aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2021-06-19 12:01:18 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2021-06-19 12:01:18 +0000
commitc0de12404986565d2a7b66569af5e09ec604ffd9 (patch)
tree007c6a23022007f52326b10a4843846b59800a00
parent05728773737deb58a10cdbe29750152c13e400bf (diff)
parent5c069a8915093a3af6bb26639a4ac8aa0db2badb (diff)
downloadgoogle-breakpad-android12-mainline-media-release.tar.gz
Change-Id: Ib9813bef7c81bcd39b9788281fa7219d68f5891a
-rw-r--r--.github/mistaken-pull-closer.yml17
-rw-r--r--.gitignore48
-rw-r--r--.travis.yml34
-rw-r--r--Android.bp95
-rw-r--r--DEPS50
-rw-r--r--LICENSE2
-rw-r--r--METADATA20
-rw-r--r--MODULE_LICENSE_BSD (renamed from inherit-review-settings-ok)0
-rw-r--r--Makefile.am872
-rw-r--r--Makefile.in4842
-rw-r--r--OWNERS1
-rw-r--r--README43
-rw-r--r--README.ANDROID4
-rw-r--r--README.md82
-rw-r--r--aclocal.m4138
-rw-r--r--android/google_breakpad/Android.mk15
-rw-r--r--android/sample_app/jni/Android.mk3
-rw-r--r--android/sample_app/jni/Application.mk1
-rw-r--r--appveyor.yml42
-rwxr-xr-xautotools/ar-lib270
-rwxr-xr-xautotools/compile2
-rwxr-xr-xautotools/config.guess188
-rwxr-xr-xautotools/config.sub97
-rwxr-xr-xautotools/depcomp2
-rwxr-xr-xautotools/install-sh366
-rwxr-xr-xautotools/missing2
-rwxr-xr-xautotools/root-test-driver3
-rwxr-xr-xautotools/test-driver15
-rwxr-xr-xconfigure1405
-rw-r--r--configure.ac122
-rw-r--r--default.xml43
-rw-r--r--docs/OWNERS1
-rw-r--r--docs/breakpad.pngbin0 -> 84153 bytes
-rw-r--r--docs/breakpad.svg1023
-rw-r--r--docs/client_design.md223
-rw-r--r--docs/contributing_to_breakpad.md35
-rw-r--r--docs/exception_handling.md128
-rw-r--r--docs/getting_started_with_breakpad.md115
-rw-r--r--docs/linux_starter_guide.md110
-rw-r--r--docs/linux_system_calls.md47
-rw-r--r--docs/mac_breakpad_starter_guide.md184
-rw-r--r--docs/mozilla_brown_bag_talk.md82
-rw-r--r--docs/processor_design.md231
-rw-r--r--docs/stack_walking.md144
-rw-r--r--docs/sym_upload_v2_protocol.md214
-rw-r--r--docs/symbol_files.md506
-rw-r--r--docs/windows_client_integration.md70
-rw-r--r--m4/ax_append_compile_flags.m467
-rw-r--r--m4/ax_append_flag.m471
-rw-r--r--m4/ax_check_compile_flag.m474
-rw-r--r--m4/ax_check_define.m492
-rw-r--r--m4/ax_cxx_compile_stdcxx.m4558
-rw-r--r--m4/ax_pthread.m42
-rw-r--r--m4/ax_require_defined.m437
-rwxr-xr-xscripts/travis-build.sh70
-rwxr-xr-xscripts/travis-checkout.sh24
-rw-r--r--src/breakpad_googletest_includes.h4
-rw-r--r--src/build/common.gypi2
-rw-r--r--src/build/testing.gyp (renamed from src/build/testing.gypi)20
-rw-r--r--src/client/ios/Breakpad.h20
-rw-r--r--src/client/ios/Breakpad.mm145
-rw-r--r--src/client/ios/Breakpad.xcodeproj/project.pbxproj18
-rw-r--r--src/client/ios/BreakpadController.h13
-rw-r--r--src/client/ios/BreakpadController.mm104
-rw-r--r--src/client/ios/exception_handler_no_mach.cc262
-rw-r--r--src/client/ios/exception_handler_no_mach.h179
-rw-r--r--src/client/ios/handler/ios_exception_minidump_generator.mm6
-rw-r--r--src/client/linux/crash_generation/crash_generation_client.cc2
-rw-r--r--src/client/linux/crash_generation/crash_generation_server.cc5
-rw-r--r--src/client/linux/dump_writer_common/mapping_info.h13
-rw-r--r--src/client/linux/dump_writer_common/raw_context_cpu.h2
-rw-r--r--src/client/linux/dump_writer_common/seccomp_unwinder.cc154
-rw-r--r--src/client/linux/dump_writer_common/thread_info.cc73
-rw-r--r--src/client/linux/dump_writer_common/thread_info.h21
-rw-r--r--src/client/linux/dump_writer_common/ucontext_reader.cc44
-rw-r--r--src/client/linux/dump_writer_common/ucontext_reader.h19
-rw-r--r--src/client/linux/handler/exception_handler.cc138
-rw-r--r--src/client/linux/handler/exception_handler.h11
-rw-r--r--src/client/linux/handler/exception_handler_unittest.cc152
-rw-r--r--src/client/linux/handler/microdump_extra_info.h (renamed from src/testing/gtest/test/production.h)41
-rw-r--r--src/client/linux/handler/minidump_descriptor.cc14
-rw-r--r--src/client/linux/handler/minidump_descriptor.h82
-rw-r--r--src/client/linux/log/log.cc38
-rw-r--r--src/client/linux/log/log.h14
-rw-r--r--src/client/linux/microdump_writer/microdump_writer.cc475
-rw-r--r--src/client/linux/microdump_writer/microdump_writer.h12
-rw-r--r--src/client/linux/microdump_writer/microdump_writer_unittest.cc350
-rw-r--r--src/client/linux/minidump_writer/linux_core_dumper.cc76
-rw-r--r--src/client/linux/minidump_writer/linux_core_dumper.h4
-rw-r--r--src/client/linux/minidump_writer/linux_core_dumper_unittest.cc80
-rw-r--r--src/client/linux/minidump_writer/linux_dumper.cc736
-rw-r--r--src/client/linux/minidump_writer/linux_dumper.h153
-rw-r--r--src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc5
-rw-r--r--src/client/linux/minidump_writer/linux_ptrace_dumper.cc93
-rw-r--r--src/client/linux/minidump_writer/linux_ptrace_dumper.h9
-rw-r--r--src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc266
-rw-r--r--src/client/linux/minidump_writer/minidump_writer.cc390
-rw-r--r--src/client/linux/minidump_writer/minidump_writer.h33
-rw-r--r--src/client/linux/minidump_writer/minidump_writer_unittest.cc266
-rw-r--r--src/client/linux/sender/google_crash_report_sender.cc3
-rw-r--r--src/client/mac/Breakpad.xcodeproj/project.pbxproj151
-rw-r--r--src/client/mac/Framework/Breakpad.mm2
-rw-r--r--src/client/mac/Framework/OnDemandServer.h2
-rw-r--r--src/client/mac/Framework/OnDemandServer.mm2
-rw-r--r--src/client/mac/crash_generation/ConfigFile.h4
-rw-r--r--src/client/mac/crash_generation/Inspector.h4
-rw-r--r--src/client/mac/handler/breakpad_nlist_64.h1
-rw-r--r--src/client/mac/handler/dynamic_images.cc8
-rw-r--r--src/client/mac/handler/exception_handler.cc9
-rw-r--r--src/client/mac/handler/minidump_generator.cc62
-rw-r--r--src/client/mac/handler/minidump_generator.h21
-rw-r--r--src/client/mac/handler/minidump_test.xcodeproj/project.pbxproj26
-rw-r--r--src/client/mac/sender/Breakpad.xib4
-rw-r--r--src/client/mac/sender/uploader.h17
-rw-r--r--src/client/mac/sender/uploader.mm76
-rw-r--r--src/client/mac/tests/exception_handler_test.cc9
-rw-r--r--src/client/mac/tests/minidump_generator_test.cc3
-rw-r--r--src/client/minidump_file_writer.cc72
-rw-r--r--src/client/minidump_file_writer_unittest.cc2
-rw-r--r--src/client/solaris/handler/Makefile7
-rw-r--r--src/client/windows/crash_generation/crash_generation_client.cc16
-rw-r--r--src/client/windows/crash_generation/crash_generation_server.cc18
-rw-r--r--src/client/windows/crash_generation/minidump_generator.cc26
-rw-r--r--src/client/windows/crash_generation/minidump_generator.h4
-rw-r--r--src/client/windows/handler/exception_handler.cc35
-rw-r--r--src/client/windows/handler/exception_handler.h6
-rw-r--r--src/client/windows/sender/crash_report_sender.cc6
-rw-r--r--src/client/windows/sender/crash_report_sender.h4
-rw-r--r--src/client/windows/tests/crash_generation_app/crash_generation_app.cc2
-rw-r--r--src/client/windows/unittests/client_tests.gyp2
-rw-r--r--src/client/windows/unittests/crash_generation_server_test.cc11
-rw-r--r--src/client/windows/unittests/dump_analysis.cc2
-rw-r--r--src/client/windows/unittests/exception_handler_death_test.cc25
-rw-r--r--src/client/windows/unittests/exception_handler_test.cc4
-rw-r--r--src/client/windows/unittests/minidump_test.cc5
-rw-r--r--src/client/windows/unittests/testing.gyp33
-rw-r--r--src/common/android/include/asm-mips/README.md9
-rw-r--r--src/common/android/include/asm-mips/asm.h270
-rw-r--r--src/common/android/include/asm-mips/fpregdef.h117
-rw-r--r--src/common/android/include/asm-mips/regdef.h125
-rw-r--r--src/common/android/include/elf.h11
-rw-r--r--src/common/android/include/link.h (renamed from src/testing/gtest/test/gtest-param-test_test.h)62
-rw-r--r--src/common/android/include/sgidefs.h6
-rw-r--r--src/common/android/include/sys/procfs.h7
-rw-r--r--src/common/android/include/sys/user.h109
-rw-r--r--src/common/android/testing/pthread_fixes.h5
-rw-r--r--src/common/common.gyp44
-rw-r--r--src/common/convert_UTF.cc (renamed from src/common/convert_UTF.c)117
-rw-r--r--src/common/convert_UTF.h11
-rw-r--r--src/common/dwarf/bytereader-inl.h75
-rw-r--r--src/common/dwarf/bytereader.cc31
-rw-r--r--src/common/dwarf/bytereader.h53
-rw-r--r--src/common/dwarf/bytereader_unittest.cc50
-rw-r--r--src/common/dwarf/cfi_assembler.cc8
-rw-r--r--src/common/dwarf/cfi_assembler.h4
-rw-r--r--src/common/dwarf/dwarf2diehandler.cc35
-rw-r--r--src/common/dwarf/dwarf2diehandler.h60
-rw-r--r--src/common/dwarf/dwarf2diehandler_unittest.cc36
-rw-r--r--src/common/dwarf/dwarf2enums.h37
-rw-r--r--src/common/dwarf/dwarf2reader.cc834
-rw-r--r--src/common/dwarf/dwarf2reader.h603
-rw-r--r--src/common/dwarf/dwarf2reader_cfi_unittest.cc216
-rw-r--r--src/common/dwarf/dwarf2reader_die_unittest.cc51
-rw-r--r--src/common/dwarf/elf_reader.cc1274
-rw-r--r--src/common/dwarf/elf_reader.h167
-rw-r--r--src/common/dwarf/functioninfo.cc38
-rw-r--r--src/common/dwarf/functioninfo.h41
-rw-r--r--src/common/dwarf/line_state_machine.h8
-rw-r--r--src/common/dwarf/types.h18
-rw-r--r--src/common/dwarf_cfi_to_module.cc20
-rw-r--r--src/common/dwarf_cfi_to_module.h22
-rw-r--r--src/common/dwarf_cfi_to_module_unittest.cc2
-rw-r--r--src/common/dwarf_cu_to_module.cc478
-rw-r--r--src/common/dwarf_cu_to_module.h75
-rw-r--r--src/common/dwarf_cu_to_module_unittest.cc141
-rw-r--r--src/common/dwarf_line_to_module.cc14
-rw-r--r--src/common/dwarf_line_to_module.h20
-rw-r--r--src/common/dwarf_range_list_handler.cc (renamed from src/client/linux/dump_writer_common/seccomp_unwinder.h)40
-rw-r--r--src/common/dwarf_range_list_handler.h (renamed from src/testing/gtest/samples/sample2.h)76
-rw-r--r--src/common/language.cc130
-rw-r--r--src/common/language.h17
-rw-r--r--src/common/linux/breakpad_getcontext.S (renamed from src/common/android/breakpad_getcontext.S)15
-rw-r--r--src/common/linux/breakpad_getcontext.h (renamed from src/testing/gtest/samples/sample4.h)41
-rw-r--r--src/common/linux/breakpad_getcontext_unittest.cc (renamed from src/common/android/breakpad_getcontext_unittest.cc)14
-rw-r--r--src/common/linux/dump_symbols.cc359
-rw-r--r--src/common/linux/dump_symbols.h17
-rw-r--r--src/common/linux/dump_symbols_unittest.cc80
-rw-r--r--src/common/linux/elf_core_dump.h9
-rw-r--r--src/common/linux/elf_core_dump_unittest.cc13
-rw-r--r--src/common/linux/elf_gnu_compat.h5
-rw-r--r--src/common/linux/elfutils.cc109
-rw-r--r--src/common/linux/elfutils.h45
-rw-r--r--src/common/linux/file_id.cc116
-rw-r--r--src/common/linux/file_id.h38
-rw-r--r--src/common/linux/file_id_unittest.cc229
-rw-r--r--src/common/linux/google_crashdump_uploader.cc15
-rw-r--r--src/common/linux/google_crashdump_uploader_test.cc2
-rw-r--r--src/common/linux/guid_creator.cc99
-rw-r--r--src/common/linux/http_upload.cc30
-rw-r--r--src/common/linux/http_upload.h12
-rw-r--r--src/common/linux/ignore_ret.h2
-rw-r--r--src/common/linux/libcurl_wrapper.cc229
-rw-r--r--src/common/linux/libcurl_wrapper.h30
-rw-r--r--src/common/linux/memory_mapped_file.cc11
-rw-r--r--src/common/linux/symbol_collector_client.cc195
-rw-r--r--src/common/linux/symbol_collector_client.h88
-rw-r--r--src/common/linux/symbol_upload.cc284
-rw-r--r--src/common/linux/symbol_upload.h (renamed from src/testing/gtest/test/gtest_list_tests_unittest_.cc)85
-rw-r--r--src/common/linux/synth_elf.cc4
-rw-r--r--src/common/linux/synth_elf.h2
-rw-r--r--src/common/linux/synth_elf_unittest.cc2
-rw-r--r--src/common/linux/tests/crash_generator.cc11
-rw-r--r--src/common/linux/ucontext_constants.h153
-rw-r--r--src/common/long_string_dictionary.cc178
-rw-r--r--src/common/long_string_dictionary.h87
-rw-r--r--src/common/long_string_dictionary_unittest.cc301
-rw-r--r--src/common/mac/Breakpad.xcconfig12
-rw-r--r--src/common/mac/GTMDefines.h2
-rw-r--r--src/common/mac/HTTPMultipartUpload.m78
-rw-r--r--src/common/mac/MachIPC.h2
-rw-r--r--src/common/mac/arch_utilities.cc179
-rw-r--r--src/common/mac/byteswap.h25
-rw-r--r--src/common/mac/dump_syms.cc (renamed from src/common/mac/dump_syms.mm)422
-rw-r--r--src/common/mac/dump_syms.h55
-rw-r--r--src/common/mac/file_id.cc3
-rw-r--r--src/common/mac/file_id.h2
-rw-r--r--src/common/mac/macho_id.cc36
-rw-r--r--src/common/mac/macho_reader.cc83
-rw-r--r--src/common/mac/macho_reader.h25
-rw-r--r--src/common/mac/macho_reader_unittest.cc30
-rw-r--r--src/common/mac/macho_utilities.cc89
-rw-r--r--src/common/mac/macho_utilities.h27
-rw-r--r--src/common/mac/macho_walker.cc28
-rw-r--r--src/common/mac/super_fat_arch.h88
-rw-r--r--src/common/mac/testing/GTMSenTestCase.m72
-rw-r--r--src/common/macros.h (renamed from src/testing/gtest/test/gtest_help_test_.cc)31
-rw-r--r--src/common/md5.cc4
-rw-r--r--src/common/memory_allocator.h (renamed from src/common/memory.h)65
-rw-r--r--src/common/memory_allocator_unittest.cc (renamed from src/common/memory_unittest.cc)29
-rw-r--r--src/common/module.cc97
-rw-r--r--src/common/module.h38
-rw-r--r--src/common/module_unittest.cc210
-rw-r--r--src/common/path_helper.cc (renamed from src/testing/gtest/samples/sample4.cc)33
-rw-r--r--src/common/path_helper.h (renamed from src/testing/gtest/test/gtest_main_unittest.cc)23
-rw-r--r--src/common/simple_string_dictionary.h81
-rw-r--r--src/common/simple_string_dictionary_unittest.cc31
-rw-r--r--src/common/solaris/guid_creator.cc2
-rw-r--r--src/common/stabs_reader.h5
-rw-r--r--src/common/stabs_to_module.cc10
-rw-r--r--src/common/stabs_to_module_unittest.cc8
-rw-r--r--src/common/stdio_wrapper.h (renamed from src/testing/gtest/src/gtest_main.cc)19
-rw-r--r--src/common/string_conversion.cc10
-rw-r--r--src/common/string_conversion_unittest.cc (renamed from src/testing/gtest/test/gtest_sole_header_test.cc)51
-rw-r--r--src/common/unordered.h4
-rw-r--r--src/common/windows/common_windows.gyp7
-rw-r--r--src/common/windows/http_upload.cc706
-rw-r--r--src/common/windows/http_upload.h105
-rw-r--r--src/common/windows/module_info.h75
-rw-r--r--src/common/windows/omap.cc26
-rw-r--r--src/common/windows/omap_internal.h3
-rw-r--r--src/common/windows/omap_unittest.cc3
-rw-r--r--src/common/windows/pdb_source_line_writer.cc513
-rw-r--r--src/common/windows/pdb_source_line_writer.h65
-rw-r--r--src/common/windows/pe_source_line_writer.cc (renamed from src/testing/gtest/test/gtest_color_test_.cc)148
-rw-r--r--src/common/windows/pe_source_line_writer.h (renamed from src/testing/gtest/xcode/Samples/FrameworkSample/widget_test.cc)137
-rw-r--r--src/common/windows/pe_util.cc407
-rw-r--r--src/common/windows/pe_util.h78
-rw-r--r--src/common/windows/symbol_collector_client.cc155
-rw-r--r--src/common/windows/symbol_collector_client.h89
-rw-r--r--src/config.h.in18
-rw-r--r--src/google_breakpad/common/breakpad_types.h28
-rw-r--r--src/google_breakpad/common/minidump_cpu_arm64.h80
-rw-r--r--src/google_breakpad/common/minidump_cpu_mips.h38
-rw-r--r--src/google_breakpad/common/minidump_cpu_ppc.h5
-rw-r--r--src/google_breakpad/common/minidump_cpu_ppc64.h5
-rw-r--r--src/google_breakpad/common/minidump_cpu_sparc.h5
-rw-r--r--src/google_breakpad/common/minidump_exception_fuchsia.h58
-rw-r--r--src/google_breakpad/common/minidump_exception_linux.h38
-rw-r--r--src/google_breakpad/common/minidump_exception_mac.h8
-rw-r--r--src/google_breakpad/common/minidump_exception_win32.h10
-rw-r--r--src/google_breakpad/common/minidump_format.h152
-rw-r--r--src/google_breakpad/common/minidump_size.h6
-rw-r--r--src/google_breakpad/processor/basic_source_line_resolver.h20
-rw-r--r--src/google_breakpad/processor/call_stack.h12
-rw-r--r--src/google_breakpad/processor/code_module.h12
-rw-r--r--src/google_breakpad/processor/code_modules.h10
-rw-r--r--src/google_breakpad/processor/dump_context.h4
-rw-r--r--src/google_breakpad/processor/exception_record.h124
-rw-r--r--src/google_breakpad/processor/exploitability.h9
-rw-r--r--src/google_breakpad/processor/microdump.h11
-rw-r--r--src/google_breakpad/processor/microdump_processor.h5
-rw-r--r--src/google_breakpad/processor/minidump.h349
-rw-r--r--src/google_breakpad/processor/minidump_processor.h6
-rw-r--r--src/google_breakpad/processor/proc_maps_linux.h60
-rw-r--r--src/google_breakpad/processor/process_state.h25
-rw-r--r--src/google_breakpad/processor/stack_frame.h2
-rw-r--r--src/google_breakpad/processor/stack_frame_symbolizer.h8
-rw-r--r--src/google_breakpad/processor/stackwalker.h24
-rw-r--r--src/google_breakpad/processor/system_info.h10
-rw-r--r--src/processor/basic_code_module.h40
-rw-r--r--src/processor/basic_code_modules.cc64
-rw-r--r--src/processor/basic_code_modules.h19
-rw-r--r--src/processor/basic_source_line_resolver.cc104
-rw-r--r--src/processor/basic_source_line_resolver_types.h12
-rw-r--r--src/processor/basic_source_line_resolver_unittest.cc154
-rw-r--r--src/processor/binarystream.cc124
-rw-r--r--src/processor/binarystream.h92
-rw-r--r--src/processor/binarystream_unittest.cc432
-rw-r--r--src/processor/call_stack.cc1
-rw-r--r--src/processor/cfi_frame_info.cc2
-rw-r--r--src/processor/cfi_frame_info.h2
-rw-r--r--src/processor/convert_old_arm64_context.cc (renamed from src/testing/gtest/samples/sample2.cc)53
-rw-r--r--src/processor/convert_old_arm64_context.h (renamed from src/testing/gtest/samples/sample1.h)21
-rw-r--r--src/processor/disassembler_x86.cc1
-rw-r--r--src/processor/dump_context.cc74
-rw-r--r--src/processor/exploitability.cc12
-rw-r--r--src/processor/exploitability_linux.cc550
-rw-r--r--src/processor/exploitability_linux.h74
-rw-r--r--src/processor/exploitability_unittest.cc191
-rw-r--r--src/processor/exploitability_win.cc20
-rw-r--r--src/processor/fast_source_line_resolver_unittest.cc5
-rw-r--r--src/processor/logging.cc9
-rw-r--r--src/processor/logging.h16
-rw-r--r--src/processor/microdump.cc135
-rw-r--r--src/processor/microdump_processor.cc21
-rw-r--r--src/processor/microdump_processor_unittest.cc124
-rw-r--r--src/processor/microdump_stackwalk.cc128
-rwxr-xr-xsrc/processor/microdump_stackwalk_machine_readable_test2
-rwxr-xr-xsrc/processor/microdump_stackwalk_test2
-rw-r--r--src/processor/minidump.cc1626
-rw-r--r--src/processor/minidump_dump.cc80
-rw-r--r--src/processor/minidump_processor.cc305
-rw-r--r--src/processor/minidump_processor_unittest.cc141
-rw-r--r--src/processor/minidump_stackwalk.cc137
-rw-r--r--src/processor/minidump_unittest.cc406
-rw-r--r--src/processor/proc_maps_linux.cc106
-rw-r--r--src/processor/proc_maps_linux_unittest.cc251
-rw-r--r--src/processor/process_state.cc2
-rw-r--r--src/processor/processor.gyp14
-rw-r--r--src/processor/proto/README2
-rw-r--r--src/processor/range_map-inl.h153
-rw-r--r--src/processor/range_map.h77
-rw-r--r--src/processor/range_map_truncate_lower_unittest.cc346
-rw-r--r--src/processor/range_map_truncate_upper_unittest.cc354
-rw-r--r--src/processor/range_map_unittest.cc13
-rw-r--r--src/processor/source_line_resolver_base_types.h17
-rw-r--r--src/processor/stack_frame_symbolizer.cc11
-rw-r--r--src/processor/stackwalk_common.cc33
-rw-r--r--src/processor/stackwalker.cc60
-rw-r--r--src/processor/stackwalker_amd64.cc41
-rw-r--r--src/processor/stackwalker_amd64_unittest.cc339
-rw-r--r--src/processor/stackwalker_arm.cc29
-rw-r--r--src/processor/stackwalker_arm64.cc81
-rw-r--r--src/processor/stackwalker_arm64.h14
-rw-r--r--src/processor/stackwalker_arm64_unittest.cc3
-rw-r--r--src/processor/stackwalker_arm_unittest.cc11
-rw-r--r--src/processor/stackwalker_mips.cc412
-rw-r--r--src/processor/stackwalker_mips64_unittest.cc716
-rw-r--r--src/processor/stackwalker_mips_unittest.cc13
-rw-r--r--src/processor/stackwalker_ppc.cc13
-rw-r--r--src/processor/stackwalker_ppc64.cc13
-rw-r--r--src/processor/stackwalker_sparc.cc8
-rw-r--r--src/processor/stackwalker_unittest_utils.h21
-rw-r--r--src/processor/stackwalker_x86.cc32
-rw-r--r--src/processor/stackwalker_x86_unittest.cc148
-rw-r--r--src/processor/static_map_unittest.cc2
-rw-r--r--src/processor/symbolic_constants_win.cc8
-rw-r--r--src/processor/symbolic_constants_win.h3
-rw-r--r--src/processor/synth_minidump.cc42
-rw-r--r--src/processor/synth_minidump.h26
-rw-r--r--src/processor/testdata/linux_divide_by_zero.dmpbin0 -> 38760 bytes
-rw-r--r--src/processor/testdata/linux_executable_heap.dmpbin0 -> 38761 bytes
-rw-r--r--src/processor/testdata/linux_executable_stack.dmpbin0 -> 38794 bytes
-rw-r--r--src/processor/testdata/linux_inside_module_exe_region1.dmpbin0 -> 56256 bytes
-rw-r--r--src/processor/testdata/linux_inside_module_exe_region2.dmpbin0 -> 48600 bytes
-rw-r--r--src/processor/testdata/linux_jmp_to_0.dmpbin0 -> 38544 bytes
-rw-r--r--src/processor/testdata/linux_jmp_to_module_not_exe_region.dmpbin0 -> 44936 bytes
-rw-r--r--src/processor/testdata/linux_null_dereference.dmpbin0 -> 38760 bytes
-rw-r--r--src/processor/testdata/linux_outside_module.dmpbin0 -> 44600 bytes
-rw-r--r--src/processor/testdata/linux_raise_sigabrt.dmpbin0 -> 52424 bytes
-rw-r--r--src/processor/testdata/linux_stack_pointer_in_module.dmpbin0 -> 38761 bytes
-rw-r--r--src/processor/testdata/linux_stack_pointer_in_stack.dmpbin0 -> 38761 bytes
-rw-r--r--src/processor/testdata/linux_stack_pointer_in_stack_alt_name.dmpbin0 -> 38761 bytes
-rw-r--r--src/processor/testdata/linux_write_to_nonwritable_module.dmpbin0 -> 44944 bytes
-rw-r--r--src/processor/testdata/linux_write_to_nonwritable_region_math.dmpbin0 -> 40848 bytes
-rw-r--r--src/processor/testdata/linux_write_to_outside_module.dmpbin0 -> 44944 bytes
-rw-r--r--src/processor/testdata/linux_write_to_outside_module_via_math.dmpbin0 -> 44944 bytes
-rw-r--r--src/processor/testdata/linux_write_to_under_4k.dmpbin0 -> 44944 bytes
-rw-r--r--src/processor/testdata/microdump-arm.dmp1
-rw-r--r--src/processor/testdata/microdump-mips32.dmp37
-rw-r--r--src/processor/testdata/microdump-mips64.dmp26
-rw-r--r--src/processor/testdata/microdump-multiple.dmp197
-rw-r--r--src/processor/testdata/microdump-withcrashreason.dmp1422
-rw-r--r--src/processor/testdata/microdump-x86.dmp174
-rw-r--r--src/processor/testdata/microdump.stackwalk-arm.out39
-rw-r--r--src/processor/testdata/microdump.stackwalk-arm64.out86
-rw-r--r--src/processor/testdata/microdump.stackwalk.machine_readable-arm.out3
-rw-r--r--src/processor/testdata/microdump.stackwalk.machine_readable-arm64.out3
-rw-r--r--src/processor/testdata/minidump2.stackwalk.machine_readable.out1
-rw-r--r--src/processor/testdata/minidump2.stackwalk.out2
-rw-r--r--src/processor/testdata/minidump_32bit_crash_addr.dmpbin0 -> 11317 bytes
-rw-r--r--src/processor/testdata/symbols/microdump/crash_example/6E72E2F1A5F59AB3D51356FDFE394D490/crash_example.sym56
-rw-r--r--src/processor/testdata/symbols/microdump/crash_example/8F36148CC4647A8116CAF2A25F591F570/crash_example.sym48
-rw-r--r--src/processor/tokenize.cc2
-rw-r--r--src/processor/windows_frame_info.h2
-rw-r--r--src/testing/CHANGES92
-rw-r--r--src/testing/CMakeLists.txt170
-rw-r--r--src/testing/CONTRIBUTORS40
-rw-r--r--src/testing/LICENSE28
-rw-r--r--src/testing/Makefile.am213
-rw-r--r--src/testing/README361
-rw-r--r--src/testing/build-aux/.keep0
-rw-r--r--src/testing/configure.ac146
-rw-r--r--src/testing/gtest/CHANGES130
-rw-r--r--src/testing/gtest/CMakeLists.txt250
-rw-r--r--src/testing/gtest/CONTRIBUTORS37
-rw-r--r--src/testing/gtest/LICENSE28
-rw-r--r--src/testing/gtest/Makefile.am304
-rw-r--r--src/testing/gtest/README434
-rw-r--r--src/testing/gtest/build-aux/.keep0
-rw-r--r--src/testing/gtest/cmake/internal_utils.cmake227
-rw-r--r--src/testing/gtest/codegear/gtest.cbproj138
-rw-r--r--src/testing/gtest/codegear/gtest.groupproj54
-rw-r--r--src/testing/gtest/codegear/gtest_all.cc38
-rw-r--r--src/testing/gtest/codegear/gtest_link.cc40
-rw-r--r--src/testing/gtest/codegear/gtest_main.cbproj82
-rw-r--r--src/testing/gtest/codegear/gtest_unittest.cbproj88
-rw-r--r--src/testing/gtest/configure.ac68
-rw-r--r--src/testing/gtest/include/gtest/gtest-death-test.h294
-rw-r--r--src/testing/gtest/include/gtest/gtest-message.h230
-rw-r--r--src/testing/gtest/include/gtest/gtest-param-test.h1421
-rw-r--r--src/testing/gtest/include/gtest/gtest-param-test.h.pump487
-rw-r--r--src/testing/gtest/include/gtest/gtest-printers.h799
-rw-r--r--src/testing/gtest/include/gtest/gtest-spi.h232
-rw-r--r--src/testing/gtest/include/gtest/gtest-test-part.h177
-rw-r--r--src/testing/gtest/include/gtest/gtest-typed-test.h259
-rw-r--r--src/testing/gtest/include/gtest/gtest.h2159
-rw-r--r--src/testing/gtest/include/gtest/gtest_pred_impl.h358
-rw-r--r--src/testing/gtest/include/gtest/gtest_prod.h58
-rw-r--r--src/testing/gtest/include/gtest/internal/gtest-death-test-internal.h319
-rw-r--r--src/testing/gtest/include/gtest/internal/gtest-filepath.h210
-rw-r--r--src/testing/gtest/include/gtest/internal/gtest-internal.h1232
-rw-r--r--src/testing/gtest/include/gtest/internal/gtest-linked_ptr.h233
-rw-r--r--src/testing/gtest/include/gtest/internal/gtest-param-util-generated.h5143
-rw-r--r--src/testing/gtest/include/gtest/internal/gtest-param-util-generated.h.pump301
-rw-r--r--src/testing/gtest/include/gtest/internal/gtest-param-util.h619
-rw-r--r--src/testing/gtest/include/gtest/internal/gtest-port.h1851
-rw-r--r--src/testing/gtest/include/gtest/internal/gtest-string.h350
-rw-r--r--src/testing/gtest/include/gtest/internal/gtest-tuple.h1012
-rw-r--r--src/testing/gtest/include/gtest/internal/gtest-tuple.h.pump339
-rw-r--r--src/testing/gtest/include/gtest/internal/gtest-type-util.h3332
-rw-r--r--src/testing/gtest/include/gtest/internal/gtest-type-util.h.pump298
-rw-r--r--src/testing/gtest/m4/acx_pthread.m4363
-rw-r--r--src/testing/gtest/m4/gtest.m474
-rw-r--r--src/testing/gtest/make/Makefile80
-rw-r--r--src/testing/gtest/msvc/gtest-md.sln45
-rw-r--r--src/testing/gtest/msvc/gtest-md.vcproj126
-rw-r--r--src/testing/gtest/msvc/gtest.sln45
-rw-r--r--src/testing/gtest/msvc/gtest.vcproj126
-rw-r--r--src/testing/gtest/msvc/gtest_main-md.vcproj129
-rw-r--r--src/testing/gtest/msvc/gtest_main.vcproj129
-rw-r--r--src/testing/gtest/msvc/gtest_prod_test-md.vcproj164
-rw-r--r--src/testing/gtest/msvc/gtest_prod_test.vcproj164
-rw-r--r--src/testing/gtest/msvc/gtest_unittest-md.vcproj147
-rw-r--r--src/testing/gtest/msvc/gtest_unittest.vcproj147
-rw-r--r--src/testing/gtest/samples/prime_tables.h123
-rw-r--r--src/testing/gtest/samples/sample10_unittest.cc144
-rw-r--r--src/testing/gtest/samples/sample1_unittest.cc153
-rw-r--r--src/testing/gtest/samples/sample2_unittest.cc109
-rw-r--r--src/testing/gtest/samples/sample3-inl.h172
-rw-r--r--src/testing/gtest/samples/sample3_unittest.cc151
-rw-r--r--src/testing/gtest/samples/sample4_unittest.cc45
-rw-r--r--src/testing/gtest/samples/sample5_unittest.cc199
-rw-r--r--src/testing/gtest/samples/sample6_unittest.cc224
-rw-r--r--src/testing/gtest/samples/sample7_unittest.cc130
-rw-r--r--src/testing/gtest/samples/sample8_unittest.cc173
-rw-r--r--src/testing/gtest/samples/sample9_unittest.cc160
-rwxr-xr-xsrc/testing/gtest/scripts/fuse_gtest_files.py250
-rwxr-xr-xsrc/testing/gtest/scripts/gen_gtest_pred_impl.py730
-rwxr-xr-xsrc/testing/gtest/scripts/gtest-config.in274
-rwxr-xr-xsrc/testing/gtest/scripts/pump.py847
-rw-r--r--src/testing/gtest/scripts/test/Makefile59
-rwxr-xr-xsrc/testing/gtest/scripts/upload.py1387
-rwxr-xr-xsrc/testing/gtest/scripts/upload_gtest.py78
-rw-r--r--src/testing/gtest/src/gtest-all.cc48
-rw-r--r--src/testing/gtest/src/gtest-death-test.cc1337
-rw-r--r--src/testing/gtest/src/gtest-filepath.cc380
-rw-r--r--src/testing/gtest/src/gtest-internal-inl.h1056
-rw-r--r--src/testing/gtest/src/gtest-port.cc787
-rw-r--r--src/testing/gtest/src/gtest-printers.cc348
-rw-r--r--src/testing/gtest/src/gtest-test-part.cc110
-rw-r--r--src/testing/gtest/src/gtest-typed-test.cc110
-rw-r--r--src/testing/gtest/src/gtest.cc4930
-rw-r--r--src/testing/gtest/test/gtest-death-test_ex_test.cc93
-rw-r--r--src/testing/gtest/test/gtest-death-test_test.cc1370
-rw-r--r--src/testing/gtest/test/gtest-filepath_test.cc696
-rw-r--r--src/testing/gtest/test/gtest-linked_ptr_test.cc154
-rw-r--r--src/testing/gtest/test/gtest-listener_test.cc313
-rw-r--r--src/testing/gtest/test/gtest-message_test.cc166
-rw-r--r--src/testing/gtest/test/gtest-options_test.cc212
-rw-r--r--src/testing/gtest/test/gtest-param-test2_test.cc65
-rw-r--r--src/testing/gtest/test/gtest-param-test_test.cc897
-rw-r--r--src/testing/gtest/test/gtest-port_test.cc1214
-rw-r--r--src/testing/gtest/test/gtest-printers_test.cc1311
-rw-r--r--src/testing/gtest/test/gtest-test-part_test.cc208
-rw-r--r--src/testing/gtest/test/gtest-tuple_test.cc320
-rw-r--r--src/testing/gtest/test/gtest-typed-test_test.cc360
-rw-r--r--src/testing/gtest/test/gtest-typed-test_test.h66
-rw-r--r--src/testing/gtest/test/gtest-unittest-api_test.cc341
-rw-r--r--src/testing/gtest/test/gtest_all_test.cc47
-rwxr-xr-xsrc/testing/gtest/test/gtest_break_on_failure_unittest.py218
-rw-r--r--src/testing/gtest/test/gtest_break_on_failure_unittest_.cc88
-rwxr-xr-xsrc/testing/gtest/test/gtest_catch_exceptions_test.py223
-rw-r--r--src/testing/gtest/test/gtest_catch_exceptions_test_.cc311
-rwxr-xr-xsrc/testing/gtest/test/gtest_color_test.py130
-rwxr-xr-xsrc/testing/gtest/test/gtest_env_var_test.py104
-rw-r--r--src/testing/gtest/test/gtest_env_var_test_.cc126
-rw-r--r--src/testing/gtest/test/gtest_environment_test.cc192
-rwxr-xr-xsrc/testing/gtest/test/gtest_filter_unittest.py633
-rw-r--r--src/testing/gtest/test/gtest_filter_unittest_.cc140
-rwxr-xr-xsrc/testing/gtest/test/gtest_help_test.py172
-rwxr-xr-xsrc/testing/gtest/test/gtest_list_tests_unittest.py177
-rw-r--r--src/testing/gtest/test/gtest_no_test_unittest.cc56
-rwxr-xr-xsrc/testing/gtest/test/gtest_output_test.py335
-rw-r--r--src/testing/gtest/test/gtest_output_test_.cc1021
-rw-r--r--src/testing/gtest/test/gtest_output_test_golden_lin.txt711
-rw-r--r--src/testing/gtest/test/gtest_pred_impl_unittest.cc2427
-rw-r--r--src/testing/gtest/test/gtest_prod_test.cc57
-rw-r--r--src/testing/gtest/test/gtest_repeat_test.cc253
-rwxr-xr-xsrc/testing/gtest/test/gtest_shuffle_test.py326
-rw-r--r--src/testing/gtest/test/gtest_shuffle_test_.cc104
-rw-r--r--src/testing/gtest/test/gtest_stress_test.cc257
-rwxr-xr-xsrc/testing/gtest/test/gtest_test_utils.py305
-rw-r--r--src/testing/gtest/test/gtest_throw_on_failure_ex_test.cc92
-rwxr-xr-xsrc/testing/gtest/test/gtest_throw_on_failure_test.py171
-rw-r--r--src/testing/gtest/test/gtest_throw_on_failure_test_.cc72
-rw-r--r--src/testing/gtest/test/gtest_uninitialized_test_.cc43
-rw-r--r--src/testing/gtest/test/gtest_unittest.cc7557
-rw-r--r--src/testing/gtest/test/gtest_xml_outfile1_test_.cc49
-rw-r--r--src/testing/gtest/test/gtest_xml_outfile2_test_.cc49
-rwxr-xr-xsrc/testing/gtest/test/gtest_xml_outfiles_test.py132
-rwxr-xr-xsrc/testing/gtest/test/gtest_xml_output_unittest.py284
-rw-r--r--src/testing/gtest/test/gtest_xml_output_unittest_.cc177
-rwxr-xr-xsrc/testing/gtest/test/gtest_xml_test_utils.py190
-rw-r--r--src/testing/gtest/xcode/Config/DebugProject.xcconfig30
-rw-r--r--src/testing/gtest/xcode/Config/FrameworkTarget.xcconfig17
-rw-r--r--src/testing/gtest/xcode/Config/General.xcconfig41
-rw-r--r--src/testing/gtest/xcode/Config/ReleaseProject.xcconfig32
-rw-r--r--src/testing/gtest/xcode/Config/StaticLibraryTarget.xcconfig18
-rw-r--r--src/testing/gtest/xcode/Config/TestTarget.xcconfig8
-rw-r--r--src/testing/gtest/xcode/Resources/Info.plist30
-rw-r--r--src/testing/gtest/xcode/Samples/FrameworkSample/Info.plist28
-rw-r--r--src/testing/gtest/xcode/Samples/FrameworkSample/WidgetFramework.xcodeproj/project.pbxproj457
-rw-r--r--src/testing/gtest/xcode/Samples/FrameworkSample/widget.cc63
-rw-r--r--src/testing/gtest/xcode/Scripts/runtests.sh65
-rw-r--r--src/testing/gtest/xcode/Scripts/versiongenerate.py100
-rw-r--r--src/testing/gtest/xcode/gtest.xcodeproj/project.pbxproj1084
-rw-r--r--src/testing/include/gmock/gmock-actions.h1078
-rw-r--r--src/testing/include/gmock/gmock-cardinalities.h147
-rw-r--r--src/testing/include/gmock/gmock-generated-actions.h2415
-rw-r--r--src/testing/include/gmock/gmock-generated-actions.h.pump821
-rw-r--r--src/testing/include/gmock/gmock-generated-function-mockers.h929
-rw-r--r--src/testing/include/gmock/gmock-generated-function-mockers.h.pump258
-rw-r--r--src/testing/include/gmock/gmock-generated-matchers.h2210
-rw-r--r--src/testing/include/gmock/gmock-generated-matchers.h.pump705
-rw-r--r--src/testing/include/gmock/gmock-generated-nice-strict.h274
-rw-r--r--src/testing/include/gmock/gmock-generated-nice-strict.h.pump160
-rw-r--r--src/testing/include/gmock/gmock-matchers.h3207
-rw-r--r--src/testing/include/gmock/gmock-more-actions.h233
-rw-r--r--src/testing/include/gmock/gmock-spec-builders.h1774
-rw-r--r--src/testing/include/gmock/gmock.h93
-rw-r--r--src/testing/include/gmock/internal/gmock-generated-internal-utils.h279
-rw-r--r--src/testing/include/gmock/internal/gmock-generated-internal-utils.h.pump136
-rw-r--r--src/testing/include/gmock/internal/gmock-internal-utils.h471
-rw-r--r--src/testing/include/gmock/internal/gmock-port.h78
-rw-r--r--src/testing/make/Makefile98
-rw-r--r--src/testing/msvc/2005/gmock.sln32
-rw-r--r--src/testing/msvc/2005/gmock.vcproj191
-rw-r--r--src/testing/msvc/2005/gmock_config.vsprops15
-rw-r--r--src/testing/msvc/2005/gmock_main.vcproj187
-rw-r--r--src/testing/msvc/2005/gmock_test.vcproj201
-rw-r--r--src/testing/msvc/2010/gmock.sln32
-rw-r--r--src/testing/msvc/2010/gmock.vcxproj82
-rw-r--r--src/testing/msvc/2010/gmock_config.props19
-rw-r--r--src/testing/msvc/2010/gmock_main.vcxproj88
-rw-r--r--src/testing/msvc/2010/gmock_test.vcxproj101
-rwxr-xr-xsrc/testing/scripts/fuse_gmock_files.py240
-rw-r--r--src/testing/scripts/generator/LICENSE203
-rw-r--r--src/testing/scripts/generator/README35
-rw-r--r--src/testing/scripts/generator/README.cppclean115
-rwxr-xr-xsrc/testing/scripts/generator/cpp/__init__.py0
-rwxr-xr-xsrc/testing/scripts/generator/cpp/ast.py1723
-rwxr-xr-xsrc/testing/scripts/generator/cpp/gmock_class.py208
-rwxr-xr-xsrc/testing/scripts/generator/cpp/gmock_class_test.py259
-rwxr-xr-xsrc/testing/scripts/generator/cpp/keywords.py59
-rwxr-xr-xsrc/testing/scripts/generator/cpp/tokenize.py287
-rwxr-xr-xsrc/testing/scripts/generator/cpp/utils.py41
-rwxr-xr-xsrc/testing/scripts/generator/gmock_gen.py31
-rwxr-xr-xsrc/testing/scripts/gmock-config.in303
-rwxr-xr-xsrc/testing/scripts/gmock_doctor.py631
-rwxr-xr-xsrc/testing/scripts/upload.py1387
-rwxr-xr-xsrc/testing/scripts/upload_gmock.py78
-rw-r--r--src/testing/src/gmock-all.cc47
-rw-r--r--src/testing/src/gmock-cardinalities.cc156
-rw-r--r--src/testing/src/gmock-internal-utils.cc174
-rw-r--r--src/testing/src/gmock-matchers.cc102
-rw-r--r--src/testing/src/gmock-spec-builders.cc813
-rw-r--r--src/testing/src/gmock.cc182
-rw-r--r--src/testing/src/gmock_main.cc54
-rw-r--r--src/testing/test/gmock-actions_test.cc1308
-rw-r--r--src/testing/test/gmock-cardinalities_test.cc428
-rw-r--r--src/testing/test/gmock-generated-actions_test.cc1212
-rw-r--r--src/testing/test/gmock-generated-function-mockers_test.cc540
-rw-r--r--src/testing/test/gmock-generated-internal-utils_test.cc127
-rw-r--r--src/testing/test/gmock-generated-matchers_test.cc1141
-rw-r--r--src/testing/test/gmock-internal-utils_test.cc655
-rw-r--r--src/testing/test/gmock-matchers_test.cc4197
-rw-r--r--src/testing/test/gmock-more-actions_test.cc705
-rw-r--r--src/testing/test/gmock-nice-strict_test.cc284
-rw-r--r--src/testing/test/gmock-port_test.cc43
-rw-r--r--src/testing/test/gmock-spec-builders_test.cc2535
-rw-r--r--src/testing/test/gmock_all_test.cc48
-rwxr-xr-xsrc/testing/test/gmock_leak_test.py90
-rw-r--r--src/testing/test/gmock_leak_test_.cc100
-rw-r--r--src/testing/test/gmock_link2_test.cc40
-rw-r--r--src/testing/test/gmock_link_test.cc40
-rw-r--r--src/testing/test/gmock_link_test.h669
-rwxr-xr-xsrc/testing/test/gmock_output_test.py180
-rw-r--r--src/testing/test/gmock_output_test_.cc290
-rw-r--r--src/testing/test/gmock_output_test_golden.txt310
-rw-r--r--src/testing/test/gmock_stress_test.cc322
-rw-r--r--src/testing/test/gmock_test.cc255
-rwxr-xr-xsrc/testing/test/gmock_test_utils.py111
-rw-r--r--src/third_party/curl/curlbuild.h3
-rw-r--r--src/third_party/libdisasm/LICENSE137
-rw-r--r--src/third_party/libdisasm/README.breakpad9
-rw-r--r--src/third_party/libdisasm/libdis.h4
-rw-r--r--src/third_party/libdisasm/libdisasm.gyp3
-rw-r--r--src/third_party/libdisasm/x86_disasm.c6
-rw-r--r--src/third_party/linux/include/gflags/gflags.h533
-rw-r--r--src/third_party/linux/lib/gflags/libgflags.abin390804 -> 0 bytes
-rw-r--r--src/third_party/linux/lib/glog/libglog.abin226928 -> 0 bytes
-rw-r--r--src/third_party/lss/linux_syscall_support.h1051
-rw-r--r--src/third_party/mac_headers/README2
-rw-r--r--src/third_party/mac_headers/architecture/byte_order.h45
-rw-r--r--src/third_party/mac_headers/i386/_types.h34
-rw-r--r--src/third_party/mac_headers/mach-o/arch.h105
-rw-r--r--src/third_party/mac_headers/mach-o/fat.h64
-rw-r--r--src/third_party/mac_headers/mach-o/loader.h1402
-rw-r--r--src/third_party/mac_headers/mach-o/nlist.h312
-rw-r--r--src/third_party/mac_headers/mach/boolean.h88
-rw-r--r--src/third_party/mac_headers/mach/i386/boolean.h74
-rw-r--r--src/third_party/mac_headers/mach/i386/vm_param.h157
-rw-r--r--src/third_party/mac_headers/mach/i386/vm_types.h140
-rw-r--r--src/third_party/mac_headers/mach/machine.h347
-rw-r--r--src/third_party/mac_headers/mach/machine/boolean.h40
-rw-r--r--src/third_party/mac_headers/mach/machine/thread_state.h9
-rw-r--r--src/third_party/mac_headers/mach/machine/thread_status.h1
-rw-r--r--src/third_party/mac_headers/mach/machine/vm_types.h40
-rw-r--r--src/third_party/mac_headers/mach/thread_status.h94
-rw-r--r--src/third_party/mac_headers/mach/vm_prot.h140
-rw-r--r--src/third_party/musl/COPYRIGHT163
-rw-r--r--src/third_party/musl/README23
-rw-r--r--src/third_party/musl/README.breakpad3
-rw-r--r--src/third_party/musl/VERSION1
-rw-r--r--src/third_party/musl/include/elf.h2827
-rw-r--r--src/tools/linux/core2md/core2md.cc2
-rw-r--r--src/tools/linux/dump_syms/dump_syms.cc66
-rw-r--r--src/tools/linux/md2core/minidump-2-core.cc516
-rw-r--r--src/tools/linux/symupload/minidump_upload.cc6
-rw-r--r--src/tools/linux/symupload/sym_upload.cc227
-rw-r--r--src/tools/linux/tools_linux.gypi2
-rw-r--r--src/tools/mac/crash_report/crash_report.xcodeproj/project.pbxproj39
-rw-r--r--src/tools/mac/crash_report/on_demand_symbol_supplier.mm8
-rw-r--r--src/tools/mac/dump_syms/dump_syms.xcodeproj/project.pbxproj272
-rw-r--r--src/tools/mac/dump_syms/dump_syms_tool.cc (renamed from src/tools/mac/dump_syms/dump_syms_tool.mm)43
-rw-r--r--src/tools/mac/dump_syms/macho_dump.cc14
-rw-r--r--src/tools/mac/symupload/minidump_upload.m4
-rw-r--r--src/tools/mac/symupload/symupload.m30
-rw-r--r--src/tools/mac/tools_mac.gypi2
-rw-r--r--src/tools/mac/upload_system_symbols/arch_constants.h6
-rw-r--r--src/tools/mac/upload_system_symbols/arch_reader.go10
-rw-r--r--src/tools/mac/upload_system_symbols/upload_system_symbols.go36
-rwxr-xr-xsrc/tools/python/deps-to-manifest.py167
-rw-r--r--src/tools/python/filter_syms.py2
-rw-r--r--src/tools/windows/binaries/dump_syms.exebin130048 -> 141824 bytes
-rw-r--r--src/tools/windows/binaries/symupload.exebin195072 -> 243712 bytes
-rw-r--r--src/tools/windows/converter/ms_symbol_server_converter.cc210
-rw-r--r--src/tools/windows/converter/ms_symbol_server_converter.h16
-rw-r--r--src/tools/windows/converter_exe/configure.cmd33
-rw-r--r--src/tools/windows/converter_exe/converter.cc807
-rw-r--r--[-rwxr-xr-x]src/tools/windows/converter_exe/converter.gyp (renamed from src/testing/gtest/test/gtest_uninitialized_test.py)73
-rw-r--r--src/tools/windows/converter_exe/escaping.cc757
-rw-r--r--src/tools/windows/converter_exe/escaping.h99
-rw-r--r--src/tools/windows/converter_exe/http_client.h96
-rw-r--r--src/tools/windows/converter_exe/http_download.cc326
-rw-r--r--src/tools/windows/converter_exe/http_download.h (renamed from src/testing/gtest/xcode/Samples/FrameworkSample/widget.h)121
-rw-r--r--src/tools/windows/converter_exe/missing_symbols_test.txt5
-rw-r--r--src/tools/windows/converter_exe/symsrv.yes2
-rw-r--r--src/tools/windows/converter_exe/tokenizer.cc (renamed from src/testing/gtest/samples/sample1.cc)129
-rw-r--r--src/tools/windows/converter_exe/tokenizer.h (renamed from src/testing/gtest/test/gtest-typed-test2_test.cc)96
-rw-r--r--src/tools/windows/converter_exe/winhttp_client.cc307
-rw-r--r--src/tools/windows/converter_exe/winhttp_client.h (renamed from src/testing/gtest/test/production.cc)76
-rw-r--r--src/tools/windows/converter_exe/wininet_client.cc278
-rw-r--r--src/tools/windows/converter_exe/wininet_client.h (renamed from src/common/android/include/sys/signal.h)75
-rw-r--r--src/tools/windows/converter_exe/winsymconv.cmd86
-rw-r--r--src/tools/windows/converter_exe/winsymconv_test.cmd72
-rw-r--r--src/tools/windows/dump_syms/dump_syms.cc34
-rw-r--r--src/tools/windows/dump_syms/dump_syms_unittest.cc80
-rw-r--r--src/tools/windows/dump_syms/testdata/dump_syms_regtest.cc6
-rw-r--r--src/tools/windows/dump_syms/testdata/dump_syms_regtest.sym5890
-rwxr-xr-xsrc/tools/windows/dump_syms/testdata/dump_syms_regtest64.exebin0 -> 84992 bytes
-rw-r--r--src/tools/windows/dump_syms/testdata/dump_syms_regtest64.pdbbin1010688 -> 1010688 bytes
-rw-r--r--src/tools/windows/dump_syms/testdata/dump_syms_regtest64.sym82
-rw-r--r--src/tools/windows/dump_syms/testdata/omap_reorder_bbs.sym419
-rw-r--r--src/tools/windows/dump_syms/testdata/omap_reorder_funcs.sym34
-rw-r--r--src/tools/windows/dump_syms/testdata/omap_stretched.sym46
-rw-r--r--src/tools/windows/dump_syms/testdata/omap_stretched_filled.sym34
-rw-r--r--src/tools/windows/dump_syms/testdata/pe_only_symbol_test.dllbin0 -> 51200 bytes
-rw-r--r--src/tools/windows/dump_syms/testdata/pe_only_symbol_test.sym214
-rw-r--r--src/tools/windows/refresh_binaries.bat20
-rw-r--r--src/tools/windows/symupload/symupload.cc209
-rw-r--r--src/tools/windows/symupload/symupload.gyp5
-rw-r--r--src/tools/windows/tools_windows.gyp (renamed from src/testing/gtest/xcode/Samples/FrameworkSample/runtests.sh)52
724 files changed, 49196 insertions, 120893 deletions
diff --git a/.github/mistaken-pull-closer.yml b/.github/mistaken-pull-closer.yml
new file mode 100644
index 00000000..13c8d1b3
--- /dev/null
+++ b/.github/mistaken-pull-closer.yml
@@ -0,0 +1,17 @@
+# The JSONPath filter expression used to identify which PRs to close.
+# The data filtered is the pull request data along with other metadata passed in
+# by probot.
+# See http://goessner.net/articles/JsonPath/
+# `true` will close all PRs.
+filters:
+ - true
+
+# The message to post to the closed PR.
+commentBody: |
+ Thanks for your contribution! Unfortunately, we don't use GitHub pull
+ requests to manage code contributions to this repository. Instead, please
+ see [README.md](../blob/master/README.md) which provides full instructions
+ on how to get involved.
+
+# Whether to add a label to the closed PR.
+addLabel: false
diff --git a/.gitignore b/.gitignore
index ee337553..aa53ba87 100644
--- a/.gitignore
+++ b/.gitignore
@@ -26,6 +26,47 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# Ignore other VCSs.
+.repo/
+.svn/
+
+# Ignore common compiled artifacts.
+*~
+*.dwo
+*.o
+lib*.a
+/breakpad.pc
+/breakpad-client.pc
+/src/client/linux/linux_client_unittest_shlib
+/src/client/linux/linux_dumper_unittest_helper
+/src/common/linux/google_crashdump_uploader_test
+/src/processor/microdump_stackwalk
+/src/processor/minidump_dump
+/src/processor/minidump_stackwalk
+/src/tools/linux/core2md/core2md
+/src/tools/linux/dump_syms/dump_syms
+/src/tools/linux/md2core/minidump-2-core
+/src/tools/linux/symupload/minidump_upload
+/src/tools/linux/symupload/sym_upload
+/src/tools/mac/dump_syms/dump_syms
+/src/tools/mac/dump_syms/dump_syms_mac
+
+# Ignore unit test artifacts.
+*_unittest
+*.log
+*.trs
+
+# Ignore autotools generated artifacts.
+.deps
+.dirstamp
+autom4te.cache/
+/config.cache
+config.h
+/config.log
+/config.status
+/Makefile
+stamp-h1
+
# Ignore GYP generated Visual Studio artifacts.
*.filters
*.sdf
@@ -34,12 +75,15 @@
*.vcproj
*.vcxproj
+# Ignore GYP generated Makefiles
+src/Makefile
+*.Makefile
+*.target.mk
+
# Ignore compiled Python files.
*.pyc
# Ignore directories gclient syncs.
src/testing
-src/third_party/glog
-src/third_party/lss
src/third_party/protobuf
src/tools/gyp
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 00000000..628362d2
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,34 @@
+# Travis build integration.
+# https://docs.travis-ci.com/
+language: cpp
+
+sudo: required
+
+addons:
+ apt:
+ sources:
+ - ubuntu-toolchain-r-test
+ packages:
+ - clang
+ - gcc-4.8
+ - g++-4.8
+
+env:
+ global:
+ - secure: "FPczJ1u7FWGXOtUVf5AONeexfQDYnKRtuNs3phLwlPPAbgAlIc/WeTRSHC8DAb1T8IyPdN3Zi7cqLz0dvPol0iX1fWSfr8YdtW0ea8nUYH5ldmmp6H75FEUJUcISmYwL4WN7TldC6Hnzrlbw/0xmBH8gtAgddtBXKc9P9SwEZvM4OiFMHbMPwZEhRj+D95rfH12lgh3D16nbXGnx3rSNbHszvIxrU2VvlLo9Aa+hbmVj5CsBiNJjhDS64ie+VMTkuzcWNqLRYaGOCQ8ftKAlj/fjGfoKjPDN9dSJg9gW1FjOMPeQo93qhSc/hCmTq7sWxBJu48telinUgESdE5q/8gRf5J05ImWPntZAkC/wQkA20K7Kp/fH1CRaYXQMWKjts8c6dQZ5R4WxE4WXUo5rz573Ti9uyVTLys9whnzaib3YbqYv04irkhpgzo3rd8PF8SXpgK99ySQCcv/Dh7UQuXPpcaknOk2mBySXjQDgpQHHXDN2uUek1HEo5xit8fQuQw3TdPIZ9ZgzQ/c5/Dx6sLWAGEfVH9MN+hy6AiZnJ1JI+XF82kAf1pnf8WddHtlE7pAdWRFQt0iOj9T9esV1/o0VCJVzJLRdpKecF0sTpJxDuan6cFI0tNCkNjHFA5wJKYAvdOPAmYkqre7aIIqSOKy3Fjh9JP9CBJFy7eals9U="
+
+# TODO: Add an OS X config.
+matrix:
+ include:
+ - os: linux
+ compiler: gcc
+ env: USE_CC=gcc-4.8 USE_CXX=g++-4.8 COVERITY_SCAN=true
+ - os: linux
+ compiler: clang
+
+before_install: ./scripts/travis-checkout.sh
+script: ./scripts/travis-build.sh
+
+notifications:
+ email:
+ - google-breakpad-dev@googlegroups.com
diff --git a/Android.bp b/Android.bp
index 074fdaf5..b37e26f3 100644
--- a/Android.bp
+++ b/Android.bp
@@ -14,20 +14,62 @@
// Static library.
// =================================================
+package {
+ default_applicable_licenses: ["external_google-breakpad_license"],
+}
+
+// Added automatically by a large-scale-change that took the approach of
+// 'apply every license found to every target'. While this makes sure we respect
+// every license restriction, it may not be entirely correct.
+//
+// e.g. GPL in an MIT project might only apply to the contrib/ directory.
+//
+// Please consider splitting the single license below into multiple licenses,
+// taking care not to lose any license_kind information, and overriding the
+// default license using the 'licenses: [...]' property on targets as needed.
+//
+// For unused files, consider creating a 'fileGroup' with "//visibility:private"
+// to attach the license to, and including a comment whether the files may be
+// used in the current project.
+// See: http://go/android-license-faq
+license {
+ name: "external_google-breakpad_license",
+ visibility: [":__subpackages__"],
+ license_kinds: [
+ "SPDX-license-identifier-APSL-2.0",
+ "SPDX-license-identifier-Apache-2.0",
+ "SPDX-license-identifier-Artistic",
+ "SPDX-license-identifier-BSD",
+ "SPDX-license-identifier-FSFAP",
+ "SPDX-license-identifier-ISC",
+ "SPDX-license-identifier-MIT",
+ "SPDX-license-identifier-Unicode-DFS",
+ "legacy_notice",
+ "legacy_unencumbered",
+ ],
+ license_text: [
+ "LICENSE",
+ ],
+}
+
cc_library_static {
name: "breakpad_client",
-
+ host_supported: true,
srcs: [
- "src/client/linux/dump_writer_common/seccomp_unwinder.cc",
+ "src/client/linux/crash_generation/crash_generation_client.cc",
"src/client/linux/dump_writer_common/thread_info.cc",
"src/client/linux/dump_writer_common/ucontext_reader.cc",
+ "src/client/linux/handler/exception_handler.cc",
"src/client/linux/handler/minidump_descriptor.cc",
+ "src/client/linux/log/log.cc",
+ "src/client/linux/microdump_writer/microdump_writer.cc",
"src/client/linux/minidump_writer/linux_core_dumper.cc",
"src/client/linux/minidump_writer/linux_dumper.cc",
"src/client/linux/minidump_writer/linux_ptrace_dumper.cc",
"src/client/linux/minidump_writer/minidump_writer.cc",
"src/client/minidump_file_writer.cc",
- "src/common/convert_UTF.c",
+ "src/common/convert_UTF.cc",
+ "src/common/linux/breakpad_getcontext.S",
"src/common/linux/elf_core_dump.cc",
"src/common/linux/elfutils.cc",
"src/common/linux/file_id.cc",
@@ -37,19 +79,20 @@ cc_library_static {
"src/common/linux/safe_readlink.cc",
"src/common/string_conversion.cc",
],
-
- export_include_dirs: [
- "src/common/android/include",
- "src",
- ],
-
+ export_include_dirs: ["src"],
cflags: [
"-Wall",
"-Werror",
"-Wno-unused-parameter",
"-Wno-tautological-compare",
],
-
+ target: {
+ bionic: {
+ local_include_dirs: [
+ "src/common/android/include",
+ ],
+ },
+ },
// Work around b/25435766 core2md segfault.
arch: {
x86: {
@@ -62,18 +105,19 @@ cc_library_static {
// =================================================
cc_binary {
name: "core2md",
-
- srcs: ["src/tools/linux/core2md/core2md.cc"],
-
+ host_supported: true,
+ srcs: [
+ "src/common/convert_UTF.cc",
+ "src/common/path_helper.cc",
+ "src/tools/linux/core2md/core2md.cc",
+ ],
static_libs: ["breakpad_client"],
-
// Work around b/25435766 core2md segfault.
arch: {
x86: {
clang_cflags: ["-mno-stackrealign"],
},
},
-
cflags: [
"-Wall",
"-Werror",
@@ -88,14 +132,14 @@ cc_binary_host {
darwin: {
enabled: false,
},
-
linux_glibc: {
cppflags: [
"-DHAVE_A_OUT_H",
"-Wno-unused-parameter",
],
-
srcs: [
+ "src/common/dwarf/elf_reader.cc",
+ "src/common/dwarf_range_list_handler.cc",
"src/common/linux/crc32.cc",
"src/common/linux/dump_symbols.cc",
"src/common/linux/elfutils.cc",
@@ -103,11 +147,11 @@ cc_binary_host {
"src/common/linux/file_id.cc",
"src/common/linux/linux_libc_support.cc",
"src/common/linux/memory_mapped_file.cc",
+ "src/common/path_helper.cc",
"src/tools/linux/dump_syms/dump_syms.cc",
],
},
},
-
local_include_dirs: ["src"],
srcs: [
"src/common/dwarf/bytereader.cc",
@@ -139,17 +183,17 @@ cc_binary_host {
darwin: {
enabled: false,
},
-
linux_glibc: {
srcs: [
"src/common/linux/http_upload.cc",
+ "src/common/linux/libcurl_wrapper.cc",
+ "src/common/linux/symbol_collector_client.cc",
+ "src/common/linux/symbol_upload.cc",
"src/tools/linux/symupload/sym_upload.cc",
],
},
},
-
local_include_dirs: ["src"],
-
cflags: [
"-Wall",
"-Werror",
@@ -165,7 +209,6 @@ cc_library_host_static {
darwin: {
enabled: false,
},
-
linux_glibc: {
cflags: [
"-Wno-missing-field-initializers",
@@ -175,7 +218,6 @@ cc_library_host_static {
],
},
},
-
export_include_dirs: ["src/third_party/libdisasm"],
srcs: [
"src/third_party/libdisasm/ia32_implicit.c",
@@ -203,7 +245,6 @@ cc_binary_host {
darwin: {
enabled: false,
},
-
linux_glibc: {
cppflags: [
"-DHAVE_A_OUT_H",
@@ -212,12 +253,13 @@ cc_binary_host {
"-Wno-unused-function",
"-Wno-unused-parameter",
],
-
srcs: [
+ "src/common/path_helper.cc",
"src/processor/basic_code_modules.cc",
"src/processor/basic_source_line_resolver.cc",
"src/processor/call_stack.cc",
"src/processor/cfi_frame_info.cc",
+ "src/processor/convert_old_arm64_context.cc",
"src/processor/disassembler_x86.cc",
"src/processor/dump_context.cc",
"src/processor/dump_object.cc",
@@ -232,6 +274,7 @@ cc_binary_host {
"src/processor/minidump_stackwalk.cc",
"src/processor/pathname_stripper.cc",
"src/processor/process_state.cc",
+ "src/processor/proc_maps_linux.cc",
"src/processor/simple_symbol_supplier.cc",
"src/processor/source_line_resolver_base.cc",
"src/processor/stack_frame_symbolizer.cc",
@@ -250,8 +293,6 @@ cc_binary_host {
],
},
},
-
local_include_dirs: ["src"],
-
static_libs: ["libdisasm"],
}
diff --git a/DEPS b/DEPS
index b63afa60..3ddaf4e3 100644
--- a/DEPS
+++ b/DEPS
@@ -33,34 +33,52 @@
# 'gclient runhooks' rather than 'gclient sync'.
deps = {
- # Logging code.
- "src/src/third_party/glog":
- "http://google-glog.googlecode.com/svn/trunk@97",
-
# Testing libraries and utilities.
- "src/src/testing": "http://googlemock.googlecode.com/svn/trunk@408",
- "src/src/testing/gtest": "http://googletest.googlecode.com/svn/trunk@615",
+ "src/src/testing":
+ "https://github.com/google/googletest.git" +
+ "@5ec7f0c4a113e2f18ac2c6cc7df51ad6afc24081",
# Protobuf.
"src/src/third_party/protobuf/protobuf":
- "http://protobuf.googlecode.com/svn/trunk@407",
+ "https://github.com/google/protobuf.git" +
+ "@cb6dd4ef5f82e41e06179dcd57d3b1d9246ad6ac",
# GYP project generator.
- "src/src/tools/gyp": "http://gyp.googlecode.com/svn/trunk@1886",
+ "src/src/tools/gyp":
+ "https://chromium.googlesource.com/external/gyp/" +
+ "@324dd166b7c0b39d513026fa52d6280ac6d56770",
# Linux syscall support.
"src/src/third_party/lss":
- "http://linux-syscall-support.googlecode.com/svn/trunk/lss@24",
+ "https://chromium.googlesource.com/linux-syscall-support/" +
+ "@fd00dbbd0c06a309c657d89e9430143b179ff6db",
}
hooks = [
{
- # TODO(chrisha): Fix the GYP files so that they work without
- # --no-circular-check.
- "pattern": ".",
- "action": ["python",
- "src/src/tools/gyp/gyp_main.py",
- "--no-circular-check",
- "src/src/client/windows/breakpad_client.gyp"],
+ # Keep the manifest up to date.
+ "action": ["python", "src/src/tools/python/deps-to-manifest.py",
+ "src/DEPS", "src/default.xml"],
},
]
+
+hooks_os = {
+ 'win': [
+ {
+ # TODO(chrisha): Fix the GYP files so that they work without
+ # --no-circular-check.
+ "pattern": ".",
+ "action": ["python",
+ "src/src/tools/gyp/gyp_main.py",
+ "--no-circular-check",
+ "src/src/client/windows/breakpad_client.gyp"],
+ },
+ {
+ # XXX: this and above should all be wired into build/all.gyp ?
+ "action": ["python",
+ "src/src/tools/gyp/gyp_main.py",
+ "--no-circular-check",
+ "src/src/tools/windows/tools_windows.gyp"],
+ },
+ ],
+}
diff --git a/LICENSE b/LICENSE
index 95207bdf..dc6aab4c 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2006, Google Inc.
+Copyright 2008, Google Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
diff --git a/METADATA b/METADATA
new file mode 100644
index 00000000..76ed448b
--- /dev/null
+++ b/METADATA
@@ -0,0 +1,20 @@
+name: "google-breakpad"
+description:
+ "Breakpad is a set of client and server components which implement a "
+ "crash-reporting system"
+third_party {
+ url {
+ type: HOMEPAGE
+ value: "https://chromium.googlesource.com/breakpad/breakpad"
+ }
+ url {
+ type: GIT
+ value: "https://chromium.googlesource.com/breakpad/breakpad"
+ }
+ version: "a2d3e8b"
+ last_upgrade_date { year: 2020 month: 4 day: 19 }
+ # would be NOTICE save for APSL in:
+ # src/third_party/mac_handler/breakpad_nlist_64.cc
+ # src/third_party/mac_headers/
+ license_type: RECIPROCAL
+}
diff --git a/inherit-review-settings-ok b/MODULE_LICENSE_BSD
index e69de29b..e69de29b 100644
--- a/inherit-review-settings-ok
+++ b/MODULE_LICENSE_BSD
diff --git a/Makefile.am b/Makefile.am
index fe5848d6..9a25d9d4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -43,17 +43,7 @@ AM_CXXFLAGS += -I$(top_srcdir)/src/common/android/include
AM_CXXFLAGS += -I$(top_srcdir)/src/common/android/testing/include
endif
-if GCC
-# These are good warnings to be treated as errors
-AM_CXXFLAGS += \
- -Werror=missing-braces \
- -Werror=non-virtual-dtor \
- -Werror=overloaded-virtual \
- -Werror=reorder \
- -Werror=sign-compare \
- -Werror=unused-variable \
- -Werror=vla
-endif
+AM_CXXFLAGS += $(WARN_CXXFLAGS)
if LINUX_HOST
# Build as PIC on Linux, for linux_client_unittest_shlib
@@ -76,13 +66,16 @@ dist_doc_DATA = \
INSTALL \
LICENSE \
NEWS \
- README
+ README.md
## Headers
if LINUX_HOST
includeclhdir = $(includedir)/$(PACKAGE)/client/linux/handler
includeclh_HEADERS = $(top_srcdir)/src/client/linux/handler/*.h
+includecldwcdir = $(includedir)/$(PACKAGE)/client/linux/dump_writer_common
+includecldwc_HEADERS = $(top_srcdir)/src/client/linux/dump_writer_common/*.h
+
includeclmdir = $(includedir)/$(PACKAGE)/client/linux/minidump_writer
includeclm_HEADERS = $(top_srcdir)/src/client/linux/minidump_writer/*.h
@@ -109,11 +102,43 @@ includep_HEADERS = $(top_srcdir)/src/processor/*.h
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA =
+## Common test logic
+if SYSTEM_TEST_LIBS
+TEST_CFLAGS = $(GTEST_CFLAGS) $(GMOCK_CFLAGS)
+TEST_LIBS = $(GTEST_LIBS) -lgtest_main $(GMOCK_LIBS)
+TEST_DEPS =
+else
+TEST_CFLAGS = \
+ -I$(top_srcdir)/src/testing/include \
+ -I$(top_srcdir)/src/testing/googletest/include \
+ -I$(top_srcdir)/src/testing/googletest \
+ -I$(top_srcdir)/src/testing/googlemock/include \
+ -I$(top_srcdir)/src/testing/googlemock \
+ -I$(top_srcdir)/src/testing
+TEST_LIBS = src/testing/libtesting.a
+TEST_DEPS = $(TEST_LIBS)
+endif
+
## Libraries
+check_LIBRARIES =
noinst_LIBRARIES =
lib_LIBRARIES =
bin_PROGRAMS =
check_PROGRAMS =
+EXTRA_PROGRAMS =
+CLEANFILES =
+
+check_LIBRARIES += src/testing/libtesting.a
+
+if !SYSTEM_TEST_LIBS
+src_testing_libtesting_a_SOURCES = \
+ src/breakpad_googletest_includes.h \
+ src/testing/googletest/src/gtest-all.cc \
+ src/testing/googletest/src/gtest_main.cc \
+ src/testing/googlemock/src/gmock-all.cc
+src_testing_libtesting_a_CPPFLAGS = \
+ $(AM_CPPFLAGS) $(TEST_CFLAGS)
+endif
if !DISABLE_PROCESSOR
lib_LIBRARIES += src/libbreakpad.a
@@ -128,29 +153,42 @@ pkgconfig_DATA += breakpad-client.pc
src_client_linux_libbreakpad_client_a_SOURCES = \
src/client/linux/crash_generation/crash_generation_client.cc \
src/client/linux/crash_generation/crash_generation_server.cc \
- src/client/linux/dump_writer_common/seccomp_unwinder.cc \
src/client/linux/dump_writer_common/thread_info.cc \
src/client/linux/dump_writer_common/ucontext_reader.cc \
src/client/linux/handler/exception_handler.cc \
+ src/client/linux/handler/exception_handler.h \
src/client/linux/handler/minidump_descriptor.cc \
+ src/client/linux/handler/minidump_descriptor.h \
src/client/linux/log/log.cc \
+ src/client/linux/log/log.h \
src/client/linux/microdump_writer/microdump_writer.cc \
+ src/client/linux/microdump_writer/microdump_writer.h \
+ src/client/linux/minidump_writer/linux_core_dumper.cc \
src/client/linux/minidump_writer/linux_dumper.cc \
src/client/linux/minidump_writer/linux_ptrace_dumper.cc \
src/client/linux/minidump_writer/minidump_writer.cc \
+ src/client/minidump_file_writer-inl.h \
src/client/minidump_file_writer.cc \
- src/common/convert_UTF.c \
+ src/client/minidump_file_writer.h \
+ src/common/convert_UTF.cc \
+ src/common/convert_UTF.h \
src/common/md5.cc \
+ src/common/md5.h \
src/common/string_conversion.cc \
+ src/common/string_conversion.h \
+ src/common/linux/elf_core_dump.cc \
src/common/linux/elfutils.cc \
+ src/common/linux/elfutils.h \
src/common/linux/file_id.cc \
+ src/common/linux/file_id.h \
src/common/linux/guid_creator.cc \
+ src/common/linux/guid_creator.h \
src/common/linux/linux_libc_support.cc \
src/common/linux/memory_mapped_file.cc \
src/common/linux/safe_readlink.cc
-if ANDROID_HOST
+if !HAVE_GETCONTEXT
src_client_linux_libbreakpad_client_a_SOURCES += \
- src/common/android/breakpad_getcontext.S
+ src/common/linux/breakpad_getcontext.S
endif
endif LINUX_HOST
@@ -174,6 +212,7 @@ src_libbreakpad_a_SOURCES = \
src/google_breakpad/processor/minidump_processor.h \
src/google_breakpad/processor/process_result.h \
src/google_breakpad/processor/process_state.h \
+ src/google_breakpad/processor/proc_maps_linux.h \
src/google_breakpad/processor/source_line_resolver_base.h \
src/google_breakpad/processor/source_line_resolver_interface.h \
src/google_breakpad/processor/stack_frame.h \
@@ -189,13 +228,13 @@ src_libbreakpad_a_SOURCES = \
src/processor/basic_code_modules.h \
src/processor/basic_source_line_resolver_types.h \
src/processor/basic_source_line_resolver.cc \
- src/processor/binarystream.h \
- src/processor/binarystream.cc \
src/processor/call_stack.cc \
src/processor/cfi_frame_info.cc \
src/processor/cfi_frame_info.h \
src/processor/contained_range_map-inl.h \
src/processor/contained_range_map.h \
+ src/processor/convert_old_arm64_context.cc \
+ src/processor/convert_old_arm64_context.h \
src/processor/disassembler_x86.h \
src/processor/disassembler_x86.cc \
src/processor/dump_context.cc \
@@ -226,6 +265,7 @@ src_libbreakpad_a_SOURCES = \
src/processor/postfix_evaluator-inl.h \
src/processor/postfix_evaluator.h \
src/processor/process_state.cc \
+ src/processor/proc_maps_linux.cc \
src/processor/range_map-inl.h \
src/processor/range_map.h \
src/processor/simple_serializer-inl.h \
@@ -271,8 +311,6 @@ src_libbreakpad_a_SOURCES = \
src/processor/tokenize.cc \
src/processor/tokenize.h
-src_libbreakpad_a_LIBADD = src/third_party/libdisasm/libdisasm.a
-
src_third_party_libdisasm_libdisasm_a_SOURCES = \
src/third_party/libdisasm/ia32_implicit.c \
src/third_party/libdisasm/ia32_implicit.h \
@@ -309,7 +347,9 @@ bin_PROGRAMS += \
endif !DISABLE_PROCESSOR
if LINUX_HOST
-bin_PROGRAMS += \
+EXTRA_PROGRAMS += \
+ src/client/linux/linux_dumper_unittest_helper
+CLEANFILES += \
src/client/linux/linux_dumper_unittest_helper
if !DISABLE_TOOLS
@@ -319,6 +359,10 @@ bin_PROGRAMS += \
src/tools/linux/md2core/minidump-2-core \
src/tools/linux/symupload/minidump_upload \
src/tools/linux/symupload/sym_upload
+if X86_HOST
+bin_PROGRAMS += \
+ src/tools/mac/dump_syms/dump_syms_mac
+endif
endif
endif LINUX_HOST
@@ -328,7 +372,6 @@ if !DISABLE_PROCESSOR
check_PROGRAMS += \
src/common/test_assembler_unittest \
src/processor/address_map_unittest \
- src/processor/binarystream_unittest \
src/processor/basic_source_line_resolver_unittest \
src/processor/cfi_frame_info_unittest \
src/processor/contained_range_map_unittest \
@@ -345,27 +388,38 @@ check_PROGRAMS += \
src/processor/static_range_map_unittest \
src/processor/pathname_stripper_unittest \
src/processor/postfix_evaluator_unittest \
+ src/processor/proc_maps_linux_unittest \
+ src/processor/range_map_truncate_lower_unittest \
+ src/processor/range_map_truncate_upper_unittest \
src/processor/range_map_unittest \
src/processor/stackwalker_amd64_unittest \
src/processor/stackwalker_arm_unittest \
src/processor/stackwalker_arm64_unittest \
src/processor/stackwalker_address_list_unittest \
src/processor/stackwalker_mips_unittest \
+ src/processor/stackwalker_mips64_unittest \
src/processor/stackwalker_x86_unittest \
src/processor/synth_minidump_unittest
endif
if LINUX_HOST
-EXTRA_PROGRAMS = \
+EXTRA_PROGRAMS += \
+ src/client/linux/linux_client_unittest_shlib
+CLEANFILES += \
src/client/linux/linux_client_unittest_shlib
check_PROGRAMS += \
- src/client/linux/linux_client_unittest
+ src/client/linux/linux_client_unittest \
+ src/common/linux/google_crashdump_uploader_test
if !DISABLE_TOOLS
check_PROGRAMS += \
src/common/dumper_unittest \
src/tools/linux/md2core/minidump_2_core_unittest
+if X86_HOST
+check_PROGRAMS += \
+ src/common/mac/macho_reader_unittest
+endif
endif
endif LINUX_HOST
@@ -395,8 +449,12 @@ if ANDROID_HOST
LOG_DRIVER = $(top_srcdir)/android/test-driver
else
# The default Autotools test driver script.
+if TESTS_AS_ROOT
+LOG_DRIVER = $(top_srcdir)/autotools/root-test-driver $(top_srcdir)/autotools/test-driver
+else
LOG_DRIVER = $(top_srcdir)/autotools/test-driver
-endif
+endif !TESTS_AS_ROOT
+endif !ANDROID_HOST
if LINUX_HOST
src_client_linux_linux_dumper_unittest_helper_SOURCES = \
@@ -412,7 +470,9 @@ src_client_linux_linux_dumper_unittest_helper_CXXFLAGS=$(PTHREAD_CFLAGS)
endif
src_client_linux_linux_client_unittest_shlib_SOURCES = \
+ $(src_testing_libtesting_a_SOURCES) \
src/client/linux/handler/exception_handler_unittest.cc \
+ src/client/linux/microdump_writer/microdump_writer_unittest.cc \
src/client/linux/minidump_writer/directory_reader_unittest.cc \
src/client/linux/minidump_writer/cpu_set_unittest.cc \
src/client/linux/minidump_writer/line_reader_unittest.cc \
@@ -424,39 +484,32 @@ src_client_linux_linux_client_unittest_shlib_SOURCES = \
src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc \
src/common/linux/elf_core_dump.cc \
src/common/linux/linux_libc_support_unittest.cc \
+ src/common/linux/tests/auto_testfile.h \
src/common/linux/tests/crash_generator.cc \
- src/common/memory_unittest.cc \
+ src/common/memory_allocator_unittest.cc \
+ src/common/tests/auto_tempdir.h \
src/common/tests/file_utils.cc \
- src/testing/gtest/src/gtest-all.cc \
- src/testing/gtest/src/gtest_main.cc \
- src/testing/src/gmock-all.cc \
+ src/common/tests/file_utils.h \
src/processor/basic_code_modules.cc \
+ src/processor/convert_old_arm64_context.cc \
src/processor/dump_context.cc \
src/processor/dump_object.cc \
src/processor/logging.cc \
src/processor/minidump.cc \
- src/processor/pathname_stripper.cc
-if ANDROID_HOST
-src_client_linux_linux_client_unittest_shlib_SOURCES += \
- src/common/android/breakpad_getcontext.S
-endif
-if LINUX_HOST
+ src/processor/pathname_stripper.cc \
+ src/processor/proc_maps_linux.cc
+if !HAVE_GETCONTEXT
src_client_linux_linux_client_unittest_shlib_SOURCES += \
- src/client/linux/microdump_writer/microdump_writer_unittest.cc
+ src/common/linux/breakpad_getcontext.S
endif
src_client_linux_linux_client_unittest_shlib_CPPFLAGS = \
- -I$(top_srcdir)/src \
- -I$(top_srcdir)/src/testing/include \
- -I$(top_srcdir)/src/testing/gtest/include \
- -I$(top_srcdir)/src/testing/gtest \
- -I$(top_srcdir)/src/testing
+ $(AM_CPPFLAGS) $(TEST_CFLAGS)
src_client_linux_linux_client_unittest_shlib_LDFLAGS = \
-shared \
-Wl,-h,linux_client_unittest_shlib
src_client_linux_linux_client_unittest_shlib_LDADD = \
src/client/linux/crash_generation/crash_generation_client.o \
- src/client/linux/dump_writer_common/seccomp_unwinder.o \
src/client/linux/dump_writer_common/thread_info.o \
src/client/linux/dump_writer_common/ucontext_reader.o \
src/client/linux/handler/exception_handler.o \
@@ -476,10 +529,13 @@ src_client_linux_linux_client_unittest_shlib_LDADD = \
src/common/linux/memory_mapped_file.o \
src/common/linux/safe_readlink.o \
src/common/string_conversion.o \
+ $(TEST_LIBS) \
$(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-if ANDROID_HOST
+if !HAVE_GETCONTEXT
src_client_linux_linux_client_unittest_shlib_SOURCES += \
- src/common/android/breakpad_getcontext_unittest.cc
+ src/common/linux/breakpad_getcontext_unittest.cc
+endif
+if ANDROID_HOST
src_client_linux_linux_client_unittest_shlib_LDFLAGS += \
-llog -lm
endif
@@ -487,27 +543,29 @@ endif
src_client_linux_linux_client_unittest_shlib_DEPENDENCIES = \
src/client/linux/linux_dumper_unittest_helper \
src/client/linux/libbreakpad_client.a \
+ $(TEST_DEPS) \
src/libbreakpad.a
src_client_linux_linux_client_unittest_SOURCES =
+# The extra-long build id is for a test in minidump_writer_unittest.cc.
src_client_linux_linux_client_unittest_LDFLAGS = \
- -Wl,-rpath,'$$ORIGIN'
+ -Wl,-rpath,'$$ORIGIN' \
+ -Wl,--build-id=0x000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
if ANDROID_HOST
src_client_linux_linux_client_unittest_LDFLAGS += \
-llog
endif
src_client_linux_linux_client_unittest_LDADD = \
- src/client/linux/linux_client_unittest_shlib
+ src/client/linux/linux_client_unittest_shlib \
+ $(TEST_LIBS)
src_client_linux_linux_client_unittest_DEPENDENCIES = \
src/client/linux/linux_client_unittest_shlib
if !DISABLE_TOOLS
src_tools_linux_core2md_core2md_SOURCES = \
- src/tools/linux/core2md/core2md.cc \
- src/client/linux/minidump_writer/linux_core_dumper.cc \
- src/common/linux/elf_core_dump.cc
+ src/tools/linux/core2md/core2md.cc
src_tools_linux_core2md_core2md_LDADD = \
src/client/linux/libbreakpad_client.a
@@ -516,26 +574,37 @@ src_tools_linux_dump_syms_dump_syms_SOURCES = \
src/common/dwarf_cfi_to_module.cc \
src/common/dwarf_cu_to_module.cc \
src/common/dwarf_line_to_module.cc \
+ src/common/dwarf_range_list_handler.cc \
src/common/language.cc \
src/common/module.cc \
+ src/common/path_helper.cc \
src/common/stabs_reader.cc \
src/common/stabs_to_module.cc \
src/common/dwarf/bytereader.cc \
src/common/dwarf/dwarf2diehandler.cc \
src/common/dwarf/dwarf2reader.cc \
+ src/common/dwarf/elf_reader.cc \
src/common/linux/crc32.cc \
src/common/linux/dump_symbols.cc \
+ src/common/linux/dump_symbols.h \
src/common/linux/elf_symbols_to_module.cc \
+ src/common/linux/elf_symbols_to_module.h \
src/common/linux/elfutils.cc \
src/common/linux/file_id.cc \
src/common/linux/linux_libc_support.cc \
src/common/linux/memory_mapped_file.cc \
src/common/linux/safe_readlink.cc \
src/tools/linux/dump_syms/dump_syms.cc
+src_tools_linux_dump_syms_dump_syms_CXXFLAGS = \
+ $(RUST_DEMANGLE_CFLAGS)
+src_tools_linux_dump_syms_dump_syms_LDADD = \
+ $(RUST_DEMANGLE_LIBS)
src_tools_linux_md2core_minidump_2_core_SOURCES = \
src/common/linux/memory_mapped_file.cc \
- src/tools/linux/md2core/minidump-2-core.cc
+ src/common/path_helper.cc \
+ src/tools/linux/md2core/minidump-2-core.cc \
+ src/tools/linux/md2core/minidump_memory_range.h
src_tools_linux_symupload_minidump_upload_SOURCES = \
src/common/linux/http_upload.cc \
@@ -544,34 +613,89 @@ src_tools_linux_symupload_minidump_upload_LDADD = -ldl
src_tools_linux_symupload_sym_upload_SOURCES = \
src/common/linux/http_upload.cc \
+ src/common/linux/http_upload.h \
+ src/common/linux/libcurl_wrapper.cc \
+ src/common/linux/libcurl_wrapper.h \
+ src/common/linux/symbol_collector_client.cc \
+ src/common/linux/symbol_collector_client.h \
+ src/common/linux/symbol_upload.cc \
+ src/common/linux/symbol_upload.h \
src/tools/linux/symupload/sym_upload.cc
src_tools_linux_symupload_sym_upload_LDADD = -ldl
+src_tools_mac_dump_syms_dump_syms_mac_SOURCES = \
+ src/common/dwarf_cfi_to_module.cc \
+ src/common/dwarf_cu_to_module.cc \
+ src/common/dwarf_line_to_module.cc \
+ src/common/dwarf_range_list_handler.cc \
+ src/common/language.cc \
+ src/common/md5.cc \
+ src/common/module.cc \
+ src/common/path_helper.cc \
+ src/common/stabs_reader.cc \
+ src/common/stabs_to_module.cc \
+ src/common/dwarf/bytereader.cc \
+ src/common/dwarf/dwarf2diehandler.cc \
+ src/common/dwarf/dwarf2reader.cc \
+ src/common/dwarf/elf_reader.cc \
+ src/common/mac/arch_utilities.cc \
+ src/common/mac/dump_syms.cc \
+ src/common/mac/dump_syms.h \
+ src/common/mac/file_id.cc \
+ src/common/mac/file_id.h \
+ src/common/mac/macho_id.cc \
+ src/common/mac/macho_id.h \
+ src/common/mac/macho_reader.cc \
+ src/common/mac/macho_reader.h \
+ src/common/mac/macho_utilities.cc \
+ src/common/mac/macho_utilities.h \
+ src/common/mac/macho_walker.cc \
+ src/common/mac/macho_walker.h \
+ src/tools/mac/dump_syms/dump_syms_tool.cc
+src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS= \
+ -I$(top_srcdir)/src/third_party/mac_headers \
+ $(RUST_DEMANGLE_CFLAGS) \
+ -DHAVE_MACH_O_NLIST_H
+src_tools_mac_dump_syms_dump_syms_mac_LDADD= \
+ $(RUST_DEMANGLE_LIBS)
+
src_common_dumper_unittest_SOURCES = \
src/common/byte_cursor_unittest.cc \
+ src/common/convert_UTF.cc \
src/common/dwarf_cfi_to_module.cc \
src/common/dwarf_cfi_to_module_unittest.cc \
src/common/dwarf_cu_to_module.cc \
src/common/dwarf_cu_to_module_unittest.cc \
src/common/dwarf_line_to_module.cc \
src/common/dwarf_line_to_module_unittest.cc \
+ src/common/dwarf_range_list_handler.cc \
src/common/language.cc \
src/common/memory_range_unittest.cc \
src/common/module.cc \
src/common/module_unittest.cc \
+ src/common/path_helper.cc \
src/common/stabs_reader.cc \
src/common/stabs_reader_unittest.cc \
src/common/stabs_to_module.cc \
src/common/stabs_to_module_unittest.cc \
+ src/common/string_conversion.cc \
+ src/common/string_conversion_unittest.cc \
src/common/test_assembler.cc \
src/common/dwarf/bytereader.cc \
+ src/common/dwarf/bytereader.h \
+ src/common/dwarf/bytereader-inl.h \
src/common/dwarf/bytereader_unittest.cc \
src/common/dwarf/cfi_assembler.cc \
+ src/common/dwarf/cfi_assembler.h \
src/common/dwarf/dwarf2diehandler.cc \
src/common/dwarf/dwarf2diehandler_unittest.cc \
src/common/dwarf/dwarf2reader.cc \
+ src/common/dwarf/dwarf2reader.h \
+ src/common/dwarf/elf_reader.cc \
+ src/common/dwarf/elf_reader.h \
src/common/dwarf/dwarf2reader_cfi_unittest.cc \
src/common/dwarf/dwarf2reader_die_unittest.cc \
+ src/common/dwarf/dwarf2reader_test_common.h \
src/common/linux/crc32.cc \
src/common/linux/dump_symbols.cc \
src/common/linux/dump_symbols_unittest.cc \
@@ -590,32 +714,69 @@ src_common_dumper_unittest_SOURCES = \
src/common/linux/synth_elf.cc \
src/common/linux/synth_elf_unittest.cc \
src/common/linux/tests/crash_generator.cc \
- src/common/tests/file_utils.cc \
- src/testing/gtest/src/gtest-all.cc \
- src/testing/gtest/src/gtest_main.cc \
- src/testing/src/gmock-all.cc
+ src/common/linux/tests/crash_generator.h \
+ src/common/testdata/func-line-pairing.h \
+ src/common/tests/file_utils.cc
src_common_dumper_unittest_CPPFLAGS = \
- -I$(top_srcdir)/src \
- -I$(top_srcdir)/src/testing/include \
- -I$(top_srcdir)/src/testing/gtest/include \
- -I$(top_srcdir)/src/testing/gtest \
- -I$(top_srcdir)/src/testing \
+ $(AM_CPPFLAGS) $(TEST_CFLAGS) \
+ $(RUST_DEMANGLE_CFLAGS) \
$(PTHREAD_CFLAGS)
-src_common_dumper_unittest_LDADD = $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
+src_common_dumper_unittest_LDADD = \
+ $(TEST_LIBS) \
+ $(RUST_DEMANGLE_LIBS) \
+ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
+
+src_common_mac_macho_reader_unittest_SOURCES = \
+ src/common/dwarf_cfi_to_module.cc \
+ src/common/dwarf_cu_to_module.cc \
+ src/common/dwarf_line_to_module.cc \
+ src/common/language.cc \
+ src/common/md5.cc \
+ src/common/module.cc \
+ src/common/path_helper.cc \
+ src/common/stabs_reader.cc \
+ src/common/stabs_to_module.cc \
+ src/common/test_assembler.cc \
+ src/common/dwarf/bytereader.cc \
+ src/common/dwarf/cfi_assembler.cc \
+ src/common/dwarf/dwarf2diehandler.cc \
+ src/common/dwarf/dwarf2reader.cc \
+ src/common/dwarf/elf_reader.cc \
+ src/common/mac/arch_utilities.cc \
+ src/common/mac/file_id.cc \
+ src/common/mac/macho_id.cc \
+ src/common/mac/macho_reader.cc \
+ src/common/mac/macho_reader_unittest.cc \
+ src/common/mac/macho_utilities.cc \
+ src/common/mac/macho_walker.cc \
+ src/common/tests/file_utils.cc
+src_common_mac_macho_reader_unittest_CPPFLAGS = \
+ $(AM_CPPFLAGS) $(TEST_CFLAGS) \
+ -I$(top_srcdir)/src/third_party/mac_headers \
+ -DHAVE_MACH_O_NLIST_H \
+ $(PTHREAD_CFLAGS)
+src_common_mac_macho_reader_unittest_LDADD = \
+ $(TEST_LIBS) \
+ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
endif
+src_common_linux_google_crashdump_uploader_test_SOURCES = \
+ src/common/linux/google_crashdump_uploader.cc \
+ src/common/linux/google_crashdump_uploader_test.cc \
+ src/common/linux/libcurl_wrapper.cc
+src_common_linux_google_crashdump_uploader_test_CPPFLAGS = \
+ $(AM_CPPFLAGS) $(TEST_CFLAGS)
+src_common_linux_google_crashdump_uploader_test_LDADD = \
+ $(TEST_LIBS) \
+ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) \
+ -ldl
+
src_tools_linux_md2core_minidump_2_core_unittest_SOURCES = \
- src/testing/gtest/src/gtest-all.cc \
- src/testing/gtest/src/gtest_main.cc \
- src/testing/src/gmock-all.cc \
src/tools/linux/md2core/minidump_memory_range_unittest.cc
src_tools_linux_md2core_minidump_2_core_unittest_CPPFLAGS = \
- -I$(top_srcdir)/src \
- -I$(top_srcdir)/src/testing/include \
- -I$(top_srcdir)/src/testing/gtest/include \
- -I$(top_srcdir)/src/testing/gtest \
- -I$(top_srcdir)/src/testing
+ $(AM_CPPFLAGS) $(TEST_CFLAGS)
src_tools_linux_md2core_minidump_2_core_unittest_LDADD = \
+ $(TEST_LIBS) \
$(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
endif LINUX_HOST
@@ -627,30 +788,10 @@ src_processor_address_map_unittest_LDADD = \
src/processor/logging.o \
src/processor/pathname_stripper.o
-src_processor_binarystream_unittest_SOURCES = \
- src/processor/binarystream_unittest.cc \
- src/testing/gtest/src/gtest-all.cc \
- src/testing/src/gmock-all.cc
-src_processor_binarystream_unittest_CPPFLAGS = \
- -I$(top_srcdir)/src \
- -I$(top_srcdir)/src/testing/include \
- -I$(top_srcdir)/src/testing/gtest/include \
- -I$(top_srcdir)/src/testing/gtest \
- -I$(top_srcdir)/src/testing
-src_processor_binarystream_unittest_LDADD = \
- src/processor/binarystream.o \
- $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-
src_processor_basic_source_line_resolver_unittest_SOURCES = \
- src/processor/basic_source_line_resolver_unittest.cc \
- src/testing/gtest/src/gtest-all.cc \
- src/testing/src/gmock-all.cc
+ src/processor/basic_source_line_resolver_unittest.cc
src_processor_basic_source_line_resolver_unittest_CPPFLAGS = \
- -I$(top_srcdir)/src \
- -I$(top_srcdir)/src/testing/include \
- -I$(top_srcdir)/src/testing/gtest/include \
- -I$(top_srcdir)/src/testing/gtest \
- -I$(top_srcdir)/src/testing
+ $(AM_CPPFLAGS) $(TEST_CFLAGS)
src_processor_basic_source_line_resolver_unittest_LDADD = \
src/processor/basic_source_line_resolver.o \
src/processor/cfi_frame_info.o \
@@ -658,24 +799,19 @@ src_processor_basic_source_line_resolver_unittest_LDADD = \
src/processor/logging.o \
src/processor/source_line_resolver_base.o \
src/processor/tokenize.o \
+ $(TEST_LIBS) \
$(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
src_processor_cfi_frame_info_unittest_SOURCES = \
- src/processor/cfi_frame_info_unittest.cc \
- src/testing/gtest/src/gtest-all.cc \
- src/testing/gtest/src/gtest_main.cc \
- src/testing/src/gmock-all.cc
+ src/processor/cfi_frame_info_unittest.cc
src_processor_cfi_frame_info_unittest_LDADD = \
src/processor/cfi_frame_info.o \
src/processor/logging.o \
src/processor/pathname_stripper.o \
+ $(TEST_LIBS) \
$(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
src_processor_cfi_frame_info_unittest_CPPFLAGS = \
- -I$(top_srcdir)/src \
- -I$(top_srcdir)/src/testing/include \
- -I$(top_srcdir)/src/testing/gtest/include \
- -I$(top_srcdir)/src/testing/gtest \
- -I$(top_srcdir)/src/testing
+ $(AM_CPPFLAGS) $(TEST_CFLAGS)
src_processor_contained_range_map_unittest_SOURCES = \
src/processor/contained_range_map_unittest.cc
@@ -684,17 +820,11 @@ src_processor_contained_range_map_unittest_LDADD = \
src/processor/pathname_stripper.o
src_processor_exploitability_unittest_SOURCES = \
- src/processor/exploitability_unittest.cc \
- src/testing/gtest/src/gtest-all.cc \
- src/testing/gtest/src/gtest_main.cc \
- src/testing/src/gmock-all.cc
+ src/processor/exploitability_unittest.cc
src_processor_exploitability_unittest_CPPFLAGS = \
- -I$(top_srcdir)/src \
- -I$(top_srcdir)/src/testing/include \
- -I$(top_srcdir)/src/testing/gtest/include \
- -I$(top_srcdir)/src/testing/gtest \
- -I$(top_srcdir)/src/testing
+ $(AM_CPPFLAGS) $(TEST_CFLAGS)
src_processor_exploitability_unittest_LDADD = \
+ src/processor/convert_old_arm64_context.o \
src/processor/minidump_processor.o \
src/processor/process_state.o \
src/processor/disassembler_x86.o \
@@ -710,6 +840,7 @@ src_processor_exploitability_unittest_LDADD = \
src/processor/logging.o \
src/processor/minidump.o \
src/processor/pathname_stripper.o \
+ src/processor/proc_maps_linux.o \
src/processor/simple_symbol_supplier.o \
src/processor/source_line_resolver_base.o \
src/processor/stack_frame_cpu.o \
@@ -727,34 +858,23 @@ src_processor_exploitability_unittest_LDADD = \
src/processor/symbolic_constants_win.o \
src/processor/tokenize.o \
src/third_party/libdisasm/libdisasm.a \
+ $(TEST_LIBS) \
$(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
src_processor_disassembler_x86_unittest_SOURCES = \
- src/processor/disassembler_x86_unittest.cc \
- src/testing/gtest/src/gtest-all.cc \
- src/testing/gtest/src/gtest_main.cc \
- src/testing/src/gmock-all.cc
+ src/processor/disassembler_x86_unittest.cc
src_processor_disassembler_x86_unittest_CPPFLAGS = \
- -I$(top_srcdir)/src \
- -I$(top_srcdir)/src/testing/include \
- -I$(top_srcdir)/src/testing/gtest/include \
- -I$(top_srcdir)/src/testing/gtest \
- -I$(top_srcdir)/src/testing
+ $(AM_CPPFLAGS) $(TEST_CFLAGS)
src_processor_disassembler_x86_unittest_LDADD = \
src/processor/disassembler_x86.o \
src/third_party/libdisasm/libdisasm.a \
+ $(TEST_LIBS) \
$(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
src_processor_fast_source_line_resolver_unittest_SOURCES = \
- src/processor/fast_source_line_resolver_unittest.cc \
- src/testing/gtest/src/gtest-all.cc \
- src/testing/src/gmock-all.cc
+ src/processor/fast_source_line_resolver_unittest.cc
src_processor_fast_source_line_resolver_unittest_CPPFLAGS = \
- -I$(top_srcdir)/src \
- -I$(top_srcdir)/src/testing/include \
- -I$(top_srcdir)/src/testing/gtest/include \
- -I$(top_srcdir)/src/testing/gtest \
- -I$(top_srcdir)/src/testing
+ $(AM_CPPFLAGS) $(TEST_CFLAGS)
src_processor_fast_source_line_resolver_unittest_LDADD = \
src/processor/fast_source_line_resolver.o \
src/processor/basic_source_line_resolver.o \
@@ -765,37 +885,28 @@ src_processor_fast_source_line_resolver_unittest_LDADD = \
src/processor/logging.o \
src/processor/source_line_resolver_base.o \
src/processor/tokenize.o \
+ $(TEST_LIBS) \
$(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
src_processor_map_serializers_unittest_SOURCES = \
- src/processor/map_serializers_unittest.cc \
- src/testing/gtest/src/gtest-all.cc \
- src/testing/src/gmock-all.cc
+ src/processor/map_serializers_unittest.cc
src_processor_map_serializers_unittest_CPPFLAGS = \
- -I$(top_srcdir)/src \
- -I$(top_srcdir)/src/testing/include \
- -I$(top_srcdir)/src/testing/gtest/include \
- -I$(top_srcdir)/src/testing/gtest \
- -I$(top_srcdir)/src/testing
+ $(AM_CPPFLAGS) $(TEST_CFLAGS)
src_processor_map_serializers_unittest_LDADD = \
src/processor/logging.o \
src/processor/pathname_stripper.o \
+ $(TEST_LIBS) \
$(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
src_processor_microdump_processor_unittest_SOURCES = \
- src/processor/microdump_processor_unittest.cc \
- src/testing/gtest/src/gtest-all.cc \
- src/testing/src/gmock-all.cc
+ src/processor/microdump_processor_unittest.cc
src_processor_microdump_processor_unittest_CPPFLAGS = \
- -I$(top_srcdir)/src \
- -I$(top_srcdir)/src/testing/include \
- -I$(top_srcdir)/src/testing/gtest/include \
- -I$(top_srcdir)/src/testing/gtest \
- -I$(top_srcdir)/src/testing
+ $(AM_CPPFLAGS) $(TEST_CFLAGS)
src_processor_microdump_processor_unittest_LDADD = \
src/processor/basic_code_modules.o \
src/processor/basic_source_line_resolver.o \
src/processor/call_stack.o \
+ src/processor/convert_old_arm64_context.o \
src/processor/cfi_frame_info.o \
src/processor/dump_context.o \
src/processor/dump_object.o \
@@ -818,23 +929,19 @@ src_processor_microdump_processor_unittest_LDADD = \
src/processor/stackwalker_sparc.o \
src/processor/stackwalker_x86.o \
src/processor/tokenize.o \
- $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
+ $(TEST_LIBS) \
+ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
src_processor_minidump_processor_unittest_SOURCES = \
- src/processor/minidump_processor_unittest.cc \
- src/testing/gtest/src/gtest-all.cc \
- src/testing/src/gmock-all.cc
+ src/processor/minidump_processor_unittest.cc
src_processor_minidump_processor_unittest_CPPFLAGS = \
- -I$(top_srcdir)/src \
- -I$(top_srcdir)/src/testing/include \
- -I$(top_srcdir)/src/testing/gtest/include \
- -I$(top_srcdir)/src/testing/gtest \
- -I$(top_srcdir)/src/testing
+ $(AM_CPPFLAGS) $(TEST_CFLAGS)
src_processor_minidump_processor_unittest_LDADD = \
src/processor/basic_code_modules.o \
src/processor/basic_source_line_resolver.o \
src/processor/call_stack.o \
src/processor/cfi_frame_info.o \
+ src/processor/convert_old_arm64_context.o \
src/processor/disassembler_x86.o \
src/processor/dump_context.o \
src/processor/dump_object.o \
@@ -846,6 +953,7 @@ src_processor_minidump_processor_unittest_LDADD = \
src/processor/minidump.o \
src/processor/pathname_stripper.o \
src/processor/process_state.o \
+ src/processor/proc_maps_linux.o \
src/processor/source_line_resolver_base.o \
src/processor/stack_frame_cpu.o \
src/processor/stack_frame_symbolizer.o \
@@ -862,88 +970,77 @@ src_processor_minidump_processor_unittest_LDADD = \
src/processor/symbolic_constants_win.o \
src/processor/tokenize.o \
src/third_party/libdisasm/libdisasm.a \
+ $(TEST_LIBS) \
$(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
src_processor_minidump_unittest_SOURCES = \
src/common/test_assembler.cc \
src/processor/minidump_unittest.cc \
- src/processor/synth_minidump.cc \
- src/testing/gtest/src/gtest-all.cc \
- src/testing/gtest/src/gtest_main.cc \
- src/testing/src/gmock-all.cc
+ src/processor/synth_minidump.cc
src_processor_minidump_unittest_CPPFLAGS = \
- -I$(top_srcdir)/src \
- -I$(top_srcdir)/src/testing/include \
- -I$(top_srcdir)/src/testing/gtest/include \
- -I$(top_srcdir)/src/testing/gtest \
- -I$(top_srcdir)/src/testing
+ $(AM_CPPFLAGS) $(TEST_CFLAGS)
src_processor_minidump_unittest_LDADD = \
src/processor/basic_code_modules.o \
+ src/processor/convert_old_arm64_context.o \
src/processor/dump_context.o \
src/processor/dump_object.o \
src/processor/logging.o \
src/processor/minidump.o \
src/processor/pathname_stripper.o \
+ src/processor/proc_maps_linux.o \
+ $(TEST_LIBS) \
+ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
+
+src_processor_proc_maps_linux_unittest_SOURCES = \
+ src/processor/proc_maps_linux.cc \
+ src/processor/proc_maps_linux_unittest.cc
+src_processor_proc_maps_linux_unittest_CPPFLAGS = \
+ $(AM_CPPFLAGS) $(TEST_CFLAGS)
+src_processor_proc_maps_linux_unittest_LDADD = \
+ src/processor/logging.o \
+ src/processor/pathname_stripper.o \
+ src/third_party/libdisasm/libdisasm.a \
+ $(TEST_LIBS) \
$(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
src_processor_static_address_map_unittest_SOURCES = \
- src/processor/static_address_map_unittest.cc \
- src/testing/gtest/src/gtest-all.cc \
- src/testing/src/gmock-all.cc
+ src/processor/static_address_map_unittest.cc
src_processor_static_address_map_unittest_CPPFLAGS = \
- -I$(top_srcdir)/src \
- -I$(top_srcdir)/src/testing/include \
- -I$(top_srcdir)/src/testing/gtest/include \
- -I$(top_srcdir)/src/testing/gtest \
- -I$(top_srcdir)/src/testing
+ $(AM_CPPFLAGS) $(TEST_CFLAGS)
src_processor_static_address_map_unittest_LDADD = \
src/processor/logging.o \
src/processor/pathname_stripper.o \
+ $(TEST_LIBS) \
$(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
src_processor_static_contained_range_map_unittest_SOURCES = \
- src/processor/static_contained_range_map_unittest.cc \
- src/testing/gtest/src/gtest-all.cc \
- src/testing/src/gmock-all.cc
+ src/processor/static_contained_range_map_unittest.cc
src_processor_static_contained_range_map_unittest_CPPFLAGS = \
- -I$(top_srcdir)/src \
- -I$(top_srcdir)/src/testing/include \
- -I$(top_srcdir)/src/testing/gtest/include \
- -I$(top_srcdir)/src/testing/gtest \
- -I$(top_srcdir)/src/testing
+ $(AM_CPPFLAGS) $(TEST_CFLAGS)
src_processor_static_contained_range_map_unittest_LDADD = \
src/processor/logging.o \
src/processor/pathname_stripper.o \
+ $(TEST_LIBS) \
$(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
src_processor_static_map_unittest_SOURCES = \
- src/processor/static_map_unittest.cc \
- src/testing/gtest/src/gtest-all.cc \
- src/testing/src/gmock-all.cc
+ src/processor/static_map_unittest.cc
src_processor_static_map_unittest_CPPFLAGS = \
- -I$(top_srcdir)/src \
- -I$(top_srcdir)/src/testing/include \
- -I$(top_srcdir)/src/testing/gtest/include \
- -I$(top_srcdir)/src/testing/gtest \
- -I$(top_srcdir)/src/testing
+ $(AM_CPPFLAGS) $(TEST_CFLAGS)
src_processor_static_map_unittest_LDADD = \
src/processor/logging.o \
src/processor/pathname_stripper.o \
+ $(TEST_LIBS) \
$(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
src_processor_static_range_map_unittest_SOURCES = \
- src/processor/static_range_map_unittest.cc \
- src/testing/gtest/src/gtest-all.cc \
- src/testing/src/gmock-all.cc
+ src/processor/static_range_map_unittest.cc
src_processor_static_range_map_unittest_CPPFLAGS = \
- -I$(top_srcdir)/src \
- -I$(top_srcdir)/src/testing/include \
- -I$(top_srcdir)/src/testing/gtest/include \
- -I$(top_srcdir)/src/testing/gtest \
- -I$(top_srcdir)/src/testing
+ $(AM_CPPFLAGS) $(TEST_CFLAGS)
src_processor_static_range_map_unittest_LDADD = \
src/processor/logging.o \
src/processor/pathname_stripper.o \
+ $(TEST_LIBS) \
$(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
src_processor_pathname_stripper_unittest_SOURCES = \
@@ -959,6 +1056,26 @@ src_processor_postfix_evaluator_unittest_LDADD = \
src/processor/pathname_stripper.o \
$(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
+src_processor_range_map_truncate_lower_unittest_SOURCES = \
+ src/processor/range_map_truncate_lower_unittest.cc
+src_processor_range_map_truncate_lower_unittest_LDADD = \
+ src/processor/logging.o \
+ src/processor/pathname_stripper.o \
+ $(TEST_LIBS) \
+ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
+src_processor_range_map_truncate_lower_unittest_CPPFLAGS = \
+ $(AM_CPPFLAGS) $(TEST_CFLAGS)
+
+src_processor_range_map_truncate_upper_unittest_SOURCES = \
+ src/processor/range_map_truncate_upper_unittest.cc
+src_processor_range_map_truncate_upper_unittest_LDADD = \
+ src/processor/logging.o \
+ src/processor/pathname_stripper.o \
+ $(TEST_LIBS) \
+ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
+src_processor_range_map_truncate_upper_unittest_CPPFLAGS = \
+ $(AM_CPPFLAGS) $(TEST_CFLAGS)
+
src_processor_range_map_unittest_SOURCES = \
src/processor/range_map_unittest.cc
src_processor_range_map_unittest_LDADD = \
@@ -979,6 +1096,7 @@ src_processor_stackwalker_selftest_LDADD = \
src/processor/logging.o \
src/processor/minidump.o \
src/processor/pathname_stripper.o \
+ src/processor/proc_maps_linux.o \
src/processor/source_line_resolver_base.o \
src/processor/stack_frame_cpu.o \
src/processor/stack_frame_symbolizer.o \
@@ -997,131 +1115,95 @@ src_processor_stackwalker_selftest_LDADD = \
src_processor_stackwalker_amd64_unittest_SOURCES = \
src/common/test_assembler.cc \
- src/processor/stackwalker_amd64_unittest.cc \
- src/testing/gtest/src/gtest-all.cc \
- src/testing/gtest/src/gtest_main.cc \
- src/testing/src/gmock-all.cc
+ src/processor/stackwalker_amd64_unittest.cc
src_processor_stackwalker_amd64_unittest_LDADD = \
src/libbreakpad.a \
+ $(TEST_LIBS) \
$(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
src_processor_stackwalker_amd64_unittest_CPPFLAGS = \
- -I$(top_srcdir)/src \
- -I$(top_srcdir)/src/testing/include \
- -I$(top_srcdir)/src/testing/gtest/include \
- -I$(top_srcdir)/src/testing/gtest \
- -I$(top_srcdir)/src/testing
+ $(AM_CPPFLAGS) $(TEST_CFLAGS)
src_processor_stackwalker_arm_unittest_SOURCES = \
src/common/test_assembler.cc \
- src/processor/stackwalker_arm_unittest.cc \
- src/testing/gtest/src/gtest-all.cc \
- src/testing/gtest/src/gtest_main.cc \
- src/testing/src/gmock-all.cc
+ src/processor/stackwalker_arm_unittest.cc
src_processor_stackwalker_arm_unittest_LDADD = \
src/libbreakpad.a \
+ $(TEST_LIBS) \
$(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
src_processor_stackwalker_arm_unittest_CPPFLAGS = \
- -I$(top_srcdir)/src \
- -I$(top_srcdir)/src/testing/include \
- -I$(top_srcdir)/src/testing/gtest/include \
- -I$(top_srcdir)/src/testing/gtest \
- -I$(top_srcdir)/src/testing
+ $(AM_CPPFLAGS) $(TEST_CFLAGS)
src_processor_stackwalker_arm64_unittest_SOURCES = \
src/common/test_assembler.cc \
- src/processor/stackwalker_arm64_unittest.cc \
- src/testing/gtest/src/gtest-all.cc \
- src/testing/gtest/src/gtest_main.cc \
- src/testing/src/gmock-all.cc
+ src/processor/stackwalker_arm64_unittest.cc
src_processor_stackwalker_arm64_unittest_LDADD = \
src/libbreakpad.a \
+ $(TEST_LIBS) \
$(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
src_processor_stackwalker_arm64_unittest_CPPFLAGS = \
- -I$(top_srcdir)/src \
- -I$(top_srcdir)/src/testing/include \
- -I$(top_srcdir)/src/testing/gtest/include \
- -I$(top_srcdir)/src/testing/gtest \
- -I$(top_srcdir)/src/testing
+ $(AM_CPPFLAGS) $(TEST_CFLAGS)
src_processor_stackwalker_address_list_unittest_SOURCES = \
src/common/test_assembler.cc \
- src/processor/stackwalker_address_list_unittest.cc \
- src/testing/gtest/src/gtest-all.cc \
- src/testing/gtest/src/gtest_main.cc \
- src/testing/src/gmock-all.cc
+ src/processor/stackwalker_address_list_unittest.cc
src_processor_stackwalker_address_list_unittest_LDADD = \
src/libbreakpad.a \
+ $(TEST_LIBS) \
$(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
src_processor_stackwalker_address_list_unittest_CPPFLAGS = \
- -I$(top_srcdir)/src \
- -I$(top_srcdir)/src/testing/include \
- -I$(top_srcdir)/src/testing/gtest/include \
- -I$(top_srcdir)/src/testing/gtest \
- -I$(top_srcdir)/src/testing
+ $(AM_CPPFLAGS) $(TEST_CFLAGS)
src_processor_stackwalker_mips_unittest_SOURCES = \
src/common/test_assembler.cc \
- src/processor/stackwalker_mips_unittest.cc \
- src/testing/gtest/src/gtest-all.cc \
- src/testing/gtest/src/gtest_main.cc \
- src/testing/src/gmock-all.cc
+ src/processor/stackwalker_mips_unittest.cc
src_processor_stackwalker_mips_unittest_LDADD = \
src/libbreakpad.a \
+ $(TEST_LIBS) \
$(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
src_processor_stackwalker_mips_unittest_CPPFLAGS = \
- -I$(top_srcdir)/src \
- -I$(top_srcdir)/src/testing/include \
- -I$(top_srcdir)/src/testing/gtest/include \
- -I$(top_srcdir)/src/testing/gtest \
- -I$(top_srcdir)/src/testing
+ $(AM_CPPFLAGS) $(TEST_CFLAGS)
+
+src_processor_stackwalker_mips64_unittest_SOURCES = \
+ src/common/test_assembler.cc \
+ src/processor/stackwalker_mips64_unittest.cc
+src_processor_stackwalker_mips64_unittest_LDADD = \
+ src/libbreakpad.a \
+ $(TEST_LIBS) \
+ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
+src_processor_stackwalker_mips64_unittest_CPPFLAGS = \
+ $(AM_CPPFLAGS) $(TEST_CFLAGS)
src_processor_stackwalker_x86_unittest_SOURCES = \
src/common/test_assembler.cc \
- src/processor/stackwalker_x86_unittest.cc \
- src/testing/gtest/src/gtest-all.cc \
- src/testing/gtest/src/gtest_main.cc \
- src/testing/src/gmock-all.cc
+ src/processor/stackwalker_x86_unittest.cc
src_processor_stackwalker_x86_unittest_LDADD = \
src/libbreakpad.a \
+ $(TEST_LIBS) \
$(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
src_processor_stackwalker_x86_unittest_CPPFLAGS = \
- -I$(top_srcdir)/src \
- -I$(top_srcdir)/src/testing/include \
- -I$(top_srcdir)/src/testing/gtest/include \
- -I$(top_srcdir)/src/testing/gtest \
- -I$(top_srcdir)/src/testing
+ $(AM_CPPFLAGS) $(TEST_CFLAGS)
src_processor_synth_minidump_unittest_SOURCES = \
src/common/test_assembler.cc \
src/common/test_assembler.h \
src/processor/synth_minidump_unittest.cc \
- src/testing/gtest/src/gtest-all.cc \
- src/testing/gtest/src/gtest_main.cc \
- src/testing/src/gmock-all.cc \
src/processor/synth_minidump.cc \
src/processor/synth_minidump.h
src_processor_synth_minidump_unittest_CPPFLAGS = \
- -I$(top_srcdir)/src \
- -I$(top_srcdir)/src/testing/include \
- -I$(top_srcdir)/src/testing/gtest/include \
- -I$(top_srcdir)/src/testing/gtest \
- -I$(top_srcdir)/src/testing
-src_processor_synth_minidump_unittest_LDADD = $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
+ $(AM_CPPFLAGS) $(TEST_CFLAGS)
+src_processor_synth_minidump_unittest_LDADD = \
+ $(TEST_LIBS) \
+ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
src_common_test_assembler_unittest_SOURCES = \
src/common/test_assembler.cc \
src/common/test_assembler.h \
- src/common/test_assembler_unittest.cc \
- src/testing/gtest/src/gtest-all.cc \
- src/testing/gtest/src/gtest_main.cc \
- src/testing/src/gmock-all.cc
+ src/common/test_assembler_unittest.cc
src_common_test_assembler_unittest_CPPFLAGS = \
- -I$(top_srcdir)/src \
- -I$(top_srcdir)/src/testing/include \
- -I$(top_srcdir)/src/testing/gtest/include \
- -I$(top_srcdir)/src/testing/gtest \
- -I$(top_srcdir)/src/testing
-src_common_test_assembler_unittest_LDADD = $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
+ $(AM_CPPFLAGS) $(TEST_CFLAGS)
+src_common_test_assembler_unittest_LDADD = \
+ $(TEST_LIBS) \
+ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
## Non-installables
noinst_PROGRAMS =
@@ -1131,19 +1213,22 @@ src_processor_minidump_dump_SOURCES = \
src/processor/minidump_dump.cc
src_processor_minidump_dump_LDADD = \
src/processor/basic_code_modules.o \
+ src/processor/convert_old_arm64_context.o \
src/processor/dump_context.o \
src/processor/dump_object.o \
src/processor/logging.o \
src/processor/minidump.o \
- src/processor/pathname_stripper.o
+ src/processor/pathname_stripper.o \
+ src/processor/proc_maps_linux.o
src_processor_microdump_stackwalk_SOURCES = \
src/processor/microdump_stackwalk.cc
src_processor_microdump_stackwalk_LDADD = \
+ src/common/path_helper.o \
src/processor/basic_code_modules.o \
src/processor/basic_source_line_resolver.o \
- src/processor/binarystream.o \
src/processor/call_stack.o \
+ src/processor/convert_old_arm64_context.o \
src/processor/cfi_frame_info.o \
src/processor/disassembler_x86.o \
src/processor/dump_context.o \
@@ -1174,11 +1259,12 @@ src_processor_microdump_stackwalk_LDADD = \
src_processor_minidump_stackwalk_SOURCES = \
src/processor/minidump_stackwalk.cc
src_processor_minidump_stackwalk_LDADD = \
+ src/common/path_helper.o \
src/processor/basic_code_modules.o \
src/processor/basic_source_line_resolver.o \
- src/processor/binarystream.o \
src/processor/call_stack.o \
src/processor/cfi_frame_info.o \
+ src/processor/convert_old_arm64_context.o \
src/processor/disassembler_x86.o \
src/processor/dump_context.o \
src/processor/dump_object.o \
@@ -1190,6 +1276,7 @@ src_processor_minidump_stackwalk_LDADD = \
src/processor/minidump_processor.o \
src/processor/pathname_stripper.o \
src/processor/process_state.o \
+ src/processor/proc_maps_linux.o \
src/processor/simple_symbol_supplier.o \
src/processor/source_line_resolver_base.o \
src/processor/stack_frame_cpu.o \
@@ -1218,33 +1305,32 @@ endif !DISABLE_PROCESSOR
## sed -e s/'^\(.*\)$'/'\t\1 \\'/
EXTRA_DIST = \
$(SCRIPTS) \
- src/processor/stackwalk_selftest_sol.s \
- src/client/linux/handler/Makefile \
- src/client/linux/handler/exception_handler.cc \
- src/client/linux/handler/exception_handler.h \
- src/client/linux/handler/minidump_descriptor.cc \
- src/client/linux/handler/minidump_descriptor.h \
- src/client/linux/handler/exception_handler_test.cc \
- src/client/linux/handler/linux_thread.cc \
- src/client/linux/handler/linux_thread.h \
- src/client/linux/handler/linux_thread_test.cc \
- src/client/linux/handler/minidump_generator.cc \
- src/client/linux/handler/minidump_generator.h \
- src/client/linux/handler/minidump_test.cc \
+ src/client/linux/data/linux-gate-amd.sym \
+ src/client/linux/data/linux-gate-intel.sym \
+ src/client/mac/handler/breakpad_nlist_64.cc \
+ src/client/mac/handler/breakpad_nlist_64.h \
src/client/mac/handler/dynamic_images.cc \
src/client/mac/handler/dynamic_images.h \
src/client/mac/handler/exception_handler.cc \
src/client/mac/handler/exception_handler.h \
- src/client/mac/handler/exception_handler_test.cc \
+ src/client/mac/handler/mach_vm_compat.h \
src/client/mac/handler/minidump_generator.cc \
src/client/mac/handler/minidump_generator.h \
- src/client/mac/handler/minidump_generator_test.cc \
src/client/mac/handler/minidump_test.xcodeproj/project.pbxproj \
+ src/client/mac/handler/minidump_tests32-Info.plist \
+ src/client/mac/handler/minidump_tests64-Info.plist \
+ src/client/mac/handler/obj-cTestCases-Info.plist \
src/client/mac/handler/protected_memory_allocator.cc \
src/client/mac/handler/protected_memory_allocator.h \
- src/client/minidump_file_writer-inl.h \
- src/client/minidump_file_writer.cc \
- src/client/minidump_file_writer.h \
+ src/client/mac/handler/ucontext_compat.h \
+ src/client/mac/handler/testcases/testdata/dump_syms_i386_breakpad.sym \
+ src/client/mac/tests/BreakpadFramework_Test.mm \
+ src/client/mac/tests/crash_generation_server_test.cc \
+ src/client/mac/tests/exception_handler_test.cc \
+ src/client/mac/tests/minidump_generator_test.cc \
+ src/client/mac/tests/minidump_generator_test_helper.cc \
+ src/client/mac/tests/spawn_child_process.h \
+ src/client/mac/tests/testlogging.h \
src/client/minidump_file_writer_unittest.cc \
src/client/solaris/handler/Makefile \
src/client/solaris/handler/exception_handler.cc \
@@ -1255,44 +1341,24 @@ EXTRA_DIST = \
src/client/solaris/handler/minidump_test.cc \
src/client/solaris/handler/solaris_lwp.cc \
src/client/solaris/handler/solaris_lwp.h \
- src/client/windows/breakpad_client.sln \
+ src/client/windows/breakpad_client.gyp \
src/client/windows/handler/exception_handler.cc \
src/client/windows/handler/exception_handler.h \
- src/client/windows/handler/exception_handler.vcproj \
+ src/client/windows/handler/exception_handler.gyp \
src/client/windows/sender/crash_report_sender.cc \
src/client/windows/sender/crash_report_sender.h \
- src/client/windows/sender/crash_report_sender.vcproj \
- src/common/convert_UTF.c \
- src/common/convert_UTF.h \
- src/common/linux/crc32.cc \
- src/common/linux/dump_symbols.cc \
- src/common/linux/dump_symbols.h \
- src/common/linux/elf_symbols_to_module.cc \
- src/common/linux/elf_symbols_to_module.h \
- src/common/linux/elfutils.cc \
- src/common/linux/elfutils.h \
- src/common/linux/file_id.cc \
- src/common/linux/file_id.h \
- src/common/linux/guid_creator.cc \
- src/common/linux/guid_creator.h \
- src/common/linux/http_upload.cc \
- src/common/linux/http_upload.h \
+ src/client/windows/sender/crash_report_sender.gyp \
+ src/common/dwarf/dwarf2diehandler.h \
+ src/common/dwarf/dwarf2enums.h \
+ src/common/dwarf/line_state_machine.h \
+ src/common/dwarf/types.h \
+ src/common/mac/arch_utilities.h \
+ src/common/mac/byteswap.h \
src/common/mac/HTTPMultipartUpload.h \
src/common/mac/HTTPMultipartUpload.m \
- src/common/mac/dump_syms.h \
- src/common/mac/dump_syms.mm \
- src/common/mac/file_id.cc \
- src/common/mac/file_id.h \
- src/common/mac/macho_id.cc \
- src/common/mac/macho_id.h \
- src/common/mac/macho_utilities.cc \
- src/common/mac/macho_utilities.h \
- src/common/mac/macho_walker.cc \
- src/common/mac/macho_walker.h \
src/common/mac/string_utilities.cc \
src/common/mac/string_utilities.h \
- src/common/md5.cc \
- src/common/md5.h \
+ src/common/mac/super_fat_arch.h \
src/common/scoped_ptr.h \
src/common/solaris/dump_symbols.cc \
src/common/solaris/dump_symbols.h \
@@ -1301,8 +1367,6 @@ EXTRA_DIST = \
src/common/solaris/guid_creator.cc \
src/common/solaris/guid_creator.h \
src/common/solaris/message_output.h \
- src/common/string_conversion.cc \
- src/common/string_conversion.h \
src/common/windows/guid_string.cc \
src/common/windows/guid_string.h \
src/common/windows/http_upload.cc \
@@ -1311,28 +1375,176 @@ EXTRA_DIST = \
src/common/windows/pdb_source_line_writer.h \
src/common/windows/string_utils-inl.h \
src/common/windows/string_utils.cc \
+ src/processor/microdump_stackwalk_test_vars \
+ src/processor/stackwalk_common.cc \
+ src/processor/stackwalk_common.h \
+ src/processor/stackwalker_selftest_sol.s \
+ src/processor/testdata/ascii_read_av_block_write.dmp \
+ src/processor/testdata/ascii_read_av_clobber_write.dmp \
+ src/processor/testdata/ascii_read_av_conditional.dmp \
+ src/processor/testdata/ascii_read_av.dmp \
+ src/processor/testdata/ascii_read_av_then_jmp.dmp \
+ src/processor/testdata/ascii_read_av_xchg_write.dmp \
+ src/processor/testdata/ascii_write_av_arg_to_call.dmp \
+ src/processor/testdata/ascii_write_av.dmp \
+ src/processor/testdata/exec_av_on_stack.dmp \
+ src/processor/testdata/linux_divide_by_zero.dmp \
+ src/processor/testdata/linux_executable_heap.dmp \
+ src/processor/testdata/linux_executable_stack.dmp \
+ src/processor/testdata/linux_inside_module_exe_region1.dmp \
+ src/processor/testdata/linux_inside_module_exe_region2.dmp \
+ src/processor/testdata/linux_jmp_to_0.dmp \
+ src/processor/testdata/linux_jmp_to_module_not_exe_region.dmp \
+ src/processor/testdata/linux_null_dereference.dmp \
+ src/processor/testdata/linux_null_read_av.dmp \
+ src/processor/testdata/linux_outside_module.dmp \
+ src/processor/testdata/linux_overflow.dmp \
+ src/processor/testdata/linux_raise_sigabrt.dmp \
+ src/processor/testdata/linux_stack_pointer_in_module.dmp \
+ src/processor/testdata/linux_stack_pointer_in_stack.dmp \
+ src/processor/testdata/linux_stack_pointer_in_stack_alt_name.dmp \
+ src/processor/testdata/linux_stacksmash.dmp \
+ src/processor/testdata/linux_write_to_nonwritable_module.dmp \
+ src/processor/testdata/linux_write_to_nonwritable_region_math.dmp \
+ src/processor/testdata/linux_write_to_outside_module.dmp \
+ src/processor/testdata/linux_write_to_outside_module_via_math.dmp \
+ src/processor/testdata/linux_write_to_under_4k.dmp \
+ src/processor/testdata/microdump-arm64.dmp \
+ src/processor/testdata/microdump-arm.dmp \
+ src/processor/testdata/microdump-mips32.dmp \
+ src/processor/testdata/microdump-mips64.dmp \
+ src/processor/testdata/microdump-multiple.dmp \
+ src/processor/testdata/microdump.stackwalk-arm64.out \
+ src/processor/testdata/microdump.stackwalk-arm.out \
+ src/processor/testdata/microdump.stackwalk.machine_readable-arm64.out \
+ src/processor/testdata/microdump.stackwalk.machine_readable-arm.out \
+ src/processor/testdata/microdump-withcrashreason.dmp \
+ src/processor/testdata/microdump-x86.dmp \
+ src/processor/testdata/minidump_32bit_crash_addr.dmp \
src/processor/testdata/minidump2.dmp \
src/processor/testdata/minidump2.dump.out \
src/processor/testdata/minidump2.stackwalk.machine_readable.out \
src/processor/testdata/minidump2.stackwalk.out \
+ src/processor/testdata/module0.out \
src/processor/testdata/module1.out \
src/processor/testdata/module2.out \
src/processor/testdata/module3_bad.out \
src/processor/testdata/module4_bad.out \
+ src/processor/testdata/null_read_av.dmp \
+ src/processor/testdata/null_write_av.dmp \
+ src/processor/testdata/read_av_clobber_write.dmp \
+ src/processor/testdata/read_av_conditional.dmp \
+ src/processor/testdata/read_av_non_null.dmp \
+ src/processor/testdata/stack_exhaustion.dmp \
+ src/processor/testdata/write_av_non_null.dmp \
src/processor/testdata/symbols/kernel32.pdb/BCE8785C57B44245A669896B6A19B9542/kernel32.sym \
+ src/processor/testdata/symbols/ld-2.13.so/C32AD7E235EA6112E02A5B9D6219C4850/ld-2.13.so.sym \
+ src/processor/testdata/symbols/libc-2.13.so/F4F8DFCD5A5FB5A7CE64717E9E6AE3890/libc-2.13.so.sym \
+ src/processor/testdata/symbols/libgcc_s.so.1/18B180F90887D8F8B5C35D185444AF4C0/libgcc_s.so.1.sym \
+ src/processor/testdata/symbols/microdump/breakpad_unittests/D6D1FEC9A15DE7F38A236898871A2E770/breakpad_unittests.sym \
+ src/processor/testdata/symbols/microdump/breakpad_unittests/DA7778FB66018A4E9B4110ED06E730D00/breakpad_unittests.sym \
+ src/processor/testdata/symbols/microdump/crash_example/6E72E2F1A5F59AB3D51356FDFE394D490/crash_example.sym \
+ src/processor/testdata/symbols/microdump/crash_example/8F36148CC4647A8116CAF2A25F591F570/crash_example.sym \
+ src/processor/testdata/symbols/null_read_av/7B7D1968FF0D47AE4366E9C3A7E1B6750/null_read_av.sym \
+ src/processor/testdata/symbols/overflow/B0E1FC01EF48E39CAF5C881D2DF0C3840/overflow.sym \
src/processor/testdata/symbols/test_app.pdb/5A9832E5287241C1838ED98914E9B7FF1/test_app.sym \
src/processor/testdata/test_app.cc \
- src/tools/linux/dump_syms/Makefile \
- src/tools/linux/dump_syms/dump_syms.cc \
- src/tools/linux/symupload/Makefile \
- src/tools/linux/symupload/minidump_upload.cc \
- src/tools/linux/symupload/sym_upload.cc \
+ src/testing/googletest/include/gtest/gtest.h \
+ src/testing/googletest/include/gtest/gtest-death-test.h \
+ src/testing/googletest/include/gtest/gtest-matchers.h \
+ src/testing/googletest/include/gtest/gtest-message.h \
+ src/testing/googletest/include/gtest/gtest-param-test.h \
+ src/testing/googletest/include/gtest/gtest-printers.h \
+ src/testing/googletest/include/gtest/gtest-spi.h \
+ src/testing/googletest/include/gtest/gtest-test-part.h \
+ src/testing/googletest/include/gtest/gtest-typed-test.h \
+ src/testing/googletest/include/gtest/gtest_pred_impl.h \
+ src/testing/googletest/include/gtest/gtest_prod.h \
+ src/testing/googletest/include/gtest/internal/custom/gtest-port.h \
+ src/testing/googletest/include/gtest/internal/custom/gtest-printers.h \
+ src/testing/googletest/include/gtest/internal/custom/gtest.h \
+ src/testing/googletest/include/gtest/internal/gtest-death-test-internal.h \
+ src/testing/googletest/include/gtest/internal/gtest-filepath.h \
+ src/testing/googletest/include/gtest/internal/gtest-internal.h \
+ src/testing/googletest/include/gtest/internal/gtest-param-util-generated.h \
+ src/testing/googletest/include/gtest/internal/gtest-param-util.h \
+ src/testing/googletest/include/gtest/internal/gtest-port-arch.h \
+ src/testing/googletest/include/gtest/internal/gtest-port.h \
+ src/testing/googletest/include/gtest/internal/gtest-string.h \
+ src/testing/googletest/include/gtest/internal/gtest-type-util.h \
+ src/testing/googletest/src/gtest.cc \
+ src/testing/googletest/src/gtest-death-test.cc \
+ src/testing/googletest/src/gtest-filepath.cc \
+ src/testing/googletest/src/gtest-internal-inl.h \
+ src/testing/googletest/src/gtest-matchers.cc \
+ src/testing/googletest/src/gtest-port.cc \
+ src/testing/googletest/src/gtest-printers.cc \
+ src/testing/googletest/src/gtest-test-part.cc \
+ src/testing/googletest/src/gtest-typed-test.cc \
+ src/testing/googlemock/include/gmock/gmock.h \
+ src/testing/googlemock/include/gmock/gmock-actions.h \
+ src/testing/googlemock/include/gmock/gmock-cardinalities.h \
+ src/testing/googlemock/include/gmock/gmock-function-mocker.h \
+ src/testing/googlemock/include/gmock/gmock-generated-actions.h \
+ src/testing/googlemock/include/gmock/gmock-generated-function-mockers.h \
+ src/testing/googlemock/include/gmock/gmock-generated-matchers.h \
+ src/testing/googlemock/include/gmock/gmock-matchers.h \
+ src/testing/googlemock/include/gmock/gmock-more-actions.h \
+ src/testing/googlemock/include/gmock/gmock-more-matchers.h \
+ src/testing/googlemock/include/gmock/gmock-nice-strict.h \
+ src/testing/googlemock/include/gmock/gmock-spec-builders.h \
+ src/testing/googlemock/include/gmock/internal/custom/gmock-generated-actions.h \
+ src/testing/googlemock/include/gmock/internal/custom/gmock-matchers.h \
+ src/testing/googlemock/include/gmock/internal/custom/gmock-port.h \
+ src/testing/googlemock/include/gmock/internal/gmock-internal-utils.h \
+ src/testing/googlemock/include/gmock/internal/gmock-port.h \
+ src/testing/googlemock/include/gmock/internal/gmock-pp.h \
+ src/testing/googlemock/src/gmock.cc \
+ src/testing/googlemock/src/gmock-cardinalities.cc \
+ src/testing/googlemock/src/gmock-internal-utils.cc \
+ src/testing/googlemock/src/gmock-matchers.cc \
+ src/testing/googlemock/src/gmock-spec-builders.cc \
+ src/testing/googlemock/src/gmock_main.cc \
+ src/third_party/curl/COPYING \
+ src/third_party/curl/curlbuild.h \
+ src/third_party/curl/curl.h \
+ src/third_party/curl/curlrules.h \
+ src/third_party/curl/curlver.h \
+ src/third_party/curl/easy.h \
+ src/third_party/curl/mprintf.h \
+ src/third_party/curl/multi.h \
+ src/third_party/curl/stdcheaders.h \
+ src/third_party/curl/typecheck-gcc.h \
+ src/third_party/curl/types.h \
+ src/third_party/mac_headers/architecture/byte_order.h \
+ src/third_party/mac_headers/i386/_types.h \
+ src/third_party/mac_headers/mach/boolean.h \
+ src/third_party/mac_headers/mach/i386/boolean.h \
+ src/third_party/mac_headers/mach/i386/vm_param.h \
+ src/third_party/mac_headers/mach/i386/vm_types.h \
+ src/third_party/mac_headers/mach/machine/boolean.h \
+ src/third_party/mac_headers/mach/machine.h \
+ src/third_party/mac_headers/mach/machine/thread_state.h \
+ src/third_party/mac_headers/mach/machine/thread_status.h \
+ src/third_party/mac_headers/mach/machine/vm_types.h \
+ src/third_party/mac_headers/mach-o/arch.h \
+ src/third_party/mac_headers/mach-o/fat.h \
+ src/third_party/mac_headers/mach-o/loader.h \
+ src/third_party/mac_headers/mach-o/nlist.h \
+ src/third_party/mac_headers/mach/thread_status.h \
+ src/third_party/mac_headers/mach/vm_prot.h \
+ src/third_party/mac_headers/README \
+ src/third_party/musl/README \
+ src/third_party/musl/COPYRIGHT \
+ src/third_party/musl/README.breakpad \
+ src/third_party/musl/VERSION \
+ src/third_party/musl/include/elf.h \
src/tools/mac/crash_report/crash_report.mm \
src/tools/mac/crash_report/crash_report.xcodeproj/project.pbxproj \
src/tools/mac/crash_report/on_demand_symbol_supplier.h \
src/tools/mac/crash_report/on_demand_symbol_supplier.mm \
src/tools/mac/dump_syms/dump_syms.xcodeproj/project.pbxproj \
- src/tools/mac/dump_syms/dump_syms_tool.m \
+ src/tools/mac/dump_syms/dump_syms_tool.cc \
src/tools/mac/symupload/minidump_upload.m \
src/tools/mac/symupload/symupload.m \
src/tools/mac/symupload/symupload.xcodeproj/project.pbxproj \
@@ -1345,12 +1557,20 @@ EXTRA_DIST = \
src/tools/solaris/dump_syms/testdata/dump_syms_regtest.sym \
src/tools/windows/converter/ms_symbol_server_converter.cc \
src/tools/windows/converter/ms_symbol_server_converter.h \
- src/tools/windows/converter/ms_symbol_server_converter.vcproj \
+ src/tools/windows/converter/ms_symbol_server_converter.gyp \
src/tools/windows/dump_syms/dump_syms.cc \
- src/tools/windows/dump_syms/dump_syms.vcproj \
+ src/tools/windows/dump_syms/dump_syms.gyp \
src/tools/windows/dump_syms/run_regtest.sh \
src/tools/windows/dump_syms/testdata/dump_syms_regtest.cc \
src/tools/windows/dump_syms/testdata/dump_syms_regtest.pdb \
src/tools/windows/dump_syms/testdata/dump_syms_regtest.sym \
+ src/tools/windows/dump_syms/testdata/dump_syms_regtest64.sym \
+ src/tools/windows/dump_syms/testdata/omap_reorder_bbs.sym \
+ src/tools/windows/dump_syms/testdata/omap_reorder_funcs.sym \
+ src/tools/windows/dump_syms/testdata/omap_stretched.sym \
+ src/tools/windows/dump_syms/testdata/omap_stretched_filled.sym \
src/tools/windows/symupload/symupload.cc \
- src/tools/windows/symupload/symupload.vcproj
+ src/tools/windows/symupload/symupload.gyp
+
+mostlyclean-local:
+ -find src -name '*.dwo' -exec rm -f {} +
diff --git a/Makefile.in b/Makefile.in
index f65165cf..f1658e44 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2017 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -48,7 +48,17 @@
VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
@@ -119,39 +129,30 @@ host_triplet = @host@
@ANDROID_HOST_TRUE@ -I$(top_srcdir)/src/common/android/include \
@ANDROID_HOST_TRUE@ -I$(top_srcdir)/src/common/android/testing/include
-# These are good warnings to be treated as errors
-@GCC_TRUE@am__append_2 = \
-@GCC_TRUE@ -Werror=missing-braces \
-@GCC_TRUE@ -Werror=non-virtual-dtor \
-@GCC_TRUE@ -Werror=overloaded-virtual \
-@GCC_TRUE@ -Werror=reorder \
-@GCC_TRUE@ -Werror=sign-compare \
-@GCC_TRUE@ -Werror=unused-variable \
-@GCC_TRUE@ -Werror=vla
-
-
# Build as PIC on Linux, for linux_client_unittest_shlib
+@LINUX_HOST_TRUE@am__append_2 = -fPIC
@LINUX_HOST_TRUE@am__append_3 = -fPIC
-@LINUX_HOST_TRUE@am__append_4 = -fPIC
-bin_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_3)
-check_PROGRAMS = $(am__EXEEXT_4) $(am__EXEEXT_5) $(am__EXEEXT_6) \
- $(am__EXEEXT_7)
-@DISABLE_PROCESSOR_FALSE@am__append_5 = src/libbreakpad.a
-@DISABLE_PROCESSOR_FALSE@am__append_6 = breakpad.pc
-@DISABLE_PROCESSOR_FALSE@am__append_7 = src/third_party/libdisasm/libdisasm.a
-@LINUX_HOST_TRUE@am__append_8 = src/client/linux/libbreakpad_client.a
-@LINUX_HOST_TRUE@am__append_9 = breakpad-client.pc
-@ANDROID_HOST_TRUE@@LINUX_HOST_TRUE@am__append_10 = \
-@ANDROID_HOST_TRUE@@LINUX_HOST_TRUE@ src/common/android/breakpad_getcontext.S
-
-@DISABLE_PROCESSOR_FALSE@am__append_11 = \
+bin_PROGRAMS = $(am__EXEEXT_2) $(am__EXEEXT_3) $(am__EXEEXT_4)
+check_PROGRAMS = $(am__EXEEXT_5) $(am__EXEEXT_6) $(am__EXEEXT_7) \
+ $(am__EXEEXT_8) $(am__EXEEXT_9)
+EXTRA_PROGRAMS = $(am__EXEEXT_1)
+@DISABLE_PROCESSOR_FALSE@am__append_4 = src/libbreakpad.a
+@DISABLE_PROCESSOR_FALSE@am__append_5 = breakpad.pc
+@DISABLE_PROCESSOR_FALSE@am__append_6 = src/third_party/libdisasm/libdisasm.a
+@LINUX_HOST_TRUE@am__append_7 = src/client/linux/libbreakpad_client.a
+@LINUX_HOST_TRUE@am__append_8 = breakpad-client.pc
+@HAVE_GETCONTEXT_FALSE@@LINUX_HOST_TRUE@am__append_9 = \
+@HAVE_GETCONTEXT_FALSE@@LINUX_HOST_TRUE@ src/common/linux/breakpad_getcontext.S
+
+@DISABLE_PROCESSOR_FALSE@am__append_10 = \
@DISABLE_PROCESSOR_FALSE@ src/processor/microdump_stackwalk \
@DISABLE_PROCESSOR_FALSE@ src/processor/minidump_dump \
@DISABLE_PROCESSOR_FALSE@ src/processor/minidump_stackwalk
-@LINUX_HOST_TRUE@am__append_12 = \
-@LINUX_HOST_TRUE@ src/client/linux/linux_dumper_unittest_helper
-
+@LINUX_HOST_TRUE@am__append_11 = src/client/linux/linux_dumper_unittest_helper \
+@LINUX_HOST_TRUE@ src/client/linux/linux_client_unittest_shlib
+@LINUX_HOST_TRUE@am__append_12 = src/client/linux/linux_dumper_unittest_helper \
+@LINUX_HOST_TRUE@ src/client/linux/linux_client_unittest_shlib
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am__append_13 = \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/core2md/core2md \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/dump_syms/dump_syms \
@@ -159,10 +160,12 @@ check_PROGRAMS = $(am__EXEEXT_4) $(am__EXEEXT_5) $(am__EXEEXT_6) \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/symupload/minidump_upload \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/symupload/sym_upload
-@DISABLE_PROCESSOR_FALSE@am__append_14 = \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@@X86_HOST_TRUE@am__append_14 = \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@@X86_HOST_TRUE@ src/tools/mac/dump_syms/dump_syms_mac
+
+@DISABLE_PROCESSOR_FALSE@am__append_15 = \
@DISABLE_PROCESSOR_FALSE@ src/common/test_assembler_unittest \
@DISABLE_PROCESSOR_FALSE@ src/processor/address_map_unittest \
-@DISABLE_PROCESSOR_FALSE@ src/processor/binarystream_unittest \
@DISABLE_PROCESSOR_FALSE@ src/processor/basic_source_line_resolver_unittest \
@DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info_unittest \
@DISABLE_PROCESSOR_FALSE@ src/processor/contained_range_map_unittest \
@@ -179,63 +182,61 @@ check_PROGRAMS = $(am__EXEEXT_4) $(am__EXEEXT_5) $(am__EXEEXT_6) \
@DISABLE_PROCESSOR_FALSE@ src/processor/static_range_map_unittest \
@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper_unittest \
@DISABLE_PROCESSOR_FALSE@ src/processor/postfix_evaluator_unittest \
+@DISABLE_PROCESSOR_FALSE@ src/processor/proc_maps_linux_unittest \
+@DISABLE_PROCESSOR_FALSE@ src/processor/range_map_truncate_lower_unittest \
+@DISABLE_PROCESSOR_FALSE@ src/processor/range_map_truncate_upper_unittest \
@DISABLE_PROCESSOR_FALSE@ src/processor/range_map_unittest \
@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_amd64_unittest \
@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm_unittest \
@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm64_unittest \
@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_address_list_unittest \
@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_mips_unittest \
+@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_mips64_unittest \
@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_x86_unittest \
@DISABLE_PROCESSOR_FALSE@ src/processor/synth_minidump_unittest
-@LINUX_HOST_TRUE@EXTRA_PROGRAMS = src/client/linux/linux_client_unittest_shlib$(EXEEXT)
-@LINUX_HOST_TRUE@am__append_15 = \
-@LINUX_HOST_TRUE@ src/client/linux/linux_client_unittest
+@LINUX_HOST_TRUE@am__append_16 = \
+@LINUX_HOST_TRUE@ src/client/linux/linux_client_unittest \
+@LINUX_HOST_TRUE@ src/common/linux/google_crashdump_uploader_test
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am__append_16 = \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am__append_17 = \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dumper_unittest \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/md2core/minidump_2_core_unittest
-@DISABLE_PROCESSOR_FALSE@@SELFTEST_TRUE@am__append_17 = \
-@DISABLE_PROCESSOR_FALSE@@SELFTEST_TRUE@ src/processor/stackwalker_selftest
-
-@ANDROID_HOST_TRUE@@LINUX_HOST_TRUE@am__append_18 = \
-@ANDROID_HOST_TRUE@@LINUX_HOST_TRUE@ src/common/android/breakpad_getcontext.S
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@@X86_HOST_TRUE@am__append_18 = \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@@X86_HOST_TRUE@ src/common/mac/macho_reader_unittest
-@ANDROID_HOST_TRUE@@LINUX_HOST_TRUE@am__append_19 = \
-@ANDROID_HOST_TRUE@@LINUX_HOST_TRUE@ src/common/android/breakpad_getcontext_unittest.cc
+@DISABLE_PROCESSOR_FALSE@@SELFTEST_TRUE@am__append_19 = \
+@DISABLE_PROCESSOR_FALSE@@SELFTEST_TRUE@ src/processor/stackwalker_selftest
-@ANDROID_HOST_TRUE@@LINUX_HOST_TRUE@am__append_20 = \
+@HAVE_GETCONTEXT_FALSE@@LINUX_HOST_TRUE@am__append_20 = src/common/linux/breakpad_getcontext.S \
+@HAVE_GETCONTEXT_FALSE@@LINUX_HOST_TRUE@ src/common/linux/breakpad_getcontext_unittest.cc
+@ANDROID_HOST_TRUE@@LINUX_HOST_TRUE@am__append_21 = \
@ANDROID_HOST_TRUE@@LINUX_HOST_TRUE@ -llog -lm
-@ANDROID_HOST_TRUE@@LINUX_HOST_TRUE@am__append_21 = \
+@ANDROID_HOST_TRUE@@LINUX_HOST_TRUE@am__append_22 = \
@ANDROID_HOST_TRUE@@LINUX_HOST_TRUE@ -llog
noinst_PROGRAMS =
subdir = .
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(top_srcdir)/configure $(am__configure_deps) \
- $(top_srcdir)/src/config.h.in $(srcdir)/breakpad.pc.in \
- $(srcdir)/breakpad-client.pc.in \
- $(top_srcdir)/autotools/depcomp $(dist_doc_DATA) \
- $(includec_HEADERS) $(am__includecl_HEADERS_DIST) \
- $(am__includeclc_HEADERS_DIST) $(am__includeclh_HEADERS_DIST) \
- $(am__includeclm_HEADERS_DIST) $(includegbc_HEADERS) \
- $(am__includelss_HEADERS_DIST) $(includep_HEADERS) \
- $(top_srcdir)/autotools/test-driver AUTHORS ChangeLog INSTALL \
- NEWS README autotools/compile autotools/config.guess \
- autotools/config.sub autotools/depcomp autotools/install-sh \
- autotools/missing autotools/ltmain.sh \
- $(top_srcdir)/autotools/compile \
- $(top_srcdir)/autotools/config.guess \
- $(top_srcdir)/autotools/config.sub \
- $(top_srcdir)/autotools/install-sh \
- $(top_srcdir)/autotools/missing
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pthread.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \
+ $(top_srcdir)/m4/ax_append_flag.m4 \
+ $(top_srcdir)/m4/ax_check_compile_flag.m4 \
+ $(top_srcdir)/m4/ax_check_define.m4 \
+ $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \
+ $(top_srcdir)/m4/ax_pthread.m4 \
+ $(top_srcdir)/m4/ax_require_defined.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
+ $(am__configure_deps) $(dist_doc_DATA) $(includec_HEADERS) \
+ $(am__includecl_HEADERS_DIST) $(am__includeclc_HEADERS_DIST) \
+ $(am__includecldwc_HEADERS_DIST) \
+ $(am__includeclh_HEADERS_DIST) $(am__includeclm_HEADERS_DIST) \
+ $(includegbc_HEADERS) $(am__includelss_HEADERS_DIST) \
+ $(includep_HEADERS) $(am__DIST_COMMON)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno
mkinstalldirs = $(install_sh) -d
@@ -272,50 +273,58 @@ am__uninstall_files_from_dir = { \
am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \
"$(DESTDIR)$(docdir)" "$(DESTDIR)$(pkgconfigdir)" \
"$(DESTDIR)$(includecdir)" "$(DESTDIR)$(includecldir)" \
- "$(DESTDIR)$(includeclcdir)" "$(DESTDIR)$(includeclhdir)" \
- "$(DESTDIR)$(includeclmdir)" "$(DESTDIR)$(includegbcdir)" \
- "$(DESTDIR)$(includelssdir)" "$(DESTDIR)$(includepdir)"
+ "$(DESTDIR)$(includeclcdir)" "$(DESTDIR)$(includecldwcdir)" \
+ "$(DESTDIR)$(includeclhdir)" "$(DESTDIR)$(includeclmdir)" \
+ "$(DESTDIR)$(includegbcdir)" "$(DESTDIR)$(includelssdir)" \
+ "$(DESTDIR)$(includepdir)"
LIBRARIES = $(lib_LIBRARIES) $(noinst_LIBRARIES)
-AR = ar
ARFLAGS = cru
AM_V_AR = $(am__v_AR_@AM_V@)
am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@)
am__v_AR_0 = @echo " AR " $@;
-am__v_AR_1 =
+am__v_AR_1 =
src_client_linux_libbreakpad_client_a_AR = $(AR) $(ARFLAGS)
src_client_linux_libbreakpad_client_a_LIBADD =
am__src_client_linux_libbreakpad_client_a_SOURCES_DIST = \
src/client/linux/crash_generation/crash_generation_client.cc \
src/client/linux/crash_generation/crash_generation_server.cc \
- src/client/linux/dump_writer_common/seccomp_unwinder.cc \
src/client/linux/dump_writer_common/thread_info.cc \
src/client/linux/dump_writer_common/ucontext_reader.cc \
src/client/linux/handler/exception_handler.cc \
+ src/client/linux/handler/exception_handler.h \
src/client/linux/handler/minidump_descriptor.cc \
- src/client/linux/log/log.cc \
+ src/client/linux/handler/minidump_descriptor.h \
+ src/client/linux/log/log.cc src/client/linux/log/log.h \
src/client/linux/microdump_writer/microdump_writer.cc \
+ src/client/linux/microdump_writer/microdump_writer.h \
+ src/client/linux/minidump_writer/linux_core_dumper.cc \
src/client/linux/minidump_writer/linux_dumper.cc \
src/client/linux/minidump_writer/linux_ptrace_dumper.cc \
src/client/linux/minidump_writer/minidump_writer.cc \
- src/client/minidump_file_writer.cc src/common/convert_UTF.c \
- src/common/md5.cc src/common/string_conversion.cc \
- src/common/linux/elfutils.cc src/common/linux/file_id.cc \
- src/common/linux/guid_creator.cc \
+ src/client/minidump_file_writer-inl.h \
+ src/client/minidump_file_writer.cc \
+ src/client/minidump_file_writer.h src/common/convert_UTF.cc \
+ src/common/convert_UTF.h src/common/md5.cc src/common/md5.h \
+ src/common/string_conversion.cc src/common/string_conversion.h \
+ src/common/linux/elf_core_dump.cc src/common/linux/elfutils.cc \
+ src/common/linux/elfutils.h src/common/linux/file_id.cc \
+ src/common/linux/file_id.h src/common/linux/guid_creator.cc \
+ src/common/linux/guid_creator.h \
src/common/linux/linux_libc_support.cc \
src/common/linux/memory_mapped_file.cc \
src/common/linux/safe_readlink.cc \
- src/common/android/breakpad_getcontext.S
+ src/common/linux/breakpad_getcontext.S
am__dirstamp = $(am__leading_dot)dirstamp
-@ANDROID_HOST_TRUE@@LINUX_HOST_TRUE@am__objects_1 = src/common/android/breakpad_getcontext.$(OBJEXT)
+@HAVE_GETCONTEXT_FALSE@@LINUX_HOST_TRUE@am__objects_1 = src/common/linux/breakpad_getcontext.$(OBJEXT)
@LINUX_HOST_TRUE@am_src_client_linux_libbreakpad_client_a_OBJECTS = src/client/linux/crash_generation/crash_generation_client.$(OBJEXT) \
@LINUX_HOST_TRUE@ src/client/linux/crash_generation/crash_generation_server.$(OBJEXT) \
-@LINUX_HOST_TRUE@ src/client/linux/dump_writer_common/seccomp_unwinder.$(OBJEXT) \
@LINUX_HOST_TRUE@ src/client/linux/dump_writer_common/thread_info.$(OBJEXT) \
@LINUX_HOST_TRUE@ src/client/linux/dump_writer_common/ucontext_reader.$(OBJEXT) \
@LINUX_HOST_TRUE@ src/client/linux/handler/exception_handler.$(OBJEXT) \
@LINUX_HOST_TRUE@ src/client/linux/handler/minidump_descriptor.$(OBJEXT) \
@LINUX_HOST_TRUE@ src/client/linux/log/log.$(OBJEXT) \
@LINUX_HOST_TRUE@ src/client/linux/microdump_writer/microdump_writer.$(OBJEXT) \
+@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_core_dumper.$(OBJEXT) \
@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_dumper.$(OBJEXT) \
@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_ptrace_dumper.$(OBJEXT) \
@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/minidump_writer.$(OBJEXT) \
@@ -323,6 +332,7 @@ am__dirstamp = $(am__leading_dot)dirstamp
@LINUX_HOST_TRUE@ src/common/convert_UTF.$(OBJEXT) \
@LINUX_HOST_TRUE@ src/common/md5.$(OBJEXT) \
@LINUX_HOST_TRUE@ src/common/string_conversion.$(OBJEXT) \
+@LINUX_HOST_TRUE@ src/common/linux/elf_core_dump.$(OBJEXT) \
@LINUX_HOST_TRUE@ src/common/linux/elfutils.$(OBJEXT) \
@LINUX_HOST_TRUE@ src/common/linux/file_id.$(OBJEXT) \
@LINUX_HOST_TRUE@ src/common/linux/guid_creator.$(OBJEXT) \
@@ -333,7 +343,7 @@ am__dirstamp = $(am__leading_dot)dirstamp
src_client_linux_libbreakpad_client_a_OBJECTS = \
$(am_src_client_linux_libbreakpad_client_a_OBJECTS)
src_libbreakpad_a_AR = $(AR) $(ARFLAGS)
-@DISABLE_PROCESSOR_FALSE@src_libbreakpad_a_DEPENDENCIES = src/third_party/libdisasm/libdisasm.a
+src_libbreakpad_a_LIBADD =
am__src_libbreakpad_a_SOURCES_DIST = \
src/google_breakpad/common/breakpad_types.h \
src/google_breakpad/common/minidump_format.h \
@@ -353,6 +363,7 @@ am__src_libbreakpad_a_SOURCES_DIST = \
src/google_breakpad/processor/minidump_processor.h \
src/google_breakpad/processor/process_result.h \
src/google_breakpad/processor/process_state.h \
+ src/google_breakpad/processor/proc_maps_linux.h \
src/google_breakpad/processor/source_line_resolver_base.h \
src/google_breakpad/processor/source_line_resolver_interface.h \
src/google_breakpad/processor/stack_frame.h \
@@ -367,11 +378,12 @@ am__src_libbreakpad_a_SOURCES_DIST = \
src/processor/basic_code_modules.h \
src/processor/basic_source_line_resolver_types.h \
src/processor/basic_source_line_resolver.cc \
- src/processor/binarystream.h src/processor/binarystream.cc \
src/processor/call_stack.cc src/processor/cfi_frame_info.cc \
src/processor/cfi_frame_info.h \
src/processor/contained_range_map-inl.h \
src/processor/contained_range_map.h \
+ src/processor/convert_old_arm64_context.cc \
+ src/processor/convert_old_arm64_context.h \
src/processor/disassembler_x86.h \
src/processor/disassembler_x86.cc \
src/processor/dump_context.cc src/processor/dump_object.cc \
@@ -395,7 +407,8 @@ am__src_libbreakpad_a_SOURCES_DIST = \
src/processor/pathname_stripper.h \
src/processor/postfix_evaluator-inl.h \
src/processor/postfix_evaluator.h \
- src/processor/process_state.cc src/processor/range_map-inl.h \
+ src/processor/process_state.cc \
+ src/processor/proc_maps_linux.cc src/processor/range_map-inl.h \
src/processor/range_map.h \
src/processor/simple_serializer-inl.h \
src/processor/simple_serializer.h \
@@ -439,9 +452,9 @@ am__src_libbreakpad_a_SOURCES_DIST = \
src/processor/tokenize.cc src/processor/tokenize.h
@DISABLE_PROCESSOR_FALSE@am_src_libbreakpad_a_OBJECTS = src/processor/basic_code_modules.$(OBJEXT) \
@DISABLE_PROCESSOR_FALSE@ src/processor/basic_source_line_resolver.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/binarystream.$(OBJEXT) \
@DISABLE_PROCESSOR_FALSE@ src/processor/call_stack.$(OBJEXT) \
@DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info.$(OBJEXT) \
+@DISABLE_PROCESSOR_FALSE@ src/processor/convert_old_arm64_context.$(OBJEXT) \
@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_x86.$(OBJEXT) \
@DISABLE_PROCESSOR_FALSE@ src/processor/dump_context.$(OBJEXT) \
@DISABLE_PROCESSOR_FALSE@ src/processor/dump_object.$(OBJEXT) \
@@ -458,6 +471,7 @@ am__src_libbreakpad_a_SOURCES_DIST = \
@DISABLE_PROCESSOR_FALSE@ src/processor/module_serializer.$(OBJEXT) \
@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.$(OBJEXT) \
@DISABLE_PROCESSOR_FALSE@ src/processor/process_state.$(OBJEXT) \
+@DISABLE_PROCESSOR_FALSE@ src/processor/proc_maps_linux.$(OBJEXT) \
@DISABLE_PROCESSOR_FALSE@ src/processor/simple_symbol_supplier.$(OBJEXT) \
@DISABLE_PROCESSOR_FALSE@ src/processor/source_line_resolver_base.$(OBJEXT) \
@DISABLE_PROCESSOR_FALSE@ src/processor/stack_frame_cpu.$(OBJEXT) \
@@ -475,6 +489,18 @@ am__src_libbreakpad_a_SOURCES_DIST = \
@DISABLE_PROCESSOR_FALSE@ src/processor/symbolic_constants_win.$(OBJEXT) \
@DISABLE_PROCESSOR_FALSE@ src/processor/tokenize.$(OBJEXT)
src_libbreakpad_a_OBJECTS = $(am_src_libbreakpad_a_OBJECTS)
+src_testing_libtesting_a_AR = $(AR) $(ARFLAGS)
+src_testing_libtesting_a_LIBADD =
+am__src_testing_libtesting_a_SOURCES_DIST = \
+ src/breakpad_googletest_includes.h \
+ src/testing/googletest/src/gtest-all.cc \
+ src/testing/googletest/src/gtest_main.cc \
+ src/testing/googlemock/src/gmock-all.cc
+@SYSTEM_TEST_LIBS_FALSE@am_src_testing_libtesting_a_OBJECTS = src/testing/googletest/src/src_testing_libtesting_a-gtest-all.$(OBJEXT) \
+@SYSTEM_TEST_LIBS_FALSE@ src/testing/googletest/src/src_testing_libtesting_a-gtest_main.$(OBJEXT) \
+@SYSTEM_TEST_LIBS_FALSE@ src/testing/googlemock/src/src_testing_libtesting_a-gmock-all.$(OBJEXT)
+src_testing_libtesting_a_OBJECTS = \
+ $(am_src_testing_libtesting_a_OBJECTS)
src_third_party_libdisasm_libdisasm_a_AR = $(AR) $(ARFLAGS)
src_third_party_libdisasm_libdisasm_a_LIBADD =
am__src_third_party_libdisasm_libdisasm_a_SOURCES_DIST = \
@@ -520,18 +546,19 @@ am__src_third_party_libdisasm_libdisasm_a_SOURCES_DIST = \
@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/x86_operand_list.$(OBJEXT)
src_third_party_libdisasm_libdisasm_a_OBJECTS = \
$(am_src_third_party_libdisasm_libdisasm_a_OBJECTS)
-@DISABLE_PROCESSOR_FALSE@am__EXEEXT_1 = src/processor/microdump_stackwalk$(EXEEXT) \
+@LINUX_HOST_TRUE@am__EXEEXT_1 = src/client/linux/linux_dumper_unittest_helper$(EXEEXT) \
+@LINUX_HOST_TRUE@ src/client/linux/linux_client_unittest_shlib$(EXEEXT)
+@DISABLE_PROCESSOR_FALSE@am__EXEEXT_2 = src/processor/microdump_stackwalk$(EXEEXT) \
@DISABLE_PROCESSOR_FALSE@ src/processor/minidump_dump$(EXEEXT) \
@DISABLE_PROCESSOR_FALSE@ src/processor/minidump_stackwalk$(EXEEXT)
-@LINUX_HOST_TRUE@am__EXEEXT_2 = src/client/linux/linux_dumper_unittest_helper$(EXEEXT)
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am__EXEEXT_3 = src/tools/linux/core2md/core2md$(EXEEXT) \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/dump_syms/dump_syms$(EXEEXT) \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/md2core/minidump-2-core$(EXEEXT) \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/symupload/minidump_upload$(EXEEXT) \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/symupload/sym_upload$(EXEEXT)
-@DISABLE_PROCESSOR_FALSE@am__EXEEXT_4 = src/common/test_assembler_unittest$(EXEEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@@X86_HOST_TRUE@am__EXEEXT_4 = src/tools/mac/dump_syms/dump_syms_mac$(EXEEXT)
+@DISABLE_PROCESSOR_FALSE@am__EXEEXT_5 = src/common/test_assembler_unittest$(EXEEXT) \
@DISABLE_PROCESSOR_FALSE@ src/processor/address_map_unittest$(EXEEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/binarystream_unittest$(EXEEXT) \
@DISABLE_PROCESSOR_FALSE@ src/processor/basic_source_line_resolver_unittest$(EXEEXT) \
@DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info_unittest$(EXEEXT) \
@DISABLE_PROCESSOR_FALSE@ src/processor/contained_range_map_unittest$(EXEEXT) \
@@ -548,27 +575,42 @@ src_third_party_libdisasm_libdisasm_a_OBJECTS = \
@DISABLE_PROCESSOR_FALSE@ src/processor/static_range_map_unittest$(EXEEXT) \
@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper_unittest$(EXEEXT) \
@DISABLE_PROCESSOR_FALSE@ src/processor/postfix_evaluator_unittest$(EXEEXT) \
+@DISABLE_PROCESSOR_FALSE@ src/processor/proc_maps_linux_unittest$(EXEEXT) \
+@DISABLE_PROCESSOR_FALSE@ src/processor/range_map_truncate_lower_unittest$(EXEEXT) \
+@DISABLE_PROCESSOR_FALSE@ src/processor/range_map_truncate_upper_unittest$(EXEEXT) \
@DISABLE_PROCESSOR_FALSE@ src/processor/range_map_unittest$(EXEEXT) \
@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_amd64_unittest$(EXEEXT) \
@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm_unittest$(EXEEXT) \
@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm64_unittest$(EXEEXT) \
@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_address_list_unittest$(EXEEXT) \
@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_mips_unittest$(EXEEXT) \
+@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_mips64_unittest$(EXEEXT) \
@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_x86_unittest$(EXEEXT) \
@DISABLE_PROCESSOR_FALSE@ src/processor/synth_minidump_unittest$(EXEEXT)
-@LINUX_HOST_TRUE@am__EXEEXT_5 = src/client/linux/linux_client_unittest$(EXEEXT)
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am__EXEEXT_6 = src/common/dumper_unittest$(EXEEXT) \
+@LINUX_HOST_TRUE@am__EXEEXT_6 = src/client/linux/linux_client_unittest$(EXEEXT) \
+@LINUX_HOST_TRUE@ src/common/linux/google_crashdump_uploader_test$(EXEEXT)
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am__EXEEXT_7 = src/common/dumper_unittest$(EXEEXT) \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/md2core/minidump_2_core_unittest$(EXEEXT)
-@DISABLE_PROCESSOR_FALSE@@SELFTEST_TRUE@am__EXEEXT_7 = src/processor/stackwalker_selftest$(EXEEXT)
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@@X86_HOST_TRUE@am__EXEEXT_8 = src/common/mac/macho_reader_unittest$(EXEEXT)
+@DISABLE_PROCESSOR_FALSE@@SELFTEST_TRUE@am__EXEEXT_9 = src/processor/stackwalker_selftest$(EXEEXT)
PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS)
am_src_client_linux_linux_client_unittest_OBJECTS =
src_client_linux_linux_client_unittest_OBJECTS = \
$(am_src_client_linux_linux_client_unittest_OBJECTS)
+am__DEPENDENCIES_1 =
+@SYSTEM_TEST_LIBS_FALSE@am__DEPENDENCIES_2 = src/testing/libtesting.a
+@SYSTEM_TEST_LIBS_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) \
+@SYSTEM_TEST_LIBS_TRUE@ $(am__DEPENDENCIES_1)
src_client_linux_linux_client_unittest_LINK = $(CCLD) $(AM_CFLAGS) \
$(CFLAGS) $(src_client_linux_linux_client_unittest_LDFLAGS) \
$(LDFLAGS) -o $@
am__src_client_linux_linux_client_unittest_shlib_SOURCES_DIST = \
+ src/breakpad_googletest_includes.h \
+ src/testing/googletest/src/gtest-all.cc \
+ src/testing/googletest/src/gtest_main.cc \
+ src/testing/googlemock/src/gmock-all.cc \
src/client/linux/handler/exception_handler_unittest.cc \
+ src/client/linux/microdump_writer/microdump_writer_unittest.cc \
src/client/linux/minidump_writer/directory_reader_unittest.cc \
src/client/linux/minidump_writer/cpu_set_unittest.cc \
src/client/linux/minidump_writer/line_reader_unittest.cc \
@@ -580,21 +622,28 @@ am__src_client_linux_linux_client_unittest_shlib_SOURCES_DIST = \
src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc \
src/common/linux/elf_core_dump.cc \
src/common/linux/linux_libc_support_unittest.cc \
+ src/common/linux/tests/auto_testfile.h \
src/common/linux/tests/crash_generator.cc \
- src/common/memory_unittest.cc src/common/tests/file_utils.cc \
- src/testing/gtest/src/gtest-all.cc \
- src/testing/gtest/src/gtest_main.cc \
- src/testing/src/gmock-all.cc \
+ src/common/memory_allocator_unittest.cc \
+ src/common/tests/auto_tempdir.h src/common/tests/file_utils.cc \
+ src/common/tests/file_utils.h \
src/processor/basic_code_modules.cc \
+ src/processor/convert_old_arm64_context.cc \
src/processor/dump_context.cc src/processor/dump_object.cc \
src/processor/logging.cc src/processor/minidump.cc \
src/processor/pathname_stripper.cc \
- src/common/android/breakpad_getcontext.S \
- src/client/linux/microdump_writer/microdump_writer_unittest.cc \
- src/common/android/breakpad_getcontext_unittest.cc
-@ANDROID_HOST_TRUE@@LINUX_HOST_TRUE@am__objects_2 = src/common/android/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext.$(OBJEXT)
-@ANDROID_HOST_TRUE@@LINUX_HOST_TRUE@am__objects_3 = src/common/android/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.$(OBJEXT)
-@LINUX_HOST_TRUE@am_src_client_linux_linux_client_unittest_shlib_OBJECTS = src/client/linux/handler/src_client_linux_linux_client_unittest_shlib-exception_handler_unittest.$(OBJEXT) \
+ src/processor/proc_maps_linux.cc \
+ src/common/linux/breakpad_getcontext.S \
+ src/common/linux/breakpad_getcontext_unittest.cc
+@SYSTEM_TEST_LIBS_FALSE@am__objects_2 = src/testing/googletest/src/src_client_linux_linux_client_unittest_shlib-gtest-all.$(OBJEXT) \
+@SYSTEM_TEST_LIBS_FALSE@ src/testing/googletest/src/src_client_linux_linux_client_unittest_shlib-gtest_main.$(OBJEXT) \
+@SYSTEM_TEST_LIBS_FALSE@ src/testing/googlemock/src/src_client_linux_linux_client_unittest_shlib-gmock-all.$(OBJEXT)
+@HAVE_GETCONTEXT_FALSE@@LINUX_HOST_TRUE@am__objects_3 = src/common/linux/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext.$(OBJEXT) \
+@HAVE_GETCONTEXT_FALSE@@LINUX_HOST_TRUE@ src/common/linux/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.$(OBJEXT)
+@LINUX_HOST_TRUE@am_src_client_linux_linux_client_unittest_shlib_OBJECTS = \
+@LINUX_HOST_TRUE@ $(am__objects_2) \
+@LINUX_HOST_TRUE@ src/client/linux/handler/src_client_linux_linux_client_unittest_shlib-exception_handler_unittest.$(OBJEXT) \
+@LINUX_HOST_TRUE@ src/client/linux/microdump_writer/src_client_linux_linux_client_unittest_shlib-microdump_writer_unittest.$(OBJEXT) \
@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-directory_reader_unittest.$(OBJEXT) \
@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-cpu_set_unittest.$(OBJEXT) \
@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-line_reader_unittest.$(OBJEXT) \
@@ -607,23 +656,19 @@ am__src_client_linux_linux_client_unittest_shlib_SOURCES_DIST = \
@LINUX_HOST_TRUE@ src/common/linux/src_client_linux_linux_client_unittest_shlib-elf_core_dump.$(OBJEXT) \
@LINUX_HOST_TRUE@ src/common/linux/src_client_linux_linux_client_unittest_shlib-linux_libc_support_unittest.$(OBJEXT) \
@LINUX_HOST_TRUE@ src/common/linux/tests/src_client_linux_linux_client_unittest_shlib-crash_generator.$(OBJEXT) \
-@LINUX_HOST_TRUE@ src/common/src_client_linux_linux_client_unittest_shlib-memory_unittest.$(OBJEXT) \
+@LINUX_HOST_TRUE@ src/common/src_client_linux_linux_client_unittest_shlib-memory_allocator_unittest.$(OBJEXT) \
@LINUX_HOST_TRUE@ src/common/tests/src_client_linux_linux_client_unittest_shlib-file_utils.$(OBJEXT) \
-@LINUX_HOST_TRUE@ src/testing/gtest/src/src_client_linux_linux_client_unittest_shlib-gtest-all.$(OBJEXT) \
-@LINUX_HOST_TRUE@ src/testing/gtest/src/src_client_linux_linux_client_unittest_shlib-gtest_main.$(OBJEXT) \
-@LINUX_HOST_TRUE@ src/testing/src/src_client_linux_linux_client_unittest_shlib-gmock-all.$(OBJEXT) \
@LINUX_HOST_TRUE@ src/processor/src_client_linux_linux_client_unittest_shlib-basic_code_modules.$(OBJEXT) \
+@LINUX_HOST_TRUE@ src/processor/src_client_linux_linux_client_unittest_shlib-convert_old_arm64_context.$(OBJEXT) \
@LINUX_HOST_TRUE@ src/processor/src_client_linux_linux_client_unittest_shlib-dump_context.$(OBJEXT) \
@LINUX_HOST_TRUE@ src/processor/src_client_linux_linux_client_unittest_shlib-dump_object.$(OBJEXT) \
@LINUX_HOST_TRUE@ src/processor/src_client_linux_linux_client_unittest_shlib-logging.$(OBJEXT) \
@LINUX_HOST_TRUE@ src/processor/src_client_linux_linux_client_unittest_shlib-minidump.$(OBJEXT) \
@LINUX_HOST_TRUE@ src/processor/src_client_linux_linux_client_unittest_shlib-pathname_stripper.$(OBJEXT) \
-@LINUX_HOST_TRUE@ $(am__objects_2) \
-@LINUX_HOST_TRUE@ src/client/linux/microdump_writer/src_client_linux_linux_client_unittest_shlib-microdump_writer_unittest.$(OBJEXT) \
+@LINUX_HOST_TRUE@ src/processor/src_client_linux_linux_client_unittest_shlib-proc_maps_linux.$(OBJEXT) \
@LINUX_HOST_TRUE@ $(am__objects_3)
src_client_linux_linux_client_unittest_shlib_OBJECTS = \
$(am_src_client_linux_linux_client_unittest_shlib_OBJECTS)
-am__DEPENDENCIES_1 =
src_client_linux_linux_client_unittest_shlib_LINK = $(CXXLD) \
$(AM_CXXFLAGS) $(CXXFLAGS) \
$(src_client_linux_linux_client_unittest_shlib_LDFLAGS) \
@@ -639,26 +684,35 @@ src_client_linux_linux_dumper_unittest_helper_LINK = $(CXXLD) \
$(src_client_linux_linux_dumper_unittest_helper_LDFLAGS) \
$(LDFLAGS) -o $@
am__src_common_dumper_unittest_SOURCES_DIST = \
- src/common/byte_cursor_unittest.cc \
+ src/common/byte_cursor_unittest.cc src/common/convert_UTF.cc \
src/common/dwarf_cfi_to_module.cc \
src/common/dwarf_cfi_to_module_unittest.cc \
src/common/dwarf_cu_to_module.cc \
src/common/dwarf_cu_to_module_unittest.cc \
src/common/dwarf_line_to_module.cc \
src/common/dwarf_line_to_module_unittest.cc \
- src/common/language.cc src/common/memory_range_unittest.cc \
- src/common/module.cc src/common/module_unittest.cc \
+ src/common/dwarf_range_list_handler.cc src/common/language.cc \
+ src/common/memory_range_unittest.cc src/common/module.cc \
+ src/common/module_unittest.cc src/common/path_helper.cc \
src/common/stabs_reader.cc src/common/stabs_reader_unittest.cc \
src/common/stabs_to_module.cc \
src/common/stabs_to_module_unittest.cc \
+ src/common/string_conversion.cc \
+ src/common/string_conversion_unittest.cc \
src/common/test_assembler.cc src/common/dwarf/bytereader.cc \
+ src/common/dwarf/bytereader.h \
+ src/common/dwarf/bytereader-inl.h \
src/common/dwarf/bytereader_unittest.cc \
src/common/dwarf/cfi_assembler.cc \
+ src/common/dwarf/cfi_assembler.h \
src/common/dwarf/dwarf2diehandler.cc \
src/common/dwarf/dwarf2diehandler_unittest.cc \
src/common/dwarf/dwarf2reader.cc \
+ src/common/dwarf/dwarf2reader.h src/common/dwarf/elf_reader.cc \
+ src/common/dwarf/elf_reader.h \
src/common/dwarf/dwarf2reader_cfi_unittest.cc \
src/common/dwarf/dwarf2reader_die_unittest.cc \
+ src/common/dwarf/dwarf2reader_test_common.h \
src/common/linux/crc32.cc src/common/linux/dump_symbols.cc \
src/common/linux/dump_symbols_unittest.cc \
src/common/linux/elf_core_dump.cc \
@@ -675,25 +729,29 @@ am__src_common_dumper_unittest_SOURCES_DIST = \
src/common/linux/synth_elf.cc \
src/common/linux/synth_elf_unittest.cc \
src/common/linux/tests/crash_generator.cc \
- src/common/tests/file_utils.cc \
- src/testing/gtest/src/gtest-all.cc \
- src/testing/gtest/src/gtest_main.cc \
- src/testing/src/gmock-all.cc
+ src/common/linux/tests/crash_generator.h \
+ src/common/testdata/func-line-pairing.h \
+ src/common/tests/file_utils.cc
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am_src_common_dumper_unittest_OBJECTS = src/common/src_common_dumper_unittest-byte_cursor_unittest.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_common_dumper_unittest-convert_UTF.$(OBJEXT) \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_common_dumper_unittest-dwarf_cfi_to_module.$(OBJEXT) \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_common_dumper_unittest-dwarf_cfi_to_module_unittest.$(OBJEXT) \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_common_dumper_unittest-dwarf_cu_to_module.$(OBJEXT) \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_common_dumper_unittest-dwarf_cu_to_module_unittest.$(OBJEXT) \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_common_dumper_unittest-dwarf_line_to_module.$(OBJEXT) \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_common_dumper_unittest-dwarf_line_to_module_unittest.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_common_dumper_unittest-dwarf_range_list_handler.$(OBJEXT) \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_common_dumper_unittest-language.$(OBJEXT) \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_common_dumper_unittest-memory_range_unittest.$(OBJEXT) \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_common_dumper_unittest-module.$(OBJEXT) \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_common_dumper_unittest-module_unittest.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_common_dumper_unittest-path_helper.$(OBJEXT) \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_common_dumper_unittest-stabs_reader.$(OBJEXT) \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_common_dumper_unittest-stabs_reader_unittest.$(OBJEXT) \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_common_dumper_unittest-stabs_to_module.$(OBJEXT) \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_common_dumper_unittest-stabs_to_module_unittest.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_common_dumper_unittest-string_conversion.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_common_dumper_unittest-string_conversion_unittest.$(OBJEXT) \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_common_dumper_unittest-test_assembler.$(OBJEXT) \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/src_common_dumper_unittest-bytereader.$(OBJEXT) \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/src_common_dumper_unittest-bytereader_unittest.$(OBJEXT) \
@@ -701,6 +759,7 @@ am__src_common_dumper_unittest_SOURCES_DIST = \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/src_common_dumper_unittest-dwarf2diehandler.$(OBJEXT) \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/src_common_dumper_unittest-dwarf2diehandler_unittest.$(OBJEXT) \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/src_common_dumper_unittest-dwarf2reader.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/src_common_dumper_unittest-elf_reader.$(OBJEXT) \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/src_common_dumper_unittest-dwarf2reader_cfi_unittest.$(OBJEXT) \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/src_common_dumper_unittest-dwarf2reader_die_unittest.$(OBJEXT) \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/src_common_dumper_unittest-crc32.$(OBJEXT) \
@@ -721,29 +780,81 @@ am__src_common_dumper_unittest_SOURCES_DIST = \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/src_common_dumper_unittest-synth_elf.$(OBJEXT) \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/src_common_dumper_unittest-synth_elf_unittest.$(OBJEXT) \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/tests/src_common_dumper_unittest-crash_generator.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/tests/src_common_dumper_unittest-file_utils.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/testing/gtest/src/src_common_dumper_unittest-gtest-all.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/testing/gtest/src/src_common_dumper_unittest-gtest_main.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/testing/src/src_common_dumper_unittest-gmock-all.$(OBJEXT)
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/tests/src_common_dumper_unittest-file_utils.$(OBJEXT)
src_common_dumper_unittest_OBJECTS = \
$(am_src_common_dumper_unittest_OBJECTS)
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_common_dumper_unittest_DEPENDENCIES = \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(am__DEPENDENCIES_2) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(am__DEPENDENCIES_1) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(am__DEPENDENCIES_1) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(am__DEPENDENCIES_1)
+am__src_common_linux_google_crashdump_uploader_test_SOURCES_DIST = \
+ src/common/linux/google_crashdump_uploader.cc \
+ src/common/linux/google_crashdump_uploader_test.cc \
+ src/common/linux/libcurl_wrapper.cc
+@LINUX_HOST_TRUE@am_src_common_linux_google_crashdump_uploader_test_OBJECTS = src/common/linux/src_common_linux_google_crashdump_uploader_test-google_crashdump_uploader.$(OBJEXT) \
+@LINUX_HOST_TRUE@ src/common/linux/src_common_linux_google_crashdump_uploader_test-google_crashdump_uploader_test.$(OBJEXT) \
+@LINUX_HOST_TRUE@ src/common/linux/src_common_linux_google_crashdump_uploader_test-libcurl_wrapper.$(OBJEXT)
+src_common_linux_google_crashdump_uploader_test_OBJECTS = \
+ $(am_src_common_linux_google_crashdump_uploader_test_OBJECTS)
+@LINUX_HOST_TRUE@src_common_linux_google_crashdump_uploader_test_DEPENDENCIES = \
+@LINUX_HOST_TRUE@ $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \
+@LINUX_HOST_TRUE@ $(am__DEPENDENCIES_1)
+am__src_common_mac_macho_reader_unittest_SOURCES_DIST = \
+ src/common/dwarf_cfi_to_module.cc \
+ src/common/dwarf_cu_to_module.cc \
+ src/common/dwarf_line_to_module.cc src/common/language.cc \
+ src/common/md5.cc src/common/module.cc \
+ src/common/path_helper.cc src/common/stabs_reader.cc \
+ src/common/stabs_to_module.cc src/common/test_assembler.cc \
+ src/common/dwarf/bytereader.cc \
+ src/common/dwarf/cfi_assembler.cc \
+ src/common/dwarf/dwarf2diehandler.cc \
+ src/common/dwarf/dwarf2reader.cc \
+ src/common/dwarf/elf_reader.cc \
+ src/common/mac/arch_utilities.cc src/common/mac/file_id.cc \
+ src/common/mac/macho_id.cc src/common/mac/macho_reader.cc \
+ src/common/mac/macho_reader_unittest.cc \
+ src/common/mac/macho_utilities.cc \
+ src/common/mac/macho_walker.cc src/common/tests/file_utils.cc
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am_src_common_mac_macho_reader_unittest_OBJECTS = src/common/src_common_mac_macho_reader_unittest-dwarf_cfi_to_module.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_common_mac_macho_reader_unittest-dwarf_cu_to_module.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_common_mac_macho_reader_unittest-dwarf_line_to_module.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_common_mac_macho_reader_unittest-language.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_common_mac_macho_reader_unittest-md5.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_common_mac_macho_reader_unittest-module.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_common_mac_macho_reader_unittest-path_helper.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_common_mac_macho_reader_unittest-stabs_reader.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_common_mac_macho_reader_unittest-stabs_to_module.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_common_mac_macho_reader_unittest-test_assembler.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/src_common_mac_macho_reader_unittest-bytereader.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/src_common_mac_macho_reader_unittest-cfi_assembler.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/src_common_mac_macho_reader_unittest-dwarf2diehandler.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/src_common_mac_macho_reader_unittest-dwarf2reader.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/src_common_mac_macho_reader_unittest-elf_reader.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/src_common_mac_macho_reader_unittest-arch_utilities.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/src_common_mac_macho_reader_unittest-file_id.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/src_common_mac_macho_reader_unittest-macho_id.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/src_common_mac_macho_reader_unittest-macho_reader.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/src_common_mac_macho_reader_unittest-macho_reader_unittest.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/src_common_mac_macho_reader_unittest-macho_utilities.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/src_common_mac_macho_reader_unittest-macho_walker.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/tests/src_common_mac_macho_reader_unittest-file_utils.$(OBJEXT)
+src_common_mac_macho_reader_unittest_OBJECTS = \
+ $(am_src_common_mac_macho_reader_unittest_OBJECTS)
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_common_mac_macho_reader_unittest_DEPENDENCIES = \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(am__DEPENDENCIES_2) \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(am__DEPENDENCIES_1) \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(am__DEPENDENCIES_1)
am__src_common_test_assembler_unittest_SOURCES_DIST = \
src/common/test_assembler.cc src/common/test_assembler.h \
- src/common/test_assembler_unittest.cc \
- src/testing/gtest/src/gtest-all.cc \
- src/testing/gtest/src/gtest_main.cc \
- src/testing/src/gmock-all.cc
+ src/common/test_assembler_unittest.cc
@DISABLE_PROCESSOR_FALSE@am_src_common_test_assembler_unittest_OBJECTS = src/common/src_common_test_assembler_unittest-test_assembler.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/common/src_common_test_assembler_unittest-test_assembler_unittest.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/testing/gtest/src/src_common_test_assembler_unittest-gtest-all.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/testing/gtest/src/src_common_test_assembler_unittest-gtest_main.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/testing/src/src_common_test_assembler_unittest-gmock-all.$(OBJEXT)
+@DISABLE_PROCESSOR_FALSE@ src/common/src_common_test_assembler_unittest-test_assembler_unittest.$(OBJEXT)
src_common_test_assembler_unittest_OBJECTS = \
$(am_src_common_test_assembler_unittest_OBJECTS)
@DISABLE_PROCESSOR_FALSE@src_common_test_assembler_unittest_DEPENDENCIES = \
+@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \
@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \
@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1)
am__src_processor_address_map_unittest_SOURCES_DIST = \
@@ -755,12 +866,8 @@ src_processor_address_map_unittest_OBJECTS = \
@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o
am__src_processor_basic_source_line_resolver_unittest_SOURCES_DIST = \
- src/processor/basic_source_line_resolver_unittest.cc \
- src/testing/gtest/src/gtest-all.cc \
- src/testing/src/gmock-all.cc
-@DISABLE_PROCESSOR_FALSE@am_src_processor_basic_source_line_resolver_unittest_OBJECTS = src/processor/src_processor_basic_source_line_resolver_unittest-basic_source_line_resolver_unittest.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/testing/gtest/src/src_processor_basic_source_line_resolver_unittest-gtest-all.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/testing/src/src_processor_basic_source_line_resolver_unittest-gmock-all.$(OBJEXT)
+ src/processor/basic_source_line_resolver_unittest.cc
+@DISABLE_PROCESSOR_FALSE@am_src_processor_basic_source_line_resolver_unittest_OBJECTS = src/processor/src_processor_basic_source_line_resolver_unittest-basic_source_line_resolver_unittest.$(OBJEXT)
src_processor_basic_source_line_resolver_unittest_OBJECTS = $(am_src_processor_basic_source_line_resolver_unittest_OBJECTS)
@DISABLE_PROCESSOR_FALSE@src_processor_basic_source_line_resolver_unittest_DEPENDENCIES = src/processor/basic_source_line_resolver.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info.o \
@@ -768,36 +875,19 @@ src_processor_basic_source_line_resolver_unittest_OBJECTS = $(am_src_processor_b
@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/source_line_resolver_base.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/tokenize.o \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1)
-am__src_processor_binarystream_unittest_SOURCES_DIST = \
- src/processor/binarystream_unittest.cc \
- src/testing/gtest/src/gtest-all.cc \
- src/testing/src/gmock-all.cc
-@DISABLE_PROCESSOR_FALSE@am_src_processor_binarystream_unittest_OBJECTS = src/processor/src_processor_binarystream_unittest-binarystream_unittest.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/testing/gtest/src/src_processor_binarystream_unittest-gtest-all.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/testing/src/src_processor_binarystream_unittest-gmock-all.$(OBJEXT)
-src_processor_binarystream_unittest_OBJECTS = \
- $(am_src_processor_binarystream_unittest_OBJECTS)
-@DISABLE_PROCESSOR_FALSE@src_processor_binarystream_unittest_DEPENDENCIES = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/binarystream.o \
+@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \
@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \
@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1)
am__src_processor_cfi_frame_info_unittest_SOURCES_DIST = \
- src/processor/cfi_frame_info_unittest.cc \
- src/testing/gtest/src/gtest-all.cc \
- src/testing/gtest/src/gtest_main.cc \
- src/testing/src/gmock-all.cc
-@DISABLE_PROCESSOR_FALSE@am_src_processor_cfi_frame_info_unittest_OBJECTS = src/processor/src_processor_cfi_frame_info_unittest-cfi_frame_info_unittest.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/testing/gtest/src/src_processor_cfi_frame_info_unittest-gtest-all.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/testing/gtest/src/src_processor_cfi_frame_info_unittest-gtest_main.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/testing/src/src_processor_cfi_frame_info_unittest-gmock-all.$(OBJEXT)
+ src/processor/cfi_frame_info_unittest.cc
+@DISABLE_PROCESSOR_FALSE@am_src_processor_cfi_frame_info_unittest_OBJECTS = src/processor/src_processor_cfi_frame_info_unittest-cfi_frame_info_unittest.$(OBJEXT)
src_processor_cfi_frame_info_unittest_OBJECTS = \
$(am_src_processor_cfi_frame_info_unittest_OBJECTS)
@DISABLE_PROCESSOR_FALSE@src_processor_cfi_frame_info_unittest_DEPENDENCIES = \
@DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
+@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \
@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \
@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1)
am__src_processor_contained_range_map_unittest_SOURCES_DIST = \
@@ -809,33 +899,22 @@ src_processor_contained_range_map_unittest_OBJECTS = \
@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o
am__src_processor_disassembler_x86_unittest_SOURCES_DIST = \
- src/processor/disassembler_x86_unittest.cc \
- src/testing/gtest/src/gtest-all.cc \
- src/testing/gtest/src/gtest_main.cc \
- src/testing/src/gmock-all.cc
-@DISABLE_PROCESSOR_FALSE@am_src_processor_disassembler_x86_unittest_OBJECTS = src/processor/src_processor_disassembler_x86_unittest-disassembler_x86_unittest.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/testing/gtest/src/src_processor_disassembler_x86_unittest-gtest-all.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/testing/gtest/src/src_processor_disassembler_x86_unittest-gtest_main.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/testing/src/src_processor_disassembler_x86_unittest-gmock-all.$(OBJEXT)
+ src/processor/disassembler_x86_unittest.cc
+@DISABLE_PROCESSOR_FALSE@am_src_processor_disassembler_x86_unittest_OBJECTS = src/processor/src_processor_disassembler_x86_unittest-disassembler_x86_unittest.$(OBJEXT)
src_processor_disassembler_x86_unittest_OBJECTS = \
$(am_src_processor_disassembler_x86_unittest_OBJECTS)
@DISABLE_PROCESSOR_FALSE@src_processor_disassembler_x86_unittest_DEPENDENCIES = \
@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_x86.o \
@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/libdisasm.a \
+@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \
@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \
@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1)
am__src_processor_exploitability_unittest_SOURCES_DIST = \
- src/processor/exploitability_unittest.cc \
- src/testing/gtest/src/gtest-all.cc \
- src/testing/gtest/src/gtest_main.cc \
- src/testing/src/gmock-all.cc
-@DISABLE_PROCESSOR_FALSE@am_src_processor_exploitability_unittest_OBJECTS = src/processor/src_processor_exploitability_unittest-exploitability_unittest.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/testing/gtest/src/src_processor_exploitability_unittest-gtest-all.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/testing/gtest/src/src_processor_exploitability_unittest-gtest_main.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/testing/src/src_processor_exploitability_unittest-gmock-all.$(OBJEXT)
+ src/processor/exploitability_unittest.cc
+@DISABLE_PROCESSOR_FALSE@am_src_processor_exploitability_unittest_OBJECTS = src/processor/src_processor_exploitability_unittest-exploitability_unittest.$(OBJEXT)
src_processor_exploitability_unittest_OBJECTS = \
$(am_src_processor_exploitability_unittest_OBJECTS)
-@DISABLE_PROCESSOR_FALSE@src_processor_exploitability_unittest_DEPENDENCIES = \
+@DISABLE_PROCESSOR_FALSE@src_processor_exploitability_unittest_DEPENDENCIES = src/processor/convert_old_arm64_context.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/minidump_processor.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/process_state.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_x86.o \
@@ -851,6 +930,7 @@ src_processor_exploitability_unittest_OBJECTS = \
@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/minidump.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
+@DISABLE_PROCESSOR_FALSE@ src/processor/proc_maps_linux.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/simple_symbol_supplier.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/source_line_resolver_base.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/stack_frame_cpu.o \
@@ -868,15 +948,12 @@ src_processor_exploitability_unittest_OBJECTS = \
@DISABLE_PROCESSOR_FALSE@ src/processor/symbolic_constants_win.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/tokenize.o \
@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/libdisasm.a \
+@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \
@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \
@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1)
am__src_processor_fast_source_line_resolver_unittest_SOURCES_DIST = \
- src/processor/fast_source_line_resolver_unittest.cc \
- src/testing/gtest/src/gtest-all.cc \
- src/testing/src/gmock-all.cc
-@DISABLE_PROCESSOR_FALSE@am_src_processor_fast_source_line_resolver_unittest_OBJECTS = src/processor/src_processor_fast_source_line_resolver_unittest-fast_source_line_resolver_unittest.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/testing/gtest/src/src_processor_fast_source_line_resolver_unittest-gtest-all.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/testing/src/src_processor_fast_source_line_resolver_unittest-gmock-all.$(OBJEXT)
+ src/processor/fast_source_line_resolver_unittest.cc
+@DISABLE_PROCESSOR_FALSE@am_src_processor_fast_source_line_resolver_unittest_OBJECTS = src/processor/src_processor_fast_source_line_resolver_unittest-fast_source_line_resolver_unittest.$(OBJEXT)
src_processor_fast_source_line_resolver_unittest_OBJECTS = $(am_src_processor_fast_source_line_resolver_unittest_OBJECTS)
@DISABLE_PROCESSOR_FALSE@src_processor_fast_source_line_resolver_unittest_DEPENDENCIES = src/processor/fast_source_line_resolver.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/basic_source_line_resolver.o \
@@ -887,35 +964,30 @@ src_processor_fast_source_line_resolver_unittest_OBJECTS = $(am_src_processor_fa
@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/source_line_resolver_base.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/tokenize.o \
+@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \
@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \
@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1)
am__src_processor_map_serializers_unittest_SOURCES_DIST = \
- src/processor/map_serializers_unittest.cc \
- src/testing/gtest/src/gtest-all.cc \
- src/testing/src/gmock-all.cc
-@DISABLE_PROCESSOR_FALSE@am_src_processor_map_serializers_unittest_OBJECTS = src/processor/src_processor_map_serializers_unittest-map_serializers_unittest.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/testing/gtest/src/src_processor_map_serializers_unittest-gtest-all.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/testing/src/src_processor_map_serializers_unittest-gmock-all.$(OBJEXT)
+ src/processor/map_serializers_unittest.cc
+@DISABLE_PROCESSOR_FALSE@am_src_processor_map_serializers_unittest_OBJECTS = src/processor/src_processor_map_serializers_unittest-map_serializers_unittest.$(OBJEXT)
src_processor_map_serializers_unittest_OBJECTS = \
$(am_src_processor_map_serializers_unittest_OBJECTS)
@DISABLE_PROCESSOR_FALSE@src_processor_map_serializers_unittest_DEPENDENCIES = \
@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
+@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \
@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \
@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1)
am__src_processor_microdump_processor_unittest_SOURCES_DIST = \
- src/processor/microdump_processor_unittest.cc \
- src/testing/gtest/src/gtest-all.cc \
- src/testing/src/gmock-all.cc
-@DISABLE_PROCESSOR_FALSE@am_src_processor_microdump_processor_unittest_OBJECTS = src/processor/src_processor_microdump_processor_unittest-microdump_processor_unittest.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/testing/gtest/src/src_processor_microdump_processor_unittest-gtest-all.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/testing/src/src_processor_microdump_processor_unittest-gmock-all.$(OBJEXT)
+ src/processor/microdump_processor_unittest.cc
+@DISABLE_PROCESSOR_FALSE@am_src_processor_microdump_processor_unittest_OBJECTS = src/processor/src_processor_microdump_processor_unittest-microdump_processor_unittest.$(OBJEXT)
src_processor_microdump_processor_unittest_OBJECTS = \
$(am_src_processor_microdump_processor_unittest_OBJECTS)
@DISABLE_PROCESSOR_FALSE@src_processor_microdump_processor_unittest_DEPENDENCIES = \
@DISABLE_PROCESSOR_FALSE@ src/processor/basic_code_modules.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/basic_source_line_resolver.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/call_stack.o \
+@DISABLE_PROCESSOR_FALSE@ src/processor/convert_old_arm64_context.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/dump_context.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/dump_object.o \
@@ -938,6 +1010,7 @@ src_processor_microdump_processor_unittest_OBJECTS = \
@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_sparc.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_x86.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/tokenize.o \
+@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \
@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \
@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1)
am__src_processor_microdump_stackwalk_SOURCES_DIST = \
@@ -946,10 +1019,11 @@ am__src_processor_microdump_stackwalk_SOURCES_DIST = \
src_processor_microdump_stackwalk_OBJECTS = \
$(am_src_processor_microdump_stackwalk_OBJECTS)
@DISABLE_PROCESSOR_FALSE@src_processor_microdump_stackwalk_DEPENDENCIES = \
+@DISABLE_PROCESSOR_FALSE@ src/common/path_helper.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/basic_code_modules.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/basic_source_line_resolver.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/binarystream.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/call_stack.o \
+@DISABLE_PROCESSOR_FALSE@ src/processor/convert_old_arm64_context.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_x86.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/dump_context.o \
@@ -983,18 +1057,16 @@ src_processor_minidump_dump_OBJECTS = \
$(am_src_processor_minidump_dump_OBJECTS)
@DISABLE_PROCESSOR_FALSE@src_processor_minidump_dump_DEPENDENCIES = \
@DISABLE_PROCESSOR_FALSE@ src/processor/basic_code_modules.o \
+@DISABLE_PROCESSOR_FALSE@ src/processor/convert_old_arm64_context.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/dump_context.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/dump_object.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/minidump.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o
+@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
+@DISABLE_PROCESSOR_FALSE@ src/processor/proc_maps_linux.o
am__src_processor_minidump_processor_unittest_SOURCES_DIST = \
- src/processor/minidump_processor_unittest.cc \
- src/testing/gtest/src/gtest-all.cc \
- src/testing/src/gmock-all.cc
-@DISABLE_PROCESSOR_FALSE@am_src_processor_minidump_processor_unittest_OBJECTS = src/processor/src_processor_minidump_processor_unittest-minidump_processor_unittest.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/testing/gtest/src/src_processor_minidump_processor_unittest-gtest-all.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/testing/src/src_processor_minidump_processor_unittest-gmock-all.$(OBJEXT)
+ src/processor/minidump_processor_unittest.cc
+@DISABLE_PROCESSOR_FALSE@am_src_processor_minidump_processor_unittest_OBJECTS = src/processor/src_processor_minidump_processor_unittest-minidump_processor_unittest.$(OBJEXT)
src_processor_minidump_processor_unittest_OBJECTS = \
$(am_src_processor_minidump_processor_unittest_OBJECTS)
@DISABLE_PROCESSOR_FALSE@src_processor_minidump_processor_unittest_DEPENDENCIES = \
@@ -1002,6 +1074,7 @@ src_processor_minidump_processor_unittest_OBJECTS = \
@DISABLE_PROCESSOR_FALSE@ src/processor/basic_source_line_resolver.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/call_stack.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info.o \
+@DISABLE_PROCESSOR_FALSE@ src/processor/convert_old_arm64_context.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_x86.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/dump_context.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/dump_object.o \
@@ -1013,6 +1086,7 @@ src_processor_minidump_processor_unittest_OBJECTS = \
@DISABLE_PROCESSOR_FALSE@ src/processor/minidump.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/process_state.o \
+@DISABLE_PROCESSOR_FALSE@ src/processor/proc_maps_linux.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/source_line_resolver_base.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/stack_frame_cpu.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/stack_frame_symbolizer.o \
@@ -1029,6 +1103,7 @@ src_processor_minidump_processor_unittest_OBJECTS = \
@DISABLE_PROCESSOR_FALSE@ src/processor/symbolic_constants_win.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/tokenize.o \
@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/libdisasm.a \
+@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \
@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \
@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1)
am__src_processor_minidump_stackwalk_SOURCES_DIST = \
@@ -1037,11 +1112,12 @@ am__src_processor_minidump_stackwalk_SOURCES_DIST = \
src_processor_minidump_stackwalk_OBJECTS = \
$(am_src_processor_minidump_stackwalk_OBJECTS)
@DISABLE_PROCESSOR_FALSE@src_processor_minidump_stackwalk_DEPENDENCIES = \
+@DISABLE_PROCESSOR_FALSE@ src/common/path_helper.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/basic_code_modules.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/basic_source_line_resolver.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/binarystream.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/call_stack.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info.o \
+@DISABLE_PROCESSOR_FALSE@ src/processor/convert_old_arm64_context.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_x86.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/dump_context.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/dump_object.o \
@@ -1053,6 +1129,7 @@ src_processor_minidump_stackwalk_OBJECTS = \
@DISABLE_PROCESSOR_FALSE@ src/processor/minidump_processor.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/process_state.o \
+@DISABLE_PROCESSOR_FALSE@ src/processor/proc_maps_linux.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/simple_symbol_supplier.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/source_line_resolver_base.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/stack_frame_cpu.o \
@@ -1074,25 +1151,22 @@ src_processor_minidump_stackwalk_OBJECTS = \
am__src_processor_minidump_unittest_SOURCES_DIST = \
src/common/test_assembler.cc \
src/processor/minidump_unittest.cc \
- src/processor/synth_minidump.cc \
- src/testing/gtest/src/gtest-all.cc \
- src/testing/gtest/src/gtest_main.cc \
- src/testing/src/gmock-all.cc
+ src/processor/synth_minidump.cc
@DISABLE_PROCESSOR_FALSE@am_src_processor_minidump_unittest_OBJECTS = src/common/src_processor_minidump_unittest-test_assembler.$(OBJEXT) \
@DISABLE_PROCESSOR_FALSE@ src/processor/src_processor_minidump_unittest-minidump_unittest.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/src_processor_minidump_unittest-synth_minidump.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/testing/gtest/src/src_processor_minidump_unittest-gtest-all.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/testing/gtest/src/src_processor_minidump_unittest-gtest_main.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/testing/src/src_processor_minidump_unittest-gmock-all.$(OBJEXT)
+@DISABLE_PROCESSOR_FALSE@ src/processor/src_processor_minidump_unittest-synth_minidump.$(OBJEXT)
src_processor_minidump_unittest_OBJECTS = \
$(am_src_processor_minidump_unittest_OBJECTS)
@DISABLE_PROCESSOR_FALSE@src_processor_minidump_unittest_DEPENDENCIES = \
@DISABLE_PROCESSOR_FALSE@ src/processor/basic_code_modules.o \
+@DISABLE_PROCESSOR_FALSE@ src/processor/convert_old_arm64_context.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/dump_context.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/dump_object.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/minidump.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
+@DISABLE_PROCESSOR_FALSE@ src/processor/proc_maps_linux.o \
+@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \
@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \
@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1)
am__src_processor_pathname_stripper_unittest_SOURCES_DIST = \
@@ -1114,6 +1188,42 @@ src_processor_postfix_evaluator_unittest_OBJECTS = \
@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \
@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1)
+am__src_processor_proc_maps_linux_unittest_SOURCES_DIST = \
+ src/processor/proc_maps_linux.cc \
+ src/processor/proc_maps_linux_unittest.cc
+@DISABLE_PROCESSOR_FALSE@am_src_processor_proc_maps_linux_unittest_OBJECTS = src/processor/src_processor_proc_maps_linux_unittest-proc_maps_linux.$(OBJEXT) \
+@DISABLE_PROCESSOR_FALSE@ src/processor/src_processor_proc_maps_linux_unittest-proc_maps_linux_unittest.$(OBJEXT)
+src_processor_proc_maps_linux_unittest_OBJECTS = \
+ $(am_src_processor_proc_maps_linux_unittest_OBJECTS)
+@DISABLE_PROCESSOR_FALSE@src_processor_proc_maps_linux_unittest_DEPENDENCIES = \
+@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
+@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
+@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/libdisasm.a \
+@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \
+@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \
+@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1)
+am__src_processor_range_map_truncate_lower_unittest_SOURCES_DIST = \
+ src/processor/range_map_truncate_lower_unittest.cc
+@DISABLE_PROCESSOR_FALSE@am_src_processor_range_map_truncate_lower_unittest_OBJECTS = src/processor/src_processor_range_map_truncate_lower_unittest-range_map_truncate_lower_unittest.$(OBJEXT)
+src_processor_range_map_truncate_lower_unittest_OBJECTS = \
+ $(am_src_processor_range_map_truncate_lower_unittest_OBJECTS)
+@DISABLE_PROCESSOR_FALSE@src_processor_range_map_truncate_lower_unittest_DEPENDENCIES = \
+@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
+@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
+@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \
+@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \
+@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1)
+am__src_processor_range_map_truncate_upper_unittest_SOURCES_DIST = \
+ src/processor/range_map_truncate_upper_unittest.cc
+@DISABLE_PROCESSOR_FALSE@am_src_processor_range_map_truncate_upper_unittest_OBJECTS = src/processor/src_processor_range_map_truncate_upper_unittest-range_map_truncate_upper_unittest.$(OBJEXT)
+src_processor_range_map_truncate_upper_unittest_OBJECTS = \
+ $(am_src_processor_range_map_truncate_upper_unittest_OBJECTS)
+@DISABLE_PROCESSOR_FALSE@src_processor_range_map_truncate_upper_unittest_DEPENDENCIES = \
+@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
+@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
+@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \
+@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \
+@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1)
am__src_processor_range_map_unittest_SOURCES_DIST = \
src/processor/range_map_unittest.cc
@DISABLE_PROCESSOR_FALSE@am_src_processor_range_map_unittest_OBJECTS = src/processor/range_map_unittest.$(OBJEXT)
@@ -1126,87 +1236,74 @@ src_processor_range_map_unittest_OBJECTS = \
@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1)
am__src_processor_stackwalker_address_list_unittest_SOURCES_DIST = \
src/common/test_assembler.cc \
- src/processor/stackwalker_address_list_unittest.cc \
- src/testing/gtest/src/gtest-all.cc \
- src/testing/gtest/src/gtest_main.cc \
- src/testing/src/gmock-all.cc
+ src/processor/stackwalker_address_list_unittest.cc
@DISABLE_PROCESSOR_FALSE@am_src_processor_stackwalker_address_list_unittest_OBJECTS = src/common/src_processor_stackwalker_address_list_unittest-test_assembler.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/src_processor_stackwalker_address_list_unittest-stackwalker_address_list_unittest.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/testing/gtest/src/src_processor_stackwalker_address_list_unittest-gtest-all.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/testing/gtest/src/src_processor_stackwalker_address_list_unittest-gtest_main.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/testing/src/src_processor_stackwalker_address_list_unittest-gmock-all.$(OBJEXT)
+@DISABLE_PROCESSOR_FALSE@ src/processor/src_processor_stackwalker_address_list_unittest-stackwalker_address_list_unittest.$(OBJEXT)
src_processor_stackwalker_address_list_unittest_OBJECTS = \
$(am_src_processor_stackwalker_address_list_unittest_OBJECTS)
@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_address_list_unittest_DEPENDENCIES = \
@DISABLE_PROCESSOR_FALSE@ src/libbreakpad.a \
+@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \
@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \
@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1)
am__src_processor_stackwalker_amd64_unittest_SOURCES_DIST = \
src/common/test_assembler.cc \
- src/processor/stackwalker_amd64_unittest.cc \
- src/testing/gtest/src/gtest-all.cc \
- src/testing/gtest/src/gtest_main.cc \
- src/testing/src/gmock-all.cc
+ src/processor/stackwalker_amd64_unittest.cc
@DISABLE_PROCESSOR_FALSE@am_src_processor_stackwalker_amd64_unittest_OBJECTS = src/common/src_processor_stackwalker_amd64_unittest-test_assembler.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/src_processor_stackwalker_amd64_unittest-stackwalker_amd64_unittest.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/testing/gtest/src/src_processor_stackwalker_amd64_unittest-gtest-all.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/testing/gtest/src/src_processor_stackwalker_amd64_unittest-gtest_main.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/testing/src/src_processor_stackwalker_amd64_unittest-gmock-all.$(OBJEXT)
+@DISABLE_PROCESSOR_FALSE@ src/processor/src_processor_stackwalker_amd64_unittest-stackwalker_amd64_unittest.$(OBJEXT)
src_processor_stackwalker_amd64_unittest_OBJECTS = \
$(am_src_processor_stackwalker_amd64_unittest_OBJECTS)
@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_amd64_unittest_DEPENDENCIES = \
@DISABLE_PROCESSOR_FALSE@ src/libbreakpad.a \
+@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \
@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \
@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1)
am__src_processor_stackwalker_arm64_unittest_SOURCES_DIST = \
src/common/test_assembler.cc \
- src/processor/stackwalker_arm64_unittest.cc \
- src/testing/gtest/src/gtest-all.cc \
- src/testing/gtest/src/gtest_main.cc \
- src/testing/src/gmock-all.cc
+ src/processor/stackwalker_arm64_unittest.cc
@DISABLE_PROCESSOR_FALSE@am_src_processor_stackwalker_arm64_unittest_OBJECTS = src/common/src_processor_stackwalker_arm64_unittest-test_assembler.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/src_processor_stackwalker_arm64_unittest-stackwalker_arm64_unittest.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/testing/gtest/src/src_processor_stackwalker_arm64_unittest-gtest-all.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/testing/gtest/src/src_processor_stackwalker_arm64_unittest-gtest_main.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/testing/src/src_processor_stackwalker_arm64_unittest-gmock-all.$(OBJEXT)
+@DISABLE_PROCESSOR_FALSE@ src/processor/src_processor_stackwalker_arm64_unittest-stackwalker_arm64_unittest.$(OBJEXT)
src_processor_stackwalker_arm64_unittest_OBJECTS = \
$(am_src_processor_stackwalker_arm64_unittest_OBJECTS)
@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_arm64_unittest_DEPENDENCIES = \
@DISABLE_PROCESSOR_FALSE@ src/libbreakpad.a \
+@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \
@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \
@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1)
am__src_processor_stackwalker_arm_unittest_SOURCES_DIST = \
src/common/test_assembler.cc \
- src/processor/stackwalker_arm_unittest.cc \
- src/testing/gtest/src/gtest-all.cc \
- src/testing/gtest/src/gtest_main.cc \
- src/testing/src/gmock-all.cc
+ src/processor/stackwalker_arm_unittest.cc
@DISABLE_PROCESSOR_FALSE@am_src_processor_stackwalker_arm_unittest_OBJECTS = src/common/src_processor_stackwalker_arm_unittest-test_assembler.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/src_processor_stackwalker_arm_unittest-stackwalker_arm_unittest.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/testing/gtest/src/src_processor_stackwalker_arm_unittest-gtest-all.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/testing/gtest/src/src_processor_stackwalker_arm_unittest-gtest_main.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/testing/src/src_processor_stackwalker_arm_unittest-gmock-all.$(OBJEXT)
+@DISABLE_PROCESSOR_FALSE@ src/processor/src_processor_stackwalker_arm_unittest-stackwalker_arm_unittest.$(OBJEXT)
src_processor_stackwalker_arm_unittest_OBJECTS = \
$(am_src_processor_stackwalker_arm_unittest_OBJECTS)
@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_arm_unittest_DEPENDENCIES = \
@DISABLE_PROCESSOR_FALSE@ src/libbreakpad.a \
+@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \
+@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \
+@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1)
+am__src_processor_stackwalker_mips64_unittest_SOURCES_DIST = \
+ src/common/test_assembler.cc \
+ src/processor/stackwalker_mips64_unittest.cc
+@DISABLE_PROCESSOR_FALSE@am_src_processor_stackwalker_mips64_unittest_OBJECTS = src/common/src_processor_stackwalker_mips64_unittest-test_assembler.$(OBJEXT) \
+@DISABLE_PROCESSOR_FALSE@ src/processor/src_processor_stackwalker_mips64_unittest-stackwalker_mips64_unittest.$(OBJEXT)
+src_processor_stackwalker_mips64_unittest_OBJECTS = \
+ $(am_src_processor_stackwalker_mips64_unittest_OBJECTS)
+@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_mips64_unittest_DEPENDENCIES = \
+@DISABLE_PROCESSOR_FALSE@ src/libbreakpad.a \
+@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \
@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \
@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1)
am__src_processor_stackwalker_mips_unittest_SOURCES_DIST = \
src/common/test_assembler.cc \
- src/processor/stackwalker_mips_unittest.cc \
- src/testing/gtest/src/gtest-all.cc \
- src/testing/gtest/src/gtest_main.cc \
- src/testing/src/gmock-all.cc
+ src/processor/stackwalker_mips_unittest.cc
@DISABLE_PROCESSOR_FALSE@am_src_processor_stackwalker_mips_unittest_OBJECTS = src/common/src_processor_stackwalker_mips_unittest-test_assembler.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/src_processor_stackwalker_mips_unittest-stackwalker_mips_unittest.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/testing/gtest/src/src_processor_stackwalker_mips_unittest-gtest-all.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/testing/gtest/src/src_processor_stackwalker_mips_unittest-gtest_main.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/testing/src/src_processor_stackwalker_mips_unittest-gmock-all.$(OBJEXT)
+@DISABLE_PROCESSOR_FALSE@ src/processor/src_processor_stackwalker_mips_unittest-stackwalker_mips_unittest.$(OBJEXT)
src_processor_stackwalker_mips_unittest_OBJECTS = \
$(am_src_processor_stackwalker_mips_unittest_OBJECTS)
@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_mips_unittest_DEPENDENCIES = \
@DISABLE_PROCESSOR_FALSE@ src/libbreakpad.a \
+@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \
@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \
@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1)
am__src_processor_stackwalker_selftest_SOURCES_DIST = \
@@ -1225,6 +1322,7 @@ src_processor_stackwalker_selftest_OBJECTS = \
@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/minidump.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
+@DISABLE_PROCESSOR_FALSE@ src/processor/proc_maps_linux.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/source_line_resolver_base.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/stack_frame_cpu.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/stack_frame_symbolizer.o \
@@ -1243,161 +1341,145 @@ src_processor_stackwalker_selftest_OBJECTS = \
@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1)
am__src_processor_stackwalker_x86_unittest_SOURCES_DIST = \
src/common/test_assembler.cc \
- src/processor/stackwalker_x86_unittest.cc \
- src/testing/gtest/src/gtest-all.cc \
- src/testing/gtest/src/gtest_main.cc \
- src/testing/src/gmock-all.cc
+ src/processor/stackwalker_x86_unittest.cc
@DISABLE_PROCESSOR_FALSE@am_src_processor_stackwalker_x86_unittest_OBJECTS = src/common/src_processor_stackwalker_x86_unittest-test_assembler.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/src_processor_stackwalker_x86_unittest-stackwalker_x86_unittest.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/testing/gtest/src/src_processor_stackwalker_x86_unittest-gtest-all.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/testing/gtest/src/src_processor_stackwalker_x86_unittest-gtest_main.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/testing/src/src_processor_stackwalker_x86_unittest-gmock-all.$(OBJEXT)
+@DISABLE_PROCESSOR_FALSE@ src/processor/src_processor_stackwalker_x86_unittest-stackwalker_x86_unittest.$(OBJEXT)
src_processor_stackwalker_x86_unittest_OBJECTS = \
$(am_src_processor_stackwalker_x86_unittest_OBJECTS)
@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_x86_unittest_DEPENDENCIES = \
@DISABLE_PROCESSOR_FALSE@ src/libbreakpad.a \
+@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \
@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \
@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1)
am__src_processor_static_address_map_unittest_SOURCES_DIST = \
- src/processor/static_address_map_unittest.cc \
- src/testing/gtest/src/gtest-all.cc \
- src/testing/src/gmock-all.cc
-@DISABLE_PROCESSOR_FALSE@am_src_processor_static_address_map_unittest_OBJECTS = src/processor/src_processor_static_address_map_unittest-static_address_map_unittest.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/testing/gtest/src/src_processor_static_address_map_unittest-gtest-all.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/testing/src/src_processor_static_address_map_unittest-gmock-all.$(OBJEXT)
+ src/processor/static_address_map_unittest.cc
+@DISABLE_PROCESSOR_FALSE@am_src_processor_static_address_map_unittest_OBJECTS = src/processor/src_processor_static_address_map_unittest-static_address_map_unittest.$(OBJEXT)
src_processor_static_address_map_unittest_OBJECTS = \
$(am_src_processor_static_address_map_unittest_OBJECTS)
@DISABLE_PROCESSOR_FALSE@src_processor_static_address_map_unittest_DEPENDENCIES = \
@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
+@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \
@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \
@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1)
am__src_processor_static_contained_range_map_unittest_SOURCES_DIST = \
- src/processor/static_contained_range_map_unittest.cc \
- src/testing/gtest/src/gtest-all.cc \
- src/testing/src/gmock-all.cc
-@DISABLE_PROCESSOR_FALSE@am_src_processor_static_contained_range_map_unittest_OBJECTS = src/processor/src_processor_static_contained_range_map_unittest-static_contained_range_map_unittest.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/testing/gtest/src/src_processor_static_contained_range_map_unittest-gtest-all.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/testing/src/src_processor_static_contained_range_map_unittest-gmock-all.$(OBJEXT)
+ src/processor/static_contained_range_map_unittest.cc
+@DISABLE_PROCESSOR_FALSE@am_src_processor_static_contained_range_map_unittest_OBJECTS = src/processor/src_processor_static_contained_range_map_unittest-static_contained_range_map_unittest.$(OBJEXT)
src_processor_static_contained_range_map_unittest_OBJECTS = $(am_src_processor_static_contained_range_map_unittest_OBJECTS)
@DISABLE_PROCESSOR_FALSE@src_processor_static_contained_range_map_unittest_DEPENDENCIES = \
@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
+@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \
@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \
@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1)
am__src_processor_static_map_unittest_SOURCES_DIST = \
- src/processor/static_map_unittest.cc \
- src/testing/gtest/src/gtest-all.cc \
- src/testing/src/gmock-all.cc
-@DISABLE_PROCESSOR_FALSE@am_src_processor_static_map_unittest_OBJECTS = src/processor/src_processor_static_map_unittest-static_map_unittest.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/testing/gtest/src/src_processor_static_map_unittest-gtest-all.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/testing/src/src_processor_static_map_unittest-gmock-all.$(OBJEXT)
+ src/processor/static_map_unittest.cc
+@DISABLE_PROCESSOR_FALSE@am_src_processor_static_map_unittest_OBJECTS = src/processor/src_processor_static_map_unittest-static_map_unittest.$(OBJEXT)
src_processor_static_map_unittest_OBJECTS = \
$(am_src_processor_static_map_unittest_OBJECTS)
@DISABLE_PROCESSOR_FALSE@src_processor_static_map_unittest_DEPENDENCIES = \
@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
+@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \
@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \
@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1)
am__src_processor_static_range_map_unittest_SOURCES_DIST = \
- src/processor/static_range_map_unittest.cc \
- src/testing/gtest/src/gtest-all.cc \
- src/testing/src/gmock-all.cc
-@DISABLE_PROCESSOR_FALSE@am_src_processor_static_range_map_unittest_OBJECTS = src/processor/src_processor_static_range_map_unittest-static_range_map_unittest.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/testing/gtest/src/src_processor_static_range_map_unittest-gtest-all.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/testing/src/src_processor_static_range_map_unittest-gmock-all.$(OBJEXT)
+ src/processor/static_range_map_unittest.cc
+@DISABLE_PROCESSOR_FALSE@am_src_processor_static_range_map_unittest_OBJECTS = src/processor/src_processor_static_range_map_unittest-static_range_map_unittest.$(OBJEXT)
src_processor_static_range_map_unittest_OBJECTS = \
$(am_src_processor_static_range_map_unittest_OBJECTS)
@DISABLE_PROCESSOR_FALSE@src_processor_static_range_map_unittest_DEPENDENCIES = \
@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
+@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \
@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \
@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1)
am__src_processor_synth_minidump_unittest_SOURCES_DIST = \
src/common/test_assembler.cc src/common/test_assembler.h \
src/processor/synth_minidump_unittest.cc \
- src/testing/gtest/src/gtest-all.cc \
- src/testing/gtest/src/gtest_main.cc \
- src/testing/src/gmock-all.cc src/processor/synth_minidump.cc \
- src/processor/synth_minidump.h
+ src/processor/synth_minidump.cc src/processor/synth_minidump.h
@DISABLE_PROCESSOR_FALSE@am_src_processor_synth_minidump_unittest_OBJECTS = src/common/src_processor_synth_minidump_unittest-test_assembler.$(OBJEXT) \
@DISABLE_PROCESSOR_FALSE@ src/processor/src_processor_synth_minidump_unittest-synth_minidump_unittest.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/testing/gtest/src/src_processor_synth_minidump_unittest-gtest-all.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/testing/gtest/src/src_processor_synth_minidump_unittest-gtest_main.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/testing/src/src_processor_synth_minidump_unittest-gmock-all.$(OBJEXT) \
@DISABLE_PROCESSOR_FALSE@ src/processor/src_processor_synth_minidump_unittest-synth_minidump.$(OBJEXT)
src_processor_synth_minidump_unittest_OBJECTS = \
$(am_src_processor_synth_minidump_unittest_OBJECTS)
@DISABLE_PROCESSOR_FALSE@src_processor_synth_minidump_unittest_DEPENDENCIES = \
+@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \
@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \
@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1)
am__src_tools_linux_core2md_core2md_SOURCES_DIST = \
- src/tools/linux/core2md/core2md.cc \
- src/client/linux/minidump_writer/linux_core_dumper.cc \
- src/common/linux/elf_core_dump.cc
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am_src_tools_linux_core2md_core2md_OBJECTS = src/tools/linux/core2md/core2md.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_core_dumper.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/elf_core_dump.$(OBJEXT)
+ src/tools/linux/core2md/core2md.cc
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am_src_tools_linux_core2md_core2md_OBJECTS = src/tools/linux/core2md/core2md.$(OBJEXT)
src_tools_linux_core2md_core2md_OBJECTS = \
$(am_src_tools_linux_core2md_core2md_OBJECTS)
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_tools_linux_core2md_core2md_DEPENDENCIES = src/client/linux/libbreakpad_client.a
am__src_tools_linux_dump_syms_dump_syms_SOURCES_DIST = \
src/common/dwarf_cfi_to_module.cc \
src/common/dwarf_cu_to_module.cc \
- src/common/dwarf_line_to_module.cc src/common/language.cc \
- src/common/module.cc src/common/stabs_reader.cc \
- src/common/stabs_to_module.cc src/common/dwarf/bytereader.cc \
+ src/common/dwarf_line_to_module.cc \
+ src/common/dwarf_range_list_handler.cc src/common/language.cc \
+ src/common/module.cc src/common/path_helper.cc \
+ src/common/stabs_reader.cc src/common/stabs_to_module.cc \
+ src/common/dwarf/bytereader.cc \
src/common/dwarf/dwarf2diehandler.cc \
- src/common/dwarf/dwarf2reader.cc src/common/linux/crc32.cc \
+ src/common/dwarf/dwarf2reader.cc \
+ src/common/dwarf/elf_reader.cc src/common/linux/crc32.cc \
src/common/linux/dump_symbols.cc \
+ src/common/linux/dump_symbols.h \
src/common/linux/elf_symbols_to_module.cc \
+ src/common/linux/elf_symbols_to_module.h \
src/common/linux/elfutils.cc src/common/linux/file_id.cc \
src/common/linux/linux_libc_support.cc \
src/common/linux/memory_mapped_file.cc \
src/common/linux/safe_readlink.cc \
src/tools/linux/dump_syms/dump_syms.cc
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am_src_tools_linux_dump_syms_dump_syms_OBJECTS = src/common/dwarf_cfi_to_module.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf_cu_to_module.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf_line_to_module.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/language.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/module.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/stabs_reader.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/stabs_to_module.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/bytereader.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/dwarf2diehandler.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/dwarf2reader.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/crc32.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/dump_symbols.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/elf_symbols_to_module.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/elfutils.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/file_id.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/linux_libc_support.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/memory_mapped_file.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/safe_readlink.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/dump_syms/dump_syms.$(OBJEXT)
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am_src_tools_linux_dump_syms_dump_syms_OBJECTS = src/common/src_tools_linux_dump_syms_dump_syms-dwarf_cfi_to_module.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_tools_linux_dump_syms_dump_syms-dwarf_cu_to_module.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_tools_linux_dump_syms_dump_syms-dwarf_line_to_module.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_tools_linux_dump_syms_dump_syms-dwarf_range_list_handler.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_tools_linux_dump_syms_dump_syms-language.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_tools_linux_dump_syms_dump_syms-module.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_tools_linux_dump_syms_dump_syms-path_helper.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_tools_linux_dump_syms_dump_syms-stabs_reader.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_tools_linux_dump_syms_dump_syms-stabs_to_module.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/src_tools_linux_dump_syms_dump_syms-bytereader.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/src_tools_linux_dump_syms_dump_syms-dwarf2diehandler.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/src_tools_linux_dump_syms_dump_syms-dwarf2reader.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/src_tools_linux_dump_syms_dump_syms-elf_reader.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/src_tools_linux_dump_syms_dump_syms-crc32.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/src_tools_linux_dump_syms_dump_syms-dump_symbols.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/src_tools_linux_dump_syms_dump_syms-elf_symbols_to_module.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/src_tools_linux_dump_syms_dump_syms-elfutils.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/src_tools_linux_dump_syms_dump_syms-file_id.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/src_tools_linux_dump_syms_dump_syms-linux_libc_support.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/src_tools_linux_dump_syms_dump_syms-memory_mapped_file.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/src_tools_linux_dump_syms_dump_syms-safe_readlink.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/dump_syms/src_tools_linux_dump_syms_dump_syms-dump_syms.$(OBJEXT)
src_tools_linux_dump_syms_dump_syms_OBJECTS = \
$(am_src_tools_linux_dump_syms_dump_syms_OBJECTS)
-src_tools_linux_dump_syms_dump_syms_LDADD = $(LDADD)
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_tools_linux_dump_syms_dump_syms_DEPENDENCIES = \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(am__DEPENDENCIES_1)
+src_tools_linux_dump_syms_dump_syms_LINK = $(CXXLD) \
+ $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
am__src_tools_linux_md2core_minidump_2_core_SOURCES_DIST = \
src/common/linux/memory_mapped_file.cc \
- src/tools/linux/md2core/minidump-2-core.cc
+ src/common/path_helper.cc \
+ src/tools/linux/md2core/minidump-2-core.cc \
+ src/tools/linux/md2core/minidump_memory_range.h
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am_src_tools_linux_md2core_minidump_2_core_OBJECTS = src/common/linux/memory_mapped_file.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/path_helper.$(OBJEXT) \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/md2core/minidump-2-core.$(OBJEXT)
src_tools_linux_md2core_minidump_2_core_OBJECTS = \
$(am_src_tools_linux_md2core_minidump_2_core_OBJECTS)
src_tools_linux_md2core_minidump_2_core_LDADD = $(LDADD)
am__src_tools_linux_md2core_minidump_2_core_unittest_SOURCES_DIST = \
- src/testing/gtest/src/gtest-all.cc \
- src/testing/gtest/src/gtest_main.cc \
- src/testing/src/gmock-all.cc \
src/tools/linux/md2core/minidump_memory_range_unittest.cc
-@LINUX_HOST_TRUE@am_src_tools_linux_md2core_minidump_2_core_unittest_OBJECTS = src/testing/gtest/src/src_tools_linux_md2core_minidump_2_core_unittest-gtest-all.$(OBJEXT) \
-@LINUX_HOST_TRUE@ src/testing/gtest/src/src_tools_linux_md2core_minidump_2_core_unittest-gtest_main.$(OBJEXT) \
-@LINUX_HOST_TRUE@ src/testing/src/src_tools_linux_md2core_minidump_2_core_unittest-gmock-all.$(OBJEXT) \
-@LINUX_HOST_TRUE@ src/tools/linux/md2core/src_tools_linux_md2core_minidump_2_core_unittest-minidump_memory_range_unittest.$(OBJEXT)
+@LINUX_HOST_TRUE@am_src_tools_linux_md2core_minidump_2_core_unittest_OBJECTS = src/tools/linux/md2core/src_tools_linux_md2core_minidump_2_core_unittest-minidump_memory_range_unittest.$(OBJEXT)
src_tools_linux_md2core_minidump_2_core_unittest_OBJECTS = $(am_src_tools_linux_md2core_minidump_2_core_unittest_OBJECTS)
@LINUX_HOST_TRUE@src_tools_linux_md2core_minidump_2_core_unittest_DEPENDENCIES = \
-@LINUX_HOST_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+@LINUX_HOST_TRUE@ $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \
+@LINUX_HOST_TRUE@ $(am__DEPENDENCIES_1)
am__src_tools_linux_symupload_minidump_upload_SOURCES_DIST = \
src/common/linux/http_upload.cc \
src/tools/linux/symupload/minidump_upload.cc
@@ -1407,13 +1489,71 @@ src_tools_linux_symupload_minidump_upload_OBJECTS = \
$(am_src_tools_linux_symupload_minidump_upload_OBJECTS)
src_tools_linux_symupload_minidump_upload_DEPENDENCIES =
am__src_tools_linux_symupload_sym_upload_SOURCES_DIST = \
- src/common/linux/http_upload.cc \
+ src/common/linux/http_upload.cc src/common/linux/http_upload.h \
+ src/common/linux/libcurl_wrapper.cc \
+ src/common/linux/libcurl_wrapper.h \
+ src/common/linux/symbol_collector_client.cc \
+ src/common/linux/symbol_collector_client.h \
+ src/common/linux/symbol_upload.cc \
+ src/common/linux/symbol_upload.h \
src/tools/linux/symupload/sym_upload.cc
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am_src_tools_linux_symupload_sym_upload_OBJECTS = src/common/linux/http_upload.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/libcurl_wrapper.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/symbol_collector_client.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/symbol_upload.$(OBJEXT) \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/symupload/sym_upload.$(OBJEXT)
src_tools_linux_symupload_sym_upload_OBJECTS = \
$(am_src_tools_linux_symupload_sym_upload_OBJECTS)
src_tools_linux_symupload_sym_upload_DEPENDENCIES =
+am__src_tools_mac_dump_syms_dump_syms_mac_SOURCES_DIST = \
+ src/common/dwarf_cfi_to_module.cc \
+ src/common/dwarf_cu_to_module.cc \
+ src/common/dwarf_line_to_module.cc \
+ src/common/dwarf_range_list_handler.cc src/common/language.cc \
+ src/common/md5.cc src/common/module.cc \
+ src/common/path_helper.cc src/common/stabs_reader.cc \
+ src/common/stabs_to_module.cc src/common/dwarf/bytereader.cc \
+ src/common/dwarf/dwarf2diehandler.cc \
+ src/common/dwarf/dwarf2reader.cc \
+ src/common/dwarf/elf_reader.cc \
+ src/common/mac/arch_utilities.cc src/common/mac/dump_syms.cc \
+ src/common/mac/dump_syms.h src/common/mac/file_id.cc \
+ src/common/mac/file_id.h src/common/mac/macho_id.cc \
+ src/common/mac/macho_id.h src/common/mac/macho_reader.cc \
+ src/common/mac/macho_reader.h \
+ src/common/mac/macho_utilities.cc \
+ src/common/mac/macho_utilities.h \
+ src/common/mac/macho_walker.cc src/common/mac/macho_walker.h \
+ src/tools/mac/dump_syms/dump_syms_tool.cc
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am_src_tools_mac_dump_syms_dump_syms_mac_OBJECTS = src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cfi_to_module.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cu_to_module.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_line_to_module.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_range_list_handler.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_tools_mac_dump_syms_dump_syms_mac-language.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_tools_mac_dump_syms_dump_syms_mac-md5.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_tools_mac_dump_syms_dump_syms_mac-module.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_tools_mac_dump_syms_dump_syms_mac-path_helper.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_tools_mac_dump_syms_dump_syms_mac-stabs_reader.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_tools_mac_dump_syms_dump_syms_mac-stabs_to_module.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-bytereader.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-dwarf2diehandler.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-dwarf2reader.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-elf_reader.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-arch_utilities.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-dump_syms.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-file_id.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_id.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_reader.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_utilities.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_walker.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/mac/dump_syms/src_tools_mac_dump_syms_dump_syms_mac-dump_syms_tool.$(OBJEXT)
+src_tools_mac_dump_syms_dump_syms_mac_OBJECTS = \
+ $(am_src_tools_mac_dump_syms_dump_syms_mac_OBJECTS)
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_tools_mac_dump_syms_dump_syms_mac_DEPENDENCIES = \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(am__DEPENDENCIES_1)
+src_tools_mac_dump_syms_dump_syms_mac_LINK = $(CXXLD) \
+ $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
SCRIPTS = $(noinst_SCRIPTS)
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
@@ -1422,11 +1562,11 @@ am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
-am__v_GEN_1 =
+am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
-am__v_at_1 =
+am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src
depcomp = $(SHELL) $(top_srcdir)/autotools/depcomp
am__depfiles_maybe = depfiles
@@ -1434,49 +1574,51 @@ am__mv = mv -f
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
-am__v_lt_1 =
+am__v_lt_1 =
CPPASCOMPILE = $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS)
AM_V_CPPAS = $(am__v_CPPAS_@AM_V@)
am__v_CPPAS_ = $(am__v_CPPAS_@AM_DEFAULT_V@)
am__v_CPPAS_0 = @echo " CPPAS " $@;
-am__v_CPPAS_1 =
+am__v_CPPAS_1 =
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
AM_V_CC = $(am__v_CC_@AM_V@)
am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
am__v_CC_0 = @echo " CC " $@;
-am__v_CC_1 =
+am__v_CC_1 =
CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@;
-am__v_CCLD_1 =
+am__v_CCLD_1 =
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
AM_V_CXX = $(am__v_CXX_@AM_V@)
am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@)
am__v_CXX_0 = @echo " CXX " $@;
-am__v_CXX_1 =
+am__v_CXX_1 =
CXXLD = $(CXX)
CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
-o $@
AM_V_CXXLD = $(am__v_CXXLD_@AM_V@)
am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@)
am__v_CXXLD_0 = @echo " CXXLD " $@;
-am__v_CXXLD_1 =
+am__v_CXXLD_1 =
SOURCES = $(src_client_linux_libbreakpad_client_a_SOURCES) \
$(src_libbreakpad_a_SOURCES) \
+ $(src_testing_libtesting_a_SOURCES) \
$(src_third_party_libdisasm_libdisasm_a_SOURCES) \
$(src_client_linux_linux_client_unittest_SOURCES) \
$(src_client_linux_linux_client_unittest_shlib_SOURCES) \
$(src_client_linux_linux_dumper_unittest_helper_SOURCES) \
$(src_common_dumper_unittest_SOURCES) \
+ $(src_common_linux_google_crashdump_uploader_test_SOURCES) \
+ $(src_common_mac_macho_reader_unittest_SOURCES) \
$(src_common_test_assembler_unittest_SOURCES) \
$(src_processor_address_map_unittest_SOURCES) \
$(src_processor_basic_source_line_resolver_unittest_SOURCES) \
- $(src_processor_binarystream_unittest_SOURCES) \
$(src_processor_cfi_frame_info_unittest_SOURCES) \
$(src_processor_contained_range_map_unittest_SOURCES) \
$(src_processor_disassembler_x86_unittest_SOURCES) \
@@ -1491,11 +1633,15 @@ SOURCES = $(src_client_linux_libbreakpad_client_a_SOURCES) \
$(src_processor_minidump_unittest_SOURCES) \
$(src_processor_pathname_stripper_unittest_SOURCES) \
$(src_processor_postfix_evaluator_unittest_SOURCES) \
+ $(src_processor_proc_maps_linux_unittest_SOURCES) \
+ $(src_processor_range_map_truncate_lower_unittest_SOURCES) \
+ $(src_processor_range_map_truncate_upper_unittest_SOURCES) \
$(src_processor_range_map_unittest_SOURCES) \
$(src_processor_stackwalker_address_list_unittest_SOURCES) \
$(src_processor_stackwalker_amd64_unittest_SOURCES) \
$(src_processor_stackwalker_arm64_unittest_SOURCES) \
$(src_processor_stackwalker_arm_unittest_SOURCES) \
+ $(src_processor_stackwalker_mips64_unittest_SOURCES) \
$(src_processor_stackwalker_mips_unittest_SOURCES) \
$(src_processor_stackwalker_selftest_SOURCES) \
$(src_processor_stackwalker_x86_unittest_SOURCES) \
@@ -1509,19 +1655,22 @@ SOURCES = $(src_client_linux_libbreakpad_client_a_SOURCES) \
$(src_tools_linux_md2core_minidump_2_core_SOURCES) \
$(src_tools_linux_md2core_minidump_2_core_unittest_SOURCES) \
$(src_tools_linux_symupload_minidump_upload_SOURCES) \
- $(src_tools_linux_symupload_sym_upload_SOURCES)
+ $(src_tools_linux_symupload_sym_upload_SOURCES) \
+ $(src_tools_mac_dump_syms_dump_syms_mac_SOURCES)
DIST_SOURCES = \
$(am__src_client_linux_libbreakpad_client_a_SOURCES_DIST) \
$(am__src_libbreakpad_a_SOURCES_DIST) \
+ $(am__src_testing_libtesting_a_SOURCES_DIST) \
$(am__src_third_party_libdisasm_libdisasm_a_SOURCES_DIST) \
$(src_client_linux_linux_client_unittest_SOURCES) \
$(am__src_client_linux_linux_client_unittest_shlib_SOURCES_DIST) \
$(am__src_client_linux_linux_dumper_unittest_helper_SOURCES_DIST) \
$(am__src_common_dumper_unittest_SOURCES_DIST) \
+ $(am__src_common_linux_google_crashdump_uploader_test_SOURCES_DIST) \
+ $(am__src_common_mac_macho_reader_unittest_SOURCES_DIST) \
$(am__src_common_test_assembler_unittest_SOURCES_DIST) \
$(am__src_processor_address_map_unittest_SOURCES_DIST) \
$(am__src_processor_basic_source_line_resolver_unittest_SOURCES_DIST) \
- $(am__src_processor_binarystream_unittest_SOURCES_DIST) \
$(am__src_processor_cfi_frame_info_unittest_SOURCES_DIST) \
$(am__src_processor_contained_range_map_unittest_SOURCES_DIST) \
$(am__src_processor_disassembler_x86_unittest_SOURCES_DIST) \
@@ -1536,11 +1685,15 @@ DIST_SOURCES = \
$(am__src_processor_minidump_unittest_SOURCES_DIST) \
$(am__src_processor_pathname_stripper_unittest_SOURCES_DIST) \
$(am__src_processor_postfix_evaluator_unittest_SOURCES_DIST) \
+ $(am__src_processor_proc_maps_linux_unittest_SOURCES_DIST) \
+ $(am__src_processor_range_map_truncate_lower_unittest_SOURCES_DIST) \
+ $(am__src_processor_range_map_truncate_upper_unittest_SOURCES_DIST) \
$(am__src_processor_range_map_unittest_SOURCES_DIST) \
$(am__src_processor_stackwalker_address_list_unittest_SOURCES_DIST) \
$(am__src_processor_stackwalker_amd64_unittest_SOURCES_DIST) \
$(am__src_processor_stackwalker_arm64_unittest_SOURCES_DIST) \
$(am__src_processor_stackwalker_arm_unittest_SOURCES_DIST) \
+ $(am__src_processor_stackwalker_mips64_unittest_SOURCES_DIST) \
$(am__src_processor_stackwalker_mips_unittest_SOURCES_DIST) \
$(am__src_processor_stackwalker_selftest_SOURCES_DIST) \
$(am__src_processor_stackwalker_x86_unittest_SOURCES_DIST) \
@@ -1554,7 +1707,8 @@ DIST_SOURCES = \
$(am__src_tools_linux_md2core_minidump_2_core_SOURCES_DIST) \
$(am__src_tools_linux_md2core_minidump_2_core_unittest_SOURCES_DIST) \
$(am__src_tools_linux_symupload_minidump_upload_SOURCES_DIST) \
- $(am__src_tools_linux_symupload_sym_upload_SOURCES_DIST)
+ $(am__src_tools_linux_symupload_sym_upload_SOURCES_DIST) \
+ $(am__src_tools_mac_dump_syms_dump_syms_mac_SOURCES_DIST)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
@@ -1564,15 +1718,18 @@ DATA = $(dist_doc_DATA) $(pkgconfig_DATA)
am__includecl_HEADERS_DIST = $(top_srcdir)/src/common/linux/*.h
am__includeclc_HEADERS_DIST = \
$(top_srcdir)/src/client/linux/crash_generation/*.h
+am__includecldwc_HEADERS_DIST = \
+ $(top_srcdir)/src/client/linux/dump_writer_common/*.h
am__includeclh_HEADERS_DIST = \
$(top_srcdir)/src/client/linux/handler/*.h
am__includeclm_HEADERS_DIST = \
$(top_srcdir)/src/client/linux/minidump_writer/*.h
am__includelss_HEADERS_DIST = $(top_srcdir)/src/third_party/lss/*.h
HEADERS = $(includec_HEADERS) $(includecl_HEADERS) \
- $(includeclc_HEADERS) $(includeclh_HEADERS) \
- $(includeclm_HEADERS) $(includegbc_HEADERS) \
- $(includelss_HEADERS) $(includep_HEADERS)
+ $(includeclc_HEADERS) $(includecldwc_HEADERS) \
+ $(includeclh_HEADERS) $(includeclm_HEADERS) \
+ $(includegbc_HEADERS) $(includelss_HEADERS) \
+ $(includep_HEADERS)
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
@@ -1769,6 +1926,19 @@ TEST_LOGS = $(am__test_logs2:.test.log=.log)
TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/autotools/test-driver
TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \
$(TEST_LOG_FLAGS)
+am__DIST_COMMON = $(srcdir)/Makefile.in \
+ $(srcdir)/breakpad-client.pc.in $(srcdir)/breakpad.pc.in \
+ $(top_srcdir)/autotools/ar-lib $(top_srcdir)/autotools/compile \
+ $(top_srcdir)/autotools/config.guess \
+ $(top_srcdir)/autotools/config.sub \
+ $(top_srcdir)/autotools/depcomp \
+ $(top_srcdir)/autotools/install-sh \
+ $(top_srcdir)/autotools/missing \
+ $(top_srcdir)/autotools/test-driver \
+ $(top_srcdir)/src/config.h.in AUTHORS ChangeLog INSTALL NEWS \
+ autotools/ar-lib autotools/compile autotools/config.guess \
+ autotools/config.sub autotools/depcomp autotools/install-sh \
+ autotools/ltmain.sh autotools/missing
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
@@ -1789,6 +1959,7 @@ distcleancheck_listfiles = find . -type f -print
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
@@ -1812,7 +1983,12 @@ ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
+GMOCK_CFLAGS = @GMOCK_CFLAGS@
+GMOCK_LIBS = @GMOCK_LIBS@
GREP = @GREP@
+GTEST_CFLAGS = @GTEST_CFLAGS@
+GTEST_LIBS = @GTEST_LIBS@
+HAVE_CXX11 = @HAVE_CXX11@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -1838,14 +2014,18 @@ PTHREAD_CC = @PTHREAD_CC@
PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
PTHREAD_LIBS = @PTHREAD_LIBS@
RANLIB = @RANLIB@
+RUST_DEMANGLE_CFLAGS = @RUST_DEMANGLE_CFLAGS@
+RUST_DEMANGLE_LIBS = @RUST_DEMANGLE_LIBS@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
+WARN_CXXFLAGS = @WARN_CXXFLAGS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
am__include = @am__include@
@@ -1897,8 +2077,8 @@ top_srcdir = @top_srcdir@
# This allows #includes to be relative to src/
AM_CPPFLAGS = -I$(top_srcdir)/src
-AM_CFLAGS = $(am__append_3)
-AM_CXXFLAGS = $(am__append_1) $(am__append_2) $(am__append_4)
+AM_CFLAGS = $(am__append_2)
+AM_CXXFLAGS = $(am__append_1) $(WARN_CXXFLAGS) $(am__append_3)
# Specify include paths for ac macros
ACLOCAL_AMFLAGS = -I m4
@@ -1911,10 +2091,12 @@ dist_doc_DATA = \
INSTALL \
LICENSE \
NEWS \
- README
+ README.md
@LINUX_HOST_TRUE@includeclhdir = $(includedir)/$(PACKAGE)/client/linux/handler
@LINUX_HOST_TRUE@includeclh_HEADERS = $(top_srcdir)/src/client/linux/handler/*.h
+@LINUX_HOST_TRUE@includecldwcdir = $(includedir)/$(PACKAGE)/client/linux/dump_writer_common
+@LINUX_HOST_TRUE@includecldwc_HEADERS = $(top_srcdir)/src/client/linux/dump_writer_common/*.h
@LINUX_HOST_TRUE@includeclmdir = $(includedir)/$(PACKAGE)/client/linux/minidump_writer
@LINUX_HOST_TRUE@includeclm_HEADERS = $(top_srcdir)/src/client/linux/minidump_writer/*.h
@LINUX_HOST_TRUE@includeclcdir = $(includedir)/$(PACKAGE)/client/linux/crash_generation
@@ -1930,31 +2112,68 @@ includec_HEADERS = $(top_srcdir)/src/common/*.h
includepdir = $(includedir)/$(PACKAGE)/processor
includep_HEADERS = $(top_srcdir)/src/processor/*.h
pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA = $(am__append_6) $(am__append_9)
-noinst_LIBRARIES = $(am__append_7)
-lib_LIBRARIES = $(am__append_5) $(am__append_8)
+pkgconfig_DATA = $(am__append_5) $(am__append_8)
+@SYSTEM_TEST_LIBS_FALSE@TEST_CFLAGS = \
+@SYSTEM_TEST_LIBS_FALSE@ -I$(top_srcdir)/src/testing/include \
+@SYSTEM_TEST_LIBS_FALSE@ -I$(top_srcdir)/src/testing/googletest/include \
+@SYSTEM_TEST_LIBS_FALSE@ -I$(top_srcdir)/src/testing/googletest \
+@SYSTEM_TEST_LIBS_FALSE@ -I$(top_srcdir)/src/testing/googlemock/include \
+@SYSTEM_TEST_LIBS_FALSE@ -I$(top_srcdir)/src/testing/googlemock \
+@SYSTEM_TEST_LIBS_FALSE@ -I$(top_srcdir)/src/testing
+
+@SYSTEM_TEST_LIBS_TRUE@TEST_CFLAGS = $(GTEST_CFLAGS) $(GMOCK_CFLAGS)
+@SYSTEM_TEST_LIBS_FALSE@TEST_LIBS = src/testing/libtesting.a
+@SYSTEM_TEST_LIBS_TRUE@TEST_LIBS = $(GTEST_LIBS) -lgtest_main $(GMOCK_LIBS)
+@SYSTEM_TEST_LIBS_FALSE@TEST_DEPS = $(TEST_LIBS)
+@SYSTEM_TEST_LIBS_TRUE@TEST_DEPS =
+check_LIBRARIES = src/testing/libtesting.a
+noinst_LIBRARIES = $(am__append_6)
+lib_LIBRARIES = $(am__append_4) $(am__append_7)
+CLEANFILES = $(am__append_12)
+@SYSTEM_TEST_LIBS_FALSE@src_testing_libtesting_a_SOURCES = \
+@SYSTEM_TEST_LIBS_FALSE@ src/breakpad_googletest_includes.h \
+@SYSTEM_TEST_LIBS_FALSE@ src/testing/googletest/src/gtest-all.cc \
+@SYSTEM_TEST_LIBS_FALSE@ src/testing/googletest/src/gtest_main.cc \
+@SYSTEM_TEST_LIBS_FALSE@ src/testing/googlemock/src/gmock-all.cc
+
+@SYSTEM_TEST_LIBS_FALSE@src_testing_libtesting_a_CPPFLAGS = \
+@SYSTEM_TEST_LIBS_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS)
+
@LINUX_HOST_TRUE@src_client_linux_libbreakpad_client_a_SOURCES = src/client/linux/crash_generation/crash_generation_client.cc \
@LINUX_HOST_TRUE@ src/client/linux/crash_generation/crash_generation_server.cc \
-@LINUX_HOST_TRUE@ src/client/linux/dump_writer_common/seccomp_unwinder.cc \
@LINUX_HOST_TRUE@ src/client/linux/dump_writer_common/thread_info.cc \
@LINUX_HOST_TRUE@ src/client/linux/dump_writer_common/ucontext_reader.cc \
@LINUX_HOST_TRUE@ src/client/linux/handler/exception_handler.cc \
+@LINUX_HOST_TRUE@ src/client/linux/handler/exception_handler.h \
@LINUX_HOST_TRUE@ src/client/linux/handler/minidump_descriptor.cc \
+@LINUX_HOST_TRUE@ src/client/linux/handler/minidump_descriptor.h \
@LINUX_HOST_TRUE@ src/client/linux/log/log.cc \
+@LINUX_HOST_TRUE@ src/client/linux/log/log.h \
@LINUX_HOST_TRUE@ src/client/linux/microdump_writer/microdump_writer.cc \
+@LINUX_HOST_TRUE@ src/client/linux/microdump_writer/microdump_writer.h \
+@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_core_dumper.cc \
@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_dumper.cc \
@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_ptrace_dumper.cc \
@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/minidump_writer.cc \
+@LINUX_HOST_TRUE@ src/client/minidump_file_writer-inl.h \
@LINUX_HOST_TRUE@ src/client/minidump_file_writer.cc \
-@LINUX_HOST_TRUE@ src/common/convert_UTF.c src/common/md5.cc \
+@LINUX_HOST_TRUE@ src/client/minidump_file_writer.h \
+@LINUX_HOST_TRUE@ src/common/convert_UTF.cc \
+@LINUX_HOST_TRUE@ src/common/convert_UTF.h src/common/md5.cc \
+@LINUX_HOST_TRUE@ src/common/md5.h \
@LINUX_HOST_TRUE@ src/common/string_conversion.cc \
+@LINUX_HOST_TRUE@ src/common/string_conversion.h \
+@LINUX_HOST_TRUE@ src/common/linux/elf_core_dump.cc \
@LINUX_HOST_TRUE@ src/common/linux/elfutils.cc \
+@LINUX_HOST_TRUE@ src/common/linux/elfutils.h \
@LINUX_HOST_TRUE@ src/common/linux/file_id.cc \
+@LINUX_HOST_TRUE@ src/common/linux/file_id.h \
@LINUX_HOST_TRUE@ src/common/linux/guid_creator.cc \
+@LINUX_HOST_TRUE@ src/common/linux/guid_creator.h \
@LINUX_HOST_TRUE@ src/common/linux/linux_libc_support.cc \
@LINUX_HOST_TRUE@ src/common/linux/memory_mapped_file.cc \
@LINUX_HOST_TRUE@ src/common/linux/safe_readlink.cc \
-@LINUX_HOST_TRUE@ $(am__append_10)
+@LINUX_HOST_TRUE@ $(am__append_9)
@DISABLE_PROCESSOR_FALSE@src_libbreakpad_a_SOURCES = \
@DISABLE_PROCESSOR_FALSE@ src/google_breakpad/common/breakpad_types.h \
@DISABLE_PROCESSOR_FALSE@ src/google_breakpad/common/minidump_format.h \
@@ -1974,6 +2193,7 @@ lib_LIBRARIES = $(am__append_5) $(am__append_8)
@DISABLE_PROCESSOR_FALSE@ src/google_breakpad/processor/minidump_processor.h \
@DISABLE_PROCESSOR_FALSE@ src/google_breakpad/processor/process_result.h \
@DISABLE_PROCESSOR_FALSE@ src/google_breakpad/processor/process_state.h \
+@DISABLE_PROCESSOR_FALSE@ src/google_breakpad/processor/proc_maps_linux.h \
@DISABLE_PROCESSOR_FALSE@ src/google_breakpad/processor/source_line_resolver_base.h \
@DISABLE_PROCESSOR_FALSE@ src/google_breakpad/processor/source_line_resolver_interface.h \
@DISABLE_PROCESSOR_FALSE@ src/google_breakpad/processor/stack_frame.h \
@@ -1989,13 +2209,13 @@ lib_LIBRARIES = $(am__append_5) $(am__append_8)
@DISABLE_PROCESSOR_FALSE@ src/processor/basic_code_modules.h \
@DISABLE_PROCESSOR_FALSE@ src/processor/basic_source_line_resolver_types.h \
@DISABLE_PROCESSOR_FALSE@ src/processor/basic_source_line_resolver.cc \
-@DISABLE_PROCESSOR_FALSE@ src/processor/binarystream.h \
-@DISABLE_PROCESSOR_FALSE@ src/processor/binarystream.cc \
@DISABLE_PROCESSOR_FALSE@ src/processor/call_stack.cc \
@DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info.cc \
@DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info.h \
@DISABLE_PROCESSOR_FALSE@ src/processor/contained_range_map-inl.h \
@DISABLE_PROCESSOR_FALSE@ src/processor/contained_range_map.h \
+@DISABLE_PROCESSOR_FALSE@ src/processor/convert_old_arm64_context.cc \
+@DISABLE_PROCESSOR_FALSE@ src/processor/convert_old_arm64_context.h \
@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_x86.h \
@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_x86.cc \
@DISABLE_PROCESSOR_FALSE@ src/processor/dump_context.cc \
@@ -2026,6 +2246,7 @@ lib_LIBRARIES = $(am__append_5) $(am__append_8)
@DISABLE_PROCESSOR_FALSE@ src/processor/postfix_evaluator-inl.h \
@DISABLE_PROCESSOR_FALSE@ src/processor/postfix_evaluator.h \
@DISABLE_PROCESSOR_FALSE@ src/processor/process_state.cc \
+@DISABLE_PROCESSOR_FALSE@ src/processor/proc_maps_linux.cc \
@DISABLE_PROCESSOR_FALSE@ src/processor/range_map-inl.h \
@DISABLE_PROCESSOR_FALSE@ src/processor/range_map.h \
@DISABLE_PROCESSOR_FALSE@ src/processor/simple_serializer-inl.h \
@@ -2071,7 +2292,6 @@ lib_LIBRARIES = $(am__append_5) $(am__append_8)
@DISABLE_PROCESSOR_FALSE@ src/processor/tokenize.cc \
@DISABLE_PROCESSOR_FALSE@ src/processor/tokenize.h
-@DISABLE_PROCESSOR_FALSE@src_libbreakpad_a_LIBADD = src/third_party/libdisasm/libdisasm.a
@DISABLE_PROCESSOR_FALSE@src_third_party_libdisasm_libdisasm_a_SOURCES = \
@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/ia32_implicit.c \
@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/ia32_implicit.h \
@@ -2108,8 +2328,9 @@ lib_LIBRARIES = $(am__append_5) $(am__append_8)
@DISABLE_PROCESSOR_FALSE@ src/processor/minidump_stackwalk_machine_readable_test
TESTS = $(check_PROGRAMS) $(check_SCRIPTS)
+@ANDROID_HOST_FALSE@@TESTS_AS_ROOT_FALSE@LOG_DRIVER = $(top_srcdir)/autotools/test-driver
# The default Autotools test driver script.
-@ANDROID_HOST_FALSE@LOG_DRIVER = $(top_srcdir)/autotools/test-driver
+@ANDROID_HOST_FALSE@@TESTS_AS_ROOT_TRUE@LOG_DRIVER = $(top_srcdir)/autotools/root-test-driver $(top_srcdir)/autotools/test-driver
# Since Autotools 1.2, tests are run through a special "test driver" script.
# Unfortunately, it's not possible anymore to specify an alternative shell to
@@ -2125,7 +2346,10 @@ TESTS = $(check_PROGRAMS) $(check_SCRIPTS)
# On Android PTHREAD_CFLAGS is empty, and adding src/common/android/include
# to the include path is necessary to build this program.
@ANDROID_HOST_TRUE@@LINUX_HOST_TRUE@src_client_linux_linux_dumper_unittest_helper_CXXFLAGS = $(AM_CXXFLAGS)
-@LINUX_HOST_TRUE@src_client_linux_linux_client_unittest_shlib_SOURCES = src/client/linux/handler/exception_handler_unittest.cc \
+@LINUX_HOST_TRUE@src_client_linux_linux_client_unittest_shlib_SOURCES = \
+@LINUX_HOST_TRUE@ $(src_testing_libtesting_a_SOURCES) \
+@LINUX_HOST_TRUE@ src/client/linux/handler/exception_handler_unittest.cc \
+@LINUX_HOST_TRUE@ src/client/linux/microdump_writer/microdump_writer_unittest.cc \
@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/directory_reader_unittest.cc \
@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/cpu_set_unittest.cc \
@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/line_reader_unittest.cc \
@@ -2137,34 +2361,29 @@ TESTS = $(check_PROGRAMS) $(check_SCRIPTS)
@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc \
@LINUX_HOST_TRUE@ src/common/linux/elf_core_dump.cc \
@LINUX_HOST_TRUE@ src/common/linux/linux_libc_support_unittest.cc \
+@LINUX_HOST_TRUE@ src/common/linux/tests/auto_testfile.h \
@LINUX_HOST_TRUE@ src/common/linux/tests/crash_generator.cc \
-@LINUX_HOST_TRUE@ src/common/memory_unittest.cc \
+@LINUX_HOST_TRUE@ src/common/memory_allocator_unittest.cc \
+@LINUX_HOST_TRUE@ src/common/tests/auto_tempdir.h \
@LINUX_HOST_TRUE@ src/common/tests/file_utils.cc \
-@LINUX_HOST_TRUE@ src/testing/gtest/src/gtest-all.cc \
-@LINUX_HOST_TRUE@ src/testing/gtest/src/gtest_main.cc \
-@LINUX_HOST_TRUE@ src/testing/src/gmock-all.cc \
+@LINUX_HOST_TRUE@ src/common/tests/file_utils.h \
@LINUX_HOST_TRUE@ src/processor/basic_code_modules.cc \
+@LINUX_HOST_TRUE@ src/processor/convert_old_arm64_context.cc \
@LINUX_HOST_TRUE@ src/processor/dump_context.cc \
@LINUX_HOST_TRUE@ src/processor/dump_object.cc \
@LINUX_HOST_TRUE@ src/processor/logging.cc \
@LINUX_HOST_TRUE@ src/processor/minidump.cc \
@LINUX_HOST_TRUE@ src/processor/pathname_stripper.cc \
-@LINUX_HOST_TRUE@ $(am__append_18) \
-@LINUX_HOST_TRUE@ src/client/linux/microdump_writer/microdump_writer_unittest.cc \
-@LINUX_HOST_TRUE@ $(am__append_19)
+@LINUX_HOST_TRUE@ src/processor/proc_maps_linux.cc \
+@LINUX_HOST_TRUE@ $(am__append_20)
@LINUX_HOST_TRUE@src_client_linux_linux_client_unittest_shlib_CPPFLAGS = \
-@LINUX_HOST_TRUE@ -I$(top_srcdir)/src \
-@LINUX_HOST_TRUE@ -I$(top_srcdir)/src/testing/include \
-@LINUX_HOST_TRUE@ -I$(top_srcdir)/src/testing/gtest/include \
-@LINUX_HOST_TRUE@ -I$(top_srcdir)/src/testing/gtest \
-@LINUX_HOST_TRUE@ -I$(top_srcdir)/src/testing
+@LINUX_HOST_TRUE@ $(AM_CPPFLAGS) $(TEST_CFLAGS)
@LINUX_HOST_TRUE@src_client_linux_linux_client_unittest_shlib_LDFLAGS = \
@LINUX_HOST_TRUE@ -shared -Wl,-h,linux_client_unittest_shlib \
-@LINUX_HOST_TRUE@ $(am__append_20)
+@LINUX_HOST_TRUE@ $(am__append_21)
@LINUX_HOST_TRUE@src_client_linux_linux_client_unittest_shlib_LDADD = \
@LINUX_HOST_TRUE@ src/client/linux/crash_generation/crash_generation_client.o \
-@LINUX_HOST_TRUE@ src/client/linux/dump_writer_common/seccomp_unwinder.o \
@LINUX_HOST_TRUE@ src/client/linux/dump_writer_common/thread_info.o \
@LINUX_HOST_TRUE@ src/client/linux/dump_writer_common/ucontext_reader.o \
@LINUX_HOST_TRUE@ src/client/linux/handler/exception_handler.o \
@@ -2184,26 +2403,30 @@ TESTS = $(check_PROGRAMS) $(check_SCRIPTS)
@LINUX_HOST_TRUE@ src/common/linux/memory_mapped_file.o \
@LINUX_HOST_TRUE@ src/common/linux/safe_readlink.o \
@LINUX_HOST_TRUE@ src/common/string_conversion.o \
+@LINUX_HOST_TRUE@ $(TEST_LIBS) \
@LINUX_HOST_TRUE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
@LINUX_HOST_TRUE@src_client_linux_linux_client_unittest_shlib_DEPENDENCIES = \
@LINUX_HOST_TRUE@ src/client/linux/linux_dumper_unittest_helper \
@LINUX_HOST_TRUE@ src/client/linux/libbreakpad_client.a \
+@LINUX_HOST_TRUE@ $(TEST_DEPS) \
@LINUX_HOST_TRUE@ src/libbreakpad.a
-@LINUX_HOST_TRUE@src_client_linux_linux_client_unittest_SOURCES =
+@LINUX_HOST_TRUE@src_client_linux_linux_client_unittest_SOURCES =
+# The extra-long build id is for a test in minidump_writer_unittest.cc.
@LINUX_HOST_TRUE@src_client_linux_linux_client_unittest_LDFLAGS = \
-@LINUX_HOST_TRUE@ -Wl,-rpath,'$$ORIGIN' $(am__append_21)
+@LINUX_HOST_TRUE@ -Wl,-rpath,'$$ORIGIN' \
+@LINUX_HOST_TRUE@ -Wl,--build-id=0x000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f \
+@LINUX_HOST_TRUE@ $(am__append_22)
@LINUX_HOST_TRUE@src_client_linux_linux_client_unittest_LDADD = \
-@LINUX_HOST_TRUE@ src/client/linux/linux_client_unittest_shlib
+@LINUX_HOST_TRUE@ src/client/linux/linux_client_unittest_shlib \
+@LINUX_HOST_TRUE@ $(TEST_LIBS)
@LINUX_HOST_TRUE@src_client_linux_linux_client_unittest_DEPENDENCIES = \
@LINUX_HOST_TRUE@ src/client/linux/linux_client_unittest_shlib
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_tools_linux_core2md_core2md_SOURCES = \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/core2md/core2md.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_core_dumper.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/elf_core_dump.cc
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/core2md/core2md.cc
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_tools_linux_core2md_core2md_LDADD = \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/client/linux/libbreakpad_client.a
@@ -2212,16 +2435,21 @@ TESTS = $(check_PROGRAMS) $(check_SCRIPTS)
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf_cfi_to_module.cc \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf_cu_to_module.cc \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf_line_to_module.cc \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf_range_list_handler.cc \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/language.cc \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/module.cc \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/path_helper.cc \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/stabs_reader.cc \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/stabs_to_module.cc \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/bytereader.cc \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/dwarf2diehandler.cc \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/dwarf2reader.cc \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/elf_reader.cc \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/crc32.cc \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/dump_symbols.cc \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/dump_symbols.h \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/elf_symbols_to_module.cc \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/elf_symbols_to_module.h \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/elfutils.cc \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/file_id.cc \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/linux_libc_support.cc \
@@ -2229,9 +2457,17 @@ TESTS = $(check_PROGRAMS) $(check_SCRIPTS)
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/safe_readlink.cc \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/dump_syms/dump_syms.cc
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_tools_linux_dump_syms_dump_syms_CXXFLAGS = \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(RUST_DEMANGLE_CFLAGS)
+
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_tools_linux_dump_syms_dump_syms_LDADD = \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(RUST_DEMANGLE_LIBS)
+
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_tools_linux_md2core_minidump_2_core_SOURCES = \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/memory_mapped_file.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/md2core/minidump-2-core.cc
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/path_helper.cc \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/md2core/minidump-2-core.cc \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/md2core/minidump_memory_range.h
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_tools_linux_symupload_minidump_upload_SOURCES = \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/http_upload.cc \
@@ -2240,34 +2476,91 @@ TESTS = $(check_PROGRAMS) $(check_SCRIPTS)
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_tools_linux_symupload_minidump_upload_LDADD = -ldl
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_tools_linux_symupload_sym_upload_SOURCES = \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/http_upload.cc \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/http_upload.h \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/libcurl_wrapper.cc \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/libcurl_wrapper.h \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/symbol_collector_client.cc \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/symbol_collector_client.h \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/symbol_upload.cc \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/symbol_upload.h \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/symupload/sym_upload.cc
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_tools_linux_symupload_sym_upload_LDADD = -ldl
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_tools_mac_dump_syms_dump_syms_mac_SOURCES = \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf_cfi_to_module.cc \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf_cu_to_module.cc \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf_line_to_module.cc \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf_range_list_handler.cc \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/language.cc \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/md5.cc \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/module.cc \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/path_helper.cc \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/stabs_reader.cc \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/stabs_to_module.cc \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/bytereader.cc \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/dwarf2diehandler.cc \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/dwarf2reader.cc \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/elf_reader.cc \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/arch_utilities.cc \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/dump_syms.cc \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/dump_syms.h \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/file_id.cc \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/file_id.h \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/macho_id.cc \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/macho_id.h \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/macho_reader.cc \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/macho_reader.h \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/macho_utilities.cc \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/macho_utilities.h \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/macho_walker.cc \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/macho_walker.h \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/mac/dump_syms/dump_syms_tool.cc
+
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS = \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ -I$(top_srcdir)/src/third_party/mac_headers \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(RUST_DEMANGLE_CFLAGS) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ -DHAVE_MACH_O_NLIST_H
+
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_tools_mac_dump_syms_dump_syms_mac_LDADD = \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(RUST_DEMANGLE_LIBS)
+
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_common_dumper_unittest_SOURCES = \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/byte_cursor_unittest.cc \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/convert_UTF.cc \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf_cfi_to_module.cc \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf_cfi_to_module_unittest.cc \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf_cu_to_module.cc \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf_cu_to_module_unittest.cc \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf_line_to_module.cc \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf_line_to_module_unittest.cc \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf_range_list_handler.cc \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/language.cc \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/memory_range_unittest.cc \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/module.cc \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/module_unittest.cc \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/path_helper.cc \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/stabs_reader.cc \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/stabs_reader_unittest.cc \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/stabs_to_module.cc \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/stabs_to_module_unittest.cc \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/string_conversion.cc \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/string_conversion_unittest.cc \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/test_assembler.cc \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/bytereader.cc \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/bytereader.h \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/bytereader-inl.h \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/bytereader_unittest.cc \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/cfi_assembler.cc \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/cfi_assembler.h \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/dwarf2diehandler.cc \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/dwarf2diehandler_unittest.cc \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/dwarf2reader.cc \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/dwarf2reader.h \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/elf_reader.cc \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/elf_reader.h \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/dwarf2reader_cfi_unittest.cc \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/dwarf2reader_die_unittest.cc \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/dwarf2reader_test_common.h \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/crc32.cc \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/dump_symbols.cc \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/dump_symbols_unittest.cc \
@@ -2286,34 +2579,76 @@ TESTS = $(check_PROGRAMS) $(check_SCRIPTS)
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/synth_elf.cc \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/synth_elf_unittest.cc \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/tests/crash_generator.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/tests/file_utils.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/testing/gtest/src/gtest-all.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/testing/gtest/src/gtest_main.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/testing/src/gmock-all.cc
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/tests/crash_generator.h \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/testdata/func-line-pairing.h \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/tests/file_utils.cc
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_common_dumper_unittest_CPPFLAGS = \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ -I$(top_srcdir)/src \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ -I$(top_srcdir)/src/testing/include \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ -I$(top_srcdir)/src/testing/gtest/include \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ -I$(top_srcdir)/src/testing/gtest \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ -I$(top_srcdir)/src/testing \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(AM_CPPFLAGS) $(TEST_CFLAGS) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(RUST_DEMANGLE_CFLAGS) \
@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(PTHREAD_CFLAGS)
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_common_dumper_unittest_LDADD = $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_common_dumper_unittest_LDADD = \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(TEST_LIBS) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(RUST_DEMANGLE_LIBS) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
+
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_common_mac_macho_reader_unittest_SOURCES = \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf_cfi_to_module.cc \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf_cu_to_module.cc \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf_line_to_module.cc \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/language.cc \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/md5.cc \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/module.cc \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/path_helper.cc \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/stabs_reader.cc \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/stabs_to_module.cc \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/test_assembler.cc \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/bytereader.cc \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/cfi_assembler.cc \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/dwarf2diehandler.cc \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/dwarf2reader.cc \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/elf_reader.cc \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/arch_utilities.cc \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/file_id.cc \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/macho_id.cc \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/macho_reader.cc \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/macho_reader_unittest.cc \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/macho_utilities.cc \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/macho_walker.cc \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/tests/file_utils.cc
+
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_common_mac_macho_reader_unittest_CPPFLAGS = \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(AM_CPPFLAGS) $(TEST_CFLAGS) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ -I$(top_srcdir)/src/third_party/mac_headers \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ -DHAVE_MACH_O_NLIST_H \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(PTHREAD_CFLAGS)
+
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_common_mac_macho_reader_unittest_LDADD = \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(TEST_LIBS) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
+
+@LINUX_HOST_TRUE@src_common_linux_google_crashdump_uploader_test_SOURCES = \
+@LINUX_HOST_TRUE@ src/common/linux/google_crashdump_uploader.cc \
+@LINUX_HOST_TRUE@ src/common/linux/google_crashdump_uploader_test.cc \
+@LINUX_HOST_TRUE@ src/common/linux/libcurl_wrapper.cc
+
+@LINUX_HOST_TRUE@src_common_linux_google_crashdump_uploader_test_CPPFLAGS = \
+@LINUX_HOST_TRUE@ $(AM_CPPFLAGS) $(TEST_CFLAGS)
+
+@LINUX_HOST_TRUE@src_common_linux_google_crashdump_uploader_test_LDADD = \
+@LINUX_HOST_TRUE@ $(TEST_LIBS) \
+@LINUX_HOST_TRUE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) \
+@LINUX_HOST_TRUE@ -ldl
+
@LINUX_HOST_TRUE@src_tools_linux_md2core_minidump_2_core_unittest_SOURCES = \
-@LINUX_HOST_TRUE@ src/testing/gtest/src/gtest-all.cc \
-@LINUX_HOST_TRUE@ src/testing/gtest/src/gtest_main.cc \
-@LINUX_HOST_TRUE@ src/testing/src/gmock-all.cc \
@LINUX_HOST_TRUE@ src/tools/linux/md2core/minidump_memory_range_unittest.cc
@LINUX_HOST_TRUE@src_tools_linux_md2core_minidump_2_core_unittest_CPPFLAGS = \
-@LINUX_HOST_TRUE@ -I$(top_srcdir)/src \
-@LINUX_HOST_TRUE@ -I$(top_srcdir)/src/testing/include \
-@LINUX_HOST_TRUE@ -I$(top_srcdir)/src/testing/gtest/include \
-@LINUX_HOST_TRUE@ -I$(top_srcdir)/src/testing/gtest \
-@LINUX_HOST_TRUE@ -I$(top_srcdir)/src/testing
+@LINUX_HOST_TRUE@ $(AM_CPPFLAGS) $(TEST_CFLAGS)
@LINUX_HOST_TRUE@src_tools_linux_md2core_minidump_2_core_unittest_LDADD = \
+@LINUX_HOST_TRUE@ $(TEST_LIBS) \
@LINUX_HOST_TRUE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
@DISABLE_PROCESSOR_FALSE@src_processor_address_map_unittest_SOURCES = \
@@ -2323,33 +2658,11 @@ TESTS = $(check_PROGRAMS) $(check_SCRIPTS)
@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o
-@DISABLE_PROCESSOR_FALSE@src_processor_binarystream_unittest_SOURCES = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/binarystream_unittest.cc \
-@DISABLE_PROCESSOR_FALSE@ src/testing/gtest/src/gtest-all.cc \
-@DISABLE_PROCESSOR_FALSE@ src/testing/src/gmock-all.cc
-
-@DISABLE_PROCESSOR_FALSE@src_processor_binarystream_unittest_CPPFLAGS = \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing/include \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing/gtest/include \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing/gtest \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing
-
-@DISABLE_PROCESSOR_FALSE@src_processor_binarystream_unittest_LDADD = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/binarystream.o \
-@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-
@DISABLE_PROCESSOR_FALSE@src_processor_basic_source_line_resolver_unittest_SOURCES = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/basic_source_line_resolver_unittest.cc \
-@DISABLE_PROCESSOR_FALSE@ src/testing/gtest/src/gtest-all.cc \
-@DISABLE_PROCESSOR_FALSE@ src/testing/src/gmock-all.cc
+@DISABLE_PROCESSOR_FALSE@ src/processor/basic_source_line_resolver_unittest.cc
@DISABLE_PROCESSOR_FALSE@src_processor_basic_source_line_resolver_unittest_CPPFLAGS = \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing/include \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing/gtest/include \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing/gtest \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing
+@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS)
@DISABLE_PROCESSOR_FALSE@src_processor_basic_source_line_resolver_unittest_LDADD = \
@DISABLE_PROCESSOR_FALSE@ src/processor/basic_source_line_resolver.o \
@@ -2358,26 +2671,21 @@ TESTS = $(check_PROGRAMS) $(check_SCRIPTS)
@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/source_line_resolver_base.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/tokenize.o \
+@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \
@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
@DISABLE_PROCESSOR_FALSE@src_processor_cfi_frame_info_unittest_SOURCES = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info_unittest.cc \
-@DISABLE_PROCESSOR_FALSE@ src/testing/gtest/src/gtest-all.cc \
-@DISABLE_PROCESSOR_FALSE@ src/testing/gtest/src/gtest_main.cc \
-@DISABLE_PROCESSOR_FALSE@ src/testing/src/gmock-all.cc
+@DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info_unittest.cc
@DISABLE_PROCESSOR_FALSE@src_processor_cfi_frame_info_unittest_LDADD = \
@DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
+@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \
@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
@DISABLE_PROCESSOR_FALSE@src_processor_cfi_frame_info_unittest_CPPFLAGS = \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing/include \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing/gtest/include \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing/gtest \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing
+@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS)
@DISABLE_PROCESSOR_FALSE@src_processor_contained_range_map_unittest_SOURCES = \
@DISABLE_PROCESSOR_FALSE@ src/processor/contained_range_map_unittest.cc
@@ -2387,19 +2695,13 @@ TESTS = $(check_PROGRAMS) $(check_SCRIPTS)
@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o
@DISABLE_PROCESSOR_FALSE@src_processor_exploitability_unittest_SOURCES = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability_unittest.cc \
-@DISABLE_PROCESSOR_FALSE@ src/testing/gtest/src/gtest-all.cc \
-@DISABLE_PROCESSOR_FALSE@ src/testing/gtest/src/gtest_main.cc \
-@DISABLE_PROCESSOR_FALSE@ src/testing/src/gmock-all.cc
+@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability_unittest.cc
@DISABLE_PROCESSOR_FALSE@src_processor_exploitability_unittest_CPPFLAGS = \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing/include \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing/gtest/include \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing/gtest \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing
+@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS)
@DISABLE_PROCESSOR_FALSE@src_processor_exploitability_unittest_LDADD = \
+@DISABLE_PROCESSOR_FALSE@ src/processor/convert_old_arm64_context.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/minidump_processor.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/process_state.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_x86.o \
@@ -2415,6 +2717,7 @@ TESTS = $(check_PROGRAMS) $(check_SCRIPTS)
@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/minidump.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
+@DISABLE_PROCESSOR_FALSE@ src/processor/proc_maps_linux.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/simple_symbol_supplier.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/source_line_resolver_base.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/stack_frame_cpu.o \
@@ -2432,37 +2735,26 @@ TESTS = $(check_PROGRAMS) $(check_SCRIPTS)
@DISABLE_PROCESSOR_FALSE@ src/processor/symbolic_constants_win.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/tokenize.o \
@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/libdisasm.a \
+@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \
@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
@DISABLE_PROCESSOR_FALSE@src_processor_disassembler_x86_unittest_SOURCES = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_x86_unittest.cc \
-@DISABLE_PROCESSOR_FALSE@ src/testing/gtest/src/gtest-all.cc \
-@DISABLE_PROCESSOR_FALSE@ src/testing/gtest/src/gtest_main.cc \
-@DISABLE_PROCESSOR_FALSE@ src/testing/src/gmock-all.cc
+@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_x86_unittest.cc
@DISABLE_PROCESSOR_FALSE@src_processor_disassembler_x86_unittest_CPPFLAGS = \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing/include \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing/gtest/include \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing/gtest \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing
+@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS)
@DISABLE_PROCESSOR_FALSE@src_processor_disassembler_x86_unittest_LDADD = \
@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_x86.o \
@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/libdisasm.a \
+@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \
@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
@DISABLE_PROCESSOR_FALSE@src_processor_fast_source_line_resolver_unittest_SOURCES = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/fast_source_line_resolver_unittest.cc \
-@DISABLE_PROCESSOR_FALSE@ src/testing/gtest/src/gtest-all.cc \
-@DISABLE_PROCESSOR_FALSE@ src/testing/src/gmock-all.cc
+@DISABLE_PROCESSOR_FALSE@ src/processor/fast_source_line_resolver_unittest.cc
@DISABLE_PROCESSOR_FALSE@src_processor_fast_source_line_resolver_unittest_CPPFLAGS = \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing/include \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing/gtest/include \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing/gtest \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing
+@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS)
@DISABLE_PROCESSOR_FALSE@src_processor_fast_source_line_resolver_unittest_LDADD = \
@DISABLE_PROCESSOR_FALSE@ src/processor/fast_source_line_resolver.o \
@@ -2474,41 +2766,32 @@ TESTS = $(check_PROGRAMS) $(check_SCRIPTS)
@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/source_line_resolver_base.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/tokenize.o \
+@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \
@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
@DISABLE_PROCESSOR_FALSE@src_processor_map_serializers_unittest_SOURCES = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/map_serializers_unittest.cc \
-@DISABLE_PROCESSOR_FALSE@ src/testing/gtest/src/gtest-all.cc \
-@DISABLE_PROCESSOR_FALSE@ src/testing/src/gmock-all.cc
+@DISABLE_PROCESSOR_FALSE@ src/processor/map_serializers_unittest.cc
@DISABLE_PROCESSOR_FALSE@src_processor_map_serializers_unittest_CPPFLAGS = \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing/include \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing/gtest/include \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing/gtest \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing
+@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS)
@DISABLE_PROCESSOR_FALSE@src_processor_map_serializers_unittest_LDADD = \
@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
+@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \
@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
@DISABLE_PROCESSOR_FALSE@src_processor_microdump_processor_unittest_SOURCES = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/microdump_processor_unittest.cc \
-@DISABLE_PROCESSOR_FALSE@ src/testing/gtest/src/gtest-all.cc \
-@DISABLE_PROCESSOR_FALSE@ src/testing/src/gmock-all.cc
+@DISABLE_PROCESSOR_FALSE@ src/processor/microdump_processor_unittest.cc
@DISABLE_PROCESSOR_FALSE@src_processor_microdump_processor_unittest_CPPFLAGS = \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing/include \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing/gtest/include \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing/gtest \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing
+@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS)
@DISABLE_PROCESSOR_FALSE@src_processor_microdump_processor_unittest_LDADD = \
@DISABLE_PROCESSOR_FALSE@ src/processor/basic_code_modules.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/basic_source_line_resolver.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/call_stack.o \
+@DISABLE_PROCESSOR_FALSE@ src/processor/convert_old_arm64_context.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/dump_context.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/dump_object.o \
@@ -2531,25 +2814,21 @@ TESTS = $(check_PROGRAMS) $(check_SCRIPTS)
@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_sparc.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_x86.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/tokenize.o \
-@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
+@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \
+@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
@DISABLE_PROCESSOR_FALSE@src_processor_minidump_processor_unittest_SOURCES = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/minidump_processor_unittest.cc \
-@DISABLE_PROCESSOR_FALSE@ src/testing/gtest/src/gtest-all.cc \
-@DISABLE_PROCESSOR_FALSE@ src/testing/src/gmock-all.cc
+@DISABLE_PROCESSOR_FALSE@ src/processor/minidump_processor_unittest.cc
@DISABLE_PROCESSOR_FALSE@src_processor_minidump_processor_unittest_CPPFLAGS = \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing/include \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing/gtest/include \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing/gtest \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing
+@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS)
@DISABLE_PROCESSOR_FALSE@src_processor_minidump_processor_unittest_LDADD = \
@DISABLE_PROCESSOR_FALSE@ src/processor/basic_code_modules.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/basic_source_line_resolver.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/call_stack.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info.o \
+@DISABLE_PROCESSOR_FALSE@ src/processor/convert_old_arm64_context.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_x86.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/dump_context.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/dump_object.o \
@@ -2561,6 +2840,7 @@ TESTS = $(check_PROGRAMS) $(check_SCRIPTS)
@DISABLE_PROCESSOR_FALSE@ src/processor/minidump.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/process_state.o \
+@DISABLE_PROCESSOR_FALSE@ src/processor/proc_maps_linux.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/source_line_resolver_base.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/stack_frame_cpu.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/stack_frame_symbolizer.o \
@@ -2577,98 +2857,89 @@ TESTS = $(check_PROGRAMS) $(check_SCRIPTS)
@DISABLE_PROCESSOR_FALSE@ src/processor/symbolic_constants_win.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/tokenize.o \
@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/libdisasm.a \
+@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \
@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
@DISABLE_PROCESSOR_FALSE@src_processor_minidump_unittest_SOURCES = \
@DISABLE_PROCESSOR_FALSE@ src/common/test_assembler.cc \
@DISABLE_PROCESSOR_FALSE@ src/processor/minidump_unittest.cc \
-@DISABLE_PROCESSOR_FALSE@ src/processor/synth_minidump.cc \
-@DISABLE_PROCESSOR_FALSE@ src/testing/gtest/src/gtest-all.cc \
-@DISABLE_PROCESSOR_FALSE@ src/testing/gtest/src/gtest_main.cc \
-@DISABLE_PROCESSOR_FALSE@ src/testing/src/gmock-all.cc
+@DISABLE_PROCESSOR_FALSE@ src/processor/synth_minidump.cc
@DISABLE_PROCESSOR_FALSE@src_processor_minidump_unittest_CPPFLAGS = \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing/include \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing/gtest/include \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing/gtest \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing
+@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS)
@DISABLE_PROCESSOR_FALSE@src_processor_minidump_unittest_LDADD = \
@DISABLE_PROCESSOR_FALSE@ src/processor/basic_code_modules.o \
+@DISABLE_PROCESSOR_FALSE@ src/processor/convert_old_arm64_context.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/dump_context.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/dump_object.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/minidump.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
+@DISABLE_PROCESSOR_FALSE@ src/processor/proc_maps_linux.o \
+@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \
+@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
+
+@DISABLE_PROCESSOR_FALSE@src_processor_proc_maps_linux_unittest_SOURCES = \
+@DISABLE_PROCESSOR_FALSE@ src/processor/proc_maps_linux.cc \
+@DISABLE_PROCESSOR_FALSE@ src/processor/proc_maps_linux_unittest.cc
+
+@DISABLE_PROCESSOR_FALSE@src_processor_proc_maps_linux_unittest_CPPFLAGS = \
+@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS)
+
+@DISABLE_PROCESSOR_FALSE@src_processor_proc_maps_linux_unittest_LDADD = \
+@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
+@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
+@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/libdisasm.a \
+@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \
@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
@DISABLE_PROCESSOR_FALSE@src_processor_static_address_map_unittest_SOURCES = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/static_address_map_unittest.cc \
-@DISABLE_PROCESSOR_FALSE@ src/testing/gtest/src/gtest-all.cc \
-@DISABLE_PROCESSOR_FALSE@ src/testing/src/gmock-all.cc
+@DISABLE_PROCESSOR_FALSE@ src/processor/static_address_map_unittest.cc
@DISABLE_PROCESSOR_FALSE@src_processor_static_address_map_unittest_CPPFLAGS = \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing/include \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing/gtest/include \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing/gtest \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing
+@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS)
@DISABLE_PROCESSOR_FALSE@src_processor_static_address_map_unittest_LDADD = \
@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
+@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \
@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
@DISABLE_PROCESSOR_FALSE@src_processor_static_contained_range_map_unittest_SOURCES = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/static_contained_range_map_unittest.cc \
-@DISABLE_PROCESSOR_FALSE@ src/testing/gtest/src/gtest-all.cc \
-@DISABLE_PROCESSOR_FALSE@ src/testing/src/gmock-all.cc
+@DISABLE_PROCESSOR_FALSE@ src/processor/static_contained_range_map_unittest.cc
@DISABLE_PROCESSOR_FALSE@src_processor_static_contained_range_map_unittest_CPPFLAGS = \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing/include \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing/gtest/include \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing/gtest \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing
+@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS)
@DISABLE_PROCESSOR_FALSE@src_processor_static_contained_range_map_unittest_LDADD = \
@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
+@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \
@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
@DISABLE_PROCESSOR_FALSE@src_processor_static_map_unittest_SOURCES = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/static_map_unittest.cc \
-@DISABLE_PROCESSOR_FALSE@ src/testing/gtest/src/gtest-all.cc \
-@DISABLE_PROCESSOR_FALSE@ src/testing/src/gmock-all.cc
+@DISABLE_PROCESSOR_FALSE@ src/processor/static_map_unittest.cc
@DISABLE_PROCESSOR_FALSE@src_processor_static_map_unittest_CPPFLAGS = \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing/include \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing/gtest/include \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing/gtest \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing
+@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS)
@DISABLE_PROCESSOR_FALSE@src_processor_static_map_unittest_LDADD = \
@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
+@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \
@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
@DISABLE_PROCESSOR_FALSE@src_processor_static_range_map_unittest_SOURCES = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/static_range_map_unittest.cc \
-@DISABLE_PROCESSOR_FALSE@ src/testing/gtest/src/gtest-all.cc \
-@DISABLE_PROCESSOR_FALSE@ src/testing/src/gmock-all.cc
+@DISABLE_PROCESSOR_FALSE@ src/processor/static_range_map_unittest.cc
@DISABLE_PROCESSOR_FALSE@src_processor_static_range_map_unittest_CPPFLAGS = \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing/include \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing/gtest/include \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing/gtest \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing
+@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS)
@DISABLE_PROCESSOR_FALSE@src_processor_static_range_map_unittest_LDADD = \
@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
+@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \
@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
@DISABLE_PROCESSOR_FALSE@src_processor_pathname_stripper_unittest_SOURCES = \
@@ -2686,6 +2957,30 @@ TESTS = $(check_PROGRAMS) $(check_SCRIPTS)
@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
+@DISABLE_PROCESSOR_FALSE@src_processor_range_map_truncate_lower_unittest_SOURCES = \
+@DISABLE_PROCESSOR_FALSE@ src/processor/range_map_truncate_lower_unittest.cc
+
+@DISABLE_PROCESSOR_FALSE@src_processor_range_map_truncate_lower_unittest_LDADD = \
+@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
+@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
+@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \
+@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
+
+@DISABLE_PROCESSOR_FALSE@src_processor_range_map_truncate_lower_unittest_CPPFLAGS = \
+@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS)
+
+@DISABLE_PROCESSOR_FALSE@src_processor_range_map_truncate_upper_unittest_SOURCES = \
+@DISABLE_PROCESSOR_FALSE@ src/processor/range_map_truncate_upper_unittest.cc
+
+@DISABLE_PROCESSOR_FALSE@src_processor_range_map_truncate_upper_unittest_LDADD = \
+@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
+@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
+@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \
+@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
+
+@DISABLE_PROCESSOR_FALSE@src_processor_range_map_truncate_upper_unittest_CPPFLAGS = \
+@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS)
+
@DISABLE_PROCESSOR_FALSE@src_processor_range_map_unittest_SOURCES = \
@DISABLE_PROCESSOR_FALSE@ src/processor/range_map_unittest.cc
@@ -2708,6 +3003,7 @@ TESTS = $(check_PROGRAMS) $(check_SCRIPTS)
@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/minidump.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
+@DISABLE_PROCESSOR_FALSE@ src/processor/proc_maps_linux.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/source_line_resolver_base.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/stack_frame_cpu.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/stack_frame_symbolizer.o \
@@ -2726,166 +3022,137 @@ TESTS = $(check_PROGRAMS) $(check_SCRIPTS)
@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_amd64_unittest_SOURCES = \
@DISABLE_PROCESSOR_FALSE@ src/common/test_assembler.cc \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_amd64_unittest.cc \
-@DISABLE_PROCESSOR_FALSE@ src/testing/gtest/src/gtest-all.cc \
-@DISABLE_PROCESSOR_FALSE@ src/testing/gtest/src/gtest_main.cc \
-@DISABLE_PROCESSOR_FALSE@ src/testing/src/gmock-all.cc
+@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_amd64_unittest.cc
@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_amd64_unittest_LDADD = \
@DISABLE_PROCESSOR_FALSE@ src/libbreakpad.a \
+@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \
@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_amd64_unittest_CPPFLAGS = \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing/include \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing/gtest/include \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing/gtest \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing
+@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS)
@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_arm_unittest_SOURCES = \
@DISABLE_PROCESSOR_FALSE@ src/common/test_assembler.cc \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm_unittest.cc \
-@DISABLE_PROCESSOR_FALSE@ src/testing/gtest/src/gtest-all.cc \
-@DISABLE_PROCESSOR_FALSE@ src/testing/gtest/src/gtest_main.cc \
-@DISABLE_PROCESSOR_FALSE@ src/testing/src/gmock-all.cc
+@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm_unittest.cc
@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_arm_unittest_LDADD = \
@DISABLE_PROCESSOR_FALSE@ src/libbreakpad.a \
+@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \
@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_arm_unittest_CPPFLAGS = \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing/include \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing/gtest/include \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing/gtest \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing
+@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS)
@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_arm64_unittest_SOURCES = \
@DISABLE_PROCESSOR_FALSE@ src/common/test_assembler.cc \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm64_unittest.cc \
-@DISABLE_PROCESSOR_FALSE@ src/testing/gtest/src/gtest-all.cc \
-@DISABLE_PROCESSOR_FALSE@ src/testing/gtest/src/gtest_main.cc \
-@DISABLE_PROCESSOR_FALSE@ src/testing/src/gmock-all.cc
+@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm64_unittest.cc
@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_arm64_unittest_LDADD = \
@DISABLE_PROCESSOR_FALSE@ src/libbreakpad.a \
+@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \
@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_arm64_unittest_CPPFLAGS = \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing/include \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing/gtest/include \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing/gtest \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing
+@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS)
@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_address_list_unittest_SOURCES = \
@DISABLE_PROCESSOR_FALSE@ src/common/test_assembler.cc \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_address_list_unittest.cc \
-@DISABLE_PROCESSOR_FALSE@ src/testing/gtest/src/gtest-all.cc \
-@DISABLE_PROCESSOR_FALSE@ src/testing/gtest/src/gtest_main.cc \
-@DISABLE_PROCESSOR_FALSE@ src/testing/src/gmock-all.cc
+@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_address_list_unittest.cc
@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_address_list_unittest_LDADD = \
@DISABLE_PROCESSOR_FALSE@ src/libbreakpad.a \
+@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \
@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_address_list_unittest_CPPFLAGS = \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing/include \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing/gtest/include \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing/gtest \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing
+@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS)
@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_mips_unittest_SOURCES = \
@DISABLE_PROCESSOR_FALSE@ src/common/test_assembler.cc \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_mips_unittest.cc \
-@DISABLE_PROCESSOR_FALSE@ src/testing/gtest/src/gtest-all.cc \
-@DISABLE_PROCESSOR_FALSE@ src/testing/gtest/src/gtest_main.cc \
-@DISABLE_PROCESSOR_FALSE@ src/testing/src/gmock-all.cc
+@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_mips_unittest.cc
@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_mips_unittest_LDADD = \
@DISABLE_PROCESSOR_FALSE@ src/libbreakpad.a \
+@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \
@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_mips_unittest_CPPFLAGS = \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing/include \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing/gtest/include \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing/gtest \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing
+@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS)
+
+@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_mips64_unittest_SOURCES = \
+@DISABLE_PROCESSOR_FALSE@ src/common/test_assembler.cc \
+@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_mips64_unittest.cc
+
+@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_mips64_unittest_LDADD = \
+@DISABLE_PROCESSOR_FALSE@ src/libbreakpad.a \
+@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \
+@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
+
+@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_mips64_unittest_CPPFLAGS = \
+@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS)
@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_x86_unittest_SOURCES = \
@DISABLE_PROCESSOR_FALSE@ src/common/test_assembler.cc \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_x86_unittest.cc \
-@DISABLE_PROCESSOR_FALSE@ src/testing/gtest/src/gtest-all.cc \
-@DISABLE_PROCESSOR_FALSE@ src/testing/gtest/src/gtest_main.cc \
-@DISABLE_PROCESSOR_FALSE@ src/testing/src/gmock-all.cc
+@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_x86_unittest.cc
@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_x86_unittest_LDADD = \
@DISABLE_PROCESSOR_FALSE@ src/libbreakpad.a \
+@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \
@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_x86_unittest_CPPFLAGS = \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing/include \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing/gtest/include \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing/gtest \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing
+@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS)
@DISABLE_PROCESSOR_FALSE@src_processor_synth_minidump_unittest_SOURCES = \
@DISABLE_PROCESSOR_FALSE@ src/common/test_assembler.cc \
@DISABLE_PROCESSOR_FALSE@ src/common/test_assembler.h \
@DISABLE_PROCESSOR_FALSE@ src/processor/synth_minidump_unittest.cc \
-@DISABLE_PROCESSOR_FALSE@ src/testing/gtest/src/gtest-all.cc \
-@DISABLE_PROCESSOR_FALSE@ src/testing/gtest/src/gtest_main.cc \
-@DISABLE_PROCESSOR_FALSE@ src/testing/src/gmock-all.cc \
@DISABLE_PROCESSOR_FALSE@ src/processor/synth_minidump.cc \
@DISABLE_PROCESSOR_FALSE@ src/processor/synth_minidump.h
@DISABLE_PROCESSOR_FALSE@src_processor_synth_minidump_unittest_CPPFLAGS = \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing/include \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing/gtest/include \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing/gtest \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing
+@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS)
+
+@DISABLE_PROCESSOR_FALSE@src_processor_synth_minidump_unittest_LDADD = \
+@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \
+@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-@DISABLE_PROCESSOR_FALSE@src_processor_synth_minidump_unittest_LDADD = $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
@DISABLE_PROCESSOR_FALSE@src_common_test_assembler_unittest_SOURCES = \
@DISABLE_PROCESSOR_FALSE@ src/common/test_assembler.cc \
@DISABLE_PROCESSOR_FALSE@ src/common/test_assembler.h \
-@DISABLE_PROCESSOR_FALSE@ src/common/test_assembler_unittest.cc \
-@DISABLE_PROCESSOR_FALSE@ src/testing/gtest/src/gtest-all.cc \
-@DISABLE_PROCESSOR_FALSE@ src/testing/gtest/src/gtest_main.cc \
-@DISABLE_PROCESSOR_FALSE@ src/testing/src/gmock-all.cc
+@DISABLE_PROCESSOR_FALSE@ src/common/test_assembler_unittest.cc
@DISABLE_PROCESSOR_FALSE@src_common_test_assembler_unittest_CPPFLAGS = \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing/include \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing/gtest/include \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing/gtest \
-@DISABLE_PROCESSOR_FALSE@ -I$(top_srcdir)/src/testing
+@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS)
+
+@DISABLE_PROCESSOR_FALSE@src_common_test_assembler_unittest_LDADD = \
+@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \
+@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-@DISABLE_PROCESSOR_FALSE@src_common_test_assembler_unittest_LDADD = $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
@DISABLE_PROCESSOR_FALSE@noinst_SCRIPTS = $(check_SCRIPTS)
@DISABLE_PROCESSOR_FALSE@src_processor_minidump_dump_SOURCES = \
@DISABLE_PROCESSOR_FALSE@ src/processor/minidump_dump.cc
@DISABLE_PROCESSOR_FALSE@src_processor_minidump_dump_LDADD = \
@DISABLE_PROCESSOR_FALSE@ src/processor/basic_code_modules.o \
+@DISABLE_PROCESSOR_FALSE@ src/processor/convert_old_arm64_context.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/dump_context.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/dump_object.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/minidump.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o
+@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
+@DISABLE_PROCESSOR_FALSE@ src/processor/proc_maps_linux.o
@DISABLE_PROCESSOR_FALSE@src_processor_microdump_stackwalk_SOURCES = \
@DISABLE_PROCESSOR_FALSE@ src/processor/microdump_stackwalk.cc
@DISABLE_PROCESSOR_FALSE@src_processor_microdump_stackwalk_LDADD = \
+@DISABLE_PROCESSOR_FALSE@ src/common/path_helper.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/basic_code_modules.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/basic_source_line_resolver.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/binarystream.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/call_stack.o \
+@DISABLE_PROCESSOR_FALSE@ src/processor/convert_old_arm64_context.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_x86.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/dump_context.o \
@@ -2917,11 +3184,12 @@ TESTS = $(check_PROGRAMS) $(check_SCRIPTS)
@DISABLE_PROCESSOR_FALSE@ src/processor/minidump_stackwalk.cc
@DISABLE_PROCESSOR_FALSE@src_processor_minidump_stackwalk_LDADD = \
+@DISABLE_PROCESSOR_FALSE@ src/common/path_helper.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/basic_code_modules.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/basic_source_line_resolver.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/binarystream.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/call_stack.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info.o \
+@DISABLE_PROCESSOR_FALSE@ src/processor/convert_old_arm64_context.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_x86.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/dump_context.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/dump_object.o \
@@ -2933,6 +3201,7 @@ TESTS = $(check_PROGRAMS) $(check_SCRIPTS)
@DISABLE_PROCESSOR_FALSE@ src/processor/minidump_processor.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/process_state.o \
+@DISABLE_PROCESSOR_FALSE@ src/processor/proc_maps_linux.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/simple_symbol_supplier.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/source_line_resolver_base.o \
@DISABLE_PROCESSOR_FALSE@ src/processor/stack_frame_cpu.o \
@@ -2954,33 +3223,32 @@ TESTS = $(check_PROGRAMS) $(check_SCRIPTS)
EXTRA_DIST = \
$(SCRIPTS) \
- src/processor/stackwalk_selftest_sol.s \
- src/client/linux/handler/Makefile \
- src/client/linux/handler/exception_handler.cc \
- src/client/linux/handler/exception_handler.h \
- src/client/linux/handler/minidump_descriptor.cc \
- src/client/linux/handler/minidump_descriptor.h \
- src/client/linux/handler/exception_handler_test.cc \
- src/client/linux/handler/linux_thread.cc \
- src/client/linux/handler/linux_thread.h \
- src/client/linux/handler/linux_thread_test.cc \
- src/client/linux/handler/minidump_generator.cc \
- src/client/linux/handler/minidump_generator.h \
- src/client/linux/handler/minidump_test.cc \
+ src/client/linux/data/linux-gate-amd.sym \
+ src/client/linux/data/linux-gate-intel.sym \
+ src/client/mac/handler/breakpad_nlist_64.cc \
+ src/client/mac/handler/breakpad_nlist_64.h \
src/client/mac/handler/dynamic_images.cc \
src/client/mac/handler/dynamic_images.h \
src/client/mac/handler/exception_handler.cc \
src/client/mac/handler/exception_handler.h \
- src/client/mac/handler/exception_handler_test.cc \
+ src/client/mac/handler/mach_vm_compat.h \
src/client/mac/handler/minidump_generator.cc \
src/client/mac/handler/minidump_generator.h \
- src/client/mac/handler/minidump_generator_test.cc \
src/client/mac/handler/minidump_test.xcodeproj/project.pbxproj \
+ src/client/mac/handler/minidump_tests32-Info.plist \
+ src/client/mac/handler/minidump_tests64-Info.plist \
+ src/client/mac/handler/obj-cTestCases-Info.plist \
src/client/mac/handler/protected_memory_allocator.cc \
src/client/mac/handler/protected_memory_allocator.h \
- src/client/minidump_file_writer-inl.h \
- src/client/minidump_file_writer.cc \
- src/client/minidump_file_writer.h \
+ src/client/mac/handler/ucontext_compat.h \
+ src/client/mac/handler/testcases/testdata/dump_syms_i386_breakpad.sym \
+ src/client/mac/tests/BreakpadFramework_Test.mm \
+ src/client/mac/tests/crash_generation_server_test.cc \
+ src/client/mac/tests/exception_handler_test.cc \
+ src/client/mac/tests/minidump_generator_test.cc \
+ src/client/mac/tests/minidump_generator_test_helper.cc \
+ src/client/mac/tests/spawn_child_process.h \
+ src/client/mac/tests/testlogging.h \
src/client/minidump_file_writer_unittest.cc \
src/client/solaris/handler/Makefile \
src/client/solaris/handler/exception_handler.cc \
@@ -2991,44 +3259,24 @@ EXTRA_DIST = \
src/client/solaris/handler/minidump_test.cc \
src/client/solaris/handler/solaris_lwp.cc \
src/client/solaris/handler/solaris_lwp.h \
- src/client/windows/breakpad_client.sln \
+ src/client/windows/breakpad_client.gyp \
src/client/windows/handler/exception_handler.cc \
src/client/windows/handler/exception_handler.h \
- src/client/windows/handler/exception_handler.vcproj \
+ src/client/windows/handler/exception_handler.gyp \
src/client/windows/sender/crash_report_sender.cc \
src/client/windows/sender/crash_report_sender.h \
- src/client/windows/sender/crash_report_sender.vcproj \
- src/common/convert_UTF.c \
- src/common/convert_UTF.h \
- src/common/linux/crc32.cc \
- src/common/linux/dump_symbols.cc \
- src/common/linux/dump_symbols.h \
- src/common/linux/elf_symbols_to_module.cc \
- src/common/linux/elf_symbols_to_module.h \
- src/common/linux/elfutils.cc \
- src/common/linux/elfutils.h \
- src/common/linux/file_id.cc \
- src/common/linux/file_id.h \
- src/common/linux/guid_creator.cc \
- src/common/linux/guid_creator.h \
- src/common/linux/http_upload.cc \
- src/common/linux/http_upload.h \
+ src/client/windows/sender/crash_report_sender.gyp \
+ src/common/dwarf/dwarf2diehandler.h \
+ src/common/dwarf/dwarf2enums.h \
+ src/common/dwarf/line_state_machine.h \
+ src/common/dwarf/types.h \
+ src/common/mac/arch_utilities.h \
+ src/common/mac/byteswap.h \
src/common/mac/HTTPMultipartUpload.h \
src/common/mac/HTTPMultipartUpload.m \
- src/common/mac/dump_syms.h \
- src/common/mac/dump_syms.mm \
- src/common/mac/file_id.cc \
- src/common/mac/file_id.h \
- src/common/mac/macho_id.cc \
- src/common/mac/macho_id.h \
- src/common/mac/macho_utilities.cc \
- src/common/mac/macho_utilities.h \
- src/common/mac/macho_walker.cc \
- src/common/mac/macho_walker.h \
src/common/mac/string_utilities.cc \
src/common/mac/string_utilities.h \
- src/common/md5.cc \
- src/common/md5.h \
+ src/common/mac/super_fat_arch.h \
src/common/scoped_ptr.h \
src/common/solaris/dump_symbols.cc \
src/common/solaris/dump_symbols.h \
@@ -3037,8 +3285,6 @@ EXTRA_DIST = \
src/common/solaris/guid_creator.cc \
src/common/solaris/guid_creator.h \
src/common/solaris/message_output.h \
- src/common/string_conversion.cc \
- src/common/string_conversion.h \
src/common/windows/guid_string.cc \
src/common/windows/guid_string.h \
src/common/windows/http_upload.cc \
@@ -3047,28 +3293,176 @@ EXTRA_DIST = \
src/common/windows/pdb_source_line_writer.h \
src/common/windows/string_utils-inl.h \
src/common/windows/string_utils.cc \
+ src/processor/microdump_stackwalk_test_vars \
+ src/processor/stackwalk_common.cc \
+ src/processor/stackwalk_common.h \
+ src/processor/stackwalker_selftest_sol.s \
+ src/processor/testdata/ascii_read_av_block_write.dmp \
+ src/processor/testdata/ascii_read_av_clobber_write.dmp \
+ src/processor/testdata/ascii_read_av_conditional.dmp \
+ src/processor/testdata/ascii_read_av.dmp \
+ src/processor/testdata/ascii_read_av_then_jmp.dmp \
+ src/processor/testdata/ascii_read_av_xchg_write.dmp \
+ src/processor/testdata/ascii_write_av_arg_to_call.dmp \
+ src/processor/testdata/ascii_write_av.dmp \
+ src/processor/testdata/exec_av_on_stack.dmp \
+ src/processor/testdata/linux_divide_by_zero.dmp \
+ src/processor/testdata/linux_executable_heap.dmp \
+ src/processor/testdata/linux_executable_stack.dmp \
+ src/processor/testdata/linux_inside_module_exe_region1.dmp \
+ src/processor/testdata/linux_inside_module_exe_region2.dmp \
+ src/processor/testdata/linux_jmp_to_0.dmp \
+ src/processor/testdata/linux_jmp_to_module_not_exe_region.dmp \
+ src/processor/testdata/linux_null_dereference.dmp \
+ src/processor/testdata/linux_null_read_av.dmp \
+ src/processor/testdata/linux_outside_module.dmp \
+ src/processor/testdata/linux_overflow.dmp \
+ src/processor/testdata/linux_raise_sigabrt.dmp \
+ src/processor/testdata/linux_stack_pointer_in_module.dmp \
+ src/processor/testdata/linux_stack_pointer_in_stack.dmp \
+ src/processor/testdata/linux_stack_pointer_in_stack_alt_name.dmp \
+ src/processor/testdata/linux_stacksmash.dmp \
+ src/processor/testdata/linux_write_to_nonwritable_module.dmp \
+ src/processor/testdata/linux_write_to_nonwritable_region_math.dmp \
+ src/processor/testdata/linux_write_to_outside_module.dmp \
+ src/processor/testdata/linux_write_to_outside_module_via_math.dmp \
+ src/processor/testdata/linux_write_to_under_4k.dmp \
+ src/processor/testdata/microdump-arm64.dmp \
+ src/processor/testdata/microdump-arm.dmp \
+ src/processor/testdata/microdump-mips32.dmp \
+ src/processor/testdata/microdump-mips64.dmp \
+ src/processor/testdata/microdump-multiple.dmp \
+ src/processor/testdata/microdump.stackwalk-arm64.out \
+ src/processor/testdata/microdump.stackwalk-arm.out \
+ src/processor/testdata/microdump.stackwalk.machine_readable-arm64.out \
+ src/processor/testdata/microdump.stackwalk.machine_readable-arm.out \
+ src/processor/testdata/microdump-withcrashreason.dmp \
+ src/processor/testdata/microdump-x86.dmp \
+ src/processor/testdata/minidump_32bit_crash_addr.dmp \
src/processor/testdata/minidump2.dmp \
src/processor/testdata/minidump2.dump.out \
src/processor/testdata/minidump2.stackwalk.machine_readable.out \
src/processor/testdata/minidump2.stackwalk.out \
+ src/processor/testdata/module0.out \
src/processor/testdata/module1.out \
src/processor/testdata/module2.out \
src/processor/testdata/module3_bad.out \
src/processor/testdata/module4_bad.out \
+ src/processor/testdata/null_read_av.dmp \
+ src/processor/testdata/null_write_av.dmp \
+ src/processor/testdata/read_av_clobber_write.dmp \
+ src/processor/testdata/read_av_conditional.dmp \
+ src/processor/testdata/read_av_non_null.dmp \
+ src/processor/testdata/stack_exhaustion.dmp \
+ src/processor/testdata/write_av_non_null.dmp \
src/processor/testdata/symbols/kernel32.pdb/BCE8785C57B44245A669896B6A19B9542/kernel32.sym \
+ src/processor/testdata/symbols/ld-2.13.so/C32AD7E235EA6112E02A5B9D6219C4850/ld-2.13.so.sym \
+ src/processor/testdata/symbols/libc-2.13.so/F4F8DFCD5A5FB5A7CE64717E9E6AE3890/libc-2.13.so.sym \
+ src/processor/testdata/symbols/libgcc_s.so.1/18B180F90887D8F8B5C35D185444AF4C0/libgcc_s.so.1.sym \
+ src/processor/testdata/symbols/microdump/breakpad_unittests/D6D1FEC9A15DE7F38A236898871A2E770/breakpad_unittests.sym \
+ src/processor/testdata/symbols/microdump/breakpad_unittests/DA7778FB66018A4E9B4110ED06E730D00/breakpad_unittests.sym \
+ src/processor/testdata/symbols/microdump/crash_example/6E72E2F1A5F59AB3D51356FDFE394D490/crash_example.sym \
+ src/processor/testdata/symbols/microdump/crash_example/8F36148CC4647A8116CAF2A25F591F570/crash_example.sym \
+ src/processor/testdata/symbols/null_read_av/7B7D1968FF0D47AE4366E9C3A7E1B6750/null_read_av.sym \
+ src/processor/testdata/symbols/overflow/B0E1FC01EF48E39CAF5C881D2DF0C3840/overflow.sym \
src/processor/testdata/symbols/test_app.pdb/5A9832E5287241C1838ED98914E9B7FF1/test_app.sym \
src/processor/testdata/test_app.cc \
- src/tools/linux/dump_syms/Makefile \
- src/tools/linux/dump_syms/dump_syms.cc \
- src/tools/linux/symupload/Makefile \
- src/tools/linux/symupload/minidump_upload.cc \
- src/tools/linux/symupload/sym_upload.cc \
+ src/testing/googletest/include/gtest/gtest.h \
+ src/testing/googletest/include/gtest/gtest-death-test.h \
+ src/testing/googletest/include/gtest/gtest-matchers.h \
+ src/testing/googletest/include/gtest/gtest-message.h \
+ src/testing/googletest/include/gtest/gtest-param-test.h \
+ src/testing/googletest/include/gtest/gtest-printers.h \
+ src/testing/googletest/include/gtest/gtest-spi.h \
+ src/testing/googletest/include/gtest/gtest-test-part.h \
+ src/testing/googletest/include/gtest/gtest-typed-test.h \
+ src/testing/googletest/include/gtest/gtest_pred_impl.h \
+ src/testing/googletest/include/gtest/gtest_prod.h \
+ src/testing/googletest/include/gtest/internal/custom/gtest-port.h \
+ src/testing/googletest/include/gtest/internal/custom/gtest-printers.h \
+ src/testing/googletest/include/gtest/internal/custom/gtest.h \
+ src/testing/googletest/include/gtest/internal/gtest-death-test-internal.h \
+ src/testing/googletest/include/gtest/internal/gtest-filepath.h \
+ src/testing/googletest/include/gtest/internal/gtest-internal.h \
+ src/testing/googletest/include/gtest/internal/gtest-param-util-generated.h \
+ src/testing/googletest/include/gtest/internal/gtest-param-util.h \
+ src/testing/googletest/include/gtest/internal/gtest-port-arch.h \
+ src/testing/googletest/include/gtest/internal/gtest-port.h \
+ src/testing/googletest/include/gtest/internal/gtest-string.h \
+ src/testing/googletest/include/gtest/internal/gtest-type-util.h \
+ src/testing/googletest/src/gtest.cc \
+ src/testing/googletest/src/gtest-death-test.cc \
+ src/testing/googletest/src/gtest-filepath.cc \
+ src/testing/googletest/src/gtest-internal-inl.h \
+ src/testing/googletest/src/gtest-matchers.cc \
+ src/testing/googletest/src/gtest-port.cc \
+ src/testing/googletest/src/gtest-printers.cc \
+ src/testing/googletest/src/gtest-test-part.cc \
+ src/testing/googletest/src/gtest-typed-test.cc \
+ src/testing/googlemock/include/gmock/gmock.h \
+ src/testing/googlemock/include/gmock/gmock-actions.h \
+ src/testing/googlemock/include/gmock/gmock-cardinalities.h \
+ src/testing/googlemock/include/gmock/gmock-function-mocker.h \
+ src/testing/googlemock/include/gmock/gmock-generated-actions.h \
+ src/testing/googlemock/include/gmock/gmock-generated-function-mockers.h \
+ src/testing/googlemock/include/gmock/gmock-generated-matchers.h \
+ src/testing/googlemock/include/gmock/gmock-matchers.h \
+ src/testing/googlemock/include/gmock/gmock-more-actions.h \
+ src/testing/googlemock/include/gmock/gmock-more-matchers.h \
+ src/testing/googlemock/include/gmock/gmock-nice-strict.h \
+ src/testing/googlemock/include/gmock/gmock-spec-builders.h \
+ src/testing/googlemock/include/gmock/internal/custom/gmock-generated-actions.h \
+ src/testing/googlemock/include/gmock/internal/custom/gmock-matchers.h \
+ src/testing/googlemock/include/gmock/internal/custom/gmock-port.h \
+ src/testing/googlemock/include/gmock/internal/gmock-internal-utils.h \
+ src/testing/googlemock/include/gmock/internal/gmock-port.h \
+ src/testing/googlemock/include/gmock/internal/gmock-pp.h \
+ src/testing/googlemock/src/gmock.cc \
+ src/testing/googlemock/src/gmock-cardinalities.cc \
+ src/testing/googlemock/src/gmock-internal-utils.cc \
+ src/testing/googlemock/src/gmock-matchers.cc \
+ src/testing/googlemock/src/gmock-spec-builders.cc \
+ src/testing/googlemock/src/gmock_main.cc \
+ src/third_party/curl/COPYING \
+ src/third_party/curl/curlbuild.h \
+ src/third_party/curl/curl.h \
+ src/third_party/curl/curlrules.h \
+ src/third_party/curl/curlver.h \
+ src/third_party/curl/easy.h \
+ src/third_party/curl/mprintf.h \
+ src/third_party/curl/multi.h \
+ src/third_party/curl/stdcheaders.h \
+ src/third_party/curl/typecheck-gcc.h \
+ src/third_party/curl/types.h \
+ src/third_party/mac_headers/architecture/byte_order.h \
+ src/third_party/mac_headers/i386/_types.h \
+ src/third_party/mac_headers/mach/boolean.h \
+ src/third_party/mac_headers/mach/i386/boolean.h \
+ src/third_party/mac_headers/mach/i386/vm_param.h \
+ src/third_party/mac_headers/mach/i386/vm_types.h \
+ src/third_party/mac_headers/mach/machine/boolean.h \
+ src/third_party/mac_headers/mach/machine.h \
+ src/third_party/mac_headers/mach/machine/thread_state.h \
+ src/third_party/mac_headers/mach/machine/thread_status.h \
+ src/third_party/mac_headers/mach/machine/vm_types.h \
+ src/third_party/mac_headers/mach-o/arch.h \
+ src/third_party/mac_headers/mach-o/fat.h \
+ src/third_party/mac_headers/mach-o/loader.h \
+ src/third_party/mac_headers/mach-o/nlist.h \
+ src/third_party/mac_headers/mach/thread_status.h \
+ src/third_party/mac_headers/mach/vm_prot.h \
+ src/third_party/mac_headers/README \
+ src/third_party/musl/README \
+ src/third_party/musl/COPYRIGHT \
+ src/third_party/musl/README.breakpad \
+ src/third_party/musl/VERSION \
+ src/third_party/musl/include/elf.h \
src/tools/mac/crash_report/crash_report.mm \
src/tools/mac/crash_report/crash_report.xcodeproj/project.pbxproj \
src/tools/mac/crash_report/on_demand_symbol_supplier.h \
src/tools/mac/crash_report/on_demand_symbol_supplier.mm \
src/tools/mac/dump_syms/dump_syms.xcodeproj/project.pbxproj \
- src/tools/mac/dump_syms/dump_syms_tool.m \
+ src/tools/mac/dump_syms/dump_syms_tool.cc \
src/tools/mac/symupload/minidump_upload.m \
src/tools/mac/symupload/symupload.m \
src/tools/mac/symupload/symupload.xcodeproj/project.pbxproj \
@@ -3081,15 +3475,20 @@ EXTRA_DIST = \
src/tools/solaris/dump_syms/testdata/dump_syms_regtest.sym \
src/tools/windows/converter/ms_symbol_server_converter.cc \
src/tools/windows/converter/ms_symbol_server_converter.h \
- src/tools/windows/converter/ms_symbol_server_converter.vcproj \
+ src/tools/windows/converter/ms_symbol_server_converter.gyp \
src/tools/windows/dump_syms/dump_syms.cc \
- src/tools/windows/dump_syms/dump_syms.vcproj \
+ src/tools/windows/dump_syms/dump_syms.gyp \
src/tools/windows/dump_syms/run_regtest.sh \
src/tools/windows/dump_syms/testdata/dump_syms_regtest.cc \
src/tools/windows/dump_syms/testdata/dump_syms_regtest.pdb \
src/tools/windows/dump_syms/testdata/dump_syms_regtest.sym \
+ src/tools/windows/dump_syms/testdata/dump_syms_regtest64.sym \
+ src/tools/windows/dump_syms/testdata/omap_reorder_bbs.sym \
+ src/tools/windows/dump_syms/testdata/omap_reorder_funcs.sym \
+ src/tools/windows/dump_syms/testdata/omap_stretched.sym \
+ src/tools/windows/dump_syms/testdata/omap_stretched_filled.sym \
src/tools/windows/symupload/symupload.cc \
- src/tools/windows/symupload/symupload.vcproj
+ src/tools/windows/symupload/symupload.gyp
all: all-am
@@ -3110,7 +3509,6 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign Makefile
-.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
@@ -3137,7 +3535,7 @@ src/config.h: src/stamp-h1
src/stamp-h1: $(top_srcdir)/src/config.h.in $(top_builddir)/config.status
@rm -f src/stamp-h1
cd $(top_builddir) && $(SHELL) ./config.status src/config.h
-$(top_srcdir)/src/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+$(top_srcdir)/src/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
($(am__cd) $(top_srcdir) && $(AUTOHEADER))
rm -f src/stamp-h1
touch $@
@@ -3148,6 +3546,9 @@ breakpad.pc: $(top_builddir)/config.status $(srcdir)/breakpad.pc.in
cd $(top_builddir) && $(SHELL) ./config.status $@
breakpad-client.pc: $(top_builddir)/config.status $(srcdir)/breakpad-client.pc.in
cd $(top_builddir) && $(SHELL) ./config.status $@
+
+clean-checkLIBRARIES:
+ -test -z "$(check_LIBRARIES)" || rm -f $(check_LIBRARIES)
install-libLIBRARIES: $(lib_LIBRARIES)
@$(NORMAL_INSTALL)
@list='$(lib_LIBRARIES)'; test -n "$(libdir)" || list=; \
@@ -3200,9 +3601,6 @@ src/client/linux/dump_writer_common/$(am__dirstamp):
src/client/linux/dump_writer_common/$(DEPDIR)/$(am__dirstamp):
@$(MKDIR_P) src/client/linux/dump_writer_common/$(DEPDIR)
@: > src/client/linux/dump_writer_common/$(DEPDIR)/$(am__dirstamp)
-src/client/linux/dump_writer_common/seccomp_unwinder.$(OBJEXT): \
- src/client/linux/dump_writer_common/$(am__dirstamp) \
- src/client/linux/dump_writer_common/$(DEPDIR)/$(am__dirstamp)
src/client/linux/dump_writer_common/thread_info.$(OBJEXT): \
src/client/linux/dump_writer_common/$(am__dirstamp) \
src/client/linux/dump_writer_common/$(DEPDIR)/$(am__dirstamp)
@@ -3245,6 +3643,9 @@ src/client/linux/minidump_writer/$(am__dirstamp):
src/client/linux/minidump_writer/$(DEPDIR)/$(am__dirstamp):
@$(MKDIR_P) src/client/linux/minidump_writer/$(DEPDIR)
@: > src/client/linux/minidump_writer/$(DEPDIR)/$(am__dirstamp)
+src/client/linux/minidump_writer/linux_core_dumper.$(OBJEXT): \
+ src/client/linux/minidump_writer/$(am__dirstamp) \
+ src/client/linux/minidump_writer/$(DEPDIR)/$(am__dirstamp)
src/client/linux/minidump_writer/linux_dumper.$(OBJEXT): \
src/client/linux/minidump_writer/$(am__dirstamp) \
src/client/linux/minidump_writer/$(DEPDIR)/$(am__dirstamp)
@@ -3280,6 +3681,9 @@ src/common/linux/$(am__dirstamp):
src/common/linux/$(DEPDIR)/$(am__dirstamp):
@$(MKDIR_P) src/common/linux/$(DEPDIR)
@: > src/common/linux/$(DEPDIR)/$(am__dirstamp)
+src/common/linux/elf_core_dump.$(OBJEXT): \
+ src/common/linux/$(am__dirstamp) \
+ src/common/linux/$(DEPDIR)/$(am__dirstamp)
src/common/linux/elfutils.$(OBJEXT): src/common/linux/$(am__dirstamp) \
src/common/linux/$(DEPDIR)/$(am__dirstamp)
src/common/linux/file_id.$(OBJEXT): src/common/linux/$(am__dirstamp) \
@@ -3296,15 +3700,9 @@ src/common/linux/memory_mapped_file.$(OBJEXT): \
src/common/linux/safe_readlink.$(OBJEXT): \
src/common/linux/$(am__dirstamp) \
src/common/linux/$(DEPDIR)/$(am__dirstamp)
-src/common/android/$(am__dirstamp):
- @$(MKDIR_P) src/common/android
- @: > src/common/android/$(am__dirstamp)
-src/common/android/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) src/common/android/$(DEPDIR)
- @: > src/common/android/$(DEPDIR)/$(am__dirstamp)
-src/common/android/breakpad_getcontext.$(OBJEXT): \
- src/common/android/$(am__dirstamp) \
- src/common/android/$(DEPDIR)/$(am__dirstamp)
+src/common/linux/breakpad_getcontext.$(OBJEXT): \
+ src/common/linux/$(am__dirstamp) \
+ src/common/linux/$(DEPDIR)/$(am__dirstamp)
src/client/linux/$(am__dirstamp):
@$(MKDIR_P) src/client/linux
@: > src/client/linux/$(am__dirstamp)
@@ -3325,12 +3723,13 @@ src/processor/basic_code_modules.$(OBJEXT): \
src/processor/basic_source_line_resolver.$(OBJEXT): \
src/processor/$(am__dirstamp) \
src/processor/$(DEPDIR)/$(am__dirstamp)
-src/processor/binarystream.$(OBJEXT): src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
src/processor/call_stack.$(OBJEXT): src/processor/$(am__dirstamp) \
src/processor/$(DEPDIR)/$(am__dirstamp)
src/processor/cfi_frame_info.$(OBJEXT): src/processor/$(am__dirstamp) \
src/processor/$(DEPDIR)/$(am__dirstamp)
+src/processor/convert_old_arm64_context.$(OBJEXT): \
+ src/processor/$(am__dirstamp) \
+ src/processor/$(DEPDIR)/$(am__dirstamp)
src/processor/disassembler_x86.$(OBJEXT): \
src/processor/$(am__dirstamp) \
src/processor/$(DEPDIR)/$(am__dirstamp)
@@ -3372,6 +3771,9 @@ src/processor/pathname_stripper.$(OBJEXT): \
src/processor/$(DEPDIR)/$(am__dirstamp)
src/processor/process_state.$(OBJEXT): src/processor/$(am__dirstamp) \
src/processor/$(DEPDIR)/$(am__dirstamp)
+src/processor/proc_maps_linux.$(OBJEXT): \
+ src/processor/$(am__dirstamp) \
+ src/processor/$(DEPDIR)/$(am__dirstamp)
src/processor/simple_symbol_supplier.$(OBJEXT): \
src/processor/$(am__dirstamp) \
src/processor/$(DEPDIR)/$(am__dirstamp)
@@ -3426,6 +3828,35 @@ src/libbreakpad.a: $(src_libbreakpad_a_OBJECTS) $(src_libbreakpad_a_DEPENDENCIES
$(AM_V_at)-rm -f src/libbreakpad.a
$(AM_V_AR)$(src_libbreakpad_a_AR) src/libbreakpad.a $(src_libbreakpad_a_OBJECTS) $(src_libbreakpad_a_LIBADD)
$(AM_V_at)$(RANLIB) src/libbreakpad.a
+src/testing/googletest/src/$(am__dirstamp):
+ @$(MKDIR_P) src/testing/googletest/src
+ @: > src/testing/googletest/src/$(am__dirstamp)
+src/testing/googletest/src/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) src/testing/googletest/src/$(DEPDIR)
+ @: > src/testing/googletest/src/$(DEPDIR)/$(am__dirstamp)
+src/testing/googletest/src/src_testing_libtesting_a-gtest-all.$(OBJEXT): \
+ src/testing/googletest/src/$(am__dirstamp) \
+ src/testing/googletest/src/$(DEPDIR)/$(am__dirstamp)
+src/testing/googletest/src/src_testing_libtesting_a-gtest_main.$(OBJEXT): \
+ src/testing/googletest/src/$(am__dirstamp) \
+ src/testing/googletest/src/$(DEPDIR)/$(am__dirstamp)
+src/testing/googlemock/src/$(am__dirstamp):
+ @$(MKDIR_P) src/testing/googlemock/src
+ @: > src/testing/googlemock/src/$(am__dirstamp)
+src/testing/googlemock/src/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) src/testing/googlemock/src/$(DEPDIR)
+ @: > src/testing/googlemock/src/$(DEPDIR)/$(am__dirstamp)
+src/testing/googlemock/src/src_testing_libtesting_a-gmock-all.$(OBJEXT): \
+ src/testing/googlemock/src/$(am__dirstamp) \
+ src/testing/googlemock/src/$(DEPDIR)/$(am__dirstamp)
+src/testing/$(am__dirstamp):
+ @$(MKDIR_P) src/testing
+ @: > src/testing/$(am__dirstamp)
+
+src/testing/libtesting.a: $(src_testing_libtesting_a_OBJECTS) $(src_testing_libtesting_a_DEPENDENCIES) $(EXTRA_src_testing_libtesting_a_DEPENDENCIES) src/testing/$(am__dirstamp)
+ $(AM_V_at)-rm -f src/testing/libtesting.a
+ $(AM_V_AR)$(src_testing_libtesting_a_AR) src/testing/libtesting.a $(src_testing_libtesting_a_OBJECTS) $(src_testing_libtesting_a_LIBADD)
+ $(AM_V_at)$(RANLIB) src/testing/libtesting.a
src/third_party/libdisasm/$(am__dirstamp):
@$(MKDIR_P) src/third_party/libdisasm
@: > src/third_party/libdisasm/$(am__dirstamp)
@@ -3531,9 +3962,21 @@ clean-noinstPROGRAMS:
src/client/linux/linux_client_unittest$(EXEEXT): $(src_client_linux_linux_client_unittest_OBJECTS) $(src_client_linux_linux_client_unittest_DEPENDENCIES) $(EXTRA_src_client_linux_linux_client_unittest_DEPENDENCIES) src/client/linux/$(am__dirstamp)
@rm -f src/client/linux/linux_client_unittest$(EXEEXT)
$(AM_V_CCLD)$(src_client_linux_linux_client_unittest_LINK) $(src_client_linux_linux_client_unittest_OBJECTS) $(src_client_linux_linux_client_unittest_LDADD) $(LIBS)
+src/testing/googletest/src/src_client_linux_linux_client_unittest_shlib-gtest-all.$(OBJEXT): \
+ src/testing/googletest/src/$(am__dirstamp) \
+ src/testing/googletest/src/$(DEPDIR)/$(am__dirstamp)
+src/testing/googletest/src/src_client_linux_linux_client_unittest_shlib-gtest_main.$(OBJEXT): \
+ src/testing/googletest/src/$(am__dirstamp) \
+ src/testing/googletest/src/$(DEPDIR)/$(am__dirstamp)
+src/testing/googlemock/src/src_client_linux_linux_client_unittest_shlib-gmock-all.$(OBJEXT): \
+ src/testing/googlemock/src/$(am__dirstamp) \
+ src/testing/googlemock/src/$(DEPDIR)/$(am__dirstamp)
src/client/linux/handler/src_client_linux_linux_client_unittest_shlib-exception_handler_unittest.$(OBJEXT): \
src/client/linux/handler/$(am__dirstamp) \
src/client/linux/handler/$(DEPDIR)/$(am__dirstamp)
+src/client/linux/microdump_writer/src_client_linux_linux_client_unittest_shlib-microdump_writer_unittest.$(OBJEXT): \
+ src/client/linux/microdump_writer/$(am__dirstamp) \
+ src/client/linux/microdump_writer/$(DEPDIR)/$(am__dirstamp)
src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-directory_reader_unittest.$(OBJEXT): \
src/client/linux/minidump_writer/$(am__dirstamp) \
src/client/linux/minidump_writer/$(DEPDIR)/$(am__dirstamp)
@@ -3576,7 +4019,7 @@ src/common/linux/tests/$(DEPDIR)/$(am__dirstamp):
src/common/linux/tests/src_client_linux_linux_client_unittest_shlib-crash_generator.$(OBJEXT): \
src/common/linux/tests/$(am__dirstamp) \
src/common/linux/tests/$(DEPDIR)/$(am__dirstamp)
-src/common/src_client_linux_linux_client_unittest_shlib-memory_unittest.$(OBJEXT): \
+src/common/src_client_linux_linux_client_unittest_shlib-memory_allocator_unittest.$(OBJEXT): \
src/common/$(am__dirstamp) \
src/common/$(DEPDIR)/$(am__dirstamp)
src/common/tests/$(am__dirstamp):
@@ -3588,30 +4031,12 @@ src/common/tests/$(DEPDIR)/$(am__dirstamp):
src/common/tests/src_client_linux_linux_client_unittest_shlib-file_utils.$(OBJEXT): \
src/common/tests/$(am__dirstamp) \
src/common/tests/$(DEPDIR)/$(am__dirstamp)
-src/testing/gtest/src/$(am__dirstamp):
- @$(MKDIR_P) src/testing/gtest/src
- @: > src/testing/gtest/src/$(am__dirstamp)
-src/testing/gtest/src/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) src/testing/gtest/src/$(DEPDIR)
- @: > src/testing/gtest/src/$(DEPDIR)/$(am__dirstamp)
-src/testing/gtest/src/src_client_linux_linux_client_unittest_shlib-gtest-all.$(OBJEXT): \
- src/testing/gtest/src/$(am__dirstamp) \
- src/testing/gtest/src/$(DEPDIR)/$(am__dirstamp)
-src/testing/gtest/src/src_client_linux_linux_client_unittest_shlib-gtest_main.$(OBJEXT): \
- src/testing/gtest/src/$(am__dirstamp) \
- src/testing/gtest/src/$(DEPDIR)/$(am__dirstamp)
-src/testing/src/$(am__dirstamp):
- @$(MKDIR_P) src/testing/src
- @: > src/testing/src/$(am__dirstamp)
-src/testing/src/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) src/testing/src/$(DEPDIR)
- @: > src/testing/src/$(DEPDIR)/$(am__dirstamp)
-src/testing/src/src_client_linux_linux_client_unittest_shlib-gmock-all.$(OBJEXT): \
- src/testing/src/$(am__dirstamp) \
- src/testing/src/$(DEPDIR)/$(am__dirstamp)
src/processor/src_client_linux_linux_client_unittest_shlib-basic_code_modules.$(OBJEXT): \
src/processor/$(am__dirstamp) \
src/processor/$(DEPDIR)/$(am__dirstamp)
+src/processor/src_client_linux_linux_client_unittest_shlib-convert_old_arm64_context.$(OBJEXT): \
+ src/processor/$(am__dirstamp) \
+ src/processor/$(DEPDIR)/$(am__dirstamp)
src/processor/src_client_linux_linux_client_unittest_shlib-dump_context.$(OBJEXT): \
src/processor/$(am__dirstamp) \
src/processor/$(DEPDIR)/$(am__dirstamp)
@@ -3627,15 +4052,15 @@ src/processor/src_client_linux_linux_client_unittest_shlib-minidump.$(OBJEXT):
src/processor/src_client_linux_linux_client_unittest_shlib-pathname_stripper.$(OBJEXT): \
src/processor/$(am__dirstamp) \
src/processor/$(DEPDIR)/$(am__dirstamp)
-src/common/android/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext.$(OBJEXT): \
- src/common/android/$(am__dirstamp) \
- src/common/android/$(DEPDIR)/$(am__dirstamp)
-src/client/linux/microdump_writer/src_client_linux_linux_client_unittest_shlib-microdump_writer_unittest.$(OBJEXT): \
- src/client/linux/microdump_writer/$(am__dirstamp) \
- src/client/linux/microdump_writer/$(DEPDIR)/$(am__dirstamp)
-src/common/android/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.$(OBJEXT): \
- src/common/android/$(am__dirstamp) \
- src/common/android/$(DEPDIR)/$(am__dirstamp)
+src/processor/src_client_linux_linux_client_unittest_shlib-proc_maps_linux.$(OBJEXT): \
+ src/processor/$(am__dirstamp) \
+ src/processor/$(DEPDIR)/$(am__dirstamp)
+src/common/linux/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext.$(OBJEXT): \
+ src/common/linux/$(am__dirstamp) \
+ src/common/linux/$(DEPDIR)/$(am__dirstamp)
+src/common/linux/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.$(OBJEXT): \
+ src/common/linux/$(am__dirstamp) \
+ src/common/linux/$(DEPDIR)/$(am__dirstamp)
src/client/linux/linux_client_unittest_shlib$(EXEEXT): $(src_client_linux_linux_client_unittest_shlib_OBJECTS) $(src_client_linux_linux_client_unittest_shlib_DEPENDENCIES) $(EXTRA_src_client_linux_linux_client_unittest_shlib_DEPENDENCIES) src/client/linux/$(am__dirstamp)
@rm -f src/client/linux/linux_client_unittest_shlib$(EXEEXT)
@@ -3650,6 +4075,9 @@ src/client/linux/linux_dumper_unittest_helper$(EXEEXT): $(src_client_linux_linux
src/common/src_common_dumper_unittest-byte_cursor_unittest.$(OBJEXT): \
src/common/$(am__dirstamp) \
src/common/$(DEPDIR)/$(am__dirstamp)
+src/common/src_common_dumper_unittest-convert_UTF.$(OBJEXT): \
+ src/common/$(am__dirstamp) \
+ src/common/$(DEPDIR)/$(am__dirstamp)
src/common/src_common_dumper_unittest-dwarf_cfi_to_module.$(OBJEXT): \
src/common/$(am__dirstamp) \
src/common/$(DEPDIR)/$(am__dirstamp)
@@ -3668,6 +4096,9 @@ src/common/src_common_dumper_unittest-dwarf_line_to_module.$(OBJEXT): \
src/common/src_common_dumper_unittest-dwarf_line_to_module_unittest.$(OBJEXT): \
src/common/$(am__dirstamp) \
src/common/$(DEPDIR)/$(am__dirstamp)
+src/common/src_common_dumper_unittest-dwarf_range_list_handler.$(OBJEXT): \
+ src/common/$(am__dirstamp) \
+ src/common/$(DEPDIR)/$(am__dirstamp)
src/common/src_common_dumper_unittest-language.$(OBJEXT): \
src/common/$(am__dirstamp) \
src/common/$(DEPDIR)/$(am__dirstamp)
@@ -3680,6 +4111,9 @@ src/common/src_common_dumper_unittest-module.$(OBJEXT): \
src/common/src_common_dumper_unittest-module_unittest.$(OBJEXT): \
src/common/$(am__dirstamp) \
src/common/$(DEPDIR)/$(am__dirstamp)
+src/common/src_common_dumper_unittest-path_helper.$(OBJEXT): \
+ src/common/$(am__dirstamp) \
+ src/common/$(DEPDIR)/$(am__dirstamp)
src/common/src_common_dumper_unittest-stabs_reader.$(OBJEXT): \
src/common/$(am__dirstamp) \
src/common/$(DEPDIR)/$(am__dirstamp)
@@ -3692,6 +4126,12 @@ src/common/src_common_dumper_unittest-stabs_to_module.$(OBJEXT): \
src/common/src_common_dumper_unittest-stabs_to_module_unittest.$(OBJEXT): \
src/common/$(am__dirstamp) \
src/common/$(DEPDIR)/$(am__dirstamp)
+src/common/src_common_dumper_unittest-string_conversion.$(OBJEXT): \
+ src/common/$(am__dirstamp) \
+ src/common/$(DEPDIR)/$(am__dirstamp)
+src/common/src_common_dumper_unittest-string_conversion_unittest.$(OBJEXT): \
+ src/common/$(am__dirstamp) \
+ src/common/$(DEPDIR)/$(am__dirstamp)
src/common/src_common_dumper_unittest-test_assembler.$(OBJEXT): \
src/common/$(am__dirstamp) \
src/common/$(DEPDIR)/$(am__dirstamp)
@@ -3719,6 +4159,9 @@ src/common/dwarf/src_common_dumper_unittest-dwarf2diehandler_unittest.$(OBJEXT):
src/common/dwarf/src_common_dumper_unittest-dwarf2reader.$(OBJEXT): \
src/common/dwarf/$(am__dirstamp) \
src/common/dwarf/$(DEPDIR)/$(am__dirstamp)
+src/common/dwarf/src_common_dumper_unittest-elf_reader.$(OBJEXT): \
+ src/common/dwarf/$(am__dirstamp) \
+ src/common/dwarf/$(DEPDIR)/$(am__dirstamp)
src/common/dwarf/src_common_dumper_unittest-dwarf2reader_cfi_unittest.$(OBJEXT): \
src/common/dwarf/$(am__dirstamp) \
src/common/dwarf/$(DEPDIR)/$(am__dirstamp)
@@ -3782,34 +4225,108 @@ src/common/linux/tests/src_common_dumper_unittest-crash_generator.$(OBJEXT): \
src/common/tests/src_common_dumper_unittest-file_utils.$(OBJEXT): \
src/common/tests/$(am__dirstamp) \
src/common/tests/$(DEPDIR)/$(am__dirstamp)
-src/testing/gtest/src/src_common_dumper_unittest-gtest-all.$(OBJEXT): \
- src/testing/gtest/src/$(am__dirstamp) \
- src/testing/gtest/src/$(DEPDIR)/$(am__dirstamp)
-src/testing/gtest/src/src_common_dumper_unittest-gtest_main.$(OBJEXT): \
- src/testing/gtest/src/$(am__dirstamp) \
- src/testing/gtest/src/$(DEPDIR)/$(am__dirstamp)
-src/testing/src/src_common_dumper_unittest-gmock-all.$(OBJEXT): \
- src/testing/src/$(am__dirstamp) \
- src/testing/src/$(DEPDIR)/$(am__dirstamp)
src/common/dumper_unittest$(EXEEXT): $(src_common_dumper_unittest_OBJECTS) $(src_common_dumper_unittest_DEPENDENCIES) $(EXTRA_src_common_dumper_unittest_DEPENDENCIES) src/common/$(am__dirstamp)
@rm -f src/common/dumper_unittest$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(src_common_dumper_unittest_OBJECTS) $(src_common_dumper_unittest_LDADD) $(LIBS)
+src/common/linux/src_common_linux_google_crashdump_uploader_test-google_crashdump_uploader.$(OBJEXT): \
+ src/common/linux/$(am__dirstamp) \
+ src/common/linux/$(DEPDIR)/$(am__dirstamp)
+src/common/linux/src_common_linux_google_crashdump_uploader_test-google_crashdump_uploader_test.$(OBJEXT): \
+ src/common/linux/$(am__dirstamp) \
+ src/common/linux/$(DEPDIR)/$(am__dirstamp)
+src/common/linux/src_common_linux_google_crashdump_uploader_test-libcurl_wrapper.$(OBJEXT): \
+ src/common/linux/$(am__dirstamp) \
+ src/common/linux/$(DEPDIR)/$(am__dirstamp)
+
+src/common/linux/google_crashdump_uploader_test$(EXEEXT): $(src_common_linux_google_crashdump_uploader_test_OBJECTS) $(src_common_linux_google_crashdump_uploader_test_DEPENDENCIES) $(EXTRA_src_common_linux_google_crashdump_uploader_test_DEPENDENCIES) src/common/linux/$(am__dirstamp)
+ @rm -f src/common/linux/google_crashdump_uploader_test$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(src_common_linux_google_crashdump_uploader_test_OBJECTS) $(src_common_linux_google_crashdump_uploader_test_LDADD) $(LIBS)
+src/common/src_common_mac_macho_reader_unittest-dwarf_cfi_to_module.$(OBJEXT): \
+ src/common/$(am__dirstamp) \
+ src/common/$(DEPDIR)/$(am__dirstamp)
+src/common/src_common_mac_macho_reader_unittest-dwarf_cu_to_module.$(OBJEXT): \
+ src/common/$(am__dirstamp) \
+ src/common/$(DEPDIR)/$(am__dirstamp)
+src/common/src_common_mac_macho_reader_unittest-dwarf_line_to_module.$(OBJEXT): \
+ src/common/$(am__dirstamp) \
+ src/common/$(DEPDIR)/$(am__dirstamp)
+src/common/src_common_mac_macho_reader_unittest-language.$(OBJEXT): \
+ src/common/$(am__dirstamp) \
+ src/common/$(DEPDIR)/$(am__dirstamp)
+src/common/src_common_mac_macho_reader_unittest-md5.$(OBJEXT): \
+ src/common/$(am__dirstamp) \
+ src/common/$(DEPDIR)/$(am__dirstamp)
+src/common/src_common_mac_macho_reader_unittest-module.$(OBJEXT): \
+ src/common/$(am__dirstamp) \
+ src/common/$(DEPDIR)/$(am__dirstamp)
+src/common/src_common_mac_macho_reader_unittest-path_helper.$(OBJEXT): \
+ src/common/$(am__dirstamp) \
+ src/common/$(DEPDIR)/$(am__dirstamp)
+src/common/src_common_mac_macho_reader_unittest-stabs_reader.$(OBJEXT): \
+ src/common/$(am__dirstamp) \
+ src/common/$(DEPDIR)/$(am__dirstamp)
+src/common/src_common_mac_macho_reader_unittest-stabs_to_module.$(OBJEXT): \
+ src/common/$(am__dirstamp) \
+ src/common/$(DEPDIR)/$(am__dirstamp)
+src/common/src_common_mac_macho_reader_unittest-test_assembler.$(OBJEXT): \
+ src/common/$(am__dirstamp) \
+ src/common/$(DEPDIR)/$(am__dirstamp)
+src/common/dwarf/src_common_mac_macho_reader_unittest-bytereader.$(OBJEXT): \
+ src/common/dwarf/$(am__dirstamp) \
+ src/common/dwarf/$(DEPDIR)/$(am__dirstamp)
+src/common/dwarf/src_common_mac_macho_reader_unittest-cfi_assembler.$(OBJEXT): \
+ src/common/dwarf/$(am__dirstamp) \
+ src/common/dwarf/$(DEPDIR)/$(am__dirstamp)
+src/common/dwarf/src_common_mac_macho_reader_unittest-dwarf2diehandler.$(OBJEXT): \
+ src/common/dwarf/$(am__dirstamp) \
+ src/common/dwarf/$(DEPDIR)/$(am__dirstamp)
+src/common/dwarf/src_common_mac_macho_reader_unittest-dwarf2reader.$(OBJEXT): \
+ src/common/dwarf/$(am__dirstamp) \
+ src/common/dwarf/$(DEPDIR)/$(am__dirstamp)
+src/common/dwarf/src_common_mac_macho_reader_unittest-elf_reader.$(OBJEXT): \
+ src/common/dwarf/$(am__dirstamp) \
+ src/common/dwarf/$(DEPDIR)/$(am__dirstamp)
+src/common/mac/$(am__dirstamp):
+ @$(MKDIR_P) src/common/mac
+ @: > src/common/mac/$(am__dirstamp)
+src/common/mac/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) src/common/mac/$(DEPDIR)
+ @: > src/common/mac/$(DEPDIR)/$(am__dirstamp)
+src/common/mac/src_common_mac_macho_reader_unittest-arch_utilities.$(OBJEXT): \
+ src/common/mac/$(am__dirstamp) \
+ src/common/mac/$(DEPDIR)/$(am__dirstamp)
+src/common/mac/src_common_mac_macho_reader_unittest-file_id.$(OBJEXT): \
+ src/common/mac/$(am__dirstamp) \
+ src/common/mac/$(DEPDIR)/$(am__dirstamp)
+src/common/mac/src_common_mac_macho_reader_unittest-macho_id.$(OBJEXT): \
+ src/common/mac/$(am__dirstamp) \
+ src/common/mac/$(DEPDIR)/$(am__dirstamp)
+src/common/mac/src_common_mac_macho_reader_unittest-macho_reader.$(OBJEXT): \
+ src/common/mac/$(am__dirstamp) \
+ src/common/mac/$(DEPDIR)/$(am__dirstamp)
+src/common/mac/src_common_mac_macho_reader_unittest-macho_reader_unittest.$(OBJEXT): \
+ src/common/mac/$(am__dirstamp) \
+ src/common/mac/$(DEPDIR)/$(am__dirstamp)
+src/common/mac/src_common_mac_macho_reader_unittest-macho_utilities.$(OBJEXT): \
+ src/common/mac/$(am__dirstamp) \
+ src/common/mac/$(DEPDIR)/$(am__dirstamp)
+src/common/mac/src_common_mac_macho_reader_unittest-macho_walker.$(OBJEXT): \
+ src/common/mac/$(am__dirstamp) \
+ src/common/mac/$(DEPDIR)/$(am__dirstamp)
+src/common/tests/src_common_mac_macho_reader_unittest-file_utils.$(OBJEXT): \
+ src/common/tests/$(am__dirstamp) \
+ src/common/tests/$(DEPDIR)/$(am__dirstamp)
+
+src/common/mac/macho_reader_unittest$(EXEEXT): $(src_common_mac_macho_reader_unittest_OBJECTS) $(src_common_mac_macho_reader_unittest_DEPENDENCIES) $(EXTRA_src_common_mac_macho_reader_unittest_DEPENDENCIES) src/common/mac/$(am__dirstamp)
+ @rm -f src/common/mac/macho_reader_unittest$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(src_common_mac_macho_reader_unittest_OBJECTS) $(src_common_mac_macho_reader_unittest_LDADD) $(LIBS)
src/common/src_common_test_assembler_unittest-test_assembler.$(OBJEXT): \
src/common/$(am__dirstamp) \
src/common/$(DEPDIR)/$(am__dirstamp)
src/common/src_common_test_assembler_unittest-test_assembler_unittest.$(OBJEXT): \
src/common/$(am__dirstamp) \
src/common/$(DEPDIR)/$(am__dirstamp)
-src/testing/gtest/src/src_common_test_assembler_unittest-gtest-all.$(OBJEXT): \
- src/testing/gtest/src/$(am__dirstamp) \
- src/testing/gtest/src/$(DEPDIR)/$(am__dirstamp)
-src/testing/gtest/src/src_common_test_assembler_unittest-gtest_main.$(OBJEXT): \
- src/testing/gtest/src/$(am__dirstamp) \
- src/testing/gtest/src/$(DEPDIR)/$(am__dirstamp)
-src/testing/src/src_common_test_assembler_unittest-gmock-all.$(OBJEXT): \
- src/testing/src/$(am__dirstamp) \
- src/testing/src/$(DEPDIR)/$(am__dirstamp)
src/common/test_assembler_unittest$(EXEEXT): $(src_common_test_assembler_unittest_OBJECTS) $(src_common_test_assembler_unittest_DEPENDENCIES) $(EXTRA_src_common_test_assembler_unittest_DEPENDENCIES) src/common/$(am__dirstamp)
@rm -f src/common/test_assembler_unittest$(EXEEXT)
@@ -3824,41 +4341,13 @@ src/processor/address_map_unittest$(EXEEXT): $(src_processor_address_map_unittes
src/processor/src_processor_basic_source_line_resolver_unittest-basic_source_line_resolver_unittest.$(OBJEXT): \
src/processor/$(am__dirstamp) \
src/processor/$(DEPDIR)/$(am__dirstamp)
-src/testing/gtest/src/src_processor_basic_source_line_resolver_unittest-gtest-all.$(OBJEXT): \
- src/testing/gtest/src/$(am__dirstamp) \
- src/testing/gtest/src/$(DEPDIR)/$(am__dirstamp)
-src/testing/src/src_processor_basic_source_line_resolver_unittest-gmock-all.$(OBJEXT): \
- src/testing/src/$(am__dirstamp) \
- src/testing/src/$(DEPDIR)/$(am__dirstamp)
src/processor/basic_source_line_resolver_unittest$(EXEEXT): $(src_processor_basic_source_line_resolver_unittest_OBJECTS) $(src_processor_basic_source_line_resolver_unittest_DEPENDENCIES) $(EXTRA_src_processor_basic_source_line_resolver_unittest_DEPENDENCIES) src/processor/$(am__dirstamp)
@rm -f src/processor/basic_source_line_resolver_unittest$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(src_processor_basic_source_line_resolver_unittest_OBJECTS) $(src_processor_basic_source_line_resolver_unittest_LDADD) $(LIBS)
-src/processor/src_processor_binarystream_unittest-binarystream_unittest.$(OBJEXT): \
- src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-src/testing/gtest/src/src_processor_binarystream_unittest-gtest-all.$(OBJEXT): \
- src/testing/gtest/src/$(am__dirstamp) \
- src/testing/gtest/src/$(DEPDIR)/$(am__dirstamp)
-src/testing/src/src_processor_binarystream_unittest-gmock-all.$(OBJEXT): \
- src/testing/src/$(am__dirstamp) \
- src/testing/src/$(DEPDIR)/$(am__dirstamp)
-
-src/processor/binarystream_unittest$(EXEEXT): $(src_processor_binarystream_unittest_OBJECTS) $(src_processor_binarystream_unittest_DEPENDENCIES) $(EXTRA_src_processor_binarystream_unittest_DEPENDENCIES) src/processor/$(am__dirstamp)
- @rm -f src/processor/binarystream_unittest$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(src_processor_binarystream_unittest_OBJECTS) $(src_processor_binarystream_unittest_LDADD) $(LIBS)
src/processor/src_processor_cfi_frame_info_unittest-cfi_frame_info_unittest.$(OBJEXT): \
src/processor/$(am__dirstamp) \
src/processor/$(DEPDIR)/$(am__dirstamp)
-src/testing/gtest/src/src_processor_cfi_frame_info_unittest-gtest-all.$(OBJEXT): \
- src/testing/gtest/src/$(am__dirstamp) \
- src/testing/gtest/src/$(DEPDIR)/$(am__dirstamp)
-src/testing/gtest/src/src_processor_cfi_frame_info_unittest-gtest_main.$(OBJEXT): \
- src/testing/gtest/src/$(am__dirstamp) \
- src/testing/gtest/src/$(DEPDIR)/$(am__dirstamp)
-src/testing/src/src_processor_cfi_frame_info_unittest-gmock-all.$(OBJEXT): \
- src/testing/src/$(am__dirstamp) \
- src/testing/src/$(DEPDIR)/$(am__dirstamp)
src/processor/cfi_frame_info_unittest$(EXEEXT): $(src_processor_cfi_frame_info_unittest_OBJECTS) $(src_processor_cfi_frame_info_unittest_DEPENDENCIES) $(EXTRA_src_processor_cfi_frame_info_unittest_DEPENDENCIES) src/processor/$(am__dirstamp)
@rm -f src/processor/cfi_frame_info_unittest$(EXEEXT)
@@ -3873,15 +4362,6 @@ src/processor/contained_range_map_unittest$(EXEEXT): $(src_processor_contained_r
src/processor/src_processor_disassembler_x86_unittest-disassembler_x86_unittest.$(OBJEXT): \
src/processor/$(am__dirstamp) \
src/processor/$(DEPDIR)/$(am__dirstamp)
-src/testing/gtest/src/src_processor_disassembler_x86_unittest-gtest-all.$(OBJEXT): \
- src/testing/gtest/src/$(am__dirstamp) \
- src/testing/gtest/src/$(DEPDIR)/$(am__dirstamp)
-src/testing/gtest/src/src_processor_disassembler_x86_unittest-gtest_main.$(OBJEXT): \
- src/testing/gtest/src/$(am__dirstamp) \
- src/testing/gtest/src/$(DEPDIR)/$(am__dirstamp)
-src/testing/src/src_processor_disassembler_x86_unittest-gmock-all.$(OBJEXT): \
- src/testing/src/$(am__dirstamp) \
- src/testing/src/$(DEPDIR)/$(am__dirstamp)
src/processor/disassembler_x86_unittest$(EXEEXT): $(src_processor_disassembler_x86_unittest_OBJECTS) $(src_processor_disassembler_x86_unittest_DEPENDENCIES) $(EXTRA_src_processor_disassembler_x86_unittest_DEPENDENCIES) src/processor/$(am__dirstamp)
@rm -f src/processor/disassembler_x86_unittest$(EXEEXT)
@@ -3889,15 +4369,6 @@ src/processor/disassembler_x86_unittest$(EXEEXT): $(src_processor_disassembler_x
src/processor/src_processor_exploitability_unittest-exploitability_unittest.$(OBJEXT): \
src/processor/$(am__dirstamp) \
src/processor/$(DEPDIR)/$(am__dirstamp)
-src/testing/gtest/src/src_processor_exploitability_unittest-gtest-all.$(OBJEXT): \
- src/testing/gtest/src/$(am__dirstamp) \
- src/testing/gtest/src/$(DEPDIR)/$(am__dirstamp)
-src/testing/gtest/src/src_processor_exploitability_unittest-gtest_main.$(OBJEXT): \
- src/testing/gtest/src/$(am__dirstamp) \
- src/testing/gtest/src/$(DEPDIR)/$(am__dirstamp)
-src/testing/src/src_processor_exploitability_unittest-gmock-all.$(OBJEXT): \
- src/testing/src/$(am__dirstamp) \
- src/testing/src/$(DEPDIR)/$(am__dirstamp)
src/processor/exploitability_unittest$(EXEEXT): $(src_processor_exploitability_unittest_OBJECTS) $(src_processor_exploitability_unittest_DEPENDENCIES) $(EXTRA_src_processor_exploitability_unittest_DEPENDENCIES) src/processor/$(am__dirstamp)
@rm -f src/processor/exploitability_unittest$(EXEEXT)
@@ -3905,12 +4376,6 @@ src/processor/exploitability_unittest$(EXEEXT): $(src_processor_exploitability_u
src/processor/src_processor_fast_source_line_resolver_unittest-fast_source_line_resolver_unittest.$(OBJEXT): \
src/processor/$(am__dirstamp) \
src/processor/$(DEPDIR)/$(am__dirstamp)
-src/testing/gtest/src/src_processor_fast_source_line_resolver_unittest-gtest-all.$(OBJEXT): \
- src/testing/gtest/src/$(am__dirstamp) \
- src/testing/gtest/src/$(DEPDIR)/$(am__dirstamp)
-src/testing/src/src_processor_fast_source_line_resolver_unittest-gmock-all.$(OBJEXT): \
- src/testing/src/$(am__dirstamp) \
- src/testing/src/$(DEPDIR)/$(am__dirstamp)
src/processor/fast_source_line_resolver_unittest$(EXEEXT): $(src_processor_fast_source_line_resolver_unittest_OBJECTS) $(src_processor_fast_source_line_resolver_unittest_DEPENDENCIES) $(EXTRA_src_processor_fast_source_line_resolver_unittest_DEPENDENCIES) src/processor/$(am__dirstamp)
@rm -f src/processor/fast_source_line_resolver_unittest$(EXEEXT)
@@ -3918,12 +4383,6 @@ src/processor/fast_source_line_resolver_unittest$(EXEEXT): $(src_processor_fast_
src/processor/src_processor_map_serializers_unittest-map_serializers_unittest.$(OBJEXT): \
src/processor/$(am__dirstamp) \
src/processor/$(DEPDIR)/$(am__dirstamp)
-src/testing/gtest/src/src_processor_map_serializers_unittest-gtest-all.$(OBJEXT): \
- src/testing/gtest/src/$(am__dirstamp) \
- src/testing/gtest/src/$(DEPDIR)/$(am__dirstamp)
-src/testing/src/src_processor_map_serializers_unittest-gmock-all.$(OBJEXT): \
- src/testing/src/$(am__dirstamp) \
- src/testing/src/$(DEPDIR)/$(am__dirstamp)
src/processor/map_serializers_unittest$(EXEEXT): $(src_processor_map_serializers_unittest_OBJECTS) $(src_processor_map_serializers_unittest_DEPENDENCIES) $(EXTRA_src_processor_map_serializers_unittest_DEPENDENCIES) src/processor/$(am__dirstamp)
@rm -f src/processor/map_serializers_unittest$(EXEEXT)
@@ -3931,12 +4390,6 @@ src/processor/map_serializers_unittest$(EXEEXT): $(src_processor_map_serializers
src/processor/src_processor_microdump_processor_unittest-microdump_processor_unittest.$(OBJEXT): \
src/processor/$(am__dirstamp) \
src/processor/$(DEPDIR)/$(am__dirstamp)
-src/testing/gtest/src/src_processor_microdump_processor_unittest-gtest-all.$(OBJEXT): \
- src/testing/gtest/src/$(am__dirstamp) \
- src/testing/gtest/src/$(DEPDIR)/$(am__dirstamp)
-src/testing/src/src_processor_microdump_processor_unittest-gmock-all.$(OBJEXT): \
- src/testing/src/$(am__dirstamp) \
- src/testing/src/$(DEPDIR)/$(am__dirstamp)
src/processor/microdump_processor_unittest$(EXEEXT): $(src_processor_microdump_processor_unittest_OBJECTS) $(src_processor_microdump_processor_unittest_DEPENDENCIES) $(EXTRA_src_processor_microdump_processor_unittest_DEPENDENCIES) src/processor/$(am__dirstamp)
@rm -f src/processor/microdump_processor_unittest$(EXEEXT)
@@ -3957,12 +4410,6 @@ src/processor/minidump_dump$(EXEEXT): $(src_processor_minidump_dump_OBJECTS) $(s
src/processor/src_processor_minidump_processor_unittest-minidump_processor_unittest.$(OBJEXT): \
src/processor/$(am__dirstamp) \
src/processor/$(DEPDIR)/$(am__dirstamp)
-src/testing/gtest/src/src_processor_minidump_processor_unittest-gtest-all.$(OBJEXT): \
- src/testing/gtest/src/$(am__dirstamp) \
- src/testing/gtest/src/$(DEPDIR)/$(am__dirstamp)
-src/testing/src/src_processor_minidump_processor_unittest-gmock-all.$(OBJEXT): \
- src/testing/src/$(am__dirstamp) \
- src/testing/src/$(DEPDIR)/$(am__dirstamp)
src/processor/minidump_processor_unittest$(EXEEXT): $(src_processor_minidump_processor_unittest_OBJECTS) $(src_processor_minidump_processor_unittest_DEPENDENCIES) $(EXTRA_src_processor_minidump_processor_unittest_DEPENDENCIES) src/processor/$(am__dirstamp)
@rm -f src/processor/minidump_processor_unittest$(EXEEXT)
@@ -3983,15 +4430,6 @@ src/processor/src_processor_minidump_unittest-minidump_unittest.$(OBJEXT): \
src/processor/src_processor_minidump_unittest-synth_minidump.$(OBJEXT): \
src/processor/$(am__dirstamp) \
src/processor/$(DEPDIR)/$(am__dirstamp)
-src/testing/gtest/src/src_processor_minidump_unittest-gtest-all.$(OBJEXT): \
- src/testing/gtest/src/$(am__dirstamp) \
- src/testing/gtest/src/$(DEPDIR)/$(am__dirstamp)
-src/testing/gtest/src/src_processor_minidump_unittest-gtest_main.$(OBJEXT): \
- src/testing/gtest/src/$(am__dirstamp) \
- src/testing/gtest/src/$(DEPDIR)/$(am__dirstamp)
-src/testing/src/src_processor_minidump_unittest-gmock-all.$(OBJEXT): \
- src/testing/src/$(am__dirstamp) \
- src/testing/src/$(DEPDIR)/$(am__dirstamp)
src/processor/minidump_unittest$(EXEEXT): $(src_processor_minidump_unittest_OBJECTS) $(src_processor_minidump_unittest_DEPENDENCIES) $(EXTRA_src_processor_minidump_unittest_DEPENDENCIES) src/processor/$(am__dirstamp)
@rm -f src/processor/minidump_unittest$(EXEEXT)
@@ -4010,6 +4448,30 @@ src/processor/postfix_evaluator_unittest.$(OBJEXT): \
src/processor/postfix_evaluator_unittest$(EXEEXT): $(src_processor_postfix_evaluator_unittest_OBJECTS) $(src_processor_postfix_evaluator_unittest_DEPENDENCIES) $(EXTRA_src_processor_postfix_evaluator_unittest_DEPENDENCIES) src/processor/$(am__dirstamp)
@rm -f src/processor/postfix_evaluator_unittest$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(src_processor_postfix_evaluator_unittest_OBJECTS) $(src_processor_postfix_evaluator_unittest_LDADD) $(LIBS)
+src/processor/src_processor_proc_maps_linux_unittest-proc_maps_linux.$(OBJEXT): \
+ src/processor/$(am__dirstamp) \
+ src/processor/$(DEPDIR)/$(am__dirstamp)
+src/processor/src_processor_proc_maps_linux_unittest-proc_maps_linux_unittest.$(OBJEXT): \
+ src/processor/$(am__dirstamp) \
+ src/processor/$(DEPDIR)/$(am__dirstamp)
+
+src/processor/proc_maps_linux_unittest$(EXEEXT): $(src_processor_proc_maps_linux_unittest_OBJECTS) $(src_processor_proc_maps_linux_unittest_DEPENDENCIES) $(EXTRA_src_processor_proc_maps_linux_unittest_DEPENDENCIES) src/processor/$(am__dirstamp)
+ @rm -f src/processor/proc_maps_linux_unittest$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(src_processor_proc_maps_linux_unittest_OBJECTS) $(src_processor_proc_maps_linux_unittest_LDADD) $(LIBS)
+src/processor/src_processor_range_map_truncate_lower_unittest-range_map_truncate_lower_unittest.$(OBJEXT): \
+ src/processor/$(am__dirstamp) \
+ src/processor/$(DEPDIR)/$(am__dirstamp)
+
+src/processor/range_map_truncate_lower_unittest$(EXEEXT): $(src_processor_range_map_truncate_lower_unittest_OBJECTS) $(src_processor_range_map_truncate_lower_unittest_DEPENDENCIES) $(EXTRA_src_processor_range_map_truncate_lower_unittest_DEPENDENCIES) src/processor/$(am__dirstamp)
+ @rm -f src/processor/range_map_truncate_lower_unittest$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(src_processor_range_map_truncate_lower_unittest_OBJECTS) $(src_processor_range_map_truncate_lower_unittest_LDADD) $(LIBS)
+src/processor/src_processor_range_map_truncate_upper_unittest-range_map_truncate_upper_unittest.$(OBJEXT): \
+ src/processor/$(am__dirstamp) \
+ src/processor/$(DEPDIR)/$(am__dirstamp)
+
+src/processor/range_map_truncate_upper_unittest$(EXEEXT): $(src_processor_range_map_truncate_upper_unittest_OBJECTS) $(src_processor_range_map_truncate_upper_unittest_DEPENDENCIES) $(EXTRA_src_processor_range_map_truncate_upper_unittest_DEPENDENCIES) src/processor/$(am__dirstamp)
+ @rm -f src/processor/range_map_truncate_upper_unittest$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(src_processor_range_map_truncate_upper_unittest_OBJECTS) $(src_processor_range_map_truncate_upper_unittest_LDADD) $(LIBS)
src/processor/range_map_unittest.$(OBJEXT): \
src/processor/$(am__dirstamp) \
src/processor/$(DEPDIR)/$(am__dirstamp)
@@ -4023,15 +4485,6 @@ src/common/src_processor_stackwalker_address_list_unittest-test_assembler.$(OBJE
src/processor/src_processor_stackwalker_address_list_unittest-stackwalker_address_list_unittest.$(OBJEXT): \
src/processor/$(am__dirstamp) \
src/processor/$(DEPDIR)/$(am__dirstamp)
-src/testing/gtest/src/src_processor_stackwalker_address_list_unittest-gtest-all.$(OBJEXT): \
- src/testing/gtest/src/$(am__dirstamp) \
- src/testing/gtest/src/$(DEPDIR)/$(am__dirstamp)
-src/testing/gtest/src/src_processor_stackwalker_address_list_unittest-gtest_main.$(OBJEXT): \
- src/testing/gtest/src/$(am__dirstamp) \
- src/testing/gtest/src/$(DEPDIR)/$(am__dirstamp)
-src/testing/src/src_processor_stackwalker_address_list_unittest-gmock-all.$(OBJEXT): \
- src/testing/src/$(am__dirstamp) \
- src/testing/src/$(DEPDIR)/$(am__dirstamp)
src/processor/stackwalker_address_list_unittest$(EXEEXT): $(src_processor_stackwalker_address_list_unittest_OBJECTS) $(src_processor_stackwalker_address_list_unittest_DEPENDENCIES) $(EXTRA_src_processor_stackwalker_address_list_unittest_DEPENDENCIES) src/processor/$(am__dirstamp)
@rm -f src/processor/stackwalker_address_list_unittest$(EXEEXT)
@@ -4042,15 +4495,6 @@ src/common/src_processor_stackwalker_amd64_unittest-test_assembler.$(OBJEXT): \
src/processor/src_processor_stackwalker_amd64_unittest-stackwalker_amd64_unittest.$(OBJEXT): \
src/processor/$(am__dirstamp) \
src/processor/$(DEPDIR)/$(am__dirstamp)
-src/testing/gtest/src/src_processor_stackwalker_amd64_unittest-gtest-all.$(OBJEXT): \
- src/testing/gtest/src/$(am__dirstamp) \
- src/testing/gtest/src/$(DEPDIR)/$(am__dirstamp)
-src/testing/gtest/src/src_processor_stackwalker_amd64_unittest-gtest_main.$(OBJEXT): \
- src/testing/gtest/src/$(am__dirstamp) \
- src/testing/gtest/src/$(DEPDIR)/$(am__dirstamp)
-src/testing/src/src_processor_stackwalker_amd64_unittest-gmock-all.$(OBJEXT): \
- src/testing/src/$(am__dirstamp) \
- src/testing/src/$(DEPDIR)/$(am__dirstamp)
src/processor/stackwalker_amd64_unittest$(EXEEXT): $(src_processor_stackwalker_amd64_unittest_OBJECTS) $(src_processor_stackwalker_amd64_unittest_DEPENDENCIES) $(EXTRA_src_processor_stackwalker_amd64_unittest_DEPENDENCIES) src/processor/$(am__dirstamp)
@rm -f src/processor/stackwalker_amd64_unittest$(EXEEXT)
@@ -4061,15 +4505,6 @@ src/common/src_processor_stackwalker_arm64_unittest-test_assembler.$(OBJEXT): \
src/processor/src_processor_stackwalker_arm64_unittest-stackwalker_arm64_unittest.$(OBJEXT): \
src/processor/$(am__dirstamp) \
src/processor/$(DEPDIR)/$(am__dirstamp)
-src/testing/gtest/src/src_processor_stackwalker_arm64_unittest-gtest-all.$(OBJEXT): \
- src/testing/gtest/src/$(am__dirstamp) \
- src/testing/gtest/src/$(DEPDIR)/$(am__dirstamp)
-src/testing/gtest/src/src_processor_stackwalker_arm64_unittest-gtest_main.$(OBJEXT): \
- src/testing/gtest/src/$(am__dirstamp) \
- src/testing/gtest/src/$(DEPDIR)/$(am__dirstamp)
-src/testing/src/src_processor_stackwalker_arm64_unittest-gmock-all.$(OBJEXT): \
- src/testing/src/$(am__dirstamp) \
- src/testing/src/$(DEPDIR)/$(am__dirstamp)
src/processor/stackwalker_arm64_unittest$(EXEEXT): $(src_processor_stackwalker_arm64_unittest_OBJECTS) $(src_processor_stackwalker_arm64_unittest_DEPENDENCIES) $(EXTRA_src_processor_stackwalker_arm64_unittest_DEPENDENCIES) src/processor/$(am__dirstamp)
@rm -f src/processor/stackwalker_arm64_unittest$(EXEEXT)
@@ -4080,34 +4515,26 @@ src/common/src_processor_stackwalker_arm_unittest-test_assembler.$(OBJEXT): \
src/processor/src_processor_stackwalker_arm_unittest-stackwalker_arm_unittest.$(OBJEXT): \
src/processor/$(am__dirstamp) \
src/processor/$(DEPDIR)/$(am__dirstamp)
-src/testing/gtest/src/src_processor_stackwalker_arm_unittest-gtest-all.$(OBJEXT): \
- src/testing/gtest/src/$(am__dirstamp) \
- src/testing/gtest/src/$(DEPDIR)/$(am__dirstamp)
-src/testing/gtest/src/src_processor_stackwalker_arm_unittest-gtest_main.$(OBJEXT): \
- src/testing/gtest/src/$(am__dirstamp) \
- src/testing/gtest/src/$(DEPDIR)/$(am__dirstamp)
-src/testing/src/src_processor_stackwalker_arm_unittest-gmock-all.$(OBJEXT): \
- src/testing/src/$(am__dirstamp) \
- src/testing/src/$(DEPDIR)/$(am__dirstamp)
src/processor/stackwalker_arm_unittest$(EXEEXT): $(src_processor_stackwalker_arm_unittest_OBJECTS) $(src_processor_stackwalker_arm_unittest_DEPENDENCIES) $(EXTRA_src_processor_stackwalker_arm_unittest_DEPENDENCIES) src/processor/$(am__dirstamp)
@rm -f src/processor/stackwalker_arm_unittest$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(src_processor_stackwalker_arm_unittest_OBJECTS) $(src_processor_stackwalker_arm_unittest_LDADD) $(LIBS)
+src/common/src_processor_stackwalker_mips64_unittest-test_assembler.$(OBJEXT): \
+ src/common/$(am__dirstamp) \
+ src/common/$(DEPDIR)/$(am__dirstamp)
+src/processor/src_processor_stackwalker_mips64_unittest-stackwalker_mips64_unittest.$(OBJEXT): \
+ src/processor/$(am__dirstamp) \
+ src/processor/$(DEPDIR)/$(am__dirstamp)
+
+src/processor/stackwalker_mips64_unittest$(EXEEXT): $(src_processor_stackwalker_mips64_unittest_OBJECTS) $(src_processor_stackwalker_mips64_unittest_DEPENDENCIES) $(EXTRA_src_processor_stackwalker_mips64_unittest_DEPENDENCIES) src/processor/$(am__dirstamp)
+ @rm -f src/processor/stackwalker_mips64_unittest$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(src_processor_stackwalker_mips64_unittest_OBJECTS) $(src_processor_stackwalker_mips64_unittest_LDADD) $(LIBS)
src/common/src_processor_stackwalker_mips_unittest-test_assembler.$(OBJEXT): \
src/common/$(am__dirstamp) \
src/common/$(DEPDIR)/$(am__dirstamp)
src/processor/src_processor_stackwalker_mips_unittest-stackwalker_mips_unittest.$(OBJEXT): \
src/processor/$(am__dirstamp) \
src/processor/$(DEPDIR)/$(am__dirstamp)
-src/testing/gtest/src/src_processor_stackwalker_mips_unittest-gtest-all.$(OBJEXT): \
- src/testing/gtest/src/$(am__dirstamp) \
- src/testing/gtest/src/$(DEPDIR)/$(am__dirstamp)
-src/testing/gtest/src/src_processor_stackwalker_mips_unittest-gtest_main.$(OBJEXT): \
- src/testing/gtest/src/$(am__dirstamp) \
- src/testing/gtest/src/$(DEPDIR)/$(am__dirstamp)
-src/testing/src/src_processor_stackwalker_mips_unittest-gmock-all.$(OBJEXT): \
- src/testing/src/$(am__dirstamp) \
- src/testing/src/$(DEPDIR)/$(am__dirstamp)
src/processor/stackwalker_mips_unittest$(EXEEXT): $(src_processor_stackwalker_mips_unittest_OBJECTS) $(src_processor_stackwalker_mips_unittest_DEPENDENCIES) $(EXTRA_src_processor_stackwalker_mips_unittest_DEPENDENCIES) src/processor/$(am__dirstamp)
@rm -f src/processor/stackwalker_mips_unittest$(EXEEXT)
@@ -4125,15 +4552,6 @@ src/common/src_processor_stackwalker_x86_unittest-test_assembler.$(OBJEXT): \
src/processor/src_processor_stackwalker_x86_unittest-stackwalker_x86_unittest.$(OBJEXT): \
src/processor/$(am__dirstamp) \
src/processor/$(DEPDIR)/$(am__dirstamp)
-src/testing/gtest/src/src_processor_stackwalker_x86_unittest-gtest-all.$(OBJEXT): \
- src/testing/gtest/src/$(am__dirstamp) \
- src/testing/gtest/src/$(DEPDIR)/$(am__dirstamp)
-src/testing/gtest/src/src_processor_stackwalker_x86_unittest-gtest_main.$(OBJEXT): \
- src/testing/gtest/src/$(am__dirstamp) \
- src/testing/gtest/src/$(DEPDIR)/$(am__dirstamp)
-src/testing/src/src_processor_stackwalker_x86_unittest-gmock-all.$(OBJEXT): \
- src/testing/src/$(am__dirstamp) \
- src/testing/src/$(DEPDIR)/$(am__dirstamp)
src/processor/stackwalker_x86_unittest$(EXEEXT): $(src_processor_stackwalker_x86_unittest_OBJECTS) $(src_processor_stackwalker_x86_unittest_DEPENDENCIES) $(EXTRA_src_processor_stackwalker_x86_unittest_DEPENDENCIES) src/processor/$(am__dirstamp)
@rm -f src/processor/stackwalker_x86_unittest$(EXEEXT)
@@ -4141,12 +4559,6 @@ src/processor/stackwalker_x86_unittest$(EXEEXT): $(src_processor_stackwalker_x86
src/processor/src_processor_static_address_map_unittest-static_address_map_unittest.$(OBJEXT): \
src/processor/$(am__dirstamp) \
src/processor/$(DEPDIR)/$(am__dirstamp)
-src/testing/gtest/src/src_processor_static_address_map_unittest-gtest-all.$(OBJEXT): \
- src/testing/gtest/src/$(am__dirstamp) \
- src/testing/gtest/src/$(DEPDIR)/$(am__dirstamp)
-src/testing/src/src_processor_static_address_map_unittest-gmock-all.$(OBJEXT): \
- src/testing/src/$(am__dirstamp) \
- src/testing/src/$(DEPDIR)/$(am__dirstamp)
src/processor/static_address_map_unittest$(EXEEXT): $(src_processor_static_address_map_unittest_OBJECTS) $(src_processor_static_address_map_unittest_DEPENDENCIES) $(EXTRA_src_processor_static_address_map_unittest_DEPENDENCIES) src/processor/$(am__dirstamp)
@rm -f src/processor/static_address_map_unittest$(EXEEXT)
@@ -4154,12 +4566,6 @@ src/processor/static_address_map_unittest$(EXEEXT): $(src_processor_static_addre
src/processor/src_processor_static_contained_range_map_unittest-static_contained_range_map_unittest.$(OBJEXT): \
src/processor/$(am__dirstamp) \
src/processor/$(DEPDIR)/$(am__dirstamp)
-src/testing/gtest/src/src_processor_static_contained_range_map_unittest-gtest-all.$(OBJEXT): \
- src/testing/gtest/src/$(am__dirstamp) \
- src/testing/gtest/src/$(DEPDIR)/$(am__dirstamp)
-src/testing/src/src_processor_static_contained_range_map_unittest-gmock-all.$(OBJEXT): \
- src/testing/src/$(am__dirstamp) \
- src/testing/src/$(DEPDIR)/$(am__dirstamp)
src/processor/static_contained_range_map_unittest$(EXEEXT): $(src_processor_static_contained_range_map_unittest_OBJECTS) $(src_processor_static_contained_range_map_unittest_DEPENDENCIES) $(EXTRA_src_processor_static_contained_range_map_unittest_DEPENDENCIES) src/processor/$(am__dirstamp)
@rm -f src/processor/static_contained_range_map_unittest$(EXEEXT)
@@ -4167,12 +4573,6 @@ src/processor/static_contained_range_map_unittest$(EXEEXT): $(src_processor_stat
src/processor/src_processor_static_map_unittest-static_map_unittest.$(OBJEXT): \
src/processor/$(am__dirstamp) \
src/processor/$(DEPDIR)/$(am__dirstamp)
-src/testing/gtest/src/src_processor_static_map_unittest-gtest-all.$(OBJEXT): \
- src/testing/gtest/src/$(am__dirstamp) \
- src/testing/gtest/src/$(DEPDIR)/$(am__dirstamp)
-src/testing/src/src_processor_static_map_unittest-gmock-all.$(OBJEXT): \
- src/testing/src/$(am__dirstamp) \
- src/testing/src/$(DEPDIR)/$(am__dirstamp)
src/processor/static_map_unittest$(EXEEXT): $(src_processor_static_map_unittest_OBJECTS) $(src_processor_static_map_unittest_DEPENDENCIES) $(EXTRA_src_processor_static_map_unittest_DEPENDENCIES) src/processor/$(am__dirstamp)
@rm -f src/processor/static_map_unittest$(EXEEXT)
@@ -4180,12 +4580,6 @@ src/processor/static_map_unittest$(EXEEXT): $(src_processor_static_map_unittest_
src/processor/src_processor_static_range_map_unittest-static_range_map_unittest.$(OBJEXT): \
src/processor/$(am__dirstamp) \
src/processor/$(DEPDIR)/$(am__dirstamp)
-src/testing/gtest/src/src_processor_static_range_map_unittest-gtest-all.$(OBJEXT): \
- src/testing/gtest/src/$(am__dirstamp) \
- src/testing/gtest/src/$(DEPDIR)/$(am__dirstamp)
-src/testing/src/src_processor_static_range_map_unittest-gmock-all.$(OBJEXT): \
- src/testing/src/$(am__dirstamp) \
- src/testing/src/$(DEPDIR)/$(am__dirstamp)
src/processor/static_range_map_unittest$(EXEEXT): $(src_processor_static_range_map_unittest_OBJECTS) $(src_processor_static_range_map_unittest_DEPENDENCIES) $(EXTRA_src_processor_static_range_map_unittest_DEPENDENCIES) src/processor/$(am__dirstamp)
@rm -f src/processor/static_range_map_unittest$(EXEEXT)
@@ -4196,15 +4590,6 @@ src/common/src_processor_synth_minidump_unittest-test_assembler.$(OBJEXT): \
src/processor/src_processor_synth_minidump_unittest-synth_minidump_unittest.$(OBJEXT): \
src/processor/$(am__dirstamp) \
src/processor/$(DEPDIR)/$(am__dirstamp)
-src/testing/gtest/src/src_processor_synth_minidump_unittest-gtest-all.$(OBJEXT): \
- src/testing/gtest/src/$(am__dirstamp) \
- src/testing/gtest/src/$(DEPDIR)/$(am__dirstamp)
-src/testing/gtest/src/src_processor_synth_minidump_unittest-gtest_main.$(OBJEXT): \
- src/testing/gtest/src/$(am__dirstamp) \
- src/testing/gtest/src/$(DEPDIR)/$(am__dirstamp)
-src/testing/src/src_processor_synth_minidump_unittest-gmock-all.$(OBJEXT): \
- src/testing/src/$(am__dirstamp) \
- src/testing/src/$(DEPDIR)/$(am__dirstamp)
src/processor/src_processor_synth_minidump_unittest-synth_minidump.$(OBJEXT): \
src/processor/$(am__dirstamp) \
src/processor/$(DEPDIR)/$(am__dirstamp)
@@ -4221,45 +4606,71 @@ src/tools/linux/core2md/$(DEPDIR)/$(am__dirstamp):
src/tools/linux/core2md/core2md.$(OBJEXT): \
src/tools/linux/core2md/$(am__dirstamp) \
src/tools/linux/core2md/$(DEPDIR)/$(am__dirstamp)
-src/client/linux/minidump_writer/linux_core_dumper.$(OBJEXT): \
- src/client/linux/minidump_writer/$(am__dirstamp) \
- src/client/linux/minidump_writer/$(DEPDIR)/$(am__dirstamp)
-src/common/linux/elf_core_dump.$(OBJEXT): \
- src/common/linux/$(am__dirstamp) \
- src/common/linux/$(DEPDIR)/$(am__dirstamp)
src/tools/linux/core2md/core2md$(EXEEXT): $(src_tools_linux_core2md_core2md_OBJECTS) $(src_tools_linux_core2md_core2md_DEPENDENCIES) $(EXTRA_src_tools_linux_core2md_core2md_DEPENDENCIES) src/tools/linux/core2md/$(am__dirstamp)
@rm -f src/tools/linux/core2md/core2md$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(src_tools_linux_core2md_core2md_OBJECTS) $(src_tools_linux_core2md_core2md_LDADD) $(LIBS)
-src/common/dwarf_cfi_to_module.$(OBJEXT): src/common/$(am__dirstamp) \
+src/common/src_tools_linux_dump_syms_dump_syms-dwarf_cfi_to_module.$(OBJEXT): \
+ src/common/$(am__dirstamp) \
src/common/$(DEPDIR)/$(am__dirstamp)
-src/common/dwarf_cu_to_module.$(OBJEXT): src/common/$(am__dirstamp) \
+src/common/src_tools_linux_dump_syms_dump_syms-dwarf_cu_to_module.$(OBJEXT): \
+ src/common/$(am__dirstamp) \
src/common/$(DEPDIR)/$(am__dirstamp)
-src/common/dwarf_line_to_module.$(OBJEXT): src/common/$(am__dirstamp) \
+src/common/src_tools_linux_dump_syms_dump_syms-dwarf_line_to_module.$(OBJEXT): \
+ src/common/$(am__dirstamp) \
src/common/$(DEPDIR)/$(am__dirstamp)
-src/common/language.$(OBJEXT): src/common/$(am__dirstamp) \
+src/common/src_tools_linux_dump_syms_dump_syms-dwarf_range_list_handler.$(OBJEXT): \
+ src/common/$(am__dirstamp) \
src/common/$(DEPDIR)/$(am__dirstamp)
-src/common/module.$(OBJEXT): src/common/$(am__dirstamp) \
+src/common/src_tools_linux_dump_syms_dump_syms-language.$(OBJEXT): \
+ src/common/$(am__dirstamp) \
src/common/$(DEPDIR)/$(am__dirstamp)
-src/common/stabs_reader.$(OBJEXT): src/common/$(am__dirstamp) \
+src/common/src_tools_linux_dump_syms_dump_syms-module.$(OBJEXT): \
+ src/common/$(am__dirstamp) \
src/common/$(DEPDIR)/$(am__dirstamp)
-src/common/stabs_to_module.$(OBJEXT): src/common/$(am__dirstamp) \
+src/common/src_tools_linux_dump_syms_dump_syms-path_helper.$(OBJEXT): \
+ src/common/$(am__dirstamp) \
src/common/$(DEPDIR)/$(am__dirstamp)
-src/common/dwarf/bytereader.$(OBJEXT): \
+src/common/src_tools_linux_dump_syms_dump_syms-stabs_reader.$(OBJEXT): \
+ src/common/$(am__dirstamp) \
+ src/common/$(DEPDIR)/$(am__dirstamp)
+src/common/src_tools_linux_dump_syms_dump_syms-stabs_to_module.$(OBJEXT): \
+ src/common/$(am__dirstamp) \
+ src/common/$(DEPDIR)/$(am__dirstamp)
+src/common/dwarf/src_tools_linux_dump_syms_dump_syms-bytereader.$(OBJEXT): \
+ src/common/dwarf/$(am__dirstamp) \
+ src/common/dwarf/$(DEPDIR)/$(am__dirstamp)
+src/common/dwarf/src_tools_linux_dump_syms_dump_syms-dwarf2diehandler.$(OBJEXT): \
src/common/dwarf/$(am__dirstamp) \
src/common/dwarf/$(DEPDIR)/$(am__dirstamp)
-src/common/dwarf/dwarf2diehandler.$(OBJEXT): \
+src/common/dwarf/src_tools_linux_dump_syms_dump_syms-dwarf2reader.$(OBJEXT): \
src/common/dwarf/$(am__dirstamp) \
src/common/dwarf/$(DEPDIR)/$(am__dirstamp)
-src/common/dwarf/dwarf2reader.$(OBJEXT): \
+src/common/dwarf/src_tools_linux_dump_syms_dump_syms-elf_reader.$(OBJEXT): \
src/common/dwarf/$(am__dirstamp) \
src/common/dwarf/$(DEPDIR)/$(am__dirstamp)
-src/common/linux/crc32.$(OBJEXT): src/common/linux/$(am__dirstamp) \
+src/common/linux/src_tools_linux_dump_syms_dump_syms-crc32.$(OBJEXT): \
+ src/common/linux/$(am__dirstamp) \
+ src/common/linux/$(DEPDIR)/$(am__dirstamp)
+src/common/linux/src_tools_linux_dump_syms_dump_syms-dump_symbols.$(OBJEXT): \
+ src/common/linux/$(am__dirstamp) \
src/common/linux/$(DEPDIR)/$(am__dirstamp)
-src/common/linux/dump_symbols.$(OBJEXT): \
+src/common/linux/src_tools_linux_dump_syms_dump_syms-elf_symbols_to_module.$(OBJEXT): \
src/common/linux/$(am__dirstamp) \
src/common/linux/$(DEPDIR)/$(am__dirstamp)
-src/common/linux/elf_symbols_to_module.$(OBJEXT): \
+src/common/linux/src_tools_linux_dump_syms_dump_syms-elfutils.$(OBJEXT): \
+ src/common/linux/$(am__dirstamp) \
+ src/common/linux/$(DEPDIR)/$(am__dirstamp)
+src/common/linux/src_tools_linux_dump_syms_dump_syms-file_id.$(OBJEXT): \
+ src/common/linux/$(am__dirstamp) \
+ src/common/linux/$(DEPDIR)/$(am__dirstamp)
+src/common/linux/src_tools_linux_dump_syms_dump_syms-linux_libc_support.$(OBJEXT): \
+ src/common/linux/$(am__dirstamp) \
+ src/common/linux/$(DEPDIR)/$(am__dirstamp)
+src/common/linux/src_tools_linux_dump_syms_dump_syms-memory_mapped_file.$(OBJEXT): \
+ src/common/linux/$(am__dirstamp) \
+ src/common/linux/$(DEPDIR)/$(am__dirstamp)
+src/common/linux/src_tools_linux_dump_syms_dump_syms-safe_readlink.$(OBJEXT): \
src/common/linux/$(am__dirstamp) \
src/common/linux/$(DEPDIR)/$(am__dirstamp)
src/tools/linux/dump_syms/$(am__dirstamp):
@@ -4268,13 +4679,15 @@ src/tools/linux/dump_syms/$(am__dirstamp):
src/tools/linux/dump_syms/$(DEPDIR)/$(am__dirstamp):
@$(MKDIR_P) src/tools/linux/dump_syms/$(DEPDIR)
@: > src/tools/linux/dump_syms/$(DEPDIR)/$(am__dirstamp)
-src/tools/linux/dump_syms/dump_syms.$(OBJEXT): \
+src/tools/linux/dump_syms/src_tools_linux_dump_syms_dump_syms-dump_syms.$(OBJEXT): \
src/tools/linux/dump_syms/$(am__dirstamp) \
src/tools/linux/dump_syms/$(DEPDIR)/$(am__dirstamp)
src/tools/linux/dump_syms/dump_syms$(EXEEXT): $(src_tools_linux_dump_syms_dump_syms_OBJECTS) $(src_tools_linux_dump_syms_dump_syms_DEPENDENCIES) $(EXTRA_src_tools_linux_dump_syms_dump_syms_DEPENDENCIES) src/tools/linux/dump_syms/$(am__dirstamp)
@rm -f src/tools/linux/dump_syms/dump_syms$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(src_tools_linux_dump_syms_dump_syms_OBJECTS) $(src_tools_linux_dump_syms_dump_syms_LDADD) $(LIBS)
+ $(AM_V_CXXLD)$(src_tools_linux_dump_syms_dump_syms_LINK) $(src_tools_linux_dump_syms_dump_syms_OBJECTS) $(src_tools_linux_dump_syms_dump_syms_LDADD) $(LIBS)
+src/common/path_helper.$(OBJEXT): src/common/$(am__dirstamp) \
+ src/common/$(DEPDIR)/$(am__dirstamp)
src/tools/linux/md2core/$(am__dirstamp):
@$(MKDIR_P) src/tools/linux/md2core
@: > src/tools/linux/md2core/$(am__dirstamp)
@@ -4288,15 +4701,6 @@ src/tools/linux/md2core/minidump-2-core.$(OBJEXT): \
src/tools/linux/md2core/minidump-2-core$(EXEEXT): $(src_tools_linux_md2core_minidump_2_core_OBJECTS) $(src_tools_linux_md2core_minidump_2_core_DEPENDENCIES) $(EXTRA_src_tools_linux_md2core_minidump_2_core_DEPENDENCIES) src/tools/linux/md2core/$(am__dirstamp)
@rm -f src/tools/linux/md2core/minidump-2-core$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(src_tools_linux_md2core_minidump_2_core_OBJECTS) $(src_tools_linux_md2core_minidump_2_core_LDADD) $(LIBS)
-src/testing/gtest/src/src_tools_linux_md2core_minidump_2_core_unittest-gtest-all.$(OBJEXT): \
- src/testing/gtest/src/$(am__dirstamp) \
- src/testing/gtest/src/$(DEPDIR)/$(am__dirstamp)
-src/testing/gtest/src/src_tools_linux_md2core_minidump_2_core_unittest-gtest_main.$(OBJEXT): \
- src/testing/gtest/src/$(am__dirstamp) \
- src/testing/gtest/src/$(DEPDIR)/$(am__dirstamp)
-src/testing/src/src_tools_linux_md2core_minidump_2_core_unittest-gmock-all.$(OBJEXT): \
- src/testing/src/$(am__dirstamp) \
- src/testing/src/$(DEPDIR)/$(am__dirstamp)
src/tools/linux/md2core/src_tools_linux_md2core_minidump_2_core_unittest-minidump_memory_range_unittest.$(OBJEXT): \
src/tools/linux/md2core/$(am__dirstamp) \
src/tools/linux/md2core/$(DEPDIR)/$(am__dirstamp)
@@ -4320,6 +4724,12 @@ src/tools/linux/symupload/minidump_upload.$(OBJEXT): \
src/tools/linux/symupload/minidump_upload$(EXEEXT): $(src_tools_linux_symupload_minidump_upload_OBJECTS) $(src_tools_linux_symupload_minidump_upload_DEPENDENCIES) $(EXTRA_src_tools_linux_symupload_minidump_upload_DEPENDENCIES) src/tools/linux/symupload/$(am__dirstamp)
@rm -f src/tools/linux/symupload/minidump_upload$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(src_tools_linux_symupload_minidump_upload_OBJECTS) $(src_tools_linux_symupload_minidump_upload_LDADD) $(LIBS)
+src/common/linux/symbol_collector_client.$(OBJEXT): \
+ src/common/linux/$(am__dirstamp) \
+ src/common/linux/$(DEPDIR)/$(am__dirstamp)
+src/common/linux/symbol_upload.$(OBJEXT): \
+ src/common/linux/$(am__dirstamp) \
+ src/common/linux/$(DEPDIR)/$(am__dirstamp)
src/tools/linux/symupload/sym_upload.$(OBJEXT): \
src/tools/linux/symupload/$(am__dirstamp) \
src/tools/linux/symupload/$(DEPDIR)/$(am__dirstamp)
@@ -4327,6 +4737,82 @@ src/tools/linux/symupload/sym_upload.$(OBJEXT): \
src/tools/linux/symupload/sym_upload$(EXEEXT): $(src_tools_linux_symupload_sym_upload_OBJECTS) $(src_tools_linux_symupload_sym_upload_DEPENDENCIES) $(EXTRA_src_tools_linux_symupload_sym_upload_DEPENDENCIES) src/tools/linux/symupload/$(am__dirstamp)
@rm -f src/tools/linux/symupload/sym_upload$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(src_tools_linux_symupload_sym_upload_OBJECTS) $(src_tools_linux_symupload_sym_upload_LDADD) $(LIBS)
+src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cfi_to_module.$(OBJEXT): \
+ src/common/$(am__dirstamp) \
+ src/common/$(DEPDIR)/$(am__dirstamp)
+src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cu_to_module.$(OBJEXT): \
+ src/common/$(am__dirstamp) \
+ src/common/$(DEPDIR)/$(am__dirstamp)
+src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_line_to_module.$(OBJEXT): \
+ src/common/$(am__dirstamp) \
+ src/common/$(DEPDIR)/$(am__dirstamp)
+src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_range_list_handler.$(OBJEXT): \
+ src/common/$(am__dirstamp) \
+ src/common/$(DEPDIR)/$(am__dirstamp)
+src/common/src_tools_mac_dump_syms_dump_syms_mac-language.$(OBJEXT): \
+ src/common/$(am__dirstamp) \
+ src/common/$(DEPDIR)/$(am__dirstamp)
+src/common/src_tools_mac_dump_syms_dump_syms_mac-md5.$(OBJEXT): \
+ src/common/$(am__dirstamp) \
+ src/common/$(DEPDIR)/$(am__dirstamp)
+src/common/src_tools_mac_dump_syms_dump_syms_mac-module.$(OBJEXT): \
+ src/common/$(am__dirstamp) \
+ src/common/$(DEPDIR)/$(am__dirstamp)
+src/common/src_tools_mac_dump_syms_dump_syms_mac-path_helper.$(OBJEXT): \
+ src/common/$(am__dirstamp) \
+ src/common/$(DEPDIR)/$(am__dirstamp)
+src/common/src_tools_mac_dump_syms_dump_syms_mac-stabs_reader.$(OBJEXT): \
+ src/common/$(am__dirstamp) \
+ src/common/$(DEPDIR)/$(am__dirstamp)
+src/common/src_tools_mac_dump_syms_dump_syms_mac-stabs_to_module.$(OBJEXT): \
+ src/common/$(am__dirstamp) \
+ src/common/$(DEPDIR)/$(am__dirstamp)
+src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-bytereader.$(OBJEXT): \
+ src/common/dwarf/$(am__dirstamp) \
+ src/common/dwarf/$(DEPDIR)/$(am__dirstamp)
+src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-dwarf2diehandler.$(OBJEXT): \
+ src/common/dwarf/$(am__dirstamp) \
+ src/common/dwarf/$(DEPDIR)/$(am__dirstamp)
+src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-dwarf2reader.$(OBJEXT): \
+ src/common/dwarf/$(am__dirstamp) \
+ src/common/dwarf/$(DEPDIR)/$(am__dirstamp)
+src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-elf_reader.$(OBJEXT): \
+ src/common/dwarf/$(am__dirstamp) \
+ src/common/dwarf/$(DEPDIR)/$(am__dirstamp)
+src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-arch_utilities.$(OBJEXT): \
+ src/common/mac/$(am__dirstamp) \
+ src/common/mac/$(DEPDIR)/$(am__dirstamp)
+src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-dump_syms.$(OBJEXT): \
+ src/common/mac/$(am__dirstamp) \
+ src/common/mac/$(DEPDIR)/$(am__dirstamp)
+src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-file_id.$(OBJEXT): \
+ src/common/mac/$(am__dirstamp) \
+ src/common/mac/$(DEPDIR)/$(am__dirstamp)
+src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_id.$(OBJEXT): \
+ src/common/mac/$(am__dirstamp) \
+ src/common/mac/$(DEPDIR)/$(am__dirstamp)
+src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_reader.$(OBJEXT): \
+ src/common/mac/$(am__dirstamp) \
+ src/common/mac/$(DEPDIR)/$(am__dirstamp)
+src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_utilities.$(OBJEXT): \
+ src/common/mac/$(am__dirstamp) \
+ src/common/mac/$(DEPDIR)/$(am__dirstamp)
+src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_walker.$(OBJEXT): \
+ src/common/mac/$(am__dirstamp) \
+ src/common/mac/$(DEPDIR)/$(am__dirstamp)
+src/tools/mac/dump_syms/$(am__dirstamp):
+ @$(MKDIR_P) src/tools/mac/dump_syms
+ @: > src/tools/mac/dump_syms/$(am__dirstamp)
+src/tools/mac/dump_syms/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) src/tools/mac/dump_syms/$(DEPDIR)
+ @: > src/tools/mac/dump_syms/$(DEPDIR)/$(am__dirstamp)
+src/tools/mac/dump_syms/src_tools_mac_dump_syms_dump_syms_mac-dump_syms_tool.$(OBJEXT): \
+ src/tools/mac/dump_syms/$(am__dirstamp) \
+ src/tools/mac/dump_syms/$(DEPDIR)/$(am__dirstamp)
+
+src/tools/mac/dump_syms/dump_syms_mac$(EXEEXT): $(src_tools_mac_dump_syms_dump_syms_mac_OBJECTS) $(src_tools_mac_dump_syms_dump_syms_mac_DEPENDENCIES) $(EXTRA_src_tools_mac_dump_syms_dump_syms_mac_DEPENDENCIES) src/tools/mac/dump_syms/$(am__dirstamp)
+ @rm -f src/tools/mac/dump_syms/dump_syms_mac$(EXEEXT)
+ $(AM_V_CXXLD)$(src_tools_mac_dump_syms_dump_syms_mac_LINK) $(src_tools_mac_dump_syms_dump_syms_mac_OBJECTS) $(src_tools_mac_dump_syms_dump_syms_mac_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
@@ -4338,19 +4824,20 @@ mostlyclean-compile:
-rm -f src/client/linux/microdump_writer/*.$(OBJEXT)
-rm -f src/client/linux/minidump_writer/*.$(OBJEXT)
-rm -f src/common/*.$(OBJEXT)
- -rm -f src/common/android/*.$(OBJEXT)
-rm -f src/common/dwarf/*.$(OBJEXT)
-rm -f src/common/linux/*.$(OBJEXT)
-rm -f src/common/linux/tests/*.$(OBJEXT)
+ -rm -f src/common/mac/*.$(OBJEXT)
-rm -f src/common/tests/*.$(OBJEXT)
-rm -f src/processor/*.$(OBJEXT)
- -rm -f src/testing/gtest/src/*.$(OBJEXT)
- -rm -f src/testing/src/*.$(OBJEXT)
+ -rm -f src/testing/googlemock/src/*.$(OBJEXT)
+ -rm -f src/testing/googletest/src/*.$(OBJEXT)
-rm -f src/third_party/libdisasm/*.$(OBJEXT)
-rm -f src/tools/linux/core2md/*.$(OBJEXT)
-rm -f src/tools/linux/dump_syms/*.$(OBJEXT)
-rm -f src/tools/linux/md2core/*.$(OBJEXT)
-rm -f src/tools/linux/symupload/*.$(OBJEXT)
+ -rm -f src/tools/mac/dump_syms/*.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@@ -4358,7 +4845,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@src/client/$(DEPDIR)/minidump_file_writer.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/client/linux/crash_generation/$(DEPDIR)/crash_generation_client.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/client/linux/crash_generation/$(DEPDIR)/crash_generation_server.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/client/linux/dump_writer_common/$(DEPDIR)/seccomp_unwinder.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/client/linux/dump_writer_common/$(DEPDIR)/thread_info.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/client/linux/dump_writer_common/$(DEPDIR)/ucontext_reader.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/client/linux/handler/$(DEPDIR)/exception_handler.Po@am__quote@
@@ -4382,29 +4868,40 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-proc_cpuinfo_reader_unittest.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_dumper_unittest_helper-linux_dumper_unittest_helper.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/convert_UTF.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/dwarf_cfi_to_module.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/dwarf_cu_to_module.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/dwarf_line_to_module.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/language.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/md5.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/module.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-memory_unittest.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/path_helper.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-memory_allocator_unittest.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_common_dumper_unittest-byte_cursor_unittest.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_common_dumper_unittest-convert_UTF.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_common_dumper_unittest-dwarf_cfi_to_module.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_common_dumper_unittest-dwarf_cfi_to_module_unittest.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_common_dumper_unittest-dwarf_cu_to_module.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_common_dumper_unittest-dwarf_cu_to_module_unittest.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_common_dumper_unittest-dwarf_line_to_module.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_common_dumper_unittest-dwarf_line_to_module_unittest.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_common_dumper_unittest-dwarf_range_list_handler.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_common_dumper_unittest-language.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_common_dumper_unittest-memory_range_unittest.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_common_dumper_unittest-module.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_common_dumper_unittest-module_unittest.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_common_dumper_unittest-path_helper.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_common_dumper_unittest-stabs_reader.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_common_dumper_unittest-stabs_reader_unittest.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_common_dumper_unittest-stabs_to_module.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_common_dumper_unittest-stabs_to_module_unittest.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_common_dumper_unittest-string_conversion.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_common_dumper_unittest-string_conversion_unittest.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_common_dumper_unittest-test_assembler.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf_cfi_to_module.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf_cu_to_module.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf_line_to_module.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-language.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-md5.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-module.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-path_helper.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-stabs_reader.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-stabs_to_module.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-test_assembler.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_common_test_assembler_unittest-test_assembler.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_common_test_assembler_unittest-test_assembler_unittest.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_processor_minidump_unittest-test_assembler.Po@am__quote@
@@ -4412,18 +4909,30 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_processor_stackwalker_amd64_unittest-test_assembler.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_processor_stackwalker_arm64_unittest-test_assembler.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_processor_stackwalker_arm_unittest-test_assembler.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_processor_stackwalker_mips64_unittest-test_assembler.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_processor_stackwalker_mips_unittest-test_assembler.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_processor_stackwalker_x86_unittest-test_assembler.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_processor_synth_minidump_unittest-test_assembler.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/stabs_reader.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/stabs_to_module.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-dwarf_cfi_to_module.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-dwarf_cu_to_module.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-dwarf_line_to_module.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-dwarf_range_list_handler.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-language.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-module.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-path_helper.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-stabs_reader.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-stabs_to_module.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cfi_to_module.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cu_to_module.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf_line_to_module.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf_range_list_handler.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-language.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-md5.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-module.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-path_helper.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-stabs_reader.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-stabs_to_module.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/string_conversion.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/android/$(DEPDIR)/breakpad_getcontext.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/android/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/android/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/dwarf/$(DEPDIR)/bytereader.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/dwarf/$(DEPDIR)/dwarf2diehandler.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/dwarf/$(DEPDIR)/dwarf2reader.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-bytereader.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-bytereader_unittest.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-cfi_assembler.Po@am__quote@
@@ -4432,10 +4941,22 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-dwarf2reader.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-dwarf2reader_cfi_unittest.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-dwarf2reader_die_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/crc32.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/dump_symbols.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-elf_reader.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-bytereader.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-cfi_assembler.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf2diehandler.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf2reader.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-elf_reader.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/dwarf/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-bytereader.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/dwarf/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-dwarf2diehandler.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/dwarf/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-dwarf2reader.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/dwarf/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-elf_reader.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/dwarf/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-bytereader.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/dwarf/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf2diehandler.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/dwarf/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf2reader.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/dwarf/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-elf_reader.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/breakpad_getcontext.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/elf_core_dump.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/elf_symbols_to_module.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/elfutils.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/file_id.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/guid_creator.Po@am__quote@
@@ -4443,6 +4964,8 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/linux_libc_support.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/memory_mapped_file.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/safe_readlink.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-elf_core_dump.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-linux_libc_support_unittest.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/src_common_dumper_unittest-crc32.Po@am__quote@
@@ -4462,17 +4985,45 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/src_common_dumper_unittest-safe_readlink_unittest.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/src_common_dumper_unittest-synth_elf.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/src_common_dumper_unittest-synth_elf_unittest.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/src_common_linux_google_crashdump_uploader_test-google_crashdump_uploader.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/src_common_linux_google_crashdump_uploader_test-google_crashdump_uploader_test.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/src_common_linux_google_crashdump_uploader_test-libcurl_wrapper.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-crc32.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-dump_symbols.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-elf_symbols_to_module.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-elfutils.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-file_id.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-linux_libc_support.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-memory_mapped_file.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-safe_readlink.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/symbol_collector_client.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/symbol_upload.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/tests/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-crash_generator.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/tests/$(DEPDIR)/src_common_dumper_unittest-crash_generator.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-arch_utilities.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-file_id.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_id.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_reader.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_reader_unittest.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_utilities.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_walker.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-arch_utilities.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dump_syms.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-file_id.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-macho_id.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-macho_reader.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-macho_utilities.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-macho_walker.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/common/tests/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-file_utils.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/common/tests/$(DEPDIR)/src_common_dumper_unittest-file_utils.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/common/tests/$(DEPDIR)/src_common_mac_macho_reader_unittest-file_utils.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/address_map_unittest.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/basic_code_modules.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/basic_source_line_resolver.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/binarystream.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/call_stack.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/cfi_frame_info.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/contained_range_map_unittest.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/convert_old_arm64_context.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/disassembler_x86.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/dump_context.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/dump_object.Po@am__quote@
@@ -4493,18 +5044,20 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/pathname_stripper.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/pathname_stripper_unittest.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/postfix_evaluator_unittest.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/proc_maps_linux.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/process_state.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/range_map_unittest.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/simple_symbol_supplier.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/source_line_resolver_base.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-basic_code_modules.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-convert_old_arm64_context.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-dump_context.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-dump_object.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-logging.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-minidump.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-pathname_stripper.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-proc_maps_linux.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/src_processor_basic_source_line_resolver_unittest-basic_source_line_resolver_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/src_processor_binarystream_unittest-binarystream_unittest.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/src_processor_cfi_frame_info_unittest-cfi_frame_info_unittest.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/src_processor_disassembler_x86_unittest-disassembler_x86_unittest.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/src_processor_exploitability_unittest-exploitability_unittest.Po@am__quote@
@@ -4514,10 +5067,15 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/src_processor_minidump_processor_unittest-minidump_processor_unittest.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/src_processor_minidump_unittest-minidump_unittest.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/src_processor_minidump_unittest-synth_minidump.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/src_processor_proc_maps_linux_unittest-proc_maps_linux.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/src_processor_proc_maps_linux_unittest-proc_maps_linux_unittest.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/src_processor_range_map_truncate_lower_unittest-range_map_truncate_lower_unittest.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/src_processor_range_map_truncate_upper_unittest-range_map_truncate_upper_unittest.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/src_processor_stackwalker_address_list_unittest-stackwalker_address_list_unittest.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/src_processor_stackwalker_amd64_unittest-stackwalker_amd64_unittest.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/src_processor_stackwalker_arm64_unittest-stackwalker_arm64_unittest.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/src_processor_stackwalker_arm_unittest-stackwalker_arm_unittest.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/src_processor_stackwalker_mips64_unittest-stackwalker_mips64_unittest.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/src_processor_stackwalker_mips_unittest-stackwalker_mips_unittest.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/src_processor_stackwalker_x86_unittest-stackwalker_x86_unittest.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/src_processor_static_address_map_unittest-static_address_map_unittest.Po@am__quote@
@@ -4541,71 +5099,12 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/stackwalker_x86.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/symbolic_constants_win.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/tokenize.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/gtest/src/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-gtest-all.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/gtest/src/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-gtest_main.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/gtest/src/$(DEPDIR)/src_common_dumper_unittest-gtest-all.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/gtest/src/$(DEPDIR)/src_common_dumper_unittest-gtest_main.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/gtest/src/$(DEPDIR)/src_common_test_assembler_unittest-gtest-all.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/gtest/src/$(DEPDIR)/src_common_test_assembler_unittest-gtest_main.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/gtest/src/$(DEPDIR)/src_processor_basic_source_line_resolver_unittest-gtest-all.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/gtest/src/$(DEPDIR)/src_processor_binarystream_unittest-gtest-all.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/gtest/src/$(DEPDIR)/src_processor_cfi_frame_info_unittest-gtest-all.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/gtest/src/$(DEPDIR)/src_processor_cfi_frame_info_unittest-gtest_main.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/gtest/src/$(DEPDIR)/src_processor_disassembler_x86_unittest-gtest-all.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/gtest/src/$(DEPDIR)/src_processor_disassembler_x86_unittest-gtest_main.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/gtest/src/$(DEPDIR)/src_processor_exploitability_unittest-gtest-all.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/gtest/src/$(DEPDIR)/src_processor_exploitability_unittest-gtest_main.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/gtest/src/$(DEPDIR)/src_processor_fast_source_line_resolver_unittest-gtest-all.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/gtest/src/$(DEPDIR)/src_processor_map_serializers_unittest-gtest-all.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/gtest/src/$(DEPDIR)/src_processor_microdump_processor_unittest-gtest-all.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/gtest/src/$(DEPDIR)/src_processor_minidump_processor_unittest-gtest-all.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/gtest/src/$(DEPDIR)/src_processor_minidump_unittest-gtest-all.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/gtest/src/$(DEPDIR)/src_processor_minidump_unittest-gtest_main.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_address_list_unittest-gtest-all.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_address_list_unittest-gtest_main.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_amd64_unittest-gtest-all.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_amd64_unittest-gtest_main.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_arm64_unittest-gtest-all.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_arm64_unittest-gtest_main.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_arm_unittest-gtest-all.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_arm_unittest-gtest_main.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_mips_unittest-gtest-all.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_mips_unittest-gtest_main.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_x86_unittest-gtest-all.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_x86_unittest-gtest_main.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/gtest/src/$(DEPDIR)/src_processor_static_address_map_unittest-gtest-all.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/gtest/src/$(DEPDIR)/src_processor_static_contained_range_map_unittest-gtest-all.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/gtest/src/$(DEPDIR)/src_processor_static_map_unittest-gtest-all.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/gtest/src/$(DEPDIR)/src_processor_static_range_map_unittest-gtest-all.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/gtest/src/$(DEPDIR)/src_processor_synth_minidump_unittest-gtest-all.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/gtest/src/$(DEPDIR)/src_processor_synth_minidump_unittest-gtest_main.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/gtest/src/$(DEPDIR)/src_tools_linux_md2core_minidump_2_core_unittest-gtest-all.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/gtest/src/$(DEPDIR)/src_tools_linux_md2core_minidump_2_core_unittest-gtest_main.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/src/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-gmock-all.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/src/$(DEPDIR)/src_common_dumper_unittest-gmock-all.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/src/$(DEPDIR)/src_common_test_assembler_unittest-gmock-all.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/src/$(DEPDIR)/src_processor_basic_source_line_resolver_unittest-gmock-all.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/src/$(DEPDIR)/src_processor_binarystream_unittest-gmock-all.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/src/$(DEPDIR)/src_processor_cfi_frame_info_unittest-gmock-all.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/src/$(DEPDIR)/src_processor_disassembler_x86_unittest-gmock-all.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/src/$(DEPDIR)/src_processor_exploitability_unittest-gmock-all.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/src/$(DEPDIR)/src_processor_fast_source_line_resolver_unittest-gmock-all.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/src/$(DEPDIR)/src_processor_map_serializers_unittest-gmock-all.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/src/$(DEPDIR)/src_processor_microdump_processor_unittest-gmock-all.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/src/$(DEPDIR)/src_processor_minidump_processor_unittest-gmock-all.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/src/$(DEPDIR)/src_processor_minidump_unittest-gmock-all.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/src/$(DEPDIR)/src_processor_stackwalker_address_list_unittest-gmock-all.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/src/$(DEPDIR)/src_processor_stackwalker_amd64_unittest-gmock-all.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/src/$(DEPDIR)/src_processor_stackwalker_arm64_unittest-gmock-all.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/src/$(DEPDIR)/src_processor_stackwalker_arm_unittest-gmock-all.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/src/$(DEPDIR)/src_processor_stackwalker_mips_unittest-gmock-all.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/src/$(DEPDIR)/src_processor_stackwalker_x86_unittest-gmock-all.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/src/$(DEPDIR)/src_processor_static_address_map_unittest-gmock-all.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/src/$(DEPDIR)/src_processor_static_contained_range_map_unittest-gmock-all.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/src/$(DEPDIR)/src_processor_static_map_unittest-gmock-all.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/src/$(DEPDIR)/src_processor_static_range_map_unittest-gmock-all.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/src/$(DEPDIR)/src_processor_synth_minidump_unittest-gmock-all.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/src/$(DEPDIR)/src_tools_linux_md2core_minidump_2_core_unittest-gmock-all.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/testing/googlemock/src/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-gmock-all.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/testing/googlemock/src/$(DEPDIR)/src_testing_libtesting_a-gmock-all.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/testing/googletest/src/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-gtest-all.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/testing/googletest/src/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-gtest_main.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/testing/googletest/src/$(DEPDIR)/src_testing_libtesting_a-gtest-all.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/testing/googletest/src/$(DEPDIR)/src_testing_libtesting_a-gtest_main.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/third_party/libdisasm/$(DEPDIR)/ia32_implicit.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/third_party/libdisasm/$(DEPDIR)/ia32_insn.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/third_party/libdisasm/$(DEPDIR)/ia32_invariant.Po@am__quote@
@@ -4621,11 +5120,12 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@src/third_party/libdisasm/$(DEPDIR)/x86_misc.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/third_party/libdisasm/$(DEPDIR)/x86_operand_list.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/tools/linux/core2md/$(DEPDIR)/core2md.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/tools/linux/dump_syms/$(DEPDIR)/dump_syms.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/tools/linux/dump_syms/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-dump_syms.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/tools/linux/md2core/$(DEPDIR)/minidump-2-core.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/tools/linux/md2core/$(DEPDIR)/src_tools_linux_md2core_minidump_2_core_unittest-minidump_memory_range_unittest.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/tools/linux/symupload/$(DEPDIR)/minidump_upload.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/tools/linux/symupload/$(DEPDIR)/sym_upload.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/tools/mac/dump_syms/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dump_syms_tool.Po@am__quote@
.S.o:
@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
@@ -4643,19 +5143,19 @@ distclean-compile:
@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(CPPASCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-src/common/android/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext.o: src/common/android/breakpad_getcontext.S
-@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT src/common/android/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext.o -MD -MP -MF src/common/android/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext.Tpo -c -o src/common/android/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext.o `test -f 'src/common/android/breakpad_getcontext.S' || echo '$(srcdir)/'`src/common/android/breakpad_getcontext.S
-@am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) src/common/android/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext.Tpo src/common/android/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext.Po
-@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='src/common/android/breakpad_getcontext.S' object='src/common/android/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext.o' libtool=no @AMDEPBACKSLASH@
+src/common/linux/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext.o: src/common/linux/breakpad_getcontext.S
+@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT src/common/linux/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext.o -MD -MP -MF src/common/linux/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext.Tpo -c -o src/common/linux/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext.o `test -f 'src/common/linux/breakpad_getcontext.S' || echo '$(srcdir)/'`src/common/linux/breakpad_getcontext.S
+@am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext.Tpo src/common/linux/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext.Po
+@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='src/common/linux/breakpad_getcontext.S' object='src/common/linux/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o src/common/android/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext.o `test -f 'src/common/android/breakpad_getcontext.S' || echo '$(srcdir)/'`src/common/android/breakpad_getcontext.S
+@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o src/common/linux/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext.o `test -f 'src/common/linux/breakpad_getcontext.S' || echo '$(srcdir)/'`src/common/linux/breakpad_getcontext.S
-src/common/android/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext.obj: src/common/android/breakpad_getcontext.S
-@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT src/common/android/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext.obj -MD -MP -MF src/common/android/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext.Tpo -c -o src/common/android/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext.obj `if test -f 'src/common/android/breakpad_getcontext.S'; then $(CYGPATH_W) 'src/common/android/breakpad_getcontext.S'; else $(CYGPATH_W) '$(srcdir)/src/common/android/breakpad_getcontext.S'; fi`
-@am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) src/common/android/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext.Tpo src/common/android/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext.Po
-@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='src/common/android/breakpad_getcontext.S' object='src/common/android/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext.obj' libtool=no @AMDEPBACKSLASH@
+src/common/linux/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext.obj: src/common/linux/breakpad_getcontext.S
+@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT src/common/linux/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext.obj -MD -MP -MF src/common/linux/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext.Tpo -c -o src/common/linux/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext.obj `if test -f 'src/common/linux/breakpad_getcontext.S'; then $(CYGPATH_W) 'src/common/linux/breakpad_getcontext.S'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/breakpad_getcontext.S'; fi`
+@am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext.Tpo src/common/linux/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext.Po
+@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='src/common/linux/breakpad_getcontext.S' object='src/common/linux/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o src/common/android/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext.obj `if test -f 'src/common/android/breakpad_getcontext.S'; then $(CYGPATH_W) 'src/common/android/breakpad_getcontext.S'; else $(CYGPATH_W) '$(srcdir)/src/common/android/breakpad_getcontext.S'; fi`
+@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o src/common/linux/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext.obj `if test -f 'src/common/linux/breakpad_getcontext.S'; then $(CYGPATH_W) 'src/common/linux/breakpad_getcontext.S'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/breakpad_getcontext.S'; fi`
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
@@ -4689,6 +5189,90 @@ src/common/android/src_client_linux_linux_client_unittest_shlib-breakpad_getcont
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+src/testing/googletest/src/src_testing_libtesting_a-gtest-all.o: src/testing/googletest/src/gtest-all.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_testing_libtesting_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/googletest/src/src_testing_libtesting_a-gtest-all.o -MD -MP -MF src/testing/googletest/src/$(DEPDIR)/src_testing_libtesting_a-gtest-all.Tpo -c -o src/testing/googletest/src/src_testing_libtesting_a-gtest-all.o `test -f 'src/testing/googletest/src/gtest-all.cc' || echo '$(srcdir)/'`src/testing/googletest/src/gtest-all.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/googletest/src/$(DEPDIR)/src_testing_libtesting_a-gtest-all.Tpo src/testing/googletest/src/$(DEPDIR)/src_testing_libtesting_a-gtest-all.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/googletest/src/gtest-all.cc' object='src/testing/googletest/src/src_testing_libtesting_a-gtest-all.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_testing_libtesting_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/googletest/src/src_testing_libtesting_a-gtest-all.o `test -f 'src/testing/googletest/src/gtest-all.cc' || echo '$(srcdir)/'`src/testing/googletest/src/gtest-all.cc
+
+src/testing/googletest/src/src_testing_libtesting_a-gtest-all.obj: src/testing/googletest/src/gtest-all.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_testing_libtesting_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/googletest/src/src_testing_libtesting_a-gtest-all.obj -MD -MP -MF src/testing/googletest/src/$(DEPDIR)/src_testing_libtesting_a-gtest-all.Tpo -c -o src/testing/googletest/src/src_testing_libtesting_a-gtest-all.obj `if test -f 'src/testing/googletest/src/gtest-all.cc'; then $(CYGPATH_W) 'src/testing/googletest/src/gtest-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/googletest/src/gtest-all.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/googletest/src/$(DEPDIR)/src_testing_libtesting_a-gtest-all.Tpo src/testing/googletest/src/$(DEPDIR)/src_testing_libtesting_a-gtest-all.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/googletest/src/gtest-all.cc' object='src/testing/googletest/src/src_testing_libtesting_a-gtest-all.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_testing_libtesting_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/googletest/src/src_testing_libtesting_a-gtest-all.obj `if test -f 'src/testing/googletest/src/gtest-all.cc'; then $(CYGPATH_W) 'src/testing/googletest/src/gtest-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/googletest/src/gtest-all.cc'; fi`
+
+src/testing/googletest/src/src_testing_libtesting_a-gtest_main.o: src/testing/googletest/src/gtest_main.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_testing_libtesting_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/googletest/src/src_testing_libtesting_a-gtest_main.o -MD -MP -MF src/testing/googletest/src/$(DEPDIR)/src_testing_libtesting_a-gtest_main.Tpo -c -o src/testing/googletest/src/src_testing_libtesting_a-gtest_main.o `test -f 'src/testing/googletest/src/gtest_main.cc' || echo '$(srcdir)/'`src/testing/googletest/src/gtest_main.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/googletest/src/$(DEPDIR)/src_testing_libtesting_a-gtest_main.Tpo src/testing/googletest/src/$(DEPDIR)/src_testing_libtesting_a-gtest_main.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/googletest/src/gtest_main.cc' object='src/testing/googletest/src/src_testing_libtesting_a-gtest_main.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_testing_libtesting_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/googletest/src/src_testing_libtesting_a-gtest_main.o `test -f 'src/testing/googletest/src/gtest_main.cc' || echo '$(srcdir)/'`src/testing/googletest/src/gtest_main.cc
+
+src/testing/googletest/src/src_testing_libtesting_a-gtest_main.obj: src/testing/googletest/src/gtest_main.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_testing_libtesting_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/googletest/src/src_testing_libtesting_a-gtest_main.obj -MD -MP -MF src/testing/googletest/src/$(DEPDIR)/src_testing_libtesting_a-gtest_main.Tpo -c -o src/testing/googletest/src/src_testing_libtesting_a-gtest_main.obj `if test -f 'src/testing/googletest/src/gtest_main.cc'; then $(CYGPATH_W) 'src/testing/googletest/src/gtest_main.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/googletest/src/gtest_main.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/googletest/src/$(DEPDIR)/src_testing_libtesting_a-gtest_main.Tpo src/testing/googletest/src/$(DEPDIR)/src_testing_libtesting_a-gtest_main.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/googletest/src/gtest_main.cc' object='src/testing/googletest/src/src_testing_libtesting_a-gtest_main.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_testing_libtesting_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/googletest/src/src_testing_libtesting_a-gtest_main.obj `if test -f 'src/testing/googletest/src/gtest_main.cc'; then $(CYGPATH_W) 'src/testing/googletest/src/gtest_main.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/googletest/src/gtest_main.cc'; fi`
+
+src/testing/googlemock/src/src_testing_libtesting_a-gmock-all.o: src/testing/googlemock/src/gmock-all.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_testing_libtesting_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/googlemock/src/src_testing_libtesting_a-gmock-all.o -MD -MP -MF src/testing/googlemock/src/$(DEPDIR)/src_testing_libtesting_a-gmock-all.Tpo -c -o src/testing/googlemock/src/src_testing_libtesting_a-gmock-all.o `test -f 'src/testing/googlemock/src/gmock-all.cc' || echo '$(srcdir)/'`src/testing/googlemock/src/gmock-all.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/googlemock/src/$(DEPDIR)/src_testing_libtesting_a-gmock-all.Tpo src/testing/googlemock/src/$(DEPDIR)/src_testing_libtesting_a-gmock-all.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/googlemock/src/gmock-all.cc' object='src/testing/googlemock/src/src_testing_libtesting_a-gmock-all.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_testing_libtesting_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/googlemock/src/src_testing_libtesting_a-gmock-all.o `test -f 'src/testing/googlemock/src/gmock-all.cc' || echo '$(srcdir)/'`src/testing/googlemock/src/gmock-all.cc
+
+src/testing/googlemock/src/src_testing_libtesting_a-gmock-all.obj: src/testing/googlemock/src/gmock-all.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_testing_libtesting_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/googlemock/src/src_testing_libtesting_a-gmock-all.obj -MD -MP -MF src/testing/googlemock/src/$(DEPDIR)/src_testing_libtesting_a-gmock-all.Tpo -c -o src/testing/googlemock/src/src_testing_libtesting_a-gmock-all.obj `if test -f 'src/testing/googlemock/src/gmock-all.cc'; then $(CYGPATH_W) 'src/testing/googlemock/src/gmock-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/googlemock/src/gmock-all.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/googlemock/src/$(DEPDIR)/src_testing_libtesting_a-gmock-all.Tpo src/testing/googlemock/src/$(DEPDIR)/src_testing_libtesting_a-gmock-all.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/googlemock/src/gmock-all.cc' object='src/testing/googlemock/src/src_testing_libtesting_a-gmock-all.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_testing_libtesting_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/googlemock/src/src_testing_libtesting_a-gmock-all.obj `if test -f 'src/testing/googlemock/src/gmock-all.cc'; then $(CYGPATH_W) 'src/testing/googlemock/src/gmock-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/googlemock/src/gmock-all.cc'; fi`
+
+src/testing/googletest/src/src_client_linux_linux_client_unittest_shlib-gtest-all.o: src/testing/googletest/src/gtest-all.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/googletest/src/src_client_linux_linux_client_unittest_shlib-gtest-all.o -MD -MP -MF src/testing/googletest/src/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-gtest-all.Tpo -c -o src/testing/googletest/src/src_client_linux_linux_client_unittest_shlib-gtest-all.o `test -f 'src/testing/googletest/src/gtest-all.cc' || echo '$(srcdir)/'`src/testing/googletest/src/gtest-all.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/googletest/src/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-gtest-all.Tpo src/testing/googletest/src/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-gtest-all.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/googletest/src/gtest-all.cc' object='src/testing/googletest/src/src_client_linux_linux_client_unittest_shlib-gtest-all.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/googletest/src/src_client_linux_linux_client_unittest_shlib-gtest-all.o `test -f 'src/testing/googletest/src/gtest-all.cc' || echo '$(srcdir)/'`src/testing/googletest/src/gtest-all.cc
+
+src/testing/googletest/src/src_client_linux_linux_client_unittest_shlib-gtest-all.obj: src/testing/googletest/src/gtest-all.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/googletest/src/src_client_linux_linux_client_unittest_shlib-gtest-all.obj -MD -MP -MF src/testing/googletest/src/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-gtest-all.Tpo -c -o src/testing/googletest/src/src_client_linux_linux_client_unittest_shlib-gtest-all.obj `if test -f 'src/testing/googletest/src/gtest-all.cc'; then $(CYGPATH_W) 'src/testing/googletest/src/gtest-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/googletest/src/gtest-all.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/googletest/src/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-gtest-all.Tpo src/testing/googletest/src/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-gtest-all.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/googletest/src/gtest-all.cc' object='src/testing/googletest/src/src_client_linux_linux_client_unittest_shlib-gtest-all.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/googletest/src/src_client_linux_linux_client_unittest_shlib-gtest-all.obj `if test -f 'src/testing/googletest/src/gtest-all.cc'; then $(CYGPATH_W) 'src/testing/googletest/src/gtest-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/googletest/src/gtest-all.cc'; fi`
+
+src/testing/googletest/src/src_client_linux_linux_client_unittest_shlib-gtest_main.o: src/testing/googletest/src/gtest_main.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/googletest/src/src_client_linux_linux_client_unittest_shlib-gtest_main.o -MD -MP -MF src/testing/googletest/src/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-gtest_main.Tpo -c -o src/testing/googletest/src/src_client_linux_linux_client_unittest_shlib-gtest_main.o `test -f 'src/testing/googletest/src/gtest_main.cc' || echo '$(srcdir)/'`src/testing/googletest/src/gtest_main.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/googletest/src/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-gtest_main.Tpo src/testing/googletest/src/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-gtest_main.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/googletest/src/gtest_main.cc' object='src/testing/googletest/src/src_client_linux_linux_client_unittest_shlib-gtest_main.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/googletest/src/src_client_linux_linux_client_unittest_shlib-gtest_main.o `test -f 'src/testing/googletest/src/gtest_main.cc' || echo '$(srcdir)/'`src/testing/googletest/src/gtest_main.cc
+
+src/testing/googletest/src/src_client_linux_linux_client_unittest_shlib-gtest_main.obj: src/testing/googletest/src/gtest_main.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/googletest/src/src_client_linux_linux_client_unittest_shlib-gtest_main.obj -MD -MP -MF src/testing/googletest/src/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-gtest_main.Tpo -c -o src/testing/googletest/src/src_client_linux_linux_client_unittest_shlib-gtest_main.obj `if test -f 'src/testing/googletest/src/gtest_main.cc'; then $(CYGPATH_W) 'src/testing/googletest/src/gtest_main.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/googletest/src/gtest_main.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/googletest/src/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-gtest_main.Tpo src/testing/googletest/src/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-gtest_main.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/googletest/src/gtest_main.cc' object='src/testing/googletest/src/src_client_linux_linux_client_unittest_shlib-gtest_main.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/googletest/src/src_client_linux_linux_client_unittest_shlib-gtest_main.obj `if test -f 'src/testing/googletest/src/gtest_main.cc'; then $(CYGPATH_W) 'src/testing/googletest/src/gtest_main.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/googletest/src/gtest_main.cc'; fi`
+
+src/testing/googlemock/src/src_client_linux_linux_client_unittest_shlib-gmock-all.o: src/testing/googlemock/src/gmock-all.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/googlemock/src/src_client_linux_linux_client_unittest_shlib-gmock-all.o -MD -MP -MF src/testing/googlemock/src/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-gmock-all.Tpo -c -o src/testing/googlemock/src/src_client_linux_linux_client_unittest_shlib-gmock-all.o `test -f 'src/testing/googlemock/src/gmock-all.cc' || echo '$(srcdir)/'`src/testing/googlemock/src/gmock-all.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/googlemock/src/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-gmock-all.Tpo src/testing/googlemock/src/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-gmock-all.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/googlemock/src/gmock-all.cc' object='src/testing/googlemock/src/src_client_linux_linux_client_unittest_shlib-gmock-all.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/googlemock/src/src_client_linux_linux_client_unittest_shlib-gmock-all.o `test -f 'src/testing/googlemock/src/gmock-all.cc' || echo '$(srcdir)/'`src/testing/googlemock/src/gmock-all.cc
+
+src/testing/googlemock/src/src_client_linux_linux_client_unittest_shlib-gmock-all.obj: src/testing/googlemock/src/gmock-all.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/googlemock/src/src_client_linux_linux_client_unittest_shlib-gmock-all.obj -MD -MP -MF src/testing/googlemock/src/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-gmock-all.Tpo -c -o src/testing/googlemock/src/src_client_linux_linux_client_unittest_shlib-gmock-all.obj `if test -f 'src/testing/googlemock/src/gmock-all.cc'; then $(CYGPATH_W) 'src/testing/googlemock/src/gmock-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/googlemock/src/gmock-all.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/googlemock/src/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-gmock-all.Tpo src/testing/googlemock/src/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-gmock-all.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/googlemock/src/gmock-all.cc' object='src/testing/googlemock/src/src_client_linux_linux_client_unittest_shlib-gmock-all.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/googlemock/src/src_client_linux_linux_client_unittest_shlib-gmock-all.obj `if test -f 'src/testing/googlemock/src/gmock-all.cc'; then $(CYGPATH_W) 'src/testing/googlemock/src/gmock-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/googlemock/src/gmock-all.cc'; fi`
+
src/client/linux/handler/src_client_linux_linux_client_unittest_shlib-exception_handler_unittest.o: src/client/linux/handler/exception_handler_unittest.cc
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/client/linux/handler/src_client_linux_linux_client_unittest_shlib-exception_handler_unittest.o -MD -MP -MF src/client/linux/handler/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-exception_handler_unittest.Tpo -c -o src/client/linux/handler/src_client_linux_linux_client_unittest_shlib-exception_handler_unittest.o `test -f 'src/client/linux/handler/exception_handler_unittest.cc' || echo '$(srcdir)/'`src/client/linux/handler/exception_handler_unittest.cc
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/client/linux/handler/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-exception_handler_unittest.Tpo src/client/linux/handler/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-exception_handler_unittest.Po
@@ -4703,6 +5287,20 @@ src/client/linux/handler/src_client_linux_linux_client_unittest_shlib-exception_
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/client/linux/handler/src_client_linux_linux_client_unittest_shlib-exception_handler_unittest.obj `if test -f 'src/client/linux/handler/exception_handler_unittest.cc'; then $(CYGPATH_W) 'src/client/linux/handler/exception_handler_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/client/linux/handler/exception_handler_unittest.cc'; fi`
+src/client/linux/microdump_writer/src_client_linux_linux_client_unittest_shlib-microdump_writer_unittest.o: src/client/linux/microdump_writer/microdump_writer_unittest.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/client/linux/microdump_writer/src_client_linux_linux_client_unittest_shlib-microdump_writer_unittest.o -MD -MP -MF src/client/linux/microdump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-microdump_writer_unittest.Tpo -c -o src/client/linux/microdump_writer/src_client_linux_linux_client_unittest_shlib-microdump_writer_unittest.o `test -f 'src/client/linux/microdump_writer/microdump_writer_unittest.cc' || echo '$(srcdir)/'`src/client/linux/microdump_writer/microdump_writer_unittest.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/client/linux/microdump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-microdump_writer_unittest.Tpo src/client/linux/microdump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-microdump_writer_unittest.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/client/linux/microdump_writer/microdump_writer_unittest.cc' object='src/client/linux/microdump_writer/src_client_linux_linux_client_unittest_shlib-microdump_writer_unittest.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/client/linux/microdump_writer/src_client_linux_linux_client_unittest_shlib-microdump_writer_unittest.o `test -f 'src/client/linux/microdump_writer/microdump_writer_unittest.cc' || echo '$(srcdir)/'`src/client/linux/microdump_writer/microdump_writer_unittest.cc
+
+src/client/linux/microdump_writer/src_client_linux_linux_client_unittest_shlib-microdump_writer_unittest.obj: src/client/linux/microdump_writer/microdump_writer_unittest.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/client/linux/microdump_writer/src_client_linux_linux_client_unittest_shlib-microdump_writer_unittest.obj -MD -MP -MF src/client/linux/microdump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-microdump_writer_unittest.Tpo -c -o src/client/linux/microdump_writer/src_client_linux_linux_client_unittest_shlib-microdump_writer_unittest.obj `if test -f 'src/client/linux/microdump_writer/microdump_writer_unittest.cc'; then $(CYGPATH_W) 'src/client/linux/microdump_writer/microdump_writer_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/client/linux/microdump_writer/microdump_writer_unittest.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/client/linux/microdump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-microdump_writer_unittest.Tpo src/client/linux/microdump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-microdump_writer_unittest.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/client/linux/microdump_writer/microdump_writer_unittest.cc' object='src/client/linux/microdump_writer/src_client_linux_linux_client_unittest_shlib-microdump_writer_unittest.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/client/linux/microdump_writer/src_client_linux_linux_client_unittest_shlib-microdump_writer_unittest.obj `if test -f 'src/client/linux/microdump_writer/microdump_writer_unittest.cc'; then $(CYGPATH_W) 'src/client/linux/microdump_writer/microdump_writer_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/client/linux/microdump_writer/microdump_writer_unittest.cc'; fi`
+
src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-directory_reader_unittest.o: src/client/linux/minidump_writer/directory_reader_unittest.cc
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-directory_reader_unittest.o -MD -MP -MF src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-directory_reader_unittest.Tpo -c -o src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-directory_reader_unittest.o `test -f 'src/client/linux/minidump_writer/directory_reader_unittest.cc' || echo '$(srcdir)/'`src/client/linux/minidump_writer/directory_reader_unittest.cc
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-directory_reader_unittest.Tpo src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-directory_reader_unittest.Po
@@ -4871,19 +5469,19 @@ src/common/linux/tests/src_client_linux_linux_client_unittest_shlib-crash_genera
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/tests/src_client_linux_linux_client_unittest_shlib-crash_generator.obj `if test -f 'src/common/linux/tests/crash_generator.cc'; then $(CYGPATH_W) 'src/common/linux/tests/crash_generator.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/tests/crash_generator.cc'; fi`
-src/common/src_client_linux_linux_client_unittest_shlib-memory_unittest.o: src/common/memory_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_client_linux_linux_client_unittest_shlib-memory_unittest.o -MD -MP -MF src/common/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-memory_unittest.Tpo -c -o src/common/src_client_linux_linux_client_unittest_shlib-memory_unittest.o `test -f 'src/common/memory_unittest.cc' || echo '$(srcdir)/'`src/common/memory_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-memory_unittest.Tpo src/common/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-memory_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/memory_unittest.cc' object='src/common/src_client_linux_linux_client_unittest_shlib-memory_unittest.o' libtool=no @AMDEPBACKSLASH@
+src/common/src_client_linux_linux_client_unittest_shlib-memory_allocator_unittest.o: src/common/memory_allocator_unittest.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_client_linux_linux_client_unittest_shlib-memory_allocator_unittest.o -MD -MP -MF src/common/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-memory_allocator_unittest.Tpo -c -o src/common/src_client_linux_linux_client_unittest_shlib-memory_allocator_unittest.o `test -f 'src/common/memory_allocator_unittest.cc' || echo '$(srcdir)/'`src/common/memory_allocator_unittest.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-memory_allocator_unittest.Tpo src/common/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-memory_allocator_unittest.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/memory_allocator_unittest.cc' object='src/common/src_client_linux_linux_client_unittest_shlib-memory_allocator_unittest.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_client_linux_linux_client_unittest_shlib-memory_unittest.o `test -f 'src/common/memory_unittest.cc' || echo '$(srcdir)/'`src/common/memory_unittest.cc
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_client_linux_linux_client_unittest_shlib-memory_allocator_unittest.o `test -f 'src/common/memory_allocator_unittest.cc' || echo '$(srcdir)/'`src/common/memory_allocator_unittest.cc
-src/common/src_client_linux_linux_client_unittest_shlib-memory_unittest.obj: src/common/memory_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_client_linux_linux_client_unittest_shlib-memory_unittest.obj -MD -MP -MF src/common/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-memory_unittest.Tpo -c -o src/common/src_client_linux_linux_client_unittest_shlib-memory_unittest.obj `if test -f 'src/common/memory_unittest.cc'; then $(CYGPATH_W) 'src/common/memory_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/memory_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-memory_unittest.Tpo src/common/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-memory_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/memory_unittest.cc' object='src/common/src_client_linux_linux_client_unittest_shlib-memory_unittest.obj' libtool=no @AMDEPBACKSLASH@
+src/common/src_client_linux_linux_client_unittest_shlib-memory_allocator_unittest.obj: src/common/memory_allocator_unittest.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_client_linux_linux_client_unittest_shlib-memory_allocator_unittest.obj -MD -MP -MF src/common/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-memory_allocator_unittest.Tpo -c -o src/common/src_client_linux_linux_client_unittest_shlib-memory_allocator_unittest.obj `if test -f 'src/common/memory_allocator_unittest.cc'; then $(CYGPATH_W) 'src/common/memory_allocator_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/memory_allocator_unittest.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-memory_allocator_unittest.Tpo src/common/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-memory_allocator_unittest.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/memory_allocator_unittest.cc' object='src/common/src_client_linux_linux_client_unittest_shlib-memory_allocator_unittest.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_client_linux_linux_client_unittest_shlib-memory_unittest.obj `if test -f 'src/common/memory_unittest.cc'; then $(CYGPATH_W) 'src/common/memory_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/memory_unittest.cc'; fi`
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_client_linux_linux_client_unittest_shlib-memory_allocator_unittest.obj `if test -f 'src/common/memory_allocator_unittest.cc'; then $(CYGPATH_W) 'src/common/memory_allocator_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/memory_allocator_unittest.cc'; fi`
src/common/tests/src_client_linux_linux_client_unittest_shlib-file_utils.o: src/common/tests/file_utils.cc
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/tests/src_client_linux_linux_client_unittest_shlib-file_utils.o -MD -MP -MF src/common/tests/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-file_utils.Tpo -c -o src/common/tests/src_client_linux_linux_client_unittest_shlib-file_utils.o `test -f 'src/common/tests/file_utils.cc' || echo '$(srcdir)/'`src/common/tests/file_utils.cc
@@ -4899,48 +5497,6 @@ src/common/tests/src_client_linux_linux_client_unittest_shlib-file_utils.obj: sr
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/tests/src_client_linux_linux_client_unittest_shlib-file_utils.obj `if test -f 'src/common/tests/file_utils.cc'; then $(CYGPATH_W) 'src/common/tests/file_utils.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/tests/file_utils.cc'; fi`
-src/testing/gtest/src/src_client_linux_linux_client_unittest_shlib-gtest-all.o: src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_client_linux_linux_client_unittest_shlib-gtest-all.o -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-gtest-all.Tpo -c -o src/testing/gtest/src/src_client_linux_linux_client_unittest_shlib-gtest-all.o `test -f 'src/testing/gtest/src/gtest-all.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-gtest-all.Tpo src/testing/gtest/src/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-gtest-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest-all.cc' object='src/testing/gtest/src/src_client_linux_linux_client_unittest_shlib-gtest-all.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_client_linux_linux_client_unittest_shlib-gtest-all.o `test -f 'src/testing/gtest/src/gtest-all.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest-all.cc
-
-src/testing/gtest/src/src_client_linux_linux_client_unittest_shlib-gtest-all.obj: src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_client_linux_linux_client_unittest_shlib-gtest-all.obj -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-gtest-all.Tpo -c -o src/testing/gtest/src/src_client_linux_linux_client_unittest_shlib-gtest-all.obj `if test -f 'src/testing/gtest/src/gtest-all.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest-all.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-gtest-all.Tpo src/testing/gtest/src/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-gtest-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest-all.cc' object='src/testing/gtest/src/src_client_linux_linux_client_unittest_shlib-gtest-all.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_client_linux_linux_client_unittest_shlib-gtest-all.obj `if test -f 'src/testing/gtest/src/gtest-all.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest-all.cc'; fi`
-
-src/testing/gtest/src/src_client_linux_linux_client_unittest_shlib-gtest_main.o: src/testing/gtest/src/gtest_main.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_client_linux_linux_client_unittest_shlib-gtest_main.o -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-gtest_main.Tpo -c -o src/testing/gtest/src/src_client_linux_linux_client_unittest_shlib-gtest_main.o `test -f 'src/testing/gtest/src/gtest_main.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest_main.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-gtest_main.Tpo src/testing/gtest/src/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-gtest_main.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest_main.cc' object='src/testing/gtest/src/src_client_linux_linux_client_unittest_shlib-gtest_main.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_client_linux_linux_client_unittest_shlib-gtest_main.o `test -f 'src/testing/gtest/src/gtest_main.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest_main.cc
-
-src/testing/gtest/src/src_client_linux_linux_client_unittest_shlib-gtest_main.obj: src/testing/gtest/src/gtest_main.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_client_linux_linux_client_unittest_shlib-gtest_main.obj -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-gtest_main.Tpo -c -o src/testing/gtest/src/src_client_linux_linux_client_unittest_shlib-gtest_main.obj `if test -f 'src/testing/gtest/src/gtest_main.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest_main.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest_main.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-gtest_main.Tpo src/testing/gtest/src/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-gtest_main.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest_main.cc' object='src/testing/gtest/src/src_client_linux_linux_client_unittest_shlib-gtest_main.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_client_linux_linux_client_unittest_shlib-gtest_main.obj `if test -f 'src/testing/gtest/src/gtest_main.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest_main.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest_main.cc'; fi`
-
-src/testing/src/src_client_linux_linux_client_unittest_shlib-gmock-all.o: src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/src/src_client_linux_linux_client_unittest_shlib-gmock-all.o -MD -MP -MF src/testing/src/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-gmock-all.Tpo -c -o src/testing/src/src_client_linux_linux_client_unittest_shlib-gmock-all.o `test -f 'src/testing/src/gmock-all.cc' || echo '$(srcdir)/'`src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/src/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-gmock-all.Tpo src/testing/src/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-gmock-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/src/gmock-all.cc' object='src/testing/src/src_client_linux_linux_client_unittest_shlib-gmock-all.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/src/src_client_linux_linux_client_unittest_shlib-gmock-all.o `test -f 'src/testing/src/gmock-all.cc' || echo '$(srcdir)/'`src/testing/src/gmock-all.cc
-
-src/testing/src/src_client_linux_linux_client_unittest_shlib-gmock-all.obj: src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/src/src_client_linux_linux_client_unittest_shlib-gmock-all.obj -MD -MP -MF src/testing/src/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-gmock-all.Tpo -c -o src/testing/src/src_client_linux_linux_client_unittest_shlib-gmock-all.obj `if test -f 'src/testing/src/gmock-all.cc'; then $(CYGPATH_W) 'src/testing/src/gmock-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/src/gmock-all.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/src/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-gmock-all.Tpo src/testing/src/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-gmock-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/src/gmock-all.cc' object='src/testing/src/src_client_linux_linux_client_unittest_shlib-gmock-all.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/src/src_client_linux_linux_client_unittest_shlib-gmock-all.obj `if test -f 'src/testing/src/gmock-all.cc'; then $(CYGPATH_W) 'src/testing/src/gmock-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/src/gmock-all.cc'; fi`
-
src/processor/src_client_linux_linux_client_unittest_shlib-basic_code_modules.o: src/processor/basic_code_modules.cc
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_client_linux_linux_client_unittest_shlib-basic_code_modules.o -MD -MP -MF src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-basic_code_modules.Tpo -c -o src/processor/src_client_linux_linux_client_unittest_shlib-basic_code_modules.o `test -f 'src/processor/basic_code_modules.cc' || echo '$(srcdir)/'`src/processor/basic_code_modules.cc
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-basic_code_modules.Tpo src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-basic_code_modules.Po
@@ -4955,6 +5511,20 @@ src/processor/src_client_linux_linux_client_unittest_shlib-basic_code_modules.ob
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_client_linux_linux_client_unittest_shlib-basic_code_modules.obj `if test -f 'src/processor/basic_code_modules.cc'; then $(CYGPATH_W) 'src/processor/basic_code_modules.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/basic_code_modules.cc'; fi`
+src/processor/src_client_linux_linux_client_unittest_shlib-convert_old_arm64_context.o: src/processor/convert_old_arm64_context.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_client_linux_linux_client_unittest_shlib-convert_old_arm64_context.o -MD -MP -MF src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-convert_old_arm64_context.Tpo -c -o src/processor/src_client_linux_linux_client_unittest_shlib-convert_old_arm64_context.o `test -f 'src/processor/convert_old_arm64_context.cc' || echo '$(srcdir)/'`src/processor/convert_old_arm64_context.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-convert_old_arm64_context.Tpo src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-convert_old_arm64_context.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/convert_old_arm64_context.cc' object='src/processor/src_client_linux_linux_client_unittest_shlib-convert_old_arm64_context.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_client_linux_linux_client_unittest_shlib-convert_old_arm64_context.o `test -f 'src/processor/convert_old_arm64_context.cc' || echo '$(srcdir)/'`src/processor/convert_old_arm64_context.cc
+
+src/processor/src_client_linux_linux_client_unittest_shlib-convert_old_arm64_context.obj: src/processor/convert_old_arm64_context.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_client_linux_linux_client_unittest_shlib-convert_old_arm64_context.obj -MD -MP -MF src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-convert_old_arm64_context.Tpo -c -o src/processor/src_client_linux_linux_client_unittest_shlib-convert_old_arm64_context.obj `if test -f 'src/processor/convert_old_arm64_context.cc'; then $(CYGPATH_W) 'src/processor/convert_old_arm64_context.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/convert_old_arm64_context.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-convert_old_arm64_context.Tpo src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-convert_old_arm64_context.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/convert_old_arm64_context.cc' object='src/processor/src_client_linux_linux_client_unittest_shlib-convert_old_arm64_context.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_client_linux_linux_client_unittest_shlib-convert_old_arm64_context.obj `if test -f 'src/processor/convert_old_arm64_context.cc'; then $(CYGPATH_W) 'src/processor/convert_old_arm64_context.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/convert_old_arm64_context.cc'; fi`
+
src/processor/src_client_linux_linux_client_unittest_shlib-dump_context.o: src/processor/dump_context.cc
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_client_linux_linux_client_unittest_shlib-dump_context.o -MD -MP -MF src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-dump_context.Tpo -c -o src/processor/src_client_linux_linux_client_unittest_shlib-dump_context.o `test -f 'src/processor/dump_context.cc' || echo '$(srcdir)/'`src/processor/dump_context.cc
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-dump_context.Tpo src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-dump_context.Po
@@ -5025,33 +5595,33 @@ src/processor/src_client_linux_linux_client_unittest_shlib-pathname_stripper.obj
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_client_linux_linux_client_unittest_shlib-pathname_stripper.obj `if test -f 'src/processor/pathname_stripper.cc'; then $(CYGPATH_W) 'src/processor/pathname_stripper.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/pathname_stripper.cc'; fi`
-src/client/linux/microdump_writer/src_client_linux_linux_client_unittest_shlib-microdump_writer_unittest.o: src/client/linux/microdump_writer/microdump_writer_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/client/linux/microdump_writer/src_client_linux_linux_client_unittest_shlib-microdump_writer_unittest.o -MD -MP -MF src/client/linux/microdump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-microdump_writer_unittest.Tpo -c -o src/client/linux/microdump_writer/src_client_linux_linux_client_unittest_shlib-microdump_writer_unittest.o `test -f 'src/client/linux/microdump_writer/microdump_writer_unittest.cc' || echo '$(srcdir)/'`src/client/linux/microdump_writer/microdump_writer_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/client/linux/microdump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-microdump_writer_unittest.Tpo src/client/linux/microdump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-microdump_writer_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/client/linux/microdump_writer/microdump_writer_unittest.cc' object='src/client/linux/microdump_writer/src_client_linux_linux_client_unittest_shlib-microdump_writer_unittest.o' libtool=no @AMDEPBACKSLASH@
+src/processor/src_client_linux_linux_client_unittest_shlib-proc_maps_linux.o: src/processor/proc_maps_linux.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_client_linux_linux_client_unittest_shlib-proc_maps_linux.o -MD -MP -MF src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-proc_maps_linux.Tpo -c -o src/processor/src_client_linux_linux_client_unittest_shlib-proc_maps_linux.o `test -f 'src/processor/proc_maps_linux.cc' || echo '$(srcdir)/'`src/processor/proc_maps_linux.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-proc_maps_linux.Tpo src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-proc_maps_linux.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/proc_maps_linux.cc' object='src/processor/src_client_linux_linux_client_unittest_shlib-proc_maps_linux.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/client/linux/microdump_writer/src_client_linux_linux_client_unittest_shlib-microdump_writer_unittest.o `test -f 'src/client/linux/microdump_writer/microdump_writer_unittest.cc' || echo '$(srcdir)/'`src/client/linux/microdump_writer/microdump_writer_unittest.cc
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_client_linux_linux_client_unittest_shlib-proc_maps_linux.o `test -f 'src/processor/proc_maps_linux.cc' || echo '$(srcdir)/'`src/processor/proc_maps_linux.cc
-src/client/linux/microdump_writer/src_client_linux_linux_client_unittest_shlib-microdump_writer_unittest.obj: src/client/linux/microdump_writer/microdump_writer_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/client/linux/microdump_writer/src_client_linux_linux_client_unittest_shlib-microdump_writer_unittest.obj -MD -MP -MF src/client/linux/microdump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-microdump_writer_unittest.Tpo -c -o src/client/linux/microdump_writer/src_client_linux_linux_client_unittest_shlib-microdump_writer_unittest.obj `if test -f 'src/client/linux/microdump_writer/microdump_writer_unittest.cc'; then $(CYGPATH_W) 'src/client/linux/microdump_writer/microdump_writer_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/client/linux/microdump_writer/microdump_writer_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/client/linux/microdump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-microdump_writer_unittest.Tpo src/client/linux/microdump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-microdump_writer_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/client/linux/microdump_writer/microdump_writer_unittest.cc' object='src/client/linux/microdump_writer/src_client_linux_linux_client_unittest_shlib-microdump_writer_unittest.obj' libtool=no @AMDEPBACKSLASH@
+src/processor/src_client_linux_linux_client_unittest_shlib-proc_maps_linux.obj: src/processor/proc_maps_linux.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_client_linux_linux_client_unittest_shlib-proc_maps_linux.obj -MD -MP -MF src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-proc_maps_linux.Tpo -c -o src/processor/src_client_linux_linux_client_unittest_shlib-proc_maps_linux.obj `if test -f 'src/processor/proc_maps_linux.cc'; then $(CYGPATH_W) 'src/processor/proc_maps_linux.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/proc_maps_linux.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-proc_maps_linux.Tpo src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-proc_maps_linux.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/proc_maps_linux.cc' object='src/processor/src_client_linux_linux_client_unittest_shlib-proc_maps_linux.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/client/linux/microdump_writer/src_client_linux_linux_client_unittest_shlib-microdump_writer_unittest.obj `if test -f 'src/client/linux/microdump_writer/microdump_writer_unittest.cc'; then $(CYGPATH_W) 'src/client/linux/microdump_writer/microdump_writer_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/client/linux/microdump_writer/microdump_writer_unittest.cc'; fi`
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_client_linux_linux_client_unittest_shlib-proc_maps_linux.obj `if test -f 'src/processor/proc_maps_linux.cc'; then $(CYGPATH_W) 'src/processor/proc_maps_linux.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/proc_maps_linux.cc'; fi`
-src/common/android/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.o: src/common/android/breakpad_getcontext_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/android/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.o -MD -MP -MF src/common/android/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.Tpo -c -o src/common/android/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.o `test -f 'src/common/android/breakpad_getcontext_unittest.cc' || echo '$(srcdir)/'`src/common/android/breakpad_getcontext_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/android/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.Tpo src/common/android/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/android/breakpad_getcontext_unittest.cc' object='src/common/android/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.o' libtool=no @AMDEPBACKSLASH@
+src/common/linux/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.o: src/common/linux/breakpad_getcontext_unittest.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.o -MD -MP -MF src/common/linux/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.Tpo -c -o src/common/linux/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.o `test -f 'src/common/linux/breakpad_getcontext_unittest.cc' || echo '$(srcdir)/'`src/common/linux/breakpad_getcontext_unittest.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.Tpo src/common/linux/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/breakpad_getcontext_unittest.cc' object='src/common/linux/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/android/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.o `test -f 'src/common/android/breakpad_getcontext_unittest.cc' || echo '$(srcdir)/'`src/common/android/breakpad_getcontext_unittest.cc
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.o `test -f 'src/common/linux/breakpad_getcontext_unittest.cc' || echo '$(srcdir)/'`src/common/linux/breakpad_getcontext_unittest.cc
-src/common/android/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.obj: src/common/android/breakpad_getcontext_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/android/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.obj -MD -MP -MF src/common/android/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.Tpo -c -o src/common/android/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.obj `if test -f 'src/common/android/breakpad_getcontext_unittest.cc'; then $(CYGPATH_W) 'src/common/android/breakpad_getcontext_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/android/breakpad_getcontext_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/android/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.Tpo src/common/android/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/android/breakpad_getcontext_unittest.cc' object='src/common/android/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.obj' libtool=no @AMDEPBACKSLASH@
+src/common/linux/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.obj: src/common/linux/breakpad_getcontext_unittest.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.obj -MD -MP -MF src/common/linux/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.Tpo -c -o src/common/linux/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.obj `if test -f 'src/common/linux/breakpad_getcontext_unittest.cc'; then $(CYGPATH_W) 'src/common/linux/breakpad_getcontext_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/breakpad_getcontext_unittest.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.Tpo src/common/linux/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/breakpad_getcontext_unittest.cc' object='src/common/linux/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/android/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.obj `if test -f 'src/common/android/breakpad_getcontext_unittest.cc'; then $(CYGPATH_W) 'src/common/android/breakpad_getcontext_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/android/breakpad_getcontext_unittest.cc'; fi`
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.obj `if test -f 'src/common/linux/breakpad_getcontext_unittest.cc'; then $(CYGPATH_W) 'src/common/linux/breakpad_getcontext_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/breakpad_getcontext_unittest.cc'; fi`
src/client/linux/minidump_writer/src_client_linux_linux_dumper_unittest_helper-linux_dumper_unittest_helper.o: src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_client_linux_linux_dumper_unittest_helper_CXXFLAGS) $(CXXFLAGS) -MT src/client/linux/minidump_writer/src_client_linux_linux_dumper_unittest_helper-linux_dumper_unittest_helper.o -MD -MP -MF src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_dumper_unittest_helper-linux_dumper_unittest_helper.Tpo -c -o src/client/linux/minidump_writer/src_client_linux_linux_dumper_unittest_helper-linux_dumper_unittest_helper.o `test -f 'src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc' || echo '$(srcdir)/'`src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc
@@ -5081,6 +5651,20 @@ src/common/src_common_dumper_unittest-byte_cursor_unittest.obj: src/common/byte_
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_dumper_unittest-byte_cursor_unittest.obj `if test -f 'src/common/byte_cursor_unittest.cc'; then $(CYGPATH_W) 'src/common/byte_cursor_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/byte_cursor_unittest.cc'; fi`
+src/common/src_common_dumper_unittest-convert_UTF.o: src/common/convert_UTF.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_dumper_unittest-convert_UTF.o -MD -MP -MF src/common/$(DEPDIR)/src_common_dumper_unittest-convert_UTF.Tpo -c -o src/common/src_common_dumper_unittest-convert_UTF.o `test -f 'src/common/convert_UTF.cc' || echo '$(srcdir)/'`src/common/convert_UTF.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_dumper_unittest-convert_UTF.Tpo src/common/$(DEPDIR)/src_common_dumper_unittest-convert_UTF.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/convert_UTF.cc' object='src/common/src_common_dumper_unittest-convert_UTF.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_dumper_unittest-convert_UTF.o `test -f 'src/common/convert_UTF.cc' || echo '$(srcdir)/'`src/common/convert_UTF.cc
+
+src/common/src_common_dumper_unittest-convert_UTF.obj: src/common/convert_UTF.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_dumper_unittest-convert_UTF.obj -MD -MP -MF src/common/$(DEPDIR)/src_common_dumper_unittest-convert_UTF.Tpo -c -o src/common/src_common_dumper_unittest-convert_UTF.obj `if test -f 'src/common/convert_UTF.cc'; then $(CYGPATH_W) 'src/common/convert_UTF.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/convert_UTF.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_dumper_unittest-convert_UTF.Tpo src/common/$(DEPDIR)/src_common_dumper_unittest-convert_UTF.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/convert_UTF.cc' object='src/common/src_common_dumper_unittest-convert_UTF.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_dumper_unittest-convert_UTF.obj `if test -f 'src/common/convert_UTF.cc'; then $(CYGPATH_W) 'src/common/convert_UTF.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/convert_UTF.cc'; fi`
+
src/common/src_common_dumper_unittest-dwarf_cfi_to_module.o: src/common/dwarf_cfi_to_module.cc
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_dumper_unittest-dwarf_cfi_to_module.o -MD -MP -MF src/common/$(DEPDIR)/src_common_dumper_unittest-dwarf_cfi_to_module.Tpo -c -o src/common/src_common_dumper_unittest-dwarf_cfi_to_module.o `test -f 'src/common/dwarf_cfi_to_module.cc' || echo '$(srcdir)/'`src/common/dwarf_cfi_to_module.cc
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_dumper_unittest-dwarf_cfi_to_module.Tpo src/common/$(DEPDIR)/src_common_dumper_unittest-dwarf_cfi_to_module.Po
@@ -5165,6 +5749,20 @@ src/common/src_common_dumper_unittest-dwarf_line_to_module_unittest.obj: src/com
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_dumper_unittest-dwarf_line_to_module_unittest.obj `if test -f 'src/common/dwarf_line_to_module_unittest.cc'; then $(CYGPATH_W) 'src/common/dwarf_line_to_module_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf_line_to_module_unittest.cc'; fi`
+src/common/src_common_dumper_unittest-dwarf_range_list_handler.o: src/common/dwarf_range_list_handler.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_dumper_unittest-dwarf_range_list_handler.o -MD -MP -MF src/common/$(DEPDIR)/src_common_dumper_unittest-dwarf_range_list_handler.Tpo -c -o src/common/src_common_dumper_unittest-dwarf_range_list_handler.o `test -f 'src/common/dwarf_range_list_handler.cc' || echo '$(srcdir)/'`src/common/dwarf_range_list_handler.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_dumper_unittest-dwarf_range_list_handler.Tpo src/common/$(DEPDIR)/src_common_dumper_unittest-dwarf_range_list_handler.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf_range_list_handler.cc' object='src/common/src_common_dumper_unittest-dwarf_range_list_handler.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_dumper_unittest-dwarf_range_list_handler.o `test -f 'src/common/dwarf_range_list_handler.cc' || echo '$(srcdir)/'`src/common/dwarf_range_list_handler.cc
+
+src/common/src_common_dumper_unittest-dwarf_range_list_handler.obj: src/common/dwarf_range_list_handler.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_dumper_unittest-dwarf_range_list_handler.obj -MD -MP -MF src/common/$(DEPDIR)/src_common_dumper_unittest-dwarf_range_list_handler.Tpo -c -o src/common/src_common_dumper_unittest-dwarf_range_list_handler.obj `if test -f 'src/common/dwarf_range_list_handler.cc'; then $(CYGPATH_W) 'src/common/dwarf_range_list_handler.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf_range_list_handler.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_dumper_unittest-dwarf_range_list_handler.Tpo src/common/$(DEPDIR)/src_common_dumper_unittest-dwarf_range_list_handler.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf_range_list_handler.cc' object='src/common/src_common_dumper_unittest-dwarf_range_list_handler.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_dumper_unittest-dwarf_range_list_handler.obj `if test -f 'src/common/dwarf_range_list_handler.cc'; then $(CYGPATH_W) 'src/common/dwarf_range_list_handler.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf_range_list_handler.cc'; fi`
+
src/common/src_common_dumper_unittest-language.o: src/common/language.cc
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_dumper_unittest-language.o -MD -MP -MF src/common/$(DEPDIR)/src_common_dumper_unittest-language.Tpo -c -o src/common/src_common_dumper_unittest-language.o `test -f 'src/common/language.cc' || echo '$(srcdir)/'`src/common/language.cc
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_dumper_unittest-language.Tpo src/common/$(DEPDIR)/src_common_dumper_unittest-language.Po
@@ -5221,6 +5819,20 @@ src/common/src_common_dumper_unittest-module_unittest.obj: src/common/module_uni
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_dumper_unittest-module_unittest.obj `if test -f 'src/common/module_unittest.cc'; then $(CYGPATH_W) 'src/common/module_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/module_unittest.cc'; fi`
+src/common/src_common_dumper_unittest-path_helper.o: src/common/path_helper.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_dumper_unittest-path_helper.o -MD -MP -MF src/common/$(DEPDIR)/src_common_dumper_unittest-path_helper.Tpo -c -o src/common/src_common_dumper_unittest-path_helper.o `test -f 'src/common/path_helper.cc' || echo '$(srcdir)/'`src/common/path_helper.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_dumper_unittest-path_helper.Tpo src/common/$(DEPDIR)/src_common_dumper_unittest-path_helper.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/path_helper.cc' object='src/common/src_common_dumper_unittest-path_helper.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_dumper_unittest-path_helper.o `test -f 'src/common/path_helper.cc' || echo '$(srcdir)/'`src/common/path_helper.cc
+
+src/common/src_common_dumper_unittest-path_helper.obj: src/common/path_helper.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_dumper_unittest-path_helper.obj -MD -MP -MF src/common/$(DEPDIR)/src_common_dumper_unittest-path_helper.Tpo -c -o src/common/src_common_dumper_unittest-path_helper.obj `if test -f 'src/common/path_helper.cc'; then $(CYGPATH_W) 'src/common/path_helper.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/path_helper.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_dumper_unittest-path_helper.Tpo src/common/$(DEPDIR)/src_common_dumper_unittest-path_helper.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/path_helper.cc' object='src/common/src_common_dumper_unittest-path_helper.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_dumper_unittest-path_helper.obj `if test -f 'src/common/path_helper.cc'; then $(CYGPATH_W) 'src/common/path_helper.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/path_helper.cc'; fi`
+
src/common/src_common_dumper_unittest-stabs_reader.o: src/common/stabs_reader.cc
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_dumper_unittest-stabs_reader.o -MD -MP -MF src/common/$(DEPDIR)/src_common_dumper_unittest-stabs_reader.Tpo -c -o src/common/src_common_dumper_unittest-stabs_reader.o `test -f 'src/common/stabs_reader.cc' || echo '$(srcdir)/'`src/common/stabs_reader.cc
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_dumper_unittest-stabs_reader.Tpo src/common/$(DEPDIR)/src_common_dumper_unittest-stabs_reader.Po
@@ -5277,6 +5889,34 @@ src/common/src_common_dumper_unittest-stabs_to_module_unittest.obj: src/common/s
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_dumper_unittest-stabs_to_module_unittest.obj `if test -f 'src/common/stabs_to_module_unittest.cc'; then $(CYGPATH_W) 'src/common/stabs_to_module_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/stabs_to_module_unittest.cc'; fi`
+src/common/src_common_dumper_unittest-string_conversion.o: src/common/string_conversion.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_dumper_unittest-string_conversion.o -MD -MP -MF src/common/$(DEPDIR)/src_common_dumper_unittest-string_conversion.Tpo -c -o src/common/src_common_dumper_unittest-string_conversion.o `test -f 'src/common/string_conversion.cc' || echo '$(srcdir)/'`src/common/string_conversion.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_dumper_unittest-string_conversion.Tpo src/common/$(DEPDIR)/src_common_dumper_unittest-string_conversion.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/string_conversion.cc' object='src/common/src_common_dumper_unittest-string_conversion.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_dumper_unittest-string_conversion.o `test -f 'src/common/string_conversion.cc' || echo '$(srcdir)/'`src/common/string_conversion.cc
+
+src/common/src_common_dumper_unittest-string_conversion.obj: src/common/string_conversion.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_dumper_unittest-string_conversion.obj -MD -MP -MF src/common/$(DEPDIR)/src_common_dumper_unittest-string_conversion.Tpo -c -o src/common/src_common_dumper_unittest-string_conversion.obj `if test -f 'src/common/string_conversion.cc'; then $(CYGPATH_W) 'src/common/string_conversion.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/string_conversion.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_dumper_unittest-string_conversion.Tpo src/common/$(DEPDIR)/src_common_dumper_unittest-string_conversion.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/string_conversion.cc' object='src/common/src_common_dumper_unittest-string_conversion.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_dumper_unittest-string_conversion.obj `if test -f 'src/common/string_conversion.cc'; then $(CYGPATH_W) 'src/common/string_conversion.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/string_conversion.cc'; fi`
+
+src/common/src_common_dumper_unittest-string_conversion_unittest.o: src/common/string_conversion_unittest.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_dumper_unittest-string_conversion_unittest.o -MD -MP -MF src/common/$(DEPDIR)/src_common_dumper_unittest-string_conversion_unittest.Tpo -c -o src/common/src_common_dumper_unittest-string_conversion_unittest.o `test -f 'src/common/string_conversion_unittest.cc' || echo '$(srcdir)/'`src/common/string_conversion_unittest.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_dumper_unittest-string_conversion_unittest.Tpo src/common/$(DEPDIR)/src_common_dumper_unittest-string_conversion_unittest.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/string_conversion_unittest.cc' object='src/common/src_common_dumper_unittest-string_conversion_unittest.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_dumper_unittest-string_conversion_unittest.o `test -f 'src/common/string_conversion_unittest.cc' || echo '$(srcdir)/'`src/common/string_conversion_unittest.cc
+
+src/common/src_common_dumper_unittest-string_conversion_unittest.obj: src/common/string_conversion_unittest.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_dumper_unittest-string_conversion_unittest.obj -MD -MP -MF src/common/$(DEPDIR)/src_common_dumper_unittest-string_conversion_unittest.Tpo -c -o src/common/src_common_dumper_unittest-string_conversion_unittest.obj `if test -f 'src/common/string_conversion_unittest.cc'; then $(CYGPATH_W) 'src/common/string_conversion_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/string_conversion_unittest.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_dumper_unittest-string_conversion_unittest.Tpo src/common/$(DEPDIR)/src_common_dumper_unittest-string_conversion_unittest.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/string_conversion_unittest.cc' object='src/common/src_common_dumper_unittest-string_conversion_unittest.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_dumper_unittest-string_conversion_unittest.obj `if test -f 'src/common/string_conversion_unittest.cc'; then $(CYGPATH_W) 'src/common/string_conversion_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/string_conversion_unittest.cc'; fi`
+
src/common/src_common_dumper_unittest-test_assembler.o: src/common/test_assembler.cc
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_dumper_unittest-test_assembler.o -MD -MP -MF src/common/$(DEPDIR)/src_common_dumper_unittest-test_assembler.Tpo -c -o src/common/src_common_dumper_unittest-test_assembler.o `test -f 'src/common/test_assembler.cc' || echo '$(srcdir)/'`src/common/test_assembler.cc
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_dumper_unittest-test_assembler.Tpo src/common/$(DEPDIR)/src_common_dumper_unittest-test_assembler.Po
@@ -5375,6 +6015,20 @@ src/common/dwarf/src_common_dumper_unittest-dwarf2reader.obj: src/common/dwarf/d
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/dwarf/src_common_dumper_unittest-dwarf2reader.obj `if test -f 'src/common/dwarf/dwarf2reader.cc'; then $(CYGPATH_W) 'src/common/dwarf/dwarf2reader.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf/dwarf2reader.cc'; fi`
+src/common/dwarf/src_common_dumper_unittest-elf_reader.o: src/common/dwarf/elf_reader.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/dwarf/src_common_dumper_unittest-elf_reader.o -MD -MP -MF src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-elf_reader.Tpo -c -o src/common/dwarf/src_common_dumper_unittest-elf_reader.o `test -f 'src/common/dwarf/elf_reader.cc' || echo '$(srcdir)/'`src/common/dwarf/elf_reader.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-elf_reader.Tpo src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-elf_reader.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf/elf_reader.cc' object='src/common/dwarf/src_common_dumper_unittest-elf_reader.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/dwarf/src_common_dumper_unittest-elf_reader.o `test -f 'src/common/dwarf/elf_reader.cc' || echo '$(srcdir)/'`src/common/dwarf/elf_reader.cc
+
+src/common/dwarf/src_common_dumper_unittest-elf_reader.obj: src/common/dwarf/elf_reader.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/dwarf/src_common_dumper_unittest-elf_reader.obj -MD -MP -MF src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-elf_reader.Tpo -c -o src/common/dwarf/src_common_dumper_unittest-elf_reader.obj `if test -f 'src/common/dwarf/elf_reader.cc'; then $(CYGPATH_W) 'src/common/dwarf/elf_reader.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf/elf_reader.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-elf_reader.Tpo src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-elf_reader.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf/elf_reader.cc' object='src/common/dwarf/src_common_dumper_unittest-elf_reader.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/dwarf/src_common_dumper_unittest-elf_reader.obj `if test -f 'src/common/dwarf/elf_reader.cc'; then $(CYGPATH_W) 'src/common/dwarf/elf_reader.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf/elf_reader.cc'; fi`
+
src/common/dwarf/src_common_dumper_unittest-dwarf2reader_cfi_unittest.o: src/common/dwarf/dwarf2reader_cfi_unittest.cc
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/dwarf/src_common_dumper_unittest-dwarf2reader_cfi_unittest.o -MD -MP -MF src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-dwarf2reader_cfi_unittest.Tpo -c -o src/common/dwarf/src_common_dumper_unittest-dwarf2reader_cfi_unittest.o `test -f 'src/common/dwarf/dwarf2reader_cfi_unittest.cc' || echo '$(srcdir)/'`src/common/dwarf/dwarf2reader_cfi_unittest.cc
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-dwarf2reader_cfi_unittest.Tpo src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-dwarf2reader_cfi_unittest.Po
@@ -5669,369 +6323,453 @@ src/common/tests/src_common_dumper_unittest-file_utils.obj: src/common/tests/fil
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/tests/src_common_dumper_unittest-file_utils.obj `if test -f 'src/common/tests/file_utils.cc'; then $(CYGPATH_W) 'src/common/tests/file_utils.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/tests/file_utils.cc'; fi`
-src/testing/gtest/src/src_common_dumper_unittest-gtest-all.o: src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_common_dumper_unittest-gtest-all.o -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_common_dumper_unittest-gtest-all.Tpo -c -o src/testing/gtest/src/src_common_dumper_unittest-gtest-all.o `test -f 'src/testing/gtest/src/gtest-all.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_common_dumper_unittest-gtest-all.Tpo src/testing/gtest/src/$(DEPDIR)/src_common_dumper_unittest-gtest-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest-all.cc' object='src/testing/gtest/src/src_common_dumper_unittest-gtest-all.o' libtool=no @AMDEPBACKSLASH@
+src/common/linux/src_common_linux_google_crashdump_uploader_test-google_crashdump_uploader.o: src/common/linux/google_crashdump_uploader.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_linux_google_crashdump_uploader_test_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/src_common_linux_google_crashdump_uploader_test-google_crashdump_uploader.o -MD -MP -MF src/common/linux/$(DEPDIR)/src_common_linux_google_crashdump_uploader_test-google_crashdump_uploader.Tpo -c -o src/common/linux/src_common_linux_google_crashdump_uploader_test-google_crashdump_uploader.o `test -f 'src/common/linux/google_crashdump_uploader.cc' || echo '$(srcdir)/'`src/common/linux/google_crashdump_uploader.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/src_common_linux_google_crashdump_uploader_test-google_crashdump_uploader.Tpo src/common/linux/$(DEPDIR)/src_common_linux_google_crashdump_uploader_test-google_crashdump_uploader.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/google_crashdump_uploader.cc' object='src/common/linux/src_common_linux_google_crashdump_uploader_test-google_crashdump_uploader.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_common_dumper_unittest-gtest-all.o `test -f 'src/testing/gtest/src/gtest-all.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest-all.cc
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_linux_google_crashdump_uploader_test_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/src_common_linux_google_crashdump_uploader_test-google_crashdump_uploader.o `test -f 'src/common/linux/google_crashdump_uploader.cc' || echo '$(srcdir)/'`src/common/linux/google_crashdump_uploader.cc
-src/testing/gtest/src/src_common_dumper_unittest-gtest-all.obj: src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_common_dumper_unittest-gtest-all.obj -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_common_dumper_unittest-gtest-all.Tpo -c -o src/testing/gtest/src/src_common_dumper_unittest-gtest-all.obj `if test -f 'src/testing/gtest/src/gtest-all.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest-all.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_common_dumper_unittest-gtest-all.Tpo src/testing/gtest/src/$(DEPDIR)/src_common_dumper_unittest-gtest-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest-all.cc' object='src/testing/gtest/src/src_common_dumper_unittest-gtest-all.obj' libtool=no @AMDEPBACKSLASH@
+src/common/linux/src_common_linux_google_crashdump_uploader_test-google_crashdump_uploader.obj: src/common/linux/google_crashdump_uploader.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_linux_google_crashdump_uploader_test_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/src_common_linux_google_crashdump_uploader_test-google_crashdump_uploader.obj -MD -MP -MF src/common/linux/$(DEPDIR)/src_common_linux_google_crashdump_uploader_test-google_crashdump_uploader.Tpo -c -o src/common/linux/src_common_linux_google_crashdump_uploader_test-google_crashdump_uploader.obj `if test -f 'src/common/linux/google_crashdump_uploader.cc'; then $(CYGPATH_W) 'src/common/linux/google_crashdump_uploader.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/google_crashdump_uploader.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/src_common_linux_google_crashdump_uploader_test-google_crashdump_uploader.Tpo src/common/linux/$(DEPDIR)/src_common_linux_google_crashdump_uploader_test-google_crashdump_uploader.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/google_crashdump_uploader.cc' object='src/common/linux/src_common_linux_google_crashdump_uploader_test-google_crashdump_uploader.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_common_dumper_unittest-gtest-all.obj `if test -f 'src/testing/gtest/src/gtest-all.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest-all.cc'; fi`
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_linux_google_crashdump_uploader_test_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/src_common_linux_google_crashdump_uploader_test-google_crashdump_uploader.obj `if test -f 'src/common/linux/google_crashdump_uploader.cc'; then $(CYGPATH_W) 'src/common/linux/google_crashdump_uploader.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/google_crashdump_uploader.cc'; fi`
-src/testing/gtest/src/src_common_dumper_unittest-gtest_main.o: src/testing/gtest/src/gtest_main.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_common_dumper_unittest-gtest_main.o -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_common_dumper_unittest-gtest_main.Tpo -c -o src/testing/gtest/src/src_common_dumper_unittest-gtest_main.o `test -f 'src/testing/gtest/src/gtest_main.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest_main.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_common_dumper_unittest-gtest_main.Tpo src/testing/gtest/src/$(DEPDIR)/src_common_dumper_unittest-gtest_main.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest_main.cc' object='src/testing/gtest/src/src_common_dumper_unittest-gtest_main.o' libtool=no @AMDEPBACKSLASH@
+src/common/linux/src_common_linux_google_crashdump_uploader_test-google_crashdump_uploader_test.o: src/common/linux/google_crashdump_uploader_test.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_linux_google_crashdump_uploader_test_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/src_common_linux_google_crashdump_uploader_test-google_crashdump_uploader_test.o -MD -MP -MF src/common/linux/$(DEPDIR)/src_common_linux_google_crashdump_uploader_test-google_crashdump_uploader_test.Tpo -c -o src/common/linux/src_common_linux_google_crashdump_uploader_test-google_crashdump_uploader_test.o `test -f 'src/common/linux/google_crashdump_uploader_test.cc' || echo '$(srcdir)/'`src/common/linux/google_crashdump_uploader_test.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/src_common_linux_google_crashdump_uploader_test-google_crashdump_uploader_test.Tpo src/common/linux/$(DEPDIR)/src_common_linux_google_crashdump_uploader_test-google_crashdump_uploader_test.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/google_crashdump_uploader_test.cc' object='src/common/linux/src_common_linux_google_crashdump_uploader_test-google_crashdump_uploader_test.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_common_dumper_unittest-gtest_main.o `test -f 'src/testing/gtest/src/gtest_main.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest_main.cc
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_linux_google_crashdump_uploader_test_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/src_common_linux_google_crashdump_uploader_test-google_crashdump_uploader_test.o `test -f 'src/common/linux/google_crashdump_uploader_test.cc' || echo '$(srcdir)/'`src/common/linux/google_crashdump_uploader_test.cc
-src/testing/gtest/src/src_common_dumper_unittest-gtest_main.obj: src/testing/gtest/src/gtest_main.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_common_dumper_unittest-gtest_main.obj -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_common_dumper_unittest-gtest_main.Tpo -c -o src/testing/gtest/src/src_common_dumper_unittest-gtest_main.obj `if test -f 'src/testing/gtest/src/gtest_main.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest_main.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest_main.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_common_dumper_unittest-gtest_main.Tpo src/testing/gtest/src/$(DEPDIR)/src_common_dumper_unittest-gtest_main.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest_main.cc' object='src/testing/gtest/src/src_common_dumper_unittest-gtest_main.obj' libtool=no @AMDEPBACKSLASH@
+src/common/linux/src_common_linux_google_crashdump_uploader_test-google_crashdump_uploader_test.obj: src/common/linux/google_crashdump_uploader_test.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_linux_google_crashdump_uploader_test_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/src_common_linux_google_crashdump_uploader_test-google_crashdump_uploader_test.obj -MD -MP -MF src/common/linux/$(DEPDIR)/src_common_linux_google_crashdump_uploader_test-google_crashdump_uploader_test.Tpo -c -o src/common/linux/src_common_linux_google_crashdump_uploader_test-google_crashdump_uploader_test.obj `if test -f 'src/common/linux/google_crashdump_uploader_test.cc'; then $(CYGPATH_W) 'src/common/linux/google_crashdump_uploader_test.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/google_crashdump_uploader_test.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/src_common_linux_google_crashdump_uploader_test-google_crashdump_uploader_test.Tpo src/common/linux/$(DEPDIR)/src_common_linux_google_crashdump_uploader_test-google_crashdump_uploader_test.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/google_crashdump_uploader_test.cc' object='src/common/linux/src_common_linux_google_crashdump_uploader_test-google_crashdump_uploader_test.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_common_dumper_unittest-gtest_main.obj `if test -f 'src/testing/gtest/src/gtest_main.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest_main.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest_main.cc'; fi`
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_linux_google_crashdump_uploader_test_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/src_common_linux_google_crashdump_uploader_test-google_crashdump_uploader_test.obj `if test -f 'src/common/linux/google_crashdump_uploader_test.cc'; then $(CYGPATH_W) 'src/common/linux/google_crashdump_uploader_test.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/google_crashdump_uploader_test.cc'; fi`
-src/testing/src/src_common_dumper_unittest-gmock-all.o: src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/src/src_common_dumper_unittest-gmock-all.o -MD -MP -MF src/testing/src/$(DEPDIR)/src_common_dumper_unittest-gmock-all.Tpo -c -o src/testing/src/src_common_dumper_unittest-gmock-all.o `test -f 'src/testing/src/gmock-all.cc' || echo '$(srcdir)/'`src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/src/$(DEPDIR)/src_common_dumper_unittest-gmock-all.Tpo src/testing/src/$(DEPDIR)/src_common_dumper_unittest-gmock-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/src/gmock-all.cc' object='src/testing/src/src_common_dumper_unittest-gmock-all.o' libtool=no @AMDEPBACKSLASH@
+src/common/linux/src_common_linux_google_crashdump_uploader_test-libcurl_wrapper.o: src/common/linux/libcurl_wrapper.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_linux_google_crashdump_uploader_test_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/src_common_linux_google_crashdump_uploader_test-libcurl_wrapper.o -MD -MP -MF src/common/linux/$(DEPDIR)/src_common_linux_google_crashdump_uploader_test-libcurl_wrapper.Tpo -c -o src/common/linux/src_common_linux_google_crashdump_uploader_test-libcurl_wrapper.o `test -f 'src/common/linux/libcurl_wrapper.cc' || echo '$(srcdir)/'`src/common/linux/libcurl_wrapper.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/src_common_linux_google_crashdump_uploader_test-libcurl_wrapper.Tpo src/common/linux/$(DEPDIR)/src_common_linux_google_crashdump_uploader_test-libcurl_wrapper.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/libcurl_wrapper.cc' object='src/common/linux/src_common_linux_google_crashdump_uploader_test-libcurl_wrapper.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/src/src_common_dumper_unittest-gmock-all.o `test -f 'src/testing/src/gmock-all.cc' || echo '$(srcdir)/'`src/testing/src/gmock-all.cc
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_linux_google_crashdump_uploader_test_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/src_common_linux_google_crashdump_uploader_test-libcurl_wrapper.o `test -f 'src/common/linux/libcurl_wrapper.cc' || echo '$(srcdir)/'`src/common/linux/libcurl_wrapper.cc
-src/testing/src/src_common_dumper_unittest-gmock-all.obj: src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/src/src_common_dumper_unittest-gmock-all.obj -MD -MP -MF src/testing/src/$(DEPDIR)/src_common_dumper_unittest-gmock-all.Tpo -c -o src/testing/src/src_common_dumper_unittest-gmock-all.obj `if test -f 'src/testing/src/gmock-all.cc'; then $(CYGPATH_W) 'src/testing/src/gmock-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/src/gmock-all.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/src/$(DEPDIR)/src_common_dumper_unittest-gmock-all.Tpo src/testing/src/$(DEPDIR)/src_common_dumper_unittest-gmock-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/src/gmock-all.cc' object='src/testing/src/src_common_dumper_unittest-gmock-all.obj' libtool=no @AMDEPBACKSLASH@
+src/common/linux/src_common_linux_google_crashdump_uploader_test-libcurl_wrapper.obj: src/common/linux/libcurl_wrapper.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_linux_google_crashdump_uploader_test_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/src_common_linux_google_crashdump_uploader_test-libcurl_wrapper.obj -MD -MP -MF src/common/linux/$(DEPDIR)/src_common_linux_google_crashdump_uploader_test-libcurl_wrapper.Tpo -c -o src/common/linux/src_common_linux_google_crashdump_uploader_test-libcurl_wrapper.obj `if test -f 'src/common/linux/libcurl_wrapper.cc'; then $(CYGPATH_W) 'src/common/linux/libcurl_wrapper.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/libcurl_wrapper.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/src_common_linux_google_crashdump_uploader_test-libcurl_wrapper.Tpo src/common/linux/$(DEPDIR)/src_common_linux_google_crashdump_uploader_test-libcurl_wrapper.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/libcurl_wrapper.cc' object='src/common/linux/src_common_linux_google_crashdump_uploader_test-libcurl_wrapper.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/src/src_common_dumper_unittest-gmock-all.obj `if test -f 'src/testing/src/gmock-all.cc'; then $(CYGPATH_W) 'src/testing/src/gmock-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/src/gmock-all.cc'; fi`
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_linux_google_crashdump_uploader_test_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/src_common_linux_google_crashdump_uploader_test-libcurl_wrapper.obj `if test -f 'src/common/linux/libcurl_wrapper.cc'; then $(CYGPATH_W) 'src/common/linux/libcurl_wrapper.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/libcurl_wrapper.cc'; fi`
-src/common/src_common_test_assembler_unittest-test_assembler.o: src/common/test_assembler.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_test_assembler_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_test_assembler_unittest-test_assembler.o -MD -MP -MF src/common/$(DEPDIR)/src_common_test_assembler_unittest-test_assembler.Tpo -c -o src/common/src_common_test_assembler_unittest-test_assembler.o `test -f 'src/common/test_assembler.cc' || echo '$(srcdir)/'`src/common/test_assembler.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_test_assembler_unittest-test_assembler.Tpo src/common/$(DEPDIR)/src_common_test_assembler_unittest-test_assembler.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/test_assembler.cc' object='src/common/src_common_test_assembler_unittest-test_assembler.o' libtool=no @AMDEPBACKSLASH@
+src/common/src_common_mac_macho_reader_unittest-dwarf_cfi_to_module.o: src/common/dwarf_cfi_to_module.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_mac_macho_reader_unittest-dwarf_cfi_to_module.o -MD -MP -MF src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf_cfi_to_module.Tpo -c -o src/common/src_common_mac_macho_reader_unittest-dwarf_cfi_to_module.o `test -f 'src/common/dwarf_cfi_to_module.cc' || echo '$(srcdir)/'`src/common/dwarf_cfi_to_module.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf_cfi_to_module.Tpo src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf_cfi_to_module.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf_cfi_to_module.cc' object='src/common/src_common_mac_macho_reader_unittest-dwarf_cfi_to_module.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_test_assembler_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_test_assembler_unittest-test_assembler.o `test -f 'src/common/test_assembler.cc' || echo '$(srcdir)/'`src/common/test_assembler.cc
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_mac_macho_reader_unittest-dwarf_cfi_to_module.o `test -f 'src/common/dwarf_cfi_to_module.cc' || echo '$(srcdir)/'`src/common/dwarf_cfi_to_module.cc
-src/common/src_common_test_assembler_unittest-test_assembler.obj: src/common/test_assembler.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_test_assembler_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_test_assembler_unittest-test_assembler.obj -MD -MP -MF src/common/$(DEPDIR)/src_common_test_assembler_unittest-test_assembler.Tpo -c -o src/common/src_common_test_assembler_unittest-test_assembler.obj `if test -f 'src/common/test_assembler.cc'; then $(CYGPATH_W) 'src/common/test_assembler.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/test_assembler.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_test_assembler_unittest-test_assembler.Tpo src/common/$(DEPDIR)/src_common_test_assembler_unittest-test_assembler.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/test_assembler.cc' object='src/common/src_common_test_assembler_unittest-test_assembler.obj' libtool=no @AMDEPBACKSLASH@
+src/common/src_common_mac_macho_reader_unittest-dwarf_cfi_to_module.obj: src/common/dwarf_cfi_to_module.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_mac_macho_reader_unittest-dwarf_cfi_to_module.obj -MD -MP -MF src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf_cfi_to_module.Tpo -c -o src/common/src_common_mac_macho_reader_unittest-dwarf_cfi_to_module.obj `if test -f 'src/common/dwarf_cfi_to_module.cc'; then $(CYGPATH_W) 'src/common/dwarf_cfi_to_module.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf_cfi_to_module.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf_cfi_to_module.Tpo src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf_cfi_to_module.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf_cfi_to_module.cc' object='src/common/src_common_mac_macho_reader_unittest-dwarf_cfi_to_module.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_test_assembler_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_test_assembler_unittest-test_assembler.obj `if test -f 'src/common/test_assembler.cc'; then $(CYGPATH_W) 'src/common/test_assembler.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/test_assembler.cc'; fi`
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_mac_macho_reader_unittest-dwarf_cfi_to_module.obj `if test -f 'src/common/dwarf_cfi_to_module.cc'; then $(CYGPATH_W) 'src/common/dwarf_cfi_to_module.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf_cfi_to_module.cc'; fi`
-src/common/src_common_test_assembler_unittest-test_assembler_unittest.o: src/common/test_assembler_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_test_assembler_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_test_assembler_unittest-test_assembler_unittest.o -MD -MP -MF src/common/$(DEPDIR)/src_common_test_assembler_unittest-test_assembler_unittest.Tpo -c -o src/common/src_common_test_assembler_unittest-test_assembler_unittest.o `test -f 'src/common/test_assembler_unittest.cc' || echo '$(srcdir)/'`src/common/test_assembler_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_test_assembler_unittest-test_assembler_unittest.Tpo src/common/$(DEPDIR)/src_common_test_assembler_unittest-test_assembler_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/test_assembler_unittest.cc' object='src/common/src_common_test_assembler_unittest-test_assembler_unittest.o' libtool=no @AMDEPBACKSLASH@
+src/common/src_common_mac_macho_reader_unittest-dwarf_cu_to_module.o: src/common/dwarf_cu_to_module.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_mac_macho_reader_unittest-dwarf_cu_to_module.o -MD -MP -MF src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf_cu_to_module.Tpo -c -o src/common/src_common_mac_macho_reader_unittest-dwarf_cu_to_module.o `test -f 'src/common/dwarf_cu_to_module.cc' || echo '$(srcdir)/'`src/common/dwarf_cu_to_module.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf_cu_to_module.Tpo src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf_cu_to_module.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf_cu_to_module.cc' object='src/common/src_common_mac_macho_reader_unittest-dwarf_cu_to_module.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_test_assembler_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_test_assembler_unittest-test_assembler_unittest.o `test -f 'src/common/test_assembler_unittest.cc' || echo '$(srcdir)/'`src/common/test_assembler_unittest.cc
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_mac_macho_reader_unittest-dwarf_cu_to_module.o `test -f 'src/common/dwarf_cu_to_module.cc' || echo '$(srcdir)/'`src/common/dwarf_cu_to_module.cc
-src/common/src_common_test_assembler_unittest-test_assembler_unittest.obj: src/common/test_assembler_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_test_assembler_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_test_assembler_unittest-test_assembler_unittest.obj -MD -MP -MF src/common/$(DEPDIR)/src_common_test_assembler_unittest-test_assembler_unittest.Tpo -c -o src/common/src_common_test_assembler_unittest-test_assembler_unittest.obj `if test -f 'src/common/test_assembler_unittest.cc'; then $(CYGPATH_W) 'src/common/test_assembler_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/test_assembler_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_test_assembler_unittest-test_assembler_unittest.Tpo src/common/$(DEPDIR)/src_common_test_assembler_unittest-test_assembler_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/test_assembler_unittest.cc' object='src/common/src_common_test_assembler_unittest-test_assembler_unittest.obj' libtool=no @AMDEPBACKSLASH@
+src/common/src_common_mac_macho_reader_unittest-dwarf_cu_to_module.obj: src/common/dwarf_cu_to_module.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_mac_macho_reader_unittest-dwarf_cu_to_module.obj -MD -MP -MF src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf_cu_to_module.Tpo -c -o src/common/src_common_mac_macho_reader_unittest-dwarf_cu_to_module.obj `if test -f 'src/common/dwarf_cu_to_module.cc'; then $(CYGPATH_W) 'src/common/dwarf_cu_to_module.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf_cu_to_module.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf_cu_to_module.Tpo src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf_cu_to_module.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf_cu_to_module.cc' object='src/common/src_common_mac_macho_reader_unittest-dwarf_cu_to_module.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_test_assembler_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_test_assembler_unittest-test_assembler_unittest.obj `if test -f 'src/common/test_assembler_unittest.cc'; then $(CYGPATH_W) 'src/common/test_assembler_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/test_assembler_unittest.cc'; fi`
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_mac_macho_reader_unittest-dwarf_cu_to_module.obj `if test -f 'src/common/dwarf_cu_to_module.cc'; then $(CYGPATH_W) 'src/common/dwarf_cu_to_module.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf_cu_to_module.cc'; fi`
-src/testing/gtest/src/src_common_test_assembler_unittest-gtest-all.o: src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_test_assembler_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_common_test_assembler_unittest-gtest-all.o -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_common_test_assembler_unittest-gtest-all.Tpo -c -o src/testing/gtest/src/src_common_test_assembler_unittest-gtest-all.o `test -f 'src/testing/gtest/src/gtest-all.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_common_test_assembler_unittest-gtest-all.Tpo src/testing/gtest/src/$(DEPDIR)/src_common_test_assembler_unittest-gtest-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest-all.cc' object='src/testing/gtest/src/src_common_test_assembler_unittest-gtest-all.o' libtool=no @AMDEPBACKSLASH@
+src/common/src_common_mac_macho_reader_unittest-dwarf_line_to_module.o: src/common/dwarf_line_to_module.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_mac_macho_reader_unittest-dwarf_line_to_module.o -MD -MP -MF src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf_line_to_module.Tpo -c -o src/common/src_common_mac_macho_reader_unittest-dwarf_line_to_module.o `test -f 'src/common/dwarf_line_to_module.cc' || echo '$(srcdir)/'`src/common/dwarf_line_to_module.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf_line_to_module.Tpo src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf_line_to_module.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf_line_to_module.cc' object='src/common/src_common_mac_macho_reader_unittest-dwarf_line_to_module.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_test_assembler_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_common_test_assembler_unittest-gtest-all.o `test -f 'src/testing/gtest/src/gtest-all.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest-all.cc
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_mac_macho_reader_unittest-dwarf_line_to_module.o `test -f 'src/common/dwarf_line_to_module.cc' || echo '$(srcdir)/'`src/common/dwarf_line_to_module.cc
-src/testing/gtest/src/src_common_test_assembler_unittest-gtest-all.obj: src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_test_assembler_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_common_test_assembler_unittest-gtest-all.obj -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_common_test_assembler_unittest-gtest-all.Tpo -c -o src/testing/gtest/src/src_common_test_assembler_unittest-gtest-all.obj `if test -f 'src/testing/gtest/src/gtest-all.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest-all.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_common_test_assembler_unittest-gtest-all.Tpo src/testing/gtest/src/$(DEPDIR)/src_common_test_assembler_unittest-gtest-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest-all.cc' object='src/testing/gtest/src/src_common_test_assembler_unittest-gtest-all.obj' libtool=no @AMDEPBACKSLASH@
+src/common/src_common_mac_macho_reader_unittest-dwarf_line_to_module.obj: src/common/dwarf_line_to_module.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_mac_macho_reader_unittest-dwarf_line_to_module.obj -MD -MP -MF src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf_line_to_module.Tpo -c -o src/common/src_common_mac_macho_reader_unittest-dwarf_line_to_module.obj `if test -f 'src/common/dwarf_line_to_module.cc'; then $(CYGPATH_W) 'src/common/dwarf_line_to_module.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf_line_to_module.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf_line_to_module.Tpo src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf_line_to_module.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf_line_to_module.cc' object='src/common/src_common_mac_macho_reader_unittest-dwarf_line_to_module.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_test_assembler_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_common_test_assembler_unittest-gtest-all.obj `if test -f 'src/testing/gtest/src/gtest-all.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest-all.cc'; fi`
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_mac_macho_reader_unittest-dwarf_line_to_module.obj `if test -f 'src/common/dwarf_line_to_module.cc'; then $(CYGPATH_W) 'src/common/dwarf_line_to_module.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf_line_to_module.cc'; fi`
-src/testing/gtest/src/src_common_test_assembler_unittest-gtest_main.o: src/testing/gtest/src/gtest_main.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_test_assembler_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_common_test_assembler_unittest-gtest_main.o -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_common_test_assembler_unittest-gtest_main.Tpo -c -o src/testing/gtest/src/src_common_test_assembler_unittest-gtest_main.o `test -f 'src/testing/gtest/src/gtest_main.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest_main.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_common_test_assembler_unittest-gtest_main.Tpo src/testing/gtest/src/$(DEPDIR)/src_common_test_assembler_unittest-gtest_main.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest_main.cc' object='src/testing/gtest/src/src_common_test_assembler_unittest-gtest_main.o' libtool=no @AMDEPBACKSLASH@
+src/common/src_common_mac_macho_reader_unittest-language.o: src/common/language.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_mac_macho_reader_unittest-language.o -MD -MP -MF src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-language.Tpo -c -o src/common/src_common_mac_macho_reader_unittest-language.o `test -f 'src/common/language.cc' || echo '$(srcdir)/'`src/common/language.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-language.Tpo src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-language.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/language.cc' object='src/common/src_common_mac_macho_reader_unittest-language.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_test_assembler_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_common_test_assembler_unittest-gtest_main.o `test -f 'src/testing/gtest/src/gtest_main.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest_main.cc
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_mac_macho_reader_unittest-language.o `test -f 'src/common/language.cc' || echo '$(srcdir)/'`src/common/language.cc
-src/testing/gtest/src/src_common_test_assembler_unittest-gtest_main.obj: src/testing/gtest/src/gtest_main.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_test_assembler_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_common_test_assembler_unittest-gtest_main.obj -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_common_test_assembler_unittest-gtest_main.Tpo -c -o src/testing/gtest/src/src_common_test_assembler_unittest-gtest_main.obj `if test -f 'src/testing/gtest/src/gtest_main.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest_main.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest_main.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_common_test_assembler_unittest-gtest_main.Tpo src/testing/gtest/src/$(DEPDIR)/src_common_test_assembler_unittest-gtest_main.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest_main.cc' object='src/testing/gtest/src/src_common_test_assembler_unittest-gtest_main.obj' libtool=no @AMDEPBACKSLASH@
+src/common/src_common_mac_macho_reader_unittest-language.obj: src/common/language.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_mac_macho_reader_unittest-language.obj -MD -MP -MF src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-language.Tpo -c -o src/common/src_common_mac_macho_reader_unittest-language.obj `if test -f 'src/common/language.cc'; then $(CYGPATH_W) 'src/common/language.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/language.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-language.Tpo src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-language.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/language.cc' object='src/common/src_common_mac_macho_reader_unittest-language.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_test_assembler_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_common_test_assembler_unittest-gtest_main.obj `if test -f 'src/testing/gtest/src/gtest_main.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest_main.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest_main.cc'; fi`
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_mac_macho_reader_unittest-language.obj `if test -f 'src/common/language.cc'; then $(CYGPATH_W) 'src/common/language.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/language.cc'; fi`
-src/testing/src/src_common_test_assembler_unittest-gmock-all.o: src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_test_assembler_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/src/src_common_test_assembler_unittest-gmock-all.o -MD -MP -MF src/testing/src/$(DEPDIR)/src_common_test_assembler_unittest-gmock-all.Tpo -c -o src/testing/src/src_common_test_assembler_unittest-gmock-all.o `test -f 'src/testing/src/gmock-all.cc' || echo '$(srcdir)/'`src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/src/$(DEPDIR)/src_common_test_assembler_unittest-gmock-all.Tpo src/testing/src/$(DEPDIR)/src_common_test_assembler_unittest-gmock-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/src/gmock-all.cc' object='src/testing/src/src_common_test_assembler_unittest-gmock-all.o' libtool=no @AMDEPBACKSLASH@
+src/common/src_common_mac_macho_reader_unittest-md5.o: src/common/md5.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_mac_macho_reader_unittest-md5.o -MD -MP -MF src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-md5.Tpo -c -o src/common/src_common_mac_macho_reader_unittest-md5.o `test -f 'src/common/md5.cc' || echo '$(srcdir)/'`src/common/md5.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-md5.Tpo src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-md5.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/md5.cc' object='src/common/src_common_mac_macho_reader_unittest-md5.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_test_assembler_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/src/src_common_test_assembler_unittest-gmock-all.o `test -f 'src/testing/src/gmock-all.cc' || echo '$(srcdir)/'`src/testing/src/gmock-all.cc
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_mac_macho_reader_unittest-md5.o `test -f 'src/common/md5.cc' || echo '$(srcdir)/'`src/common/md5.cc
-src/testing/src/src_common_test_assembler_unittest-gmock-all.obj: src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_test_assembler_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/src/src_common_test_assembler_unittest-gmock-all.obj -MD -MP -MF src/testing/src/$(DEPDIR)/src_common_test_assembler_unittest-gmock-all.Tpo -c -o src/testing/src/src_common_test_assembler_unittest-gmock-all.obj `if test -f 'src/testing/src/gmock-all.cc'; then $(CYGPATH_W) 'src/testing/src/gmock-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/src/gmock-all.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/src/$(DEPDIR)/src_common_test_assembler_unittest-gmock-all.Tpo src/testing/src/$(DEPDIR)/src_common_test_assembler_unittest-gmock-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/src/gmock-all.cc' object='src/testing/src/src_common_test_assembler_unittest-gmock-all.obj' libtool=no @AMDEPBACKSLASH@
+src/common/src_common_mac_macho_reader_unittest-md5.obj: src/common/md5.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_mac_macho_reader_unittest-md5.obj -MD -MP -MF src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-md5.Tpo -c -o src/common/src_common_mac_macho_reader_unittest-md5.obj `if test -f 'src/common/md5.cc'; then $(CYGPATH_W) 'src/common/md5.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/md5.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-md5.Tpo src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-md5.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/md5.cc' object='src/common/src_common_mac_macho_reader_unittest-md5.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_test_assembler_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/src/src_common_test_assembler_unittest-gmock-all.obj `if test -f 'src/testing/src/gmock-all.cc'; then $(CYGPATH_W) 'src/testing/src/gmock-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/src/gmock-all.cc'; fi`
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_mac_macho_reader_unittest-md5.obj `if test -f 'src/common/md5.cc'; then $(CYGPATH_W) 'src/common/md5.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/md5.cc'; fi`
-src/processor/src_processor_basic_source_line_resolver_unittest-basic_source_line_resolver_unittest.o: src/processor/basic_source_line_resolver_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_basic_source_line_resolver_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_basic_source_line_resolver_unittest-basic_source_line_resolver_unittest.o -MD -MP -MF src/processor/$(DEPDIR)/src_processor_basic_source_line_resolver_unittest-basic_source_line_resolver_unittest.Tpo -c -o src/processor/src_processor_basic_source_line_resolver_unittest-basic_source_line_resolver_unittest.o `test -f 'src/processor/basic_source_line_resolver_unittest.cc' || echo '$(srcdir)/'`src/processor/basic_source_line_resolver_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_basic_source_line_resolver_unittest-basic_source_line_resolver_unittest.Tpo src/processor/$(DEPDIR)/src_processor_basic_source_line_resolver_unittest-basic_source_line_resolver_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/basic_source_line_resolver_unittest.cc' object='src/processor/src_processor_basic_source_line_resolver_unittest-basic_source_line_resolver_unittest.o' libtool=no @AMDEPBACKSLASH@
+src/common/src_common_mac_macho_reader_unittest-module.o: src/common/module.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_mac_macho_reader_unittest-module.o -MD -MP -MF src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-module.Tpo -c -o src/common/src_common_mac_macho_reader_unittest-module.o `test -f 'src/common/module.cc' || echo '$(srcdir)/'`src/common/module.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-module.Tpo src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-module.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/module.cc' object='src/common/src_common_mac_macho_reader_unittest-module.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_basic_source_line_resolver_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_basic_source_line_resolver_unittest-basic_source_line_resolver_unittest.o `test -f 'src/processor/basic_source_line_resolver_unittest.cc' || echo '$(srcdir)/'`src/processor/basic_source_line_resolver_unittest.cc
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_mac_macho_reader_unittest-module.o `test -f 'src/common/module.cc' || echo '$(srcdir)/'`src/common/module.cc
-src/processor/src_processor_basic_source_line_resolver_unittest-basic_source_line_resolver_unittest.obj: src/processor/basic_source_line_resolver_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_basic_source_line_resolver_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_basic_source_line_resolver_unittest-basic_source_line_resolver_unittest.obj -MD -MP -MF src/processor/$(DEPDIR)/src_processor_basic_source_line_resolver_unittest-basic_source_line_resolver_unittest.Tpo -c -o src/processor/src_processor_basic_source_line_resolver_unittest-basic_source_line_resolver_unittest.obj `if test -f 'src/processor/basic_source_line_resolver_unittest.cc'; then $(CYGPATH_W) 'src/processor/basic_source_line_resolver_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/basic_source_line_resolver_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_basic_source_line_resolver_unittest-basic_source_line_resolver_unittest.Tpo src/processor/$(DEPDIR)/src_processor_basic_source_line_resolver_unittest-basic_source_line_resolver_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/basic_source_line_resolver_unittest.cc' object='src/processor/src_processor_basic_source_line_resolver_unittest-basic_source_line_resolver_unittest.obj' libtool=no @AMDEPBACKSLASH@
+src/common/src_common_mac_macho_reader_unittest-module.obj: src/common/module.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_mac_macho_reader_unittest-module.obj -MD -MP -MF src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-module.Tpo -c -o src/common/src_common_mac_macho_reader_unittest-module.obj `if test -f 'src/common/module.cc'; then $(CYGPATH_W) 'src/common/module.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/module.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-module.Tpo src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-module.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/module.cc' object='src/common/src_common_mac_macho_reader_unittest-module.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_basic_source_line_resolver_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_basic_source_line_resolver_unittest-basic_source_line_resolver_unittest.obj `if test -f 'src/processor/basic_source_line_resolver_unittest.cc'; then $(CYGPATH_W) 'src/processor/basic_source_line_resolver_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/basic_source_line_resolver_unittest.cc'; fi`
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_mac_macho_reader_unittest-module.obj `if test -f 'src/common/module.cc'; then $(CYGPATH_W) 'src/common/module.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/module.cc'; fi`
-src/testing/gtest/src/src_processor_basic_source_line_resolver_unittest-gtest-all.o: src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_basic_source_line_resolver_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_processor_basic_source_line_resolver_unittest-gtest-all.o -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_processor_basic_source_line_resolver_unittest-gtest-all.Tpo -c -o src/testing/gtest/src/src_processor_basic_source_line_resolver_unittest-gtest-all.o `test -f 'src/testing/gtest/src/gtest-all.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_processor_basic_source_line_resolver_unittest-gtest-all.Tpo src/testing/gtest/src/$(DEPDIR)/src_processor_basic_source_line_resolver_unittest-gtest-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest-all.cc' object='src/testing/gtest/src/src_processor_basic_source_line_resolver_unittest-gtest-all.o' libtool=no @AMDEPBACKSLASH@
+src/common/src_common_mac_macho_reader_unittest-path_helper.o: src/common/path_helper.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_mac_macho_reader_unittest-path_helper.o -MD -MP -MF src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-path_helper.Tpo -c -o src/common/src_common_mac_macho_reader_unittest-path_helper.o `test -f 'src/common/path_helper.cc' || echo '$(srcdir)/'`src/common/path_helper.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-path_helper.Tpo src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-path_helper.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/path_helper.cc' object='src/common/src_common_mac_macho_reader_unittest-path_helper.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_basic_source_line_resolver_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_processor_basic_source_line_resolver_unittest-gtest-all.o `test -f 'src/testing/gtest/src/gtest-all.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest-all.cc
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_mac_macho_reader_unittest-path_helper.o `test -f 'src/common/path_helper.cc' || echo '$(srcdir)/'`src/common/path_helper.cc
-src/testing/gtest/src/src_processor_basic_source_line_resolver_unittest-gtest-all.obj: src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_basic_source_line_resolver_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_processor_basic_source_line_resolver_unittest-gtest-all.obj -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_processor_basic_source_line_resolver_unittest-gtest-all.Tpo -c -o src/testing/gtest/src/src_processor_basic_source_line_resolver_unittest-gtest-all.obj `if test -f 'src/testing/gtest/src/gtest-all.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest-all.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_processor_basic_source_line_resolver_unittest-gtest-all.Tpo src/testing/gtest/src/$(DEPDIR)/src_processor_basic_source_line_resolver_unittest-gtest-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest-all.cc' object='src/testing/gtest/src/src_processor_basic_source_line_resolver_unittest-gtest-all.obj' libtool=no @AMDEPBACKSLASH@
+src/common/src_common_mac_macho_reader_unittest-path_helper.obj: src/common/path_helper.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_mac_macho_reader_unittest-path_helper.obj -MD -MP -MF src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-path_helper.Tpo -c -o src/common/src_common_mac_macho_reader_unittest-path_helper.obj `if test -f 'src/common/path_helper.cc'; then $(CYGPATH_W) 'src/common/path_helper.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/path_helper.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-path_helper.Tpo src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-path_helper.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/path_helper.cc' object='src/common/src_common_mac_macho_reader_unittest-path_helper.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_basic_source_line_resolver_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_processor_basic_source_line_resolver_unittest-gtest-all.obj `if test -f 'src/testing/gtest/src/gtest-all.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest-all.cc'; fi`
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_mac_macho_reader_unittest-path_helper.obj `if test -f 'src/common/path_helper.cc'; then $(CYGPATH_W) 'src/common/path_helper.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/path_helper.cc'; fi`
-src/testing/src/src_processor_basic_source_line_resolver_unittest-gmock-all.o: src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_basic_source_line_resolver_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/src/src_processor_basic_source_line_resolver_unittest-gmock-all.o -MD -MP -MF src/testing/src/$(DEPDIR)/src_processor_basic_source_line_resolver_unittest-gmock-all.Tpo -c -o src/testing/src/src_processor_basic_source_line_resolver_unittest-gmock-all.o `test -f 'src/testing/src/gmock-all.cc' || echo '$(srcdir)/'`src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/src/$(DEPDIR)/src_processor_basic_source_line_resolver_unittest-gmock-all.Tpo src/testing/src/$(DEPDIR)/src_processor_basic_source_line_resolver_unittest-gmock-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/src/gmock-all.cc' object='src/testing/src/src_processor_basic_source_line_resolver_unittest-gmock-all.o' libtool=no @AMDEPBACKSLASH@
+src/common/src_common_mac_macho_reader_unittest-stabs_reader.o: src/common/stabs_reader.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_mac_macho_reader_unittest-stabs_reader.o -MD -MP -MF src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-stabs_reader.Tpo -c -o src/common/src_common_mac_macho_reader_unittest-stabs_reader.o `test -f 'src/common/stabs_reader.cc' || echo '$(srcdir)/'`src/common/stabs_reader.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-stabs_reader.Tpo src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-stabs_reader.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/stabs_reader.cc' object='src/common/src_common_mac_macho_reader_unittest-stabs_reader.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_basic_source_line_resolver_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/src/src_processor_basic_source_line_resolver_unittest-gmock-all.o `test -f 'src/testing/src/gmock-all.cc' || echo '$(srcdir)/'`src/testing/src/gmock-all.cc
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_mac_macho_reader_unittest-stabs_reader.o `test -f 'src/common/stabs_reader.cc' || echo '$(srcdir)/'`src/common/stabs_reader.cc
-src/testing/src/src_processor_basic_source_line_resolver_unittest-gmock-all.obj: src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_basic_source_line_resolver_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/src/src_processor_basic_source_line_resolver_unittest-gmock-all.obj -MD -MP -MF src/testing/src/$(DEPDIR)/src_processor_basic_source_line_resolver_unittest-gmock-all.Tpo -c -o src/testing/src/src_processor_basic_source_line_resolver_unittest-gmock-all.obj `if test -f 'src/testing/src/gmock-all.cc'; then $(CYGPATH_W) 'src/testing/src/gmock-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/src/gmock-all.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/src/$(DEPDIR)/src_processor_basic_source_line_resolver_unittest-gmock-all.Tpo src/testing/src/$(DEPDIR)/src_processor_basic_source_line_resolver_unittest-gmock-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/src/gmock-all.cc' object='src/testing/src/src_processor_basic_source_line_resolver_unittest-gmock-all.obj' libtool=no @AMDEPBACKSLASH@
+src/common/src_common_mac_macho_reader_unittest-stabs_reader.obj: src/common/stabs_reader.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_mac_macho_reader_unittest-stabs_reader.obj -MD -MP -MF src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-stabs_reader.Tpo -c -o src/common/src_common_mac_macho_reader_unittest-stabs_reader.obj `if test -f 'src/common/stabs_reader.cc'; then $(CYGPATH_W) 'src/common/stabs_reader.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/stabs_reader.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-stabs_reader.Tpo src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-stabs_reader.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/stabs_reader.cc' object='src/common/src_common_mac_macho_reader_unittest-stabs_reader.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_basic_source_line_resolver_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/src/src_processor_basic_source_line_resolver_unittest-gmock-all.obj `if test -f 'src/testing/src/gmock-all.cc'; then $(CYGPATH_W) 'src/testing/src/gmock-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/src/gmock-all.cc'; fi`
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_mac_macho_reader_unittest-stabs_reader.obj `if test -f 'src/common/stabs_reader.cc'; then $(CYGPATH_W) 'src/common/stabs_reader.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/stabs_reader.cc'; fi`
-src/processor/src_processor_binarystream_unittest-binarystream_unittest.o: src/processor/binarystream_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_binarystream_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_binarystream_unittest-binarystream_unittest.o -MD -MP -MF src/processor/$(DEPDIR)/src_processor_binarystream_unittest-binarystream_unittest.Tpo -c -o src/processor/src_processor_binarystream_unittest-binarystream_unittest.o `test -f 'src/processor/binarystream_unittest.cc' || echo '$(srcdir)/'`src/processor/binarystream_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_binarystream_unittest-binarystream_unittest.Tpo src/processor/$(DEPDIR)/src_processor_binarystream_unittest-binarystream_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/binarystream_unittest.cc' object='src/processor/src_processor_binarystream_unittest-binarystream_unittest.o' libtool=no @AMDEPBACKSLASH@
+src/common/src_common_mac_macho_reader_unittest-stabs_to_module.o: src/common/stabs_to_module.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_mac_macho_reader_unittest-stabs_to_module.o -MD -MP -MF src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-stabs_to_module.Tpo -c -o src/common/src_common_mac_macho_reader_unittest-stabs_to_module.o `test -f 'src/common/stabs_to_module.cc' || echo '$(srcdir)/'`src/common/stabs_to_module.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-stabs_to_module.Tpo src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-stabs_to_module.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/stabs_to_module.cc' object='src/common/src_common_mac_macho_reader_unittest-stabs_to_module.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_binarystream_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_binarystream_unittest-binarystream_unittest.o `test -f 'src/processor/binarystream_unittest.cc' || echo '$(srcdir)/'`src/processor/binarystream_unittest.cc
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_mac_macho_reader_unittest-stabs_to_module.o `test -f 'src/common/stabs_to_module.cc' || echo '$(srcdir)/'`src/common/stabs_to_module.cc
-src/processor/src_processor_binarystream_unittest-binarystream_unittest.obj: src/processor/binarystream_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_binarystream_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_binarystream_unittest-binarystream_unittest.obj -MD -MP -MF src/processor/$(DEPDIR)/src_processor_binarystream_unittest-binarystream_unittest.Tpo -c -o src/processor/src_processor_binarystream_unittest-binarystream_unittest.obj `if test -f 'src/processor/binarystream_unittest.cc'; then $(CYGPATH_W) 'src/processor/binarystream_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/binarystream_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_binarystream_unittest-binarystream_unittest.Tpo src/processor/$(DEPDIR)/src_processor_binarystream_unittest-binarystream_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/binarystream_unittest.cc' object='src/processor/src_processor_binarystream_unittest-binarystream_unittest.obj' libtool=no @AMDEPBACKSLASH@
+src/common/src_common_mac_macho_reader_unittest-stabs_to_module.obj: src/common/stabs_to_module.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_mac_macho_reader_unittest-stabs_to_module.obj -MD -MP -MF src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-stabs_to_module.Tpo -c -o src/common/src_common_mac_macho_reader_unittest-stabs_to_module.obj `if test -f 'src/common/stabs_to_module.cc'; then $(CYGPATH_W) 'src/common/stabs_to_module.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/stabs_to_module.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-stabs_to_module.Tpo src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-stabs_to_module.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/stabs_to_module.cc' object='src/common/src_common_mac_macho_reader_unittest-stabs_to_module.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_binarystream_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_binarystream_unittest-binarystream_unittest.obj `if test -f 'src/processor/binarystream_unittest.cc'; then $(CYGPATH_W) 'src/processor/binarystream_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/binarystream_unittest.cc'; fi`
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_mac_macho_reader_unittest-stabs_to_module.obj `if test -f 'src/common/stabs_to_module.cc'; then $(CYGPATH_W) 'src/common/stabs_to_module.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/stabs_to_module.cc'; fi`
-src/testing/gtest/src/src_processor_binarystream_unittest-gtest-all.o: src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_binarystream_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_processor_binarystream_unittest-gtest-all.o -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_processor_binarystream_unittest-gtest-all.Tpo -c -o src/testing/gtest/src/src_processor_binarystream_unittest-gtest-all.o `test -f 'src/testing/gtest/src/gtest-all.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_processor_binarystream_unittest-gtest-all.Tpo src/testing/gtest/src/$(DEPDIR)/src_processor_binarystream_unittest-gtest-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest-all.cc' object='src/testing/gtest/src/src_processor_binarystream_unittest-gtest-all.o' libtool=no @AMDEPBACKSLASH@
+src/common/src_common_mac_macho_reader_unittest-test_assembler.o: src/common/test_assembler.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_mac_macho_reader_unittest-test_assembler.o -MD -MP -MF src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-test_assembler.Tpo -c -o src/common/src_common_mac_macho_reader_unittest-test_assembler.o `test -f 'src/common/test_assembler.cc' || echo '$(srcdir)/'`src/common/test_assembler.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-test_assembler.Tpo src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-test_assembler.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/test_assembler.cc' object='src/common/src_common_mac_macho_reader_unittest-test_assembler.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_binarystream_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_processor_binarystream_unittest-gtest-all.o `test -f 'src/testing/gtest/src/gtest-all.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest-all.cc
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_mac_macho_reader_unittest-test_assembler.o `test -f 'src/common/test_assembler.cc' || echo '$(srcdir)/'`src/common/test_assembler.cc
-src/testing/gtest/src/src_processor_binarystream_unittest-gtest-all.obj: src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_binarystream_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_processor_binarystream_unittest-gtest-all.obj -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_processor_binarystream_unittest-gtest-all.Tpo -c -o src/testing/gtest/src/src_processor_binarystream_unittest-gtest-all.obj `if test -f 'src/testing/gtest/src/gtest-all.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest-all.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_processor_binarystream_unittest-gtest-all.Tpo src/testing/gtest/src/$(DEPDIR)/src_processor_binarystream_unittest-gtest-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest-all.cc' object='src/testing/gtest/src/src_processor_binarystream_unittest-gtest-all.obj' libtool=no @AMDEPBACKSLASH@
+src/common/src_common_mac_macho_reader_unittest-test_assembler.obj: src/common/test_assembler.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_mac_macho_reader_unittest-test_assembler.obj -MD -MP -MF src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-test_assembler.Tpo -c -o src/common/src_common_mac_macho_reader_unittest-test_assembler.obj `if test -f 'src/common/test_assembler.cc'; then $(CYGPATH_W) 'src/common/test_assembler.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/test_assembler.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-test_assembler.Tpo src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-test_assembler.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/test_assembler.cc' object='src/common/src_common_mac_macho_reader_unittest-test_assembler.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_binarystream_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_processor_binarystream_unittest-gtest-all.obj `if test -f 'src/testing/gtest/src/gtest-all.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest-all.cc'; fi`
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_mac_macho_reader_unittest-test_assembler.obj `if test -f 'src/common/test_assembler.cc'; then $(CYGPATH_W) 'src/common/test_assembler.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/test_assembler.cc'; fi`
-src/testing/src/src_processor_binarystream_unittest-gmock-all.o: src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_binarystream_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/src/src_processor_binarystream_unittest-gmock-all.o -MD -MP -MF src/testing/src/$(DEPDIR)/src_processor_binarystream_unittest-gmock-all.Tpo -c -o src/testing/src/src_processor_binarystream_unittest-gmock-all.o `test -f 'src/testing/src/gmock-all.cc' || echo '$(srcdir)/'`src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/src/$(DEPDIR)/src_processor_binarystream_unittest-gmock-all.Tpo src/testing/src/$(DEPDIR)/src_processor_binarystream_unittest-gmock-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/src/gmock-all.cc' object='src/testing/src/src_processor_binarystream_unittest-gmock-all.o' libtool=no @AMDEPBACKSLASH@
+src/common/dwarf/src_common_mac_macho_reader_unittest-bytereader.o: src/common/dwarf/bytereader.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/dwarf/src_common_mac_macho_reader_unittest-bytereader.o -MD -MP -MF src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-bytereader.Tpo -c -o src/common/dwarf/src_common_mac_macho_reader_unittest-bytereader.o `test -f 'src/common/dwarf/bytereader.cc' || echo '$(srcdir)/'`src/common/dwarf/bytereader.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-bytereader.Tpo src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-bytereader.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf/bytereader.cc' object='src/common/dwarf/src_common_mac_macho_reader_unittest-bytereader.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_binarystream_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/src/src_processor_binarystream_unittest-gmock-all.o `test -f 'src/testing/src/gmock-all.cc' || echo '$(srcdir)/'`src/testing/src/gmock-all.cc
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/dwarf/src_common_mac_macho_reader_unittest-bytereader.o `test -f 'src/common/dwarf/bytereader.cc' || echo '$(srcdir)/'`src/common/dwarf/bytereader.cc
-src/testing/src/src_processor_binarystream_unittest-gmock-all.obj: src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_binarystream_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/src/src_processor_binarystream_unittest-gmock-all.obj -MD -MP -MF src/testing/src/$(DEPDIR)/src_processor_binarystream_unittest-gmock-all.Tpo -c -o src/testing/src/src_processor_binarystream_unittest-gmock-all.obj `if test -f 'src/testing/src/gmock-all.cc'; then $(CYGPATH_W) 'src/testing/src/gmock-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/src/gmock-all.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/src/$(DEPDIR)/src_processor_binarystream_unittest-gmock-all.Tpo src/testing/src/$(DEPDIR)/src_processor_binarystream_unittest-gmock-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/src/gmock-all.cc' object='src/testing/src/src_processor_binarystream_unittest-gmock-all.obj' libtool=no @AMDEPBACKSLASH@
+src/common/dwarf/src_common_mac_macho_reader_unittest-bytereader.obj: src/common/dwarf/bytereader.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/dwarf/src_common_mac_macho_reader_unittest-bytereader.obj -MD -MP -MF src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-bytereader.Tpo -c -o src/common/dwarf/src_common_mac_macho_reader_unittest-bytereader.obj `if test -f 'src/common/dwarf/bytereader.cc'; then $(CYGPATH_W) 'src/common/dwarf/bytereader.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf/bytereader.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-bytereader.Tpo src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-bytereader.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf/bytereader.cc' object='src/common/dwarf/src_common_mac_macho_reader_unittest-bytereader.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_binarystream_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/src/src_processor_binarystream_unittest-gmock-all.obj `if test -f 'src/testing/src/gmock-all.cc'; then $(CYGPATH_W) 'src/testing/src/gmock-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/src/gmock-all.cc'; fi`
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/dwarf/src_common_mac_macho_reader_unittest-bytereader.obj `if test -f 'src/common/dwarf/bytereader.cc'; then $(CYGPATH_W) 'src/common/dwarf/bytereader.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf/bytereader.cc'; fi`
-src/processor/src_processor_cfi_frame_info_unittest-cfi_frame_info_unittest.o: src/processor/cfi_frame_info_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_cfi_frame_info_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_cfi_frame_info_unittest-cfi_frame_info_unittest.o -MD -MP -MF src/processor/$(DEPDIR)/src_processor_cfi_frame_info_unittest-cfi_frame_info_unittest.Tpo -c -o src/processor/src_processor_cfi_frame_info_unittest-cfi_frame_info_unittest.o `test -f 'src/processor/cfi_frame_info_unittest.cc' || echo '$(srcdir)/'`src/processor/cfi_frame_info_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_cfi_frame_info_unittest-cfi_frame_info_unittest.Tpo src/processor/$(DEPDIR)/src_processor_cfi_frame_info_unittest-cfi_frame_info_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/cfi_frame_info_unittest.cc' object='src/processor/src_processor_cfi_frame_info_unittest-cfi_frame_info_unittest.o' libtool=no @AMDEPBACKSLASH@
+src/common/dwarf/src_common_mac_macho_reader_unittest-cfi_assembler.o: src/common/dwarf/cfi_assembler.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/dwarf/src_common_mac_macho_reader_unittest-cfi_assembler.o -MD -MP -MF src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-cfi_assembler.Tpo -c -o src/common/dwarf/src_common_mac_macho_reader_unittest-cfi_assembler.o `test -f 'src/common/dwarf/cfi_assembler.cc' || echo '$(srcdir)/'`src/common/dwarf/cfi_assembler.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-cfi_assembler.Tpo src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-cfi_assembler.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf/cfi_assembler.cc' object='src/common/dwarf/src_common_mac_macho_reader_unittest-cfi_assembler.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_cfi_frame_info_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_cfi_frame_info_unittest-cfi_frame_info_unittest.o `test -f 'src/processor/cfi_frame_info_unittest.cc' || echo '$(srcdir)/'`src/processor/cfi_frame_info_unittest.cc
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/dwarf/src_common_mac_macho_reader_unittest-cfi_assembler.o `test -f 'src/common/dwarf/cfi_assembler.cc' || echo '$(srcdir)/'`src/common/dwarf/cfi_assembler.cc
-src/processor/src_processor_cfi_frame_info_unittest-cfi_frame_info_unittest.obj: src/processor/cfi_frame_info_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_cfi_frame_info_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_cfi_frame_info_unittest-cfi_frame_info_unittest.obj -MD -MP -MF src/processor/$(DEPDIR)/src_processor_cfi_frame_info_unittest-cfi_frame_info_unittest.Tpo -c -o src/processor/src_processor_cfi_frame_info_unittest-cfi_frame_info_unittest.obj `if test -f 'src/processor/cfi_frame_info_unittest.cc'; then $(CYGPATH_W) 'src/processor/cfi_frame_info_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/cfi_frame_info_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_cfi_frame_info_unittest-cfi_frame_info_unittest.Tpo src/processor/$(DEPDIR)/src_processor_cfi_frame_info_unittest-cfi_frame_info_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/cfi_frame_info_unittest.cc' object='src/processor/src_processor_cfi_frame_info_unittest-cfi_frame_info_unittest.obj' libtool=no @AMDEPBACKSLASH@
+src/common/dwarf/src_common_mac_macho_reader_unittest-cfi_assembler.obj: src/common/dwarf/cfi_assembler.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/dwarf/src_common_mac_macho_reader_unittest-cfi_assembler.obj -MD -MP -MF src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-cfi_assembler.Tpo -c -o src/common/dwarf/src_common_mac_macho_reader_unittest-cfi_assembler.obj `if test -f 'src/common/dwarf/cfi_assembler.cc'; then $(CYGPATH_W) 'src/common/dwarf/cfi_assembler.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf/cfi_assembler.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-cfi_assembler.Tpo src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-cfi_assembler.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf/cfi_assembler.cc' object='src/common/dwarf/src_common_mac_macho_reader_unittest-cfi_assembler.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_cfi_frame_info_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_cfi_frame_info_unittest-cfi_frame_info_unittest.obj `if test -f 'src/processor/cfi_frame_info_unittest.cc'; then $(CYGPATH_W) 'src/processor/cfi_frame_info_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/cfi_frame_info_unittest.cc'; fi`
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/dwarf/src_common_mac_macho_reader_unittest-cfi_assembler.obj `if test -f 'src/common/dwarf/cfi_assembler.cc'; then $(CYGPATH_W) 'src/common/dwarf/cfi_assembler.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf/cfi_assembler.cc'; fi`
-src/testing/gtest/src/src_processor_cfi_frame_info_unittest-gtest-all.o: src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_cfi_frame_info_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_processor_cfi_frame_info_unittest-gtest-all.o -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_processor_cfi_frame_info_unittest-gtest-all.Tpo -c -o src/testing/gtest/src/src_processor_cfi_frame_info_unittest-gtest-all.o `test -f 'src/testing/gtest/src/gtest-all.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_processor_cfi_frame_info_unittest-gtest-all.Tpo src/testing/gtest/src/$(DEPDIR)/src_processor_cfi_frame_info_unittest-gtest-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest-all.cc' object='src/testing/gtest/src/src_processor_cfi_frame_info_unittest-gtest-all.o' libtool=no @AMDEPBACKSLASH@
+src/common/dwarf/src_common_mac_macho_reader_unittest-dwarf2diehandler.o: src/common/dwarf/dwarf2diehandler.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/dwarf/src_common_mac_macho_reader_unittest-dwarf2diehandler.o -MD -MP -MF src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf2diehandler.Tpo -c -o src/common/dwarf/src_common_mac_macho_reader_unittest-dwarf2diehandler.o `test -f 'src/common/dwarf/dwarf2diehandler.cc' || echo '$(srcdir)/'`src/common/dwarf/dwarf2diehandler.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf2diehandler.Tpo src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf2diehandler.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf/dwarf2diehandler.cc' object='src/common/dwarf/src_common_mac_macho_reader_unittest-dwarf2diehandler.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_cfi_frame_info_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_processor_cfi_frame_info_unittest-gtest-all.o `test -f 'src/testing/gtest/src/gtest-all.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest-all.cc
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/dwarf/src_common_mac_macho_reader_unittest-dwarf2diehandler.o `test -f 'src/common/dwarf/dwarf2diehandler.cc' || echo '$(srcdir)/'`src/common/dwarf/dwarf2diehandler.cc
-src/testing/gtest/src/src_processor_cfi_frame_info_unittest-gtest-all.obj: src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_cfi_frame_info_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_processor_cfi_frame_info_unittest-gtest-all.obj -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_processor_cfi_frame_info_unittest-gtest-all.Tpo -c -o src/testing/gtest/src/src_processor_cfi_frame_info_unittest-gtest-all.obj `if test -f 'src/testing/gtest/src/gtest-all.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest-all.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_processor_cfi_frame_info_unittest-gtest-all.Tpo src/testing/gtest/src/$(DEPDIR)/src_processor_cfi_frame_info_unittest-gtest-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest-all.cc' object='src/testing/gtest/src/src_processor_cfi_frame_info_unittest-gtest-all.obj' libtool=no @AMDEPBACKSLASH@
+src/common/dwarf/src_common_mac_macho_reader_unittest-dwarf2diehandler.obj: src/common/dwarf/dwarf2diehandler.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/dwarf/src_common_mac_macho_reader_unittest-dwarf2diehandler.obj -MD -MP -MF src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf2diehandler.Tpo -c -o src/common/dwarf/src_common_mac_macho_reader_unittest-dwarf2diehandler.obj `if test -f 'src/common/dwarf/dwarf2diehandler.cc'; then $(CYGPATH_W) 'src/common/dwarf/dwarf2diehandler.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf/dwarf2diehandler.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf2diehandler.Tpo src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf2diehandler.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf/dwarf2diehandler.cc' object='src/common/dwarf/src_common_mac_macho_reader_unittest-dwarf2diehandler.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_cfi_frame_info_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_processor_cfi_frame_info_unittest-gtest-all.obj `if test -f 'src/testing/gtest/src/gtest-all.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest-all.cc'; fi`
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/dwarf/src_common_mac_macho_reader_unittest-dwarf2diehandler.obj `if test -f 'src/common/dwarf/dwarf2diehandler.cc'; then $(CYGPATH_W) 'src/common/dwarf/dwarf2diehandler.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf/dwarf2diehandler.cc'; fi`
-src/testing/gtest/src/src_processor_cfi_frame_info_unittest-gtest_main.o: src/testing/gtest/src/gtest_main.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_cfi_frame_info_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_processor_cfi_frame_info_unittest-gtest_main.o -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_processor_cfi_frame_info_unittest-gtest_main.Tpo -c -o src/testing/gtest/src/src_processor_cfi_frame_info_unittest-gtest_main.o `test -f 'src/testing/gtest/src/gtest_main.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest_main.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_processor_cfi_frame_info_unittest-gtest_main.Tpo src/testing/gtest/src/$(DEPDIR)/src_processor_cfi_frame_info_unittest-gtest_main.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest_main.cc' object='src/testing/gtest/src/src_processor_cfi_frame_info_unittest-gtest_main.o' libtool=no @AMDEPBACKSLASH@
+src/common/dwarf/src_common_mac_macho_reader_unittest-dwarf2reader.o: src/common/dwarf/dwarf2reader.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/dwarf/src_common_mac_macho_reader_unittest-dwarf2reader.o -MD -MP -MF src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf2reader.Tpo -c -o src/common/dwarf/src_common_mac_macho_reader_unittest-dwarf2reader.o `test -f 'src/common/dwarf/dwarf2reader.cc' || echo '$(srcdir)/'`src/common/dwarf/dwarf2reader.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf2reader.Tpo src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf2reader.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf/dwarf2reader.cc' object='src/common/dwarf/src_common_mac_macho_reader_unittest-dwarf2reader.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_cfi_frame_info_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_processor_cfi_frame_info_unittest-gtest_main.o `test -f 'src/testing/gtest/src/gtest_main.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest_main.cc
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/dwarf/src_common_mac_macho_reader_unittest-dwarf2reader.o `test -f 'src/common/dwarf/dwarf2reader.cc' || echo '$(srcdir)/'`src/common/dwarf/dwarf2reader.cc
-src/testing/gtest/src/src_processor_cfi_frame_info_unittest-gtest_main.obj: src/testing/gtest/src/gtest_main.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_cfi_frame_info_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_processor_cfi_frame_info_unittest-gtest_main.obj -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_processor_cfi_frame_info_unittest-gtest_main.Tpo -c -o src/testing/gtest/src/src_processor_cfi_frame_info_unittest-gtest_main.obj `if test -f 'src/testing/gtest/src/gtest_main.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest_main.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest_main.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_processor_cfi_frame_info_unittest-gtest_main.Tpo src/testing/gtest/src/$(DEPDIR)/src_processor_cfi_frame_info_unittest-gtest_main.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest_main.cc' object='src/testing/gtest/src/src_processor_cfi_frame_info_unittest-gtest_main.obj' libtool=no @AMDEPBACKSLASH@
+src/common/dwarf/src_common_mac_macho_reader_unittest-dwarf2reader.obj: src/common/dwarf/dwarf2reader.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/dwarf/src_common_mac_macho_reader_unittest-dwarf2reader.obj -MD -MP -MF src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf2reader.Tpo -c -o src/common/dwarf/src_common_mac_macho_reader_unittest-dwarf2reader.obj `if test -f 'src/common/dwarf/dwarf2reader.cc'; then $(CYGPATH_W) 'src/common/dwarf/dwarf2reader.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf/dwarf2reader.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf2reader.Tpo src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf2reader.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf/dwarf2reader.cc' object='src/common/dwarf/src_common_mac_macho_reader_unittest-dwarf2reader.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_cfi_frame_info_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_processor_cfi_frame_info_unittest-gtest_main.obj `if test -f 'src/testing/gtest/src/gtest_main.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest_main.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest_main.cc'; fi`
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/dwarf/src_common_mac_macho_reader_unittest-dwarf2reader.obj `if test -f 'src/common/dwarf/dwarf2reader.cc'; then $(CYGPATH_W) 'src/common/dwarf/dwarf2reader.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf/dwarf2reader.cc'; fi`
-src/testing/src/src_processor_cfi_frame_info_unittest-gmock-all.o: src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_cfi_frame_info_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/src/src_processor_cfi_frame_info_unittest-gmock-all.o -MD -MP -MF src/testing/src/$(DEPDIR)/src_processor_cfi_frame_info_unittest-gmock-all.Tpo -c -o src/testing/src/src_processor_cfi_frame_info_unittest-gmock-all.o `test -f 'src/testing/src/gmock-all.cc' || echo '$(srcdir)/'`src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/src/$(DEPDIR)/src_processor_cfi_frame_info_unittest-gmock-all.Tpo src/testing/src/$(DEPDIR)/src_processor_cfi_frame_info_unittest-gmock-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/src/gmock-all.cc' object='src/testing/src/src_processor_cfi_frame_info_unittest-gmock-all.o' libtool=no @AMDEPBACKSLASH@
+src/common/dwarf/src_common_mac_macho_reader_unittest-elf_reader.o: src/common/dwarf/elf_reader.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/dwarf/src_common_mac_macho_reader_unittest-elf_reader.o -MD -MP -MF src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-elf_reader.Tpo -c -o src/common/dwarf/src_common_mac_macho_reader_unittest-elf_reader.o `test -f 'src/common/dwarf/elf_reader.cc' || echo '$(srcdir)/'`src/common/dwarf/elf_reader.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-elf_reader.Tpo src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-elf_reader.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf/elf_reader.cc' object='src/common/dwarf/src_common_mac_macho_reader_unittest-elf_reader.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_cfi_frame_info_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/src/src_processor_cfi_frame_info_unittest-gmock-all.o `test -f 'src/testing/src/gmock-all.cc' || echo '$(srcdir)/'`src/testing/src/gmock-all.cc
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/dwarf/src_common_mac_macho_reader_unittest-elf_reader.o `test -f 'src/common/dwarf/elf_reader.cc' || echo '$(srcdir)/'`src/common/dwarf/elf_reader.cc
-src/testing/src/src_processor_cfi_frame_info_unittest-gmock-all.obj: src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_cfi_frame_info_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/src/src_processor_cfi_frame_info_unittest-gmock-all.obj -MD -MP -MF src/testing/src/$(DEPDIR)/src_processor_cfi_frame_info_unittest-gmock-all.Tpo -c -o src/testing/src/src_processor_cfi_frame_info_unittest-gmock-all.obj `if test -f 'src/testing/src/gmock-all.cc'; then $(CYGPATH_W) 'src/testing/src/gmock-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/src/gmock-all.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/src/$(DEPDIR)/src_processor_cfi_frame_info_unittest-gmock-all.Tpo src/testing/src/$(DEPDIR)/src_processor_cfi_frame_info_unittest-gmock-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/src/gmock-all.cc' object='src/testing/src/src_processor_cfi_frame_info_unittest-gmock-all.obj' libtool=no @AMDEPBACKSLASH@
+src/common/dwarf/src_common_mac_macho_reader_unittest-elf_reader.obj: src/common/dwarf/elf_reader.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/dwarf/src_common_mac_macho_reader_unittest-elf_reader.obj -MD -MP -MF src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-elf_reader.Tpo -c -o src/common/dwarf/src_common_mac_macho_reader_unittest-elf_reader.obj `if test -f 'src/common/dwarf/elf_reader.cc'; then $(CYGPATH_W) 'src/common/dwarf/elf_reader.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf/elf_reader.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-elf_reader.Tpo src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-elf_reader.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf/elf_reader.cc' object='src/common/dwarf/src_common_mac_macho_reader_unittest-elf_reader.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_cfi_frame_info_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/src/src_processor_cfi_frame_info_unittest-gmock-all.obj `if test -f 'src/testing/src/gmock-all.cc'; then $(CYGPATH_W) 'src/testing/src/gmock-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/src/gmock-all.cc'; fi`
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/dwarf/src_common_mac_macho_reader_unittest-elf_reader.obj `if test -f 'src/common/dwarf/elf_reader.cc'; then $(CYGPATH_W) 'src/common/dwarf/elf_reader.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf/elf_reader.cc'; fi`
-src/processor/src_processor_disassembler_x86_unittest-disassembler_x86_unittest.o: src/processor/disassembler_x86_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_disassembler_x86_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_disassembler_x86_unittest-disassembler_x86_unittest.o -MD -MP -MF src/processor/$(DEPDIR)/src_processor_disassembler_x86_unittest-disassembler_x86_unittest.Tpo -c -o src/processor/src_processor_disassembler_x86_unittest-disassembler_x86_unittest.o `test -f 'src/processor/disassembler_x86_unittest.cc' || echo '$(srcdir)/'`src/processor/disassembler_x86_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_disassembler_x86_unittest-disassembler_x86_unittest.Tpo src/processor/$(DEPDIR)/src_processor_disassembler_x86_unittest-disassembler_x86_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/disassembler_x86_unittest.cc' object='src/processor/src_processor_disassembler_x86_unittest-disassembler_x86_unittest.o' libtool=no @AMDEPBACKSLASH@
+src/common/mac/src_common_mac_macho_reader_unittest-arch_utilities.o: src/common/mac/arch_utilities.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/mac/src_common_mac_macho_reader_unittest-arch_utilities.o -MD -MP -MF src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-arch_utilities.Tpo -c -o src/common/mac/src_common_mac_macho_reader_unittest-arch_utilities.o `test -f 'src/common/mac/arch_utilities.cc' || echo '$(srcdir)/'`src/common/mac/arch_utilities.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-arch_utilities.Tpo src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-arch_utilities.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/mac/arch_utilities.cc' object='src/common/mac/src_common_mac_macho_reader_unittest-arch_utilities.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_disassembler_x86_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_disassembler_x86_unittest-disassembler_x86_unittest.o `test -f 'src/processor/disassembler_x86_unittest.cc' || echo '$(srcdir)/'`src/processor/disassembler_x86_unittest.cc
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/mac/src_common_mac_macho_reader_unittest-arch_utilities.o `test -f 'src/common/mac/arch_utilities.cc' || echo '$(srcdir)/'`src/common/mac/arch_utilities.cc
-src/processor/src_processor_disassembler_x86_unittest-disassembler_x86_unittest.obj: src/processor/disassembler_x86_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_disassembler_x86_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_disassembler_x86_unittest-disassembler_x86_unittest.obj -MD -MP -MF src/processor/$(DEPDIR)/src_processor_disassembler_x86_unittest-disassembler_x86_unittest.Tpo -c -o src/processor/src_processor_disassembler_x86_unittest-disassembler_x86_unittest.obj `if test -f 'src/processor/disassembler_x86_unittest.cc'; then $(CYGPATH_W) 'src/processor/disassembler_x86_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/disassembler_x86_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_disassembler_x86_unittest-disassembler_x86_unittest.Tpo src/processor/$(DEPDIR)/src_processor_disassembler_x86_unittest-disassembler_x86_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/disassembler_x86_unittest.cc' object='src/processor/src_processor_disassembler_x86_unittest-disassembler_x86_unittest.obj' libtool=no @AMDEPBACKSLASH@
+src/common/mac/src_common_mac_macho_reader_unittest-arch_utilities.obj: src/common/mac/arch_utilities.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/mac/src_common_mac_macho_reader_unittest-arch_utilities.obj -MD -MP -MF src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-arch_utilities.Tpo -c -o src/common/mac/src_common_mac_macho_reader_unittest-arch_utilities.obj `if test -f 'src/common/mac/arch_utilities.cc'; then $(CYGPATH_W) 'src/common/mac/arch_utilities.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/mac/arch_utilities.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-arch_utilities.Tpo src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-arch_utilities.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/mac/arch_utilities.cc' object='src/common/mac/src_common_mac_macho_reader_unittest-arch_utilities.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_disassembler_x86_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_disassembler_x86_unittest-disassembler_x86_unittest.obj `if test -f 'src/processor/disassembler_x86_unittest.cc'; then $(CYGPATH_W) 'src/processor/disassembler_x86_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/disassembler_x86_unittest.cc'; fi`
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/mac/src_common_mac_macho_reader_unittest-arch_utilities.obj `if test -f 'src/common/mac/arch_utilities.cc'; then $(CYGPATH_W) 'src/common/mac/arch_utilities.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/mac/arch_utilities.cc'; fi`
-src/testing/gtest/src/src_processor_disassembler_x86_unittest-gtest-all.o: src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_disassembler_x86_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_processor_disassembler_x86_unittest-gtest-all.o -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_processor_disassembler_x86_unittest-gtest-all.Tpo -c -o src/testing/gtest/src/src_processor_disassembler_x86_unittest-gtest-all.o `test -f 'src/testing/gtest/src/gtest-all.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_processor_disassembler_x86_unittest-gtest-all.Tpo src/testing/gtest/src/$(DEPDIR)/src_processor_disassembler_x86_unittest-gtest-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest-all.cc' object='src/testing/gtest/src/src_processor_disassembler_x86_unittest-gtest-all.o' libtool=no @AMDEPBACKSLASH@
+src/common/mac/src_common_mac_macho_reader_unittest-file_id.o: src/common/mac/file_id.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/mac/src_common_mac_macho_reader_unittest-file_id.o -MD -MP -MF src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-file_id.Tpo -c -o src/common/mac/src_common_mac_macho_reader_unittest-file_id.o `test -f 'src/common/mac/file_id.cc' || echo '$(srcdir)/'`src/common/mac/file_id.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-file_id.Tpo src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-file_id.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/mac/file_id.cc' object='src/common/mac/src_common_mac_macho_reader_unittest-file_id.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_disassembler_x86_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_processor_disassembler_x86_unittest-gtest-all.o `test -f 'src/testing/gtest/src/gtest-all.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest-all.cc
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/mac/src_common_mac_macho_reader_unittest-file_id.o `test -f 'src/common/mac/file_id.cc' || echo '$(srcdir)/'`src/common/mac/file_id.cc
-src/testing/gtest/src/src_processor_disassembler_x86_unittest-gtest-all.obj: src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_disassembler_x86_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_processor_disassembler_x86_unittest-gtest-all.obj -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_processor_disassembler_x86_unittest-gtest-all.Tpo -c -o src/testing/gtest/src/src_processor_disassembler_x86_unittest-gtest-all.obj `if test -f 'src/testing/gtest/src/gtest-all.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest-all.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_processor_disassembler_x86_unittest-gtest-all.Tpo src/testing/gtest/src/$(DEPDIR)/src_processor_disassembler_x86_unittest-gtest-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest-all.cc' object='src/testing/gtest/src/src_processor_disassembler_x86_unittest-gtest-all.obj' libtool=no @AMDEPBACKSLASH@
+src/common/mac/src_common_mac_macho_reader_unittest-file_id.obj: src/common/mac/file_id.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/mac/src_common_mac_macho_reader_unittest-file_id.obj -MD -MP -MF src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-file_id.Tpo -c -o src/common/mac/src_common_mac_macho_reader_unittest-file_id.obj `if test -f 'src/common/mac/file_id.cc'; then $(CYGPATH_W) 'src/common/mac/file_id.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/mac/file_id.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-file_id.Tpo src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-file_id.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/mac/file_id.cc' object='src/common/mac/src_common_mac_macho_reader_unittest-file_id.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_disassembler_x86_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_processor_disassembler_x86_unittest-gtest-all.obj `if test -f 'src/testing/gtest/src/gtest-all.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest-all.cc'; fi`
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/mac/src_common_mac_macho_reader_unittest-file_id.obj `if test -f 'src/common/mac/file_id.cc'; then $(CYGPATH_W) 'src/common/mac/file_id.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/mac/file_id.cc'; fi`
-src/testing/gtest/src/src_processor_disassembler_x86_unittest-gtest_main.o: src/testing/gtest/src/gtest_main.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_disassembler_x86_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_processor_disassembler_x86_unittest-gtest_main.o -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_processor_disassembler_x86_unittest-gtest_main.Tpo -c -o src/testing/gtest/src/src_processor_disassembler_x86_unittest-gtest_main.o `test -f 'src/testing/gtest/src/gtest_main.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest_main.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_processor_disassembler_x86_unittest-gtest_main.Tpo src/testing/gtest/src/$(DEPDIR)/src_processor_disassembler_x86_unittest-gtest_main.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest_main.cc' object='src/testing/gtest/src/src_processor_disassembler_x86_unittest-gtest_main.o' libtool=no @AMDEPBACKSLASH@
+src/common/mac/src_common_mac_macho_reader_unittest-macho_id.o: src/common/mac/macho_id.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/mac/src_common_mac_macho_reader_unittest-macho_id.o -MD -MP -MF src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_id.Tpo -c -o src/common/mac/src_common_mac_macho_reader_unittest-macho_id.o `test -f 'src/common/mac/macho_id.cc' || echo '$(srcdir)/'`src/common/mac/macho_id.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_id.Tpo src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_id.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/mac/macho_id.cc' object='src/common/mac/src_common_mac_macho_reader_unittest-macho_id.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_disassembler_x86_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_processor_disassembler_x86_unittest-gtest_main.o `test -f 'src/testing/gtest/src/gtest_main.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest_main.cc
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/mac/src_common_mac_macho_reader_unittest-macho_id.o `test -f 'src/common/mac/macho_id.cc' || echo '$(srcdir)/'`src/common/mac/macho_id.cc
-src/testing/gtest/src/src_processor_disassembler_x86_unittest-gtest_main.obj: src/testing/gtest/src/gtest_main.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_disassembler_x86_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_processor_disassembler_x86_unittest-gtest_main.obj -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_processor_disassembler_x86_unittest-gtest_main.Tpo -c -o src/testing/gtest/src/src_processor_disassembler_x86_unittest-gtest_main.obj `if test -f 'src/testing/gtest/src/gtest_main.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest_main.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest_main.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_processor_disassembler_x86_unittest-gtest_main.Tpo src/testing/gtest/src/$(DEPDIR)/src_processor_disassembler_x86_unittest-gtest_main.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest_main.cc' object='src/testing/gtest/src/src_processor_disassembler_x86_unittest-gtest_main.obj' libtool=no @AMDEPBACKSLASH@
+src/common/mac/src_common_mac_macho_reader_unittest-macho_id.obj: src/common/mac/macho_id.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/mac/src_common_mac_macho_reader_unittest-macho_id.obj -MD -MP -MF src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_id.Tpo -c -o src/common/mac/src_common_mac_macho_reader_unittest-macho_id.obj `if test -f 'src/common/mac/macho_id.cc'; then $(CYGPATH_W) 'src/common/mac/macho_id.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/mac/macho_id.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_id.Tpo src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_id.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/mac/macho_id.cc' object='src/common/mac/src_common_mac_macho_reader_unittest-macho_id.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_disassembler_x86_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_processor_disassembler_x86_unittest-gtest_main.obj `if test -f 'src/testing/gtest/src/gtest_main.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest_main.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest_main.cc'; fi`
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/mac/src_common_mac_macho_reader_unittest-macho_id.obj `if test -f 'src/common/mac/macho_id.cc'; then $(CYGPATH_W) 'src/common/mac/macho_id.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/mac/macho_id.cc'; fi`
-src/testing/src/src_processor_disassembler_x86_unittest-gmock-all.o: src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_disassembler_x86_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/src/src_processor_disassembler_x86_unittest-gmock-all.o -MD -MP -MF src/testing/src/$(DEPDIR)/src_processor_disassembler_x86_unittest-gmock-all.Tpo -c -o src/testing/src/src_processor_disassembler_x86_unittest-gmock-all.o `test -f 'src/testing/src/gmock-all.cc' || echo '$(srcdir)/'`src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/src/$(DEPDIR)/src_processor_disassembler_x86_unittest-gmock-all.Tpo src/testing/src/$(DEPDIR)/src_processor_disassembler_x86_unittest-gmock-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/src/gmock-all.cc' object='src/testing/src/src_processor_disassembler_x86_unittest-gmock-all.o' libtool=no @AMDEPBACKSLASH@
+src/common/mac/src_common_mac_macho_reader_unittest-macho_reader.o: src/common/mac/macho_reader.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/mac/src_common_mac_macho_reader_unittest-macho_reader.o -MD -MP -MF src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_reader.Tpo -c -o src/common/mac/src_common_mac_macho_reader_unittest-macho_reader.o `test -f 'src/common/mac/macho_reader.cc' || echo '$(srcdir)/'`src/common/mac/macho_reader.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_reader.Tpo src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_reader.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/mac/macho_reader.cc' object='src/common/mac/src_common_mac_macho_reader_unittest-macho_reader.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_disassembler_x86_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/src/src_processor_disassembler_x86_unittest-gmock-all.o `test -f 'src/testing/src/gmock-all.cc' || echo '$(srcdir)/'`src/testing/src/gmock-all.cc
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/mac/src_common_mac_macho_reader_unittest-macho_reader.o `test -f 'src/common/mac/macho_reader.cc' || echo '$(srcdir)/'`src/common/mac/macho_reader.cc
-src/testing/src/src_processor_disassembler_x86_unittest-gmock-all.obj: src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_disassembler_x86_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/src/src_processor_disassembler_x86_unittest-gmock-all.obj -MD -MP -MF src/testing/src/$(DEPDIR)/src_processor_disassembler_x86_unittest-gmock-all.Tpo -c -o src/testing/src/src_processor_disassembler_x86_unittest-gmock-all.obj `if test -f 'src/testing/src/gmock-all.cc'; then $(CYGPATH_W) 'src/testing/src/gmock-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/src/gmock-all.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/src/$(DEPDIR)/src_processor_disassembler_x86_unittest-gmock-all.Tpo src/testing/src/$(DEPDIR)/src_processor_disassembler_x86_unittest-gmock-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/src/gmock-all.cc' object='src/testing/src/src_processor_disassembler_x86_unittest-gmock-all.obj' libtool=no @AMDEPBACKSLASH@
+src/common/mac/src_common_mac_macho_reader_unittest-macho_reader.obj: src/common/mac/macho_reader.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/mac/src_common_mac_macho_reader_unittest-macho_reader.obj -MD -MP -MF src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_reader.Tpo -c -o src/common/mac/src_common_mac_macho_reader_unittest-macho_reader.obj `if test -f 'src/common/mac/macho_reader.cc'; then $(CYGPATH_W) 'src/common/mac/macho_reader.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/mac/macho_reader.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_reader.Tpo src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_reader.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/mac/macho_reader.cc' object='src/common/mac/src_common_mac_macho_reader_unittest-macho_reader.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_disassembler_x86_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/src/src_processor_disassembler_x86_unittest-gmock-all.obj `if test -f 'src/testing/src/gmock-all.cc'; then $(CYGPATH_W) 'src/testing/src/gmock-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/src/gmock-all.cc'; fi`
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/mac/src_common_mac_macho_reader_unittest-macho_reader.obj `if test -f 'src/common/mac/macho_reader.cc'; then $(CYGPATH_W) 'src/common/mac/macho_reader.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/mac/macho_reader.cc'; fi`
-src/processor/src_processor_exploitability_unittest-exploitability_unittest.o: src/processor/exploitability_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_exploitability_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_exploitability_unittest-exploitability_unittest.o -MD -MP -MF src/processor/$(DEPDIR)/src_processor_exploitability_unittest-exploitability_unittest.Tpo -c -o src/processor/src_processor_exploitability_unittest-exploitability_unittest.o `test -f 'src/processor/exploitability_unittest.cc' || echo '$(srcdir)/'`src/processor/exploitability_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_exploitability_unittest-exploitability_unittest.Tpo src/processor/$(DEPDIR)/src_processor_exploitability_unittest-exploitability_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/exploitability_unittest.cc' object='src/processor/src_processor_exploitability_unittest-exploitability_unittest.o' libtool=no @AMDEPBACKSLASH@
+src/common/mac/src_common_mac_macho_reader_unittest-macho_reader_unittest.o: src/common/mac/macho_reader_unittest.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/mac/src_common_mac_macho_reader_unittest-macho_reader_unittest.o -MD -MP -MF src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_reader_unittest.Tpo -c -o src/common/mac/src_common_mac_macho_reader_unittest-macho_reader_unittest.o `test -f 'src/common/mac/macho_reader_unittest.cc' || echo '$(srcdir)/'`src/common/mac/macho_reader_unittest.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_reader_unittest.Tpo src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_reader_unittest.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/mac/macho_reader_unittest.cc' object='src/common/mac/src_common_mac_macho_reader_unittest-macho_reader_unittest.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_exploitability_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_exploitability_unittest-exploitability_unittest.o `test -f 'src/processor/exploitability_unittest.cc' || echo '$(srcdir)/'`src/processor/exploitability_unittest.cc
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/mac/src_common_mac_macho_reader_unittest-macho_reader_unittest.o `test -f 'src/common/mac/macho_reader_unittest.cc' || echo '$(srcdir)/'`src/common/mac/macho_reader_unittest.cc
-src/processor/src_processor_exploitability_unittest-exploitability_unittest.obj: src/processor/exploitability_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_exploitability_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_exploitability_unittest-exploitability_unittest.obj -MD -MP -MF src/processor/$(DEPDIR)/src_processor_exploitability_unittest-exploitability_unittest.Tpo -c -o src/processor/src_processor_exploitability_unittest-exploitability_unittest.obj `if test -f 'src/processor/exploitability_unittest.cc'; then $(CYGPATH_W) 'src/processor/exploitability_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/exploitability_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_exploitability_unittest-exploitability_unittest.Tpo src/processor/$(DEPDIR)/src_processor_exploitability_unittest-exploitability_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/exploitability_unittest.cc' object='src/processor/src_processor_exploitability_unittest-exploitability_unittest.obj' libtool=no @AMDEPBACKSLASH@
+src/common/mac/src_common_mac_macho_reader_unittest-macho_reader_unittest.obj: src/common/mac/macho_reader_unittest.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/mac/src_common_mac_macho_reader_unittest-macho_reader_unittest.obj -MD -MP -MF src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_reader_unittest.Tpo -c -o src/common/mac/src_common_mac_macho_reader_unittest-macho_reader_unittest.obj `if test -f 'src/common/mac/macho_reader_unittest.cc'; then $(CYGPATH_W) 'src/common/mac/macho_reader_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/mac/macho_reader_unittest.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_reader_unittest.Tpo src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_reader_unittest.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/mac/macho_reader_unittest.cc' object='src/common/mac/src_common_mac_macho_reader_unittest-macho_reader_unittest.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_exploitability_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_exploitability_unittest-exploitability_unittest.obj `if test -f 'src/processor/exploitability_unittest.cc'; then $(CYGPATH_W) 'src/processor/exploitability_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/exploitability_unittest.cc'; fi`
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/mac/src_common_mac_macho_reader_unittest-macho_reader_unittest.obj `if test -f 'src/common/mac/macho_reader_unittest.cc'; then $(CYGPATH_W) 'src/common/mac/macho_reader_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/mac/macho_reader_unittest.cc'; fi`
+
+src/common/mac/src_common_mac_macho_reader_unittest-macho_utilities.o: src/common/mac/macho_utilities.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/mac/src_common_mac_macho_reader_unittest-macho_utilities.o -MD -MP -MF src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_utilities.Tpo -c -o src/common/mac/src_common_mac_macho_reader_unittest-macho_utilities.o `test -f 'src/common/mac/macho_utilities.cc' || echo '$(srcdir)/'`src/common/mac/macho_utilities.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_utilities.Tpo src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_utilities.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/mac/macho_utilities.cc' object='src/common/mac/src_common_mac_macho_reader_unittest-macho_utilities.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/mac/src_common_mac_macho_reader_unittest-macho_utilities.o `test -f 'src/common/mac/macho_utilities.cc' || echo '$(srcdir)/'`src/common/mac/macho_utilities.cc
+
+src/common/mac/src_common_mac_macho_reader_unittest-macho_utilities.obj: src/common/mac/macho_utilities.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/mac/src_common_mac_macho_reader_unittest-macho_utilities.obj -MD -MP -MF src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_utilities.Tpo -c -o src/common/mac/src_common_mac_macho_reader_unittest-macho_utilities.obj `if test -f 'src/common/mac/macho_utilities.cc'; then $(CYGPATH_W) 'src/common/mac/macho_utilities.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/mac/macho_utilities.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_utilities.Tpo src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_utilities.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/mac/macho_utilities.cc' object='src/common/mac/src_common_mac_macho_reader_unittest-macho_utilities.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/mac/src_common_mac_macho_reader_unittest-macho_utilities.obj `if test -f 'src/common/mac/macho_utilities.cc'; then $(CYGPATH_W) 'src/common/mac/macho_utilities.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/mac/macho_utilities.cc'; fi`
+
+src/common/mac/src_common_mac_macho_reader_unittest-macho_walker.o: src/common/mac/macho_walker.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/mac/src_common_mac_macho_reader_unittest-macho_walker.o -MD -MP -MF src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_walker.Tpo -c -o src/common/mac/src_common_mac_macho_reader_unittest-macho_walker.o `test -f 'src/common/mac/macho_walker.cc' || echo '$(srcdir)/'`src/common/mac/macho_walker.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_walker.Tpo src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_walker.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/mac/macho_walker.cc' object='src/common/mac/src_common_mac_macho_reader_unittest-macho_walker.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/mac/src_common_mac_macho_reader_unittest-macho_walker.o `test -f 'src/common/mac/macho_walker.cc' || echo '$(srcdir)/'`src/common/mac/macho_walker.cc
+
+src/common/mac/src_common_mac_macho_reader_unittest-macho_walker.obj: src/common/mac/macho_walker.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/mac/src_common_mac_macho_reader_unittest-macho_walker.obj -MD -MP -MF src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_walker.Tpo -c -o src/common/mac/src_common_mac_macho_reader_unittest-macho_walker.obj `if test -f 'src/common/mac/macho_walker.cc'; then $(CYGPATH_W) 'src/common/mac/macho_walker.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/mac/macho_walker.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_walker.Tpo src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_walker.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/mac/macho_walker.cc' object='src/common/mac/src_common_mac_macho_reader_unittest-macho_walker.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/mac/src_common_mac_macho_reader_unittest-macho_walker.obj `if test -f 'src/common/mac/macho_walker.cc'; then $(CYGPATH_W) 'src/common/mac/macho_walker.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/mac/macho_walker.cc'; fi`
+
+src/common/tests/src_common_mac_macho_reader_unittest-file_utils.o: src/common/tests/file_utils.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/tests/src_common_mac_macho_reader_unittest-file_utils.o -MD -MP -MF src/common/tests/$(DEPDIR)/src_common_mac_macho_reader_unittest-file_utils.Tpo -c -o src/common/tests/src_common_mac_macho_reader_unittest-file_utils.o `test -f 'src/common/tests/file_utils.cc' || echo '$(srcdir)/'`src/common/tests/file_utils.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/tests/$(DEPDIR)/src_common_mac_macho_reader_unittest-file_utils.Tpo src/common/tests/$(DEPDIR)/src_common_mac_macho_reader_unittest-file_utils.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/tests/file_utils.cc' object='src/common/tests/src_common_mac_macho_reader_unittest-file_utils.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/tests/src_common_mac_macho_reader_unittest-file_utils.o `test -f 'src/common/tests/file_utils.cc' || echo '$(srcdir)/'`src/common/tests/file_utils.cc
+
+src/common/tests/src_common_mac_macho_reader_unittest-file_utils.obj: src/common/tests/file_utils.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/tests/src_common_mac_macho_reader_unittest-file_utils.obj -MD -MP -MF src/common/tests/$(DEPDIR)/src_common_mac_macho_reader_unittest-file_utils.Tpo -c -o src/common/tests/src_common_mac_macho_reader_unittest-file_utils.obj `if test -f 'src/common/tests/file_utils.cc'; then $(CYGPATH_W) 'src/common/tests/file_utils.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/tests/file_utils.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/tests/$(DEPDIR)/src_common_mac_macho_reader_unittest-file_utils.Tpo src/common/tests/$(DEPDIR)/src_common_mac_macho_reader_unittest-file_utils.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/tests/file_utils.cc' object='src/common/tests/src_common_mac_macho_reader_unittest-file_utils.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/tests/src_common_mac_macho_reader_unittest-file_utils.obj `if test -f 'src/common/tests/file_utils.cc'; then $(CYGPATH_W) 'src/common/tests/file_utils.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/tests/file_utils.cc'; fi`
+
+src/common/src_common_test_assembler_unittest-test_assembler.o: src/common/test_assembler.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_test_assembler_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_test_assembler_unittest-test_assembler.o -MD -MP -MF src/common/$(DEPDIR)/src_common_test_assembler_unittest-test_assembler.Tpo -c -o src/common/src_common_test_assembler_unittest-test_assembler.o `test -f 'src/common/test_assembler.cc' || echo '$(srcdir)/'`src/common/test_assembler.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_test_assembler_unittest-test_assembler.Tpo src/common/$(DEPDIR)/src_common_test_assembler_unittest-test_assembler.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/test_assembler.cc' object='src/common/src_common_test_assembler_unittest-test_assembler.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_test_assembler_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_test_assembler_unittest-test_assembler.o `test -f 'src/common/test_assembler.cc' || echo '$(srcdir)/'`src/common/test_assembler.cc
+
+src/common/src_common_test_assembler_unittest-test_assembler.obj: src/common/test_assembler.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_test_assembler_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_test_assembler_unittest-test_assembler.obj -MD -MP -MF src/common/$(DEPDIR)/src_common_test_assembler_unittest-test_assembler.Tpo -c -o src/common/src_common_test_assembler_unittest-test_assembler.obj `if test -f 'src/common/test_assembler.cc'; then $(CYGPATH_W) 'src/common/test_assembler.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/test_assembler.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_test_assembler_unittest-test_assembler.Tpo src/common/$(DEPDIR)/src_common_test_assembler_unittest-test_assembler.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/test_assembler.cc' object='src/common/src_common_test_assembler_unittest-test_assembler.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_test_assembler_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_test_assembler_unittest-test_assembler.obj `if test -f 'src/common/test_assembler.cc'; then $(CYGPATH_W) 'src/common/test_assembler.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/test_assembler.cc'; fi`
+
+src/common/src_common_test_assembler_unittest-test_assembler_unittest.o: src/common/test_assembler_unittest.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_test_assembler_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_test_assembler_unittest-test_assembler_unittest.o -MD -MP -MF src/common/$(DEPDIR)/src_common_test_assembler_unittest-test_assembler_unittest.Tpo -c -o src/common/src_common_test_assembler_unittest-test_assembler_unittest.o `test -f 'src/common/test_assembler_unittest.cc' || echo '$(srcdir)/'`src/common/test_assembler_unittest.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_test_assembler_unittest-test_assembler_unittest.Tpo src/common/$(DEPDIR)/src_common_test_assembler_unittest-test_assembler_unittest.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/test_assembler_unittest.cc' object='src/common/src_common_test_assembler_unittest-test_assembler_unittest.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_test_assembler_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_test_assembler_unittest-test_assembler_unittest.o `test -f 'src/common/test_assembler_unittest.cc' || echo '$(srcdir)/'`src/common/test_assembler_unittest.cc
+
+src/common/src_common_test_assembler_unittest-test_assembler_unittest.obj: src/common/test_assembler_unittest.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_test_assembler_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_test_assembler_unittest-test_assembler_unittest.obj -MD -MP -MF src/common/$(DEPDIR)/src_common_test_assembler_unittest-test_assembler_unittest.Tpo -c -o src/common/src_common_test_assembler_unittest-test_assembler_unittest.obj `if test -f 'src/common/test_assembler_unittest.cc'; then $(CYGPATH_W) 'src/common/test_assembler_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/test_assembler_unittest.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_test_assembler_unittest-test_assembler_unittest.Tpo src/common/$(DEPDIR)/src_common_test_assembler_unittest-test_assembler_unittest.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/test_assembler_unittest.cc' object='src/common/src_common_test_assembler_unittest-test_assembler_unittest.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_test_assembler_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_test_assembler_unittest-test_assembler_unittest.obj `if test -f 'src/common/test_assembler_unittest.cc'; then $(CYGPATH_W) 'src/common/test_assembler_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/test_assembler_unittest.cc'; fi`
-src/testing/gtest/src/src_processor_exploitability_unittest-gtest-all.o: src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_exploitability_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_processor_exploitability_unittest-gtest-all.o -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_processor_exploitability_unittest-gtest-all.Tpo -c -o src/testing/gtest/src/src_processor_exploitability_unittest-gtest-all.o `test -f 'src/testing/gtest/src/gtest-all.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_processor_exploitability_unittest-gtest-all.Tpo src/testing/gtest/src/$(DEPDIR)/src_processor_exploitability_unittest-gtest-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest-all.cc' object='src/testing/gtest/src/src_processor_exploitability_unittest-gtest-all.o' libtool=no @AMDEPBACKSLASH@
+src/processor/src_processor_basic_source_line_resolver_unittest-basic_source_line_resolver_unittest.o: src/processor/basic_source_line_resolver_unittest.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_basic_source_line_resolver_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_basic_source_line_resolver_unittest-basic_source_line_resolver_unittest.o -MD -MP -MF src/processor/$(DEPDIR)/src_processor_basic_source_line_resolver_unittest-basic_source_line_resolver_unittest.Tpo -c -o src/processor/src_processor_basic_source_line_resolver_unittest-basic_source_line_resolver_unittest.o `test -f 'src/processor/basic_source_line_resolver_unittest.cc' || echo '$(srcdir)/'`src/processor/basic_source_line_resolver_unittest.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_basic_source_line_resolver_unittest-basic_source_line_resolver_unittest.Tpo src/processor/$(DEPDIR)/src_processor_basic_source_line_resolver_unittest-basic_source_line_resolver_unittest.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/basic_source_line_resolver_unittest.cc' object='src/processor/src_processor_basic_source_line_resolver_unittest-basic_source_line_resolver_unittest.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_exploitability_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_processor_exploitability_unittest-gtest-all.o `test -f 'src/testing/gtest/src/gtest-all.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest-all.cc
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_basic_source_line_resolver_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_basic_source_line_resolver_unittest-basic_source_line_resolver_unittest.o `test -f 'src/processor/basic_source_line_resolver_unittest.cc' || echo '$(srcdir)/'`src/processor/basic_source_line_resolver_unittest.cc
-src/testing/gtest/src/src_processor_exploitability_unittest-gtest-all.obj: src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_exploitability_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_processor_exploitability_unittest-gtest-all.obj -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_processor_exploitability_unittest-gtest-all.Tpo -c -o src/testing/gtest/src/src_processor_exploitability_unittest-gtest-all.obj `if test -f 'src/testing/gtest/src/gtest-all.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest-all.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_processor_exploitability_unittest-gtest-all.Tpo src/testing/gtest/src/$(DEPDIR)/src_processor_exploitability_unittest-gtest-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest-all.cc' object='src/testing/gtest/src/src_processor_exploitability_unittest-gtest-all.obj' libtool=no @AMDEPBACKSLASH@
+src/processor/src_processor_basic_source_line_resolver_unittest-basic_source_line_resolver_unittest.obj: src/processor/basic_source_line_resolver_unittest.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_basic_source_line_resolver_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_basic_source_line_resolver_unittest-basic_source_line_resolver_unittest.obj -MD -MP -MF src/processor/$(DEPDIR)/src_processor_basic_source_line_resolver_unittest-basic_source_line_resolver_unittest.Tpo -c -o src/processor/src_processor_basic_source_line_resolver_unittest-basic_source_line_resolver_unittest.obj `if test -f 'src/processor/basic_source_line_resolver_unittest.cc'; then $(CYGPATH_W) 'src/processor/basic_source_line_resolver_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/basic_source_line_resolver_unittest.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_basic_source_line_resolver_unittest-basic_source_line_resolver_unittest.Tpo src/processor/$(DEPDIR)/src_processor_basic_source_line_resolver_unittest-basic_source_line_resolver_unittest.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/basic_source_line_resolver_unittest.cc' object='src/processor/src_processor_basic_source_line_resolver_unittest-basic_source_line_resolver_unittest.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_exploitability_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_processor_exploitability_unittest-gtest-all.obj `if test -f 'src/testing/gtest/src/gtest-all.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest-all.cc'; fi`
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_basic_source_line_resolver_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_basic_source_line_resolver_unittest-basic_source_line_resolver_unittest.obj `if test -f 'src/processor/basic_source_line_resolver_unittest.cc'; then $(CYGPATH_W) 'src/processor/basic_source_line_resolver_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/basic_source_line_resolver_unittest.cc'; fi`
-src/testing/gtest/src/src_processor_exploitability_unittest-gtest_main.o: src/testing/gtest/src/gtest_main.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_exploitability_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_processor_exploitability_unittest-gtest_main.o -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_processor_exploitability_unittest-gtest_main.Tpo -c -o src/testing/gtest/src/src_processor_exploitability_unittest-gtest_main.o `test -f 'src/testing/gtest/src/gtest_main.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest_main.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_processor_exploitability_unittest-gtest_main.Tpo src/testing/gtest/src/$(DEPDIR)/src_processor_exploitability_unittest-gtest_main.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest_main.cc' object='src/testing/gtest/src/src_processor_exploitability_unittest-gtest_main.o' libtool=no @AMDEPBACKSLASH@
+src/processor/src_processor_cfi_frame_info_unittest-cfi_frame_info_unittest.o: src/processor/cfi_frame_info_unittest.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_cfi_frame_info_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_cfi_frame_info_unittest-cfi_frame_info_unittest.o -MD -MP -MF src/processor/$(DEPDIR)/src_processor_cfi_frame_info_unittest-cfi_frame_info_unittest.Tpo -c -o src/processor/src_processor_cfi_frame_info_unittest-cfi_frame_info_unittest.o `test -f 'src/processor/cfi_frame_info_unittest.cc' || echo '$(srcdir)/'`src/processor/cfi_frame_info_unittest.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_cfi_frame_info_unittest-cfi_frame_info_unittest.Tpo src/processor/$(DEPDIR)/src_processor_cfi_frame_info_unittest-cfi_frame_info_unittest.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/cfi_frame_info_unittest.cc' object='src/processor/src_processor_cfi_frame_info_unittest-cfi_frame_info_unittest.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_exploitability_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_processor_exploitability_unittest-gtest_main.o `test -f 'src/testing/gtest/src/gtest_main.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest_main.cc
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_cfi_frame_info_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_cfi_frame_info_unittest-cfi_frame_info_unittest.o `test -f 'src/processor/cfi_frame_info_unittest.cc' || echo '$(srcdir)/'`src/processor/cfi_frame_info_unittest.cc
-src/testing/gtest/src/src_processor_exploitability_unittest-gtest_main.obj: src/testing/gtest/src/gtest_main.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_exploitability_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_processor_exploitability_unittest-gtest_main.obj -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_processor_exploitability_unittest-gtest_main.Tpo -c -o src/testing/gtest/src/src_processor_exploitability_unittest-gtest_main.obj `if test -f 'src/testing/gtest/src/gtest_main.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest_main.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest_main.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_processor_exploitability_unittest-gtest_main.Tpo src/testing/gtest/src/$(DEPDIR)/src_processor_exploitability_unittest-gtest_main.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest_main.cc' object='src/testing/gtest/src/src_processor_exploitability_unittest-gtest_main.obj' libtool=no @AMDEPBACKSLASH@
+src/processor/src_processor_cfi_frame_info_unittest-cfi_frame_info_unittest.obj: src/processor/cfi_frame_info_unittest.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_cfi_frame_info_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_cfi_frame_info_unittest-cfi_frame_info_unittest.obj -MD -MP -MF src/processor/$(DEPDIR)/src_processor_cfi_frame_info_unittest-cfi_frame_info_unittest.Tpo -c -o src/processor/src_processor_cfi_frame_info_unittest-cfi_frame_info_unittest.obj `if test -f 'src/processor/cfi_frame_info_unittest.cc'; then $(CYGPATH_W) 'src/processor/cfi_frame_info_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/cfi_frame_info_unittest.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_cfi_frame_info_unittest-cfi_frame_info_unittest.Tpo src/processor/$(DEPDIR)/src_processor_cfi_frame_info_unittest-cfi_frame_info_unittest.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/cfi_frame_info_unittest.cc' object='src/processor/src_processor_cfi_frame_info_unittest-cfi_frame_info_unittest.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_exploitability_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_processor_exploitability_unittest-gtest_main.obj `if test -f 'src/testing/gtest/src/gtest_main.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest_main.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest_main.cc'; fi`
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_cfi_frame_info_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_cfi_frame_info_unittest-cfi_frame_info_unittest.obj `if test -f 'src/processor/cfi_frame_info_unittest.cc'; then $(CYGPATH_W) 'src/processor/cfi_frame_info_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/cfi_frame_info_unittest.cc'; fi`
-src/testing/src/src_processor_exploitability_unittest-gmock-all.o: src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_exploitability_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/src/src_processor_exploitability_unittest-gmock-all.o -MD -MP -MF src/testing/src/$(DEPDIR)/src_processor_exploitability_unittest-gmock-all.Tpo -c -o src/testing/src/src_processor_exploitability_unittest-gmock-all.o `test -f 'src/testing/src/gmock-all.cc' || echo '$(srcdir)/'`src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/src/$(DEPDIR)/src_processor_exploitability_unittest-gmock-all.Tpo src/testing/src/$(DEPDIR)/src_processor_exploitability_unittest-gmock-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/src/gmock-all.cc' object='src/testing/src/src_processor_exploitability_unittest-gmock-all.o' libtool=no @AMDEPBACKSLASH@
+src/processor/src_processor_disassembler_x86_unittest-disassembler_x86_unittest.o: src/processor/disassembler_x86_unittest.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_disassembler_x86_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_disassembler_x86_unittest-disassembler_x86_unittest.o -MD -MP -MF src/processor/$(DEPDIR)/src_processor_disassembler_x86_unittest-disassembler_x86_unittest.Tpo -c -o src/processor/src_processor_disassembler_x86_unittest-disassembler_x86_unittest.o `test -f 'src/processor/disassembler_x86_unittest.cc' || echo '$(srcdir)/'`src/processor/disassembler_x86_unittest.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_disassembler_x86_unittest-disassembler_x86_unittest.Tpo src/processor/$(DEPDIR)/src_processor_disassembler_x86_unittest-disassembler_x86_unittest.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/disassembler_x86_unittest.cc' object='src/processor/src_processor_disassembler_x86_unittest-disassembler_x86_unittest.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_exploitability_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/src/src_processor_exploitability_unittest-gmock-all.o `test -f 'src/testing/src/gmock-all.cc' || echo '$(srcdir)/'`src/testing/src/gmock-all.cc
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_disassembler_x86_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_disassembler_x86_unittest-disassembler_x86_unittest.o `test -f 'src/processor/disassembler_x86_unittest.cc' || echo '$(srcdir)/'`src/processor/disassembler_x86_unittest.cc
-src/testing/src/src_processor_exploitability_unittest-gmock-all.obj: src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_exploitability_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/src/src_processor_exploitability_unittest-gmock-all.obj -MD -MP -MF src/testing/src/$(DEPDIR)/src_processor_exploitability_unittest-gmock-all.Tpo -c -o src/testing/src/src_processor_exploitability_unittest-gmock-all.obj `if test -f 'src/testing/src/gmock-all.cc'; then $(CYGPATH_W) 'src/testing/src/gmock-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/src/gmock-all.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/src/$(DEPDIR)/src_processor_exploitability_unittest-gmock-all.Tpo src/testing/src/$(DEPDIR)/src_processor_exploitability_unittest-gmock-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/src/gmock-all.cc' object='src/testing/src/src_processor_exploitability_unittest-gmock-all.obj' libtool=no @AMDEPBACKSLASH@
+src/processor/src_processor_disassembler_x86_unittest-disassembler_x86_unittest.obj: src/processor/disassembler_x86_unittest.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_disassembler_x86_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_disassembler_x86_unittest-disassembler_x86_unittest.obj -MD -MP -MF src/processor/$(DEPDIR)/src_processor_disassembler_x86_unittest-disassembler_x86_unittest.Tpo -c -o src/processor/src_processor_disassembler_x86_unittest-disassembler_x86_unittest.obj `if test -f 'src/processor/disassembler_x86_unittest.cc'; then $(CYGPATH_W) 'src/processor/disassembler_x86_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/disassembler_x86_unittest.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_disassembler_x86_unittest-disassembler_x86_unittest.Tpo src/processor/$(DEPDIR)/src_processor_disassembler_x86_unittest-disassembler_x86_unittest.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/disassembler_x86_unittest.cc' object='src/processor/src_processor_disassembler_x86_unittest-disassembler_x86_unittest.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_exploitability_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/src/src_processor_exploitability_unittest-gmock-all.obj `if test -f 'src/testing/src/gmock-all.cc'; then $(CYGPATH_W) 'src/testing/src/gmock-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/src/gmock-all.cc'; fi`
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_disassembler_x86_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_disassembler_x86_unittest-disassembler_x86_unittest.obj `if test -f 'src/processor/disassembler_x86_unittest.cc'; then $(CYGPATH_W) 'src/processor/disassembler_x86_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/disassembler_x86_unittest.cc'; fi`
+
+src/processor/src_processor_exploitability_unittest-exploitability_unittest.o: src/processor/exploitability_unittest.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_exploitability_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_exploitability_unittest-exploitability_unittest.o -MD -MP -MF src/processor/$(DEPDIR)/src_processor_exploitability_unittest-exploitability_unittest.Tpo -c -o src/processor/src_processor_exploitability_unittest-exploitability_unittest.o `test -f 'src/processor/exploitability_unittest.cc' || echo '$(srcdir)/'`src/processor/exploitability_unittest.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_exploitability_unittest-exploitability_unittest.Tpo src/processor/$(DEPDIR)/src_processor_exploitability_unittest-exploitability_unittest.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/exploitability_unittest.cc' object='src/processor/src_processor_exploitability_unittest-exploitability_unittest.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_exploitability_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_exploitability_unittest-exploitability_unittest.o `test -f 'src/processor/exploitability_unittest.cc' || echo '$(srcdir)/'`src/processor/exploitability_unittest.cc
+
+src/processor/src_processor_exploitability_unittest-exploitability_unittest.obj: src/processor/exploitability_unittest.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_exploitability_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_exploitability_unittest-exploitability_unittest.obj -MD -MP -MF src/processor/$(DEPDIR)/src_processor_exploitability_unittest-exploitability_unittest.Tpo -c -o src/processor/src_processor_exploitability_unittest-exploitability_unittest.obj `if test -f 'src/processor/exploitability_unittest.cc'; then $(CYGPATH_W) 'src/processor/exploitability_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/exploitability_unittest.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_exploitability_unittest-exploitability_unittest.Tpo src/processor/$(DEPDIR)/src_processor_exploitability_unittest-exploitability_unittest.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/exploitability_unittest.cc' object='src/processor/src_processor_exploitability_unittest-exploitability_unittest.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_exploitability_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_exploitability_unittest-exploitability_unittest.obj `if test -f 'src/processor/exploitability_unittest.cc'; then $(CYGPATH_W) 'src/processor/exploitability_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/exploitability_unittest.cc'; fi`
src/processor/src_processor_fast_source_line_resolver_unittest-fast_source_line_resolver_unittest.o: src/processor/fast_source_line_resolver_unittest.cc
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_fast_source_line_resolver_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_fast_source_line_resolver_unittest-fast_source_line_resolver_unittest.o -MD -MP -MF src/processor/$(DEPDIR)/src_processor_fast_source_line_resolver_unittest-fast_source_line_resolver_unittest.Tpo -c -o src/processor/src_processor_fast_source_line_resolver_unittest-fast_source_line_resolver_unittest.o `test -f 'src/processor/fast_source_line_resolver_unittest.cc' || echo '$(srcdir)/'`src/processor/fast_source_line_resolver_unittest.cc
@@ -6047,34 +6785,6 @@ src/processor/src_processor_fast_source_line_resolver_unittest-fast_source_line_
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_fast_source_line_resolver_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_fast_source_line_resolver_unittest-fast_source_line_resolver_unittest.obj `if test -f 'src/processor/fast_source_line_resolver_unittest.cc'; then $(CYGPATH_W) 'src/processor/fast_source_line_resolver_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/fast_source_line_resolver_unittest.cc'; fi`
-src/testing/gtest/src/src_processor_fast_source_line_resolver_unittest-gtest-all.o: src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_fast_source_line_resolver_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_processor_fast_source_line_resolver_unittest-gtest-all.o -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_processor_fast_source_line_resolver_unittest-gtest-all.Tpo -c -o src/testing/gtest/src/src_processor_fast_source_line_resolver_unittest-gtest-all.o `test -f 'src/testing/gtest/src/gtest-all.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_processor_fast_source_line_resolver_unittest-gtest-all.Tpo src/testing/gtest/src/$(DEPDIR)/src_processor_fast_source_line_resolver_unittest-gtest-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest-all.cc' object='src/testing/gtest/src/src_processor_fast_source_line_resolver_unittest-gtest-all.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_fast_source_line_resolver_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_processor_fast_source_line_resolver_unittest-gtest-all.o `test -f 'src/testing/gtest/src/gtest-all.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest-all.cc
-
-src/testing/gtest/src/src_processor_fast_source_line_resolver_unittest-gtest-all.obj: src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_fast_source_line_resolver_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_processor_fast_source_line_resolver_unittest-gtest-all.obj -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_processor_fast_source_line_resolver_unittest-gtest-all.Tpo -c -o src/testing/gtest/src/src_processor_fast_source_line_resolver_unittest-gtest-all.obj `if test -f 'src/testing/gtest/src/gtest-all.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest-all.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_processor_fast_source_line_resolver_unittest-gtest-all.Tpo src/testing/gtest/src/$(DEPDIR)/src_processor_fast_source_line_resolver_unittest-gtest-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest-all.cc' object='src/testing/gtest/src/src_processor_fast_source_line_resolver_unittest-gtest-all.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_fast_source_line_resolver_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_processor_fast_source_line_resolver_unittest-gtest-all.obj `if test -f 'src/testing/gtest/src/gtest-all.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest-all.cc'; fi`
-
-src/testing/src/src_processor_fast_source_line_resolver_unittest-gmock-all.o: src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_fast_source_line_resolver_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/src/src_processor_fast_source_line_resolver_unittest-gmock-all.o -MD -MP -MF src/testing/src/$(DEPDIR)/src_processor_fast_source_line_resolver_unittest-gmock-all.Tpo -c -o src/testing/src/src_processor_fast_source_line_resolver_unittest-gmock-all.o `test -f 'src/testing/src/gmock-all.cc' || echo '$(srcdir)/'`src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/src/$(DEPDIR)/src_processor_fast_source_line_resolver_unittest-gmock-all.Tpo src/testing/src/$(DEPDIR)/src_processor_fast_source_line_resolver_unittest-gmock-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/src/gmock-all.cc' object='src/testing/src/src_processor_fast_source_line_resolver_unittest-gmock-all.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_fast_source_line_resolver_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/src/src_processor_fast_source_line_resolver_unittest-gmock-all.o `test -f 'src/testing/src/gmock-all.cc' || echo '$(srcdir)/'`src/testing/src/gmock-all.cc
-
-src/testing/src/src_processor_fast_source_line_resolver_unittest-gmock-all.obj: src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_fast_source_line_resolver_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/src/src_processor_fast_source_line_resolver_unittest-gmock-all.obj -MD -MP -MF src/testing/src/$(DEPDIR)/src_processor_fast_source_line_resolver_unittest-gmock-all.Tpo -c -o src/testing/src/src_processor_fast_source_line_resolver_unittest-gmock-all.obj `if test -f 'src/testing/src/gmock-all.cc'; then $(CYGPATH_W) 'src/testing/src/gmock-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/src/gmock-all.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/src/$(DEPDIR)/src_processor_fast_source_line_resolver_unittest-gmock-all.Tpo src/testing/src/$(DEPDIR)/src_processor_fast_source_line_resolver_unittest-gmock-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/src/gmock-all.cc' object='src/testing/src/src_processor_fast_source_line_resolver_unittest-gmock-all.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_fast_source_line_resolver_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/src/src_processor_fast_source_line_resolver_unittest-gmock-all.obj `if test -f 'src/testing/src/gmock-all.cc'; then $(CYGPATH_W) 'src/testing/src/gmock-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/src/gmock-all.cc'; fi`
-
src/processor/src_processor_map_serializers_unittest-map_serializers_unittest.o: src/processor/map_serializers_unittest.cc
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_map_serializers_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_map_serializers_unittest-map_serializers_unittest.o -MD -MP -MF src/processor/$(DEPDIR)/src_processor_map_serializers_unittest-map_serializers_unittest.Tpo -c -o src/processor/src_processor_map_serializers_unittest-map_serializers_unittest.o `test -f 'src/processor/map_serializers_unittest.cc' || echo '$(srcdir)/'`src/processor/map_serializers_unittest.cc
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_map_serializers_unittest-map_serializers_unittest.Tpo src/processor/$(DEPDIR)/src_processor_map_serializers_unittest-map_serializers_unittest.Po
@@ -6089,34 +6799,6 @@ src/processor/src_processor_map_serializers_unittest-map_serializers_unittest.ob
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_map_serializers_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_map_serializers_unittest-map_serializers_unittest.obj `if test -f 'src/processor/map_serializers_unittest.cc'; then $(CYGPATH_W) 'src/processor/map_serializers_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/map_serializers_unittest.cc'; fi`
-src/testing/gtest/src/src_processor_map_serializers_unittest-gtest-all.o: src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_map_serializers_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_processor_map_serializers_unittest-gtest-all.o -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_processor_map_serializers_unittest-gtest-all.Tpo -c -o src/testing/gtest/src/src_processor_map_serializers_unittest-gtest-all.o `test -f 'src/testing/gtest/src/gtest-all.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_processor_map_serializers_unittest-gtest-all.Tpo src/testing/gtest/src/$(DEPDIR)/src_processor_map_serializers_unittest-gtest-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest-all.cc' object='src/testing/gtest/src/src_processor_map_serializers_unittest-gtest-all.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_map_serializers_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_processor_map_serializers_unittest-gtest-all.o `test -f 'src/testing/gtest/src/gtest-all.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest-all.cc
-
-src/testing/gtest/src/src_processor_map_serializers_unittest-gtest-all.obj: src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_map_serializers_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_processor_map_serializers_unittest-gtest-all.obj -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_processor_map_serializers_unittest-gtest-all.Tpo -c -o src/testing/gtest/src/src_processor_map_serializers_unittest-gtest-all.obj `if test -f 'src/testing/gtest/src/gtest-all.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest-all.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_processor_map_serializers_unittest-gtest-all.Tpo src/testing/gtest/src/$(DEPDIR)/src_processor_map_serializers_unittest-gtest-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest-all.cc' object='src/testing/gtest/src/src_processor_map_serializers_unittest-gtest-all.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_map_serializers_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_processor_map_serializers_unittest-gtest-all.obj `if test -f 'src/testing/gtest/src/gtest-all.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest-all.cc'; fi`
-
-src/testing/src/src_processor_map_serializers_unittest-gmock-all.o: src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_map_serializers_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/src/src_processor_map_serializers_unittest-gmock-all.o -MD -MP -MF src/testing/src/$(DEPDIR)/src_processor_map_serializers_unittest-gmock-all.Tpo -c -o src/testing/src/src_processor_map_serializers_unittest-gmock-all.o `test -f 'src/testing/src/gmock-all.cc' || echo '$(srcdir)/'`src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/src/$(DEPDIR)/src_processor_map_serializers_unittest-gmock-all.Tpo src/testing/src/$(DEPDIR)/src_processor_map_serializers_unittest-gmock-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/src/gmock-all.cc' object='src/testing/src/src_processor_map_serializers_unittest-gmock-all.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_map_serializers_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/src/src_processor_map_serializers_unittest-gmock-all.o `test -f 'src/testing/src/gmock-all.cc' || echo '$(srcdir)/'`src/testing/src/gmock-all.cc
-
-src/testing/src/src_processor_map_serializers_unittest-gmock-all.obj: src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_map_serializers_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/src/src_processor_map_serializers_unittest-gmock-all.obj -MD -MP -MF src/testing/src/$(DEPDIR)/src_processor_map_serializers_unittest-gmock-all.Tpo -c -o src/testing/src/src_processor_map_serializers_unittest-gmock-all.obj `if test -f 'src/testing/src/gmock-all.cc'; then $(CYGPATH_W) 'src/testing/src/gmock-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/src/gmock-all.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/src/$(DEPDIR)/src_processor_map_serializers_unittest-gmock-all.Tpo src/testing/src/$(DEPDIR)/src_processor_map_serializers_unittest-gmock-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/src/gmock-all.cc' object='src/testing/src/src_processor_map_serializers_unittest-gmock-all.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_map_serializers_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/src/src_processor_map_serializers_unittest-gmock-all.obj `if test -f 'src/testing/src/gmock-all.cc'; then $(CYGPATH_W) 'src/testing/src/gmock-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/src/gmock-all.cc'; fi`
-
src/processor/src_processor_microdump_processor_unittest-microdump_processor_unittest.o: src/processor/microdump_processor_unittest.cc
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_microdump_processor_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_microdump_processor_unittest-microdump_processor_unittest.o -MD -MP -MF src/processor/$(DEPDIR)/src_processor_microdump_processor_unittest-microdump_processor_unittest.Tpo -c -o src/processor/src_processor_microdump_processor_unittest-microdump_processor_unittest.o `test -f 'src/processor/microdump_processor_unittest.cc' || echo '$(srcdir)/'`src/processor/microdump_processor_unittest.cc
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_microdump_processor_unittest-microdump_processor_unittest.Tpo src/processor/$(DEPDIR)/src_processor_microdump_processor_unittest-microdump_processor_unittest.Po
@@ -6131,34 +6813,6 @@ src/processor/src_processor_microdump_processor_unittest-microdump_processor_uni
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_microdump_processor_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_microdump_processor_unittest-microdump_processor_unittest.obj `if test -f 'src/processor/microdump_processor_unittest.cc'; then $(CYGPATH_W) 'src/processor/microdump_processor_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/microdump_processor_unittest.cc'; fi`
-src/testing/gtest/src/src_processor_microdump_processor_unittest-gtest-all.o: src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_microdump_processor_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_processor_microdump_processor_unittest-gtest-all.o -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_processor_microdump_processor_unittest-gtest-all.Tpo -c -o src/testing/gtest/src/src_processor_microdump_processor_unittest-gtest-all.o `test -f 'src/testing/gtest/src/gtest-all.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_processor_microdump_processor_unittest-gtest-all.Tpo src/testing/gtest/src/$(DEPDIR)/src_processor_microdump_processor_unittest-gtest-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest-all.cc' object='src/testing/gtest/src/src_processor_microdump_processor_unittest-gtest-all.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_microdump_processor_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_processor_microdump_processor_unittest-gtest-all.o `test -f 'src/testing/gtest/src/gtest-all.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest-all.cc
-
-src/testing/gtest/src/src_processor_microdump_processor_unittest-gtest-all.obj: src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_microdump_processor_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_processor_microdump_processor_unittest-gtest-all.obj -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_processor_microdump_processor_unittest-gtest-all.Tpo -c -o src/testing/gtest/src/src_processor_microdump_processor_unittest-gtest-all.obj `if test -f 'src/testing/gtest/src/gtest-all.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest-all.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_processor_microdump_processor_unittest-gtest-all.Tpo src/testing/gtest/src/$(DEPDIR)/src_processor_microdump_processor_unittest-gtest-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest-all.cc' object='src/testing/gtest/src/src_processor_microdump_processor_unittest-gtest-all.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_microdump_processor_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_processor_microdump_processor_unittest-gtest-all.obj `if test -f 'src/testing/gtest/src/gtest-all.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest-all.cc'; fi`
-
-src/testing/src/src_processor_microdump_processor_unittest-gmock-all.o: src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_microdump_processor_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/src/src_processor_microdump_processor_unittest-gmock-all.o -MD -MP -MF src/testing/src/$(DEPDIR)/src_processor_microdump_processor_unittest-gmock-all.Tpo -c -o src/testing/src/src_processor_microdump_processor_unittest-gmock-all.o `test -f 'src/testing/src/gmock-all.cc' || echo '$(srcdir)/'`src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/src/$(DEPDIR)/src_processor_microdump_processor_unittest-gmock-all.Tpo src/testing/src/$(DEPDIR)/src_processor_microdump_processor_unittest-gmock-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/src/gmock-all.cc' object='src/testing/src/src_processor_microdump_processor_unittest-gmock-all.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_microdump_processor_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/src/src_processor_microdump_processor_unittest-gmock-all.o `test -f 'src/testing/src/gmock-all.cc' || echo '$(srcdir)/'`src/testing/src/gmock-all.cc
-
-src/testing/src/src_processor_microdump_processor_unittest-gmock-all.obj: src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_microdump_processor_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/src/src_processor_microdump_processor_unittest-gmock-all.obj -MD -MP -MF src/testing/src/$(DEPDIR)/src_processor_microdump_processor_unittest-gmock-all.Tpo -c -o src/testing/src/src_processor_microdump_processor_unittest-gmock-all.obj `if test -f 'src/testing/src/gmock-all.cc'; then $(CYGPATH_W) 'src/testing/src/gmock-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/src/gmock-all.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/src/$(DEPDIR)/src_processor_microdump_processor_unittest-gmock-all.Tpo src/testing/src/$(DEPDIR)/src_processor_microdump_processor_unittest-gmock-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/src/gmock-all.cc' object='src/testing/src/src_processor_microdump_processor_unittest-gmock-all.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_microdump_processor_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/src/src_processor_microdump_processor_unittest-gmock-all.obj `if test -f 'src/testing/src/gmock-all.cc'; then $(CYGPATH_W) 'src/testing/src/gmock-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/src/gmock-all.cc'; fi`
-
src/processor/src_processor_minidump_processor_unittest-minidump_processor_unittest.o: src/processor/minidump_processor_unittest.cc
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_minidump_processor_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_minidump_processor_unittest-minidump_processor_unittest.o -MD -MP -MF src/processor/$(DEPDIR)/src_processor_minidump_processor_unittest-minidump_processor_unittest.Tpo -c -o src/processor/src_processor_minidump_processor_unittest-minidump_processor_unittest.o `test -f 'src/processor/minidump_processor_unittest.cc' || echo '$(srcdir)/'`src/processor/minidump_processor_unittest.cc
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_minidump_processor_unittest-minidump_processor_unittest.Tpo src/processor/$(DEPDIR)/src_processor_minidump_processor_unittest-minidump_processor_unittest.Po
@@ -6173,34 +6827,6 @@ src/processor/src_processor_minidump_processor_unittest-minidump_processor_unitt
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_minidump_processor_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_minidump_processor_unittest-minidump_processor_unittest.obj `if test -f 'src/processor/minidump_processor_unittest.cc'; then $(CYGPATH_W) 'src/processor/minidump_processor_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/minidump_processor_unittest.cc'; fi`
-src/testing/gtest/src/src_processor_minidump_processor_unittest-gtest-all.o: src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_minidump_processor_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_processor_minidump_processor_unittest-gtest-all.o -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_processor_minidump_processor_unittest-gtest-all.Tpo -c -o src/testing/gtest/src/src_processor_minidump_processor_unittest-gtest-all.o `test -f 'src/testing/gtest/src/gtest-all.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_processor_minidump_processor_unittest-gtest-all.Tpo src/testing/gtest/src/$(DEPDIR)/src_processor_minidump_processor_unittest-gtest-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest-all.cc' object='src/testing/gtest/src/src_processor_minidump_processor_unittest-gtest-all.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_minidump_processor_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_processor_minidump_processor_unittest-gtest-all.o `test -f 'src/testing/gtest/src/gtest-all.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest-all.cc
-
-src/testing/gtest/src/src_processor_minidump_processor_unittest-gtest-all.obj: src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_minidump_processor_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_processor_minidump_processor_unittest-gtest-all.obj -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_processor_minidump_processor_unittest-gtest-all.Tpo -c -o src/testing/gtest/src/src_processor_minidump_processor_unittest-gtest-all.obj `if test -f 'src/testing/gtest/src/gtest-all.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest-all.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_processor_minidump_processor_unittest-gtest-all.Tpo src/testing/gtest/src/$(DEPDIR)/src_processor_minidump_processor_unittest-gtest-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest-all.cc' object='src/testing/gtest/src/src_processor_minidump_processor_unittest-gtest-all.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_minidump_processor_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_processor_minidump_processor_unittest-gtest-all.obj `if test -f 'src/testing/gtest/src/gtest-all.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest-all.cc'; fi`
-
-src/testing/src/src_processor_minidump_processor_unittest-gmock-all.o: src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_minidump_processor_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/src/src_processor_minidump_processor_unittest-gmock-all.o -MD -MP -MF src/testing/src/$(DEPDIR)/src_processor_minidump_processor_unittest-gmock-all.Tpo -c -o src/testing/src/src_processor_minidump_processor_unittest-gmock-all.o `test -f 'src/testing/src/gmock-all.cc' || echo '$(srcdir)/'`src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/src/$(DEPDIR)/src_processor_minidump_processor_unittest-gmock-all.Tpo src/testing/src/$(DEPDIR)/src_processor_minidump_processor_unittest-gmock-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/src/gmock-all.cc' object='src/testing/src/src_processor_minidump_processor_unittest-gmock-all.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_minidump_processor_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/src/src_processor_minidump_processor_unittest-gmock-all.o `test -f 'src/testing/src/gmock-all.cc' || echo '$(srcdir)/'`src/testing/src/gmock-all.cc
-
-src/testing/src/src_processor_minidump_processor_unittest-gmock-all.obj: src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_minidump_processor_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/src/src_processor_minidump_processor_unittest-gmock-all.obj -MD -MP -MF src/testing/src/$(DEPDIR)/src_processor_minidump_processor_unittest-gmock-all.Tpo -c -o src/testing/src/src_processor_minidump_processor_unittest-gmock-all.obj `if test -f 'src/testing/src/gmock-all.cc'; then $(CYGPATH_W) 'src/testing/src/gmock-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/src/gmock-all.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/src/$(DEPDIR)/src_processor_minidump_processor_unittest-gmock-all.Tpo src/testing/src/$(DEPDIR)/src_processor_minidump_processor_unittest-gmock-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/src/gmock-all.cc' object='src/testing/src/src_processor_minidump_processor_unittest-gmock-all.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_minidump_processor_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/src/src_processor_minidump_processor_unittest-gmock-all.obj `if test -f 'src/testing/src/gmock-all.cc'; then $(CYGPATH_W) 'src/testing/src/gmock-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/src/gmock-all.cc'; fi`
-
src/common/src_processor_minidump_unittest-test_assembler.o: src/common/test_assembler.cc
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_minidump_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_processor_minidump_unittest-test_assembler.o -MD -MP -MF src/common/$(DEPDIR)/src_processor_minidump_unittest-test_assembler.Tpo -c -o src/common/src_processor_minidump_unittest-test_assembler.o `test -f 'src/common/test_assembler.cc' || echo '$(srcdir)/'`src/common/test_assembler.cc
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_processor_minidump_unittest-test_assembler.Tpo src/common/$(DEPDIR)/src_processor_minidump_unittest-test_assembler.Po
@@ -6243,47 +6869,61 @@ src/processor/src_processor_minidump_unittest-synth_minidump.obj: src/processor/
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_minidump_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_minidump_unittest-synth_minidump.obj `if test -f 'src/processor/synth_minidump.cc'; then $(CYGPATH_W) 'src/processor/synth_minidump.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/synth_minidump.cc'; fi`
-src/testing/gtest/src/src_processor_minidump_unittest-gtest-all.o: src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_minidump_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_processor_minidump_unittest-gtest-all.o -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_processor_minidump_unittest-gtest-all.Tpo -c -o src/testing/gtest/src/src_processor_minidump_unittest-gtest-all.o `test -f 'src/testing/gtest/src/gtest-all.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_processor_minidump_unittest-gtest-all.Tpo src/testing/gtest/src/$(DEPDIR)/src_processor_minidump_unittest-gtest-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest-all.cc' object='src/testing/gtest/src/src_processor_minidump_unittest-gtest-all.o' libtool=no @AMDEPBACKSLASH@
+src/processor/src_processor_proc_maps_linux_unittest-proc_maps_linux.o: src/processor/proc_maps_linux.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_proc_maps_linux_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_proc_maps_linux_unittest-proc_maps_linux.o -MD -MP -MF src/processor/$(DEPDIR)/src_processor_proc_maps_linux_unittest-proc_maps_linux.Tpo -c -o src/processor/src_processor_proc_maps_linux_unittest-proc_maps_linux.o `test -f 'src/processor/proc_maps_linux.cc' || echo '$(srcdir)/'`src/processor/proc_maps_linux.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_proc_maps_linux_unittest-proc_maps_linux.Tpo src/processor/$(DEPDIR)/src_processor_proc_maps_linux_unittest-proc_maps_linux.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/proc_maps_linux.cc' object='src/processor/src_processor_proc_maps_linux_unittest-proc_maps_linux.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_proc_maps_linux_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_proc_maps_linux_unittest-proc_maps_linux.o `test -f 'src/processor/proc_maps_linux.cc' || echo '$(srcdir)/'`src/processor/proc_maps_linux.cc
+
+src/processor/src_processor_proc_maps_linux_unittest-proc_maps_linux.obj: src/processor/proc_maps_linux.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_proc_maps_linux_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_proc_maps_linux_unittest-proc_maps_linux.obj -MD -MP -MF src/processor/$(DEPDIR)/src_processor_proc_maps_linux_unittest-proc_maps_linux.Tpo -c -o src/processor/src_processor_proc_maps_linux_unittest-proc_maps_linux.obj `if test -f 'src/processor/proc_maps_linux.cc'; then $(CYGPATH_W) 'src/processor/proc_maps_linux.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/proc_maps_linux.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_proc_maps_linux_unittest-proc_maps_linux.Tpo src/processor/$(DEPDIR)/src_processor_proc_maps_linux_unittest-proc_maps_linux.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/proc_maps_linux.cc' object='src/processor/src_processor_proc_maps_linux_unittest-proc_maps_linux.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_minidump_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_processor_minidump_unittest-gtest-all.o `test -f 'src/testing/gtest/src/gtest-all.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest-all.cc
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_proc_maps_linux_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_proc_maps_linux_unittest-proc_maps_linux.obj `if test -f 'src/processor/proc_maps_linux.cc'; then $(CYGPATH_W) 'src/processor/proc_maps_linux.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/proc_maps_linux.cc'; fi`
-src/testing/gtest/src/src_processor_minidump_unittest-gtest-all.obj: src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_minidump_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_processor_minidump_unittest-gtest-all.obj -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_processor_minidump_unittest-gtest-all.Tpo -c -o src/testing/gtest/src/src_processor_minidump_unittest-gtest-all.obj `if test -f 'src/testing/gtest/src/gtest-all.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest-all.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_processor_minidump_unittest-gtest-all.Tpo src/testing/gtest/src/$(DEPDIR)/src_processor_minidump_unittest-gtest-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest-all.cc' object='src/testing/gtest/src/src_processor_minidump_unittest-gtest-all.obj' libtool=no @AMDEPBACKSLASH@
+src/processor/src_processor_proc_maps_linux_unittest-proc_maps_linux_unittest.o: src/processor/proc_maps_linux_unittest.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_proc_maps_linux_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_proc_maps_linux_unittest-proc_maps_linux_unittest.o -MD -MP -MF src/processor/$(DEPDIR)/src_processor_proc_maps_linux_unittest-proc_maps_linux_unittest.Tpo -c -o src/processor/src_processor_proc_maps_linux_unittest-proc_maps_linux_unittest.o `test -f 'src/processor/proc_maps_linux_unittest.cc' || echo '$(srcdir)/'`src/processor/proc_maps_linux_unittest.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_proc_maps_linux_unittest-proc_maps_linux_unittest.Tpo src/processor/$(DEPDIR)/src_processor_proc_maps_linux_unittest-proc_maps_linux_unittest.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/proc_maps_linux_unittest.cc' object='src/processor/src_processor_proc_maps_linux_unittest-proc_maps_linux_unittest.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_minidump_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_processor_minidump_unittest-gtest-all.obj `if test -f 'src/testing/gtest/src/gtest-all.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest-all.cc'; fi`
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_proc_maps_linux_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_proc_maps_linux_unittest-proc_maps_linux_unittest.o `test -f 'src/processor/proc_maps_linux_unittest.cc' || echo '$(srcdir)/'`src/processor/proc_maps_linux_unittest.cc
-src/testing/gtest/src/src_processor_minidump_unittest-gtest_main.o: src/testing/gtest/src/gtest_main.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_minidump_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_processor_minidump_unittest-gtest_main.o -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_processor_minidump_unittest-gtest_main.Tpo -c -o src/testing/gtest/src/src_processor_minidump_unittest-gtest_main.o `test -f 'src/testing/gtest/src/gtest_main.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest_main.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_processor_minidump_unittest-gtest_main.Tpo src/testing/gtest/src/$(DEPDIR)/src_processor_minidump_unittest-gtest_main.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest_main.cc' object='src/testing/gtest/src/src_processor_minidump_unittest-gtest_main.o' libtool=no @AMDEPBACKSLASH@
+src/processor/src_processor_proc_maps_linux_unittest-proc_maps_linux_unittest.obj: src/processor/proc_maps_linux_unittest.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_proc_maps_linux_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_proc_maps_linux_unittest-proc_maps_linux_unittest.obj -MD -MP -MF src/processor/$(DEPDIR)/src_processor_proc_maps_linux_unittest-proc_maps_linux_unittest.Tpo -c -o src/processor/src_processor_proc_maps_linux_unittest-proc_maps_linux_unittest.obj `if test -f 'src/processor/proc_maps_linux_unittest.cc'; then $(CYGPATH_W) 'src/processor/proc_maps_linux_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/proc_maps_linux_unittest.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_proc_maps_linux_unittest-proc_maps_linux_unittest.Tpo src/processor/$(DEPDIR)/src_processor_proc_maps_linux_unittest-proc_maps_linux_unittest.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/proc_maps_linux_unittest.cc' object='src/processor/src_processor_proc_maps_linux_unittest-proc_maps_linux_unittest.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_minidump_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_processor_minidump_unittest-gtest_main.o `test -f 'src/testing/gtest/src/gtest_main.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest_main.cc
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_proc_maps_linux_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_proc_maps_linux_unittest-proc_maps_linux_unittest.obj `if test -f 'src/processor/proc_maps_linux_unittest.cc'; then $(CYGPATH_W) 'src/processor/proc_maps_linux_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/proc_maps_linux_unittest.cc'; fi`
-src/testing/gtest/src/src_processor_minidump_unittest-gtest_main.obj: src/testing/gtest/src/gtest_main.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_minidump_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_processor_minidump_unittest-gtest_main.obj -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_processor_minidump_unittest-gtest_main.Tpo -c -o src/testing/gtest/src/src_processor_minidump_unittest-gtest_main.obj `if test -f 'src/testing/gtest/src/gtest_main.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest_main.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest_main.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_processor_minidump_unittest-gtest_main.Tpo src/testing/gtest/src/$(DEPDIR)/src_processor_minidump_unittest-gtest_main.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest_main.cc' object='src/testing/gtest/src/src_processor_minidump_unittest-gtest_main.obj' libtool=no @AMDEPBACKSLASH@
+src/processor/src_processor_range_map_truncate_lower_unittest-range_map_truncate_lower_unittest.o: src/processor/range_map_truncate_lower_unittest.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_range_map_truncate_lower_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_range_map_truncate_lower_unittest-range_map_truncate_lower_unittest.o -MD -MP -MF src/processor/$(DEPDIR)/src_processor_range_map_truncate_lower_unittest-range_map_truncate_lower_unittest.Tpo -c -o src/processor/src_processor_range_map_truncate_lower_unittest-range_map_truncate_lower_unittest.o `test -f 'src/processor/range_map_truncate_lower_unittest.cc' || echo '$(srcdir)/'`src/processor/range_map_truncate_lower_unittest.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_range_map_truncate_lower_unittest-range_map_truncate_lower_unittest.Tpo src/processor/$(DEPDIR)/src_processor_range_map_truncate_lower_unittest-range_map_truncate_lower_unittest.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/range_map_truncate_lower_unittest.cc' object='src/processor/src_processor_range_map_truncate_lower_unittest-range_map_truncate_lower_unittest.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_minidump_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_processor_minidump_unittest-gtest_main.obj `if test -f 'src/testing/gtest/src/gtest_main.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest_main.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest_main.cc'; fi`
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_range_map_truncate_lower_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_range_map_truncate_lower_unittest-range_map_truncate_lower_unittest.o `test -f 'src/processor/range_map_truncate_lower_unittest.cc' || echo '$(srcdir)/'`src/processor/range_map_truncate_lower_unittest.cc
-src/testing/src/src_processor_minidump_unittest-gmock-all.o: src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_minidump_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/src/src_processor_minidump_unittest-gmock-all.o -MD -MP -MF src/testing/src/$(DEPDIR)/src_processor_minidump_unittest-gmock-all.Tpo -c -o src/testing/src/src_processor_minidump_unittest-gmock-all.o `test -f 'src/testing/src/gmock-all.cc' || echo '$(srcdir)/'`src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/src/$(DEPDIR)/src_processor_minidump_unittest-gmock-all.Tpo src/testing/src/$(DEPDIR)/src_processor_minidump_unittest-gmock-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/src/gmock-all.cc' object='src/testing/src/src_processor_minidump_unittest-gmock-all.o' libtool=no @AMDEPBACKSLASH@
+src/processor/src_processor_range_map_truncate_lower_unittest-range_map_truncate_lower_unittest.obj: src/processor/range_map_truncate_lower_unittest.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_range_map_truncate_lower_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_range_map_truncate_lower_unittest-range_map_truncate_lower_unittest.obj -MD -MP -MF src/processor/$(DEPDIR)/src_processor_range_map_truncate_lower_unittest-range_map_truncate_lower_unittest.Tpo -c -o src/processor/src_processor_range_map_truncate_lower_unittest-range_map_truncate_lower_unittest.obj `if test -f 'src/processor/range_map_truncate_lower_unittest.cc'; then $(CYGPATH_W) 'src/processor/range_map_truncate_lower_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/range_map_truncate_lower_unittest.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_range_map_truncate_lower_unittest-range_map_truncate_lower_unittest.Tpo src/processor/$(DEPDIR)/src_processor_range_map_truncate_lower_unittest-range_map_truncate_lower_unittest.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/range_map_truncate_lower_unittest.cc' object='src/processor/src_processor_range_map_truncate_lower_unittest-range_map_truncate_lower_unittest.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_minidump_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/src/src_processor_minidump_unittest-gmock-all.o `test -f 'src/testing/src/gmock-all.cc' || echo '$(srcdir)/'`src/testing/src/gmock-all.cc
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_range_map_truncate_lower_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_range_map_truncate_lower_unittest-range_map_truncate_lower_unittest.obj `if test -f 'src/processor/range_map_truncate_lower_unittest.cc'; then $(CYGPATH_W) 'src/processor/range_map_truncate_lower_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/range_map_truncate_lower_unittest.cc'; fi`
-src/testing/src/src_processor_minidump_unittest-gmock-all.obj: src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_minidump_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/src/src_processor_minidump_unittest-gmock-all.obj -MD -MP -MF src/testing/src/$(DEPDIR)/src_processor_minidump_unittest-gmock-all.Tpo -c -o src/testing/src/src_processor_minidump_unittest-gmock-all.obj `if test -f 'src/testing/src/gmock-all.cc'; then $(CYGPATH_W) 'src/testing/src/gmock-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/src/gmock-all.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/src/$(DEPDIR)/src_processor_minidump_unittest-gmock-all.Tpo src/testing/src/$(DEPDIR)/src_processor_minidump_unittest-gmock-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/src/gmock-all.cc' object='src/testing/src/src_processor_minidump_unittest-gmock-all.obj' libtool=no @AMDEPBACKSLASH@
+src/processor/src_processor_range_map_truncate_upper_unittest-range_map_truncate_upper_unittest.o: src/processor/range_map_truncate_upper_unittest.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_range_map_truncate_upper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_range_map_truncate_upper_unittest-range_map_truncate_upper_unittest.o -MD -MP -MF src/processor/$(DEPDIR)/src_processor_range_map_truncate_upper_unittest-range_map_truncate_upper_unittest.Tpo -c -o src/processor/src_processor_range_map_truncate_upper_unittest-range_map_truncate_upper_unittest.o `test -f 'src/processor/range_map_truncate_upper_unittest.cc' || echo '$(srcdir)/'`src/processor/range_map_truncate_upper_unittest.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_range_map_truncate_upper_unittest-range_map_truncate_upper_unittest.Tpo src/processor/$(DEPDIR)/src_processor_range_map_truncate_upper_unittest-range_map_truncate_upper_unittest.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/range_map_truncate_upper_unittest.cc' object='src/processor/src_processor_range_map_truncate_upper_unittest-range_map_truncate_upper_unittest.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_minidump_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/src/src_processor_minidump_unittest-gmock-all.obj `if test -f 'src/testing/src/gmock-all.cc'; then $(CYGPATH_W) 'src/testing/src/gmock-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/src/gmock-all.cc'; fi`
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_range_map_truncate_upper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_range_map_truncate_upper_unittest-range_map_truncate_upper_unittest.o `test -f 'src/processor/range_map_truncate_upper_unittest.cc' || echo '$(srcdir)/'`src/processor/range_map_truncate_upper_unittest.cc
+
+src/processor/src_processor_range_map_truncate_upper_unittest-range_map_truncate_upper_unittest.obj: src/processor/range_map_truncate_upper_unittest.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_range_map_truncate_upper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_range_map_truncate_upper_unittest-range_map_truncate_upper_unittest.obj -MD -MP -MF src/processor/$(DEPDIR)/src_processor_range_map_truncate_upper_unittest-range_map_truncate_upper_unittest.Tpo -c -o src/processor/src_processor_range_map_truncate_upper_unittest-range_map_truncate_upper_unittest.obj `if test -f 'src/processor/range_map_truncate_upper_unittest.cc'; then $(CYGPATH_W) 'src/processor/range_map_truncate_upper_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/range_map_truncate_upper_unittest.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_range_map_truncate_upper_unittest-range_map_truncate_upper_unittest.Tpo src/processor/$(DEPDIR)/src_processor_range_map_truncate_upper_unittest-range_map_truncate_upper_unittest.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/range_map_truncate_upper_unittest.cc' object='src/processor/src_processor_range_map_truncate_upper_unittest-range_map_truncate_upper_unittest.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_range_map_truncate_upper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_range_map_truncate_upper_unittest-range_map_truncate_upper_unittest.obj `if test -f 'src/processor/range_map_truncate_upper_unittest.cc'; then $(CYGPATH_W) 'src/processor/range_map_truncate_upper_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/range_map_truncate_upper_unittest.cc'; fi`
src/common/src_processor_stackwalker_address_list_unittest-test_assembler.o: src/common/test_assembler.cc
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_address_list_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_processor_stackwalker_address_list_unittest-test_assembler.o -MD -MP -MF src/common/$(DEPDIR)/src_processor_stackwalker_address_list_unittest-test_assembler.Tpo -c -o src/common/src_processor_stackwalker_address_list_unittest-test_assembler.o `test -f 'src/common/test_assembler.cc' || echo '$(srcdir)/'`src/common/test_assembler.cc
@@ -6313,48 +6953,6 @@ src/processor/src_processor_stackwalker_address_list_unittest-stackwalker_addres
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_address_list_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_stackwalker_address_list_unittest-stackwalker_address_list_unittest.obj `if test -f 'src/processor/stackwalker_address_list_unittest.cc'; then $(CYGPATH_W) 'src/processor/stackwalker_address_list_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/stackwalker_address_list_unittest.cc'; fi`
-src/testing/gtest/src/src_processor_stackwalker_address_list_unittest-gtest-all.o: src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_address_list_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_processor_stackwalker_address_list_unittest-gtest-all.o -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_address_list_unittest-gtest-all.Tpo -c -o src/testing/gtest/src/src_processor_stackwalker_address_list_unittest-gtest-all.o `test -f 'src/testing/gtest/src/gtest-all.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_address_list_unittest-gtest-all.Tpo src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_address_list_unittest-gtest-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest-all.cc' object='src/testing/gtest/src/src_processor_stackwalker_address_list_unittest-gtest-all.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_address_list_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_processor_stackwalker_address_list_unittest-gtest-all.o `test -f 'src/testing/gtest/src/gtest-all.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest-all.cc
-
-src/testing/gtest/src/src_processor_stackwalker_address_list_unittest-gtest-all.obj: src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_address_list_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_processor_stackwalker_address_list_unittest-gtest-all.obj -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_address_list_unittest-gtest-all.Tpo -c -o src/testing/gtest/src/src_processor_stackwalker_address_list_unittest-gtest-all.obj `if test -f 'src/testing/gtest/src/gtest-all.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest-all.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_address_list_unittest-gtest-all.Tpo src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_address_list_unittest-gtest-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest-all.cc' object='src/testing/gtest/src/src_processor_stackwalker_address_list_unittest-gtest-all.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_address_list_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_processor_stackwalker_address_list_unittest-gtest-all.obj `if test -f 'src/testing/gtest/src/gtest-all.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest-all.cc'; fi`
-
-src/testing/gtest/src/src_processor_stackwalker_address_list_unittest-gtest_main.o: src/testing/gtest/src/gtest_main.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_address_list_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_processor_stackwalker_address_list_unittest-gtest_main.o -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_address_list_unittest-gtest_main.Tpo -c -o src/testing/gtest/src/src_processor_stackwalker_address_list_unittest-gtest_main.o `test -f 'src/testing/gtest/src/gtest_main.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest_main.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_address_list_unittest-gtest_main.Tpo src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_address_list_unittest-gtest_main.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest_main.cc' object='src/testing/gtest/src/src_processor_stackwalker_address_list_unittest-gtest_main.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_address_list_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_processor_stackwalker_address_list_unittest-gtest_main.o `test -f 'src/testing/gtest/src/gtest_main.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest_main.cc
-
-src/testing/gtest/src/src_processor_stackwalker_address_list_unittest-gtest_main.obj: src/testing/gtest/src/gtest_main.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_address_list_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_processor_stackwalker_address_list_unittest-gtest_main.obj -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_address_list_unittest-gtest_main.Tpo -c -o src/testing/gtest/src/src_processor_stackwalker_address_list_unittest-gtest_main.obj `if test -f 'src/testing/gtest/src/gtest_main.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest_main.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest_main.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_address_list_unittest-gtest_main.Tpo src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_address_list_unittest-gtest_main.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest_main.cc' object='src/testing/gtest/src/src_processor_stackwalker_address_list_unittest-gtest_main.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_address_list_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_processor_stackwalker_address_list_unittest-gtest_main.obj `if test -f 'src/testing/gtest/src/gtest_main.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest_main.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest_main.cc'; fi`
-
-src/testing/src/src_processor_stackwalker_address_list_unittest-gmock-all.o: src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_address_list_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/src/src_processor_stackwalker_address_list_unittest-gmock-all.o -MD -MP -MF src/testing/src/$(DEPDIR)/src_processor_stackwalker_address_list_unittest-gmock-all.Tpo -c -o src/testing/src/src_processor_stackwalker_address_list_unittest-gmock-all.o `test -f 'src/testing/src/gmock-all.cc' || echo '$(srcdir)/'`src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/src/$(DEPDIR)/src_processor_stackwalker_address_list_unittest-gmock-all.Tpo src/testing/src/$(DEPDIR)/src_processor_stackwalker_address_list_unittest-gmock-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/src/gmock-all.cc' object='src/testing/src/src_processor_stackwalker_address_list_unittest-gmock-all.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_address_list_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/src/src_processor_stackwalker_address_list_unittest-gmock-all.o `test -f 'src/testing/src/gmock-all.cc' || echo '$(srcdir)/'`src/testing/src/gmock-all.cc
-
-src/testing/src/src_processor_stackwalker_address_list_unittest-gmock-all.obj: src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_address_list_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/src/src_processor_stackwalker_address_list_unittest-gmock-all.obj -MD -MP -MF src/testing/src/$(DEPDIR)/src_processor_stackwalker_address_list_unittest-gmock-all.Tpo -c -o src/testing/src/src_processor_stackwalker_address_list_unittest-gmock-all.obj `if test -f 'src/testing/src/gmock-all.cc'; then $(CYGPATH_W) 'src/testing/src/gmock-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/src/gmock-all.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/src/$(DEPDIR)/src_processor_stackwalker_address_list_unittest-gmock-all.Tpo src/testing/src/$(DEPDIR)/src_processor_stackwalker_address_list_unittest-gmock-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/src/gmock-all.cc' object='src/testing/src/src_processor_stackwalker_address_list_unittest-gmock-all.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_address_list_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/src/src_processor_stackwalker_address_list_unittest-gmock-all.obj `if test -f 'src/testing/src/gmock-all.cc'; then $(CYGPATH_W) 'src/testing/src/gmock-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/src/gmock-all.cc'; fi`
-
src/common/src_processor_stackwalker_amd64_unittest-test_assembler.o: src/common/test_assembler.cc
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_amd64_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_processor_stackwalker_amd64_unittest-test_assembler.o -MD -MP -MF src/common/$(DEPDIR)/src_processor_stackwalker_amd64_unittest-test_assembler.Tpo -c -o src/common/src_processor_stackwalker_amd64_unittest-test_assembler.o `test -f 'src/common/test_assembler.cc' || echo '$(srcdir)/'`src/common/test_assembler.cc
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_processor_stackwalker_amd64_unittest-test_assembler.Tpo src/common/$(DEPDIR)/src_processor_stackwalker_amd64_unittest-test_assembler.Po
@@ -6383,48 +6981,6 @@ src/processor/src_processor_stackwalker_amd64_unittest-stackwalker_amd64_unittes
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_amd64_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_stackwalker_amd64_unittest-stackwalker_amd64_unittest.obj `if test -f 'src/processor/stackwalker_amd64_unittest.cc'; then $(CYGPATH_W) 'src/processor/stackwalker_amd64_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/stackwalker_amd64_unittest.cc'; fi`
-src/testing/gtest/src/src_processor_stackwalker_amd64_unittest-gtest-all.o: src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_amd64_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_processor_stackwalker_amd64_unittest-gtest-all.o -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_amd64_unittest-gtest-all.Tpo -c -o src/testing/gtest/src/src_processor_stackwalker_amd64_unittest-gtest-all.o `test -f 'src/testing/gtest/src/gtest-all.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_amd64_unittest-gtest-all.Tpo src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_amd64_unittest-gtest-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest-all.cc' object='src/testing/gtest/src/src_processor_stackwalker_amd64_unittest-gtest-all.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_amd64_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_processor_stackwalker_amd64_unittest-gtest-all.o `test -f 'src/testing/gtest/src/gtest-all.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest-all.cc
-
-src/testing/gtest/src/src_processor_stackwalker_amd64_unittest-gtest-all.obj: src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_amd64_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_processor_stackwalker_amd64_unittest-gtest-all.obj -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_amd64_unittest-gtest-all.Tpo -c -o src/testing/gtest/src/src_processor_stackwalker_amd64_unittest-gtest-all.obj `if test -f 'src/testing/gtest/src/gtest-all.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest-all.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_amd64_unittest-gtest-all.Tpo src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_amd64_unittest-gtest-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest-all.cc' object='src/testing/gtest/src/src_processor_stackwalker_amd64_unittest-gtest-all.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_amd64_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_processor_stackwalker_amd64_unittest-gtest-all.obj `if test -f 'src/testing/gtest/src/gtest-all.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest-all.cc'; fi`
-
-src/testing/gtest/src/src_processor_stackwalker_amd64_unittest-gtest_main.o: src/testing/gtest/src/gtest_main.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_amd64_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_processor_stackwalker_amd64_unittest-gtest_main.o -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_amd64_unittest-gtest_main.Tpo -c -o src/testing/gtest/src/src_processor_stackwalker_amd64_unittest-gtest_main.o `test -f 'src/testing/gtest/src/gtest_main.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest_main.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_amd64_unittest-gtest_main.Tpo src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_amd64_unittest-gtest_main.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest_main.cc' object='src/testing/gtest/src/src_processor_stackwalker_amd64_unittest-gtest_main.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_amd64_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_processor_stackwalker_amd64_unittest-gtest_main.o `test -f 'src/testing/gtest/src/gtest_main.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest_main.cc
-
-src/testing/gtest/src/src_processor_stackwalker_amd64_unittest-gtest_main.obj: src/testing/gtest/src/gtest_main.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_amd64_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_processor_stackwalker_amd64_unittest-gtest_main.obj -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_amd64_unittest-gtest_main.Tpo -c -o src/testing/gtest/src/src_processor_stackwalker_amd64_unittest-gtest_main.obj `if test -f 'src/testing/gtest/src/gtest_main.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest_main.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest_main.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_amd64_unittest-gtest_main.Tpo src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_amd64_unittest-gtest_main.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest_main.cc' object='src/testing/gtest/src/src_processor_stackwalker_amd64_unittest-gtest_main.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_amd64_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_processor_stackwalker_amd64_unittest-gtest_main.obj `if test -f 'src/testing/gtest/src/gtest_main.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest_main.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest_main.cc'; fi`
-
-src/testing/src/src_processor_stackwalker_amd64_unittest-gmock-all.o: src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_amd64_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/src/src_processor_stackwalker_amd64_unittest-gmock-all.o -MD -MP -MF src/testing/src/$(DEPDIR)/src_processor_stackwalker_amd64_unittest-gmock-all.Tpo -c -o src/testing/src/src_processor_stackwalker_amd64_unittest-gmock-all.o `test -f 'src/testing/src/gmock-all.cc' || echo '$(srcdir)/'`src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/src/$(DEPDIR)/src_processor_stackwalker_amd64_unittest-gmock-all.Tpo src/testing/src/$(DEPDIR)/src_processor_stackwalker_amd64_unittest-gmock-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/src/gmock-all.cc' object='src/testing/src/src_processor_stackwalker_amd64_unittest-gmock-all.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_amd64_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/src/src_processor_stackwalker_amd64_unittest-gmock-all.o `test -f 'src/testing/src/gmock-all.cc' || echo '$(srcdir)/'`src/testing/src/gmock-all.cc
-
-src/testing/src/src_processor_stackwalker_amd64_unittest-gmock-all.obj: src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_amd64_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/src/src_processor_stackwalker_amd64_unittest-gmock-all.obj -MD -MP -MF src/testing/src/$(DEPDIR)/src_processor_stackwalker_amd64_unittest-gmock-all.Tpo -c -o src/testing/src/src_processor_stackwalker_amd64_unittest-gmock-all.obj `if test -f 'src/testing/src/gmock-all.cc'; then $(CYGPATH_W) 'src/testing/src/gmock-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/src/gmock-all.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/src/$(DEPDIR)/src_processor_stackwalker_amd64_unittest-gmock-all.Tpo src/testing/src/$(DEPDIR)/src_processor_stackwalker_amd64_unittest-gmock-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/src/gmock-all.cc' object='src/testing/src/src_processor_stackwalker_amd64_unittest-gmock-all.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_amd64_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/src/src_processor_stackwalker_amd64_unittest-gmock-all.obj `if test -f 'src/testing/src/gmock-all.cc'; then $(CYGPATH_W) 'src/testing/src/gmock-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/src/gmock-all.cc'; fi`
-
src/common/src_processor_stackwalker_arm64_unittest-test_assembler.o: src/common/test_assembler.cc
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_arm64_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_processor_stackwalker_arm64_unittest-test_assembler.o -MD -MP -MF src/common/$(DEPDIR)/src_processor_stackwalker_arm64_unittest-test_assembler.Tpo -c -o src/common/src_processor_stackwalker_arm64_unittest-test_assembler.o `test -f 'src/common/test_assembler.cc' || echo '$(srcdir)/'`src/common/test_assembler.cc
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_processor_stackwalker_arm64_unittest-test_assembler.Tpo src/common/$(DEPDIR)/src_processor_stackwalker_arm64_unittest-test_assembler.Po
@@ -6453,48 +7009,6 @@ src/processor/src_processor_stackwalker_arm64_unittest-stackwalker_arm64_unittes
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_arm64_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_stackwalker_arm64_unittest-stackwalker_arm64_unittest.obj `if test -f 'src/processor/stackwalker_arm64_unittest.cc'; then $(CYGPATH_W) 'src/processor/stackwalker_arm64_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/stackwalker_arm64_unittest.cc'; fi`
-src/testing/gtest/src/src_processor_stackwalker_arm64_unittest-gtest-all.o: src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_arm64_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_processor_stackwalker_arm64_unittest-gtest-all.o -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_arm64_unittest-gtest-all.Tpo -c -o src/testing/gtest/src/src_processor_stackwalker_arm64_unittest-gtest-all.o `test -f 'src/testing/gtest/src/gtest-all.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_arm64_unittest-gtest-all.Tpo src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_arm64_unittest-gtest-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest-all.cc' object='src/testing/gtest/src/src_processor_stackwalker_arm64_unittest-gtest-all.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_arm64_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_processor_stackwalker_arm64_unittest-gtest-all.o `test -f 'src/testing/gtest/src/gtest-all.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest-all.cc
-
-src/testing/gtest/src/src_processor_stackwalker_arm64_unittest-gtest-all.obj: src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_arm64_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_processor_stackwalker_arm64_unittest-gtest-all.obj -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_arm64_unittest-gtest-all.Tpo -c -o src/testing/gtest/src/src_processor_stackwalker_arm64_unittest-gtest-all.obj `if test -f 'src/testing/gtest/src/gtest-all.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest-all.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_arm64_unittest-gtest-all.Tpo src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_arm64_unittest-gtest-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest-all.cc' object='src/testing/gtest/src/src_processor_stackwalker_arm64_unittest-gtest-all.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_arm64_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_processor_stackwalker_arm64_unittest-gtest-all.obj `if test -f 'src/testing/gtest/src/gtest-all.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest-all.cc'; fi`
-
-src/testing/gtest/src/src_processor_stackwalker_arm64_unittest-gtest_main.o: src/testing/gtest/src/gtest_main.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_arm64_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_processor_stackwalker_arm64_unittest-gtest_main.o -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_arm64_unittest-gtest_main.Tpo -c -o src/testing/gtest/src/src_processor_stackwalker_arm64_unittest-gtest_main.o `test -f 'src/testing/gtest/src/gtest_main.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest_main.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_arm64_unittest-gtest_main.Tpo src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_arm64_unittest-gtest_main.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest_main.cc' object='src/testing/gtest/src/src_processor_stackwalker_arm64_unittest-gtest_main.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_arm64_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_processor_stackwalker_arm64_unittest-gtest_main.o `test -f 'src/testing/gtest/src/gtest_main.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest_main.cc
-
-src/testing/gtest/src/src_processor_stackwalker_arm64_unittest-gtest_main.obj: src/testing/gtest/src/gtest_main.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_arm64_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_processor_stackwalker_arm64_unittest-gtest_main.obj -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_arm64_unittest-gtest_main.Tpo -c -o src/testing/gtest/src/src_processor_stackwalker_arm64_unittest-gtest_main.obj `if test -f 'src/testing/gtest/src/gtest_main.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest_main.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest_main.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_arm64_unittest-gtest_main.Tpo src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_arm64_unittest-gtest_main.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest_main.cc' object='src/testing/gtest/src/src_processor_stackwalker_arm64_unittest-gtest_main.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_arm64_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_processor_stackwalker_arm64_unittest-gtest_main.obj `if test -f 'src/testing/gtest/src/gtest_main.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest_main.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest_main.cc'; fi`
-
-src/testing/src/src_processor_stackwalker_arm64_unittest-gmock-all.o: src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_arm64_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/src/src_processor_stackwalker_arm64_unittest-gmock-all.o -MD -MP -MF src/testing/src/$(DEPDIR)/src_processor_stackwalker_arm64_unittest-gmock-all.Tpo -c -o src/testing/src/src_processor_stackwalker_arm64_unittest-gmock-all.o `test -f 'src/testing/src/gmock-all.cc' || echo '$(srcdir)/'`src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/src/$(DEPDIR)/src_processor_stackwalker_arm64_unittest-gmock-all.Tpo src/testing/src/$(DEPDIR)/src_processor_stackwalker_arm64_unittest-gmock-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/src/gmock-all.cc' object='src/testing/src/src_processor_stackwalker_arm64_unittest-gmock-all.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_arm64_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/src/src_processor_stackwalker_arm64_unittest-gmock-all.o `test -f 'src/testing/src/gmock-all.cc' || echo '$(srcdir)/'`src/testing/src/gmock-all.cc
-
-src/testing/src/src_processor_stackwalker_arm64_unittest-gmock-all.obj: src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_arm64_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/src/src_processor_stackwalker_arm64_unittest-gmock-all.obj -MD -MP -MF src/testing/src/$(DEPDIR)/src_processor_stackwalker_arm64_unittest-gmock-all.Tpo -c -o src/testing/src/src_processor_stackwalker_arm64_unittest-gmock-all.obj `if test -f 'src/testing/src/gmock-all.cc'; then $(CYGPATH_W) 'src/testing/src/gmock-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/src/gmock-all.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/src/$(DEPDIR)/src_processor_stackwalker_arm64_unittest-gmock-all.Tpo src/testing/src/$(DEPDIR)/src_processor_stackwalker_arm64_unittest-gmock-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/src/gmock-all.cc' object='src/testing/src/src_processor_stackwalker_arm64_unittest-gmock-all.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_arm64_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/src/src_processor_stackwalker_arm64_unittest-gmock-all.obj `if test -f 'src/testing/src/gmock-all.cc'; then $(CYGPATH_W) 'src/testing/src/gmock-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/src/gmock-all.cc'; fi`
-
src/common/src_processor_stackwalker_arm_unittest-test_assembler.o: src/common/test_assembler.cc
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_arm_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_processor_stackwalker_arm_unittest-test_assembler.o -MD -MP -MF src/common/$(DEPDIR)/src_processor_stackwalker_arm_unittest-test_assembler.Tpo -c -o src/common/src_processor_stackwalker_arm_unittest-test_assembler.o `test -f 'src/common/test_assembler.cc' || echo '$(srcdir)/'`src/common/test_assembler.cc
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_processor_stackwalker_arm_unittest-test_assembler.Tpo src/common/$(DEPDIR)/src_processor_stackwalker_arm_unittest-test_assembler.Po
@@ -6523,47 +7037,33 @@ src/processor/src_processor_stackwalker_arm_unittest-stackwalker_arm_unittest.ob
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_arm_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_stackwalker_arm_unittest-stackwalker_arm_unittest.obj `if test -f 'src/processor/stackwalker_arm_unittest.cc'; then $(CYGPATH_W) 'src/processor/stackwalker_arm_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/stackwalker_arm_unittest.cc'; fi`
-src/testing/gtest/src/src_processor_stackwalker_arm_unittest-gtest-all.o: src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_arm_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_processor_stackwalker_arm_unittest-gtest-all.o -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_arm_unittest-gtest-all.Tpo -c -o src/testing/gtest/src/src_processor_stackwalker_arm_unittest-gtest-all.o `test -f 'src/testing/gtest/src/gtest-all.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_arm_unittest-gtest-all.Tpo src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_arm_unittest-gtest-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest-all.cc' object='src/testing/gtest/src/src_processor_stackwalker_arm_unittest-gtest-all.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_arm_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_processor_stackwalker_arm_unittest-gtest-all.o `test -f 'src/testing/gtest/src/gtest-all.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest-all.cc
-
-src/testing/gtest/src/src_processor_stackwalker_arm_unittest-gtest-all.obj: src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_arm_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_processor_stackwalker_arm_unittest-gtest-all.obj -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_arm_unittest-gtest-all.Tpo -c -o src/testing/gtest/src/src_processor_stackwalker_arm_unittest-gtest-all.obj `if test -f 'src/testing/gtest/src/gtest-all.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest-all.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_arm_unittest-gtest-all.Tpo src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_arm_unittest-gtest-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest-all.cc' object='src/testing/gtest/src/src_processor_stackwalker_arm_unittest-gtest-all.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_arm_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_processor_stackwalker_arm_unittest-gtest-all.obj `if test -f 'src/testing/gtest/src/gtest-all.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest-all.cc'; fi`
-
-src/testing/gtest/src/src_processor_stackwalker_arm_unittest-gtest_main.o: src/testing/gtest/src/gtest_main.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_arm_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_processor_stackwalker_arm_unittest-gtest_main.o -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_arm_unittest-gtest_main.Tpo -c -o src/testing/gtest/src/src_processor_stackwalker_arm_unittest-gtest_main.o `test -f 'src/testing/gtest/src/gtest_main.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest_main.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_arm_unittest-gtest_main.Tpo src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_arm_unittest-gtest_main.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest_main.cc' object='src/testing/gtest/src/src_processor_stackwalker_arm_unittest-gtest_main.o' libtool=no @AMDEPBACKSLASH@
+src/common/src_processor_stackwalker_mips64_unittest-test_assembler.o: src/common/test_assembler.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_mips64_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_processor_stackwalker_mips64_unittest-test_assembler.o -MD -MP -MF src/common/$(DEPDIR)/src_processor_stackwalker_mips64_unittest-test_assembler.Tpo -c -o src/common/src_processor_stackwalker_mips64_unittest-test_assembler.o `test -f 'src/common/test_assembler.cc' || echo '$(srcdir)/'`src/common/test_assembler.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_processor_stackwalker_mips64_unittest-test_assembler.Tpo src/common/$(DEPDIR)/src_processor_stackwalker_mips64_unittest-test_assembler.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/test_assembler.cc' object='src/common/src_processor_stackwalker_mips64_unittest-test_assembler.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_arm_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_processor_stackwalker_arm_unittest-gtest_main.o `test -f 'src/testing/gtest/src/gtest_main.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest_main.cc
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_mips64_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_processor_stackwalker_mips64_unittest-test_assembler.o `test -f 'src/common/test_assembler.cc' || echo '$(srcdir)/'`src/common/test_assembler.cc
-src/testing/gtest/src/src_processor_stackwalker_arm_unittest-gtest_main.obj: src/testing/gtest/src/gtest_main.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_arm_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_processor_stackwalker_arm_unittest-gtest_main.obj -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_arm_unittest-gtest_main.Tpo -c -o src/testing/gtest/src/src_processor_stackwalker_arm_unittest-gtest_main.obj `if test -f 'src/testing/gtest/src/gtest_main.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest_main.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest_main.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_arm_unittest-gtest_main.Tpo src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_arm_unittest-gtest_main.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest_main.cc' object='src/testing/gtest/src/src_processor_stackwalker_arm_unittest-gtest_main.obj' libtool=no @AMDEPBACKSLASH@
+src/common/src_processor_stackwalker_mips64_unittest-test_assembler.obj: src/common/test_assembler.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_mips64_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_processor_stackwalker_mips64_unittest-test_assembler.obj -MD -MP -MF src/common/$(DEPDIR)/src_processor_stackwalker_mips64_unittest-test_assembler.Tpo -c -o src/common/src_processor_stackwalker_mips64_unittest-test_assembler.obj `if test -f 'src/common/test_assembler.cc'; then $(CYGPATH_W) 'src/common/test_assembler.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/test_assembler.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_processor_stackwalker_mips64_unittest-test_assembler.Tpo src/common/$(DEPDIR)/src_processor_stackwalker_mips64_unittest-test_assembler.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/test_assembler.cc' object='src/common/src_processor_stackwalker_mips64_unittest-test_assembler.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_arm_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_processor_stackwalker_arm_unittest-gtest_main.obj `if test -f 'src/testing/gtest/src/gtest_main.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest_main.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest_main.cc'; fi`
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_mips64_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_processor_stackwalker_mips64_unittest-test_assembler.obj `if test -f 'src/common/test_assembler.cc'; then $(CYGPATH_W) 'src/common/test_assembler.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/test_assembler.cc'; fi`
-src/testing/src/src_processor_stackwalker_arm_unittest-gmock-all.o: src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_arm_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/src/src_processor_stackwalker_arm_unittest-gmock-all.o -MD -MP -MF src/testing/src/$(DEPDIR)/src_processor_stackwalker_arm_unittest-gmock-all.Tpo -c -o src/testing/src/src_processor_stackwalker_arm_unittest-gmock-all.o `test -f 'src/testing/src/gmock-all.cc' || echo '$(srcdir)/'`src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/src/$(DEPDIR)/src_processor_stackwalker_arm_unittest-gmock-all.Tpo src/testing/src/$(DEPDIR)/src_processor_stackwalker_arm_unittest-gmock-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/src/gmock-all.cc' object='src/testing/src/src_processor_stackwalker_arm_unittest-gmock-all.o' libtool=no @AMDEPBACKSLASH@
+src/processor/src_processor_stackwalker_mips64_unittest-stackwalker_mips64_unittest.o: src/processor/stackwalker_mips64_unittest.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_mips64_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_stackwalker_mips64_unittest-stackwalker_mips64_unittest.o -MD -MP -MF src/processor/$(DEPDIR)/src_processor_stackwalker_mips64_unittest-stackwalker_mips64_unittest.Tpo -c -o src/processor/src_processor_stackwalker_mips64_unittest-stackwalker_mips64_unittest.o `test -f 'src/processor/stackwalker_mips64_unittest.cc' || echo '$(srcdir)/'`src/processor/stackwalker_mips64_unittest.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_stackwalker_mips64_unittest-stackwalker_mips64_unittest.Tpo src/processor/$(DEPDIR)/src_processor_stackwalker_mips64_unittest-stackwalker_mips64_unittest.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/stackwalker_mips64_unittest.cc' object='src/processor/src_processor_stackwalker_mips64_unittest-stackwalker_mips64_unittest.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_arm_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/src/src_processor_stackwalker_arm_unittest-gmock-all.o `test -f 'src/testing/src/gmock-all.cc' || echo '$(srcdir)/'`src/testing/src/gmock-all.cc
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_mips64_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_stackwalker_mips64_unittest-stackwalker_mips64_unittest.o `test -f 'src/processor/stackwalker_mips64_unittest.cc' || echo '$(srcdir)/'`src/processor/stackwalker_mips64_unittest.cc
-src/testing/src/src_processor_stackwalker_arm_unittest-gmock-all.obj: src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_arm_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/src/src_processor_stackwalker_arm_unittest-gmock-all.obj -MD -MP -MF src/testing/src/$(DEPDIR)/src_processor_stackwalker_arm_unittest-gmock-all.Tpo -c -o src/testing/src/src_processor_stackwalker_arm_unittest-gmock-all.obj `if test -f 'src/testing/src/gmock-all.cc'; then $(CYGPATH_W) 'src/testing/src/gmock-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/src/gmock-all.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/src/$(DEPDIR)/src_processor_stackwalker_arm_unittest-gmock-all.Tpo src/testing/src/$(DEPDIR)/src_processor_stackwalker_arm_unittest-gmock-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/src/gmock-all.cc' object='src/testing/src/src_processor_stackwalker_arm_unittest-gmock-all.obj' libtool=no @AMDEPBACKSLASH@
+src/processor/src_processor_stackwalker_mips64_unittest-stackwalker_mips64_unittest.obj: src/processor/stackwalker_mips64_unittest.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_mips64_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_stackwalker_mips64_unittest-stackwalker_mips64_unittest.obj -MD -MP -MF src/processor/$(DEPDIR)/src_processor_stackwalker_mips64_unittest-stackwalker_mips64_unittest.Tpo -c -o src/processor/src_processor_stackwalker_mips64_unittest-stackwalker_mips64_unittest.obj `if test -f 'src/processor/stackwalker_mips64_unittest.cc'; then $(CYGPATH_W) 'src/processor/stackwalker_mips64_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/stackwalker_mips64_unittest.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_stackwalker_mips64_unittest-stackwalker_mips64_unittest.Tpo src/processor/$(DEPDIR)/src_processor_stackwalker_mips64_unittest-stackwalker_mips64_unittest.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/stackwalker_mips64_unittest.cc' object='src/processor/src_processor_stackwalker_mips64_unittest-stackwalker_mips64_unittest.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_arm_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/src/src_processor_stackwalker_arm_unittest-gmock-all.obj `if test -f 'src/testing/src/gmock-all.cc'; then $(CYGPATH_W) 'src/testing/src/gmock-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/src/gmock-all.cc'; fi`
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_mips64_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_stackwalker_mips64_unittest-stackwalker_mips64_unittest.obj `if test -f 'src/processor/stackwalker_mips64_unittest.cc'; then $(CYGPATH_W) 'src/processor/stackwalker_mips64_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/stackwalker_mips64_unittest.cc'; fi`
src/common/src_processor_stackwalker_mips_unittest-test_assembler.o: src/common/test_assembler.cc
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_mips_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_processor_stackwalker_mips_unittest-test_assembler.o -MD -MP -MF src/common/$(DEPDIR)/src_processor_stackwalker_mips_unittest-test_assembler.Tpo -c -o src/common/src_processor_stackwalker_mips_unittest-test_assembler.o `test -f 'src/common/test_assembler.cc' || echo '$(srcdir)/'`src/common/test_assembler.cc
@@ -6593,48 +7093,6 @@ src/processor/src_processor_stackwalker_mips_unittest-stackwalker_mips_unittest.
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_mips_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_stackwalker_mips_unittest-stackwalker_mips_unittest.obj `if test -f 'src/processor/stackwalker_mips_unittest.cc'; then $(CYGPATH_W) 'src/processor/stackwalker_mips_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/stackwalker_mips_unittest.cc'; fi`
-src/testing/gtest/src/src_processor_stackwalker_mips_unittest-gtest-all.o: src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_mips_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_processor_stackwalker_mips_unittest-gtest-all.o -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_mips_unittest-gtest-all.Tpo -c -o src/testing/gtest/src/src_processor_stackwalker_mips_unittest-gtest-all.o `test -f 'src/testing/gtest/src/gtest-all.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_mips_unittest-gtest-all.Tpo src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_mips_unittest-gtest-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest-all.cc' object='src/testing/gtest/src/src_processor_stackwalker_mips_unittest-gtest-all.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_mips_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_processor_stackwalker_mips_unittest-gtest-all.o `test -f 'src/testing/gtest/src/gtest-all.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest-all.cc
-
-src/testing/gtest/src/src_processor_stackwalker_mips_unittest-gtest-all.obj: src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_mips_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_processor_stackwalker_mips_unittest-gtest-all.obj -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_mips_unittest-gtest-all.Tpo -c -o src/testing/gtest/src/src_processor_stackwalker_mips_unittest-gtest-all.obj `if test -f 'src/testing/gtest/src/gtest-all.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest-all.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_mips_unittest-gtest-all.Tpo src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_mips_unittest-gtest-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest-all.cc' object='src/testing/gtest/src/src_processor_stackwalker_mips_unittest-gtest-all.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_mips_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_processor_stackwalker_mips_unittest-gtest-all.obj `if test -f 'src/testing/gtest/src/gtest-all.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest-all.cc'; fi`
-
-src/testing/gtest/src/src_processor_stackwalker_mips_unittest-gtest_main.o: src/testing/gtest/src/gtest_main.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_mips_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_processor_stackwalker_mips_unittest-gtest_main.o -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_mips_unittest-gtest_main.Tpo -c -o src/testing/gtest/src/src_processor_stackwalker_mips_unittest-gtest_main.o `test -f 'src/testing/gtest/src/gtest_main.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest_main.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_mips_unittest-gtest_main.Tpo src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_mips_unittest-gtest_main.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest_main.cc' object='src/testing/gtest/src/src_processor_stackwalker_mips_unittest-gtest_main.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_mips_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_processor_stackwalker_mips_unittest-gtest_main.o `test -f 'src/testing/gtest/src/gtest_main.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest_main.cc
-
-src/testing/gtest/src/src_processor_stackwalker_mips_unittest-gtest_main.obj: src/testing/gtest/src/gtest_main.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_mips_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_processor_stackwalker_mips_unittest-gtest_main.obj -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_mips_unittest-gtest_main.Tpo -c -o src/testing/gtest/src/src_processor_stackwalker_mips_unittest-gtest_main.obj `if test -f 'src/testing/gtest/src/gtest_main.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest_main.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest_main.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_mips_unittest-gtest_main.Tpo src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_mips_unittest-gtest_main.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest_main.cc' object='src/testing/gtest/src/src_processor_stackwalker_mips_unittest-gtest_main.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_mips_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_processor_stackwalker_mips_unittest-gtest_main.obj `if test -f 'src/testing/gtest/src/gtest_main.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest_main.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest_main.cc'; fi`
-
-src/testing/src/src_processor_stackwalker_mips_unittest-gmock-all.o: src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_mips_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/src/src_processor_stackwalker_mips_unittest-gmock-all.o -MD -MP -MF src/testing/src/$(DEPDIR)/src_processor_stackwalker_mips_unittest-gmock-all.Tpo -c -o src/testing/src/src_processor_stackwalker_mips_unittest-gmock-all.o `test -f 'src/testing/src/gmock-all.cc' || echo '$(srcdir)/'`src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/src/$(DEPDIR)/src_processor_stackwalker_mips_unittest-gmock-all.Tpo src/testing/src/$(DEPDIR)/src_processor_stackwalker_mips_unittest-gmock-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/src/gmock-all.cc' object='src/testing/src/src_processor_stackwalker_mips_unittest-gmock-all.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_mips_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/src/src_processor_stackwalker_mips_unittest-gmock-all.o `test -f 'src/testing/src/gmock-all.cc' || echo '$(srcdir)/'`src/testing/src/gmock-all.cc
-
-src/testing/src/src_processor_stackwalker_mips_unittest-gmock-all.obj: src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_mips_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/src/src_processor_stackwalker_mips_unittest-gmock-all.obj -MD -MP -MF src/testing/src/$(DEPDIR)/src_processor_stackwalker_mips_unittest-gmock-all.Tpo -c -o src/testing/src/src_processor_stackwalker_mips_unittest-gmock-all.obj `if test -f 'src/testing/src/gmock-all.cc'; then $(CYGPATH_W) 'src/testing/src/gmock-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/src/gmock-all.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/src/$(DEPDIR)/src_processor_stackwalker_mips_unittest-gmock-all.Tpo src/testing/src/$(DEPDIR)/src_processor_stackwalker_mips_unittest-gmock-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/src/gmock-all.cc' object='src/testing/src/src_processor_stackwalker_mips_unittest-gmock-all.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_mips_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/src/src_processor_stackwalker_mips_unittest-gmock-all.obj `if test -f 'src/testing/src/gmock-all.cc'; then $(CYGPATH_W) 'src/testing/src/gmock-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/src/gmock-all.cc'; fi`
-
src/common/src_processor_stackwalker_x86_unittest-test_assembler.o: src/common/test_assembler.cc
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_x86_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_processor_stackwalker_x86_unittest-test_assembler.o -MD -MP -MF src/common/$(DEPDIR)/src_processor_stackwalker_x86_unittest-test_assembler.Tpo -c -o src/common/src_processor_stackwalker_x86_unittest-test_assembler.o `test -f 'src/common/test_assembler.cc' || echo '$(srcdir)/'`src/common/test_assembler.cc
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_processor_stackwalker_x86_unittest-test_assembler.Tpo src/common/$(DEPDIR)/src_processor_stackwalker_x86_unittest-test_assembler.Po
@@ -6663,48 +7121,6 @@ src/processor/src_processor_stackwalker_x86_unittest-stackwalker_x86_unittest.ob
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_x86_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_stackwalker_x86_unittest-stackwalker_x86_unittest.obj `if test -f 'src/processor/stackwalker_x86_unittest.cc'; then $(CYGPATH_W) 'src/processor/stackwalker_x86_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/stackwalker_x86_unittest.cc'; fi`
-src/testing/gtest/src/src_processor_stackwalker_x86_unittest-gtest-all.o: src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_x86_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_processor_stackwalker_x86_unittest-gtest-all.o -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_x86_unittest-gtest-all.Tpo -c -o src/testing/gtest/src/src_processor_stackwalker_x86_unittest-gtest-all.o `test -f 'src/testing/gtest/src/gtest-all.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_x86_unittest-gtest-all.Tpo src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_x86_unittest-gtest-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest-all.cc' object='src/testing/gtest/src/src_processor_stackwalker_x86_unittest-gtest-all.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_x86_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_processor_stackwalker_x86_unittest-gtest-all.o `test -f 'src/testing/gtest/src/gtest-all.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest-all.cc
-
-src/testing/gtest/src/src_processor_stackwalker_x86_unittest-gtest-all.obj: src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_x86_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_processor_stackwalker_x86_unittest-gtest-all.obj -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_x86_unittest-gtest-all.Tpo -c -o src/testing/gtest/src/src_processor_stackwalker_x86_unittest-gtest-all.obj `if test -f 'src/testing/gtest/src/gtest-all.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest-all.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_x86_unittest-gtest-all.Tpo src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_x86_unittest-gtest-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest-all.cc' object='src/testing/gtest/src/src_processor_stackwalker_x86_unittest-gtest-all.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_x86_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_processor_stackwalker_x86_unittest-gtest-all.obj `if test -f 'src/testing/gtest/src/gtest-all.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest-all.cc'; fi`
-
-src/testing/gtest/src/src_processor_stackwalker_x86_unittest-gtest_main.o: src/testing/gtest/src/gtest_main.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_x86_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_processor_stackwalker_x86_unittest-gtest_main.o -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_x86_unittest-gtest_main.Tpo -c -o src/testing/gtest/src/src_processor_stackwalker_x86_unittest-gtest_main.o `test -f 'src/testing/gtest/src/gtest_main.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest_main.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_x86_unittest-gtest_main.Tpo src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_x86_unittest-gtest_main.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest_main.cc' object='src/testing/gtest/src/src_processor_stackwalker_x86_unittest-gtest_main.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_x86_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_processor_stackwalker_x86_unittest-gtest_main.o `test -f 'src/testing/gtest/src/gtest_main.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest_main.cc
-
-src/testing/gtest/src/src_processor_stackwalker_x86_unittest-gtest_main.obj: src/testing/gtest/src/gtest_main.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_x86_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_processor_stackwalker_x86_unittest-gtest_main.obj -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_x86_unittest-gtest_main.Tpo -c -o src/testing/gtest/src/src_processor_stackwalker_x86_unittest-gtest_main.obj `if test -f 'src/testing/gtest/src/gtest_main.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest_main.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest_main.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_x86_unittest-gtest_main.Tpo src/testing/gtest/src/$(DEPDIR)/src_processor_stackwalker_x86_unittest-gtest_main.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest_main.cc' object='src/testing/gtest/src/src_processor_stackwalker_x86_unittest-gtest_main.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_x86_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_processor_stackwalker_x86_unittest-gtest_main.obj `if test -f 'src/testing/gtest/src/gtest_main.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest_main.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest_main.cc'; fi`
-
-src/testing/src/src_processor_stackwalker_x86_unittest-gmock-all.o: src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_x86_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/src/src_processor_stackwalker_x86_unittest-gmock-all.o -MD -MP -MF src/testing/src/$(DEPDIR)/src_processor_stackwalker_x86_unittest-gmock-all.Tpo -c -o src/testing/src/src_processor_stackwalker_x86_unittest-gmock-all.o `test -f 'src/testing/src/gmock-all.cc' || echo '$(srcdir)/'`src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/src/$(DEPDIR)/src_processor_stackwalker_x86_unittest-gmock-all.Tpo src/testing/src/$(DEPDIR)/src_processor_stackwalker_x86_unittest-gmock-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/src/gmock-all.cc' object='src/testing/src/src_processor_stackwalker_x86_unittest-gmock-all.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_x86_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/src/src_processor_stackwalker_x86_unittest-gmock-all.o `test -f 'src/testing/src/gmock-all.cc' || echo '$(srcdir)/'`src/testing/src/gmock-all.cc
-
-src/testing/src/src_processor_stackwalker_x86_unittest-gmock-all.obj: src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_x86_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/src/src_processor_stackwalker_x86_unittest-gmock-all.obj -MD -MP -MF src/testing/src/$(DEPDIR)/src_processor_stackwalker_x86_unittest-gmock-all.Tpo -c -o src/testing/src/src_processor_stackwalker_x86_unittest-gmock-all.obj `if test -f 'src/testing/src/gmock-all.cc'; then $(CYGPATH_W) 'src/testing/src/gmock-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/src/gmock-all.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/src/$(DEPDIR)/src_processor_stackwalker_x86_unittest-gmock-all.Tpo src/testing/src/$(DEPDIR)/src_processor_stackwalker_x86_unittest-gmock-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/src/gmock-all.cc' object='src/testing/src/src_processor_stackwalker_x86_unittest-gmock-all.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_x86_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/src/src_processor_stackwalker_x86_unittest-gmock-all.obj `if test -f 'src/testing/src/gmock-all.cc'; then $(CYGPATH_W) 'src/testing/src/gmock-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/src/gmock-all.cc'; fi`
-
src/processor/src_processor_static_address_map_unittest-static_address_map_unittest.o: src/processor/static_address_map_unittest.cc
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_static_address_map_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_static_address_map_unittest-static_address_map_unittest.o -MD -MP -MF src/processor/$(DEPDIR)/src_processor_static_address_map_unittest-static_address_map_unittest.Tpo -c -o src/processor/src_processor_static_address_map_unittest-static_address_map_unittest.o `test -f 'src/processor/static_address_map_unittest.cc' || echo '$(srcdir)/'`src/processor/static_address_map_unittest.cc
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_static_address_map_unittest-static_address_map_unittest.Tpo src/processor/$(DEPDIR)/src_processor_static_address_map_unittest-static_address_map_unittest.Po
@@ -6719,34 +7135,6 @@ src/processor/src_processor_static_address_map_unittest-static_address_map_unitt
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_static_address_map_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_static_address_map_unittest-static_address_map_unittest.obj `if test -f 'src/processor/static_address_map_unittest.cc'; then $(CYGPATH_W) 'src/processor/static_address_map_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/static_address_map_unittest.cc'; fi`
-src/testing/gtest/src/src_processor_static_address_map_unittest-gtest-all.o: src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_static_address_map_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_processor_static_address_map_unittest-gtest-all.o -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_processor_static_address_map_unittest-gtest-all.Tpo -c -o src/testing/gtest/src/src_processor_static_address_map_unittest-gtest-all.o `test -f 'src/testing/gtest/src/gtest-all.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_processor_static_address_map_unittest-gtest-all.Tpo src/testing/gtest/src/$(DEPDIR)/src_processor_static_address_map_unittest-gtest-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest-all.cc' object='src/testing/gtest/src/src_processor_static_address_map_unittest-gtest-all.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_static_address_map_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_processor_static_address_map_unittest-gtest-all.o `test -f 'src/testing/gtest/src/gtest-all.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest-all.cc
-
-src/testing/gtest/src/src_processor_static_address_map_unittest-gtest-all.obj: src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_static_address_map_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_processor_static_address_map_unittest-gtest-all.obj -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_processor_static_address_map_unittest-gtest-all.Tpo -c -o src/testing/gtest/src/src_processor_static_address_map_unittest-gtest-all.obj `if test -f 'src/testing/gtest/src/gtest-all.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest-all.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_processor_static_address_map_unittest-gtest-all.Tpo src/testing/gtest/src/$(DEPDIR)/src_processor_static_address_map_unittest-gtest-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest-all.cc' object='src/testing/gtest/src/src_processor_static_address_map_unittest-gtest-all.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_static_address_map_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_processor_static_address_map_unittest-gtest-all.obj `if test -f 'src/testing/gtest/src/gtest-all.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest-all.cc'; fi`
-
-src/testing/src/src_processor_static_address_map_unittest-gmock-all.o: src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_static_address_map_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/src/src_processor_static_address_map_unittest-gmock-all.o -MD -MP -MF src/testing/src/$(DEPDIR)/src_processor_static_address_map_unittest-gmock-all.Tpo -c -o src/testing/src/src_processor_static_address_map_unittest-gmock-all.o `test -f 'src/testing/src/gmock-all.cc' || echo '$(srcdir)/'`src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/src/$(DEPDIR)/src_processor_static_address_map_unittest-gmock-all.Tpo src/testing/src/$(DEPDIR)/src_processor_static_address_map_unittest-gmock-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/src/gmock-all.cc' object='src/testing/src/src_processor_static_address_map_unittest-gmock-all.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_static_address_map_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/src/src_processor_static_address_map_unittest-gmock-all.o `test -f 'src/testing/src/gmock-all.cc' || echo '$(srcdir)/'`src/testing/src/gmock-all.cc
-
-src/testing/src/src_processor_static_address_map_unittest-gmock-all.obj: src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_static_address_map_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/src/src_processor_static_address_map_unittest-gmock-all.obj -MD -MP -MF src/testing/src/$(DEPDIR)/src_processor_static_address_map_unittest-gmock-all.Tpo -c -o src/testing/src/src_processor_static_address_map_unittest-gmock-all.obj `if test -f 'src/testing/src/gmock-all.cc'; then $(CYGPATH_W) 'src/testing/src/gmock-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/src/gmock-all.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/src/$(DEPDIR)/src_processor_static_address_map_unittest-gmock-all.Tpo src/testing/src/$(DEPDIR)/src_processor_static_address_map_unittest-gmock-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/src/gmock-all.cc' object='src/testing/src/src_processor_static_address_map_unittest-gmock-all.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_static_address_map_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/src/src_processor_static_address_map_unittest-gmock-all.obj `if test -f 'src/testing/src/gmock-all.cc'; then $(CYGPATH_W) 'src/testing/src/gmock-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/src/gmock-all.cc'; fi`
-
src/processor/src_processor_static_contained_range_map_unittest-static_contained_range_map_unittest.o: src/processor/static_contained_range_map_unittest.cc
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_static_contained_range_map_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_static_contained_range_map_unittest-static_contained_range_map_unittest.o -MD -MP -MF src/processor/$(DEPDIR)/src_processor_static_contained_range_map_unittest-static_contained_range_map_unittest.Tpo -c -o src/processor/src_processor_static_contained_range_map_unittest-static_contained_range_map_unittest.o `test -f 'src/processor/static_contained_range_map_unittest.cc' || echo '$(srcdir)/'`src/processor/static_contained_range_map_unittest.cc
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_static_contained_range_map_unittest-static_contained_range_map_unittest.Tpo src/processor/$(DEPDIR)/src_processor_static_contained_range_map_unittest-static_contained_range_map_unittest.Po
@@ -6761,34 +7149,6 @@ src/processor/src_processor_static_contained_range_map_unittest-static_contained
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_static_contained_range_map_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_static_contained_range_map_unittest-static_contained_range_map_unittest.obj `if test -f 'src/processor/static_contained_range_map_unittest.cc'; then $(CYGPATH_W) 'src/processor/static_contained_range_map_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/static_contained_range_map_unittest.cc'; fi`
-src/testing/gtest/src/src_processor_static_contained_range_map_unittest-gtest-all.o: src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_static_contained_range_map_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_processor_static_contained_range_map_unittest-gtest-all.o -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_processor_static_contained_range_map_unittest-gtest-all.Tpo -c -o src/testing/gtest/src/src_processor_static_contained_range_map_unittest-gtest-all.o `test -f 'src/testing/gtest/src/gtest-all.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_processor_static_contained_range_map_unittest-gtest-all.Tpo src/testing/gtest/src/$(DEPDIR)/src_processor_static_contained_range_map_unittest-gtest-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest-all.cc' object='src/testing/gtest/src/src_processor_static_contained_range_map_unittest-gtest-all.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_static_contained_range_map_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_processor_static_contained_range_map_unittest-gtest-all.o `test -f 'src/testing/gtest/src/gtest-all.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest-all.cc
-
-src/testing/gtest/src/src_processor_static_contained_range_map_unittest-gtest-all.obj: src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_static_contained_range_map_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_processor_static_contained_range_map_unittest-gtest-all.obj -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_processor_static_contained_range_map_unittest-gtest-all.Tpo -c -o src/testing/gtest/src/src_processor_static_contained_range_map_unittest-gtest-all.obj `if test -f 'src/testing/gtest/src/gtest-all.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest-all.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_processor_static_contained_range_map_unittest-gtest-all.Tpo src/testing/gtest/src/$(DEPDIR)/src_processor_static_contained_range_map_unittest-gtest-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest-all.cc' object='src/testing/gtest/src/src_processor_static_contained_range_map_unittest-gtest-all.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_static_contained_range_map_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_processor_static_contained_range_map_unittest-gtest-all.obj `if test -f 'src/testing/gtest/src/gtest-all.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest-all.cc'; fi`
-
-src/testing/src/src_processor_static_contained_range_map_unittest-gmock-all.o: src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_static_contained_range_map_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/src/src_processor_static_contained_range_map_unittest-gmock-all.o -MD -MP -MF src/testing/src/$(DEPDIR)/src_processor_static_contained_range_map_unittest-gmock-all.Tpo -c -o src/testing/src/src_processor_static_contained_range_map_unittest-gmock-all.o `test -f 'src/testing/src/gmock-all.cc' || echo '$(srcdir)/'`src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/src/$(DEPDIR)/src_processor_static_contained_range_map_unittest-gmock-all.Tpo src/testing/src/$(DEPDIR)/src_processor_static_contained_range_map_unittest-gmock-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/src/gmock-all.cc' object='src/testing/src/src_processor_static_contained_range_map_unittest-gmock-all.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_static_contained_range_map_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/src/src_processor_static_contained_range_map_unittest-gmock-all.o `test -f 'src/testing/src/gmock-all.cc' || echo '$(srcdir)/'`src/testing/src/gmock-all.cc
-
-src/testing/src/src_processor_static_contained_range_map_unittest-gmock-all.obj: src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_static_contained_range_map_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/src/src_processor_static_contained_range_map_unittest-gmock-all.obj -MD -MP -MF src/testing/src/$(DEPDIR)/src_processor_static_contained_range_map_unittest-gmock-all.Tpo -c -o src/testing/src/src_processor_static_contained_range_map_unittest-gmock-all.obj `if test -f 'src/testing/src/gmock-all.cc'; then $(CYGPATH_W) 'src/testing/src/gmock-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/src/gmock-all.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/src/$(DEPDIR)/src_processor_static_contained_range_map_unittest-gmock-all.Tpo src/testing/src/$(DEPDIR)/src_processor_static_contained_range_map_unittest-gmock-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/src/gmock-all.cc' object='src/testing/src/src_processor_static_contained_range_map_unittest-gmock-all.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_static_contained_range_map_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/src/src_processor_static_contained_range_map_unittest-gmock-all.obj `if test -f 'src/testing/src/gmock-all.cc'; then $(CYGPATH_W) 'src/testing/src/gmock-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/src/gmock-all.cc'; fi`
-
src/processor/src_processor_static_map_unittest-static_map_unittest.o: src/processor/static_map_unittest.cc
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_static_map_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_static_map_unittest-static_map_unittest.o -MD -MP -MF src/processor/$(DEPDIR)/src_processor_static_map_unittest-static_map_unittest.Tpo -c -o src/processor/src_processor_static_map_unittest-static_map_unittest.o `test -f 'src/processor/static_map_unittest.cc' || echo '$(srcdir)/'`src/processor/static_map_unittest.cc
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_static_map_unittest-static_map_unittest.Tpo src/processor/$(DEPDIR)/src_processor_static_map_unittest-static_map_unittest.Po
@@ -6803,34 +7163,6 @@ src/processor/src_processor_static_map_unittest-static_map_unittest.obj: src/pro
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_static_map_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_static_map_unittest-static_map_unittest.obj `if test -f 'src/processor/static_map_unittest.cc'; then $(CYGPATH_W) 'src/processor/static_map_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/static_map_unittest.cc'; fi`
-src/testing/gtest/src/src_processor_static_map_unittest-gtest-all.o: src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_static_map_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_processor_static_map_unittest-gtest-all.o -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_processor_static_map_unittest-gtest-all.Tpo -c -o src/testing/gtest/src/src_processor_static_map_unittest-gtest-all.o `test -f 'src/testing/gtest/src/gtest-all.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_processor_static_map_unittest-gtest-all.Tpo src/testing/gtest/src/$(DEPDIR)/src_processor_static_map_unittest-gtest-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest-all.cc' object='src/testing/gtest/src/src_processor_static_map_unittest-gtest-all.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_static_map_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_processor_static_map_unittest-gtest-all.o `test -f 'src/testing/gtest/src/gtest-all.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest-all.cc
-
-src/testing/gtest/src/src_processor_static_map_unittest-gtest-all.obj: src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_static_map_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_processor_static_map_unittest-gtest-all.obj -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_processor_static_map_unittest-gtest-all.Tpo -c -o src/testing/gtest/src/src_processor_static_map_unittest-gtest-all.obj `if test -f 'src/testing/gtest/src/gtest-all.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest-all.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_processor_static_map_unittest-gtest-all.Tpo src/testing/gtest/src/$(DEPDIR)/src_processor_static_map_unittest-gtest-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest-all.cc' object='src/testing/gtest/src/src_processor_static_map_unittest-gtest-all.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_static_map_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_processor_static_map_unittest-gtest-all.obj `if test -f 'src/testing/gtest/src/gtest-all.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest-all.cc'; fi`
-
-src/testing/src/src_processor_static_map_unittest-gmock-all.o: src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_static_map_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/src/src_processor_static_map_unittest-gmock-all.o -MD -MP -MF src/testing/src/$(DEPDIR)/src_processor_static_map_unittest-gmock-all.Tpo -c -o src/testing/src/src_processor_static_map_unittest-gmock-all.o `test -f 'src/testing/src/gmock-all.cc' || echo '$(srcdir)/'`src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/src/$(DEPDIR)/src_processor_static_map_unittest-gmock-all.Tpo src/testing/src/$(DEPDIR)/src_processor_static_map_unittest-gmock-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/src/gmock-all.cc' object='src/testing/src/src_processor_static_map_unittest-gmock-all.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_static_map_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/src/src_processor_static_map_unittest-gmock-all.o `test -f 'src/testing/src/gmock-all.cc' || echo '$(srcdir)/'`src/testing/src/gmock-all.cc
-
-src/testing/src/src_processor_static_map_unittest-gmock-all.obj: src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_static_map_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/src/src_processor_static_map_unittest-gmock-all.obj -MD -MP -MF src/testing/src/$(DEPDIR)/src_processor_static_map_unittest-gmock-all.Tpo -c -o src/testing/src/src_processor_static_map_unittest-gmock-all.obj `if test -f 'src/testing/src/gmock-all.cc'; then $(CYGPATH_W) 'src/testing/src/gmock-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/src/gmock-all.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/src/$(DEPDIR)/src_processor_static_map_unittest-gmock-all.Tpo src/testing/src/$(DEPDIR)/src_processor_static_map_unittest-gmock-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/src/gmock-all.cc' object='src/testing/src/src_processor_static_map_unittest-gmock-all.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_static_map_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/src/src_processor_static_map_unittest-gmock-all.obj `if test -f 'src/testing/src/gmock-all.cc'; then $(CYGPATH_W) 'src/testing/src/gmock-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/src/gmock-all.cc'; fi`
-
src/processor/src_processor_static_range_map_unittest-static_range_map_unittest.o: src/processor/static_range_map_unittest.cc
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_static_range_map_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_static_range_map_unittest-static_range_map_unittest.o -MD -MP -MF src/processor/$(DEPDIR)/src_processor_static_range_map_unittest-static_range_map_unittest.Tpo -c -o src/processor/src_processor_static_range_map_unittest-static_range_map_unittest.o `test -f 'src/processor/static_range_map_unittest.cc' || echo '$(srcdir)/'`src/processor/static_range_map_unittest.cc
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_static_range_map_unittest-static_range_map_unittest.Tpo src/processor/$(DEPDIR)/src_processor_static_range_map_unittest-static_range_map_unittest.Po
@@ -6845,34 +7177,6 @@ src/processor/src_processor_static_range_map_unittest-static_range_map_unittest.
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_static_range_map_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_static_range_map_unittest-static_range_map_unittest.obj `if test -f 'src/processor/static_range_map_unittest.cc'; then $(CYGPATH_W) 'src/processor/static_range_map_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/static_range_map_unittest.cc'; fi`
-src/testing/gtest/src/src_processor_static_range_map_unittest-gtest-all.o: src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_static_range_map_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_processor_static_range_map_unittest-gtest-all.o -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_processor_static_range_map_unittest-gtest-all.Tpo -c -o src/testing/gtest/src/src_processor_static_range_map_unittest-gtest-all.o `test -f 'src/testing/gtest/src/gtest-all.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_processor_static_range_map_unittest-gtest-all.Tpo src/testing/gtest/src/$(DEPDIR)/src_processor_static_range_map_unittest-gtest-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest-all.cc' object='src/testing/gtest/src/src_processor_static_range_map_unittest-gtest-all.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_static_range_map_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_processor_static_range_map_unittest-gtest-all.o `test -f 'src/testing/gtest/src/gtest-all.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest-all.cc
-
-src/testing/gtest/src/src_processor_static_range_map_unittest-gtest-all.obj: src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_static_range_map_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_processor_static_range_map_unittest-gtest-all.obj -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_processor_static_range_map_unittest-gtest-all.Tpo -c -o src/testing/gtest/src/src_processor_static_range_map_unittest-gtest-all.obj `if test -f 'src/testing/gtest/src/gtest-all.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest-all.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_processor_static_range_map_unittest-gtest-all.Tpo src/testing/gtest/src/$(DEPDIR)/src_processor_static_range_map_unittest-gtest-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest-all.cc' object='src/testing/gtest/src/src_processor_static_range_map_unittest-gtest-all.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_static_range_map_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_processor_static_range_map_unittest-gtest-all.obj `if test -f 'src/testing/gtest/src/gtest-all.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest-all.cc'; fi`
-
-src/testing/src/src_processor_static_range_map_unittest-gmock-all.o: src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_static_range_map_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/src/src_processor_static_range_map_unittest-gmock-all.o -MD -MP -MF src/testing/src/$(DEPDIR)/src_processor_static_range_map_unittest-gmock-all.Tpo -c -o src/testing/src/src_processor_static_range_map_unittest-gmock-all.o `test -f 'src/testing/src/gmock-all.cc' || echo '$(srcdir)/'`src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/src/$(DEPDIR)/src_processor_static_range_map_unittest-gmock-all.Tpo src/testing/src/$(DEPDIR)/src_processor_static_range_map_unittest-gmock-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/src/gmock-all.cc' object='src/testing/src/src_processor_static_range_map_unittest-gmock-all.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_static_range_map_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/src/src_processor_static_range_map_unittest-gmock-all.o `test -f 'src/testing/src/gmock-all.cc' || echo '$(srcdir)/'`src/testing/src/gmock-all.cc
-
-src/testing/src/src_processor_static_range_map_unittest-gmock-all.obj: src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_static_range_map_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/src/src_processor_static_range_map_unittest-gmock-all.obj -MD -MP -MF src/testing/src/$(DEPDIR)/src_processor_static_range_map_unittest-gmock-all.Tpo -c -o src/testing/src/src_processor_static_range_map_unittest-gmock-all.obj `if test -f 'src/testing/src/gmock-all.cc'; then $(CYGPATH_W) 'src/testing/src/gmock-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/src/gmock-all.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/src/$(DEPDIR)/src_processor_static_range_map_unittest-gmock-all.Tpo src/testing/src/$(DEPDIR)/src_processor_static_range_map_unittest-gmock-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/src/gmock-all.cc' object='src/testing/src/src_processor_static_range_map_unittest-gmock-all.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_static_range_map_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/src/src_processor_static_range_map_unittest-gmock-all.obj `if test -f 'src/testing/src/gmock-all.cc'; then $(CYGPATH_W) 'src/testing/src/gmock-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/src/gmock-all.cc'; fi`
-
src/common/src_processor_synth_minidump_unittest-test_assembler.o: src/common/test_assembler.cc
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_synth_minidump_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_processor_synth_minidump_unittest-test_assembler.o -MD -MP -MF src/common/$(DEPDIR)/src_processor_synth_minidump_unittest-test_assembler.Tpo -c -o src/common/src_processor_synth_minidump_unittest-test_assembler.o `test -f 'src/common/test_assembler.cc' || echo '$(srcdir)/'`src/common/test_assembler.cc
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_processor_synth_minidump_unittest-test_assembler.Tpo src/common/$(DEPDIR)/src_processor_synth_minidump_unittest-test_assembler.Po
@@ -6901,103 +7205,327 @@ src/processor/src_processor_synth_minidump_unittest-synth_minidump_unittest.obj:
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_synth_minidump_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_synth_minidump_unittest-synth_minidump_unittest.obj `if test -f 'src/processor/synth_minidump_unittest.cc'; then $(CYGPATH_W) 'src/processor/synth_minidump_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/synth_minidump_unittest.cc'; fi`
-src/testing/gtest/src/src_processor_synth_minidump_unittest-gtest-all.o: src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_synth_minidump_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_processor_synth_minidump_unittest-gtest-all.o -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_processor_synth_minidump_unittest-gtest-all.Tpo -c -o src/testing/gtest/src/src_processor_synth_minidump_unittest-gtest-all.o `test -f 'src/testing/gtest/src/gtest-all.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_processor_synth_minidump_unittest-gtest-all.Tpo src/testing/gtest/src/$(DEPDIR)/src_processor_synth_minidump_unittest-gtest-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest-all.cc' object='src/testing/gtest/src/src_processor_synth_minidump_unittest-gtest-all.o' libtool=no @AMDEPBACKSLASH@
+src/processor/src_processor_synth_minidump_unittest-synth_minidump.o: src/processor/synth_minidump.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_synth_minidump_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_synth_minidump_unittest-synth_minidump.o -MD -MP -MF src/processor/$(DEPDIR)/src_processor_synth_minidump_unittest-synth_minidump.Tpo -c -o src/processor/src_processor_synth_minidump_unittest-synth_minidump.o `test -f 'src/processor/synth_minidump.cc' || echo '$(srcdir)/'`src/processor/synth_minidump.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_synth_minidump_unittest-synth_minidump.Tpo src/processor/$(DEPDIR)/src_processor_synth_minidump_unittest-synth_minidump.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/synth_minidump.cc' object='src/processor/src_processor_synth_minidump_unittest-synth_minidump.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_synth_minidump_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_processor_synth_minidump_unittest-gtest-all.o `test -f 'src/testing/gtest/src/gtest-all.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest-all.cc
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_synth_minidump_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_synth_minidump_unittest-synth_minidump.o `test -f 'src/processor/synth_minidump.cc' || echo '$(srcdir)/'`src/processor/synth_minidump.cc
-src/testing/gtest/src/src_processor_synth_minidump_unittest-gtest-all.obj: src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_synth_minidump_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_processor_synth_minidump_unittest-gtest-all.obj -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_processor_synth_minidump_unittest-gtest-all.Tpo -c -o src/testing/gtest/src/src_processor_synth_minidump_unittest-gtest-all.obj `if test -f 'src/testing/gtest/src/gtest-all.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest-all.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_processor_synth_minidump_unittest-gtest-all.Tpo src/testing/gtest/src/$(DEPDIR)/src_processor_synth_minidump_unittest-gtest-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest-all.cc' object='src/testing/gtest/src/src_processor_synth_minidump_unittest-gtest-all.obj' libtool=no @AMDEPBACKSLASH@
+src/processor/src_processor_synth_minidump_unittest-synth_minidump.obj: src/processor/synth_minidump.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_synth_minidump_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_synth_minidump_unittest-synth_minidump.obj -MD -MP -MF src/processor/$(DEPDIR)/src_processor_synth_minidump_unittest-synth_minidump.Tpo -c -o src/processor/src_processor_synth_minidump_unittest-synth_minidump.obj `if test -f 'src/processor/synth_minidump.cc'; then $(CYGPATH_W) 'src/processor/synth_minidump.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/synth_minidump.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_synth_minidump_unittest-synth_minidump.Tpo src/processor/$(DEPDIR)/src_processor_synth_minidump_unittest-synth_minidump.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/synth_minidump.cc' object='src/processor/src_processor_synth_minidump_unittest-synth_minidump.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_synth_minidump_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_processor_synth_minidump_unittest-gtest-all.obj `if test -f 'src/testing/gtest/src/gtest-all.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest-all.cc'; fi`
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_synth_minidump_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_synth_minidump_unittest-synth_minidump.obj `if test -f 'src/processor/synth_minidump.cc'; then $(CYGPATH_W) 'src/processor/synth_minidump.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/synth_minidump.cc'; fi`
-src/testing/gtest/src/src_processor_synth_minidump_unittest-gtest_main.o: src/testing/gtest/src/gtest_main.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_synth_minidump_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_processor_synth_minidump_unittest-gtest_main.o -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_processor_synth_minidump_unittest-gtest_main.Tpo -c -o src/testing/gtest/src/src_processor_synth_minidump_unittest-gtest_main.o `test -f 'src/testing/gtest/src/gtest_main.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest_main.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_processor_synth_minidump_unittest-gtest_main.Tpo src/testing/gtest/src/$(DEPDIR)/src_processor_synth_minidump_unittest-gtest_main.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest_main.cc' object='src/testing/gtest/src/src_processor_synth_minidump_unittest-gtest_main.o' libtool=no @AMDEPBACKSLASH@
+src/common/src_tools_linux_dump_syms_dump_syms-dwarf_cfi_to_module.o: src/common/dwarf_cfi_to_module.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_tools_linux_dump_syms_dump_syms-dwarf_cfi_to_module.o -MD -MP -MF src/common/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-dwarf_cfi_to_module.Tpo -c -o src/common/src_tools_linux_dump_syms_dump_syms-dwarf_cfi_to_module.o `test -f 'src/common/dwarf_cfi_to_module.cc' || echo '$(srcdir)/'`src/common/dwarf_cfi_to_module.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-dwarf_cfi_to_module.Tpo src/common/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-dwarf_cfi_to_module.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf_cfi_to_module.cc' object='src/common/src_tools_linux_dump_syms_dump_syms-dwarf_cfi_to_module.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_synth_minidump_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_processor_synth_minidump_unittest-gtest_main.o `test -f 'src/testing/gtest/src/gtest_main.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest_main.cc
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_tools_linux_dump_syms_dump_syms-dwarf_cfi_to_module.o `test -f 'src/common/dwarf_cfi_to_module.cc' || echo '$(srcdir)/'`src/common/dwarf_cfi_to_module.cc
-src/testing/gtest/src/src_processor_synth_minidump_unittest-gtest_main.obj: src/testing/gtest/src/gtest_main.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_synth_minidump_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_processor_synth_minidump_unittest-gtest_main.obj -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_processor_synth_minidump_unittest-gtest_main.Tpo -c -o src/testing/gtest/src/src_processor_synth_minidump_unittest-gtest_main.obj `if test -f 'src/testing/gtest/src/gtest_main.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest_main.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest_main.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_processor_synth_minidump_unittest-gtest_main.Tpo src/testing/gtest/src/$(DEPDIR)/src_processor_synth_minidump_unittest-gtest_main.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest_main.cc' object='src/testing/gtest/src/src_processor_synth_minidump_unittest-gtest_main.obj' libtool=no @AMDEPBACKSLASH@
+src/common/src_tools_linux_dump_syms_dump_syms-dwarf_cfi_to_module.obj: src/common/dwarf_cfi_to_module.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_tools_linux_dump_syms_dump_syms-dwarf_cfi_to_module.obj -MD -MP -MF src/common/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-dwarf_cfi_to_module.Tpo -c -o src/common/src_tools_linux_dump_syms_dump_syms-dwarf_cfi_to_module.obj `if test -f 'src/common/dwarf_cfi_to_module.cc'; then $(CYGPATH_W) 'src/common/dwarf_cfi_to_module.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf_cfi_to_module.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-dwarf_cfi_to_module.Tpo src/common/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-dwarf_cfi_to_module.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf_cfi_to_module.cc' object='src/common/src_tools_linux_dump_syms_dump_syms-dwarf_cfi_to_module.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_synth_minidump_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_processor_synth_minidump_unittest-gtest_main.obj `if test -f 'src/testing/gtest/src/gtest_main.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest_main.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest_main.cc'; fi`
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_tools_linux_dump_syms_dump_syms-dwarf_cfi_to_module.obj `if test -f 'src/common/dwarf_cfi_to_module.cc'; then $(CYGPATH_W) 'src/common/dwarf_cfi_to_module.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf_cfi_to_module.cc'; fi`
-src/testing/src/src_processor_synth_minidump_unittest-gmock-all.o: src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_synth_minidump_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/src/src_processor_synth_minidump_unittest-gmock-all.o -MD -MP -MF src/testing/src/$(DEPDIR)/src_processor_synth_minidump_unittest-gmock-all.Tpo -c -o src/testing/src/src_processor_synth_minidump_unittest-gmock-all.o `test -f 'src/testing/src/gmock-all.cc' || echo '$(srcdir)/'`src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/src/$(DEPDIR)/src_processor_synth_minidump_unittest-gmock-all.Tpo src/testing/src/$(DEPDIR)/src_processor_synth_minidump_unittest-gmock-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/src/gmock-all.cc' object='src/testing/src/src_processor_synth_minidump_unittest-gmock-all.o' libtool=no @AMDEPBACKSLASH@
+src/common/src_tools_linux_dump_syms_dump_syms-dwarf_cu_to_module.o: src/common/dwarf_cu_to_module.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_tools_linux_dump_syms_dump_syms-dwarf_cu_to_module.o -MD -MP -MF src/common/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-dwarf_cu_to_module.Tpo -c -o src/common/src_tools_linux_dump_syms_dump_syms-dwarf_cu_to_module.o `test -f 'src/common/dwarf_cu_to_module.cc' || echo '$(srcdir)/'`src/common/dwarf_cu_to_module.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-dwarf_cu_to_module.Tpo src/common/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-dwarf_cu_to_module.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf_cu_to_module.cc' object='src/common/src_tools_linux_dump_syms_dump_syms-dwarf_cu_to_module.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_synth_minidump_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/src/src_processor_synth_minidump_unittest-gmock-all.o `test -f 'src/testing/src/gmock-all.cc' || echo '$(srcdir)/'`src/testing/src/gmock-all.cc
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_tools_linux_dump_syms_dump_syms-dwarf_cu_to_module.o `test -f 'src/common/dwarf_cu_to_module.cc' || echo '$(srcdir)/'`src/common/dwarf_cu_to_module.cc
-src/testing/src/src_processor_synth_minidump_unittest-gmock-all.obj: src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_synth_minidump_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/src/src_processor_synth_minidump_unittest-gmock-all.obj -MD -MP -MF src/testing/src/$(DEPDIR)/src_processor_synth_minidump_unittest-gmock-all.Tpo -c -o src/testing/src/src_processor_synth_minidump_unittest-gmock-all.obj `if test -f 'src/testing/src/gmock-all.cc'; then $(CYGPATH_W) 'src/testing/src/gmock-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/src/gmock-all.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/src/$(DEPDIR)/src_processor_synth_minidump_unittest-gmock-all.Tpo src/testing/src/$(DEPDIR)/src_processor_synth_minidump_unittest-gmock-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/src/gmock-all.cc' object='src/testing/src/src_processor_synth_minidump_unittest-gmock-all.obj' libtool=no @AMDEPBACKSLASH@
+src/common/src_tools_linux_dump_syms_dump_syms-dwarf_cu_to_module.obj: src/common/dwarf_cu_to_module.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_tools_linux_dump_syms_dump_syms-dwarf_cu_to_module.obj -MD -MP -MF src/common/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-dwarf_cu_to_module.Tpo -c -o src/common/src_tools_linux_dump_syms_dump_syms-dwarf_cu_to_module.obj `if test -f 'src/common/dwarf_cu_to_module.cc'; then $(CYGPATH_W) 'src/common/dwarf_cu_to_module.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf_cu_to_module.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-dwarf_cu_to_module.Tpo src/common/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-dwarf_cu_to_module.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf_cu_to_module.cc' object='src/common/src_tools_linux_dump_syms_dump_syms-dwarf_cu_to_module.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_synth_minidump_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/src/src_processor_synth_minidump_unittest-gmock-all.obj `if test -f 'src/testing/src/gmock-all.cc'; then $(CYGPATH_W) 'src/testing/src/gmock-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/src/gmock-all.cc'; fi`
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_tools_linux_dump_syms_dump_syms-dwarf_cu_to_module.obj `if test -f 'src/common/dwarf_cu_to_module.cc'; then $(CYGPATH_W) 'src/common/dwarf_cu_to_module.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf_cu_to_module.cc'; fi`
-src/processor/src_processor_synth_minidump_unittest-synth_minidump.o: src/processor/synth_minidump.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_synth_minidump_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_synth_minidump_unittest-synth_minidump.o -MD -MP -MF src/processor/$(DEPDIR)/src_processor_synth_minidump_unittest-synth_minidump.Tpo -c -o src/processor/src_processor_synth_minidump_unittest-synth_minidump.o `test -f 'src/processor/synth_minidump.cc' || echo '$(srcdir)/'`src/processor/synth_minidump.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_synth_minidump_unittest-synth_minidump.Tpo src/processor/$(DEPDIR)/src_processor_synth_minidump_unittest-synth_minidump.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/synth_minidump.cc' object='src/processor/src_processor_synth_minidump_unittest-synth_minidump.o' libtool=no @AMDEPBACKSLASH@
+src/common/src_tools_linux_dump_syms_dump_syms-dwarf_line_to_module.o: src/common/dwarf_line_to_module.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_tools_linux_dump_syms_dump_syms-dwarf_line_to_module.o -MD -MP -MF src/common/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-dwarf_line_to_module.Tpo -c -o src/common/src_tools_linux_dump_syms_dump_syms-dwarf_line_to_module.o `test -f 'src/common/dwarf_line_to_module.cc' || echo '$(srcdir)/'`src/common/dwarf_line_to_module.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-dwarf_line_to_module.Tpo src/common/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-dwarf_line_to_module.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf_line_to_module.cc' object='src/common/src_tools_linux_dump_syms_dump_syms-dwarf_line_to_module.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_synth_minidump_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_synth_minidump_unittest-synth_minidump.o `test -f 'src/processor/synth_minidump.cc' || echo '$(srcdir)/'`src/processor/synth_minidump.cc
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_tools_linux_dump_syms_dump_syms-dwarf_line_to_module.o `test -f 'src/common/dwarf_line_to_module.cc' || echo '$(srcdir)/'`src/common/dwarf_line_to_module.cc
-src/processor/src_processor_synth_minidump_unittest-synth_minidump.obj: src/processor/synth_minidump.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_synth_minidump_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_synth_minidump_unittest-synth_minidump.obj -MD -MP -MF src/processor/$(DEPDIR)/src_processor_synth_minidump_unittest-synth_minidump.Tpo -c -o src/processor/src_processor_synth_minidump_unittest-synth_minidump.obj `if test -f 'src/processor/synth_minidump.cc'; then $(CYGPATH_W) 'src/processor/synth_minidump.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/synth_minidump.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_synth_minidump_unittest-synth_minidump.Tpo src/processor/$(DEPDIR)/src_processor_synth_minidump_unittest-synth_minidump.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/synth_minidump.cc' object='src/processor/src_processor_synth_minidump_unittest-synth_minidump.obj' libtool=no @AMDEPBACKSLASH@
+src/common/src_tools_linux_dump_syms_dump_syms-dwarf_line_to_module.obj: src/common/dwarf_line_to_module.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_tools_linux_dump_syms_dump_syms-dwarf_line_to_module.obj -MD -MP -MF src/common/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-dwarf_line_to_module.Tpo -c -o src/common/src_tools_linux_dump_syms_dump_syms-dwarf_line_to_module.obj `if test -f 'src/common/dwarf_line_to_module.cc'; then $(CYGPATH_W) 'src/common/dwarf_line_to_module.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf_line_to_module.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-dwarf_line_to_module.Tpo src/common/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-dwarf_line_to_module.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf_line_to_module.cc' object='src/common/src_tools_linux_dump_syms_dump_syms-dwarf_line_to_module.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_synth_minidump_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_synth_minidump_unittest-synth_minidump.obj `if test -f 'src/processor/synth_minidump.cc'; then $(CYGPATH_W) 'src/processor/synth_minidump.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/synth_minidump.cc'; fi`
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_tools_linux_dump_syms_dump_syms-dwarf_line_to_module.obj `if test -f 'src/common/dwarf_line_to_module.cc'; then $(CYGPATH_W) 'src/common/dwarf_line_to_module.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf_line_to_module.cc'; fi`
+
+src/common/src_tools_linux_dump_syms_dump_syms-dwarf_range_list_handler.o: src/common/dwarf_range_list_handler.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_tools_linux_dump_syms_dump_syms-dwarf_range_list_handler.o -MD -MP -MF src/common/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-dwarf_range_list_handler.Tpo -c -o src/common/src_tools_linux_dump_syms_dump_syms-dwarf_range_list_handler.o `test -f 'src/common/dwarf_range_list_handler.cc' || echo '$(srcdir)/'`src/common/dwarf_range_list_handler.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-dwarf_range_list_handler.Tpo src/common/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-dwarf_range_list_handler.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf_range_list_handler.cc' object='src/common/src_tools_linux_dump_syms_dump_syms-dwarf_range_list_handler.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_tools_linux_dump_syms_dump_syms-dwarf_range_list_handler.o `test -f 'src/common/dwarf_range_list_handler.cc' || echo '$(srcdir)/'`src/common/dwarf_range_list_handler.cc
+
+src/common/src_tools_linux_dump_syms_dump_syms-dwarf_range_list_handler.obj: src/common/dwarf_range_list_handler.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_tools_linux_dump_syms_dump_syms-dwarf_range_list_handler.obj -MD -MP -MF src/common/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-dwarf_range_list_handler.Tpo -c -o src/common/src_tools_linux_dump_syms_dump_syms-dwarf_range_list_handler.obj `if test -f 'src/common/dwarf_range_list_handler.cc'; then $(CYGPATH_W) 'src/common/dwarf_range_list_handler.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf_range_list_handler.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-dwarf_range_list_handler.Tpo src/common/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-dwarf_range_list_handler.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf_range_list_handler.cc' object='src/common/src_tools_linux_dump_syms_dump_syms-dwarf_range_list_handler.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_tools_linux_dump_syms_dump_syms-dwarf_range_list_handler.obj `if test -f 'src/common/dwarf_range_list_handler.cc'; then $(CYGPATH_W) 'src/common/dwarf_range_list_handler.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf_range_list_handler.cc'; fi`
+
+src/common/src_tools_linux_dump_syms_dump_syms-language.o: src/common/language.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_tools_linux_dump_syms_dump_syms-language.o -MD -MP -MF src/common/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-language.Tpo -c -o src/common/src_tools_linux_dump_syms_dump_syms-language.o `test -f 'src/common/language.cc' || echo '$(srcdir)/'`src/common/language.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-language.Tpo src/common/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-language.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/language.cc' object='src/common/src_tools_linux_dump_syms_dump_syms-language.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_tools_linux_dump_syms_dump_syms-language.o `test -f 'src/common/language.cc' || echo '$(srcdir)/'`src/common/language.cc
+
+src/common/src_tools_linux_dump_syms_dump_syms-language.obj: src/common/language.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_tools_linux_dump_syms_dump_syms-language.obj -MD -MP -MF src/common/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-language.Tpo -c -o src/common/src_tools_linux_dump_syms_dump_syms-language.obj `if test -f 'src/common/language.cc'; then $(CYGPATH_W) 'src/common/language.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/language.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-language.Tpo src/common/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-language.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/language.cc' object='src/common/src_tools_linux_dump_syms_dump_syms-language.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_tools_linux_dump_syms_dump_syms-language.obj `if test -f 'src/common/language.cc'; then $(CYGPATH_W) 'src/common/language.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/language.cc'; fi`
+
+src/common/src_tools_linux_dump_syms_dump_syms-module.o: src/common/module.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_tools_linux_dump_syms_dump_syms-module.o -MD -MP -MF src/common/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-module.Tpo -c -o src/common/src_tools_linux_dump_syms_dump_syms-module.o `test -f 'src/common/module.cc' || echo '$(srcdir)/'`src/common/module.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-module.Tpo src/common/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-module.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/module.cc' object='src/common/src_tools_linux_dump_syms_dump_syms-module.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_tools_linux_dump_syms_dump_syms-module.o `test -f 'src/common/module.cc' || echo '$(srcdir)/'`src/common/module.cc
+
+src/common/src_tools_linux_dump_syms_dump_syms-module.obj: src/common/module.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_tools_linux_dump_syms_dump_syms-module.obj -MD -MP -MF src/common/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-module.Tpo -c -o src/common/src_tools_linux_dump_syms_dump_syms-module.obj `if test -f 'src/common/module.cc'; then $(CYGPATH_W) 'src/common/module.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/module.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-module.Tpo src/common/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-module.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/module.cc' object='src/common/src_tools_linux_dump_syms_dump_syms-module.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_tools_linux_dump_syms_dump_syms-module.obj `if test -f 'src/common/module.cc'; then $(CYGPATH_W) 'src/common/module.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/module.cc'; fi`
+
+src/common/src_tools_linux_dump_syms_dump_syms-path_helper.o: src/common/path_helper.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_tools_linux_dump_syms_dump_syms-path_helper.o -MD -MP -MF src/common/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-path_helper.Tpo -c -o src/common/src_tools_linux_dump_syms_dump_syms-path_helper.o `test -f 'src/common/path_helper.cc' || echo '$(srcdir)/'`src/common/path_helper.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-path_helper.Tpo src/common/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-path_helper.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/path_helper.cc' object='src/common/src_tools_linux_dump_syms_dump_syms-path_helper.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_tools_linux_dump_syms_dump_syms-path_helper.o `test -f 'src/common/path_helper.cc' || echo '$(srcdir)/'`src/common/path_helper.cc
+
+src/common/src_tools_linux_dump_syms_dump_syms-path_helper.obj: src/common/path_helper.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_tools_linux_dump_syms_dump_syms-path_helper.obj -MD -MP -MF src/common/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-path_helper.Tpo -c -o src/common/src_tools_linux_dump_syms_dump_syms-path_helper.obj `if test -f 'src/common/path_helper.cc'; then $(CYGPATH_W) 'src/common/path_helper.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/path_helper.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-path_helper.Tpo src/common/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-path_helper.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/path_helper.cc' object='src/common/src_tools_linux_dump_syms_dump_syms-path_helper.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_tools_linux_dump_syms_dump_syms-path_helper.obj `if test -f 'src/common/path_helper.cc'; then $(CYGPATH_W) 'src/common/path_helper.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/path_helper.cc'; fi`
+
+src/common/src_tools_linux_dump_syms_dump_syms-stabs_reader.o: src/common/stabs_reader.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_tools_linux_dump_syms_dump_syms-stabs_reader.o -MD -MP -MF src/common/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-stabs_reader.Tpo -c -o src/common/src_tools_linux_dump_syms_dump_syms-stabs_reader.o `test -f 'src/common/stabs_reader.cc' || echo '$(srcdir)/'`src/common/stabs_reader.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-stabs_reader.Tpo src/common/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-stabs_reader.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/stabs_reader.cc' object='src/common/src_tools_linux_dump_syms_dump_syms-stabs_reader.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_tools_linux_dump_syms_dump_syms-stabs_reader.o `test -f 'src/common/stabs_reader.cc' || echo '$(srcdir)/'`src/common/stabs_reader.cc
+
+src/common/src_tools_linux_dump_syms_dump_syms-stabs_reader.obj: src/common/stabs_reader.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_tools_linux_dump_syms_dump_syms-stabs_reader.obj -MD -MP -MF src/common/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-stabs_reader.Tpo -c -o src/common/src_tools_linux_dump_syms_dump_syms-stabs_reader.obj `if test -f 'src/common/stabs_reader.cc'; then $(CYGPATH_W) 'src/common/stabs_reader.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/stabs_reader.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-stabs_reader.Tpo src/common/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-stabs_reader.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/stabs_reader.cc' object='src/common/src_tools_linux_dump_syms_dump_syms-stabs_reader.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_tools_linux_dump_syms_dump_syms-stabs_reader.obj `if test -f 'src/common/stabs_reader.cc'; then $(CYGPATH_W) 'src/common/stabs_reader.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/stabs_reader.cc'; fi`
+
+src/common/src_tools_linux_dump_syms_dump_syms-stabs_to_module.o: src/common/stabs_to_module.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_tools_linux_dump_syms_dump_syms-stabs_to_module.o -MD -MP -MF src/common/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-stabs_to_module.Tpo -c -o src/common/src_tools_linux_dump_syms_dump_syms-stabs_to_module.o `test -f 'src/common/stabs_to_module.cc' || echo '$(srcdir)/'`src/common/stabs_to_module.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-stabs_to_module.Tpo src/common/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-stabs_to_module.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/stabs_to_module.cc' object='src/common/src_tools_linux_dump_syms_dump_syms-stabs_to_module.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_tools_linux_dump_syms_dump_syms-stabs_to_module.o `test -f 'src/common/stabs_to_module.cc' || echo '$(srcdir)/'`src/common/stabs_to_module.cc
+
+src/common/src_tools_linux_dump_syms_dump_syms-stabs_to_module.obj: src/common/stabs_to_module.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_tools_linux_dump_syms_dump_syms-stabs_to_module.obj -MD -MP -MF src/common/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-stabs_to_module.Tpo -c -o src/common/src_tools_linux_dump_syms_dump_syms-stabs_to_module.obj `if test -f 'src/common/stabs_to_module.cc'; then $(CYGPATH_W) 'src/common/stabs_to_module.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/stabs_to_module.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-stabs_to_module.Tpo src/common/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-stabs_to_module.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/stabs_to_module.cc' object='src/common/src_tools_linux_dump_syms_dump_syms-stabs_to_module.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_tools_linux_dump_syms_dump_syms-stabs_to_module.obj `if test -f 'src/common/stabs_to_module.cc'; then $(CYGPATH_W) 'src/common/stabs_to_module.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/stabs_to_module.cc'; fi`
+
+src/common/dwarf/src_tools_linux_dump_syms_dump_syms-bytereader.o: src/common/dwarf/bytereader.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -MT src/common/dwarf/src_tools_linux_dump_syms_dump_syms-bytereader.o -MD -MP -MF src/common/dwarf/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-bytereader.Tpo -c -o src/common/dwarf/src_tools_linux_dump_syms_dump_syms-bytereader.o `test -f 'src/common/dwarf/bytereader.cc' || echo '$(srcdir)/'`src/common/dwarf/bytereader.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/dwarf/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-bytereader.Tpo src/common/dwarf/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-bytereader.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf/bytereader.cc' object='src/common/dwarf/src_tools_linux_dump_syms_dump_syms-bytereader.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -c -o src/common/dwarf/src_tools_linux_dump_syms_dump_syms-bytereader.o `test -f 'src/common/dwarf/bytereader.cc' || echo '$(srcdir)/'`src/common/dwarf/bytereader.cc
+
+src/common/dwarf/src_tools_linux_dump_syms_dump_syms-bytereader.obj: src/common/dwarf/bytereader.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -MT src/common/dwarf/src_tools_linux_dump_syms_dump_syms-bytereader.obj -MD -MP -MF src/common/dwarf/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-bytereader.Tpo -c -o src/common/dwarf/src_tools_linux_dump_syms_dump_syms-bytereader.obj `if test -f 'src/common/dwarf/bytereader.cc'; then $(CYGPATH_W) 'src/common/dwarf/bytereader.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf/bytereader.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/dwarf/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-bytereader.Tpo src/common/dwarf/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-bytereader.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf/bytereader.cc' object='src/common/dwarf/src_tools_linux_dump_syms_dump_syms-bytereader.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -c -o src/common/dwarf/src_tools_linux_dump_syms_dump_syms-bytereader.obj `if test -f 'src/common/dwarf/bytereader.cc'; then $(CYGPATH_W) 'src/common/dwarf/bytereader.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf/bytereader.cc'; fi`
+
+src/common/dwarf/src_tools_linux_dump_syms_dump_syms-dwarf2diehandler.o: src/common/dwarf/dwarf2diehandler.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -MT src/common/dwarf/src_tools_linux_dump_syms_dump_syms-dwarf2diehandler.o -MD -MP -MF src/common/dwarf/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-dwarf2diehandler.Tpo -c -o src/common/dwarf/src_tools_linux_dump_syms_dump_syms-dwarf2diehandler.o `test -f 'src/common/dwarf/dwarf2diehandler.cc' || echo '$(srcdir)/'`src/common/dwarf/dwarf2diehandler.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/dwarf/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-dwarf2diehandler.Tpo src/common/dwarf/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-dwarf2diehandler.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf/dwarf2diehandler.cc' object='src/common/dwarf/src_tools_linux_dump_syms_dump_syms-dwarf2diehandler.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -c -o src/common/dwarf/src_tools_linux_dump_syms_dump_syms-dwarf2diehandler.o `test -f 'src/common/dwarf/dwarf2diehandler.cc' || echo '$(srcdir)/'`src/common/dwarf/dwarf2diehandler.cc
+
+src/common/dwarf/src_tools_linux_dump_syms_dump_syms-dwarf2diehandler.obj: src/common/dwarf/dwarf2diehandler.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -MT src/common/dwarf/src_tools_linux_dump_syms_dump_syms-dwarf2diehandler.obj -MD -MP -MF src/common/dwarf/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-dwarf2diehandler.Tpo -c -o src/common/dwarf/src_tools_linux_dump_syms_dump_syms-dwarf2diehandler.obj `if test -f 'src/common/dwarf/dwarf2diehandler.cc'; then $(CYGPATH_W) 'src/common/dwarf/dwarf2diehandler.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf/dwarf2diehandler.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/dwarf/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-dwarf2diehandler.Tpo src/common/dwarf/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-dwarf2diehandler.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf/dwarf2diehandler.cc' object='src/common/dwarf/src_tools_linux_dump_syms_dump_syms-dwarf2diehandler.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -c -o src/common/dwarf/src_tools_linux_dump_syms_dump_syms-dwarf2diehandler.obj `if test -f 'src/common/dwarf/dwarf2diehandler.cc'; then $(CYGPATH_W) 'src/common/dwarf/dwarf2diehandler.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf/dwarf2diehandler.cc'; fi`
+
+src/common/dwarf/src_tools_linux_dump_syms_dump_syms-dwarf2reader.o: src/common/dwarf/dwarf2reader.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -MT src/common/dwarf/src_tools_linux_dump_syms_dump_syms-dwarf2reader.o -MD -MP -MF src/common/dwarf/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-dwarf2reader.Tpo -c -o src/common/dwarf/src_tools_linux_dump_syms_dump_syms-dwarf2reader.o `test -f 'src/common/dwarf/dwarf2reader.cc' || echo '$(srcdir)/'`src/common/dwarf/dwarf2reader.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/dwarf/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-dwarf2reader.Tpo src/common/dwarf/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-dwarf2reader.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf/dwarf2reader.cc' object='src/common/dwarf/src_tools_linux_dump_syms_dump_syms-dwarf2reader.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -c -o src/common/dwarf/src_tools_linux_dump_syms_dump_syms-dwarf2reader.o `test -f 'src/common/dwarf/dwarf2reader.cc' || echo '$(srcdir)/'`src/common/dwarf/dwarf2reader.cc
+
+src/common/dwarf/src_tools_linux_dump_syms_dump_syms-dwarf2reader.obj: src/common/dwarf/dwarf2reader.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -MT src/common/dwarf/src_tools_linux_dump_syms_dump_syms-dwarf2reader.obj -MD -MP -MF src/common/dwarf/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-dwarf2reader.Tpo -c -o src/common/dwarf/src_tools_linux_dump_syms_dump_syms-dwarf2reader.obj `if test -f 'src/common/dwarf/dwarf2reader.cc'; then $(CYGPATH_W) 'src/common/dwarf/dwarf2reader.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf/dwarf2reader.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/dwarf/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-dwarf2reader.Tpo src/common/dwarf/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-dwarf2reader.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf/dwarf2reader.cc' object='src/common/dwarf/src_tools_linux_dump_syms_dump_syms-dwarf2reader.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -c -o src/common/dwarf/src_tools_linux_dump_syms_dump_syms-dwarf2reader.obj `if test -f 'src/common/dwarf/dwarf2reader.cc'; then $(CYGPATH_W) 'src/common/dwarf/dwarf2reader.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf/dwarf2reader.cc'; fi`
-src/testing/gtest/src/src_tools_linux_md2core_minidump_2_core_unittest-gtest-all.o: src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_tools_linux_md2core_minidump_2_core_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_tools_linux_md2core_minidump_2_core_unittest-gtest-all.o -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_tools_linux_md2core_minidump_2_core_unittest-gtest-all.Tpo -c -o src/testing/gtest/src/src_tools_linux_md2core_minidump_2_core_unittest-gtest-all.o `test -f 'src/testing/gtest/src/gtest-all.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_tools_linux_md2core_minidump_2_core_unittest-gtest-all.Tpo src/testing/gtest/src/$(DEPDIR)/src_tools_linux_md2core_minidump_2_core_unittest-gtest-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest-all.cc' object='src/testing/gtest/src/src_tools_linux_md2core_minidump_2_core_unittest-gtest-all.o' libtool=no @AMDEPBACKSLASH@
+src/common/dwarf/src_tools_linux_dump_syms_dump_syms-elf_reader.o: src/common/dwarf/elf_reader.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -MT src/common/dwarf/src_tools_linux_dump_syms_dump_syms-elf_reader.o -MD -MP -MF src/common/dwarf/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-elf_reader.Tpo -c -o src/common/dwarf/src_tools_linux_dump_syms_dump_syms-elf_reader.o `test -f 'src/common/dwarf/elf_reader.cc' || echo '$(srcdir)/'`src/common/dwarf/elf_reader.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/dwarf/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-elf_reader.Tpo src/common/dwarf/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-elf_reader.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf/elf_reader.cc' object='src/common/dwarf/src_tools_linux_dump_syms_dump_syms-elf_reader.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_tools_linux_md2core_minidump_2_core_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_tools_linux_md2core_minidump_2_core_unittest-gtest-all.o `test -f 'src/testing/gtest/src/gtest-all.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest-all.cc
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -c -o src/common/dwarf/src_tools_linux_dump_syms_dump_syms-elf_reader.o `test -f 'src/common/dwarf/elf_reader.cc' || echo '$(srcdir)/'`src/common/dwarf/elf_reader.cc
-src/testing/gtest/src/src_tools_linux_md2core_minidump_2_core_unittest-gtest-all.obj: src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_tools_linux_md2core_minidump_2_core_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_tools_linux_md2core_minidump_2_core_unittest-gtest-all.obj -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_tools_linux_md2core_minidump_2_core_unittest-gtest-all.Tpo -c -o src/testing/gtest/src/src_tools_linux_md2core_minidump_2_core_unittest-gtest-all.obj `if test -f 'src/testing/gtest/src/gtest-all.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest-all.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_tools_linux_md2core_minidump_2_core_unittest-gtest-all.Tpo src/testing/gtest/src/$(DEPDIR)/src_tools_linux_md2core_minidump_2_core_unittest-gtest-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest-all.cc' object='src/testing/gtest/src/src_tools_linux_md2core_minidump_2_core_unittest-gtest-all.obj' libtool=no @AMDEPBACKSLASH@
+src/common/dwarf/src_tools_linux_dump_syms_dump_syms-elf_reader.obj: src/common/dwarf/elf_reader.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -MT src/common/dwarf/src_tools_linux_dump_syms_dump_syms-elf_reader.obj -MD -MP -MF src/common/dwarf/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-elf_reader.Tpo -c -o src/common/dwarf/src_tools_linux_dump_syms_dump_syms-elf_reader.obj `if test -f 'src/common/dwarf/elf_reader.cc'; then $(CYGPATH_W) 'src/common/dwarf/elf_reader.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf/elf_reader.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/dwarf/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-elf_reader.Tpo src/common/dwarf/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-elf_reader.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf/elf_reader.cc' object='src/common/dwarf/src_tools_linux_dump_syms_dump_syms-elf_reader.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_tools_linux_md2core_minidump_2_core_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_tools_linux_md2core_minidump_2_core_unittest-gtest-all.obj `if test -f 'src/testing/gtest/src/gtest-all.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest-all.cc'; fi`
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -c -o src/common/dwarf/src_tools_linux_dump_syms_dump_syms-elf_reader.obj `if test -f 'src/common/dwarf/elf_reader.cc'; then $(CYGPATH_W) 'src/common/dwarf/elf_reader.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf/elf_reader.cc'; fi`
-src/testing/gtest/src/src_tools_linux_md2core_minidump_2_core_unittest-gtest_main.o: src/testing/gtest/src/gtest_main.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_tools_linux_md2core_minidump_2_core_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_tools_linux_md2core_minidump_2_core_unittest-gtest_main.o -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_tools_linux_md2core_minidump_2_core_unittest-gtest_main.Tpo -c -o src/testing/gtest/src/src_tools_linux_md2core_minidump_2_core_unittest-gtest_main.o `test -f 'src/testing/gtest/src/gtest_main.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest_main.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_tools_linux_md2core_minidump_2_core_unittest-gtest_main.Tpo src/testing/gtest/src/$(DEPDIR)/src_tools_linux_md2core_minidump_2_core_unittest-gtest_main.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest_main.cc' object='src/testing/gtest/src/src_tools_linux_md2core_minidump_2_core_unittest-gtest_main.o' libtool=no @AMDEPBACKSLASH@
+src/common/linux/src_tools_linux_dump_syms_dump_syms-crc32.o: src/common/linux/crc32.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/src_tools_linux_dump_syms_dump_syms-crc32.o -MD -MP -MF src/common/linux/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-crc32.Tpo -c -o src/common/linux/src_tools_linux_dump_syms_dump_syms-crc32.o `test -f 'src/common/linux/crc32.cc' || echo '$(srcdir)/'`src/common/linux/crc32.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-crc32.Tpo src/common/linux/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-crc32.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/crc32.cc' object='src/common/linux/src_tools_linux_dump_syms_dump_syms-crc32.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_tools_linux_md2core_minidump_2_core_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_tools_linux_md2core_minidump_2_core_unittest-gtest_main.o `test -f 'src/testing/gtest/src/gtest_main.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest_main.cc
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/src_tools_linux_dump_syms_dump_syms-crc32.o `test -f 'src/common/linux/crc32.cc' || echo '$(srcdir)/'`src/common/linux/crc32.cc
-src/testing/gtest/src/src_tools_linux_md2core_minidump_2_core_unittest-gtest_main.obj: src/testing/gtest/src/gtest_main.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_tools_linux_md2core_minidump_2_core_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_tools_linux_md2core_minidump_2_core_unittest-gtest_main.obj -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_tools_linux_md2core_minidump_2_core_unittest-gtest_main.Tpo -c -o src/testing/gtest/src/src_tools_linux_md2core_minidump_2_core_unittest-gtest_main.obj `if test -f 'src/testing/gtest/src/gtest_main.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest_main.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest_main.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_tools_linux_md2core_minidump_2_core_unittest-gtest_main.Tpo src/testing/gtest/src/$(DEPDIR)/src_tools_linux_md2core_minidump_2_core_unittest-gtest_main.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest_main.cc' object='src/testing/gtest/src/src_tools_linux_md2core_minidump_2_core_unittest-gtest_main.obj' libtool=no @AMDEPBACKSLASH@
+src/common/linux/src_tools_linux_dump_syms_dump_syms-crc32.obj: src/common/linux/crc32.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/src_tools_linux_dump_syms_dump_syms-crc32.obj -MD -MP -MF src/common/linux/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-crc32.Tpo -c -o src/common/linux/src_tools_linux_dump_syms_dump_syms-crc32.obj `if test -f 'src/common/linux/crc32.cc'; then $(CYGPATH_W) 'src/common/linux/crc32.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/crc32.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-crc32.Tpo src/common/linux/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-crc32.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/crc32.cc' object='src/common/linux/src_tools_linux_dump_syms_dump_syms-crc32.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_tools_linux_md2core_minidump_2_core_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_tools_linux_md2core_minidump_2_core_unittest-gtest_main.obj `if test -f 'src/testing/gtest/src/gtest_main.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest_main.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest_main.cc'; fi`
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/src_tools_linux_dump_syms_dump_syms-crc32.obj `if test -f 'src/common/linux/crc32.cc'; then $(CYGPATH_W) 'src/common/linux/crc32.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/crc32.cc'; fi`
-src/testing/src/src_tools_linux_md2core_minidump_2_core_unittest-gmock-all.o: src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_tools_linux_md2core_minidump_2_core_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/src/src_tools_linux_md2core_minidump_2_core_unittest-gmock-all.o -MD -MP -MF src/testing/src/$(DEPDIR)/src_tools_linux_md2core_minidump_2_core_unittest-gmock-all.Tpo -c -o src/testing/src/src_tools_linux_md2core_minidump_2_core_unittest-gmock-all.o `test -f 'src/testing/src/gmock-all.cc' || echo '$(srcdir)/'`src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/src/$(DEPDIR)/src_tools_linux_md2core_minidump_2_core_unittest-gmock-all.Tpo src/testing/src/$(DEPDIR)/src_tools_linux_md2core_minidump_2_core_unittest-gmock-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/src/gmock-all.cc' object='src/testing/src/src_tools_linux_md2core_minidump_2_core_unittest-gmock-all.o' libtool=no @AMDEPBACKSLASH@
+src/common/linux/src_tools_linux_dump_syms_dump_syms-dump_symbols.o: src/common/linux/dump_symbols.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/src_tools_linux_dump_syms_dump_syms-dump_symbols.o -MD -MP -MF src/common/linux/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-dump_symbols.Tpo -c -o src/common/linux/src_tools_linux_dump_syms_dump_syms-dump_symbols.o `test -f 'src/common/linux/dump_symbols.cc' || echo '$(srcdir)/'`src/common/linux/dump_symbols.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-dump_symbols.Tpo src/common/linux/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-dump_symbols.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/dump_symbols.cc' object='src/common/linux/src_tools_linux_dump_syms_dump_syms-dump_symbols.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_tools_linux_md2core_minidump_2_core_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/src/src_tools_linux_md2core_minidump_2_core_unittest-gmock-all.o `test -f 'src/testing/src/gmock-all.cc' || echo '$(srcdir)/'`src/testing/src/gmock-all.cc
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/src_tools_linux_dump_syms_dump_syms-dump_symbols.o `test -f 'src/common/linux/dump_symbols.cc' || echo '$(srcdir)/'`src/common/linux/dump_symbols.cc
-src/testing/src/src_tools_linux_md2core_minidump_2_core_unittest-gmock-all.obj: src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_tools_linux_md2core_minidump_2_core_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/src/src_tools_linux_md2core_minidump_2_core_unittest-gmock-all.obj -MD -MP -MF src/testing/src/$(DEPDIR)/src_tools_linux_md2core_minidump_2_core_unittest-gmock-all.Tpo -c -o src/testing/src/src_tools_linux_md2core_minidump_2_core_unittest-gmock-all.obj `if test -f 'src/testing/src/gmock-all.cc'; then $(CYGPATH_W) 'src/testing/src/gmock-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/src/gmock-all.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/src/$(DEPDIR)/src_tools_linux_md2core_minidump_2_core_unittest-gmock-all.Tpo src/testing/src/$(DEPDIR)/src_tools_linux_md2core_minidump_2_core_unittest-gmock-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/src/gmock-all.cc' object='src/testing/src/src_tools_linux_md2core_minidump_2_core_unittest-gmock-all.obj' libtool=no @AMDEPBACKSLASH@
+src/common/linux/src_tools_linux_dump_syms_dump_syms-dump_symbols.obj: src/common/linux/dump_symbols.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/src_tools_linux_dump_syms_dump_syms-dump_symbols.obj -MD -MP -MF src/common/linux/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-dump_symbols.Tpo -c -o src/common/linux/src_tools_linux_dump_syms_dump_syms-dump_symbols.obj `if test -f 'src/common/linux/dump_symbols.cc'; then $(CYGPATH_W) 'src/common/linux/dump_symbols.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/dump_symbols.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-dump_symbols.Tpo src/common/linux/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-dump_symbols.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/dump_symbols.cc' object='src/common/linux/src_tools_linux_dump_syms_dump_syms-dump_symbols.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_tools_linux_md2core_minidump_2_core_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/src/src_tools_linux_md2core_minidump_2_core_unittest-gmock-all.obj `if test -f 'src/testing/src/gmock-all.cc'; then $(CYGPATH_W) 'src/testing/src/gmock-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/src/gmock-all.cc'; fi`
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/src_tools_linux_dump_syms_dump_syms-dump_symbols.obj `if test -f 'src/common/linux/dump_symbols.cc'; then $(CYGPATH_W) 'src/common/linux/dump_symbols.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/dump_symbols.cc'; fi`
+
+src/common/linux/src_tools_linux_dump_syms_dump_syms-elf_symbols_to_module.o: src/common/linux/elf_symbols_to_module.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/src_tools_linux_dump_syms_dump_syms-elf_symbols_to_module.o -MD -MP -MF src/common/linux/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-elf_symbols_to_module.Tpo -c -o src/common/linux/src_tools_linux_dump_syms_dump_syms-elf_symbols_to_module.o `test -f 'src/common/linux/elf_symbols_to_module.cc' || echo '$(srcdir)/'`src/common/linux/elf_symbols_to_module.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-elf_symbols_to_module.Tpo src/common/linux/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-elf_symbols_to_module.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/elf_symbols_to_module.cc' object='src/common/linux/src_tools_linux_dump_syms_dump_syms-elf_symbols_to_module.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/src_tools_linux_dump_syms_dump_syms-elf_symbols_to_module.o `test -f 'src/common/linux/elf_symbols_to_module.cc' || echo '$(srcdir)/'`src/common/linux/elf_symbols_to_module.cc
+
+src/common/linux/src_tools_linux_dump_syms_dump_syms-elf_symbols_to_module.obj: src/common/linux/elf_symbols_to_module.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/src_tools_linux_dump_syms_dump_syms-elf_symbols_to_module.obj -MD -MP -MF src/common/linux/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-elf_symbols_to_module.Tpo -c -o src/common/linux/src_tools_linux_dump_syms_dump_syms-elf_symbols_to_module.obj `if test -f 'src/common/linux/elf_symbols_to_module.cc'; then $(CYGPATH_W) 'src/common/linux/elf_symbols_to_module.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/elf_symbols_to_module.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-elf_symbols_to_module.Tpo src/common/linux/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-elf_symbols_to_module.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/elf_symbols_to_module.cc' object='src/common/linux/src_tools_linux_dump_syms_dump_syms-elf_symbols_to_module.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/src_tools_linux_dump_syms_dump_syms-elf_symbols_to_module.obj `if test -f 'src/common/linux/elf_symbols_to_module.cc'; then $(CYGPATH_W) 'src/common/linux/elf_symbols_to_module.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/elf_symbols_to_module.cc'; fi`
+
+src/common/linux/src_tools_linux_dump_syms_dump_syms-elfutils.o: src/common/linux/elfutils.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/src_tools_linux_dump_syms_dump_syms-elfutils.o -MD -MP -MF src/common/linux/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-elfutils.Tpo -c -o src/common/linux/src_tools_linux_dump_syms_dump_syms-elfutils.o `test -f 'src/common/linux/elfutils.cc' || echo '$(srcdir)/'`src/common/linux/elfutils.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-elfutils.Tpo src/common/linux/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-elfutils.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/elfutils.cc' object='src/common/linux/src_tools_linux_dump_syms_dump_syms-elfutils.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/src_tools_linux_dump_syms_dump_syms-elfutils.o `test -f 'src/common/linux/elfutils.cc' || echo '$(srcdir)/'`src/common/linux/elfutils.cc
+
+src/common/linux/src_tools_linux_dump_syms_dump_syms-elfutils.obj: src/common/linux/elfutils.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/src_tools_linux_dump_syms_dump_syms-elfutils.obj -MD -MP -MF src/common/linux/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-elfutils.Tpo -c -o src/common/linux/src_tools_linux_dump_syms_dump_syms-elfutils.obj `if test -f 'src/common/linux/elfutils.cc'; then $(CYGPATH_W) 'src/common/linux/elfutils.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/elfutils.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-elfutils.Tpo src/common/linux/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-elfutils.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/elfutils.cc' object='src/common/linux/src_tools_linux_dump_syms_dump_syms-elfutils.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/src_tools_linux_dump_syms_dump_syms-elfutils.obj `if test -f 'src/common/linux/elfutils.cc'; then $(CYGPATH_W) 'src/common/linux/elfutils.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/elfutils.cc'; fi`
+
+src/common/linux/src_tools_linux_dump_syms_dump_syms-file_id.o: src/common/linux/file_id.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/src_tools_linux_dump_syms_dump_syms-file_id.o -MD -MP -MF src/common/linux/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-file_id.Tpo -c -o src/common/linux/src_tools_linux_dump_syms_dump_syms-file_id.o `test -f 'src/common/linux/file_id.cc' || echo '$(srcdir)/'`src/common/linux/file_id.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-file_id.Tpo src/common/linux/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-file_id.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/file_id.cc' object='src/common/linux/src_tools_linux_dump_syms_dump_syms-file_id.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/src_tools_linux_dump_syms_dump_syms-file_id.o `test -f 'src/common/linux/file_id.cc' || echo '$(srcdir)/'`src/common/linux/file_id.cc
+
+src/common/linux/src_tools_linux_dump_syms_dump_syms-file_id.obj: src/common/linux/file_id.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/src_tools_linux_dump_syms_dump_syms-file_id.obj -MD -MP -MF src/common/linux/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-file_id.Tpo -c -o src/common/linux/src_tools_linux_dump_syms_dump_syms-file_id.obj `if test -f 'src/common/linux/file_id.cc'; then $(CYGPATH_W) 'src/common/linux/file_id.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/file_id.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-file_id.Tpo src/common/linux/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-file_id.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/file_id.cc' object='src/common/linux/src_tools_linux_dump_syms_dump_syms-file_id.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/src_tools_linux_dump_syms_dump_syms-file_id.obj `if test -f 'src/common/linux/file_id.cc'; then $(CYGPATH_W) 'src/common/linux/file_id.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/file_id.cc'; fi`
+
+src/common/linux/src_tools_linux_dump_syms_dump_syms-linux_libc_support.o: src/common/linux/linux_libc_support.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/src_tools_linux_dump_syms_dump_syms-linux_libc_support.o -MD -MP -MF src/common/linux/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-linux_libc_support.Tpo -c -o src/common/linux/src_tools_linux_dump_syms_dump_syms-linux_libc_support.o `test -f 'src/common/linux/linux_libc_support.cc' || echo '$(srcdir)/'`src/common/linux/linux_libc_support.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-linux_libc_support.Tpo src/common/linux/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-linux_libc_support.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/linux_libc_support.cc' object='src/common/linux/src_tools_linux_dump_syms_dump_syms-linux_libc_support.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/src_tools_linux_dump_syms_dump_syms-linux_libc_support.o `test -f 'src/common/linux/linux_libc_support.cc' || echo '$(srcdir)/'`src/common/linux/linux_libc_support.cc
+
+src/common/linux/src_tools_linux_dump_syms_dump_syms-linux_libc_support.obj: src/common/linux/linux_libc_support.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/src_tools_linux_dump_syms_dump_syms-linux_libc_support.obj -MD -MP -MF src/common/linux/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-linux_libc_support.Tpo -c -o src/common/linux/src_tools_linux_dump_syms_dump_syms-linux_libc_support.obj `if test -f 'src/common/linux/linux_libc_support.cc'; then $(CYGPATH_W) 'src/common/linux/linux_libc_support.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/linux_libc_support.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-linux_libc_support.Tpo src/common/linux/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-linux_libc_support.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/linux_libc_support.cc' object='src/common/linux/src_tools_linux_dump_syms_dump_syms-linux_libc_support.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/src_tools_linux_dump_syms_dump_syms-linux_libc_support.obj `if test -f 'src/common/linux/linux_libc_support.cc'; then $(CYGPATH_W) 'src/common/linux/linux_libc_support.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/linux_libc_support.cc'; fi`
+
+src/common/linux/src_tools_linux_dump_syms_dump_syms-memory_mapped_file.o: src/common/linux/memory_mapped_file.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/src_tools_linux_dump_syms_dump_syms-memory_mapped_file.o -MD -MP -MF src/common/linux/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-memory_mapped_file.Tpo -c -o src/common/linux/src_tools_linux_dump_syms_dump_syms-memory_mapped_file.o `test -f 'src/common/linux/memory_mapped_file.cc' || echo '$(srcdir)/'`src/common/linux/memory_mapped_file.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-memory_mapped_file.Tpo src/common/linux/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-memory_mapped_file.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/memory_mapped_file.cc' object='src/common/linux/src_tools_linux_dump_syms_dump_syms-memory_mapped_file.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/src_tools_linux_dump_syms_dump_syms-memory_mapped_file.o `test -f 'src/common/linux/memory_mapped_file.cc' || echo '$(srcdir)/'`src/common/linux/memory_mapped_file.cc
+
+src/common/linux/src_tools_linux_dump_syms_dump_syms-memory_mapped_file.obj: src/common/linux/memory_mapped_file.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/src_tools_linux_dump_syms_dump_syms-memory_mapped_file.obj -MD -MP -MF src/common/linux/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-memory_mapped_file.Tpo -c -o src/common/linux/src_tools_linux_dump_syms_dump_syms-memory_mapped_file.obj `if test -f 'src/common/linux/memory_mapped_file.cc'; then $(CYGPATH_W) 'src/common/linux/memory_mapped_file.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/memory_mapped_file.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-memory_mapped_file.Tpo src/common/linux/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-memory_mapped_file.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/memory_mapped_file.cc' object='src/common/linux/src_tools_linux_dump_syms_dump_syms-memory_mapped_file.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/src_tools_linux_dump_syms_dump_syms-memory_mapped_file.obj `if test -f 'src/common/linux/memory_mapped_file.cc'; then $(CYGPATH_W) 'src/common/linux/memory_mapped_file.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/memory_mapped_file.cc'; fi`
+
+src/common/linux/src_tools_linux_dump_syms_dump_syms-safe_readlink.o: src/common/linux/safe_readlink.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/src_tools_linux_dump_syms_dump_syms-safe_readlink.o -MD -MP -MF src/common/linux/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-safe_readlink.Tpo -c -o src/common/linux/src_tools_linux_dump_syms_dump_syms-safe_readlink.o `test -f 'src/common/linux/safe_readlink.cc' || echo '$(srcdir)/'`src/common/linux/safe_readlink.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-safe_readlink.Tpo src/common/linux/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-safe_readlink.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/safe_readlink.cc' object='src/common/linux/src_tools_linux_dump_syms_dump_syms-safe_readlink.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/src_tools_linux_dump_syms_dump_syms-safe_readlink.o `test -f 'src/common/linux/safe_readlink.cc' || echo '$(srcdir)/'`src/common/linux/safe_readlink.cc
+
+src/common/linux/src_tools_linux_dump_syms_dump_syms-safe_readlink.obj: src/common/linux/safe_readlink.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/src_tools_linux_dump_syms_dump_syms-safe_readlink.obj -MD -MP -MF src/common/linux/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-safe_readlink.Tpo -c -o src/common/linux/src_tools_linux_dump_syms_dump_syms-safe_readlink.obj `if test -f 'src/common/linux/safe_readlink.cc'; then $(CYGPATH_W) 'src/common/linux/safe_readlink.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/safe_readlink.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-safe_readlink.Tpo src/common/linux/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-safe_readlink.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/safe_readlink.cc' object='src/common/linux/src_tools_linux_dump_syms_dump_syms-safe_readlink.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/src_tools_linux_dump_syms_dump_syms-safe_readlink.obj `if test -f 'src/common/linux/safe_readlink.cc'; then $(CYGPATH_W) 'src/common/linux/safe_readlink.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/safe_readlink.cc'; fi`
+
+src/tools/linux/dump_syms/src_tools_linux_dump_syms_dump_syms-dump_syms.o: src/tools/linux/dump_syms/dump_syms.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -MT src/tools/linux/dump_syms/src_tools_linux_dump_syms_dump_syms-dump_syms.o -MD -MP -MF src/tools/linux/dump_syms/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-dump_syms.Tpo -c -o src/tools/linux/dump_syms/src_tools_linux_dump_syms_dump_syms-dump_syms.o `test -f 'src/tools/linux/dump_syms/dump_syms.cc' || echo '$(srcdir)/'`src/tools/linux/dump_syms/dump_syms.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/tools/linux/dump_syms/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-dump_syms.Tpo src/tools/linux/dump_syms/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-dump_syms.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/tools/linux/dump_syms/dump_syms.cc' object='src/tools/linux/dump_syms/src_tools_linux_dump_syms_dump_syms-dump_syms.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -c -o src/tools/linux/dump_syms/src_tools_linux_dump_syms_dump_syms-dump_syms.o `test -f 'src/tools/linux/dump_syms/dump_syms.cc' || echo '$(srcdir)/'`src/tools/linux/dump_syms/dump_syms.cc
+
+src/tools/linux/dump_syms/src_tools_linux_dump_syms_dump_syms-dump_syms.obj: src/tools/linux/dump_syms/dump_syms.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -MT src/tools/linux/dump_syms/src_tools_linux_dump_syms_dump_syms-dump_syms.obj -MD -MP -MF src/tools/linux/dump_syms/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-dump_syms.Tpo -c -o src/tools/linux/dump_syms/src_tools_linux_dump_syms_dump_syms-dump_syms.obj `if test -f 'src/tools/linux/dump_syms/dump_syms.cc'; then $(CYGPATH_W) 'src/tools/linux/dump_syms/dump_syms.cc'; else $(CYGPATH_W) '$(srcdir)/src/tools/linux/dump_syms/dump_syms.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/tools/linux/dump_syms/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-dump_syms.Tpo src/tools/linux/dump_syms/$(DEPDIR)/src_tools_linux_dump_syms_dump_syms-dump_syms.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/tools/linux/dump_syms/dump_syms.cc' object='src/tools/linux/dump_syms/src_tools_linux_dump_syms_dump_syms-dump_syms.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_linux_dump_syms_dump_syms_CXXFLAGS) $(CXXFLAGS) -c -o src/tools/linux/dump_syms/src_tools_linux_dump_syms_dump_syms-dump_syms.obj `if test -f 'src/tools/linux/dump_syms/dump_syms.cc'; then $(CYGPATH_W) 'src/tools/linux/dump_syms/dump_syms.cc'; else $(CYGPATH_W) '$(srcdir)/src/tools/linux/dump_syms/dump_syms.cc'; fi`
src/tools/linux/md2core/src_tools_linux_md2core_minidump_2_core_unittest-minidump_memory_range_unittest.o: src/tools/linux/md2core/minidump_memory_range_unittest.cc
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_tools_linux_md2core_minidump_2_core_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/tools/linux/md2core/src_tools_linux_md2core_minidump_2_core_unittest-minidump_memory_range_unittest.o -MD -MP -MF src/tools/linux/md2core/$(DEPDIR)/src_tools_linux_md2core_minidump_2_core_unittest-minidump_memory_range_unittest.Tpo -c -o src/tools/linux/md2core/src_tools_linux_md2core_minidump_2_core_unittest-minidump_memory_range_unittest.o `test -f 'src/tools/linux/md2core/minidump_memory_range_unittest.cc' || echo '$(srcdir)/'`src/tools/linux/md2core/minidump_memory_range_unittest.cc
@@ -7012,6 +7540,314 @@ src/tools/linux/md2core/src_tools_linux_md2core_minidump_2_core_unittest-minidum
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/tools/linux/md2core/minidump_memory_range_unittest.cc' object='src/tools/linux/md2core/src_tools_linux_md2core_minidump_2_core_unittest-minidump_memory_range_unittest.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_tools_linux_md2core_minidump_2_core_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/tools/linux/md2core/src_tools_linux_md2core_minidump_2_core_unittest-minidump_memory_range_unittest.obj `if test -f 'src/tools/linux/md2core/minidump_memory_range_unittest.cc'; then $(CYGPATH_W) 'src/tools/linux/md2core/minidump_memory_range_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/tools/linux/md2core/minidump_memory_range_unittest.cc'; fi`
+
+src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cfi_to_module.o: src/common/dwarf_cfi_to_module.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cfi_to_module.o -MD -MP -MF src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cfi_to_module.Tpo -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cfi_to_module.o `test -f 'src/common/dwarf_cfi_to_module.cc' || echo '$(srcdir)/'`src/common/dwarf_cfi_to_module.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cfi_to_module.Tpo src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cfi_to_module.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf_cfi_to_module.cc' object='src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cfi_to_module.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cfi_to_module.o `test -f 'src/common/dwarf_cfi_to_module.cc' || echo '$(srcdir)/'`src/common/dwarf_cfi_to_module.cc
+
+src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cfi_to_module.obj: src/common/dwarf_cfi_to_module.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cfi_to_module.obj -MD -MP -MF src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cfi_to_module.Tpo -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cfi_to_module.obj `if test -f 'src/common/dwarf_cfi_to_module.cc'; then $(CYGPATH_W) 'src/common/dwarf_cfi_to_module.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf_cfi_to_module.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cfi_to_module.Tpo src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cfi_to_module.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf_cfi_to_module.cc' object='src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cfi_to_module.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cfi_to_module.obj `if test -f 'src/common/dwarf_cfi_to_module.cc'; then $(CYGPATH_W) 'src/common/dwarf_cfi_to_module.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf_cfi_to_module.cc'; fi`
+
+src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cu_to_module.o: src/common/dwarf_cu_to_module.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cu_to_module.o -MD -MP -MF src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cu_to_module.Tpo -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cu_to_module.o `test -f 'src/common/dwarf_cu_to_module.cc' || echo '$(srcdir)/'`src/common/dwarf_cu_to_module.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cu_to_module.Tpo src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cu_to_module.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf_cu_to_module.cc' object='src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cu_to_module.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cu_to_module.o `test -f 'src/common/dwarf_cu_to_module.cc' || echo '$(srcdir)/'`src/common/dwarf_cu_to_module.cc
+
+src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cu_to_module.obj: src/common/dwarf_cu_to_module.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cu_to_module.obj -MD -MP -MF src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cu_to_module.Tpo -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cu_to_module.obj `if test -f 'src/common/dwarf_cu_to_module.cc'; then $(CYGPATH_W) 'src/common/dwarf_cu_to_module.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf_cu_to_module.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cu_to_module.Tpo src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cu_to_module.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf_cu_to_module.cc' object='src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cu_to_module.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cu_to_module.obj `if test -f 'src/common/dwarf_cu_to_module.cc'; then $(CYGPATH_W) 'src/common/dwarf_cu_to_module.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf_cu_to_module.cc'; fi`
+
+src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_line_to_module.o: src/common/dwarf_line_to_module.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_line_to_module.o -MD -MP -MF src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf_line_to_module.Tpo -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_line_to_module.o `test -f 'src/common/dwarf_line_to_module.cc' || echo '$(srcdir)/'`src/common/dwarf_line_to_module.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf_line_to_module.Tpo src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf_line_to_module.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf_line_to_module.cc' object='src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_line_to_module.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_line_to_module.o `test -f 'src/common/dwarf_line_to_module.cc' || echo '$(srcdir)/'`src/common/dwarf_line_to_module.cc
+
+src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_line_to_module.obj: src/common/dwarf_line_to_module.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_line_to_module.obj -MD -MP -MF src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf_line_to_module.Tpo -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_line_to_module.obj `if test -f 'src/common/dwarf_line_to_module.cc'; then $(CYGPATH_W) 'src/common/dwarf_line_to_module.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf_line_to_module.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf_line_to_module.Tpo src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf_line_to_module.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf_line_to_module.cc' object='src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_line_to_module.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_line_to_module.obj `if test -f 'src/common/dwarf_line_to_module.cc'; then $(CYGPATH_W) 'src/common/dwarf_line_to_module.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf_line_to_module.cc'; fi`
+
+src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_range_list_handler.o: src/common/dwarf_range_list_handler.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_range_list_handler.o -MD -MP -MF src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf_range_list_handler.Tpo -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_range_list_handler.o `test -f 'src/common/dwarf_range_list_handler.cc' || echo '$(srcdir)/'`src/common/dwarf_range_list_handler.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf_range_list_handler.Tpo src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf_range_list_handler.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf_range_list_handler.cc' object='src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_range_list_handler.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_range_list_handler.o `test -f 'src/common/dwarf_range_list_handler.cc' || echo '$(srcdir)/'`src/common/dwarf_range_list_handler.cc
+
+src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_range_list_handler.obj: src/common/dwarf_range_list_handler.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_range_list_handler.obj -MD -MP -MF src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf_range_list_handler.Tpo -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_range_list_handler.obj `if test -f 'src/common/dwarf_range_list_handler.cc'; then $(CYGPATH_W) 'src/common/dwarf_range_list_handler.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf_range_list_handler.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf_range_list_handler.Tpo src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf_range_list_handler.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf_range_list_handler.cc' object='src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_range_list_handler.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_range_list_handler.obj `if test -f 'src/common/dwarf_range_list_handler.cc'; then $(CYGPATH_W) 'src/common/dwarf_range_list_handler.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf_range_list_handler.cc'; fi`
+
+src/common/src_tools_mac_dump_syms_dump_syms_mac-language.o: src/common/language.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_tools_mac_dump_syms_dump_syms_mac-language.o -MD -MP -MF src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-language.Tpo -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-language.o `test -f 'src/common/language.cc' || echo '$(srcdir)/'`src/common/language.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-language.Tpo src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-language.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/language.cc' object='src/common/src_tools_mac_dump_syms_dump_syms_mac-language.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-language.o `test -f 'src/common/language.cc' || echo '$(srcdir)/'`src/common/language.cc
+
+src/common/src_tools_mac_dump_syms_dump_syms_mac-language.obj: src/common/language.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_tools_mac_dump_syms_dump_syms_mac-language.obj -MD -MP -MF src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-language.Tpo -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-language.obj `if test -f 'src/common/language.cc'; then $(CYGPATH_W) 'src/common/language.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/language.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-language.Tpo src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-language.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/language.cc' object='src/common/src_tools_mac_dump_syms_dump_syms_mac-language.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-language.obj `if test -f 'src/common/language.cc'; then $(CYGPATH_W) 'src/common/language.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/language.cc'; fi`
+
+src/common/src_tools_mac_dump_syms_dump_syms_mac-md5.o: src/common/md5.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_tools_mac_dump_syms_dump_syms_mac-md5.o -MD -MP -MF src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-md5.Tpo -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-md5.o `test -f 'src/common/md5.cc' || echo '$(srcdir)/'`src/common/md5.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-md5.Tpo src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-md5.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/md5.cc' object='src/common/src_tools_mac_dump_syms_dump_syms_mac-md5.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-md5.o `test -f 'src/common/md5.cc' || echo '$(srcdir)/'`src/common/md5.cc
+
+src/common/src_tools_mac_dump_syms_dump_syms_mac-md5.obj: src/common/md5.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_tools_mac_dump_syms_dump_syms_mac-md5.obj -MD -MP -MF src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-md5.Tpo -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-md5.obj `if test -f 'src/common/md5.cc'; then $(CYGPATH_W) 'src/common/md5.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/md5.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-md5.Tpo src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-md5.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/md5.cc' object='src/common/src_tools_mac_dump_syms_dump_syms_mac-md5.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-md5.obj `if test -f 'src/common/md5.cc'; then $(CYGPATH_W) 'src/common/md5.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/md5.cc'; fi`
+
+src/common/src_tools_mac_dump_syms_dump_syms_mac-module.o: src/common/module.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_tools_mac_dump_syms_dump_syms_mac-module.o -MD -MP -MF src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-module.Tpo -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-module.o `test -f 'src/common/module.cc' || echo '$(srcdir)/'`src/common/module.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-module.Tpo src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-module.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/module.cc' object='src/common/src_tools_mac_dump_syms_dump_syms_mac-module.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-module.o `test -f 'src/common/module.cc' || echo '$(srcdir)/'`src/common/module.cc
+
+src/common/src_tools_mac_dump_syms_dump_syms_mac-module.obj: src/common/module.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_tools_mac_dump_syms_dump_syms_mac-module.obj -MD -MP -MF src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-module.Tpo -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-module.obj `if test -f 'src/common/module.cc'; then $(CYGPATH_W) 'src/common/module.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/module.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-module.Tpo src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-module.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/module.cc' object='src/common/src_tools_mac_dump_syms_dump_syms_mac-module.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-module.obj `if test -f 'src/common/module.cc'; then $(CYGPATH_W) 'src/common/module.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/module.cc'; fi`
+
+src/common/src_tools_mac_dump_syms_dump_syms_mac-path_helper.o: src/common/path_helper.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_tools_mac_dump_syms_dump_syms_mac-path_helper.o -MD -MP -MF src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-path_helper.Tpo -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-path_helper.o `test -f 'src/common/path_helper.cc' || echo '$(srcdir)/'`src/common/path_helper.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-path_helper.Tpo src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-path_helper.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/path_helper.cc' object='src/common/src_tools_mac_dump_syms_dump_syms_mac-path_helper.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-path_helper.o `test -f 'src/common/path_helper.cc' || echo '$(srcdir)/'`src/common/path_helper.cc
+
+src/common/src_tools_mac_dump_syms_dump_syms_mac-path_helper.obj: src/common/path_helper.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_tools_mac_dump_syms_dump_syms_mac-path_helper.obj -MD -MP -MF src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-path_helper.Tpo -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-path_helper.obj `if test -f 'src/common/path_helper.cc'; then $(CYGPATH_W) 'src/common/path_helper.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/path_helper.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-path_helper.Tpo src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-path_helper.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/path_helper.cc' object='src/common/src_tools_mac_dump_syms_dump_syms_mac-path_helper.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-path_helper.obj `if test -f 'src/common/path_helper.cc'; then $(CYGPATH_W) 'src/common/path_helper.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/path_helper.cc'; fi`
+
+src/common/src_tools_mac_dump_syms_dump_syms_mac-stabs_reader.o: src/common/stabs_reader.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_tools_mac_dump_syms_dump_syms_mac-stabs_reader.o -MD -MP -MF src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-stabs_reader.Tpo -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-stabs_reader.o `test -f 'src/common/stabs_reader.cc' || echo '$(srcdir)/'`src/common/stabs_reader.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-stabs_reader.Tpo src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-stabs_reader.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/stabs_reader.cc' object='src/common/src_tools_mac_dump_syms_dump_syms_mac-stabs_reader.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-stabs_reader.o `test -f 'src/common/stabs_reader.cc' || echo '$(srcdir)/'`src/common/stabs_reader.cc
+
+src/common/src_tools_mac_dump_syms_dump_syms_mac-stabs_reader.obj: src/common/stabs_reader.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_tools_mac_dump_syms_dump_syms_mac-stabs_reader.obj -MD -MP -MF src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-stabs_reader.Tpo -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-stabs_reader.obj `if test -f 'src/common/stabs_reader.cc'; then $(CYGPATH_W) 'src/common/stabs_reader.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/stabs_reader.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-stabs_reader.Tpo src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-stabs_reader.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/stabs_reader.cc' object='src/common/src_tools_mac_dump_syms_dump_syms_mac-stabs_reader.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-stabs_reader.obj `if test -f 'src/common/stabs_reader.cc'; then $(CYGPATH_W) 'src/common/stabs_reader.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/stabs_reader.cc'; fi`
+
+src/common/src_tools_mac_dump_syms_dump_syms_mac-stabs_to_module.o: src/common/stabs_to_module.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_tools_mac_dump_syms_dump_syms_mac-stabs_to_module.o -MD -MP -MF src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-stabs_to_module.Tpo -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-stabs_to_module.o `test -f 'src/common/stabs_to_module.cc' || echo '$(srcdir)/'`src/common/stabs_to_module.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-stabs_to_module.Tpo src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-stabs_to_module.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/stabs_to_module.cc' object='src/common/src_tools_mac_dump_syms_dump_syms_mac-stabs_to_module.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-stabs_to_module.o `test -f 'src/common/stabs_to_module.cc' || echo '$(srcdir)/'`src/common/stabs_to_module.cc
+
+src/common/src_tools_mac_dump_syms_dump_syms_mac-stabs_to_module.obj: src/common/stabs_to_module.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_tools_mac_dump_syms_dump_syms_mac-stabs_to_module.obj -MD -MP -MF src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-stabs_to_module.Tpo -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-stabs_to_module.obj `if test -f 'src/common/stabs_to_module.cc'; then $(CYGPATH_W) 'src/common/stabs_to_module.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/stabs_to_module.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-stabs_to_module.Tpo src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-stabs_to_module.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/stabs_to_module.cc' object='src/common/src_tools_mac_dump_syms_dump_syms_mac-stabs_to_module.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-stabs_to_module.obj `if test -f 'src/common/stabs_to_module.cc'; then $(CYGPATH_W) 'src/common/stabs_to_module.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/stabs_to_module.cc'; fi`
+
+src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-bytereader.o: src/common/dwarf/bytereader.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-bytereader.o -MD -MP -MF src/common/dwarf/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-bytereader.Tpo -c -o src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-bytereader.o `test -f 'src/common/dwarf/bytereader.cc' || echo '$(srcdir)/'`src/common/dwarf/bytereader.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/dwarf/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-bytereader.Tpo src/common/dwarf/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-bytereader.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf/bytereader.cc' object='src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-bytereader.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-bytereader.o `test -f 'src/common/dwarf/bytereader.cc' || echo '$(srcdir)/'`src/common/dwarf/bytereader.cc
+
+src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-bytereader.obj: src/common/dwarf/bytereader.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-bytereader.obj -MD -MP -MF src/common/dwarf/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-bytereader.Tpo -c -o src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-bytereader.obj `if test -f 'src/common/dwarf/bytereader.cc'; then $(CYGPATH_W) 'src/common/dwarf/bytereader.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf/bytereader.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/dwarf/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-bytereader.Tpo src/common/dwarf/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-bytereader.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf/bytereader.cc' object='src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-bytereader.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-bytereader.obj `if test -f 'src/common/dwarf/bytereader.cc'; then $(CYGPATH_W) 'src/common/dwarf/bytereader.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf/bytereader.cc'; fi`
+
+src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-dwarf2diehandler.o: src/common/dwarf/dwarf2diehandler.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-dwarf2diehandler.o -MD -MP -MF src/common/dwarf/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf2diehandler.Tpo -c -o src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-dwarf2diehandler.o `test -f 'src/common/dwarf/dwarf2diehandler.cc' || echo '$(srcdir)/'`src/common/dwarf/dwarf2diehandler.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/dwarf/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf2diehandler.Tpo src/common/dwarf/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf2diehandler.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf/dwarf2diehandler.cc' object='src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-dwarf2diehandler.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-dwarf2diehandler.o `test -f 'src/common/dwarf/dwarf2diehandler.cc' || echo '$(srcdir)/'`src/common/dwarf/dwarf2diehandler.cc
+
+src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-dwarf2diehandler.obj: src/common/dwarf/dwarf2diehandler.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-dwarf2diehandler.obj -MD -MP -MF src/common/dwarf/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf2diehandler.Tpo -c -o src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-dwarf2diehandler.obj `if test -f 'src/common/dwarf/dwarf2diehandler.cc'; then $(CYGPATH_W) 'src/common/dwarf/dwarf2diehandler.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf/dwarf2diehandler.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/dwarf/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf2diehandler.Tpo src/common/dwarf/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf2diehandler.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf/dwarf2diehandler.cc' object='src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-dwarf2diehandler.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-dwarf2diehandler.obj `if test -f 'src/common/dwarf/dwarf2diehandler.cc'; then $(CYGPATH_W) 'src/common/dwarf/dwarf2diehandler.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf/dwarf2diehandler.cc'; fi`
+
+src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-dwarf2reader.o: src/common/dwarf/dwarf2reader.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-dwarf2reader.o -MD -MP -MF src/common/dwarf/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf2reader.Tpo -c -o src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-dwarf2reader.o `test -f 'src/common/dwarf/dwarf2reader.cc' || echo '$(srcdir)/'`src/common/dwarf/dwarf2reader.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/dwarf/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf2reader.Tpo src/common/dwarf/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf2reader.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf/dwarf2reader.cc' object='src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-dwarf2reader.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-dwarf2reader.o `test -f 'src/common/dwarf/dwarf2reader.cc' || echo '$(srcdir)/'`src/common/dwarf/dwarf2reader.cc
+
+src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-dwarf2reader.obj: src/common/dwarf/dwarf2reader.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-dwarf2reader.obj -MD -MP -MF src/common/dwarf/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf2reader.Tpo -c -o src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-dwarf2reader.obj `if test -f 'src/common/dwarf/dwarf2reader.cc'; then $(CYGPATH_W) 'src/common/dwarf/dwarf2reader.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf/dwarf2reader.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/dwarf/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf2reader.Tpo src/common/dwarf/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf2reader.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf/dwarf2reader.cc' object='src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-dwarf2reader.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-dwarf2reader.obj `if test -f 'src/common/dwarf/dwarf2reader.cc'; then $(CYGPATH_W) 'src/common/dwarf/dwarf2reader.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf/dwarf2reader.cc'; fi`
+
+src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-elf_reader.o: src/common/dwarf/elf_reader.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-elf_reader.o -MD -MP -MF src/common/dwarf/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-elf_reader.Tpo -c -o src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-elf_reader.o `test -f 'src/common/dwarf/elf_reader.cc' || echo '$(srcdir)/'`src/common/dwarf/elf_reader.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/dwarf/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-elf_reader.Tpo src/common/dwarf/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-elf_reader.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf/elf_reader.cc' object='src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-elf_reader.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-elf_reader.o `test -f 'src/common/dwarf/elf_reader.cc' || echo '$(srcdir)/'`src/common/dwarf/elf_reader.cc
+
+src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-elf_reader.obj: src/common/dwarf/elf_reader.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-elf_reader.obj -MD -MP -MF src/common/dwarf/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-elf_reader.Tpo -c -o src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-elf_reader.obj `if test -f 'src/common/dwarf/elf_reader.cc'; then $(CYGPATH_W) 'src/common/dwarf/elf_reader.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf/elf_reader.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/dwarf/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-elf_reader.Tpo src/common/dwarf/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-elf_reader.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf/elf_reader.cc' object='src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-elf_reader.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-elf_reader.obj `if test -f 'src/common/dwarf/elf_reader.cc'; then $(CYGPATH_W) 'src/common/dwarf/elf_reader.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf/elf_reader.cc'; fi`
+
+src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-arch_utilities.o: src/common/mac/arch_utilities.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-arch_utilities.o -MD -MP -MF src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-arch_utilities.Tpo -c -o src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-arch_utilities.o `test -f 'src/common/mac/arch_utilities.cc' || echo '$(srcdir)/'`src/common/mac/arch_utilities.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-arch_utilities.Tpo src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-arch_utilities.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/mac/arch_utilities.cc' object='src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-arch_utilities.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-arch_utilities.o `test -f 'src/common/mac/arch_utilities.cc' || echo '$(srcdir)/'`src/common/mac/arch_utilities.cc
+
+src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-arch_utilities.obj: src/common/mac/arch_utilities.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-arch_utilities.obj -MD -MP -MF src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-arch_utilities.Tpo -c -o src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-arch_utilities.obj `if test -f 'src/common/mac/arch_utilities.cc'; then $(CYGPATH_W) 'src/common/mac/arch_utilities.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/mac/arch_utilities.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-arch_utilities.Tpo src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-arch_utilities.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/mac/arch_utilities.cc' object='src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-arch_utilities.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-arch_utilities.obj `if test -f 'src/common/mac/arch_utilities.cc'; then $(CYGPATH_W) 'src/common/mac/arch_utilities.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/mac/arch_utilities.cc'; fi`
+
+src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-dump_syms.o: src/common/mac/dump_syms.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-dump_syms.o -MD -MP -MF src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dump_syms.Tpo -c -o src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-dump_syms.o `test -f 'src/common/mac/dump_syms.cc' || echo '$(srcdir)/'`src/common/mac/dump_syms.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dump_syms.Tpo src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dump_syms.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/mac/dump_syms.cc' object='src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-dump_syms.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-dump_syms.o `test -f 'src/common/mac/dump_syms.cc' || echo '$(srcdir)/'`src/common/mac/dump_syms.cc
+
+src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-dump_syms.obj: src/common/mac/dump_syms.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-dump_syms.obj -MD -MP -MF src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dump_syms.Tpo -c -o src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-dump_syms.obj `if test -f 'src/common/mac/dump_syms.cc'; then $(CYGPATH_W) 'src/common/mac/dump_syms.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/mac/dump_syms.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dump_syms.Tpo src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dump_syms.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/mac/dump_syms.cc' object='src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-dump_syms.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-dump_syms.obj `if test -f 'src/common/mac/dump_syms.cc'; then $(CYGPATH_W) 'src/common/mac/dump_syms.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/mac/dump_syms.cc'; fi`
+
+src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-file_id.o: src/common/mac/file_id.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-file_id.o -MD -MP -MF src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-file_id.Tpo -c -o src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-file_id.o `test -f 'src/common/mac/file_id.cc' || echo '$(srcdir)/'`src/common/mac/file_id.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-file_id.Tpo src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-file_id.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/mac/file_id.cc' object='src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-file_id.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-file_id.o `test -f 'src/common/mac/file_id.cc' || echo '$(srcdir)/'`src/common/mac/file_id.cc
+
+src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-file_id.obj: src/common/mac/file_id.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-file_id.obj -MD -MP -MF src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-file_id.Tpo -c -o src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-file_id.obj `if test -f 'src/common/mac/file_id.cc'; then $(CYGPATH_W) 'src/common/mac/file_id.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/mac/file_id.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-file_id.Tpo src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-file_id.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/mac/file_id.cc' object='src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-file_id.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-file_id.obj `if test -f 'src/common/mac/file_id.cc'; then $(CYGPATH_W) 'src/common/mac/file_id.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/mac/file_id.cc'; fi`
+
+src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_id.o: src/common/mac/macho_id.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_id.o -MD -MP -MF src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-macho_id.Tpo -c -o src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_id.o `test -f 'src/common/mac/macho_id.cc' || echo '$(srcdir)/'`src/common/mac/macho_id.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-macho_id.Tpo src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-macho_id.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/mac/macho_id.cc' object='src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_id.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_id.o `test -f 'src/common/mac/macho_id.cc' || echo '$(srcdir)/'`src/common/mac/macho_id.cc
+
+src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_id.obj: src/common/mac/macho_id.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_id.obj -MD -MP -MF src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-macho_id.Tpo -c -o src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_id.obj `if test -f 'src/common/mac/macho_id.cc'; then $(CYGPATH_W) 'src/common/mac/macho_id.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/mac/macho_id.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-macho_id.Tpo src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-macho_id.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/mac/macho_id.cc' object='src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_id.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_id.obj `if test -f 'src/common/mac/macho_id.cc'; then $(CYGPATH_W) 'src/common/mac/macho_id.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/mac/macho_id.cc'; fi`
+
+src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_reader.o: src/common/mac/macho_reader.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_reader.o -MD -MP -MF src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-macho_reader.Tpo -c -o src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_reader.o `test -f 'src/common/mac/macho_reader.cc' || echo '$(srcdir)/'`src/common/mac/macho_reader.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-macho_reader.Tpo src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-macho_reader.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/mac/macho_reader.cc' object='src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_reader.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_reader.o `test -f 'src/common/mac/macho_reader.cc' || echo '$(srcdir)/'`src/common/mac/macho_reader.cc
+
+src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_reader.obj: src/common/mac/macho_reader.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_reader.obj -MD -MP -MF src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-macho_reader.Tpo -c -o src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_reader.obj `if test -f 'src/common/mac/macho_reader.cc'; then $(CYGPATH_W) 'src/common/mac/macho_reader.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/mac/macho_reader.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-macho_reader.Tpo src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-macho_reader.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/mac/macho_reader.cc' object='src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_reader.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_reader.obj `if test -f 'src/common/mac/macho_reader.cc'; then $(CYGPATH_W) 'src/common/mac/macho_reader.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/mac/macho_reader.cc'; fi`
+
+src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_utilities.o: src/common/mac/macho_utilities.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_utilities.o -MD -MP -MF src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-macho_utilities.Tpo -c -o src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_utilities.o `test -f 'src/common/mac/macho_utilities.cc' || echo '$(srcdir)/'`src/common/mac/macho_utilities.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-macho_utilities.Tpo src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-macho_utilities.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/mac/macho_utilities.cc' object='src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_utilities.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_utilities.o `test -f 'src/common/mac/macho_utilities.cc' || echo '$(srcdir)/'`src/common/mac/macho_utilities.cc
+
+src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_utilities.obj: src/common/mac/macho_utilities.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_utilities.obj -MD -MP -MF src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-macho_utilities.Tpo -c -o src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_utilities.obj `if test -f 'src/common/mac/macho_utilities.cc'; then $(CYGPATH_W) 'src/common/mac/macho_utilities.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/mac/macho_utilities.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-macho_utilities.Tpo src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-macho_utilities.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/mac/macho_utilities.cc' object='src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_utilities.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_utilities.obj `if test -f 'src/common/mac/macho_utilities.cc'; then $(CYGPATH_W) 'src/common/mac/macho_utilities.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/mac/macho_utilities.cc'; fi`
+
+src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_walker.o: src/common/mac/macho_walker.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_walker.o -MD -MP -MF src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-macho_walker.Tpo -c -o src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_walker.o `test -f 'src/common/mac/macho_walker.cc' || echo '$(srcdir)/'`src/common/mac/macho_walker.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-macho_walker.Tpo src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-macho_walker.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/mac/macho_walker.cc' object='src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_walker.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_walker.o `test -f 'src/common/mac/macho_walker.cc' || echo '$(srcdir)/'`src/common/mac/macho_walker.cc
+
+src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_walker.obj: src/common/mac/macho_walker.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_walker.obj -MD -MP -MF src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-macho_walker.Tpo -c -o src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_walker.obj `if test -f 'src/common/mac/macho_walker.cc'; then $(CYGPATH_W) 'src/common/mac/macho_walker.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/mac/macho_walker.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-macho_walker.Tpo src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-macho_walker.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/mac/macho_walker.cc' object='src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_walker.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_walker.obj `if test -f 'src/common/mac/macho_walker.cc'; then $(CYGPATH_W) 'src/common/mac/macho_walker.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/mac/macho_walker.cc'; fi`
+
+src/tools/mac/dump_syms/src_tools_mac_dump_syms_dump_syms_mac-dump_syms_tool.o: src/tools/mac/dump_syms/dump_syms_tool.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/tools/mac/dump_syms/src_tools_mac_dump_syms_dump_syms_mac-dump_syms_tool.o -MD -MP -MF src/tools/mac/dump_syms/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dump_syms_tool.Tpo -c -o src/tools/mac/dump_syms/src_tools_mac_dump_syms_dump_syms_mac-dump_syms_tool.o `test -f 'src/tools/mac/dump_syms/dump_syms_tool.cc' || echo '$(srcdir)/'`src/tools/mac/dump_syms/dump_syms_tool.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/tools/mac/dump_syms/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dump_syms_tool.Tpo src/tools/mac/dump_syms/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dump_syms_tool.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/tools/mac/dump_syms/dump_syms_tool.cc' object='src/tools/mac/dump_syms/src_tools_mac_dump_syms_dump_syms_mac-dump_syms_tool.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/tools/mac/dump_syms/src_tools_mac_dump_syms_dump_syms_mac-dump_syms_tool.o `test -f 'src/tools/mac/dump_syms/dump_syms_tool.cc' || echo '$(srcdir)/'`src/tools/mac/dump_syms/dump_syms_tool.cc
+
+src/tools/mac/dump_syms/src_tools_mac_dump_syms_dump_syms_mac-dump_syms_tool.obj: src/tools/mac/dump_syms/dump_syms_tool.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/tools/mac/dump_syms/src_tools_mac_dump_syms_dump_syms_mac-dump_syms_tool.obj -MD -MP -MF src/tools/mac/dump_syms/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dump_syms_tool.Tpo -c -o src/tools/mac/dump_syms/src_tools_mac_dump_syms_dump_syms_mac-dump_syms_tool.obj `if test -f 'src/tools/mac/dump_syms/dump_syms_tool.cc'; then $(CYGPATH_W) 'src/tools/mac/dump_syms/dump_syms_tool.cc'; else $(CYGPATH_W) '$(srcdir)/src/tools/mac/dump_syms/dump_syms_tool.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/tools/mac/dump_syms/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dump_syms_tool.Tpo src/tools/mac/dump_syms/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dump_syms_tool.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/tools/mac/dump_syms/dump_syms_tool.cc' object='src/tools/mac/dump_syms/src_tools_mac_dump_syms_dump_syms_mac-dump_syms_tool.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/tools/mac/dump_syms/src_tools_mac_dump_syms_dump_syms_mac-dump_syms_tool.obj `if test -f 'src/tools/mac/dump_syms/dump_syms_tool.cc'; then $(CYGPATH_W) 'src/tools/mac/dump_syms/dump_syms_tool.cc'; else $(CYGPATH_W) '$(srcdir)/src/tools/mac/dump_syms/dump_syms_tool.cc'; fi`
install-dist_docDATA: $(dist_doc_DATA)
@$(NORMAL_INSTALL)
@list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \
@@ -7117,6 +7953,27 @@ uninstall-includeclcHEADERS:
@list='$(includeclc_HEADERS)'; test -n "$(includeclcdir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
dir='$(DESTDIR)$(includeclcdir)'; $(am__uninstall_files_from_dir)
+install-includecldwcHEADERS: $(includecldwc_HEADERS)
+ @$(NORMAL_INSTALL)
+ @list='$(includecldwc_HEADERS)'; test -n "$(includecldwcdir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(includecldwcdir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(includecldwcdir)" || exit 1; \
+ fi; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includecldwcdir)'"; \
+ $(INSTALL_HEADER) $$files "$(DESTDIR)$(includecldwcdir)" || exit $$?; \
+ done
+
+uninstall-includecldwcHEADERS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(includecldwc_HEADERS)'; test -n "$(includecldwcdir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+ dir='$(DESTDIR)$(includecldwcdir)'; $(am__uninstall_files_from_dir)
install-includeclhHEADERS: $(includeclh_HEADERS)
@$(NORMAL_INSTALL)
@list='$(includeclh_HEADERS)'; test -n "$(includeclhdir)" || list=; \
@@ -7312,7 +8169,7 @@ $(TEST_SUITE_LOG): $(TEST_LOGS)
if test -n "$$am__remaking_logs"; then \
echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \
"recursion detected" >&2; \
- else \
+ elif test -n "$$redo_logs"; then \
am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \
fi; \
if $(am__make_dryrun); then :; else \
@@ -7412,7 +8269,7 @@ check-TESTS:
log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \
$(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \
exit $$?;
-recheck: all $(check_PROGRAMS) $(check_SCRIPTS)
+recheck: all $(check_LIBRARIES) $(check_PROGRAMS) $(check_SCRIPTS)
@test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
@set +e; $(am__set_TESTS_bases); \
bases=`for i in $$bases; do echo $$i; done \
@@ -7437,13 +8294,6 @@ src/processor/address_map_unittest.log: src/processor/address_map_unittest$(EXEE
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
-src/processor/binarystream_unittest.log: src/processor/binarystream_unittest$(EXEEXT)
- @p='src/processor/binarystream_unittest$(EXEEXT)'; \
- b='src/processor/binarystream_unittest'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
src/processor/basic_source_line_resolver_unittest.log: src/processor/basic_source_line_resolver_unittest$(EXEEXT)
@p='src/processor/basic_source_line_resolver_unittest$(EXEEXT)'; \
b='src/processor/basic_source_line_resolver_unittest'; \
@@ -7556,6 +8406,27 @@ src/processor/postfix_evaluator_unittest.log: src/processor/postfix_evaluator_un
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
+src/processor/proc_maps_linux_unittest.log: src/processor/proc_maps_linux_unittest$(EXEEXT)
+ @p='src/processor/proc_maps_linux_unittest$(EXEEXT)'; \
+ b='src/processor/proc_maps_linux_unittest'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+src/processor/range_map_truncate_lower_unittest.log: src/processor/range_map_truncate_lower_unittest$(EXEEXT)
+ @p='src/processor/range_map_truncate_lower_unittest$(EXEEXT)'; \
+ b='src/processor/range_map_truncate_lower_unittest'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+src/processor/range_map_truncate_upper_unittest.log: src/processor/range_map_truncate_upper_unittest$(EXEEXT)
+ @p='src/processor/range_map_truncate_upper_unittest$(EXEEXT)'; \
+ b='src/processor/range_map_truncate_upper_unittest'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
src/processor/range_map_unittest.log: src/processor/range_map_unittest$(EXEEXT)
@p='src/processor/range_map_unittest$(EXEEXT)'; \
b='src/processor/range_map_unittest'; \
@@ -7598,6 +8469,13 @@ src/processor/stackwalker_mips_unittest.log: src/processor/stackwalker_mips_unit
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
+src/processor/stackwalker_mips64_unittest.log: src/processor/stackwalker_mips64_unittest$(EXEEXT)
+ @p='src/processor/stackwalker_mips64_unittest$(EXEEXT)'; \
+ b='src/processor/stackwalker_mips64_unittest'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
src/processor/stackwalker_x86_unittest.log: src/processor/stackwalker_x86_unittest$(EXEEXT)
@p='src/processor/stackwalker_x86_unittest$(EXEEXT)'; \
b='src/processor/stackwalker_x86_unittest'; \
@@ -7619,6 +8497,13 @@ src/client/linux/linux_client_unittest.log: src/client/linux/linux_client_unitte
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
+src/common/linux/google_crashdump_uploader_test.log: src/common/linux/google_crashdump_uploader_test$(EXEEXT)
+ @p='src/common/linux/google_crashdump_uploader_test$(EXEEXT)'; \
+ b='src/common/linux/google_crashdump_uploader_test'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
src/common/dumper_unittest.log: src/common/dumper_unittest$(EXEEXT)
@p='src/common/dumper_unittest$(EXEEXT)'; \
b='src/common/dumper_unittest'; \
@@ -7633,6 +8518,13 @@ src/tools/linux/md2core/minidump_2_core_unittest.log: src/tools/linux/md2core/mi
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
+src/common/mac/macho_reader_unittest.log: src/common/mac/macho_reader_unittest$(EXEEXT)
+ @p='src/common/mac/macho_reader_unittest$(EXEEXT)'; \
+ b='src/common/mac/macho_reader_unittest'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
src/processor/stackwalker_selftest.log: src/processor/stackwalker_selftest$(EXEEXT)
@p='src/processor/stackwalker_selftest$(EXEEXT)'; \
b='src/processor/stackwalker_selftest'; \
@@ -7730,7 +8622,7 @@ distdir: $(DISTFILES)
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r "$(distdir)"
dist-gzip: distdir
- tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz
$(am__post_remove_distdir)
dist-bzip2: distdir
@@ -7746,17 +8638,17 @@ dist-xz: distdir
$(am__post_remove_distdir)
dist-tarZ: distdir
- @echo WARNING: "Support for shar distribution archives is" \
- "deprecated." >&2
+ @echo WARNING: "Support for distribution archives compressed with" \
+ "legacy program 'compress' is deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__post_remove_distdir)
dist-shar: distdir
- @echo WARNING: "Support for distribution archives compressed with" \
- "legacy program 'compress' is deprecated." >&2
+ @echo WARNING: "Support for shar distribution archives is" \
+ "deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
- shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+ shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz
$(am__post_remove_distdir)
dist-zip: distdir
@@ -7774,7 +8666,7 @@ dist dist-all:
distcheck: dist
case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \
- GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
+ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lz*) \
@@ -7784,23 +8676,23 @@ distcheck: dist
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
- GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
+ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
esac
chmod -R a-w $(distdir)
chmod u+w $(distdir)
- mkdir $(distdir)/_build $(distdir)/_inst
+ mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
chmod a-w $(distdir)
test -d $(distdir)/_build || exit 0; \
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& am__cwd=`pwd` \
- && $(am__cd) $(distdir)/_build \
- && ../configure \
+ && $(am__cd) $(distdir)/_build/sub \
+ && ../../configure \
$(AM_DISTCHECK_CONFIGURE_FLAGS) \
$(DISTCHECK_CONFIGURE_FLAGS) \
- --srcdir=.. --prefix="$$dc_install_base" \
+ --srcdir=../.. --prefix="$$dc_install_base" \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
@@ -7854,13 +8746,14 @@ distcleancheck: distclean
$(distcleancheck_listfiles) ; \
exit 1; } >&2
check-am: all-am
- $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(check_SCRIPTS)
+ $(MAKE) $(AM_MAKEFLAGS) $(check_LIBRARIES) $(check_PROGRAMS) \
+ $(check_SCRIPTS)
$(MAKE) $(AM_MAKEFLAGS) check-TESTS
check: check-am
all-am: Makefile $(LIBRARIES) $(PROGRAMS) $(SCRIPTS) $(DATA) \
$(HEADERS)
installdirs:
- for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(docdir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(includecdir)" "$(DESTDIR)$(includecldir)" "$(DESTDIR)$(includeclcdir)" "$(DESTDIR)$(includeclhdir)" "$(DESTDIR)$(includeclmdir)" "$(DESTDIR)$(includegbcdir)" "$(DESTDIR)$(includelssdir)" "$(DESTDIR)$(includepdir)"; do \
+ for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(docdir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(includecdir)" "$(DESTDIR)$(includecldir)" "$(DESTDIR)$(includeclcdir)" "$(DESTDIR)$(includecldwcdir)" "$(DESTDIR)$(includeclhdir)" "$(DESTDIR)$(includeclmdir)" "$(DESTDIR)$(includegbcdir)" "$(DESTDIR)$(includelssdir)" "$(DESTDIR)$(includepdir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
@@ -7888,6 +8781,7 @@ mostlyclean-generic:
-test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
@@ -7910,22 +8804,23 @@ distclean-generic:
-rm -f src/client/linux/minidump_writer/$(am__dirstamp)
-rm -f src/common/$(DEPDIR)/$(am__dirstamp)
-rm -f src/common/$(am__dirstamp)
- -rm -f src/common/android/$(DEPDIR)/$(am__dirstamp)
- -rm -f src/common/android/$(am__dirstamp)
-rm -f src/common/dwarf/$(DEPDIR)/$(am__dirstamp)
-rm -f src/common/dwarf/$(am__dirstamp)
-rm -f src/common/linux/$(DEPDIR)/$(am__dirstamp)
-rm -f src/common/linux/$(am__dirstamp)
-rm -f src/common/linux/tests/$(DEPDIR)/$(am__dirstamp)
-rm -f src/common/linux/tests/$(am__dirstamp)
+ -rm -f src/common/mac/$(DEPDIR)/$(am__dirstamp)
+ -rm -f src/common/mac/$(am__dirstamp)
-rm -f src/common/tests/$(DEPDIR)/$(am__dirstamp)
-rm -f src/common/tests/$(am__dirstamp)
-rm -f src/processor/$(DEPDIR)/$(am__dirstamp)
-rm -f src/processor/$(am__dirstamp)
- -rm -f src/testing/gtest/src/$(DEPDIR)/$(am__dirstamp)
- -rm -f src/testing/gtest/src/$(am__dirstamp)
- -rm -f src/testing/src/$(DEPDIR)/$(am__dirstamp)
- -rm -f src/testing/src/$(am__dirstamp)
+ -rm -f src/testing/$(am__dirstamp)
+ -rm -f src/testing/googlemock/src/$(DEPDIR)/$(am__dirstamp)
+ -rm -f src/testing/googlemock/src/$(am__dirstamp)
+ -rm -f src/testing/googletest/src/$(DEPDIR)/$(am__dirstamp)
+ -rm -f src/testing/googletest/src/$(am__dirstamp)
-rm -f src/third_party/libdisasm/$(DEPDIR)/$(am__dirstamp)
-rm -f src/third_party/libdisasm/$(am__dirstamp)
-rm -f src/tools/linux/core2md/$(DEPDIR)/$(am__dirstamp)
@@ -7936,19 +8831,21 @@ distclean-generic:
-rm -f src/tools/linux/md2core/$(am__dirstamp)
-rm -f src/tools/linux/symupload/$(DEPDIR)/$(am__dirstamp)
-rm -f src/tools/linux/symupload/$(am__dirstamp)
+ -rm -f src/tools/mac/dump_syms/$(DEPDIR)/$(am__dirstamp)
+ -rm -f src/tools/mac/dump_syms/$(am__dirstamp)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
-clean-am: clean-binPROGRAMS clean-checkPROGRAMS clean-generic \
- clean-libLIBRARIES clean-noinstLIBRARIES clean-noinstPROGRAMS \
- mostlyclean-am
+clean-am: clean-binPROGRAMS clean-checkLIBRARIES clean-checkPROGRAMS \
+ clean-generic clean-libLIBRARIES clean-noinstLIBRARIES \
+ clean-noinstPROGRAMS mostlyclean-am
distclean: distclean-am
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
- -rm -rf src/client/$(DEPDIR) src/client/linux/crash_generation/$(DEPDIR) src/client/linux/dump_writer_common/$(DEPDIR) src/client/linux/handler/$(DEPDIR) src/client/linux/log/$(DEPDIR) src/client/linux/microdump_writer/$(DEPDIR) src/client/linux/minidump_writer/$(DEPDIR) src/common/$(DEPDIR) src/common/android/$(DEPDIR) src/common/dwarf/$(DEPDIR) src/common/linux/$(DEPDIR) src/common/linux/tests/$(DEPDIR) src/common/tests/$(DEPDIR) src/processor/$(DEPDIR) src/testing/gtest/src/$(DEPDIR) src/testing/src/$(DEPDIR) src/third_party/libdisasm/$(DEPDIR) src/tools/linux/core2md/$(DEPDIR) src/tools/linux/dump_syms/$(DEPDIR) src/tools/linux/md2core/$(DEPDIR) src/tools/linux/symupload/$(DEPDIR)
+ -rm -rf src/client/$(DEPDIR) src/client/linux/crash_generation/$(DEPDIR) src/client/linux/dump_writer_common/$(DEPDIR) src/client/linux/handler/$(DEPDIR) src/client/linux/log/$(DEPDIR) src/client/linux/microdump_writer/$(DEPDIR) src/client/linux/minidump_writer/$(DEPDIR) src/common/$(DEPDIR) src/common/dwarf/$(DEPDIR) src/common/linux/$(DEPDIR) src/common/linux/tests/$(DEPDIR) src/common/mac/$(DEPDIR) src/common/tests/$(DEPDIR) src/processor/$(DEPDIR) src/testing/googlemock/src/$(DEPDIR) src/testing/googletest/src/$(DEPDIR) src/third_party/libdisasm/$(DEPDIR) src/tools/linux/core2md/$(DEPDIR) src/tools/linux/dump_syms/$(DEPDIR) src/tools/linux/md2core/$(DEPDIR) src/tools/linux/symupload/$(DEPDIR) src/tools/mac/dump_syms/$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-hdr distclean-tags
@@ -7967,9 +8864,10 @@ info-am:
install-data-am: install-dist_docDATA install-includecHEADERS \
install-includeclHEADERS install-includeclcHEADERS \
- install-includeclhHEADERS install-includeclmHEADERS \
- install-includegbcHEADERS install-includelssHEADERS \
- install-includepHEADERS install-pkgconfigDATA
+ install-includecldwcHEADERS install-includeclhHEADERS \
+ install-includeclmHEADERS install-includegbcHEADERS \
+ install-includelssHEADERS install-includepHEADERS \
+ install-pkgconfigDATA
install-dvi: install-dvi-am
@@ -8000,13 +8898,14 @@ installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf $(top_srcdir)/autom4te.cache
- -rm -rf src/client/$(DEPDIR) src/client/linux/crash_generation/$(DEPDIR) src/client/linux/dump_writer_common/$(DEPDIR) src/client/linux/handler/$(DEPDIR) src/client/linux/log/$(DEPDIR) src/client/linux/microdump_writer/$(DEPDIR) src/client/linux/minidump_writer/$(DEPDIR) src/common/$(DEPDIR) src/common/android/$(DEPDIR) src/common/dwarf/$(DEPDIR) src/common/linux/$(DEPDIR) src/common/linux/tests/$(DEPDIR) src/common/tests/$(DEPDIR) src/processor/$(DEPDIR) src/testing/gtest/src/$(DEPDIR) src/testing/src/$(DEPDIR) src/third_party/libdisasm/$(DEPDIR) src/tools/linux/core2md/$(DEPDIR) src/tools/linux/dump_syms/$(DEPDIR) src/tools/linux/md2core/$(DEPDIR) src/tools/linux/symupload/$(DEPDIR)
+ -rm -rf src/client/$(DEPDIR) src/client/linux/crash_generation/$(DEPDIR) src/client/linux/dump_writer_common/$(DEPDIR) src/client/linux/handler/$(DEPDIR) src/client/linux/log/$(DEPDIR) src/client/linux/microdump_writer/$(DEPDIR) src/client/linux/minidump_writer/$(DEPDIR) src/common/$(DEPDIR) src/common/dwarf/$(DEPDIR) src/common/linux/$(DEPDIR) src/common/linux/tests/$(DEPDIR) src/common/mac/$(DEPDIR) src/common/tests/$(DEPDIR) src/processor/$(DEPDIR) src/testing/googlemock/src/$(DEPDIR) src/testing/googletest/src/$(DEPDIR) src/third_party/libdisasm/$(DEPDIR) src/tools/linux/core2md/$(DEPDIR) src/tools/linux/dump_syms/$(DEPDIR) src/tools/linux/md2core/$(DEPDIR) src/tools/linux/symupload/$(DEPDIR) src/tools/mac/dump_syms/$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
-mostlyclean-am: mostlyclean-compile mostlyclean-generic
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-local
pdf: pdf-am
@@ -8018,18 +8917,19 @@ ps-am:
uninstall-am: uninstall-binPROGRAMS uninstall-dist_docDATA \
uninstall-includecHEADERS uninstall-includeclHEADERS \
- uninstall-includeclcHEADERS uninstall-includeclhHEADERS \
- uninstall-includeclmHEADERS uninstall-includegbcHEADERS \
- uninstall-includelssHEADERS uninstall-includepHEADERS \
- uninstall-libLIBRARIES uninstall-pkgconfigDATA
+ uninstall-includeclcHEADERS uninstall-includecldwcHEADERS \
+ uninstall-includeclhHEADERS uninstall-includeclmHEADERS \
+ uninstall-includegbcHEADERS uninstall-includelssHEADERS \
+ uninstall-includepHEADERS uninstall-libLIBRARIES \
+ uninstall-pkgconfigDATA
.MAKE: check-am install-am install-strip
.PHONY: CTAGS GTAGS TAGS all all-am am--refresh check check-TESTS \
- check-am clean clean-binPROGRAMS clean-checkPROGRAMS \
- clean-cscope clean-generic clean-libLIBRARIES \
- clean-noinstLIBRARIES clean-noinstPROGRAMS cscope \
- cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \
+ check-am clean clean-binPROGRAMS clean-checkLIBRARIES \
+ clean-checkPROGRAMS clean-cscope clean-generic \
+ clean-libLIBRARIES clean-noinstLIBRARIES clean-noinstPROGRAMS \
+ cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \
dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \
distcheck distclean distclean-compile distclean-generic \
distclean-hdr distclean-tags distcleancheck distdir \
@@ -8039,22 +8939,28 @@ uninstall-am: uninstall-binPROGRAMS uninstall-dist_docDATA \
install-dvi-am install-exec install-exec-am install-html \
install-html-am install-includecHEADERS \
install-includeclHEADERS install-includeclcHEADERS \
- install-includeclhHEADERS install-includeclmHEADERS \
- install-includegbcHEADERS install-includelssHEADERS \
- install-includepHEADERS install-info install-info-am \
- install-libLIBRARIES install-man install-pdf install-pdf-am \
- install-pkgconfigDATA install-ps install-ps-am install-strip \
- installcheck installcheck-am installdirs maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-compile \
- mostlyclean-generic pdf pdf-am ps ps-am recheck tags tags-am \
- uninstall uninstall-am uninstall-binPROGRAMS \
- uninstall-dist_docDATA uninstall-includecHEADERS \
- uninstall-includeclHEADERS uninstall-includeclcHEADERS \
+ install-includecldwcHEADERS install-includeclhHEADERS \
+ install-includeclmHEADERS install-includegbcHEADERS \
+ install-includelssHEADERS install-includepHEADERS install-info \
+ install-info-am install-libLIBRARIES install-man install-pdf \
+ install-pdf-am install-pkgconfigDATA install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-compile mostlyclean-generic mostlyclean-local pdf \
+ pdf-am ps ps-am recheck tags tags-am uninstall uninstall-am \
+ uninstall-binPROGRAMS uninstall-dist_docDATA \
+ uninstall-includecHEADERS uninstall-includeclHEADERS \
+ uninstall-includeclcHEADERS uninstall-includecldwcHEADERS \
uninstall-includeclhHEADERS uninstall-includeclmHEADERS \
uninstall-includegbcHEADERS uninstall-includelssHEADERS \
uninstall-includepHEADERS uninstall-libLIBRARIES \
uninstall-pkgconfigDATA
+.PRECIOUS: Makefile
+
+
+mostlyclean-local:
+ -find src -name '*.dwo' -exec rm -f {} +
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/OWNERS b/OWNERS
index 40a8287e..0083bf99 100644
--- a/OWNERS
+++ b/OWNERS
@@ -1,3 +1,4 @@
set noparent
benchan@google.com
vapier@google.com
+siyuanh@google.com
diff --git a/README b/README
deleted file mode 100644
index 3bccd4be..00000000
--- a/README
+++ /dev/null
@@ -1,43 +0,0 @@
-Breakpad is a set of client and server components which implement a
-crash-reporting system.
-
-
------
-Getting started in 32-bit mode (from trunk)
-Configure: CXXFLAGS=-m32 CFLAGS=-m32 CPPFLAGS=-m32 ./configure
- Build: make
- Test: make check
- Install: make install
-
-If you need to reconfigure your build be sure to run "make distclean" first.
-
-
------
-To request change review:
-0. Get access to a read-write copy of source.
- Owners at http://code.google.com/p/google-breakpad/ are able to grant
- this access.
-
-1. Check out a read-write copy of source using instructions at
- http://code.google.com/p/google-breakpad/source/checkout
-
-2. Make changes. Build and test your changes.
- For core code like processor use methods above.
- For linux/mac/windows, there are test targets in each project file.
-
-3. Download http://codereview.appspot.com/static/upload.py
-
-4. Run upload.py from the 'src' directory:
- upload.py --server=breakpad.appspot.com
-
- You will be prompted for credential and a description.
-
-5. At http://breakpad.appspot.com you'll find your issue listed; click on it,
- and select Publish+Mail, and enter in the code reviewer and CC
- google-breakpad-dev@googlegroups.com
-
-6. When applying code review feedback, specify the '-i' option when running
- upload.py again and pass the issue number so it updates the existing issue,
- rather than creating a new one.
- Be sure to rerun upload.py from the same directory as you did for previous
- uploads to allow for proper diff calculations.
diff --git a/README.ANDROID b/README.ANDROID
index f7eacdde..30959ed3 100644
--- a/README.ANDROID
+++ b/README.ANDROID
@@ -6,7 +6,7 @@ on Android, and later generate valid stack traces from the minidumps
it generates.
This release supports ARM, x86 and MIPS based Android systems.
-This release requires NDK release r10c or higher.
+This release requires NDK release r11c or higher.
I. Building the client library:
===============================
@@ -58,7 +58,7 @@ II. Using the client library in Android:
========================================
The usage instructions are very similar to the Linux ones that are
-found at http://code.google.com/p/google-breakpad/wiki/LinuxStarterGuide
+found at https://chromium.googlesource.com/breakpad/breakpad/+/master/docs/linux_starter_guide.md
1/ You need to include "client/linux/handler/exception_handler.h" from a C++
source file.
diff --git a/README.md b/README.md
new file mode 100644
index 00000000..caefdd28
--- /dev/null
+++ b/README.md
@@ -0,0 +1,82 @@
+# Breakpad
+
+Breakpad is a set of client and server components which implement a
+crash-reporting system.
+
+* [Homepage](https://chromium.googlesource.com/breakpad/breakpad/)
+* [Documentation](https://chromium.googlesource.com/breakpad/breakpad/+/master/docs/)
+* [Bugs](https://bugs.chromium.org/p/google-breakpad/)
+* Discussion/Questions: [google-breakpad-discuss@googlegroups.com](https://groups.google.com/d/forum/google-breakpad-discuss)
+* Developer/Reviews: [google-breakpad-dev@googlegroups.com](https://groups.google.com/d/forum/google-breakpad-dev)
+* Tests: [![Build Status](https://travis-ci.org/google/breakpad.svg?branch=master)](https://travis-ci.org/google/breakpad) [![Build status](https://ci.appveyor.com/api/projects/status/eguv4emv2rhq68u2?svg=true)](https://ci.appveyor.com/project/vapier/breakpad)
+* Coverage [![Coverity Status](https://scan.coverity.com/projects/9215/badge.svg)](https://scan.coverity.com/projects/google-breakpad)
+
+## Getting started (from master)
+
+1. First, [download depot_tools](http://dev.chromium.org/developers/how-tos/install-depot-tools)
+ and ensure that they’re in your `PATH`.
+
+2. Create a new directory for checking out the source code (it must be named
+ breakpad).
+
+ ```sh
+ mkdir breakpad && cd breakpad
+ ```
+
+3. Run the `fetch` tool from depot_tools to download all the source repos.
+
+ ```sh
+ fetch breakpad
+ cd src
+ ```
+
+4. Build the source.
+
+ ```sh
+ ./configure && make
+ ```
+
+ You can also cd to another directory and run configure from there to build
+ outside the source tree.
+
+ This will build the processor tools (`src/processor/minidump_stackwalk`,
+ `src/processor/minidump_dump`, etc), and when building on Linux it will
+ also build the client libraries and some tools
+ (`src/tools/linux/dump_syms/dump_syms`,
+ `src/tools/linux/md2core/minidump-2-core`, etc).
+
+5. Optionally, run tests.
+
+ ```sh
+ make check
+ ```
+
+6. Optionally, install the built libraries
+
+ ```sh
+ make install
+ ```
+
+If you need to reconfigure your build be sure to run `make distclean` first.
+
+To update an existing checkout to a newer revision, you can
+`git pull` as usual, but then you should run `gclient sync` to ensure that the
+dependent repos are up-to-date.
+
+## To request change review
+
+1. Follow the steps above to get the source and build it.
+
+2. Make changes. Build and test your changes.
+ For core code like processor use methods above.
+ For linux/mac/windows, there are test targets in each project file.
+
+3. Commit your changes to your local repo and upload them to the server.
+ http://dev.chromium.org/developers/contributing-code
+ e.g. `git commit ... && git cl upload ...`
+ You will be prompted for credential and a description.
+
+4. At https://chromium-review.googlesource.com/ you'll find your issue listed;
+ click on it, then “Add reviewer”, and enter in the code reviewer. Depending
+ on your settings, you may not see an email, but the reviewer has been
+ notified with google-breakpad-dev@googlegroups.com always CC’d.
diff --git a/aclocal.m4 b/aclocal.m4
index b397b89f..b6aeaa44 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,6 +1,6 @@
-# generated automatically by aclocal 1.14.1 -*- Autoconf -*-
+# generated automatically by aclocal 1.15.1 -*- Autoconf -*-
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -20,7 +20,7 @@ You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
-# Copyright (C) 2002-2013 Free Software Foundation, Inc.
+# Copyright (C) 2002-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -32,10 +32,10 @@ To do so, use the procedure documented by the package, typically 'autoreconf'.])
# generated from the m4 files accompanying Automake X.Y.
# (This private macro should not be called outside this file.)
AC_DEFUN([AM_AUTOMAKE_VERSION],
-[am__api_version='1.14'
+[am__api_version='1.15'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
-m4_if([$1], [1.14.1], [],
+m4_if([$1], [1.15.1], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
@@ -51,14 +51,74 @@ m4_define([_AM_AUTOCONF_VERSION], [])
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.14.1])dnl
+[AM_AUTOMAKE_VERSION([1.15.1])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
+# Copyright (C) 2011-2017 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_AR([ACT-IF-FAIL])
+# -------------------------
+# Try to determine the archiver interface, and trigger the ar-lib wrapper
+# if it is needed. If the detection of archiver interface fails, run
+# ACT-IF-FAIL (default is to abort configure with a proper error message).
+AC_DEFUN([AM_PROG_AR],
+[AC_BEFORE([$0], [LT_INIT])dnl
+AC_BEFORE([$0], [AC_PROG_LIBTOOL])dnl
+AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([ar-lib])dnl
+AC_CHECK_TOOLS([AR], [ar lib "link -lib"], [false])
+: ${AR=ar}
+
+AC_CACHE_CHECK([the archiver ($AR) interface], [am_cv_ar_interface],
+ [AC_LANG_PUSH([C])
+ am_cv_ar_interface=ar
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int some_variable = 0;]])],
+ [am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&AS_MESSAGE_LOG_FD'
+ AC_TRY_EVAL([am_ar_try])
+ if test "$ac_status" -eq 0; then
+ am_cv_ar_interface=ar
+ else
+ am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&AS_MESSAGE_LOG_FD'
+ AC_TRY_EVAL([am_ar_try])
+ if test "$ac_status" -eq 0; then
+ am_cv_ar_interface=lib
+ else
+ am_cv_ar_interface=unknown
+ fi
+ fi
+ rm -f conftest.lib libconftest.a
+ ])
+ AC_LANG_POP([C])])
+
+case $am_cv_ar_interface in
+ar)
+ ;;
+lib)
+ # Microsoft lib, so override with the ar-lib wrapper script.
+ # FIXME: It is wrong to rewrite AR.
+ # But if we don't then we get into trouble of one sort or another.
+ # A longer-term fix would be to have automake use am__AR in this case,
+ # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something
+ # similar.
+ AR="$am_aux_dir/ar-lib $AR"
+ ;;
+unknown)
+ m4_default([$1],
+ [AC_MSG_ERROR([could not determine $AR interface])])
+ ;;
+esac
+AC_SUBST([AR])dnl
+])
+
# Figure out how to run the assembler. -*- Autoconf -*-
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -78,7 +138,7 @@ _AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES([CCAS])])dnl
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -123,15 +183,14 @@ _AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES([CCAS])])dnl
# configured tree to be moved without reconfiguration.
AC_DEFUN([AM_AUX_DIR_EXPAND],
-[dnl Rely on autoconf to set up CDPATH properly.
-AC_PREREQ([2.50])dnl
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
+[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
+# Expand $ac_aux_dir to an absolute path.
+am_aux_dir=`cd "$ac_aux_dir" && pwd`
])
# AM_CONDITIONAL -*- Autoconf -*-
-# Copyright (C) 1997-2013 Free Software Foundation, Inc.
+# Copyright (C) 1997-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -162,7 +221,7 @@ AC_CONFIG_COMMANDS_PRE(
Usually this means the macro was only invoked conditionally.]])
fi])])
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Copyright (C) 1999-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -353,7 +412,7 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl
# Generate code to set up dependency tracking. -*- Autoconf -*-
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Copyright (C) 1999-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -429,7 +488,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
# Do all the work for Automake. -*- Autoconf -*-
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -519,8 +578,8 @@ AC_REQUIRE([AC_PROG_MKDIR_P])dnl
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
-# We need awk for the "check" target. The system "awk" is bad on
-# some platforms.
+# We need awk for the "check" target (and possibly the TAP driver). The
+# system "awk" is bad on some platforms.
AC_REQUIRE([AC_PROG_AWK])dnl
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
AC_REQUIRE([AM_SET_LEADING_DOT])dnl
@@ -593,7 +652,11 @@ to "yes", and re-run configure.
END
AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
fi
-fi])
+fi
+dnl The trailing newline in this macro's definition is deliberate, for
+dnl backward compatibility and to allow trailing 'dnl'-style comments
+dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
+])
dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
@@ -622,7 +685,7 @@ for _am_header in $config_headers :; do
done
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -633,7 +696,7 @@ echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_co
# Define $install_sh.
AC_DEFUN([AM_PROG_INSTALL_SH],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-if test x"${install_sh}" != xset; then
+if test x"${install_sh+set}" != xset; then
case $am_aux_dir in
*\ * | *\ *)
install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
@@ -643,7 +706,7 @@ if test x"${install_sh}" != xset; then
fi
AC_SUBST([install_sh])])
-# Copyright (C) 2003-2013 Free Software Foundation, Inc.
+# Copyright (C) 2003-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -665,7 +728,7 @@ AC_SUBST([am__leading_dot])])
# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
# From Jim Meyering
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -700,7 +763,7 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
# Check to see how 'make' treats includes. -*- Autoconf -*-
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -750,7 +813,7 @@ rm -f confinc confmf
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
-# Copyright (C) 1997-2013 Free Software Foundation, Inc.
+# Copyright (C) 1997-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -791,7 +854,7 @@ fi
# Obsolete and "removed" macros, that must however still report explicit
# error messages when used, to smooth transition.
#
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -818,7 +881,7 @@ AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES])
# Helper functions for option handling. -*- Autoconf -*-
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -847,7 +910,7 @@ AC_DEFUN([_AM_SET_OPTIONS],
AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Copyright (C) 1999-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -894,7 +957,7 @@ AC_LANG_POP([C])])
# For backward compatibility.
AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -913,7 +976,7 @@ AC_DEFUN([AM_RUN_LOG],
# Check to make sure that the build environment is sane. -*- Autoconf -*-
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -994,7 +1057,7 @@ AC_CONFIG_COMMANDS_PRE(
rm -f conftest.file
])
-# Copyright (C) 2009-2013 Free Software Foundation, Inc.
+# Copyright (C) 2009-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -1054,7 +1117,7 @@ AC_SUBST([AM_BACKSLASH])dnl
_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
])
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -1082,7 +1145,7 @@ fi
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
-# Copyright (C) 2006-2013 Free Software Foundation, Inc.
+# Copyright (C) 2006-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -1101,7 +1164,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
# Check how to create a tarball. -*- Autoconf -*-
-# Copyright (C) 2004-2013 Free Software Foundation, Inc.
+# Copyright (C) 2004-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -1232,3 +1295,10 @@ AC_SUBST([am__tar])
AC_SUBST([am__untar])
]) # _AM_PROG_TAR
+m4_include([m4/ax_append_compile_flags.m4])
+m4_include([m4/ax_append_flag.m4])
+m4_include([m4/ax_check_compile_flag.m4])
+m4_include([m4/ax_check_define.m4])
+m4_include([m4/ax_cxx_compile_stdcxx.m4])
+m4_include([m4/ax_pthread.m4])
+m4_include([m4/ax_require_defined.m4])
diff --git a/android/google_breakpad/Android.mk b/android/google_breakpad/Android.mk
index 52fa5e4b..252f1af6 100644
--- a/android/google_breakpad/Android.mk
+++ b/android/google_breakpad/Android.mk
@@ -56,6 +56,9 @@ LOCAL_PATH := $(call my-dir)/../..
include $(CLEAR_VARS)
LOCAL_MODULE := breakpad_client
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-BSD
+LOCAL_LICENSE_CONDITIONS := notice
+LOCAL_NOTICE_FILE := $(LOCAL_PATH)/../../LICENSE
LOCAL_CPP_EXTENSION := .cc
@@ -71,17 +74,20 @@ LOCAL_ARM_MODE := arm
# List of client source files, directly taken from Makefile.am
LOCAL_SRC_FILES := \
src/client/linux/crash_generation/crash_generation_client.cc \
+ src/client/linux/dump_writer_common/thread_info.cc \
+ src/client/linux/dump_writer_common/ucontext_reader.cc \
src/client/linux/handler/exception_handler.cc \
src/client/linux/handler/minidump_descriptor.cc \
src/client/linux/log/log.cc \
+ src/client/linux/microdump_writer/microdump_writer.cc \
src/client/linux/minidump_writer/linux_dumper.cc \
src/client/linux/minidump_writer/linux_ptrace_dumper.cc \
src/client/linux/minidump_writer/minidump_writer.cc \
src/client/minidump_file_writer.cc \
- src/common/android/breakpad_getcontext.S \
- src/common/convert_UTF.c \
+ src/common/convert_UTF.cc \
src/common/md5.cc \
src/common/string_conversion.cc \
+ src/common/linux/breakpad_getcontext.S \
src/common/linux/elfutils.cc \
src/common/linux/file_id.cc \
src/common/linux/guid_creator.cc \
@@ -90,11 +96,12 @@ LOCAL_SRC_FILES := \
src/common/linux/safe_readlink.cc
LOCAL_C_INCLUDES := $(LOCAL_PATH)/src/common/android/include \
- $(LOCAL_PATH)/src
+ $(LOCAL_PATH)/src \
+ $(LSS_PATH)
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_C_INCLUDES)
LOCAL_EXPORT_LDLIBS := -llog
include $(BUILD_STATIC_LIBRARY)
-# Done. \ No newline at end of file
+# Done.
diff --git a/android/sample_app/jni/Android.mk b/android/sample_app/jni/Android.mk
index 61487b52..7ffb4227 100644
--- a/android/sample_app/jni/Android.mk
+++ b/android/sample_app/jni/Android.mk
@@ -31,6 +31,9 @@ LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := test_google_breakpad
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-BSD
+LOCAL_LICENSE_CONDITIONS := notice
+LOCAL_NOTICE_FILE := $(LOCAL_PATH)/../../../LICENSE
LOCAL_SRC_FILES := test_breakpad.cpp
LOCAL_STATIC_LIBRARIES += breakpad_client
include $(BUILD_EXECUTABLE)
diff --git a/android/sample_app/jni/Application.mk b/android/sample_app/jni/Application.mk
index 366ce29f..9728017d 100644
--- a/android/sample_app/jni/Application.mk
+++ b/android/sample_app/jni/Application.mk
@@ -29,3 +29,4 @@
APP_STL := stlport_static
APP_ABI := all
+APP_CXXFLAGS := -std=c++11 -D__STDC_LIMIT_MACROS
diff --git a/appveyor.yml b/appveyor.yml
new file mode 100644
index 00000000..3cf5ba42
--- /dev/null
+++ b/appveyor.yml
@@ -0,0 +1,42 @@
+version: '{build}'
+
+environment:
+ GYP_MSVS_VERSION: 2013
+
+platform:
+ - Win32
+
+configuration:
+ - Debug
+ - Release
+
+# Use the source dir expected by gclient.
+clone_folder: c:\projects\breakpad\src
+
+# Before checkout.
+init:
+ - cd %APPVEYOR_BUILD_FOLDER%\..\..
+ - appveyor DownloadFile https://storage.googleapis.com/chrome-infra/depot_tools.zip
+ - 7z -bd x depot_tools.zip -odepot_tools
+ - depot_tools\update_depot_tools
+ - cd %APPVEYOR_BUILD_FOLDER%
+
+# After checkout.
+install:
+ - PATH C:\projects\depot_tools;%PATH%
+ - cd %APPVEYOR_BUILD_FOLDER%\..
+ - gclient config https://%APPVEYOR_REPO_PROVIDER%.com/%APPVEYOR_REPO_NAME% --unmanaged --name=src
+ - gclient sync
+
+build_script:
+ - cd %APPVEYOR_BUILD_FOLDER%
+ - msbuild src\client\windows\breakpad_client.sln /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" /m /verbosity:normal
+ - msbuild src\tools\windows\tools_windows.sln /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" /m /verbosity:normal
+
+test_script:
+ - src\client\windows\%CONFIGURATION%\client_tests.exe
+ - src\tools\windows\%CONFIGURATION%\dump_syms_unittest.exe
+
+artifacts:
+ - path: '**\*.exe'
+ - path: '**\*.lib'
diff --git a/autotools/ar-lib b/autotools/ar-lib
new file mode 100755
index 00000000..463b9ec0
--- /dev/null
+++ b/autotools/ar-lib
@@ -0,0 +1,270 @@
+#! /bin/sh
+# Wrapper for Microsoft lib.exe
+
+me=ar-lib
+scriptversion=2012-03-01.08; # UTC
+
+# Copyright (C) 2010-2014 Free Software Foundation, Inc.
+# Written by Peter Rosin <peda@lysator.liu.se>.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+
+# func_error message
+func_error ()
+{
+ echo "$me: $1" 1>&2
+ exit 1
+}
+
+file_conv=
+
+# func_file_conv build_file
+# Convert a $build file to $host form and store it in $file
+# Currently only supports Windows hosts.
+func_file_conv ()
+{
+ file=$1
+ case $file in
+ / | /[!/]*) # absolute file, and not a UNC file
+ if test -z "$file_conv"; then
+ # lazily determine how to convert abs files
+ case `uname -s` in
+ MINGW*)
+ file_conv=mingw
+ ;;
+ CYGWIN*)
+ file_conv=cygwin
+ ;;
+ *)
+ file_conv=wine
+ ;;
+ esac
+ fi
+ case $file_conv in
+ mingw)
+ file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
+ ;;
+ cygwin)
+ file=`cygpath -m "$file" || echo "$file"`
+ ;;
+ wine)
+ file=`winepath -w "$file" || echo "$file"`
+ ;;
+ esac
+ ;;
+ esac
+}
+
+# func_at_file at_file operation archive
+# Iterate over all members in AT_FILE performing OPERATION on ARCHIVE
+# for each of them.
+# When interpreting the content of the @FILE, do NOT use func_file_conv,
+# since the user would need to supply preconverted file names to
+# binutils ar, at least for MinGW.
+func_at_file ()
+{
+ operation=$2
+ archive=$3
+ at_file_contents=`cat "$1"`
+ eval set x "$at_file_contents"
+ shift
+
+ for member
+ do
+ $AR -NOLOGO $operation:"$member" "$archive" || exit $?
+ done
+}
+
+case $1 in
+ '')
+ func_error "no command. Try '$0 --help' for more information."
+ ;;
+ -h | --h*)
+ cat <<EOF
+Usage: $me [--help] [--version] PROGRAM ACTION ARCHIVE [MEMBER...]
+
+Members may be specified in a file named with @FILE.
+EOF
+ exit $?
+ ;;
+ -v | --v*)
+ echo "$me, version $scriptversion"
+ exit $?
+ ;;
+esac
+
+if test $# -lt 3; then
+ func_error "you must specify a program, an action and an archive"
+fi
+
+AR=$1
+shift
+while :
+do
+ if test $# -lt 2; then
+ func_error "you must specify a program, an action and an archive"
+ fi
+ case $1 in
+ -lib | -LIB \
+ | -ltcg | -LTCG \
+ | -machine* | -MACHINE* \
+ | -subsystem* | -SUBSYSTEM* \
+ | -verbose | -VERBOSE \
+ | -wx* | -WX* )
+ AR="$AR $1"
+ shift
+ ;;
+ *)
+ action=$1
+ shift
+ break
+ ;;
+ esac
+done
+orig_archive=$1
+shift
+func_file_conv "$orig_archive"
+archive=$file
+
+# strip leading dash in $action
+action=${action#-}
+
+delete=
+extract=
+list=
+quick=
+replace=
+index=
+create=
+
+while test -n "$action"
+do
+ case $action in
+ d*) delete=yes ;;
+ x*) extract=yes ;;
+ t*) list=yes ;;
+ q*) quick=yes ;;
+ r*) replace=yes ;;
+ s*) index=yes ;;
+ S*) ;; # the index is always updated implicitly
+ c*) create=yes ;;
+ u*) ;; # TODO: don't ignore the update modifier
+ v*) ;; # TODO: don't ignore the verbose modifier
+ *)
+ func_error "unknown action specified"
+ ;;
+ esac
+ action=${action#?}
+done
+
+case $delete$extract$list$quick$replace,$index in
+ yes,* | ,yes)
+ ;;
+ yesyes*)
+ func_error "more than one action specified"
+ ;;
+ *)
+ func_error "no action specified"
+ ;;
+esac
+
+if test -n "$delete"; then
+ if test ! -f "$orig_archive"; then
+ func_error "archive not found"
+ fi
+ for member
+ do
+ case $1 in
+ @*)
+ func_at_file "${1#@}" -REMOVE "$archive"
+ ;;
+ *)
+ func_file_conv "$1"
+ $AR -NOLOGO -REMOVE:"$file" "$archive" || exit $?
+ ;;
+ esac
+ done
+
+elif test -n "$extract"; then
+ if test ! -f "$orig_archive"; then
+ func_error "archive not found"
+ fi
+ if test $# -gt 0; then
+ for member
+ do
+ case $1 in
+ @*)
+ func_at_file "${1#@}" -EXTRACT "$archive"
+ ;;
+ *)
+ func_file_conv "$1"
+ $AR -NOLOGO -EXTRACT:"$file" "$archive" || exit $?
+ ;;
+ esac
+ done
+ else
+ $AR -NOLOGO -LIST "$archive" | sed -e 's/\\/\\\\/g' | while read member
+ do
+ $AR -NOLOGO -EXTRACT:"$member" "$archive" || exit $?
+ done
+ fi
+
+elif test -n "$quick$replace"; then
+ if test ! -f "$orig_archive"; then
+ if test -z "$create"; then
+ echo "$me: creating $orig_archive"
+ fi
+ orig_archive=
+ else
+ orig_archive=$archive
+ fi
+
+ for member
+ do
+ case $1 in
+ @*)
+ func_file_conv "${1#@}"
+ set x "$@" "@$file"
+ ;;
+ *)
+ func_file_conv "$1"
+ set x "$@" "$file"
+ ;;
+ esac
+ shift
+ shift
+ done
+
+ if test -n "$orig_archive"; then
+ $AR -NOLOGO -OUT:"$archive" "$orig_archive" "$@" || exit $?
+ else
+ $AR -NOLOGO -OUT:"$archive" "$@" || exit $?
+ fi
+
+elif test -n "$list"; then
+ if test ! -f "$orig_archive"; then
+ func_error "archive not found"
+ fi
+ $AR -NOLOGO -LIST "$archive" || exit $?
+fi
diff --git a/autotools/compile b/autotools/compile
index 531136b0..a85b723c 100755
--- a/autotools/compile
+++ b/autotools/compile
@@ -3,7 +3,7 @@
scriptversion=2012-10-14.11; # UTC
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Copyright (C) 1999-2014 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>.
#
# This program is free software; you can redistribute it and/or modify
diff --git a/autotools/config.guess b/autotools/config.guess
index 94fcdfe9..1000e2bd 100755
--- a/autotools/config.guess
+++ b/autotools/config.guess
@@ -1,8 +1,8 @@
#! /bin/sh
# Attempt to guess a canonical system name.
-# Copyright 1992-2014 Free Software Foundation, Inc.
+# Copyright 1992-2017 Free Software Foundation, Inc.
-timestamp='2014-03-23'
+timestamp='2017-02-07'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -24,12 +24,12 @@ timestamp='2014-03-23'
# program. This Exception is an additional permission under section 7
# of the GNU General Public License, version 3 ("GPLv3").
#
-# Originally written by Per Bothner.
+# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
#
# You can get the latest version of this script from:
-# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
#
-# Please send patches with a ChangeLog entry to config-patches@gnu.org.
+# Please send patches to <config-patches@gnu.org>.
me=`echo "$0" | sed -e 's,.*/,,'`
@@ -50,7 +50,7 @@ version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
-Copyright 1992-2014 Free Software Foundation, Inc.
+Copyright 1992-2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -168,19 +168,29 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# Note: NetBSD doesn't particularly care about the vendor
# portion of the name. We always set it to "unknown".
sysctl="sysctl -n hw.machine_arch"
- UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
- /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
+ UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
+ /sbin/$sysctl 2>/dev/null || \
+ /usr/sbin/$sysctl 2>/dev/null || \
+ echo unknown)`
case "${UNAME_MACHINE_ARCH}" in
armeb) machine=armeb-unknown ;;
arm*) machine=arm-unknown ;;
sh3el) machine=shl-unknown ;;
sh3eb) machine=sh-unknown ;;
sh5el) machine=sh5le-unknown ;;
+ earmv*)
+ arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
+ endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'`
+ machine=${arch}${endian}-unknown
+ ;;
*) machine=${UNAME_MACHINE_ARCH}-unknown ;;
esac
# The Operating System including object format, if it has switched
- # to ELF recently, or will in the future.
+ # to ELF recently (or will in the future) and ABI.
case "${UNAME_MACHINE_ARCH}" in
+ earm*)
+ os=netbsdelf
+ ;;
arm*|i386|m68k|ns32k|sh3*|sparc|vax)
eval $set_cc_for_build
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
@@ -197,6 +207,13 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
os=netbsd
;;
esac
+ # Determine ABI tags.
+ case "${UNAME_MACHINE_ARCH}" in
+ earm*)
+ expr='s/^earmv[0-9]/-eabi/;s/eb$//'
+ abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"`
+ ;;
+ esac
# The OS release
# Debian GNU/NetBSD machines have a different userland, and
# thus, need a distinct triplet. However, they do not need
@@ -207,13 +224,13 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
release='-gnu'
;;
*)
- release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+ release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2`
;;
esac
# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
# contains redundant information, the shorter form:
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
- echo "${machine}-${os}${release}"
+ echo "${machine}-${os}${release}${abi}"
exit ;;
*:Bitrig:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
@@ -223,6 +240,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
exit ;;
+ *:LibertyBSD:*:*)
+ UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
+ echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE}
+ exit ;;
*:ekkoBSD:*:*)
echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
exit ;;
@@ -235,6 +256,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
*:MirBSD:*:*)
echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
exit ;;
+ *:Sortix:*:*)
+ echo ${UNAME_MACHINE}-unknown-sortix
+ exit ;;
alpha:OSF1:*:*)
case $UNAME_RELEASE in
*4.0)
@@ -251,42 +275,42 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
case "$ALPHA_CPU_TYPE" in
"EV4 (21064)")
- UNAME_MACHINE="alpha" ;;
+ UNAME_MACHINE=alpha ;;
"EV4.5 (21064)")
- UNAME_MACHINE="alpha" ;;
+ UNAME_MACHINE=alpha ;;
"LCA4 (21066/21068)")
- UNAME_MACHINE="alpha" ;;
+ UNAME_MACHINE=alpha ;;
"EV5 (21164)")
- UNAME_MACHINE="alphaev5" ;;
+ UNAME_MACHINE=alphaev5 ;;
"EV5.6 (21164A)")
- UNAME_MACHINE="alphaev56" ;;
+ UNAME_MACHINE=alphaev56 ;;
"EV5.6 (21164PC)")
- UNAME_MACHINE="alphapca56" ;;
+ UNAME_MACHINE=alphapca56 ;;
"EV5.7 (21164PC)")
- UNAME_MACHINE="alphapca57" ;;
+ UNAME_MACHINE=alphapca57 ;;
"EV6 (21264)")
- UNAME_MACHINE="alphaev6" ;;
+ UNAME_MACHINE=alphaev6 ;;
"EV6.7 (21264A)")
- UNAME_MACHINE="alphaev67" ;;
+ UNAME_MACHINE=alphaev67 ;;
"EV6.8CB (21264C)")
- UNAME_MACHINE="alphaev68" ;;
+ UNAME_MACHINE=alphaev68 ;;
"EV6.8AL (21264B)")
- UNAME_MACHINE="alphaev68" ;;
+ UNAME_MACHINE=alphaev68 ;;
"EV6.8CX (21264D)")
- UNAME_MACHINE="alphaev68" ;;
+ UNAME_MACHINE=alphaev68 ;;
"EV6.9A (21264/EV69A)")
- UNAME_MACHINE="alphaev69" ;;
+ UNAME_MACHINE=alphaev69 ;;
"EV7 (21364)")
- UNAME_MACHINE="alphaev7" ;;
+ UNAME_MACHINE=alphaev7 ;;
"EV7.9 (21364A)")
- UNAME_MACHINE="alphaev79" ;;
+ UNAME_MACHINE=alphaev79 ;;
esac
# A Pn.n version is a patched version.
# A Vn.n version is a released version.
# A Tn.n version is a released field test version.
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
- echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
exitcode=$?
trap '' 0
@@ -359,16 +383,16 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
exit ;;
i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
eval $set_cc_for_build
- SUN_ARCH="i386"
+ SUN_ARCH=i386
# If there is a compiler, see if it is configured for 64-bit objects.
# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
# This test works for both compilers.
- if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+ if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
- (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_64BIT_ARCH >/dev/null
then
- SUN_ARCH="x86_64"
+ SUN_ARCH=x86_64
fi
fi
echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
@@ -393,7 +417,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
exit ;;
sun*:*:4.2BSD:*)
UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
- test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
+ test "x${UNAME_RELEASE}" = x && UNAME_RELEASE=3
case "`/bin/arch`" in
sun3)
echo m68k-sun-sunos${UNAME_RELEASE}
@@ -579,8 +603,9 @@ EOF
else
IBM_ARCH=powerpc
fi
- if [ -x /usr/bin/oslevel ] ; then
- IBM_REV=`/usr/bin/oslevel`
+ if [ -x /usr/bin/lslpp ] ; then
+ IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
+ awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
else
IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
fi
@@ -617,13 +642,13 @@ EOF
sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
case "${sc_cpu_version}" in
- 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
- 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+ 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
+ 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
532) # CPU_PA_RISC2_0
case "${sc_kernel_bits}" in
- 32) HP_ARCH="hppa2.0n" ;;
- 64) HP_ARCH="hppa2.0w" ;;
- '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
+ 32) HP_ARCH=hppa2.0n ;;
+ 64) HP_ARCH=hppa2.0w ;;
+ '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20
esac ;;
esac
fi
@@ -662,11 +687,11 @@ EOF
exit (0);
}
EOF
- (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+ (CCOPTS="" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
test -z "$HP_ARCH" && HP_ARCH=hppa
fi ;;
esac
- if [ ${HP_ARCH} = "hppa2.0w" ]
+ if [ ${HP_ARCH} = hppa2.0w ]
then
eval $set_cc_for_build
@@ -679,12 +704,12 @@ EOF
# $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
# => hppa64-hp-hpux11.23
- if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
+ if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) |
grep -q __LP64__
then
- HP_ARCH="hppa2.0w"
+ HP_ARCH=hppa2.0w
else
- HP_ARCH="hppa64"
+ HP_ARCH=hppa64
fi
fi
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
@@ -789,14 +814,14 @@ EOF
echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit ;;
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
- FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
+ FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit ;;
5000:UNIX_System_V:4.*:*)
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
+ FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit ;;
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
@@ -878,7 +903,7 @@ EOF
exit ;;
*:GNU/*:*:*)
# other systems with GNU libc and userland
- echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
+ echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
exit ;;
i*86:Minix:*:*)
echo ${UNAME_MACHINE}-pc-minix
@@ -901,7 +926,7 @@ EOF
EV68*) UNAME_MACHINE=alphaev68 ;;
esac
objdump --private-headers /bin/sh | grep -q ld.so.1
- if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
+ if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
arc:Linux:*:* | arceb:Linux:*:*)
@@ -932,6 +957,9 @@ EOF
crisv32:Linux:*:*)
echo ${UNAME_MACHINE}-axis-linux-${LIBC}
exit ;;
+ e2k:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
frv:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
@@ -944,6 +972,9 @@ EOF
ia64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
+ k1om:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
m32r*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
@@ -969,6 +1000,9 @@ EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
;;
+ mips64el:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
openrisc*:Linux:*:*)
echo or1k-unknown-linux-${LIBC}
exit ;;
@@ -1001,6 +1035,9 @@ EOF
ppcle:Linux:*:*)
echo powerpcle-unknown-linux-${LIBC}
exit ;;
+ riscv32:Linux:*:* | riscv64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
s390:Linux:*:* | s390x:Linux:*:*)
echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
exit ;;
@@ -1020,18 +1057,7 @@ EOF
echo ${UNAME_MACHINE}-dec-linux-${LIBC}
exit ;;
x86_64:Linux:*:*)
- eval $set_cc_for_build
- X86_64_ABI=
- # If there is a compiler, see if it is configured for 32-bit objects.
- if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
- if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \
- (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
- grep IS_X32 >/dev/null
- then
- X86_64_ABI=x32
- fi
- fi
- echo x86_64-unknown-linux-gnu${X86_64_ABI}
+ echo ${UNAME_MACHINE}-pc-linux-${LIBC}
exit ;;
xtensa*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
@@ -1110,7 +1136,7 @@ EOF
# uname -m prints for DJGPP always 'pc', but it prints nothing about
# the processor, so we play safe by assuming i586.
# Note: whatever this is, it MUST be the same as what config.sub
- # prints for the "djgpp" host, or else GDB configury will decide that
+ # prints for the "djgpp" host, or else GDB configure will decide that
# this is a cross-build.
echo i586-pc-msdosdjgpp
exit ;;
@@ -1259,6 +1285,9 @@ EOF
SX-8R:SUPER-UX:*:*)
echo sx8r-nec-superux${UNAME_RELEASE}
exit ;;
+ SX-ACE:SUPER-UX:*:*)
+ echo sxace-nec-superux${UNAME_RELEASE}
+ exit ;;
Power*:Rhapsody:*:*)
echo powerpc-apple-rhapsody${UNAME_RELEASE}
exit ;;
@@ -1272,9 +1301,9 @@ EOF
UNAME_PROCESSOR=powerpc
fi
if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
- if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+ if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
- (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_64BIT_ARCH >/dev/null
then
case $UNAME_PROCESSOR in
@@ -1296,7 +1325,7 @@ EOF
exit ;;
*:procnto*:*:* | *:QNX:[0123456789]*:*)
UNAME_PROCESSOR=`uname -p`
- if test "$UNAME_PROCESSOR" = "x86"; then
+ if test "$UNAME_PROCESSOR" = x86; then
UNAME_PROCESSOR=i386
UNAME_MACHINE=pc
fi
@@ -1314,6 +1343,9 @@ EOF
NSR-?:NONSTOP_KERNEL:*:*)
echo nsr-tandem-nsk${UNAME_RELEASE}
exit ;;
+ NSX-?:NONSTOP_KERNEL:*:*)
+ echo nsx-tandem-nsk${UNAME_RELEASE}
+ exit ;;
*:NonStop-UX:*:*)
echo mips-compaq-nonstopux
exit ;;
@@ -1327,7 +1359,7 @@ EOF
# "uname -m" is not consistent, so use $cputype instead. 386
# is converted to i386 for consistency with other x86
# operating systems.
- if test "$cputype" = "386"; then
+ if test "$cputype" = 386; then
UNAME_MACHINE=i386
else
UNAME_MACHINE="$cputype"
@@ -1369,7 +1401,7 @@ EOF
echo i386-pc-xenix
exit ;;
i*86:skyos:*:*)
- echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
+ echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'`
exit ;;
i*86:rdos:*:*)
echo ${UNAME_MACHINE}-pc-rdos
@@ -1380,23 +1412,25 @@ EOF
x86_64:VMkernel:*:*)
echo ${UNAME_MACHINE}-unknown-esx
exit ;;
+ amd64:Isilon\ OneFS:*:*)
+ echo x86_64-unknown-onefs
+ exit ;;
esac
cat >&2 <<EOF
$0: unable to guess system type
-This script, last modified $timestamp, has failed to recognize
-the operating system you are using. It is advised that you
-download the most up to date version of the config scripts from
+This script (version $timestamp), has failed to recognize the
+operating system you are using. If your script is old, overwrite
+config.guess and config.sub with the latest versions from:
- http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
and
- http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
-If the version you run ($0) is already up to date, please
-send the following data and any information you think might be
-pertinent to <config-patches@gnu.org> in order to provide the needed
-information to handle your system.
+If $0 has already been updated, send the following data and any
+information you think might be pertinent to config-patches@gnu.org to
+provide the necessary information to handle your system.
config.guess timestamp = $timestamp
diff --git a/autotools/config.sub b/autotools/config.sub
index 3f5d45d4..87abeab6 100755
--- a/autotools/config.sub
+++ b/autotools/config.sub
@@ -1,8 +1,8 @@
#! /bin/sh
# Configuration validation subroutine script.
-# Copyright 1992-2014 Free Software Foundation, Inc.
+# Copyright 1992-2017 Free Software Foundation, Inc.
-timestamp='2014-07-28'
+timestamp='2017-02-07'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -25,7 +25,7 @@ timestamp='2014-07-28'
# of the GNU General Public License, version 3 ("GPLv3").
-# Please send patches with a ChangeLog entry to config-patches@gnu.org.
+# Please send patches to <config-patches@gnu.org>.
#
# Configuration subroutine to validate and canonicalize a configuration type.
# Supply the specified configuration type as an argument.
@@ -33,7 +33,7 @@ timestamp='2014-07-28'
# Otherwise, we print the canonical config type on stdout and succeed.
# You can get the latest version of this script from:
-# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
# This file is supposed to be the same for all GNU packages
# and recognize all the CPU types, system types and aliases
@@ -53,8 +53,7 @@ timestamp='2014-07-28'
me=`echo "$0" | sed -e 's,.*/,,'`
usage="\
-Usage: $0 [OPTION] CPU-MFR-OPSYS
- $0 [OPTION] ALIAS
+Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS
Canonicalize a configuration name.
@@ -68,7 +67,7 @@ Report bugs and patches to <config-patches@gnu.org>."
version="\
GNU config.sub ($timestamp)
-Copyright 1992-2014 Free Software Foundation, Inc.
+Copyright 1992-2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -117,8 +116,8 @@ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
- knetbsd*-gnu* | netbsd*-gnu* | \
- kopensolaris*-gnu* | \
+ knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
+ kopensolaris*-gnu* | cloudabi*-eabi* | \
storm-chaos* | os2-emx* | rtmk-nova*)
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
@@ -255,12 +254,13 @@ case $basic_machine in
| arc | arceb \
| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
| avr | avr32 \
+ | ba \
| be32 | be64 \
| bfin \
| c4x | c8051 | clipper \
- | d10v | d30v | dlx | dsp16xx | dvp \
- | epiphany \
- | fido | fr30 | frv \
+ | d10v | d30v | dlx | dsp16xx \
+ | e2k | epiphany \
+ | fido | fr30 | frv | ft32 \
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| hexagon \
| i370 | i860 | i960 | ia64 \
@@ -301,10 +301,12 @@ case $basic_machine in
| open8 | or1k | or1knd | or32 \
| pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle \
+ | pru \
| pyramid \
+ | riscv32 | riscv64 \
| rl78 | rx \
| score \
- | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
| sh64 | sh64le \
| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
@@ -312,6 +314,7 @@ case $basic_machine in
| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
| ubicom32 \
| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
+ | visium \
| we32k \
| x86 | xc16x | xstormy16 | xtensa \
| z8k | z80)
@@ -326,6 +329,9 @@ case $basic_machine in
c6x)
basic_machine=tic6x-unknown
;;
+ leon|leon[3-9])
+ basic_machine=sparc-$basic_machine
+ ;;
m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
basic_machine=$basic_machine-unknown
os=-none
@@ -371,12 +377,13 @@ case $basic_machine in
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
| avr-* | avr32-* \
+ | ba-* \
| be32-* | be64-* \
| bfin-* | bs2000-* \
| c[123]* | c30-* | [cjt]90-* | c4x-* \
| c8051-* | clipper-* | craynv-* | cydra-* \
| d10v-* | d30v-* | dlx-* \
- | elxsi-* \
+ | e2k-* | elxsi-* \
| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
| h8300-* | h8500-* \
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
@@ -422,13 +429,15 @@ case $basic_machine in
| orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
+ | pru-* \
| pyramid-* \
+ | riscv32-* | riscv64-* \
| rl78-* | romp-* | rs6000-* | rx-* \
| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
| sparclite-* \
- | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
+ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \
| tahoe-* \
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
| tile*-* \
@@ -436,6 +445,7 @@ case $basic_machine in
| ubicom32-* \
| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
| vax-* \
+ | visium-* \
| we32k-* \
| x86-* | x86_64-* | xc16x-* | xps100-* \
| xstormy16-* | xtensa*-* \
@@ -512,6 +522,9 @@ case $basic_machine in
basic_machine=i386-pc
os=-aros
;;
+ asmjs)
+ basic_machine=asmjs-unknown
+ ;;
aux)
basic_machine=m68k-apple
os=-aux
@@ -632,6 +645,14 @@ case $basic_machine in
basic_machine=m68k-bull
os=-sysv3
;;
+ e500v[12])
+ basic_machine=powerpc-unknown
+ os=$os"spe"
+ ;;
+ e500v[12]-*)
+ basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=$os"spe"
+ ;;
ebmon29k)
basic_machine=a29k-amd
os=-ebmon
@@ -773,6 +794,9 @@ case $basic_machine in
basic_machine=m68k-isi
os=-sysv
;;
+ leon-*|leon[3-9]-*)
+ basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'`
+ ;;
m68knommu)
basic_machine=m68k-unknown
os=-linux
@@ -814,24 +838,6 @@ case $basic_machine in
basic_machine=m68k-atari
os=-mint
;;
- mipsEE* | ee | ps2)
- basic_machine=mips64r5900el-scei
- case $os in
- -linux*)
- ;;
- *)
- os=-elf
- ;;
- esac
- ;;
- iop)
- basic_machine=mipsel-scei
- os=-irx
- ;;
- dvp)
- basic_machine=dvp-scei
- os=-elf
- ;;
mips3*-*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
;;
@@ -942,6 +948,9 @@ case $basic_machine in
nsr-tandem)
basic_machine=nsr-tandem
;;
+ nsx-tandem)
+ basic_machine=nsx-tandem
+ ;;
op50n-* | op60c-*)
basic_machine=hppa1.1-oki
os=-proelf
@@ -1026,7 +1035,7 @@ case $basic_machine in
ppc-* | ppcbe-*)
basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
- ppcle | powerpclittle | ppc-le | powerpc-little)
+ ppcle | powerpclittle)
basic_machine=powerpcle-unknown
;;
ppcle-* | powerpclittle-*)
@@ -1036,7 +1045,7 @@ case $basic_machine in
;;
ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
- ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+ ppc64le | powerpc64little)
basic_machine=powerpc64le-unknown
;;
ppc64le-* | powerpc64little-*)
@@ -1382,27 +1391,28 @@ case $os in
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
| -sym* | -kopensolaris* | -plan9* \
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
- | -aos* | -aros* \
+ | -aos* | -aros* | -cloudabi* | -sortix* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
- | -bitrig* | -openbsd* | -solidbsd* \
+ | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \
| -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
- | -chorusos* | -chorusrdb* | -cegcc* \
+ | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \
| -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
- | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
+ | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
| -linux-newlib* | -linux-musl* | -linux-uclibc* \
| -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
- | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* | -irx* \
+ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
- | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*)
+ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \
+ | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
@@ -1534,6 +1544,8 @@ case $os in
;;
-nacl*)
;;
+ -ios)
+ ;;
-none)
;;
*)
@@ -1629,6 +1641,9 @@ case $basic_machine in
sparc-* | *-sun)
os=-sunos4.1.1
;;
+ pru-*)
+ os=-elf
+ ;;
*-be)
os=-beos
;;
diff --git a/autotools/depcomp b/autotools/depcomp
index 4ebd5b3a..fc98710e 100755
--- a/autotools/depcomp
+++ b/autotools/depcomp
@@ -3,7 +3,7 @@
scriptversion=2013-05-30.07; # UTC
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Copyright (C) 1999-2014 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/autotools/install-sh b/autotools/install-sh
index 377bb868..0b0fdcbb 100755
--- a/autotools/install-sh
+++ b/autotools/install-sh
@@ -1,7 +1,7 @@
#!/bin/sh
# install - install a program, script, or datafile
-scriptversion=2011-11-20.07; # UTC
+scriptversion=2013-12-25.23; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
@@ -41,19 +41,15 @@ scriptversion=2011-11-20.07; # UTC
# This script is compatible with the BSD install script, but was written
# from scratch.
+tab=' '
nl='
'
-IFS=" "" $nl"
+IFS=" $tab$nl"
-# set DOITPROG to echo to test this script
+# Set DOITPROG to "echo" to test this script.
-# Don't use :- since 4.3BSD and earlier shells don't like it.
doit=${DOITPROG-}
-if test -z "$doit"; then
- doit_exec=exec
-else
- doit_exec=$doit
-fi
+doit_exec=${doit:-exec}
# Put in absolute file names if you don't have them in your path;
# or use environment vars.
@@ -68,17 +64,6 @@ mvprog=${MVPROG-mv}
rmprog=${RMPROG-rm}
stripprog=${STRIPPROG-strip}
-posix_glob='?'
-initialize_posix_glob='
- test "$posix_glob" != "?" || {
- if (set -f) 2>/dev/null; then
- posix_glob=
- else
- posix_glob=:
- fi
- }
-'
-
posix_mkdir=
# Desired mode of installed file.
@@ -97,7 +82,7 @@ dir_arg=
dst_arg=
copy_on_change=false
-no_target_directory=
+is_target_a_directory=possibly
usage="\
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
@@ -137,46 +122,57 @@ while test $# -ne 0; do
-d) dir_arg=true;;
-g) chgrpcmd="$chgrpprog $2"
- shift;;
+ shift;;
--help) echo "$usage"; exit $?;;
-m) mode=$2
- case $mode in
- *' '* | *' '* | *'
-'* | *'*'* | *'?'* | *'['*)
- echo "$0: invalid mode: $mode" >&2
- exit 1;;
- esac
- shift;;
+ case $mode in
+ *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
+ echo "$0: invalid mode: $mode" >&2
+ exit 1;;
+ esac
+ shift;;
-o) chowncmd="$chownprog $2"
- shift;;
+ shift;;
-s) stripcmd=$stripprog;;
- -t) dst_arg=$2
- # Protect names problematic for 'test' and other utilities.
- case $dst_arg in
- -* | [=\(\)!]) dst_arg=./$dst_arg;;
- esac
- shift;;
+ -t)
+ is_target_a_directory=always
+ dst_arg=$2
+ # Protect names problematic for 'test' and other utilities.
+ case $dst_arg in
+ -* | [=\(\)!]) dst_arg=./$dst_arg;;
+ esac
+ shift;;
- -T) no_target_directory=true;;
+ -T) is_target_a_directory=never;;
--version) echo "$0 $scriptversion"; exit $?;;
- --) shift
- break;;
+ --) shift
+ break;;
- -*) echo "$0: invalid option: $1" >&2
- exit 1;;
+ -*) echo "$0: invalid option: $1" >&2
+ exit 1;;
*) break;;
esac
shift
done
+# We allow the use of options -d and -T together, by making -d
+# take the precedence; this is for compatibility with GNU install.
+
+if test -n "$dir_arg"; then
+ if test -n "$dst_arg"; then
+ echo "$0: target directory not allowed when installing a directory." >&2
+ exit 1
+ fi
+fi
+
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
# When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
@@ -208,6 +204,15 @@ if test $# -eq 0; then
fi
if test -z "$dir_arg"; then
+ if test $# -gt 1 || test "$is_target_a_directory" = always; then
+ if test ! -d "$dst_arg"; then
+ echo "$0: $dst_arg: Is not a directory." >&2
+ exit 1
+ fi
+ fi
+fi
+
+if test -z "$dir_arg"; then
do_exit='(exit $ret); exit $ret'
trap "ret=129; $do_exit" 1
trap "ret=130; $do_exit" 2
@@ -223,16 +228,16 @@ if test -z "$dir_arg"; then
*[0-7])
if test -z "$stripcmd"; then
- u_plus_rw=
+ u_plus_rw=
else
- u_plus_rw='% 200'
+ u_plus_rw='% 200'
fi
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
*)
if test -z "$stripcmd"; then
- u_plus_rw=
+ u_plus_rw=
else
- u_plus_rw=,u+rw
+ u_plus_rw=,u+rw
fi
cp_umask=$mode$u_plus_rw;;
esac
@@ -269,41 +274,15 @@ do
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
if test -d "$dst"; then
- if test -n "$no_target_directory"; then
- echo "$0: $dst_arg: Is a directory" >&2
- exit 1
+ if test "$is_target_a_directory" = never; then
+ echo "$0: $dst_arg: Is a directory" >&2
+ exit 1
fi
dstdir=$dst
dst=$dstdir/`basename "$src"`
dstdir_status=0
else
- # Prefer dirname, but fall back on a substitute if dirname fails.
- dstdir=`
- (dirname "$dst") 2>/dev/null ||
- expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$dst" : 'X\(//\)[^/]' \| \
- X"$dst" : 'X\(//\)$' \| \
- X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
- echo X"$dst" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'
- `
-
+ dstdir=`dirname "$dst"`
test -d "$dstdir"
dstdir_status=$?
fi
@@ -314,74 +293,74 @@ do
if test $dstdir_status != 0; then
case $posix_mkdir in
'')
- # Create intermediate dirs using mode 755 as modified by the umask.
- # This is like FreeBSD 'install' as of 1997-10-28.
- umask=`umask`
- case $stripcmd.$umask in
- # Optimize common cases.
- *[2367][2367]) mkdir_umask=$umask;;
- .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
-
- *[0-7])
- mkdir_umask=`expr $umask + 22 \
- - $umask % 100 % 40 + $umask % 20 \
- - $umask % 10 % 4 + $umask % 2
- `;;
- *) mkdir_umask=$umask,go-w;;
- esac
-
- # With -d, create the new directory with the user-specified mode.
- # Otherwise, rely on $mkdir_umask.
- if test -n "$dir_arg"; then
- mkdir_mode=-m$mode
- else
- mkdir_mode=
- fi
-
- posix_mkdir=false
- case $umask in
- *[123567][0-7][0-7])
- # POSIX mkdir -p sets u+wx bits regardless of umask, which
- # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
- ;;
- *)
- tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
- trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
-
- if (umask $mkdir_umask &&
- exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
- then
- if test -z "$dir_arg" || {
- # Check for POSIX incompatibilities with -m.
- # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
- # other-writable bit of parent directory when it shouldn't.
- # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
- ls_ld_tmpdir=`ls -ld "$tmpdir"`
- case $ls_ld_tmpdir in
- d????-?r-*) different_mode=700;;
- d????-?--*) different_mode=755;;
- *) false;;
- esac &&
- $mkdirprog -m$different_mode -p -- "$tmpdir" && {
- ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
- test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
- }
- }
- then posix_mkdir=:
- fi
- rmdir "$tmpdir/d" "$tmpdir"
- else
- # Remove any dirs left behind by ancient mkdir implementations.
- rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
- fi
- trap '' 0;;
- esac;;
+ # Create intermediate dirs using mode 755 as modified by the umask.
+ # This is like FreeBSD 'install' as of 1997-10-28.
+ umask=`umask`
+ case $stripcmd.$umask in
+ # Optimize common cases.
+ *[2367][2367]) mkdir_umask=$umask;;
+ .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+ *[0-7])
+ mkdir_umask=`expr $umask + 22 \
+ - $umask % 100 % 40 + $umask % 20 \
+ - $umask % 10 % 4 + $umask % 2
+ `;;
+ *) mkdir_umask=$umask,go-w;;
+ esac
+
+ # With -d, create the new directory with the user-specified mode.
+ # Otherwise, rely on $mkdir_umask.
+ if test -n "$dir_arg"; then
+ mkdir_mode=-m$mode
+ else
+ mkdir_mode=
+ fi
+
+ posix_mkdir=false
+ case $umask in
+ *[123567][0-7][0-7])
+ # POSIX mkdir -p sets u+wx bits regardless of umask, which
+ # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+ ;;
+ *)
+ tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+ if (umask $mkdir_umask &&
+ exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+ then
+ if test -z "$dir_arg" || {
+ # Check for POSIX incompatibilities with -m.
+ # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+ # other-writable bit of parent directory when it shouldn't.
+ # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+ ls_ld_tmpdir=`ls -ld "$tmpdir"`
+ case $ls_ld_tmpdir in
+ d????-?r-*) different_mode=700;;
+ d????-?--*) different_mode=755;;
+ *) false;;
+ esac &&
+ $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+ ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+ test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+ }
+ }
+ then posix_mkdir=:
+ fi
+ rmdir "$tmpdir/d" "$tmpdir"
+ else
+ # Remove any dirs left behind by ancient mkdir implementations.
+ rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+ fi
+ trap '' 0;;
+ esac;;
esac
if
$posix_mkdir && (
- umask $mkdir_umask &&
- $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+ umask $mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
)
then :
else
@@ -391,53 +370,51 @@ do
# directory the slow way, step by step, checking for races as we go.
case $dstdir in
- /*) prefix='/';;
- [-=\(\)!]*) prefix='./';;
- *) prefix='';;
+ /*) prefix='/';;
+ [-=\(\)!]*) prefix='./';;
+ *) prefix='';;
esac
- eval "$initialize_posix_glob"
-
oIFS=$IFS
IFS=/
- $posix_glob set -f
+ set -f
set fnord $dstdir
shift
- $posix_glob set +f
+ set +f
IFS=$oIFS
prefixes=
for d
do
- test X"$d" = X && continue
-
- prefix=$prefix$d
- if test -d "$prefix"; then
- prefixes=
- else
- if $posix_mkdir; then
- (umask=$mkdir_umask &&
- $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
- # Don't fail if two instances are running concurrently.
- test -d "$prefix" || exit 1
- else
- case $prefix in
- *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
- *) qprefix=$prefix;;
- esac
- prefixes="$prefixes '$qprefix'"
- fi
- fi
- prefix=$prefix/
+ test X"$d" = X && continue
+
+ prefix=$prefix$d
+ if test -d "$prefix"; then
+ prefixes=
+ else
+ if $posix_mkdir; then
+ (umask=$mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+ # Don't fail if two instances are running concurrently.
+ test -d "$prefix" || exit 1
+ else
+ case $prefix in
+ *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+ *) qprefix=$prefix;;
+ esac
+ prefixes="$prefixes '$qprefix'"
+ fi
+ fi
+ prefix=$prefix/
done
if test -n "$prefixes"; then
- # Don't fail if two instances are running concurrently.
- (umask $mkdir_umask &&
- eval "\$doit_exec \$mkdirprog $prefixes") ||
- test -d "$dstdir" || exit 1
- obsolete_mkdir_used=true
+ # Don't fail if two instances are running concurrently.
+ (umask $mkdir_umask &&
+ eval "\$doit_exec \$mkdirprog $prefixes") ||
+ test -d "$dstdir" || exit 1
+ obsolete_mkdir_used=true
fi
fi
fi
@@ -472,15 +449,12 @@ do
# If -C, don't bother to copy if it wouldn't change the file.
if $copy_on_change &&
- old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
- new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
-
- eval "$initialize_posix_glob" &&
- $posix_glob set -f &&
+ old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
+ new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
+ set -f &&
set X $old && old=:$2:$4:$5:$6 &&
set X $new && new=:$2:$4:$5:$6 &&
- $posix_glob set +f &&
-
+ set +f &&
test "$old" = "$new" &&
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
then
@@ -493,24 +467,24 @@ do
# to itself, or perhaps because mv is so ancient that it does not
# support -f.
{
- # Now remove or move aside any old file at destination location.
- # We try this two ways since rm can't unlink itself on some
- # systems and the destination file might be busy for other
- # reasons. In this case, the final cleanup might fail but the new
- # file should still install successfully.
- {
- test ! -f "$dst" ||
- $doit $rmcmd -f "$dst" 2>/dev/null ||
- { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
- { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
- } ||
- { echo "$0: cannot unlink or rename $dst" >&2
- (exit 1); exit 1
- }
- } &&
-
- # Now rename the file to the real destination.
- $doit $mvcmd "$dsttmp" "$dst"
+ # Now remove or move aside any old file at destination location.
+ # We try this two ways since rm can't unlink itself on some
+ # systems and the destination file might be busy for other
+ # reasons. In this case, the final cleanup might fail but the new
+ # file should still install successfully.
+ {
+ test ! -f "$dst" ||
+ $doit $rmcmd -f "$dst" 2>/dev/null ||
+ { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+ { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+ } ||
+ { echo "$0: cannot unlink or rename $dst" >&2
+ (exit 1); exit 1
+ }
+ } &&
+
+ # Now rename the file to the real destination.
+ $doit $mvcmd "$dsttmp" "$dst"
}
fi || exit 1
diff --git a/autotools/missing b/autotools/missing
index db98974f..f62bbae3 100755
--- a/autotools/missing
+++ b/autotools/missing
@@ -3,7 +3,7 @@
scriptversion=2013-10-28.13; # UTC
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Copyright (C) 1996-2014 Free Software Foundation, Inc.
# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify
diff --git a/autotools/root-test-driver b/autotools/root-test-driver
new file mode 100755
index 00000000..66bf7ebb
--- /dev/null
+++ b/autotools/root-test-driver
@@ -0,0 +1,3 @@
+#!/bin/sh
+# -E to keep the environment variables needed to run the tests.
+exec sudo -E "$@"
diff --git a/autotools/test-driver b/autotools/test-driver
index d3060566..8e575b01 100755
--- a/autotools/test-driver
+++ b/autotools/test-driver
@@ -3,7 +3,7 @@
scriptversion=2013-07-13.22; # UTC
-# Copyright (C) 2011-2013 Free Software Foundation, Inc.
+# Copyright (C) 2011-2014 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -106,11 +106,14 @@ trap "st=143; $do_exit" 15
# Test script is run here.
"$@" >$log_file 2>&1
estatus=$?
+
if test $enable_hard_errors = no && test $estatus -eq 99; then
- estatus=1
+ tweaked_estatus=1
+else
+ tweaked_estatus=$estatus
fi
-case $estatus:$expect_failure in
+case $tweaked_estatus:$expect_failure in
0:yes) col=$red res=XPASS recheck=yes gcopy=yes;;
0:*) col=$grn res=PASS recheck=no gcopy=no;;
77:*) col=$blu res=SKIP recheck=no gcopy=yes;;
@@ -119,6 +122,12 @@ case $estatus:$expect_failure in
*:*) col=$red res=FAIL recheck=yes gcopy=yes;;
esac
+# Report the test outcome and exit status in the logs, so that one can
+# know whether the test passed or failed simply by looking at the '.log'
+# file, without the need of also peaking into the corresponding '.trs'
+# file (automake bug#11814).
+echo "$res $test_name (exit status: $estatus)" >>$log_file
+
# Report outcome to console.
echo "${col}${res}${std}: $test_name"
diff --git a/configure b/configure
index 72647b0a..5e4b3d2e 100755
--- a/configure
+++ b/configure
@@ -585,7 +585,7 @@ PACKAGE_STRING='breakpad 0.1'
PACKAGE_BUGREPORT='google-breakpad-dev@googlegroups.com'
PACKAGE_URL=''
-ac_unique_file="README"
+ac_unique_file="README.md"
# Factoring default headers for most tests.
ac_includes_default="\
#include <stdio.h>
@@ -626,24 +626,38 @@ ac_subst_vars='am__EXEEXT_FALSE
am__EXEEXT_TRUE
LTLIBOBJS
LIBOBJS
+TESTS_AS_ROOT_FALSE
+TESTS_AS_ROOT_TRUE
+RUST_DEMANGLE_LIBS
+RUST_DEMANGLE_CFLAGS
SELFTEST_FALSE
SELFTEST_TRUE
+GTEST_LIBS
+GTEST_CFLAGS
+GMOCK_LIBS
+GMOCK_CFLAGS
+SYSTEM_TEST_LIBS_FALSE
+SYSTEM_TEST_LIBS_TRUE
DISABLE_TOOLS_FALSE
DISABLE_TOOLS_TRUE
DISABLE_PROCESSOR_FALSE
DISABLE_PROCESSOR_TRUE
+X86_HOST_FALSE
+X86_HOST_TRUE
ANDROID_HOST_FALSE
ANDROID_HOST_TRUE
LINUX_HOST_FALSE
LINUX_HOST_TRUE
+WARN_CXXFLAGS
+HAVE_CXX11
+HAVE_GETCONTEXT_FALSE
+HAVE_GETCONTEXT_TRUE
PTHREAD_CFLAGS
PTHREAD_LIBS
PTHREAD_CC
ax_pthread_config
EGREP
GREP
-GCC_FALSE
-GCC_TRUE
RANLIB
am__fastdepCXX_FALSE
am__fastdepCXX_TRUE
@@ -674,6 +688,8 @@ CPPFLAGS
LDFLAGS
CFLAGS
CC
+ac_ct_AR
+AR
MAINT
MAINTAINER_MODE_FALSE
MAINTAINER_MODE_TRUE
@@ -760,7 +776,10 @@ enable_m32
enable_largefile
enable_processor
enable_tools
+enable_system_test_libs
enable_selftest
+with_rust_demangle
+with_tests_as_root
'
ac_precious_vars='build_alias
host_alias
@@ -775,7 +794,13 @@ CCASFLAGS
CPP
CXX
CXXFLAGS
-CCC'
+CCC
+GMOCK_CFLAGS
+GMOCK_LIBS
+GTEST_CFLAGS
+GTEST_LIBS
+RUST_DEMANGLE_CFLAGS
+RUST_DEMANGLE_LIBS'
# Initialize some variables set by options.
@@ -1407,9 +1432,23 @@ Optional Features:
--disable-largefile omit support for large files
--disable-processor Don't build processor library (default is no)
--disable-tools Don't build tool binaries (default is no)
+ --enable-system-test-libs
+ Use gtest/gmock/etc... from the system instead of
+ the local copies (default is local)
--enable-selftest Run extra tests with "make check" (may conflict with
optimizations) (default is no)
+Optional Packages:
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --with-rust-demangle=/path/to/rust-demangle-capi
+ Link against the rust-demangle library to demangle
+ Rust language symbols during symbol dumping (default
+ is no) Pass the path to the crate root.
+ --with-tests-as-root Run the tests as root. Use this on platforms like
+ travis-ci.org that require root privileges to use
+ ptrace (default is no)
+
Some influential environment variables:
CC C compiler command
CFLAGS C compiler flags
@@ -1423,6 +1462,16 @@ Some influential environment variables:
CPP C preprocessor
CXX C++ compiler command
CXXFLAGS C++ compiler flags
+ GMOCK_CFLAGS
+ Compiler flags for gmock
+ GMOCK_LIBS Linker flags for gmock
+ GTEST_CFLAGS
+ Compiler flags for gtest
+ GTEST_LIBS Linker flags for gtest
+ RUST_DEMANGLE_CFLAGS
+ Compiler flags for rust-demangle
+ RUST_DEMANGLE_LIBS
+ Linker flags for rust-demangle
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
@@ -1826,6 +1875,73 @@ $as_echo "$ac_res" >&6; }
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_c_check_header_compile
+
+# ac_fn_c_check_func LINENO FUNC VAR
+# ----------------------------------
+# Tests whether FUNC exists, setting the cache variable VAR accordingly
+ac_fn_c_check_func ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $2 innocuous_$2
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $2 (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $2
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $2 ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub_$2 || defined __stub___$2
+choke me
+#endif
+
+int
+main ()
+{
+return $2 ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_func
cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
@@ -2281,7 +2397,7 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
-am__api_version='1.14'
+am__api_version='1.15'
# Find a good install program. We prefer a C program (faster),
# so one script is as good as another. But avoid the broken or
@@ -2453,8 +2569,8 @@ test "$program_suffix" != NONE &&
ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
+# Expand $ac_aux_dir to an absolute path.
+am_aux_dir=`cd "$ac_aux_dir" && pwd`
if test x"${MISSING+set}" != xset; then
case $am_aux_dir in
@@ -2473,7 +2589,7 @@ else
$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
fi
-if test x"${install_sh}" != xset; then
+if test x"${install_sh+set}" != xset; then
case $am_aux_dir in
*\ * | *\ *)
install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
@@ -2801,8 +2917,8 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
mkdir_p='$(MKDIR_P)'
-# We need awk for the "check" target. The system "awk" is bad on
-# some platforms.
+# We need awk for the "check" target (and possibly the TAP driver). The
+# system "awk" is bad on some platforms.
# Always define AMTAR for backward compatibility. Yes, it's still used
# in the wild :-( We should find a proper way to deprecate it ...
AMTAR='$${TAR-tar}'
@@ -2975,6 +3091,7 @@ END
as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5
fi
fi
+
ac_config_headers="$ac_config_headers src/config.h"
@@ -4040,6 +4157,178 @@ else
fi
+
+if test -n "$ac_tool_prefix"; then
+ for ac_prog in ar lib "link -lib"
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AR+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$AR"; then
+ ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
+$as_echo "$AR" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$AR" && break
+ done
+fi
+if test -z "$AR"; then
+ ac_ct_AR=$AR
+ for ac_prog in ar lib "link -lib"
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_AR+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_AR"; then
+ ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_AR="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
+$as_echo "$ac_ct_AR" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_AR" && break
+done
+
+ if test "x$ac_ct_AR" = x; then
+ AR="false"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ AR=$ac_ct_AR
+ fi
+fi
+
+: ${AR=ar}
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the archiver ($AR) interface" >&5
+$as_echo_n "checking the archiver ($AR) interface... " >&6; }
+if ${am_cv_ar_interface+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ am_cv_ar_interface=ar
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int some_variable = 0;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&5'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5
+ (eval $am_ar_try) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ if test "$ac_status" -eq 0; then
+ am_cv_ar_interface=ar
+ else
+ am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&5'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5
+ (eval $am_ar_try) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ if test "$ac_status" -eq 0; then
+ am_cv_ar_interface=lib
+ else
+ am_cv_ar_interface=unknown
+ fi
+ fi
+ rm -f conftest.lib libconftest.a
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_ar_interface" >&5
+$as_echo "$am_cv_ar_interface" >&6; }
+
+case $am_cv_ar_interface in
+ar)
+ ;;
+lib)
+ # Microsoft lib, so override with the ar-lib wrapper script.
+ # FIXME: It is wrong to rewrite AR.
+ # But if we don't then we get into trouble of one sort or another.
+ # A longer-term fix would be to have automake use am__AR in this case,
+ # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something
+ # similar.
+ AR="$am_aux_dir/ar-lib $AR"
+ ;;
+unknown)
+ as_fn_error $? "could not determine $AR interface" "$LINENO" 5
+ ;;
+esac
+
# By default we simply use the C compiler to build assembly code.
test "${CCAS+set}" = set || CCAS=$CC
@@ -5514,14 +5803,6 @@ else
RANLIB="$ac_cv_prog_RANLIB"
fi
- if test "$GCC" = yes; then
- GCC_TRUE=
- GCC_FALSE='#'
-else
- GCC_TRUE='#'
- GCC_FALSE=
-fi
- # let the Makefile know if we're gcc
# Check whether --enable-m32 was given.
if test "${enable_m32+set}" = set; then :
@@ -5544,7 +5825,6 @@ fi
-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
if ${ac_cv_path_GREP+:} false; then :
@@ -5812,7 +6092,7 @@ else
We can't simply define LARGE_OFF_T to be 9223372036854775807,
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
@@ -5858,7 +6138,7 @@ else
We can't simply define LARGE_OFF_T to be 9223372036854775807,
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
@@ -5882,7 +6162,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
We can't simply define LARGE_OFF_T to be 9223372036854775807,
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
@@ -5927,7 +6207,7 @@ else
We can't simply define LARGE_OFF_T to be 9223372036854775807,
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
@@ -5951,7 +6231,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
We can't simply define LARGE_OFF_T to be 9223372036854775807,
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
@@ -5987,104 +6267,6 @@ rm -rf conftest*
fi
-# ===========================================================================
-# http://www.nongnu.org/autoconf-archive/ax_pthread.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-# AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
-#
-# DESCRIPTION
-#
-# This macro figures out how to build C programs using POSIX threads. It
-# sets the PTHREAD_LIBS output variable to the threads library and linker
-# flags, and the PTHREAD_CFLAGS output variable to any special C compiler
-# flags that are needed. (The user can also force certain compiler
-# flags/libs to be tested by setting these environment variables.)
-#
-# Also sets PTHREAD_CC to any special C compiler that is needed for
-# multi-threaded programs (defaults to the value of CC otherwise). (This
-# is necessary on AIX to use the special cc_r compiler alias.)
-#
-# NOTE: You are assumed to not only compile your program with these flags,
-# but also link it with them as well. e.g. you should link with
-# $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS
-#
-# If you are only building threads programs, you may wish to use these
-# variables in your default LIBS, CFLAGS, and CC:
-#
-# LIBS="$PTHREAD_LIBS $LIBS"
-# CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
-# CC="$PTHREAD_CC"
-#
-# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant
-# has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name
-# (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
-#
-# ACTION-IF-FOUND is a list of shell commands to run if a threads library
-# is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it
-# is not found. If ACTION-IF-FOUND is not specified, the default action
-# will define HAVE_PTHREAD.
-#
-# Please let the authors know if this macro fails on any platform, or if
-# you have any other suggestions or comments. This macro was based on work
-# by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help
-# from M. Frigo), as well as ac_pthread and hb_pthread macros posted by
-# Alejandro Forero Cuervo to the autoconf macro repository. We are also
-# grateful for the helpful feedback of numerous users.
-#
-# LICENSE
-#
-# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
-#
-# This program is free software: you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation, either version 3 of the License, or (at your
-# option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
-# Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-# As a special exception, the respective Autoconf Macro's copyright owner
-# gives unlimited permission to copy, distribute and modify the configure
-# scripts that are the output of Autoconf when processing the Macro. You
-# need not follow the terms of the GNU General Public License when using
-# or distributing such scripts, even though portions of the text of the
-# Macro appear in them. The GNU General Public License (GPL) does govern
-# all other use of the material that constitutes the Autoconf Macro.
-#
-# This special exception to the GPL applies to versions of the Autoconf
-# Macro released by the Autoconf Archive. When you make and distribute a
-# modified version of the Autoconf Macro, you may extend this special
-# exception to the GPL to apply to your modified version as well.
-
-#serial 6
-
-# This is what autoupdate's m4 run will expand. It fires
-# the warning (with _au_warn_XXX), outputs it into the
-# updated configure.ac (with AC_DIAGNOSE), and then outputs
-# the replacement expansion.
-
-
-# This is an auxiliary macro that is also run when
-# autoupdate runs m4. It simply calls m4_warning, but
-# we need a wrapper so that each warning is emitted only
-# once. We break the quoting in m4_warning's argument in
-# order to expand this macro's arguments, not AU_DEFUN's.
-
-
-# Finally, this is the expansion that is picked up by
-# autoconf. It tells the user to run autoupdate, and
-# then outputs the replacement expansion. We do not care
-# about autoupdate's warning because that contains
-# information on what to do *after* running autoupdate.
-
@@ -6457,18 +6639,869 @@ fi
done
-for ac_header in a.out.h
+for ac_header in a.out.h sys/random.h
do :
- ac_fn_c_check_header_mongrel "$LINENO" "a.out.h" "ac_cv_header_a_out_h" "$ac_includes_default"
-if test "x$ac_cv_header_a_out_h" = xyes; then :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
cat >>confdefs.h <<_ACEOF
-#define HAVE_A_OUT_H 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+for ac_func in arc4random getcontext getrandom
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+ if test "x$ac_cv_func_getcontext" = xyes; then
+ HAVE_GETCONTEXT_TRUE=
+ HAVE_GETCONTEXT_FALSE='#'
+else
+ HAVE_GETCONTEXT_TRUE='#'
+ HAVE_GETCONTEXT_FALSE=
+fi
+
+
+
+ ax_cxx_compile_cxx11_required=true
+ ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+ ac_success=no
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features by default" >&5
+$as_echo_n "checking whether $CXX supports C++11 features by default... " >&6; }
+if ${ax_cv_cxx_compile_cxx11+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+// If the compiler admits that it is not ready for C++11, why torture it?
+// Hopefully, this will speed up the test.
+
+#ifndef __cplusplus
+
+#error "This is not a C++ compiler"
+
+#elif __cplusplus < 201103L
+
+#error "This is not a C++11 compiler"
+
+#else
+
+namespace cxx11
+{
+
+ namespace test_static_assert
+ {
+
+ template <typename T>
+ struct check
+ {
+ static_assert(sizeof(int) <= sizeof(T), "not big enough");
+ };
+
+ }
+
+ namespace test_final_override
+ {
+
+ struct Base
+ {
+ virtual void f() {}
+ };
+
+ struct Derived : public Base
+ {
+ virtual void f() override {}
+ };
+
+ }
+
+ namespace test_double_right_angle_brackets
+ {
+
+ template < typename T >
+ struct check {};
+
+ typedef check<void> single_type;
+ typedef check<check<void>> double_type;
+ typedef check<check<check<void>>> triple_type;
+ typedef check<check<check<check<void>>>> quadruple_type;
+
+ }
+
+ namespace test_decltype
+ {
+
+ int
+ f()
+ {
+ int a = 1;
+ decltype(a) b = 2;
+ return a + b;
+ }
+
+ }
+
+ namespace test_type_deduction
+ {
+
+ template < typename T1, typename T2 >
+ struct is_same
+ {
+ static const bool value = false;
+ };
+
+ template < typename T >
+ struct is_same<T, T>
+ {
+ static const bool value = true;
+ };
+
+ template < typename T1, typename T2 >
+ auto
+ add(T1 a1, T2 a2) -> decltype(a1 + a2)
+ {
+ return a1 + a2;
+ }
+
+ int
+ test(const int c, volatile int v)
+ {
+ static_assert(is_same<int, decltype(0)>::value == true, "");
+ static_assert(is_same<int, decltype(c)>::value == false, "");
+ static_assert(is_same<int, decltype(v)>::value == false, "");
+ auto ac = c;
+ auto av = v;
+ auto sumi = ac + av + 'x';
+ auto sumf = ac + av + 1.0;
+ static_assert(is_same<int, decltype(ac)>::value == true, "");
+ static_assert(is_same<int, decltype(av)>::value == true, "");
+ static_assert(is_same<int, decltype(sumi)>::value == true, "");
+ static_assert(is_same<int, decltype(sumf)>::value == false, "");
+ static_assert(is_same<int, decltype(add(c, v))>::value == true, "");
+ return (sumf > 0.0) ? sumi : add(c, v);
+ }
+
+ }
+
+ namespace test_noexcept
+ {
+
+ int f() { return 0; }
+ int g() noexcept { return 0; }
+
+ static_assert(noexcept(f()) == false, "");
+ static_assert(noexcept(g()) == true, "");
+
+ }
+
+ namespace test_constexpr
+ {
+
+ template < typename CharT >
+ unsigned long constexpr
+ strlen_c_r(const CharT *const s, const unsigned long acc) noexcept
+ {
+ return *s ? strlen_c_r(s + 1, acc + 1) : acc;
+ }
+
+ template < typename CharT >
+ unsigned long constexpr
+ strlen_c(const CharT *const s) noexcept
+ {
+ return strlen_c_r(s, 0UL);
+ }
+
+ static_assert(strlen_c("") == 0UL, "");
+ static_assert(strlen_c("1") == 1UL, "");
+ static_assert(strlen_c("example") == 7UL, "");
+ static_assert(strlen_c("another\0example") == 7UL, "");
+
+ }
+
+ namespace test_rvalue_references
+ {
+
+ template < int N >
+ struct answer
+ {
+ static constexpr int value = N;
+ };
+
+ answer<1> f(int&) { return answer<1>(); }
+ answer<2> f(const int&) { return answer<2>(); }
+ answer<3> f(int&&) { return answer<3>(); }
+
+ void
+ test()
+ {
+ int i = 0;
+ const int c = 0;
+ static_assert(decltype(f(i))::value == 1, "");
+ static_assert(decltype(f(c))::value == 2, "");
+ static_assert(decltype(f(0))::value == 3, "");
+ }
+
+ }
+
+ namespace test_uniform_initialization
+ {
+
+ struct test
+ {
+ static const int zero {};
+ static const int one {1};
+ };
+
+ static_assert(test::zero == 0, "");
+ static_assert(test::one == 1, "");
+
+ }
+
+ namespace test_lambdas
+ {
+
+ void
+ test1()
+ {
+ auto lambda1 = [](){};
+ auto lambda2 = lambda1;
+ lambda1();
+ lambda2();
+ }
+
+ int
+ test2()
+ {
+ auto a = [](int i, int j){ return i + j; }(1, 2);
+ auto b = []() -> int { return '0'; }();
+ auto c = [=](){ return a + b; }();
+ auto d = [&](){ return c; }();
+ auto e = [a, &b](int x) mutable {
+ const auto identity = [](int y){ return y; };
+ for (auto i = 0; i < a; ++i)
+ a += b--;
+ return x + identity(a + b);
+ }(0);
+ return a + b + c + d + e;
+ }
+
+ int
+ test3()
+ {
+ const auto nullary = [](){ return 0; };
+ const auto unary = [](int x){ return x; };
+ using nullary_t = decltype(nullary);
+ using unary_t = decltype(unary);
+ const auto higher1st = [](nullary_t f){ return f(); };
+ const auto higher2nd = [unary](nullary_t f1){
+ return [unary, f1](unary_t f2){ return f2(unary(f1())); };
+ };
+ return higher1st(nullary) + higher2nd(nullary)(unary);
+ }
+
+ }
+
+ namespace test_variadic_templates
+ {
+
+ template <int...>
+ struct sum;
+
+ template <int N0, int... N1toN>
+ struct sum<N0, N1toN...>
+ {
+ static constexpr auto value = N0 + sum<N1toN...>::value;
+ };
+
+ template <>
+ struct sum<>
+ {
+ static constexpr auto value = 0;
+ };
+
+ static_assert(sum<>::value == 0, "");
+ static_assert(sum<1>::value == 1, "");
+ static_assert(sum<23>::value == 23, "");
+ static_assert(sum<1, 2>::value == 3, "");
+ static_assert(sum<5, 5, 11>::value == 21, "");
+ static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, "");
+
+ }
+
+ // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae
+ // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function
+ // because of this.
+ namespace test_template_alias_sfinae
+ {
+
+ struct foo {};
+
+ template<typename T>
+ using member = typename T::member_type;
+
+ template<typename T>
+ void func(...) {}
+
+ template<typename T>
+ void func(member<T>*) {}
+
+ void test();
+
+ void test() { func<foo>(0); }
+
+ }
+
+} // namespace cxx11
+
+#endif // __cplusplus >= 201103L
+
+
+
_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ ax_cv_cxx_compile_cxx11=yes
+else
+ ax_cv_cxx_compile_cxx11=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cxx_compile_cxx11" >&5
+$as_echo "$ax_cv_cxx_compile_cxx11" >&6; }
+ if test x$ax_cv_cxx_compile_cxx11 = xyes; then
+ ac_success=yes
+ fi
+
+
+
+ if test x$ac_success = xno; then
+ for switch in -std=c++11 -std=c++0x +std=c++11 "-h std=c++11"; do
+ cachevar=`$as_echo "ax_cv_cxx_compile_cxx11_$switch" | $as_tr_sh`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features with $switch" >&5
+$as_echo_n "checking whether $CXX supports C++11 features with $switch... " >&6; }
+if eval \${$cachevar+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="$CXXFLAGS $switch"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+// If the compiler admits that it is not ready for C++11, why torture it?
+// Hopefully, this will speed up the test.
+
+#ifndef __cplusplus
+
+#error "This is not a C++ compiler"
+
+#elif __cplusplus < 201103L
+
+#error "This is not a C++11 compiler"
+
+#else
+
+namespace cxx11
+{
+
+ namespace test_static_assert
+ {
+
+ template <typename T>
+ struct check
+ {
+ static_assert(sizeof(int) <= sizeof(T), "not big enough");
+ };
+
+ }
+
+ namespace test_final_override
+ {
+
+ struct Base
+ {
+ virtual void f() {}
+ };
+
+ struct Derived : public Base
+ {
+ virtual void f() override {}
+ };
+
+ }
+
+ namespace test_double_right_angle_brackets
+ {
+
+ template < typename T >
+ struct check {};
+
+ typedef check<void> single_type;
+ typedef check<check<void>> double_type;
+ typedef check<check<check<void>>> triple_type;
+ typedef check<check<check<check<void>>>> quadruple_type;
+
+ }
+
+ namespace test_decltype
+ {
+
+ int
+ f()
+ {
+ int a = 1;
+ decltype(a) b = 2;
+ return a + b;
+ }
+
+ }
+
+ namespace test_type_deduction
+ {
+
+ template < typename T1, typename T2 >
+ struct is_same
+ {
+ static const bool value = false;
+ };
+
+ template < typename T >
+ struct is_same<T, T>
+ {
+ static const bool value = true;
+ };
+
+ template < typename T1, typename T2 >
+ auto
+ add(T1 a1, T2 a2) -> decltype(a1 + a2)
+ {
+ return a1 + a2;
+ }
+
+ int
+ test(const int c, volatile int v)
+ {
+ static_assert(is_same<int, decltype(0)>::value == true, "");
+ static_assert(is_same<int, decltype(c)>::value == false, "");
+ static_assert(is_same<int, decltype(v)>::value == false, "");
+ auto ac = c;
+ auto av = v;
+ auto sumi = ac + av + 'x';
+ auto sumf = ac + av + 1.0;
+ static_assert(is_same<int, decltype(ac)>::value == true, "");
+ static_assert(is_same<int, decltype(av)>::value == true, "");
+ static_assert(is_same<int, decltype(sumi)>::value == true, "");
+ static_assert(is_same<int, decltype(sumf)>::value == false, "");
+ static_assert(is_same<int, decltype(add(c, v))>::value == true, "");
+ return (sumf > 0.0) ? sumi : add(c, v);
+ }
+
+ }
+
+ namespace test_noexcept
+ {
+
+ int f() { return 0; }
+ int g() noexcept { return 0; }
+
+ static_assert(noexcept(f()) == false, "");
+ static_assert(noexcept(g()) == true, "");
+
+ }
+
+ namespace test_constexpr
+ {
+
+ template < typename CharT >
+ unsigned long constexpr
+ strlen_c_r(const CharT *const s, const unsigned long acc) noexcept
+ {
+ return *s ? strlen_c_r(s + 1, acc + 1) : acc;
+ }
+
+ template < typename CharT >
+ unsigned long constexpr
+ strlen_c(const CharT *const s) noexcept
+ {
+ return strlen_c_r(s, 0UL);
+ }
+
+ static_assert(strlen_c("") == 0UL, "");
+ static_assert(strlen_c("1") == 1UL, "");
+ static_assert(strlen_c("example") == 7UL, "");
+ static_assert(strlen_c("another\0example") == 7UL, "");
+
+ }
+
+ namespace test_rvalue_references
+ {
+
+ template < int N >
+ struct answer
+ {
+ static constexpr int value = N;
+ };
+
+ answer<1> f(int&) { return answer<1>(); }
+ answer<2> f(const int&) { return answer<2>(); }
+ answer<3> f(int&&) { return answer<3>(); }
+
+ void
+ test()
+ {
+ int i = 0;
+ const int c = 0;
+ static_assert(decltype(f(i))::value == 1, "");
+ static_assert(decltype(f(c))::value == 2, "");
+ static_assert(decltype(f(0))::value == 3, "");
+ }
+
+ }
+
+ namespace test_uniform_initialization
+ {
+
+ struct test
+ {
+ static const int zero {};
+ static const int one {1};
+ };
+
+ static_assert(test::zero == 0, "");
+ static_assert(test::one == 1, "");
+
+ }
+
+ namespace test_lambdas
+ {
+ void
+ test1()
+ {
+ auto lambda1 = [](){};
+ auto lambda2 = lambda1;
+ lambda1();
+ lambda2();
+ }
+
+ int
+ test2()
+ {
+ auto a = [](int i, int j){ return i + j; }(1, 2);
+ auto b = []() -> int { return '0'; }();
+ auto c = [=](){ return a + b; }();
+ auto d = [&](){ return c; }();
+ auto e = [a, &b](int x) mutable {
+ const auto identity = [](int y){ return y; };
+ for (auto i = 0; i < a; ++i)
+ a += b--;
+ return x + identity(a + b);
+ }(0);
+ return a + b + c + d + e;
+ }
+
+ int
+ test3()
+ {
+ const auto nullary = [](){ return 0; };
+ const auto unary = [](int x){ return x; };
+ using nullary_t = decltype(nullary);
+ using unary_t = decltype(unary);
+ const auto higher1st = [](nullary_t f){ return f(); };
+ const auto higher2nd = [unary](nullary_t f1){
+ return [unary, f1](unary_t f2){ return f2(unary(f1())); };
+ };
+ return higher1st(nullary) + higher2nd(nullary)(unary);
+ }
+
+ }
+
+ namespace test_variadic_templates
+ {
+
+ template <int...>
+ struct sum;
+
+ template <int N0, int... N1toN>
+ struct sum<N0, N1toN...>
+ {
+ static constexpr auto value = N0 + sum<N1toN...>::value;
+ };
+
+ template <>
+ struct sum<>
+ {
+ static constexpr auto value = 0;
+ };
+
+ static_assert(sum<>::value == 0, "");
+ static_assert(sum<1>::value == 1, "");
+ static_assert(sum<23>::value == 23, "");
+ static_assert(sum<1, 2>::value == 3, "");
+ static_assert(sum<5, 5, 11>::value == 21, "");
+ static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, "");
+
+ }
+
+ // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae
+ // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function
+ // because of this.
+ namespace test_template_alias_sfinae
+ {
+
+ struct foo {};
+
+ template<typename T>
+ using member = typename T::member_type;
+
+ template<typename T>
+ void func(...) {}
+
+ template<typename T>
+ void func(member<T>*) {}
+
+ void test();
+
+ void test() { func<foo>(0); }
+
+ }
+
+} // namespace cxx11
+
+#endif // __cplusplus >= 201103L
+
+
+
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ eval $cachevar=yes
+else
+ eval $cachevar=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ CXXFLAGS="$ac_save_CXXFLAGS"
+fi
+eval ac_res=\$$cachevar
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ if eval test x\$$cachevar = xyes; then
+ CXXFLAGS="$CXXFLAGS $switch"
+ ac_success=yes
+ break
+ fi
+ done
+ fi
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ if test x$ax_cxx_compile_cxx11_required = xtrue; then
+ if test x$ac_success = xno; then
+ as_fn_error $? "*** A compiler with support for C++11 language features is required." "$LINENO" 5
+ fi
+ else
+ if test x$ac_success = xno; then
+ HAVE_CXX11=0
+ { $as_echo "$as_me:${as_lineno-$LINENO}: No compiler with C++11 support was found" >&5
+$as_echo "$as_me: No compiler with C++11 support was found" >&6;}
+ else
+ HAVE_CXX11=1
+
+$as_echo "#define HAVE_CXX11 1" >>confdefs.h
+
+ fi
+
+
+ fi
+
+
+WARN_CXXFLAGS=
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts -Werror=unknown-warning-option" >&5
+$as_echo_n "checking whether C++ compiler accepts -Werror=unknown-warning-option... " >&6; }
+if ${ax_cv_check_cxxflags___Werror_unknown_warning_option+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ ax_check_save_flags=$CXXFLAGS
+ CXXFLAGS="$CXXFLAGS -Werror=unknown-warning-option"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ ax_cv_check_cxxflags___Werror_unknown_warning_option=yes
+else
+ ax_cv_check_cxxflags___Werror_unknown_warning_option=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ CXXFLAGS=$ax_check_save_flags
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cxxflags___Werror_unknown_warning_option" >&5
+$as_echo "$ax_cv_check_cxxflags___Werror_unknown_warning_option" >&6; }
+if test "x$ax_cv_check_cxxflags___Werror_unknown_warning_option" = xyes; then :
+
+ ax_compiler_flags_test="-Werror=unknown-warning-option"
+
+else
+
+ ax_compiler_flags_test=""
+
+fi
+
+
+
+
+
+for flag in -Wmissing-braces -Wnon-virtual-dtor -Woverloaded-virtual -Wreorder -Wsign-compare -Wunused-local-typedefs -Wunused-variable -Wvla ; do
+ as_CACHEVAR=`$as_echo "ax_cv_check_cxxflags_${ax_compiler_flags_test}_$flag" | $as_tr_sh`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts $flag" >&5
+$as_echo_n "checking whether C++ compiler accepts $flag... " >&6; }
+if eval \${$as_CACHEVAR+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ ax_check_save_flags=$CXXFLAGS
+ CXXFLAGS="$CXXFLAGS ${ax_compiler_flags_test} $flag"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ eval "$as_CACHEVAR=yes"
+else
+ eval "$as_CACHEVAR=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ CXXFLAGS=$ax_check_save_flags
+fi
+eval ac_res=\$$as_CACHEVAR
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then :
+
+if ${WARN_CXXFLAGS+:} false; then :
+
+ case " $WARN_CXXFLAGS " in #(
+ *" $flag "*) :
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: : WARN_CXXFLAGS already contains \$flag"; } >&5
+ (: WARN_CXXFLAGS already contains $flag) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } ;; #(
+ *) :
+
+ as_fn_append WARN_CXXFLAGS " $flag"
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: : WARN_CXXFLAGS=\"\$WARN_CXXFLAGS\""; } >&5
+ (: WARN_CXXFLAGS="$WARN_CXXFLAGS") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ ;;
+esac
+
+else
+
+ WARN_CXXFLAGS=$flag
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: : WARN_CXXFLAGS=\"\$WARN_CXXFLAGS\""; } >&5
+ (: WARN_CXXFLAGS="$WARN_CXXFLAGS") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+
+fi
+
+else
+ :
fi
done
+as_fn_append WARN_CXXFLAGS " -Werror"
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for O_CLOEXEC defined in fcntl.h" >&5
+$as_echo_n "checking for O_CLOEXEC defined in fcntl.h... " >&6; }
+if ${ac_cv_defined_O_CLOEXEC_fcntl_h+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <fcntl.h>
+int
+main ()
+{
+
+ #ifdef O_CLOEXEC
+ int ok;
+ #else
+ choke me
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_defined_O_CLOEXEC_fcntl_h=yes
+else
+ ac_cv_defined_O_CLOEXEC_fcntl_h=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_defined_O_CLOEXEC_fcntl_h" >&5
+$as_echo "$ac_cv_defined_O_CLOEXEC_fcntl_h" >&6; }
+if test $ac_cv_defined_O_CLOEXEC_fcntl_h != "no"; then :
+
+else
+
+$as_echo "#define O_CLOEXEC 0" >>confdefs.h
+
+fi
# Only build Linux client libs when compiling for Linux
case $host in
@@ -6500,6 +7533,21 @@ else
fi
+# Some tools (like mac ones) only support x86 currently.
+case $host_cpu in
+ i?86|x86_64)
+ X86_HOST=true
+ ;;
+esac
+ if test x$X86_HOST = xtrue; then
+ X86_HOST_TRUE=
+ X86_HOST_FALSE='#'
+else
+ X86_HOST_TRUE='#'
+ X86_HOST_FALSE=
+fi
+
+
# Check whether --enable-processor was given.
if test "${enable_processor+set}" = set; then :
enableval=$enable_processor; case "${enableval}" in
@@ -6556,6 +7604,43 @@ if test x$LINUX_HOST = xfalse -a x$disable_processor = xtrue -a x$disable_tools
as_fn_error $? "--disable-processor and --disable-tools were specified, and not building for Linux. Nothing to build!" "$LINENO" 5
fi
+# Check whether --enable-system-test-libs was given.
+if test "${enable_system_test_libs+set}" = set; then :
+ enableval=$enable_system_test_libs; case "${enableval}" in
+ yes)
+ system_test_libs=true
+ ;;
+ no)
+ system_test_libs=false
+ ;;
+ *)
+ as_fn_error $? "bad value ${enableval} for --enable-system-test-libs" "$LINENO" 5
+ ;;
+ esac
+else
+ system_test_libs=false
+fi
+
+ if test x$system_test_libs = xtrue; then
+ SYSTEM_TEST_LIBS_TRUE=
+ SYSTEM_TEST_LIBS_FALSE='#'
+else
+ SYSTEM_TEST_LIBS_TRUE='#'
+ SYSTEM_TEST_LIBS_FALSE=
+fi
+
+
+
+
+
+
+if test x$system_test_libs = xtrue; then
+ : "${GMOCK_CFLAGS:=-pthread}"
+ : "${GMOCK_LIBS:=-lgmock -lgtest -pthread -lpthread}"
+ : "${GTEST_CFLAGS:=-pthread}"
+ : "${GTEST_LIBS:=-lgtest -pthread -lpthread}"
+fi
+
# Check whether --enable-selftest was given.
if test "${enable_selftest+set}" = set; then :
enableval=$enable_selftest; case "${enableval}" in
@@ -6582,6 +7667,58 @@ else
fi
+
+# Check whether --with-rust-demangle was given.
+if test "${with_rust_demangle+set}" = set; then :
+ withval=$with_rust_demangle; case "${withval}" in
+ yes)
+ as_fn_error $? "You must pass the path to the rust-demangle-capi crate for --with-rust-demangle" "$LINENO" 5
+ ;;
+ no)
+ rust_demangle=false
+ ;;
+ *)
+ if ! test -f "${withval}/Cargo.toml"; then
+ as_fn_error $? "You must pass the path to the rust-demangle-capi crate for --with-rust-demangle" "$LINENO" 5
+ fi
+ RUST_DEMANGLE_CFLAGS="-DHAVE_RUST_DEMANGLE -I${withval}/target/include"
+ RUST_DEMANGLE_LIBS="-L${withval}/target/release -lrust_demangle -lpthread -ldl"
+ ;;
+ esac
+else
+ rust_demangle=false
+fi
+
+
+
+
+
+# Check whether --with-tests-as-root was given.
+if test "${with_tests_as_root+set}" = set; then :
+ withval=$with_tests_as_root; case "${withval}" in
+ yes)
+ tests_as_root=true
+ ;;
+ no)
+ tests_as_root=false
+ ;;
+ *)
+ as_fn_error $? "--with-tests-as-root can only be \"yes\" or \"no\"" "$LINENO" 5
+ ;;
+ esac
+else
+ tests_as_root=false
+fi
+
+ if test x$tests_as_root = xtrue; then
+ TESTS_AS_ROOT_TRUE=
+ TESTS_AS_ROOT_FALSE='#'
+else
+ TESTS_AS_ROOT_TRUE='#'
+ TESTS_AS_ROOT_FALSE=
+fi
+
+
ac_config_files="$ac_config_files breakpad.pc breakpad-client.pc Makefile"
@@ -6733,8 +7870,8 @@ if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
as_fn_error $? "conditional \"am__fastdepCXX\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
-if test -z "${GCC_TRUE}" && test -z "${GCC_FALSE}"; then
- as_fn_error $? "conditional \"GCC\" was never defined.
+if test -z "${HAVE_GETCONTEXT_TRUE}" && test -z "${HAVE_GETCONTEXT_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_GETCONTEXT\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${LINUX_HOST_TRUE}" && test -z "${LINUX_HOST_FALSE}"; then
@@ -6745,6 +7882,10 @@ if test -z "${ANDROID_HOST_TRUE}" && test -z "${ANDROID_HOST_FALSE}"; then
as_fn_error $? "conditional \"ANDROID_HOST\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+if test -z "${X86_HOST_TRUE}" && test -z "${X86_HOST_FALSE}"; then
+ as_fn_error $? "conditional \"X86_HOST\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
if test -z "${DISABLE_PROCESSOR_TRUE}" && test -z "${DISABLE_PROCESSOR_FALSE}"; then
as_fn_error $? "conditional \"DISABLE_PROCESSOR\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -6753,10 +7894,18 @@ if test -z "${DISABLE_TOOLS_TRUE}" && test -z "${DISABLE_TOOLS_FALSE}"; then
as_fn_error $? "conditional \"DISABLE_TOOLS\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+if test -z "${SYSTEM_TEST_LIBS_TRUE}" && test -z "${SYSTEM_TEST_LIBS_FALSE}"; then
+ as_fn_error $? "conditional \"SYSTEM_TEST_LIBS\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
if test -z "${SELFTEST_TRUE}" && test -z "${SELFTEST_FALSE}"; then
as_fn_error $? "conditional \"SELFTEST\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+if test -z "${TESTS_AS_ROOT_TRUE}" && test -z "${TESTS_AS_ROOT_FALSE}"; then
+ as_fn_error $? "conditional \"TESTS_AS_ROOT\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
: "${CONFIG_STATUS=./config.status}"
ac_write_fail=0
diff --git a/configure.ac b/configure.ac
index 8c02f519..08513687 100644
--- a/configure.ac
+++ b/configure.ac
@@ -28,11 +28,11 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-AC_PREREQ(2.57)
+AC_PREREQ(2.64)
AC_INIT(breakpad, 0.1, google-breakpad-dev@googlegroups.com)
dnl Sanity check: the argument is just a file that should exist.
-AC_CONFIG_SRCDIR(README)
+AC_CONFIG_SRCDIR(README.md)
AC_CONFIG_AUX_DIR(autotools)
AC_CONFIG_MACRO_DIR([m4])
AC_CANONICAL_HOST
@@ -41,13 +41,13 @@ AM_INIT_AUTOMAKE(subdir-objects tar-ustar 1.11.1)
AM_CONFIG_HEADER(src/config.h)
AM_MAINTAINER_MODE
+AM_PROG_AR
AM_PROG_AS
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_CPP
AC_PROG_CXX
AC_PROG_RANLIB
-AM_CONDITIONAL(GCC, test "$GCC" = yes) # let the Makefile know if we're gcc
dnl This must come before all the feature tests below.
AC_ARG_ENABLE(m32,
@@ -71,9 +71,40 @@ AC_ARG_ENABLE(m32,
AC_HEADER_STDC
AC_SYS_LARGEFILE
-m4_include(m4/ax_pthread.m4)
AX_PTHREAD
-AC_CHECK_HEADERS([a.out.h])
+AC_CHECK_HEADERS([a.out.h sys/random.h])
+AC_CHECK_FUNCS([arc4random getcontext getrandom])
+AM_CONDITIONAL([HAVE_GETCONTEXT], [test "x$ac_cv_func_getcontext" = xyes])
+
+AX_CXX_COMPILE_STDCXX(11, noext, mandatory)
+
+dnl Test supported warning flags.
+WARN_CXXFLAGS=
+dnl This warning flag is used by clang. Its default behavior is to warn when
+dnl given an unknown flag rather than error out.
+AC_LANG_PUSH([C++])
+AX_CHECK_COMPILE_FLAG([-Werror=unknown-warning-option],[
+ ax_compiler_flags_test="-Werror=unknown-warning-option"
+],[
+ ax_compiler_flags_test=""
+])
+AX_APPEND_COMPILE_FLAGS(m4_flatten([
+ -Wmissing-braces
+ -Wnon-virtual-dtor
+ -Woverloaded-virtual
+ -Wreorder
+ -Wsign-compare
+ -Wunused-local-typedefs
+ -Wunused-variable
+ -Wvla
+]), [WARN_CXXFLAGS], [${ax_compiler_flags_test}])
+AS_VAR_APPEND([WARN_CXXFLAGS], " -Werror")
+AC_LANG_POP([C++])
+AC_SUBST([WARN_CXXFLAGS])
+
+dnl Test support for O_CLOEXEC
+AX_CHECK_DEFINE([fcntl.h], [O_CLOEXEC], [],
+ [AC_DEFINE([O_CLOEXEC], [0], [Fallback definition for old systems])])
# Only build Linux client libs when compiling for Linux
case $host in
@@ -91,6 +122,14 @@ case $host in
esac
AM_CONDITIONAL(ANDROID_HOST, test x$ANDROID_HOST = xtrue)
+# Some tools (like mac ones) only support x86 currently.
+case $host_cpu in
+ i?86|x86_64)
+ X86_HOST=true
+ ;;
+esac
+AM_CONDITIONAL(X86_HOST, test x$X86_HOST = xtrue)
+
AC_ARG_ENABLE(processor,
AS_HELP_STRING([--disable-processor],
[Don't build processor library]
@@ -131,6 +170,35 @@ if test x$LINUX_HOST = xfalse -a x$disable_processor = xtrue -a x$disable_tools
AC_MSG_ERROR([--disable-processor and --disable-tools were specified, and not building for Linux. Nothing to build!])
fi
+AC_ARG_ENABLE(system-test-libs,
+ AS_HELP_STRING([--enable-system-test-libs],
+ [Use gtest/gmock/etc... from the system instead ]
+ [of the local copies (default is local)]),
+ [case "${enableval}" in
+ yes)
+ system_test_libs=true
+ ;;
+ no)
+ system_test_libs=false
+ ;;
+ *)
+ AC_MSG_ERROR(bad value ${enableval} for --enable-system-test-libs)
+ ;;
+ esac],
+ [system_test_libs=false])
+AM_CONDITIONAL(SYSTEM_TEST_LIBS, test x$system_test_libs = xtrue)
+
+AC_ARG_VAR([GMOCK_CFLAGS], [Compiler flags for gmock])
+AC_ARG_VAR([GMOCK_LIBS], [Linker flags for gmock])
+AC_ARG_VAR([GTEST_CFLAGS], [Compiler flags for gtest])
+AC_ARG_VAR([GTEST_LIBS], [Linker flags for gtest])
+if test x$system_test_libs = xtrue; then
+ : "${GMOCK_CFLAGS:=-pthread}"
+ : "${GMOCK_LIBS:=-lgmock -lgtest -pthread -lpthread}"
+ : "${GTEST_CFLAGS:=-pthread}"
+ : "${GTEST_LIBS:=-lgtest -pthread -lpthread}"
+fi
+
AC_ARG_ENABLE(selftest,
AS_HELP_STRING([--enable-selftest],
[Run extra tests with "make check" ]
@@ -150,6 +218,50 @@ AC_ARG_ENABLE(selftest,
[selftest=false])
AM_CONDITIONAL(SELFTEST, test x$selftest = xtrue)
+AC_ARG_WITH(rust-demangle,
+ AS_HELP_STRING([--with-rust-demangle=/path/to/rust-demangle-capi],
+ [Link against the rust-demangle library]
+ [to demangle Rust language symbols during]
+ [symbol dumping (default is no)]
+ [Pass the path to the crate root.]),
+ [case "${withval}" in
+ yes)
+ AC_MSG_ERROR(You must pass the path to the rust-demangle-capi crate for --with-rust-demangle)
+ ;;
+ no)
+ rust_demangle=false
+ ;;
+ *)
+ if ! test -f "${withval}/Cargo.toml"; then
+ AC_MSG_ERROR(You must pass the path to the rust-demangle-capi crate for --with-rust-demangle)
+ fi
+ RUST_DEMANGLE_CFLAGS="-DHAVE_RUST_DEMANGLE -I${withval}/target/include"
+ RUST_DEMANGLE_LIBS="-L${withval}/target/release -lrust_demangle -lpthread -ldl"
+ ;;
+ esac],
+ [rust_demangle=false])
+AC_ARG_VAR([RUST_DEMANGLE_CFLAGS], [Compiler flags for rust-demangle])
+AC_ARG_VAR([RUST_DEMANGLE_LIBS], [Linker flags for rust-demangle])
+
+AC_ARG_WITH(tests-as-root,
+ AS_HELP_STRING([--with-tests-as-root],
+ [Run the tests as root. Use this on platforms]
+ [like travis-ci.org that require root privileges]
+ [to use ptrace (default is no)]),
+ [case "${withval}" in
+ yes)
+ tests_as_root=true
+ ;;
+ no)
+ tests_as_root=false
+ ;;
+ *)
+ AC_MSG_ERROR(--with-tests-as-root can only be "yes" or "no")
+ ;;
+ esac],
+ [tests_as_root=false])
+AM_CONDITIONAL(TESTS_AS_ROOT, test x$tests_as_root = xtrue)
+
AC_CONFIG_FILES(m4_flatten([
breakpad.pc
breakpad-client.pc
diff --git a/default.xml b/default.xml
new file mode 100644
index 00000000..195bbb59
--- /dev/null
+++ b/default.xml
@@ -0,0 +1,43 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- AUTOGENERATED BY deps-to-manifest.py; DO NOT EDIT -->
+<manifest>
+
+ <default revision='refs/heads/master'
+ remote='chromium'
+ sync-c='true'
+ sync-j='8' />
+
+ <remote name='github'
+ fetch='https://github.com/'
+ review='' />
+
+ <remote name='chromium'
+ fetch='https://chromium.googlesource.com/'
+ review='https://chromium-review.googlesource.com' />
+
+ <project path='src'
+ name='breakpad/breakpad'
+ revision='refs/heads/master'
+ remote='chromium' />
+
+ <project path='src/src/tools/gyp'
+ name='external/gyp/'
+ revision='324dd166b7c0b39d513026fa52d6280ac6d56770'
+ remote='chromium' />
+
+ <project path='src/src/testing'
+ name='google/googletest.git'
+ revision='5ec7f0c4a113e2f18ac2c6cc7df51ad6afc24081'
+ remote='github' />
+
+ <project path='src/src/third_party/lss'
+ name='linux-syscall-support/'
+ revision='fd00dbbd0c06a309c657d89e9430143b179ff6db'
+ remote='chromium' />
+
+ <project path='src/src/third_party/protobuf/protobuf'
+ name='google/protobuf.git'
+ revision='cb6dd4ef5f82e41e06179dcd57d3b1d9246ad6ac'
+ remote='github' />
+
+</manifest>
diff --git a/docs/OWNERS b/docs/OWNERS
new file mode 100644
index 00000000..72e8ffc0
--- /dev/null
+++ b/docs/OWNERS
@@ -0,0 +1 @@
+*
diff --git a/docs/breakpad.png b/docs/breakpad.png
new file mode 100644
index 00000000..20bc7566
--- /dev/null
+++ b/docs/breakpad.png
Binary files differ
diff --git a/docs/breakpad.svg b/docs/breakpad.svg
new file mode 100644
index 00000000..e91e72cb
--- /dev/null
+++ b/docs/breakpad.svg
@@ -0,0 +1,1023 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="744.09448819"
+ height="1052.3622047"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.47pre4 r22446"
+ sodipodi:docname="breakpad.svg"
+ inkscape:export-filename="/home/jimb/breakpad/breakpad.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90">
+ <defs
+ id="defs4">
+ <marker
+ inkscape:stockid="Arrow1Mend"
+ orient="auto"
+ refY="0.0"
+ refX="0.0"
+ id="Arrow1Mend"
+ style="overflow:visible;">
+ <path
+ id="path9356"
+ d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
+ style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;marker-start:none;"
+ transform="scale(0.4) rotate(180) translate(10,0)" />
+ </marker>
+ <marker
+ inkscape:stockid="Arrow1Lend"
+ orient="auto"
+ refY="0.0"
+ refX="0.0"
+ id="Arrow1Lend"
+ style="overflow:visible;">
+ <path
+ id="path9350"
+ d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
+ style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;marker-start:none;"
+ transform="scale(0.8) rotate(180) translate(12.5,0)" />
+ </marker>
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 526.18109 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="744.09448 : 526.18109 : 1"
+ inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+ id="perspective10" />
+ <inkscape:perspective
+ id="perspective3613"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3635"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3657"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3679"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3710"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3736"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3761"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3786"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3811"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3833"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3872"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3901"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3925"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3955"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3981"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective4007"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective4034"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective7725"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective7771"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective7840"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective7868"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective7922"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective7953"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective8002"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective8042"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective8070"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective8097"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective8097-9"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective8143"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective8176"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective8176-4"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective8176-42"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective8176-3"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective8176-2"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective8176-428"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective8243"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective8295"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <filter
+ id="filter8321"
+ inkscape:label="Drop shadow"
+ width="1.5"
+ height="1.5"
+ x="-.25"
+ y="-.25">
+ <feGaussianBlur
+ id="feGaussianBlur8323"
+ in="SourceAlpha"
+ stdDeviation="2.000000"
+ result="blur" />
+ <feColorMatrix
+ id="feColorMatrix8325"
+ result="bluralpha"
+ type="matrix"
+ values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0.500000 0 " />
+ <feOffset
+ id="feOffset8327"
+ in="bluralpha"
+ dx="4.000000"
+ dy="4.000000"
+ result="offsetBlur" />
+ <feMerge
+ id="feMerge8329">
+ <feMergeNode
+ id="feMergeNode8331"
+ in="offsetBlur" />
+ <feMergeNode
+ id="feMergeNode8333"
+ in="SourceGraphic" />
+ </feMerge>
+ </filter>
+ <inkscape:perspective
+ id="perspective8343"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <filter
+ id="filter8366"
+ inkscape:label="Drop shadow"
+ width="1.5"
+ height="1.5"
+ x="-.25"
+ y="-.25">
+ <feGaussianBlur
+ id="feGaussianBlur8368"
+ in="SourceAlpha"
+ stdDeviation="2.000000"
+ result="blur" />
+ <feColorMatrix
+ id="feColorMatrix8370"
+ result="bluralpha"
+ type="matrix"
+ values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0.500000 0 " />
+ <feOffset
+ id="feOffset8372"
+ in="bluralpha"
+ dx="4.000000"
+ dy="4.000000"
+ result="offsetBlur" />
+ <feMerge
+ id="feMerge8374">
+ <feMergeNode
+ id="feMergeNode8376"
+ in="offsetBlur" />
+ <feMergeNode
+ id="feMergeNode8378"
+ in="SourceGraphic" />
+ </feMerge>
+ </filter>
+ <inkscape:perspective
+ id="perspective9324"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective4142"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <marker
+ inkscape:stockid="Arrow1Mend"
+ orient="auto"
+ refY="0"
+ refX="0"
+ id="Arrow1Mend-3"
+ style="overflow:visible">
+ <path
+ id="path9356-7"
+ d="M 0,0 5,-5 -12.5,0 5,5 0,0 z"
+ style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:none"
+ transform="matrix(-0.4,0,0,-0.4,-4,0)" />
+ </marker>
+ <inkscape:perspective
+ id="perspective4170"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective4217"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <marker
+ inkscape:stockid="Arrow1Mend"
+ orient="auto"
+ refY="0"
+ refX="0"
+ id="Arrow1Mend-9"
+ style="overflow:visible">
+ <path
+ id="path9356-0"
+ d="M 0,0 5,-5 -12.5,0 5,5 0,0 z"
+ style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:none"
+ transform="matrix(-0.4,0,0,-0.4,-4,0)" />
+ </marker>
+ <inkscape:perspective
+ id="perspective4245"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective4471"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective4688"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective4911"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective4943"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective4968"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <marker
+ inkscape:stockid="Arrow1Mend"
+ orient="auto"
+ refY="0"
+ refX="0"
+ id="Arrow1Mend-9-4"
+ style="overflow:visible">
+ <path
+ id="path9356-0-1"
+ d="M 0,0 5,-5 -12.5,0 5,5 0,0 z"
+ style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:none"
+ transform="matrix(-0.4,0,0,-0.4,-4,0)" />
+ </marker>
+ <inkscape:perspective
+ id="perspective5779"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective5814"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="0.7"
+ inkscape:cx="359.94288"
+ inkscape:cy="623.17274"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ showguides="true"
+ inkscape:guide-bbox="true"
+ inkscape:window-width="1440"
+ inkscape:window-height="826"
+ inkscape:window-x="0"
+ inkscape:window-y="25"
+ inkscape:window-maximized="1" />
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1">
+ <rect
+ style="fill:#000000;stroke:none;stroke-width:3.43128871999999996;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:6.86257769000000017, 13.72515536000000047;stroke-dashoffset:0;fill-opacity:0.11255411"
+ id="rect2816"
+ width="457.31259"
+ height="316.05023"
+ x="30.533802"
+ y="32.018353"
+ ry="37.375645"
+ rx="37.375645" />
+ <rect
+ style="fill:#000000;stroke:none;stroke-width:3.30610942999999979;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:6.61221891000000017, 13.22443780000000046;stroke-dashoffset:0;fill-opacity:0.11255411"
+ id="rect2816-6"
+ width="322.07736"
+ height="402.03836"
+ x="24.829395"
+ y="400.81494"
+ ry="37.375645"
+ rx="37.375645" />
+ <rect
+ style="fill:#000000;stroke:none;stroke-width:3.30260920999999996;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:6.60521854000000008, 13.21043710000000004;stroke-dashoffset:4.62365298000000013;fill-opacity:0.11255411"
+ id="rect2816-6-4"
+ width="318.04028"
+ height="403.05206"
+ x="370.2998"
+ y="401.82336"
+ ry="37.375645"
+ rx="37.375648" />
+ <text
+ xml:space="preserve"
+ style="font-size:40px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans"
+ x="-209.10158"
+ y="168.4787"
+ id="text7705"><tspan
+ sodipodi:role="line"
+ id="tspan7707"
+ x="-209.10158"
+ y="168.4787" /></text>
+ <g
+ id="g7976"
+ transform="translate(6.3149563,0)">
+ <path
+ id="rect3889-4-9-8-7-4"
+ d="m 203.15004,163.41405 0,12.83936 c 0,9.20592 7.41912,16.61718 16.63478,16.61718 l 62.97825,0 c 9.21567,0 16.63479,-7.41126 16.63479,-16.61718 l 0,-12.83936 -96.24782,0 z"
+ style="fill:#69d06e;fill-opacity:1;stroke:#000000;stroke-width:3;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ id="rect3889-4-5-8-5"
+ d="m 219.78482,102.07328 c -9.21566,0 -16.63478,7.41126 -16.63478,16.61717 l 0,44.72356 65.75938,0 0,-61.34073 -49.1246,0 z"
+ style="fill:#ff7373;fill-opacity:1;stroke:#000000;stroke-width:3;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ id="rect3889-4-5-6-0-8"
+ d="m 268.90942,102.07328 0,61.34073 30.46245,0 0,-44.72356 c 0,-9.20591 -7.41912,-16.61717 -16.63479,-16.61717 l -13.82766,0 z"
+ style="fill:#7389ff;fill-opacity:1;stroke:#000000;stroke-width:3;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ </g>
+ <g
+ id="g6291"
+ transform="translate(14.142136,-6.0609152)">
+ <path
+ id="rect3889-4-9-8-7-4-5"
+ d="m 520.27773,164.28681 0,26.28651 c 0,18.84762 15.17789,34.02097 34.03114,34.02097 l 128.83978,0 c 18.85325,0 34.03115,-15.17335 34.03115,-34.02097 l 0,-26.28651 -196.90207,0 z"
+ style="fill:#69d06e;fill-opacity:1;stroke:#000000;stroke-width:2.99999976;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ id="rect3889-4-5-8-5-2"
+ d="m 554.30887,38.701491 c -18.85325,0 -34.03114,15.173353 -34.03114,34.020972 l 0,91.564267 134.52936,0 0,-125.585239 -100.49822,0 z"
+ style="fill:#ff7373;fill-opacity:1;stroke:#000000;stroke-width:2.99999976;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ id="rect3889-4-5-6-0-8-5"
+ d="m 654.80709,38.701491 0,125.585239 62.31954,0 0,-91.564267 c 0,-18.847619 -15.1779,-34.020972 -34.03116,-34.020972 l -28.28838,0 z"
+ style="fill:#7389ff;fill-opacity:1;stroke:#000000;stroke-width:2.99999976;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <text
+ transform="matrix(0,0.99985053,-1.0001495,0,0,0)"
+ id="text4054-8-1"
+ y="-670.69989"
+ x="46.701351"
+ style="font-size:15.31172657px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Electron;-inkscape-font-specification:Electron"
+ xml:space="preserve"><tspan
+ y="-670.69989"
+ x="46.701351"
+ id="tspan4056-1-5"
+ sodipodi:role="line">Breakpad Client</tspan></text>
+ <text
+ transform="scale(1.0001495,0.99985053)"
+ id="text7709-2-9"
+ y="195.04388"
+ x="541.16602"
+ style="font-size:15.31172657px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Electron;-inkscape-font-specification:Electron"
+ xml:space="preserve"><tspan
+ y="195.04388"
+ x="541.16602"
+ id="tspan7711-4-2"
+ sodipodi:role="line">Debugging Information</tspan></text>
+ <text
+ transform="scale(1.0001495,0.99985053)"
+ id="text7713-8-0"
+ y="89.351486"
+ x="529.84656"
+ style="font-size:15.31172657px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Electron;-inkscape-font-specification:Electron"
+ xml:space="preserve"><tspan
+ y="89.351486"
+ x="529.84656"
+ id="tspan7715-2-9"
+ sodipodi:role="line">Application Code</tspan></text>
+ </g>
+ <text
+ xml:space="preserve"
+ style="font-size:40px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Electron;-inkscape-font-specification:Electron"
+ x="146.88969"
+ y="80.301979"
+ id="text7820"><tspan
+ sodipodi:role="line"
+ id="tspan7822"
+ x="146.88969"
+ y="80.301979">Build System </tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:40px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Electron;-inkscape-font-specification:Electron"
+ x="57.38908"
+ y="776.59052"
+ id="text7824"><tspan
+ sodipodi:role="line"
+ id="tspan7826"
+ x="57.38908"
+ y="776.59052">User's System</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:40px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Electron;-inkscape-font-specification:Electron"
+ x="392.94681"
+ y="776.59052"
+ id="text7828"><tspan
+ sodipodi:role="line"
+ id="tspan7830"
+ x="392.94681"
+ y="776.59052">Crash Collector</tspan></text>
+ <g
+ id="g7888"
+ transform="translate(2.2177734e-5,8.08123)">
+ <path
+ id="rect3889-4-9-8-7-4-3"
+ d="m 336.74421,269.27363 0,12.83936 c 0,9.20592 7.41912,16.61718 16.63478,16.61718 l 62.97825,0 c 9.21567,0 16.63479,-7.41126 16.63479,-16.61718 l 0,-12.83936 -96.24782,0 z"
+ style="fill:#69d06e;fill-opacity:1;stroke:#000000;stroke-width:3;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ id="rect3889-4-5-8-5-22"
+ d="m 353.37899,207.93286 c -9.21566,0 -16.63478,7.41126 -16.63478,16.61717 l 0,44.72356 65.75938,0 0,-61.34073 -49.1246,0 z"
+ style="fill:none;stroke:#000000;stroke-width:3;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:3, 3;stroke-dashoffset:0" />
+ <path
+ id="rect3889-4-5-6-0-8-4"
+ d="m 402.50359,207.93286 0,61.34073 30.46245,0 0,-44.72356 c 0,-9.20591 -7.41912,-16.61717 -16.63479,-16.61717 l -13.82766,0 z"
+ style="fill:none;stroke:#000000;stroke-width:3;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:3, 3;stroke-dashoffset:3" />
+ </g>
+ <g
+ id="g7893">
+ <path
+ id="rect3889-4-9-8-7-4-3-5"
+ d="m 82.185768,277.35486 0,12.83936 c 0,9.20592 7.41912,16.61718 16.63478,16.61718 l 62.978252,0 c 9.21567,0 16.63479,-7.41126 16.63479,-16.61718 l 0,-12.83936 -96.247822,0 z"
+ style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:3;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:3,3;stroke-dashoffset:0" />
+ <path
+ id="rect3889-4-5-8-5-22-0"
+ d="m 98.820548,216.01409 c -9.21566,0 -16.63478,7.41126 -16.63478,16.61717 l 0,44.72356 65.759382,0 0,-61.34073 -49.124602,0 z"
+ style="fill:#ff7373;fill-opacity:1;stroke:#000000;stroke-width:3;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ id="rect3889-4-5-6-0-8-4-1"
+ d="m 147.94515,216.01409 0,61.34073 30.46245,0 0,-44.72356 c 0,-9.20591 -7.41912,-16.61717 -16.63479,-16.61717 l -13.82766,0 z"
+ style="fill:#7389ff;fill-opacity:1;stroke:#000000;stroke-width:3;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ </g>
+ <g
+ transform="translate(-1.0101527,215.16249)"
+ id="g7893-0">
+ <path
+ id="rect3889-4-9-8-7-4-3-5-9"
+ d="m 82.185768,277.35486 0,12.83936 c 0,9.20592 7.41912,16.61718 16.63478,16.61718 l 62.978252,0 c 9.21567,0 16.63479,-7.41126 16.63479,-16.61718 l 0,-12.83936 -96.247822,0 z"
+ style="fill:none;stroke:#000000;stroke-width:3;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:3, 3;stroke-dashoffset:0" />
+ <path
+ id="rect3889-4-5-8-5-22-0-3"
+ d="m 98.820548,216.01409 c -9.21566,0 -16.63478,7.41126 -16.63478,16.61717 l 0,44.72356 65.759382,0 0,-61.34073 -49.124602,0 z"
+ style="fill:#ff7373;fill-opacity:1;stroke:#000000;stroke-width:3;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ id="rect3889-4-5-6-0-8-4-1-5"
+ d="m 147.94515,216.01409 0,61.34073 30.46245,0 0,-44.72356 c 0,-9.20591 -7.41912,-16.61717 -16.63479,-16.61717 l -13.82766,0 z"
+ style="fill:#7389ff;fill-opacity:1;stroke:#000000;stroke-width:3;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ </g>
+ <path
+ style="fill:#69d06e;fill-opacity:1;stroke:#000000;stroke-width:3;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m 401.48829,493.94592 0,12.83936 c 0,9.20592 7.41912,16.61718 16.63478,16.61718 l 62.97825,0 c 9.21567,0 16.63479,-7.41126 16.63479,-16.61718 l 0,-12.83936 -96.24782,0 z"
+ id="rect3889-4-9-8-7-4-3-6" />
+ <path
+ style="fill:none;stroke:#000000;stroke-width:3;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:3, 3;stroke-dashoffset:0"
+ d="m 418.12307,432.60515 c -9.21566,0 -16.63478,7.41126 -16.63478,16.61717 l 0,44.72356 65.75938,0 0,-61.34073 -49.1246,0 z"
+ id="rect3889-4-5-8-5-22-09" />
+ <path
+ style="fill:none;stroke:#000000;stroke-width:3;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:3, 3;stroke-dashoffset:3"
+ d="m 467.24767,432.60515 0,61.34073 30.46245,0 0,-44.72356 c 0,-9.20591 -7.41912,-16.61717 -16.63479,-16.61717 l -13.82766,0 z"
+ id="rect3889-4-5-6-0-8-4-9" />
+ <g
+ transform="matrix(0.66061386,0,0,0.66061386,-286.29084,438.82849)"
+ id="g8084-9">
+ <path
+ transform="matrix(1.4728437,0,0,1.328464,449.83354,-501.49781)"
+ d="m 155.71429,578.07645 -17.11889,20.26398 20.46679,18.49833 -26.51647,-0.74971 -1.70174,27.5351 -15.94661,-21.19884 -22.588825,15.83737 6.631376,-25.68481 -26.466061,-7.78622 24.215795,-10.8296 -10.413811,-25.54663 23.565226,12.18053 13.48025,-24.06991 5.16956,26.01847 27.22341,-4.46806 z"
+ inkscape:randomized="0"
+ inkscape:rounded="0"
+ inkscape:flatsided="false"
+ sodipodi:arg2="-0.12029562"
+ sodipodi:arg1="-0.53495504"
+ sodipodi:r2="21.608704"
+ sodipodi:r1="44.8353"
+ sodipodi:cy="600.93359"
+ sodipodi:cx="117.14286"
+ sodipodi:sides="7"
+ id="path7983-2-1"
+ style="fill:#ffa30c;fill-opacity:1;stroke:#000000;stroke-width:3.71295619;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:4.8034"
+ sodipodi:type="star" />
+ <text
+ transform="scale(1.0001495,0.99985053)"
+ id="text7709-2-9-4-8-5"
+ y="303.53152"
+ x="586.65173"
+ style="font-size:15.31172657px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Electron;-inkscape-font-specification:Electron"
+ xml:space="preserve"><tspan
+ y="303.53152"
+ x="586.65173"
+ id="tspan7711-4-2-5-2-8"
+ sodipodi:role="line">Minidump</tspan></text>
+ </g>
+ <g
+ id="g8312">
+ <path
+ transform="matrix(0.97298096,0,0,0.87760173,331.1881,107.53209)"
+ d="m 155.71429,578.07645 -17.11889,20.26398 20.46679,18.49833 -26.51647,-0.74971 -1.70174,27.5351 -15.94661,-21.19884 -22.588825,15.83737 6.631376,-25.68481 -26.466061,-7.78622 24.215795,-10.8296 -10.413811,-25.54663 23.565226,12.18053 13.48025,-24.06991 5.16956,26.01847 27.22341,-4.46806 z"
+ inkscape:randomized="0"
+ inkscape:rounded="0"
+ inkscape:flatsided="false"
+ sodipodi:arg2="-0.12029562"
+ sodipodi:arg1="-0.53495504"
+ sodipodi:r2="21.608704"
+ sodipodi:r1="44.8353"
+ sodipodi:cy="600.93359"
+ sodipodi:cx="117.14286"
+ sodipodi:sides="7"
+ id="path7983-2-1-2"
+ style="fill:#ffa30c;fill-opacity:1;stroke:#000000;stroke-width:3.71295619;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:4.8034"
+ sodipodi:type="star" />
+ <text
+ transform="scale(1.0001495,0.99985053)"
+ id="text7709-2-9-4-8-5-3"
+ y="639.41125"
+ x="421.56702"
+ style="font-size:10.11513901px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Electron;-inkscape-font-specification:Electron"
+ xml:space="preserve"><tspan
+ y="639.41125"
+ x="421.56702"
+ id="tspan7711-4-2-5-2-8-6"
+ sodipodi:role="line">Minidump</tspan></text>
+ </g>
+ <g
+ id="g6064"
+ transform="translate(-4.3412377e-5,0)">
+ <rect
+ y="638.66846"
+ x="589.55682"
+ height="5.6898999"
+ width="74.78157"
+ id="rect8166-95"
+ style="fill:#ffa30c;fill-opacity:1;stroke:#000000;stroke-width:2;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:4.8034" />
+ <rect
+ y="648.62573"
+ x="589.55682"
+ height="5.6898999"
+ width="74.78157"
+ id="rect8166-4-2"
+ style="fill:#ffa30c;fill-opacity:1;stroke:#000000;stroke-width:2;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:4.8034" />
+ <rect
+ y="658.58307"
+ x="589.55682"
+ height="5.6898999"
+ width="74.78157"
+ id="rect8166-0-0"
+ style="fill:#ffa30c;fill-opacity:1;stroke:#000000;stroke-width:2;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:4.8034" />
+ <rect
+ y="668.54041"
+ x="589.55682"
+ height="5.6898999"
+ width="74.78157"
+ id="rect8166-7-8"
+ style="fill:#ffa30c;fill-opacity:1;stroke:#000000;stroke-width:2;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:4.8034" />
+ <rect
+ y="678.49774"
+ x="589.55682"
+ height="5.6898999"
+ width="74.78157"
+ id="rect8166-9-3"
+ style="fill:#ffa30c;fill-opacity:1;stroke:#000000;stroke-width:2;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:4.8034" />
+ <rect
+ y="688.45502"
+ x="589.55682"
+ height="5.6898999"
+ width="74.78157"
+ id="rect8166-2-5"
+ style="fill:#ffa30c;fill-opacity:1;stroke:#000000;stroke-width:2;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:4.8034" />
+ <rect
+ y="698.41235"
+ x="589.55682"
+ height="5.6898999"
+ width="74.78157"
+ id="rect8166-1-5"
+ style="fill:#ffa30c;fill-opacity:1;stroke:#000000;stroke-width:2;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:4.8034" />
+ </g>
+ <text
+ xml:space="preserve"
+ style="font-size:14;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;font-family:Electron;-inkscape-font-specification:Electron"
+ x="626.64435"
+ y="721.01373"
+ id="text7709-2-9-4-8-5-3-6"
+ transform="scale(1.0001495,0.99985053)"><tspan
+ sodipodi:role="line"
+ id="tspan7711-4-2-5-2-8-6-4"
+ x="626.64435"
+ y="721.01373">Human-readable</tspan><tspan
+ sodipodi:role="line"
+ x="626.64435"
+ y="733.65765"
+ id="tspan8317">Stack Trace</tspan></text>
+ <path
+ style="fill:none;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow1Mend);stroke-miterlimit:4;stroke-dasharray:none"
+ d="m 197.98989,145.24521 c -49.70055,0 -69.70052,3.18552 -69.70052,62.62945"
+ id="path3754"
+ sodipodi:nodetypes="cs" />
+ <text
+ xml:space="preserve"
+ style="font-size:18px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Electron;-inkscape-font-specification:Electron"
+ x="81.822357"
+ y="138.17415"
+ id="text4128"><tspan
+ sodipodi:role="line"
+ id="tspan4130"
+ x="81.822357"
+ y="138.17415">strip debug</tspan><tspan
+ sodipodi:role="line"
+ x="81.822357"
+ y="160.67415"
+ id="tspan4132">info</tspan></text>
+ <path
+ style="fill:none;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker-end:url(#Arrow1Mend)"
+ d="m 310.38714,155.10181 c 39.65053,0 78.79189,18.27988 78.79189,53.53808"
+ id="path3754-1"
+ sodipodi:nodetypes="cs" />
+ <text
+ xml:space="preserve"
+ style="font-size:18px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;font-family:Electron;-inkscape-font-specification:Electron"
+ x="412.43362"
+ y="136.31461"
+ id="text4128-8"><tspan
+ sodipodi:role="line"
+ x="412.43362"
+ y="136.31461"
+ id="tspan4132-5">Breakpad symbol</tspan><tspan
+ sodipodi:role="line"
+ x="412.43362"
+ y="158.81461"
+ id="tspan4192">dumper</tspan></text>
+ <path
+ style="fill:none;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker-end:url(#Arrow1Mend)"
+ d="m 81.046974,305.10945 c -19.395976,29.29442 -25.25381,88.03833 -1.010153,126.26906"
+ id="path3754-12"
+ sodipodi:nodetypes="cs" />
+ <text
+ xml:space="preserve"
+ style="font-size:18px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Electron;-inkscape-font-specification:Electron"
+ x="69.991928"
+ y="377.74106"
+ id="text4128-2"><tspan
+ sodipodi:role="line"
+ x="69.991928"
+ y="377.74106"
+ id="tspan4132-6">distribute program to users</tspan></text>
+ <path
+ style="fill:none;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none;marker-end:url(#Arrow1Mend-9)"
+ d="m 429.31483,307.87976 c 35.35534,36.36549 29.29442,105.05587 29.29442,119.198"
+ id="path4267" />
+ <text
+ xml:space="preserve"
+ style="font-size:40px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Electron;-inkscape-font-specification:Electron"
+ x="508.10672"
+ y="377.58029"
+ id="text4459"><tspan
+ sodipodi:role="line"
+ id="tspan4461"
+ x="508.10672"
+ y="377.58029" /></text>
+ <text
+ xml:space="preserve"
+ style="font-size:18px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Electron;-inkscape-font-specification:Electron"
+ x="464.03134"
+ y="379.15485"
+ id="text4128-2-2"><tspan
+ sodipodi:role="line"
+ x="464.03134"
+ y="379.15485"
+ id="tspan4132-6-0">copy symbol file</tspan></text>
+ <path
+ style="fill:none;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none;marker-end:url(#Arrow1Mend-9)"
+ d="m 86.873118,525.06256 c -30.304576,41.41625 -8.08122,61.6193 2.020305,73.74113"
+ id="path4488" />
+ <text
+ xml:space="preserve"
+ style="font-size:18px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Electron;-inkscape-font-specification:Electron"
+ x="82.19368"
+ y="553.91125"
+ id="text4128-2-5"><tspan
+ sodipodi:role="line"
+ x="82.19368"
+ y="553.91125"
+ id="tspan4705">Crash! Breakpad client</tspan><tspan
+ sodipodi:role="line"
+ x="82.19368"
+ y="576.41125"
+ id="tspan4709">writes minidump...</tspan></text>
+ <path
+ style="fill:none;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none;marker-end:url(#Arrow1Mend-9)"
+ d="m 175.76654,651.33163 c 73.74114,32.32488 199.00005,11.11167 226.27417,4.04061"
+ id="path4711"
+ sodipodi:nodetypes="cc" />
+ <text
+ xml:space="preserve"
+ style="font-size:18px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Electron;-inkscape-font-specification:Electron"
+ x="195.66714"
+ y="632.6698"
+ id="text4128-2-5-0"><tspan
+ sodipodi:role="line"
+ x="195.66714"
+ y="632.6698"
+ id="tspan4709-9">...and submits it</tspan><tspan
+ sodipodi:role="line"
+ x="195.66714"
+ y="655.1698"
+ id="tspan4933">to crash collector</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:18px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Electron;-inkscape-font-specification:Electron"
+ x="566.60748"
+ y="534.8764"
+ id="text4128-2-2-1"><tspan
+ sodipodi:role="line"
+ x="566.60748"
+ y="534.8764"
+ id="tspan6038">Breakpad</tspan><tspan
+ sodipodi:role="line"
+ x="566.60748"
+ y="557.3764"
+ id="tspan6042">minidump</tspan><tspan
+ sodipodi:role="line"
+ x="566.60748"
+ y="579.8764"
+ id="tspan6044">processor</tspan></text>
+ <path
+ style="fill:none;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none;marker-end:none"
+ d="m 478.8123,528.09302 c 0,46.46701 10.10153,64.64976 33.33504,64.64976"
+ id="path5378" />
+ <path
+ style="fill:#7389ff;fill-opacity:1;stroke:#000000;stroke-width:2;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m 359.69771,149.79174 -2.15995,5.52276 -3.38867,-4.8502 c -1.37337,0.38745 -2.68104,0.92291 -3.90603,1.6038 l 0.87951,5.8073 -5.22528,-2.45743 c -0.99192,1.02805 -1.87267,2.16471 -2.61264,3.40161 l 0,0.0129 3.56974,4.47511 -5.63916,0.47856 c -0.35721,1.38104 -0.55839,2.82102 -0.59496,4.30697 l 5.23822,2.04355 -4.64326,3.23346 c 0.36854,1.42098 0.89771,2.76704 1.565,4.03537 l 5.63916,-0.85364 -2.45743,5.23822 c 0.99352,1.01894 2.11057,1.9224 3.31106,2.69024 l 4.56566,-3.64735 0.50442,5.89784 c 1.33402,0.36025 2.73022,0.57394 4.1647,0.62082 l 2.17289,-5.53569 3.38867,4.86313 c 1.37068,-0.38651 2.68307,-0.92495 3.90602,-1.60379 l -0.8795,-5.82024 5.23821,2.45743 c 0.98882,-1.02601 1.86161,-2.16784 2.59971,-3.4016 l -3.56975,-4.4751 5.63916,-0.47855 c 0.35722,-1.38104 0.55839,-2.82102 0.59496,-4.30697 l -5.23821,-2.04355 4.64325,-3.23347 c -0.36719,-1.41579 -0.88822,-2.77103 -1.55206,-4.03536 l -5.65209,0.85363 2.45743,-5.25114 c -0.99335,-1.01866 -2.11085,-1.90964 -3.31107,-2.67731 l -4.56565,3.64735 -0.50442,-5.91078 c -1.33935,-0.36164 -2.73711,-0.56219 -4.17764,-0.60789 z"
+ id="path5764-8" />
+ <path
+ style="fill:#7389ff;fill-opacity:1;stroke:#000000;stroke-width:2;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m 543.22423,577.59555 -2.15995,5.52276 -3.38867,-4.8502 c -1.37337,0.38745 -2.68104,0.92291 -3.90603,1.6038 l 0.87951,5.8073 -5.22528,-2.45743 c -0.99192,1.02805 -1.87267,2.16471 -2.61264,3.40161 l 0,0.0129 3.56974,4.47511 -5.63916,0.47856 c -0.35721,1.38104 -0.55839,2.82102 -0.59496,4.30697 l 5.23822,2.04355 -4.64326,3.23346 c 0.36854,1.42098 0.89771,2.76704 1.565,4.03537 l 5.63916,-0.85364 -2.45743,5.23822 c 0.99352,1.01894 2.11057,1.9224 3.31106,2.69024 l 4.56566,-3.64735 0.50442,5.89784 c 1.33402,0.36025 2.73022,0.57394 4.1647,0.62082 l 2.17289,-5.53569 3.38867,4.86313 c 1.37068,-0.38651 2.68307,-0.92495 3.90602,-1.60379 l -0.8795,-5.82024 5.23821,2.45743 c 0.98882,-1.02601 1.86161,-2.16784 2.59971,-3.4016 l -3.56975,-4.4751 5.63916,-0.47855 c 0.35722,-1.38104 0.55839,-2.82102 0.59496,-4.30697 l -5.23821,-2.04355 4.64325,-3.23347 c -0.36719,-1.41579 -0.88822,-2.77103 -1.55206,-4.03536 l -5.65209,0.85363 2.45743,-5.25114 c -0.99335,-1.01866 -2.11085,-1.90964 -3.31107,-2.67731 l -4.56565,3.64735 -0.50442,-5.91078 c -1.33935,-0.36164 -2.73711,-0.56219 -4.17764,-0.60789 z"
+ id="path5764-8-4" />
+ <path
+ style="fill:none;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none;marker-end:url(#Arrow1Mend-9-4)"
+ d="m 460.09385,613.01762 c 15.48314,-16.15719 27.22758,-22.44115 57.04901,-19.40543"
+ id="path5841"
+ sodipodi:nodetypes="cc" />
+ <path
+ style="fill:none;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none;marker-end:url(#Arrow1Mend-9-4)"
+ d="m 563.92857,598.79076 c 22.14285,2.85714 31.78571,11.42857 44.64286,32.85714"
+ id="path6086"
+ sodipodi:nodetypes="cc" />
+ </g>
+</svg>
diff --git a/docs/client_design.md b/docs/client_design.md
new file mode 100644
index 00000000..9f85655d
--- /dev/null
+++ b/docs/client_design.md
@@ -0,0 +1,223 @@
+# Breakpad Client Libraries
+
+## Objective
+
+The Breakpad client libraries are responsible for monitoring an application for
+crashes (exceptions), handling them when they occur by generating a dump, and
+providing a means to upload dumps to a crash reporting server. These tasks are
+divided between the “handler” (short for “exception handler”) library linked in
+to an application being monitored for crashes, and the “sender” library,
+intended to be linked in to a separate external program.
+
+## Background
+
+As one of the chief tasks of the client handler is to generate a dump, an
+understanding of [dump files](processor_design.md) will aid in understanding the
+handler.
+
+## Overview
+
+Breakpad provides client libraries for each of its target platforms. Currently,
+these exist for Windows on x86 and Mac OS X on both x86 and PowerPC. A Linux
+implementation has been written and is currently under review.
+
+Because the mechanisms for catching exceptions and the methods for obtaining the
+information that a dump contains vary between operating systems, each target
+operating system requires a completely different handler implementation. Where
+multiple CPUs are supported for a single operating system, the handler
+implementation will likely also require separate code for each processor type to
+extract CPU-specific information. One of the goals of the Breakpad handler is to
+provide a prepackaged cross-platform system that masks many of these
+system-level differences and quirks from the application developer. Although the
+underlying implementations differ, the handler library for each system follows
+the same set of principles and exposes a similar interface.
+
+Code that wishes to take advantage of Breakpad should be linked against the
+handler library, and should, at an appropriate time, install a Breakpad handler.
+For applications, it is generally desirable to install the handler as early in
+the start-up process as possible. Developers of library code using Breakpad to
+monitor itself may wish to install a Breakpad handler when the library is
+loaded, or may only want to install a handler when calls are made in to the
+library.
+
+The handler can be triggered to generate a dump either by catching an exception
+or at the request of the application itself. The latter case may be useful in
+debugging assertions or other conditions where developers want to know how a
+program got in to a specific non-crash state. After generating a dump, the
+handler calls a user-specified callback function. The callback function may
+collect additional data about the program’s state, quit the program, launch a
+crash reporter application, or perform other tasks. Allowing for this
+functionality to be dictated by a callback function preserves flexibility.
+
+The sender library is also has a separate implementation for each supported
+platform, because of the varying interfaces for accessing network resources on
+different operating systems. The sender transmits a dump along with other
+application-defined information to a crash report server via HTTP. Because dumps
+may contain sensitive data, the sender allows for the use of HTTPS.
+
+The canonical example of the entire client system would be for a monitored
+application to link against the handler library, install a Breakpad handler from
+its main function, and provide a callback to launch a small crash reporter
+program. The crash reporter program would be linked against the sender library,
+and would send the crash dump when launched. A separate process is recommended
+for this function because of the unreliability inherent in doing any significant
+amount of work from a crashed process.
+
+## Detailed Design
+
+### Exception Handler Installation
+
+The mechanisms for installing an exception handler vary between operating
+systems. On Windows, it’s a relatively simple matter of making one call to
+register a [top-level exception
+filter](http://msdn.microsoft.com/library/en-us/debug/base/setunhandledexceptionfilter.asp)
+callback function. On most Unix-like systems such as Linux, processes are
+informed of exceptions by the delivery of a signal, so an exception handler
+takes the form of a signal handler. The native mechanism to catch exceptions on
+Mac OS X requires a large amount of code to set up a Mach port, identify it as
+the exception port, and assign a thread to listen for an exception on that port.
+Just as the preparation of exception handlers differ, the manner in which they
+are called differs as well. On Windows and most Unix-like systems, the handler
+is called on the thread that caused the exception. On Mac OS X, the thread
+listening to the exception port is notified that an exception has occurred. The
+different implementations of the Breakpad handler libraries perform these tasks
+in the appropriate ways on each platform, while exposing a similar interface on
+each.
+
+A Breakpad handler is embodied in an `ExceptionHandler` object. Because it’s a
+C++ object, `ExceptionHandler`s may be created as local variables, allowing them
+to be installed and removed as functions are called and return. This provides
+one possible way for a developer to monitor only a portion of an application for
+crashes.
+
+### Exception Basics
+
+Once an application encounters an exception, it is in an indeterminate and
+possibly hazardous state. Consequently, any code that runs after an exception
+occurs must take extreme care to avoid performing operations that might fail,
+hang, or cause additional exceptions. This task is not at all straightforward,
+and the Breakpad handler library seeks to do it properly, accounting for all of
+the minute details while allowing other application developers, even those with
+little systems programming experience, to reap the benefits. All of the Breakpad
+handler code that executes after an exception occurs has been written according
+to the following guidelines for safety at exception time:
+
+* Use of the application heap is forbidden. The heap may be corrupt or
+ otherwise unusable, and allocators may not function.
+* Resource allocation must be severely limited. The handler may create a new
+ file to contain the dump, and it may attempt to launch a process to continue
+ handling the crash.
+* Execution on the thread that caused the exception is significantly limited.
+ The only code permitted to execute on this thread is the code necessary to
+ transition handling to a dedicated preallocated handler thread, and the code
+ to return from the exception handler.
+* Handlers shouldn’t handle crashes by attempting to walk stacks themselves,
+ as stacks may be in inconsistent states. Dump generation should be performed
+ by interfacing with the operating system’s memory manager and code module
+ manager.
+* Library code, including runtime library code, must be avoided unless it
+ provably meets the above guidelines. For example, this means that the STL
+ string class may not be used, because it performs operations that attempt to
+ allocate and use heap memory. It also means that many C runtime functions
+ must be avoided, particularly on Windows, because of heap operations that
+ they may perform.
+
+A dedicated handler thread is used to preserve the state of the exception thread
+when an exception occurs: during dump generation, it is difficult if not
+impossible for a thread to accurately capture its own state. Performing all
+exception-handling functions on a separate thread is also critical when handling
+stack-limit-exceeded exceptions. It would be hazardous to run out of stack space
+while attempting to handle an exception. Because of the rule against allocating
+resources at exception time, the Breakpad handler library creates its handler
+thread when it installs its exception handler. On Mac OS X, this handler thread
+is created during the normal setup of the exception handler, and the handler
+thread will be signaled directly in the event of an exception. On Windows and
+Linux, the handler thread is signaled by a small amount of code that executes on
+the exception thread. Because the code that executes on the exception thread in
+this case is small and safe, this does not pose a problem. Even when an
+exception is caused by exceeding stack size limits, this code is sufficiently
+compact to execute entirely within the stack’s guard page without causing an
+exception.
+
+The handler thread may also be triggered directly by a user call, even when no
+exception occurs, to allow dumps to be generated at any point deemed
+interesting.
+
+### Filter Callback
+
+When the handler thread begins handling an exception, it calls an optional
+user-defined filter callback function, which is responsible for judging whether
+Breakpad’s handler should continue handling the exception or not. This mechanism
+is provided for the benefit of library or plug-in code, whose developers may not
+be interested in reports of crashes that occur outside of their modules but
+within processes hosting their code. If the filter callback indicates that it is
+not interested in the exception, the Breakpad handler arranges for it to be
+delivered to any previously-installed handler.
+
+### Dump Generation
+
+Assuming that the filter callback approves (or does not exist), the handler
+writes a dump in a directory specified by the application developer when the
+handler was installed, using a previously generated unique identifier to avoid
+name collisions. The mechanics of dump generation also vary between platforms,
+but in general, the process involves enumerating each thread of execution, and
+capturing its state, including processor context and the active portion of its
+stack area. The dump also includes a list of the code modules loaded in to the
+application, and an indicator of which thread generated the exception or
+requested the dump. In order to avoid allocating memory during this process, the
+dump is written in place on disk.
+
+### Post-Dump Behavior
+
+Upon completion of writing the dump, a second callback function is called. This
+callback may be used to launch a separate crash reporting program or to collect
+additional data from the application. The callback may also be used to influence
+whether Breakpad will treat the exception as handled or unhandled. Even after a
+dump is successfully generated, Breakpad can be made to behave as though it
+didn’t actually handle an exception. This function may be useful for developers
+who want to test their applications with Breakpad enabled but still retain the
+ability to use traditional debugging techniques. It also allows a
+Breakpad-enabled application to coexist with a platform’s native crash reporting
+system, such as Mac OS X’ [CrashReporter](http://developer.apple.com/technotes/tn2004/tn2123.html)
+and [Windows Error Reporting](http://msdn.microsoft.com/isv/resources/wer/).
+
+Typically, when Breakpad handles an exception fully and no debuggers are
+involved, the crashed process will terminate.
+
+Authors of both callback functions that execute within a Breakpad handler are
+cautioned that their code will be run at exception time, and that as a result,
+they should observe the same programming practices that the Breakpad handler
+itself adheres to. Notably, if a callback is to be used to collect additional
+data from an application, it should take care to read only “safe” data. This
+might involve accessing only static memory locations that are updated
+periodically during the course of normal program execution.
+
+### Sender Library
+
+The Breakpad sender library provides a single function to send a crash report to
+a crash server. It accepts a crash server’s URL, a map of key-value parameters
+that will accompany the dump, and the path to a dump file itself. Each of the
+key-value parameters and the dump file are sent as distinct parts of a multipart
+HTTP POST request to the specified URL using the platform’s native HTTP
+facilities. On Linux, [libcurl](http://curl.haxx.se/) is used for this function,
+as it is the closest thing to a standard HTTP library available on that
+platform.
+
+## Future Plans
+
+Although we’ve had great success with in-process dump generation by following
+our guidelines for safe code at exception time, we are exploring options for
+allowing dumps to be generated in a separate process, to further enhance the
+handler library’s robustness.
+
+On Windows, we intend to offer tools to make it easier for Breakpad’s settings
+to be managed by the native group policy management system.
+
+We also plan to offer tools that many developers would find desirable in the
+context of handling crashes, such as a mechanism to determine at launch if the
+program last terminated in a crash, and a way to calculate “crashiness” in terms
+of crashes over time or the number of application launches between crashes.
+
+We are also investigating methods to capture crashes that occur early in an
+application’s launch sequence, including crashes that occur before a program’s
+main function begins executing.
diff --git a/docs/contributing_to_breakpad.md b/docs/contributing_to_breakpad.md
new file mode 100644
index 00000000..b8d261e9
--- /dev/null
+++ b/docs/contributing_to_breakpad.md
@@ -0,0 +1,35 @@
+# Introduction
+
+Thanks for thinking of contributing to Breakpad! Unfortunately there are some
+pesky legal issues to get out of the way, but they're quick and painless.
+
+## Legal
+
+If you're doing work individually, not as part of any employment, you'll need to
+sign the <a
+href='http://code.google.com/legal/individual-cla-v1.0.html'>Individual
+Contributor License Agreement</a>. This agreement can be completed
+electronically.
+
+If you're contributing to Breakpad as part of your employment with another
+organization, you'll need to sign a <a
+href='http://code.google.com/legal/corporate-cla-v1.0.html'> Corporate
+Contributor License Agreement</a>. Once completed this document will need to be
+faxed.
+
+**_IMPORTANT_**: The authors(you!) of the contributions will maintain all
+copyrights; the agreements you sign will grant rights to Google to use your
+work.
+
+Thanks, and if you have any questions let me know and I'll loop in the legal guy
+here to get you an answer.
+
+## Technical
+
+Once you have signed the agreement you can be added to our contributors list and
+have write access to code. For full details on getting started see our trunk
+`README`.
+
+## List of people who have signed contributor agreements
+
+None so far.
diff --git a/docs/exception_handling.md b/docs/exception_handling.md
new file mode 100644
index 00000000..e48a52ae
--- /dev/null
+++ b/docs/exception_handling.md
@@ -0,0 +1,128 @@
+The goal of this document is to give an overview of the exception handling
+options in breakpad.
+
+# Basics
+
+Exception handling is a mechanism designed to handle the occurrence of
+exceptions, special conditions that change the normal flow of program execution.
+
+`SetUnhandledExceptionFilter` replaces all unhandled exceptions when Breakpad is
+enabled. TODO: More on first and second change and vectored v. try/catch.
+
+There are two main types of exceptions across all platforms: in-process and
+out-of-process.
+
+# In-Process
+
+In process exception handling is relatively simple since the crashing process
+handles crash reporting. It is generally considered unsafe to write a minidump
+from a crashed process. For example, key data structures could be corrupted or
+the stack on which the exception handler runs could have been overwritten. For
+this reason all platforms also support some level of out-of-process exception
+handling.
+
+## Windows
+
+In-process exception handling Breakpad creates a 'handler head' that waits
+infinitely on a semaphore at start up. When this thread is woken it writes the
+minidump and signals to the excepting thread that it may continue. A filter will
+tell the OS to kill the process if the minidump is written successfully.
+Otherwise it continues.
+
+# Out-of-Process
+
+Out-of-process exception handling is more complicated than in-process exception
+handling because of the need to set up a separate process that can read the
+state of the crashing process.
+
+## Windows
+
+Breakpad uses two abstractions around the exception handler to make things work:
+`CrashGenerationServer` and `CrashGenerationClient`. The constructor for these
+takes a named pipe name.
+
+During server start up a named pipe and registers callbacks for client
+connections are created. The named pipe is used for registration and all IO on
+the pipe is done asynchronously. `OnPipeConnected` is called when a client
+attempts to connect (call `CreateFile` on the pipe). `OnPipeConnected` does the
+state machine transition from `Initial` to `Connecting` and on through
+`Reading`, `Reading_Done`, `Writing`, `Writing_Done`, `Reading_ACK`, and
+`Disconnecting`.
+
+When registering callbacks, the client passes in two pointers to pointers: 1. A
+pointer to the `EXCEPTION_INFO` pointer 1. A pointer to the `MDRawAssertionInfo`
+which handles various non-exception failures like assertions
+
+The essence of registration is adding a "`ClientInfo`" object that contains
+handles used for synchronization with the crashing process to an array
+maintained by the server. This is how we can keep track of all the clients on
+the system that have registered for minidumps. These handles are: *
+`server_died(mutex)` * `dump_requested(Event)` * `dump_generated(Event)`
+
+The server registers asynchronous waits on these events with the `ClientInfo`
+object as the callback context. When the `dump_requested` event is set by the
+client, the `OnDumpRequested()` callback is called. The server uses the handles
+inside `ClientInfo` to communicate with the child process. Once the child sets
+the event, it waits for two objects: 1. the `dump_generated` event 1. the
+`server_died` mutex
+
+In the end handles are "duped" into the client process, and the clients use
+`SetEvent` to request events, wait on the other event, or the `server_died`
+mutex.
+
+## Linux
+
+### Current Status
+
+As of July 2011, Linux had a minidump generator that is not entirely
+out-of-process. The minidump was generated from a separate process, but one that
+shared an address space, file descriptors, signal handles and much else with the
+crashing process. It worked by using the `clone()` system call to duplicate the
+crashing process, and then uses `ptrace()` and the `/proc` file system to
+retrieve the information required to write the minidump. Since then Breakpad has
+updated Linux exception handling to provide more benefits of out-of-process
+report generation.
+
+### Proposed Design
+
+#### Overview
+
+Breakpad would use a per-user daemon to write out a minidump that does not have,
+interact with or depend on the crashing process. We don't want to start a new
+separate process every time a user launches a Breakpad-enabled process. Doing
+one daemon per machine is unacceptable for security concerns around one user
+being able to initiate a minidump generation for another user's process.
+
+#### Client/Server Communication
+
+On Breakpad initialization in a process, the initializer would check if the
+daemon is running and, if not, start it. The race condition between the check
+and the initialization is not a problem because multiple daemons can check if
+the IPC endpoint already exists and if a server is listening. Even if multiple
+copies of the daemon try to `bind()` the filesystem to name the socket, all but
+one will fail and can terminate.
+
+This point is relevant for error handling conditions. Linux does not clean the
+file system representation of a UNIX domain socket even if both endpoints
+terminate, so checking for existence is not strong enough. However checking the
+process list or sending a ping on the socket can handle this.
+
+Breakpad uses UNIX domain sockets since they support full duplex communication
+(unlike Windows, named pipes on Linux are half) and the kernal automatically
+creates a private channel between the client and server once the client calls
+`connect()`.
+
+#### Minidump Generation
+
+Breakpad could use the current system with `ptrace()` and `/proc` within the
+daemon executable.
+
+Overall the operations look like: 1. Signal from OS indicating crash 1. Signal
+Handler suspends all threads except itself 1. Signal Handler sends
+`CRASH_DUMP_REQUEST` message to server and waits for response 1. Server inspects
+1. Minidump is asynchronously written to disk by the server 1. Server responds
+indicating inspection is done
+
+## Mac OSX
+
+Out-of-process exception handling is fully supported on Mac.
diff --git a/docs/getting_started_with_breakpad.md b/docs/getting_started_with_breakpad.md
new file mode 100644
index 00000000..b827d401
--- /dev/null
+++ b/docs/getting_started_with_breakpad.md
@@ -0,0 +1,115 @@
+# Introduction
+
+Breakpad is a library and tool suite that allows you to distribute an
+application to users with compiler-provided debugging information removed,
+record crashes in compact "minidump" files, send them back to your server, and
+produce C and C++ stack traces from these minidumps. Breakpad can also write
+minidumps on request for programs that have not crashed.
+
+Breakpad is currently used by Google Chrome, Firefox, Google Picasa, Camino,
+Google Earth, and other projects.
+
+![Workflow](breakpad.png)
+
+Breakpad has three main components:
+
+* The **client** is a library that you include in your application. It can
+ write minidump files capturing the current threads' state and the identities
+ of the currently loaded executable and shared libraries. You can configure
+ the client to write a minidump when a crash occurs, or when explicitly
+ requested.
+
+* The **symbol dumper** is a program that reads the debugging information
+ produced by the compiler and produces a **symbol file**, in [Breakpad's own
+ format](symbol_files.md).
+
+* The **processor** is a program that reads a minidump file, finds the
+ appropriate symbol files for the versions of the executables and shared
+ libraries the minidump mentions, and produces a human-readable C/C++ stack
+ trace.
+
+# The minidump file format
+
+The minidump file format is similar to core files but was developed by Microsoft
+for its crash-uploading facility. A minidump file contains:
+
+* A list of the executable and shared libraries that were loaded in the
+ process at the time the dump was created. This list includes both file names
+ and identifiers for the particular versions of those files that were loaded.
+
+* A list of threads present in the process. For each thread, the minidump
+ includes the state of the processor registers, and the contents of the
+ threads' stack memory. These data are uninterpreted byte streams, as the
+ Breakpad client generally has no debugging information available to produce
+ function names or line numbers, or even identify stack frame boundaries.
+
+* Other information about the system on which the dump was collected:
+ processor and operating system versions, the reason for the dump, and so on.
+
+Breakpad uses Windows minidump files on all platforms, instead of the
+traditional core files, for several reasons:
+
+* Core files can be very large, making them impractical to send across a
+ network to the collector for processing. Minidumps are smaller, as they were
+ designed to be used this way.
+
+* The core file format is poorly documented. For example, the Linux Standards
+ Base does not describe how registers are stored in `PT_NOTE` segments.
+
+* It is harder to persuade a Windows machine to produce a core dump file than
+ it is to persuade other machines to write a minidump file.
+
+* It simplifies the Breakpad processor to support only one file format.
+
+# Overview/Life of a minidump
+
+A minidump is generated via calls into the Breakpad library. By default,
+initializing Breakpad installs an exception/signal handler that writes a
+minidump to disk at exception time. On Windows, this is done via
+`SetUnhandledExceptionFilter()`; on OS X, this is done by creating a thread that
+waits on the Mach exception port; and on Linux, this is done by installing a
+signal handler for various exceptions like `SIGILL, SIGSEGV` etc.
+
+Once the minidump is generated, each platform has a slightly different way of
+uploading the crash dump. On Windows & Linux, a separate library of functions is
+provided that can be called into to do the upload. On OS X, a separate process
+is spawned that prompts the user for permission, if configured to do so, and
+sends the file.
+
+# Terminology
+
+**In-process vs. out-of-process exception handling** - it's generally considered
+that writing the minidump from within the crashed process is unsafe - key
+process data structures could be corrupted, or the stack on which the exception
+handler runs could have been overwritten, etc. All 3 platforms support what's
+known as "out-of-process" exception handling.
+
+# Integration overview
+
+## Breakpad Code Overview
+
+All the client-side code is found by visiting the Google Project at
+https://chromium.googlesource.com/breakpad/breakpad. The following directory structure is
+present in the `src` directory:
+
+* `processor` Contains minidump-processing code that is used on the server
+ side and isn't of use on the client side
+* `client` Contains client minidump-generation libraries for all platforms
+* `tools` Contains source code & projects for building various tools on each
+ platform.
+
+(Among other directories)
+
+* [Windows Integration Guide](windows_client_integration.md)
+* [Mac Integration Guide](mac_breakpad_starter_guide.md)
+* [Linux Integration Guide](linux_starter_guide.md)
+
+## Build process specifics(symbol generation)
+
+This applies to all platforms. Inside `src/tools/{platform}/dump_syms` is a tool
+that can read debugging information for each platform (e.g. for OS X/Linux,
+DWARF and STABS, and for Windows, PDB files) and generate a Breakpad symbol
+file. This tool should be run on your binary before it's stripped(in the case of
+OS X/Linux) and the symbol files need to be stored somewhere that the minidump
+processor can find. There is another tool, `symupload`, that can be used to
+upload symbol files if you have written a server that can accept them.
diff --git a/docs/linux_starter_guide.md b/docs/linux_starter_guide.md
new file mode 100644
index 00000000..41e1162f
--- /dev/null
+++ b/docs/linux_starter_guide.md
@@ -0,0 +1,110 @@
+# How To Add Breakpad To Your Linux Application
+
+This document is an overview of using the Breakpad client libraries on Linux.
+
+## Building the Breakpad libraries
+
+Breakpad provides an Autotools build system that will build both the Linux
+client libraries and the processor libraries. Running `./configure && make` in
+the Breakpad source directory will produce
+**src/client/linux/libbreakpad\_client.a**, which contains all the code
+necessary to produce minidumps from an application.
+
+## Integrating Breakpad into your Application
+
+First, configure your build process to link **libbreakpad\_client.a** into your
+binary, and set your include paths to include the **src** directory in the
+**google-breakpad** source tree. Next, include the exception handler header:
+
+```cpp
+#include "client/linux/handler/exception_handler.h"
+```
+
+Now you can instantiate an `ExceptionHandler` object. Exception handling is active for the lifetime of the `ExceptionHandler` object, so you should instantiate it as early as possible in your application's startup process, and keep it alive for as close to shutdown as possible. To do anything useful, the `ExceptionHandler` constructor requires a path where it can write minidumps, as well as a callback function to receive information about minidumps that were written:
+
+```cpp
+static bool dumpCallback(const google_breakpad::MinidumpDescriptor& descriptor,
+void* context, bool succeeded) {
+ printf("Dump path: %s\n", descriptor.path());
+ return succeeded;
+}
+
+void crash() { volatile int* a = (int*)(NULL); *a = 1; }
+
+int main(int argc, char* argv[]) {
+ google_breakpad::MinidumpDescriptor descriptor("/tmp");
+ google_breakpad::ExceptionHandler eh(descriptor, NULL, dumpCallback, NULL, true, -1);
+ crash();
+ return 0;
+}
+```
+
+Compiling and running this example should produce a minidump file in /tmp, and
+it should print the minidump filename before exiting. You can read more about
+the other parameters to the `ExceptionHandler` constructor [in the exception_handler.h source file][1].
+
+[1]: https://chromium.googlesource.com/breakpad/breakpad/+/master/src/client/linux/handler/exception_handler.h
+
+**Note**: You should do as little work as possible in the callback function.
+Your application is in an unsafe state. It may not be safe to allocate memory or
+call functions from other shared libraries. The safest thing to do is `fork` and
+`exec` a new process to do any work you need to do. If you must do some work in
+the callback, the Breakpad source contains [some simple reimplementations of libc functions][2], to avoid calling directly into
+libc, as well as [a header file for making Linux system calls][3] (in **src/third\_party/lss**) to avoid calling into other shared libraries.
+
+[2]: https://chromium.googlesource.com/breakpad/breakpad/+/master/src/common/linux/linux_libc_support.h
+[3]: https://chromium.googlesource.com/linux-syscall-support/+/master
+
+## Sending the minidump file
+
+In a real application, you would want to handle the minidump in some way, likely
+by sending it to a server for analysis. The Breakpad source tree contains [some
+HTTP upload source][4] that you might find useful, as well as [a minidump upload tool][5].
+
+[4]: https://chromium.googlesource.com/breakpad/breakpad/+/master/src/common/linux/http_upload.h
+[5]: https://chromium.googlesource.com/breakpad/breakpad/+/master/src/tools/linux/symupload/minidump_upload.cc
+
+## Producing symbols for your application
+
+To produce useful stack traces, Breakpad requires you to convert the debugging
+symbols in your binaries to [text-format symbol files][6]. First, ensure that you've compiled your binaries with `-g` to
+include debugging symbols. Next, compile the `dump_syms` tool by running
+`configure && make` in the Breakpad source directory. Next, run `dump_syms` on
+your binaries to produce the text-format symbols. For example, if your main
+binary was named `test`:
+
+[6]: https://chromium.googlesource.com/breakpad/breakpad/+/master/docs/symbol_files.md
+
+```
+$ google-breakpad/src/tools/linux/dump_syms/dump_syms ./test > test.sym
+```
+
+In order to use these symbols with the `minidump_stackwalk` tool, you will need
+to place them in a specific directory structure. The first line of the symbol
+file contains the information you need to produce this directory structure, for
+example (your output will vary):
+
+```
+$ head -n1 test.sym MODULE Linux x86_64 6EDC6ACDB282125843FD59DA9C81BD830 test
+$ mkdir -p ./symbols/test/6EDC6ACDB282125843FD59DA9C81BD830
+$ mv test.sym ./symbols/test/6EDC6ACDB282125843FD59DA9C81BD830
+```
+
+You may also find the [symbolstore.py][7] script in the Mozilla repository useful, as it encapsulates these steps.
+
+[7]: https://dxr.mozilla.org/mozilla-central/source/toolkit/crashreporter/tools/symbolstore.py
+
+## Processing the minidump to produce a stack trace
+
+Breakpad includes a tool called `minidump_stackwalk` which can take a minidump
+plus its corresponding text-format symbols and produce a symbolized stacktrace.
+It should be in the **google-breakpad/src/processor** directory if you compiled
+the Breakpad source using the directions above. Simply pass it the minidump and
+the symbol path as commandline parameters:
+
+```
+$ google-breakpad/src/processor/minidump_stackwalk minidump.dmp ./symbols
+```
+
+It produces verbose output on stderr, and the stacktrace on stdout, so you may
+want to redirect stderr.
diff --git a/docs/linux_system_calls.md b/docs/linux_system_calls.md
new file mode 100644
index 00000000..17ada7e0
--- /dev/null
+++ b/docs/linux_system_calls.md
@@ -0,0 +1,47 @@
+# Introduction
+
+Linux implements its userland-to-kernel transition using a special library
+called linux-gate.so that is mapped by the kernel into every process. For more
+information, see
+
+http://www.trilithium.com/johan/2005/08/linux-gate/
+
+In a nutshell, the problem is that the system call gate function,
+kernel\_vsyscall does not use EBP to point to the frame pointer.
+
+However, the Breakpad processor supports special frames like this via STACK
+lines in the symbol file. If you look in src/client/linux/data you will see
+symbol files for linux-gate.so for both Intel & AMD(the implementation of
+kernel\_vsyscall changes depending on the CPU manufacturer). When processing
+minidumps from Linux 2.6, having these symbol files is necessary for walking the
+stack for crashes that happen while a thread is in a system call.
+
+If you're just interested in processing minidumps, those two symbol files should
+be all you need!
+
+# Details
+
+The particular details of understanding the linux-gate.so symbol files can be
+found by reading about STACK lines inside
+src/common/windows/pdb\_source\_line\_writer.cc, and the above link. To
+summarize briefly, we just have to inform the processor how to get to the
+previous frame when the EIP is inside kernel\_vsyscall, and we do that by
+telling the processor how many bytes kernel\_vsyscall has pushed onto the stack
+in it's prologue. For example, one of the symbol files looks somewhat like the
+following:
+
+MODULE Linux x86 random\_debug\_id linux-gate.so PUBLIC 400 0 kernel\_vsyscall
+STACK WIN 4 100 1 1 0 0 0 0 0 1
+
+The PUBLIC line indicates that kernel\_vsyscall is at offset 400 (in bytes) from
+the beginning of linux-gate.so. The STACK line indicates the size of the
+function(100), how many bytes it pushes(1), and how many bytes it pops(1). The
+last 1 indicates that EBP is pushed onto the stack before being used by the
+function.
+
+# Warnings
+
+These functions might change significantly depending on kernel version. In my
+opinion, the actual function stack information is unlikely to change frequently,
+but the Linux kernel might change the address of kernel\_vsyscall w.r.t the
+beginning of linux-gate.so, which would cause these symbol files to be invalid.
diff --git a/docs/mac_breakpad_starter_guide.md b/docs/mac_breakpad_starter_guide.md
new file mode 100644
index 00000000..6e0bdb0e
--- /dev/null
+++ b/docs/mac_breakpad_starter_guide.md
@@ -0,0 +1,184 @@
+# How To Add Breakpad To Your Mac Client Application
+
+This document is a step-by-step recipe to get your Mac client app to build with
+Breakpad.
+
+## Preparing a binary build of Breakpad for use in your tree
+
+You can either check in a binary build of the Breakpad framework & tools or
+build it as a dependency of your project. The former is recommended, and
+detailed here, since building dependencies through other projects is
+problematic(matching up configuration names), and the Breakpad code doesn't
+change nearly often enough as your application's will.
+
+## Building the requisite targets
+
+All directories are relative to the `src` directory of the Breakpad checkout.
+
+* Build the 'All' target of `client/mac/Breakpad.xcodeproj` in Release mode.
+* Execute `cp -R client/mac/build/Release/Breakpad.framework <location in your
+ source tree>`
+* Inside `tools/mac/dump_syms` directory, build dump\_syms.xcodeproj, and copy
+ tools/mac/dump\_syms/build/Release/dump\_syms to a safe location where it
+ can be run during the build process.
+
+## Adding Breakpad.framework
+
+Inside your application's framework, add the Breakpad.Framework to your
+project's framework settings. When you select it from the file chooser, it will
+let you pick a target to add it to; go ahead and check the one that's relevant
+to your application.
+
+## Copy Breakpad into your Application Package
+
+Copy Breakpad into your Application Package, so it will be around at run time.
+
+Go to the Targets section of your Xcode Project window. Hit the disclosure
+triangle to reveal the build phases of your application. Add a new Copy Files
+phase using the Contextual menu (Control Click). On the General panel of the new
+'Get Info' of this new phase, set the destination to 'Frameworks' Close the
+'Info' panel. Use the Contextual Menu to Rename your new phase 'Copy Frameworks'
+Now drag Breakpad again into this Copy Frameworks phase. Drag it from whereever
+it appears in the project file tree.
+
+## Add a New Run Script build phase
+
+Near the end of the build phases, add a new Run Script build phase. This will be
+run before Xcode calls /usr/bin/strip on your project. This is where you'll be
+calling dump\_sym to output the symbols for each architecture of your build. In
+my case, the relevant lines read:
+
+```
+#!/bin/sh
+$TOOL_DIR=<location of dump_syms from step 3 above>
+
+"$TOOL_DIR/dump_syms" -a ppc "$PROD" > "$TARGET_NAME ppc.breakpad"
+
+"$TOOL_DIR/dump_syms" -a i386 "$PROD" > "$TARGET_NAME i386.breakpad"
+```
+
+## Adjust the Project Settings
+
+* Turn on Separate Strip,
+* Set the Strip Style to Non-Global Symbols.
+
+## Write Code!
+
+You'll need to have an object that acts as the delegate for NSApplication.
+Inside this object's header, you'll need to add
+
+1. add an ivar for Breakpad and
+2. a declaration for the applicationShouldTerminate:(NSApplication`*` sender)
+ message.
+
+```
+#import <Breakpad/Breakpad.h>
+
+@interface BreakpadTest : NSObject {
+ .
+ .
+ .
+ BreakpadRef breakpad;
+ .
+ .
+ .
+}
+.
+.
+- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender;
+.
+.
+@end
+```
+
+Inside your object's implementation file,
+
+1. add the following method InitBreakpad
+2. modify your awakeFromNib method to look like the one below,
+3. modify/add your application's delegate method to look like the one below
+
+```
+static BreakpadRef InitBreakpad(void) {
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ BreakpadRef breakpad = 0;
+ NSDictionary *plist = [[NSBundle mainBundle] infoDictionary];
+ if (plist) {
+ // Note: version 1.0.0.4 of the framework changed the type of the argument
+ // from CFDictionaryRef to NSDictionary * on the next line:
+ breakpad = BreakpadCreate(plist);
+ }
+ [pool release];
+ return breakpad;
+}
+
+- (void)awakeFromNib {
+ breakpad = InitBreakpad();
+}
+
+- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender {
+ BreakpadRelease(breakpad);
+ return NSTerminateNow;
+}
+```
+
+## Configure Breakpad
+
+Configure Breakpad for your application.
+
+1. Take a look inside the Breakpad.framework at the Breakpad.h file for the
+ keys, default values, and descriptions to be passed to BreakpadCreate().
+2. Add/Edit the Breakpad specific entries in the dictionary passed to
+ BreakpadCreate() -- typically your application's info plist.
+
+Example from the Notifier Info.plist:
+`<key>BreakpadProduct</key><string>Google_Notifier_Mac</string>
+<key>BreakpadProductDisplay</key><string>${PRODUCT_NAME}</string>
+`
+
+## Build Your Application
+
+Almost done!
+
+## Verify
+
+Double-check:
+
+Your app should have in its package contents:
+myApp.app/Contents/Frameworks/Breakpad.framework.
+
+The symbol files have reasonable contents (you can look at them with a text
+editor.)
+
+Look again at the Copy Frameworks phase of your project. Are you leaking .h
+files? Select them and delete them. (If you drag a bunch of files into your
+project, Xcode often wants to copy your .h files into the build, revealing
+Google secrets. Be vigilant!)
+
+## Upload the symbol file
+
+You'll need to configure your build process to store symbols in a location that
+is accessible by the minidump processor. There is a tool in tools/mac/symupload
+that can be used to send the symbol file via HTTP post.
+
+1. Test
+
+Configure breakpad to send reports to a URL by adding to your app's Info.plist:
+
+```
+<key>BreakpadURL</key>
+<string>upload URL</string>
+<key>BreakpadReportInterval</key>
+<string>30</string>
+```
+
+## Final Notes
+
+Breakpad checks whether it is being run under a debugger, and if so, normally
+does nothing. But, you can force Breakpad to function under a debugger by
+setting the Unix shell variable BREAKPAD\_IGNORE\_DEBUGGER to a non-zero value.
+You can bracket the source code in the above Write The Code step with #if DEBUG
+to completely eliminate it from Debug builds. See
+//depot/googlemac/GoogleNotifier/main.m for an example. FYI, when your process
+forks(), exception handlers are reset to the default for child processes. So
+they must reinitialize Breakpad, otherwise exceptions will be handled by Apple's
+Crash Reporter.
diff --git a/docs/mozilla_brown_bag_talk.md b/docs/mozilla_brown_bag_talk.md
new file mode 100644
index 00000000..82461b3d
--- /dev/null
+++ b/docs/mozilla_brown_bag_talk.md
@@ -0,0 +1,82 @@
+# Breakpad Crash Reporting for Mozilla
+
+* January 24, 2007
+ * Links updated February 14, 2007
+* Mozilla HQ
+* Mark Mentovai
+* Brian Ryner
+
+## What is a crash reporter?
+
+* Enables developers to analyze crashes that occur in the wild
+* Produces stack backtraces that help identify how a program failed
+* Offers higher-level data aggregation (topcrashes, MTBF statistics)
+
+## Motivation
+
+* Talkback is proprietary and unmaintained
+* Smaller open-source projects have few options
+* Larger projects need flexibility and scalability
+
+## Design Options
+
+* Stackwalking done on client
+ * Apple CrashReporter
+ * GNOME BugBuddy
+* Client sends memory dump
+ * Talkback
+ * Windows Error Reporting
+ * Breakpad
+
+## Goals
+
+* Provide libraries around which systems can be based
+* Open-source
+* Cross-platform
+ * Mac OS X x86, PowerPC
+ * Linux x86
+ * Windows x86
+* No requirement to distribute symbols
+
+## Client Libraries
+
+* Exception handler installed at application startup
+ * Spawns a separate thread
+* Minidump file written at crash time
+ * Format used by Windows debuggers
+* Separate application invoked to send
+ * HTTP[S](S.md) POST, can include additional parameters
+
+## Symbols
+
+* Cross-platform symbol file format
+* Contents
+ * Function names
+ * Source file names and line numbers
+ * Windows: Frame pointer omission data
+ * Future: parameters and local variables
+* Symbol conversion methods
+
+## Processor
+
+* Examines minidump file and invokes stackwalker
+* Symbol files requested from a SymbolSupplier
+* Produces stack trace
+* Output may be placed where convenient
+
+## Intergation
+
+* Breakpad client present in Gran Paradiso Alpha 1 for Windows
+ * Disabled by default
+ * Enable with `MOZ_AIRBAG`
+* Proof-of-concept collector
+ * http://mavra.perilith.com/~luser/airbag-collector/list.pl
+* Other platforms coming soon
+
+## More Information
+
+* Project home: https://chromium.googlesource.com/breakpad/breakpad
+* Mailing lists
+ * [google-breakpad-dev@googlegroups.com](http://groups.google.com/group/google-breakpad-dev/)
+ * [google-breakpad-discuss@googlegroups.com](http://groups.google.com/group/google-breakpad-discuss/)
+* Ask me (irc.mozilla.org: mento)
diff --git a/docs/processor_design.md b/docs/processor_design.md
new file mode 100644
index 00000000..7b9f244d
--- /dev/null
+++ b/docs/processor_design.md
@@ -0,0 +1,231 @@
+# Breakpad Processor Library
+
+## Objective
+
+The Breakpad processor library is an open-source framework to access the the
+information contained within crash dumps for multiple platforms, and to use that
+information to produce stack traces showing the call chain of each thread in a
+process. After processing, this data is made available to users of the library.
+
+## Background
+
+The Breakpad processor is intended to sit at the core of a comprehensive
+crash-reporting system that does not require debugging information to be
+provided to those running applications being monitored. Some existing
+crash-reporting systems, such as [GNOME](http://www.gnome.org/)’s Bug-Buddy and
+[Apple](http://www.apple.com/)’s
+[CrashReporter](http://developer.apple.com/technotes/tn2004/tn2123.html),
+require symbolic
+information to be present on the end user’s computer; in the case of
+CrashReporter, the reports are transmitted only to Apple, not to third-party
+developers. Other systems, such as [Microsoft](http://www.microsoft.com/)’s
+[Windows Error Reporting](http://msdn.microsoft.com/isv/resources/wer/) and
+SupportSoft’s Talkback, transmit only a snapshot of a crashed process’ state,
+which can later be combined with symbolic debugging information without the need
+for it to be present on end users’ computers. Because symbolic debugging
+information consumes a large amount of space and is otherwise not needed during
+the normal operation of software, and because some developers are reluctant to
+release debugging symbols to their customers, Breakpad follows the latter
+approach.
+
+We know of no currently-maintained crash-reporting systems that meet our
+requirements, which are to: * allow for symbols to be separate from the
+application, * handle crash reports from multiple platforms, * allow developers
+to operate their own crash-reporting platform, and to * be open-source. Windows
+Error Reporting only functions for Microsoft products, and requires the
+involvement of Microsoft’s servers. Talkback, while cross-platform, has not been
+maintained and at this point does not support Mac OS X on x86, which we consider
+to be a significant platform. Talkback is also closed-source commercial
+software, and has very specific requirements for its server platform.
+
+We are aware of Windows-only crash-reporting systems that leverage Microsoft’s
+debugging interfaces. Such systems, even if extended to support dumps from other
+platforms, are tied to using Windows for at least a portion of the processor
+platform.
+
+## Overview
+
+The Breakpad processor itself is written in standard C++ and will work on a
+variety of platforms. The dumps it accepts may also have been created on a
+variety of systems. The library is able to combine dumps with symbolic debugging
+information to create stack traces that include function signatures. The
+processor library includes simple command-line tools to examine dumps and
+process them, producing stack traces. It also exposes several layers of APIs
+enabling crash-reporting systems to be built around the Breakpad processor.
+
+## Detailed Design
+
+### Dump Files
+
+In the processor, the dump data is of primary significance. Dumps typically
+contain:
+
+* CPU context (register data) as it was at the time the crash occurred, and an
+ indication of which thread caused the crash. General-purpose registers are
+ included, as are special-purpose registers such as the instruction pointer
+ (program counter).
+* Information about each thread of execution within a crashed process,
+ including:
+ * The memory region used for each thread’s stack.
+ * CPU context for each thread, which for various reasons is not the same
+ as the crash context in the case of the crashed thread.
+* A list of loaded code segments (or modules), including:
+ * The name of the file (`.so`, `.exe`, `.dll`, etc.) which provides the
+ code.
+ * The boundaries of the memory region in which the code segment is visible
+ to the process.
+ * A reference to the debugging information for the code module, when such
+ information is available.
+
+Ordinarily, dumps are produced as a result of a crash, but other triggers may be
+set to produce dumps at any time a developer deems appropriate. The Breakpad
+processor can handle dumps in the minidump format, either generated by an
+[Breakpad client “handler”](client_design.md) implementation, or by another
+implementation that produces dumps in this format. The
+[DbgHelp.dll!MiniDumpWriteDump](http://msdn2.microsoft.com/en-us/library/ms680360.aspx)
+function on Windows
+produces dumps in this format, and is the basis for the Breakpad handler
+implementation on that platform.
+
+The [minidump format](http://msdn.microsoft.com/en-us/library/ms679293%28VS.85%29.aspx) is
+essentially a simple container format, organized as a series of streams. Each
+stream contains some type of data relevant to the crash. A typical “normal”
+minidump contains streams for the thread list, the module list, the CPU context
+at the time of the crash, and various bits of additional system information.
+Other types of minidump can be generated, such as a full-memory minidump, which
+in addition to stack memory contains snapshots of all of a process’ mapped
+memory regions.
+
+The minidump format was chosen as Breakpad’s dump format because it has an
+established track record on Windows, and it can be adapted to meet the needs of
+the other platforms that Breakpad supports. Most other operating systems use
+“core” files as their native dump formats, but the capabilities of core files
+vary across platforms, and because core files are usually presented in a
+platform’s native executable format, there are complications involved in
+accessing the data contained therein without the benefit of the header files
+that define an executable format’s entire structure. Because minidumps are
+leaner than a typical executable format, a redefinition of the format in a
+cross-platform header file, `minidump_format.h`, was a straightforward task.
+Similarly, the capabilities of the minidump format are understood, and because
+it provides an extensible container, any of Breakpad’s needs that could not be
+met directly by the standard minidump format could likely be met by extending it
+as needed. Finally, using this format means that the dump file is compatible
+with native debugging tools at least on Windows. A possible future avenue for
+exploration is the conversion of minidumps to core files, to enable this same
+benefit on other platforms.
+
+We have already provided an extension to the minidump format that allows it to
+carry dumps generated on systems with PowerPC processors. The format already
+allows for variable CPUs, so our work in this area was limited to defining a
+context structure sufficient to represent the execution state of a PowerPC. We
+have also defined an extension that allows minidumps to indicate which thread of
+execution requested a dump be produced for non-crash dumps.
+
+Often, the information contained within a dump alone is sufficient to produce a
+full stack backtrace for each thread. Certain optimizations that compilers
+employ in producing code frustrate this process. Specifically, the “frame
+pointer omission” optimization of x86 compilers can make it impossible to
+produce useful stack traces given only a stack snapshot and CPU context. In
+these cases, however, compiler-emitted debugging information can aid in
+producing useful stack traces. The Breakpad processor is able to take advantage
+of this debugging information as supplied by Microsoft’s C/C++ compiler, the
+only compiler to apply such optimizations by default. As a result, the Breakpad
+processor can produce useful stack traces even from code with frame pointer
+omission optimizations as produced by this compiler.
+
+### Symbol Files
+
+The [symbol files](symbol_files.md) that the Breakpad processor accepts allow
+for frame pointer omission data, but this is only one of their capabilities.
+Each symbol file also includes information about the functions, source files,
+and source code line numbers for a single module of code. A module is an
+individually-loadble chunk of code: these can be executables containing a main
+program (`exe` files on Windows) or shared libraries (`.so` files on Linux,
+`.dylib` files, frameworks, and bundles on Mac OS X, and `.dll` files on
+Windows). Dumps contain information about which of these modules were loaded at
+the time the dump was produced, and given this information, the Breakpad
+processor attempts to locate debugging symbols for the module through a
+user-supplied function embodied in a “symbol supplier.” Breakpad includes a
+sample symbol supplier, called `SimpleSymbolSupplier`, that is used by its
+command-line tools; this supplier locates symbol files by pathname.
+`SimpleSymbolSupplier` is also available to other users of the Breakpad
+processor library. This allows for the use of a simple reference implementation,
+but preserves flexibility for users who may have more demanding symbol file
+storage needs.
+
+Breakpad’s symbol file format is text-based, and was defined to be fairly
+human-readable and to encompass the needs of multiple platforms. The Breakpad
+processor itself does not operate directly with native symbol formats
+([DWARF](http://dwarf.freestandards.org/) and
+[STABS](http://sourceware.org/gdb/current/onlinedocs/stabs.html)
+on most Unix-like systems,
+[.pdb files](http://msdn2.microsoft.com/en-us/library/yd4f8bd1(VS.80).aspx)
+on Windows),
+because of the complications in accessing potentially complex symbol formats
+with slight variations between platforms, stored within different types of
+binary formats. In the case of `.pdb` files, the debugging format is not even
+documented. Instead, Breakpad’s symbol files are produced on each platform,
+using specific debugging APIs where available, to convert native symbols to
+Breakpad’s cross-platform format.
+
+### Processing
+
+Most commonly, a developer will enable an application to use Breakpad by
+building it with a platform-specific [client “handler”](client_design.md)
+library. After building the application, the developer will create symbol files
+for Breakpad’s use using the included `dump_syms` or `symupload` tools, or
+another suitable tool, and place the symbol files where the processor’s symbol
+supplier will be able to locate them.
+
+When a dump file is given to the processor’s `MinidumpProcessor` class, it will
+read it using its included minidump reader, contained in the `Minidump` family
+of classes. It will collect information about the operating system and CPU that
+produced the dump, and determine whether the dump was produced as a result of a
+crash or at the direct request of the application itself. It then loops over all
+of the threads in a process, attempting to walk the stack associated with each
+thread. This process is achieved by the processor’s `Stackwalker` components, of
+which there are a slightly different implementations for each CPU type that the
+processor is able to handle dumps from. Beginning with a thread’s context, and
+possibly using debugging data, the stackwalker produces a list of stack frames,
+containing each instruction executed in the chain. These instructions are
+matched up with the modules that contributed them to a process, and the
+`SymbolSupplier` is invoked to locate a symbol file. The symbol file is given to
+a `SourceLineResolver`, which matches the instruction up with a specific
+function name, source file, and line number, resulting in a representation of a
+stack frame that can easily be used to identify which code was executing.
+
+The results of processing are made available in a `ProcessState` object, which
+contains a vector of threads, each containing a vector of stack frames.
+
+For small-scale use of the Breakpad processor, and for testing and debugging,
+the `minidump_stackwalk` tool is provided. It invokes the processor and displays
+the full results of processing, optionally allowing symbols to be provided to
+the processor by a pathname-based symbol supplier, `SimpleSymbolSupplier`.
+
+For lower-level testing and debugging, the processor library also includes a
+`minidump_dump` tool, which walks through an entire minidump file and displays
+its contents in somewhat readable form.
+
+### Platform Support
+
+The Breakpad processor library is able to process dumps produced on Mac OS X
+systems running on x86, x86-64, and PowerPC processors, on Windows and Linux
+systems running on x86 or x86-64 processors, and on Android systems running ARM
+or x86 processors. The processor library itself is written in standard C++, and
+should function properly in most Unix-like environments. It has been tested on
+Linux and Mac OS X.
+
+## Future Plans
+
+There are currently no firm plans or timetables to implement any of these
+features, although they are possible avenues for future exploration.
+
+The symbol file format can be extended to carry information about the locations
+of parameters and local variables as stored in stack frames and registers, and
+the processor can use this information to provide enhanced stack traces showing
+function arguments and variable values.
+
+On Mac OS X and Linux, we can provide tools to convert files from the minidump
+format into the native core format. This will enable developers to open dump
+files in a native debugger, just as they are presently able to do with minidumps
+on Windows.
diff --git a/docs/stack_walking.md b/docs/stack_walking.md
new file mode 100644
index 00000000..94111594
--- /dev/null
+++ b/docs/stack_walking.md
@@ -0,0 +1,144 @@
+# Introduction
+
+This page aims to provide a detailed description of how Breakpad produces stack
+traces from the information contained within a minidump file.
+
+# Details
+
+## Starting the Process
+
+Typically the stack walking process is initiated by instantiating the
+[MinidumpProcessor](../src/processor/minidump_processor.cc)
+class and calling the [MinidumpProcessor::Process](../src/processor/minidump_processor.cc#61)
+method, providing it a minidump file to process. To produce a useful stack
+trace, the MinidumpProcessor requires two other objects which are passed in its
+constructor: a [SymbolSupplier](../src/google_breakpad/processor/symbol_supplier.h)
+and a [SourceLineResolverInterface](../src/google_breakpad/processor/source_line_resolver_interface.h).
+The SymbolSupplier object is responsible for locating and providing SymbolFiles
+that match modules from the minidump. The SourceLineResolverInterface is
+responsible for loading the symbol files and using the information contained
+within to provide function and source information for stack frames, as well as
+information on how to unwind from a stack frame to its caller. More detail will
+be provided on these interactions later.
+
+A number of data streams are extracted from the minidump to begin stack walking:
+the list of threads from the process
+([MinidumpThreadList](../src/google_breakpad/processor/minidump.h#335)),
+the list of modules loaded in the process
+([MinidumpModuleList](../src/google_breakpad/processor/minidump.h#501)),
+and information about the exception that caused the process to crash
+([MinidumpException](../src/google_breakpad/processor/minidump.h#615)).
+
+## Enumerating Threads
+
+For each thread in the thread list
+([MinidumpThread](../src/google_breakpad/processor/minidump.h#299)),
+the thread memory containing the stack for the thread
+([MinidumpMemoryRegion](../src/google_breakpad/processor/minidump.h#236))
+and the CPU context representing the CPU state of the thread at the time the
+dump was written ([MinidumpContext](../src/google_breakpad/processor/minidump.h#171))
+are extracted from the minidump. If the thread being processed is the thread
+that produced the exception then a CPU context is obtained from the
+MinidumpException object instead, which represents the CPU state of the thread
+at the point of the exception. A stack walker is then instantiated by calling
+the [Stackwalker::StackwalkerForCPU](../src/google_breakpad/processor/stackwalker.h#77)
+method and passing it the CPU context, the thread memory, the module list, as
+well as the SymbolSupplier and SourceLineResolverInterface. This method selects
+the specific !Stackwalker subclass based on the CPU architecture of the provided
+CPU context and returns an instance of that subclass.
+
+## Walking a thread's stack
+
+Once a !Stackwalker instance has been obtained, the processor calls the
+[Stackwalker::Walk](../src/google_breakpad/processor/source_line_resolver_interface.h)
+method to obtain a list of frames representing the stack of this thread. The
+!Stackwalker starts by calling the GetContextFrame method which returns a
+StackFrame representing the top of the stack, with CPU state provided by the
+initial CPU context. From there, the stack walker repeats the following steps
+for each frame in turn:
+
+### Finding the Module
+
+The address of the instruction pointer of the current frame is used to determine
+which module contains the current frame by calling the module list's
+[GetModuleForAddress](../src/google_breakpad/processor/code_modules.h#56) method.
+
+### Locating Symbols
+
+If a module is located, the SymbolSupplier is asked to locate symbols
+corresponding to the module by calling its
+[GetCStringSymbolData](../src/google_breakpad/processor/symbol_supplier.h#87)
+method. Typically this is implemented by using the module's debug filename (the
+PDB filename for Windows dumps) and debug identifier (a GUID plus one extra
+digit) as a lookup key. The [SimpleSymbolSupplier](../src/processor/simple_symbol_supplier.cc)
+class simply uses these as parts of a file path to locate a flat file on disk.
+
+### Loading Symbols
+
+If a symbol file is located, the SourceLineResolverInterface is then asked to
+load the symbol file by calling its
+[LoadModuleUsingMemoryBuffer](../src/google_breakpad/processor/source_line_resolver_interface.h#71)
+method. The [BasicSourceLineResolver](../src/processor/basic_source_line_resolver.cc)
+implementation parses the text-format [symbol file](symbol_files.md) into
+in-memory data structures to make lookups by address of function names, source
+line information, and unwind information easy.
+
+### Getting source line information
+
+If a symbol file has been successfully loaded, the SourceLineResolverInterface's
+[FillSourceLineInfo](../src/google_breakpad/processor/source_line_resolver_interface.h#89)
+method is called to provide a function name and source line information for the
+current frame. This is done by subtracting the base address of the module
+containing the current frame from the instruction pointer of the current frame
+to obtain a relative virtual address (RVA), which is a code offset relative to
+the start of the module. This RVA is then used as a lookup into a table of
+functions ([FUNC lines](SymbolFiles#FUNC_records.md) from the symbol file), each
+of which has an associated address range (function start address, function
+size). If a function is found whose address range contains the RVA, then its
+name is used. The RVA is then used as a lookup into a table of source lines
+([line records](SymbolFiles#Line_records.md) from the symbol file), each of
+which also has an associated address range. If a match is found it will provide
+the file name and source line associated with the current frame. If no match was
+found in the function table, another table of publicly exported symbols may be
+consulted ([PUBLIC lines](SymbolFiles#PUBLIC_records.md) from the symbol file).
+Public symbols contain only a start address, so the lookup simply looks for the
+nearest symbol that is less than the provided RVA.
+
+### Finding the caller frame
+
+To find the next frame in the stack, the !Stackwalker calls its
+[GetCallerFrame](../src/google_breakpad/processor/stackwalker.h#186)
+method, passing in the current frame. Each !Stackwalker subclass implements
+GetCallerFrame differently, but there are common patterns.
+
+Typically the first step is to query the SourceLineResolverInterface for the
+presence of detailed unwind information. This is done using its
+[FindWindowsFrameInfo](../src/google_breakpad/processor/source_line_resolver_interface.h#96)
+and [FindCFIFrameInfo](../src/google_breakpad/processor/source_line_resolver_interface.h#102)
+methods. These methods look for Windows unwind info extracted from a PDB file
+([STACK WIN](SymbolFiles#STACK_WIN_records.md) lines from the symbol file), or
+DWARF CFI extracted from a binary ([STACK CFI](SymbolFiles#STACK_CFI_records.md)
+lines from the symbol file) respectively. The information covers address ranges,
+so the RVA of the current frame is used for lookup as with function and source
+line information.
+
+If unwind info is found it provides a set of rules to recover the register state
+of the caller frame given the current register state as well as the thread's
+stack memory. The rules are evaluated to produce the caller frame.
+
+If unwind info is not found then the !Stackwalker may resort to other methods.
+Typically on architectures which specify a frame pointer unwinding by
+dereferencing the frame pointer is tried next. If that is successful it is used
+to produce the caller frame.
+
+If no caller frame was found by any other method most !Stackwalker
+implementations resort to stack scanning by looking at each word on the stack
+down to a fixed depth (implemented in the
+[Stackwalker::ScanForReturnAddress](../src/google_breakpad/processor/stackwalker.h#131)
+method) and using a heuristic to attempt to find a reasonable return address
+(implemented in the
+[Stackwalker::InstructionAddressSeemsValid](../src/google_breakpad/processor/stackwalker.h#111) method).
+
+If no caller frame is found or the caller frame seems invalid, stack walking
+stops. If a caller frame was found then these steps repeat using the new frame
+as the current frame.
diff --git a/docs/sym_upload_v2_protocol.md b/docs/sym_upload_v2_protocol.md
new file mode 100644
index 00000000..d56a4c83
--- /dev/null
+++ b/docs/sym_upload_v2_protocol.md
@@ -0,0 +1,214 @@
+# Introduction
+
+The `sym_upload` tool is able to operate in `sym-upload-v2` protocol mode, in
+addition to the legacy protocol (which will be referred to as `sym-upload-v1`
+for the rest of this document). For now `sym-upload-v2` is HTTP/REST-based but
+it could be extended to operate over gRPC instead, in the future.
+
+# Table of Contents
+* [Why](#why)
+* [How](#how)
+ * [Uploading](#uploading)
+ * [Uploading with `sym_upload`](#uploading-with-sym_upload)
+ * [Uploading with curl](#uploading-with-curl)
+ * [Serving the `sym-upload-v2` protocol](#serving-the-sym-upload-v2-protocol)
+ * [Authenticate using `key`](#authenticate-using-key)
+ * [Symbol `checkStatus`](#symbol-checkstatus)
+ * [Upload `create`](#upload-create)
+ * [Uploading the symbol file](#uploading-the-symbol-file)
+ * [Upload complete](#upload-complete)
+
+
+# Why
+
+Using `sym_upload` in `sym-upload-v2` protocol mode has the following features
+beyond `sym-upload-v1`:
+ * Authentication via `key` (arbitrary secret).
+ * Symbol identifier (product of `debug_file` and `debug_id`, as recorded in
+output from `dump_syms`) can be checked against existing symbol information on
+server. If it's present, then the upload is skipped entirely.
+
+# How
+
+## Uploading
+
+### Uploading with `sym_upload`
+
+Uploading in `sym-upload-v2` protocol mode is easy. Invoke `sym_upload` like
+```
+$ ./sym_upload -p sym-upload-v2 [-k <API-key>] <symbol-file> <API-URL>
+```
+
+Where `symbol-file` is a symbol file created by `dump_syms`, `API-URL` is the
+URL of your `sym-upload-v2` API service (see next section for details), and
+`API-key` is a secret known to your uploader and server.
+
+For more options see `sym_upload --help`.
+
+### Uploading with curl
+
+As an example, if:
+ * Your API's URL was "https://sym-upload-api".
+ * Your service has assigned you `key` "myfancysecret123".
+ * You wanted to upload the symbol file at "path/to/file_name", with
+`debug_file` being "file_name" and `debug_id` being
+"123123123123123123123123123". Normally you would read these values from
+"path/to/file_name", which in turn was generated by `dump_syms`.
+
+Then you might run:
+```
+$ curl https://sym-upload-api/symbols/file_name/123123123123123123123123123:checkStatus?key=myfancysecret123
+```
+
+And, upon seeing that this `debug_file`/`debug_id` combo is missing from symbol
+storage then you could run:
+```
+$ curl --request POST https://sym-upload-api/uploads:create?key=myfancysecret123
+```
+
+Which returns `upload_url` "https://upload-server/42?creds=shhhhh" and
+`upload_key` "42". Next you upload the file directly like:
+```
+$ curl -T path/to/file_name "https://upload-server/42?creds=shhhhh"
+```
+
+Once the HTTP PUT is complete, run:
+```
+$ curl --header "Content-Type: application/json" \
+ --request POST \
+ --data '{symbol_id:{"debugFile":"file_name",'\
+ '"debugId":"123123123123123123123123123"}}' \
+ https://sym-upload-api/uploads/42:complete?key=myfancysecret123
+```
+
+### Serving the `sym-upload-v2` Protocol
+
+The protocol is currently defined only in HTTP/REST. There are three necessary
+REST operations to implement in your service:
+* `/symbols/<debug_file>/<debug_id>:checkStatus?key=<key>`
+* `/uploads:create?key=<key>`
+* `/uploads/<upload_key>:complete?key=<key>`
+
+#### Authenticate Using `key`
+
+The query string arg `key` contains some secret that both the uploader and
+server understand. It is up to the service implementer to decide on what
+constitutes a valid `key`, how the uploader acquires one, and how to handle
+requests made with invalid ones.
+
+#### Symbol `checkStatus`
+
+```
+/symbols/<debug_file>/<debug_id>:checkStatus?key=<key>
+```
+
+This operation expects an empty (or no) JSON payload in the request.
+
+This operation should return the status of the symbol file uniquely identified
+by the given `debug_file` and `debug_id`. JSON schema:
+```
+{
+ "type": object",
+ "properties": {
+ "status": {
+ "type": "string",
+ "enum": ["STATUS_UNSPECIFIED", "MISING", "FOUND"],
+ "required": true
+ }
+ }
+}
+```
+
+Where `MISSING` denotes that the symbol file does not exist on the server and
+`FOUND` denotes that the symbol file exists on the server.
+
+#### Upload `create`
+
+```
+/uploads:create?key=<key>
+```
+
+This operation expects an empty (or no) JSON payload in the request.
+
+This operation should return a URL that uploader can HTTP PUT their symbol file
+to, along with an "upload key" that can be used to notify the service once the
+file upload is completed. JSON schema:
+```
+{
+ "type": "object",
+ "properties": {
+ "upload_url": {
+ "type: "string",
+ "required": true
+ },
+ "upload_key": {
+ "type": "string",
+ "required": true
+ }
+ }
+}
+```
+
+Since this REST API operation can be authenticated via the `key` query string
+arg, the service can return a URL that encodes permission delegation to the
+upload endpoint resource and thereby constrain the ability to upload to those
+with valid `key`s.
+
+#### Uploading the Symbol File
+
+Note that the actual symbol upload step is _not_ part of the REST API. The
+upload URL obtained in the above operation is meant to be used as the endpoint
+for a normal HTTP PUT request for the contents of the symbol file. Once that
+HTTP PUT request is completed use the upload `complete` operation.
+
+#### Upload `complete`
+
+```
+/uploads/<upload_key>:complete?key=<key>
+```
+
+This operation expects a JSON payload in the HTTP request body with the
+following schema:
+```
+{
+ "type": "object",
+ "properties": {
+ "symbol_id": {
+ "type": "object",
+ "properties": {
+ "debug_file": {
+ "type": "string",
+ "required": true
+ },
+ "debug_id": {
+ "type": "string",
+ "required": true
+ }
+ }
+ }
+ }
+}
+```
+
+This operation should cause the symbol storage back-end (however implemented)
+to consume the symbol file identified by `upload_key`. It is up to the service
+implementation to decide how uploads are assigned `upload_key`s and how to
+retrieve a completed upload by its `upload_key`. If the symbol file cannot be
+found, is malformed, or the operation cannot be completed for any other reason
+then an HTTP error will be returned. JSON schema of non-error responses:
+```
+{
+ "type": "object",
+ "properties": {
+ "result": {
+ "type": string,
+ "enum": ["RESULT_UNSPECIFIED", "OK", "DUPLICATE_DATA"],
+ "required": true
+ }
+ }
+}
+```
+
+Where `OK` denotes that the symbol storage was updated with the new symbol file
+and `DUPLICATE_DATA` denotes that the symbol file data was identical to data
+already in symbol storage and therefore nothing changed.
diff --git a/docs/symbol_files.md b/docs/symbol_files.md
new file mode 100644
index 00000000..237b6567
--- /dev/null
+++ b/docs/symbol_files.md
@@ -0,0 +1,506 @@
+# Introduction
+
+Given a minidump file, the Breakpad processor produces stack traces that include
+function names and source locations. However, minidump files contain only the
+byte-by-byte contents of threads' registers and stacks, without function names
+or machine-code-to-source mapping data. The processor consults Breakpad symbol
+files for the information it needs to produce human-readable stack traces from
+the binary-only minidump file.
+
+The platform-specific symbol dumping tools parse the debugging information the
+compiler provides (whether as DWARF or STABS sections in an ELF file or as
+stand-alone PDB files), and write that information back out in the Breakpad
+symbol file format. This format is much simpler and less detailed than compiler
+debugging information, and values legibility over compactness.
+
+# Overview
+
+Breakpad symbol files are ASCII text files, with lines delimited as appropriate
+for the host platform. Each line is a _record_, divided into fields by single
+spaces; in some cases, the last field of the record can contain spaces. The
+first field is a string indicating what sort of record the line represents
+(except for line records; these are very common, making them the default saves
+space). Some fields hold decimal or hexadecimal numbers; hexadecimal numbers
+have no "0x" prefix, and use lower-case letters.
+
+Breakpad symbol files contain the following record types. With some
+restrictions, these may appear in any order.
+
+* A `MODULE` record describes the executable file or shared library from which
+ this data was derived, for use by symbol suppliers. A `MODULE' record should
+ be the first record in the file.
+
+* A `FILE` record gives a source file name, and assigns it a number by which
+ other records can refer to it.
+
+* A `FUNC` record describes a function present in the source code.
+
+* A line record indicates to which source file and line a given range of
+ machine code should be attributed. The line is attributed to the function
+ defined by the most recent `FUNC` record.
+
+* A `PUBLIC` record gives the address of a linker symbol.
+
+* A `STACK` record provides information necessary to produce stack traces.
+
+# `MODULE` records
+
+A `MODULE` record provides meta-information about the module the symbol file
+describes. It has the form:
+
+> `MODULE` _operatingsystem_ _architecture_ _id_ _name_
+
+For example: `MODULE Linux x86 D3096ED481217FD4C16B29CD9BC208BA0 firefox-bin
+` These records provide meta-information about the executable or shared library
+from which this symbol file was generated. A symbol supplier might use this
+information to find the correct symbol files to use to interpret a given
+minidump, or to perform other sorts of validation. If present, a `MODULE` record
+should be the first line in the file.
+
+The fields are separated by spaces, and cannot contain spaces themselves, except
+for _name_.
+
+* The _operatingsystem_ field names the operating system on which the
+ executable or shared library was intended to run. This field should have one
+ of the following values: | **Value** | **Meaning** |
+ |:----------|:--------------------| | Linux | Linux | | mac | Macintosh OSX
+ | | windows | Microsoft Windows |
+
+* The _architecture_ field indicates what processor architecture the
+ executable or shared library contains machine code for. This field should
+ have one of the following values: | **Value** | **Instruction Set
+ Architecture** | |:----------|:---------------------------------| | x86 |
+ Intel IA-32 | | x86\_64 | AMD64/Intel 64 | | ppc | 32-bit PowerPC | | ppc64
+ | 64-bit PowerPC | | unknown | unknown |
+
+* The _id_ field is a sequence of hexadecimal digits that identifies the exact
+ executable or library whose contents the symbol file describes. The way in
+ which it is computed varies from platform to platform.
+
+* The _name_ field contains the base name (the final component of the
+ directory path) of the executable or library. It may contain spaces, and
+ extends to the end of the line.
+
+# `FILE` records
+
+A `FILE` record holds a source file name for other records to refer to. It has
+the form:
+
+> `FILE` _number_ _name_
+
+For example: `FILE 2 /home/jimb/mc/in/browser/app/nsBrowserApp.cpp
+`
+
+A `FILE` record provides the name of a source file, and assigns it a number
+which other records (line records, in particular) can use to refer to that file
+name. The _number_ field is a decimal number. The _name_ field is the name of
+the file; it may contain spaces.
+
+# `FUNC` records
+
+A `FUNC` record describes a source-language function. It has the form:
+
+> `FUNC` _[m]_ _address_ _size_ _parameter\_size_ _name_
+
+For example: `FUNC m c184 30 0 nsQueryInterfaceWithError::operator()(nsID const&,
+void**) const
+`
+
+The _m_ field is optional. If present it indicates that multiple symbols
+reference this function's instructions. (In which case, only one symbol name is
+mentioned within the breakpad file.) Multiple symbols referencing the same
+instructions may occur due to identical code folding by the linker.
+
+The _address_ and _size_ fields are hexadecimal numbers indicating the start
+address and length in bytes of the machine code instructions the function
+occupies. (Breakpad symbol files cannot accurately describe functions whose code
+is not contiguous.) The start address is relative to the module's load address.
+
+The _parameter\_size_ field is a hexadecimal number indicating the size, in
+bytes, of the arguments pushed on the stack for this function. Some calling
+conventions, like the Microsoft Windows `stdcall` convention, require the called
+function to pop parameters passed to it on the stack from its caller before
+returning. The stack walker uses this value, along with data from `STACK`
+records, to step from the called function's frame to the caller's frame.
+
+The _name_ field is the name of the function. In languages that use linker
+symbol name mangling like C++, this should be the source language name (the
+"unmangled" form). This field may contain spaces.
+
+# Line records
+
+A line record describes the source file and line number to which a given range
+of machine code should be attributed. It has the form:
+
+> _address_ _size_ _line_ _filenum_
+
+For example: `c184 7 59 4
+`
+
+Because they are so common, line records do not begin with a string indicating
+the record type. All other record types' names use upper-case letters;
+hexadecimal numbers, like a line record's _address_, use lower-case letters.
+
+The _address_ and _size_ fields are hexadecimal numbers indicating the start
+address and length in bytes of the machine code. The address is relative to the
+module's load address.
+
+The _line_ field is the line number to which the machine code should be
+attributed, in decimal; the first line of the source file is line number 1. The
+_filenum_ field is a decimal number appearing in a prior `FILE` record; the name
+given in that record is the source file name for the machine code.
+
+The line is assumed to belong to the function described by the last preceding
+`FUNC` record. Line records may not appear before the first `FUNC' record.
+
+No two line records in a symbol file cover the same range of addresses. However,
+there may be many line records with identical line and file numbers, as a given
+source line may contribute many non-contiguous blocks of machine code.
+
+# `PUBLIC` records
+
+A `PUBLIC` record describes a publicly visible linker symbol, such as that used
+to identify an assembly language entry point or region of memory. It has the
+form:
+
+> PUBLIC _[m]_ _address_ _parameter\_size_ _name_
+
+For example: `PUBLIC m 2160 0 Public2_1
+`
+
+The Breakpad processor essentially treats a `PUBLIC` record as defining a
+function with no line number data and an indeterminate size: the code extends to
+the next address mentioned. If a given address is covered by both a `PUBLIC`
+record and a `FUNC` record, the processor uses the `FUNC` data.
+
+The _m_ field is optional. If present it indicates that multiple symbols
+reference this function's instructions. (In which case, only one symbol name is
+mentioned within the breakpad file.) Multiple symbols referencing the same
+instructions may occur due to identical code folding by the linker.
+
+The _address_ field is a hexadecimal number indicating the symbol's address,
+relative to the module's load address.
+
+The _parameter\_size_ field is a hexadecimal number indicating the size of the
+parameters passed to the code whose entry point the symbol marks, if known. This
+field has the same meaning as the _parameter\_size_ field of a `FUNC` record;
+see that description for more details.
+
+The _name_ field is the name of the symbol. In languages that use linker symbol
+name mangling like C++, this should be the source language name (the "unmangled"
+form). This field may contain spaces.
+
+# `STACK WIN` records
+
+Given a stack frame, a `STACK WIN` record indicates how to find the frame that
+called it. It has the form:
+
+> STACK WIN _type_ _rva_ _code\_size_ _prologue\_size_ _epilogue\_size_
+> _parameter\_size_ _saved\_register\_size_ _local\_size_ _max\_stack\_size_
+> _has\_program\_string_ _program\_string\_OR\_allocates\_base\_pointer_
+
+For example: `STACK WIN 4 2170 14 1 0 0 0 0 0 1 $eip 4 + ^ = $esp $ebp 8 + =
+$ebp $ebp ^ =
+`
+
+All fields of a `STACK WIN` record, except for the last, are hexadecimal
+numbers.
+
+The _type_ field indicates what sort of stack frame data this record holds. Its
+value should be one of the values of the
+[StackFrameTypeEnum](http://msdn.microsoft.com/en-us/library/bc5207xw%28VS.100%29.aspx)
+type in Microsoft's
+[Debug Interface Access (DIA)](http://msdn.microsoft.com/en-us/library/x93ctkx8%28VS.100%29.aspx) API.
+Breakpad uses only records of type 4 (`FrameTypeFrameData`) and 0
+(`FrameTypeFPO`); it ignores others. These types differ only in whether the last
+field is an _allocates\_base\_pointer_ flag (`FrameTypeFPO`) or a program string
+(`FrameTypeFrameData`). If more than one record covers a given address, Breakpad
+prefers `FrameTypeFrameData` records over `FrameTypeFPO` records.
+
+The _rva_ and _code\_size_ fields give the starting address and length in bytes
+of the machine code covered by this record. The starting address is relative to
+the module's load address.
+
+The _prologue\_size_ and _epilogue\_size_ fields give the length, in bytes, of
+the prologue and epilogue machine code within the record's range. Breakpad does
+not use these values.
+
+The _parameter\_size_ field gives the number of argument bytes this function
+expects to have been passed. This field has the same meaning as the
+_parameter\_size_ field of a `FUNC` record; see that description for more
+details.
+
+The _saved\_register\_size_ field gives the number of bytes in the stack frame
+dedicated to preserving the values of any callee-saves registers used by this
+function.
+
+The _local\_size_ field gives the number of bytes in the stack frame dedicated
+to holding the function's local variables and temporary values.
+
+The _max\_stack\_size_ field gives the maximum number of bytes pushed on the
+stack in the frame. Breakpad does not use this value.
+
+If the _has\_program\_string_ field is zero, then the `STACK WIN` record's final
+field is an _allocates\_base\_pointer_ flag, as a hexadecimal number; this is
+expected for records whose _type_ is 0. Otherwise, the final field is a program
+string.
+
+## Interpreting a `STACK WIN` record
+
+Given the register values for a frame F, we can find the calling frame as
+follows:
+
+* If the _has\_program\_string_ field of a `STACK WIN` record is zero, then
+ the final field is _allocates\_base\_pointer_, a flag indicating whether the
+ frame uses the frame pointer register, `%ebp`, as a general-purpose
+ register.
+ * If _allocates\_base\_pointer_ is true, then `%ebp` does not point to the
+ frame's base address. Instead,
+ * Let _next\_parameter\_size_ be the parameter size of the function
+ frame F called (**not** this record's _parameter\_size_ field), or
+ zero if F is the youngest frame on the stack. You must find this
+ value in F's callee's `FUNC`, `STACK WIN`, or `PUBLIC` records.
+ * Let _frame\_size_ be the sum of the _local\_size_ field, the
+ _saved\_register\_size_ field, and _next\_parameter\_size_. > > With
+ those definitions in place, we can recover the calling frame as
+ follows:
+ * F's return address is at `%esp +`_frame\_size_,
+ * the caller's value of `%ebp` is saved at `%esp
+ +`_next\_parameter\_size_`+`_saved\_register\_size_`- 8`, and
+ * the caller's value of `%esp` just before the call instruction was
+ `%esp +`_frame\_size_`+ 4`. > > (Why do we include
+ _next\_parameter\_size_ in the sum when computing _frame\_size_ and
+ the address of the saved `%ebp`? When a function A has called a
+ function B, the arguments that A pushed for B are considered part of
+ A's stack frame: A's value for `%esp` points at the last argument
+ pushed for B. Thus, we must include the size of those arguments
+ (given by the debugging info for B) along with the size of A's
+ register save area and local variable area (given by the debugging
+ info for A) when computing the overall size of A's frame.)
+ * If _allocates\_base\_pointer_ is false, then F's function doesn't use
+ `%ebp` at all. You may recover the calling frame as above, except that
+ the caller's value of `%ebp` is the same as F's value for `%ebp`, so no
+ steps are necessary to recover it.
+* If the _has\_program\_string_ field of a `STACK WIN` record is not zero,
+ then the record's final field is a string containing a program to be
+ interpreted to recover the caller's frame. The comments in the
+ [postfix\_evaluator.h](../src/processor/postfix_evaluator.h#40)
+ header file explain the language in which the program is written. You should
+ place the following variables in the dictionary before interpreting the
+ program:
+ * `$ebp` and `$esp` should be the values of the `%ebp` and `%esp`
+ registers in F.
+ * `.cbParams`, `.cbSavedRegs`, and `.cbLocals`, should be the values of
+ the `STACK WIN` record's _parameter\_size_, _saved\_register\_size_, and
+ _local\_size_ fields.
+ * `.raSearchStart` should be set to the address on the stack to begin
+ scanning for a return address, if necessary. The Breakpad processor sets
+ this to the value of `%esp` in F, plus the _frame\_size_ value mentioned
+ above.
+
+> If the program stores values for `$eip`, `$esp`, `$ebp`, `$ebx`, `$esi`, or
+> `$edi`, then those are the values of the given registers in the caller. If the
+> value of `$eip` is zero, that indicates that the end of the stack has been
+> reached.
+
+The Breakpad processor checks that the value yielded by the above for the
+calling frame's instruction address refers to known code; if the address seems
+to be bogus, then it uses a heuristic search to find F's return address and
+stack base.
+
+# `STACK CFI` records
+
+`STACK CFI` ("Call Frame Information") records describe how to walk the stack
+when execution is at a given machine instruction. These records take one of two
+forms:
+
+> `STACK CFI INIT` _address_ _size_ _register<sub>1</sub>_:
+> _expression<sub>1</sub>_ _register<sub>2</sub>_: _expression<sub>2</sub>_ ...
+>
+> `STACK CFI` _address_ _register<sub>1</sub>_: _expression<sub>1</sub>_
+> _register<sub>2</sub>_: _expression<sub>2</sub>_ ...
+
+For example:
+
+```
+STACK CFI INIT 804c4b0 40 .cfa: $esp 4 + $eip: .cfa 4 - ^
+STACK CFI 804c4b1 .cfa: $esp 8 + $ebp: .cfa 8 - ^
+```
+
+The _address_ and _size_ fields are hexadecimal numbers. Each
+_register_<sub>i</sub> is the name of a register or pseudoregister. Each
+_expression_ is a Breakpad postfix expression, which may contain spaces, but
+never ends with a colon. (The appropriate register names for a given
+architecture are determined when `STACK CFI` records are first enabled for that
+architecture, and should be documented in the appropriate
+`stackwalker_`_architecture_`.cc` source file.)
+
+STACK CFI records describe, at each machine instruction in a given function, how
+to recover the values the machine registers had in the function's caller.
+Naturally, some registers' values are simply lost, but there are three cases in
+which they can be recovered:
+
+* You can always recover the program counter, because that's the function's
+ return address. If the function is ever going to return, the PC must be
+ saved somewhere.
+
+* You can always recover the stack pointer. The function is responsible for
+ popping its stack frame before it returns to the caller, so it must be able
+ to restore this, as well.
+
+* You should be able to recover the values of callee-saves registers. These
+ are registers whose values the callee must preserve, either by saving them
+ in its own stack frame before using them and re-loading them before
+ returning, or by not using them at all.
+
+(As an exception, note that functions which never return may not save any of
+this data. It may not be possible to walk the stack past such functions' stack
+frames.)
+
+Given rules for recovering the values of a function's caller's registers, we can
+walk up the stack. Starting with the current set of registers --- the PC of the
+instruction we're currently executing, the current stack pointer, etc. --- we
+use CFI to recover the values those registers had in the caller of the current
+frame. This gives us a PC in the caller whose CFI we can look up; we apply the
+process again to find that function's caller; and so on.
+
+Concretely, CFI records represent a table with a row for each machine
+instruction address and a column for each register. The table entry for a given
+address and register contains a rule describing how, when the PC is at that
+address, to restore the value that register had in the caller.
+
+There are some special columns:
+
+* A column named `.cfa`, for "Canonical Frame Address", tells how to compute
+ the base address of the frame; other entries can refer to the CFA in their
+ rules.
+
+* A column named `.ra` represents the return address.
+
+For example, suppose we have a machine with 32-bit registers, one-byte
+instructions, a stack that grows downwards, and an assembly language that
+resembles C. Suppose further that we have a function whose machine code looks
+like this:
+
+```
+func: ; entry point; return address at sp
+func+0: sp -= 16 ; allocate space for stack frame
+func+1: sp[12] = r0 ; save 4-byte r0 at sp+12
+ ... ; stuff that doesn't affect stack
+func+10: sp -= 4; *sp = x ; push some 4-byte x on the stack
+ ... ; stuff that doesn't affect stack
+func+20: r0 = sp[16] ; restore saved r0
+func+21: sp += 20 ; pop whole stack frame
+func+22: pc = *sp; sp += 4 ; pop return address and jump to it
+```
+
+The following table would describe the function above:
+
+**code address** | **.cfa** | **r0 (on Google Code)** | **r1 (on Google Code)** | ... | **.ra**
+:--------------- | :------- | :---------------------- | :---------------------- | :-- | :-------
+func+0 | sp | | | | `cfa[0]`
+func+1 | sp+16 | | | | `cfa[0]`
+func+2 | sp+16 | `cfa[-4]` | | | `cfa[0]`
+func+11 | sp+20 | `cfa[-4]` | | | `cfa[0]`
+func+21 | sp+20 | | | | `cfa[0]`
+func+22 | sp | | | | `cfa[0]`
+
+Some things to note here:
+
+* Each row describes the state of affairs **before** executing the instruction
+ at the given address. Thus, the row for func+0 describes the state before we
+ execute the first instruction, which allocates the stack frame. In the next
+ row, the formula for computing the CFA has changed, reflecting the
+ allocation.
+
+* The other entries are written in terms of the CFA; this allows them to
+ remain unchanged as the stack pointer gets bumped around. For example, to
+ find the caller's value for r0 (on Google Code) at func+2, we would first
+ compute the CFA by adding 16 to the sp, and then subtract four from that to
+ find the address at which r0 (on Google Code) was saved.
+
+* Although the example doesn't show this, most calling conventions designate
+ "callee-saves" and "caller-saves" registers. The callee must restore the
+ values of "callee-saves" registers before returning (if it uses them at
+ all), whereas the callee is free to use "caller-saves" registers without
+ restoring their values. A function that uses caller-saves registers
+ typically does not save their original values at all; in this case, the CFI
+ marks such registers' values as "unrecoverable".
+
+* Exactly where the CFA points in the frame --- at the return address? below
+ it? At some fixed point within the frame? --- is a question of definition
+ that depends on the architecture and ABI in use. But by definition, the CFA
+ remains constant throughout the lifetime of the frame. It's up to
+ architecture- specific code to know what significance to assign the CFA, if
+ any.
+
+To save space, the most common type of CFI record only mentions the table
+entries at which changes take place. So for the above, the CFI data would only
+actually mention the non-blank entries here:
+
+**insn** | **cfa** | **r0 (on Google Code)** | **r1 (on Google Code)** | ... | **ra**
+:------- | :------ | :---------------------- | :---------------------- | :-- | :-------
+func+0 | sp | | | | `cfa[0]`
+func+1 | sp+16 | | | |
+func+2 | | `cfa[-4]` | | |
+func+11 | sp+20 | | | |
+func+21 | | r0 (on Google Code) | | |
+func+22 | sp | | | |
+
+A `STACK CFI INIT` record indicates that, at the machine instruction at
+_address_, belonging to some function, the value that _register<sub>n</sub>_ had
+in that function's caller can be recovered by evaluating
+_expression<sub>n</sub>_. The values of any callee-saves registers not mentioned
+are assumed to be unchanged. (`STACK CFI` records never mention caller-saves
+registers.) These rules apply starting at _address_ and continue up to, but not
+including, the address given in the next `STACK CFI` record. The _size_ field is
+the total number of bytes of machine code covered by this record and any
+subsequent `STACK CFI` records (until the next `STACK CFI INIT` record). The
+_address_ field is relative to the module's load address.
+
+A `STACK CFI` record (no `INIT`) is the same, except that it mentions only those
+registers whose recovery rules have changed from the previous CFI record. There
+must be a prior `STACK CFI INIT` or `STACK CFI` record in the symbol file. The
+_address_ field of this record must be greater than that of the previous record,
+and it must not be at or beyond the end of the range given by the most recent
+`STACK CFI INIT` record. The address is relative to the module's load address.
+
+Each expression is a breakpad-style postfix expression. Expressions may contain
+spaces, but their tokens may not end with colons. When an expression mentions a
+register, it refers to the value of that register in the callee, even if a prior
+name/expression pair gives that register's value in the caller. The exception is
+`.cfa`, which refers to the canonical frame address computed by the .cfa rule in
+force at the current instruction.
+
+The special expression `.undef` indicates that the given register's value cannot
+be recovered.
+
+The register names preceding the expressions are always followed by colons. The
+expressions themselves never contain tokens ending with colons.
+
+There are two special register names:
+
+* `.cfa` ("Canonical Frame Address") is the base address of the stack frame.
+ Other registers' rules may refer to this. If no rule is provided for the
+ stack pointer, the value of `.cfa` is the caller's stack pointer.
+
+* `.ra` is the return address. This is the value of the restored program
+ counter. We use `.ra` instead of the architecture-specific name for the
+ program counter.
+
+The Breakpad stack walker requires that there be rules in force for `.cfa` and
+`.ra` at every code address from which it unwinds. If those rules are not
+present, the stack walker will ignore the `STACK CFI` data, and try to use a
+different strategy.
+
+So the CFI for the example function above would be as follows, if `func` were at
+address 0x1000 (relative to the module's load address):
+
+```
+STACK CFI INIT 1000 .cfa: $sp .ra: .cfa ^
+STACK CFI 1001 .cfa: $sp 16 +
+STACK CFI 1002 $r0: .cfa 4 - ^
+STACK CFI 100b .cfa: $sp 20 +
+STACK CFI 1015 $r0: $r0
+STACK CFI 1016 .cfa: $sp
+```
diff --git a/docs/windows_client_integration.md b/docs/windows_client_integration.md
new file mode 100644
index 00000000..99a84926
--- /dev/null
+++ b/docs/windows_client_integration.md
@@ -0,0 +1,70 @@
+# Windows Integration overview
+
+## Windows Client Code
+
+The Windows client code is in the `src/client/windows` directory of the tree.
+Since the header files are fairly well commented some specifics are purposely
+omitted from this document.
+
+## Integration of minidump-generation
+
+Once you build the solution inside `src/client/windows`, an output file of
+`exception_handler.lib` will be generated. You can either check this into your
+project's directory or build directly from the source, as the project itself
+does.
+
+Enabling Breakpad in your application requires you to `#include
+"exception_handler.h"` and instantiate the `ExceptionHandler` object like so:
+
+```
+ handler = new ExceptionHandler(const wstring& dump_path,
+ FilterCallback filter,
+ MinidumpCallback callback,
+ void* callback_context,
+ int handler_types,
+ MINIDUMP_TYPE dump_type,
+ const wchar_t* pipe_name,
+ const CustomClientInfo* custom_info);
+```
+
+The parameters, in order, are:
+
+* pathname for minidumps to be written to - this is ignored if OOP dump
+ generation is used
+* A callback that is called when the exception is first handled - you can
+ return true/false here to continue/stop exception processing
+* A callback that is called after minidumps have been written
+* Context for the callbacks
+* Which exceptions to handle - see `HandlerType` enumeration in
+ exception\_handler.h
+* The type of minidump to generate, using the `MINIDUMP_TYPE` definitions in
+ `DbgHelp.h`
+* A pipe name that can be used to communicate with a crash generation server
+* A pointer to a CustomClientInfo class that can be used to send custom data
+ along with the minidump when using OOP generation
+
+You can also see `src/client/windows/tests/crash_generation_app/*` for a sample
+app that uses OOP generation.
+
+## OOP Minidump Generation
+
+For out of process minidump generation, more work is needed. If you look inside
+`src/client/windows/crash_generation`, you will see a file called
+`crash_generation_server.h`. This file is the interface for a crash generation
+server, which must be instantiated with the same pipe name that is passed to the
+client above. The logistics of running a separate process that instantiates the
+crash generation server is left up to you, however.
+
+## Build process specifics(symbol generation, upload)
+
+The symbol creation step is talked about in the general overview doc, since it
+doesn't vary much by platform. You'll need to make sure that the symbols are
+available wherever minidumps are uploaded to for processing.
+
+## Out in the field - uploading the minidump
+
+Inside `src/client/windows/sender` is a class implementation called
+`CrashReportSender`. This class can be compiled into a separate standalone CLI
+or in the crash generation server and used to upload the report; it can know
+when to do so via one of the callbacks provided by the `CrashGenerationServer`
+or the `ExceptionHandler` object for in-process generation.
diff --git a/m4/ax_append_compile_flags.m4 b/m4/ax_append_compile_flags.m4
new file mode 100644
index 00000000..2bb27ef2
--- /dev/null
+++ b/m4/ax_append_compile_flags.m4
@@ -0,0 +1,67 @@
+# ===========================================================================
+# http://www.gnu.org/software/autoconf-archive/ax_append_compile_flags.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_APPEND_COMPILE_FLAGS([FLAG1 FLAG2 ...], [FLAGS-VARIABLE], [EXTRA-FLAGS], [INPUT])
+#
+# DESCRIPTION
+#
+# For every FLAG1, FLAG2 it is checked whether the compiler works with the
+# flag. If it does, the flag is added FLAGS-VARIABLE
+#
+# If FLAGS-VARIABLE is not specified, the current language's flags (e.g.
+# CFLAGS) is used. During the check the flag is always added to the
+# current language's flags.
+#
+# If EXTRA-FLAGS is defined, it is added to the current language's default
+# flags (e.g. CFLAGS) when the check is done. The check is thus made with
+# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to
+# force the compiler to issue an error when a bad flag is given.
+#
+# INPUT gives an alternative input source to AC_COMPILE_IFELSE.
+#
+# NOTE: This macro depends on the AX_APPEND_FLAG and
+# AX_CHECK_COMPILE_FLAG. Please keep this macro in sync with
+# AX_APPEND_LINK_FLAGS.
+#
+# LICENSE
+#
+# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation, either version 3 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+# Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. You
+# need not follow the terms of the GNU General Public License when using
+# or distributing such scripts, even though portions of the text of the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+#serial 5
+
+AC_DEFUN([AX_APPEND_COMPILE_FLAGS],
+[AX_REQUIRE_DEFINED([AX_CHECK_COMPILE_FLAG])
+AX_REQUIRE_DEFINED([AX_APPEND_FLAG])
+for flag in $1; do
+ AX_CHECK_COMPILE_FLAG([$flag], [AX_APPEND_FLAG([$flag], [$2])], [], [$3], [$4])
+done
+])dnl AX_APPEND_COMPILE_FLAGS
diff --git a/m4/ax_append_flag.m4 b/m4/ax_append_flag.m4
new file mode 100644
index 00000000..08f2e07e
--- /dev/null
+++ b/m4/ax_append_flag.m4
@@ -0,0 +1,71 @@
+# ===========================================================================
+# http://www.gnu.org/software/autoconf-archive/ax_append_flag.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_APPEND_FLAG(FLAG, [FLAGS-VARIABLE])
+#
+# DESCRIPTION
+#
+# FLAG is appended to the FLAGS-VARIABLE shell variable, with a space
+# added in between.
+#
+# If FLAGS-VARIABLE is not specified, the current language's flags (e.g.
+# CFLAGS) is used. FLAGS-VARIABLE is not changed if it already contains
+# FLAG. If FLAGS-VARIABLE is unset in the shell, it is set to exactly
+# FLAG.
+#
+# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
+# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation, either version 3 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+# Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. You
+# need not follow the terms of the GNU General Public License when using
+# or distributing such scripts, even though portions of the text of the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+#serial 6
+
+AC_DEFUN([AX_APPEND_FLAG],
+[dnl
+AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_SET_IF
+AS_VAR_PUSHDEF([FLAGS], [m4_default($2,_AC_LANG_PREFIX[FLAGS])])
+AS_VAR_SET_IF(FLAGS,[
+ AS_CASE([" AS_VAR_GET(FLAGS) "],
+ [*" $1 "*], [AC_RUN_LOG([: FLAGS already contains $1])],
+ [
+ AS_VAR_APPEND(FLAGS,[" $1"])
+ AC_RUN_LOG([: FLAGS="$FLAGS"])
+ ])
+ ],
+ [
+ AS_VAR_SET(FLAGS,[$1])
+ AC_RUN_LOG([: FLAGS="$FLAGS"])
+ ])
+AS_VAR_POPDEF([FLAGS])dnl
+])dnl AX_APPEND_FLAG
diff --git a/m4/ax_check_compile_flag.m4 b/m4/ax_check_compile_flag.m4
new file mode 100644
index 00000000..ca363971
--- /dev/null
+++ b/m4/ax_check_compile_flag.m4
@@ -0,0 +1,74 @@
+# ===========================================================================
+# http://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT])
+#
+# DESCRIPTION
+#
+# Check whether the given FLAG works with the current language's compiler
+# or gives an error. (Warnings, however, are ignored)
+#
+# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
+# success/failure.
+#
+# If EXTRA-FLAGS is defined, it is added to the current language's default
+# flags (e.g. CFLAGS) when the check is done. The check is thus made with
+# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to
+# force the compiler to issue an error when a bad flag is given.
+#
+# INPUT gives an alternative input source to AC_COMPILE_IFELSE.
+#
+# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
+# macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
+# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation, either version 3 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+# Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. You
+# need not follow the terms of the GNU General Public License when using
+# or distributing such scripts, even though portions of the text of the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+#serial 4
+
+AC_DEFUN([AX_CHECK_COMPILE_FLAG],
+[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF
+AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl
+AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [
+ ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS
+ _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1"
+ AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],
+ [AS_VAR_SET(CACHEVAR,[yes])],
+ [AS_VAR_SET(CACHEVAR,[no])])
+ _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags])
+AS_VAR_IF(CACHEVAR,yes,
+ [m4_default([$2], :)],
+ [m4_default([$3], :)])
+AS_VAR_POPDEF([CACHEVAR])dnl
+])dnl AX_CHECK_COMPILE_FLAGS
diff --git a/m4/ax_check_define.m4 b/m4/ax_check_define.m4
new file mode 100644
index 00000000..20ba8086
--- /dev/null
+++ b/m4/ax_check_define.m4
@@ -0,0 +1,92 @@
+# ===========================================================================
+# https://www.gnu.org/software/autoconf-archive/ax_check_define.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CHECK_DEFINE([symbol], [ACTION-IF-FOUND], [ACTION-IF-NOT])
+# AX_CHECK_DEFINE([includes],[symbol], [ACTION-IF-FOUND], [ACTION-IF-NOT])
+#
+# DESCRIPTION
+#
+# Complements AC_CHECK_FUNC but it does not check for a function but for a
+# define to exist. Consider a usage like:
+#
+# AC_CHECK_DEFINE(__STRICT_ANSI__, CFLAGS="$CFLAGS -D_XOPEN_SOURCE=500")
+#
+# LICENSE
+#
+# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; either version 3 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+# Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see <https://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. You
+# need not follow the terms of the GNU General Public License when using
+# or distributing such scripts, even though portions of the text of the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+#serial 9
+
+AU_ALIAS([AC_CHECK_DEFINED], [AC_CHECK_DEFINE])
+AC_DEFUN([AC_CHECK_DEFINE],[
+AS_VAR_PUSHDEF([ac_var],[ac_cv_defined_$1])dnl
+AC_CACHE_CHECK([for $1 defined], ac_var,
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
+ #ifdef $1
+ int ok;
+ #else
+ choke me
+ #endif
+]])],[AS_VAR_SET(ac_var, yes)],[AS_VAR_SET(ac_var, no)]))
+AS_IF([test AS_VAR_GET(ac_var) != "no"], [$2], [$3])dnl
+AS_VAR_POPDEF([ac_var])dnl
+])
+
+AU_ALIAS([AX_CHECK_DEFINED], [AX_CHECK_DEFINE])
+AC_DEFUN([AX_CHECK_DEFINE],[
+AS_VAR_PUSHDEF([ac_var],[ac_cv_defined_$2_$1])dnl
+AC_CACHE_CHECK([for $2 defined in $1], ac_var,
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <$1>]], [[
+ #ifdef $2
+ int ok;
+ #else
+ choke me
+ #endif
+]])],[AS_VAR_SET(ac_var, yes)],[AS_VAR_SET(ac_var, no)]))
+AS_IF([test AS_VAR_GET(ac_var) != "no"], [$3], [$4])dnl
+AS_VAR_POPDEF([ac_var])dnl
+])
+
+AC_DEFUN([AX_CHECK_FUNC],
+[AS_VAR_PUSHDEF([ac_var], [ac_cv_func_$2])dnl
+AC_CACHE_CHECK([for $2], ac_var,
+dnl AC_LANG_FUNC_LINK_TRY
+[AC_LINK_IFELSE([AC_LANG_PROGRAM([$1
+ #undef $2
+ char $2 ();],[
+ char (*f) () = $2;
+ return f != $2; ])],
+ [AS_VAR_SET(ac_var, yes)],
+ [AS_VAR_SET(ac_var, no)])])
+AS_IF([test AS_VAR_GET(ac_var) = yes], [$3], [$4])dnl
+AS_VAR_POPDEF([ac_var])dnl
+])# AC_CHECK_FUNC
diff --git a/m4/ax_cxx_compile_stdcxx.m4 b/m4/ax_cxx_compile_stdcxx.m4
new file mode 100644
index 00000000..079e17d2
--- /dev/null
+++ b/m4/ax_cxx_compile_stdcxx.m4
@@ -0,0 +1,558 @@
+# ===========================================================================
+# http://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CXX_COMPILE_STDCXX(VERSION, [ext|noext], [mandatory|optional])
+#
+# DESCRIPTION
+#
+# Check for baseline language coverage in the compiler for the specified
+# version of the C++ standard. If necessary, add switches to CXXFLAGS to
+# enable support. VERSION may be '11' (for the C++11 standard) or '14'
+# (for the C++14 standard).
+#
+# The second argument, if specified, indicates whether you insist on an
+# extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g.
+# -std=c++11). If neither is specified, you get whatever works, with
+# preference for an extended mode.
+#
+# The third argument, if specified 'mandatory' or if left unspecified,
+# indicates that baseline support for the specified C++ standard is
+# required and that the macro should error out if no mode with that
+# support is found. If specified 'optional', then configuration proceeds
+# regardless, after defining HAVE_CXX${VERSION} if and only if a
+# supporting mode is found.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Benjamin Kosnik <bkoz@redhat.com>
+# Copyright (c) 2012 Zack Weinberg <zackw@panix.com>
+# Copyright (c) 2013 Roy Stogner <roystgnr@ices.utexas.edu>
+# Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov <sokolov@google.com>
+# Copyright (c) 2015 Paul Norman <penorman@mac.com>
+# Copyright (c) 2015 Moritz Klammler <moritz@klammler.eu>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved. This file is offered as-is, without any
+# warranty.
+
+#serial 1
+
+dnl This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro
+dnl (serial version number 13).
+
+AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl
+ m4_if([$1], [11], [],
+ [$1], [14], [],
+ [$1], [17], [m4_fatal([support for C++17 not yet implemented in AX_CXX_COMPILE_STDCXX])],
+ [m4_fatal([invalid first argument `$1' to AX_CXX_COMPILE_STDCXX])])dnl
+ m4_if([$2], [], [],
+ [$2], [ext], [],
+ [$2], [noext], [],
+ [m4_fatal([invalid second argument `$2' to AX_CXX_COMPILE_STDCXX])])dnl
+ m4_if([$3], [], [ax_cxx_compile_cxx$1_required=true],
+ [$3], [mandatory], [ax_cxx_compile_cxx$1_required=true],
+ [$3], [optional], [ax_cxx_compile_cxx$1_required=false],
+ [m4_fatal([invalid third argument `$3' to AX_CXX_COMPILE_STDCXX])])
+ AC_LANG_PUSH([C++])dnl
+ ac_success=no
+ AC_CACHE_CHECK(whether $CXX supports C++$1 features by default,
+ ax_cv_cxx_compile_cxx$1,
+ [AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])],
+ [ax_cv_cxx_compile_cxx$1=yes],
+ [ax_cv_cxx_compile_cxx$1=no])])
+ if test x$ax_cv_cxx_compile_cxx$1 = xyes; then
+ ac_success=yes
+ fi
+
+ m4_if([$2], [noext], [], [dnl
+ if test x$ac_success = xno; then
+ for switch in -std=gnu++$1 -std=gnu++0x; do
+ cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch])
+ AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch,
+ $cachevar,
+ [ac_save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="$CXXFLAGS $switch"
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])],
+ [eval $cachevar=yes],
+ [eval $cachevar=no])
+ CXXFLAGS="$ac_save_CXXFLAGS"])
+ if eval test x\$$cachevar = xyes; then
+ CXXFLAGS="$CXXFLAGS $switch"
+ ac_success=yes
+ break
+ fi
+ done
+ fi])
+
+ m4_if([$2], [ext], [], [dnl
+ if test x$ac_success = xno; then
+ dnl HP's aCC needs +std=c++11 according to:
+ dnl http://h21007.www2.hp.com/portal/download/files/unprot/aCxx/PDF_Release_Notes/769149-001.pdf
+ dnl Cray's crayCC needs "-h std=c++11"
+ for switch in -std=c++$1 -std=c++0x +std=c++$1 "-h std=c++$1"; do
+ cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch])
+ AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch,
+ $cachevar,
+ [ac_save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="$CXXFLAGS $switch"
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])],
+ [eval $cachevar=yes],
+ [eval $cachevar=no])
+ CXXFLAGS="$ac_save_CXXFLAGS"])
+ if eval test x\$$cachevar = xyes; then
+ CXXFLAGS="$CXXFLAGS $switch"
+ ac_success=yes
+ break
+ fi
+ done
+ fi])
+ AC_LANG_POP([C++])
+ if test x$ax_cxx_compile_cxx$1_required = xtrue; then
+ if test x$ac_success = xno; then
+ AC_MSG_ERROR([*** A compiler with support for C++$1 language features is required.])
+ fi
+ else
+ if test x$ac_success = xno; then
+ HAVE_CXX$1=0
+ AC_MSG_NOTICE([No compiler with C++$1 support was found])
+ else
+ HAVE_CXX$1=1
+ AC_DEFINE(HAVE_CXX$1,1,
+ [define if the compiler supports basic C++$1 syntax])
+ fi
+
+ AC_SUBST(HAVE_CXX$1)
+ fi
+])
+
+
+dnl Test body for checking C++11 support
+
+m4_define([_AX_CXX_COMPILE_STDCXX_testbody_11],
+ _AX_CXX_COMPILE_STDCXX_testbody_new_in_11
+)
+
+
+dnl Test body for checking C++14 support
+
+m4_define([_AX_CXX_COMPILE_STDCXX_testbody_14],
+ _AX_CXX_COMPILE_STDCXX_testbody_new_in_11
+ _AX_CXX_COMPILE_STDCXX_testbody_new_in_14
+)
+
+
+dnl Tests for new features in C++11
+
+m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_11], [[
+
+// If the compiler admits that it is not ready for C++11, why torture it?
+// Hopefully, this will speed up the test.
+
+#ifndef __cplusplus
+
+#error "This is not a C++ compiler"
+
+#elif __cplusplus < 201103L
+
+#error "This is not a C++11 compiler"
+
+#else
+
+namespace cxx11
+{
+
+ namespace test_static_assert
+ {
+
+ template <typename T>
+ struct check
+ {
+ static_assert(sizeof(int) <= sizeof(T), "not big enough");
+ };
+
+ }
+
+ namespace test_final_override
+ {
+
+ struct Base
+ {
+ virtual void f() {}
+ };
+
+ struct Derived : public Base
+ {
+ virtual void f() override {}
+ };
+
+ }
+
+ namespace test_double_right_angle_brackets
+ {
+
+ template < typename T >
+ struct check {};
+
+ typedef check<void> single_type;
+ typedef check<check<void>> double_type;
+ typedef check<check<check<void>>> triple_type;
+ typedef check<check<check<check<void>>>> quadruple_type;
+
+ }
+
+ namespace test_decltype
+ {
+
+ int
+ f()
+ {
+ int a = 1;
+ decltype(a) b = 2;
+ return a + b;
+ }
+
+ }
+
+ namespace test_type_deduction
+ {
+
+ template < typename T1, typename T2 >
+ struct is_same
+ {
+ static const bool value = false;
+ };
+
+ template < typename T >
+ struct is_same<T, T>
+ {
+ static const bool value = true;
+ };
+
+ template < typename T1, typename T2 >
+ auto
+ add(T1 a1, T2 a2) -> decltype(a1 + a2)
+ {
+ return a1 + a2;
+ }
+
+ int
+ test(const int c, volatile int v)
+ {
+ static_assert(is_same<int, decltype(0)>::value == true, "");
+ static_assert(is_same<int, decltype(c)>::value == false, "");
+ static_assert(is_same<int, decltype(v)>::value == false, "");
+ auto ac = c;
+ auto av = v;
+ auto sumi = ac + av + 'x';
+ auto sumf = ac + av + 1.0;
+ static_assert(is_same<int, decltype(ac)>::value == true, "");
+ static_assert(is_same<int, decltype(av)>::value == true, "");
+ static_assert(is_same<int, decltype(sumi)>::value == true, "");
+ static_assert(is_same<int, decltype(sumf)>::value == false, "");
+ static_assert(is_same<int, decltype(add(c, v))>::value == true, "");
+ return (sumf > 0.0) ? sumi : add(c, v);
+ }
+
+ }
+
+ namespace test_noexcept
+ {
+
+ int f() { return 0; }
+ int g() noexcept { return 0; }
+
+ static_assert(noexcept(f()) == false, "");
+ static_assert(noexcept(g()) == true, "");
+
+ }
+
+ namespace test_constexpr
+ {
+
+ template < typename CharT >
+ unsigned long constexpr
+ strlen_c_r(const CharT *const s, const unsigned long acc) noexcept
+ {
+ return *s ? strlen_c_r(s + 1, acc + 1) : acc;
+ }
+
+ template < typename CharT >
+ unsigned long constexpr
+ strlen_c(const CharT *const s) noexcept
+ {
+ return strlen_c_r(s, 0UL);
+ }
+
+ static_assert(strlen_c("") == 0UL, "");
+ static_assert(strlen_c("1") == 1UL, "");
+ static_assert(strlen_c("example") == 7UL, "");
+ static_assert(strlen_c("another\0example") == 7UL, "");
+
+ }
+
+ namespace test_rvalue_references
+ {
+
+ template < int N >
+ struct answer
+ {
+ static constexpr int value = N;
+ };
+
+ answer<1> f(int&) { return answer<1>(); }
+ answer<2> f(const int&) { return answer<2>(); }
+ answer<3> f(int&&) { return answer<3>(); }
+
+ void
+ test()
+ {
+ int i = 0;
+ const int c = 0;
+ static_assert(decltype(f(i))::value == 1, "");
+ static_assert(decltype(f(c))::value == 2, "");
+ static_assert(decltype(f(0))::value == 3, "");
+ }
+
+ }
+
+ namespace test_uniform_initialization
+ {
+
+ struct test
+ {
+ static const int zero {};
+ static const int one {1};
+ };
+
+ static_assert(test::zero == 0, "");
+ static_assert(test::one == 1, "");
+
+ }
+
+ namespace test_lambdas
+ {
+
+ void
+ test1()
+ {
+ auto lambda1 = [](){};
+ auto lambda2 = lambda1;
+ lambda1();
+ lambda2();
+ }
+
+ int
+ test2()
+ {
+ auto a = [](int i, int j){ return i + j; }(1, 2);
+ auto b = []() -> int { return '0'; }();
+ auto c = [=](){ return a + b; }();
+ auto d = [&](){ return c; }();
+ auto e = [a, &b](int x) mutable {
+ const auto identity = [](int y){ return y; };
+ for (auto i = 0; i < a; ++i)
+ a += b--;
+ return x + identity(a + b);
+ }(0);
+ return a + b + c + d + e;
+ }
+
+ int
+ test3()
+ {
+ const auto nullary = [](){ return 0; };
+ const auto unary = [](int x){ return x; };
+ using nullary_t = decltype(nullary);
+ using unary_t = decltype(unary);
+ const auto higher1st = [](nullary_t f){ return f(); };
+ const auto higher2nd = [unary](nullary_t f1){
+ return [unary, f1](unary_t f2){ return f2(unary(f1())); };
+ };
+ return higher1st(nullary) + higher2nd(nullary)(unary);
+ }
+
+ }
+
+ namespace test_variadic_templates
+ {
+
+ template <int...>
+ struct sum;
+
+ template <int N0, int... N1toN>
+ struct sum<N0, N1toN...>
+ {
+ static constexpr auto value = N0 + sum<N1toN...>::value;
+ };
+
+ template <>
+ struct sum<>
+ {
+ static constexpr auto value = 0;
+ };
+
+ static_assert(sum<>::value == 0, "");
+ static_assert(sum<1>::value == 1, "");
+ static_assert(sum<23>::value == 23, "");
+ static_assert(sum<1, 2>::value == 3, "");
+ static_assert(sum<5, 5, 11>::value == 21, "");
+ static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, "");
+
+ }
+
+ // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae
+ // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function
+ // because of this.
+ namespace test_template_alias_sfinae
+ {
+
+ struct foo {};
+
+ template<typename T>
+ using member = typename T::member_type;
+
+ template<typename T>
+ void func(...) {}
+
+ template<typename T>
+ void func(member<T>*) {}
+
+ void test();
+
+ void test() { func<foo>(0); }
+
+ }
+
+} // namespace cxx11
+
+#endif // __cplusplus >= 201103L
+
+]])
+
+
+dnl Tests for new features in C++14
+
+m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_14], [[
+
+// If the compiler admits that it is not ready for C++14, why torture it?
+// Hopefully, this will speed up the test.
+
+#ifndef __cplusplus
+
+#error "This is not a C++ compiler"
+
+#elif __cplusplus < 201402L
+
+#error "This is not a C++14 compiler"
+
+#else
+
+namespace cxx14
+{
+
+ namespace test_polymorphic_lambdas
+ {
+
+ int
+ test()
+ {
+ const auto lambda = [](auto&&... args){
+ const auto istiny = [](auto x){
+ return (sizeof(x) == 1UL) ? 1 : 0;
+ };
+ const int aretiny[] = { istiny(args)... };
+ return aretiny[0];
+ };
+ return lambda(1, 1L, 1.0f, '1');
+ }
+
+ }
+
+ namespace test_binary_literals
+ {
+
+ constexpr auto ivii = 0b0000000000101010;
+ static_assert(ivii == 42, "wrong value");
+
+ }
+
+ namespace test_generalized_constexpr
+ {
+
+ template < typename CharT >
+ constexpr unsigned long
+ strlen_c(const CharT *const s) noexcept
+ {
+ auto length = 0UL;
+ for (auto p = s; *p; ++p)
+ ++length;
+ return length;
+ }
+
+ static_assert(strlen_c("") == 0UL, "");
+ static_assert(strlen_c("x") == 1UL, "");
+ static_assert(strlen_c("test") == 4UL, "");
+ static_assert(strlen_c("another\0test") == 7UL, "");
+
+ }
+
+ namespace test_lambda_init_capture
+ {
+
+ int
+ test()
+ {
+ auto x = 0;
+ const auto lambda1 = [a = x](int b){ return a + b; };
+ const auto lambda2 = [a = lambda1(x)](){ return a; };
+ return lambda2();
+ }
+
+ }
+
+ namespace test_digit_seperators
+ {
+
+ constexpr auto ten_million = 100'000'000;
+ static_assert(ten_million == 100000000, "");
+
+ }
+
+ namespace test_return_type_deduction
+ {
+
+ auto f(int& x) { return x; }
+ decltype(auto) g(int& x) { return x; }
+
+ template < typename T1, typename T2 >
+ struct is_same
+ {
+ static constexpr auto value = false;
+ };
+
+ template < typename T >
+ struct is_same<T, T>
+ {
+ static constexpr auto value = true;
+ };
+
+ int
+ test()
+ {
+ auto x = 0;
+ static_assert(is_same<int, decltype(f(x))>::value, "");
+ static_assert(is_same<int&, decltype(g(x))>::value, "");
+ return x;
+ }
+
+ }
+
+} // namespace cxx14
+
+#endif // __cplusplus >= 201402L
+
+]])
diff --git a/m4/ax_pthread.m4 b/m4/ax_pthread.m4
index ca164eb2..77ae09c3 100644
--- a/m4/ax_pthread.m4
+++ b/m4/ax_pthread.m4
@@ -280,4 +280,4 @@ else
$2
fi
AC_LANG_RESTORE
-])dnl AX_PTHREAD \ No newline at end of file
+])dnl AX_PTHREAD
diff --git a/m4/ax_require_defined.m4 b/m4/ax_require_defined.m4
new file mode 100644
index 00000000..cae11112
--- /dev/null
+++ b/m4/ax_require_defined.m4
@@ -0,0 +1,37 @@
+# ===========================================================================
+# http://www.gnu.org/software/autoconf-archive/ax_require_defined.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_REQUIRE_DEFINED(MACRO)
+#
+# DESCRIPTION
+#
+# AX_REQUIRE_DEFINED is a simple helper for making sure other macros have
+# been defined and thus are available for use. This avoids random issues
+# where a macro isn't expanded. Instead the configure script emits a
+# non-fatal:
+#
+# ./configure: line 1673: AX_CFLAGS_WARN_ALL: command not found
+#
+# It's like AC_REQUIRE except it doesn't expand the required macro.
+#
+# Here's an example:
+#
+# AX_REQUIRE_DEFINED([AX_CHECK_LINK_FLAG])
+#
+# LICENSE
+#
+# Copyright (c) 2014 Mike Frysinger <vapier@gentoo.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved. This file is offered as-is, without any
+# warranty.
+
+#serial 1
+
+AC_DEFUN([AX_REQUIRE_DEFINED], [dnl
+ m4_ifndef([$1], [m4_fatal([macro ]$1[ is not defined; is a m4 file missing?])])
+])dnl AX_REQUIRE_DEFINED
diff --git a/scripts/travis-build.sh b/scripts/travis-build.sh
new file mode 100755
index 00000000..1d1beb3d
--- /dev/null
+++ b/scripts/travis-build.sh
@@ -0,0 +1,70 @@
+#!/bin/bash
+
+set -ex
+
+setup_env() {
+ # Travis sets CC/CXX to the system toolchain, so our .travis.yml
+ # exports USE_{CC,CXX} for this script to use.
+ if [ -n "$USE_CC" ]; then
+ export CC=$USE_CC
+ fi
+ if [ -n "$USE_CXX" ]; then
+ export CXX=$USE_CXX
+ fi
+ # Use -jN for faster builds. Travis build machines under Docker
+ # have a lot of cores, but are memory-limited, so the kernel
+ # will OOM if we try to use them all, so use at most 4.
+ # See https://github.com/travis-ci/travis-ci/issues/1972
+ export NCPUS=$(getconf _NPROCESSORS_ONLN)
+ export JOBS=$(( $NCPUS < 4 ? $NCPUS : 4 ))
+}
+
+# We have to do this by hand rather than use the coverity addon because of
+# matrix explosion: https://github.com/travis-ci/travis-ci/issues/1975
+# We also do it by hand because when we're throttled, the addon will exit
+# the build immediately and skip the main script!
+coverity_scan() {
+ if [ "${COVERITY_SCAN}" != "true" ] || \
+ [ -n "${TRAVIS_TAG}" ] || \
+ [ "${TRAVIS_PULL_REQUEST}" = "true" ]
+ then
+ echo "Skipping coverity scan."
+ return
+ fi
+
+ export COVERITY_SCAN_PROJECT_NAME="${TRAVIS_REPO_SLUG}"
+ export COVERITY_SCAN_NOTIFICATION_EMAIL="google-breakpad-dev@googlegroups.com"
+ export COVERITY_SCAN_BUILD_COMMAND="make -j${JOBS}"
+ export COVERITY_SCAN_BUILD_COMMAND_PREPEND="git clean -q -x -d -f; git checkout -f; ./configure"
+ export COVERITY_SCAN_BRANCH_PATTERN="master"
+
+ curl -s "https://scan.coverity.com/scripts/travisci_build_coverity_scan.sh" | bash || :
+}
+
+# Do an in-tree build and make sure tests pass.
+build() {
+ ./configure --with-tests-as-root
+ make -j${JOBS} check VERBOSE=1
+ make distclean
+}
+
+# Do an out-of-tree build and make sure we can create a release tarball.
+build_out_of_tree() {
+ mkdir -p build/native
+ pushd build/native >/dev/null
+ ../../configure --with-tests-as-root
+ make -j${JOBS} distcheck VERBOSE=1
+ popd >/dev/null
+}
+
+main() {
+ setup_env
+ build
+ build_out_of_tree
+
+ # Do scans last as they like to dirty the tree and some tests
+ # expect a clean tree (like code style checks).
+ coverity_scan
+}
+
+main "$@"
diff --git a/scripts/travis-checkout.sh b/scripts/travis-checkout.sh
new file mode 100755
index 00000000..e5b33324
--- /dev/null
+++ b/scripts/travis-checkout.sh
@@ -0,0 +1,24 @@
+#!/bin/bash
+set -ex
+
+get_depot_tools() {
+ cd
+ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
+ PATH="$HOME/depot_tools:$PATH"
+}
+
+gclient_sync() {
+ # Rename the source dir to match what gclient expects.
+ srcdir=$(basename "$TRAVIS_BUILD_DIR")
+ cd "${TRAVIS_BUILD_DIR}"/..
+ mv "${srcdir}" src
+ gclient config --unmanaged https://github.com/google/breakpad.git
+ gclient sync
+}
+
+main() {
+ get_depot_tools
+ gclient_sync
+}
+
+main "$@"
diff --git a/src/breakpad_googletest_includes.h b/src/breakpad_googletest_includes.h
index 1cc324b2..19a3e980 100644
--- a/src/breakpad_googletest_includes.h
+++ b/src/breakpad_googletest_includes.h
@@ -30,8 +30,8 @@
#ifndef BREAKPAD_GOOGLETEST_INCLUDES_H__
#define BREAKPAD_GOOGLETEST_INCLUDES_H__
-#include "testing/gtest/include/gtest/gtest.h"
-#include "testing/include/gmock/gmock.h"
+#include "gtest/gtest.h"
+#include "gmock/gmock.h"
// If AddressSanitizer is used, NULL pointer dereferences generate SIGILL
// (illegal instruction) instead of SIGSEGV (segmentation fault). Also,
diff --git a/src/build/common.gypi b/src/build/common.gypi
index b9466a32..29990c65 100644
--- a/src/build/common.gypi
+++ b/src/build/common.gypi
@@ -894,7 +894,7 @@
],
'msvs_cygwin_dirs': ['<(DEPTH)/third_party/cygwin'],
'msvs_disabled_warnings': [
- 4100, 4127, 4396, 4503, 4512, 4819, 4995, 4702
+ 4091, 4100, 4127, 4366, 4396, 4503, 4512, 4819, 4995, 4702
],
'msvs_settings': {
'VCCLCompilerTool': {
diff --git a/src/build/testing.gypi b/src/build/testing.gyp
index 3a77230a..6a459a64 100644
--- a/src/build/testing.gypi
+++ b/src/build/testing.gyp
@@ -32,15 +32,15 @@
'target_name': 'gtest',
'type': 'static_library',
'sources': [
- '../testing/gtest/src/gtest-all.cc',
+ '../testing/googletest/src/gtest-all.cc',
],
'include_dirs': [
- '../testing/gtest',
- '../testing/gtest/include',
+ '../testing/googletest',
+ '../testing/googletest/include',
],
'direct_dependent_settings': {
'include_dirs': [
- '../testing/gtest/include',
+ '../testing/googletest/include',
],
},
},
@@ -51,7 +51,7 @@
'gtest',
],
'sources': [
- 'gtest/src/gtest_main.cc',
+ '../testing/googletest/src/gtest_main.cc',
],
},
{
@@ -61,15 +61,15 @@
'gtest',
],
'sources': [
- '../testing/src/gmock-all.cc',
+ '../testing/googlemock/src/gmock-all.cc',
],
'include_dirs': [
- '../testing',
- '../testing/include',
+ '../testing/googlemock',
+ '../testing/googlemock/include',
],
'direct_dependent_settings': {
'include_dirs': [
- '../testing/include',
+ '../testing/googlemock/include',
],
},
'export_dependent_settings': [
@@ -83,7 +83,7 @@
'gmock',
],
'sources': [
- '../testing/src/gmock_main.cc',
+ '../testing/googlemock/src/gmock_main.cc',
],
},
],
diff --git a/src/client/ios/Breakpad.h b/src/client/ios/Breakpad.h
index c099ad07..fa790f77 100644
--- a/src/client/ios/Breakpad.h
+++ b/src/client/ios/Breakpad.h
@@ -62,6 +62,14 @@ typedef bool (*BreakpadFilterCallback)(int exception_type,
mach_port_t crashing_thread,
void *context);
+// Optional user-defined function that will be called after a network upload
+// of a crash report.
+// |report_id| will be the id returned by the server, or "ERR" if an error
+// occurred.
+// |error| will contain the error, or nil if no error occured.
+typedef void (*BreakpadUploadCompletionCallback)(NSString *report_id,
+ NSError *error);
+
// Create a new BreakpadRef object and install it as an exception
// handler. The |parameters| will typically be the contents of your
// bundle's Info.plist.
@@ -202,13 +210,18 @@ int BreakpadGetCrashReportCount(BreakpadRef ref);
// Returns the next upload configuration. The report file is deleted.
NSDictionary *BreakpadGetNextReportConfiguration(BreakpadRef ref);
+// Returns the date of the most recent crash report.
+NSDate *BreakpadGetDateOfMostRecentCrashReport(BreakpadRef ref);
+
// Upload next report to the server.
void BreakpadUploadNextReport(BreakpadRef ref);
// Upload next report to the server.
// |server_parameters| is additional server parameters to send.
-void BreakpadUploadNextReportWithParameters(BreakpadRef ref,
- NSDictionary *server_parameters);
+void BreakpadUploadNextReportWithParameters(
+ BreakpadRef ref,
+ NSDictionary *server_parameters,
+ BreakpadUploadCompletionCallback callback);
// Upload a report to the server.
// |server_parameters| is additional server parameters to send.
@@ -216,7 +229,8 @@ void BreakpadUploadNextReportWithParameters(BreakpadRef ref,
void BreakpadUploadReportWithParametersAndConfiguration(
BreakpadRef ref,
NSDictionary *server_parameters,
- NSDictionary *configuration);
+ NSDictionary *configuration,
+ BreakpadUploadCompletionCallback callback);
// Handles the network response of a breakpad upload. This function is needed if
// the actual upload is done by the Breakpad client.
diff --git a/src/client/ios/Breakpad.mm b/src/client/ios/Breakpad.mm
index c56a6401..2b61bbe3 100644
--- a/src/client/ios/Breakpad.mm
+++ b/src/client/ios/Breakpad.mm
@@ -36,14 +36,22 @@
#include <pthread.h>
#include <sys/stat.h>
#include <sys/sysctl.h>
+#include <TargetConditionals.h>
+
+#include <string>
#import "client/ios/handler/ios_exception_minidump_generator.h"
#import "client/mac/crash_generation/ConfigFile.h"
-#import "client/mac/handler/exception_handler.h"
#import "client/mac/handler/minidump_generator.h"
-#import "client/mac/sender/uploader.h"
#import "client/mac/handler/protected_memory_allocator.h"
-#import "common/simple_string_dictionary.h"
+#import "client/mac/sender/uploader.h"
+#import "common/long_string_dictionary.h"
+
+#if !TARGET_OS_TV && !TARGET_OS_WATCH
+#import "client/mac/handler/exception_handler.h"
+#else
+#import "client/ios/exception_handler_no_mach.h"
+#endif // !TARGET_OS_TV && !TARGET_OS_WATCH
#if !defined(__EXCEPTIONS) || (__clang__ && !__has_feature(cxx_exceptions))
// This file uses C++ try/catch (but shouldn't). Duplicate the macros from
@@ -59,7 +67,7 @@
using google_breakpad::ConfigFile;
using google_breakpad::EnsureDirectoryPathExists;
-using google_breakpad::SimpleStringDictionary;
+using google_breakpad::LongStringDictionary;
//=============================================================================
// We want any memory allocations which are used by breakpad during the
@@ -112,7 +120,7 @@ class ProtectedMemoryLocker {
// Then unlock the mutex
__attribute__((unused)) int rv = pthread_mutex_unlock(mutex_);
assert(rv == 0);
- };
+ }
private:
ProtectedMemoryLocker();
@@ -153,9 +161,12 @@ class Breakpad {
NSArray *CrashReportsToUpload();
NSString *NextCrashReportToUpload();
NSDictionary *NextCrashReportConfiguration();
+ NSDictionary *FixedUpCrashReportConfiguration(NSDictionary *configuration);
+ NSDate *DateOfMostRecentCrashReport();
void UploadNextReport(NSDictionary *server_parameters);
void UploadReportWithConfiguration(NSDictionary *configuration,
- NSDictionary *server_parameters);
+ NSDictionary *server_parameters,
+ BreakpadUploadCompletionCallback callback);
void UploadData(NSData *data, NSString *name,
NSDictionary *server_parameters);
void HandleNetworkResponse(NSDictionary *configuration,
@@ -190,7 +201,7 @@ class Breakpad {
// MachineExceptions.h, we have to explicitly name the handler.
google_breakpad::ExceptionHandler *handler_; // The actual handler (STRONG)
- SimpleStringDictionary *config_params_; // Create parameters (STRONG)
+ LongStringDictionary *config_params_; // Create parameters (STRONG)
ConfigFile config_file_;
@@ -263,8 +274,8 @@ void Breakpad::UncaughtExceptionHandler(NSException *exception) {
NSSetUncaughtExceptionHandler(NULL);
if (current_breakpad_) {
current_breakpad_->HandleUncaughtException(exception);
+ BreakpadRelease(current_breakpad_);
}
- BreakpadRelease(current_breakpad_);
}
//=============================================================================
@@ -306,7 +317,7 @@ Breakpad::~Breakpad() {
// since they were allocated by ProtectedMemoryAllocator objects.
//
if (config_params_) {
- config_params_->~SimpleStringDictionary();
+ config_params_->~LongStringDictionary();
}
if (handler_)
@@ -341,7 +352,7 @@ bool Breakpad::ExtractParameters(NSDictionary *parameters) {
}
}
- if (!version)
+ if (!version.length) // Default nil or empty string to CFBundleVersion
version = [parameters objectForKey:@"CFBundleVersion"];
if (!vendor) {
@@ -374,10 +385,10 @@ bool Breakpad::ExtractParameters(NSDictionary *parameters) {
}
config_params_ =
- new (gKeyValueAllocator->Allocate(sizeof(SimpleStringDictionary)) )
- SimpleStringDictionary();
+ new (gKeyValueAllocator->Allocate(sizeof(LongStringDictionary)))
+ LongStringDictionary();
- SimpleStringDictionary &dictionary = *config_params_;
+ LongStringDictionary &dictionary = *config_params_;
dictionary.SetKeyValue(BREAKPAD_SERVER_TYPE, [serverType UTF8String]);
dictionary.SetKeyValue(BREAKPAD_PRODUCT_DISPLAY, [display UTF8String]);
@@ -420,8 +431,8 @@ NSString *Breakpad::KeyValue(NSString *key) {
if (!config_params_ || !key)
return nil;
- const char *value = config_params_->GetValueForKey([key UTF8String]);
- return value ? [NSString stringWithUTF8String:value] : nil;
+ const std::string value = config_params_->GetValueForKey([key UTF8String]);
+ return value.empty() ? nil : [NSString stringWithUTF8String:value.c_str()];
}
//=============================================================================
@@ -456,7 +467,42 @@ NSString *Breakpad::NextCrashReportToUpload() {
//=============================================================================
NSDictionary *Breakpad::NextCrashReportConfiguration() {
- return [Uploader readConfigurationDataFromFile:NextCrashReportToUpload()];
+ NSDictionary *configuration = [Uploader readConfigurationDataFromFile:NextCrashReportToUpload()];
+ return FixedUpCrashReportConfiguration(configuration);
+}
+
+//=============================================================================
+NSDictionary *Breakpad::FixedUpCrashReportConfiguration(NSDictionary *configuration) {
+ NSMutableDictionary *fixedConfiguration = [[configuration mutableCopy] autorelease];
+ // kReporterMinidumpDirectoryKey can become stale because the app's data container path includes
+ // an UUID that is not guaranteed to stay the same over time.
+ [fixedConfiguration setObject:KeyValue(@BREAKPAD_DUMP_DIRECTORY)
+ forKey:@kReporterMinidumpDirectoryKey];
+ return fixedConfiguration;
+}
+
+//=============================================================================
+NSDate *Breakpad::DateOfMostRecentCrashReport() {
+ NSString *directory = KeyValue(@BREAKPAD_DUMP_DIRECTORY);
+ if (!directory) {
+ return nil;
+ }
+ NSFileManager *fileManager = [NSFileManager defaultManager];
+ NSArray *dirContents = [fileManager contentsOfDirectoryAtPath:directory error:nil];
+ NSArray *dumps = [dirContents filteredArrayUsingPredicate:[NSPredicate
+ predicateWithFormat:@"self ENDSWITH '.dmp'"]];
+ NSDate *mostRecentCrashReportDate = nil;
+ for (NSString *dump in dumps) {
+ NSString *filePath = [directory stringByAppendingPathComponent:dump];
+ NSDate *crashReportDate =
+ [[fileManager attributesOfItemAtPath:filePath error:nil] fileCreationDate];
+ if (!mostRecentCrashReportDate) {
+ mostRecentCrashReportDate = crashReportDate;
+ } else if (crashReportDate) {
+ mostRecentCrashReportDate = [mostRecentCrashReportDate laterDate:crashReportDate];
+ }
+ }
+ return mostRecentCrashReportDate;
}
//=============================================================================
@@ -469,8 +515,10 @@ void Breakpad::HandleNetworkResponse(NSDictionary *configuration,
}
//=============================================================================
-void Breakpad::UploadReportWithConfiguration(NSDictionary *configuration,
- NSDictionary *server_parameters) {
+void Breakpad::UploadReportWithConfiguration(
+ NSDictionary *configuration,
+ NSDictionary *server_parameters,
+ BreakpadUploadCompletionCallback callback) {
Uploader *uploader = [[[Uploader alloc]
initWithConfig:configuration] autorelease];
if (!uploader)
@@ -479,6 +527,13 @@ void Breakpad::UploadReportWithConfiguration(NSDictionary *configuration,
[uploader addServerParameter:[server_parameters objectForKey:key]
forKey:key];
}
+ if (callback) {
+ [uploader setUploadCompletionBlock:^(NSString *report_id, NSError *error) {
+ dispatch_async(dispatch_get_main_queue(), ^{
+ callback(report_id, error);
+ });
+ }];
+ }
[uploader report];
}
@@ -486,7 +541,8 @@ void Breakpad::UploadReportWithConfiguration(NSDictionary *configuration,
void Breakpad::UploadNextReport(NSDictionary *server_parameters) {
NSDictionary *configuration = NextCrashReportConfiguration();
if (configuration) {
- return UploadReportWithConfiguration(configuration, server_parameters);
+ return UploadReportWithConfiguration(configuration, server_parameters,
+ nullptr);
}
}
@@ -495,8 +551,8 @@ void Breakpad::UploadData(NSData *data, NSString *name,
NSDictionary *server_parameters) {
NSMutableDictionary *config = [NSMutableDictionary dictionary];
- SimpleStringDictionary::Iterator it(*config_params_);
- while (const SimpleStringDictionary::Entry *next = it.Next()) {
+ LongStringDictionary::Iterator it(*config_params_);
+ while (const LongStringDictionary::Entry *next = it.Next()) {
[config setValue:[NSString stringWithUTF8String:next->value]
forKey:[NSString stringWithUTF8String:next->key]];
}
@@ -525,7 +581,7 @@ NSDictionary *Breakpad::GenerateReport(NSDictionary *server_parameters) {
if (!success)
return nil;
- SimpleStringDictionary params = *config_params_;
+ LongStringDictionary params = *config_params_;
for (NSString *key in server_parameters) {
params.SetKeyValue([key UTF8String],
[[server_parameters objectForKey:key] UTF8String]);
@@ -560,7 +616,7 @@ bool Breakpad::HandleMinidump(const char *dump_dir,
void Breakpad::HandleUncaughtException(NSException *exception) {
// Generate the minidump.
google_breakpad::IosExceptionMinidumpGenerator generator(exception);
- const char *minidump_path =
+ const std::string minidump_path =
config_params_->GetValueForKey(BREAKPAD_DUMP_DIRECTORY);
std::string minidump_id;
std::string minidump_filename = generator.UniqueNameInDirectory(minidump_path,
@@ -573,7 +629,7 @@ void Breakpad::HandleUncaughtException(NSException *exception) {
// 2- If the application crash while trying to handle this exception, a usual
// report will be generated. This report must not contain these special
// keys.
- SimpleStringDictionary params = *config_params_;
+ LongStringDictionary params = *config_params_;
params.SetKeyValue(BREAKPAD_SERVER_PARAMETER_PREFIX "type", "exception");
params.SetKeyValue(BREAKPAD_SERVER_PARAMETER_PREFIX "exceptionName",
[[exception name] UTF8String]);
@@ -582,9 +638,9 @@ void Breakpad::HandleUncaughtException(NSException *exception) {
// And finally write the config file.
ConfigFile config_file;
- config_file.WriteFile(minidump_path,
+ config_file.WriteFile(minidump_path.c_str(),
&params,
- minidump_path,
+ minidump_path.c_str(),
minidump_id.c_str());
}
@@ -612,9 +668,9 @@ BreakpadRef BreakpadCreate(NSDictionary *parameters) {
gKeyValueAllocator =
new (gMasterAllocator->Allocate(sizeof(ProtectedMemoryAllocator)))
- ProtectedMemoryAllocator(sizeof(SimpleStringDictionary));
+ ProtectedMemoryAllocator(sizeof(LongStringDictionary));
- // Create a mutex for use in accessing the SimpleStringDictionary
+ // Create a mutex for use in accessing the LongStringDictionary
int mutexResult = pthread_mutex_init(&gDictionaryMutex, NULL);
if (mutexResult == 0) {
@@ -817,7 +873,7 @@ int BreakpadGetCrashReportCount(BreakpadRef ref) {
//=============================================================================
void BreakpadUploadNextReport(BreakpadRef ref) {
- BreakpadUploadNextReportWithParameters(ref, nil);
+ BreakpadUploadNextReportWithParameters(ref, nil, nullptr);
}
//=============================================================================
@@ -833,25 +889,41 @@ NSDictionary *BreakpadGetNextReportConfiguration(BreakpadRef ref) {
}
//=============================================================================
+NSDate *BreakpadGetDateOfMostRecentCrashReport(BreakpadRef ref) {
+ try {
+ Breakpad *breakpad = (Breakpad *)ref;
+ if (breakpad) {
+ return breakpad->DateOfMostRecentCrashReport();
+ }
+ } catch (...) { // don't let exceptions leave this C API
+ fprintf(stderr, "BreakpadGetDateOfMostRecentCrashReport() : error\n");
+ }
+ return nil;
+}
+
+//=============================================================================
void BreakpadUploadReportWithParametersAndConfiguration(
BreakpadRef ref,
NSDictionary *server_parameters,
- NSDictionary *configuration) {
+ NSDictionary *configuration,
+ BreakpadUploadCompletionCallback callback) {
try {
Breakpad *breakpad = (Breakpad *)ref;
if (!breakpad || !configuration)
return;
- breakpad->UploadReportWithConfiguration(configuration, server_parameters);
+ breakpad->UploadReportWithConfiguration(configuration, server_parameters,
+ callback);
} catch(...) { // don't let exceptions leave this C API
fprintf(stderr,
"BreakpadUploadReportWithParametersAndConfiguration() : error\n");
}
-
}
//=============================================================================
-void BreakpadUploadNextReportWithParameters(BreakpadRef ref,
- NSDictionary *server_parameters) {
+void BreakpadUploadNextReportWithParameters(
+ BreakpadRef ref,
+ NSDictionary *server_parameters,
+ BreakpadUploadCompletionCallback callback) {
try {
Breakpad *breakpad = (Breakpad *)ref;
if (!breakpad)
@@ -859,9 +931,8 @@ void BreakpadUploadNextReportWithParameters(BreakpadRef ref,
NSDictionary *configuration = breakpad->NextCrashReportConfiguration();
if (!configuration)
return;
- return BreakpadUploadReportWithParametersAndConfiguration(ref,
- server_parameters,
- configuration);
+ return BreakpadUploadReportWithParametersAndConfiguration(
+ ref, server_parameters, configuration, callback);
} catch(...) { // don't let exceptions leave this C API
fprintf(stderr, "BreakpadUploadNextReportWithParameters() : error\n");
}
diff --git a/src/client/ios/Breakpad.xcodeproj/project.pbxproj b/src/client/ios/Breakpad.xcodeproj/project.pbxproj
index e9fcae3f..2ed66d53 100644
--- a/src/client/ios/Breakpad.xcodeproj/project.pbxproj
+++ b/src/client/ios/Breakpad.xcodeproj/project.pbxproj
@@ -31,7 +31,7 @@
16C7CE18147D4A4300776EAD /* minidump_file_writer-inl.h in Headers */ = {isa = PBXBuildFile; fileRef = 16C7CC04147D4A4300776EAD /* minidump_file_writer-inl.h */; };
16C7CE19147D4A4300776EAD /* minidump_file_writer.cc in Sources */ = {isa = PBXBuildFile; fileRef = 16C7CC05147D4A4300776EAD /* minidump_file_writer.cc */; };
16C7CE1A147D4A4300776EAD /* minidump_file_writer.h in Headers */ = {isa = PBXBuildFile; fileRef = 16C7CC06147D4A4300776EAD /* minidump_file_writer.h */; };
- 16C7CE40147D4A4300776EAD /* convert_UTF.c in Sources */ = {isa = PBXBuildFile; fileRef = 16C7CC4A147D4A4300776EAD /* convert_UTF.c */; };
+ 16C7CE40147D4A4300776EAD /* convert_UTF.cc in Sources */ = {isa = PBXBuildFile; fileRef = 16C7CC4A147D4A4300776EAD /* convert_UTF.cc */; };
16C7CE41147D4A4300776EAD /* convert_UTF.h in Headers */ = {isa = PBXBuildFile; fileRef = 16C7CC4B147D4A4300776EAD /* convert_UTF.h */; };
16C7CE78147D4A4300776EAD /* GTMLogger.h in Headers */ = {isa = PBXBuildFile; fileRef = 16C7CC88147D4A4300776EAD /* GTMLogger.h */; };
16C7CE79147D4A4300776EAD /* GTMLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 16C7CC89147D4A4300776EAD /* GTMLogger.m */; };
@@ -57,6 +57,8 @@
1EEEB6101720821900F7E689 /* simple_string_dictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = 1EEEB60D1720821900F7E689 /* simple_string_dictionary.h */; };
AA747D9F0F9514B9006C5449 /* Breakpad_Prefix.pch in Headers */ = {isa = PBXBuildFile; fileRef = AA747D9E0F9514B9006C5449 /* Breakpad_Prefix.pch */; };
AACBBE4A0F95108600F1A2B1 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AACBBE490F95108600F1A2B1 /* Foundation.framework */; };
+ CF6D547D1F9E6FFE00E95174 /* long_string_dictionary.cc in Sources */ = {isa = PBXBuildFile; fileRef = CF6D547C1F9E6FFE00E95174 /* long_string_dictionary.cc */; };
+ CF706DC11F7C6EFB002C54C7 /* long_string_dictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = CF706DC01F7C6EFB002C54C7 /* long_string_dictionary.h */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
@@ -85,7 +87,7 @@
16C7CC05147D4A4300776EAD /* minidump_file_writer.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = minidump_file_writer.cc; sourceTree = "<group>"; };
16C7CC06147D4A4300776EAD /* minidump_file_writer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = minidump_file_writer.h; sourceTree = "<group>"; };
16C7CC07147D4A4300776EAD /* minidump_file_writer_unittest.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = minidump_file_writer_unittest.cc; sourceTree = "<group>"; };
- 16C7CC4A147D4A4300776EAD /* convert_UTF.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = convert_UTF.c; sourceTree = "<group>"; };
+ 16C7CC4A147D4A4300776EAD /* convert_UTF.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = convert_UTF.cc; sourceTree = "<group>"; };
16C7CC4B147D4A4300776EAD /* convert_UTF.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = convert_UTF.h; sourceTree = "<group>"; };
16C7CC88147D4A4300776EAD /* GTMLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GTMLogger.h; sourceTree = "<group>"; };
16C7CC89147D4A4300776EAD /* GTMLogger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GTMLogger.m; sourceTree = "<group>"; };
@@ -111,6 +113,8 @@
1EEEB60D1720821900F7E689 /* simple_string_dictionary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = simple_string_dictionary.h; sourceTree = "<group>"; };
AA747D9E0F9514B9006C5449 /* Breakpad_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Breakpad_Prefix.pch; sourceTree = SOURCE_ROOT; };
AACBBE490F95108600F1A2B1 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
+ CF6D547C1F9E6FFE00E95174 /* long_string_dictionary.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = long_string_dictionary.cc; sourceTree = "<group>"; };
+ CF706DC01F7C6EFB002C54C7 /* long_string_dictionary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = long_string_dictionary.h; sourceTree = "<group>"; };
D2AAC07E0554694100DB518D /* libBreakpad.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libBreakpad.a; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
@@ -264,9 +268,11 @@
16C7CC47147D4A4300776EAD /* common */ = {
isa = PBXGroup;
children = (
+ CF706DC01F7C6EFB002C54C7 /* long_string_dictionary.h */,
+ CF6D547C1F9E6FFE00E95174 /* long_string_dictionary.cc */,
1EEEB60C1720821900F7E689 /* simple_string_dictionary.cc */,
1EEEB60D1720821900F7E689 /* simple_string_dictionary.h */,
- 16C7CC4A147D4A4300776EAD /* convert_UTF.c */,
+ 16C7CC4A147D4A4300776EAD /* convert_UTF.cc */,
16C7CC4B147D4A4300776EAD /* convert_UTF.h */,
16C7CC82147D4A4300776EAD /* mac */,
16C7CCA4147D4A4300776EAD /* md5.cc */,
@@ -339,6 +345,7 @@
16C7CEA8147D4A4300776EAD /* string_conversion.h in Headers */,
16BFA67014E195E9009704F8 /* ios_exception_minidump_generator.h in Headers */,
16C92FAD150DF8330053D7BA /* BreakpadController.h in Headers */,
+ CF706DC11F7C6EFB002C54C7 /* long_string_dictionary.h in Headers */,
1EEEB6101720821900F7E689 /* simple_string_dictionary.h in Headers */,
14569323182CE2C10029C465 /* mach_vm_compat.h in Headers */,
);
@@ -416,8 +423,9 @@
16C7CDFC147D4A4300776EAD /* minidump_generator.cc in Sources */,
16C7CDFE147D4A4300776EAD /* protected_memory_allocator.cc in Sources */,
16C7CE09147D4A4300776EAD /* uploader.mm in Sources */,
+ CF6D547D1F9E6FFE00E95174 /* long_string_dictionary.cc in Sources */,
16C7CE19147D4A4300776EAD /* minidump_file_writer.cc in Sources */,
- 16C7CE40147D4A4300776EAD /* convert_UTF.c in Sources */,
+ 16C7CE40147D4A4300776EAD /* convert_UTF.cc in Sources */,
16C7CE79147D4A4300776EAD /* GTMLogger.m in Sources */,
16C7CE7B147D4A4300776EAD /* HTTPMultipartUpload.m in Sources */,
16C7CE83147D4A4300776EAD /* file_id.cc in Sources */,
@@ -440,6 +448,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_CXX_LIBRARY = "libc++";
COPY_PHASE_STRIP = NO;
DSTROOT = /tmp/Breakpad.dst;
FRAMEWORK_SEARCH_PATHS = (
@@ -471,6 +480,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_CXX_LIBRARY = "libc++";
DSTROOT = /tmp/Breakpad.dst;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
diff --git a/src/client/ios/BreakpadController.h b/src/client/ios/BreakpadController.h
index 13609cb8..6c70c202 100644
--- a/src/client/ios/BreakpadController.h
+++ b/src/client/ios/BreakpadController.h
@@ -66,6 +66,9 @@
// The dictionary that contains additional server parameters to send when
// uploading crash reports.
NSDictionary* uploadTimeParameters_;
+
+ // The callback to call on report upload completion.
+ BreakpadUploadCompletionCallback uploadCompleteCallback_;
}
// Singleton.
@@ -95,6 +98,10 @@
// crash report is generated. See |BreakpadAddUploadParameter|.
- (void)addUploadParameter:(NSString*)value forKey:(NSString*)key;
+// Sets the callback to be called after uploading a crash report to the server.
+// Only the latest callback registered will be called.
+- (void)setUploadCallback:(BreakpadUploadCompletionCallback)callback;
+
// Remove a previously-added parameter from the upload parameter set. See
// |BreakpadRemoveUploadParameter|.
- (void)removeUploadParameterForKey:(NSString*)key;
@@ -112,6 +119,9 @@
// Unregisters the crash handlers.
- (void)stop;
+// Returns whether or not the controller is started.
+- (BOOL)isStarted;
+
// Enables or disables uploading of crash reports, but does not stop the
// BreakpadController.
- (void)setUploadingEnabled:(BOOL)enabled;
@@ -131,6 +141,9 @@
- (void)getNextReportConfigurationOrSendDelay:
(void(^)(NSDictionary*, int))callback;
+// Get the date of the most recent crash report.
+- (void)getDateOfMostRecentCrashReport:(void(^)(NSDate *))callback;
+
// Sends synchronously the report specified by |configuration|. This method is
// NOT thread safe and must be called from the breakpad thread.
- (void)threadUnsafeSendReportWithConfiguration:(NSDictionary*)configuration
diff --git a/src/client/ios/BreakpadController.mm b/src/client/ios/BreakpadController.mm
index dd71cff6..01fb5f13 100644
--- a/src/client/ios/BreakpadController.mm
+++ b/src/client/ios/BreakpadController.mm
@@ -93,11 +93,12 @@ NSString* GetPlatform() {
@implementation BreakpadController
+ (BreakpadController*)sharedInstance {
- @synchronized(self) {
- static BreakpadController* sharedInstance_ =
- [[BreakpadController alloc] initSingleton];
- return sharedInstance_;
- }
+ static dispatch_once_t onceToken;
+ static BreakpadController* sharedInstance ;
+ dispatch_once(&onceToken, ^{
+ sharedInstance = [[BreakpadController alloc] initSingleton];
+ });
+ return sharedInstance;
}
- (id)init {
@@ -155,15 +156,19 @@ NSString* GetPlatform() {
});
}
+- (BOOL)isStarted {
+ return started_;
+}
+
// This method must be called from the breakpad queue.
- (void)threadUnsafeSendReportWithConfiguration:(NSDictionary*)configuration
withBreakpadRef:(BreakpadRef)ref {
NSAssert(started_, @"The controller must be started before "
"threadUnsafeSendReportWithConfiguration is called");
if (breakpadRef_) {
- BreakpadUploadReportWithParametersAndConfiguration(breakpadRef_,
- uploadTimeParameters_,
- configuration);
+ BreakpadUploadReportWithParametersAndConfiguration(
+ breakpadRef_, uploadTimeParameters_, configuration,
+ uploadCompleteCallback_);
}
}
@@ -179,10 +184,9 @@ NSString* GetPlatform() {
enableUploads_ = YES;
[self sendStoredCrashReports];
} else {
+ // disable the enableUpload_ flag.
+ // sendDelay checks this flag and disables the upload of logs by sendStoredCrashReports
enableUploads_ = NO;
- [NSObject cancelPreviousPerformRequestsWithTarget:self
- selector:@selector(sendStoredCrashReports)
- object:nil];
}
});
}
@@ -191,7 +195,7 @@ NSString* GetPlatform() {
NSAssert(!started_,
@"The controller must not be started when updateConfiguration is called");
[configuration_ addEntriesFromDictionary:configuration];
- NSString* uploadInterval =
+ NSString *uploadInterval =
[configuration_ valueForKey:@BREAKPAD_REPORT_INTERVAL];
if (uploadInterval)
[self setUploadInterval:[uploadInterval intValue]];
@@ -202,7 +206,7 @@ NSString* GetPlatform() {
@"The controller must not be started when resetConfiguration is called");
[configuration_ autorelease];
configuration_ = [[[NSBundle mainBundle] infoDictionary] mutableCopy];
- NSString* uploadInterval =
+ NSString *uploadInterval =
[configuration_ valueForKey:@BREAKPAD_REPORT_INTERVAL];
[self setUploadInterval:[uploadInterval intValue]];
[self setParametersToAddAtUploadTime:nil];
@@ -239,6 +243,15 @@ NSString* GetPlatform() {
});
}
+- (void)setUploadCallback:(BreakpadUploadCompletionCallback)callback {
+ NSAssert(started_,
+ @"The controller must not be started before setUploadCallback is "
+ "called");
+ dispatch_async(queue_, ^{
+ uploadCompleteCallback_ = callback;
+ });
+}
+
- (void)removeUploadParameterForKey:(NSString*)key {
NSAssert(started_, @"The controller must be started before "
"removeUploadParameterForKey is called");
@@ -249,10 +262,8 @@ NSString* GetPlatform() {
}
- (void)withBreakpadRef:(void(^)(BreakpadRef))callback {
- NSAssert(started_,
- @"The controller must be started before withBreakpadRef is called");
dispatch_async(queue_, ^{
- callback(breakpadRef_);
+ callback(started_ ? breakpadRef_ : NULL);
});
}
@@ -291,6 +302,18 @@ NSString* GetPlatform() {
});
}
+- (void)getDateOfMostRecentCrashReport:(void(^)(NSDate *))callback {
+ NSAssert(started_, @"The controller must be started before "
+ "getDateOfMostRecentCrashReport is called");
+ dispatch_async(queue_, ^{
+ if (!breakpadRef_) {
+ callback(nil);
+ return;
+ }
+ callback(BreakpadGetDateOfMostRecentCrashReport(breakpadRef_));
+ });
+}
+
#pragma mark -
- (int)sendDelay {
@@ -317,38 +340,35 @@ NSString* GetPlatform() {
[userDefaults synchronize];
}
+// This method must be called from the breakpad queue.
- (void)sendStoredCrashReports {
- dispatch_async(queue_, ^{
- if (BreakpadGetCrashReportCount(breakpadRef_) == 0)
- return;
+ if (BreakpadGetCrashReportCount(breakpadRef_) == 0)
+ return;
- int timeToWait = [self sendDelay];
+ int timeToWait = [self sendDelay];
- // Unable to ever send report.
- if (timeToWait == -1)
- return;
+ // Unable to ever send report.
+ if (timeToWait == -1)
+ return;
- // A report can be sent now.
- if (timeToWait == 0) {
- [self reportWillBeSent];
- BreakpadUploadNextReportWithParameters(breakpadRef_,
- uploadTimeParameters_);
+ // A report can be sent now.
+ if (timeToWait == 0) {
+ [self reportWillBeSent];
+ BreakpadUploadNextReportWithParameters(breakpadRef_, uploadTimeParameters_,
+ uploadCompleteCallback_);
- // If more reports must be sent, make sure this method is called again.
- if (BreakpadGetCrashReportCount(breakpadRef_) > 0)
- timeToWait = uploadIntervalInSeconds_;
- }
+ // If more reports must be sent, make sure this method is called again.
+ if (BreakpadGetCrashReportCount(breakpadRef_) > 0)
+ timeToWait = uploadIntervalInSeconds_;
+ }
- // A report must be sent later.
- if (timeToWait > 0) {
- // performSelector: doesn't work on queue_
- dispatch_async(dispatch_get_main_queue(), ^{
- [self performSelector:@selector(sendStoredCrashReports)
- withObject:nil
- afterDelay:timeToWait];
- });
- }
- });
+ // A report must be sent later.
+ if (timeToWait > 0) {
+ dispatch_time_t delay = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(timeToWait * NSEC_PER_SEC));
+ dispatch_after(delay, queue_, ^{
+ [self sendStoredCrashReports];
+ });
+ }
}
@end
diff --git a/src/client/ios/exception_handler_no_mach.cc b/src/client/ios/exception_handler_no_mach.cc
new file mode 100644
index 00000000..7fcf2d83
--- /dev/null
+++ b/src/client/ios/exception_handler_no_mach.cc
@@ -0,0 +1,262 @@
+// Copyright (c) 2006, Google Inc.
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#include <signal.h>
+#include <TargetConditionals.h>
+
+#include "client/mac/handler/minidump_generator.h"
+#include "client/ios/exception_handler_no_mach.h"
+
+#ifndef USE_PROTECTED_ALLOCATIONS
+#if TARGET_OS_TV
+#define USE_PROTECTED_ALLOCATIONS 1
+#else
+#define USE_PROTECTED_ALLOCATIONS 0
+#endif
+#endif
+
+// If USE_PROTECTED_ALLOCATIONS is activated then the
+// gBreakpadAllocator needs to be setup in other code
+// ahead of time. Please see ProtectedMemoryAllocator.h
+// for more details.
+#if USE_PROTECTED_ALLOCATIONS
+ #include "client/mac/handler/protected_memory_allocator.h"
+ extern ProtectedMemoryAllocator *gBreakpadAllocator;
+#endif
+
+namespace google_breakpad {
+
+const int kExceptionSignals[] = {
+ // Core-generating signals.
+ SIGABRT, SIGBUS, SIGFPE, SIGILL, SIGQUIT, SIGSEGV, SIGSYS, SIGTRAP, SIGEMT,
+ SIGXCPU, SIGXFSZ,
+ // Non-core-generating but terminating signals.
+ SIGALRM, SIGHUP, SIGINT, SIGPIPE, SIGPROF, SIGTERM, SIGUSR1, SIGUSR2,
+ SIGVTALRM, SIGXCPU, SIGXFSZ, SIGIO,
+};
+const int kNumHandledSignals =
+ sizeof(kExceptionSignals) / sizeof(kExceptionSignals[0]);
+struct scoped_ptr<struct sigaction> old_handlers[kNumHandledSignals];
+
+static union {
+#if USE_PROTECTED_ALLOCATIONS
+#if defined PAGE_MAX_SIZE
+ char protected_buffer[PAGE_MAX_SIZE] __attribute__((aligned(PAGE_MAX_SIZE)));
+#else
+ char protected_buffer[PAGE_SIZE] __attribute__((aligned(PAGE_SIZE)));
+#endif // defined PAGE_MAX_SIZE
+#endif // USE_PROTECTED_ALLOCATIONS
+ google_breakpad::ExceptionHandler *handler;
+} gProtectedData;
+
+ExceptionHandler::ExceptionHandler(const string &dump_path,
+ FilterCallback filter,
+ MinidumpCallback callback,
+ void* callback_context,
+ bool install_handler,
+ const char* port_name)
+ : dump_path_(),
+ filter_(filter),
+ callback_(callback),
+ callback_context_(callback_context),
+ directCallback_(NULL),
+ installed_exception_handler_(false),
+ is_in_teardown_(false) {
+ // This will update to the ID and C-string pointers
+ set_dump_path(dump_path);
+ MinidumpGenerator::GatherSystemInformation();
+ Setup();
+}
+
+// special constructor if we want to bypass minidump writing and
+// simply get a callback with the exception information
+ExceptionHandler::ExceptionHandler(DirectCallback callback,
+ void* callback_context,
+ bool install_handler)
+ : dump_path_(),
+ filter_(NULL),
+ callback_(NULL),
+ callback_context_(callback_context),
+ directCallback_(callback),
+ installed_exception_handler_(false),
+ is_in_teardown_(false) {
+ MinidumpGenerator::GatherSystemInformation();
+ Setup();
+}
+
+ExceptionHandler::~ExceptionHandler() {
+ Teardown();
+}
+
+bool ExceptionHandler::WriteMinidumpWithException(
+ int exception_type,
+ int exception_code,
+ int exception_subcode,
+ breakpad_ucontext_t* task_context,
+ mach_port_t thread_name,
+ bool exit_after_write,
+ bool report_current_thread) {
+ bool result = false;
+
+#if !TARGET_OS_TV
+ exit_after_write = false;
+#endif // !TARGET_OS_TV
+
+ if (directCallback_) {
+ if (directCallback_(callback_context_,
+ exception_type,
+ exception_code,
+ exception_subcode,
+ thread_name) ) {
+ if (exit_after_write)
+ _exit(exception_type);
+ }
+ } else {
+ string minidump_id;
+
+ // Putting the MinidumpGenerator in its own context will ensure that the
+ // destructor is executed, closing the newly created minidump file.
+ if (!dump_path_.empty()) {
+ MinidumpGenerator md(mach_task_self(),
+ report_current_thread ? MACH_PORT_NULL :
+ mach_thread_self());
+ md.SetTaskContext(task_context);
+ if (exception_type && exception_code) {
+ // If this is a real exception, give the filter (if any) a chance to
+ // decide if this should be sent.
+ if (filter_ && !filter_(callback_context_))
+ return false;
+
+ md.SetExceptionInformation(exception_type, exception_code,
+ exception_subcode, thread_name);
+ }
+
+ result = md.Write(next_minidump_path_c_);
+ }
+
+ // Call user specified callback (if any)
+ if (callback_) {
+ // If the user callback returned true and we're handling an exception
+ // (rather than just writing out the file), then we should exit without
+ // forwarding the exception to the next handler.
+ if (callback_(dump_path_c_, next_minidump_id_c_, callback_context_,
+ result)) {
+ if (exit_after_write)
+ _exit(exception_type);
+ }
+ }
+ }
+
+ return result;
+}
+
+// static
+void ExceptionHandler::SignalHandler(int sig, siginfo_t* info, void* uc) {
+#if USE_PROTECTED_ALLOCATIONS
+ if (gBreakpadAllocator)
+ gBreakpadAllocator->Unprotect();
+#endif
+ gProtectedData.handler->WriteMinidumpWithException(
+ EXC_SOFTWARE,
+ MD_EXCEPTION_CODE_MAC_ABORT,
+ 0,
+ static_cast<breakpad_ucontext_t*>(uc),
+ mach_thread_self(),
+ true,
+ true);
+#if USE_PROTECTED_ALLOCATIONS
+ if (gBreakpadAllocator)
+ gBreakpadAllocator->Protect();
+#endif
+}
+
+bool ExceptionHandler::InstallHandlers() {
+ // If a handler is already installed, something is really wrong.
+ if (gProtectedData.handler != NULL)
+ return false;
+ for (int i = 0; i < kNumHandledSignals; ++i) {
+ struct sigaction sa;
+ memset(&sa, 0, sizeof(sa));
+ sigemptyset(&sa.sa_mask);
+ sigaddset(&sa.sa_mask, kExceptionSignals[i]);
+ sa.sa_sigaction = ExceptionHandler::SignalHandler;
+ sa.sa_flags = SA_ONSTACK | SA_SIGINFO;
+
+ if (sigaction(kExceptionSignals[i], &sa, old_handlers[i].get()) == -1) {
+ return false;
+ }
+ }
+ gProtectedData.handler = this;
+#if USE_PROTECTED_ALLOCATIONS
+ assert(((size_t)(gProtectedData.protected_buffer) & PAGE_MASK) == 0);
+ mprotect(gProtectedData.protected_buffer, PAGE_SIZE, PROT_READ);
+#endif // USE_PROTECTED_ALLOCATIONS
+ installed_exception_handler_ = true;
+ return true;
+}
+
+bool ExceptionHandler::UninstallHandlers() {
+ for (int i = 0; i < kNumHandledSignals; ++i) {
+ if (old_handlers[i].get()) {
+ sigaction(kExceptionSignals[i], old_handlers[i].get(), NULL);
+ old_handlers[i].reset();
+ }
+ }
+#if USE_PROTECTED_ALLOCATIONS
+ mprotect(gProtectedData.protected_buffer, PAGE_SIZE, PROT_READ | PROT_WRITE);
+#endif // USE_PROTECTED_ALLOCATIONS
+ gProtectedData.handler = NULL;
+ installed_exception_handler_ = false;
+ return true;
+}
+
+bool ExceptionHandler::Setup() {
+ if (!InstallHandlers())
+ return false;
+ return true;
+}
+
+bool ExceptionHandler::Teardown() {
+ is_in_teardown_ = true;
+
+ if (!UninstallHandlers())
+ return false;
+
+ return true;
+}
+
+void ExceptionHandler::UpdateNextID() {
+ next_minidump_path_ =
+ (MinidumpGenerator::UniqueNameInDirectory(dump_path_, &next_minidump_id_));
+
+ next_minidump_path_c_ = next_minidump_path_.c_str();
+ next_minidump_id_c_ = next_minidump_id_.c_str();
+}
+
+} // namespace google_breakpad
diff --git a/src/client/ios/exception_handler_no_mach.h b/src/client/ios/exception_handler_no_mach.h
new file mode 100644
index 00000000..6d99565b
--- /dev/null
+++ b/src/client/ios/exception_handler_no_mach.h
@@ -0,0 +1,179 @@
+// Copyright (c) 2006, Google Inc.
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef CLIENT_IOS_HANDLER_EXCEPTION_HANDLER_NO_MACH_H__
+#define CLIENT_IOS_HANDLER_EXCEPTION_HANDLER_NO_MACH_H__
+
+#include <mach/mach.h>
+#include <TargetConditionals.h>
+
+#include <string>
+
+#include "client/mac/handler/ucontext_compat.h"
+#include "common/scoped_ptr.h"
+
+namespace google_breakpad {
+
+using std::string;
+
+class ExceptionHandler {
+ public:
+ // A callback function to run before Breakpad performs any substantial
+ // processing of an exception. A FilterCallback is called before writing
+ // a minidump. context is the parameter supplied by the user as
+ // callback_context when the handler was created.
+ //
+ // If a FilterCallback returns true, Breakpad will continue processing,
+ // attempting to write a minidump. If a FilterCallback returns false, Breakpad
+ // will immediately report the exception as unhandled without writing a
+ // minidump, allowing another handler the opportunity to handle it.
+ typedef bool (*FilterCallback)(void *context);
+
+ // A callback function to run after the minidump has been written.
+ // |minidump_id| is a unique id for the dump, so the minidump
+ // file is <dump_dir>/<minidump_id>.dmp.
+ // |context| is the value passed into the constructor.
+ // |succeeded| indicates whether a minidump file was successfully written.
+ // Return true if the exception was fully handled and breakpad should exit.
+ // Return false to allow any other exception handlers to process the
+ // exception.
+ typedef bool (*MinidumpCallback)(const char *dump_dir,
+ const char *minidump_id,
+ void *context, bool succeeded);
+
+ // A callback function which will be called directly if an exception occurs.
+ // This bypasses the minidump file writing and simply gives the client
+ // the exception information.
+ typedef bool (*DirectCallback)( void *context,
+ int exception_type,
+ int exception_code,
+ int exception_subcode,
+ mach_port_t thread_name);
+
+ // Creates a new ExceptionHandler instance to handle writing minidumps.
+ // Minidump files will be written to dump_path, and the optional callback
+ // is called after writing the dump file, as described above.
+ // If install_handler is true, then a minidump will be written whenever
+ // an unhandled exception occurs. If it is false, minidumps will only
+ // be written when WriteMinidump is called.
+ // If port_name is non-NULL, attempt to perform out-of-process dump generation
+ // If port_name is NULL, in-process dump generation will be used.
+ ExceptionHandler(const string &dump_path,
+ FilterCallback filter, MinidumpCallback callback,
+ void *callback_context, bool install_handler,
+ const char *port_name);
+
+ // A special constructor if we want to bypass minidump writing and
+ // simply get a callback with the exception information.
+ ExceptionHandler(DirectCallback callback,
+ void *callback_context,
+ bool install_handler);
+
+ ~ExceptionHandler();
+
+ // Get and set the minidump path.
+ string dump_path() const { return dump_path_; }
+ void set_dump_path(const string &dump_path) {
+ dump_path_ = dump_path;
+ dump_path_c_ = dump_path_.c_str();
+ UpdateNextID(); // Necessary to put dump_path_ in next_minidump_path_.
+ }
+
+ private:
+ // Install the SIG exception handlers.
+ bool InstallHandlers();
+
+ // Uninstall the SIG exception handlers.
+ bool UninstallHandlers();
+
+ // Setup the handler thread, and if |install_handler| is true, install the
+ // mach exception port handler
+ bool Setup();
+
+ // Uninstall the mach exception handler (if any) and terminate the helper
+ // thread
+ bool Teardown();
+
+ // All minidump writing goes through this one routine.
+ // |task_context| can be NULL. If not, it will be used to retrieve the
+ // context of the current thread, instead of using |thread_get_state|.
+ bool WriteMinidumpWithException(int exception_type,
+ int exception_code,
+ int exception_subcode,
+ breakpad_ucontext_t *task_context,
+ mach_port_t thread_name,
+ bool exit_after_write,
+ bool report_current_thread);
+
+ // Signal handler for SIG exceptions.
+ static void SignalHandler(int sig, siginfo_t* info, void* uc);
+
+ // disallow copy ctor and operator=
+ explicit ExceptionHandler(const ExceptionHandler &);
+ void operator=(const ExceptionHandler &);
+
+ // Generates a new ID and stores it in next_minidump_id_, and stores the
+ // path of the next minidump to be written in next_minidump_path_.
+ void UpdateNextID();
+
+ // The destination directory for the minidump
+ string dump_path_;
+
+ // The basename of the next minidump w/o extension
+ string next_minidump_id_;
+
+ // The full path to the next minidump to be written, including extension
+ string next_minidump_path_;
+
+ // Pointers to the UTF-8 versions of above
+ const char *dump_path_c_;
+ const char *next_minidump_id_c_;
+ const char *next_minidump_path_c_;
+
+ // The callback function and pointer to be passed back after the minidump
+ // has been written
+ FilterCallback filter_;
+ MinidumpCallback callback_;
+ void *callback_context_;
+
+ // The callback function to be passed back when we don't want a minidump
+ // file to be written
+ DirectCallback directCallback_;
+
+ // True, if we've installed the exception handler
+ bool installed_exception_handler_;
+
+ // True, if we're in the process of uninstalling the exception handler and
+ // the thread.
+ bool is_in_teardown_;
+};
+
+} // namespace google_breakpad
+
+#endif // CLIENT_IOS_HANDLER_EXCEPTION_HANDLER_NO_MACH_H__
diff --git a/src/client/ios/handler/ios_exception_minidump_generator.mm b/src/client/ios/handler/ios_exception_minidump_generator.mm
index 82ea5bb5..f57bdf21 100644
--- a/src/client/ios/handler/ios_exception_minidump_generator.mm
+++ b/src/client/ios/handler/ios_exception_minidump_generator.mm
@@ -108,13 +108,13 @@ bool IosExceptionMinidumpGenerator::WriteCrashingContextARM(
#ifdef HAS_ARM64_SUPPORT
bool IosExceptionMinidumpGenerator::WriteCrashingContextARM64(
MDLocationDescriptor *register_location) {
- TypedMDRVA<MDRawContextARM64> context(&writer_);
+ TypedMDRVA<MDRawContextARM64_Old> context(&writer_);
if (!context.Allocate())
return false;
*register_location = context.location();
- MDRawContextARM64 *context_ptr = context.get();
+ MDRawContextARM64_Old *context_ptr = context.get();
memset(context_ptr, 0, sizeof(*context_ptr));
- context_ptr->context_flags = MD_CONTEXT_ARM64_FULL;
+ context_ptr->context_flags = MD_CONTEXT_ARM64_FULL_OLD;
context_ptr->iregs[MD_CONTEXT_ARM64_REG_FP] = kExpectedFinalFp; // FP
context_ptr->iregs[MD_CONTEXT_ARM64_REG_SP] = kExpectedFinalSp; // SP
context_ptr->iregs[MD_CONTEXT_ARM64_REG_LR] = GetLRFromException(); // LR
diff --git a/src/client/linux/crash_generation/crash_generation_client.cc b/src/client/linux/crash_generation/crash_generation_client.cc
index d8bfbbad..613baddc 100644
--- a/src/client/linux/crash_generation/crash_generation_client.cc
+++ b/src/client/linux/crash_generation/crash_generation_client.cc
@@ -58,7 +58,7 @@ class CrashGenerationClientImpl : public CrashGenerationClient {
iov.iov_base = const_cast<void*>(blob);
iov.iov_len = blob_size;
- struct kernel_msghdr msg = { 0 };
+ struct kernel_msghdr msg = {};
msg.msg_iov = &iov;
msg.msg_iovlen = 1;
char cmsg[kControlMsgSize] = "";
diff --git a/src/client/linux/crash_generation/crash_generation_server.cc b/src/client/linux/crash_generation/crash_generation_server.cc
index 860e8bc9..26c50a5c 100644
--- a/src/client/linux/crash_generation/crash_generation_server.cc
+++ b/src/client/linux/crash_generation/crash_generation_server.cc
@@ -123,6 +123,9 @@ CrashGenerationServer::Stop()
void* dummy;
pthread_join(thread_, &dummy);
+ close(control_pipe_in_);
+ close(control_pipe_out_);
+
started_ = false;
}
@@ -252,7 +255,7 @@ CrashGenerationServer::ClientEvent(short revents)
}
if (crashing_pid == -1 || signal_fd == -1) {
- if (signal_fd)
+ if (signal_fd != -1)
close(signal_fd);
return true;
}
diff --git a/src/client/linux/dump_writer_common/mapping_info.h b/src/client/linux/dump_writer_common/mapping_info.h
index 5f247cfd..c09e48ab 100644
--- a/src/client/linux/dump_writer_common/mapping_info.h
+++ b/src/client/linux/dump_writer_common/mapping_info.h
@@ -41,8 +41,21 @@ namespace google_breakpad {
// One of these is produced for each mapping in the process (i.e. line in
// /proc/$x/maps).
struct MappingInfo {
+ // On Android, relocation packing can mean that the reported start
+ // address of the mapping must be adjusted by a bias in order to
+ // compensate for the compression of the relocation section. The
+ // following two members hold (after LateInit) the adjusted mapping
+ // range. See crbug.com/606972 for more information.
uintptr_t start_addr;
size_t size;
+ // When Android relocation packing causes |start_addr| and |size| to
+ // be modified with a load bias, we need to remember the unbiased
+ // address range. The following structure holds the original mapping
+ // address range as reported by the operating system.
+ struct {
+ uintptr_t start_addr;
+ uintptr_t end_addr;
+ } system_mapping_info;
size_t offset; // offset into the backed file.
bool exec; // true if the mapping has the execute bit set.
char name[NAME_MAX];
diff --git a/src/client/linux/dump_writer_common/raw_context_cpu.h b/src/client/linux/dump_writer_common/raw_context_cpu.h
index e2ef45df..07d9171a 100644
--- a/src/client/linux/dump_writer_common/raw_context_cpu.h
+++ b/src/client/linux/dump_writer_common/raw_context_cpu.h
@@ -41,7 +41,7 @@ typedef MDRawContextAMD64 RawContextCPU;
#elif defined(__ARM_EABI__)
typedef MDRawContextARM RawContextCPU;
#elif defined(__aarch64__)
-typedef MDRawContextARM64 RawContextCPU;
+typedef MDRawContextARM64_Old RawContextCPU;
#elif defined(__mips__)
typedef MDRawContextMIPS RawContextCPU;
#else
diff --git a/src/client/linux/dump_writer_common/seccomp_unwinder.cc b/src/client/linux/dump_writer_common/seccomp_unwinder.cc
deleted file mode 100644
index e9d1ec78..00000000
--- a/src/client/linux/dump_writer_common/seccomp_unwinder.cc
+++ /dev/null
@@ -1,154 +0,0 @@
-// Copyright (c) 2014, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include "client/linux/dump_writer_common/seccomp_unwinder.h"
-
-#include <string.h>
-
-#include "google_breakpad/common/minidump_format.h"
-#include "common/linux/linux_libc_support.h"
-
-namespace google_breakpad {
-
-void SeccompUnwinder::PopSeccompStackFrame(RawContextCPU* cpu,
- const MDRawThread& thread,
- uint8_t* stack_copy) {
-#if defined(__x86_64)
- uint64_t bp = cpu->rbp;
- uint64_t top = thread.stack.start_of_memory_range;
- for (int i = 4; i--; ) {
- if (bp < top ||
- bp > thread.stack.start_of_memory_range +
- thread.stack.memory.data_size - sizeof(bp) ||
- bp & 1) {
- break;
- }
- uint64_t old_top = top;
- top = bp;
- uint8_t* bp_addr = stack_copy + bp - thread.stack.start_of_memory_range;
- my_memcpy(&bp, bp_addr, sizeof(bp));
- if (bp == 0xDEADBEEFDEADBEEFull) {
- struct {
- uint64_t r15;
- uint64_t r14;
- uint64_t r13;
- uint64_t r12;
- uint64_t r11;
- uint64_t r10;
- uint64_t r9;
- uint64_t r8;
- uint64_t rdi;
- uint64_t rsi;
- uint64_t rdx;
- uint64_t rcx;
- uint64_t rbx;
- uint64_t deadbeef;
- uint64_t rbp;
- uint64_t fakeret;
- uint64_t ret;
- /* char redzone[128]; */
- } seccomp_stackframe;
- if (top - offsetof(__typeof__(seccomp_stackframe), deadbeef) < old_top ||
- top - offsetof(__typeof__(seccomp_stackframe), deadbeef) +
- sizeof(seccomp_stackframe) >
- thread.stack.start_of_memory_range+thread.stack.memory.data_size) {
- break;
- }
- my_memcpy(&seccomp_stackframe,
- bp_addr - offsetof(__typeof__(seccomp_stackframe), deadbeef),
- sizeof(seccomp_stackframe));
- cpu->rbx = seccomp_stackframe.rbx;
- cpu->rcx = seccomp_stackframe.rcx;
- cpu->rdx = seccomp_stackframe.rdx;
- cpu->rsi = seccomp_stackframe.rsi;
- cpu->rdi = seccomp_stackframe.rdi;
- cpu->rbp = seccomp_stackframe.rbp;
- cpu->rsp = top + 4*sizeof(uint64_t) + 128;
- cpu->r8 = seccomp_stackframe.r8;
- cpu->r9 = seccomp_stackframe.r9;
- cpu->r10 = seccomp_stackframe.r10;
- cpu->r11 = seccomp_stackframe.r11;
- cpu->r12 = seccomp_stackframe.r12;
- cpu->r13 = seccomp_stackframe.r13;
- cpu->r14 = seccomp_stackframe.r14;
- cpu->r15 = seccomp_stackframe.r15;
- cpu->rip = seccomp_stackframe.fakeret;
- return;
- }
- }
-#elif defined(__i386__)
- uint32_t bp = cpu->ebp;
- uint32_t top = thread.stack.start_of_memory_range;
- for (int i = 4; i--; ) {
- if (bp < top ||
- bp > thread.stack.start_of_memory_range +
- thread.stack.memory.data_size - sizeof(bp) ||
- bp & 1) {
- break;
- }
- uint32_t old_top = top;
- top = bp;
- uint8_t* bp_addr = stack_copy + bp - thread.stack.start_of_memory_range;
- my_memcpy(&bp, bp_addr, sizeof(bp));
- if (bp == 0xDEADBEEFu) {
- struct {
- uint32_t edi;
- uint32_t esi;
- uint32_t edx;
- uint32_t ecx;
- uint32_t ebx;
- uint32_t deadbeef;
- uint32_t ebp;
- uint32_t fakeret;
- uint32_t ret;
- } seccomp_stackframe;
- if (top - offsetof(__typeof__(seccomp_stackframe), deadbeef) < old_top ||
- top - offsetof(__typeof__(seccomp_stackframe), deadbeef) +
- sizeof(seccomp_stackframe) >
- thread.stack.start_of_memory_range+thread.stack.memory.data_size) {
- break;
- }
- my_memcpy(&seccomp_stackframe,
- bp_addr - offsetof(__typeof__(seccomp_stackframe), deadbeef),
- sizeof(seccomp_stackframe));
- cpu->ebx = seccomp_stackframe.ebx;
- cpu->ecx = seccomp_stackframe.ecx;
- cpu->edx = seccomp_stackframe.edx;
- cpu->esi = seccomp_stackframe.esi;
- cpu->edi = seccomp_stackframe.edi;
- cpu->ebp = seccomp_stackframe.ebp;
- cpu->esp = top + 4*sizeof(void*);
- cpu->eip = seccomp_stackframe.fakeret;
- return;
- }
- }
-#endif
-}
-
-} // namespace google_breakpad
diff --git a/src/client/linux/dump_writer_common/thread_info.cc b/src/client/linux/dump_writer_common/thread_info.cc
index a3072b6c..aae1dc13 100644
--- a/src/client/linux/dump_writer_common/thread_info.cc
+++ b/src/client/linux/dump_writer_common/thread_info.cc
@@ -30,6 +30,7 @@
#include "client/linux/dump_writer_common/thread_info.h"
#include <string.h>
+#include <assert.h>
#include "common/linux/linux_libc_support.h"
#include "google_breakpad/common/minidump_format.h"
@@ -213,7 +214,7 @@ uintptr_t ThreadInfo::GetInstructionPointer() const {
}
void ThreadInfo::FillCPUContext(RawContextCPU* out) const {
- out->context_flags = MD_CONTEXT_ARM64_FULL;
+ out->context_flags = MD_CONTEXT_ARM64_FULL_OLD;
out->cpsr = static_cast<uint32_t>(regs.pstate);
for (int i = 0; i < MD_CONTEXT_ARM64_REG_SP; ++i)
@@ -230,37 +231,75 @@ void ThreadInfo::FillCPUContext(RawContextCPU* out) const {
#elif defined(__mips__)
uintptr_t ThreadInfo::GetInstructionPointer() const {
- return regs.epc;
+ return mcontext.pc;
}
void ThreadInfo::FillCPUContext(RawContextCPU* out) const {
+#if _MIPS_SIM == _ABI64
+ out->context_flags = MD_CONTEXT_MIPS64_FULL;
+#elif _MIPS_SIM == _ABIO32
out->context_flags = MD_CONTEXT_MIPS_FULL;
+#else
+# error "This mips ABI is currently not supported (n32)"
+#endif
for (int i = 0; i < MD_CONTEXT_MIPS_GPR_COUNT; ++i)
- out->iregs[i] = regs.regs[i];
+ out->iregs[i] = mcontext.gregs[i];
- out->mdhi = regs.hi;
- out->mdlo = regs.lo;
+ out->mdhi = mcontext.mdhi;
+ out->mdlo = mcontext.mdlo;
+ out->dsp_control = mcontext.dsp;
- for (int i = 0; i < MD_CONTEXT_MIPS_DSP_COUNT; ++i) {
- out->hi[i] = hi[i];
- out->lo[i] = lo[i];
- }
- out->dsp_control = dsp_control;
+ out->hi[0] = mcontext.hi1;
+ out->lo[0] = mcontext.lo1;
+ out->hi[1] = mcontext.hi2;
+ out->lo[1] = mcontext.lo2;
+ out->hi[2] = mcontext.hi3;
+ out->lo[2] = mcontext.lo3;
- out->epc = regs.epc;
- out->badvaddr = regs.badvaddr;
- out->status = regs.status;
- out->cause = regs.cause;
+ out->epc = mcontext.pc;
+ out->badvaddr = 0; // Not stored in mcontext
+ out->status = 0; // Not stored in mcontext
+ out->cause = 0; // Not stored in mcontext
for (int i = 0; i < MD_FLOATINGSAVEAREA_MIPS_FPR_COUNT; ++i)
- out->float_save.regs[i] = fpregs.regs[i];
+ out->float_save.regs[i] = mcontext.fpregs.fp_r.fp_fregs[i]._fp_fregs;
- out->float_save.fpcsr = fpregs.fpcsr;
+ out->float_save.fpcsr = mcontext.fpc_csr;
#if _MIPS_SIM == _ABIO32
- out->float_save.fir = fpregs.fir;
+ out->float_save.fir = mcontext.fpc_eir;
+#endif
+}
+#endif // __mips__
+
+void ThreadInfo::GetGeneralPurposeRegisters(void** gp_regs, size_t* size) {
+ assert(gp_regs || size);
+#if defined(__mips__)
+ if (gp_regs)
+ *gp_regs = mcontext.gregs;
+ if (size)
+ *size = sizeof(mcontext.gregs);
+#else
+ if (gp_regs)
+ *gp_regs = &regs;
+ if (size)
+ *size = sizeof(regs);
#endif
}
+
+void ThreadInfo::GetFloatingPointRegisters(void** fp_regs, size_t* size) {
+ assert(fp_regs || size);
+#if defined(__mips__)
+ if (fp_regs)
+ *fp_regs = &mcontext.fpregs;
+ if (size)
+ *size = sizeof(mcontext.fpregs);
+#else
+ if (fp_regs)
+ *fp_regs = &fpregs;
+ if (size)
+ *size = sizeof(fpregs);
#endif
+}
} // namespace google_breakpad
diff --git a/src/client/linux/dump_writer_common/thread_info.h b/src/client/linux/dump_writer_common/thread_info.h
index cf6d0101..fb216fa6 100644
--- a/src/client/linux/dump_writer_common/thread_info.h
+++ b/src/client/linux/dump_writer_common/thread_info.h
@@ -34,7 +34,7 @@
#include <sys/user.h>
#include "client/linux/dump_writer_common/raw_context_cpu.h"
-#include "common/memory.h"
+#include "common/memory_allocator.h"
#include "google_breakpad/common/minidump_format.h"
namespace google_breakpad {
@@ -65,15 +65,12 @@ struct ThreadInfo {
struct user_regs regs;
struct user_fpregs fpregs;
#elif defined(__aarch64__)
- // Use the structures defined in <asm/ptrace.h>
- struct user_pt_regs regs;
- struct user_fpsimd_state fpregs;
+ // Use the structures defined in <sys/user.h>
+ struct user_regs_struct regs;
+ struct user_fpsimd_struct fpregs;
#elif defined(__mips__)
- user_regs_struct regs;
- user_fpregs_struct fpregs;
- uint32_t hi[3];
- uint32_t lo[3];
- uint32_t dsp_control;
+ // Use the structure defined in <sys/ucontext.h>.
+ mcontext_t mcontext;
#endif
// Returns the instruction pointer (platform-dependent impl.).
@@ -81,6 +78,12 @@ struct ThreadInfo {
// Fills a RawContextCPU using the context in the ThreadInfo object.
void FillCPUContext(RawContextCPU* out) const;
+
+ // Returns the pointer and size of general purpose register area.
+ void GetGeneralPurposeRegisters(void** gp_regs, size_t* size);
+
+ // Returns the pointer and size of float point register area.
+ void GetFloatingPointRegisters(void** fp_regs, size_t* size);
};
} // namespace google_breakpad
diff --git a/src/client/linux/dump_writer_common/ucontext_reader.cc b/src/client/linux/dump_writer_common/ucontext_reader.cc
index d37fdeb0..ee515c41 100644
--- a/src/client/linux/dump_writer_common/ucontext_reader.cc
+++ b/src/client/linux/dump_writer_common/ucontext_reader.cc
@@ -36,20 +36,20 @@ namespace google_breakpad {
// Minidump defines register structures which are different from the raw
// structures which we get from the kernel. These are platform specific
-// functions to juggle the ucontext and user structures into minidump format.
+// functions to juggle the ucontext_t and user structures into minidump format.
#if defined(__i386__)
-uintptr_t UContextReader::GetStackPointer(const struct ucontext* uc) {
+uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) {
return uc->uc_mcontext.gregs[REG_ESP];
}
-uintptr_t UContextReader::GetInstructionPointer(const struct ucontext* uc) {
+uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
return uc->uc_mcontext.gregs[REG_EIP];
}
-void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc,
- const struct _libc_fpstate* fp) {
+void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+ const fpstate_t* fp) {
const greg_t* regs = uc->uc_mcontext.gregs;
out->context_flags = MD_CONTEXT_X86_FULL |
@@ -88,16 +88,16 @@ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc,
#elif defined(__x86_64)
-uintptr_t UContextReader::GetStackPointer(const struct ucontext* uc) {
+uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) {
return uc->uc_mcontext.gregs[REG_RSP];
}
-uintptr_t UContextReader::GetInstructionPointer(const struct ucontext* uc) {
+uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
return uc->uc_mcontext.gregs[REG_RIP];
}
-void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc,
- const struct _libc_fpstate* fpregs) {
+void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+ const fpstate_t* fpregs) {
const greg_t* regs = uc->uc_mcontext.gregs;
out->context_flags = MD_CONTEXT_AMD64_FULL;
@@ -145,15 +145,15 @@ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc,
#elif defined(__ARM_EABI__)
-uintptr_t UContextReader::GetStackPointer(const struct ucontext* uc) {
+uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) {
return uc->uc_mcontext.arm_sp;
}
-uintptr_t UContextReader::GetInstructionPointer(const struct ucontext* uc) {
+uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
return uc->uc_mcontext.arm_pc;
}
-void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc) {
+void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc) {
out->context_flags = MD_CONTEXT_ARM_FULL;
out->iregs[0] = uc->uc_mcontext.arm_r0;
@@ -184,17 +184,17 @@ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc) {
#elif defined(__aarch64__)
-uintptr_t UContextReader::GetStackPointer(const struct ucontext* uc) {
+uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) {
return uc->uc_mcontext.sp;
}
-uintptr_t UContextReader::GetInstructionPointer(const struct ucontext* uc) {
+uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
return uc->uc_mcontext.pc;
}
-void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc,
+void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
const struct fpsimd_context* fpregs) {
- out->context_flags = MD_CONTEXT_ARM64_FULL;
+ out->context_flags = MD_CONTEXT_ARM64_FULL_OLD;
out->cpsr = static_cast<uint32_t>(uc->uc_mcontext.pstate);
for (int i = 0; i < MD_CONTEXT_ARM64_REG_SP; ++i)
@@ -210,16 +210,22 @@ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc,
#elif defined(__mips__)
-uintptr_t UContextReader::GetStackPointer(const struct ucontext* uc) {
+uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) {
return uc->uc_mcontext.gregs[MD_CONTEXT_MIPS_REG_SP];
}
-uintptr_t UContextReader::GetInstructionPointer(const struct ucontext* uc) {
+uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
return uc->uc_mcontext.pc;
}
-void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc) {
+void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc) {
+#if _MIPS_SIM == _ABI64
+ out->context_flags = MD_CONTEXT_MIPS64_FULL;
+#elif _MIPS_SIM == _ABIO32
out->context_flags = MD_CONTEXT_MIPS_FULL;
+#else
+#error "This mips ABI is currently not supported (n32)"
+#endif
for (int i = 0; i < MD_CONTEXT_MIPS_GPR_COUNT; ++i)
out->iregs[i] = uc->uc_mcontext.gregs[i];
diff --git a/src/client/linux/dump_writer_common/ucontext_reader.h b/src/client/linux/dump_writer_common/ucontext_reader.h
index b6e77b4b..8e74a8a5 100644
--- a/src/client/linux/dump_writer_common/ucontext_reader.h
+++ b/src/client/linux/dump_writer_common/ucontext_reader.h
@@ -34,28 +34,29 @@
#include <sys/user.h>
#include "client/linux/dump_writer_common/raw_context_cpu.h"
-#include "common/memory.h"
+#include "client/linux/minidump_writer/minidump_writer.h"
+#include "common/memory_allocator.h"
#include "google_breakpad/common/minidump_format.h"
namespace google_breakpad {
-// Wraps platform-dependent implementations of accessors to ucontext structs.
+// Wraps platform-dependent implementations of accessors to ucontext_t structs.
struct UContextReader {
- static uintptr_t GetStackPointer(const struct ucontext* uc);
+ static uintptr_t GetStackPointer(const ucontext_t* uc);
- static uintptr_t GetInstructionPointer(const struct ucontext* uc);
+ static uintptr_t GetInstructionPointer(const ucontext_t* uc);
- // Juggle a arch-specific ucontext into a minidump format
+ // Juggle a arch-specific ucontext_t into a minidump format
// out: the minidump structure
// info: the collection of register structures.
#if defined(__i386__) || defined(__x86_64)
- static void FillCPUContext(RawContextCPU *out, const ucontext *uc,
- const struct _libc_fpstate* fp);
+ static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+ const fpstate_t* fp);
#elif defined(__aarch64__)
- static void FillCPUContext(RawContextCPU *out, const ucontext *uc,
+ static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
const struct fpsimd_context* fpregs);
#else
- static void FillCPUContext(RawContextCPU *out, const ucontext *uc);
+ static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc);
#endif
};
diff --git a/src/client/linux/handler/exception_handler.cc b/src/client/linux/handler/exception_handler.cc
index 3ddbe662..c65feaa1 100644
--- a/src/client/linux/handler/exception_handler.cc
+++ b/src/client/linux/handler/exception_handler.cc
@@ -78,7 +78,6 @@
#include <sys/wait.h>
#include <unistd.h>
-#include <sys/signal.h>
#include <sys/ucontext.h>
#include <sys/user.h>
#include <ucontext.h>
@@ -88,8 +87,9 @@
#include <vector>
#include "common/basictypes.h"
+#include "common/linux/breakpad_getcontext.h"
#include "common/linux/linux_libc_support.h"
-#include "common/memory.h"
+#include "common/memory_allocator.h"
#include "client/linux/log/log.h"
#include "client/linux/microdump_writer/microdump_writer.h"
#include "client/linux/minidump_writer/linux_dumper.h"
@@ -105,12 +105,6 @@
#define PR_SET_PTRACER 0x59616d61
#endif
-// A wrapper for the tgkill syscall: send a signal to a specific thread.
-static int tgkill(pid_t tgid, pid_t tid, int sig) {
- return syscall(__NR_tgkill, tgid, tid, sig);
- return 0;
-}
-
namespace google_breakpad {
namespace {
@@ -118,7 +112,7 @@ namespace {
// all these signals must be Core (see man 7 signal) because we rethrow the
// signal after handling it and expect that it'll be fatal.
const int kExceptionSignals[] = {
- SIGSEGV, SIGABRT, SIGFPE, SIGILL, SIGBUS
+ SIGSEGV, SIGABRT, SIGFPE, SIGILL, SIGBUS, SIGTRAP
};
const int kNumHandledSignals =
sizeof(kExceptionSignals) / sizeof(kExceptionSignals[0]);
@@ -195,12 +189,12 @@ void InstallDefaultHandler(int sig) {
// to SIG_DFL is ignored. In that case, an infinite loop is entered as the
// signal is repeatedly sent to breakpad's signal handler.
// To work around this, directly call the system's sigaction.
- struct sigaction sa;
+ struct kernel_sigaction sa;
memset(&sa, 0, sizeof(sa));
- sigemptyset(&sa.sa_mask);
- sa.sa_handler = SIG_DFL;
+ sys_sigemptyset(&sa.sa_mask);
+ sa.sa_handler_ = SIG_DFL;
sa.sa_flags = SA_RESTART;
- syscall(__NR_rt_sigaction, sig, &sa, NULL);
+ sys_rt_sigaction(sig, &sa, NULL, sizeof(kernel_sigset_t));
#else
signal(sig, SIG_DFL);
#endif
@@ -212,6 +206,13 @@ void InstallDefaultHandler(int sig) {
std::vector<ExceptionHandler*>* g_handler_stack_ = NULL;
pthread_mutex_t g_handler_stack_mutex_ = PTHREAD_MUTEX_INITIALIZER;
+// sizeof(CrashContext) can be too big w.r.t the size of alternatate stack
+// for SignalHandler(). Keep the crash context as a .bss field. Exception
+// handlers are serialized by the |g_handler_stack_mutex_| and at most one at a
+// time can use |g_crash_context_|.
+ExceptionHandler::CrashContext g_crash_context_;
+
+FirstChanceHandler g_first_chance_handler_ = nullptr;
} // namespace
// Runs before crashing: normal context.
@@ -233,7 +234,17 @@ ExceptionHandler::ExceptionHandler(const MinidumpDescriptor& descriptor,
!minidump_descriptor_.IsMicrodumpOnConsole())
minidump_descriptor_.UpdatePath();
+#if defined(__ANDROID__)
+ if (minidump_descriptor_.IsMicrodumpOnConsole())
+ logger::initializeCrashLogWriter();
+#endif
+
pthread_mutex_lock(&g_handler_stack_mutex_);
+
+ // Pre-fault the crash context struct. This is to avoid failing due to OOM
+ // if handling an exception when the process ran out of virtual memory.
+ memset(&g_crash_context_, 0, sizeof(g_crash_context_));
+
if (!g_handler_stack_)
g_handler_stack_ = new std::vector<ExceptionHandler*>;
if (install_handler) {
@@ -315,6 +326,18 @@ void ExceptionHandler::RestoreHandlersLocked() {
// Runs on the crashing thread.
// static
void ExceptionHandler::SignalHandler(int sig, siginfo_t* info, void* uc) {
+
+ // Give the first chance handler a chance to recover from this signal
+ //
+ // This is primarily used by V8. V8 uses guard regions to guarantee memory
+ // safety in WebAssembly. This means some signals might be expected if they
+ // originate from Wasm code while accessing the guard region. We give V8 the
+ // chance to handle and recover from these signals first.
+ if (g_first_chance_handler_ != nullptr &&
+ g_first_chance_handler_(sig, info, uc)) {
+ return;
+ }
+
// All the exception signals are blocked at this point.
pthread_mutex_lock(&g_handler_stack_mutex_);
@@ -330,6 +353,7 @@ void ExceptionHandler::SignalHandler(int sig, siginfo_t* info, void* uc) {
// will call the function with the right arguments.
struct sigaction cur_handler;
if (sigaction(sig, NULL, &cur_handler) == 0 &&
+ cur_handler.sa_sigaction == SignalHandler &&
(cur_handler.sa_flags & SA_SIGINFO) == 0) {
// Reset signal handler with the right flags.
sigemptyset(&cur_handler.sa_mask);
@@ -365,12 +389,13 @@ void ExceptionHandler::SignalHandler(int sig, siginfo_t* info, void* uc) {
pthread_mutex_unlock(&g_handler_stack_mutex_);
- if (info->si_pid || sig == SIGABRT) {
+ // info->si_code <= 0 iff SI_FROMUSER (SI_FROMKERNEL otherwise).
+ if (info->si_code <= 0 || sig == SIGABRT) {
// This signal was triggered by somebody sending us the signal with kill().
// In order to retrigger it, we have to queue a new signal by calling
// kill() ourselves. The special case (si_pid == 0 && sig == SIGABRT) is
// due to the kernel sending a SIGABRT from a user request via SysRQ.
- if (tgkill(getpid(), syscall(__NR_gettid), sig) < 0) {
+ if (sys_tgkill(getpid(), syscall(__NR_gettid), sig) < 0) {
// If we failed to kill ourselves (e.g. because a sandbox disallows us
// to do so), we instead resort to terminating our process. This will
// result in an incorrect exit code.
@@ -397,9 +422,14 @@ struct ThreadArgument {
int ExceptionHandler::ThreadEntry(void *arg) {
const ThreadArgument *thread_arg = reinterpret_cast<ThreadArgument*>(arg);
+ // Close the write end of the pipe. This allows us to fail if the parent dies
+ // while waiting for the continue signal.
+ sys_close(thread_arg->handler->fdes[1]);
+
// Block here until the crashing process unblocks us when
// we're allowed to use ptrace
thread_arg->handler->WaitForContinueSignal();
+ sys_close(thread_arg->handler->fdes[0]);
return thread_arg->handler->DoDump(thread_arg->pid, thread_arg->context,
thread_arg->context_size) == false;
@@ -407,7 +437,7 @@ int ExceptionHandler::ThreadEntry(void *arg) {
// This function runs in a compromised context: see the top of the file.
// Runs on the crashing thread.
-bool ExceptionHandler::HandleSignal(int sig, siginfo_t* info, void* uc) {
+bool ExceptionHandler::HandleSignal(int /*sig*/, siginfo_t* info, void* uc) {
if (filter_ && !filter_(callback_context_))
return false;
@@ -418,36 +448,37 @@ bool ExceptionHandler::HandleSignal(int sig, siginfo_t* info, void* uc) {
if (signal_trusted || (signal_pid_trusted && info->si_pid == getpid())) {
sys_prctl(PR_SET_DUMPABLE, 1, 0, 0, 0);
}
- CrashContext context;
+
// Fill in all the holes in the struct to make Valgrind happy.
- memset(&context, 0, sizeof(context));
- memcpy(&context.siginfo, info, sizeof(siginfo_t));
- memcpy(&context.context, uc, sizeof(struct ucontext));
+ memset(&g_crash_context_, 0, sizeof(g_crash_context_));
+ memcpy(&g_crash_context_.siginfo, info, sizeof(siginfo_t));
+ memcpy(&g_crash_context_.context, uc, sizeof(ucontext_t));
#if defined(__aarch64__)
- struct ucontext *uc_ptr = (struct ucontext*)uc;
- struct fpsimd_context *fp_ptr =
+ ucontext_t* uc_ptr = (ucontext_t*)uc;
+ struct fpsimd_context* fp_ptr =
(struct fpsimd_context*)&uc_ptr->uc_mcontext.__reserved;
if (fp_ptr->head.magic == FPSIMD_MAGIC) {
- memcpy(&context.float_state, fp_ptr, sizeof(context.float_state));
+ memcpy(&g_crash_context_.float_state, fp_ptr,
+ sizeof(g_crash_context_.float_state));
}
-#elif !defined(__ARM_EABI__) && !defined(__mips__)
+#elif !defined(__ARM_EABI__) && !defined(__mips__)
// FP state is not part of user ABI on ARM Linux.
- // In case of MIPS Linux FP state is already part of struct ucontext
+ // In case of MIPS Linux FP state is already part of ucontext_t
// and 'float_state' is not a member of CrashContext.
- struct ucontext *uc_ptr = (struct ucontext*)uc;
+ ucontext_t* uc_ptr = (ucontext_t*)uc;
if (uc_ptr->uc_mcontext.fpregs) {
- memcpy(&context.float_state,
- uc_ptr->uc_mcontext.fpregs,
- sizeof(context.float_state));
+ memcpy(&g_crash_context_.float_state, uc_ptr->uc_mcontext.fpregs,
+ sizeof(g_crash_context_.float_state));
}
#endif
- context.tid = syscall(__NR_gettid);
+ g_crash_context_.tid = syscall(__NR_gettid);
if (crash_handler_ != NULL) {
- if (crash_handler_(&context, sizeof(context), callback_context_)) {
+ if (crash_handler_(&g_crash_context_, sizeof(g_crash_context_),
+ callback_context_)) {
return true;
}
}
- return GenerateDump(&context);
+ return GenerateDump(&g_crash_context_);
}
// This is a public interface to HandleSignal that allows the client to
@@ -458,7 +489,7 @@ bool ExceptionHandler::SimulateSignalDelivery(int sig) {
// ExceptionHandler::HandleSignal().
siginfo.si_code = SI_USER;
siginfo.si_pid = getpid();
- struct ucontext context;
+ ucontext_t context;
getcontext(&context);
return HandleSignal(sig, &siginfo, &context);
}
@@ -505,21 +536,22 @@ bool ExceptionHandler::GenerateDump(CrashContext *context) {
}
const pid_t child = sys_clone(
- ThreadEntry, stack, CLONE_FILES | CLONE_FS | CLONE_UNTRACED,
- &thread_arg, NULL, NULL, NULL);
+ ThreadEntry, stack, CLONE_FS | CLONE_UNTRACED, &thread_arg, NULL, NULL,
+ NULL);
if (child == -1) {
sys_close(fdes[0]);
sys_close(fdes[1]);
return false;
}
+ // Close the read end of the pipe.
+ sys_close(fdes[0]);
// Allow the child to ptrace us
sys_prctl(PR_SET_PTRACER, child, 0, 0, 0);
SendContinueSignalToChild();
- int status;
+ int status = 0;
const int r = HANDLE_EINTR(sys_waitpid(child, &status, __WALL));
- sys_close(fdes[0]);
sys_close(fdes[1]);
if (r == -1) {
@@ -568,11 +600,21 @@ void ExceptionHandler::WaitForContinueSignal() {
// Runs on the cloned process.
bool ExceptionHandler::DoDump(pid_t crashing_process, const void* context,
size_t context_size) {
+ const bool may_skip_dump =
+ minidump_descriptor_.skip_dump_if_principal_mapping_not_referenced();
+ const uintptr_t principal_mapping_address =
+ minidump_descriptor_.address_within_principal_mapping();
+ const bool sanitize_stacks = minidump_descriptor_.sanitize_stacks();
if (minidump_descriptor_.IsMicrodumpOnConsole()) {
- return google_breakpad::WriteMicrodump(crashing_process,
- context,
- context_size,
- mapping_list_);
+ return google_breakpad::WriteMicrodump(
+ crashing_process,
+ context,
+ context_size,
+ mapping_list_,
+ may_skip_dump,
+ principal_mapping_address,
+ sanitize_stacks,
+ *minidump_descriptor_.microdump_extra_info());
}
if (minidump_descriptor_.IsFD()) {
return google_breakpad::WriteMinidump(minidump_descriptor_.fd(),
@@ -581,7 +623,10 @@ bool ExceptionHandler::DoDump(pid_t crashing_process, const void* context,
context,
context_size,
mapping_list_,
- app_memory_list_);
+ app_memory_list_,
+ may_skip_dump,
+ principal_mapping_address,
+ sanitize_stacks);
}
return google_breakpad::WriteMinidump(minidump_descriptor_.path(),
minidump_descriptor_.size_limit(),
@@ -589,7 +634,10 @@ bool ExceptionHandler::DoDump(pid_t crashing_process, const void* context,
context,
context_size,
mapping_list_,
- app_memory_list_);
+ app_memory_list_,
+ may_skip_dump,
+ principal_mapping_address,
+ sanitize_stacks);
}
// static
@@ -742,4 +790,8 @@ bool ExceptionHandler::WriteMinidumpForChild(pid_t child,
return callback ? callback(descriptor, callback_context, true) : true;
}
+void SetFirstChanceExceptionHandler(FirstChanceHandler callback) {
+ g_first_chance_handler_ = callback;
+}
+
} // namespace google_breakpad
diff --git a/src/client/linux/handler/exception_handler.h b/src/client/linux/handler/exception_handler.h
index 591c3108..f44483ff 100644
--- a/src/client/linux/handler/exception_handler.h
+++ b/src/client/linux/handler/exception_handler.h
@@ -191,11 +191,11 @@ class ExceptionHandler {
struct CrashContext {
siginfo_t siginfo;
pid_t tid; // the crashing thread.
- struct ucontext context;
+ ucontext_t context;
#if !defined(__ARM_EABI__) && !defined(__mips__)
// #ifdef this out because FP state is not part of user ABI for Linux ARM.
- // In case of MIPS Linux FP state is already part of struct
- // ucontext so 'float_state' is not required.
+ // In case of MIPS Linux FP state is already part of ucontext_t so
+ // 'float_state' is not required.
fpstate_t float_state;
#endif
};
@@ -262,7 +262,7 @@ class ExceptionHandler {
// can do this. We create a pipe which we can use to block the
// cloned process after creating it, until we have explicitly enabled
// ptrace. This is used to store the file descriptors for the pipe
- int fdes[2];
+ int fdes[2] = {-1, -1};
// Callers can add extra info about mappings for cases where the
// dumper code cannot extract enough information from /proc/<pid>/maps.
@@ -273,6 +273,9 @@ class ExceptionHandler {
AppMemoryList app_memory_list_;
};
+typedef bool (*FirstChanceHandler)(int, siginfo_t*, void*);
+void SetFirstChanceExceptionHandler(FirstChanceHandler callback);
+
} // namespace google_breakpad
#endif // CLIENT_LINUX_HANDLER_EXCEPTION_HANDLER_H_
diff --git a/src/client/linux/handler/exception_handler_unittest.cc b/src/client/linux/handler/exception_handler_unittest.cc
index 289c9cd1..27808aa1 100644
--- a/src/client/linux/handler/exception_handler_unittest.cc
+++ b/src/client/linux/handler/exception_handler_unittest.cc
@@ -27,11 +27,12 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#include <poll.h>
+#include <pthread.h>
#include <stdint.h>
#include <unistd.h>
#include <signal.h>
#include <sys/mman.h>
-#include <sys/poll.h>
#include <sys/socket.h>
#include <sys/uio.h>
#include <sys/wait.h>
@@ -45,7 +46,6 @@
#include "client/linux/handler/exception_handler.h"
#include "client/linux/minidump_writer/minidump_writer.h"
#include "common/linux/eintr_wrapper.h"
-#include "common/linux/file_id.h"
#include "common/linux/ignore_ret.h"
#include "common/linux/linux_libc_support.h"
#include "common/tests/auto_tempdir.h"
@@ -94,10 +94,6 @@ void FlushInstructionCache(const char* memory, uint32_t memory_size) {
#endif
}
-// Length of a formatted GUID string =
-// sizeof(MDGUID) * 2 + 4 (for dashes) + 1 (null terminator)
-const int kGUIDStringSize = 37;
-
void sigchld_handler(int signo) { }
int CreateTMPFile(const string& dir, string* path) {
@@ -262,7 +258,65 @@ TEST(ExceptionHandlerTest, ChildCrashWithFD) {
ASSERT_NO_FATAL_FAILURE(ChildCrash(true));
}
-#endif // !ADDRESS_SANITIZER
+#if !defined(__ANDROID_API__) || __ANDROID_API__ >= __ANDROID_API_N__
+static void* SleepFunction(void* unused) {
+ while (true) usleep(1000000);
+ return NULL;
+}
+
+static void* CrashFunction(void* b_ptr) {
+ pthread_barrier_t* b = reinterpret_cast<pthread_barrier_t*>(b_ptr);
+ pthread_barrier_wait(b);
+ DoNullPointerDereference();
+ return NULL;
+}
+
+// Tests that concurrent crashes do not enter a loop by alternately triggering
+// the signal handler.
+TEST(ExceptionHandlerTest, ParallelChildCrashesDontHang) {
+ AutoTempDir temp_dir;
+ const pid_t child = fork();
+ if (child == 0) {
+ google_breakpad::scoped_ptr<ExceptionHandler> handler(
+ new ExceptionHandler(MinidumpDescriptor(temp_dir.path()), NULL, NULL,
+ NULL, true, -1));
+
+ // We start a number of threads to make sure handling the signal takes
+ // enough time for the second thread to enter the signal handler.
+ int num_sleep_threads = 100;
+ google_breakpad::scoped_array<pthread_t> sleep_threads(
+ new pthread_t[num_sleep_threads]);
+ for (int i = 0; i < num_sleep_threads; ++i) {
+ ASSERT_EQ(0, pthread_create(&sleep_threads[i], NULL, SleepFunction,
+ NULL));
+ }
+
+ int num_crash_threads = 2;
+ google_breakpad::scoped_array<pthread_t> crash_threads(
+ new pthread_t[num_crash_threads]);
+ // Barrier to synchronize crashing both threads at the same time.
+ pthread_barrier_t b;
+ ASSERT_EQ(0, pthread_barrier_init(&b, NULL, num_crash_threads + 1));
+ for (int i = 0; i < num_crash_threads; ++i) {
+ ASSERT_EQ(0, pthread_create(&crash_threads[i], NULL, CrashFunction, &b));
+ }
+ pthread_barrier_wait(&b);
+ for (int i = 0; i < num_crash_threads; ++i) {
+ ASSERT_EQ(0, pthread_join(crash_threads[i], NULL));
+ }
+ }
+
+ // Wait a while until the child should have crashed.
+ usleep(1000000);
+ // Kill the child if it is still running.
+ kill(child, SIGKILL);
+
+ // If the child process terminated by itself, it will have returned SIGSEGV.
+ // If however it got stuck in a loop, it will have been killed by the
+ // SIGKILL.
+ ASSERT_NO_FATAL_FAILURE(WaitForProcessToTerminate(child, SIGSEGV));
+}
+#endif // !defined(__ANDROID_API__) || __ANDROID_API__ >= __ANDROID_API_N__
static bool DoneCallbackReturnFalse(const MinidumpDescriptor& descriptor,
void* context,
@@ -305,8 +359,6 @@ static bool InstallRaiseSIGKILL() {
return sigaction(SIGSEGV, &sa, NULL) != -1;
}
-#ifndef ADDRESS_SANITIZER
-
static void CrashWithCallbacks(ExceptionHandler::FilterCallback filter,
ExceptionHandler::MinidumpCallback done,
string path) {
@@ -369,6 +421,10 @@ TEST(ExceptionHandlerTest, RedeliveryToDefaultHandler) {
const pid_t child = fork();
if (child == 0) {
+ // Custom signal handlers, which may have been installed by a test launcher,
+ // are undesirable in this child.
+ signal(SIGSEGV, SIG_DFL);
+
CrashWithCallbacks(FilterCallbackReturnFalse, NULL, temp_dir.path());
}
@@ -474,6 +530,29 @@ TEST(ExceptionHandlerTest, StackedHandlersUnhandledToBottom) {
ASSERT_NO_FATAL_FAILURE(WaitForProcessToTerminate(child, SIGKILL));
}
+namespace {
+const int kSimpleFirstChanceReturnStatus = 42;
+bool SimpleFirstChanceHandler(int, siginfo_t*, void*) {
+ _exit(kSimpleFirstChanceReturnStatus);
+}
+}
+
+TEST(ExceptionHandlerTest, FirstChanceHandlerRuns) {
+ AutoTempDir temp_dir;
+
+ const pid_t child = fork();
+ if (child == 0) {
+ ExceptionHandler handler(
+ MinidumpDescriptor(temp_dir.path()), NULL, NULL, NULL, true, -1);
+ google_breakpad::SetFirstChanceExceptionHandler(SimpleFirstChanceHandler);
+ DoNullPointerDereference();
+ }
+ int status;
+ ASSERT_NE(HANDLE_EINTR(waitpid(child, &status, 0)), -1);
+ ASSERT_TRUE(WIFEXITED(status));
+ ASSERT_EQ(kSimpleFirstChanceReturnStatus, WEXITSTATUS(status));
+}
+
#endif // !ADDRESS_SANITIZER
const unsigned char kIllegalInstruction[] = {
@@ -570,7 +649,7 @@ TEST(ExceptionHandlerTest, InstructionPointerMemory) {
memset(prefix_bytes, 0, sizeof(prefix_bytes));
memset(suffix_bytes, 0, sizeof(suffix_bytes));
EXPECT_TRUE(memcmp(bytes, prefix_bytes, sizeof(prefix_bytes)) == 0);
- EXPECT_TRUE(memcmp(bytes + kOffset, kIllegalInstruction,
+ EXPECT_TRUE(memcmp(bytes + kOffset, kIllegalInstruction,
sizeof(kIllegalInstruction)) == 0);
EXPECT_TRUE(memcmp(bytes + kOffset + sizeof(kIllegalInstruction),
suffix_bytes, sizeof(suffix_bytes)) == 0);
@@ -659,7 +738,7 @@ TEST(ExceptionHandlerTest, InstructionPointerMemoryMinBound) {
uint8_t suffix_bytes[kMemorySize / 2 - sizeof(kIllegalInstruction)];
memset(suffix_bytes, 0, sizeof(suffix_bytes));
- EXPECT_TRUE(memcmp(bytes + kOffset, kIllegalInstruction,
+ EXPECT_TRUE(memcmp(bytes + kOffset, kIllegalInstruction,
sizeof(kIllegalInstruction)) == 0);
EXPECT_TRUE(memcmp(bytes + kOffset + sizeof(kIllegalInstruction),
suffix_bytes, sizeof(suffix_bytes)) == 0);
@@ -774,8 +853,13 @@ TEST(ExceptionHandlerTest, InstructionPointerMemoryNullPointer) {
true, -1);
// Try calling a NULL pointer.
typedef void (*void_function)(void);
- void_function memory_function = reinterpret_cast<void_function>(NULL);
+ // Volatile markings are needed to keep Clang from generating invalid
+ // opcodes. See http://crbug.com/498354 for details.
+ volatile void_function memory_function =
+ reinterpret_cast<void_function>(NULL);
memory_function();
+ // not reached
+ exit(1);
}
close(fds[1]);
@@ -789,17 +873,37 @@ TEST(ExceptionHandlerTest, InstructionPointerMemoryNullPointer) {
ASSERT_GT(st.st_size, 0);
// Read the minidump. Locate the exception record and the
- // memory list, and then ensure that there is a memory region
+ // memory list, and then ensure that there is no memory region
// in the memory list that covers the instruction pointer from
// the exception record.
Minidump minidump(minidump_path);
ASSERT_TRUE(minidump.Read());
MinidumpException* exception = minidump.GetException();
- MinidumpMemoryList* memory_list = minidump.GetMemoryList();
ASSERT_TRUE(exception);
+
+ MinidumpContext* exception_context = exception->GetContext();
+ ASSERT_TRUE(exception_context);
+
+ uint64_t instruction_pointer;
+ ASSERT_TRUE(exception_context->GetInstructionPointer(&instruction_pointer));
+ EXPECT_EQ(instruction_pointer, 0u);
+
+ MinidumpMemoryList* memory_list = minidump.GetMemoryList();
ASSERT_TRUE(memory_list);
- ASSERT_EQ(static_cast<unsigned int>(1), memory_list->region_count());
+
+ unsigned int region_count = memory_list->region_count();
+ ASSERT_GE(region_count, 1u);
+
+ for (unsigned int region_index = 0;
+ region_index < region_count;
+ ++region_index) {
+ MinidumpMemoryRegion* region =
+ memory_list->GetMemoryRegionAtIndex(region_index);
+ uint64_t region_base = region->GetBase();
+ EXPECT_FALSE(instruction_pointer >= region_base &&
+ instruction_pointer < region_base + region->GetSize());
+ }
unlink(minidump_path.c_str());
}
@@ -816,19 +920,7 @@ TEST(ExceptionHandlerTest, ModuleInfo) {
0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF
};
- char module_identifier_buffer[kGUIDStringSize];
- FileID::ConvertIdentifierToString(kModuleGUID,
- module_identifier_buffer,
- sizeof(module_identifier_buffer));
- string module_identifier(module_identifier_buffer);
- // Strip out dashes
- size_t pos;
- while ((pos = module_identifier.find('-')) != string::npos) {
- module_identifier.erase(pos, 1);
- }
- // And append a zero, because module IDs include an "age" field
- // which is always zero on Linux.
- module_identifier += "0";
+ const string module_identifier = "33221100554477668899AABBCCDDEEFF0";
// Get some memory.
char* memory =
@@ -873,6 +965,8 @@ TEST(ExceptionHandlerTest, ModuleInfo) {
unlink(minidump_desc.path());
}
+#ifndef ADDRESS_SANITIZER
+
static const unsigned kControlMsgSize =
CMSG_SPACE(sizeof(int)) + CMSG_SPACE(sizeof(struct ucred));
@@ -925,8 +1019,6 @@ CrashHandler(const void* crash_context, size_t crash_context_size,
return true;
}
-#ifndef ADDRESS_SANITIZER
-
TEST(ExceptionHandlerTest, ExternalDumper) {
int fds[2];
ASSERT_NE(socketpair(AF_UNIX, SOCK_DGRAM, 0, fds), -1);
diff --git a/src/testing/gtest/test/production.h b/src/client/linux/handler/microdump_extra_info.h
index 98fd5e47..bf01f0c7 100644
--- a/src/testing/gtest/test/production.h
+++ b/src/client/linux/handler/microdump_extra_info.h
@@ -1,4 +1,4 @@
-// Copyright 2006, Google Inc.
+// Copyright 2015 Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
@@ -26,30 +26,27 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-//
-// This is part of the unit test for include/gtest/gtest_prod.h.
-
-#ifndef GTEST_TEST_PRODUCTION_H_
-#define GTEST_TEST_PRODUCTION_H_
-#include "gtest/gtest_prod.h"
+#ifndef CLIENT_LINUX_HANDLER_MICRODUMP_EXTRA_INFO_H_
+#define CLIENT_LINUX_HANDLER_MICRODUMP_EXTRA_INFO_H_
-class PrivateCode {
- public:
- // Declares a friend test that does not use a fixture.
- FRIEND_TEST(PrivateCodeTest, CanAccessPrivateMembers);
+namespace google_breakpad {
- // Declares a friend test that uses a fixture.
- FRIEND_TEST(PrivateCodeFixtureTest, CanAccessPrivateMembers);
+struct MicrodumpExtraInfo {
+ // Strings pointed to by this struct are not copied, and are
+ // expected to remain valid for the lifetime of the process.
+ const char* build_fingerprint;
+ const char* product_info;
+ const char* gpu_fingerprint;
+ const char* process_type;
- PrivateCode();
-
- int x() const { return x_; }
- private:
- void set_x(int an_x) { x_ = an_x; }
- int x_;
+ MicrodumpExtraInfo()
+ : build_fingerprint(NULL),
+ product_info(NULL),
+ gpu_fingerprint(NULL),
+ process_type(NULL) {}
};
-#endif // GTEST_TEST_PRODUCTION_H_
+}
+
+#endif // CLIENT_LINUX_HANDLER_MICRODUMP_EXTRA_INFO_H_
diff --git a/src/client/linux/handler/minidump_descriptor.cc b/src/client/linux/handler/minidump_descriptor.cc
index 8c68bde2..bd94474e 100644
--- a/src/client/linux/handler/minidump_descriptor.cc
+++ b/src/client/linux/handler/minidump_descriptor.cc
@@ -44,7 +44,13 @@ MinidumpDescriptor::MinidumpDescriptor(const MinidumpDescriptor& descriptor)
fd_(descriptor.fd_),
directory_(descriptor.directory_),
c_path_(NULL),
- size_limit_(descriptor.size_limit_) {
+ size_limit_(descriptor.size_limit_),
+ address_within_principal_mapping_(
+ descriptor.address_within_principal_mapping_),
+ skip_dump_if_principal_mapping_not_referenced_(
+ descriptor.skip_dump_if_principal_mapping_not_referenced_),
+ sanitize_stacks_(descriptor.sanitize_stacks_),
+ microdump_extra_info_(descriptor.microdump_extra_info_) {
// The copy constructor is not allowed to be called on a MinidumpDescriptor
// with a valid path_, as getting its c_path_ would require the heap which
// can cause problems in compromised environments.
@@ -65,6 +71,12 @@ MinidumpDescriptor& MinidumpDescriptor::operator=(
UpdatePath();
}
size_limit_ = descriptor.size_limit_;
+ address_within_principal_mapping_ =
+ descriptor.address_within_principal_mapping_;
+ skip_dump_if_principal_mapping_not_referenced_ =
+ descriptor.skip_dump_if_principal_mapping_not_referenced_;
+ sanitize_stacks_ = descriptor.sanitize_stacks_;
+ microdump_extra_info_ = descriptor.microdump_extra_info_;
return *this;
}
diff --git a/src/client/linux/handler/minidump_descriptor.h b/src/client/linux/handler/minidump_descriptor.h
index ed656cee..c7e4f2b3 100644
--- a/src/client/linux/handler/minidump_descriptor.h
+++ b/src/client/linux/handler/minidump_descriptor.h
@@ -35,6 +35,7 @@
#include <string>
+#include "client/linux/handler/microdump_extra_info.h"
#include "common/using_std_string.h"
// This class describes how a crash dump should be generated, either:
@@ -49,16 +50,22 @@ class MinidumpDescriptor {
struct MicrodumpOnConsole {};
static const MicrodumpOnConsole kMicrodumpOnConsole;
- MinidumpDescriptor() : mode_(kUninitialized),
- fd_(-1),
- size_limit_(-1) {}
+ MinidumpDescriptor()
+ : mode_(kUninitialized),
+ fd_(-1),
+ size_limit_(-1),
+ address_within_principal_mapping_(0),
+ skip_dump_if_principal_mapping_not_referenced_(false) {}
explicit MinidumpDescriptor(const string& directory)
: mode_(kWriteMinidumpToFile),
fd_(-1),
directory_(directory),
c_path_(NULL),
- size_limit_(-1) {
+ size_limit_(-1),
+ address_within_principal_mapping_(0),
+ skip_dump_if_principal_mapping_not_referenced_(false),
+ sanitize_stacks_(false) {
assert(!directory.empty());
}
@@ -66,14 +73,20 @@ class MinidumpDescriptor {
: mode_(kWriteMinidumpToFd),
fd_(fd),
c_path_(NULL),
- size_limit_(-1) {
+ size_limit_(-1),
+ address_within_principal_mapping_(0),
+ skip_dump_if_principal_mapping_not_referenced_(false),
+ sanitize_stacks_(false) {
assert(fd != -1);
}
explicit MinidumpDescriptor(const MicrodumpOnConsole&)
: mode_(kWriteMicrodumpToConsole),
fd_(-1),
- size_limit_(-1) {}
+ size_limit_(-1),
+ address_within_principal_mapping_(0),
+ skip_dump_if_principal_mapping_not_referenced_(false),
+ sanitize_stacks_(false) {}
explicit MinidumpDescriptor(const MinidumpDescriptor& descriptor);
MinidumpDescriptor& operator=(const MinidumpDescriptor& descriptor);
@@ -99,6 +112,33 @@ class MinidumpDescriptor {
off_t size_limit() const { return size_limit_; }
void set_size_limit(off_t limit) { size_limit_ = limit; }
+ uintptr_t address_within_principal_mapping() const {
+ return address_within_principal_mapping_;
+ }
+ void set_address_within_principal_mapping(
+ uintptr_t address_within_principal_mapping) {
+ address_within_principal_mapping_ = address_within_principal_mapping;
+ }
+
+ bool skip_dump_if_principal_mapping_not_referenced() {
+ return skip_dump_if_principal_mapping_not_referenced_;
+ }
+ void set_skip_dump_if_principal_mapping_not_referenced(
+ bool skip_dump_if_principal_mapping_not_referenced) {
+ skip_dump_if_principal_mapping_not_referenced_ =
+ skip_dump_if_principal_mapping_not_referenced;
+ }
+
+ bool sanitize_stacks() const { return sanitize_stacks_; }
+ void set_sanitize_stacks(bool sanitize_stacks) {
+ sanitize_stacks_ = sanitize_stacks;
+ }
+
+ MicrodumpExtraInfo* microdump_extra_info() {
+ assert(IsMicrodumpOnConsole());
+ return &microdump_extra_info_;
+ }
+
private:
enum DumpMode {
kUninitialized = 0,
@@ -115,13 +155,43 @@ class MinidumpDescriptor {
// The directory where the minidump should be generated.
string directory_;
+
// The full path to the generated minidump.
string path_;
+
// The C string of |path_|. Precomputed so it can be access from a compromised
// context.
const char* c_path_;
off_t size_limit_;
+
+ // This member points somewhere into the main module for this
+ // process (the module that is considerered interesting for the
+ // purposes of debugging crashes).
+ uintptr_t address_within_principal_mapping_;
+
+ // If set, threads that do not reference the address range
+ // associated with |address_within_principal_mapping_| will not have their
+ // stacks logged.
+ bool skip_dump_if_principal_mapping_not_referenced_;
+
+ // If set, stacks are sanitized to remove PII. This involves
+ // overwriting any pointer-aligned words that are not either
+ // pointers into a process mapping or small integers (+/-4096). This
+ // leaves enough information to unwind stacks, and preserve some
+ // register values, but elides strings and other program data.
+ bool sanitize_stacks_;
+
+ // The extra microdump data (e.g. product name/version, build
+ // fingerprint, gpu fingerprint) that should be appended to the dump
+ // (microdump only). Microdumps don't have the ability of appending
+ // extra metadata after the dump is generated (as opposite to
+ // minidumps MIME fields), therefore the extra data must be provided
+ // upfront. Any memory pointed to by members of the
+ // MicrodumpExtraInfo struct must be valid for the lifetime of the
+ // process (read: the caller has to guarantee that it is stored in
+ // global static storage.)
+ MicrodumpExtraInfo microdump_extra_info_;
};
} // namespace google_breakpad
diff --git a/src/client/linux/log/log.cc b/src/client/linux/log/log.cc
index 18635913..fc23aa6d 100644
--- a/src/client/linux/log/log.cc
+++ b/src/client/linux/log/log.cc
@@ -31,15 +31,51 @@
#if defined(__ANDROID__)
#include <android/log.h>
+#include <dlfcn.h>
#else
#include "third_party/lss/linux_syscall_support.h"
#endif
namespace logger {
+#if defined(__ANDROID__)
+namespace {
+
+// __android_log_buf_write() is not exported in the NDK and is being used by
+// dynamic runtime linking. Its declaration is taken from Android's
+// system/core/include/log/log.h.
+using AndroidLogBufferWriteFunc = int (*)(int bufID, int prio, const char *tag,
+ const char *text);
+const int kAndroidCrashLogId = 4; // From LOG_ID_CRASH in log.h.
+const char kAndroidLogTag[] = "google-breakpad";
+
+bool g_crash_log_initialized = false;
+AndroidLogBufferWriteFunc g_android_log_buf_write = nullptr;
+
+} // namespace
+
+void initializeCrashLogWriter() {
+ if (g_crash_log_initialized)
+ return;
+ g_android_log_buf_write = reinterpret_cast<AndroidLogBufferWriteFunc>(
+ dlsym(RTLD_DEFAULT, "__android_log_buf_write"));
+ g_crash_log_initialized = true;
+}
+
+int writeToCrashLog(const char* buf) {
+ // Try writing to the crash log ring buffer. If not available, fall back to
+ // the standard log buffer.
+ if (g_android_log_buf_write) {
+ return g_android_log_buf_write(kAndroidCrashLogId, ANDROID_LOG_FATAL,
+ kAndroidLogTag, buf);
+ }
+ return __android_log_write(ANDROID_LOG_FATAL, kAndroidLogTag, buf);
+}
+#endif
+
int write(const char* buf, size_t nbytes) {
#if defined(__ANDROID__)
- return __android_log_write(ANDROID_LOG_WARN, "google-breakpad", buf);
+ return __android_log_write(ANDROID_LOG_WARN, kAndroidLogTag, buf);
#else
return sys_write(2, buf, nbytes);
#endif
diff --git a/src/client/linux/log/log.h b/src/client/linux/log/log.h
index a50e30dc..f94bbd5f 100644
--- a/src/client/linux/log/log.h
+++ b/src/client/linux/log/log.h
@@ -36,6 +36,20 @@ namespace logger {
int write(const char* buf, size_t nbytes);
+// In the case of Android the log can be written to the default system log
+// (default behavior of write() above, or to the crash log (see
+// writeToCrashLog() below).
+#if defined(__ANDROID__)
+
+// The logger must be initialized in a non-compromised context.
+void initializeCrashLogWriter();
+
+// Once initialized, writeToCrashLog is safe to use in a compromised context,
+// even if the initialization failed, in which case this will silently fall
+// back on write().
+int writeToCrashLog(const char* buf);
+#endif
+
} // namespace logger
#endif // CLIENT_LINUX_LOG_LOG_H_
diff --git a/src/client/linux/microdump_writer/microdump_writer.cc b/src/client/linux/microdump_writer/microdump_writer.cc
index e14f9754..0aa30fbf 100644
--- a/src/client/linux/microdump_writer/microdump_writer.cc
+++ b/src/client/linux/microdump_writer/microdump_writer.cc
@@ -32,34 +32,110 @@
#include "client/linux/microdump_writer/microdump_writer.h"
+#include <limits>
+
#include <sys/utsname.h>
-#include "client/linux/dump_writer_common/seccomp_unwinder.h"
#include "client/linux/dump_writer_common/thread_info.h"
#include "client/linux/dump_writer_common/ucontext_reader.h"
#include "client/linux/handler/exception_handler.h"
+#include "client/linux/handler/microdump_extra_info.h"
#include "client/linux/log/log.h"
#include "client/linux/minidump_writer/linux_ptrace_dumper.h"
+#include "common/linux/file_id.h"
#include "common/linux/linux_libc_support.h"
+#include "common/memory_allocator.h"
namespace {
+using google_breakpad::auto_wasteful_vector;
using google_breakpad::ExceptionHandler;
+using google_breakpad::kDefaultBuildIdSize;
using google_breakpad::LinuxDumper;
using google_breakpad::LinuxPtraceDumper;
using google_breakpad::MappingInfo;
using google_breakpad::MappingList;
+using google_breakpad::MicrodumpExtraInfo;
using google_breakpad::RawContextCPU;
-using google_breakpad::SeccompUnwinder;
using google_breakpad::ThreadInfo;
using google_breakpad::UContextReader;
const size_t kLineBufferSize = 2048;
+#if !defined(__LP64__)
+// The following are only used by DumpFreeSpace, so need to be compiled
+// in conditionally in the same way.
+
+template <typename Dst, typename Src>
+Dst saturated_cast(Src src) {
+ if (src >= std::numeric_limits<Dst>::max())
+ return std::numeric_limits<Dst>::max();
+ if (src <= std::numeric_limits<Dst>::min())
+ return std::numeric_limits<Dst>::min();
+ return static_cast<Dst>(src);
+}
+
+int Log2Floor(uint64_t n) {
+ // Copied from chromium src/base/bits.h
+ if (n == 0)
+ return -1;
+ int log = 0;
+ uint64_t value = n;
+ for (int i = 5; i >= 0; --i) {
+ int shift = (1 << i);
+ uint64_t x = value >> shift;
+ if (x != 0) {
+ value = x;
+ log += shift;
+ }
+ }
+ assert(value == 1u);
+ return log;
+}
+
+bool MappingsAreAdjacent(const MappingInfo& a, const MappingInfo& b) {
+ // Because of load biasing, we can end up with a situation where two
+ // mappings actually overlap. So we will define adjacency to also include a
+ // b start address that lies within a's address range (including starting
+ // immediately after a).
+ // Because load biasing only ever moves the start address backwards, the end
+ // address should still increase.
+ return a.start_addr <= b.start_addr && a.start_addr + a.size >= b.start_addr;
+}
+
+bool MappingLessThan(const MappingInfo* a, const MappingInfo* b) {
+ // Return true if mapping a is before mapping b.
+ // For the same reason (load biasing) we compare end addresses, which - unlike
+ // start addresses - will not have been modified.
+ return a->start_addr + a->size < b->start_addr + b->size;
+}
+
+size_t NextOrderedMapping(
+ const google_breakpad::wasteful_vector<MappingInfo*>& mappings,
+ size_t curr) {
+ // Find the mapping that directly follows mappings[curr].
+ // If no such mapping exists, return |invalid| to indicate this.
+ const size_t invalid = std::numeric_limits<size_t>::max();
+ size_t best = invalid;
+ for (size_t next = 0; next < mappings.size(); ++next) {
+ if (MappingLessThan(mappings[curr], mappings[next]) &&
+ (best == invalid || MappingLessThan(mappings[next], mappings[best]))) {
+ best = next;
+ }
+ }
+ return best;
+}
+
+#endif // !__LP64__
+
class MicrodumpWriter {
public:
MicrodumpWriter(const ExceptionHandler::CrashContext* context,
const MappingList& mappings,
+ bool skip_dump_if_principal_mapping_not_referenced,
+ uintptr_t address_within_principal_mapping,
+ bool sanitize_stack,
+ const MicrodumpExtraInfo& microdump_extra_info,
LinuxDumper* dumper)
: ucontext_(context ? &context->context : NULL),
#if !defined(__ARM_EABI__) && !defined(__mips__)
@@ -67,7 +143,16 @@ class MicrodumpWriter {
#endif
dumper_(dumper),
mapping_list_(mappings),
- log_line_(NULL) {
+ skip_dump_if_principal_mapping_not_referenced_(
+ skip_dump_if_principal_mapping_not_referenced),
+ address_within_principal_mapping_(address_within_principal_mapping),
+ sanitize_stack_(sanitize_stack),
+ microdump_extra_info_(microdump_extra_info),
+ log_line_(NULL),
+ stack_copy_(NULL),
+ stack_len_(0),
+ stack_lower_bound_(0),
+ stack_pointer_(0) {
log_line_ = reinterpret_cast<char*>(Alloc(kLineBufferSize));
if (log_line_)
log_line_[0] = '\0'; // Clear out the log line buffer.
@@ -82,28 +167,42 @@ class MicrodumpWriter {
// try to not crash.
if (!dumper_->Init() || !log_line_)
return false;
- return dumper_->ThreadsSuspend();
+ return dumper_->ThreadsSuspend() && dumper_->LateInit();
}
- bool Dump() {
- bool success;
+ void Dump() {
+ CaptureResult stack_capture_result = CaptureCrashingThreadStack(-1);
+ if (stack_capture_result == CAPTURE_UNINTERESTING) {
+ LogLine("Microdump skipped (uninteresting)");
+ return;
+ }
+
LogLine("-----BEGIN BREAKPAD MICRODUMP-----");
- success = DumpOSInformation();
- if (success)
- success = DumpCrashingThread();
- if (success)
- success = DumpMappings();
+ DumpProductInformation();
+ DumpOSInformation();
+ DumpProcessType();
+ DumpCrashReason();
+ DumpGPUInformation();
+#if !defined(__LP64__)
+ DumpFreeSpace();
+#endif
+ if (stack_capture_result == CAPTURE_OK)
+ DumpThreadStack();
+ DumpCPUState();
+ DumpMappings();
LogLine("-----END BREAKPAD MICRODUMP-----");
- dumper_->ThreadsResume();
- return success;
}
private:
+ enum CaptureResult { CAPTURE_OK, CAPTURE_FAILED, CAPTURE_UNINTERESTING };
+
// Writes one line to the system log.
void LogLine(const char* msg) {
+#if defined(__ANDROID__)
+ logger::writeToCrashLog(msg);
+#else
logger::write(msg, my_strlen(msg));
-#if !defined(__ANDROID__)
- logger::write("\n", 1); // Android logger appends the \n. Linux's doesn't.
+ logger::write("\n", 1);
#endif
}
@@ -140,13 +239,77 @@ class MicrodumpWriter {
// Writes out the current line buffer on the system log.
void LogCommitLine() {
LogLine(log_line_);
- my_strlcpy(log_line_, "", kLineBufferSize);
+ log_line_[0] = 0;
}
- bool DumpOSInformation() {
- struct utsname uts;
- if (uname(&uts))
- return false;
+ CaptureResult CaptureCrashingThreadStack(int max_stack_len) {
+ stack_pointer_ = UContextReader::GetStackPointer(ucontext_);
+
+ if (!dumper_->GetStackInfo(reinterpret_cast<const void**>(&stack_lower_bound_),
+ &stack_len_, stack_pointer_)) {
+ return CAPTURE_FAILED;
+ }
+
+ if (max_stack_len >= 0 &&
+ stack_len_ > static_cast<size_t>(max_stack_len)) {
+ stack_len_ = max_stack_len;
+ }
+
+ stack_copy_ = reinterpret_cast<uint8_t*>(Alloc(stack_len_));
+ dumper_->CopyFromProcess(stack_copy_, dumper_->crash_thread(),
+ reinterpret_cast<const void*>(stack_lower_bound_),
+ stack_len_);
+
+ if (!skip_dump_if_principal_mapping_not_referenced_) return CAPTURE_OK;
+
+ const MappingInfo* principal_mapping =
+ dumper_->FindMappingNoBias(address_within_principal_mapping_);
+ if (!principal_mapping) return CAPTURE_UNINTERESTING;
+
+ uintptr_t low_addr = principal_mapping->system_mapping_info.start_addr;
+ uintptr_t high_addr = principal_mapping->system_mapping_info.end_addr;
+ uintptr_t pc = UContextReader::GetInstructionPointer(ucontext_);
+ if (low_addr <= pc && pc <= high_addr) return CAPTURE_OK;
+
+ if (dumper_->StackHasPointerToMapping(stack_copy_, stack_len_,
+ stack_pointer_ - stack_lower_bound_,
+ *principal_mapping)) {
+ return CAPTURE_OK;
+ }
+ return CAPTURE_UNINTERESTING;
+ }
+
+ void DumpProductInformation() {
+ LogAppend("V ");
+ if (microdump_extra_info_.product_info) {
+ LogAppend(microdump_extra_info_.product_info);
+ } else {
+ LogAppend("UNKNOWN:0.0.0.0");
+ }
+ LogCommitLine();
+ }
+
+ void DumpProcessType() {
+ LogAppend("P ");
+ if (microdump_extra_info_.process_type) {
+ LogAppend(microdump_extra_info_.process_type);
+ } else {
+ LogAppend("UNKNOWN");
+ }
+ LogCommitLine();
+ }
+
+ void DumpCrashReason() {
+ LogAppend("R ");
+ LogAppend(dumper_->crash_signal());
+ LogAppend(" ");
+ LogAppend(dumper_->GetCrashSignalString());
+ LogAppend(" ");
+ LogAppend(dumper_->crash_address());
+ LogCommitLine();
+ }
+
+ void DumpOSInformation() {
const uint8_t n_cpus = static_cast<uint8_t>(sysconf(_SC_NPROCESSORS_CONF));
#if defined(__ANDROID__)
@@ -155,8 +318,9 @@ class MicrodumpWriter {
const char kOSId[] = "L";
#endif
-// We cannot depend on uts.machine. On multiarch devices it always returns the
-// primary arch, not the one that match the executable being run.
+// Dump the runtime architecture. On multiarch devices it might not match the
+// hw architecture (the one returned by uname()), for instance in the case of
+// a 32-bit app running on a aarch64 device.
#if defined(__aarch64__)
const char kArch[] = "arm64";
#elif defined(__ARMEL__)
@@ -166,7 +330,13 @@ class MicrodumpWriter {
#elif defined(__i386__)
const char kArch[] = "x86";
#elif defined(__mips__)
+# if _MIPS_SIM == _ABIO32
const char kArch[] = "mips";
+# elif _MIPS_SIM == _ABI64
+ const char kArch[] = "mips64";
+# else
+# error "This mips ABI is currently not supported (n32)"
+#endif
#else
#error "This code has not been ported to your platform yet"
#endif
@@ -178,98 +348,74 @@ class MicrodumpWriter {
LogAppend(" ");
LogAppend(n_cpus);
LogAppend(" ");
- LogAppend(uts.machine);
- LogAppend(" ");
- LogAppend(uts.release);
+
+ // Dump the HW architecture (e.g., armv7l, aarch64).
+ struct utsname uts;
+ const bool has_uts_info = (uname(&uts) == 0);
+ const char* hwArch = has_uts_info ? uts.machine : "unknown_hw_arch";
+ LogAppend(hwArch);
LogAppend(" ");
- LogAppend(uts.version);
+
+ // If the client has attached a build fingerprint to the MinidumpDescriptor
+ // use that one. Otherwise try to get some basic info from uname().
+ if (microdump_extra_info_.build_fingerprint) {
+ LogAppend(microdump_extra_info_.build_fingerprint);
+ } else if (has_uts_info) {
+ LogAppend(uts.release);
+ LogAppend(" ");
+ LogAppend(uts.version);
+ } else {
+ LogAppend("no build fingerprint available");
+ }
+ LogCommitLine();
+ }
+
+ void DumpGPUInformation() {
+ LogAppend("G ");
+ if (microdump_extra_info_.gpu_fingerprint) {
+ LogAppend(microdump_extra_info_.gpu_fingerprint);
+ } else {
+ LogAppend("UNKNOWN");
+ }
LogCommitLine();
- return true;
}
- bool DumpThreadStack(uint32_t thread_id,
- uintptr_t stack_pointer,
- int max_stack_len,
- uint8_t** stack_copy) {
- *stack_copy = NULL;
- const void* stack;
- size_t stack_len;
-
- if (!dumper_->GetStackInfo(&stack, &stack_len, stack_pointer)) {
- // The stack pointer might not be available. In this case we don't hard
- // fail, just produce a (almost useless) microdump w/o a stack section.
- return true;
+ void DumpThreadStack() {
+ if (sanitize_stack_) {
+ dumper_->SanitizeStackCopy(stack_copy_, stack_len_, stack_pointer_,
+ stack_pointer_ - stack_lower_bound_);
}
LogAppend("S 0 ");
- LogAppend(stack_pointer);
+ LogAppend(stack_pointer_);
LogAppend(" ");
- LogAppend(reinterpret_cast<uintptr_t>(stack));
+ LogAppend(stack_lower_bound_);
LogAppend(" ");
- LogAppend(stack_len);
+ LogAppend(stack_len_);
LogCommitLine();
- if (max_stack_len >= 0 &&
- stack_len > static_cast<unsigned int>(max_stack_len)) {
- stack_len = max_stack_len;
- }
-
- *stack_copy = reinterpret_cast<uint8_t*>(Alloc(stack_len));
- dumper_->CopyFromProcess(*stack_copy, thread_id, stack, stack_len);
-
- // Dump the content of the stack, splicing it into chunks which size is
- // compatible with the max logcat line size (see LOGGER_ENTRY_MAX_PAYLOAD).
const size_t STACK_DUMP_CHUNK_SIZE = 384;
- for (size_t stack_off = 0; stack_off < stack_len;
+ for (size_t stack_off = 0; stack_off < stack_len_;
stack_off += STACK_DUMP_CHUNK_SIZE) {
LogAppend("S ");
- LogAppend(reinterpret_cast<uintptr_t>(stack) + stack_off);
+ LogAppend(stack_lower_bound_ + stack_off);
LogAppend(" ");
- LogAppend(*stack_copy + stack_off,
- std::min(STACK_DUMP_CHUNK_SIZE, stack_len - stack_off));
+ LogAppend(stack_copy_ + stack_off,
+ std::min(STACK_DUMP_CHUNK_SIZE, stack_len_ - stack_off));
LogCommitLine();
}
- return true;
}
- // Write information about the crashing thread.
- bool DumpCrashingThread() {
- const unsigned num_threads = dumper_->threads().size();
-
- for (unsigned i = 0; i < num_threads; ++i) {
- MDRawThread thread;
- my_memset(&thread, 0, sizeof(thread));
- thread.thread_id = dumper_->threads()[i];
-
- // Dump only the crashing thread.
- if (static_cast<pid_t>(thread.thread_id) != dumper_->crash_thread())
- continue;
-
- assert(ucontext_);
- assert(!dumper_->IsPostMortem());
-
- uint8_t* stack_copy;
- const uintptr_t stack_ptr = UContextReader::GetStackPointer(ucontext_);
- if (!DumpThreadStack(thread.thread_id, stack_ptr, -1, &stack_copy))
- return false;
-
- RawContextCPU cpu;
- my_memset(&cpu, 0, sizeof(RawContextCPU));
+ void DumpCPUState() {
+ RawContextCPU cpu;
+ my_memset(&cpu, 0, sizeof(RawContextCPU));
#if !defined(__ARM_EABI__) && !defined(__mips__)
- UContextReader::FillCPUContext(&cpu, ucontext_, float_state_);
+ UContextReader::FillCPUContext(&cpu, ucontext_, float_state_);
#else
- UContextReader::FillCPUContext(&cpu, ucontext_);
+ UContextReader::FillCPUContext(&cpu, ucontext_);
#endif
- if (stack_copy)
- SeccompUnwinder::PopSeccompStackFrame(&cpu, thread, stack_copy);
- DumpCPUState(&cpu);
- }
- return true;
- }
-
- void DumpCPUState(RawContextCPU* cpu) {
LogAppend("C ");
- LogAppend(cpu, sizeof(*cpu));
+ LogAppend(&cpu, sizeof(cpu));
LogCommitLine();
}
@@ -296,21 +442,31 @@ class MicrodumpWriter {
bool member,
unsigned int mapping_id,
const uint8_t* identifier) {
- MDGUID module_identifier;
+
+ auto_wasteful_vector<uint8_t, kDefaultBuildIdSize> identifier_bytes(
+ dumper_->allocator());
+
if (identifier) {
// GUID was provided by caller.
- my_memcpy(&module_identifier, identifier, sizeof(MDGUID));
+ identifier_bytes.insert(identifier_bytes.end(),
+ identifier,
+ identifier + sizeof(MDGUID));
} else {
dumper_->ElfFileIdentifierForMapping(
mapping,
member,
mapping_id,
- reinterpret_cast<uint8_t*>(&module_identifier));
+ identifier_bytes);
}
+ // Copy as many bytes of |identifier| as will fit into a MDGUID
+ MDGUID module_identifier = {};
+ memcpy(&module_identifier, &identifier_bytes[0],
+ std::min(sizeof(MDGUID), identifier_bytes.size()));
+
char file_name[NAME_MAX];
char file_path[NAME_MAX];
- LinuxDumper::GetMappingEffectiveNameAndPath(
+ dumper_->GetMappingEffectiveNameAndPath(
mapping, file_path, sizeof(file_path), file_name, sizeof(file_name));
LogAppend("M ");
@@ -336,8 +492,96 @@ class MicrodumpWriter {
LogCommitLine();
}
+#if !defined(__LP64__)
+ void DumpFreeSpace() {
+ const MappingInfo* stack_mapping = nullptr;
+ ThreadInfo info;
+ if (dumper_->GetThreadInfoByIndex(dumper_->GetMainThreadIndex(), &info)) {
+ stack_mapping = dumper_->FindMappingNoBias(info.stack_pointer);
+ }
+
+ const google_breakpad::wasteful_vector<MappingInfo*>& mappings =
+ dumper_->mappings();
+ if (mappings.size() == 0) return;
+
+ // This is complicated by the fact that mappings is not in order. It should
+ // be mostly in order, however the mapping that contains the entry point for
+ // the process is always at the front of the vector.
+
+ static const int HBITS = sizeof(size_t) * 8;
+ size_t hole_histogram[HBITS];
+ my_memset(hole_histogram, 0, sizeof(hole_histogram));
+
+ // Find the lowest address mapping.
+ size_t curr = 0;
+ for (size_t i = 1; i < mappings.size(); ++i) {
+ if (mappings[i]->start_addr < mappings[curr]->start_addr) curr = i;
+ }
+
+ uintptr_t lo_addr = mappings[curr]->start_addr;
+
+ size_t hole_cnt = 0;
+ size_t hole_max = 0;
+ size_t hole_sum = 0;
+
+ while (true) {
+ // Skip to the end of an adjacent run of mappings. This is an optimization
+ // for the fact that mappings is mostly sorted.
+ while (curr != mappings.size() - 1 &&
+ MappingsAreAdjacent(*mappings[curr], *mappings[curr + 1])) {
+ ++curr;
+ }
+
+ if (mappings[curr] == stack_mapping) {
+ // Because we can't determine the top of userspace mappable
+ // memory we treat the start of the process stack as the top
+ // of the allocatable address space. Once we reach
+ // |stack_mapping| we are done scanning for free space regions.
+ break;
+ }
+
+ size_t next = NextOrderedMapping(mappings, curr);
+ if (next == std::numeric_limits<size_t>::max())
+ break;
+
+ uintptr_t hole_lo = mappings[curr]->start_addr + mappings[curr]->size;
+ uintptr_t hole_hi = mappings[next]->start_addr;
+
+ if (hole_hi > hole_lo) {
+ size_t hole_sz = hole_hi - hole_lo;
+ hole_sum += hole_sz;
+ hole_max = std::max(hole_sz, hole_max);
+ ++hole_cnt;
+ ++hole_histogram[Log2Floor(hole_sz)];
+ }
+ curr = next;
+ }
+
+ uintptr_t hi_addr = mappings[curr]->start_addr + mappings[curr]->size;
+
+ LogAppend("H ");
+ LogAppend(lo_addr);
+ LogAppend(" ");
+ LogAppend(hi_addr);
+ LogAppend(" ");
+ LogAppend(saturated_cast<uint16_t>(hole_cnt));
+ LogAppend(" ");
+ LogAppend(hole_max);
+ LogAppend(" ");
+ LogAppend(hole_sum);
+ for (unsigned int i = 0; i < HBITS; ++i) {
+ if (!hole_histogram[i]) continue;
+ LogAppend(" ");
+ LogAppend(saturated_cast<uint8_t>(i));
+ LogAppend(":");
+ LogAppend(saturated_cast<uint8_t>(hole_histogram[i]));
+ }
+ LogCommitLine();
+ }
+#endif
+
// Write information about the mappings in effect.
- bool DumpMappings() {
+ void DumpMappings() {
// First write all the mappings from the dumper
for (unsigned i = 0; i < dumper_->mappings().size(); ++i) {
const MappingInfo& mapping = *dumper_->mappings()[i];
@@ -356,18 +600,35 @@ class MicrodumpWriter {
++iter) {
DumpModule(iter->first, false, 0, iter->second);
}
- return true;
}
void* Alloc(unsigned bytes) { return dumper_->allocator()->Alloc(bytes); }
- const struct ucontext* const ucontext_;
+ const ucontext_t* const ucontext_;
#if !defined(__ARM_EABI__) && !defined(__mips__)
const google_breakpad::fpstate_t* const float_state_;
#endif
LinuxDumper* dumper_;
const MappingList& mapping_list_;
+ bool skip_dump_if_principal_mapping_not_referenced_;
+ uintptr_t address_within_principal_mapping_;
+ bool sanitize_stack_;
+ const MicrodumpExtraInfo microdump_extra_info_;
char* log_line_;
+
+ // The local copy of crashed process stack memory, beginning at
+ // |stack_lower_bound_|.
+ uint8_t* stack_copy_;
+
+ // The length of crashed process stack copy.
+ size_t stack_len_;
+
+ // The address of the page containing the stack pointer in the
+ // crashed process. |stack_lower_bound_| <= |stack_pointer_|
+ uintptr_t stack_lower_bound_;
+
+ // The stack pointer of the crashed thread.
+ uintptr_t stack_pointer_;
};
} // namespace
@@ -376,22 +637,28 @@ namespace google_breakpad {
bool WriteMicrodump(pid_t crashing_process,
const void* blob,
size_t blob_size,
- const MappingList& mappings) {
+ const MappingList& mappings,
+ bool skip_dump_if_principal_mapping_not_referenced,
+ uintptr_t address_within_principal_mapping,
+ bool sanitize_stack,
+ const MicrodumpExtraInfo& microdump_extra_info) {
LinuxPtraceDumper dumper(crashing_process);
const ExceptionHandler::CrashContext* context = NULL;
if (blob) {
if (blob_size != sizeof(ExceptionHandler::CrashContext))
return false;
context = reinterpret_cast<const ExceptionHandler::CrashContext*>(blob);
- dumper.set_crash_address(
- reinterpret_cast<uintptr_t>(context->siginfo.si_addr));
- dumper.set_crash_signal(context->siginfo.si_signo);
+ dumper.SetCrashInfoFromSigInfo(context->siginfo);
dumper.set_crash_thread(context->tid);
}
- MicrodumpWriter writer(context, mappings, &dumper);
+ MicrodumpWriter writer(context, mappings,
+ skip_dump_if_principal_mapping_not_referenced,
+ address_within_principal_mapping, sanitize_stack,
+ microdump_extra_info, &dumper);
if (!writer.Init())
return false;
- return writer.Dump();
+ writer.Dump();
+ return true;
}
} // namespace google_breakpad
diff --git a/src/client/linux/microdump_writer/microdump_writer.h b/src/client/linux/microdump_writer/microdump_writer.h
index 3c19f3d0..a1e53df6 100644
--- a/src/client/linux/microdump_writer/microdump_writer.h
+++ b/src/client/linux/microdump_writer/microdump_writer.h
@@ -37,6 +37,8 @@
namespace google_breakpad {
+struct MicrodumpExtraInfo;
+
// Writes a microdump (a reduced dump containing only the state of the crashing
// thread) on the console (logcat on Android). These functions do not malloc nor
// use libc functions which may. Thus, it can be used in contexts where the
@@ -46,12 +48,20 @@ namespace google_breakpad {
// blob: a blob of data from the crashing process. See exception_handler.h
// blob_size: the length of |blob| in bytes.
// mappings: a list of additional mappings provided by the application.
+// build_fingerprint: a (optional) C string which determines the OS
+// build fingerprint (e.g., aosp/occam/mako:5.1.1/LMY47W/1234:eng/dev-keys).
+// product_info: a (optional) C string which determines the product name and
+// version (e.g., WebView:42.0.2311.136).
//
// Returns true iff successful.
bool WriteMicrodump(pid_t crashing_process,
const void* blob,
size_t blob_size,
- const MappingList& mappings);
+ const MappingList& mappings,
+ bool skip_dump_if_main_module_not_referenced,
+ uintptr_t address_within_main_module,
+ bool sanitize_stack,
+ const MicrodumpExtraInfo& microdump_extra_info);
} // namespace google_breakpad
diff --git a/src/client/linux/microdump_writer/microdump_writer_unittest.cc b/src/client/linux/microdump_writer/microdump_writer_unittest.cc
index 52b1d9a9..6339ac0c 100644
--- a/src/client/linux/microdump_writer/microdump_writer_unittest.cc
+++ b/src/client/linux/microdump_writer/microdump_writer_unittest.cc
@@ -27,15 +27,20 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#include <ctype.h>
#include <sys/syscall.h>
#include <sys/types.h>
#include <unistd.h>
+#include <ucontext.h>
+#include <sstream>
#include <string>
#include "breakpad_googletest_includes.h"
#include "client/linux/handler/exception_handler.h"
+#include "client/linux/handler/microdump_extra_info.h"
#include "client/linux/microdump_writer/microdump_writer.h"
+#include "common/linux/breakpad_getcontext.h"
#include "common/linux/eintr_wrapper.h"
#include "common/linux/ignore_ret.h"
#include "common/scoped_ptr.h"
@@ -44,11 +49,41 @@
using namespace google_breakpad;
+extern "C" {
+extern char __executable_start;
+extern char __etext;
+}
+
namespace {
typedef testing::Test MicrodumpWriterTest;
-TEST(MicrodumpWriterTest, Setup) {
+MicrodumpExtraInfo MakeMicrodumpExtraInfo(
+ const char* build_fingerprint,
+ const char* product_info,
+ const char* gpu_fingerprint) {
+ MicrodumpExtraInfo info;
+ info.build_fingerprint = build_fingerprint;
+ info.product_info = product_info;
+ info.gpu_fingerprint = gpu_fingerprint;
+ info.process_type = "Browser";
+ return info;
+}
+
+bool ContainsMicrodump(const std::string& buf) {
+ return std::string::npos != buf.find("-----BEGIN BREAKPAD MICRODUMP-----") &&
+ std::string::npos != buf.find("-----END BREAKPAD MICRODUMP-----");
+}
+
+const char kIdentifiableString[] = "_IDENTIFIABLE_";
+const uintptr_t kCrashAddress = 0xdeaddeadu;
+
+void CrashAndGetMicrodump(const MappingList& mappings,
+ const MicrodumpExtraInfo& microdump_extra_info,
+ std::string* microdump,
+ bool skip_dump_if_principal_mapping_not_referenced = false,
+ uintptr_t address_within_principal_mapping = 0,
+ bool sanitize_stack = false) {
int fds[2];
ASSERT_NE(-1, pipe(fds));
@@ -57,6 +92,14 @@ TEST(MicrodumpWriterTest, Setup) {
int err_fd = open(stderr_file.c_str(), O_CREAT | O_RDWR, S_IRUSR | S_IWUSR);
ASSERT_NE(-1, err_fd);
+ char identifiable_string[sizeof(kIdentifiableString)];
+
+ // This string should not appear in the resulting microdump if it
+ // has been sanitized.
+ strcpy(identifiable_string, kIdentifiableString);
+ // Force the strcpy to not be optimized away.
+ IGNORE_RET(write(STDOUT_FILENO, identifiable_string, 0));
+
const pid_t child = fork();
if (child == 0) {
close(fds[1]);
@@ -69,10 +112,149 @@ TEST(MicrodumpWriterTest, Setup) {
ExceptionHandler::CrashContext context;
memset(&context, 0, sizeof(context));
-
+ // Pretend the current context is the child context (which is
+ // approximately right) so that we have a valid stack pointer, and
+ // can fetch child stack data via ptrace.
+ getcontext(&context.context);
// Set a non-zero tid to avoid tripping asserts.
context.tid = child;
+ context.siginfo.si_signo = MD_EXCEPTION_CODE_LIN_DUMP_REQUESTED;
+ context.siginfo.si_addr = reinterpret_cast<void*>(kCrashAddress);
+
+ // Redirect temporarily stderr to the stderr.log file.
+ int save_err = dup(STDERR_FILENO);
+ ASSERT_NE(-1, save_err);
+ ASSERT_NE(-1, dup2(err_fd, STDERR_FILENO));
+
+ ASSERT_TRUE(WriteMicrodump(child, &context, sizeof(context), mappings,
+ skip_dump_if_principal_mapping_not_referenced,
+ address_within_principal_mapping, sanitize_stack,
+ microdump_extra_info));
+ // Revert stderr back to the console.
+ dup2(save_err, STDERR_FILENO);
+ close(save_err);
+
+ // Read back the stderr file and check for the microdump marker.
+ fsync(err_fd);
+ lseek(err_fd, 0, SEEK_SET);
+
+ microdump->clear();
+ char buf[1024];
+
+ while (true) {
+ int bytes_read = IGNORE_EINTR(read(err_fd, buf, 1024));
+ if (bytes_read <= 0) break;
+ microdump->append(buf, buf + bytes_read);
+ }
+ close(err_fd);
+ close(fds[1]);
+}
+
+void ExtractMicrodumpStackContents(const string& microdump_content,
+ string* result) {
+ std::istringstream iss(microdump_content);
+ result->clear();
+ for (string line; std::getline(iss, line);) {
+ if (line.find("S ") == 0) {
+ std::istringstream stack_data(line);
+ std::string key;
+ std::string addr;
+ std::string data;
+ stack_data >> key >> addr >> data;
+ EXPECT_TRUE((data.size() & 1u) == 0u);
+ result->reserve(result->size() + data.size() / 2);
+ for (size_t i = 0; i < data.size(); i += 2) {
+ std::string byte = data.substr(i, 2);
+ result->push_back(static_cast<char>(strtoul(byte.c_str(), NULL, 16)));
+ }
+ }
+ }
+}
+
+void CheckMicrodumpContents(const string& microdump_content,
+ const MicrodumpExtraInfo& expected_info) {
+ std::istringstream iss(microdump_content);
+ bool did_find_os_info = false;
+ bool did_find_product_info = false;
+ bool did_find_process_type = false;
+ bool did_find_crash_reason = false;
+ bool did_find_gpu_info = false;
+ for (string line; std::getline(iss, line);) {
+ if (line.find("O ") == 0) {
+ std::istringstream os_info_tokens(line);
+ string token;
+ os_info_tokens.ignore(2); // Ignore the "O " preamble.
+ // Check the OS descriptor char (L=Linux, A=Android).
+ os_info_tokens >> token;
+ ASSERT_TRUE(token == "L" || token == "A");
+
+ os_info_tokens >> token; // HW architecture.
+ os_info_tokens >> token; // Number of cpus.
+ for (size_t i = 0; i < token.size(); ++i)
+ ASSERT_TRUE(isxdigit(token[i]));
+ os_info_tokens >> token; // SW architecture.
+
+ // Check that the build fingerprint is in the right place.
+ os_info_tokens >> token;
+ ASSERT_FALSE(os_info_tokens.fail());
+ if (expected_info.build_fingerprint)
+ ASSERT_EQ(expected_info.build_fingerprint, token);
+ did_find_os_info = true;
+ } else if (line.find("P ") == 0) {
+ if (expected_info.process_type)
+ ASSERT_EQ(string("P ") + expected_info.process_type, line);
+ did_find_process_type = true;
+ } else if (line.find("R ") == 0) {
+ std::istringstream crash_reason_tokens(line);
+ string token;
+ unsigned crash_reason;
+ string crash_reason_str;
+ uintptr_t crash_address;
+ crash_reason_tokens.ignore(2); // Ignore the "R " preamble.
+ crash_reason_tokens >> std::hex >> crash_reason >> crash_reason_str >>
+ crash_address;
+ ASSERT_FALSE(crash_reason_tokens.fail());
+ ASSERT_EQ(MD_EXCEPTION_CODE_LIN_DUMP_REQUESTED, crash_reason);
+ ASSERT_EQ("DUMP_REQUESTED", crash_reason_str);
+ ASSERT_EQ(kCrashAddress, crash_address);
+ did_find_crash_reason = true;
+ } else if (line.find("V ") == 0) {
+ if (expected_info.product_info)
+ ASSERT_EQ(string("V ") + expected_info.product_info, line);
+ did_find_product_info = true;
+ } else if (line.find("G ") == 0) {
+ if (expected_info.gpu_fingerprint)
+ ASSERT_EQ(string("G ") + expected_info.gpu_fingerprint, line);
+ did_find_gpu_info = true;
+ }
+ }
+ ASSERT_TRUE(did_find_os_info);
+ ASSERT_TRUE(did_find_product_info);
+ ASSERT_TRUE(did_find_process_type);
+ ASSERT_TRUE(did_find_crash_reason);
+ ASSERT_TRUE(did_find_gpu_info);
+}
+
+bool MicrodumpStackContains(const string& microdump_content,
+ const string& expected_content) {
+ string result;
+ ExtractMicrodumpStackContents(microdump_content, &result);
+ return result.find(kIdentifiableString) != string::npos;
+}
+
+void CheckMicrodumpContents(const string& microdump_content,
+ const string& expected_fingerprint,
+ const string& expected_product_info,
+ const string& expected_gpu_fingerprint) {
+ CheckMicrodumpContents(
+ microdump_content,
+ MakeMicrodumpExtraInfo(expected_fingerprint.c_str(),
+ expected_product_info.c_str(),
+ expected_gpu_fingerprint.c_str()));
+}
+
+TEST(MicrodumpWriterTest, BasicWithMappings) {
// Push some extra mapping to check the MappingList logic.
const uint32_t memory_size = sysconf(_SC_PAGESIZE);
const char* kMemoryName = "libfoo.so";
@@ -93,41 +275,147 @@ TEST(MicrodumpWriterTest, Setup) {
memcpy(mapping.second, kModuleGUID, sizeof(MDGUID));
mappings.push_back(mapping);
- // Redirect temporarily stderr to the stderr.log file.
- int save_err = dup(STDERR_FILENO);
- ASSERT_NE(-1, save_err);
- ASSERT_NE(-1, dup2(err_fd, STDERR_FILENO));
+ std::string buf;
+ CrashAndGetMicrodump(mappings, MicrodumpExtraInfo(), &buf);
+ ASSERT_TRUE(ContainsMicrodump(buf));
- ASSERT_TRUE(WriteMicrodump(child, &context, sizeof(context), mappings));
+#ifdef __LP64__
+ ASSERT_NE(std::string::npos,
+ buf.find("M 0000000000001000 000000000000002A 0000000000001000 "
+ "33221100554477668899AABBCCDDEEFF0 libfoo.so"));
+#else
+ ASSERT_NE(std::string::npos,
+ buf.find("M 00001000 0000002A 00001000 "
+ "33221100554477668899AABBCCDDEEFF0 libfoo.so"));
+#endif
- // Revert stderr back to the console.
- dup2(save_err, STDERR_FILENO);
- close(save_err);
+ // In absence of a product info in the minidump, the writer should just write
+ // an unknown marker.
+ ASSERT_NE(std::string::npos, buf.find("V UNKNOWN:0.0.0.0"));
+}
- // Read back the stderr file and check for the microdump marker.
- fsync(err_fd);
- lseek(err_fd, 0, SEEK_SET);
- const size_t kBufSize = 64 * 1024;
- scoped_array<char> buf(new char[kBufSize]);
- ASSERT_GT(read(err_fd, buf.get(), kBufSize), 0);
+// Ensure that no output occurs if the interest region is set, but
+// doesn't overlap anything on the stack.
+TEST(MicrodumpWriterTest, NoOutputIfUninteresting) {
+ const char kProductInfo[] = "MockProduct:42.0.2311.99";
+ const char kBuildFingerprint[] =
+ "aosp/occam/mako:5.1.1/LMY47W/12345678:userdegbug/dev-keys";
+ const char kGPUFingerprint[] =
+ "Qualcomm;Adreno (TM) 330;OpenGL ES 3.0 V@104.0 AU@ (GIT@Id3510ff6dc)";
+ const MicrodumpExtraInfo kMicrodumpExtraInfo(
+ MakeMicrodumpExtraInfo(kBuildFingerprint, kProductInfo, kGPUFingerprint));
- ASSERT_NE(static_cast<char*>(0), strstr(
- buf.get(), "-----BEGIN BREAKPAD MICRODUMP-----"));
- ASSERT_NE(static_cast<char*>(0), strstr(
- buf.get(), "-----END BREAKPAD MICRODUMP-----"));
+ std::string buf;
+ MappingList no_mappings;
-#ifdef __LP64__
- ASSERT_NE(static_cast<char*>(0), strstr(
- buf.get(), "M 0000000000001000 000000000000002A 0000000000001000 "
- "33221100554477668899AABBCCDDEEFF0 libfoo.so"));
-#else
- ASSERT_NE(static_cast<char*>(0), strstr(
- buf.get(), "M 00001000 0000002A 00001000 "
- "33221100554477668899AABBCCDDEEFF0 libfoo.so"));
-#endif
+ CrashAndGetMicrodump(no_mappings, kMicrodumpExtraInfo, &buf, true, 0);
+ ASSERT_FALSE(ContainsMicrodump(buf));
+}
- close(err_fd);
- close(fds[1]);
+// Ensure that stack content does not contain an identifiable string if the
+// stack is sanitized.
+TEST(MicrodumpWriterTest, StringRemovedBySanitization) {
+ const char kProductInfo[] = "MockProduct:42.0.2311.99";
+ const char kBuildFingerprint[] =
+ "aosp/occam/mako:5.1.1/LMY47W/12345678:userdegbug/dev-keys";
+ const char kGPUFingerprint[] =
+ "Qualcomm;Adreno (TM) 330;OpenGL ES 3.0 V@104.0 AU@ (GIT@Id3510ff6dc)";
+
+ const MicrodumpExtraInfo kMicrodumpExtraInfo(
+ MakeMicrodumpExtraInfo(kBuildFingerprint, kProductInfo, kGPUFingerprint));
+
+ std::string buf;
+ MappingList no_mappings;
+
+ CrashAndGetMicrodump(no_mappings, kMicrodumpExtraInfo, &buf, false, 0u, true);
+ ASSERT_TRUE(ContainsMicrodump(buf));
+ ASSERT_FALSE(MicrodumpStackContains(buf, kIdentifiableString));
+}
+
+// Ensure that stack content does contain an identifiable string if the
+// stack is not sanitized.
+TEST(MicrodumpWriterTest, StringPresentIfNotSanitized) {
+ const char kProductInfo[] = "MockProduct:42.0.2311.99";
+ const char kBuildFingerprint[] =
+ "aosp/occam/mako:5.1.1/LMY47W/12345678:userdegbug/dev-keys";
+ const char kGPUFingerprint[] =
+ "Qualcomm;Adreno (TM) 330;OpenGL ES 3.0 V@104.0 AU@ (GIT@Id3510ff6dc)";
+
+ const MicrodumpExtraInfo kMicrodumpExtraInfo(
+ MakeMicrodumpExtraInfo(kBuildFingerprint, kProductInfo, kGPUFingerprint));
+
+ std::string buf;
+ MappingList no_mappings;
+
+ CrashAndGetMicrodump(no_mappings, kMicrodumpExtraInfo, &buf, false, 0u, false);
+ ASSERT_TRUE(ContainsMicrodump(buf));
+ ASSERT_TRUE(MicrodumpStackContains(buf, kIdentifiableString));
+}
+
+// Ensure that output occurs if the interest region is set, and
+// does overlap something on the stack.
+TEST(MicrodumpWriterTest, OutputIfInteresting) {
+ const char kProductInfo[] = "MockProduct:42.0.2311.99";
+ const char kBuildFingerprint[] =
+ "aosp/occam/mako:5.1.1/LMY47W/12345678:userdegbug/dev-keys";
+ const char kGPUFingerprint[] =
+ "Qualcomm;Adreno (TM) 330;OpenGL ES 3.0 V@104.0 AU@ (GIT@Id3510ff6dc)";
+
+ const MicrodumpExtraInfo kMicrodumpExtraInfo(
+ MakeMicrodumpExtraInfo(kBuildFingerprint, kProductInfo, kGPUFingerprint));
+
+ std::string buf;
+ MappingList no_mappings;
+
+ CrashAndGetMicrodump(no_mappings, kMicrodumpExtraInfo, &buf, true,
+ reinterpret_cast<uintptr_t>(CrashAndGetMicrodump));
+ ASSERT_TRUE(ContainsMicrodump(buf));
}
+// Ensure that the product info and build fingerprint metadata show up in the
+// final microdump if present.
+TEST(MicrodumpWriterTest, BuildFingerprintAndProductInfo) {
+ const char kProductInfo[] = "MockProduct:42.0.2311.99";
+ const char kBuildFingerprint[] =
+ "aosp/occam/mako:5.1.1/LMY47W/12345678:userdegbug/dev-keys";
+ const char kGPUFingerprint[] =
+ "Qualcomm;Adreno (TM) 330;OpenGL ES 3.0 V@104.0 AU@ (GIT@Id3510ff6dc)";
+ const MicrodumpExtraInfo kMicrodumpExtraInfo(
+ MakeMicrodumpExtraInfo(kBuildFingerprint, kProductInfo, kGPUFingerprint));
+ std::string buf;
+ MappingList no_mappings;
+
+ CrashAndGetMicrodump(no_mappings, kMicrodumpExtraInfo, &buf);
+ ASSERT_TRUE(ContainsMicrodump(buf));
+ CheckMicrodumpContents(buf, kMicrodumpExtraInfo);
+}
+
+TEST(MicrodumpWriterTest, NoProductInfo) {
+ const char kBuildFingerprint[] = "foobar";
+ const char kGPUFingerprint[] = "bazqux";
+ std::string buf;
+ MappingList no_mappings;
+
+ const MicrodumpExtraInfo kMicrodumpExtraInfoNoProductInfo(
+ MakeMicrodumpExtraInfo(kBuildFingerprint, NULL, kGPUFingerprint));
+
+ CrashAndGetMicrodump(no_mappings, kMicrodumpExtraInfoNoProductInfo, &buf);
+ ASSERT_TRUE(ContainsMicrodump(buf));
+ CheckMicrodumpContents(buf, kBuildFingerprint, "UNKNOWN:0.0.0.0",
+ kGPUFingerprint);
+}
+
+TEST(MicrodumpWriterTest, NoGPUInfo) {
+ const char kProductInfo[] = "bazqux";
+ const char kBuildFingerprint[] = "foobar";
+ std::string buf;
+ MappingList no_mappings;
+
+ const MicrodumpExtraInfo kMicrodumpExtraInfoNoGPUInfo(
+ MakeMicrodumpExtraInfo(kBuildFingerprint, kProductInfo, NULL));
+
+ CrashAndGetMicrodump(no_mappings, kMicrodumpExtraInfoNoGPUInfo, &buf);
+ ASSERT_TRUE(ContainsMicrodump(buf));
+ CheckMicrodumpContents(buf, kBuildFingerprint, kProductInfo, "UNKNOWN");
+}
} // namespace
diff --git a/src/client/linux/minidump_writer/linux_core_dumper.cc b/src/client/linux/minidump_writer/linux_core_dumper.cc
index b8d90af6..41506898 100644
--- a/src/client/linux/minidump_writer/linux_core_dumper.cc
+++ b/src/client/linux/minidump_writer/linux_core_dumper.cc
@@ -38,15 +38,21 @@
#include <stdio.h>
#include <string.h>
#include <sys/procfs.h>
+#if defined(__mips__) && defined(__ANDROID__)
+// To get register definitions.
+#include <asm/reg.h>
+#endif
+#include "common/linux/elf_gnu_compat.h"
#include "common/linux/linux_libc_support.h"
namespace google_breakpad {
LinuxCoreDumper::LinuxCoreDumper(pid_t pid,
const char* core_path,
- const char* procfs_path)
- : LinuxDumper(pid),
+ const char* procfs_path,
+ const char* root_prefix)
+ : LinuxDumper(pid, root_prefix),
core_path_(core_path),
procfs_path_(procfs_path),
thread_infos_(&allocator_, 8) {
@@ -105,7 +111,7 @@ bool LinuxCoreDumper::GetThreadInfoByIndex(size_t index, ThreadInfo* info) {
memcpy(&stack_pointer, &info->regs.sp, sizeof(info->regs.sp));
#elif defined(__mips__)
stack_pointer =
- reinterpret_cast<uint8_t*>(info->regs.regs[MD_CONTEXT_MIPS_REG_SP]);
+ reinterpret_cast<uint8_t*>(info->mcontext.gregs[MD_CONTEXT_MIPS_REG_SP]);
#else
#error "This code hasn't been ported to your platform yet."
#endif
@@ -160,6 +166,7 @@ bool LinuxCoreDumper::EnumerateThreads() {
// -------------------------------------------------------------------
// 1st thread CORE NT_PRSTATUS
// process-wide CORE NT_PRPSINFO
+ // process-wide CORE NT_SIGINFO
// process-wide CORE NT_AUXV
// 1st thread CORE NT_FPREGSET
// 1st thread LINUX NT_PRXFPREG
@@ -191,27 +198,70 @@ bool LinuxCoreDumper::EnumerateThreads() {
info.tgid = status->pr_pgrp;
info.ppid = status->pr_ppid;
#if defined(__mips__)
+#if defined(__ANDROID__)
+ for (int i = EF_R0; i <= EF_R31; i++)
+ info.mcontext.gregs[i - EF_R0] = status->pr_reg[i];
+#else // __ANDROID__
for (int i = EF_REG0; i <= EF_REG31; i++)
- info.regs.regs[i - EF_REG0] = status->pr_reg[i];
-
- info.regs.lo = status->pr_reg[EF_LO];
- info.regs.hi = status->pr_reg[EF_HI];
- info.regs.epc = status->pr_reg[EF_CP0_EPC];
- info.regs.badvaddr = status->pr_reg[EF_CP0_BADVADDR];
- info.regs.status = status->pr_reg[EF_CP0_STATUS];
- info.regs.cause = status->pr_reg[EF_CP0_CAUSE];
-#else
+ info.mcontext.gregs[i - EF_REG0] = status->pr_reg[i];
+#endif // __ANDROID__
+ info.mcontext.mdlo = status->pr_reg[EF_LO];
+ info.mcontext.mdhi = status->pr_reg[EF_HI];
+ info.mcontext.pc = status->pr_reg[EF_CP0_EPC];
+#else // __mips__
memcpy(&info.regs, status->pr_reg, sizeof(info.regs));
-#endif
+#endif // __mips__
if (first_thread) {
crash_thread_ = pid;
crash_signal_ = status->pr_info.si_signo;
+ crash_signal_code_ = status->pr_info.si_code;
}
first_thread = false;
threads_.push_back(pid);
thread_infos_.push_back(info);
break;
}
+ case NT_SIGINFO: {
+ if (description.length() != sizeof(siginfo_t)) {
+ fprintf(stderr, "Found NT_SIGINFO descriptor of unexpected size\n");
+ return false;
+ }
+
+ const siginfo_t* info =
+ reinterpret_cast<const siginfo_t*>(description.data());
+
+ // Set crash_address when si_addr is valid for the signal.
+ switch (info->si_signo) {
+ case MD_EXCEPTION_CODE_LIN_SIGBUS:
+ case MD_EXCEPTION_CODE_LIN_SIGFPE:
+ case MD_EXCEPTION_CODE_LIN_SIGILL:
+ case MD_EXCEPTION_CODE_LIN_SIGSEGV:
+ case MD_EXCEPTION_CODE_LIN_SIGSYS:
+ case MD_EXCEPTION_CODE_LIN_SIGTRAP:
+ crash_address_ = reinterpret_cast<uintptr_t>(info->si_addr);
+ break;
+ }
+
+ // Set crash_exception_info for common signals. Since exception info is
+ // unsigned, but some of these fields might be signed, we always cast.
+ switch (info->si_signo) {
+ case MD_EXCEPTION_CODE_LIN_SIGKILL:
+ set_crash_exception_info({
+ static_cast<uint64_t>(info->si_pid),
+ static_cast<uint64_t>(info->si_uid),
+ });
+ break;
+ case MD_EXCEPTION_CODE_LIN_SIGSYS:
+#ifdef si_syscall
+ set_crash_exception_info({
+ static_cast<uint64_t>(info->si_syscall),
+ static_cast<uint64_t>(info->si_arch),
+ });
+#endif
+ break;
+ }
+ break;
+ }
#if defined(__i386) || defined(__x86_64)
case NT_FPREGSET: {
if (thread_infos_.empty())
diff --git a/src/client/linux/minidump_writer/linux_core_dumper.h b/src/client/linux/minidump_writer/linux_core_dumper.h
index 8537896e..8a7c924b 100644
--- a/src/client/linux/minidump_writer/linux_core_dumper.h
+++ b/src/client/linux/minidump_writer/linux_core_dumper.h
@@ -47,7 +47,9 @@ class LinuxCoreDumper : public LinuxDumper {
// its proc files at |procfs_path|. If |procfs_path| is a copy of
// /proc/<pid>, it should contain the following files:
// auxv, cmdline, environ, exe, maps, status
- LinuxCoreDumper(pid_t pid, const char* core_path, const char* procfs_path);
+ // See LinuxDumper for the purpose of |root_prefix|.
+ LinuxCoreDumper(pid_t pid, const char* core_path, const char* procfs_path,
+ const char* root_prefix = "");
// Implements LinuxDumper::BuildProcPath().
// Builds a proc path for a certain pid for a node (/proc/<pid>/<node>).
diff --git a/src/client/linux/minidump_writer/linux_core_dumper_unittest.cc b/src/client/linux/minidump_writer/linux_core_dumper_unittest.cc
index 8f6a423e..77448031 100644
--- a/src/client/linux/minidump_writer/linux_core_dumper_unittest.cc
+++ b/src/client/linux/minidump_writer/linux_core_dumper_unittest.cc
@@ -39,6 +39,16 @@
using namespace google_breakpad;
+TEST(LinuxCoreDumperTest, GetMappingAbsolutePath) {
+ const LinuxCoreDumper dumper(getpid(), "core", "/tmp", "/mnt/root");
+ const MappingInfo mapping = {0, 0, {0, 0}, 0, false, "/usr/lib/libc.so"};
+
+ char path[PATH_MAX];
+ dumper.GetMappingAbsolutePath(mapping, path);
+
+ EXPECT_STREQ("/mnt/root/usr/lib/libc.so", path);
+}
+
TEST(LinuxCoreDumperTest, BuildProcPath) {
const pid_t pid = getpid();
const char procfs_path[] = "/procfs_copy";
@@ -84,7 +94,7 @@ TEST(LinuxCoreDumperTest, VerifyDumpWithMultipleThreads) {
struct stat st;
if (stat(core_file.c_str(), &st) != 0) {
fprintf(stderr, "LinuxCoreDumperTest.VerifyDumpWithMultipleThreads test is "
- "skipped due to no core file being generated");
+ "skipped due to no core file being generated\n");
return;
}
#endif
@@ -99,14 +109,18 @@ TEST(LinuxCoreDumperTest, VerifyDumpWithMultipleThreads) {
EXPECT_TRUE(dumper.ThreadsSuspend());
EXPECT_TRUE(dumper.ThreadsResume());
- // LinuxCoreDumper cannot determine the crash address and thus it always
+ // Linux does not set the crash address with SIGABRT, so make sure it always
// sets the crash address to 0.
EXPECT_EQ(0U, dumper.crash_address());
EXPECT_EQ(kCrashSignal, dumper.crash_signal());
EXPECT_EQ(crash_generator.GetThreadId(kCrashThread),
dumper.crash_thread());
- EXPECT_EQ(kNumOfThreads, dumper.threads().size());
+#if defined(THREAD_SANITIZER)
+ EXPECT_GE(dumper.threads().size(), kNumOfThreads);
+#else
+ EXPECT_EQ(dumper.threads().size(), kNumOfThreads);
+#endif
for (unsigned i = 0; i < kNumOfThreads; ++i) {
ThreadInfo info;
EXPECT_TRUE(dumper.GetThreadInfoByIndex(i, &info));
@@ -116,3 +130,63 @@ TEST(LinuxCoreDumperTest, VerifyDumpWithMultipleThreads) {
EXPECT_EQ(getpid(), info.ppid);
}
}
+
+TEST(LinuxCoreDumperTest, VerifyExceptionDetails) {
+ CrashGenerator crash_generator;
+ if (!crash_generator.HasDefaultCorePattern()) {
+ fprintf(stderr, "LinuxCoreDumperTest.VerifyDumpWithMultipleThreads test "
+ "is skipped due to non-default core pattern\n");
+ return;
+ }
+
+#ifndef si_syscall
+ fprintf(stderr, "LinuxCoreDumperTest.VerifyDumpWithMultipleThreads test is "
+ "skipped due to old kernel/C library headers\n");
+ return;
+#endif
+
+ const unsigned kNumOfThreads = 2;
+ const unsigned kCrashThread = 1;
+ const int kCrashSignal = SIGSYS;
+ pid_t child_pid;
+ ASSERT_TRUE(crash_generator.CreateChildCrash(kNumOfThreads, kCrashThread,
+ kCrashSignal, &child_pid));
+
+ const string core_file = crash_generator.GetCoreFilePath();
+ const string procfs_path = crash_generator.GetDirectoryOfProcFilesCopy();
+
+#if defined(__ANDROID__)
+ struct stat st;
+ if (stat(core_file.c_str(), &st) != 0) {
+ fprintf(stderr, "LinuxCoreDumperTest.VerifyExceptionDetails test is "
+ "skipped due to no core file being generated\n");
+ return;
+ }
+#endif
+
+ LinuxCoreDumper dumper(child_pid, core_file.c_str(), procfs_path.c_str());
+
+ EXPECT_TRUE(dumper.Init());
+
+ EXPECT_TRUE(dumper.IsPostMortem());
+
+#if defined(__ANDROID__)
+ // TODO: For some reason, Android doesn't seem to pass this.
+ if (!dumper.crash_address()) {
+ fprintf(stderr, "LinuxCoreDumperTest.VerifyExceptionDetails test is "
+ "skipped due to missing signal details on Android\n");
+ return;
+ }
+#endif
+
+ // Check the exception details.
+ EXPECT_NE(0U, dumper.crash_address());
+ EXPECT_EQ(kCrashSignal, dumper.crash_signal());
+ EXPECT_EQ(crash_generator.GetThreadId(kCrashThread),
+ dumper.crash_thread());
+
+ // We check the length, but not the actual fields. We sent SIGSYS ourselves
+ // instead of the kernel, so the extended fields are garbage.
+ const std::vector<uint64_t> info(dumper.crash_exception_info());
+ EXPECT_EQ(2U, info.size());
+}
diff --git a/src/client/linux/minidump_writer/linux_dumper.cc b/src/client/linux/minidump_writer/linux_dumper.cc
index ebb008d6..ef75260e 100644
--- a/src/client/linux/minidump_writer/linux_dumper.cc
+++ b/src/client/linux/minidump_writer/linux_dumper.cc
@@ -50,11 +50,27 @@
#include "common/linux/linux_libc_support.h"
#include "common/linux/memory_mapped_file.h"
#include "common/linux/safe_readlink.h"
+#include "google_breakpad/common/minidump_exception_linux.h"
#include "third_party/lss/linux_syscall_support.h"
+#if defined(__ANDROID__)
+
+// Android packed relocations definitions are not yet available from the
+// NDK header files, so we have to provide them manually here.
+#ifndef DT_LOOS
+#define DT_LOOS 0x6000000d
+#endif
+#ifndef DT_ANDROID_REL
+static const int DT_ANDROID_REL = DT_LOOS + 2;
+#endif
+#ifndef DT_ANDROID_RELA
+static const int DT_ANDROID_RELA = DT_LOOS + 4;
+#endif
+
+#endif // __ANDROID __
+
static const char kMappedFileUnsafePrefix[] = "/dev/";
static const char kDeletedSuffix[] = " (deleted)";
-static const char kReservedFlags[] = " ---p";
inline static bool IsMappedFileOpenUnsafe(
const google_breakpad::MappingInfo& mapping) {
@@ -69,17 +85,210 @@ inline static bool IsMappedFileOpenUnsafe(
namespace google_breakpad {
+namespace {
+
+bool MappingContainsAddress(const MappingInfo& mapping, uintptr_t address) {
+ return mapping.system_mapping_info.start_addr <= address &&
+ address < mapping.system_mapping_info.end_addr;
+}
+
+#if defined(__CHROMEOS__)
+
+// Recover memory mappings before writing dump on ChromeOS
+//
+// On Linux, breakpad relies on /proc/[pid]/maps to associate symbols from
+// addresses. ChromeOS' hugepage implementation replaces some segments with
+// anonymous private pages, which is a restriction of current implementation
+// in Linux kernel at the time of writing. Thus, breakpad can no longer
+// symbolize addresses from those text segments replaced with hugepages.
+//
+// This postprocess tries to recover the mappings. Because hugepages are always
+// inserted in between some .text sections, it tries to infer the names and
+// offsets of the segments, by looking at segments immediately precede and
+// succeed them.
+//
+// For example, a text segment before hugepage optimization
+// 02001000-03002000 r-xp /opt/google/chrome/chrome
+//
+// can be broken into
+// 02001000-02200000 r-xp /opt/google/chrome/chrome
+// 02200000-03000000 r-xp
+// 03000000-03002000 r-xp /opt/google/chrome/chrome
+//
+// For more details, see:
+// crbug.com/628040 ChromeOS' use of hugepages confuses crash symbolization
+
+// Copied from CrOS' hugepage implementation, which is unlikely to change.
+// The hugepage size is 2M.
+const unsigned int kHpageShift = 21;
+const size_t kHpageSize = (1 << kHpageShift);
+const size_t kHpageMask = (~(kHpageSize - 1));
+
+// Find and merge anonymous r-xp segments with surrounding named segments.
+// There are two cases:
+
+// Case 1: curr, next
+// curr is anonymous
+// curr is r-xp
+// curr.size >= 2M
+// curr.size is a multiple of 2M.
+// next is backed by some file.
+// curr and next are contiguous.
+// offset(next) == sizeof(curr)
+void TryRecoverMappings(MappingInfo *curr, MappingInfo *next) {
+ // Merged segments are marked with size = 0.
+ if (curr->size == 0 || next->size == 0)
+ return;
+
+ if (curr->size >= kHpageSize &&
+ curr->exec &&
+ (curr->size & kHpageMask) == curr->size &&
+ (curr->start_addr & kHpageMask) == curr->start_addr &&
+ curr->name[0] == '\0' &&
+ next->name[0] != '\0' &&
+ curr->start_addr + curr->size == next->start_addr &&
+ curr->size == next->offset) {
+
+ // matched
+ my_strlcpy(curr->name, next->name, NAME_MAX);
+ if (next->exec) {
+ // (curr, next)
+ curr->size += next->size;
+ next->size = 0;
+ }
+ }
+}
+
+// Case 2: prev, curr, next
+// curr is anonymous
+// curr is r-xp
+// curr.size >= 2M
+// curr.size is a multiple of 2M.
+// next and prev are backed by the same file.
+// prev, curr and next are contiguous.
+// offset(next) == offset(prev) + sizeof(prev) + sizeof(curr)
+void TryRecoverMappings(MappingInfo *prev, MappingInfo *curr,
+ MappingInfo *next) {
+ // Merged segments are marked with size = 0.
+ if (prev->size == 0 || curr->size == 0 || next->size == 0)
+ return;
+
+ if (curr->size >= kHpageSize &&
+ curr->exec &&
+ (curr->size & kHpageMask) == curr->size &&
+ (curr->start_addr & kHpageMask) == curr->start_addr &&
+ curr->name[0] == '\0' &&
+ next->name[0] != '\0' &&
+ curr->start_addr + curr->size == next->start_addr &&
+ prev->start_addr + prev->size == curr->start_addr &&
+ my_strncmp(prev->name, next->name, NAME_MAX) == 0 &&
+ next->offset == prev->offset + prev->size + curr->size) {
+
+ // matched
+ my_strlcpy(curr->name, prev->name, NAME_MAX);
+ if (prev->exec) {
+ curr->offset = prev->offset;
+ curr->start_addr = prev->start_addr;
+ if (next->exec) {
+ // (prev, curr, next)
+ curr->size += prev->size + next->size;
+ prev->size = 0;
+ next->size = 0;
+ } else {
+ // (prev, curr), next
+ curr->size += prev->size;
+ prev->size = 0;
+ }
+ } else {
+ curr->offset = prev->offset + prev->size;
+ if (next->exec) {
+ // prev, (curr, next)
+ curr->size += next->size;
+ next->size = 0;
+ } else {
+ // prev, curr, next
+ }
+ }
+ }
+}
+
+// mappings_ is sorted excepted for the first entry.
+// This function tries to merge segemnts into the first entry,
+// then check for other sorted entries.
+// See LinuxDumper::EnumerateMappings().
+void CrOSPostProcessMappings(wasteful_vector<MappingInfo*>& mappings) {
+ // Find the candidate "next" to first segment, which is the only one that
+ // could be out-of-order.
+ size_t l = 1;
+ size_t r = mappings.size();
+ size_t next = mappings.size();
+ while (l < r) {
+ int m = (l + r) / 2;
+ if (mappings[m]->start_addr > mappings[0]->start_addr)
+ r = next = m;
+ else
+ l = m + 1;
+ }
+
+ // Shows the range that contains the entry point is
+ // [first_start_addr, first_end_addr)
+ size_t first_start_addr = mappings[0]->start_addr;
+ size_t first_end_addr = mappings[0]->start_addr + mappings[0]->size;
+
+ // Put the out-of-order segment in order.
+ std::rotate(mappings.begin(), mappings.begin() + 1, mappings.begin() + next);
+
+ // Iterate through normal, sorted cases.
+ // Normal case 1.
+ for (size_t i = 0; i < mappings.size() - 1; i++)
+ TryRecoverMappings(mappings[i], mappings[i + 1]);
+
+ // Normal case 2.
+ for (size_t i = 0; i < mappings.size() - 2; i++)
+ TryRecoverMappings(mappings[i], mappings[i + 1], mappings[i + 2]);
+
+ // Collect merged (size == 0) segments.
+ size_t f, e;
+ for (f = e = 0; e < mappings.size(); e++)
+ if (mappings[e]->size > 0)
+ mappings[f++] = mappings[e];
+ mappings.resize(f);
+
+ // The entry point is in the first mapping. We want to find the location
+ // of the entry point after merging segment. To do this, we want to find
+ // the mapping that covers the first mapping from the original mapping list.
+ // If the mapping is not in the beginning, we move it to the begining via
+ // a right rotate by using reverse iterators.
+ for (l = 0; l < mappings.size(); l++) {
+ if (mappings[l]->start_addr <= first_start_addr
+ && (mappings[l]->start_addr + mappings[l]->size >= first_end_addr))
+ break;
+ }
+ if (l > 0) {
+ r = mappings.size();
+ std::rotate(mappings.rbegin() + r - l - 1, mappings.rbegin() + r - l,
+ mappings.rend());
+ }
+}
+
+#endif // __CHROMEOS__
+
+} // namespace
+
// All interesting auvx entry types are below AT_SYSINFO_EHDR
#define AT_MAX AT_SYSINFO_EHDR
-LinuxDumper::LinuxDumper(pid_t pid)
+LinuxDumper::LinuxDumper(pid_t pid, const char* root_prefix)
: pid_(pid),
+ root_prefix_(root_prefix),
crash_address_(0),
crash_signal_(0),
+ crash_signal_code_(0),
crash_thread_(pid),
threads_(&allocator_, 8),
mappings_(&allocator_),
auxv_(&allocator_, AT_MAX + 1) {
+ assert(root_prefix_ && my_strlen(root_prefix_) < PATH_MAX);
// The passed-in size to the constructor (above) is only a hint.
// Must call .resize() to do actual initialization of the elements.
auxv_.resize(AT_MAX + 1);
@@ -92,13 +301,24 @@ bool LinuxDumper::Init() {
return ReadAuxv() && EnumerateThreads() && EnumerateMappings();
}
+bool LinuxDumper::LateInit() {
+#if defined(__ANDROID__)
+ LatePostprocessMappings();
+#endif
+
+#if defined(__CHROMEOS__)
+ CrOSPostProcessMappings(mappings_);
+#endif
+
+ return true;
+}
+
bool
LinuxDumper::ElfFileIdentifierForMapping(const MappingInfo& mapping,
bool member,
unsigned int mapping_id,
- uint8_t identifier[sizeof(MDGUID)]) {
+ wasteful_vector<uint8_t>& identifier) {
assert(!member || mapping_id < mappings_.size());
- my_memset(identifier, 0, sizeof(MDGUID));
if (IsMappedFileOpenUnsafe(mapping))
return false;
@@ -116,14 +336,9 @@ LinuxDumper::ElfFileIdentifierForMapping(const MappingInfo& mapping,
return FileID::ElfFileIdentifierFromMappedFile(linux_gate, identifier);
}
- char filename[NAME_MAX];
- size_t filename_len = my_strlen(mapping.name);
- if (filename_len >= NAME_MAX) {
- assert(false);
+ char filename[PATH_MAX];
+ if (!GetMappingAbsolutePath(mapping, filename))
return false;
- }
- my_memcpy(filename, mapping.name, filename_len);
- filename[filename_len] = '\0';
bool filename_modified = HandleDeletedFileInMapping(filename);
MemoryMappedFile mapped_file(filename, mapping.offset);
@@ -133,79 +348,111 @@ LinuxDumper::ElfFileIdentifierForMapping(const MappingInfo& mapping,
bool success =
FileID::ElfFileIdentifierFromMappedFile(mapped_file.data(), identifier);
if (success && member && filename_modified) {
- mappings_[mapping_id]->name[filename_len -
+ mappings_[mapping_id]->name[my_strlen(mapping.name) -
sizeof(kDeletedSuffix) + 1] = '\0';
}
return success;
}
-namespace {
-bool ElfFileSoNameFromMappedFile(
- const void* elf_base, char* soname, size_t soname_size) {
- if (!IsValidElf(elf_base)) {
- // Not ELF
- return false;
- }
-
- const void* segment_start;
- size_t segment_size;
- int elf_class;
- if (!FindElfSection(elf_base, ".dynamic", SHT_DYNAMIC,
- &segment_start, &segment_size, &elf_class)) {
- // No dynamic section
- return false;
- }
-
- const void* dynstr_start;
- size_t dynstr_size;
- if (!FindElfSection(elf_base, ".dynstr", SHT_STRTAB,
- &dynstr_start, &dynstr_size, &elf_class)) {
- // No dynstr section
- return false;
- }
+void LinuxDumper::SetCrashInfoFromSigInfo(const siginfo_t& siginfo) {
+ set_crash_address(reinterpret_cast<uintptr_t>(siginfo.si_addr));
+ set_crash_signal(siginfo.si_signo);
+ set_crash_signal_code(siginfo.si_code);
+}
- const ElfW(Dyn)* dynamic = static_cast<const ElfW(Dyn)*>(segment_start);
- size_t dcount = segment_size / sizeof(ElfW(Dyn));
- for (const ElfW(Dyn)* dyn = dynamic; dyn < dynamic + dcount; ++dyn) {
- if (dyn->d_tag == DT_SONAME) {
- const char* dynstr = static_cast<const char*>(dynstr_start);
- if (dyn->d_un.d_val >= dynstr_size) {
- // Beyond the end of the dynstr section
- return false;
- }
- const char* str = dynstr + dyn->d_un.d_val;
- const size_t maxsize = dynstr_size - dyn->d_un.d_val;
- my_strlcpy(soname, str, maxsize < soname_size ? maxsize : soname_size);
- return true;
- }
+const char* LinuxDumper::GetCrashSignalString() const {
+ switch (static_cast<unsigned int>(crash_signal_)) {
+ case MD_EXCEPTION_CODE_LIN_SIGHUP:
+ return "SIGHUP";
+ case MD_EXCEPTION_CODE_LIN_SIGINT:
+ return "SIGINT";
+ case MD_EXCEPTION_CODE_LIN_SIGQUIT:
+ return "SIGQUIT";
+ case MD_EXCEPTION_CODE_LIN_SIGILL:
+ return "SIGILL";
+ case MD_EXCEPTION_CODE_LIN_SIGTRAP:
+ return "SIGTRAP";
+ case MD_EXCEPTION_CODE_LIN_SIGABRT:
+ return "SIGABRT";
+ case MD_EXCEPTION_CODE_LIN_SIGBUS:
+ return "SIGBUS";
+ case MD_EXCEPTION_CODE_LIN_SIGFPE:
+ return "SIGFPE";
+ case MD_EXCEPTION_CODE_LIN_SIGKILL:
+ return "SIGKILL";
+ case MD_EXCEPTION_CODE_LIN_SIGUSR1:
+ return "SIGUSR1";
+ case MD_EXCEPTION_CODE_LIN_SIGSEGV:
+ return "SIGSEGV";
+ case MD_EXCEPTION_CODE_LIN_SIGUSR2:
+ return "SIGUSR2";
+ case MD_EXCEPTION_CODE_LIN_SIGPIPE:
+ return "SIGPIPE";
+ case MD_EXCEPTION_CODE_LIN_SIGALRM:
+ return "SIGALRM";
+ case MD_EXCEPTION_CODE_LIN_SIGTERM:
+ return "SIGTERM";
+ case MD_EXCEPTION_CODE_LIN_SIGSTKFLT:
+ return "SIGSTKFLT";
+ case MD_EXCEPTION_CODE_LIN_SIGCHLD:
+ return "SIGCHLD";
+ case MD_EXCEPTION_CODE_LIN_SIGCONT:
+ return "SIGCONT";
+ case MD_EXCEPTION_CODE_LIN_SIGSTOP:
+ return "SIGSTOP";
+ case MD_EXCEPTION_CODE_LIN_SIGTSTP:
+ return "SIGTSTP";
+ case MD_EXCEPTION_CODE_LIN_SIGTTIN:
+ return "SIGTTIN";
+ case MD_EXCEPTION_CODE_LIN_SIGTTOU:
+ return "SIGTTOU";
+ case MD_EXCEPTION_CODE_LIN_SIGURG:
+ return "SIGURG";
+ case MD_EXCEPTION_CODE_LIN_SIGXCPU:
+ return "SIGXCPU";
+ case MD_EXCEPTION_CODE_LIN_SIGXFSZ:
+ return "SIGXFSZ";
+ case MD_EXCEPTION_CODE_LIN_SIGVTALRM:
+ return "SIGVTALRM";
+ case MD_EXCEPTION_CODE_LIN_SIGPROF:
+ return "SIGPROF";
+ case MD_EXCEPTION_CODE_LIN_SIGWINCH:
+ return "SIGWINCH";
+ case MD_EXCEPTION_CODE_LIN_SIGIO:
+ return "SIGIO";
+ case MD_EXCEPTION_CODE_LIN_SIGPWR:
+ return "SIGPWR";
+ case MD_EXCEPTION_CODE_LIN_SIGSYS:
+ return "SIGSYS";
+ case MD_EXCEPTION_CODE_LIN_DUMP_REQUESTED:
+ return "DUMP_REQUESTED";
+ default:
+ return "UNKNOWN";
}
+}
- // Did not find SONAME
- return false;
+bool LinuxDumper::GetMappingAbsolutePath(const MappingInfo& mapping,
+ char path[PATH_MAX]) const {
+ return my_strlcpy(path, root_prefix_, PATH_MAX) < PATH_MAX &&
+ my_strlcat(path, mapping.name, PATH_MAX) < PATH_MAX;
}
+namespace {
// Find the shared object name (SONAME) by examining the ELF information
// for |mapping|. If the SONAME is found copy it into the passed buffer
// |soname| and return true. The size of the buffer is |soname_size|.
// The SONAME will be truncated if it is too long to fit in the buffer.
-bool ElfFileSoName(
+bool ElfFileSoName(const LinuxDumper& dumper,
const MappingInfo& mapping, char* soname, size_t soname_size) {
if (IsMappedFileOpenUnsafe(mapping)) {
// Not safe
return false;
}
- char filename[NAME_MAX];
- size_t filename_len = my_strlen(mapping.name);
- if (filename_len >= NAME_MAX) {
- assert(false);
- // name too long
+ char filename[PATH_MAX];
+ if (!dumper.GetMappingAbsolutePath(mapping, filename))
return false;
- }
-
- my_memcpy(filename, mapping.name, filename_len);
- filename[filename_len] = '\0';
MemoryMappedFile mapped_file(filename, mapping.offset);
if (!mapped_file.data() || mapped_file.size() < SELFMAG) {
@@ -219,7 +466,6 @@ bool ElfFileSoName(
} // namespace
-// static
void LinuxDumper::GetMappingEffectiveNameAndPath(const MappingInfo& mapping,
char* file_path,
size_t file_path_size,
@@ -227,17 +473,26 @@ void LinuxDumper::GetMappingEffectiveNameAndPath(const MappingInfo& mapping,
size_t file_name_size) {
my_strlcpy(file_path, mapping.name, file_path_size);
- // If an executable is mapped from a non-zero offset, this is likely because
- // the executable was loaded directly from inside an archive file (e.g., an
- // apk on Android). We try to find the name of the shared object (SONAME) by
- // looking in the file for ELF sections.
- bool mapped_from_archive = false;
- if (mapping.exec && mapping.offset != 0)
- mapped_from_archive = ElfFileSoName(mapping, file_name, file_name_size);
-
- if (mapped_from_archive) {
- // Some tools (e.g., stackwalk) extract the basename from the pathname. In
- // this case, we append the file_name to the mapped archive path as follows:
+ // Tools such as minidump_stackwalk use the name of the module to look up
+ // symbols produced by dump_syms. dump_syms will prefer to use a module's
+ // DT_SONAME as the module name, if one exists, and will fall back to the
+ // filesystem name of the module.
+
+ // Just use the filesystem name if no SONAME is present.
+ if (!ElfFileSoName(*this, mapping, file_name, file_name_size)) {
+ // file_path := /path/to/libname.so
+ // file_name := libname.so
+ const char* basename = my_strrchr(file_path, '/');
+ basename = basename == NULL ? file_path : (basename + 1);
+ my_strlcpy(file_name, basename, file_name_size);
+ return;
+ }
+
+ if (mapping.exec && mapping.offset != 0) {
+ // If an executable is mapped from a non-zero offset, this is likely because
+ // the executable was loaded directly from inside an archive file (e.g., an
+ // apk on Android).
+ // In this case, we append the file_name to the mapped archive path:
// file_name := libname.so
// file_path := /path/to/ARCHIVE.APK/libname.so
if (my_strlen(file_path) + 1 + my_strlen(file_name) < file_path_size) {
@@ -245,12 +500,15 @@ void LinuxDumper::GetMappingEffectiveNameAndPath(const MappingInfo& mapping,
my_strlcat(file_path, file_name, file_path_size);
}
} else {
- // Common case:
- // file_path := /path/to/libname.so
- // file_name := libname.so
- const char* basename = my_strrchr(file_path, '/');
- basename = basename == NULL ? file_path : (basename + 1);
- my_strlcpy(file_name, basename, file_name_size);
+ // Otherwise, replace the basename with the SONAME.
+ char* basename = const_cast<char*>(my_strrchr(file_path, '/'));
+ if (basename) {
+ my_strlcpy(basename + 1, file_name,
+ file_path_size - my_strlen(file_path) +
+ my_strlen(basename + 1));
+ } else {
+ my_strlcpy(file_path, file_name, file_path_size);
+ }
}
}
@@ -325,37 +583,29 @@ bool LinuxDumper::EnumerateMappings() {
name = kLinuxGateLibraryName;
offset = 0;
}
- // Merge adjacent mappings with the same name into one module,
- // assuming they're a single library mapped by the dynamic linker
+ // Merge adjacent mappings into one module, assuming they're a single
+ // library mapped by the dynamic linker. Do this only if their name
+ // matches and either they have the same +x protection flag, or if the
+ // previous mapping is not executable and the new one is, to handle
+ // lld's output (see crbug.com/716484).
if (name && !mappings_.empty()) {
MappingInfo* module = mappings_.back();
if ((start_addr == module->start_addr + module->size) &&
(my_strlen(name) == my_strlen(module->name)) &&
- (my_strncmp(name, module->name, my_strlen(name)) == 0)) {
- module->size = end_addr - module->start_addr;
- line_reader->PopLine(line_len);
- continue;
- }
- }
- // Also merge mappings that result from address ranges that the
- // linker reserved but which a loaded library did not use. These
- // appear as an anonymous private mapping with no access flags set
- // and which directly follow an executable mapping.
- if (!name && !mappings_.empty()) {
- MappingInfo* module = mappings_.back();
- if ((start_addr == module->start_addr + module->size) &&
- module->exec &&
- module->name[0] == '/' &&
- offset == 0 && my_strncmp(i2,
- kReservedFlags,
- sizeof(kReservedFlags) - 1) == 0) {
+ (my_strncmp(name, module->name, my_strlen(name)) == 0) &&
+ ((exec == module->exec) || (!module->exec && exec))) {
+ module->system_mapping_info.end_addr = end_addr;
module->size = end_addr - module->start_addr;
+ module->exec |= exec;
line_reader->PopLine(line_len);
continue;
}
}
MappingInfo* const module = new(allocator_) MappingInfo;
+ mappings_.push_back(module);
my_memset(module, 0, sizeof(MappingInfo));
+ module->system_mapping_info.start_addr = start_addr;
+ module->system_mapping_info.end_addr = end_addr;
module->start_addr = start_addr;
module->size = end_addr - start_addr;
module->offset = offset;
@@ -365,36 +615,144 @@ bool LinuxDumper::EnumerateMappings() {
if (l < sizeof(module->name))
my_memcpy(module->name, name, l);
}
- // If this is the entry-point mapping, and it's not already the
- // first one, then we need to make it be first. This is because
- // the minidump format assumes the first module is the one that
- // corresponds to the main executable (as codified in
- // processor/minidump.cc:MinidumpModuleList::GetMainModule()).
- if (entry_point_loc &&
- (entry_point_loc >=
- reinterpret_cast<void*>(module->start_addr)) &&
- (entry_point_loc <
- reinterpret_cast<void*>(module->start_addr+module->size)) &&
- !mappings_.empty()) {
- // push the module onto the front of the list.
- mappings_.resize(mappings_.size() + 1);
- for (size_t idx = mappings_.size() - 1; idx > 0; idx--)
- mappings_[idx] = mappings_[idx - 1];
- mappings_[0] = module;
- } else {
- mappings_.push_back(module);
- }
}
}
}
line_reader->PopLine(line_len);
}
+ if (entry_point_loc) {
+ for (size_t i = 0; i < mappings_.size(); ++i) {
+ MappingInfo* module = mappings_[i];
+
+ // If this module contains the entry-point, and it's not already the first
+ // one, then we need to make it be first. This is because the minidump
+ // format assumes the first module is the one that corresponds to the main
+ // executable (as codified in
+ // processor/minidump.cc:MinidumpModuleList::GetMainModule()).
+ if ((entry_point_loc >= reinterpret_cast<void*>(module->start_addr)) &&
+ (entry_point_loc <
+ reinterpret_cast<void*>(module->start_addr + module->size))) {
+ for (size_t j = i; j > 0; j--)
+ mappings_[j] = mappings_[j - 1];
+ mappings_[0] = module;
+ break;
+ }
+ }
+ }
+
sys_close(fd);
return !mappings_.empty();
}
+#if defined(__ANDROID__)
+
+bool LinuxDumper::GetLoadedElfHeader(uintptr_t start_addr, ElfW(Ehdr)* ehdr) {
+ CopyFromProcess(ehdr, pid_,
+ reinterpret_cast<const void*>(start_addr),
+ sizeof(*ehdr));
+ return my_memcmp(&ehdr->e_ident, ELFMAG, SELFMAG) == 0;
+}
+
+void LinuxDumper::ParseLoadedElfProgramHeaders(ElfW(Ehdr)* ehdr,
+ uintptr_t start_addr,
+ uintptr_t* min_vaddr_ptr,
+ uintptr_t* dyn_vaddr_ptr,
+ size_t* dyn_count_ptr) {
+ uintptr_t phdr_addr = start_addr + ehdr->e_phoff;
+
+ const uintptr_t max_addr = UINTPTR_MAX;
+ uintptr_t min_vaddr = max_addr;
+ uintptr_t dyn_vaddr = 0;
+ size_t dyn_count = 0;
+
+ for (size_t i = 0; i < ehdr->e_phnum; ++i) {
+ ElfW(Phdr) phdr;
+ CopyFromProcess(&phdr, pid_,
+ reinterpret_cast<const void*>(phdr_addr),
+ sizeof(phdr));
+ if (phdr.p_type == PT_LOAD && phdr.p_vaddr < min_vaddr) {
+ min_vaddr = phdr.p_vaddr;
+ }
+ if (phdr.p_type == PT_DYNAMIC) {
+ dyn_vaddr = phdr.p_vaddr;
+ dyn_count = phdr.p_memsz / sizeof(ElfW(Dyn));
+ }
+ phdr_addr += sizeof(phdr);
+ }
+
+ *min_vaddr_ptr = min_vaddr;
+ *dyn_vaddr_ptr = dyn_vaddr;
+ *dyn_count_ptr = dyn_count;
+}
+
+bool LinuxDumper::HasAndroidPackedRelocations(uintptr_t load_bias,
+ uintptr_t dyn_vaddr,
+ size_t dyn_count) {
+ uintptr_t dyn_addr = load_bias + dyn_vaddr;
+ for (size_t i = 0; i < dyn_count; ++i) {
+ ElfW(Dyn) dyn;
+ CopyFromProcess(&dyn, pid_,
+ reinterpret_cast<const void*>(dyn_addr),
+ sizeof(dyn));
+ if (dyn.d_tag == DT_ANDROID_REL || dyn.d_tag == DT_ANDROID_RELA) {
+ return true;
+ }
+ dyn_addr += sizeof(dyn);
+ }
+ return false;
+}
+
+uintptr_t LinuxDumper::GetEffectiveLoadBias(ElfW(Ehdr)* ehdr,
+ uintptr_t start_addr) {
+ uintptr_t min_vaddr = 0;
+ uintptr_t dyn_vaddr = 0;
+ size_t dyn_count = 0;
+ ParseLoadedElfProgramHeaders(ehdr, start_addr,
+ &min_vaddr, &dyn_vaddr, &dyn_count);
+ // If |min_vaddr| is non-zero and we find Android packed relocation tags,
+ // return the effective load bias.
+ if (min_vaddr != 0) {
+ const uintptr_t load_bias = start_addr - min_vaddr;
+ if (HasAndroidPackedRelocations(load_bias, dyn_vaddr, dyn_count)) {
+ return load_bias;
+ }
+ }
+ // Either |min_vaddr| is zero, or it is non-zero but we did not find the
+ // expected Android packed relocations tags.
+ return start_addr;
+}
+
+void LinuxDumper::LatePostprocessMappings() {
+ for (size_t i = 0; i < mappings_.size(); ++i) {
+ // Only consider exec mappings that indicate a file path was mapped, and
+ // where the ELF header indicates a mapped shared library.
+ MappingInfo* mapping = mappings_[i];
+ if (!(mapping->exec && mapping->name[0] == '/')) {
+ continue;
+ }
+ ElfW(Ehdr) ehdr;
+ if (!GetLoadedElfHeader(mapping->start_addr, &ehdr)) {
+ continue;
+ }
+ if (ehdr.e_type == ET_DYN) {
+ // Compute the effective load bias for this mapped library, and update
+ // the mapping to hold that rather than |start_addr|, at the same time
+ // adjusting |size| to account for the change in |start_addr|. Where
+ // the library does not contain Android packed relocations,
+ // GetEffectiveLoadBias() returns |start_addr| and the mapping entry
+ // is not changed.
+ const uintptr_t load_bias = GetEffectiveLoadBias(&ehdr,
+ mapping->start_addr);
+ mapping->size += mapping->start_addr - load_bias;
+ mapping->start_addr = load_bias;
+ }
+ }
+}
+
+#endif // __ANDROID__
+
// Get information about the stack, given the stack pointer. We don't try to
// walk the stack since we might not have all the information needed to do
// unwind. So we just grab, up to, 32k of stack.
@@ -422,6 +780,126 @@ bool LinuxDumper::GetStackInfo(const void** stack, size_t* stack_len,
return true;
}
+void LinuxDumper::SanitizeStackCopy(uint8_t* stack_copy, size_t stack_len,
+ uintptr_t stack_pointer,
+ uintptr_t sp_offset) {
+ // We optimize the search for containing mappings in three ways:
+ // 1) We expect that pointers into the stack mapping will be common, so
+ // we cache that address range.
+ // 2) The last referenced mapping is a reasonable predictor for the next
+ // referenced mapping, so we test that first.
+ // 3) We precompute a bitfield based upon bits 32:32-n of the start and
+ // stop addresses, and use that to short circuit any values that can
+ // not be pointers. (n=11)
+ const uintptr_t defaced =
+#if defined(__LP64__)
+ 0x0defaced0defaced;
+#else
+ 0x0defaced;
+#endif
+ // the bitfield length is 2^test_bits long.
+ const unsigned int test_bits = 11;
+ // byte length of the corresponding array.
+ const unsigned int array_size = 1 << (test_bits - 3);
+ const unsigned int array_mask = array_size - 1;
+ // The amount to right shift pointers by. This captures the top bits
+ // on 32 bit architectures. On 64 bit architectures this would be
+ // uninformative so we take the same range of bits.
+ const unsigned int shift = 32 - 11;
+ const MappingInfo* last_hit_mapping = nullptr;
+ const MappingInfo* hit_mapping = nullptr;
+ const MappingInfo* stack_mapping = FindMappingNoBias(stack_pointer);
+ // The magnitude below which integers are considered to be to be
+ // 'small', and not constitute a PII risk. These are included to
+ // avoid eliding useful register values.
+ const ssize_t small_int_magnitude = 4096;
+
+ char could_hit_mapping[array_size];
+ my_memset(could_hit_mapping, 0, array_size);
+
+ // Initialize the bitfield such that if the (pointer >> shift)'th
+ // bit, modulo the bitfield size, is not set then there does not
+ // exist a mapping in mappings_ that would contain that pointer.
+ for (size_t i = 0; i < mappings_.size(); ++i) {
+ if (!mappings_[i]->exec) continue;
+ // For each mapping, work out the (unmodulo'ed) range of bits to
+ // set.
+ uintptr_t start = mappings_[i]->start_addr;
+ uintptr_t end = start + mappings_[i]->size;
+ start >>= shift;
+ end >>= shift;
+ for (size_t bit = start; bit <= end; ++bit) {
+ // Set each bit in the range, applying the modulus.
+ could_hit_mapping[(bit >> 3) & array_mask] |= 1 << (bit & 7);
+ }
+ }
+
+ // Zero memory that is below the current stack pointer.
+ const uintptr_t offset =
+ (sp_offset + sizeof(uintptr_t) - 1) & ~(sizeof(uintptr_t) - 1);
+ if (offset) {
+ my_memset(stack_copy, 0, offset);
+ }
+
+ // Apply sanitization to each complete pointer-aligned word in the
+ // stack.
+ uint8_t* sp;
+ for (sp = stack_copy + offset;
+ sp <= stack_copy + stack_len - sizeof(uintptr_t);
+ sp += sizeof(uintptr_t)) {
+ uintptr_t addr;
+ my_memcpy(&addr, sp, sizeof(uintptr_t));
+ if (static_cast<intptr_t>(addr) <= small_int_magnitude &&
+ static_cast<intptr_t>(addr) >= -small_int_magnitude) {
+ continue;
+ }
+ if (stack_mapping && MappingContainsAddress(*stack_mapping, addr)) {
+ continue;
+ }
+ if (last_hit_mapping && MappingContainsAddress(*last_hit_mapping, addr)) {
+ continue;
+ }
+ uintptr_t test = addr >> shift;
+ if (could_hit_mapping[(test >> 3) & array_mask] & (1 << (test & 7)) &&
+ (hit_mapping = FindMappingNoBias(addr)) != nullptr &&
+ hit_mapping->exec) {
+ last_hit_mapping = hit_mapping;
+ continue;
+ }
+ my_memcpy(sp, &defaced, sizeof(uintptr_t));
+ }
+ // Zero any partial word at the top of the stack, if alignment is
+ // such that that is required.
+ if (sp < stack_copy + stack_len) {
+ my_memset(sp, 0, stack_copy + stack_len - sp);
+ }
+}
+
+bool LinuxDumper::StackHasPointerToMapping(const uint8_t* stack_copy,
+ size_t stack_len,
+ uintptr_t sp_offset,
+ const MappingInfo& mapping) {
+ // Loop over all stack words that would have been on the stack in
+ // the target process (i.e. are word aligned, and at addresses >=
+ // the stack pointer). Regardless of the alignment of |stack_copy|,
+ // the memory starting at |stack_copy| + |offset| represents an
+ // aligned word in the target process.
+ const uintptr_t low_addr = mapping.system_mapping_info.start_addr;
+ const uintptr_t high_addr = mapping.system_mapping_info.end_addr;
+ const uintptr_t offset =
+ (sp_offset + sizeof(uintptr_t) - 1) & ~(sizeof(uintptr_t) - 1);
+
+ for (const uint8_t* sp = stack_copy + offset;
+ sp <= stack_copy + stack_len - sizeof(uintptr_t);
+ sp += sizeof(uintptr_t)) {
+ uintptr_t addr;
+ my_memcpy(&addr, sp, sizeof(uintptr_t));
+ if (low_addr <= addr && addr <= high_addr)
+ return true;
+ }
+ return false;
+}
+
// Find the mapping which the given memory address falls in.
const MappingInfo* LinuxDumper::FindMapping(const void* address) const {
const uintptr_t addr = (uintptr_t) address;
@@ -435,6 +913,19 @@ const MappingInfo* LinuxDumper::FindMapping(const void* address) const {
return NULL;
}
+// Find the mapping which the given memory address falls in. Uses the
+// unadjusted mapping address range from the kernel, rather than the
+// biased range.
+const MappingInfo* LinuxDumper::FindMappingNoBias(uintptr_t address) const {
+ for (size_t i = 0; i < mappings_.size(); ++i) {
+ if (address >= mappings_[i]->system_mapping_info.start_addr &&
+ address < mappings_[i]->system_mapping_info.end_addr) {
+ return mappings_[i];
+ }
+ }
+ return NULL;
+}
+
bool LinuxDumper::HandleDeletedFileInMapping(char* path) const {
static const size_t kDeletedSuffixLen = sizeof(kDeletedSuffix) - 1;
@@ -450,10 +941,13 @@ bool LinuxDumper::HandleDeletedFileInMapping(char* path) const {
// Check |path| against the /proc/pid/exe 'symlink'.
char exe_link[NAME_MAX];
- char new_path[NAME_MAX];
if (!BuildProcPath(exe_link, pid_, "exe"))
return false;
- if (!SafeReadLink(exe_link, new_path))
+ MappingInfo new_mapping = {};
+ if (!SafeReadLink(exe_link, new_mapping.name))
+ return false;
+ char new_path[PATH_MAX];
+ if (!GetMappingAbsolutePath(new_mapping, new_path))
return false;
if (my_strcmp(path, new_path) != 0)
return false;
diff --git a/src/client/linux/minidump_writer/linux_dumper.h b/src/client/linux/minidump_writer/linux_dumper.h
index 87dfadb4..f4a75d90 100644
--- a/src/client/linux/minidump_writer/linux_dumper.h
+++ b/src/client/linux/minidump_writer/linux_dumper.h
@@ -38,15 +38,22 @@
#ifndef CLIENT_LINUX_MINIDUMP_WRITER_LINUX_DUMPER_H_
#define CLIENT_LINUX_MINIDUMP_WRITER_LINUX_DUMPER_H_
+#include <assert.h>
#include <elf.h>
+#if defined(__ANDROID__)
+#include <link.h>
+#endif
#include <linux/limits.h>
#include <stdint.h>
#include <sys/types.h>
#include <sys/user.h>
+#include <vector>
+
#include "client/linux/dump_writer_common/mapping_info.h"
#include "client/linux/dump_writer_common/thread_info.h"
-#include "common/memory.h"
+#include "common/linux/file_id.h"
+#include "common/memory_allocator.h"
#include "google_breakpad/common/minidump_format.h"
namespace google_breakpad {
@@ -69,13 +76,21 @@ const char kLinuxGateLibraryName[] = "linux-gate.so";
class LinuxDumper {
public:
- explicit LinuxDumper(pid_t pid);
+ // The |root_prefix| is prepended to mapping paths before opening them, which
+ // is useful if the crash originates from a chroot.
+ explicit LinuxDumper(pid_t pid, const char* root_prefix = "");
virtual ~LinuxDumper();
// Parse the data for |threads| and |mappings|.
virtual bool Init();
+ // Take any actions that could not be taken in Init(). LateInit() is
+ // called after all other caller's initialization is complete, and in
+ // particular after it has called ThreadsSuspend(), so that ptrace is
+ // available.
+ virtual bool LateInit();
+
// Return true if the dumper performs a post-mortem dump.
virtual bool IsPostMortem() const = 0;
@@ -87,10 +102,22 @@ class LinuxDumper {
// Returns true on success. One must have called |ThreadsSuspend| first.
virtual bool GetThreadInfoByIndex(size_t index, ThreadInfo* info) = 0;
+ size_t GetMainThreadIndex() const {
+ for (size_t i = 0; i < threads_.size(); ++i) {
+ if (threads_[i] == pid_) return i;
+ }
+ return -1u;
+ }
+
// These are only valid after a call to |Init|.
const wasteful_vector<pid_t> &threads() { return threads_; }
const wasteful_vector<MappingInfo*> &mappings() { return mappings_; }
const MappingInfo* FindMapping(const void* address) const;
+ // Find the mapping which the given memory address falls in. Unlike
+ // FindMapping, this method uses the unadjusted mapping address
+ // ranges from the kernel, rather than the ranges that have had the
+ // load bias applied.
+ const MappingInfo* FindMappingNoBias(uintptr_t address) const;
const wasteful_vector<elf_aux_val_t>& auxv() { return auxv_; }
// Find a block of memory to take as the stack given the top of stack pointer.
@@ -99,6 +126,32 @@ class LinuxDumper {
// stack_top: the current top of the stack
bool GetStackInfo(const void** stack, size_t* stack_len, uintptr_t stack_top);
+ // Sanitize a copy of the stack by overwriting words that are not
+ // pointers with a sentinel (0x0defaced).
+ // stack_copy: a copy of the stack to sanitize. |stack_copy| might
+ // not be word aligned, but it represents word aligned
+ // data copied from another location.
+ // stack_len: the length of the allocation pointed to by |stack_copy|.
+ // stack_pointer: the address of the stack pointer (used to locate
+ // the stack mapping, as an optimization).
+ // sp_offset: the offset relative to stack_copy that reflects the
+ // current value of the stack pointer.
+ void SanitizeStackCopy(uint8_t* stack_copy, size_t stack_len,
+ uintptr_t stack_pointer, uintptr_t sp_offset);
+
+ // Test whether |stack_copy| contains a pointer-aligned word that
+ // could be an address within a given mapping.
+ // stack_copy: a copy of the stack to check. |stack_copy| might
+ // not be word aligned, but it represents word aligned
+ // data copied from another location.
+ // stack_len: the length of the allocation pointed to by |stack_copy|.
+ // sp_offset: the offset relative to stack_copy that reflects the
+ // current value of the stack pointer.
+ // mapping: the mapping against which to test stack words.
+ bool StackHasPointerToMapping(const uint8_t* stack_copy, size_t stack_len,
+ uintptr_t sp_offset,
+ const MappingInfo& mapping);
+
PageAllocator* allocator() { return &allocator_; }
// Copy content of |length| bytes from a given process |child|,
@@ -118,7 +171,9 @@ class LinuxDumper {
bool ElfFileIdentifierForMapping(const MappingInfo& mapping,
bool member,
unsigned int mapping_id,
- uint8_t identifier[sizeof(MDGUID)]);
+ wasteful_vector<uint8_t>& identifier);
+
+ void SetCrashInfoFromSigInfo(const siginfo_t& siginfo);
uintptr_t crash_address() const { return crash_address_; }
void set_crash_address(uintptr_t crash_address) {
@@ -127,20 +182,37 @@ class LinuxDumper {
int crash_signal() const { return crash_signal_; }
void set_crash_signal(int crash_signal) { crash_signal_ = crash_signal; }
+ const char* GetCrashSignalString() const;
+
+ void set_crash_signal_code(int code) { crash_signal_code_ = code; }
+ int crash_signal_code() const { return crash_signal_code_; }
+
+ void set_crash_exception_info(const std::vector<uint64_t>& exception_info) {
+ assert(exception_info.size() <= MD_EXCEPTION_MAXIMUM_PARAMETERS);
+ crash_exception_info_ = exception_info;
+ }
+ const std::vector<uint64_t>& crash_exception_info() const {
+ return crash_exception_info_;
+ }
pid_t crash_thread() const { return crash_thread_; }
void set_crash_thread(pid_t crash_thread) { crash_thread_ = crash_thread; }
+ // Concatenates the |root_prefix_| and |mapping| path. Writes into |path| and
+ // returns true unless the string is too long.
+ bool GetMappingAbsolutePath(const MappingInfo& mapping,
+ char path[PATH_MAX]) const;
+
// Extracts the effective path and file name of from |mapping|. In most cases
// the effective name/path are just the mapping's path and basename. In some
// other cases, however, a library can be mapped from an archive (e.g., when
// loading .so libs from an apk on Android) and this method is able to
// reconstruct the original file name.
- static void GetMappingEffectiveNameAndPath(const MappingInfo& mapping,
- char* file_path,
- size_t file_path_size,
- char* file_name,
- size_t file_name_size);
+ void GetMappingEffectiveNameAndPath(const MappingInfo& mapping,
+ char* file_path,
+ size_t file_path_size,
+ char* file_name,
+ size_t file_name_size);
protected:
bool ReadAuxv();
@@ -163,12 +235,21 @@ class LinuxDumper {
// ID of the crashed process.
const pid_t pid_;
+ // Path of the root directory to which mapping paths are relative.
+ const char* const root_prefix_;
+
// Virtual address at which the process crashed.
uintptr_t crash_address_;
// Signal that terminated the crashed process.
int crash_signal_;
+ // The code associated with |crash_signal_|.
+ int crash_signal_code_;
+
+ // The additional fields associated with |crash_signal_|.
+ std::vector<uint64_t> crash_exception_info_;
+
// ID of the crashed thread.
pid_t crash_thread_;
@@ -182,6 +263,62 @@ class LinuxDumper {
// Info from /proc/<pid>/auxv
wasteful_vector<elf_aux_val_t> auxv_;
+
+#if defined(__ANDROID__)
+ private:
+ // Android M and later support packed ELF relocations in shared libraries.
+ // Packing relocations changes the vaddr of the LOAD segments, such that
+ // the effective load bias is no longer the same as the start address of
+ // the memory mapping containing the executable parts of the library. The
+ // packing is applied to the stripped library run on the target, but not to
+ // any other library, and in particular not to the library used to generate
+ // breakpad symbols. As a result, we need to adjust the |start_addr| for
+ // any mapping that results from a shared library that contains Android
+ // packed relocations, so that it properly represents the effective library
+ // load bias. The following functions support this adjustment.
+
+ // Check that a given mapping at |start_addr| is for an ELF shared library.
+ // If it is, place the ELF header in |ehdr| and return true.
+ // The first LOAD segment in an ELF shared library has offset zero, so the
+ // ELF file header is at the start of this map entry, and in already mapped
+ // memory.
+ bool GetLoadedElfHeader(uintptr_t start_addr, ElfW(Ehdr)* ehdr);
+
+ // For the ELF file mapped at |start_addr|, iterate ELF program headers to
+ // find the min vaddr of all program header LOAD segments, the vaddr for
+ // the DYNAMIC segment, and a count of DYNAMIC entries. Return values in
+ // |min_vaddr_ptr|, |dyn_vaddr_ptr|, and |dyn_count_ptr|.
+ // The program header table is also in already mapped memory.
+ void ParseLoadedElfProgramHeaders(ElfW(Ehdr)* ehdr,
+ uintptr_t start_addr,
+ uintptr_t* min_vaddr_ptr,
+ uintptr_t* dyn_vaddr_ptr,
+ size_t* dyn_count_ptr);
+
+ // Search the DYNAMIC tags for the ELF file with the given |load_bias|, and
+ // return true if the tags indicate that the file contains Android packed
+ // relocations. Dynamic tags are found at |dyn_vaddr| past the |load_bias|.
+ bool HasAndroidPackedRelocations(uintptr_t load_bias,
+ uintptr_t dyn_vaddr,
+ size_t dyn_count);
+
+ // If the ELF file mapped at |start_addr| contained Android packed
+ // relocations, return the load bias that the system linker (or Chromium
+ // crazy linker) will have used. If the file did not contain Android
+ // packed relocations, returns |start_addr|, indicating that no adjustment
+ // is necessary.
+ // The effective load bias is |start_addr| adjusted downwards by the
+ // min vaddr in the library LOAD segments.
+ uintptr_t GetEffectiveLoadBias(ElfW(Ehdr)* ehdr, uintptr_t start_addr);
+
+ // Called from LateInit(). Iterates |mappings_| and rewrites the |start_addr|
+ // field of any that represent ELF shared libraries with Android packed
+ // relocations, so that |start_addr| is the load bias that the system linker
+ // (or Chromium crazy linker) used. This value matches the addresses produced
+ // when the non-relocation-packed library is used for breakpad symbol
+ // generation.
+ void LatePostprocessMappings();
+#endif // __ANDROID__
};
} // namespace google_breakpad
diff --git a/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc b/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc
index 4ccb7201..3ad48e50 100644
--- a/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc
+++ b/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc
@@ -57,14 +57,15 @@
void *thread_function(void *data) {
int pipefd = *static_cast<int *>(data);
- volatile pid_t thread_id = syscall(__NR_gettid);
+ volatile pid_t* thread_id = new pid_t;
+ *thread_id = syscall(__NR_gettid);
// Signal parent that a thread has started.
uint8_t byte = 1;
if (write(pipefd, &byte, sizeof(byte)) != sizeof(byte)) {
perror("ERROR: parent notification failed");
return NULL;
}
- register volatile pid_t *thread_id_ptr asm(TID_PTR_REGISTER) = &thread_id;
+ register volatile pid_t *thread_id_ptr asm(TID_PTR_REGISTER) = thread_id;
while (true)
asm volatile ("" : : "r" (thread_id_ptr));
return NULL;
diff --git a/src/client/linux/minidump_writer/linux_ptrace_dumper.cc b/src/client/linux/minidump_writer/linux_ptrace_dumper.cc
index 7a2cfb9f..e3ddb81a 100644
--- a/src/client/linux/minidump_writer/linux_ptrace_dumper.cc
+++ b/src/client/linux/minidump_writer/linux_ptrace_dumper.cc
@@ -149,6 +149,50 @@ bool LinuxPtraceDumper::CopyFromProcess(void* dest, pid_t child,
return true;
}
+bool LinuxPtraceDumper::ReadRegisterSet(ThreadInfo* info, pid_t tid)
+{
+#ifdef PTRACE_GETREGSET
+ struct iovec io;
+ info->GetGeneralPurposeRegisters(&io.iov_base, &io.iov_len);
+ if (sys_ptrace(PTRACE_GETREGSET, tid, (void*)NT_PRSTATUS, (void*)&io) == -1) {
+ return false;
+ }
+
+ info->GetFloatingPointRegisters(&io.iov_base, &io.iov_len);
+ if (sys_ptrace(PTRACE_GETREGSET, tid, (void*)NT_FPREGSET, (void*)&io) == -1) {
+ return false;
+ }
+ return true;
+#else
+ return false;
+#endif
+}
+
+bool LinuxPtraceDumper::ReadRegisters(ThreadInfo* info, pid_t tid) {
+#ifdef PTRACE_GETREGS
+ void* gp_addr;
+ info->GetGeneralPurposeRegisters(&gp_addr, NULL);
+ if (sys_ptrace(PTRACE_GETREGS, tid, NULL, gp_addr) == -1) {
+ return false;
+ }
+
+#if !(defined(__ANDROID__) && defined(__ARM_EABI__))
+ // When running an arm build on an arm64 device, attempting to get the
+ // floating point registers fails. On Android, the floating point registers
+ // aren't written to the cpu context anyway, so just don't get them here.
+ // See http://crbug.com/508324
+ void* fp_addr;
+ info->GetFloatingPointRegisters(&fp_addr, NULL);
+ if (sys_ptrace(PTRACE_GETFPREGS, tid, NULL, fp_addr) == -1) {
+ return false;
+ }
+#endif // !(defined(__ANDROID__) && defined(__ARM_EABI__))
+ return true;
+#else // PTRACE_GETREGS
+ return false;
+#endif
+}
+
// Read thread info from /proc/$pid/status.
// Fill out the |tgid|, |ppid| and |pid| members of |info|. If unavailable,
// these members are set to -1. Returns true iff all three members are
@@ -188,28 +232,11 @@ bool LinuxPtraceDumper::GetThreadInfoByIndex(size_t index, ThreadInfo* info) {
if (info->ppid == -1 || info->tgid == -1)
return false;
-#ifdef PTRACE_GETREGSET
- struct iovec io;
- io.iov_base = &info->regs;
- io.iov_len = sizeof(info->regs);
- if (sys_ptrace(PTRACE_GETREGSET, tid, (void*)NT_PRSTATUS, (void*)&io) == -1) {
- return false;
- }
-
- io.iov_base = &info->fpregs;
- io.iov_len = sizeof(info->fpregs);
- if (sys_ptrace(PTRACE_GETREGSET, tid, (void*)NT_FPREGSET, (void*)&io) == -1) {
- return false;
- }
-#else
- if (sys_ptrace(PTRACE_GETREGS, tid, NULL, &info->regs) == -1) {
- return false;
- }
-
- if (sys_ptrace(PTRACE_GETFPREGS, tid, NULL, &info->fpregs) == -1) {
- return false;
+ if (!ReadRegisterSet(info, tid)) {
+ if (!ReadRegisters(info, tid)) {
+ return false;
+ }
}
-#endif
#if defined(__i386)
#if !defined(bit_FXSAVE) // e.g. Clang
@@ -241,14 +268,22 @@ bool LinuxPtraceDumper::GetThreadInfoByIndex(size_t index, ThreadInfo* info) {
#endif
#if defined(__mips__)
- for (int i = 0; i < 3; ++i) {
- sys_ptrace(PTRACE_PEEKUSER, tid,
- reinterpret_cast<void*>(DSP_BASE + (i * 2)), &info->hi[i]);
- sys_ptrace(PTRACE_PEEKUSER, tid,
- reinterpret_cast<void*>(DSP_BASE + (i * 2) + 1), &info->lo[i]);
- }
sys_ptrace(PTRACE_PEEKUSER, tid,
- reinterpret_cast<void*>(DSP_CONTROL), &info->dsp_control);
+ reinterpret_cast<void*>(PC), &info->mcontext.pc);
+ sys_ptrace(PTRACE_PEEKUSER, tid,
+ reinterpret_cast<void*>(DSP_BASE), &info->mcontext.hi1);
+ sys_ptrace(PTRACE_PEEKUSER, tid,
+ reinterpret_cast<void*>(DSP_BASE + 1), &info->mcontext.lo1);
+ sys_ptrace(PTRACE_PEEKUSER, tid,
+ reinterpret_cast<void*>(DSP_BASE + 2), &info->mcontext.hi2);
+ sys_ptrace(PTRACE_PEEKUSER, tid,
+ reinterpret_cast<void*>(DSP_BASE + 3), &info->mcontext.lo2);
+ sys_ptrace(PTRACE_PEEKUSER, tid,
+ reinterpret_cast<void*>(DSP_BASE + 4), &info->mcontext.hi3);
+ sys_ptrace(PTRACE_PEEKUSER, tid,
+ reinterpret_cast<void*>(DSP_BASE + 5), &info->mcontext.lo3);
+ sys_ptrace(PTRACE_PEEKUSER, tid,
+ reinterpret_cast<void*>(DSP_CONTROL), &info->mcontext.dsp);
#endif
const uint8_t* stack_pointer;
@@ -262,7 +297,7 @@ bool LinuxPtraceDumper::GetThreadInfoByIndex(size_t index, ThreadInfo* info) {
my_memcpy(&stack_pointer, &info->regs.sp, sizeof(info->regs.sp));
#elif defined(__mips__)
stack_pointer =
- reinterpret_cast<uint8_t*>(info->regs.regs[MD_CONTEXT_MIPS_REG_SP]);
+ reinterpret_cast<uint8_t*>(info->mcontext.gregs[MD_CONTEXT_MIPS_REG_SP]);
#else
#error "This code hasn't been ported to your platform yet."
#endif
diff --git a/src/client/linux/minidump_writer/linux_ptrace_dumper.h b/src/client/linux/minidump_writer/linux_ptrace_dumper.h
index 2ce834b0..cee58178 100644
--- a/src/client/linux/minidump_writer/linux_ptrace_dumper.h
+++ b/src/client/linux/minidump_writer/linux_ptrace_dumper.h
@@ -85,6 +85,15 @@ class LinuxPtraceDumper : public LinuxDumper {
private:
// Set to true if all threads of the crashed process are suspended.
bool threads_suspended_;
+
+ // Read the tracee's registers on kernel with PTRACE_GETREGSET support.
+ // Returns false if PTRACE_GETREGSET is not defined.
+ // Returns true on success.
+ bool ReadRegisterSet(ThreadInfo* info, pid_t tid);
+
+ // Read the tracee's registers on kernel with PTRACE_GETREGS support.
+ // Returns true on success.
+ bool ReadRegisters(ThreadInfo* info, pid_t tid);
};
} // namespace google_breakpad
diff --git a/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc b/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc
index 57202d33..ea6b9a12 100644
--- a/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc
+++ b/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc
@@ -36,13 +36,13 @@
#include <errno.h>
#include <fcntl.h>
#include <limits.h>
+#include <poll.h>
#include <unistd.h>
#include <signal.h>
#include <stdint.h>
#include <string.h>
#include <sys/mman.h>
#include <sys/prctl.h>
-#include <sys/poll.h>
#include <sys/stat.h>
#include <sys/types.h>
@@ -55,7 +55,7 @@
#include "common/linux/file_id.h"
#include "common/linux/ignore_ret.h"
#include "common/linux/safe_readlink.h"
-#include "common/memory.h"
+#include "common/memory_allocator.h"
#include "common/using_std_string.h"
#ifndef PR_SET_PTRACER
@@ -66,6 +66,64 @@ using namespace google_breakpad;
namespace {
+pid_t SetupChildProcess(int number_of_threads) {
+ char kNumberOfThreadsArgument[2];
+ sprintf(kNumberOfThreadsArgument, "%d", number_of_threads);
+
+ int fds[2];
+ EXPECT_NE(-1, pipe(fds));
+
+ pid_t child_pid = fork();
+ if (child_pid == 0) {
+ // In child process.
+ close(fds[0]);
+
+ string helper_path(GetHelperBinary());
+ if (helper_path.empty()) {
+ fprintf(stderr, "Couldn't find helper binary\n");
+ _exit(1);
+ }
+
+ // Pass the pipe fd and the number of threads as arguments.
+ char pipe_fd_string[8];
+ sprintf(pipe_fd_string, "%d", fds[1]);
+ execl(helper_path.c_str(),
+ "linux_dumper_unittest_helper",
+ pipe_fd_string,
+ kNumberOfThreadsArgument,
+ NULL);
+ // Kill if we get here.
+ printf("Errno from exec: %d", errno);
+ std::string err_str = "Exec of " + helper_path + " failed";
+ perror(err_str.c_str());
+ _exit(1);
+ }
+ close(fds[1]);
+
+ // Wait for all child threads to indicate that they have started
+ for (int threads = 0; threads < number_of_threads; threads++) {
+ struct pollfd pfd;
+ memset(&pfd, 0, sizeof(pfd));
+ pfd.fd = fds[0];
+ pfd.events = POLLIN | POLLERR;
+
+ const int r = HANDLE_EINTR(poll(&pfd, 1, 1000));
+ EXPECT_EQ(1, r);
+ EXPECT_TRUE(pfd.revents & POLLIN);
+ uint8_t junk;
+ EXPECT_EQ(read(fds[0], &junk, sizeof(junk)),
+ static_cast<ssize_t>(sizeof(junk)));
+ }
+ close(fds[0]);
+
+ // There is a race here because we may stop a child thread before
+ // it is actually running the busy loop. Empirically this sleep
+ // is sufficient to avoid the race.
+ usleep(100000);
+ return child_pid;
+}
+
+typedef wasteful_vector<uint8_t> id_vector;
typedef testing::Test LinuxPtraceDumperTest;
/* Fixture for running tests in a child process. */
@@ -86,8 +144,8 @@ class LinuxPtraceDumperChildTest : public testing::Test {
if (child_pid_ == 0) {
// child process
RealTestBody();
- exit(HasFatalFailure() ? kFatalFailure :
- (HasNonfatalFailure() ? kNonFatalFailure : 0));
+ _exit(HasFatalFailure() ? kFatalFailure :
+ (HasNonfatalFailure() ? kNonFatalFailure : 0));
}
ASSERT_TRUE(child_pid_ > 0);
@@ -105,11 +163,17 @@ class LinuxPtraceDumperChildTest : public testing::Test {
* This is achieved by defining a TestBody macro further below.
*/
virtual void RealTestBody() = 0;
+
+ id_vector make_vector() {
+ return id_vector(&allocator, kDefaultBuildIdSize);
+ }
+
private:
static const int kFatalFailure = 1;
static const int kNonFatalFailure = 2;
pid_t child_pid_;
+ PageAllocator allocator;
};
} // namespace
@@ -186,7 +250,7 @@ void LinuxPtraceDumperMappingsTest::SetUp() {
helper_path_ = GetHelperBinary();
if (helper_path_.empty()) {
FAIL() << "Couldn't find helper binary";
- exit(1);
+ _exit(1);
}
// mmap two segments out of the helper binary, one
@@ -310,14 +374,15 @@ TEST_F(LinuxPtraceDumperChildTest, LinuxGateMappingID) {
// Need to suspend the child so ptrace actually works.
ASSERT_TRUE(dumper.ThreadsSuspend());
- uint8_t identifier[sizeof(MDGUID)];
+ id_vector identifier(make_vector());
ASSERT_TRUE(dumper.ElfFileIdentifierForMapping(*mappings[index],
true,
index,
identifier));
- uint8_t empty_identifier[sizeof(MDGUID)];
- memset(empty_identifier, 0, sizeof(empty_identifier));
- EXPECT_NE(0, memcmp(empty_identifier, identifier, sizeof(identifier)));
+
+ id_vector empty_identifier(make_vector());
+ empty_identifier.resize(kDefaultBuildIdSize, 0);
+ EXPECT_NE(empty_identifier, identifier);
EXPECT_TRUE(dumper.ThreadsResume());
}
#endif
@@ -343,90 +408,41 @@ TEST_F(LinuxPtraceDumperChildTest, FileIDsMatch) {
}
ASSERT_TRUE(found_exe);
- uint8_t identifier1[sizeof(MDGUID)];
- uint8_t identifier2[sizeof(MDGUID)];
+ id_vector identifier1(make_vector());
+ id_vector identifier2(make_vector());
EXPECT_TRUE(dumper.ElfFileIdentifierForMapping(*mappings[i], true, i,
identifier1));
FileID fileid(exe_name);
EXPECT_TRUE(fileid.ElfFileIdentifier(identifier2));
- char identifier_string1[37];
- char identifier_string2[37];
- FileID::ConvertIdentifierToString(identifier1, identifier_string1,
- 37);
- FileID::ConvertIdentifierToString(identifier2, identifier_string2,
- 37);
- EXPECT_STREQ(identifier_string1, identifier_string2);
+
+ string identifier_string1 =
+ FileID::ConvertIdentifierToUUIDString(identifier1);
+ string identifier_string2 =
+ FileID::ConvertIdentifierToUUIDString(identifier2);
+ EXPECT_EQ(identifier_string1, identifier_string2);
}
/* Get back to normal behavior of TEST*() macros wrt TestBody. */
#undef TestBody
-// Comment out this test due to crosbug.com/6757. Only seems to
-// fail on heavily loaded buildbots and is written with timing
-// assumptions.
-#if 0
TEST(LinuxPtraceDumperTest, VerifyStackReadWithMultipleThreads) {
- static const int kNumberOfThreadsInHelperProgram = 5;
- char kNumberOfThreadsArgument[2];
- sprintf(kNumberOfThreadsArgument, "%d", kNumberOfThreadsInHelperProgram);
+ static const size_t kNumberOfThreadsInHelperProgram = 5;
- int fds[2];
- ASSERT_NE(-1, pipe(fds));
-
- pid_t child_pid = fork();
- if (child_pid == 0) {
- // In child process.
- close(fds[0]);
-
- string helper_path(GetHelperBinary());
- if (helper_path.empty()) {
- FAIL() << "Couldn't find helper binary";
- exit(1);
- }
-
- // Pass the pipe fd and the number of threads as arguments.
- char pipe_fd_string[8];
- sprintf(pipe_fd_string, "%d", fds[1]);
- execl(helper_path.c_str(),
- "linux_dumper_unittest_helper",
- pipe_fd_string,
- kNumberOfThreadsArgument,
- NULL);
- // Kill if we get here.
- printf("Errno from exec: %d", errno);
- FAIL() << "Exec of " << helper_path << " failed: " << strerror(errno);
- exit(0);
- }
- close(fds[1]);
-
- // Wait for all child threads to indicate that they have started
- for (int threads = 0; threads < kNumberOfThreadsInHelperProgram; threads++) {
- struct pollfd pfd;
- memset(&pfd, 0, sizeof(pfd));
- pfd.fd = fds[0];
- pfd.events = POLLIN | POLLERR;
-
- const int r = HANDLE_EINTR(poll(&pfd, 1, 1000));
- ASSERT_EQ(1, r);
- ASSERT_TRUE(pfd.revents & POLLIN);
- uint8_t junk;
- ASSERT_EQ(read(fds[0], &junk, sizeof(junk)),
- static_cast<ssize_t>(sizeof(junk)));
- }
- close(fds[0]);
-
- // There is a race here because we may stop a child thread before
- // it is actually running the busy loop. Empirically this sleep
- // is sufficient to avoid the race.
- usleep(100000);
+ pid_t child_pid = SetupChildProcess(kNumberOfThreadsInHelperProgram);
+ ASSERT_NE(child_pid, -1);
// Children are ready now.
LinuxPtraceDumper dumper(child_pid);
ASSERT_TRUE(dumper.Init());
- EXPECT_EQ((size_t)kNumberOfThreadsInHelperProgram, dumper.threads().size());
+#if defined(THREAD_SANITIZER)
+ EXPECT_GE(dumper.threads().size(), (size_t)kNumberOfThreadsInHelperProgram);
+#else
+ EXPECT_EQ(dumper.threads().size(), (size_t)kNumberOfThreadsInHelperProgram);
+#endif
EXPECT_TRUE(dumper.ThreadsSuspend());
ThreadInfo one_thread;
+ size_t matching_threads = 0;
for (size_t i = 0; i < dumper.threads().size(); ++i) {
EXPECT_TRUE(dumper.GetThreadInfoByIndex(i, &one_thread));
const void* stack;
@@ -445,7 +461,7 @@ TEST(LinuxPtraceDumperTest, VerifyStackReadWithMultipleThreads) {
pid_t* process_tid_location = (pid_t*)(one_thread.regs.rcx);
#elif defined(__mips__)
pid_t* process_tid_location =
- reinterpret_cast<pid_t*>(one_thread.regs.regs[1]);
+ reinterpret_cast<pid_t*>(one_thread.mcontext.gregs[1]);
#else
#error This test has not been ported to this platform.
#endif
@@ -454,8 +470,9 @@ TEST(LinuxPtraceDumperTest, VerifyStackReadWithMultipleThreads) {
dumper.threads()[i],
process_tid_location,
4);
- EXPECT_EQ(dumper.threads()[i], one_thread_id);
+ matching_threads += (dumper.threads()[i] == one_thread_id) ? 1 : 0;
}
+ EXPECT_EQ(matching_threads, kNumberOfThreadsInHelperProgram);
EXPECT_TRUE(dumper.ThreadsResume());
kill(child_pid, SIGKILL);
@@ -465,4 +482,99 @@ TEST(LinuxPtraceDumperTest, VerifyStackReadWithMultipleThreads) {
ASSERT_TRUE(WIFSIGNALED(status));
ASSERT_EQ(SIGKILL, WTERMSIG(status));
}
+
+TEST_F(LinuxPtraceDumperTest, SanitizeStackCopy) {
+ static const size_t kNumberOfThreadsInHelperProgram = 1;
+
+ pid_t child_pid = SetupChildProcess(kNumberOfThreadsInHelperProgram);
+ ASSERT_NE(child_pid, -1);
+
+ LinuxPtraceDumper dumper(child_pid);
+ ASSERT_TRUE(dumper.Init());
+ EXPECT_TRUE(dumper.ThreadsSuspend());
+
+ ThreadInfo thread_info;
+ EXPECT_TRUE(dumper.GetThreadInfoByIndex(0, &thread_info));
+
+ const uintptr_t defaced =
+#if defined(__LP64__)
+ 0x0defaced0defaced;
+#else
+ 0x0defaced;
+#endif
+
+ uintptr_t simulated_stack[2];
+
+ // Pointers into the stack shouldn't be sanitized.
+ memset(simulated_stack, 0xff, sizeof(simulated_stack));
+ simulated_stack[1] = thread_info.stack_pointer;
+ dumper.SanitizeStackCopy(reinterpret_cast<uint8_t*>(&simulated_stack),
+ sizeof(simulated_stack), thread_info.stack_pointer,
+ sizeof(uintptr_t));
+ ASSERT_NE(simulated_stack[1], defaced);
+
+ // Memory prior to the stack pointer should be cleared.
+ ASSERT_EQ(simulated_stack[0], 0u);
+
+ // Small integers should not be sanitized.
+ for (int i = -4096; i <= 4096; ++i) {
+ memset(simulated_stack, 0, sizeof(simulated_stack));
+ simulated_stack[0] = static_cast<uintptr_t>(i);
+ dumper.SanitizeStackCopy(reinterpret_cast<uint8_t*>(&simulated_stack),
+ sizeof(simulated_stack), thread_info.stack_pointer,
+ 0u);
+ ASSERT_NE(simulated_stack[0], defaced);
+ }
+
+ // The instruction pointer definitely should point into an executable mapping.
+ const MappingInfo* mapping_info = dumper.FindMappingNoBias(
+ reinterpret_cast<uintptr_t>(thread_info.GetInstructionPointer()));
+ ASSERT_NE(mapping_info, nullptr);
+ ASSERT_TRUE(mapping_info->exec);
+
+ // Pointers to code shouldn't be sanitized.
+ memset(simulated_stack, 0, sizeof(simulated_stack));
+ simulated_stack[1] = thread_info.GetInstructionPointer();
+ dumper.SanitizeStackCopy(reinterpret_cast<uint8_t*>(&simulated_stack),
+ sizeof(simulated_stack), thread_info.stack_pointer,
+ 0u);
+ ASSERT_NE(simulated_stack[0], defaced);
+
+ // String fragments should be sanitized.
+ memcpy(simulated_stack, "abcdefghijklmnop", sizeof(simulated_stack));
+ dumper.SanitizeStackCopy(reinterpret_cast<uint8_t*>(&simulated_stack),
+ sizeof(simulated_stack), thread_info.stack_pointer,
+ 0u);
+ ASSERT_EQ(simulated_stack[0], defaced);
+ ASSERT_EQ(simulated_stack[1], defaced);
+
+ // Heap pointers should be sanititzed.
+#if defined(__ARM_EABI__)
+ uintptr_t heap_addr = thread_info.regs.uregs[3];
+#elif defined(__aarch64__)
+ uintptr_t heap_addr = thread_info.regs.regs[3];
+#elif defined(__i386)
+ uintptr_t heap_addr = thread_info.regs.ecx;
+#elif defined(__x86_64)
+ uintptr_t heap_addr = thread_info.regs.rcx;
+#elif defined(__mips__)
+ uintptr_t heap_addr = thread_info.mcontext.gregs[1];
+#else
+#error This test has not been ported to this platform.
#endif
+ memset(simulated_stack, 0, sizeof(simulated_stack));
+ simulated_stack[0] = heap_addr;
+ dumper.SanitizeStackCopy(reinterpret_cast<uint8_t*>(&simulated_stack),
+ sizeof(simulated_stack), thread_info.stack_pointer,
+ 0u);
+ ASSERT_EQ(simulated_stack[0], defaced);
+
+ EXPECT_TRUE(dumper.ThreadsResume());
+ kill(child_pid, SIGKILL);
+
+ // Reap child.
+ int status;
+ ASSERT_NE(-1, HANDLE_EINTR(waitpid(child_pid, &status, 0)));
+ ASSERT_TRUE(WIFSIGNALED(status));
+ ASSERT_EQ(SIGKILL, WTERMSIG(status));
+}
diff --git a/src/client/linux/minidump_writer/minidump_writer.cc b/src/client/linux/minidump_writer/minidump_writer.cc
index 0414bb72..f8cdf2a1 100644
--- a/src/client/linux/minidump_writer/minidump_writer.cc
+++ b/src/client/linux/minidump_writer/minidump_writer.cc
@@ -64,7 +64,6 @@
#include <algorithm>
-#include "client/linux/dump_writer_common/seccomp_unwinder.h"
#include "client/linux/dump_writer_common/thread_info.h"
#include "client/linux/dump_writer_common/ucontext_reader.h"
#include "client/linux/handler/exception_handler.h"
@@ -74,6 +73,7 @@
#include "client/linux/minidump_writer/linux_ptrace_dumper.h"
#include "client/linux/minidump_writer/proc_cpuinfo_reader.h"
#include "client/minidump_file_writer.h"
+#include "common/linux/file_id.h"
#include "common/linux/linux_libc_support.h"
#include "common/minidump_type_helper.h"
#include "google_breakpad/common/minidump_format.h"
@@ -82,8 +82,10 @@
namespace {
using google_breakpad::AppMemoryList;
+using google_breakpad::auto_wasteful_vector;
using google_breakpad::ExceptionHandler;
using google_breakpad::CpuSet;
+using google_breakpad::kDefaultBuildIdSize;
using google_breakpad::LineReader;
using google_breakpad::LinuxDumper;
using google_breakpad::LinuxPtraceDumper;
@@ -95,7 +97,6 @@ using google_breakpad::MinidumpFileWriter;
using google_breakpad::PageAllocator;
using google_breakpad::ProcCpuInfoReader;
using google_breakpad::RawContextCPU;
-using google_breakpad::SeccompUnwinder;
using google_breakpad::ThreadInfo;
using google_breakpad::TypedMDRVA;
using google_breakpad::UContextReader;
@@ -128,6 +129,9 @@ class MinidumpWriter {
const ExceptionHandler::CrashContext* context,
const MappingList& mappings,
const AppMemoryList& appmem,
+ bool skip_stacks_if_mapping_unreferenced,
+ uintptr_t principal_mapping_address,
+ bool sanitize_stacks,
LinuxDumper* dumper)
: fd_(minidump_fd),
path_(minidump_path),
@@ -139,7 +143,12 @@ class MinidumpWriter {
minidump_size_limit_(-1),
memory_blocks_(dumper_->allocator()),
mapping_list_(mappings),
- app_memory_list_(appmem) {
+ app_memory_list_(appmem),
+ skip_stacks_if_mapping_unreferenced_(
+ skip_stacks_if_mapping_unreferenced),
+ principal_mapping_address_(principal_mapping_address),
+ principal_mapping_(nullptr),
+ sanitize_stacks_(sanitize_stacks) {
// Assert there should be either a valid fd or a valid path, not both.
assert(fd_ != -1 || minidump_path);
assert(fd_ == -1 || !minidump_path);
@@ -149,12 +158,22 @@ class MinidumpWriter {
if (!dumper_->Init())
return false;
+ if (!dumper_->ThreadsSuspend() || !dumper_->LateInit())
+ return false;
+
+ if (skip_stacks_if_mapping_unreferenced_) {
+ principal_mapping_ =
+ dumper_->FindMappingNoBias(principal_mapping_address_);
+ if (!CrashingThreadReferencesPrincipalMapping())
+ return false;
+ }
+
if (fd_ != -1)
minidump_writer_.SetFile(fd_);
else if (!minidump_writer_.Open(path_))
return false;
- return dumper_->ThreadsSuspend();
+ return true;
}
~MinidumpWriter() {
@@ -165,24 +184,63 @@ class MinidumpWriter {
dumper_->ThreadsResume();
}
+ bool CrashingThreadReferencesPrincipalMapping() {
+ if (!ucontext_ || !principal_mapping_)
+ return false;
+
+ const uintptr_t low_addr =
+ principal_mapping_->system_mapping_info.start_addr;
+ const uintptr_t high_addr =
+ principal_mapping_->system_mapping_info.end_addr;
+
+ const uintptr_t stack_pointer = UContextReader::GetStackPointer(ucontext_);
+ const uintptr_t pc = UContextReader::GetInstructionPointer(ucontext_);
+
+ if (pc >= low_addr && pc < high_addr)
+ return true;
+
+ uint8_t* stack_copy;
+ const void* stack;
+ size_t stack_len;
+
+ if (!dumper_->GetStackInfo(&stack, &stack_len, stack_pointer))
+ return false;
+
+ stack_copy = reinterpret_cast<uint8_t*>(Alloc(stack_len));
+ dumper_->CopyFromProcess(stack_copy, GetCrashThread(), stack, stack_len);
+
+ uintptr_t stack_pointer_offset =
+ stack_pointer - reinterpret_cast<uintptr_t>(stack);
+
+ return dumper_->StackHasPointerToMapping(
+ stack_copy, stack_len, stack_pointer_offset, *principal_mapping_);
+ }
+
bool Dump() {
// A minidump file contains a number of tagged streams. This is the number
// of stream which we write.
unsigned kNumWriters = 13;
- TypedMDRVA<MDRawHeader> header(&minidump_writer_);
TypedMDRVA<MDRawDirectory> dir(&minidump_writer_);
- if (!header.Allocate())
- return false;
- if (!dir.AllocateArray(kNumWriters))
- return false;
- my_memset(header.get(), 0, sizeof(MDRawHeader));
+ {
+ // Ensure the header gets flushed, as that happens in the destructor.
+ // If a crash occurs somewhere below, at least the header will be
+ // intact.
+ TypedMDRVA<MDRawHeader> header(&minidump_writer_);
+ if (!header.Allocate())
+ return false;
+
+ if (!dir.AllocateArray(kNumWriters))
+ return false;
- header.get()->signature = MD_HEADER_SIGNATURE;
- header.get()->version = MD_HEADER_VERSION;
- header.get()->time_date_stamp = time(NULL);
- header.get()->stream_count = kNumWriters;
- header.get()->stream_directory_rva = dir.position();
+ my_memset(header.get(), 0, sizeof(MDRawHeader));
+
+ header.get()->signature = MD_HEADER_SIGNATURE;
+ header.get()->version = MD_HEADER_VERSION;
+ header.get()->time_date_stamp = time(NULL);
+ header.get()->stream_count = kNumWriters;
+ header.get()->stream_directory_rva = dir.position();
+ }
unsigned dir_index = 0;
MDRawDirectory dirent;
@@ -258,30 +316,60 @@ class MinidumpWriter {
}
bool FillThreadStack(MDRawThread* thread, uintptr_t stack_pointer,
- int max_stack_len, uint8_t** stack_copy) {
+ uintptr_t pc, int max_stack_len, uint8_t** stack_copy) {
*stack_copy = NULL;
const void* stack;
size_t stack_len;
+
+ thread->stack.start_of_memory_range = stack_pointer;
+ thread->stack.memory.data_size = 0;
+ thread->stack.memory.rva = minidump_writer_.position();
+
if (dumper_->GetStackInfo(&stack, &stack_len, stack_pointer)) {
- UntypedMDRVA memory(&minidump_writer_);
if (max_stack_len >= 0 &&
stack_len > static_cast<unsigned int>(max_stack_len)) {
stack_len = max_stack_len;
+ // Skip empty chunks of length max_stack_len.
+ uintptr_t int_stack = reinterpret_cast<uintptr_t>(stack);
+ if (max_stack_len > 0) {
+ while (int_stack + max_stack_len < stack_pointer) {
+ int_stack += max_stack_len;
+ }
+ }
+ stack = reinterpret_cast<const void*>(int_stack);
}
- if (!memory.Allocate(stack_len))
- return false;
*stack_copy = reinterpret_cast<uint8_t*>(Alloc(stack_len));
dumper_->CopyFromProcess(*stack_copy, thread->thread_id, stack,
stack_len);
+
+ uintptr_t stack_pointer_offset =
+ stack_pointer - reinterpret_cast<uintptr_t>(stack);
+ if (skip_stacks_if_mapping_unreferenced_) {
+ if (!principal_mapping_) {
+ return true;
+ }
+ uintptr_t low_addr = principal_mapping_->system_mapping_info.start_addr;
+ uintptr_t high_addr = principal_mapping_->system_mapping_info.end_addr;
+ if ((pc < low_addr || pc > high_addr) &&
+ !dumper_->StackHasPointerToMapping(*stack_copy, stack_len,
+ stack_pointer_offset,
+ *principal_mapping_)) {
+ return true;
+ }
+ }
+
+ if (sanitize_stacks_) {
+ dumper_->SanitizeStackCopy(*stack_copy, stack_len, stack_pointer,
+ stack_pointer_offset);
+ }
+
+ UntypedMDRVA memory(&minidump_writer_);
+ if (!memory.Allocate(stack_len))
+ return false;
memory.Copy(*stack_copy, stack_len);
- thread->stack.start_of_memory_range =
- reinterpret_cast<uintptr_t>(stack);
+ thread->stack.start_of_memory_range = reinterpret_cast<uintptr_t>(stack);
thread->stack.memory = memory.location();
memory_blocks_.push_back(thread->stack);
- } else {
- thread->stack.start_of_memory_range = stack_pointer;
- thread->stack.memory.data_size = 0;
- thread->stack.memory.rva = minidump_writer_.position();
}
return true;
}
@@ -328,7 +416,9 @@ class MinidumpWriter {
!dumper_->IsPostMortem()) {
uint8_t* stack_copy;
const uintptr_t stack_ptr = UContextReader::GetStackPointer(ucontext_);
- if (!FillThreadStack(&thread, stack_ptr, -1, &stack_copy))
+ if (!FillThreadStack(&thread, stack_ptr,
+ UContextReader::GetInstructionPointer(ucontext_),
+ -1, &stack_copy))
return false;
// Copy 256 bytes around crashing instruction pointer to minidump.
@@ -383,8 +473,6 @@ class MinidumpWriter {
#else
UContextReader::FillCPUContext(cpu.get(), ucontext_);
#endif
- if (stack_copy)
- SeccompUnwinder::PopSeccompStackFrame(cpu.get(), thread, stack_copy);
thread.thread_context = cpu.location();
crashing_thread_context_ = cpu.location();
} else {
@@ -396,8 +484,9 @@ class MinidumpWriter {
int max_stack_len = -1; // default to no maximum for this thread
if (minidump_size_limit_ >= 0 && i >= kLimitBaseThreadCount)
max_stack_len = extra_thread_stack_len;
- if (!FillThreadStack(&thread, info.stack_pointer, max_stack_len,
- &stack_copy))
+ if (!FillThreadStack(&thread, info.stack_pointer,
+ info.GetInstructionPointer(), max_stack_len,
+ &stack_copy))
return false;
TypedMDRVA<RawContextCPU> cpu(&minidump_writer_);
@@ -405,8 +494,6 @@ class MinidumpWriter {
return false;
my_memset(cpu.get(), 0, sizeof(RawContextCPU));
info.FillCPUContext(cpu.get());
- if (stack_copy)
- SeccompUnwinder::PopSeccompStackFrame(cpu.get(), thread, stack_copy);
thread.thread_context = cpu.location();
if (dumper_->threads()[i] == GetCrashThread()) {
crashing_thread_context_ = cpu.location();
@@ -515,7 +602,7 @@ class MinidumpWriter {
continue;
MDRawModule mod;
- if (!FillRawModule(mapping, true, i, mod, NULL))
+ if (!FillRawModule(mapping, true, i, &mod, NULL))
return false;
list.CopyIndexAfterObject(j++, &mod, MD_MODULE_SIZE);
}
@@ -524,7 +611,7 @@ class MinidumpWriter {
iter != mapping_list_.end();
++iter) {
MDRawModule mod;
- if (!FillRawModule(iter->first, false, 0, mod, iter->second))
+ if (!FillRawModule(iter->first, false, 0, &mod, iter->second))
return false;
list.CopyIndexAfterObject(j++, &mod, MD_MODULE_SIZE);
}
@@ -538,52 +625,51 @@ class MinidumpWriter {
bool FillRawModule(const MappingInfo& mapping,
bool member,
unsigned int mapping_id,
- MDRawModule& mod,
+ MDRawModule* mod,
const uint8_t* identifier) {
- my_memset(&mod, 0, MD_MODULE_SIZE);
+ my_memset(mod, 0, MD_MODULE_SIZE);
- mod.base_of_image = mapping.start_addr;
- mod.size_of_image = mapping.size;
+ mod->base_of_image = mapping.start_addr;
+ mod->size_of_image = mapping.size;
- uint8_t cv_buf[MDCVInfoPDB70_minsize + NAME_MAX];
- uint8_t* cv_ptr = cv_buf;
+ auto_wasteful_vector<uint8_t, kDefaultBuildIdSize> identifier_bytes(
+ dumper_->allocator());
- const uint32_t cv_signature = MD_CVINFOPDB70_SIGNATURE;
- my_memcpy(cv_ptr, &cv_signature, sizeof(cv_signature));
- cv_ptr += sizeof(cv_signature);
- uint8_t* signature = cv_ptr;
- cv_ptr += sizeof(MDGUID);
if (identifier) {
// GUID was provided by caller.
- my_memcpy(signature, identifier, sizeof(MDGUID));
+ identifier_bytes.insert(identifier_bytes.end(),
+ identifier,
+ identifier + sizeof(MDGUID));
} else {
// Note: ElfFileIdentifierForMapping() can manipulate the |mapping.name|.
- dumper_->ElfFileIdentifierForMapping(mapping, member,
- mapping_id, signature);
+ dumper_->ElfFileIdentifierForMapping(mapping,
+ member,
+ mapping_id,
+ identifier_bytes);
}
- my_memset(cv_ptr, 0, sizeof(uint32_t)); // Set age to 0 on Linux.
- cv_ptr += sizeof(uint32_t);
- char file_name[NAME_MAX];
- char file_path[NAME_MAX];
- LinuxDumper::GetMappingEffectiveNameAndPath(
- mapping, file_path, sizeof(file_path), file_name, sizeof(file_name));
+ if (!identifier_bytes.empty()) {
+ UntypedMDRVA cv(&minidump_writer_);
+ if (!cv.Allocate(MDCVInfoELF_minsize + identifier_bytes.size()))
+ return false;
- const size_t file_name_len = my_strlen(file_name);
- UntypedMDRVA cv(&minidump_writer_);
- if (!cv.Allocate(MDCVInfoPDB70_minsize + file_name_len + 1))
- return false;
+ const uint32_t cv_signature = MD_CVINFOELF_SIGNATURE;
+ cv.Copy(&cv_signature, sizeof(cv_signature));
+ cv.Copy(cv.position() + sizeof(cv_signature), &identifier_bytes[0],
+ identifier_bytes.size());
- // Write pdb_file_name
- my_memcpy(cv_ptr, file_name, file_name_len + 1);
- cv.Copy(cv_buf, MDCVInfoPDB70_minsize + file_name_len + 1);
+ mod->cv_record = cv.location();
+ }
- mod.cv_record = cv.location();
+ char file_name[NAME_MAX];
+ char file_path[NAME_MAX];
+ dumper_->GetMappingEffectiveNameAndPath(
+ mapping, file_path, sizeof(file_path), file_name, sizeof(file_name));
MDLocationDescriptor ld;
if (!minidump_writer_.WriteString(file_path, my_strlen(file_path), &ld))
return false;
- mod.module_name_rva = ld.rva;
+ mod->module_name_rva = ld.rva;
return true;
}
@@ -616,15 +702,24 @@ class MinidumpWriter {
TypedMDRVA<MDRawExceptionStream> exc(&minidump_writer_);
if (!exc.Allocate())
return false;
- my_memset(exc.get(), 0, sizeof(MDRawExceptionStream));
+
+ MDRawExceptionStream* stream = exc.get();
+ my_memset(stream, 0, sizeof(MDRawExceptionStream));
dirent->stream_type = MD_EXCEPTION_STREAM;
dirent->location = exc.location();
- exc.get()->thread_id = GetCrashThread();
- exc.get()->exception_record.exception_code = dumper_->crash_signal();
- exc.get()->exception_record.exception_address = dumper_->crash_address();
- exc.get()->thread_context = crashing_thread_context_;
+ stream->thread_id = GetCrashThread();
+ stream->exception_record.exception_code = dumper_->crash_signal();
+ stream->exception_record.exception_flags = dumper_->crash_signal_code();
+ stream->exception_record.exception_address = dumper_->crash_address();
+ const std::vector<uint64_t> crash_exception_info =
+ dumper_->crash_exception_info();
+ stream->exception_record.number_parameters = crash_exception_info.size();
+ memcpy(stream->exception_record.exception_information,
+ crash_exception_info.data(),
+ sizeof(uint64_t) * crash_exception_info.size());
+ stream->thread_context = crashing_thread_context_;
return true;
}
@@ -690,17 +785,14 @@ class MinidumpWriter {
}
#ifdef __mips__
- if (dyn.d_tag == DT_MIPS_RLD_MAP) {
- r_debug = reinterpret_cast<struct r_debug*>(dyn.d_un.d_ptr);
- continue;
- }
+ const int32_t debug_tag = DT_MIPS_RLD_MAP;
#else
- if (dyn.d_tag == DT_DEBUG) {
+ const int32_t debug_tag = DT_DEBUG;
+#endif
+ if (dyn.d_tag == debug_tag) {
r_debug = reinterpret_cast<struct r_debug*>(dyn.d_un.d_ptr);
continue;
- }
-#endif
- else if (dyn.d_tag == DT_NULL) {
+ } else if (dyn.d_tag == DT_NULL) {
break;
}
}
@@ -826,7 +918,13 @@ class MinidumpWriter {
// processor_architecture should always be set, do this first
sys_info->processor_architecture =
#if defined(__mips__)
+# if _MIPS_SIM == _ABIO32
MD_CPU_ARCHITECTURE_MIPS;
+# elif _MIPS_SIM == _ABI64
+ MD_CPU_ARCHITECTURE_MIPS64;
+# else
+# error "This mips ABI is currently not supported (n32)"
+#endif
#elif defined(__i386__)
MD_CPU_ARCHITECTURE_X86;
#else
@@ -842,15 +940,14 @@ class MinidumpWriter {
ProcCpuInfoReader* const reader = new(allocator) ProcCpuInfoReader(fd);
const char* field;
while (reader->GetNextField(&field)) {
- for (size_t i = 0;
- i < sizeof(cpu_info_table) / sizeof(cpu_info_table[0]);
- i++) {
- CpuInfoEntry* entry = &cpu_info_table[i];
- if (i > 0 && entry->found) {
+ bool is_first_entry = true;
+ for (CpuInfoEntry& entry : cpu_info_table) {
+ if (!is_first_entry && entry.found) {
// except for the 'processor' field, ignore repeated values.
continue;
}
- if (!my_strcmp(field, entry->info_name)) {
+ is_first_entry = false;
+ if (!my_strcmp(field, entry.info_name)) {
size_t value_len;
const char* value = reader->GetValueAndLen(&value_len);
if (value_len == 0)
@@ -860,8 +957,8 @@ class MinidumpWriter {
if (my_read_decimal_ptr(&val, value) == value)
continue;
- entry->value = static_cast<int>(val);
- entry->found = true;
+ entry.value = static_cast<int>(val);
+ entry.found = true;
}
}
@@ -877,10 +974,8 @@ class MinidumpWriter {
}
// make sure we got everything we wanted
- for (size_t i = 0;
- i < sizeof(cpu_info_table) / sizeof(cpu_info_table[0]);
- i++) {
- if (!cpu_info_table[i].found) {
+ for (const CpuInfoEntry& entry : cpu_info_table) {
+ if (!entry.found) {
return false;
}
}
@@ -953,7 +1048,7 @@ class MinidumpWriter {
// processor_architecture should always be set, do this first
sys_info->processor_architecture =
#if defined(__aarch64__)
- MD_CPU_ARCHITECTURE_ARM64;
+ MD_CPU_ARCHITECTURE_ARM64_OLD;
#else
MD_CPU_ARCHITECTURE_ARM;
#endif
@@ -1016,18 +1111,15 @@ class MinidumpWriter {
new(allocator) ProcCpuInfoReader(fd);
const char* field;
while (reader->GetNextField(&field)) {
- for (size_t i = 0;
- i < sizeof(cpu_id_entries)/sizeof(cpu_id_entries[0]);
- ++i) {
- const CpuIdEntry* entry = &cpu_id_entries[i];
- if (my_strcmp(entry->field, field) != 0)
+ for (const CpuIdEntry& entry : cpu_id_entries) {
+ if (my_strcmp(entry.field, field) != 0)
continue;
uintptr_t result = 0;
const char* value = reader->GetValue();
const char* p = value;
if (value[0] == '0' && value[1] == 'x') {
p = my_read_hex_ptr(&result, value+2);
- } else if (entry->format == 'x') {
+ } else if (entry.format == 'x') {
p = my_read_hex_ptr(&result, value);
} else {
p = my_read_decimal_ptr(&result, value);
@@ -1035,8 +1127,8 @@ class MinidumpWriter {
if (p == value)
continue;
- result &= (1U << entry->bit_length)-1;
- result <<= entry->bit_lshift;
+ result &= (1U << entry.bit_length)-1;
+ result <<= entry.bit_lshift;
sys_info->cpu.arm_cpu_info.cpuid |=
static_cast<uint32_t>(result);
}
@@ -1090,7 +1182,7 @@ class MinidumpWriter {
const char* tag = value;
size_t tag_len = value_len;
const char* p = my_strchr(tag, ' ');
- if (p != NULL) {
+ if (p) {
tag_len = static_cast<size_t>(p - tag);
value += tag_len + 1;
value_len -= tag_len + 1;
@@ -1098,14 +1190,10 @@ class MinidumpWriter {
tag_len = strlen(tag);
value_len = 0;
}
- for (size_t i = 0;
- i < sizeof(cpu_features_entries)/
- sizeof(cpu_features_entries[0]);
- ++i) {
- const CpuFeaturesEntry* entry = &cpu_features_entries[i];
- if (tag_len == strlen(entry->tag) &&
- !memcmp(tag, entry->tag, tag_len)) {
- sys_info->cpu.arm_cpu_info.elf_hwcaps |= entry->hwcaps;
+ for (const CpuFeaturesEntry& entry : cpu_features_entries) {
+ if (tag_len == strlen(entry.tag) &&
+ !memcmp(tag, entry.tag, tag_len)) {
+ sys_info->cpu.arm_cpu_info.elf_hwcaps |= entry.hwcaps;
break;
}
}
@@ -1244,7 +1332,7 @@ class MinidumpWriter {
const int fd_; // File descriptor where the minidum should be written.
const char* path_; // Path to the file where the minidum should be written.
- const struct ucontext* const ucontext_; // also from the signal handler
+ const ucontext_t* const ucontext_; // also from the signal handler
#if !defined(__ARM_EABI__) && !defined(__mips__)
const google_breakpad::fpstate_t* const float_state_; // ditto
#endif
@@ -1261,6 +1349,13 @@ class MinidumpWriter {
// Additional memory regions to be included in the dump,
// provided by the caller.
const AppMemoryList& app_memory_list_;
+ // If set, skip recording any threads that do not reference the
+ // mapping containing principal_mapping_address_.
+ bool skip_stacks_if_mapping_unreferenced_;
+ uintptr_t principal_mapping_address_;
+ const MappingInfo* principal_mapping_;
+ // If true, apply stack sanitization to stored stack data.
+ bool sanitize_stacks_;
};
@@ -1270,20 +1365,22 @@ bool WriteMinidumpImpl(const char* minidump_path,
pid_t crashing_process,
const void* blob, size_t blob_size,
const MappingList& mappings,
- const AppMemoryList& appmem) {
+ const AppMemoryList& appmem,
+ bool skip_stacks_if_mapping_unreferenced,
+ uintptr_t principal_mapping_address,
+ bool sanitize_stacks) {
LinuxPtraceDumper dumper(crashing_process);
const ExceptionHandler::CrashContext* context = NULL;
if (blob) {
if (blob_size != sizeof(ExceptionHandler::CrashContext))
return false;
context = reinterpret_cast<const ExceptionHandler::CrashContext*>(blob);
- dumper.set_crash_address(
- reinterpret_cast<uintptr_t>(context->siginfo.si_addr));
- dumper.set_crash_signal(context->siginfo.si_signo);
+ dumper.SetCrashInfoFromSigInfo(context->siginfo);
dumper.set_crash_thread(context->tid);
}
MinidumpWriter writer(minidump_path, minidump_fd, context, mappings,
- appmem, &dumper);
+ appmem, skip_stacks_if_mapping_unreferenced,
+ principal_mapping_address, sanitize_stacks, &dumper);
// Set desired limit for file size of minidump (-1 means no limit).
writer.set_minidump_size_limit(minidump_size_limit);
if (!writer.Init())
@@ -1296,17 +1393,29 @@ bool WriteMinidumpImpl(const char* minidump_path,
namespace google_breakpad {
bool WriteMinidump(const char* minidump_path, pid_t crashing_process,
- const void* blob, size_t blob_size) {
+ const void* blob, size_t blob_size,
+ bool skip_stacks_if_mapping_unreferenced,
+ uintptr_t principal_mapping_address,
+ bool sanitize_stacks) {
return WriteMinidumpImpl(minidump_path, -1, -1,
crashing_process, blob, blob_size,
- MappingList(), AppMemoryList());
+ MappingList(), AppMemoryList(),
+ skip_stacks_if_mapping_unreferenced,
+ principal_mapping_address,
+ sanitize_stacks);
}
bool WriteMinidump(int minidump_fd, pid_t crashing_process,
- const void* blob, size_t blob_size) {
+ const void* blob, size_t blob_size,
+ bool skip_stacks_if_mapping_unreferenced,
+ uintptr_t principal_mapping_address,
+ bool sanitize_stacks) {
return WriteMinidumpImpl(NULL, minidump_fd, -1,
crashing_process, blob, blob_size,
- MappingList(), AppMemoryList());
+ MappingList(), AppMemoryList(),
+ skip_stacks_if_mapping_unreferenced,
+ principal_mapping_address,
+ sanitize_stacks);
}
bool WriteMinidump(const char* minidump_path, pid_t process,
@@ -1315,8 +1424,10 @@ bool WriteMinidump(const char* minidump_path, pid_t process,
// MinidumpWriter will set crash address
dumper.set_crash_signal(MD_EXCEPTION_CODE_LIN_DUMP_REQUESTED);
dumper.set_crash_thread(process_blamed_thread);
- MinidumpWriter writer(minidump_path, -1, NULL, MappingList(),
- AppMemoryList(), &dumper);
+ MappingList mapping_list;
+ AppMemoryList app_memory_list;
+ MinidumpWriter writer(minidump_path, -1, NULL, mapping_list,
+ app_memory_list, false, 0, false, &dumper);
if (!writer.Init())
return false;
return writer.Dump();
@@ -1325,46 +1436,71 @@ bool WriteMinidump(const char* minidump_path, pid_t process,
bool WriteMinidump(const char* minidump_path, pid_t crashing_process,
const void* blob, size_t blob_size,
const MappingList& mappings,
- const AppMemoryList& appmem) {
+ const AppMemoryList& appmem,
+ bool skip_stacks_if_mapping_unreferenced,
+ uintptr_t principal_mapping_address,
+ bool sanitize_stacks) {
return WriteMinidumpImpl(minidump_path, -1, -1, crashing_process,
blob, blob_size,
- mappings, appmem);
+ mappings, appmem,
+ skip_stacks_if_mapping_unreferenced,
+ principal_mapping_address,
+ sanitize_stacks);
}
bool WriteMinidump(int minidump_fd, pid_t crashing_process,
const void* blob, size_t blob_size,
const MappingList& mappings,
- const AppMemoryList& appmem) {
+ const AppMemoryList& appmem,
+ bool skip_stacks_if_mapping_unreferenced,
+ uintptr_t principal_mapping_address,
+ bool sanitize_stacks) {
return WriteMinidumpImpl(NULL, minidump_fd, -1, crashing_process,
blob, blob_size,
- mappings, appmem);
+ mappings, appmem,
+ skip_stacks_if_mapping_unreferenced,
+ principal_mapping_address,
+ sanitize_stacks);
}
bool WriteMinidump(const char* minidump_path, off_t minidump_size_limit,
pid_t crashing_process,
const void* blob, size_t blob_size,
const MappingList& mappings,
- const AppMemoryList& appmem) {
+ const AppMemoryList& appmem,
+ bool skip_stacks_if_mapping_unreferenced,
+ uintptr_t principal_mapping_address,
+ bool sanitize_stacks) {
return WriteMinidumpImpl(minidump_path, -1, minidump_size_limit,
crashing_process, blob, blob_size,
- mappings, appmem);
+ mappings, appmem,
+ skip_stacks_if_mapping_unreferenced,
+ principal_mapping_address,
+ sanitize_stacks);
}
bool WriteMinidump(int minidump_fd, off_t minidump_size_limit,
pid_t crashing_process,
const void* blob, size_t blob_size,
const MappingList& mappings,
- const AppMemoryList& appmem) {
+ const AppMemoryList& appmem,
+ bool skip_stacks_if_mapping_unreferenced,
+ uintptr_t principal_mapping_address,
+ bool sanitize_stacks) {
return WriteMinidumpImpl(NULL, minidump_fd, minidump_size_limit,
crashing_process, blob, blob_size,
- mappings, appmem);
+ mappings, appmem,
+ skip_stacks_if_mapping_unreferenced,
+ principal_mapping_address,
+ sanitize_stacks);
}
bool WriteMinidump(const char* filename,
const MappingList& mappings,
const AppMemoryList& appmem,
LinuxDumper* dumper) {
- MinidumpWriter writer(filename, -1, NULL, mappings, appmem, dumper);
+ MinidumpWriter writer(filename, -1, NULL, mappings, appmem,
+ false, 0, false, dumper);
if (!writer.Init())
return false;
return writer.Dump();
diff --git a/src/client/linux/minidump_writer/minidump_writer.h b/src/client/linux/minidump_writer/minidump_writer.h
index d13fb120..e3b0b16d 100644
--- a/src/client/linux/minidump_writer/minidump_writer.h
+++ b/src/client/linux/minidump_writer/minidump_writer.h
@@ -36,6 +36,7 @@
#include <unistd.h>
#include <list>
+#include <type_traits>
#include <utility>
#include "client/linux/minidump_writer/linux_dumper.h"
@@ -48,7 +49,7 @@ class ExceptionHandler;
#if defined(__aarch64__)
typedef struct fpsimd_context fpstate_t;
#elif !defined(__ARM_EABI__) && !defined(__mips__)
-typedef struct _libc_fpstate fpstate_t;
+typedef std::remove_pointer<fpregset_t>::type fpstate_t;
#endif
// These entries store a list of memory regions that the client wants included
@@ -78,10 +79,16 @@ typedef std::list<AppMemory> AppMemoryList;
//
// Returns true iff successful.
bool WriteMinidump(const char* minidump_path, pid_t crashing_process,
- const void* blob, size_t blob_size);
+ const void* blob, size_t blob_size,
+ bool skip_stacks_if_mapping_unreferenced = false,
+ uintptr_t principal_mapping_address = 0,
+ bool sanitize_stacks = false);
// Same as above but takes an open file descriptor instead of a path.
bool WriteMinidump(int minidump_fd, pid_t crashing_process,
- const void* blob, size_t blob_size);
+ const void* blob, size_t blob_size,
+ bool skip_stacks_if_mapping_unreferenced = false,
+ uintptr_t principal_mapping_address = 0,
+ bool sanitize_stacks = false);
// Alternate form of WriteMinidump() that works with processes that
// are not expected to have crashed. If |process_blamed_thread| is
@@ -96,23 +103,35 @@ bool WriteMinidump(const char* minidump_path, pid_t process,
bool WriteMinidump(const char* minidump_path, pid_t crashing_process,
const void* blob, size_t blob_size,
const MappingList& mappings,
- const AppMemoryList& appdata);
+ const AppMemoryList& appdata,
+ bool skip_stacks_if_mapping_unreferenced = false,
+ uintptr_t principal_mapping_address = 0,
+ bool sanitize_stacks = false);
bool WriteMinidump(int minidump_fd, pid_t crashing_process,
const void* blob, size_t blob_size,
const MappingList& mappings,
- const AppMemoryList& appdata);
+ const AppMemoryList& appdata,
+ bool skip_stacks_if_mapping_unreferenced = false,
+ uintptr_t principal_mapping_address = 0,
+ bool sanitize_stacks = false);
// These overloads also allow passing a file size limit for the minidump.
bool WriteMinidump(const char* minidump_path, off_t minidump_size_limit,
pid_t crashing_process,
const void* blob, size_t blob_size,
const MappingList& mappings,
- const AppMemoryList& appdata);
+ const AppMemoryList& appdata,
+ bool skip_stacks_if_mapping_unreferenced = false,
+ uintptr_t principal_mapping_address = 0,
+ bool sanitize_stacks = false);
bool WriteMinidump(int minidump_fd, off_t minidump_size_limit,
pid_t crashing_process,
const void* blob, size_t blob_size,
const MappingList& mappings,
- const AppMemoryList& appdata);
+ const AppMemoryList& appdata,
+ bool skip_stacks_if_mapping_unreferenced = false,
+ uintptr_t principal_mapping_address = 0,
+ bool sanitize_stacks = false);
bool WriteMinidump(const char* filename,
const MappingList& mappings,
diff --git a/src/client/linux/minidump_writer/minidump_writer_unittest.cc b/src/client/linux/minidump_writer/minidump_writer_unittest.cc
index 7dbff73f..3017a49a 100644
--- a/src/client/linux/minidump_writer/minidump_writer_unittest.cc
+++ b/src/client/linux/minidump_writer/minidump_writer_unittest.cc
@@ -28,7 +28,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <fcntl.h>
-#include <sys/poll.h>
+#include <poll.h>
#include <sys/stat.h>
#include <sys/syscall.h>
#include <sys/types.h>
@@ -42,6 +42,7 @@
#include "client/linux/minidump_writer/linux_dumper.h"
#include "client/linux/minidump_writer/minidump_writer.h"
#include "client/linux/minidump_writer/minidump_writer_unittest_utils.h"
+#include "common/linux/breakpad_getcontext.h"
#include "common/linux/eintr_wrapper.h"
#include "common/linux/file_id.h"
#include "common/linux/ignore_ret.h"
@@ -54,10 +55,6 @@
using namespace google_breakpad;
-// Length of a formatted GUID string =
-// sizeof(MDGUID) * 2 + 4 (for dashes) + 1 (null terminator)
-const int kGUIDStringSize = 37;
-
namespace {
typedef testing::Test MinidumpWriterTest;
@@ -74,7 +71,7 @@ TEST(MinidumpWriterTest, SetupWithPath) {
char b;
IGNORE_RET(HANDLE_EINTR(read(fds[0], &b, sizeof(b))));
close(fds[0]);
- syscall(__NR_exit);
+ syscall(__NR_exit_group);
}
close(fds[0]);
@@ -91,6 +88,7 @@ TEST(MinidumpWriterTest, SetupWithPath) {
ASSERT_GT(st.st_size, 0);
close(fds[1]);
+ IGNORE_EINTR(waitpid(child, nullptr, 0));
}
TEST(MinidumpWriterTest, SetupWithFD) {
@@ -103,7 +101,7 @@ TEST(MinidumpWriterTest, SetupWithFD) {
char b;
HANDLE_EINTR(read(fds[0], &b, sizeof(b)));
close(fds[0]);
- syscall(__NR_exit);
+ syscall(__NR_exit_group);
}
close(fds[0]);
@@ -121,6 +119,7 @@ TEST(MinidumpWriterTest, SetupWithFD) {
ASSERT_GT(st.st_size, 0);
close(fds[1]);
+ IGNORE_EINTR(waitpid(child, nullptr, 0));
}
// Test that mapping info can be specified when writing a minidump,
@@ -137,19 +136,7 @@ TEST(MinidumpWriterTest, MappingInfo) {
0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF
};
- char module_identifier_buffer[kGUIDStringSize];
- FileID::ConvertIdentifierToString(kModuleGUID,
- module_identifier_buffer,
- sizeof(module_identifier_buffer));
- string module_identifier(module_identifier_buffer);
- // Strip out dashes
- size_t pos;
- while ((pos = module_identifier.find('-')) != string::npos) {
- module_identifier.erase(pos, 1);
- }
- // And append a zero, because module IDs include an "age" field
- // which is always zero on Linux.
- module_identifier += "0";
+ const string module_identifier = "33221100554477668899AABBCCDDEEFF0";
// Get some memory.
char* memory =
@@ -168,7 +155,7 @@ TEST(MinidumpWriterTest, MappingInfo) {
char b;
IGNORE_RET(HANDLE_EINTR(read(fds[0], &b, sizeof(b))));
close(fds[0]);
- syscall(__NR_exit);
+ syscall(__NR_exit_group);
}
close(fds[0]);
@@ -185,6 +172,7 @@ TEST(MinidumpWriterTest, MappingInfo) {
info.start_addr = kMemoryAddress;
info.size = memory_size;
info.offset = 0;
+ info.exec = false;
strcpy(info.name, kMemoryName);
MappingList mappings;
@@ -194,7 +182,7 @@ TEST(MinidumpWriterTest, MappingInfo) {
memcpy(mapping.second, kModuleGUID, sizeof(MDGUID));
mappings.push_back(mapping);
ASSERT_TRUE(WriteMinidump(templ.c_str(), child, &context, sizeof(context),
- mappings, memory_list));
+ mappings, memory_list, false, 0, false));
// Read the minidump. Load the module list, and ensure that
// the mmap'ed |memory| is listed with the given module name
@@ -228,12 +216,208 @@ TEST(MinidumpWriterTest, MappingInfo) {
EXPECT_TRUE(minidump.SeekToStreamType(MD_LINUX_DSO_DEBUG, &len));
close(fds[1]);
+ IGNORE_EINTR(waitpid(child, nullptr, 0));
+}
+
+// Test that minidumping is skipped while writing minidumps if principal mapping
+// is not referenced.
+TEST(MinidumpWriterTest, MinidumpSkippedIfRequested) {
+ int fds[2];
+ ASSERT_NE(-1, pipe(fds));
+
+ const pid_t child = fork();
+ if (child == 0) {
+ close(fds[1]);
+ char b;
+ IGNORE_RET(HANDLE_EINTR(read(fds[0], &b, sizeof(b))));
+ close(fds[0]);
+ syscall(__NR_exit_group);
+ }
+ close(fds[0]);
+
+ ExceptionHandler::CrashContext context;
+ memset(&context, 0, sizeof(context));
+ ASSERT_EQ(0, getcontext(&context.context));
+ context.tid = child;
+
+ AutoTempDir temp_dir;
+ string templ = temp_dir.path() + kMDWriterUnitTestFileName;
+
+ // pass an invalid principal mapping address, which will force
+ // WriteMinidump to not write a minidump.
+ ASSERT_FALSE(WriteMinidump(templ.c_str(), child, &context, sizeof(context),
+ true, static_cast<uintptr_t>(0x0102030405060708ull),
+ false));
+ close(fds[1]);
+ IGNORE_EINTR(waitpid(child, nullptr, 0));
+}
+
+// Test that minidumping is skipped while writing minidumps if principal mapping
+// is not referenced.
+TEST(MinidumpWriterTest, MinidumpStacksSkippedIfRequested) {
+ int fds[2];
+ ASSERT_NE(-1, pipe(fds));
+
+ const pid_t child = fork();
+ if (child == 0) {
+ close(fds[1]);
+
+ // Create a thread that does not return, and only references libc (not the
+ // current executable). This thread should not be captured in the minidump.
+ pthread_t thread;
+ pthread_attr_t thread_attributes;
+ pthread_attr_init(&thread_attributes);
+ pthread_attr_setdetachstate(&thread_attributes, PTHREAD_CREATE_DETACHED);
+ sigset_t sigset;
+ sigemptyset(&sigset);
+ pthread_create(&thread, &thread_attributes,
+ reinterpret_cast<void* (*)(void*)>(&sigsuspend), &sigset);
+
+ char b;
+ IGNORE_RET(HANDLE_EINTR(read(fds[0], &b, sizeof(b))));
+ close(fds[0]);
+ syscall(__NR_exit_group);
+ }
+ close(fds[0]);
+
+ ExceptionHandler::CrashContext context;
+ memset(&context, 0, sizeof(context));
+ ASSERT_EQ(0, getcontext(&context.context));
+ context.tid = child;
+
+ AutoTempDir temp_dir;
+ string templ = temp_dir.path() + kMDWriterUnitTestFileName;
+
+ // Pass an invalid principal mapping address, which will force
+ // WriteMinidump to not dump any thread stacks.
+ ASSERT_TRUE(WriteMinidump(
+ templ.c_str(), child, &context, sizeof(context), true,
+ reinterpret_cast<uintptr_t>(google_breakpad::WriteFile), false));
+
+ // Read the minidump. And ensure that thread memory was dumped only for the
+ // main thread.
+ Minidump minidump(templ);
+ ASSERT_TRUE(minidump.Read());
+
+ MinidumpThreadList *threads = minidump.GetThreadList();
+ int threads_with_stacks = 0;
+ for (unsigned int i = 0; i < threads->thread_count(); ++i) {
+ MinidumpThread *thread = threads->GetThreadAtIndex(i);
+ if (thread->GetMemory()) {
+ ++threads_with_stacks;
+ }
+ }
+#if defined(THREAD_SANITIZER) || defined(ADDRESS_SANITIZER)
+ ASSERT_GE(threads_with_stacks, 1);
+#else
+ ASSERT_EQ(threads_with_stacks, 1);
+#endif
+ close(fds[1]);
+ IGNORE_EINTR(waitpid(child, nullptr, 0));
+}
+
+// Test that stacks can be sanitized while writing minidumps.
+TEST(MinidumpWriterTest, StacksAreSanitizedIfRequested) {
+ int fds[2];
+ ASSERT_NE(-1, pipe(fds));
+
+ const pid_t child = fork();
+ if (child == 0) {
+ close(fds[1]);
+ char b;
+ IGNORE_RET(HANDLE_EINTR(read(fds[0], &b, sizeof(b))));
+ close(fds[0]);
+ syscall(__NR_exit_group);
+ }
+ close(fds[0]);
+
+ ExceptionHandler::CrashContext context;
+ memset(&context, 0, sizeof(context));
+ ASSERT_EQ(0, getcontext(&context.context));
+ context.tid = child;
+
+ AutoTempDir temp_dir;
+ string templ = temp_dir.path() + kMDWriterUnitTestFileName;
+ // pass an invalid principal mapping address, which will force
+ // WriteMinidump to not dump any thread stacks.
+ ASSERT_TRUE(WriteMinidump(templ.c_str(), child, &context, sizeof(context),
+ false, 0, true));
+
+ // Read the minidump. And ensure that thread memory contains a defaced value.
+ Minidump minidump(templ);
+ ASSERT_TRUE(minidump.Read());
+
+ const uintptr_t defaced =
+#if defined(__LP64__)
+ 0x0defaced0defaced;
+#else
+ 0x0defaced;
+#endif
+ MinidumpThreadList *threads = minidump.GetThreadList();
+ for (unsigned int i = 0; i < threads->thread_count(); ++i) {
+ MinidumpThread *thread = threads->GetThreadAtIndex(i);
+ MinidumpMemoryRegion *mem = thread->GetMemory();
+ ASSERT_TRUE(mem != nullptr);
+ uint32_t sz = mem->GetSize();
+ const uint8_t *data = mem->GetMemory();
+ ASSERT_TRUE(memmem(data, sz, &defaced, sizeof(defaced)) != nullptr);
+ }
+ close(fds[1]);
+ IGNORE_EINTR(waitpid(child, nullptr, 0));
+}
+
+// Test that a binary with a longer-than-usual build id note
+// makes its way all the way through to the minidump unscathed.
+// The linux_client_unittest is linked with an explicit --build-id
+// in Makefile.am.
+TEST(MinidumpWriterTest, BuildIDLong) {
+ int fds[2];
+ ASSERT_NE(-1, pipe(fds));
+
+ const pid_t child = fork();
+ if (child == 0) {
+ close(fds[1]);
+ char b;
+ IGNORE_RET(HANDLE_EINTR(read(fds[0], &b, sizeof(b))));
+ close(fds[0]);
+ syscall(__NR_exit_group);
+ }
+ close(fds[0]);
+
+ ExceptionHandler::CrashContext context;
+ memset(&context, 0, sizeof(context));
+ ASSERT_EQ(0, getcontext(&context.context));
+ context.tid = child;
+
+ AutoTempDir temp_dir;
+ const string dump_path = temp_dir.path() + kMDWriterUnitTestFileName;
+
+ EXPECT_TRUE(WriteMinidump(dump_path.c_str(),
+ child, &context, sizeof(context)));
+ close(fds[1]);
+
+ // Read the minidump. Load the module list, and ensure that
+ // the main module has the correct debug id and code id.
+ Minidump minidump(dump_path);
+ ASSERT_TRUE(minidump.Read());
+
+ MinidumpModuleList* module_list = minidump.GetModuleList();
+ ASSERT_TRUE(module_list);
+ const MinidumpModule* module = module_list->GetMainModule();
+ ASSERT_TRUE(module);
+ const string module_identifier = "030201000504070608090A0B0C0D0E0F0";
+ // This is passed explicitly to the linker in Makefile.am
+ const string build_id =
+ "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f";
+ EXPECT_EQ(module_identifier, module->debug_identifier());
+ EXPECT_EQ(build_id, module->code_identifier());
+
+ IGNORE_EINTR(waitpid(child, nullptr, 0));
}
// Test that mapping info can be specified, and that it overrides
// existing mappings that are wholly contained within the specified
// range.
-#ifdef ENABLE_FLAKY_TESTS
TEST(MinidumpWriterTest, MappingInfoContained) {
int fds[2];
ASSERT_NE(-1, pipe(fds));
@@ -246,19 +430,7 @@ TEST(MinidumpWriterTest, MappingInfoContained) {
0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF
};
- char module_identifier_buffer[kGUIDStringSize];
- FileID::ConvertIdentifierToString(kModuleGUID,
- module_identifier_buffer,
- sizeof(module_identifier_buffer));
- string module_identifier(module_identifier_buffer);
- // Strip out dashes
- size_t pos;
- while ((pos = module_identifier.find('-')) != string::npos) {
- module_identifier.erase(pos, 1);
- }
- // And append a zero, because module IDs include an "age" field
- // which is always zero on Linux.
- module_identifier += "0";
+ const string module_identifier = "33221100554477668899AABBCCDDEEFF0";
// mmap a file
AutoTempDir temp_dir;
@@ -289,7 +461,7 @@ TEST(MinidumpWriterTest, MappingInfoContained) {
char b;
IGNORE_RET(HANDLE_EINTR(read(fds[0], &b, sizeof(b))));
close(fds[0]);
- syscall(__NR_exit);
+ syscall(__NR_exit_group);
}
close(fds[0]);
@@ -305,6 +477,7 @@ TEST(MinidumpWriterTest, MappingInfoContained) {
info.start_addr = kMemoryAddress - memory_size;
info.size = memory_size * 3;
info.offset = 0;
+ info.exec = false;
strcpy(info.name, kMemoryName);
MappingList mappings;
@@ -334,8 +507,8 @@ TEST(MinidumpWriterTest, MappingInfoContained) {
EXPECT_EQ(module_identifier, module->debug_identifier());
close(fds[1]);
+ IGNORE_EINTR(waitpid(child, nullptr, 0));
}
-#endif
TEST(MinidumpWriterTest, DeletedBinary) {
const string kNumberOfThreadsArgument = "1";
@@ -412,12 +585,10 @@ TEST(MinidumpWriterTest, DeletedBinary) {
EXPECT_STREQ(binpath.c_str(), module->code_file().c_str());
// Check that the file ID is correct.
FileID fileid(helper_path.c_str());
- uint8_t identifier[sizeof(MDGUID)];
+ PageAllocator allocator;
+ wasteful_vector<uint8_t> identifier(&allocator, kDefaultBuildIdSize);
EXPECT_TRUE(fileid.ElfFileIdentifier(identifier));
- char identifier_string[kGUIDStringSize];
- FileID::ConvertIdentifierToString(identifier,
- identifier_string,
- kGUIDStringSize);
+ string identifier_string = FileID::ConvertIdentifierToUUIDString(identifier);
string module_identifier(identifier_string);
// Strip out dashes
size_t pos;
@@ -428,6 +599,8 @@ TEST(MinidumpWriterTest, DeletedBinary) {
// which is always zero on Linux.
module_identifier += "0";
EXPECT_EQ(module_identifier, module->debug_identifier());
+
+ IGNORE_EINTR(waitpid(child_pid, nullptr, 0));
}
// Test that an additional memory region can be added to the minidump.
@@ -455,7 +628,7 @@ TEST(MinidumpWriterTest, AdditionalMemory) {
char b;
HANDLE_EINTR(read(fds[0], &b, sizeof(b)));
close(fds[0]);
- syscall(__NR_exit);
+ syscall(__NR_exit_group);
}
close(fds[0]);
@@ -500,6 +673,7 @@ TEST(MinidumpWriterTest, AdditionalMemory) {
delete[] memory;
close(fds[1]);
+ IGNORE_EINTR(waitpid(child, nullptr, 0));
}
// Test that an invalid thread stack pointer still results in a minidump.
@@ -513,7 +687,7 @@ TEST(MinidumpWriterTest, InvalidStackPointer) {
char b;
HANDLE_EINTR(read(fds[0], &b, sizeof(b)));
close(fds[0]);
- syscall(__NR_exit);
+ syscall(__NR_exit_group);
}
close(fds[0]);
@@ -579,6 +753,7 @@ TEST(MinidumpWriterTest, InvalidStackPointer) {
#endif
close(fds[1]);
+ IGNORE_EINTR(waitpid(child, nullptr, 0));
}
// Test that limiting the size of the minidump works.
@@ -753,6 +928,7 @@ TEST(MinidumpWriterTest, MinidumpSizeLimit) {
// Kill the helper program.
kill(child_pid, SIGKILL);
+ IGNORE_EINTR(waitpid(child_pid, nullptr, 0));
}
} // namespace
diff --git a/src/client/linux/sender/google_crash_report_sender.cc b/src/client/linux/sender/google_crash_report_sender.cc
index ec6c06e8..f83a0e89 100644
--- a/src/client/linux/sender/google_crash_report_sender.cc
+++ b/src/client/linux/sender/google_crash_report_sender.cc
@@ -28,9 +28,10 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "common/linux/google_crashdump_uploader.h"
-#include "third_party/linux/include/gflags/gflags.h"
#include <string>
#include <iostream>
+#include <gflags/gflags.h>
+#include <glog/logging.h>
#include "common/using_std_string.h"
diff --git a/src/client/mac/Breakpad.xcodeproj/project.pbxproj b/src/client/mac/Breakpad.xcodeproj/project.pbxproj
index 584ec5d2..10876535 100644
--- a/src/client/mac/Breakpad.xcodeproj/project.pbxproj
+++ b/src/client/mac/Breakpad.xcodeproj/project.pbxproj
@@ -52,6 +52,10 @@
3329D4ED0FA16D820007BBC5 /* Breakpad.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3329D4EC0FA16D820007BBC5 /* Breakpad.xib */; };
33880C800F9E097100817F82 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 33880C7E0F9E097100817F82 /* InfoPlist.strings */; };
4084699D0F5D9CF900FDCA37 /* crash_report_sender.icns in Resources */ = {isa = PBXBuildFile; fileRef = 4084699C0F5D9CF900FDCA37 /* crash_report_sender.icns */; };
+ 421BC5BC21110C0300B8042E /* convert_old_arm64_context.cc in Sources */ = {isa = PBXBuildFile; fileRef = 421BC5AD21110C0300B8042E /* convert_old_arm64_context.cc */; };
+ 421BC5BD21110C0300B8042E /* convert_old_arm64_context.h in Headers */ = {isa = PBXBuildFile; fileRef = 421BC5BB21110C0300B8042E /* convert_old_arm64_context.h */; };
+ 421BC5BE21110C1000B8042E /* convert_old_arm64_context.cc in Sources */ = {isa = PBXBuildFile; fileRef = 421BC5AD21110C0300B8042E /* convert_old_arm64_context.cc */; };
+ 4247E6412110D7A300482558 /* memory_allocator_unittest.cc in Sources */ = {isa = PBXBuildFile; fileRef = D244540A12439BA0009BBCE0 /* memory_allocator_unittest.cc */; };
4D61A25F14F43CFC002D5862 /* bootstrap_compat.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D61A25D14F43CFC002D5862 /* bootstrap_compat.cc */; };
4D61A26B14F43D3C002D5862 /* bootstrap_compat.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D61A25D14F43CFC002D5862 /* bootstrap_compat.cc */; };
4D61A26C14F43D42002D5862 /* bootstrap_compat.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D61A25D14F43CFC002D5862 /* bootstrap_compat.cc */; };
@@ -85,7 +89,6 @@
D244536B12426F00009BBCE0 /* minidump.cc in Sources */ = {isa = PBXBuildFile; fileRef = D244535212426EBB009BBCE0 /* minidump.cc */; };
D244536C12426F00009BBCE0 /* pathname_stripper.cc in Sources */ = {isa = PBXBuildFile; fileRef = D244535312426EBB009BBCE0 /* pathname_stripper.cc */; };
D244536D12426F00009BBCE0 /* basic_code_modules.cc in Sources */ = {isa = PBXBuildFile; fileRef = D244534F12426E98009BBCE0 /* basic_code_modules.cc */; };
- D244540B12439BA0009BBCE0 /* memory_unittest.cc in Sources */ = {isa = PBXBuildFile; fileRef = D244540A12439BA0009BBCE0 /* memory_unittest.cc */; };
D246417012BAA40E005170D0 /* exception_handler.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C536D0ECCE3FD009BE4BA /* exception_handler.cc */; };
D246417112BAA41C005170D0 /* crash_generation_client.cc in Sources */ = {isa = PBXBuildFile; fileRef = D2F9A4C6121336C7002747C1 /* crash_generation_client.cc */; };
D246417512BAA438005170D0 /* minidump_generator.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C536F0ECCE3FD009BE4BA /* minidump_generator.cc */; };
@@ -95,7 +98,7 @@
D246418812BAA4E3005170D0 /* string_utilities.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53820ECCE635009BE4BA /* string_utilities.cc */; };
D246418C12BAA508005170D0 /* minidump_file_writer.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C538F0ECCE70A009BE4BA /* minidump_file_writer.cc */; };
D246419012BAA52A005170D0 /* string_conversion.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53850ECCE6AD009BE4BA /* string_conversion.cc */; };
- D246419112BAA52F005170D0 /* convert_UTF.c in Sources */ = {isa = PBXBuildFile; fileRef = F92C53870ECCE6C0009BE4BA /* convert_UTF.c */; };
+ D246419112BAA52F005170D0 /* convert_UTF.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53870ECCE6C0009BE4BA /* convert_UTF.cc */; };
D246419512BAA54C005170D0 /* file_id.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53740ECCE635009BE4BA /* file_id.cc */; };
D246419612BAA55A005170D0 /* macho_id.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C537A0ECCE635009BE4BA /* macho_id.cc */; };
D24641A012BAA67F005170D0 /* macho_walker.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C537E0ECCE635009BE4BA /* macho_walker.cc */; };
@@ -136,7 +139,7 @@
D2F9A533121383A1002747C1 /* exception_handler.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C536D0ECCE3FD009BE4BA /* exception_handler.cc */; };
D2F9A534121383A1002747C1 /* minidump_generator.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C536F0ECCE3FD009BE4BA /* minidump_generator.cc */; };
D2F9A535121383A1002747C1 /* minidump_file_writer.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C538F0ECCE70A009BE4BA /* minidump_file_writer.cc */; };
- D2F9A536121383A1002747C1 /* convert_UTF.c in Sources */ = {isa = PBXBuildFile; fileRef = F92C53870ECCE6C0009BE4BA /* convert_UTF.c */; };
+ D2F9A536121383A1002747C1 /* convert_UTF.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53870ECCE6C0009BE4BA /* convert_UTF.cc */; };
D2F9A537121383A1002747C1 /* string_conversion.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53850ECCE6AD009BE4BA /* string_conversion.cc */; };
D2F9A538121383A1002747C1 /* file_id.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53740ECCE635009BE4BA /* file_id.cc */; };
D2F9A539121383A1002747C1 /* macho_id.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C537A0ECCE635009BE4BA /* macho_id.cc */; };
@@ -157,7 +160,7 @@
F92C55D10ECD0064009BE4BA /* Breakpad.mm in Sources */ = {isa = PBXBuildFile; fileRef = F92C55CF0ECD0064009BE4BA /* Breakpad.mm */; };
F92C56330ECD0DF1009BE4BA /* OnDemandServer.h in Headers */ = {isa = PBXBuildFile; fileRef = F92C56310ECD0DF1009BE4BA /* OnDemandServer.h */; };
F92C56340ECD0DF1009BE4BA /* OnDemandServer.mm in Sources */ = {isa = PBXBuildFile; fileRef = F92C56320ECD0DF1009BE4BA /* OnDemandServer.mm */; };
- F92C563F0ECD10CA009BE4BA /* convert_UTF.c in Sources */ = {isa = PBXBuildFile; fileRef = F92C53870ECCE6C0009BE4BA /* convert_UTF.c */; };
+ F92C563F0ECD10CA009BE4BA /* convert_UTF.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53870ECCE6C0009BE4BA /* convert_UTF.cc */; };
F92C56400ECD10CA009BE4BA /* dynamic_images.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C536B0ECCE3FD009BE4BA /* dynamic_images.cc */; };
F92C56410ECD10CA009BE4BA /* file_id.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53740ECCE635009BE4BA /* file_id.cc */; };
F92C56420ECD10CA009BE4BA /* macho_id.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C537A0ECCE635009BE4BA /* macho_id.cc */; };
@@ -180,7 +183,7 @@
F93803CE0F8083B7004D428B /* exception_handler.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C536D0ECCE3FD009BE4BA /* exception_handler.cc */; };
F93803CF0F8083B7004D428B /* minidump_generator.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C536F0ECCE3FD009BE4BA /* minidump_generator.cc */; };
F93803D00F8083B7004D428B /* minidump_file_writer.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C538F0ECCE70A009BE4BA /* minidump_file_writer.cc */; };
- F93803D10F8083B7004D428B /* convert_UTF.c in Sources */ = {isa = PBXBuildFile; fileRef = F92C53870ECCE6C0009BE4BA /* convert_UTF.c */; };
+ F93803D10F8083B7004D428B /* convert_UTF.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53870ECCE6C0009BE4BA /* convert_UTF.cc */; };
F93803D20F8083B7004D428B /* string_conversion.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53850ECCE6AD009BE4BA /* string_conversion.cc */; };
F93803D30F8083B7004D428B /* file_id.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53740ECCE635009BE4BA /* file_id.cc */; };
F93803D40F8083B7004D428B /* macho_id.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C537A0ECCE635009BE4BA /* macho_id.cc */; };
@@ -189,13 +192,13 @@
F93803D70F8083B7004D428B /* string_utilities.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53820ECCE635009BE4BA /* string_utilities.cc */; };
F93DE2D80F82A70E00608B94 /* minidump_file_writer_unittest.cc in Sources */ = {isa = PBXBuildFile; fileRef = F93DE2D70F82A70E00608B94 /* minidump_file_writer_unittest.cc */; };
F93DE2D90F82A73500608B94 /* minidump_file_writer.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C538F0ECCE70A009BE4BA /* minidump_file_writer.cc */; };
- F93DE2DA0F82A73500608B94 /* convert_UTF.c in Sources */ = {isa = PBXBuildFile; fileRef = F92C53870ECCE6C0009BE4BA /* convert_UTF.c */; };
+ F93DE2DA0F82A73500608B94 /* convert_UTF.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53870ECCE6C0009BE4BA /* convert_UTF.cc */; };
F93DE2DB0F82A73500608B94 /* string_conversion.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53850ECCE6AD009BE4BA /* string_conversion.cc */; };
F93DE3350F82C66B00608B94 /* dynamic_images.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C536B0ECCE3FD009BE4BA /* dynamic_images.cc */; };
F93DE3360F82C66B00608B94 /* exception_handler.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C536D0ECCE3FD009BE4BA /* exception_handler.cc */; };
F93DE3370F82C66B00608B94 /* minidump_generator.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C536F0ECCE3FD009BE4BA /* minidump_generator.cc */; };
F93DE3380F82C66B00608B94 /* minidump_file_writer.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C538F0ECCE70A009BE4BA /* minidump_file_writer.cc */; };
- F93DE3390F82C66B00608B94 /* convert_UTF.c in Sources */ = {isa = PBXBuildFile; fileRef = F92C53870ECCE6C0009BE4BA /* convert_UTF.c */; };
+ F93DE3390F82C66B00608B94 /* convert_UTF.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53870ECCE6C0009BE4BA /* convert_UTF.cc */; };
F93DE33A0F82C66B00608B94 /* string_conversion.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53850ECCE6AD009BE4BA /* string_conversion.cc */; };
F93DE33B0F82C66B00608B94 /* file_id.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53740ECCE635009BE4BA /* file_id.cc */; };
F93DE33C0F82C66B00608B94 /* macho_id.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C537A0ECCE635009BE4BA /* macho_id.cc */; };
@@ -577,13 +580,14 @@
3329D4EC0FA16D820007BBC5 /* Breakpad.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Breakpad.xib; path = sender/Breakpad.xib; sourceTree = "<group>"; };
33880C7F0F9E097100817F82 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = sender/English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
4084699C0F5D9CF900FDCA37 /* crash_report_sender.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = crash_report_sender.icns; path = sender/crash_report_sender.icns; sourceTree = "<group>"; };
+ 421BC5AD21110C0300B8042E /* convert_old_arm64_context.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = convert_old_arm64_context.cc; path = ../../processor/convert_old_arm64_context.cc; sourceTree = "<group>"; };
+ 421BC5BB21110C0300B8042E /* convert_old_arm64_context.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = convert_old_arm64_context.h; path = ../../processor/convert_old_arm64_context.h; sourceTree = "<group>"; };
4D61A25D14F43CFC002D5862 /* bootstrap_compat.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = bootstrap_compat.cc; path = ../../common/mac/bootstrap_compat.cc; sourceTree = SOURCE_ROOT; };
4D61A25E14F43CFC002D5862 /* bootstrap_compat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = bootstrap_compat.h; path = ../../common/mac/bootstrap_compat.h; sourceTree = SOURCE_ROOT; };
4D72CA0D13DFAD5C006CABE3 /* md5.cc */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = md5.cc; path = ../../common/md5.cc; sourceTree = SOURCE_ROOT; };
4DBE4769134A4F080072546A /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = System/Library/Frameworks/CoreServices.framework; sourceTree = SDKROOT; };
8B31007011F0CD3C00FCF3E4 /* GTMDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GTMDefines.h; path = ../../common/mac/GTMDefines.h; sourceTree = SOURCE_ROOT; };
8B3101E911F0CDE300FCF3E4 /* SenTestingKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SenTestingKit.framework; path = Library/Frameworks/SenTestingKit.framework; sourceTree = DEVELOPER_DIR; };
- 8B31022211F0CE1000FCF3E4 /* GTMGarbageCollection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GTMGarbageCollection.h; path = ../../common/mac/GTMGarbageCollection.h; sourceTree = SOURCE_ROOT; };
8B31027711F0D3AF00FCF3E4 /* BreakpadDebug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = BreakpadDebug.xcconfig; path = ../../common/mac/BreakpadDebug.xcconfig; sourceTree = SOURCE_ROOT; };
8B31027811F0D3AF00FCF3E4 /* BreakpadRelease.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = BreakpadRelease.xcconfig; path = ../../common/mac/BreakpadRelease.xcconfig; sourceTree = SOURCE_ROOT; };
8B31FFF611F0C90500FCF3E4 /* Breakpad.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Breakpad.xcconfig; path = ../../common/mac/Breakpad.xcconfig; sourceTree = SOURCE_ROOT; };
@@ -595,12 +599,12 @@
D244535112426EBB009BBCE0 /* logging.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = logging.cc; path = ../../processor/logging.cc; sourceTree = SOURCE_ROOT; };
D244535212426EBB009BBCE0 /* minidump.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = minidump.cc; path = ../../processor/minidump.cc; sourceTree = SOURCE_ROOT; };
D244535312426EBB009BBCE0 /* pathname_stripper.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = pathname_stripper.cc; path = ../../processor/pathname_stripper.cc; sourceTree = SOURCE_ROOT; };
- D244540A12439BA0009BBCE0 /* memory_unittest.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = memory_unittest.cc; path = ../../common/memory_unittest.cc; sourceTree = SOURCE_ROOT; };
+ D244540A12439BA0009BBCE0 /* memory_allocator_unittest.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = memory_allocator_unittest.cc; path = ../../common/memory_allocator_unittest.cc; sourceTree = SOURCE_ROOT; };
D2F9A3D41212F87C002747C1 /* exception_handler_test.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = exception_handler_test.cc; path = tests/exception_handler_test.cc; sourceTree = "<group>"; };
D2F9A41512131EF0002747C1 /* libgtest.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libgtest.a; sourceTree = BUILT_PRODUCTS_DIR; };
- D2F9A43C12131F55002747C1 /* gmock-all.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "gmock-all.cc"; path = "../../testing/src/gmock-all.cc"; sourceTree = SOURCE_ROOT; };
- D2F9A43E12131F65002747C1 /* gtest_main.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = gtest_main.cc; path = ../../testing/gtest/src/gtest_main.cc; sourceTree = "<group>"; };
- D2F9A43F12131F65002747C1 /* gtest-all.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "gtest-all.cc"; path = "../../testing/gtest/src/gtest-all.cc"; sourceTree = "<group>"; };
+ D2F9A43C12131F55002747C1 /* gmock-all.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "gmock-all.cc"; path = "../../testing/googlemock/src/gmock-all.cc"; sourceTree = SOURCE_ROOT; };
+ D2F9A43E12131F65002747C1 /* gtest_main.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = gtest_main.cc; path = ../../testing/googletest/src/gtest_main.cc; sourceTree = "<group>"; };
+ D2F9A43F12131F65002747C1 /* gtest-all.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "gtest-all.cc"; path = "../../testing/googletest/src/gtest-all.cc"; sourceTree = "<group>"; };
D2F9A4C4121336C7002747C1 /* client_info.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = client_info.h; path = crash_generation/client_info.h; sourceTree = "<group>"; };
D2F9A4C5121336C7002747C1 /* crash_generation_client.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = crash_generation_client.h; path = crash_generation/crash_generation_client.h; sourceTree = "<group>"; };
D2F9A4C6121336C7002747C1 /* crash_generation_client.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = crash_generation_client.cc; path = crash_generation/crash_generation_client.cc; sourceTree = "<group>"; };
@@ -664,7 +668,7 @@
F92C53830ECCE635009BE4BA /* string_utilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = string_utilities.h; path = ../../common/mac/string_utilities.h; sourceTree = SOURCE_ROOT; };
F92C53850ECCE6AD009BE4BA /* string_conversion.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = string_conversion.cc; path = ../../common/string_conversion.cc; sourceTree = SOURCE_ROOT; };
F92C53860ECCE6AD009BE4BA /* string_conversion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = string_conversion.h; path = ../../common/string_conversion.h; sourceTree = SOURCE_ROOT; };
- F92C53870ECCE6C0009BE4BA /* convert_UTF.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = convert_UTF.c; path = ../../common/convert_UTF.c; sourceTree = SOURCE_ROOT; };
+ F92C53870ECCE6C0009BE4BA /* convert_UTF.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = convert_UTF.cc; path = ../../common/convert_UTF.cc; sourceTree = SOURCE_ROOT; };
F92C53880ECCE6C0009BE4BA /* convert_UTF.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = convert_UTF.h; path = ../../common/convert_UTF.h; sourceTree = SOURCE_ROOT; };
F92C538E0ECCE70A009BE4BA /* minidump_file_writer-inl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "minidump_file_writer-inl.h"; path = "../minidump_file_writer-inl.h"; sourceTree = SOURCE_ROOT; };
F92C538F0ECCE70A009BE4BA /* minidump_file_writer.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = minidump_file_writer.cc; path = ../minidump_file_writer.cc; sourceTree = SOURCE_ROOT; };
@@ -897,6 +901,8 @@
D244536912426EE7009BBCE0 /* processor */ = {
isa = PBXGroup;
children = (
+ 421BC5AD21110C0300B8042E /* convert_old_arm64_context.cc */,
+ 421BC5BB21110C0300B8042E /* convert_old_arm64_context.h */,
D244535112426EBB009BBCE0 /* logging.cc */,
D244535212426EBB009BBCE0 /* minidump.cc */,
D244535312426EBB009BBCE0 /* pathname_stripper.cc */,
@@ -937,8 +943,8 @@
F92C53600ECCE3D6009BE4BA /* common */ = {
isa = PBXGroup;
children = (
- D244540A12439BA0009BBCE0 /* memory_unittest.cc */,
- F92C53870ECCE6C0009BE4BA /* convert_UTF.c */,
+ D244540A12439BA0009BBCE0 /* memory_allocator_unittest.cc */,
+ F92C53870ECCE6C0009BE4BA /* convert_UTF.cc */,
F92C53880ECCE6C0009BE4BA /* convert_UTF.h */,
4D72CA0D13DFAD5C006CABE3 /* md5.cc */,
1EEEB6211720829E00F7E689 /* simple_string_dictionary.cc */,
@@ -955,7 +961,6 @@
children = (
162F64F0161C577500CD68D5 /* arch_utilities.cc */,
162F64F1161C577500CD68D5 /* arch_utilities.h */,
- 8B31022211F0CE1000FCF3E4 /* GTMGarbageCollection.h */,
8B31007011F0CD3C00FCF3E4 /* GTMDefines.h */,
F9C77E0F0F7DDF650045F7DB /* testing */,
F9C44EE70EF0A3C1003AEBAA /* GTMLogger.h */,
@@ -1156,6 +1161,7 @@
D2F9A4CC121336C7002747C1 /* crash_generation_server.h in Headers */,
163201D61443019E00C4DBF5 /* ConfigFile.h in Headers */,
16C7C918147D45AE00776EAD /* BreakpadDefines.h in Headers */,
+ 421BC5BD21110C0300B8042E /* convert_old_arm64_context.h in Headers */,
162F64F3161C577500CD68D5 /* arch_utilities.h in Headers */,
F4DAB1DE19F1027100A5A838 /* launch_reporter.h in Headers */,
1EEEB6241720829E00F7E689 /* simple_string_dictionary.h in Headers */,
@@ -1401,6 +1407,8 @@
/* Begin PBXProject section */
0867D690FE84028FC02AAC07 /* Project object */ = {
isa = PBXProject;
+ attributes = {
+ };
buildConfigurationList = 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "Breakpad" */;
compatibilityVersion = "Xcode 3.1";
developmentRegion = English;
@@ -1686,6 +1694,7 @@
163201D71443019E00C4DBF5 /* ConfigFile.mm in Sources */,
162F64F2161C577500CD68D5 /* arch_utilities.cc in Sources */,
1EEEB6231720829E00F7E689 /* simple_string_dictionary.cc in Sources */,
+ 421BC5BC21110C0300B8042E /* convert_old_arm64_context.cc in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -1703,7 +1712,7 @@
D246418812BAA4E3005170D0 /* string_utilities.cc in Sources */,
D246418C12BAA508005170D0 /* minidump_file_writer.cc in Sources */,
D246419012BAA52A005170D0 /* string_conversion.cc in Sources */,
- D246419112BAA52F005170D0 /* convert_UTF.c in Sources */,
+ D246419112BAA52F005170D0 /* convert_UTF.cc in Sources */,
D246419512BAA54C005170D0 /* file_id.cc in Sources */,
D246419612BAA55A005170D0 /* macho_id.cc in Sources */,
D24641A012BAA67F005170D0 /* macho_walker.cc in Sources */,
@@ -1736,7 +1745,7 @@
D2F9A533121383A1002747C1 /* exception_handler.cc in Sources */,
D2F9A534121383A1002747C1 /* minidump_generator.cc in Sources */,
D2F9A535121383A1002747C1 /* minidump_file_writer.cc in Sources */,
- D2F9A536121383A1002747C1 /* convert_UTF.c in Sources */,
+ D2F9A536121383A1002747C1 /* convert_UTF.cc in Sources */,
D2F9A537121383A1002747C1 /* string_conversion.cc in Sources */,
D2F9A538121383A1002747C1 /* file_id.cc in Sources */,
D2F9A539121383A1002747C1 /* macho_id.cc in Sources */,
@@ -1771,7 +1780,7 @@
162F64F4161C579B00CD68D5 /* arch_utilities.cc in Sources */,
162F64F5161C579B00CD68D5 /* arch_utilities.h in Sources */,
D2A5DD301188633800081F03 /* breakpad_nlist_64.cc in Sources */,
- F92C563F0ECD10CA009BE4BA /* convert_UTF.c in Sources */,
+ F92C563F0ECD10CA009BE4BA /* convert_UTF.cc in Sources */,
F92C56400ECD10CA009BE4BA /* dynamic_images.cc in Sources */,
F92C56410ECD10CA009BE4BA /* file_id.cc in Sources */,
F92C56420ECD10CA009BE4BA /* macho_id.cc in Sources */,
@@ -1814,7 +1823,7 @@
F93803CE0F8083B7004D428B /* exception_handler.cc in Sources */,
F93803CF0F8083B7004D428B /* minidump_generator.cc in Sources */,
F93803D00F8083B7004D428B /* minidump_file_writer.cc in Sources */,
- F93803D10F8083B7004D428B /* convert_UTF.c in Sources */,
+ F93803D10F8083B7004D428B /* convert_UTF.cc in Sources */,
F93803D20F8083B7004D428B /* string_conversion.cc in Sources */,
F93803D30F8083B7004D428B /* file_id.cc in Sources */,
F93803D40F8083B7004D428B /* macho_id.cc in Sources */,
@@ -1834,7 +1843,7 @@
buildActionMask = 2147483647;
files = (
F93DE2D90F82A73500608B94 /* minidump_file_writer.cc in Sources */,
- F93DE2DA0F82A73500608B94 /* convert_UTF.c in Sources */,
+ F93DE2DA0F82A73500608B94 /* convert_UTF.cc in Sources */,
F93DE2DB0F82A73500608B94 /* string_conversion.cc in Sources */,
F93DE2D80F82A70E00608B94 /* minidump_file_writer_unittest.cc in Sources */,
);
@@ -1844,6 +1853,8 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
+ 421BC5BE21110C1000B8042E /* convert_old_arm64_context.cc in Sources */,
+ 4247E6412110D7A300482558 /* memory_allocator_unittest.cc in Sources */,
D244536A12426F00009BBCE0 /* logging.cc in Sources */,
D244536B12426F00009BBCE0 /* minidump.cc in Sources */,
D244536C12426F00009BBCE0 /* pathname_stripper.cc in Sources */,
@@ -1856,7 +1867,7 @@
F93DE3360F82C66B00608B94 /* exception_handler.cc in Sources */,
F93DE3370F82C66B00608B94 /* minidump_generator.cc in Sources */,
F93DE3380F82C66B00608B94 /* minidump_file_writer.cc in Sources */,
- F93DE3390F82C66B00608B94 /* convert_UTF.c in Sources */,
+ F93DE3390F82C66B00608B94 /* convert_UTF.cc in Sources */,
F93DE33A0F82C66B00608B94 /* string_conversion.cc in Sources */,
F93DE33B0F82C66B00608B94 /* file_id.cc in Sources */,
F93DE33C0F82C66B00608B94 /* macho_id.cc in Sources */,
@@ -1864,7 +1875,6 @@
F93DE33E0F82C66B00608B94 /* macho_walker.cc in Sources */,
F93DE33F0F82C66B00608B94 /* string_utilities.cc in Sources */,
D2F9A3D51212F87C002747C1 /* exception_handler_test.cc in Sources */,
- D244540B12439BA0009BBCE0 /* memory_unittest.cc in Sources */,
4D72CA3813DFAE91006CABE3 /* md5.cc in Sources */,
4D61A26E14F43D45002D5862 /* bootstrap_compat.cc in Sources */,
1EEEB6271720831E00F7E689 /* BreakpadFramework_Test.mm in Sources */,
@@ -2128,8 +2138,9 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 8B31027711F0D3AF00FCF3E4 /* BreakpadDebug.xcconfig */;
buildSettings = {
+ CLANG_CXX_LANGUAGE_STANDARD = "c++17";
GCC_TREAT_WARNINGS_AS_ERRORS = NO;
- SDKROOT = macosx10.5;
+ SDKROOT = macosx;
};
name = Debug;
};
@@ -2137,6 +2148,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 8B31027811F0D3AF00FCF3E4 /* BreakpadRelease.xcconfig */;
buildSettings = {
+ CLANG_CXX_LANGUAGE_STANDARD = "c++17";
GCC_TREAT_WARNINGS_AS_ERRORS = NO;
};
name = Release;
@@ -2195,10 +2207,10 @@
GCC_OPTIMIZATION_LEVEL = 0;
HEADER_SEARCH_PATHS = (
"$(inherited)",
- ../../testing,
- ../../testing/include,
- ../../testing/gtest,
- ../../testing/gtest/include,
+ ../../testing/googlemock,
+ ../../testing/googlemock/include,
+ ../../testing/googletest,
+ ../../testing/googletest/include,
);
PREBINDING = NO;
PRODUCT_NAME = gtest;
@@ -2211,10 +2223,10 @@
ALWAYS_SEARCH_USER_PATHS = NO;
HEADER_SEARCH_PATHS = (
"$(inherited)",
- ../../testing,
- ../../testing/include,
- ../../testing/gtest,
- ../../testing/gtest/include,
+ ../../testing/googlemock,
+ ../../testing/googlemock/include,
+ ../../testing/googletest,
+ ../../testing/googletest/include,
);
PREBINDING = NO;
PRODUCT_NAME = gtest;
@@ -2230,10 +2242,10 @@
GCC_ENABLE_FIX_AND_CONTINUE = NO;
HEADER_SEARCH_PATHS = (
"$(inherited)",
- ../../testing,
- ../../testing/include,
- ../../testing/gtest,
- ../../testing/gtest/include,
+ ../../testing/googlemock,
+ ../../testing/googlemock/include,
+ ../../testing/googletest,
+ ../../testing/googletest/include,
);
PREBINDING = NO;
PRODUCT_NAME = gtest;
@@ -2250,10 +2262,10 @@
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
HEADER_SEARCH_PATHS = (
../..,
- ../../testing,
- ../../testing/include,
- ../../testing/gtest,
- ../../testing/gtest/include,
+ ../../testing/googlemock,
+ ../../testing/googlemock/include,
+ ../../testing/googletest,
+ ../../testing/googletest/include,
);
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
@@ -2268,10 +2280,10 @@
buildSettings = {
HEADER_SEARCH_PATHS = (
../..,
- ../../testing,
- ../../testing/include,
- ../../testing/gtest,
- ../../testing/gtest/include,
+ ../../testing/googlemock,
+ ../../testing/googlemock/include,
+ ../../testing/googletest,
+ ../../testing/googletest/include,
);
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
@@ -2286,10 +2298,10 @@
buildSettings = {
HEADER_SEARCH_PATHS = (
../..,
- ../../testing,
- ../../testing/include,
- ../../testing/gtest,
- ../../testing/gtest/include,
+ ../../testing/googlemock,
+ ../../testing/googlemock/include,
+ ../../testing/googletest,
+ ../../testing/googletest/include,
);
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
@@ -2370,10 +2382,8 @@
HEADER_SEARCH_PATHS = (
../..,
../../..,
- ../../testing,
- ../../testing/include,
- ../../testing/gtest,
- ../../testing/gtest/include,
+ ../../testing/googlemock/include,
+ ../../testing/googletest/include,
);
PRODUCT_NAME = generator_test;
};
@@ -2385,10 +2395,8 @@
HEADER_SEARCH_PATHS = (
../..,
../../..,
- ../../testing,
- ../../testing/include,
- ../../testing/gtest,
- ../../testing/gtest/include,
+ ../../testing/googlemock/include,
+ ../../testing/googletest/include,
);
PRODUCT_NAME = generator_test;
};
@@ -2420,10 +2428,10 @@
HEADER_SEARCH_PATHS = (
../../..,
../..,
- ../../testing,
- ../../testing/include,
- ../../testing/gtest,
- ../../testing/gtest/include,
+ ../../testing/googletest,
+ ../../testing/googletest/include,
+ ../../testing/googlemock,
+ ../../testing/googlemock/include,
);
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
@@ -2439,10 +2447,10 @@
HEADER_SEARCH_PATHS = (
../../..,
../..,
- ../../testing,
- ../../testing/include,
- ../../testing/gtest,
- ../../testing/gtest/include,
+ ../../testing/googletest,
+ ../../testing/googletest/include,
+ ../../testing/googlemock,
+ ../../testing/googlemock/include,
);
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
@@ -2456,6 +2464,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 8B31027711F0D3AF00FCF3E4 /* BreakpadDebug.xcconfig */;
buildSettings = {
+ CLANG_CXX_LANGUAGE_STANDARD = "c++17";
GCC_TREAT_WARNINGS_AS_ERRORS = NO;
};
name = "Debug With Code Coverage";
@@ -2545,10 +2554,8 @@
HEADER_SEARCH_PATHS = (
../..,
../../..,
- ../../testing,
- ../../testing/include,
- ../../testing/gtest,
- ../../testing/gtest/include,
+ ../../testing/googlemock/include,
+ ../../testing/googletest/include,
);
PRODUCT_NAME = generator_test;
};
@@ -2568,10 +2575,10 @@
HEADER_SEARCH_PATHS = (
../../..,
../..,
- ../../testing,
- ../../testing/include,
- ../../testing/gtest,
- ../../testing/gtest/include,
+ ../../testing/googletest,
+ ../../testing/googletest/include,
+ ../../testing/googlemock,
+ ../../testing/googlemock/include,
);
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
diff --git a/src/client/mac/Framework/Breakpad.mm b/src/client/mac/Framework/Breakpad.mm
index 1d2e519b..b2140549 100644
--- a/src/client/mac/Framework/Breakpad.mm
+++ b/src/client/mac/Framework/Breakpad.mm
@@ -117,7 +117,7 @@ class ProtectedMemoryLocker {
// Then unlock the mutex
__attribute__((unused)) int rv = pthread_mutex_unlock(mutex_);
assert(rv == 0);
- };
+ }
private:
ProtectedMemoryLocker();
diff --git a/src/client/mac/Framework/OnDemandServer.h b/src/client/mac/Framework/OnDemandServer.h
index b8aabbe4..d4db5d3a 100644
--- a/src/client/mac/Framework/OnDemandServer.h
+++ b/src/client/mac/Framework/OnDemandServer.h
@@ -127,7 +127,7 @@ class OnDemandServer {
// This is the port we need to send a mach message to after calling
// LaunchOnDemand(). Sending a message causing an immediate launch
// of the server
- mach_port_t GetServicePort() { return service_port_; };
+ mach_port_t GetServicePort() { return service_port_; }
private:
// Disallow copy constructor
diff --git a/src/client/mac/Framework/OnDemandServer.mm b/src/client/mac/Framework/OnDemandServer.mm
index dbe601bb..a2ffa434 100644
--- a/src/client/mac/Framework/OnDemandServer.mm
+++ b/src/client/mac/Framework/OnDemandServer.mm
@@ -71,7 +71,7 @@ OnDemandServer *OnDemandServer::Create(const char *server_command,
delete server;
return NULL;
-};
+}
//==============================================================================
kern_return_t OnDemandServer::Initialize(const char *server_command,
diff --git a/src/client/mac/crash_generation/ConfigFile.h b/src/client/mac/crash_generation/ConfigFile.h
index 5662e8b0..f2da7c24 100644
--- a/src/client/mac/crash_generation/ConfigFile.h
+++ b/src/client/mac/crash_generation/ConfigFile.h
@@ -44,10 +44,10 @@ class ConfigFile {
config_file_ = -1;
config_file_path_[0] = 0;
has_created_file_ = false;
- };
+ }
~ConfigFile() {
- };
+ }
void WriteFile(const char* directory,
const SimpleStringDictionary *configurationParameters,
diff --git a/src/client/mac/crash_generation/Inspector.h b/src/client/mac/crash_generation/Inspector.h
index 67123551..7f923ed6 100644
--- a/src/client/mac/crash_generation/Inspector.h
+++ b/src/client/mac/crash_generation/Inspector.h
@@ -98,7 +98,7 @@ class MinidumpLocation {
(MinidumpGenerator::UniqueNameInDirectory(dump_path, &next_minidump_id));
strlcpy(minidump_id_, next_minidump_id.c_str(), sizeof(minidump_id_));
- };
+ }
const char *GetPath() { return minidump_dir_path_; }
const char *GetID() { return minidump_id_; }
@@ -111,7 +111,7 @@ class MinidumpLocation {
//=============================================================================
class Inspector {
public:
- Inspector() {};
+ Inspector() {}
// given a bootstrap service name, receives mach messages
// from a crashed process, then inspects it, creates a minidump file
diff --git a/src/client/mac/handler/breakpad_nlist_64.h b/src/client/mac/handler/breakpad_nlist_64.h
index 1d2c6391..e8e2e083 100644
--- a/src/client/mac/handler/breakpad_nlist_64.h
+++ b/src/client/mac/handler/breakpad_nlist_64.h
@@ -32,6 +32,7 @@
// nlist function implemented to work on 64-bit.
#ifndef CLIENT_MAC_HANDLER_BREAKPAD_NLIST_H__
+#define CLIENT_MAC_HANDLER_BREAKPAD_NLIST_H__
#include <mach/machine.h>
diff --git a/src/client/mac/handler/dynamic_images.cc b/src/client/mac/handler/dynamic_images.cc
index 3dc4f3b4..cdba6df4 100644
--- a/src/client/mac/handler/dynamic_images.cc
+++ b/src/client/mac/handler/dynamic_images.cc
@@ -364,7 +364,7 @@ static uint64_t LookupSymbol(const char* symbol_name,
return list.n_value;
}
-#if TARGET_OS_IPHONE
+#if TARGET_OS_IPHONE || MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6
static bool HasTaskDyldInfo() {
return true;
}
@@ -381,13 +381,9 @@ static SInt32 GetOSVersion() {
}
static bool HasTaskDyldInfo() {
-#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6
- return true;
-#else
return GetOSVersion() >= 0x1060;
-#endif
}
-#endif // TARGET_OS_IPHONE
+#endif // TARGET_OS_IPHONE || MAC_OS_X_VERSION_MIN_REQUIRED >= 10_6
uint64_t DynamicImages::GetDyldAllImageInfosPointer() {
if (HasTaskDyldInfo()) {
diff --git a/src/client/mac/handler/exception_handler.cc b/src/client/mac/handler/exception_handler.cc
index 6928e984..2a19d46a 100644
--- a/src/client/mac/handler/exception_handler.cc
+++ b/src/client/mac/handler/exception_handler.cc
@@ -126,7 +126,7 @@ extern "C" {
mach_msg_header_t* reply);
// This symbol must be visible to dlsym() - see
- // http://code.google.com/p/google-breakpad/issues/detail?id=345 for details.
+ // https://bugs.chromium.org/p/google-breakpad/issues/detail?id=345 for details.
kern_return_t catch_exception_raise(mach_port_t target_port,
mach_port_t failed_thread,
mach_port_t task,
@@ -356,6 +356,11 @@ bool ExceptionHandler::WriteMinidumpWithException(
bool report_current_thread) {
bool result = false;
+#if TARGET_OS_IPHONE
+ // _exit() should never be called on iOS.
+ exit_after_write = false;
+#endif
+
if (directCallback_) {
if (directCallback_(callback_context_,
exception_type,
@@ -459,7 +464,7 @@ kern_return_t ForwardException(mach_port_t task, mach_port_t failed_thread,
kern_return_t result;
// TODO: Handle the case where |target_behavior| has MACH_EXCEPTION_CODES
- // set. https://code.google.com/p/google-breakpad/issues/detail?id=551
+ // set. https://bugs.chromium.org/p/google-breakpad/issues/detail?id=551
switch (target_behavior) {
case EXCEPTION_DEFAULT:
result = exception_raise(target_port, failed_thread, task, exception,
diff --git a/src/client/mac/handler/minidump_generator.cc b/src/client/mac/handler/minidump_generator.cc
index 38baa04e..50df9002 100644
--- a/src/client/mac/handler/minidump_generator.cc
+++ b/src/client/mac/handler/minidump_generator.cc
@@ -133,25 +133,47 @@ void MinidumpGenerator::GatherSystemInformation() {
vers_path,
kCFURLPOSIXPathStyle,
false);
- CFDataRef data;
- SInt32 error;
- CFURLCreateDataAndPropertiesFromResource(NULL, sys_vers, &data, NULL, NULL,
- &error);
-
+ CFReadStreamRef read_stream = CFReadStreamCreateWithFile(NULL, sys_vers);
+ CFRelease(sys_vers);
+ if (!read_stream) {
+ return;
+ }
+ if (!CFReadStreamOpen(read_stream)) {
+ CFRelease(read_stream);
+ return;
+ }
+ CFMutableDataRef data = NULL;
+ while (true) {
+ // Actual data file tests: Mac at 480 bytes and iOS at 413 bytes.
+ const CFIndex kMaxBufferLength = 1024;
+ UInt8 data_bytes[kMaxBufferLength];
+ CFIndex num_bytes_read =
+ CFReadStreamRead(read_stream, data_bytes, kMaxBufferLength);
+ if (num_bytes_read < 0) {
+ if (data) {
+ CFRelease(data);
+ data = NULL;
+ }
+ break;
+ } else if (num_bytes_read == 0) {
+ break;
+ } else if (!data) {
+ data = CFDataCreateMutable(NULL, 0);
+ }
+ CFDataAppendBytes(data, data_bytes, num_bytes_read);
+ }
+ CFReadStreamClose(read_stream);
+ CFRelease(read_stream);
if (!data) {
- CFRelease(sys_vers);
return;
}
-
- CFDictionaryRef list = static_cast<CFDictionaryRef>
- (CFPropertyListCreateFromXMLData(NULL, data, kCFPropertyListImmutable,
- NULL));
+ CFDictionaryRef list =
+ static_cast<CFDictionaryRef>(CFPropertyListCreateWithData(
+ NULL, data, kCFPropertyListImmutable, NULL, NULL));
+ CFRelease(data);
if (!list) {
- CFRelease(sys_vers);
- CFRelease(data);
return;
}
-
CFStringRef build_version = static_cast<CFStringRef>
(CFDictionaryGetValue(list, CFSTR("ProductBuildVersion")));
CFStringRef product_version = static_cast<CFStringRef>
@@ -160,8 +182,6 @@ void MinidumpGenerator::GatherSystemInformation() {
string product_str = ConvertToString(product_version);
CFRelease(list);
- CFRelease(sys_vers);
- CFRelease(data);
strlcpy(build_string_, build_str.c_str(), sizeof(build_string_));
@@ -525,7 +545,7 @@ bool
MinidumpGenerator::WriteContextARM64(breakpad_thread_state_data_t state,
MDLocationDescriptor *register_location)
{
- TypedMDRVA<MDRawContextARM64> context(&writer_);
+ TypedMDRVA<MDRawContextARM64_Old> context(&writer_);
arm_thread_state64_t *machine_state =
reinterpret_cast<arm_thread_state64_t *>(state);
@@ -533,11 +553,11 @@ MinidumpGenerator::WriteContextARM64(breakpad_thread_state_data_t state,
return false;
*register_location = context.location();
- MDRawContextARM64 *context_ptr = context.get();
- context_ptr->context_flags = MD_CONTEXT_ARM64_FULL;
+ MDRawContextARM64_Old *context_ptr = context.get();
+ context_ptr->context_flags = MD_CONTEXT_ARM64_FULL_OLD;
-#define AddGPR(a) context_ptr->iregs[a] = \
- REGISTER_FROM_THREADSTATE(machine_state, x[a])
+#define AddGPR(a) \
+ context_ptr->iregs[a] = ARRAY_REGISTER_FROM_THREADSTATE(machine_state, x, a)
context_ptr->iregs[29] = REGISTER_FROM_THREADSTATE(machine_state, fp);
context_ptr->iregs[30] = REGISTER_FROM_THREADSTATE(machine_state, lr);
@@ -1171,7 +1191,7 @@ bool MinidumpGenerator::WriteSystemInfoStream(
#endif
#ifdef HAS_ARM64_SUPPORT
case CPU_TYPE_ARM64:
- info_ptr->processor_architecture = MD_CPU_ARCHITECTURE_ARM64;
+ info_ptr->processor_architecture = MD_CPU_ARCHITECTURE_ARM64_OLD;
break;
#endif
#ifdef HAS_PPC_SUPPORT
diff --git a/src/client/mac/handler/minidump_generator.h b/src/client/mac/handler/minidump_generator.h
index 4e4b4a68..f3aa9bd3 100644
--- a/src/client/mac/handler/minidump_generator.h
+++ b/src/client/mac/handler/minidump_generator.h
@@ -39,7 +39,7 @@
#include "client/mac/handler/ucontext_compat.h"
#include "client/minidump_file_writer.h"
-#include "common/memory.h"
+#include "common/memory_allocator.h"
#include "common/mac/macho_utilities.h"
#include "google_breakpad/common/minidump_format.h"
@@ -63,14 +63,31 @@ using std::string;
// Use the REGISTER_FROM_THREADSTATE to access a register name from the
// breakpad_thread_state_t structure.
-#if __DARWIN_UNIX03 || TARGET_CPU_X86_64 || TARGET_CPU_PPC64 || TARGET_CPU_ARM
+#if __DARWIN_OPAQUE_ARM_THREAD_STATE64
+#define ARRAY_REGISTER_FROM_THREADSTATE(a, b, i) ((a)->__##b[i])
+#define GET_REGISTER_FROM_THREADSTATE_fp(a) \
+ (reinterpret_cast<uintptr_t>((a)->__opaque_fp))
+#define GET_REGISTER_FROM_THREADSTATE_lr(a) \
+ (reinterpret_cast<uintptr_t>((a)->__opaque_lr))
+#define GET_REGISTER_FROM_THREADSTATE_sp(a) \
+ (reinterpret_cast<uintptr_t>((a)->__opaque_sp))
+#define GET_REGISTER_FROM_THREADSTATE_pc(a) \
+ (reinterpret_cast<uintptr_t>((a)->__opaque_pc))
+#define GET_REGISTER_FROM_THREADSTATE_cpsr(a) ((a)->__cpsr)
+#define GET_REGISTER_FROM_THREADSTATE_flags(a) ((a)->__opaque_flags)
+#define REGISTER_FROM_THREADSTATE(a, b) (GET_REGISTER_FROM_THREADSTATE_##b(a))
+#elif __DARWIN_UNIX03 || TARGET_CPU_X86_64 || TARGET_CPU_PPC64 || TARGET_CPU_ARM
// In The 10.5 SDK Headers Apple prepended __ to the variable names in the
// i386_thread_state_t structure. There's no good way to tell what version of
// the SDK we're compiling against so we just toggle on the same preprocessor
// symbol Apple's headers use.
#define REGISTER_FROM_THREADSTATE(a, b) ((a)->__ ## b)
+#define ARRAY_REGISTER_FROM_THREADSTATE(a, b, i) \
+ REGISTER_FROM_THREADSTATE(a, b[i])
#else
#define REGISTER_FROM_THREADSTATE(a, b) (a->b)
+#define ARRAY_REGISTER_FROM_THREADSTATE(a, b, i) \
+ REGISTER_FROM_THREADSTATE(a, b[i])
#endif
// Creates a minidump file of the current process. If there is exception data,
diff --git a/src/client/mac/handler/minidump_test.xcodeproj/project.pbxproj b/src/client/mac/handler/minidump_test.xcodeproj/project.pbxproj
index 2a597d50..1924ac4d 100644
--- a/src/client/mac/handler/minidump_test.xcodeproj/project.pbxproj
+++ b/src/client/mac/handler/minidump_test.xcodeproj/project.pbxproj
@@ -21,13 +21,13 @@
8BFC81AE11FF9C8C002CB4DC /* breakpad_nlist_64.cc in Sources */ = {isa = PBXBuildFile; fileRef = F98208A10DB32CAE0017AECA /* breakpad_nlist_64.cc */; };
8BFC81AF11FF9C8C002CB4DC /* breakpad_nlist_64.cc in Sources */ = {isa = PBXBuildFile; fileRef = F98208A10DB32CAE0017AECA /* breakpad_nlist_64.cc */; };
8BFC81B011FF9C8D002CB4DC /* breakpad_nlist_64.cc in Sources */ = {isa = PBXBuildFile; fileRef = F98208A10DB32CAE0017AECA /* breakpad_nlist_64.cc */; };
- 9B35FF5A0B267D5F008DE8C7 /* convert_UTF.c in Sources */ = {isa = PBXBuildFile; fileRef = 9B35FF560B267D5F008DE8C7 /* convert_UTF.c */; };
+ 9B35FF5A0B267D5F008DE8C7 /* convert_UTF.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9B35FF560B267D5F008DE8C7 /* convert_UTF.cc */; };
9B35FF5B0B267D5F008DE8C7 /* string_conversion.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9B35FF580B267D5F008DE8C7 /* string_conversion.cc */; };
9B37CEEC0AF98ECD00FA4BD4 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9B37CEEB0AF98ECD00FA4BD4 /* CoreFoundation.framework */; };
9B7CA7700B12873A00CD3A1D /* minidump_file_writer-inl.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9BE3C01E0B0CE329009892DF /* minidump_file_writer-inl.h */; };
9B7CA8540B12989000CD3A1D /* minidump_file_writer_unittest.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9B7CA8530B12989000CD3A1D /* minidump_file_writer_unittest.cc */; };
9B7CA8550B1298A100CD3A1D /* minidump_file_writer.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9BD82C230B01344C0055103E /* minidump_file_writer.cc */; };
- 9BC1D2940B336F2300F2A2B4 /* convert_UTF.c in Sources */ = {isa = PBXBuildFile; fileRef = 9B35FF560B267D5F008DE8C7 /* convert_UTF.c */; };
+ 9BC1D2940B336F2300F2A2B4 /* convert_UTF.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9B35FF560B267D5F008DE8C7 /* convert_UTF.cc */; };
9BC1D2950B336F2500F2A2B4 /* string_conversion.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9B35FF580B267D5F008DE8C7 /* string_conversion.cc */; };
9BD82AC10B0029DF0055103E /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9B37CEEB0AF98ECD00FA4BD4 /* CoreFoundation.framework */; };
9BD82BFF0B01333D0055103E /* exception_handler_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9BD82BFD0B01333D0055103E /* exception_handler_test.cc */; };
@@ -56,7 +56,7 @@
D2F6510F0BEF94EB00920385 /* macho_walker.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = D2F6510D0BEF94EB00920385 /* macho_walker.h */; };
D2F651110BEF951700920385 /* string_conversion.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9B35FF580B267D5F008DE8C7 /* string_conversion.cc */; };
D2F651130BEF951C00920385 /* string_conversion.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9B35FF590B267D5F008DE8C7 /* string_conversion.h */; };
- D2F651150BEF953000920385 /* convert_UTF.c in Sources */ = {isa = PBXBuildFile; fileRef = 9B35FF560B267D5F008DE8C7 /* convert_UTF.c */; };
+ D2F651150BEF953000920385 /* convert_UTF.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9B35FF560B267D5F008DE8C7 /* convert_UTF.cc */; };
D2F651160BEF953100920385 /* convert_UTF.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9B35FF570B267D5F008DE8C7 /* convert_UTF.h */; };
D2F6511B0BEF970E00920385 /* dynamic_images.cc in Sources */ = {isa = PBXBuildFile; fileRef = D2F651070BEF949A00920385 /* dynamic_images.cc */; };
D2F6511D0BEF973500920385 /* file_id.cc in Sources */ = {isa = PBXBuildFile; fileRef = D2F650FA0BEF947200920385 /* file_id.cc */; };
@@ -68,7 +68,7 @@
F93A887F0E8B4C8C0026AF89 /* macho_utilities.cc in Sources */ = {isa = PBXBuildFile; fileRef = D2F650FE0BEF947200920385 /* macho_utilities.cc */; };
F93A88800E8B4C8C0026AF89 /* file_id.cc in Sources */ = {isa = PBXBuildFile; fileRef = D2F650FA0BEF947200920385 /* file_id.cc */; };
F93A88860E8B4C9A0026AF89 /* dwarftests.mm in Sources */ = {isa = PBXBuildFile; fileRef = F9721F310E8B07E800D7E813 /* dwarftests.mm */; };
- F93A88870E8B4C9A0026AF89 /* dump_syms.mm in Sources */ = {isa = PBXBuildFile; fileRef = F9721F390E8B0D0D00D7E813 /* dump_syms.mm */; };
+ F93A88870E8B4C9A0026AF89 /* dump_syms.cc in Sources */ = {isa = PBXBuildFile; fileRef = F9721F390E8B0D0D00D7E813 /* dump_syms.cc */; };
F93A88880E8B4C9A0026AF89 /* bytereader.cc in Sources */ = {isa = PBXBuildFile; fileRef = F9721F760E8B0DC700D7E813 /* bytereader.cc */; };
F93A88890E8B4C9A0026AF89 /* dwarf2reader.cc in Sources */ = {isa = PBXBuildFile; fileRef = F9721F770E8B0DC700D7E813 /* dwarf2reader.cc */; };
F93A888A0E8B4C9A0026AF89 /* functioninfo.cc in Sources */ = {isa = PBXBuildFile; fileRef = F9721F780E8B0DC700D7E813 /* functioninfo.cc */; };
@@ -115,7 +115,7 @@
8BFC815411FF9B7F002CB4DC /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = System/Library/Frameworks/Carbon.framework; sourceTree = SDKROOT; };
8BFC819211FF9C23002CB4DC /* CPlusTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CPlusTest.framework; path = Library/Frameworks/CPlusTest.framework; sourceTree = DEVELOPER_DIR; };
8DD76F6C0486A84900D96B5E /* generator_test */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = generator_test; sourceTree = BUILT_PRODUCTS_DIR; };
- 9B35FF560B267D5F008DE8C7 /* convert_UTF.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = convert_UTF.c; path = ../../../common/convert_UTF.c; sourceTree = SOURCE_ROOT; };
+ 9B35FF560B267D5F008DE8C7 /* convert_UTF.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = convert_UTF.cc; path = ../../../common/convert_UTF.cc; sourceTree = SOURCE_ROOT; };
9B35FF570B267D5F008DE8C7 /* convert_UTF.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = convert_UTF.h; path = ../../../common/convert_UTF.h; sourceTree = SOURCE_ROOT; };
9B35FF580B267D5F008DE8C7 /* string_conversion.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = string_conversion.cc; path = ../../../common/string_conversion.cc; sourceTree = SOURCE_ROOT; };
9B35FF590B267D5F008DE8C7 /* string_conversion.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = string_conversion.h; path = ../../../common/string_conversion.h; sourceTree = SOURCE_ROOT; };
@@ -151,7 +151,7 @@
F9721F300E8B07E800D7E813 /* dwarftests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dwarftests.h; sourceTree = "<group>"; };
F9721F310E8B07E800D7E813 /* dwarftests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = dwarftests.mm; sourceTree = "<group>"; };
F9721F380E8B0CFC00D7E813 /* dump_syms.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dump_syms.h; path = ../../../common/mac/dump_syms.h; sourceTree = SOURCE_ROOT; };
- F9721F390E8B0D0D00D7E813 /* dump_syms.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = dump_syms.mm; path = ../../../common/mac/dump_syms.mm; sourceTree = SOURCE_ROOT; };
+ F9721F390E8B0D0D00D7E813 /* dump_syms.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = dump_syms.cc; path = ../../../common/mac/dump_syms.cc; sourceTree = SOURCE_ROOT; };
F9721F6B0E8B0D7000D7E813 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
F9721F760E8B0DC700D7E813 /* bytereader.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = bytereader.cc; path = ../../../common/dwarf/bytereader.cc; sourceTree = SOURCE_ROOT; };
F9721F770E8B0DC700D7E813 /* dwarf2reader.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = dwarf2reader.cc; path = ../../../common/dwarf/dwarf2reader.cc; sourceTree = SOURCE_ROOT; };
@@ -240,7 +240,7 @@
F9721F760E8B0DC700D7E813 /* bytereader.cc */,
F9721F770E8B0DC700D7E813 /* dwarf2reader.cc */,
F9721F780E8B0DC700D7E813 /* functioninfo.cc */,
- F9721F390E8B0D0D00D7E813 /* dump_syms.mm */,
+ F9721F390E8B0D0D00D7E813 /* dump_syms.cc */,
F9721F380E8B0CFC00D7E813 /* dump_syms.h */,
F917C4F70E03265A00F86017 /* breakpad_exc_server.c */,
F917C4F80E03265A00F86017 /* breakpad_exc_server.h */,
@@ -307,7 +307,7 @@
9BD82C040B0133420055103E /* Breakpad */ = {
isa = PBXGroup;
children = (
- 9B35FF560B267D5F008DE8C7 /* convert_UTF.c */,
+ 9B35FF560B267D5F008DE8C7 /* convert_UTF.cc */,
9B35FF570B267D5F008DE8C7 /* convert_UTF.h */,
9B35FF580B267D5F008DE8C7 /* string_conversion.cc */,
9B35FF590B267D5F008DE8C7 /* string_conversion.h */,
@@ -555,7 +555,7 @@
D2F651090BEF949A00920385 /* dynamic_images.cc in Sources */,
D2F6510E0BEF94EB00920385 /* macho_walker.cc in Sources */,
D2F651110BEF951700920385 /* string_conversion.cc in Sources */,
- D2F651150BEF953000920385 /* convert_UTF.c in Sources */,
+ D2F651150BEF953000920385 /* convert_UTF.cc in Sources */,
8BFC81B011FF9C8D002CB4DC /* breakpad_nlist_64.cc in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -566,7 +566,7 @@
files = (
9B7CA8540B12989000CD3A1D /* minidump_file_writer_unittest.cc in Sources */,
9B7CA8550B1298A100CD3A1D /* minidump_file_writer.cc in Sources */,
- 9BC1D2940B336F2300F2A2B4 /* convert_UTF.c in Sources */,
+ 9BC1D2940B336F2300F2A2B4 /* convert_UTF.cc in Sources */,
9BC1D2950B336F2500F2A2B4 /* string_conversion.cc in Sources */,
8BFC81AE11FF9C8C002CB4DC /* breakpad_nlist_64.cc in Sources */,
);
@@ -581,7 +581,7 @@
9BD82C0E0B0133520055103E /* minidump_generator.cc in Sources */,
9BD82C250B01344C0055103E /* minidump_file_writer.cc in Sources */,
9BD82C2D0B01345E0055103E /* string_utilities.cc in Sources */,
- 9B35FF5A0B267D5F008DE8C7 /* convert_UTF.c in Sources */,
+ 9B35FF5A0B267D5F008DE8C7 /* convert_UTF.cc in Sources */,
9B35FF5B0B267D5F008DE8C7 /* string_conversion.cc in Sources */,
D2F6511B0BEF970E00920385 /* dynamic_images.cc in Sources */,
D2F6511D0BEF973500920385 /* file_id.cc in Sources */,
@@ -597,7 +597,7 @@
buildActionMask = 2147483647;
files = (
F93A88860E8B4C9A0026AF89 /* dwarftests.mm in Sources */,
- F93A88870E8B4C9A0026AF89 /* dump_syms.mm in Sources */,
+ F93A88870E8B4C9A0026AF89 /* dump_syms.cc in Sources */,
F93A88880E8B4C9A0026AF89 /* bytereader.cc in Sources */,
F93A88890E8B4C9A0026AF89 /* dwarf2reader.cc in Sources */,
F93A888A0E8B4C9A0026AF89 /* functioninfo.cc in Sources */,
@@ -636,6 +636,7 @@
1DEB923208733DC60010E9CD /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ CLANG_CXX_LANGUAGE_STANDARD = "c++17";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"$(DEVELOPER_FRAMEWORKS_DIR)\"",
@@ -648,6 +649,7 @@
1DEB923308733DC60010E9CD /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ CLANG_CXX_LANGUAGE_STANDARD = "c++17";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"$(DEVELOPER_FRAMEWORKS_DIR)\"",
diff --git a/src/client/mac/sender/Breakpad.xib b/src/client/mac/sender/Breakpad.xib
index 7966f895..885e39e6 100644
--- a/src/client/mac/sender/Breakpad.xib
+++ b/src/client/mac/sender/Breakpad.xib
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10">
<data>
- <int key="IBDocument.SystemTarget">1050</int>
+ <int key="IBDocument.SystemTarget">1070</int>
<string key="IBDocument.SystemVersion">10F569</string>
<string key="IBDocument.InterfaceBuilderVersion">762</string>
<string key="IBDocument.AppKitVersion">1038.29</string>
@@ -1114,7 +1114,7 @@ UXVpc3F1ZSBtaS4gRHVpcyBsZWN0dXMuA</string>
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencies">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string>
- <integer value="1050" key="NS.object.0"/>
+ <integer value="1070" key="NS.object.0"/>
</object>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3</string>
diff --git a/src/client/mac/sender/uploader.h b/src/client/mac/sender/uploader.h
index 5f6aa464..0897dade 100644
--- a/src/client/mac/sender/uploader.h
+++ b/src/client/mac/sender/uploader.h
@@ -42,6 +42,13 @@ extern NSString *const kGoogleServerType;
extern NSString *const kSocorroServerType;
extern NSString *const kDefaultServerType;
+// Optional user-defined function that will be called after a network upload
+// of a crash report.
+// |report_id| will be the id returned by the server, or "ERR" if an error
+// occurred.
+// |error| will contain the error, or nil if no error occured.
+typedef void (^UploadCompletionBlock)(NSString *reportId, NSError *error);
+
@interface Uploader : NSObject {
@private
NSMutableDictionary *parameters_; // Key value pairs of data (STRONG)
@@ -61,6 +68,12 @@ extern NSString *const kDefaultServerType;
// that are uploaded to the
// crash server with the
// minidump.
+ UploadCompletionBlock uploadCompletion_; // A block called on network upload
+ // completion. Parameters are:
+ // The report ID returned by the
+ // server,
+ // the NSError triggered during
+ // upload.
}
- (id)initWithConfigFile:(const char *)configFile;
@@ -86,4 +99,8 @@ extern NSString *const kDefaultServerType;
// new ID.
- (void)handleNetworkResponse:(NSData *)data withError:(NSError *)error;
+// Sets the callback to be called after uploading a crash report to the server.
+// Only the latest callback registered will be called.
+- (void)setUploadCompletionBlock:(UploadCompletionBlock)uploadCompletion;
+
@end
diff --git a/src/client/mac/sender/uploader.mm b/src/client/mac/sender/uploader.mm
index 42a43bfc..13b6130a 100644
--- a/src/client/mac/sender/uploader.mm
+++ b/src/client/mac/sender/uploader.mm
@@ -28,6 +28,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#import <fcntl.h>
+#include <stdio.h>
#import <sys/stat.h>
#include <TargetConditionals.h>
#import <unistd.h>
@@ -38,7 +39,6 @@
#import "client/apple/Framework/BreakpadDefines.h"
#import "client/mac/sender/uploader.h"
-#import "common/mac/GTMLogger.h"
const int kMinidumpFileLengthLimit = 2 * 1024 * 1024; // 2MB
@@ -89,17 +89,15 @@ NSData *readData(int fileId, ssize_t length) {
NSDictionary *readConfigurationData(const char *configFile) {
int fileId = open(configFile, O_RDONLY, 0600);
if (fileId == -1) {
- GTMLoggerDebug(@"Couldn't open config file %s - %s",
- configFile,
- strerror(errno));
+ fprintf(stderr, "Breakpad Uploader: Couldn't open config file %s - %s",
+ configFile, strerror(errno));
}
// we want to avoid a build-up of old config files even if they
// have been incorrectly written by the framework
if (unlink(configFile)) {
- GTMLoggerDebug(@"Couldn't unlink config file %s - %s",
- configFile,
- strerror(errno));
+ fprintf(stderr, "Breakpad Uploader: Couldn't unlink config file %s - %s",
+ configFile, strerror(errno));
}
if (fileId == -1) {
@@ -168,6 +166,12 @@ NSDictionary *readConfigurationData(const char *configFile) {
// Records the uploaded crash ID to the log file.
- (void)logUploadWithID:(const char *)uploadID;
+
+// Builds an URL parameter for a given dictionary key. Uses Uploader's
+// parameters to provide its value. Returns nil if no item is stored for the
+// given key.
+- (NSURLQueryItem *)queryItemWithName:(NSString *)queryItemName
+ forParamKey:(NSString *)key;
@end
@implementation Uploader
@@ -354,7 +358,8 @@ NSDictionary *readConfigurationData(const char *configFile) {
NSString *logTarFile = [NSString stringWithFormat:@"%s/log.tar.bz2",tmpDir];
logFileData_ = [[NSData alloc] initWithContentsOfFile:logTarFile];
if (logFileData_ == nil) {
- GTMLoggerDebug(@"Cannot find temp tar log file: %@", logTarFile);
+ fprintf(stderr, "Breakpad Uploader: Cannot find temp tar log file: %s",
+ [logTarFile UTF8String]);
return NO;
}
return YES;
@@ -505,6 +510,9 @@ NSDictionary *readConfigurationData(const char *configFile) {
reportID = [[result stringByTrimmingCharactersInSet:trimSet] UTF8String];
[self logUploadWithID:reportID];
}
+ if (uploadCompletion_) {
+ uploadCompletion_([NSString stringWithUTF8String:reportID], error);
+ }
// rename the minidump file according to the id returned from the server
NSString *minidumpDir =
@@ -520,20 +528,64 @@ NSDictionary *readConfigurationData(const char *configFile) {
const char *dest = [destString fileSystemRepresentation];
if (rename(src, dest) == 0) {
- GTMLoggerInfo(@"Breakpad Uploader: Renamed %s to %s after successful " \
- "upload",src, dest);
+ fprintf(stderr,
+ "Breakpad Uploader: Renamed %s to %s after successful upload", src,
+ dest);
}
else {
// can't rename - don't worry - it's not important for users
- GTMLoggerDebug(@"Breakpad Uploader: successful upload report ID = %s\n",
- reportID );
+ fprintf(stderr, "Breakpad Uploader: successful upload report ID = %s\n",
+ reportID);
}
[result release];
}
//=============================================================================
+- (NSURLQueryItem *)queryItemWithName:(NSString *)queryItemName
+ forParamKey:(NSString *)key {
+ NSString *value = [parameters_ objectForKey:key];
+ NSString *escapedValue =
+ [value stringByAddingPercentEncodingWithAllowedCharacters:
+ [NSCharacterSet URLQueryAllowedCharacterSet]];
+ return [NSURLQueryItem queryItemWithName:queryItemName value:escapedValue];
+}
+
+//=============================================================================
+- (void)setUploadCompletionBlock:(UploadCompletionBlock)uploadCompletion {
+ uploadCompletion_ = uploadCompletion;
+}
+
+//=============================================================================
- (void)report {
NSURL *url = [NSURL URLWithString:[parameters_ objectForKey:@BREAKPAD_URL]];
+
+ NSString *serverType = [parameters_ objectForKey:@BREAKPAD_SERVER_TYPE];
+ if ([serverType length] == 0 ||
+ [serverType isEqualToString:kGoogleServerType]) {
+ // when communicating to Google's crash collecting service, add URL params
+ // which identify the product
+ NSURLComponents *urlComponents = [NSURLComponents componentsWithURL:url
+ resolvingAgainstBaseURL:false];
+ NSMutableArray *queryItemsToAdd = [urlComponents.queryItems mutableCopy];
+ if (queryItemsToAdd == nil) {
+ queryItemsToAdd = [[NSMutableArray alloc] init];
+ }
+
+ NSURLQueryItem *queryItemProduct =
+ [self queryItemWithName:@"product" forParamKey:@BREAKPAD_PRODUCT];
+ NSURLQueryItem *queryItemVersion =
+ [self queryItemWithName:@"version" forParamKey:@BREAKPAD_VERSION];
+ NSURLQueryItem *queryItemGuid =
+ [self queryItemWithName:@"guid" forParamKey:@"guid"];
+
+ if (queryItemProduct != nil) [queryItemsToAdd addObject:queryItemProduct];
+ if (queryItemVersion != nil) [queryItemsToAdd addObject:queryItemVersion];
+ if (queryItemGuid != nil) [queryItemsToAdd addObject:queryItemGuid];
+
+ urlComponents.queryItems = queryItemsToAdd;
+ url = [urlComponents URL];
+ }
+
HTTPMultipartUpload *upload = [[HTTPMultipartUpload alloc] initWithURL:url];
NSMutableDictionary *uploadParameters = [NSMutableDictionary dictionary];
diff --git a/src/client/mac/tests/exception_handler_test.cc b/src/client/mac/tests/exception_handler_test.cc
index e19944d0..d5b505a1 100644
--- a/src/client/mac/tests/exception_handler_test.cc
+++ b/src/client/mac/tests/exception_handler_test.cc
@@ -36,6 +36,7 @@
#include "breakpad_googletest_includes.h"
#include "client/mac/handler/exception_handler.h"
+#include "common/linux/ignore_ret.h"
#include "common/mac/MachIPC.h"
#include "common/tests/auto_tempdir.h"
#include "google_breakpad/processor/minidump.h"
@@ -93,7 +94,7 @@ static bool MDCallback(const char *dump_dir, const char *file_name,
path.append(".dmp");
int fd = *reinterpret_cast<int*>(context);
- (void)write(fd, path.c_str(), path.length() + 1);
+ IGNORE_RET(write(fd, path.c_str(), path.length() + 1));
close(fd);
exit(0);
// not reached
@@ -293,7 +294,7 @@ TEST_F(ExceptionHandlerTest, DumpChildProcess) {
// Unblock child process
uint8_t data = 1;
- (void)write(fds[1], &data, 1);
+ IGNORE_RET(write(fds[1], &data, 1));
// Child process should have exited with a zero status.
int ret;
@@ -610,7 +611,9 @@ TEST_F(ExceptionHandlerTest, InstructionPointerMemoryNullPointer) {
ExceptionHandler eh(tempDir.path(), NULL, MDCallback, &fds[1], true, NULL);
// Try calling a NULL pointer.
typedef void (*void_function)(void);
- void_function memory_function =
+ // Volatile markings are needed to keep Clang from generating invalid
+ // opcodes. See http://crbug.com/498354 for details.
+ volatile void_function memory_function =
reinterpret_cast<void_function>(NULL);
memory_function();
// not reached
diff --git a/src/client/mac/tests/minidump_generator_test.cc b/src/client/mac/tests/minidump_generator_test.cc
index d40c7d98..b1fa5d02 100644
--- a/src/client/mac/tests/minidump_generator_test.cc
+++ b/src/client/mac/tests/minidump_generator_test.cc
@@ -42,6 +42,7 @@
#include "breakpad_googletest_includes.h"
#include "client/mac/handler/minidump_generator.h"
#include "client/mac/tests/spawn_child_process.h"
+#include "common/linux/ignore_ret.h"
#include "common/mac/MachIPC.h"
#include "common/tests/auto_tempdir.h"
#include "google_breakpad/processor/minidump.h"
@@ -190,7 +191,7 @@ TEST_F(MinidumpGeneratorTest, OutOfProcess) {
// Unblock child process
uint8_t data = 1;
- (void)write(fds[1], &data, 1);
+ IGNORE_RET(write(fds[1], &data, 1));
// Child process should have exited with a zero status.
int ret;
diff --git a/src/client/minidump_file_writer.cc b/src/client/minidump_file_writer.cc
index 9e905335..a1957f32 100644
--- a/src/client/minidump_file_writer.cc
+++ b/src/client/minidump_file_writer.cc
@@ -44,6 +44,47 @@
#include "third_party/lss/linux_syscall_support.h"
#endif
+#if defined(__ANDROID__)
+#include <errno.h>
+
+namespace {
+
+bool g_need_ftruncate_workaround = false;
+bool g_checked_need_ftruncate_workaround = false;
+
+void CheckNeedsFTruncateWorkAround(int file) {
+ if (g_checked_need_ftruncate_workaround) {
+ return;
+ }
+ g_checked_need_ftruncate_workaround = true;
+
+ // Attempt an idempotent truncate that chops off nothing and see if we
+ // run into any sort of errors.
+ off_t offset = sys_lseek(file, 0, SEEK_END);
+ if (offset == -1) {
+ // lseek failed. Don't apply work around. It's unlikely that we can write
+ // to a minidump with either method.
+ return;
+ }
+
+ int result = ftruncate(file, offset);
+ if (result == -1 && errno == EACCES) {
+ // It very likely that we are running into the kernel bug in M devices.
+ // We are going to deploy the workaround for writing minidump files
+ // without uses of ftruncate(). This workaround should be fine even
+ // for kernels without the bug.
+ // See http://crbug.com/542840 for more details.
+ g_need_ftruncate_workaround = true;
+ }
+}
+
+bool NeedsFTruncateWorkAround() {
+ return g_need_ftruncate_workaround;
+}
+
+} // namespace
+#endif // defined(__ANDROID__)
+
namespace google_breakpad {
const MDRVA MinidumpFileWriter::kInvalidMDRVA = static_cast<MDRVA>(-1);
@@ -75,15 +116,24 @@ void MinidumpFileWriter::SetFile(const int file) {
assert(file_ == -1);
file_ = file;
close_file_when_destroyed_ = false;
+#if defined(__ANDROID__)
+ CheckNeedsFTruncateWorkAround(file);
+#endif
}
bool MinidumpFileWriter::Close() {
bool result = true;
if (file_ != -1) {
- if (-1 == ftruncate(file_, position_)) {
+#if defined(__ANDROID__)
+ if (!NeedsFTruncateWorkAround() && ftruncate(file_, position_)) {
return false;
}
+#else
+ if (ftruncate(file_, position_)) {
+ return false;
+ }
+#endif
#if defined(__linux__) && __linux__
result = (sys_close(file_) == 0);
#else
@@ -220,6 +270,20 @@ bool MinidumpFileWriter::WriteMemory(const void *src, size_t size,
MDRVA MinidumpFileWriter::Allocate(size_t size) {
assert(size);
assert(file_ != -1);
+#if defined(__ANDROID__)
+ if (NeedsFTruncateWorkAround()) {
+ // If ftruncate() is not available. We simply increase the size beyond the
+ // current file size. sys_write() will expand the file when data is written
+ // to it. Because we did not over allocate to fit memory pages, we also
+ // do not need to ftruncate() the file once we are done.
+ size_ += size;
+
+ // We don't need to seek since the file is unchanged.
+ MDRVA current_position = position_;
+ position_ += static_cast<MDRVA>(size);
+ return current_position;
+ }
+#endif
size_t aligned_size = (size + 7) & ~7; // 64-bit alignment
if (position_ + aligned_size > size_) {
@@ -256,14 +320,16 @@ bool MinidumpFileWriter::Copy(MDRVA position, const void *src, ssize_t size) {
#if defined(__linux__) && __linux__
if (sys_lseek(file_, position, SEEK_SET) == static_cast<off_t>(position)) {
if (sys_write(file_, src, size) == size) {
+ return true;
+ }
+ }
#else
if (lseek(file_, position, SEEK_SET) == static_cast<off_t>(position)) {
if (write(file_, src, size) == size) {
-#endif
return true;
}
}
-
+#endif
return false;
}
diff --git a/src/client/minidump_file_writer_unittest.cc b/src/client/minidump_file_writer_unittest.cc
index 60c364e6..256e3371 100644
--- a/src/client/minidump_file_writer_unittest.cc
+++ b/src/client/minidump_file_writer_unittest.cc
@@ -30,7 +30,7 @@
// Author: waylonis@google.com (Dan Waylonis)
/*
- g++ -I../ ../common/convert_UTF.c \
+ g++ -I../ ../common/convert_UTF.cc \
../common/string_conversion.cc \
minidump_file_writer.cc \
minidump_file_writer_unittest.cc \
diff --git a/src/client/solaris/handler/Makefile b/src/client/solaris/handler/Makefile
index beeb9448..6da9464e 100644
--- a/src/client/solaris/handler/Makefile
+++ b/src/client/solaris/handler/Makefile
@@ -40,13 +40,13 @@ BIN_DIR=.
THREAD_SRC=solaris_lwp.cc
SHARE_SRC=../../minidump_file_writer.cc\
+ ../../../common/convert_UTF.cc\
../../../common/md5.cc\
../../../common/string_conversion.cc\
../../../common/solaris/file_id.cc\
minidump_generator.cc
HANDLER_SRC=exception_handler.cc\
../../../common/solaris/guid_creator.cc
-SHARE_C_SRC=../../../common/convert_UTF.c
MINIDUMP_TEST_SRC=minidump_test.cc
EXCEPTION_TEST_SRC=exception_handler_test.cc
@@ -54,11 +54,10 @@ EXCEPTION_TEST_SRC=exception_handler_test.cc
THREAD_OBJ=$(patsubst %.cc,$(OBJ_DIR)/%.o,$(THREAD_SRC))
SHARE_OBJ=$(patsubst %.cc,$(OBJ_DIR)/%.o,$(SHARE_SRC))
HANDLER_OBJ=$(patsubst %.cc,$(OBJ_DIR)/%.o,$(HANDLER_SRC))
-SHARE_C_OBJ=$(patsubst %.c,$(OBJ_DIR)/%.o,$(SHARE_C_SRC))
MINIDUMP_TEST_OBJ=$(patsubst %.cc,$(OBJ_DIR)/%.o, $(MINIDUMP_TEST_SRC))\
- $(THREAD_OBJ) $(SHARE_OBJ) $(SHARE_C_OBJ) $(HANDLER_OBJ)
+ $(THREAD_OBJ) $(SHARE_OBJ) $(HANDLER_OBJ)
EXCEPTION_TEST_OBJ=$(patsubst %.cc,$(OBJ_DIR)/%.o, $(EXCEPTION_TEST_SRC))\
- $(THREAD_OBJ) $(SHARE_OBJ) $(SHARE_C_OBJ) $(HANDLER_OBJ)
+ $(THREAD_OBJ) $(SHARE_OBJ) $(HANDLER_OBJ)
BIN=$(BIN_DIR)/minidump_test\
$(BIN_DIR)/exception_handler_test
diff --git a/src/client/windows/crash_generation/crash_generation_client.cc b/src/client/windows/crash_generation/crash_generation_client.cc
index 1e86dcec..3ba5d4e4 100644
--- a/src/client/windows/crash_generation/crash_generation_client.cc
+++ b/src/client/windows/crash_generation/crash_generation_client.cc
@@ -96,14 +96,14 @@ CrashGenerationClient::CrashGenerationClient(
const CustomClientInfo* custom_info)
: pipe_name_(pipe_name),
pipe_handle_(NULL),
+ custom_info_(),
dump_type_(dump_type),
- thread_id_(0),
- server_process_id_(0),
crash_event_(NULL),
crash_generated_(NULL),
server_alive_(NULL),
- exception_pointers_(NULL),
- custom_info_() {
+ server_process_id_(0),
+ thread_id_(0),
+ exception_pointers_(NULL) {
memset(&assert_info_, 0, sizeof(assert_info_));
if (custom_info) {
custom_info_ = *custom_info;
@@ -116,14 +116,14 @@ CrashGenerationClient::CrashGenerationClient(
const CustomClientInfo* custom_info)
: pipe_name_(),
pipe_handle_(pipe_handle),
+ custom_info_(),
dump_type_(dump_type),
- thread_id_(0),
- server_process_id_(0),
crash_event_(NULL),
crash_generated_(NULL),
server_alive_(NULL),
- exception_pointers_(NULL),
- custom_info_() {
+ server_process_id_(0),
+ thread_id_(0),
+ exception_pointers_(NULL) {
memset(&assert_info_, 0, sizeof(assert_info_));
if (custom_info) {
custom_info_ = *custom_info;
diff --git a/src/client/windows/crash_generation/crash_generation_server.cc b/src/client/windows/crash_generation/crash_generation_server.cc
index ae05243c..0af213ba 100644
--- a/src/client/windows/crash_generation/crash_generation_server.cc
+++ b/src/client/windows/crash_generation/crash_generation_server.cc
@@ -85,7 +85,7 @@ static bool IsClientRequestValid(const ProtocolMessage& msg) {
msg.assert_info != NULL);
}
-#ifdef _DEBUG
+#ifndef NDEBUG
static bool CheckForIOIncomplete(bool success) {
// We should never get an I/O incomplete since we should not execute this
// unless the operation has finished and the overlapped event is signaled. If
@@ -121,12 +121,12 @@ CrashGenerationServer::CrashGenerationServer(
upload_request_callback_(upload_request_callback),
upload_context_(upload_context),
generate_dumps_(generate_dumps),
+ pre_fetch_custom_info_(true),
dump_path_(dump_path ? *dump_path : L""),
server_state_(IPC_SERVER_STATE_UNINITIALIZED),
shutting_down_(false),
overlapped_(),
- client_info_(NULL),
- pre_fetch_custom_info_(true) {
+ client_info_(NULL) {
InitializeCriticalSection(&sync_);
}
@@ -922,9 +922,21 @@ bool CrashGenerationServer::GenerateDump(const ClientInfo& client,
client.assert_info(),
client.dump_type(),
true);
+
if (!dump_generator.GenerateDumpFile(dump_path)) {
return false;
}
+
+ // If the client requests a full memory dump, we will write a normal mini
+ // dump and a full memory dump. Both dump files use the same uuid as file
+ // name prefix.
+ if (client.dump_type() & MiniDumpWithFullMemory) {
+ std::wstring full_dump_path;
+ if (!dump_generator.GenerateFullDumpFile(&full_dump_path)) {
+ return false;
+ }
+ }
+
return dump_generator.WriteMinidump();
}
diff --git a/src/client/windows/crash_generation/minidump_generator.cc b/src/client/windows/crash_generation/minidump_generator.cc
index c3e91681..573c2786 100644
--- a/src/client/windows/crash_generation/minidump_generator.cc
+++ b/src/client/windows/crash_generation/minidump_generator.cc
@@ -176,7 +176,7 @@ bool HandleTraceData::CollectHandleData(
stream_data->Reserved = 0;
std::copy(operations_.begin(),
operations_.end(),
-#ifdef _MSC_VER
+#if defined(_MSC_VER) && !defined(_LIBCPP_STD_VER)
stdext::checked_array_iterator<AVRF_HANDLE_OPERATION*>(
reinterpret_cast<AVRF_HANDLE_OPERATION*>(stream_data + 1),
operations_.size())
@@ -259,8 +259,9 @@ MinidumpGenerator::MinidumpGenerator(
const MINIDUMP_TYPE dump_type,
const bool is_client_pointers)
: dbghelp_module_(NULL),
+ write_dump_(NULL),
rpcrt4_module_(NULL),
- dump_path_(dump_path),
+ create_uuid_(NULL),
process_handle_(process_handle),
process_id_(process_id),
thread_id_(thread_id),
@@ -269,14 +270,15 @@ MinidumpGenerator::MinidumpGenerator(
assert_info_(assert_info),
dump_type_(dump_type),
is_client_pointers_(is_client_pointers),
+ dump_path_(dump_path),
+ uuid_generated_(false),
dump_file_(INVALID_HANDLE_VALUE),
full_dump_file_(INVALID_HANDLE_VALUE),
dump_file_is_internal_(false),
full_dump_file_is_internal_(false),
additional_streams_(NULL),
- callback_info_(NULL),
- write_dump_(NULL),
- create_uuid_(NULL) {
+ callback_info_(NULL) {
+ uuid_ = {0};
InitializeCriticalSection(&module_load_sync_);
InitializeCriticalSection(&get_proc_address_sync_);
}
@@ -562,15 +564,17 @@ MinidumpGenerator::UuidCreateType MinidumpGenerator::GetCreateUuid() {
}
bool MinidumpGenerator::GenerateDumpFilePath(wstring* file_path) {
- UUID id = {0};
+ if (!uuid_generated_) {
+ UuidCreateType create_uuid = GetCreateUuid();
+ if (!create_uuid) {
+ return false;
+ }
- UuidCreateType create_uuid = GetCreateUuid();
- if (!create_uuid) {
- return false;
+ create_uuid(&uuid_);
+ uuid_generated_ = true;
}
- create_uuid(&id);
- wstring id_str = GUIDString::GUIDToWString(&id);
+ wstring id_str = GUIDString::GUIDToWString(&uuid_);
*file_path = dump_path_ + TEXT("\\") + id_str + TEXT(".dmp");
return true;
diff --git a/src/client/windows/crash_generation/minidump_generator.h b/src/client/windows/crash_generation/minidump_generator.h
index a3c12305..a707c0bb 100644
--- a/src/client/windows/crash_generation/minidump_generator.h
+++ b/src/client/windows/crash_generation/minidump_generator.h
@@ -168,6 +168,10 @@ class MinidumpGenerator {
// Folder path to store dump files.
std::wstring dump_path_;
+ // UUID used to make dump file names.
+ UUID uuid_;
+ bool uuid_generated_;
+
// The file where the dump will be written.
HANDLE dump_file_;
diff --git a/src/client/windows/handler/exception_handler.cc b/src/client/windows/handler/exception_handler.cc
index b78075de..ad45b200 100644
--- a/src/client/windows/handler/exception_handler.cc
+++ b/src/client/windows/handler/exception_handler.cc
@@ -41,18 +41,17 @@
namespace google_breakpad {
-static const int kWaitForHandlerThreadMs = 60000;
-static const int kExceptionHandlerThreadInitialStackSize = 64 * 1024;
-
-// As documented on MSDN, on failure SuspendThread returns (DWORD) -1
-static const DWORD kFailedToSuspendThread = static_cast<DWORD>(-1);
-
// This is passed as the context to the MinidumpWriteDump callback.
typedef struct {
AppMemoryList::const_iterator iter;
AppMemoryList::const_iterator end;
} MinidumpCallbackContext;
+// This define is new to Windows 10.
+#ifndef DBG_PRINTEXCEPTION_WIDE_C
+#define DBG_PRINTEXCEPTION_WIDE_C ((DWORD)0x4001000A)
+#endif
+
vector<ExceptionHandler*>* ExceptionHandler::handler_stack_ = NULL;
LONG ExceptionHandler::handler_stack_index_ = 0;
CRITICAL_SECTION ExceptionHandler::handler_stack_critical_section_;
@@ -217,6 +216,7 @@ void ExceptionHandler::Initialize(
// Don't attempt to create the thread if we could not create the semaphores.
if (handler_finish_semaphore_ != NULL && handler_start_semaphore_ != NULL) {
DWORD thread_id;
+ const int kExceptionHandlerThreadInitialStackSize = 64 * 1024;
handler_thread_ = CreateThread(NULL, // lpThreadAttributes
kExceptionHandlerThreadInitialStackSize,
ExceptionHandlerThreadMain,
@@ -353,6 +353,7 @@ ExceptionHandler::~ExceptionHandler() {
// inside DllMain.
is_shutdown_ = true;
ReleaseSemaphore(handler_start_semaphore_, 1, NULL);
+ const int kWaitForHandlerThreadMs = 60000;
WaitForSingleObject(handler_thread_, kWaitForHandlerThreadMs);
#else
TerminateThread(handler_thread_, 1);
@@ -387,7 +388,7 @@ DWORD ExceptionHandler::ExceptionHandlerThreadMain(void* lpParameter) {
assert(self->handler_start_semaphore_ != NULL);
assert(self->handler_finish_semaphore_ != NULL);
- while (true) {
+ for (;;) {
if (WaitForSingleObject(self->handler_start_semaphore_, INFINITE) ==
WAIT_OBJECT_0) {
// Perform the requested action.
@@ -480,7 +481,9 @@ LONG ExceptionHandler::HandleException(EXCEPTION_POINTERS* exinfo) {
DWORD code = exinfo->ExceptionRecord->ExceptionCode;
LONG action;
bool is_debug_exception = (code == EXCEPTION_BREAKPOINT) ||
- (code == EXCEPTION_SINGLE_STEP);
+ (code == EXCEPTION_SINGLE_STEP) ||
+ (code == DBG_PRINTEXCEPTION_C) ||
+ (code == DBG_PRINTEXCEPTION_WIDE_C);
if (code == EXCEPTION_INVALID_HANDLE &&
current_handler->consume_invalid_handle_exceptions_) {
@@ -764,9 +767,10 @@ bool ExceptionHandler::WriteMinidumpForException(EXCEPTION_POINTERS* exinfo) {
// static
bool ExceptionHandler::WriteMinidump(const wstring &dump_path,
MinidumpCallback callback,
- void* callback_context) {
+ void* callback_context,
+ MINIDUMP_TYPE dump_type) {
ExceptionHandler handler(dump_path, NULL, callback, callback_context,
- HANDLER_NONE);
+ HANDLER_NONE, dump_type, (HANDLE)NULL, NULL);
return handler.WriteMinidump();
}
@@ -775,10 +779,13 @@ bool ExceptionHandler::WriteMinidumpForChild(HANDLE child,
DWORD child_blamed_thread,
const wstring& dump_path,
MinidumpCallback callback,
- void* callback_context) {
+ void* callback_context,
+ MINIDUMP_TYPE dump_type) {
EXCEPTION_RECORD ex;
CONTEXT ctx;
EXCEPTION_POINTERS exinfo = { NULL, NULL };
+ // As documented on MSDN, on failure SuspendThread returns (DWORD) -1
+ const DWORD kFailedToSuspendThread = static_cast<DWORD>(-1);
DWORD last_suspend_count = kFailedToSuspendThread;
HANDLE child_thread_handle = OpenThread(THREAD_GET_CONTEXT |
THREAD_QUERY_INFORMATION |
@@ -806,7 +813,7 @@ bool ExceptionHandler::WriteMinidumpForChild(HANDLE child,
}
ExceptionHandler handler(dump_path, NULL, callback, callback_context,
- HANDLER_NONE);
+ HANDLER_NONE, dump_type, (HANDLE)NULL, NULL);
bool success = handler.WriteMinidumpWithExceptionForProcess(
child_blamed_thread,
exinfo.ExceptionRecord ? &exinfo : NULL,
@@ -969,7 +976,9 @@ bool ExceptionHandler::WriteMinidumpWithExceptionForProcess(
#if defined(_M_IX86)
exinfo->ContextRecord->Eip;
#elif defined(_M_AMD64)
- exinfo->ContextRecord->Rip;
+ exinfo->ContextRecord->Rip;
+#elif defined(_M_ARM64)
+ exinfo->ContextRecord->Pc;
#else
#error Unsupported platform
#endif
diff --git a/src/client/windows/handler/exception_handler.h b/src/client/windows/handler/exception_handler.h
index e3cd8146..11babe51 100644
--- a/src/client/windows/handler/exception_handler.h
+++ b/src/client/windows/handler/exception_handler.h
@@ -238,7 +238,8 @@ class ExceptionHandler {
// Convenience form of WriteMinidump which does not require an
// ExceptionHandler instance.
static bool WriteMinidump(const wstring &dump_path,
- MinidumpCallback callback, void* callback_context);
+ MinidumpCallback callback, void* callback_context,
+ MINIDUMP_TYPE dump_type = MiniDumpNormal);
// Write a minidump of |child| immediately. This can be used to
// capture the execution state of |child| independently of a crash.
@@ -249,7 +250,8 @@ class ExceptionHandler {
DWORD child_blamed_thread,
const wstring& dump_path,
MinidumpCallback callback,
- void* callback_context);
+ void* callback_context,
+ MINIDUMP_TYPE dump_type = MiniDumpNormal);
// Get the thread ID of the thread requesting the dump (either the exception
// thread or any other thread that called WriteMinidump directly). This
diff --git a/src/client/windows/sender/crash_report_sender.cc b/src/client/windows/sender/crash_report_sender.cc
index ecf626d8..eb2b422a 100644
--- a/src/client/windows/sender/crash_report_sender.cc
+++ b/src/client/windows/sender/crash_report_sender.cc
@@ -59,7 +59,7 @@ CrashReportSender::CrashReportSender(const wstring &checkpoint_file)
ReportResult CrashReportSender::SendCrashReport(
const wstring &url, const map<wstring, wstring> &parameters,
- const wstring &dump_file_name, wstring *report_code) {
+ const map<wstring, wstring> &files, wstring *report_code) {
int today = GetCurrentDate();
if (today == last_sent_date_ &&
max_reports_per_day_ != -1 &&
@@ -68,8 +68,8 @@ ReportResult CrashReportSender::SendCrashReport(
}
int http_response = 0;
- bool result = HTTPUpload::SendRequest(
- url, parameters, dump_file_name, L"upload_file_minidump", NULL, report_code,
+ bool result = HTTPUpload::SendMultipartPostRequest(
+ url, parameters, files, NULL, report_code,
&http_response);
if (result) {
diff --git a/src/client/windows/sender/crash_report_sender.h b/src/client/windows/sender/crash_report_sender.h
index da1ed0af..7786cc69 100644
--- a/src/client/windows/sender/crash_report_sender.h
+++ b/src/client/windows/sender/crash_report_sender.h
@@ -77,7 +77,7 @@ class CrashReportSender {
int max_reports_per_day() const { return max_reports_per_day_; }
- // Sends the specified minidump file, along with the map of
+ // Sends the specified files, along with the map of
// name value pairs, as a multipart POST request to the given URL.
// Parameter names must contain only printable ASCII characters,
// and may not contain a quote (") character.
@@ -89,7 +89,7 @@ class CrashReportSender {
// (Otherwise, report_code will be unchanged.)
ReportResult SendCrashReport(const wstring &url,
const map<wstring, wstring> &parameters,
- const wstring &dump_file_name,
+ const map<wstring, wstring> &files,
wstring *report_code);
private:
diff --git a/src/client/windows/tests/crash_generation_app/crash_generation_app.cc b/src/client/windows/tests/crash_generation_app/crash_generation_app.cc
index ad395d6c..0d837e52 100644
--- a/src/client/windows/tests/crash_generation_app/crash_generation_app.cc
+++ b/src/client/windows/tests/crash_generation_app/crash_generation_app.cc
@@ -73,7 +73,7 @@ BOOL InitInstance(HINSTANCE, int);
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
INT_PTR CALLBACK About(HWND, UINT, WPARAM, LPARAM);
-static int kCustomInfoCount = 2;
+static size_t kCustomInfoCount = 2;
static CustomInfoEntry kCustomInfoEntries[] = {
CustomInfoEntry(L"prod", L"CrashTestApp"),
CustomInfoEntry(L"ver", L"1.0"),
diff --git a/src/client/windows/unittests/client_tests.gyp b/src/client/windows/unittests/client_tests.gyp
index 7f9c7a02..768f8fd8 100644
--- a/src/client/windows/unittests/client_tests.gyp
+++ b/src/client/windows/unittests/client_tests.gyp
@@ -68,11 +68,13 @@
'sources': [
'<(DEPTH)/common/string_conversion.cc',
'<(DEPTH)/processor/basic_code_modules.cc',
+ '<(DEPTH)/processor/convert_old_arm64_context.cc',
'<(DEPTH)/processor/dump_context.cc',
'<(DEPTH)/processor/dump_object.cc',
'<(DEPTH)/processor/logging.cc',
'<(DEPTH)/processor/minidump.cc',
'<(DEPTH)/processor/pathname_stripper.cc',
+ '<(DEPTH)/processor/proc_maps_linux.cc',
]
}
],
diff --git a/src/client/windows/unittests/crash_generation_server_test.cc b/src/client/windows/unittests/crash_generation_server_test.cc
index cf95d43f..09f2dd20 100644
--- a/src/client/windows/unittests/crash_generation_server_test.cc
+++ b/src/client/windows/unittests/crash_generation_server_test.cc
@@ -28,9 +28,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#include "testing/gtest/include/gtest/gtest.h"
-#include "testing/include/gmock/gmock.h"
-
+#include "breakpad_googletest_includes.h"
#include "client/windows/crash_generation/crash_generation_server.h"
#include "client/windows/common/ipc_protocol.h"
@@ -50,9 +48,8 @@ const DWORD kPipeFlagsAndAttributes = SECURITY_IDENTIFICATION |
const DWORD kPipeMode = PIPE_READMODE_MESSAGE;
-int kCustomInfoCount = 2;
-
-google_breakpad::CustomInfoEntry kCustomInfoEntries[] = {
+#define arraysize(f) (sizeof(f) / sizeof(*f))
+const google_breakpad::CustomInfoEntry kCustomInfoEntries[] = {
google_breakpad::CustomInfoEntry(L"prod", L"CrashGenerationServerTest"),
google_breakpad::CustomInfoEntry(L"ver", L"1.0"),
};
@@ -165,7 +162,7 @@ class CrashGenerationServerTest : public ::testing::Test {
}
google_breakpad::CustomClientInfo custom_info = {kCustomInfoEntries,
- kCustomInfoCount};
+ arraysize(kCustomInfoEntries)};
google_breakpad::ProtocolMessage msg(
fault_type == SEND_INVALID_REGISTRATION ?
diff --git a/src/client/windows/unittests/dump_analysis.cc b/src/client/windows/unittests/dump_analysis.cc
index 6bf85471..53d4ddbd 100644
--- a/src/client/windows/unittests/dump_analysis.cc
+++ b/src/client/windows/unittests/dump_analysis.cc
@@ -31,8 +31,8 @@
#include <objbase.h>
#include <dbghelp.h>
+#include "breakpad_googletest_includes.h"
#include "client/windows/unittests/dump_analysis.h" // NOLINT
-#include "testing/gtest/include/gtest/gtest.h"
DumpAnalysis::~DumpAnalysis() {
if (dump_file_view_ != NULL) {
diff --git a/src/client/windows/unittests/exception_handler_death_test.cc b/src/client/windows/unittests/exception_handler_death_test.cc
index 079ca3d6..5ef9e64d 100644
--- a/src/client/windows/unittests/exception_handler_death_test.cc
+++ b/src/client/windows/unittests/exception_handler_death_test.cc
@@ -82,7 +82,7 @@ void ExceptionHandlerDeathTest::SetUp() {
// The test case name is exposed as a c-style string,
// convert it to a wchar_t string.
int dwRet = MultiByteToWideChar(CP_ACP, 0, test_info->name(),
- strlen(test_info->name()),
+ static_cast<int>(strlen(test_info->name())),
test_name_wide,
MAX_PATH);
if (!dwRet) {
@@ -293,8 +293,8 @@ wstring find_minidump_in_directory(const wstring &directory) {
wstring filename;
do {
const wchar_t extension[] = L".dmp";
- const int extension_length = sizeof(extension) / sizeof(extension[0]) - 1;
- const int filename_length = wcslen(find_data.cFileName);
+ const size_t extension_length = sizeof(extension) / sizeof(extension[0]) - 1;
+ const size_t filename_length = wcslen(find_data.cFileName);
if (filename_length > extension_length &&
wcsncmp(extension,
find_data.cFileName + filename_length - extension_length,
@@ -357,8 +357,8 @@ TEST_F(ExceptionHandlerDeathTest, InstructionPointerMemory) {
// Read the minidump. Locate the exception record and the
// memory list, and then ensure that there is a memory region
- // in the memory list that covers the instruction pointer from
- // the exception record.
+ // in the memory list that covers at least 128 bytes on either
+ // side of the instruction pointer from the exception record.
{
Minidump minidump(minidump_filename);
ASSERT_TRUE(minidump.Read());
@@ -379,18 +379,23 @@ TEST_F(ExceptionHandlerDeathTest, InstructionPointerMemory) {
memory_list->GetMemoryRegionForAddress(instruction_pointer);
ASSERT_TRUE(region);
- EXPECT_EQ(kMemorySize, region->GetSize());
+ EXPECT_LE(kMemorySize, region->GetSize());
const uint8_t* bytes = region->GetMemory();
ASSERT_TRUE(bytes);
+ uint64_t ip_offset = instruction_pointer - region->GetBase();
+ EXPECT_GE(region->GetSize() - kOffset, ip_offset);
+ EXPECT_LE(kOffset, ip_offset);
+
uint8_t prefix_bytes[kOffset];
uint8_t suffix_bytes[kMemorySize - kOffset - sizeof(instructions)];
memset(prefix_bytes, 0, sizeof(prefix_bytes));
memset(suffix_bytes, 0, sizeof(suffix_bytes));
- EXPECT_EQ(0, memcmp(bytes, prefix_bytes, sizeof(prefix_bytes)));
- EXPECT_EQ(0, memcmp(bytes + kOffset, instructions, sizeof(instructions)));
- EXPECT_EQ(0, memcmp(bytes + kOffset + sizeof(instructions),
- suffix_bytes, sizeof(suffix_bytes)));
+ EXPECT_EQ(0, memcmp(bytes + ip_offset - kOffset, prefix_bytes,
+ sizeof(prefix_bytes)));
+ EXPECT_EQ(0, memcmp(bytes + ip_offset, instructions, sizeof(instructions)));
+ EXPECT_EQ(0, memcmp(bytes + ip_offset + sizeof(instructions), suffix_bytes,
+ sizeof(suffix_bytes)));
}
DeleteFileW(minidump_filename_wide.c_str());
diff --git a/src/client/windows/unittests/exception_handler_test.cc b/src/client/windows/unittests/exception_handler_test.cc
index 55275323..a4ce12a8 100644
--- a/src/client/windows/unittests/exception_handler_test.cc
+++ b/src/client/windows/unittests/exception_handler_test.cc
@@ -120,7 +120,7 @@ void ExceptionHandlerTest::SetUp() {
// THe test case name is exposed to use as a c-style string,
// But we might be working in UNICODE here on Windows.
int dwRet = MultiByteToWideChar(CP_ACP, 0, test_info->name(),
- strlen(test_info->name()),
+ static_cast<int>(strlen(test_info->name())),
test_name_wide,
MAX_PATH);
if (!dwRet) {
@@ -247,6 +247,7 @@ TEST_F(ExceptionHandlerTest, InvalidParameterMiniDumpTest) {
EXPECT_EXIT(DoCrashInvalidParameter(), ::testing::ExitedWithCode(0), "");
ASSERT_TRUE(!dump_file.empty() && !full_dump_file.empty());
ASSERT_TRUE(DoesPathExist(dump_file.c_str()));
+ ASSERT_TRUE(DoesPathExist(full_dump_file.c_str()));
// Verify the dump for infos.
DumpAnalysis mini(dump_file);
@@ -318,6 +319,7 @@ TEST_F(ExceptionHandlerTest, PureVirtualCallMiniDumpTest) {
EXPECT_EXIT(DoCrashPureVirtualCall(), ::testing::ExitedWithCode(0), "");
ASSERT_TRUE(!dump_file.empty() && !full_dump_file.empty());
ASSERT_TRUE(DoesPathExist(dump_file.c_str()));
+ ASSERT_TRUE(DoesPathExist(full_dump_file.c_str()));
// Verify the dump for infos.
DumpAnalysis mini(dump_file);
diff --git a/src/client/windows/unittests/minidump_test.cc b/src/client/windows/unittests/minidump_test.cc
index 8d2d726c..82641125 100644
--- a/src/client/windows/unittests/minidump_test.cc
+++ b/src/client/windows/unittests/minidump_test.cc
@@ -31,11 +31,10 @@
#include <objbase.h>
#include <dbghelp.h>
+#include "breakpad_googletest_includes.h"
#include "client/windows/crash_generation/minidump_generator.h"
#include "client/windows/unittests/dump_analysis.h" // NOLINT
-#include "gtest/gtest.h"
-
namespace {
// Minidump with stacks, PEB, TEB, and unloaded module list.
@@ -94,7 +93,7 @@ class MinidumpTest: public testing::Test {
STATUS_ACCESS_VIOLATION, // ExceptionCode
0, // ExceptionFlags
NULL, // ExceptionRecord;
- reinterpret_cast<void*>(0xCAFEBABE), // ExceptionAddress;
+ reinterpret_cast<void*>(static_cast<uintptr_t>(0xCAFEBABE)), // ExceptionAddress;
2, // NumberParameters;
{ EXCEPTION_WRITE_FAULT, reinterpret_cast<ULONG_PTR>(this) }
};
diff --git a/src/client/windows/unittests/testing.gyp b/src/client/windows/unittests/testing.gyp
index 141d0ed0..0f9f944c 100644
--- a/src/client/windows/unittests/testing.gyp
+++ b/src/client/windows/unittests/testing.gyp
@@ -38,11 +38,12 @@
'type': 'static_library',
'include_dirs': [
'<(DEPTH)/testing/include',
- '<(DEPTH)/testing/gtest',
- '<(DEPTH)/testing/gtest/include',
+ '<(DEPTH)/testing/googletest/include',
+ '<(DEPTH)/testing/googletest',
+ '<(DEPTH)/testing',
],
'sources': [
- '<(DEPTH)/testing/gtest/src/gtest-all.cc',
+ '<(DEPTH)/testing/googletest/src/gtest-all.cc',
],
'direct_dependent_settings': {
'include_dirs': [
@@ -52,31 +53,37 @@
# Visual C++ implements variadic templates strangely, and
# VC++2012 broke Google Test by lowering this value. See
# http://stackoverflow.com/questions/12558327/google-test-in-visual-studio-2012
- 'defines': ['_VARIADIC_MAX=10'],
+ 'defines': ['_VARIADIC_MAX=10', '_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING'],
},
- 'defines': ['_VARIADIC_MAX=10'],
+ 'defines': ['_VARIADIC_MAX=10', '_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING'],
},
{
'target_name': 'gmock',
'type': 'static_library',
'include_dirs': [
'<(DEPTH)/testing/include',
- '<(DEPTH)/testing/',
- '<(DEPTH)/testing/gtest',
- '<(DEPTH)/testing/gtest/include',
+ '<(DEPTH)/testing/googletest/include',
+ '<(DEPTH)/testing/googletest',
+ '<(DEPTH)/testing/googlemock/include',
+ '<(DEPTH)/testing/googlemock',
+ '<(DEPTH)/testing',
],
'sources': [
- '<(DEPTH)/testing/src/gmock-all.cc',
- '<(DEPTH)/testing/src/gmock_main.cc',
+ '<(DEPTH)/testing/googlemock/src/gmock-all.cc',
+ '<(DEPTH)/testing/googletest/src/gtest_main.cc',
],
'direct_dependent_settings': {
'include_dirs': [
'<(DEPTH)/testing/include',
- '<(DEPTH)/testing/gtest/include',
+ '<(DEPTH)/testing/googletest/include',
+ '<(DEPTH)/testing/googletest',
+ '<(DEPTH)/testing/googlemock/include',
+ '<(DEPTH)/testing/googlemock',
+ '<(DEPTH)/testing',
],
- 'defines': ['_VARIADIC_MAX=10'],
+ 'defines': ['_VARIADIC_MAX=10', '_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING'],
},
- 'defines': ['_VARIADIC_MAX=10'],
+ 'defines': ['_VARIADIC_MAX=10', '_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING'],
},
],
diff --git a/src/common/android/include/asm-mips/README.md b/src/common/android/include/asm-mips/README.md
new file mode 100644
index 00000000..b56ee60f
--- /dev/null
+++ b/src/common/android/include/asm-mips/README.md
@@ -0,0 +1,9 @@
+# asm-mips
+
+The files in this directory are almost direct copies from Android NDK r12, with
+the exception of changing the include guards to Breakpad ones. They are copied
+from the MIPS asm/ directory, but are meant to be used as replacements for both
+asm/ and machine/ includes since the files in each are largely duplicates.
+
+Some MIPS asm/ and all machine/ headers were removed in the move to unified NDK
+headers, so Breakpad fails to compile on newer NDK versions without these files. \ No newline at end of file
diff --git a/src/common/android/include/asm-mips/asm.h b/src/common/android/include/asm-mips/asm.h
new file mode 100644
index 00000000..8f086e75
--- /dev/null
+++ b/src/common/android/include/asm-mips/asm.h
@@ -0,0 +1,270 @@
+#ifndef GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_ASM_MIPS_ASM_H
+#define GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_ASM_MIPS_ASM_H
+
+#if defined(__has_include_next) && __has_include_next(<asm/asm.h>)
+#include_next <asm/asm.h>
+#else
+
+/****************************************************************************
+ ****************************************************************************
+ ***
+ *** This header was automatically generated from a Linux kernel header
+ *** of the same name, to make information necessary for userspace to
+ *** call into the kernel available to libc. It contains only constants,
+ *** structures, and macros generated from the original header, and thus,
+ *** contains no copyrightable information.
+ ***
+ *** To edit the content of this header, modify the corresponding
+ *** source file (e.g. under external/kernel-headers/original/) then
+ *** run bionic/libc/kernel/tools/update_all.py
+ ***
+ *** Any manual change here will be lost the next time this script will
+ *** be run. You've been warned!
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+
+#include <asm/sgidefs.h>
+#ifndef CAT
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#ifdef __STDC__
+#define __CAT(str1, str2) str1##str2
+#else
+#define __CAT(str1, str2) str1 str2
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#endif
+#define CAT(str1, str2) __CAT(str1, str2)
+#endif
+#ifdef __PIC__
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define CPRESTORE(register) .cprestore register
+#define CPADD(register) .cpadd register
+#define CPLOAD(register) .cpload register
+#else
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define CPRESTORE(register)
+#define CPADD(register)
+#define CPLOAD(register)
+#endif
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define LEAF(symbol) .globl symbol; .align 2; .type symbol, @function; .ent symbol, 0; symbol: .frame sp, 0, ra
+#define NESTED(symbol, framesize, rpc) .globl symbol; .align 2; .type symbol, @function; .ent symbol, 0; symbol: .frame sp, framesize, rpc
+#define END(function) .end function; .size function, .-function
+#define EXPORT(symbol) .globl symbol; symbol:
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define FEXPORT(symbol) .globl symbol; .type symbol, @function; symbol:
+#define ABS(symbol,value) .globl symbol; symbol = value
+#define PANIC(msg) .set push; .set reorder; PTR_LA a0, 8f; jal panic; 9: b 9b; .set pop; TEXT(msg)
+#define PRINT(string)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define TEXT(msg) .pushsection .data; 8: .asciiz msg; .popsection;
+#define TTABLE(string) .pushsection .text; .word 1f; .popsection .pushsection .data; 1: .asciiz string; .popsection
+#define PREF(hint, addr)
+#define PREFX(hint, addr)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#if _MIPS_ISA == _MIPS_ISA_MIPS1
+#define MOVN(rd, rs, rt) .set push; .set reorder; beqz rt, 9f; move rd, rs; .set pop; 9:
+#define MOVZ(rd, rs, rt) .set push; .set reorder; bnez rt, 9f; move rd, rs; .set pop; 9:
+#endif
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#if _MIPS_ISA == _MIPS_ISA_MIPS2 || _MIPS_ISA == _MIPS_ISA_MIPS3
+#define MOVN(rd, rs, rt) .set push; .set noreorder; bnezl rt, 9f; move rd, rs; .set pop; 9:
+#define MOVZ(rd, rs, rt) .set push; .set noreorder; beqzl rt, 9f; move rd, rs; .set pop; 9:
+#endif
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#if _MIPS_ISA == _MIPS_ISA_MIPS4 || _MIPS_ISA == _MIPS_ISA_MIPS5 || _MIPS_ISA == _MIPS_ISA_MIPS32 || _MIPS_ISA == _MIPS_ISA_MIPS64
+#define MOVN(rd, rs, rt) movn rd, rs, rt
+#define MOVZ(rd, rs, rt) movz rd, rs, rt
+#endif
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#if _MIPS_SIM == _MIPS_SIM_ABI32
+#define ALSZ 7
+#define ALMASK ~7
+#endif
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#if _MIPS_SIM == _MIPS_SIM_NABI32 || _MIPS_SIM == _MIPS_SIM_ABI64
+#define ALSZ 15
+#define ALMASK ~15
+#endif
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#ifdef __mips64
+#define SZREG 8
+#else
+#define SZREG 4
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#endif
+#if _MIPS_SIM == _MIPS_SIM_ABI32
+#define REG_S sw
+#define REG_L lw
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define REG_SUBU subu
+#define REG_ADDU addu
+#endif
+#if _MIPS_SIM == _MIPS_SIM_NABI32 || _MIPS_SIM == _MIPS_SIM_ABI64
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define REG_S sd
+#define REG_L ld
+#define REG_SUBU dsubu
+#define REG_ADDU daddu
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#endif
+#if _MIPS_SZINT == 32
+#define INT_ADD add
+#define INT_ADDU addu
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define INT_ADDI addi
+#define INT_ADDIU addiu
+#define INT_SUB sub
+#define INT_SUBU subu
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define INT_L lw
+#define INT_S sw
+#define INT_SLL sll
+#define INT_SLLV sllv
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define INT_SRL srl
+#define INT_SRLV srlv
+#define INT_SRA sra
+#define INT_SRAV srav
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#endif
+#if _MIPS_SZINT == 64
+#define INT_ADD dadd
+#define INT_ADDU daddu
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define INT_ADDI daddi
+#define INT_ADDIU daddiu
+#define INT_SUB dsub
+#define INT_SUBU dsubu
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define INT_L ld
+#define INT_S sd
+#define INT_SLL dsll
+#define INT_SLLV dsllv
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define INT_SRL dsrl
+#define INT_SRLV dsrlv
+#define INT_SRA dsra
+#define INT_SRAV dsrav
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#endif
+#if _MIPS_SZLONG == 32
+#define LONG_ADD add
+#define LONG_ADDU addu
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define LONG_ADDI addi
+#define LONG_ADDIU addiu
+#define LONG_SUB sub
+#define LONG_SUBU subu
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define LONG_L lw
+#define LONG_S sw
+#define LONG_SLL sll
+#define LONG_SLLV sllv
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define LONG_SRL srl
+#define LONG_SRLV srlv
+#define LONG_SRA sra
+#define LONG_SRAV srav
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define LONG .word
+#define LONGSIZE 4
+#define LONGMASK 3
+#define LONGLOG 2
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#endif
+#if _MIPS_SZLONG == 64
+#define LONG_ADD dadd
+#define LONG_ADDU daddu
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define LONG_ADDI daddi
+#define LONG_ADDIU daddiu
+#define LONG_SUB dsub
+#define LONG_SUBU dsubu
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define LONG_L ld
+#define LONG_S sd
+#define LONG_SLL dsll
+#define LONG_SLLV dsllv
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define LONG_SRL dsrl
+#define LONG_SRLV dsrlv
+#define LONG_SRA dsra
+#define LONG_SRAV dsrav
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define LONG .dword
+#define LONGSIZE 8
+#define LONGMASK 7
+#define LONGLOG 3
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#endif
+#if _MIPS_SZPTR == 32
+#define PTR_ADD add
+#define PTR_ADDU addu
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define PTR_ADDI addi
+#define PTR_ADDIU addiu
+#define PTR_SUB sub
+#define PTR_SUBU subu
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define PTR_L lw
+#define PTR_S sw
+#define PTR_LA la
+#define PTR_LI li
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define PTR_SLL sll
+#define PTR_SLLV sllv
+#define PTR_SRL srl
+#define PTR_SRLV srlv
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define PTR_SRA sra
+#define PTR_SRAV srav
+#define PTR_SCALESHIFT 2
+#define PTR .word
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define PTRSIZE 4
+#define PTRLOG 2
+#endif
+#if _MIPS_SZPTR == 64
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define PTR_ADD dadd
+#define PTR_ADDU daddu
+#define PTR_ADDI daddi
+#define PTR_ADDIU daddiu
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define PTR_SUB dsub
+#define PTR_SUBU dsubu
+#define PTR_L ld
+#define PTR_S sd
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define PTR_LA dla
+#define PTR_LI dli
+#define PTR_SLL dsll
+#define PTR_SLLV dsllv
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define PTR_SRL dsrl
+#define PTR_SRLV dsrlv
+#define PTR_SRA dsra
+#define PTR_SRAV dsrav
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define PTR_SCALESHIFT 3
+#define PTR .dword
+#define PTRSIZE 8
+#define PTRLOG 3
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#endif
+#if _MIPS_SIM == _MIPS_SIM_ABI32
+#define MFC0 mfc0
+#define MTC0 mtc0
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#endif
+#if _MIPS_SIM == _MIPS_SIM_NABI32 || _MIPS_SIM == _MIPS_SIM_ABI64
+#define MFC0 dmfc0
+#define MTC0 dmtc0
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#endif
+#define SSNOP sll zero, zero, 1
+#define R10KCBARRIER(addr)
+#endif // defined(__has_include_next) && __has_include_next(<asm/asm.h>)
+#endif // GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_ASM_MIPS_ASM_H
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
diff --git a/src/common/android/include/asm-mips/fpregdef.h b/src/common/android/include/asm-mips/fpregdef.h
new file mode 100644
index 00000000..a6eedc0e
--- /dev/null
+++ b/src/common/android/include/asm-mips/fpregdef.h
@@ -0,0 +1,117 @@
+#ifndef GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_ASM_MIPS_FPREGDEF_H
+#define GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_ASM_MIPS_FPREGDEF_H
+
+#if defined(__has_include_next) && __has_include_next(<asm/fpregdef.h>)
+#include_next <asm/fpregdef.h>
+#else
+
+/****************************************************************************
+ ****************************************************************************
+ ***
+ *** This header was automatically generated from a Linux kernel header
+ *** of the same name, to make information necessary for userspace to
+ *** call into the kernel available to libc. It contains only constants,
+ *** structures, and macros generated from the original header, and thus,
+ *** contains no copyrightable information.
+ ***
+ *** To edit the content of this header, modify the corresponding
+ *** source file (e.g. under external/kernel-headers/original/) then
+ *** run bionic/libc/kernel/tools/update_all.py
+ ***
+ *** Any manual change here will be lost the next time this script will
+ *** be run. You've been warned!
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+
+#include <asm/sgidefs.h>
+#if _MIPS_SIM == _MIPS_SIM_ABI32
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define fv0 $f0
+#define fv0f $f1
+#define fv1 $f2
+#define fv1f $f3
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define fa0 $f12
+#define fa0f $f13
+#define fa1 $f14
+#define fa1f $f15
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define ft0 $f4
+#define ft0f $f5
+#define ft1 $f6
+#define ft1f $f7
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define ft2 $f8
+#define ft2f $f9
+#define ft3 $f10
+#define ft3f $f11
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define ft4 $f16
+#define ft4f $f17
+#define ft5 $f18
+#define ft5f $f19
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define fs0 $f20
+#define fs0f $f21
+#define fs1 $f22
+#define fs1f $f23
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define fs2 $f24
+#define fs2f $f25
+#define fs3 $f26
+#define fs3f $f27
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define fs4 $f28
+#define fs4f $f29
+#define fs5 $f30
+#define fs5f $f31
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define fcr31 $31
+#endif
+#if _MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _MIPS_SIM_NABI32
+#define fv0 $f0
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define fv1 $f2
+#define fa0 $f12
+#define fa1 $f13
+#define fa2 $f14
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define fa3 $f15
+#define fa4 $f16
+#define fa5 $f17
+#define fa6 $f18
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define fa7 $f19
+#define ft0 $f4
+#define ft1 $f5
+#define ft2 $f6
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define ft3 $f7
+#define ft4 $f8
+#define ft5 $f9
+#define ft6 $f10
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define ft7 $f11
+#define ft8 $f20
+#define ft9 $f21
+#define ft10 $f22
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define ft11 $f23
+#define ft12 $f1
+#define ft13 $f3
+#define fs0 $f24
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define fs1 $f25
+#define fs2 $f26
+#define fs3 $f27
+#define fs4 $f28
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define fs5 $f29
+#define fs6 $f30
+#define fs7 $f31
+#define fcr31 $31
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#endif
+#endif // defined(__has_include_next) && __has_include_next(<asm/fpregdef.h>)
+#endif // GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_ASM_MIPS_FPREGDEF_H
diff --git a/src/common/android/include/asm-mips/regdef.h b/src/common/android/include/asm-mips/regdef.h
new file mode 100644
index 00000000..a7fd7690
--- /dev/null
+++ b/src/common/android/include/asm-mips/regdef.h
@@ -0,0 +1,125 @@
+#ifndef GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_ASM_MIPS_REGDEF_H
+#define GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_ASM_MIPS_REGDEF_H
+
+#if defined(__has_include_next) && __has_include_next(<asm/regdef.h>)
+#include_next <asm/regdef.h>
+#else
+
+/****************************************************************************
+ ****************************************************************************
+ ***
+ *** This header was automatically generated from a Linux kernel header
+ *** of the same name, to make information necessary for userspace to
+ *** call into the kernel available to libc. It contains only constants,
+ *** structures, and macros generated from the original header, and thus,
+ *** contains no copyrightable information.
+ ***
+ *** To edit the content of this header, modify the corresponding
+ *** source file (e.g. under external/kernel-headers/original/) then
+ *** run bionic/libc/kernel/tools/update_all.py
+ ***
+ *** Any manual change here will be lost the next time this script will
+ *** be run. You've been warned!
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+
+#include <asm/sgidefs.h>
+#if _MIPS_SIM == _MIPS_SIM_ABI32
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define zero $0
+#define AT $1
+#define v0 $2
+#define v1 $3
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define a0 $4
+#define a1 $5
+#define a2 $6
+#define a3 $7
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define t0 $8
+#define t1 $9
+#define t2 $10
+#define t3 $11
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define t4 $12
+#define t5 $13
+#define t6 $14
+#define t7 $15
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define s0 $16
+#define s1 $17
+#define s2 $18
+#define s3 $19
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define s4 $20
+#define s5 $21
+#define s6 $22
+#define s7 $23
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define t8 $24
+#define t9 $25
+#define jp $25
+#define k0 $26
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define k1 $27
+#define gp $28
+#define sp $29
+#define fp $30
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define s8 $30
+#define ra $31
+#endif
+#if _MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _MIPS_SIM_NABI32
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define zero $0
+#define AT $at
+#define v0 $2
+#define v1 $3
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define a0 $4
+#define a1 $5
+#define a2 $6
+#define a3 $7
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define a4 $8
+#define ta0 $8
+#define a5 $9
+#define ta1 $9
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define a6 $10
+#define ta2 $10
+#define a7 $11
+#define ta3 $11
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define t0 $12
+#define t1 $13
+#define t2 $14
+#define t3 $15
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define s0 $16
+#define s1 $17
+#define s2 $18
+#define s3 $19
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define s4 $20
+#define s5 $21
+#define s6 $22
+#define s7 $23
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define t8 $24
+#define t9 $25
+#define jp $25
+#define k0 $26
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define k1 $27
+#define gp $28
+#define sp $29
+#define fp $30
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define s8 $30
+#define ra $31
+#endif
+#endif // defined(__has_include_next) && __has_include_next(<asm/regdef.h>)
+#endif // GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_ASM_MIPS_REGDEF_H
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
diff --git a/src/common/android/include/elf.h b/src/common/android/include/elf.h
index b2a28df4..e6f0c672 100644
--- a/src/common/android/include/elf.h
+++ b/src/common/android/include/elf.h
@@ -109,17 +109,6 @@ typedef struct {
} Elf64_Dyn;
-// __WORDSIZE is GLibc-specific and used by Google Breakpad on Linux.
-#ifndef __WORDSIZE
-#if defined(__i386__) || defined(__ARM_EABI__) || defined(__mips__)
-#define __WORDSIZE 32
-#elif defined(__x86_64__) || defined(__aarch64__)
-#define __WORDSIZE 64
-#else
-#error "Unsupported Android CPU ABI"
-#endif
-#endif
-
// The Android headers don't always define this constant.
#ifndef EM_X86_64
#define EM_X86_64 62
diff --git a/src/testing/gtest/test/gtest-param-test_test.h b/src/common/android/include/link.h
index 26ea122b..4324629d 100644
--- a/src/testing/gtest/test/gtest-param-test_test.h
+++ b/src/common/android/include/link.h
@@ -1,4 +1,4 @@
-// Copyright 2008, Google Inc.
+// Copyright (c) 2012, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
@@ -26,32 +26,52 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Authors: vladl@google.com (Vlad Losev)
-//
-// The Google C++ Testing Framework (Google Test)
-//
-// This header file provides classes and functions used internally
-// for testing Google Test itself.
-#ifndef GTEST_TEST_GTEST_PARAM_TEST_TEST_H_
-#define GTEST_TEST_GTEST_PARAM_TEST_TEST_H_
+#ifndef GOOGLE_BREAKPAD_ANDROID_INCLUDE_LINK_H
+#define GOOGLE_BREAKPAD_ANDROID_INCLUDE_LINK_H
+
+/* Android doesn't provide all the data-structures required in its <link.h>.
+ Provide custom version here. */
+#include_next <link.h>
-#include "gtest/gtest.h"
+#include <android/api-level.h>
-#if GTEST_HAS_PARAM_TEST
+// TODO(rmcilroy): Remove this file once the NDK API level is updated to at
+// least 21 for all architectures. https://crbug.com/358831
-// Test fixture for testing definition and instantiation of a test
-// in separate translation units.
-class ExternalInstantiationTest : public ::testing::TestWithParam<int> {
+// These structures are only present in traditional headers at API level 21 and
+// above. Unified headers define these structures regardless of the chosen API
+// level. __ANDROID_API_N__ is a proxy for determining whether unified headers
+// are in use. It’s only defined by unified headers.
+#if __ANDROID_API__ < 21 && !defined(__ANDROID_API_N__)
+
+#ifdef __cplusplus
+extern "C" {
+#endif // __cplusplus
+
+struct r_debug {
+ int r_version;
+ struct link_map* r_map;
+ ElfW(Addr) r_brk;
+ enum {
+ RT_CONSISTENT,
+ RT_ADD,
+ RT_DELETE } r_state;
+ ElfW(Addr) r_ldbase;
};
-// Test fixture for testing instantiation of a test in multiple
-// translation units.
-class InstantiationInMultipleTranslaionUnitsTest
- : public ::testing::TestWithParam<int> {
+struct link_map {
+ ElfW(Addr) l_addr;
+ char* l_name;
+ ElfW(Dyn)* l_ld;
+ struct link_map* l_next;
+ struct link_map* l_prev;
};
-#endif // GTEST_HAS_PARAM_TEST
+#ifdef __cplusplus
+} // extern "C"
+#endif // __cplusplus
+
+#endif // __ANDROID_API__ < 21 && !defined(__ANDROID_API_N__)
-#endif // GTEST_TEST_GTEST_PARAM_TEST_TEST_H_
+#endif /* GOOGLE_BREAKPAD_ANDROID_INCLUDE_LINK_H */
diff --git a/src/common/android/include/sgidefs.h b/src/common/android/include/sgidefs.h
index 33796dcf..78f8f05a 100644
--- a/src/common/android/include/sgidefs.h
+++ b/src/common/android/include/sgidefs.h
@@ -26,16 +26,12 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
#ifndef GOOGLE_BREAKPAD_ANDROID_INCLUDE_SGIDEFS_H
#define GOOGLE_BREAKPAD_ANDROID_INCLUDE_SGIDEFS_H
-
#ifdef __mips__
-
// Android doesn't contain sgidefs.h, but does have <asm/sgidefs.h> which
// contains what we need.
#include <asm/sgidefs.h>
-
#endif // __mips__
-
#endif // GOOGLE_BREAKPAD_ANDROID_INCLUDE_SGIDEFS_H
+
diff --git a/src/common/android/include/sys/procfs.h b/src/common/android/include/sys/procfs.h
index bedae34a..18512436 100644
--- a/src/common/android/include/sys/procfs.h
+++ b/src/common/android/include/sys/procfs.h
@@ -38,6 +38,9 @@
#include <asm/ptrace.h>
#include <sys/cdefs.h>
+#if defined (__mips__)
+#include <sys/types.h>
+#endif
#include <sys/user.h>
#include <unistd.h>
@@ -98,8 +101,8 @@ struct elf_prpsinfo {
unsigned int pr_uid;
unsigned int pr_gid;
#elif defined(__mips__)
- unsigned long pr_uid;
- unsigned long pr_gid;
+ __kernel_uid_t pr_uid;
+ __kernel_gid_t pr_gid;
#else
unsigned short pr_uid;
unsigned short pr_gid;
diff --git a/src/common/android/include/sys/user.h b/src/common/android/include/sys/user.h
index ddb9ec71..9c27ef02 100644
--- a/src/common/android/include/sys/user.h
+++ b/src/common/android/include/sys/user.h
@@ -33,106 +33,37 @@
// The purpose of this file is to glue the mismatching headers (Android NDK vs
// glibc) and therefore avoid doing otherwise awkward #ifdefs in the code.
// The following quirks are currently handled by this file:
-// - MIPS: Keep using forked definitions of user.h structs. The definition in
-// the NDK is completely different. Internal bug b/18097715
// - i386: Use the Android NDK but alias user_fxsr_struct > user_fpxregs_struct.
-// - x86_64: Override a typo in user_fpregs_struct (mxcsr_mask -> mxcr_mask).
-// The typo has been fixed in NDK r10d, but a preprocessor workaround is
-// required to make breakpad build with r10c and lower (more details below).
-// - Other platforms: Just use the Android NDK unchanged.
-#ifdef __mips__
-#ifdef __cplusplus
-extern "C" {
-#endif // __cplusplus
-
-#define EF_REG0 6
-#define EF_REG1 7
-#define EF_REG2 8
-#define EF_REG3 9
-#define EF_REG4 10
-#define EF_REG5 11
-#define EF_REG6 12
-#define EF_REG7 13
-#define EF_REG8 14
-#define EF_REG9 15
-#define EF_REG10 16
-#define EF_REG11 17
-#define EF_REG12 18
-#define EF_REG13 19
-#define EF_REG14 20
-#define EF_REG15 21
-#define EF_REG16 22
-#define EF_REG17 23
-#define EF_REG18 24
-#define EF_REG19 25
-#define EF_REG20 26
-#define EF_REG21 27
-#define EF_REG22 28
-#define EF_REG23 29
-#define EF_REG24 30
-#define EF_REG25 31
+// TODO(primiano): remove these changes after Chromium has stably rolled to
+// an NDK with the appropriate fixes. https://crbug.com/358831
-/*
- * k0/k1 unsaved
- */
-#define EF_REG26 32
-#define EF_REG27 33
-#define EF_REG28 34
-#define EF_REG29 35
-#define EF_REG30 36
-#define EF_REG31 37
+// With traditional headers, <sys/user.h> forgot to do this. Unified headers get
+// it right.
+#include <sys/types.h>
-/*
- * Saved special registers
- */
-#define EF_LO 38
-#define EF_HI 39
-#define EF_CP0_EPC 40
-#define EF_CP0_BADVADDR 41
-#define EF_CP0_STATUS 42
-#define EF_CP0_CAUSE 43
-
-struct user_regs_struct {
- unsigned long long regs[32];
- unsigned long long lo;
- unsigned long long hi;
- unsigned long long epc;
- unsigned long long badvaddr;
- unsigned long long status;
- unsigned long long cause;
-};
+#include_next <sys/user.h>
-struct user_fpregs_struct {
- unsigned long long regs[32];
- unsigned int fpcsr;
- unsigned int fir;
-};
+#include <android/api-level.h>
#ifdef __cplusplus
-} // extern "C"
+extern "C" {
#endif // __cplusplus
-#else // __mips__
-
-// TODO(primiano): remove this after Chromium has stably rolled to NDK r10d.
-// Historical context: NDK releases < r10d had a typo in sys/user.h (mxcsr_mask
-// instead of mxcr_mask), which is fixed in r10d. However, just switching to use
-// the correct one (mxcr_mask) would put Breakpad in a state where it can be
-// rolled in chromium only atomically with the r10d NDK. A revert of either
-// project (android_tools, breakpad) would make the other one unrollable.
-// This hack makes breakpad code compatible with both r10c and r10d NDKs,
-// reducing the dependency entangling with android_tools.
-#if defined(__x86_64__)
-#define mxcsr_mask mxcr_mask
-#endif
+#if defined(__i386__)
+#if __ANDROID_API__ < 21 && !defined(__ANDROID_API_N__)
-#include_next <sys/user.h>
+// user_fpxregs_struct was called user_fxsr_struct in traditional headers before
+// API level 21. Unified headers call it user_fpxregs_struct regardless of the
+// chosen API level. __ANDROID_API_N__ is a proxy for determining whether
+// unified headers are in use. It’s only defined by unified headers.
+typedef struct user_fxsr_struct user_fpxregs_struct;
-#if defined(__x86_64__)
-#undef mxcsr_mask
-#endif
+#endif // __ANDROID_API__ < 21 && !defined(__ANDROID_API_N__)
+#endif // defined(__i386__)
-#endif // __mips__
+#ifdef __cplusplus
+} // extern "C"
+#endif // __cplusplus
#endif // GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_SYS_USER_H
diff --git a/src/common/android/testing/pthread_fixes.h b/src/common/android/testing/pthread_fixes.h
index 15c6309e..20c12084 100644
--- a/src/common/android/testing/pthread_fixes.h
+++ b/src/common/android/testing/pthread_fixes.h
@@ -89,11 +89,6 @@ int pthread_barrier_destroy(pthread_barrier_t *barrier) {
#endif // defined(PTHREAD_BARRIER_SERIAL_THREAD)
-int pthread_yield(void) {
- sched_yield();
- return 0;
-}
-
} // namespace
#endif // GOOGLE_BREAKPAD_COMMON_ANDROID_TESTING_PTHREAD_FIXES_H
diff --git a/src/common/common.gyp b/src/common/common.gyp
index f01ede57..c1dbb0fe 100644
--- a/src/common/common.gyp
+++ b/src/common/common.gyp
@@ -33,8 +33,19 @@
'defines': ['HAVE_MACH_O_NLIST_H'],
}],
['OS=="linux"', {
- 'defines': ['HAVE_A_OUT_H'],
+ # Assume glibc.
+ 'defines': ['HAVE_A_OUT_H', 'HAVE_GETCONTEXT'],
+ 'sources!': [
+ 'linux/breakpad_getcontext.S',
+ 'linux/breakpad_getcontext.h',
+ 'linux/breakpad_getcontext_unittest.cc',
+ ],
}],
+ ['OS!="android"', {'sources/': [['exclude', '(^|/)android/']]}],
+ ['OS!="linux"', {'sources/': [['exclude', '(^|/)linux/']]}],
+ ['OS!="mac"', {'sources/': [['exclude', '(^|/)mac/']]}],
+ ['OS!="solaris"', {'sources/': [['exclude', '(^|/)solaris/']]}],
+ ['OS!="win"', {'sources/': [['exclude', '(^|/)windows/']]}],
],
},
'targets': [
@@ -42,22 +53,18 @@
'target_name': 'common',
'type': 'static_library',
'sources': [
- 'android/breakpad_getcontext.S',
'android/include/elf.h',
'android/include/link.h',
- 'android/include/sgidefs.h',
'android/include/stab.h',
'android/include/sys/procfs.h',
- 'android/include/sys/signal.h',
'android/include/sys/user.h',
- 'android/include/ucontext.h',
'android/testing/include/wchar.h',
'android/testing/mkdtemp.h',
'android/testing/pthread_fixes.h',
'android/ucontext_constants.h',
'basictypes.h',
'byte_cursor.h',
- 'convert_UTF.c',
+ 'convert_UTF.cc',
'convert_UTF.h',
'dwarf/bytereader-inl.h',
'dwarf/bytereader.cc',
@@ -70,6 +77,8 @@
'dwarf/dwarf2reader.cc',
'dwarf/dwarf2reader.h',
'dwarf/dwarf2reader_test_common.h',
+ 'dwarf/elf_reader.cc',
+ 'dwarf/elf_reader.h',
'dwarf/functioninfo.cc',
'dwarf/functioninfo.h',
'dwarf/line_state_machine.h',
@@ -82,6 +91,8 @@
'dwarf_line_to_module.h',
'language.cc',
'language.h',
+ 'linux/breakpad_getcontext.S',
+ 'linux/breakpad_getcontext.h',
'linux/crc32.cc',
'linux/crc32.h',
'linux/dump_symbols.cc',
@@ -112,15 +123,19 @@
'linux/memory_mapped_file.h',
'linux/safe_readlink.cc',
'linux/safe_readlink.h',
+ 'linux/symbol_collector_client.cc',
+ 'linux/symbol_collector_client.h',
'linux/synth_elf.cc',
'linux/synth_elf.h',
+ 'long_string_dictionary.cc',
+ 'long_string_dictionary.h',
'mac/arch_utilities.cc',
'mac/arch_utilities.h',
'mac/bootstrap_compat.cc',
'mac/bootstrap_compat.h',
'mac/byteswap.h',
'mac/dump_syms.h',
- 'mac/dump_syms.mm',
+ 'mac/dump_syms.cc',
'mac/file_id.cc',
'mac/file_id.h',
'mac/GTMDefines.h',
@@ -141,9 +156,10 @@
'mac/scoped_task_suspend-inl.h',
'mac/string_utilities.cc',
'mac/string_utilities.h',
+ 'mac/super_fat_arch.h',
'md5.cc',
'md5.h',
- 'memory.h',
+ 'memory_allocator.h',
'memory_range.h',
'module.cc',
'module.h',
@@ -191,7 +207,6 @@
'target_name': 'common_unittests',
'type': 'executable',
'sources': [
- 'android/breakpad_getcontext_unittest.cc',
'byte_cursor_unittest.cc',
'dwarf/bytereader_unittest.cc',
'dwarf/dwarf2diehandler_unittest.cc',
@@ -200,6 +215,7 @@
'dwarf_cfi_to_module_unittest.cc',
'dwarf_cu_to_module_unittest.cc',
'dwarf_line_to_module_unittest.cc',
+ 'linux/breakpad_getcontext_unittest.cc',
'linux/dump_symbols_unittest.cc',
'linux/elf_core_dump_unittest.cc',
'linux/elf_symbols_to_module_unittest.cc',
@@ -212,13 +228,15 @@
'linux/tests/auto_testfile.h',
'linux/tests/crash_generator.cc',
'linux/tests/crash_generator.h',
+ 'long_string_dictionary_unittest.cc',
'mac/macho_reader_unittest.cc',
+ 'memory_allocator_unittest.cc',
'memory_range_unittest.cc',
- 'memory_unittest.cc',
'module_unittest.cc',
'simple_string_dictionary_unittest.cc',
'stabs_reader_unittest.cc',
'stabs_to_module_unittest.cc',
+ 'string_conversion_unittest.cc',
'test_assembler_unittest.cc',
'tests/auto_tempdir.h',
'tests/file_utils.cc',
@@ -230,9 +248,9 @@
],
'dependencies': [
'common',
- '../build/testing.gypi:gmock_main',
- '../build/testing.gypi:gmock',
- '../build/testing.gypi:gtest',
+ '../build/testing.gyp:gmock_main',
+ '../build/testing.gyp:gmock',
+ '../build/testing.gyp:gtest',
],
'libraries': [
'-ldl',
diff --git a/src/common/convert_UTF.c b/src/common/convert_UTF.cc
index 12a3c891..4a5df1eb 100644
--- a/src/common/convert_UTF.c
+++ b/src/common/convert_UTF.cc
@@ -60,23 +60,24 @@ See the header file "ConvertUTF.h" for complete documentation.
#include <stdio.h>
#endif
-static const int halfShift = 10; /* used for shifting by 10 bits */
+#include "common/macros.h"
-static const UTF32 halfBase = 0x0010000UL;
-static const UTF32 halfMask = 0x3FFUL;
+namespace google_breakpad {
+
+namespace {
+
+const int halfShift = 10; /* used for shifting by 10 bits */
+
+const UTF32 halfBase = 0x0010000UL;
+const UTF32 halfMask = 0x3FFUL;
+
+} // namespace
#define UNI_SUR_HIGH_START (UTF32)0xD800
#define UNI_SUR_HIGH_END (UTF32)0xDBFF
#define UNI_SUR_LOW_START (UTF32)0xDC00
#define UNI_SUR_LOW_END (UTF32)0xDFFF
-#ifndef false
-#define false 0
-#endif
-#ifndef true
-#define true 1
-#endif
-
/* --------------------------------------------------------------------- */
ConversionResult ConvertUTF32toUTF16 (const UTF32** sourceStart, const UTF32* sourceEnd,
@@ -183,6 +184,8 @@ ConversionResult ConvertUTF16toUTF32 (const UTF16** sourceStart, const UTF16* so
/* --------------------------------------------------------------------- */
+namespace {
+
/*
* Index into the table below with the first byte of a UTF-8 sequence to
* get the number of trailing bytes that are supposed to follow it.
@@ -190,7 +193,7 @@ ConversionResult ConvertUTF16toUTF32 (const UTF16** sourceStart, const UTF16* so
* left as-is for anyone who may want to do such conversion, which was
* allowed in earlier algorithms.
*/
-static const char trailingBytesForUTF8[256] = {
+const char trailingBytesForUTF8[256] = {
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
@@ -206,7 +209,7 @@ static const char trailingBytesForUTF8[256] = {
* This table contains as many values as there might be trailing bytes
* in a UTF-8 sequence.
*/
-static const UTF32 offsetsFromUTF8[6] = { 0x00000000UL, 0x00003080UL, 0x000E2080UL,
+const UTF32 offsetsFromUTF8[6] = { 0x00000000UL, 0x00003080UL, 0x000E2080UL,
0x03C82080UL, 0xFA082080UL, 0x82082080UL };
/*
@@ -216,7 +219,7 @@ static const UTF32 offsetsFromUTF8[6] = { 0x00000000UL, 0x00003080UL, 0x000E2080
* (I.e., one byte sequence, two byte... etc.). Remember that sequencs
* for *legal* UTF-8 will be 4 or fewer bytes total.
*/
-static const UTF8 firstByteMark[7] = { 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC };
+const UTF8 firstByteMark[7] = { 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC };
/* --------------------------------------------------------------------- */
@@ -228,6 +231,8 @@ static const UTF8 firstByteMark[7] = { 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC
* into an inline function.
*/
+} // namespace
+
/* --------------------------------------------------------------------- */
ConversionResult ConvertUTF16toUTF8 (const UTF16** sourceStart, const UTF16* sourceEnd,
@@ -285,10 +290,20 @@ ConversionResult ConvertUTF16toUTF8 (const UTF16** sourceStart, const UTF16* sou
target -= bytesToWrite; result = targetExhausted; break;
}
switch (bytesToWrite) { /* note: everything falls through. */
- case 4: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6;
- case 3: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6;
- case 2: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6;
- case 1: *--target = (UTF8)(ch | firstByteMark[bytesToWrite]);
+ case 4:
+ *--target = (UTF8)((ch | byteMark) & byteMask);
+ ch >>= 6;
+ BP_FALLTHROUGH;
+ case 3:
+ *--target = (UTF8)((ch | byteMark) & byteMask);
+ ch >>= 6;
+ BP_FALLTHROUGH;
+ case 2:
+ *--target = (UTF8)((ch | byteMark) & byteMask);
+ ch >>= 6;
+ BP_FALLTHROUGH;
+ case 1:
+ *--target = (UTF8)(ch | firstByteMark[bytesToWrite]);
}
target += bytesToWrite;
}
@@ -299,6 +314,8 @@ return result;
/* --------------------------------------------------------------------- */
+namespace {
+
/*
* Utility routine to tell whether a sequence of bytes is legal UTF-8.
* This must be called with the length pre-determined by the first byte.
@@ -309,16 +326,20 @@ return result;
* If presented with a length > 4, this returns false. The Unicode
* definition of UTF-8 goes up to 4-byte sequences.
*/
-
-static Boolean isLegalUTF8(const UTF8 *source, int length) {
+Boolean isLegalUTF8(const UTF8 *source, int length) {
UTF8 a;
const UTF8 *srcptr = source+length;
switch (length) {
default: return false;
/* Everything else falls through when "true"... */
- case 4: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return false;
- case 3: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return false;
- case 2: if ((a = (*--srcptr)) > 0xBF) return false;
+ case 4:
+ if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return false;
+ BP_FALLTHROUGH;
+ case 3:
+ if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return false;
+ BP_FALLTHROUGH;
+ case 2:
+ if ((a = (*--srcptr)) > 0xBF) return false;
switch (*source) {
/* no fall-through in this inner switch */
@@ -328,13 +349,15 @@ static Boolean isLegalUTF8(const UTF8 *source, int length) {
case 0xF4: if (a > 0x8F) return false; break;
default: if (a < 0x80) return false;
}
-
- case 1: if (*source >= 0x80 && *source < 0xC2) return false;
+ BP_FALLTHROUGH;
+ case 1: if (*source >= 0x80 && *source < 0xC2) return false;
}
if (*source > 0xF4) return false;
return true;
}
+} // namespace
+
/* --------------------------------------------------------------------- */
/*
@@ -371,12 +394,14 @@ ConversionResult ConvertUTF8toUTF16 (const UTF8** sourceStart, const UTF8* sourc
* The cases all fall through. See "Note A" below.
*/
switch (extraBytesToRead) {
- case 5: ch += *source++; ch <<= 6; /* remember, illegal UTF-8 */
- case 4: ch += *source++; ch <<= 6; /* remember, illegal UTF-8 */
- case 3: ch += *source++; ch <<= 6;
- case 2: ch += *source++; ch <<= 6;
- case 1: ch += *source++; ch <<= 6;
- case 0: ch += *source++;
+ /* remember, illegal UTF-8 */
+ case 5: ch += *source++; ch <<= 6; BP_FALLTHROUGH;
+ /* remember, illegal UTF-8 */
+ case 4: ch += *source++; ch <<= 6; BP_FALLTHROUGH;
+ case 3: ch += *source++; ch <<= 6; BP_FALLTHROUGH;
+ case 2: ch += *source++; ch <<= 6; BP_FALLTHROUGH;
+ case 1: ch += *source++; ch <<= 6; BP_FALLTHROUGH;
+ case 0: ch += *source++;
}
ch -= offsetsFromUTF8[extraBytesToRead];
@@ -461,10 +486,20 @@ ConversionResult ConvertUTF32toUTF8 (const UTF32** sourceStart, const UTF32* sou
target -= bytesToWrite; result = targetExhausted; break;
}
switch (bytesToWrite) { /* note: everything falls through. */
- case 4: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6;
- case 3: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6;
- case 2: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6;
- case 1: *--target = (UTF8) (ch | firstByteMark[bytesToWrite]);
+ case 4:
+ *--target = (UTF8)((ch | byteMark) & byteMask);
+ ch >>= 6;
+ BP_FALLTHROUGH;
+ case 3:
+ *--target = (UTF8)((ch | byteMark) & byteMask);
+ ch >>= 6;
+ BP_FALLTHROUGH;
+ case 2:
+ *--target = (UTF8)((ch | byteMark) & byteMask);
+ ch >>= 6;
+ BP_FALLTHROUGH;
+ case 1:
+ *--target = (UTF8) (ch | firstByteMark[bytesToWrite]);
}
target += bytesToWrite;
}
@@ -495,12 +530,12 @@ ConversionResult ConvertUTF8toUTF32 (const UTF8** sourceStart, const UTF8* sourc
* The cases all fall through. See "Note A" below.
*/
switch (extraBytesToRead) {
- case 5: ch += *source++; ch <<= 6;
- case 4: ch += *source++; ch <<= 6;
- case 3: ch += *source++; ch <<= 6;
- case 2: ch += *source++; ch <<= 6;
- case 1: ch += *source++; ch <<= 6;
- case 0: ch += *source++;
+ case 5: ch += *source++; ch <<= 6; BP_FALLTHROUGH;
+ case 4: ch += *source++; ch <<= 6; BP_FALLTHROUGH;
+ case 3: ch += *source++; ch <<= 6; BP_FALLTHROUGH;
+ case 2: ch += *source++; ch <<= 6; BP_FALLTHROUGH;
+ case 1: ch += *source++; ch <<= 6; BP_FALLTHROUGH;
+ case 0: ch += *source++;
}
ch -= offsetsFromUTF8[extraBytesToRead];
@@ -552,3 +587,5 @@ In UTF-8 writing code, the switches on "bytesToWrite" are
similarly unrolled loops.
--------------------------------------------------------------------- */
+
+} // namespace google_breakpad
diff --git a/src/common/convert_UTF.h b/src/common/convert_UTF.h
index 644d0995..2f69495d 100644
--- a/src/common/convert_UTF.h
+++ b/src/common/convert_UTF.h
@@ -106,6 +106,8 @@ All should be unsigned values to avoid sign extension during
bit mask & shift operations.
------------------------------------------------------------------------ */
+namespace google_breakpad {
+
typedef unsigned long UTF32; /* at least 32 bits */
typedef unsigned short UTF16; /* at least 16 bits */
typedef unsigned char UTF8; /* typically 8 bits */
@@ -130,11 +132,6 @@ typedef enum {
lenientConversion
} ConversionFlags;
-/* This is for C++ and does no harm in C */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
ConversionResult ConvertUTF8toUTF16 (const UTF8** sourceStart, const UTF8* sourceEnd,
UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags);
@@ -155,9 +152,7 @@ ConversionResult ConvertUTF32toUTF16 (const UTF32** sourceStart, const UTF32* so
Boolean isLegalUTF8Sequence(const UTF8 *source, const UTF8 *sourceEnd);
-#ifdef __cplusplus
-}
-#endif
+} // namespace google_breakpad
/* --------------------------------------------------------------------- */
diff --git a/src/common/dwarf/bytereader-inl.h b/src/common/dwarf/bytereader-inl.h
index 3c167089..f4c068a2 100644
--- a/src/common/dwarf/bytereader-inl.h
+++ b/src/common/dwarf/bytereader-inl.h
@@ -32,18 +32,17 @@
#include "common/dwarf/bytereader.h"
#include <assert.h>
+#include <stdint.h>
namespace dwarf2reader {
-inline uint8 ByteReader::ReadOneByte(const char* buffer) const {
+inline uint8_t ByteReader::ReadOneByte(const uint8_t *buffer) const {
return buffer[0];
}
-inline uint16 ByteReader::ReadTwoBytes(const char* signed_buffer) const {
- const unsigned char *buffer
- = reinterpret_cast<const unsigned char *>(signed_buffer);
- const uint16 buffer0 = buffer[0];
- const uint16 buffer1 = buffer[1];
+inline uint16_t ByteReader::ReadTwoBytes(const uint8_t *buffer) const {
+ const uint16_t buffer0 = buffer[0];
+ const uint16_t buffer1 = buffer[1];
if (endian_ == ENDIANNESS_LITTLE) {
return buffer0 | buffer1 << 8;
} else {
@@ -51,13 +50,11 @@ inline uint16 ByteReader::ReadTwoBytes(const char* signed_buffer) const {
}
}
-inline uint64 ByteReader::ReadFourBytes(const char* signed_buffer) const {
- const unsigned char *buffer
- = reinterpret_cast<const unsigned char *>(signed_buffer);
- const uint32 buffer0 = buffer[0];
- const uint32 buffer1 = buffer[1];
- const uint32 buffer2 = buffer[2];
- const uint32 buffer3 = buffer[3];
+inline uint64_t ByteReader::ReadFourBytes(const uint8_t *buffer) const {
+ const uint32_t buffer0 = buffer[0];
+ const uint32_t buffer1 = buffer[1];
+ const uint32_t buffer2 = buffer[2];
+ const uint32_t buffer3 = buffer[3];
if (endian_ == ENDIANNESS_LITTLE) {
return buffer0 | buffer1 << 8 | buffer2 << 16 | buffer3 << 24;
} else {
@@ -65,17 +62,15 @@ inline uint64 ByteReader::ReadFourBytes(const char* signed_buffer) const {
}
}
-inline uint64 ByteReader::ReadEightBytes(const char* signed_buffer) const {
- const unsigned char *buffer
- = reinterpret_cast<const unsigned char *>(signed_buffer);
- const uint64 buffer0 = buffer[0];
- const uint64 buffer1 = buffer[1];
- const uint64 buffer2 = buffer[2];
- const uint64 buffer3 = buffer[3];
- const uint64 buffer4 = buffer[4];
- const uint64 buffer5 = buffer[5];
- const uint64 buffer6 = buffer[6];
- const uint64 buffer7 = buffer[7];
+inline uint64_t ByteReader::ReadEightBytes(const uint8_t *buffer) const {
+ const uint64_t buffer0 = buffer[0];
+ const uint64_t buffer1 = buffer[1];
+ const uint64_t buffer2 = buffer[2];
+ const uint64_t buffer3 = buffer[3];
+ const uint64_t buffer4 = buffer[4];
+ const uint64_t buffer5 = buffer[5];
+ const uint64_t buffer6 = buffer[6];
+ const uint64_t buffer7 = buffer[7];
if (endian_ == ENDIANNESS_LITTLE) {
return buffer0 | buffer1 << 8 | buffer2 << 16 | buffer3 << 24 |
buffer4 << 32 | buffer5 << 40 | buffer6 << 48 | buffer7 << 56;
@@ -89,18 +84,18 @@ inline uint64 ByteReader::ReadEightBytes(const char* signed_buffer) const {
// information, plus one bit saying whether the number continues or
// not.
-inline uint64 ByteReader::ReadUnsignedLEB128(const char* buffer,
+inline uint64_t ByteReader::ReadUnsignedLEB128(const uint8_t *buffer,
size_t* len) const {
- uint64 result = 0;
+ uint64_t result = 0;
size_t num_read = 0;
unsigned int shift = 0;
- unsigned char byte;
+ uint8_t byte;
do {
byte = *buffer++;
num_read++;
- result |= (static_cast<uint64>(byte & 0x7f)) << shift;
+ result |= (static_cast<uint64_t>(byte & 0x7f)) << shift;
shift += 7;
@@ -114,54 +109,54 @@ inline uint64 ByteReader::ReadUnsignedLEB128(const char* buffer,
// Read a signed LEB128 number. These are like regular LEB128
// numbers, except the last byte may have a sign bit set.
-inline int64 ByteReader::ReadSignedLEB128(const char* buffer,
+inline int64_t ByteReader::ReadSignedLEB128(const uint8_t *buffer,
size_t* len) const {
- int64 result = 0;
+ int64_t result = 0;
unsigned int shift = 0;
size_t num_read = 0;
- unsigned char byte;
+ uint8_t byte;
do {
byte = *buffer++;
num_read++;
- result |= (static_cast<uint64>(byte & 0x7f) << shift);
+ result |= (static_cast<uint64_t>(byte & 0x7f) << shift);
shift += 7;
} while (byte & 0x80);
if ((shift < 8 * sizeof (result)) && (byte & 0x40))
- result |= -((static_cast<int64>(1)) << shift);
+ result |= -((static_cast<int64_t>(1)) << shift);
*len = num_read;
return result;
}
-inline uint64 ByteReader::ReadOffset(const char* buffer) const {
+inline uint64_t ByteReader::ReadOffset(const uint8_t *buffer) const {
assert(this->offset_reader_);
return (this->*offset_reader_)(buffer);
}
-inline uint64 ByteReader::ReadAddress(const char* buffer) const {
+inline uint64_t ByteReader::ReadAddress(const uint8_t *buffer) const {
assert(this->address_reader_);
return (this->*address_reader_)(buffer);
}
-inline void ByteReader::SetCFIDataBase(uint64 section_base,
- const char *buffer_base) {
+inline void ByteReader::SetCFIDataBase(uint64_t section_base,
+ const uint8_t *buffer_base) {
section_base_ = section_base;
buffer_base_ = buffer_base;
have_section_base_ = true;
}
-inline void ByteReader::SetTextBase(uint64 text_base) {
+inline void ByteReader::SetTextBase(uint64_t text_base) {
text_base_ = text_base;
have_text_base_ = true;
}
-inline void ByteReader::SetDataBase(uint64 data_base) {
+inline void ByteReader::SetDataBase(uint64_t data_base) {
data_base_ = data_base;
have_data_base_ = true;
}
-inline void ByteReader::SetFunctionBase(uint64 function_base) {
+inline void ByteReader::SetFunctionBase(uint64_t function_base) {
function_base_ = function_base;
have_function_base_ = true;
}
diff --git a/src/common/dwarf/bytereader.cc b/src/common/dwarf/bytereader.cc
index 68020264..0b27dd58 100644
--- a/src/common/dwarf/bytereader.cc
+++ b/src/common/dwarf/bytereader.cc
@@ -27,6 +27,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <assert.h>
+#include <stdint.h>
#include <stdlib.h>
#include "common/dwarf/bytereader-inl.h"
@@ -42,7 +43,7 @@ ByteReader::ByteReader(enum Endianness endian)
ByteReader::~ByteReader() { }
-void ByteReader::SetOffsetSize(uint8 size) {
+void ByteReader::SetOffsetSize(uint8_t size) {
offset_size_ = size;
assert(size == 4 || size == 8);
if (size == 4) {
@@ -52,7 +53,7 @@ void ByteReader::SetOffsetSize(uint8 size) {
}
}
-void ByteReader::SetAddressSize(uint8 size) {
+void ByteReader::SetAddressSize(uint8_t size) {
address_size_ = size;
assert(size == 4 || size == 8);
if (size == 4) {
@@ -62,8 +63,8 @@ void ByteReader::SetAddressSize(uint8 size) {
}
}
-uint64 ByteReader::ReadInitialLength(const char* start, size_t* len) {
- const uint64 initial_length = ReadFourBytes(start);
+uint64_t ByteReader::ReadInitialLength(const uint8_t *start, size_t* len) {
+ const uint64_t initial_length = ReadFourBytes(start);
start += 4;
// In DWARF2/3, if the initial length is all 1 bits, then the offset
@@ -100,7 +101,7 @@ bool ByteReader::UsableEncoding(DwarfPointerEncoding encoding) const {
}
}
-uint64 ByteReader::ReadEncodedPointer(const char *buffer,
+uint64_t ByteReader::ReadEncodedPointer(const uint8_t *buffer,
DwarfPointerEncoding encoding,
size_t *len) const {
// UsableEncoding doesn't approve of DW_EH_PE_omit, so we shouldn't
@@ -123,13 +124,13 @@ uint64 ByteReader::ReadEncodedPointer(const char *buffer,
// First, find the offset to START from the closest prior aligned
// address.
- uint64 skew = section_base_ & (AddressSize() - 1);
+ uint64_t skew = section_base_ & (AddressSize() - 1);
// Now find the offset from that aligned address to buffer.
- uint64 offset = skew + (buffer - buffer_base_);
+ uint64_t offset = skew + (buffer - buffer_base_);
// Round up to the next boundary.
- uint64 aligned = (offset + AddressSize() - 1) & -AddressSize();
+ uint64_t aligned = (offset + AddressSize() - 1) & -AddressSize();
// Convert back to a pointer.
- const char *aligned_buffer = buffer_base_ + (aligned - skew);
+ const uint8_t *aligned_buffer = buffer_base_ + (aligned - skew);
// Finally, store the length and actually fetch the pointer.
*len = aligned_buffer - buffer + AddressSize();
return ReadAddress(aligned_buffer);
@@ -137,7 +138,7 @@ uint64 ByteReader::ReadEncodedPointer(const char *buffer,
// Extract the value first, ignoring whether it's a pointer or an
// offset relative to some base.
- uint64 offset;
+ uint64_t offset;
switch (encoding & 0x0f) {
case DW_EH_PE_absptr:
// DW_EH_PE_absptr is weird, as it is used as a meaningful value for
@@ -201,7 +202,7 @@ uint64 ByteReader::ReadEncodedPointer(const char *buffer,
}
// Find the appropriate base address.
- uint64 base;
+ uint64_t base;
switch (encoding & 0x70) {
case DW_EH_PE_absptr:
base = 0;
@@ -231,15 +232,19 @@ uint64 ByteReader::ReadEncodedPointer(const char *buffer,
abort();
}
- uint64 pointer = base + offset;
+ uint64_t pointer = base + offset;
// Remove inappropriate upper bits.
if (AddressSize() == 4)
pointer = pointer & 0xffffffff;
else
- assert(AddressSize() == sizeof(uint64));
+ assert(AddressSize() == sizeof(uint64_t));
return pointer;
}
+Endianness ByteReader::GetEndianness() const {
+ return endian_;
+}
+
} // namespace dwarf2reader
diff --git a/src/common/dwarf/bytereader.h b/src/common/dwarf/bytereader.h
index e3894273..2b37a12d 100644
--- a/src/common/dwarf/bytereader.h
+++ b/src/common/dwarf/bytereader.h
@@ -31,7 +31,10 @@
#ifndef COMMON_DWARF_BYTEREADER_H__
#define COMMON_DWARF_BYTEREADER_H__
+#include <stdint.h>
+
#include <string>
+
#include "common/dwarf/types.h"
#include "common/dwarf/dwarf2enums.h"
@@ -59,22 +62,22 @@ class ByteReader {
// Read a single byte from BUFFER and return it as an unsigned 8 bit
// number.
- uint8 ReadOneByte(const char* buffer) const;
+ uint8_t ReadOneByte(const uint8_t *buffer) const;
// Read two bytes from BUFFER and return them as an unsigned 16 bit
// number, using this ByteReader's endianness.
- uint16 ReadTwoBytes(const char* buffer) const;
+ uint16_t ReadTwoBytes(const uint8_t *buffer) const;
// Read four bytes from BUFFER and return them as an unsigned 32 bit
// number, using this ByteReader's endianness. This function returns
- // a uint64 so that it is compatible with ReadAddress and
+ // a uint64_t so that it is compatible with ReadAddress and
// ReadOffset. The number it returns will never be outside the range
// of an unsigned 32 bit integer.
- uint64 ReadFourBytes(const char* buffer) const;
+ uint64_t ReadFourBytes(const uint8_t *buffer) const;
// Read eight bytes from BUFFER and return them as an unsigned 64
// bit number, using this ByteReader's endianness.
- uint64 ReadEightBytes(const char* buffer) const;
+ uint64_t ReadEightBytes(const uint8_t *buffer) const;
// Read an unsigned LEB128 (Little Endian Base 128) number from
// BUFFER and return it as an unsigned 64 bit integer. Set LEN to
@@ -93,7 +96,7 @@ class ByteReader {
// In other words, we break VALUE into groups of seven bits, put
// them in little-endian order, and then write them as eight-bit
// bytes with the high bit on all but the last.
- uint64 ReadUnsignedLEB128(const char* buffer, size_t* len) const;
+ uint64_t ReadUnsignedLEB128(const uint8_t *buffer, size_t *len) const;
// Read a signed LEB128 number from BUFFER and return it as an
// signed 64 bit integer. Set LEN to the number of bytes read.
@@ -112,7 +115,7 @@ class ByteReader {
// In other words, we break VALUE into groups of seven bits, put
// them in little-endian order, and then write them as eight-bit
// bytes with the high bit on all but the last.
- int64 ReadSignedLEB128(const char* buffer, size_t* len) const;
+ int64_t ReadSignedLEB128(const uint8_t *buffer, size_t *len) const;
// Indicate that addresses on this architecture are SIZE bytes long. SIZE
// must be either 4 or 8. (DWARF allows addresses to be any number of
@@ -126,16 +129,16 @@ class ByteReader {
// frame information doesn't indicate its address size (a shortcoming of
// the spec); you must supply the appropriate size based on the
// architecture of the target machine.
- void SetAddressSize(uint8 size);
+ void SetAddressSize(uint8_t size);
// Return the current address size, in bytes. This is either 4,
// indicating 32-bit addresses, or 8, indicating 64-bit addresses.
- uint8 AddressSize() const { return address_size_; }
+ uint8_t AddressSize() const { return address_size_; }
// Read an address from BUFFER and return it as an unsigned 64 bit
// integer, respecting this ByteReader's endianness and address size. You
// must call SetAddressSize before calling this function.
- uint64 ReadAddress(const char* buffer) const;
+ uint64_t ReadAddress(const uint8_t *buffer) const;
// DWARF actually defines two slightly different formats: 32-bit DWARF
// and 64-bit DWARF. This is *not* related to the size of registers or
@@ -172,26 +175,26 @@ class ByteReader {
// - The 32-bit value 0xffffffff, followed by a 64-bit byte count,
// indicating that the data whose length is being measured uses
// the 64-bit DWARF format.
- uint64 ReadInitialLength(const char* start, size_t* len);
+ uint64_t ReadInitialLength(const uint8_t *start, size_t *len);
// Read an offset from BUFFER and return it as an unsigned 64 bit
// integer, respecting the ByteReader's endianness. In 32-bit DWARF, the
// offset is 4 bytes long; in 64-bit DWARF, the offset is eight bytes
// long. You must call ReadInitialLength or SetOffsetSize before calling
// this function; see the comments above for details.
- uint64 ReadOffset(const char* buffer) const;
+ uint64_t ReadOffset(const uint8_t *buffer) const;
// Return the current offset size, in bytes.
// A return value of 4 indicates that we are reading 32-bit DWARF.
// A return value of 8 indicates that we are reading 64-bit DWARF.
- uint8 OffsetSize() const { return offset_size_; }
+ uint8_t OffsetSize() const { return offset_size_; }
// Indicate that section offsets and lengths are SIZE bytes long. SIZE
// must be either 4 (meaning 32-bit DWARF) or 8 (meaning 64-bit DWARF).
// Usually, you should not call this function yourself; instead, let a
// call to ReadInitialLength establish the data's offset size
// automatically.
- void SetOffsetSize(uint8 size);
+ void SetOffsetSize(uint8_t size);
// The Linux C++ ABI uses a variant of DWARF call frame information
// for exception handling. This data is included in the program's
@@ -234,24 +237,24 @@ class ByteReader {
// is BUFFER_BASE. This allows us to find the address that a given
// byte in our buffer would have when loaded into the program the
// data describes. We need this to resolve DW_EH_PE_pcrel pointers.
- void SetCFIDataBase(uint64 section_base, const char *buffer_base);
+ void SetCFIDataBase(uint64_t section_base, const uint8_t *buffer_base);
// Indicate that the base address of the program's ".text" section
// is TEXT_BASE. We need this to resolve DW_EH_PE_textrel pointers.
- void SetTextBase(uint64 text_base);
+ void SetTextBase(uint64_t text_base);
// Indicate that the base address for DW_EH_PE_datarel pointers is
// DATA_BASE. The proper value depends on the ABI; it is usually the
// address of the global offset table, held in a designated register in
// position-independent code. You will need to look at the startup code
// for the target system to be sure. I tried; my eyes bled.
- void SetDataBase(uint64 data_base);
+ void SetDataBase(uint64_t data_base);
// Indicate that the base address for the FDE we are processing is
// FUNCTION_BASE. This is the start address of DW_EH_PE_funcrel
// pointers. (This encoding does not seem to be used by the GNU
// toolchain.)
- void SetFunctionBase(uint64 function_base);
+ void SetFunctionBase(uint64_t function_base);
// Indicate that we are no longer processing any FDE, so any use of
// a DW_EH_PE_funcrel encoding is an error.
@@ -273,13 +276,15 @@ class ByteReader {
// base address this reader hasn't been given, so you should check
// with ValidEncoding and UsableEncoding first if you would rather
// die in a more helpful way.
- uint64 ReadEncodedPointer(const char *buffer, DwarfPointerEncoding encoding,
+ uint64_t ReadEncodedPointer(const uint8_t *buffer,
+ DwarfPointerEncoding encoding,
size_t *len) const;
+ Endianness GetEndianness() const;
private:
// Function pointer type for our address and offset readers.
- typedef uint64 (ByteReader::*AddressReader)(const char*) const;
+ typedef uint64_t (ByteReader::*AddressReader)(const uint8_t *) const;
// Read an offset from BUFFER and return it as an unsigned 64 bit
// integer. DWARF2/3 define offsets as either 4 or 8 bytes,
@@ -295,14 +300,14 @@ class ByteReader {
AddressReader address_reader_;
Endianness endian_;
- uint8 address_size_;
- uint8 offset_size_;
+ uint8_t address_size_;
+ uint8_t offset_size_;
// Base addresses for Linux C++ exception handling data's encoded pointers.
bool have_section_base_, have_text_base_, have_data_base_;
bool have_function_base_;
- uint64 section_base_, text_base_, data_base_, function_base_;
- const char *buffer_base_;
+ uint64_t section_base_, text_base_, data_base_, function_base_;
+ const uint8_t *buffer_base_;
};
} // namespace dwarf2reader
diff --git a/src/common/dwarf/bytereader_unittest.cc b/src/common/dwarf/bytereader_unittest.cc
index 4311ab6a..e66062d1 100644
--- a/src/common/dwarf/bytereader_unittest.cc
+++ b/src/common/dwarf/bytereader_unittest.cc
@@ -31,6 +31,8 @@
// bytereader_unittest.cc: Unit tests for dwarf2reader::ByteReader
+#include <stdint.h>
+
#include <string>
#include "breakpad_googletest_includes.h"
@@ -71,7 +73,7 @@ TEST_F(Reader, SimpleConstructor) {
.LEB128(-0x4f337badf4483f83LL)
.D32(0xfec319c9);
ASSERT_TRUE(section.GetContents(&contents));
- const char *data = contents.data();
+ const uint8_t *data = reinterpret_cast<const uint8_t *>(contents.data());
EXPECT_EQ(0xc0U, reader.ReadOneByte(data));
EXPECT_EQ(0xcf0dU, reader.ReadTwoBytes(data + 1));
EXPECT_EQ(0x96fdd219U, reader.ReadFourBytes(data + 3));
@@ -375,7 +377,7 @@ TEST_F(Reader, ValidEncodings) {
}
TEST_F(ReaderDeathTest, DW_EH_PE_omit) {
- static const char data[1] = { 42 };
+ static const uint8_t data[] = { 42 };
ByteReader reader(ENDIANNESS_BIG);
reader.SetAddressSize(4);
EXPECT_DEATH(reader.ReadEncodedPointer(data, dwarf2reader::DW_EH_PE_omit,
@@ -384,7 +386,7 @@ TEST_F(ReaderDeathTest, DW_EH_PE_omit) {
}
TEST_F(Reader, DW_EH_PE_absptr4) {
- static const char data[] = { 0x27, 0x57, 0xea, 0x40 };
+ static const uint8_t data[] = { 0x27, 0x57, 0xea, 0x40 };
ByteReader reader(ENDIANNESS_LITTLE);
reader.SetAddressSize(4);
EXPECT_EQ(0x40ea5727U,
@@ -394,7 +396,7 @@ TEST_F(Reader, DW_EH_PE_absptr4) {
}
TEST_F(Reader, DW_EH_PE_absptr8) {
- static const char data[] = {
+ static const uint8_t data[] = {
0x60, 0x27, 0x57, 0xea, 0x40, 0xc2, 0x98, 0x05, 0x01, 0x50
};
ByteReader reader(ENDIANNESS_LITTLE);
@@ -406,7 +408,7 @@ TEST_F(Reader, DW_EH_PE_absptr8) {
}
TEST_F(Reader, DW_EH_PE_uleb128) {
- static const char data[] = { 0x81, 0x84, 0x4c };
+ static const uint8_t data[] = { 0x81, 0x84, 0x4c };
ByteReader reader(ENDIANNESS_LITTLE);
reader.SetAddressSize(4);
EXPECT_EQ(0x130201U,
@@ -416,7 +418,7 @@ TEST_F(Reader, DW_EH_PE_uleb128) {
}
TEST_F(Reader, DW_EH_PE_udata2) {
- static const char data[] = { 0xf4, 0x8d };
+ static const uint8_t data[] = { 0xf4, 0x8d };
ByteReader reader(ENDIANNESS_BIG);
reader.SetAddressSize(4);
EXPECT_EQ(0xf48dU,
@@ -426,7 +428,7 @@ TEST_F(Reader, DW_EH_PE_udata2) {
}
TEST_F(Reader, DW_EH_PE_udata4) {
- static const char data[] = { 0xb2, 0x68, 0xa5, 0x62, 0x8f, 0x8b };
+ static const uint8_t data[] = { 0xb2, 0x68, 0xa5, 0x62, 0x8f, 0x8b };
ByteReader reader(ENDIANNESS_BIG);
reader.SetAddressSize(8);
EXPECT_EQ(0xa5628f8b,
@@ -436,7 +438,7 @@ TEST_F(Reader, DW_EH_PE_udata4) {
}
TEST_F(Reader, DW_EH_PE_udata8Addr8) {
- static const char data[] = {
+ static const uint8_t data[] = {
0x27, 0x04, 0x73, 0x04, 0x69, 0x9f, 0x19, 0xed, 0x8f, 0xfe
};
ByteReader reader(ENDIANNESS_LITTLE);
@@ -448,7 +450,7 @@ TEST_F(Reader, DW_EH_PE_udata8Addr8) {
}
TEST_F(Reader, DW_EH_PE_udata8Addr4) {
- static const char data[] = {
+ static const uint8_t data[] = {
0x27, 0x04, 0x73, 0x04, 0x69, 0x9f, 0x19, 0xed, 0x8f, 0xfe
};
ByteReader reader(ENDIANNESS_LITTLE);
@@ -460,7 +462,7 @@ TEST_F(Reader, DW_EH_PE_udata8Addr4) {
}
TEST_F(Reader, DW_EH_PE_sleb128) {
- static const char data[] = { 0x42, 0xff, 0xfb, 0x73 };
+ static const uint8_t data[] = { 0x42, 0xff, 0xfb, 0x73 };
ByteReader reader(ENDIANNESS_BIG);
reader.SetAddressSize(4);
EXPECT_EQ(-0x030201U & 0xffffffff,
@@ -470,7 +472,7 @@ TEST_F(Reader, DW_EH_PE_sleb128) {
}
TEST_F(Reader, DW_EH_PE_sdata2) {
- static const char data[] = { 0xb9, 0xbf };
+ static const uint8_t data[] = { 0xb9, 0xbf };
ByteReader reader(ENDIANNESS_LITTLE);
reader.SetAddressSize(8);
EXPECT_EQ(0xffffffffffffbfb9ULL,
@@ -480,7 +482,7 @@ TEST_F(Reader, DW_EH_PE_sdata2) {
}
TEST_F(Reader, DW_EH_PE_sdata4) {
- static const char data[] = { 0xa0, 0xca, 0xf2, 0xb8, 0xc2, 0xad };
+ static const uint8_t data[] = { 0xa0, 0xca, 0xf2, 0xb8, 0xc2, 0xad };
ByteReader reader(ENDIANNESS_LITTLE);
reader.SetAddressSize(8);
EXPECT_EQ(0xffffffffadc2b8f2ULL,
@@ -490,7 +492,7 @@ TEST_F(Reader, DW_EH_PE_sdata4) {
}
TEST_F(Reader, DW_EH_PE_sdata8) {
- static const char data[] = {
+ static const uint8_t data[] = {
0xf6, 0x66, 0x57, 0x79, 0xe0, 0x0c, 0x9b, 0x26, 0x87
};
ByteReader reader(ENDIANNESS_LITTLE);
@@ -502,7 +504,9 @@ TEST_F(Reader, DW_EH_PE_sdata8) {
}
TEST_F(Reader, DW_EH_PE_pcrel) {
- static const char data[] = { 0x4a, 0x8b, 0x1b, 0x14, 0xc8, 0xc4, 0x02, 0xce };
+ static const uint8_t data[] = {
+ 0x4a, 0x8b, 0x1b, 0x14, 0xc8, 0xc4, 0x02, 0xce
+ };
ByteReader reader(ENDIANNESS_BIG);
reader.SetAddressSize(4);
DwarfPointerEncoding encoding =
@@ -515,7 +519,9 @@ TEST_F(Reader, DW_EH_PE_pcrel) {
}
TEST_F(Reader, DW_EH_PE_textrel) {
- static const char data[] = { 0xd9, 0x0d, 0x05, 0x17, 0xc9, 0x7a, 0x42, 0x1e };
+ static const uint8_t data[] = {
+ 0xd9, 0x0d, 0x05, 0x17, 0xc9, 0x7a, 0x42, 0x1e
+ };
ByteReader reader(ENDIANNESS_LITTLE);
reader.SetAddressSize(4);
reader.SetTextBase(0xb91beaf0);
@@ -528,7 +534,9 @@ TEST_F(Reader, DW_EH_PE_textrel) {
}
TEST_F(Reader, DW_EH_PE_datarel) {
- static const char data[] = { 0x16, 0xf2, 0xbb, 0x82, 0x68, 0xa7, 0xbc, 0x39 };
+ static const uint8_t data[] = {
+ 0x16, 0xf2, 0xbb, 0x82, 0x68, 0xa7, 0xbc, 0x39
+ };
ByteReader reader(ENDIANNESS_BIG);
reader.SetAddressSize(8);
reader.SetDataBase(0xbef308bd25ce74f0ULL);
@@ -541,7 +549,9 @@ TEST_F(Reader, DW_EH_PE_datarel) {
}
TEST_F(Reader, DW_EH_PE_funcrel) {
- static const char data[] = { 0x84, 0xf8, 0x14, 0x01, 0x61, 0xd1, 0x48, 0xc9 };
+ static const uint8_t data[] = {
+ 0x84, 0xf8, 0x14, 0x01, 0x61, 0xd1, 0x48, 0xc9
+ };
ByteReader reader(ENDIANNESS_BIG);
reader.SetAddressSize(4);
reader.SetFunctionBase(0x823c3520);
@@ -554,7 +564,7 @@ TEST_F(Reader, DW_EH_PE_funcrel) {
}
TEST(UsableBase, CFI) {
- static const char data[1] = { 0x42 };
+ static const uint8_t data[] = { 0x42 };
ByteReader reader(ENDIANNESS_BIG);
reader.SetCFIDataBase(0xb31cbd20, data);
EXPECT_TRUE(reader.UsableEncoding(dwarf2reader::DW_EH_PE_absptr));
@@ -617,12 +627,12 @@ TEST(UsableBase, ClearFunction) {
struct AlignedFixture {
AlignedFixture() : reader(ENDIANNESS_BIG) { reader.SetAddressSize(4); }
- static const char data[10];
+ static const uint8_t data[10];
ByteReader reader;
size_t pointer_size;
};
-const char AlignedFixture::data[10] = {
+const uint8_t AlignedFixture::data[10] = {
0xfe, 0x6e, 0x93, 0xd8, 0x34, 0xd5, 0x1c, 0xd3, 0xac, 0x2b
};
diff --git a/src/common/dwarf/cfi_assembler.cc b/src/common/dwarf/cfi_assembler.cc
index dbc2efae..2dc22085 100644
--- a/src/common/dwarf/cfi_assembler.cc
+++ b/src/common/dwarf/cfi_assembler.cc
@@ -46,7 +46,9 @@ CFISection &CFISection::CIEHeader(uint64_t code_alignment_factor,
unsigned return_address_register,
uint8_t version,
const string &augmentation,
- bool dwarf64) {
+ bool dwarf64,
+ uint8_t address_size,
+ uint8_t segment_size) {
assert(!entry_length_);
entry_length_ = new PendingLength();
in_fde_ = false;
@@ -63,6 +65,10 @@ CFISection &CFISection::CIEHeader(uint64_t code_alignment_factor,
}
D8(version);
AppendCString(augmentation);
+ if (version >= 4) {
+ D8(address_size);
+ D8(segment_size);
+ }
ULEB128(code_alignment_factor);
LEB128(data_alignment_factor);
if (version == 1)
diff --git a/src/common/dwarf/cfi_assembler.h b/src/common/dwarf/cfi_assembler.h
index 227812b5..bd7354d1 100644
--- a/src/common/dwarf/cfi_assembler.h
+++ b/src/common/dwarf/cfi_assembler.h
@@ -138,7 +138,9 @@ class CFISection: public Section {
unsigned return_address_register,
uint8_t version = 3,
const string &augmentation = "",
- bool dwarf64 = false);
+ bool dwarf64 = false,
+ uint8_t address_size = 8,
+ uint8_t segment_size = 0);
// Append a Frame Description Entry header to this section with the
// given values. If dwarf64 is true, use the 64-bit DWARF initial
diff --git a/src/common/dwarf/dwarf2diehandler.cc b/src/common/dwarf/dwarf2diehandler.cc
index 20c15fa9..63845018 100644
--- a/src/common/dwarf/dwarf2diehandler.cc
+++ b/src/common/dwarf/dwarf2diehandler.cc
@@ -32,6 +32,7 @@
// See dwarf2diehandler.h for details.
#include <assert.h>
+#include <stdint.h>
#include <string>
@@ -49,15 +50,15 @@ DIEDispatcher::~DIEDispatcher() {
}
}
-bool DIEDispatcher::StartCompilationUnit(uint64 offset, uint8 address_size,
- uint8 offset_size, uint64 cu_length,
- uint8 dwarf_version) {
+bool DIEDispatcher::StartCompilationUnit(uint64_t offset, uint8_t address_size,
+ uint8_t offset_size, uint64_t cu_length,
+ uint8_t dwarf_version) {
return root_handler_->StartCompilationUnit(offset, address_size,
offset_size, cu_length,
dwarf_version);
}
-bool DIEDispatcher::StartDIE(uint64 offset, enum DwarfTag tag) {
+bool DIEDispatcher::StartDIE(uint64_t offset, enum DwarfTag tag) {
// The stack entry for the parent of this DIE, if there is one.
HandlerStack *parent = die_handlers_.empty() ? NULL : &die_handlers_.top();
@@ -112,7 +113,7 @@ bool DIEDispatcher::StartDIE(uint64 offset, enum DwarfTag tag) {
return handler != NULL;
}
-void DIEDispatcher::EndDIE(uint64 offset) {
+void DIEDispatcher::EndDIE(uint64_t offset) {
assert(!die_handlers_.empty());
HandlerStack *entry = &die_handlers_.top();
if (entry->handler_) {
@@ -134,48 +135,48 @@ void DIEDispatcher::EndDIE(uint64 offset) {
die_handlers_.pop();
}
-void DIEDispatcher::ProcessAttributeUnsigned(uint64 offset,
+void DIEDispatcher::ProcessAttributeUnsigned(uint64_t offset,
enum DwarfAttribute attr,
enum DwarfForm form,
- uint64 data) {
+ uint64_t data) {
HandlerStack &current = die_handlers_.top();
// This had better be an attribute of the DIE we were meant to handle.
assert(offset == current.offset_);
current.handler_->ProcessAttributeUnsigned(attr, form, data);
}
-void DIEDispatcher::ProcessAttributeSigned(uint64 offset,
+void DIEDispatcher::ProcessAttributeSigned(uint64_t offset,
enum DwarfAttribute attr,
enum DwarfForm form,
- int64 data) {
+ int64_t data) {
HandlerStack &current = die_handlers_.top();
// This had better be an attribute of the DIE we were meant to handle.
assert(offset == current.offset_);
current.handler_->ProcessAttributeSigned(attr, form, data);
}
-void DIEDispatcher::ProcessAttributeReference(uint64 offset,
+void DIEDispatcher::ProcessAttributeReference(uint64_t offset,
enum DwarfAttribute attr,
enum DwarfForm form,
- uint64 data) {
+ uint64_t data) {
HandlerStack &current = die_handlers_.top();
// This had better be an attribute of the DIE we were meant to handle.
assert(offset == current.offset_);
current.handler_->ProcessAttributeReference(attr, form, data);
}
-void DIEDispatcher::ProcessAttributeBuffer(uint64 offset,
+void DIEDispatcher::ProcessAttributeBuffer(uint64_t offset,
enum DwarfAttribute attr,
enum DwarfForm form,
- const char* data,
- uint64 len) {
+ const uint8_t *data,
+ uint64_t len) {
HandlerStack &current = die_handlers_.top();
// This had better be an attribute of the DIE we were meant to handle.
assert(offset == current.offset_);
current.handler_->ProcessAttributeBuffer(attr, form, data, len);
}
-void DIEDispatcher::ProcessAttributeString(uint64 offset,
+void DIEDispatcher::ProcessAttributeString(uint64_t offset,
enum DwarfAttribute attr,
enum DwarfForm form,
const string& data) {
@@ -185,10 +186,10 @@ void DIEDispatcher::ProcessAttributeString(uint64 offset,
current.handler_->ProcessAttributeString(attr, form, data);
}
-void DIEDispatcher::ProcessAttributeSignature(uint64 offset,
+void DIEDispatcher::ProcessAttributeSignature(uint64_t offset,
enum DwarfAttribute attr,
enum DwarfForm form,
- uint64 signature) {
+ uint64_t signature) {
HandlerStack &current = die_handlers_.top();
// This had better be an attribute of the DIE we were meant to handle.
assert(offset == current.offset_);
diff --git a/src/common/dwarf/dwarf2diehandler.h b/src/common/dwarf/dwarf2diehandler.h
index 81f40f07..871ba436 100644
--- a/src/common/dwarf/dwarf2diehandler.h
+++ b/src/common/dwarf/dwarf2diehandler.h
@@ -156,6 +156,8 @@
#ifndef COMMON_DWARF_DWARF2DIEHANDLER_H__
#define COMMON_DWARF_DWARF2DIEHANDLER_H__
+#include <stdint.h>
+
#include <stack>
#include <string>
@@ -197,23 +199,23 @@ class DIEHandler {
// The default definitions ignore the values they are passed.
virtual void ProcessAttributeUnsigned(enum DwarfAttribute attr,
enum DwarfForm form,
- uint64 data) { }
+ uint64_t data) { }
virtual void ProcessAttributeSigned(enum DwarfAttribute attr,
enum DwarfForm form,
- int64 data) { }
+ int64_t data) { }
virtual void ProcessAttributeReference(enum DwarfAttribute attr,
enum DwarfForm form,
- uint64 data) { }
+ uint64_t data) { }
virtual void ProcessAttributeBuffer(enum DwarfAttribute attr,
enum DwarfForm form,
- const char* data,
- uint64 len) { }
+ const uint8_t *data,
+ uint64_t len) { }
virtual void ProcessAttributeString(enum DwarfAttribute attr,
enum DwarfForm form,
const string& data) { }
virtual void ProcessAttributeSignature(enum DwarfAttribute attr,
enum DwarfForm form,
- uint64 signture) { }
+ uint64_t signture) { }
// Once we have reported all the DIE's attributes' values, we call
// this member function. If it returns false, we skip all the DIE's
@@ -242,7 +244,7 @@ class DIEHandler {
// it is.
//
// The default definition skips all children.
- virtual DIEHandler *FindChildHandler(uint64 offset, enum DwarfTag tag) {
+ virtual DIEHandler *FindChildHandler(uint64_t offset, enum DwarfTag tag) {
return NULL;
}
@@ -266,9 +268,9 @@ class RootDIEHandler: public DIEHandler {
// returns false. So the root DIE handler is actually also
// responsible for handling the compilation unit metadata.
// The default definition always visits the compilation unit.
- virtual bool StartCompilationUnit(uint64 offset, uint8 address_size,
- uint8 offset_size, uint64 cu_length,
- uint8 dwarf_version) { return true; }
+ virtual bool StartCompilationUnit(uint64_t offset, uint8_t address_size,
+ uint8_t offset_size, uint64_t cu_length,
+ uint8_t dwarf_version) { return true; }
// For the root DIE handler only, we pass the offset, tag and
// attributes of the compilation unit's root DIE. This is the only
@@ -278,7 +280,7 @@ class RootDIEHandler: public DIEHandler {
// unit.
//
// The default definition elects to visit the root DIE.
- virtual bool StartRootDIE(uint64 offset, enum DwarfTag tag) { return true; }
+ virtual bool StartRootDIE(uint64_t offset, enum DwarfTag tag) { return true; }
};
class DIEDispatcher: public Dwarf2Handler {
@@ -290,36 +292,36 @@ class DIEDispatcher: public Dwarf2Handler {
// Destroying a DIEDispatcher destroys all active handler objects
// except the root handler.
~DIEDispatcher();
- bool StartCompilationUnit(uint64 offset, uint8 address_size,
- uint8 offset_size, uint64 cu_length,
- uint8 dwarf_version);
- bool StartDIE(uint64 offset, enum DwarfTag tag);
- void ProcessAttributeUnsigned(uint64 offset,
+ bool StartCompilationUnit(uint64_t offset, uint8_t address_size,
+ uint8_t offset_size, uint64_t cu_length,
+ uint8_t dwarf_version);
+ bool StartDIE(uint64_t offset, enum DwarfTag tag);
+ void ProcessAttributeUnsigned(uint64_t offset,
enum DwarfAttribute attr,
enum DwarfForm form,
- uint64 data);
- void ProcessAttributeSigned(uint64 offset,
+ uint64_t data);
+ void ProcessAttributeSigned(uint64_t offset,
enum DwarfAttribute attr,
enum DwarfForm form,
- int64 data);
- void ProcessAttributeReference(uint64 offset,
+ int64_t data);
+ void ProcessAttributeReference(uint64_t offset,
enum DwarfAttribute attr,
enum DwarfForm form,
- uint64 data);
- void ProcessAttributeBuffer(uint64 offset,
+ uint64_t data);
+ void ProcessAttributeBuffer(uint64_t offset,
enum DwarfAttribute attr,
enum DwarfForm form,
- const char* data,
- uint64 len);
- void ProcessAttributeString(uint64 offset,
+ const uint8_t *data,
+ uint64_t len);
+ void ProcessAttributeString(uint64_t offset,
enum DwarfAttribute attr,
enum DwarfForm form,
const string &data);
- void ProcessAttributeSignature(uint64 offset,
+ void ProcessAttributeSignature(uint64_t offset,
enum DwarfAttribute attr,
enum DwarfForm form,
- uint64 signature);
- void EndDIE(uint64 offset);
+ uint64_t signature);
+ void EndDIE(uint64_t offset);
private:
@@ -329,7 +331,7 @@ class DIEDispatcher: public Dwarf2Handler {
// makes it easier to see that the code is correct.
struct HandlerStack {
// The offset of the DIE for this handler stack entry.
- uint64 offset_;
+ uint64_t offset_;
// The handler object interested in this DIE's attributes and
// children. If NULL, we're not interested in either.
diff --git a/src/common/dwarf/dwarf2diehandler_unittest.cc b/src/common/dwarf/dwarf2diehandler_unittest.cc
index c0a532aa..01b70489 100644
--- a/src/common/dwarf/dwarf2diehandler_unittest.cc
+++ b/src/common/dwarf/dwarf2diehandler_unittest.cc
@@ -32,6 +32,8 @@
// dwarf2diehander_unittest.cc: Unit tests for google_breakpad::DIEDispatcher.
+#include <stdint.h>
+
#include <string>
#include <utility>
@@ -61,41 +63,42 @@ using dwarf2reader::RootDIEHandler;
class MockDIEHandler: public DIEHandler {
public:
MOCK_METHOD3(ProcessAttributeUnsigned,
- void(DwarfAttribute, DwarfForm, uint64));
+ void(DwarfAttribute, DwarfForm, uint64_t));
MOCK_METHOD3(ProcessAttributeSigned,
- void(DwarfAttribute, DwarfForm, int64));
+ void(DwarfAttribute, DwarfForm, int64_t));
MOCK_METHOD3(ProcessAttributeReference,
- void(DwarfAttribute, DwarfForm, uint64));
+ void(DwarfAttribute, DwarfForm, uint64_t));
MOCK_METHOD4(ProcessAttributeBuffer,
- void(DwarfAttribute, DwarfForm, const char *, uint64));
+ void(DwarfAttribute, DwarfForm, const uint8_t *, uint64_t));
MOCK_METHOD3(ProcessAttributeString,
void(DwarfAttribute, DwarfForm, const string &));
MOCK_METHOD3(ProcessAttributeSignature,
- void(DwarfAttribute, DwarfForm, uint64));
+ void(DwarfAttribute, DwarfForm, uint64_t));
MOCK_METHOD0(EndAttributes, bool());
- MOCK_METHOD2(FindChildHandler, DIEHandler *(uint64, DwarfTag));
+ MOCK_METHOD2(FindChildHandler, DIEHandler *(uint64_t, DwarfTag));
MOCK_METHOD0(Finish, void());
};
class MockRootDIEHandler: public RootDIEHandler {
public:
MOCK_METHOD3(ProcessAttributeUnsigned,
- void(DwarfAttribute, DwarfForm, uint64));
+ void(DwarfAttribute, DwarfForm, uint64_t));
MOCK_METHOD3(ProcessAttributeSigned,
- void(DwarfAttribute, DwarfForm, int64));
+ void(DwarfAttribute, DwarfForm, int64_t));
MOCK_METHOD3(ProcessAttributeReference,
- void(DwarfAttribute, DwarfForm, uint64));
+ void(DwarfAttribute, DwarfForm, uint64_t));
MOCK_METHOD4(ProcessAttributeBuffer,
- void(DwarfAttribute, DwarfForm, const char *, uint64));
+ void(DwarfAttribute, DwarfForm, const uint8_t *, uint64_t));
MOCK_METHOD3(ProcessAttributeString,
void(DwarfAttribute, DwarfForm, const string &));
MOCK_METHOD3(ProcessAttributeSignature,
- void(DwarfAttribute, DwarfForm, uint64));
+ void(DwarfAttribute, DwarfForm, uint64_t));
MOCK_METHOD0(EndAttributes, bool());
- MOCK_METHOD2(FindChildHandler, DIEHandler *(uint64, DwarfTag));
+ MOCK_METHOD2(FindChildHandler, DIEHandler *(uint64_t, DwarfTag));
MOCK_METHOD0(Finish, void());
- MOCK_METHOD5(StartCompilationUnit, bool(uint64, uint8, uint8, uint64, uint8));
- MOCK_METHOD2(StartRootDIE, bool(uint64, DwarfTag));
+ MOCK_METHOD5(StartCompilationUnit, bool(uint64_t, uint8_t, uint8_t, uint64_t,
+ uint8_t));
+ MOCK_METHOD2(StartRootDIE, bool(uint64_t, DwarfTag));
};
// If the handler elects to skip the compilation unit, the dispatcher
@@ -185,8 +188,9 @@ TEST(Dwarf2DIEHandler, PassAttributeValues) {
MockRootDIEHandler mock_root_handler;
DIEDispatcher die_dispatcher(&mock_root_handler);
- const char buffer[10] = { 0x24, 0x24, 0x35, 0x9a, 0xca,
- 0xcf, 0xa8, 0x84, 0xa7, 0x18 };
+ const uint8_t buffer[10] = {
+ 0x24, 0x24, 0x35, 0x9a, 0xca, 0xcf, 0xa8, 0x84, 0xa7, 0x18
+ };
string str = "\xc8\x26\x2e\x0d\xa4\x9c\x37\xd6\xfb\x1d";
// Set expectations.
diff --git a/src/common/dwarf/dwarf2enums.h b/src/common/dwarf/dwarf2enums.h
index 5565d66e..4316a89c 100644
--- a/src/common/dwarf/dwarf2enums.h
+++ b/src/common/dwarf/dwarf2enums.h
@@ -149,7 +149,10 @@ enum DwarfForm {
DW_FORM_sec_offset = 0x17,
DW_FORM_exprloc = 0x18,
DW_FORM_flag_present = 0x19,
- DW_FORM_ref_sig8 = 0x20
+ DW_FORM_ref_sig8 = 0x20,
+ // Extensions for Fission. See http://gcc.gnu.org/wiki/DebugFission.
+ DW_FORM_GNU_addr_index = 0x1f01,
+ DW_FORM_GNU_str_index = 0x1f02
};
// Attribute names and codes
@@ -229,6 +232,8 @@ enum DwarfAttribute {
DW_AT_call_column = 0x57,
DW_AT_call_file = 0x58,
DW_AT_call_line = 0x59,
+ // DWARF 4
+ DW_AT_linkage_name = 0x6e,
// SGI/MIPS extensions.
DW_AT_MIPS_fde = 0x2001,
DW_AT_MIPS_loop_begin = 0x2002,
@@ -264,6 +269,13 @@ enum DwarfAttribute {
DW_AT_body_begin = 0x2105,
DW_AT_body_end = 0x2106,
DW_AT_GNU_vector = 0x2107,
+ // Extensions for Fission. See http://gcc.gnu.org/wiki/DebugFission.
+ DW_AT_GNU_dwo_name = 0x2130,
+ DW_AT_GNU_dwo_id = 0x2131,
+ DW_AT_GNU_ranges_base = 0x2132,
+ DW_AT_GNU_addr_base = 0x2133,
+ DW_AT_GNU_pubnames = 0x2134,
+ DW_AT_GNU_pubtypes = 0x2135,
// VMS extensions.
DW_AT_VMS_rtnbeg_pd_address = 0x2201,
// UPC extension.
@@ -489,9 +501,24 @@ enum DwarfOpcode {
DW_OP_call_frame_cfa =0x9c,
DW_OP_bit_piece =0x9d,
DW_OP_lo_user =0xe0,
- DW_OP_hi_user =0xff,
+ DW_OP_hi_user =0xff,
// GNU extensions
- DW_OP_GNU_push_tls_address =0xe0
+ DW_OP_GNU_push_tls_address =0xe0,
+ // Extensions for Fission. See http://gcc.gnu.org/wiki/DebugFission.
+ DW_OP_GNU_addr_index =0xfb,
+ DW_OP_GNU_const_index =0xfc
+};
+
+// Section identifiers for DWP files
+enum DwarfSectionId {
+ DW_SECT_INFO = 1,
+ DW_SECT_TYPES = 2,
+ DW_SECT_ABBREV = 3,
+ DW_SECT_LINE = 4,
+ DW_SECT_LOC = 5,
+ DW_SECT_STR_OFFSETS = 6,
+ DW_SECT_MACINFO = 7,
+ DW_SECT_MACRO = 8
};
// Source languages. These are values for DW_AT_language.
@@ -517,6 +544,8 @@ enum DwarfLanguage
DW_LANG_ObjC_plus_plus =0x0011,
DW_LANG_UPC =0x0012,
DW_LANG_D =0x0013,
+ DW_LANG_Rust =0x001c,
+ DW_LANG_Swift =0x001e,
// Implementation-defined language code range.
DW_LANG_lo_user = 0x8000,
DW_LANG_hi_user = 0xffff,
@@ -643,7 +672,7 @@ enum DwarfPointerEncoding
// encoding (except DW_EH_PE_aligned), and indicates that the
// encoded value represents the address at which the true address
// is stored, not the true address itself.
- DW_EH_PE_indirect = 0x80
+ DW_EH_PE_indirect = 0x80
};
} // namespace dwarf2reader
diff --git a/src/common/dwarf/dwarf2reader.cc b/src/common/dwarf/dwarf2reader.cc
index a1e610dd..6b9ce2b4 100644
--- a/src/common/dwarf/dwarf2reader.cc
+++ b/src/common/dwarf/dwarf2reader.cc
@@ -44,18 +44,48 @@
#include <string>
#include <utility>
+#include <sys/stat.h>
+
#include "common/dwarf/bytereader-inl.h"
#include "common/dwarf/bytereader.h"
#include "common/dwarf/line_state_machine.h"
#include "common/using_std_string.h"
+#include "google_breakpad/common/breakpad_types.h"
namespace dwarf2reader {
-CompilationUnit::CompilationUnit(const SectionMap& sections, uint64 offset,
+CompilationUnit::CompilationUnit(const string& path,
+ const SectionMap& sections, uint64_t offset,
ByteReader* reader, Dwarf2Handler* handler)
- : offset_from_section_start_(offset), reader_(reader),
- sections_(sections), handler_(handler), abbrevs_(NULL),
- string_buffer_(NULL), string_buffer_length_(0) {}
+ : path_(path), offset_from_section_start_(offset), reader_(reader),
+ sections_(sections), handler_(handler), abbrevs_(),
+ string_buffer_(NULL), string_buffer_length_(0),
+ str_offsets_buffer_(NULL), str_offsets_buffer_length_(0),
+ addr_buffer_(NULL), addr_buffer_length_(0),
+ is_split_dwarf_(false), dwo_id_(0), dwo_name_(),
+ skeleton_dwo_id_(0), ranges_base_(0), addr_base_(0),
+ have_checked_for_dwp_(false), dwp_path_(),
+ dwp_byte_reader_(), dwp_reader_() {}
+
+// Initialize a compilation unit from a .dwo or .dwp file.
+// In this case, we need the .debug_addr section from the
+// executable file that contains the corresponding skeleton
+// compilation unit. We also inherit the Dwarf2Handler from
+// the executable file, and call it as if we were still
+// processing the original compilation unit.
+
+void CompilationUnit::SetSplitDwarf(const uint8_t* addr_buffer,
+ uint64_t addr_buffer_length,
+ uint64_t addr_base,
+ uint64_t ranges_base,
+ uint64_t dwo_id) {
+ is_split_dwarf_ = true;
+ addr_buffer_ = addr_buffer;
+ addr_buffer_length_ = addr_buffer_length;
+ addr_base_ = addr_base;
+ ranges_base_ = ranges_base;
+ skeleton_dwo_id_ = dwo_id;
+}
// Read a DWARF2/3 abbreviation section.
// Each abbrev consists of a abbreviation number, a tag, a byte
@@ -83,17 +113,17 @@ void CompilationUnit::ReadAbbrevs() {
// The only way to check whether we are reading over the end of the
// buffer would be to first compute the size of the leb128 data by
// reading it, then go back and read it again.
- const char* abbrev_start = iter->second.first +
+ const uint8_t *abbrev_start = iter->second.first +
header_.abbrev_offset;
- const char* abbrevptr = abbrev_start;
+ const uint8_t *abbrevptr = abbrev_start;
#ifndef NDEBUG
- const uint64 abbrev_length = iter->second.second - header_.abbrev_offset;
+ const uint64_t abbrev_length = iter->second.second - header_.abbrev_offset;
#endif
while (1) {
CompilationUnit::Abbrev abbrev;
size_t len;
- const uint64 number = reader_->ReadUnsignedLEB128(abbrevptr, &len);
+ const uint64_t number = reader_->ReadUnsignedLEB128(abbrevptr, &len);
if (number == 0)
break;
@@ -101,7 +131,7 @@ void CompilationUnit::ReadAbbrevs() {
abbrevptr += len;
assert(abbrevptr < abbrev_start + abbrev_length);
- const uint64 tag = reader_->ReadUnsignedLEB128(abbrevptr, &len);
+ const uint64_t tag = reader_->ReadUnsignedLEB128(abbrevptr, &len);
abbrevptr += len;
abbrev.tag = static_cast<enum DwarfTag>(tag);
@@ -112,11 +142,11 @@ void CompilationUnit::ReadAbbrevs() {
assert(abbrevptr < abbrev_start + abbrev_length);
while (1) {
- const uint64 nametemp = reader_->ReadUnsignedLEB128(abbrevptr, &len);
+ const uint64_t nametemp = reader_->ReadUnsignedLEB128(abbrevptr, &len);
abbrevptr += len;
assert(abbrevptr < abbrev_start + abbrev_length);
- const uint64 formtemp = reader_->ReadUnsignedLEB128(abbrevptr, &len);
+ const uint64_t formtemp = reader_->ReadUnsignedLEB128(abbrevptr, &len);
abbrevptr += len;
if (nametemp == 0 && formtemp == 0)
break;
@@ -132,8 +162,8 @@ void CompilationUnit::ReadAbbrevs() {
}
// Skips a single DIE's attributes.
-const char* CompilationUnit::SkipDIE(const char* start,
- const Abbrev& abbrev) {
+const uint8_t *CompilationUnit::SkipDIE(const uint8_t* start,
+ const Abbrev& abbrev) {
for (AttributeList::const_iterator i = abbrev.attributes.begin();
i != abbrev.attributes.end();
i++) {
@@ -143,8 +173,8 @@ const char* CompilationUnit::SkipDIE(const char* start,
}
// Skips a single attribute form's data.
-const char* CompilationUnit::SkipAttribute(const char* start,
- enum DwarfForm form) {
+const uint8_t *CompilationUnit::SkipAttribute(const uint8_t *start,
+ enum DwarfForm form) {
size_t len;
switch (form) {
@@ -171,9 +201,11 @@ const char* CompilationUnit::SkipAttribute(const char* start,
case DW_FORM_ref_sig8:
return start + 8;
case DW_FORM_string:
- return start + strlen(start) + 1;
+ return start + strlen(reinterpret_cast<const char *>(start)) + 1;
case DW_FORM_udata:
case DW_FORM_ref_udata:
+ case DW_FORM_GNU_str_index:
+ case DW_FORM_GNU_addr_index:
reader_->ReadUnsignedLEB128(start, &len);
return start + len;
@@ -201,7 +233,7 @@ const char* CompilationUnit::SkipAttribute(const char* start,
return start + 4 + reader_->ReadFourBytes(start);
case DW_FORM_block:
case DW_FORM_exprloc: {
- uint64 size = reader_->ReadUnsignedLEB128(start, &len);
+ uint64_t size = reader_->ReadUnsignedLEB128(start, &len);
return start + size + len;
}
case DW_FORM_strp:
@@ -218,11 +250,11 @@ const char* CompilationUnit::SkipAttribute(const char* start,
// the offset in the .debug_abbrev section for our abbrevs, and an
// address size.
void CompilationUnit::ReadHeader() {
- const char* headerptr = buffer_;
+ const uint8_t *headerptr = buffer_;
size_t initial_length_size;
assert(headerptr + 4 < buffer_ + buffer_length_);
- const uint64 initial_length
+ const uint64_t initial_length
= reader_->ReadInitialLength(headerptr, &initial_length_size);
headerptr += initial_length_size;
header_.length = initial_length;
@@ -235,7 +267,9 @@ void CompilationUnit::ReadHeader() {
header_.abbrev_offset = reader_->ReadOffset(headerptr);
headerptr += reader_->OffsetSize();
- assert(headerptr + 1 < buffer_ + buffer_length_);
+ // Compare against less than or equal because this may be the last
+ // section in the file.
+ assert(headerptr + 1 <= buffer_ + buffer_length_);
header_.address_size = reader_->ReadOneByte(headerptr);
reader_->SetAddressSize(header_.address_size);
headerptr += 1;
@@ -249,7 +283,7 @@ void CompilationUnit::ReadHeader() {
buffer_ + buffer_length_);
}
-uint64 CompilationUnit::Start() {
+uint64_t CompilationUnit::Start() {
// First get the debug_info section. ".debug_info" is the name
// recommended in the DWARF spec, and used on Linux; "__debug_info"
// is the name used in Mac OS X Mach-O files.
@@ -268,7 +302,7 @@ uint64 CompilationUnit::Start() {
// Figure out the real length from the end of the initial length to
// the end of the compilation unit, since that is the value we
// return.
- uint64 ourlength = header_.length;
+ uint64_t ourlength = header_.length;
if (reader_->OffsetSize() == 8)
ourlength += 12;
else
@@ -296,17 +330,39 @@ uint64 CompilationUnit::Start() {
string_buffer_length_ = iter->second.second;
}
+ // Set the string offsets section if we have one.
+ iter = sections_.find(".debug_str_offsets");
+ if (iter != sections_.end()) {
+ str_offsets_buffer_ = iter->second.first;
+ str_offsets_buffer_length_ = iter->second.second;
+ }
+
+ // Set the address section if we have one.
+ iter = sections_.find(".debug_addr");
+ if (iter != sections_.end()) {
+ addr_buffer_ = iter->second.first;
+ addr_buffer_length_ = iter->second.second;
+ }
+
// Now that we have our abbreviations, start processing DIE's.
ProcessDIEs();
+ // If this is a skeleton compilation unit generated with split DWARF,
+ // and the client needs the full debug info, we need to find the full
+ // compilation unit in a .dwo or .dwp file.
+ if (!is_split_dwarf_
+ && dwo_name_ != NULL
+ && handler_->NeedSplitDebugInfo())
+ ProcessSplitDwarf();
+
return ourlength;
}
// If one really wanted, you could merge SkipAttribute and
// ProcessAttribute
// This is all boring data manipulation and calling of the handler.
-const char* CompilationUnit::ProcessAttribute(
- uint64 dieoffset, const char* start, enum DwarfAttribute attr,
+const uint8_t *CompilationUnit::ProcessAttribute(
+ uint64_t dieoffset, const uint8_t *start, enum DwarfAttribute attr,
enum DwarfForm form) {
size_t len;
@@ -320,48 +376,46 @@ const char* CompilationUnit::ProcessAttribute(
return ProcessAttribute(dieoffset, start, attr, form);
case DW_FORM_flag_present:
- handler_->ProcessAttributeUnsigned(dieoffset, attr, form, 1);
+ ProcessAttributeUnsigned(dieoffset, attr, form, 1);
return start;
case DW_FORM_data1:
case DW_FORM_flag:
- handler_->ProcessAttributeUnsigned(dieoffset, attr, form,
- reader_->ReadOneByte(start));
+ ProcessAttributeUnsigned(dieoffset, attr, form,
+ reader_->ReadOneByte(start));
return start + 1;
case DW_FORM_data2:
- handler_->ProcessAttributeUnsigned(dieoffset, attr, form,
- reader_->ReadTwoBytes(start));
+ ProcessAttributeUnsigned(dieoffset, attr, form,
+ reader_->ReadTwoBytes(start));
return start + 2;
case DW_FORM_data4:
- handler_->ProcessAttributeUnsigned(dieoffset, attr, form,
- reader_->ReadFourBytes(start));
+ ProcessAttributeUnsigned(dieoffset, attr, form,
+ reader_->ReadFourBytes(start));
return start + 4;
case DW_FORM_data8:
- handler_->ProcessAttributeUnsigned(dieoffset, attr, form,
- reader_->ReadEightBytes(start));
+ ProcessAttributeUnsigned(dieoffset, attr, form,
+ reader_->ReadEightBytes(start));
return start + 8;
case DW_FORM_string: {
- const char* str = start;
- handler_->ProcessAttributeString(dieoffset, attr, form,
- str);
+ const char *str = reinterpret_cast<const char *>(start);
+ ProcessAttributeString(dieoffset, attr, form, str);
return start + strlen(str) + 1;
}
case DW_FORM_udata:
- handler_->ProcessAttributeUnsigned(dieoffset, attr, form,
- reader_->ReadUnsignedLEB128(start,
- &len));
+ ProcessAttributeUnsigned(dieoffset, attr, form,
+ reader_->ReadUnsignedLEB128(start, &len));
return start + len;
case DW_FORM_sdata:
- handler_->ProcessAttributeSigned(dieoffset, attr, form,
- reader_->ReadSignedLEB128(start, &len));
+ ProcessAttributeSigned(dieoffset, attr, form,
+ reader_->ReadSignedLEB128(start, &len));
return start + len;
case DW_FORM_addr:
- handler_->ProcessAttributeUnsigned(dieoffset, attr, form,
- reader_->ReadAddress(start));
+ ProcessAttributeUnsigned(dieoffset, attr, form,
+ reader_->ReadAddress(start));
return start + reader_->AddressSize();
case DW_FORM_sec_offset:
- handler_->ProcessAttributeUnsigned(dieoffset, attr, form,
- reader_->ReadOffset(start));
+ ProcessAttributeUnsigned(dieoffset, attr, form,
+ reader_->ReadOffset(start));
return start + reader_->OffsetSize();
case DW_FORM_ref1:
@@ -410,26 +464,26 @@ const char* CompilationUnit::ProcessAttribute(
return start + 8;
case DW_FORM_block1: {
- uint64 datalen = reader_->ReadOneByte(start);
+ uint64_t datalen = reader_->ReadOneByte(start);
handler_->ProcessAttributeBuffer(dieoffset, attr, form, start + 1,
datalen);
return start + 1 + datalen;
}
case DW_FORM_block2: {
- uint64 datalen = reader_->ReadTwoBytes(start);
+ uint64_t datalen = reader_->ReadTwoBytes(start);
handler_->ProcessAttributeBuffer(dieoffset, attr, form, start + 2,
datalen);
return start + 2 + datalen;
}
case DW_FORM_block4: {
- uint64 datalen = reader_->ReadFourBytes(start);
+ uint64_t datalen = reader_->ReadFourBytes(start);
handler_->ProcessAttributeBuffer(dieoffset, attr, form, start + 4,
datalen);
return start + 4 + datalen;
}
case DW_FORM_block:
case DW_FORM_exprloc: {
- uint64 datalen = reader_->ReadUnsignedLEB128(start, &len);
+ uint64_t datalen = reader_->ReadUnsignedLEB128(start, &len);
handler_->ProcessAttributeBuffer(dieoffset, attr, form, start + len,
datalen);
return start + datalen + len;
@@ -437,37 +491,69 @@ const char* CompilationUnit::ProcessAttribute(
case DW_FORM_strp: {
assert(string_buffer_ != NULL);
- const uint64 offset = reader_->ReadOffset(start);
+ const uint64_t offset = reader_->ReadOffset(start);
assert(string_buffer_ + offset < string_buffer_ + string_buffer_length_);
- const char* str = string_buffer_ + offset;
- handler_->ProcessAttributeString(dieoffset, attr, form,
- str);
+ const char *str = reinterpret_cast<const char *>(string_buffer_ + offset);
+ ProcessAttributeString(dieoffset, attr, form, str);
return start + reader_->OffsetSize();
}
+
+ case DW_FORM_GNU_str_index: {
+ uint64_t str_index = reader_->ReadUnsignedLEB128(start, &len);
+ const uint8_t* offset_ptr =
+ str_offsets_buffer_ + str_index * reader_->OffsetSize();
+ const uint64_t offset = reader_->ReadOffset(offset_ptr);
+ if (offset >= string_buffer_length_) {
+ return NULL;
+ }
+
+ const char* str = reinterpret_cast<const char *>(string_buffer_) + offset;
+ ProcessAttributeString(dieoffset, attr, form, str);
+ return start + len;
+ break;
+ }
+ case DW_FORM_GNU_addr_index: {
+ uint64_t addr_index = reader_->ReadUnsignedLEB128(start, &len);
+ const uint8_t* addr_ptr =
+ addr_buffer_ + addr_base_ + addr_index * reader_->AddressSize();
+ ProcessAttributeUnsigned(dieoffset, attr, form,
+ reader_->ReadAddress(addr_ptr));
+ return start + len;
+ }
}
fprintf(stderr, "Unhandled form type\n");
return NULL;
}
-const char* CompilationUnit::ProcessDIE(uint64 dieoffset,
- const char* start,
- const Abbrev& abbrev) {
+const uint8_t *CompilationUnit::ProcessDIE(uint64_t dieoffset,
+ const uint8_t *start,
+ const Abbrev& abbrev) {
for (AttributeList::const_iterator i = abbrev.attributes.begin();
i != abbrev.attributes.end();
i++) {
start = ProcessAttribute(dieoffset, start, i->first, i->second);
}
+
+ // If this is a compilation unit in a split DWARF object, verify that
+ // the dwo_id matches. If it does not match, we will ignore this
+ // compilation unit.
+ if (abbrev.tag == DW_TAG_compile_unit
+ && is_split_dwarf_
+ && dwo_id_ != skeleton_dwo_id_) {
+ return NULL;
+ }
+
return start;
}
void CompilationUnit::ProcessDIEs() {
- const char* dieptr = after_header_;
+ const uint8_t *dieptr = after_header_;
size_t len;
// lengthstart is the place the length field is based on.
// It is the point in the header after the initial length field
- const char* lengthstart = buffer_;
+ const uint8_t *lengthstart = buffer_;
// In 64 bit dwarf, the initial length is 12 bytes, because of the
// 0xffffffff at the start.
@@ -476,14 +562,14 @@ void CompilationUnit::ProcessDIEs() {
else
lengthstart += 4;
- std::stack<uint64> die_stack;
+ std::stack<uint64_t> die_stack;
while (dieptr < (lengthstart + header_.length)) {
// We give the user the absolute offset from the beginning of
// debug_info, since they need it to deal with ref_addr forms.
- uint64 absolute_offset = (dieptr - buffer_) + offset_from_section_start_;
+ uint64_t absolute_offset = (dieptr - buffer_) + offset_from_section_start_;
- uint64 abbrev_num = reader_->ReadUnsignedLEB128(dieptr, &len);
+ uint64_t abbrev_num = reader_->ReadUnsignedLEB128(dieptr, &len);
dieptr += len;
@@ -493,7 +579,7 @@ void CompilationUnit::ProcessDIEs() {
if (die_stack.size() == 0)
// If it is padding, then we are done with the compilation unit's DIEs.
return;
- const uint64 offset = die_stack.top();
+ const uint64_t offset = die_stack.top();
die_stack.pop();
handler_->EndDIE(offset);
continue;
@@ -515,14 +601,317 @@ void CompilationUnit::ProcessDIEs() {
}
}
-LineInfo::LineInfo(const char* buffer, uint64 buffer_length,
+// Check for a valid ELF file and return the Address size.
+// Returns 0 if not a valid ELF file.
+inline int GetElfWidth(const ElfReader& elf) {
+ if (elf.IsElf32File())
+ return 4;
+ if (elf.IsElf64File())
+ return 8;
+ return 0;
+}
+
+void CompilationUnit::ProcessSplitDwarf() {
+ struct stat statbuf;
+ if (!have_checked_for_dwp_) {
+ // Look for a .dwp file in the same directory as the executable.
+ have_checked_for_dwp_ = true;
+ string dwp_suffix(".dwp");
+ dwp_path_ = path_ + dwp_suffix;
+ if (stat(dwp_path_.c_str(), &statbuf) != 0) {
+ // Fall back to a split .debug file in the same directory.
+ string debug_suffix(".debug");
+ dwp_path_ = path_;
+ size_t found = path_.rfind(debug_suffix);
+ if (found + debug_suffix.length() == path_.length())
+ dwp_path_ = dwp_path_.replace(found, debug_suffix.length(), dwp_suffix);
+ }
+ if (stat(dwp_path_.c_str(), &statbuf) == 0) {
+ ElfReader* elf = new ElfReader(dwp_path_);
+ int width = GetElfWidth(*elf);
+ if (width != 0) {
+ dwp_byte_reader_.reset(new ByteReader(reader_->GetEndianness()));
+ dwp_byte_reader_->SetAddressSize(width);
+ dwp_reader_.reset(new DwpReader(*dwp_byte_reader_, elf));
+ dwp_reader_->Initialize();
+ } else {
+ delete elf;
+ }
+ }
+ }
+ bool found_in_dwp = false;
+ if (dwp_reader_) {
+ // If we have a .dwp file, read the debug sections for the requested CU.
+ SectionMap sections;
+ dwp_reader_->ReadDebugSectionsForCU(dwo_id_, &sections);
+ if (!sections.empty()) {
+ found_in_dwp = true;
+ CompilationUnit dwp_comp_unit(dwp_path_, sections, 0,
+ dwp_byte_reader_.get(), handler_);
+ dwp_comp_unit.SetSplitDwarf(addr_buffer_, addr_buffer_length_, addr_base_,
+ ranges_base_, dwo_id_);
+ dwp_comp_unit.Start();
+ }
+ }
+ if (!found_in_dwp) {
+ // If no .dwp file, try to open the .dwo file.
+ if (stat(dwo_name_, &statbuf) == 0) {
+ ElfReader elf(dwo_name_);
+ int width = GetElfWidth(elf);
+ if (width != 0) {
+ ByteReader reader(ENDIANNESS_LITTLE);
+ reader.SetAddressSize(width);
+ SectionMap sections;
+ ReadDebugSectionsFromDwo(&elf, &sections);
+ CompilationUnit dwo_comp_unit(dwo_name_, sections, 0, &reader,
+ handler_);
+ dwo_comp_unit.SetSplitDwarf(addr_buffer_, addr_buffer_length_,
+ addr_base_, ranges_base_, dwo_id_);
+ dwo_comp_unit.Start();
+ }
+ }
+ }
+}
+
+void CompilationUnit::ReadDebugSectionsFromDwo(ElfReader* elf_reader,
+ SectionMap* sections) {
+ static const char* const section_names[] = {
+ ".debug_abbrev",
+ ".debug_info",
+ ".debug_str_offsets",
+ ".debug_str"
+ };
+ for (unsigned int i = 0u;
+ i < sizeof(section_names)/sizeof(*(section_names)); ++i) {
+ string base_name = section_names[i];
+ string dwo_name = base_name + ".dwo";
+ size_t section_size;
+ const char* section_data = elf_reader->GetSectionByName(dwo_name,
+ &section_size);
+ if (section_data != NULL)
+ sections->insert(std::make_pair(
+ base_name, std::make_pair(
+ reinterpret_cast<const uint8_t *>(section_data),
+ section_size)));
+ }
+}
+
+DwpReader::DwpReader(const ByteReader& byte_reader, ElfReader* elf_reader)
+ : elf_reader_(elf_reader), byte_reader_(byte_reader),
+ cu_index_(NULL), cu_index_size_(0), string_buffer_(NULL),
+ string_buffer_size_(0), version_(0), ncolumns_(0), nunits_(0),
+ nslots_(0), phash_(NULL), pindex_(NULL), shndx_pool_(NULL),
+ offset_table_(NULL), size_table_(NULL), abbrev_data_(NULL),
+ abbrev_size_(0), info_data_(NULL), info_size_(0),
+ str_offsets_data_(NULL), str_offsets_size_(0) {}
+
+DwpReader::~DwpReader() {
+ if (elf_reader_) delete elf_reader_;
+}
+
+void DwpReader::Initialize() {
+ cu_index_ = elf_reader_->GetSectionByName(".debug_cu_index",
+ &cu_index_size_);
+ if (cu_index_ == NULL) {
+ return;
+ }
+ // The .debug_str.dwo section is shared by all CUs in the file.
+ string_buffer_ = elf_reader_->GetSectionByName(".debug_str.dwo",
+ &string_buffer_size_);
+
+ version_ = byte_reader_.ReadFourBytes(
+ reinterpret_cast<const uint8_t *>(cu_index_));
+
+ if (version_ == 1) {
+ nslots_ = byte_reader_.ReadFourBytes(
+ reinterpret_cast<const uint8_t *>(cu_index_)
+ + 3 * sizeof(uint32_t));
+ phash_ = cu_index_ + 4 * sizeof(uint32_t);
+ pindex_ = phash_ + nslots_ * sizeof(uint64_t);
+ shndx_pool_ = pindex_ + nslots_ * sizeof(uint32_t);
+ if (shndx_pool_ >= cu_index_ + cu_index_size_) {
+ version_ = 0;
+ }
+ } else if (version_ == 2) {
+ ncolumns_ = byte_reader_.ReadFourBytes(
+ reinterpret_cast<const uint8_t *>(cu_index_) + sizeof(uint32_t));
+ nunits_ = byte_reader_.ReadFourBytes(
+ reinterpret_cast<const uint8_t *>(cu_index_) + 2 * sizeof(uint32_t));
+ nslots_ = byte_reader_.ReadFourBytes(
+ reinterpret_cast<const uint8_t *>(cu_index_) + 3 * sizeof(uint32_t));
+ phash_ = cu_index_ + 4 * sizeof(uint32_t);
+ pindex_ = phash_ + nslots_ * sizeof(uint64_t);
+ offset_table_ = pindex_ + nslots_ * sizeof(uint32_t);
+ size_table_ = offset_table_ + ncolumns_ * (nunits_ + 1) * sizeof(uint32_t);
+ abbrev_data_ = elf_reader_->GetSectionByName(".debug_abbrev.dwo",
+ &abbrev_size_);
+ info_data_ = elf_reader_->GetSectionByName(".debug_info.dwo", &info_size_);
+ str_offsets_data_ = elf_reader_->GetSectionByName(".debug_str_offsets.dwo",
+ &str_offsets_size_);
+ if (size_table_ >= cu_index_ + cu_index_size_) {
+ version_ = 0;
+ }
+ }
+}
+
+void DwpReader::ReadDebugSectionsForCU(uint64_t dwo_id,
+ SectionMap* sections) {
+ if (version_ == 1) {
+ int slot = LookupCU(dwo_id);
+ if (slot == -1) {
+ return;
+ }
+
+ // The index table points to the section index pool, where we
+ // can read a list of section indexes for the debug sections
+ // for the CU whose dwo_id we are looking for.
+ int index = byte_reader_.ReadFourBytes(
+ reinterpret_cast<const uint8_t *>(pindex_)
+ + slot * sizeof(uint32_t));
+ const char* shndx_list = shndx_pool_ + index * sizeof(uint32_t);
+ for (;;) {
+ if (shndx_list >= cu_index_ + cu_index_size_) {
+ version_ = 0;
+ return;
+ }
+ unsigned int shndx = byte_reader_.ReadFourBytes(
+ reinterpret_cast<const uint8_t *>(shndx_list));
+ shndx_list += sizeof(uint32_t);
+ if (shndx == 0)
+ break;
+ const char* section_name = elf_reader_->GetSectionName(shndx);
+ size_t section_size;
+ const char* section_data;
+ // We're only interested in these four debug sections.
+ // The section names in the .dwo file end with ".dwo", but we
+ // add them to the sections table with their normal names.
+ if (!strncmp(section_name, ".debug_abbrev", strlen(".debug_abbrev"))) {
+ section_data = elf_reader_->GetSectionByIndex(shndx, &section_size);
+ sections->insert(std::make_pair(
+ ".debug_abbrev",
+ std::make_pair(reinterpret_cast<const uint8_t *> (section_data),
+ section_size)));
+ } else if (!strncmp(section_name, ".debug_info", strlen(".debug_info"))) {
+ section_data = elf_reader_->GetSectionByIndex(shndx, &section_size);
+ sections->insert(std::make_pair(
+ ".debug_info",
+ std::make_pair(reinterpret_cast<const uint8_t *> (section_data),
+ section_size)));
+ } else if (!strncmp(section_name, ".debug_str_offsets",
+ strlen(".debug_str_offsets"))) {
+ section_data = elf_reader_->GetSectionByIndex(shndx, &section_size);
+ sections->insert(std::make_pair(
+ ".debug_str_offsets",
+ std::make_pair(reinterpret_cast<const uint8_t *> (section_data),
+ section_size)));
+ }
+ }
+ sections->insert(std::make_pair(
+ ".debug_str",
+ std::make_pair(reinterpret_cast<const uint8_t *> (string_buffer_),
+ string_buffer_size_)));
+ } else if (version_ == 2) {
+ uint32_t index = LookupCUv2(dwo_id);
+ if (index == 0) {
+ return;
+ }
+
+ // The index points to a row in each of the section offsets table
+ // and the section size table, where we can read the offsets and sizes
+ // of the contributions to each debug section from the CU whose dwo_id
+ // we are looking for. Row 0 of the section offsets table has the
+ // section ids for each column of the table. The size table begins
+ // with row 1.
+ const char* id_row = offset_table_;
+ const char* offset_row = offset_table_
+ + index * ncolumns_ * sizeof(uint32_t);
+ const char* size_row =
+ size_table_ + (index - 1) * ncolumns_ * sizeof(uint32_t);
+ if (size_row + ncolumns_ * sizeof(uint32_t) > cu_index_ + cu_index_size_) {
+ version_ = 0;
+ return;
+ }
+ for (unsigned int col = 0u; col < ncolumns_; ++col) {
+ uint32_t section_id =
+ byte_reader_.ReadFourBytes(reinterpret_cast<const uint8_t *>(id_row)
+ + col * sizeof(uint32_t));
+ uint32_t offset = byte_reader_.ReadFourBytes(
+ reinterpret_cast<const uint8_t *>(offset_row)
+ + col * sizeof(uint32_t));
+ uint32_t size = byte_reader_.ReadFourBytes(
+ reinterpret_cast<const uint8_t *>(size_row) + col * sizeof(uint32_t));
+ if (section_id == DW_SECT_ABBREV) {
+ sections->insert(std::make_pair(
+ ".debug_abbrev",
+ std::make_pair(reinterpret_cast<const uint8_t *> (abbrev_data_)
+ + offset, size)));
+ } else if (section_id == DW_SECT_INFO) {
+ sections->insert(std::make_pair(
+ ".debug_info",
+ std::make_pair(reinterpret_cast<const uint8_t *> (info_data_)
+ + offset, size)));
+ } else if (section_id == DW_SECT_STR_OFFSETS) {
+ sections->insert(std::make_pair(
+ ".debug_str_offsets",
+ std::make_pair(reinterpret_cast<const uint8_t *> (str_offsets_data_)
+ + offset, size)));
+ }
+ }
+ sections->insert(std::make_pair(
+ ".debug_str",
+ std::make_pair(reinterpret_cast<const uint8_t *> (string_buffer_),
+ string_buffer_size_)));
+ }
+}
+
+int DwpReader::LookupCU(uint64_t dwo_id) {
+ uint32_t slot = static_cast<uint32_t>(dwo_id) & (nslots_ - 1);
+ uint64_t probe = byte_reader_.ReadEightBytes(
+ reinterpret_cast<const uint8_t *>(phash_) + slot * sizeof(uint64_t));
+ if (probe != 0 && probe != dwo_id) {
+ uint32_t secondary_hash =
+ (static_cast<uint32_t>(dwo_id >> 32) & (nslots_ - 1)) | 1;
+ do {
+ slot = (slot + secondary_hash) & (nslots_ - 1);
+ probe = byte_reader_.ReadEightBytes(
+ reinterpret_cast<const uint8_t *>(phash_) + slot * sizeof(uint64_t));
+ } while (probe != 0 && probe != dwo_id);
+ }
+ if (probe == 0)
+ return -1;
+ return slot;
+}
+
+uint32_t DwpReader::LookupCUv2(uint64_t dwo_id) {
+ uint32_t slot = static_cast<uint32_t>(dwo_id) & (nslots_ - 1);
+ uint64_t probe = byte_reader_.ReadEightBytes(
+ reinterpret_cast<const uint8_t *>(phash_) + slot * sizeof(uint64_t));
+ uint32_t index = byte_reader_.ReadFourBytes(
+ reinterpret_cast<const uint8_t *>(pindex_) + slot * sizeof(uint32_t));
+ if (index != 0 && probe != dwo_id) {
+ uint32_t secondary_hash =
+ (static_cast<uint32_t>(dwo_id >> 32) & (nslots_ - 1)) | 1;
+ do {
+ slot = (slot + secondary_hash) & (nslots_ - 1);
+ probe = byte_reader_.ReadEightBytes(
+ reinterpret_cast<const uint8_t *>(phash_) + slot * sizeof(uint64_t));
+ index = byte_reader_.ReadFourBytes(
+ reinterpret_cast<const uint8_t *>(pindex_) + slot * sizeof(uint32_t));
+ } while (index != 0 && probe != dwo_id);
+ }
+ return index;
+}
+
+LineInfo::LineInfo(const uint8_t *buffer, uint64_t buffer_length,
ByteReader* reader, LineInfoHandler* handler):
- handler_(handler), reader_(reader), buffer_(buffer),
- buffer_length_(buffer_length) {
+ handler_(handler), reader_(reader), buffer_(buffer) {
+#ifndef NDEBUG
+ buffer_length_ = buffer_length;
+#endif
header_.std_opcode_lengths = NULL;
}
-uint64 LineInfo::Start() {
+uint64_t LineInfo::Start() {
ReadHeader();
ReadLines();
return after_header_ - buffer_;
@@ -531,10 +920,10 @@ uint64 LineInfo::Start() {
// The header for a debug_line section is mildly complicated, because
// the line info is very tightly encoded.
void LineInfo::ReadHeader() {
- const char* lineptr = buffer_;
+ const uint8_t *lineptr = buffer_;
size_t initial_length_size;
- const uint64 initial_length
+ const uint64_t initial_length
= reader_->ReadInitialLength(lineptr, &initial_length_size);
lineptr += initial_length_size;
@@ -554,10 +943,17 @@ void LineInfo::ReadHeader() {
header_.min_insn_length = reader_->ReadOneByte(lineptr);
lineptr += 1;
+ if (header_.version >= 4) {
+ __attribute__((unused)) uint8_t max_ops_per_insn =
+ reader_->ReadOneByte(lineptr);
+ ++lineptr;
+ assert(max_ops_per_insn == 1);
+ }
+
header_.default_is_stmt = reader_->ReadOneByte(lineptr);
lineptr += 1;
- header_.line_base = *reinterpret_cast<const int8*>(lineptr);
+ header_.line_base = *reinterpret_cast<const int8_t*>(lineptr);
lineptr += 1;
header_.line_range = reader_->ReadOneByte(lineptr);
@@ -576,9 +972,9 @@ void LineInfo::ReadHeader() {
// It is legal for the directory entry table to be empty.
if (*lineptr) {
- uint32 dirindex = 1;
+ uint32_t dirindex = 1;
while (*lineptr) {
- const char* dirname = lineptr;
+ const char *dirname = reinterpret_cast<const char *>(lineptr);
handler_->DefineDir(dirname, dirindex);
lineptr += strlen(dirname) + 1;
dirindex++;
@@ -588,21 +984,21 @@ void LineInfo::ReadHeader() {
// It is also legal for the file entry table to be empty.
if (*lineptr) {
- uint32 fileindex = 1;
+ uint32_t fileindex = 1;
size_t len;
while (*lineptr) {
- const char* filename = lineptr;
+ const char *filename = reinterpret_cast<const char *>(lineptr);
lineptr += strlen(filename) + 1;
- uint64 dirindex = reader_->ReadUnsignedLEB128(lineptr, &len);
+ uint64_t dirindex = reader_->ReadUnsignedLEB128(lineptr, &len);
lineptr += len;
- uint64 mod_time = reader_->ReadUnsignedLEB128(lineptr, &len);
+ uint64_t mod_time = reader_->ReadUnsignedLEB128(lineptr, &len);
lineptr += len;
- uint64 filelength = reader_->ReadUnsignedLEB128(lineptr, &len);
+ uint64_t filelength = reader_->ReadUnsignedLEB128(lineptr, &len);
lineptr += len;
- handler_->DefineFile(filename, fileindex, static_cast<uint32>(dirindex),
+ handler_->DefineFile(filename, fileindex, static_cast<uint32_t>(dirindex),
mod_time, filelength);
fileindex++;
}
@@ -616,14 +1012,14 @@ void LineInfo::ReadHeader() {
bool LineInfo::ProcessOneOpcode(ByteReader* reader,
LineInfoHandler* handler,
const struct LineInfoHeader &header,
- const char* start,
+ const uint8_t *start,
struct LineStateMachine* lsm,
size_t* len,
uintptr pc,
bool *lsm_passes_pc) {
size_t oplen = 0;
size_t templen;
- uint8 opcode = reader->ReadOneByte(start);
+ uint8_t opcode = reader->ReadOneByte(start);
oplen++;
start++;
@@ -631,9 +1027,9 @@ bool LineInfo::ProcessOneOpcode(ByteReader* reader,
// opcode. Most line programs consist mainly of special opcodes.
if (opcode >= header.opcode_base) {
opcode -= header.opcode_base;
- const int64 advance_address = (opcode / header.line_range)
+ const int64_t advance_address = (opcode / header.line_range)
* header.min_insn_length;
- const int32 advance_line = (opcode % header.line_range)
+ const int32_t advance_line = (opcode % header.line_range)
+ header.line_base;
// Check if the lsm passes "pc". If so, mark it as passed.
@@ -658,7 +1054,7 @@ bool LineInfo::ProcessOneOpcode(ByteReader* reader,
}
case DW_LNS_advance_pc: {
- uint64 advance_address = reader->ReadUnsignedLEB128(start, &templen);
+ uint64_t advance_address = reader->ReadUnsignedLEB128(start, &templen);
oplen += templen;
// Check if the lsm passes "pc". If so, mark it as passed.
@@ -671,9 +1067,9 @@ bool LineInfo::ProcessOneOpcode(ByteReader* reader,
}
break;
case DW_LNS_advance_line: {
- const int64 advance_line = reader->ReadSignedLEB128(start, &templen);
+ const int64_t advance_line = reader->ReadSignedLEB128(start, &templen);
oplen += templen;
- lsm->line_num += static_cast<int32>(advance_line);
+ lsm->line_num += static_cast<int32_t>(advance_line);
// With gcc 4.2.1, we can get the line_no here for the first time
// since DW_LNS_advance_line is called after DW_LNE_set_address is
@@ -685,15 +1081,15 @@ bool LineInfo::ProcessOneOpcode(ByteReader* reader,
}
break;
case DW_LNS_set_file: {
- const uint64 fileno = reader->ReadUnsignedLEB128(start, &templen);
+ const uint64_t fileno = reader->ReadUnsignedLEB128(start, &templen);
oplen += templen;
- lsm->file_num = static_cast<uint32>(fileno);
+ lsm->file_num = static_cast<uint32_t>(fileno);
}
break;
case DW_LNS_set_column: {
- const uint64 colno = reader->ReadUnsignedLEB128(start, &templen);
+ const uint64_t colno = reader->ReadUnsignedLEB128(start, &templen);
oplen += templen;
- lsm->column_num = static_cast<uint32>(colno);
+ lsm->column_num = static_cast<uint32_t>(colno);
}
break;
case DW_LNS_negate_stmt: {
@@ -705,7 +1101,7 @@ bool LineInfo::ProcessOneOpcode(ByteReader* reader,
}
break;
case DW_LNS_fixed_advance_pc: {
- const uint16 advance_address = reader->ReadTwoBytes(start);
+ const uint16_t advance_address = reader->ReadTwoBytes(start);
oplen += 2;
// Check if the lsm passes "pc". If so, mark it as passed.
@@ -718,7 +1114,7 @@ bool LineInfo::ProcessOneOpcode(ByteReader* reader,
}
break;
case DW_LNS_const_add_pc: {
- const int64 advance_address = header.min_insn_length
+ const int64_t advance_address = header.min_insn_length
* ((255 - header.opcode_base)
/ header.line_range);
@@ -732,12 +1128,12 @@ bool LineInfo::ProcessOneOpcode(ByteReader* reader,
}
break;
case DW_LNS_extended_op: {
- const uint64 extended_op_len = reader->ReadUnsignedLEB128(start,
+ const uint64_t extended_op_len = reader->ReadUnsignedLEB128(start,
&templen);
start += templen;
oplen += templen + extended_op_len;
- const uint64 extended_op = reader->ReadOneByte(start);
+ const uint64_t extended_op = reader->ReadOneByte(start);
start++;
switch (extended_op) {
@@ -752,29 +1148,29 @@ bool LineInfo::ProcessOneOpcode(ByteReader* reader,
// DW_LNE_set_address is called before DW_LNS_advance_line is
// called. So we do not check if the lsm passes "pc" here. See
// also the comment in DW_LNS_advance_line.
- uint64 address = reader->ReadAddress(start);
+ uint64_t address = reader->ReadAddress(start);
lsm->address = address;
}
break;
case DW_LNE_define_file: {
- const char* filename = start;
+ const char *filename = reinterpret_cast<const char *>(start);
templen = strlen(filename) + 1;
start += templen;
- uint64 dirindex = reader->ReadUnsignedLEB128(start, &templen);
+ uint64_t dirindex = reader->ReadUnsignedLEB128(start, &templen);
oplen += templen;
- const uint64 mod_time = reader->ReadUnsignedLEB128(start,
+ const uint64_t mod_time = reader->ReadUnsignedLEB128(start,
&templen);
oplen += templen;
- const uint64 filelength = reader->ReadUnsignedLEB128(start,
+ const uint64_t filelength = reader->ReadUnsignedLEB128(start,
&templen);
oplen += templen;
if (handler) {
- handler->DefineFile(filename, -1, static_cast<uint32>(dirindex),
+ handler->DefineFile(filename, -1, static_cast<uint32_t>(dirindex),
mod_time, filelength);
}
}
@@ -804,7 +1200,7 @@ void LineInfo::ReadLines() {
// lengthstart is the place the length field is based on.
// It is the point in the header after the initial length field
- const char* lengthstart = buffer_;
+ const uint8_t *lengthstart = buffer_;
// In 64 bit dwarf, the initial length is 12 bytes, because of the
// 0xffffffff at the start.
@@ -813,7 +1209,7 @@ void LineInfo::ReadLines() {
else
lengthstart += 4;
- const char* lineptr = after_header_;
+ const uint8_t *lineptr = after_header_;
lsm.Reset(header_.default_is_stmt);
// The LineInfoHandler interface expects each line's length along
@@ -822,8 +1218,8 @@ void LineInfo::ReadLines() {
// from the next address. So we report a line only when we get the
// next line's address, or the end-of-sequence address.
bool have_pending_line = false;
- uint64 pending_address = 0;
- uint32 pending_file_num = 0, pending_line_num = 0, pending_column_num = 0;
+ uint64_t pending_address = 0;
+ uint32_t pending_file_num = 0, pending_line_num = 0, pending_column_num = 0;
while (lineptr < lengthstart + header_.total_length) {
size_t oplength;
@@ -852,6 +1248,41 @@ void LineInfo::ReadLines() {
after_header_ = lengthstart + header_.total_length;
}
+RangeListReader::RangeListReader(const uint8_t *buffer, uint64_t size,
+ ByteReader *reader, RangeListHandler *handler)
+ : buffer_(buffer), size_(size), reader_(reader), handler_(handler) { }
+
+bool RangeListReader::ReadRangeList(uint64_t offset) {
+ const uint64_t max_address =
+ (reader_->AddressSize() == 4) ? 0xffffffffUL
+ : 0xffffffffffffffffULL;
+ const uint64_t entry_size = reader_->AddressSize() * 2;
+ bool list_end = false;
+
+ do {
+ if (offset > size_ - entry_size) {
+ return false; // Invalid range detected
+ }
+
+ uint64_t start_address = reader_->ReadAddress(buffer_ + offset);
+ uint64_t end_address =
+ reader_->ReadAddress(buffer_ + offset + reader_->AddressSize());
+
+ if (start_address == max_address) { // Base address selection
+ handler_->SetBaseAddress(end_address);
+ } else if (start_address == 0 && end_address == 0) { // End-of-list
+ handler_->Finish();
+ list_end = true;
+ } else { // Add a range entry
+ handler_->AddRange(start_address, end_address);
+ }
+
+ offset += entry_size;
+ } while (!list_end);
+
+ return true;
+}
+
// A DWARF rule for recovering the address or value of a register, or
// computing the canonical frame address. There is one subclass of this for
// each '*Rule' member function in CallFrameInfo::Handler.
@@ -875,7 +1306,7 @@ class CallFrameInfo::Rule {
// the canonical frame address. Return what the HANDLER member function
// returned.
virtual bool Handle(Handler *handler,
- uint64 address, int reg) const = 0;
+ uint64_t address, int reg) const = 0;
// Equality on rules. We use these to decide which rules we need
// to report after a DW_CFA_restore_state instruction.
@@ -900,7 +1331,7 @@ class CallFrameInfo::UndefinedRule: public CallFrameInfo::Rule {
public:
UndefinedRule() { }
~UndefinedRule() { }
- bool Handle(Handler *handler, uint64 address, int reg) const {
+ bool Handle(Handler *handler, uint64_t address, int reg) const {
return handler->UndefinedRule(address, reg);
}
bool operator==(const Rule &rhs) const {
@@ -917,7 +1348,7 @@ class CallFrameInfo::SameValueRule: public CallFrameInfo::Rule {
public:
SameValueRule() { }
~SameValueRule() { }
- bool Handle(Handler *handler, uint64 address, int reg) const {
+ bool Handle(Handler *handler, uint64_t address, int reg) const {
return handler->SameValueRule(address, reg);
}
bool operator==(const Rule &rhs) const {
@@ -936,7 +1367,7 @@ class CallFrameInfo::OffsetRule: public CallFrameInfo::Rule {
OffsetRule(int base_register, long offset)
: base_register_(base_register), offset_(offset) { }
~OffsetRule() { }
- bool Handle(Handler *handler, uint64 address, int reg) const {
+ bool Handle(Handler *handler, uint64_t address, int reg) const {
return handler->OffsetRule(address, reg, base_register_, offset_);
}
bool operator==(const Rule &rhs) const {
@@ -965,7 +1396,7 @@ class CallFrameInfo::ValOffsetRule: public CallFrameInfo::Rule {
ValOffsetRule(int base_register, long offset)
: base_register_(base_register), offset_(offset) { }
~ValOffsetRule() { }
- bool Handle(Handler *handler, uint64 address, int reg) const {
+ bool Handle(Handler *handler, uint64_t address, int reg) const {
return handler->ValOffsetRule(address, reg, base_register_, offset_);
}
bool operator==(const Rule &rhs) const {
@@ -990,7 +1421,7 @@ class CallFrameInfo::RegisterRule: public CallFrameInfo::Rule {
explicit RegisterRule(int register_number)
: register_number_(register_number) { }
~RegisterRule() { }
- bool Handle(Handler *handler, uint64 address, int reg) const {
+ bool Handle(Handler *handler, uint64_t address, int reg) const {
return handler->RegisterRule(address, reg, register_number_);
}
bool operator==(const Rule &rhs) const {
@@ -1010,7 +1441,7 @@ class CallFrameInfo::ExpressionRule: public CallFrameInfo::Rule {
explicit ExpressionRule(const string &expression)
: expression_(expression) { }
~ExpressionRule() { }
- bool Handle(Handler *handler, uint64 address, int reg) const {
+ bool Handle(Handler *handler, uint64_t address, int reg) const {
return handler->ExpressionRule(address, reg, expression_);
}
bool operator==(const Rule &rhs) const {
@@ -1030,7 +1461,7 @@ class CallFrameInfo::ValExpressionRule: public CallFrameInfo::Rule {
explicit ValExpressionRule(const string &expression)
: expression_(expression) { }
~ValExpressionRule() { }
- bool Handle(Handler *handler, uint64 address, int reg) const {
+ bool Handle(Handler *handler, uint64_t address, int reg) const {
return handler->ValExpressionRule(address, reg, expression_);
}
bool operator==(const Rule &rhs) const {
@@ -1074,7 +1505,7 @@ class CallFrameInfo::RuleMap {
// this RuleMap to NEW_RULES at ADDRESS. We use this to implement
// DW_CFA_restore_state, where lots of rules can change simultaneously.
// Return true if all handlers returned true; otherwise, return false.
- bool HandleTransitionTo(Handler *handler, uint64 address,
+ bool HandleTransitionTo(Handler *handler, uint64_t address,
const RuleMap &new_rules) const;
private:
@@ -1122,7 +1553,7 @@ void CallFrameInfo::RuleMap::SetRegisterRule(int reg, Rule *rule) {
bool CallFrameInfo::RuleMap::HandleTransitionTo(
Handler *handler,
- uint64 address,
+ uint64_t address,
const RuleMap &new_rules) const {
// Transition from cfa_rule_ to new_rules.cfa_rule_.
if (cfa_rule_ && new_rules.cfa_rule_) {
@@ -1204,7 +1635,7 @@ class CallFrameInfo::State {
// Create a call frame information interpreter state with the given
// reporter, reader, handler, and initial call frame info address.
State(ByteReader *reader, Handler *handler, Reporter *reporter,
- uint64 address)
+ uint64_t address)
: reader_(reader), handler_(handler), reporter_(reporter),
address_(address), entry_(NULL), cursor_(NULL) { }
@@ -1221,7 +1652,7 @@ class CallFrameInfo::State {
// The operands of a CFI instruction, for ParseOperands.
struct Operands {
unsigned register_number; // A register number.
- uint64 offset; // An offset or address.
+ uint64_t offset; // An offset or address.
long signed_offset; // A signed offset.
string expression; // A DWARF expression.
};
@@ -1287,7 +1718,7 @@ class CallFrameInfo::State {
// Return the section offset of the instruction at cursor. For use
// in error messages.
- uint64 CursorOffset() { return entry_->offset + (cursor_ - entry_->start); }
+ uint64_t CursorOffset() { return entry_->offset + (cursor_ - entry_->start); }
// Report that entry_ is incomplete, and return false. For brevity.
bool ReportIncomplete() {
@@ -1305,14 +1736,14 @@ class CallFrameInfo::State {
Reporter *reporter_;
// The code address to which the next instruction in the stream applies.
- uint64 address_;
+ uint64_t address_;
// The entry whose instructions we are currently processing. This is
// first a CIE, and then an FDE.
const Entry *entry_;
// The next instruction to process.
- const char *cursor_;
+ const uint8_t *cursor_;
// The current set of rules.
RuleMap rules_;
@@ -1410,7 +1841,8 @@ bool CallFrameInfo::State::ParseOperands(const char *format,
if (len > bytes_left || expression_length > bytes_left - len)
return ReportIncomplete();
cursor_ += len;
- operands->expression = string(cursor_, expression_length);
+ operands->expression = string(reinterpret_cast<const char *>(cursor_),
+ expression_length);
cursor_ += expression_length;
break;
}
@@ -1763,8 +2195,8 @@ bool CallFrameInfo::State::DoRestore(unsigned reg) {
return DoRule(reg, rule);
}
-bool CallFrameInfo::ReadEntryPrologue(const char *cursor, Entry *entry) {
- const char *buffer_end = buffer_ + buffer_length_;
+bool CallFrameInfo::ReadEntryPrologue(const uint8_t *cursor, Entry *entry) {
+ const uint8_t *buffer_end = buffer_ + buffer_length_;
// Initialize enough of ENTRY for use in error reporting.
entry->offset = cursor - buffer_;
@@ -1774,7 +2206,7 @@ bool CallFrameInfo::ReadEntryPrologue(const char *cursor, Entry *entry) {
// Read the initial length. This sets reader_'s offset size.
size_t length_size;
- uint64 length = reader_->ReadInitialLength(cursor, &length_size);
+ uint64_t length = reader_->ReadInitialLength(cursor, &length_size);
if (length_size > size_t(buffer_end - cursor))
return ReportIncomplete(entry);
cursor += length_size;
@@ -1842,7 +2274,7 @@ bool CallFrameInfo::ReadEntryPrologue(const char *cursor, Entry *entry) {
}
bool CallFrameInfo::ReadCIEFields(CIE *cie) {
- const char *cursor = cie->fields;
+ const uint8_t *cursor = cie->fields;
size_t len;
assert(cie->kind == kCIE);
@@ -1864,22 +2296,23 @@ bool CallFrameInfo::ReadCIEFields(CIE *cie) {
cursor++;
// If we don't recognize the version, we can't parse any more fields of the
- // CIE. For DWARF CFI, we handle versions 1 through 3 (there was never a
- // version 2 of CFI data). For .eh_frame, we handle versions 1 and 3 as well;
+ // CIE. For DWARF CFI, we handle versions 1 through 4 (there was never a
+ // version 2 of CFI data). For .eh_frame, we handle versions 1 and 4 as well;
// the difference between those versions seems to be the same as for
// .debug_frame.
- if (cie->version < 1 || cie->version > 3) {
+ if (cie->version < 1 || cie->version > 4) {
reporter_->UnrecognizedVersion(cie->offset, cie->version);
return false;
}
- const char *augmentation_start = cursor;
- const void *augmentation_end =
- memchr(augmentation_start, '\0', cie->end - augmentation_start);
+ const uint8_t *augmentation_start = cursor;
+ const uint8_t *augmentation_end =
+ reinterpret_cast<const uint8_t *>(memchr(augmentation_start, '\0',
+ cie->end - augmentation_start));
if (! augmentation_end) return ReportIncomplete(cie);
- cursor = static_cast<const char *>(augmentation_end);
- cie->augmentation = string(augmentation_start,
- cursor - augmentation_start);
+ cursor = augmentation_end;
+ cie->augmentation = string(reinterpret_cast<const char *>(augmentation_start),
+ cursor - augmentation_start);
// Skip the terminating '\0'.
cursor++;
@@ -1897,21 +2330,35 @@ bool CallFrameInfo::ReadCIEFields(CIE *cie) {
}
}
+ if (cie->version >= 4) {
+ cie->address_size = *cursor++;
+ if (cie->address_size != 8 && cie->address_size != 4) {
+ reporter_->UnexpectedAddressSize(cie->offset, cie->address_size);
+ return false;
+ }
+
+ cie->segment_size = *cursor++;
+ if (cie->segment_size != 0) {
+ reporter_->UnexpectedSegmentSize(cie->offset, cie->segment_size);
+ return false;
+ }
+ }
+
// Parse the code alignment factor.
cie->code_alignment_factor = reader_->ReadUnsignedLEB128(cursor, &len);
if (size_t(cie->end - cursor) < len) return ReportIncomplete(cie);
cursor += len;
-
+
// Parse the data alignment factor.
cie->data_alignment_factor = reader_->ReadSignedLEB128(cursor, &len);
if (size_t(cie->end - cursor) < len) return ReportIncomplete(cie);
cursor += len;
-
+
// Parse the return address register. This is a ubyte in version 1, and
// a ULEB128 in version 3.
if (cie->version == 1) {
if (cursor >= cie->end) return ReportIncomplete(cie);
- cie->return_address_register = uint8(*cursor++);
+ cie->return_address_register = uint8_t(*cursor++);
} else {
cie->return_address_register = reader_->ReadUnsignedLEB128(cursor, &len);
if (size_t(cie->end - cursor) < len) return ReportIncomplete(cie);
@@ -1925,9 +2372,9 @@ bool CallFrameInfo::ReadCIEFields(CIE *cie) {
if (size_t(cie->end - cursor) < len + data_size)
return ReportIncomplete(cie);
cursor += len;
- const char *data = cursor;
+ const uint8_t *data = cursor;
cursor += data_size;
- const char *data_end = cursor;
+ const uint8_t *data_end = cursor;
cie->has_z_lsda = false;
cie->has_z_personality = false;
@@ -2017,9 +2464,9 @@ bool CallFrameInfo::ReadCIEFields(CIE *cie) {
return true;
}
-
+
bool CallFrameInfo::ReadFDEFields(FDE *fde) {
- const char *cursor = fde->fields;
+ const uint8_t *cursor = fde->fields;
size_t size;
fde->address = reader_->ReadEncodedPointer(cursor, fde->cie->pointer_encoding,
@@ -2085,10 +2532,10 @@ bool CallFrameInfo::ReadFDEFields(FDE *fde) {
}
bool CallFrameInfo::Start() {
- const char *buffer_end = buffer_ + buffer_length_;
- const char *cursor;
+ const uint8_t *buffer_end = buffer_ + buffer_length_;
+ const uint8_t *cursor;
bool all_ok = true;
- const char *entry_end;
+ const uint8_t *entry_end;
bool ok;
// Traverse all the entries in buffer_, skipping CIEs and offering
@@ -2154,6 +2601,15 @@ bool CallFrameInfo::Start() {
if (!ReadCIEFields(&cie))
continue;
+ // TODO(nbilling): This could lead to strange behavior if a single buffer
+ // contained a mixture of DWARF versions as well as address sizes. Not
+ // sure if it's worth handling such a case.
+
+ // DWARF4 CIE specifies address_size, so use it for this call frame.
+ if (cie.version >= 4) {
+ reader_->SetAddressSize(cie.address_size);
+ }
+
// We now have the values that govern both the CIE and the FDE.
cie.cie = &cie;
fde.cie = &cie;
@@ -2228,114 +2684,130 @@ bool CallFrameInfo::ReportIncomplete(Entry *entry) {
return false;
}
-void CallFrameInfo::Reporter::Incomplete(uint64 offset,
+void CallFrameInfo::Reporter::Incomplete(uint64_t offset,
CallFrameInfo::EntryKind kind) {
fprintf(stderr,
- "%s: CFI %s at offset 0x%llx in '%s': entry ends early\n",
+ "%s: CFI %s at offset 0x%" PRIx64 " in '%s': entry ends early\n",
filename_.c_str(), CallFrameInfo::KindName(kind), offset,
section_.c_str());
}
-void CallFrameInfo::Reporter::EarlyEHTerminator(uint64 offset) {
+void CallFrameInfo::Reporter::EarlyEHTerminator(uint64_t offset) {
fprintf(stderr,
- "%s: CFI at offset 0x%llx in '%s': saw end-of-data marker"
+ "%s: CFI at offset 0x%" PRIx64 " in '%s': saw end-of-data marker"
" before end of section contents\n",
filename_.c_str(), offset, section_.c_str());
}
-void CallFrameInfo::Reporter::CIEPointerOutOfRange(uint64 offset,
- uint64 cie_offset) {
+void CallFrameInfo::Reporter::CIEPointerOutOfRange(uint64_t offset,
+ uint64_t cie_offset) {
fprintf(stderr,
- "%s: CFI frame description entry at offset 0x%llx in '%s':"
- " CIE pointer is out of range: 0x%llx\n",
+ "%s: CFI frame description entry at offset 0x%" PRIx64 " in '%s':"
+ " CIE pointer is out of range: 0x%" PRIx64 "\n",
filename_.c_str(), offset, section_.c_str(), cie_offset);
}
-void CallFrameInfo::Reporter::BadCIEId(uint64 offset, uint64 cie_offset) {
+void CallFrameInfo::Reporter::BadCIEId(uint64_t offset, uint64_t cie_offset) {
fprintf(stderr,
- "%s: CFI frame description entry at offset 0x%llx in '%s':"
- " CIE pointer does not point to a CIE: 0x%llx\n",
+ "%s: CFI frame description entry at offset 0x%" PRIx64 " in '%s':"
+ " CIE pointer does not point to a CIE: 0x%" PRIx64 "\n",
filename_.c_str(), offset, section_.c_str(), cie_offset);
}
-void CallFrameInfo::Reporter::UnrecognizedVersion(uint64 offset, int version) {
+void CallFrameInfo::Reporter::UnexpectedAddressSize(uint64_t offset,
+ uint8_t address_size) {
+ fprintf(stderr,
+ "%s: CFI frame description entry at offset 0x%" PRIx64 " in '%s':"
+ " CIE specifies unexpected address size: %d\n",
+ filename_.c_str(), offset, section_.c_str(), address_size);
+}
+
+void CallFrameInfo::Reporter::UnexpectedSegmentSize(uint64_t offset,
+ uint8_t segment_size) {
+ fprintf(stderr,
+ "%s: CFI frame description entry at offset 0x%" PRIx64 " in '%s':"
+ " CIE specifies unexpected segment size: %d\n",
+ filename_.c_str(), offset, section_.c_str(), segment_size);
+}
+
+void CallFrameInfo::Reporter::UnrecognizedVersion(uint64_t offset, int version) {
fprintf(stderr,
- "%s: CFI frame description entry at offset 0x%llx in '%s':"
+ "%s: CFI frame description entry at offset 0x%" PRIx64 " in '%s':"
" CIE specifies unrecognized version: %d\n",
filename_.c_str(), offset, section_.c_str(), version);
}
-void CallFrameInfo::Reporter::UnrecognizedAugmentation(uint64 offset,
+void CallFrameInfo::Reporter::UnrecognizedAugmentation(uint64_t offset,
const string &aug) {
fprintf(stderr,
- "%s: CFI frame description entry at offset 0x%llx in '%s':"
+ "%s: CFI frame description entry at offset 0x%" PRIx64 " in '%s':"
" CIE specifies unrecognized augmentation: '%s'\n",
filename_.c_str(), offset, section_.c_str(), aug.c_str());
}
-void CallFrameInfo::Reporter::InvalidPointerEncoding(uint64 offset,
- uint8 encoding) {
+void CallFrameInfo::Reporter::InvalidPointerEncoding(uint64_t offset,
+ uint8_t encoding) {
fprintf(stderr,
- "%s: CFI common information entry at offset 0x%llx in '%s':"
+ "%s: CFI common information entry at offset 0x%" PRIx64 " in '%s':"
" 'z' augmentation specifies invalid pointer encoding: 0x%02x\n",
filename_.c_str(), offset, section_.c_str(), encoding);
}
-void CallFrameInfo::Reporter::UnusablePointerEncoding(uint64 offset,
- uint8 encoding) {
+void CallFrameInfo::Reporter::UnusablePointerEncoding(uint64_t offset,
+ uint8_t encoding) {
fprintf(stderr,
- "%s: CFI common information entry at offset 0x%llx in '%s':"
+ "%s: CFI common information entry at offset 0x%" PRIx64 " in '%s':"
" 'z' augmentation specifies a pointer encoding for which"
" we have no base address: 0x%02x\n",
filename_.c_str(), offset, section_.c_str(), encoding);
}
-void CallFrameInfo::Reporter::RestoreInCIE(uint64 offset, uint64 insn_offset) {
+void CallFrameInfo::Reporter::RestoreInCIE(uint64_t offset, uint64_t insn_offset) {
fprintf(stderr,
- "%s: CFI common information entry at offset 0x%llx in '%s':"
- " the DW_CFA_restore instruction at offset 0x%llx"
+ "%s: CFI common information entry at offset 0x%" PRIx64 " in '%s':"
+ " the DW_CFA_restore instruction at offset 0x%" PRIx64
" cannot be used in a common information entry\n",
filename_.c_str(), offset, section_.c_str(), insn_offset);
}
-void CallFrameInfo::Reporter::BadInstruction(uint64 offset,
+void CallFrameInfo::Reporter::BadInstruction(uint64_t offset,
CallFrameInfo::EntryKind kind,
- uint64 insn_offset) {
+ uint64_t insn_offset) {
fprintf(stderr,
- "%s: CFI %s at offset 0x%llx in section '%s':"
- " the instruction at offset 0x%llx is unrecognized\n",
+ "%s: CFI %s at offset 0x%" PRIx64 " in section '%s':"
+ " the instruction at offset 0x%" PRIx64 " is unrecognized\n",
filename_.c_str(), CallFrameInfo::KindName(kind),
offset, section_.c_str(), insn_offset);
}
-void CallFrameInfo::Reporter::NoCFARule(uint64 offset,
+void CallFrameInfo::Reporter::NoCFARule(uint64_t offset,
CallFrameInfo::EntryKind kind,
- uint64 insn_offset) {
+ uint64_t insn_offset) {
fprintf(stderr,
- "%s: CFI %s at offset 0x%llx in section '%s':"
- " the instruction at offset 0x%llx assumes that a CFA rule has"
+ "%s: CFI %s at offset 0x%" PRIx64 " in section '%s':"
+ " the instruction at offset 0x%" PRIx64 " assumes that a CFA rule has"
" been set, but none has been set\n",
filename_.c_str(), CallFrameInfo::KindName(kind), offset,
section_.c_str(), insn_offset);
}
-void CallFrameInfo::Reporter::EmptyStateStack(uint64 offset,
+void CallFrameInfo::Reporter::EmptyStateStack(uint64_t offset,
CallFrameInfo::EntryKind kind,
- uint64 insn_offset) {
+ uint64_t insn_offset) {
fprintf(stderr,
- "%s: CFI %s at offset 0x%llx in section '%s':"
- " the DW_CFA_restore_state instruction at offset 0x%llx"
+ "%s: CFI %s at offset 0x%" PRIx64 " in section '%s':"
+ " the DW_CFA_restore_state instruction at offset 0x%" PRIx64
" should pop a saved state from the stack, but the stack is empty\n",
filename_.c_str(), CallFrameInfo::KindName(kind), offset,
section_.c_str(), insn_offset);
}
-void CallFrameInfo::Reporter::ClearingCFARule(uint64 offset,
+void CallFrameInfo::Reporter::ClearingCFARule(uint64_t offset,
CallFrameInfo::EntryKind kind,
- uint64 insn_offset) {
+ uint64_t insn_offset) {
fprintf(stderr,
- "%s: CFI %s at offset 0x%llx in section '%s':"
- " the DW_CFA_restore_state instruction at offset 0x%llx"
+ "%s: CFI %s at offset 0x%" PRIx64 " in section '%s':"
+ " the DW_CFA_restore_state instruction at offset 0x%" PRIx64
" would clear the CFA rule in effect\n",
filename_.c_str(), CallFrameInfo::KindName(kind), offset,
section_.c_str(), insn_offset);
diff --git a/src/common/dwarf/dwarf2reader.h b/src/common/dwarf/dwarf2reader.h
index 8824bf90..0b194c17 100644
--- a/src/common/dwarf/dwarf2reader.h
+++ b/src/common/dwarf/dwarf2reader.h
@@ -40,39 +40,44 @@
#ifndef COMMON_DWARF_DWARF2READER_H__
#define COMMON_DWARF_DWARF2READER_H__
+#include <stdint.h>
+
#include <list>
#include <map>
#include <string>
#include <utility>
#include <vector>
+#include <memory>
#include "common/dwarf/bytereader.h"
#include "common/dwarf/dwarf2enums.h"
#include "common/dwarf/types.h"
#include "common/using_std_string.h"
+#include "common/dwarf/elf_reader.h"
namespace dwarf2reader {
struct LineStateMachine;
class Dwarf2Handler;
class LineInfoHandler;
+class DwpReader;
// This maps from a string naming a section to a pair containing a
// the data for the section, and the size of the section.
-typedef std::map<string, std::pair<const char*, uint64> > SectionMap;
+typedef std::map<string, std::pair<const uint8_t *, uint64_t> > SectionMap;
typedef std::list<std::pair<enum DwarfAttribute, enum DwarfForm> >
AttributeList;
typedef AttributeList::iterator AttributeIterator;
typedef AttributeList::const_iterator ConstAttributeIterator;
struct LineInfoHeader {
- uint64 total_length;
- uint16 version;
- uint64 prologue_length;
- uint8 min_insn_length; // insn stands for instructin
+ uint64_t total_length;
+ uint16_t version;
+ uint64_t prologue_length;
+ uint8_t min_insn_length; // insn stands for instructin
bool default_is_stmt; // stmt stands for statement
- int8 line_base;
- uint8 line_range;
- uint8 opcode_base;
+ int8_t line_base;
+ uint8_t line_range;
+ uint8_t opcode_base;
// Use a pointer so that signalsafe_addr2line is able to use this structure
// without heap allocation problem.
std::vector<unsigned char> *std_opcode_lengths;
@@ -85,7 +90,7 @@ class LineInfo {
// to the beginning and length of the line information to read.
// Reader is a ByteReader class that has the endianness set
// properly.
- LineInfo(const char* buffer_, uint64 buffer_length,
+ LineInfo(const uint8_t *buffer_, uint64_t buffer_length,
ByteReader* reader, LineInfoHandler* handler);
virtual ~LineInfo() {
@@ -97,7 +102,7 @@ class LineInfo {
// Start processing line info, and calling callbacks in the handler.
// Consumes the line number information for a single compilation unit.
// Returns the number of bytes processed.
- uint64 Start();
+ uint64_t Start();
// Process a single line info opcode at START using the state
// machine at LSM. Return true if we should define a line using the
@@ -111,7 +116,7 @@ class LineInfo {
static bool ProcessOneOpcode(ByteReader* reader,
LineInfoHandler* handler,
const struct LineInfoHeader &header,
- const char* start,
+ const uint8_t *start,
struct LineStateMachine* lsm,
size_t* len,
uintptr pc,
@@ -139,9 +144,11 @@ class LineInfo {
// buffer is the buffer for our line info, starting at exactly where
// the line info to read is. after_header is the place right after
// the end of the line information header.
- const char* buffer_;
- uint64 buffer_length_;
- const char* after_header_;
+ const uint8_t *buffer_;
+#ifndef NDEBUG
+ uint64_t buffer_length_;
+#endif
+ const uint8_t *after_header_;
};
// This class is the main interface between the line info reader and
@@ -157,7 +164,7 @@ class LineInfoHandler {
// Called when we define a directory. NAME is the directory name,
// DIR_NUM is the directory number
- virtual void DefineDir(const string& name, uint32 dir_num) { }
+ virtual void DefineDir(const string& name, uint32_t dir_num) { }
// Called when we define a filename. NAME is the filename, FILE_NUM
// is the file number which is -1 if the file index is the next
@@ -166,9 +173,9 @@ class LineInfoHandler {
// directory index for the directory name of this file, MOD_TIME is
// the modification time of the file, and LENGTH is the length of
// the file
- virtual void DefineFile(const string& name, int32 file_num,
- uint32 dir_num, uint64 mod_time,
- uint64 length) { }
+ virtual void DefineFile(const string& name, int32_t file_num,
+ uint32_t dir_num, uint64_t mod_time,
+ uint64_t length) { }
// Called when the line info reader has a new line, address pair
// ready for us. ADDRESS is the address of the code, LENGTH is the
@@ -176,8 +183,138 @@ class LineInfoHandler {
// containing the code, LINE_NUM is the line number in that file for
// the code, and COLUMN_NUM is the column number the code starts at,
// if we know it (0 otherwise).
- virtual void AddLine(uint64 address, uint64 length,
- uint32 file_num, uint32 line_num, uint32 column_num) { }
+ virtual void AddLine(uint64_t address, uint64_t length,
+ uint32_t file_num, uint32_t line_num, uint32_t column_num) { }
+};
+
+class RangeListHandler {
+ public:
+ RangeListHandler() { }
+
+ virtual ~RangeListHandler() { }
+
+ // Add a range.
+ virtual void AddRange(uint64_t begin, uint64_t end) { };
+
+ // A new base address must be set for computing the ranges' addresses.
+ virtual void SetBaseAddress(uint64_t base_address) { };
+
+ // Finish processing the range list.
+ virtual void Finish() { };
+};
+
+class RangeListReader {
+ public:
+ RangeListReader(const uint8_t *buffer, uint64_t size, ByteReader *reader,
+ RangeListHandler *handler);
+
+ bool ReadRangeList(uint64_t offset);
+
+ private:
+ const uint8_t *buffer_;
+ uint64_t size_;
+ ByteReader* reader_;
+ RangeListHandler *handler_;
+};
+
+// This class is the main interface between the reader and the
+// client. The virtual functions inside this get called for
+// interesting events that happen during DWARF2 reading.
+// The default implementation skips everything.
+class Dwarf2Handler {
+ public:
+ Dwarf2Handler() { }
+
+ virtual ~Dwarf2Handler() { }
+
+ // Start to process a compilation unit at OFFSET from the beginning of the
+ // .debug_info section. Return false if you would like to skip this
+ // compilation unit.
+ virtual bool StartCompilationUnit(uint64_t offset, uint8_t address_size,
+ uint8_t offset_size, uint64_t cu_length,
+ uint8_t dwarf_version) { return false; }
+
+ // When processing a skeleton compilation unit, resulting from a split
+ // DWARF compilation, once the skeleton debug info has been read,
+ // the reader will call this function to ask the client if it needs
+ // the full debug info from the .dwo or .dwp file. Return true if
+ // you need it, or false to skip processing the split debug info.
+ virtual bool NeedSplitDebugInfo() { return true; }
+
+ // Start to process a split compilation unit at OFFSET from the beginning of
+ // the debug_info section in the .dwp/.dwo file. Return false if you would
+ // like to skip this compilation unit.
+ virtual bool StartSplitCompilationUnit(uint64_t offset,
+ uint64_t cu_length) { return false; }
+
+ // Start to process a DIE at OFFSET from the beginning of the .debug_info
+ // section. Return false if you would like to skip this DIE.
+ virtual bool StartDIE(uint64_t offset, enum DwarfTag tag) { return false; }
+
+ // Called when we have an attribute with unsigned data to give to our
+ // handler. The attribute is for the DIE at OFFSET from the beginning of the
+ // .debug_info section. Its name is ATTR, its form is FORM, and its value is
+ // DATA.
+ virtual void ProcessAttributeUnsigned(uint64_t offset,
+ enum DwarfAttribute attr,
+ enum DwarfForm form,
+ uint64_t data) { }
+
+ // Called when we have an attribute with signed data to give to our handler.
+ // The attribute is for the DIE at OFFSET from the beginning of the
+ // .debug_info section. Its name is ATTR, its form is FORM, and its value is
+ // DATA.
+ virtual void ProcessAttributeSigned(uint64_t offset,
+ enum DwarfAttribute attr,
+ enum DwarfForm form,
+ int64_t data) { }
+
+ // Called when we have an attribute whose value is a reference to
+ // another DIE. The attribute belongs to the DIE at OFFSET from the
+ // beginning of the .debug_info section. Its name is ATTR, its form
+ // is FORM, and the offset of the DIE being referred to from the
+ // beginning of the .debug_info section is DATA.
+ virtual void ProcessAttributeReference(uint64_t offset,
+ enum DwarfAttribute attr,
+ enum DwarfForm form,
+ uint64_t data) { }
+
+ // Called when we have an attribute with a buffer of data to give to our
+ // handler. The attribute is for the DIE at OFFSET from the beginning of the
+ // .debug_info section. Its name is ATTR, its form is FORM, DATA points to
+ // the buffer's contents, and its length in bytes is LENGTH. The buffer is
+ // owned by the caller, not the callee, and may not persist for very long.
+ // If you want the data to be available later, it needs to be copied.
+ virtual void ProcessAttributeBuffer(uint64_t offset,
+ enum DwarfAttribute attr,
+ enum DwarfForm form,
+ const uint8_t *data,
+ uint64_t len) { }
+
+ // Called when we have an attribute with string data to give to our handler.
+ // The attribute is for the DIE at OFFSET from the beginning of the
+ // .debug_info section. Its name is ATTR, its form is FORM, and its value is
+ // DATA.
+ virtual void ProcessAttributeString(uint64_t offset,
+ enum DwarfAttribute attr,
+ enum DwarfForm form,
+ const string& data) { }
+
+ // Called when we have an attribute whose value is the 64-bit signature
+ // of a type unit in the .debug_types section. OFFSET is the offset of
+ // the DIE whose attribute we're reporting. ATTR and FORM are the
+ // attribute's name and form. SIGNATURE is the type unit's signature.
+ virtual void ProcessAttributeSignature(uint64_t offset,
+ enum DwarfAttribute attr,
+ enum DwarfForm form,
+ uint64_t signature) { }
+
+ // Called when finished processing the DIE at OFFSET.
+ // Because DWARF2/3 specifies a tree of DIEs, you may get starts
+ // before ends of the previous DIE, as we process children before
+ // ending the parent.
+ virtual void EndDIE(uint64_t offset) { }
+
};
// The base of DWARF2/3 debug info is a DIE (Debugging Information
@@ -221,12 +358,21 @@ class CompilationUnit {
// Initialize a compilation unit. This requires a map of sections,
// the offset of this compilation unit in the .debug_info section, a
// ByteReader, and a Dwarf2Handler class to call callbacks in.
- CompilationUnit(const SectionMap& sections, uint64 offset,
- ByteReader* reader, Dwarf2Handler* handler);
+ CompilationUnit(const string& path, const SectionMap& sections,
+ uint64_t offset, ByteReader* reader, Dwarf2Handler* handler);
virtual ~CompilationUnit() {
if (abbrevs_) delete abbrevs_;
}
+ // Initialize a compilation unit from a .dwo or .dwp file.
+ // In this case, we need the .debug_addr section from the
+ // executable file that contains the corresponding skeleton
+ // compilation unit. We also inherit the Dwarf2Handler from
+ // the executable file, and call it as if we were still
+ // processing the original compilation unit.
+ void SetSplitDwarf(const uint8_t* addr_buffer, uint64_t addr_buffer_length,
+ uint64_t addr_base, uint64_t ranges_base, uint64_t dwo_id);
+
// Begin reading a Dwarf2 compilation unit, and calling the
// callbacks in the Dwarf2Handler
@@ -234,7 +380,7 @@ class CompilationUnit {
// headers. This plus the starting offset passed to the constructor
// is the offset of the end of the compilation unit --- and the
// start of the next compilation unit, if there is one.
- uint64 Start();
+ uint64_t Start();
private:
@@ -242,7 +388,7 @@ class CompilationUnit {
// The abbreviation tells how to read a DWARF2/3 DIE, and consist of a
// tag and a list of attributes, as well as the data form of each attribute.
struct Abbrev {
- uint64 number;
+ uint64_t number;
enum DwarfTag tag;
bool has_children;
AttributeList attributes;
@@ -252,10 +398,10 @@ class CompilationUnit {
// in the actual file, as the one in the file may have a 32 bit or
// 64 bit length.
struct CompilationUnitHeader {
- uint64 length;
- uint16 version;
- uint64 abbrev_offset;
- uint8 address_size;
+ uint64_t length;
+ uint16_t version;
+ uint64_t abbrev_offset;
+ uint8_t address_size;
} header_;
// Reads the DWARF2/3 header for this compilation unit.
@@ -266,40 +412,115 @@ class CompilationUnit {
// Processes a single DIE for this compilation unit and return a new
// pointer just past the end of it
- const char* ProcessDIE(uint64 dieoffset,
- const char* start,
- const Abbrev& abbrev);
+ const uint8_t *ProcessDIE(uint64_t dieoffset,
+ const uint8_t *start,
+ const Abbrev& abbrev);
// Processes a single attribute and return a new pointer just past the
// end of it
- const char* ProcessAttribute(uint64 dieoffset,
- const char* start,
- enum DwarfAttribute attr,
- enum DwarfForm form);
+ const uint8_t *ProcessAttribute(uint64_t dieoffset,
+ const uint8_t *start,
+ enum DwarfAttribute attr,
+ enum DwarfForm form);
+
+ // Called when we have an attribute with unsigned data to give to
+ // our handler. The attribute is for the DIE at OFFSET from the
+ // beginning of compilation unit, has a name of ATTR, a form of
+ // FORM, and the actual data of the attribute is in DATA.
+ // If we see a DW_AT_GNU_dwo_id attribute, save the value so that
+ // we can find the debug info in a .dwo or .dwp file.
+ void ProcessAttributeUnsigned(uint64_t offset,
+ enum DwarfAttribute attr,
+ enum DwarfForm form,
+ uint64_t data) {
+ if (attr == DW_AT_GNU_dwo_id) {
+ dwo_id_ = data;
+ }
+ else if (attr == DW_AT_GNU_addr_base) {
+ addr_base_ = data;
+ }
+ else if (attr == DW_AT_GNU_ranges_base) {
+ ranges_base_ = data;
+ }
+ // TODO(yunlian): When we add DW_AT_ranges_base from DWARF-5,
+ // that base will apply to DW_AT_ranges attributes in the
+ // skeleton CU as well as in the .dwo/.dwp files.
+ else if (attr == DW_AT_ranges && is_split_dwarf_) {
+ data += ranges_base_;
+ }
+ handler_->ProcessAttributeUnsigned(offset, attr, form, data);
+ }
+
+ // Called when we have an attribute with signed data to give to
+ // our handler. The attribute is for the DIE at OFFSET from the
+ // beginning of compilation unit, has a name of ATTR, a form of
+ // FORM, and the actual data of the attribute is in DATA.
+ void ProcessAttributeSigned(uint64_t offset,
+ enum DwarfAttribute attr,
+ enum DwarfForm form,
+ int64_t data) {
+ handler_->ProcessAttributeSigned(offset, attr, form, data);
+ }
+
+ // Called when we have an attribute with a buffer of data to give to
+ // our handler. The attribute is for the DIE at OFFSET from the
+ // beginning of compilation unit, has a name of ATTR, a form of
+ // FORM, and the actual data of the attribute is in DATA, and the
+ // length of the buffer is LENGTH.
+ void ProcessAttributeBuffer(uint64_t offset,
+ enum DwarfAttribute attr,
+ enum DwarfForm form,
+ const uint8_t* data,
+ uint64_t len) {
+ handler_->ProcessAttributeBuffer(offset, attr, form, data, len);
+ }
+
+ // Called when we have an attribute with string data to give to
+ // our handler. The attribute is for the DIE at OFFSET from the
+ // beginning of compilation unit, has a name of ATTR, a form of
+ // FORM, and the actual data of the attribute is in DATA.
+ // If we see a DW_AT_GNU_dwo_name attribute, save the value so
+ // that we can find the debug info in a .dwo or .dwp file.
+ void ProcessAttributeString(uint64_t offset,
+ enum DwarfAttribute attr,
+ enum DwarfForm form,
+ const char* data) {
+ if (attr == DW_AT_GNU_dwo_name)
+ dwo_name_ = data;
+ handler_->ProcessAttributeString(offset, attr, form, data);
+ }
// Processes all DIEs for this compilation unit
void ProcessDIEs();
// Skips the die with attributes specified in ABBREV starting at
// START, and return the new place to position the stream to.
- const char* SkipDIE(const char* start,
- const Abbrev& abbrev);
+ const uint8_t *SkipDIE(const uint8_t *start, const Abbrev& abbrev);
// Skips the attribute starting at START, with FORM, and return the
// new place to position the stream to.
- const char* SkipAttribute(const char* start,
- enum DwarfForm form);
+ const uint8_t *SkipAttribute(const uint8_t *start, enum DwarfForm form);
+
+ // Process the actual debug information in a split DWARF file.
+ void ProcessSplitDwarf();
+
+ // Read the debug sections from a .dwo file.
+ void ReadDebugSectionsFromDwo(ElfReader* elf_reader,
+ SectionMap* sections);
+
+ // Path of the file containing the debug information.
+ const string path_;
// Offset from section start is the offset of this compilation unit
// from the beginning of the .debug_info section.
- uint64 offset_from_section_start_;
+ uint64_t offset_from_section_start_;
// buffer is the buffer for our CU, starting at .debug_info + offset
// passed in from constructor.
// after_header points to right after the compilation unit header.
- const char* buffer_;
- uint64 buffer_length_;
- const char* after_header_;
+ const uint8_t *buffer_;
+ uint64_t buffer_length_;
+ const uint8_t *after_header_;
// The associated ByteReader that handles endianness issues for us
ByteReader* reader_;
@@ -318,96 +539,143 @@ class CompilationUnit {
// String section buffer and length, if we have a string section.
// This is here to avoid doing a section lookup for strings in
// ProcessAttribute, which is in the hot path for DWARF2 reading.
- const char* string_buffer_;
- uint64 string_buffer_length_;
-};
+ const uint8_t *string_buffer_;
+ uint64_t string_buffer_length_;
-// This class is the main interface between the reader and the
-// client. The virtual functions inside this get called for
-// interesting events that happen during DWARF2 reading.
-// The default implementation skips everything.
+ // String offsets section buffer and length, if we have a string offsets
+ // section (.debug_str_offsets or .debug_str_offsets.dwo).
+ const uint8_t* str_offsets_buffer_;
+ uint64_t str_offsets_buffer_length_;
-class Dwarf2Handler {
+ // Address section buffer and length, if we have an address section
+ // (.debug_addr).
+ const uint8_t* addr_buffer_;
+ uint64_t addr_buffer_length_;
+
+ // Flag indicating whether this compilation unit is part of a .dwo
+ // or .dwp file. If true, we are reading this unit because a
+ // skeleton compilation unit in an executable file had a
+ // DW_AT_GNU_dwo_name or DW_AT_GNU_dwo_id attribute.
+ // In a .dwo file, we expect the string offsets section to
+ // have a ".dwo" suffix, and we will use the ".debug_addr" section
+ // associated with the skeleton compilation unit.
+ bool is_split_dwarf_;
+
+ // The value of the DW_AT_GNU_dwo_id attribute, if any.
+ uint64_t dwo_id_;
+
+ // The value of the DW_AT_GNU_dwo_name attribute, if any.
+ const char* dwo_name_;
+
+ // If this is a split DWARF CU, the value of the DW_AT_GNU_dwo_id attribute
+ // from the skeleton CU.
+ uint64_t skeleton_dwo_id_;
+
+ // The value of the DW_AT_GNU_ranges_base attribute, if any.
+ uint64_t ranges_base_;
+
+ // The value of the DW_AT_GNU_addr_base attribute, if any.
+ uint64_t addr_base_;
+
+ // True if we have already looked for a .dwp file.
+ bool have_checked_for_dwp_;
+
+ // Path to the .dwp file.
+ string dwp_path_;
+
+ // ByteReader for the DWP file.
+ std::unique_ptr<ByteReader> dwp_byte_reader_;
+
+ // DWP reader.
+ std::unique_ptr<DwpReader> dwp_reader_;
+};
+
+// A Reader for a .dwp file. Supports the fetching of DWARF debug
+// info for a given dwo_id.
+//
+// There are two versions of .dwp files. In both versions, the
+// .dwp file is an ELF file containing only debug sections.
+// In Version 1, the file contains many copies of each debug
+// section, one for each .dwo file that is packaged in the .dwp
+// file, and the .debug_cu_index section maps from the dwo_id
+// to a set of section indexes. In Version 2, the file contains
+// one of each debug section, and the .debug_cu_index section
+// maps from the dwo_id to a set of offsets and lengths that
+// identify each .dwo file's contribution to the larger sections.
+
+class DwpReader {
public:
- Dwarf2Handler() { }
+ DwpReader(const ByteReader& byte_reader, ElfReader* elf_reader);
- virtual ~Dwarf2Handler() { }
+ ~DwpReader();
- // Start to process a compilation unit at OFFSET from the beginning of the
- // .debug_info section. Return false if you would like to skip this
- // compilation unit.
- virtual bool StartCompilationUnit(uint64 offset, uint8 address_size,
- uint8 offset_size, uint64 cu_length,
- uint8 dwarf_version) { return false; }
+ // Read the CU index and initialize data members.
+ void Initialize();
- // Start to process a DIE at OFFSET from the beginning of the .debug_info
- // section. Return false if you would like to skip this DIE.
- virtual bool StartDIE(uint64 offset, enum DwarfTag tag) { return false; }
+ // Read the debug sections for the given dwo_id.
+ void ReadDebugSectionsForCU(uint64_t dwo_id, SectionMap* sections);
- // Called when we have an attribute with unsigned data to give to our
- // handler. The attribute is for the DIE at OFFSET from the beginning of the
- // .debug_info section. Its name is ATTR, its form is FORM, and its value is
- // DATA.
- virtual void ProcessAttributeUnsigned(uint64 offset,
- enum DwarfAttribute attr,
- enum DwarfForm form,
- uint64 data) { }
+ private:
+ // Search a v1 hash table for "dwo_id". Returns the slot index
+ // where the dwo_id was found, or -1 if it was not found.
+ int LookupCU(uint64_t dwo_id);
- // Called when we have an attribute with signed data to give to our handler.
- // The attribute is for the DIE at OFFSET from the beginning of the
- // .debug_info section. Its name is ATTR, its form is FORM, and its value is
- // DATA.
- virtual void ProcessAttributeSigned(uint64 offset,
- enum DwarfAttribute attr,
- enum DwarfForm form,
- int64 data) { }
+ // Search a v2 hash table for "dwo_id". Returns the row index
+ // in the offsets and sizes tables, or 0 if it was not found.
+ uint32_t LookupCUv2(uint64_t dwo_id);
- // Called when we have an attribute whose value is a reference to
- // another DIE. The attribute belongs to the DIE at OFFSET from the
- // beginning of the .debug_info section. Its name is ATTR, its form
- // is FORM, and the offset of the DIE being referred to from the
- // beginning of the .debug_info section is DATA.
- virtual void ProcessAttributeReference(uint64 offset,
- enum DwarfAttribute attr,
- enum DwarfForm form,
- uint64 data) { }
+ // The ELF reader for the .dwp file.
+ ElfReader* elf_reader_;
- // Called when we have an attribute with a buffer of data to give to our
- // handler. The attribute is for the DIE at OFFSET from the beginning of the
- // .debug_info section. Its name is ATTR, its form is FORM, DATA points to
- // the buffer's contents, and its length in bytes is LENGTH. The buffer is
- // owned by the caller, not the callee, and may not persist for very long.
- // If you want the data to be available later, it needs to be copied.
- virtual void ProcessAttributeBuffer(uint64 offset,
- enum DwarfAttribute attr,
- enum DwarfForm form,
- const char* data,
- uint64 len) { }
+ // The ByteReader for the .dwp file.
+ const ByteReader& byte_reader_;
- // Called when we have an attribute with string data to give to our handler.
- // The attribute is for the DIE at OFFSET from the beginning of the
- // .debug_info section. Its name is ATTR, its form is FORM, and its value is
- // DATA.
- virtual void ProcessAttributeString(uint64 offset,
- enum DwarfAttribute attr,
- enum DwarfForm form,
- const string& data) { }
+ // Pointer to the .debug_cu_index section.
+ const char* cu_index_;
- // Called when we have an attribute whose value is the 64-bit signature
- // of a type unit in the .debug_types section. OFFSET is the offset of
- // the DIE whose attribute we're reporting. ATTR and FORM are the
- // attribute's name and form. SIGNATURE is the type unit's signature.
- virtual void ProcessAttributeSignature(uint64 offset,
- enum DwarfAttribute attr,
- enum DwarfForm form,
- uint64 signature) { }
+ // Size of the .debug_cu_index section.
+ size_t cu_index_size_;
- // Called when finished processing the DIE at OFFSET.
- // Because DWARF2/3 specifies a tree of DIEs, you may get starts
- // before ends of the previous DIE, as we process children before
- // ending the parent.
- virtual void EndDIE(uint64 offset) { }
+ // Pointer to the .debug_str.dwo section.
+ const char* string_buffer_;
+
+ // Size of the .debug_str.dwo section.
+ size_t string_buffer_size_;
+
+ // Version of the .dwp file. We support versions 1 and 2 currently.
+ int version_;
+ // Number of columns in the section tables (version 2).
+ unsigned int ncolumns_;
+
+ // Number of units in the section tables (version 2).
+ unsigned int nunits_;
+
+ // Number of slots in the hash table.
+ unsigned int nslots_;
+
+ // Pointer to the beginning of the hash table.
+ const char* phash_;
+
+ // Pointer to the beginning of the index table.
+ const char* pindex_;
+
+ // Pointer to the beginning of the section index pool (version 1).
+ const char* shndx_pool_;
+
+ // Pointer to the beginning of the section offset table (version 2).
+ const char* offset_table_;
+
+ // Pointer to the beginning of the section size table (version 2).
+ const char* size_table_;
+
+ // Contents of the sections of interest (version 2).
+ const char* abbrev_data_;
+ size_t abbrev_size_;
+ const char* info_data_;
+ size_t info_size_;
+ const char* str_offsets_data_;
+ size_t str_offsets_size_;
};
// This class is a reader for DWARF's Call Frame Information. CFI
@@ -637,7 +905,7 @@ class CallFrameInfo {
// The mechanics of C++ exception handling, personality routines,
// and language-specific data areas are described here, rather nicely:
// http://www.codesourcery.com/public/cxx-abi/abi-eh.html
- CallFrameInfo(const char *buffer, size_t buffer_length,
+ CallFrameInfo(const uint8_t *buffer, size_t buffer_length,
ByteReader *reader, Handler *handler, Reporter *reporter,
bool eh_frame = false)
: buffer_(buffer), buffer_length_(buffer_length),
@@ -665,7 +933,7 @@ class CallFrameInfo {
size_t offset;
// The start of this entry in the buffer.
- const char *start;
+ const uint8_t *start;
// Which kind of entry this is.
//
@@ -676,20 +944,20 @@ class CallFrameInfo {
// The end of this entry's common prologue (initial length and id), and
// the start of this entry's kind-specific fields.
- const char *fields;
+ const uint8_t *fields;
// The start of this entry's instructions.
- const char *instructions;
+ const uint8_t *instructions;
// The address past the entry's last byte in the buffer. (Note that
// since offset points to the entry's initial length field, and the
// length field is the number of bytes after that field, this is not
// simply buffer_ + offset + length.)
- const char *end;
+ const uint8_t *end;
// For both DWARF CFI and .eh_frame sections, this is the CIE id in a
// CIE, and the offset of the associated CIE in an FDE.
- uint64 id;
+ uint64_t id;
// The CIE that applies to this entry, if we've parsed it. If this is a
// CIE, then this field points to this structure.
@@ -698,9 +966,9 @@ class CallFrameInfo {
// A common information entry (CIE).
struct CIE: public Entry {
- uint8 version; // CFI data version number
+ uint8_t version; // CFI data version number
string augmentation; // vendor format extension markers
- uint64 code_alignment_factor; // scale for code address adjustments
+ uint64_t code_alignment_factor; // scale for code address adjustments
int data_alignment_factor; // scale for stack pointer adjustments
unsigned return_address_register; // which register holds the return addr
@@ -724,24 +992,29 @@ class CallFrameInfo {
// If has_z_personality is true, this is the address of the personality
// routine --- or, if personality_encoding & DW_EH_PE_indirect, the
// address where the personality routine's address is stored.
- uint64 personality_address;
+ uint64_t personality_address;
// This is the encoding used for addresses in the FDE header and
// in DW_CFA_set_loc instructions. This is always valid, whether
// or not we saw a 'z' augmentation string; its default value is
// DW_EH_PE_absptr, which is what normal DWARF CFI uses.
DwarfPointerEncoding pointer_encoding;
+
+ // These were only introduced in DWARF4, so will not be set in older
+ // versions.
+ uint8_t address_size;
+ uint8_t segment_size;
};
// A frame description entry (FDE).
struct FDE: public Entry {
- uint64 address; // start address of described code
- uint64 size; // size of described code, in bytes
+ uint64_t address; // start address of described code
+ uint64_t size; // size of described code, in bytes
// If cie->has_z_lsda is true, then this is the language-specific data
// area's address --- or its address's address, if cie->lsda_encoding
// has the DW_EH_PE_indirect bit set.
- uint64 lsda_address;
+ uint64_t lsda_address;
};
// Internal use.
@@ -762,7 +1035,7 @@ class CallFrameInfo {
// true. On failure, report the problem, and return false. Even if we
// return false, set ENTRY->end to the first byte after the entry if we
// were able to figure that out, or NULL if we weren't.
- bool ReadEntryPrologue(const char *cursor, Entry *entry);
+ bool ReadEntryPrologue(const uint8_t *cursor, Entry *entry);
// Parse the fields of a CIE after the entry prologue, including any 'z'
// augmentation data. Assume that the 'Entry' fields of CIE are
@@ -790,7 +1063,7 @@ class CallFrameInfo {
}
// The contents of the DWARF .debug_info section we're parsing.
- const char *buffer_;
+ const uint8_t *buffer_;
size_t buffer_length_;
// For reading multi-byte values with the appropriate endianness.
@@ -832,8 +1105,8 @@ class CallFrameInfo::Handler {
// to the handler explicitly; instead, if the handler elects to
// process a given FDE, the parser reiterates the appropriate CIE's
// contents at the beginning of the FDE's rules.
- virtual bool Entry(size_t offset, uint64 address, uint64 length,
- uint8 version, const string &augmentation,
+ virtual bool Entry(size_t offset, uint64_t address, uint64_t length,
+ uint8_t version, const string &augmentation,
unsigned return_address) = 0;
// When the Entry function returns true, the parser calls these
@@ -855,21 +1128,21 @@ class CallFrameInfo::Handler {
// computation. All other REG values will be positive.
// At ADDRESS, register REG's value is not recoverable.
- virtual bool UndefinedRule(uint64 address, int reg) = 0;
+ virtual bool UndefinedRule(uint64_t address, int reg) = 0;
// At ADDRESS, register REG's value is the same as that it had in
// the caller.
- virtual bool SameValueRule(uint64 address, int reg) = 0;
+ virtual bool SameValueRule(uint64_t address, int reg) = 0;
// At ADDRESS, register REG has been saved at offset OFFSET from
// BASE_REGISTER.
- virtual bool OffsetRule(uint64 address, int reg,
+ virtual bool OffsetRule(uint64_t address, int reg,
int base_register, long offset) = 0;
// At ADDRESS, the caller's value of register REG is the current
// value of BASE_REGISTER plus OFFSET. (This rule doesn't provide an
// address at which the register's value is saved.)
- virtual bool ValOffsetRule(uint64 address, int reg,
+ virtual bool ValOffsetRule(uint64_t address, int reg,
int base_register, long offset) = 0;
// At ADDRESS, register REG has been saved in BASE_REGISTER. This differs
@@ -877,17 +1150,17 @@ class CallFrameInfo::Handler {
// BASE_REGISTER is the "home" for REG's saved value: if you want to
// assign to a variable whose home is REG in the calling frame, you
// should put the value in BASE_REGISTER.
- virtual bool RegisterRule(uint64 address, int reg, int base_register) = 0;
+ virtual bool RegisterRule(uint64_t address, int reg, int base_register) = 0;
// At ADDRESS, the DWARF expression EXPRESSION yields the address at
// which REG was saved.
- virtual bool ExpressionRule(uint64 address, int reg,
+ virtual bool ExpressionRule(uint64_t address, int reg,
const string &expression) = 0;
// At ADDRESS, the DWARF expression EXPRESSION yields the caller's
// value for REG. (This rule doesn't provide an address at which the
// register's value is saved.)
- virtual bool ValExpressionRule(uint64 address, int reg,
+ virtual bool ValExpressionRule(uint64_t address, int reg,
const string &expression) = 0;
// Indicate that the rules for the address range reported by the
@@ -928,7 +1201,7 @@ class CallFrameInfo::Handler {
// which the routine's address is stored. The default definition for
// this handler function simply returns true, allowing parsing of
// the entry to continue.
- virtual bool PersonalityRoutine(uint64 address, bool indirect) {
+ virtual bool PersonalityRoutine(uint64_t address, bool indirect) {
return true;
}
@@ -937,7 +1210,7 @@ class CallFrameInfo::Handler {
// which the area's address is stored. The default definition for
// this handler function simply returns true, allowing parsing of
// the entry to continue.
- virtual bool LanguageSpecificDataArea(uint64 address, bool indirect) {
+ virtual bool LanguageSpecificDataArea(uint64_t address, bool indirect) {
return true;
}
@@ -973,69 +1246,77 @@ class CallFrameInfo::Reporter {
// The CFI entry at OFFSET ends too early to be well-formed. KIND
// indicates what kind of entry it is; KIND can be kUnknown if we
// haven't parsed enough of the entry to tell yet.
- virtual void Incomplete(uint64 offset, CallFrameInfo::EntryKind kind);
+ virtual void Incomplete(uint64_t offset, CallFrameInfo::EntryKind kind);
// The .eh_frame data has a four-byte zero at OFFSET where the next
// entry's length would be; this is a terminator. However, the buffer
// length as given to the CallFrameInfo constructor says there should be
// more data.
- virtual void EarlyEHTerminator(uint64 offset);
+ virtual void EarlyEHTerminator(uint64_t offset);
// The FDE at OFFSET refers to the CIE at CIE_OFFSET, but the
// section is not that large.
- virtual void CIEPointerOutOfRange(uint64 offset, uint64 cie_offset);
+ virtual void CIEPointerOutOfRange(uint64_t offset, uint64_t cie_offset);
// The FDE at OFFSET refers to the CIE at CIE_OFFSET, but the entry
// there is not a CIE.
- virtual void BadCIEId(uint64 offset, uint64 cie_offset);
+ virtual void BadCIEId(uint64_t offset, uint64_t cie_offset);
+
+ // The FDE at OFFSET refers to a CIE with an address size we don't know how
+ // to handle.
+ virtual void UnexpectedAddressSize(uint64_t offset, uint8_t address_size);
+
+ // The FDE at OFFSET refers to a CIE with an segment descriptor size we
+ // don't know how to handle.
+ virtual void UnexpectedSegmentSize(uint64_t offset, uint8_t segment_size);
// The FDE at OFFSET refers to a CIE with version number VERSION,
// which we don't recognize. We cannot parse DWARF CFI if it uses
// a version number we don't recognize.
- virtual void UnrecognizedVersion(uint64 offset, int version);
+ virtual void UnrecognizedVersion(uint64_t offset, int version);
// The FDE at OFFSET refers to a CIE with augmentation AUGMENTATION,
// which we don't recognize. We cannot parse DWARF CFI if it uses
// augmentations we don't recognize.
- virtual void UnrecognizedAugmentation(uint64 offset,
+ virtual void UnrecognizedAugmentation(uint64_t offset,
const string &augmentation);
// The pointer encoding ENCODING, specified by the CIE at OFFSET, is not
// a valid encoding.
- virtual void InvalidPointerEncoding(uint64 offset, uint8 encoding);
+ virtual void InvalidPointerEncoding(uint64_t offset, uint8_t encoding);
// The pointer encoding ENCODING, specified by the CIE at OFFSET, depends
// on a base address which has not been supplied.
- virtual void UnusablePointerEncoding(uint64 offset, uint8 encoding);
+ virtual void UnusablePointerEncoding(uint64_t offset, uint8_t encoding);
// The CIE at OFFSET contains a DW_CFA_restore instruction at
// INSN_OFFSET, which may not appear in a CIE.
- virtual void RestoreInCIE(uint64 offset, uint64 insn_offset);
+ virtual void RestoreInCIE(uint64_t offset, uint64_t insn_offset);
// The entry at OFFSET, of kind KIND, has an unrecognized
// instruction at INSN_OFFSET.
- virtual void BadInstruction(uint64 offset, CallFrameInfo::EntryKind kind,
- uint64 insn_offset);
+ virtual void BadInstruction(uint64_t offset, CallFrameInfo::EntryKind kind,
+ uint64_t insn_offset);
// The instruction at INSN_OFFSET in the entry at OFFSET, of kind
// KIND, establishes a rule that cites the CFA, but we have not
// established a CFA rule yet.
- virtual void NoCFARule(uint64 offset, CallFrameInfo::EntryKind kind,
- uint64 insn_offset);
+ virtual void NoCFARule(uint64_t offset, CallFrameInfo::EntryKind kind,
+ uint64_t insn_offset);
// The instruction at INSN_OFFSET in the entry at OFFSET, of kind
// KIND, is a DW_CFA_restore_state instruction, but the stack of
// saved states is empty.
- virtual void EmptyStateStack(uint64 offset, CallFrameInfo::EntryKind kind,
- uint64 insn_offset);
+ virtual void EmptyStateStack(uint64_t offset, CallFrameInfo::EntryKind kind,
+ uint64_t insn_offset);
// The DW_CFA_remember_state instruction at INSN_OFFSET in the entry
// at OFFSET, of kind KIND, would restore a state that has no CFA
// rule, whereas the current state does have a CFA rule. This is
// bogus input, which the CallFrameInfo::Handler interface doesn't
// (and shouldn't) have any way to report.
- virtual void ClearingCFARule(uint64 offset, CallFrameInfo::EntryKind kind,
- uint64 insn_offset);
+ virtual void ClearingCFARule(uint64_t offset, CallFrameInfo::EntryKind kind,
+ uint64_t insn_offset);
protected:
// The name of the file whose CFI we're reading.
diff --git a/src/common/dwarf/dwarf2reader_cfi_unittest.cc b/src/common/dwarf/dwarf2reader_cfi_unittest.cc
index 66c6198b..ebe612e1 100644
--- a/src/common/dwarf/dwarf2reader_cfi_unittest.cc
+++ b/src/common/dwarf/dwarf2reader_cfi_unittest.cc
@@ -31,6 +31,7 @@
// dwarf2reader_cfi_unittest.cc: Unit tests for dwarf2reader::CallFrameInfo
+#include <stdint.h>
#include <stdlib.h>
#include <string>
@@ -98,41 +99,45 @@ void WriteELFFrameSection(const char *filename, const char *section_name,
class MockCallFrameInfoHandler: public CallFrameInfo::Handler {
public:
- MOCK_METHOD6(Entry, bool(size_t offset, uint64 address, uint64 length,
- uint8 version, const string &augmentation,
+ MOCK_METHOD6(Entry, bool(size_t offset, uint64_t address, uint64_t length,
+ uint8_t version, const string &augmentation,
unsigned return_address));
- MOCK_METHOD2(UndefinedRule, bool(uint64 address, int reg));
- MOCK_METHOD2(SameValueRule, bool(uint64 address, int reg));
- MOCK_METHOD4(OffsetRule, bool(uint64 address, int reg, int base_register,
+ MOCK_METHOD2(UndefinedRule, bool(uint64_t address, int reg));
+ MOCK_METHOD2(SameValueRule, bool(uint64_t address, int reg));
+ MOCK_METHOD4(OffsetRule, bool(uint64_t address, int reg, int base_register,
long offset));
- MOCK_METHOD4(ValOffsetRule, bool(uint64 address, int reg, int base_register,
+ MOCK_METHOD4(ValOffsetRule, bool(uint64_t address, int reg, int base_register,
long offset));
- MOCK_METHOD3(RegisterRule, bool(uint64 address, int reg, int base_register));
- MOCK_METHOD3(ExpressionRule, bool(uint64 address, int reg,
+ MOCK_METHOD3(RegisterRule, bool(uint64_t address, int reg, int base_register));
+ MOCK_METHOD3(ExpressionRule, bool(uint64_t address, int reg,
const string &expression));
- MOCK_METHOD3(ValExpressionRule, bool(uint64 address, int reg,
+ MOCK_METHOD3(ValExpressionRule, bool(uint64_t address, int reg,
const string &expression));
MOCK_METHOD0(End, bool());
- MOCK_METHOD2(PersonalityRoutine, bool(uint64 address, bool indirect));
- MOCK_METHOD2(LanguageSpecificDataArea, bool(uint64 address, bool indirect));
+ MOCK_METHOD2(PersonalityRoutine, bool(uint64_t address, bool indirect));
+ MOCK_METHOD2(LanguageSpecificDataArea, bool(uint64_t address, bool indirect));
MOCK_METHOD0(SignalHandler, bool());
};
class MockCallFrameErrorReporter: public CallFrameInfo::Reporter {
public:
MockCallFrameErrorReporter() : Reporter("mock filename", "mock section") { }
- MOCK_METHOD2(Incomplete, void(uint64, CallFrameInfo::EntryKind));
- MOCK_METHOD1(EarlyEHTerminator, void(uint64));
- MOCK_METHOD2(CIEPointerOutOfRange, void(uint64, uint64));
- MOCK_METHOD2(BadCIEId, void(uint64, uint64));
- MOCK_METHOD2(UnrecognizedVersion, void(uint64, int version));
- MOCK_METHOD2(UnrecognizedAugmentation, void(uint64, const string &));
- MOCK_METHOD2(InvalidPointerEncoding, void(uint64, uint8));
- MOCK_METHOD2(UnusablePointerEncoding, void(uint64, uint8));
- MOCK_METHOD2(RestoreInCIE, void(uint64, uint64));
- MOCK_METHOD3(BadInstruction, void(uint64, CallFrameInfo::EntryKind, uint64));
- MOCK_METHOD3(NoCFARule, void(uint64, CallFrameInfo::EntryKind, uint64));
- MOCK_METHOD3(EmptyStateStack, void(uint64, CallFrameInfo::EntryKind, uint64));
+ MOCK_METHOD2(Incomplete, void(uint64_t, CallFrameInfo::EntryKind));
+ MOCK_METHOD1(EarlyEHTerminator, void(uint64_t));
+ MOCK_METHOD2(CIEPointerOutOfRange, void(uint64_t, uint64_t));
+ MOCK_METHOD2(BadCIEId, void(uint64_t, uint64_t));
+ MOCK_METHOD2(UnexpectedAddressSize, void(uint64_t, uint8_t));
+ MOCK_METHOD2(UnexpectedSegmentSize, void(uint64_t, uint8_t));
+ MOCK_METHOD2(UnrecognizedVersion, void(uint64_t, int version));
+ MOCK_METHOD2(UnrecognizedAugmentation, void(uint64_t, const string &));
+ MOCK_METHOD2(InvalidPointerEncoding, void(uint64_t, uint8_t));
+ MOCK_METHOD2(UnusablePointerEncoding, void(uint64_t, uint8_t));
+ MOCK_METHOD2(RestoreInCIE, void(uint64_t, uint64_t));
+ MOCK_METHOD3(BadInstruction, void(uint64_t, CallFrameInfo::EntryKind,
+ uint64_t));
+ MOCK_METHOD3(NoCFARule, void(uint64_t, CallFrameInfo::EntryKind, uint64_t));
+ MOCK_METHOD3(EmptyStateStack, void(uint64_t, CallFrameInfo::EntryKind,
+ uint64_t));
};
struct CFIFixture {
@@ -186,7 +191,7 @@ class CFI: public CFIFixture, public Test { };
TEST_F(CFI, EmptyRegion) {
EXPECT_CALL(handler, Entry(_, _, _, _, _, _)).Times(0);
EXPECT_CALL(handler, End()).Times(0);
- static const char data[1] = { 42 };
+ static const uint8_t data[] = { 42 };
ByteReader byte_reader(ENDIANNESS_BIG);
CallFrameInfo parser(data, 0, &byte_reader, &handler, &reporter);
@@ -213,7 +218,8 @@ TEST_F(CFI, IncompleteLength32) {
ByteReader byte_reader(ENDIANNESS_BIG);
byte_reader.SetAddressSize(8);
- CallFrameInfo parser(contents.data(), contents.size() - 2,
+ CallFrameInfo parser(reinterpret_cast<const uint8_t *>(contents.data()),
+ contents.size() - 2,
&byte_reader, &handler, &reporter);
EXPECT_FALSE(parser.Start());
}
@@ -238,7 +244,8 @@ TEST_F(CFI, IncompleteLength64) {
ByteReader byte_reader(ENDIANNESS_LITTLE);
byte_reader.SetAddressSize(4);
- CallFrameInfo parser(contents.data(), contents.size() - 4,
+ CallFrameInfo parser(reinterpret_cast<const uint8_t *>(contents.data()),
+ contents.size() - 4,
&byte_reader, &handler, &reporter);
EXPECT_FALSE(parser.Start());
}
@@ -262,7 +269,8 @@ TEST_F(CFI, IncompleteId32) {
ByteReader byte_reader(ENDIANNESS_BIG);
byte_reader.SetAddressSize(8);
- CallFrameInfo parser(contents.data(), contents.size(),
+ CallFrameInfo parser(reinterpret_cast<const uint8_t *>(contents.data()),
+ contents.size(),
&byte_reader, &handler, &reporter);
EXPECT_FALSE(parser.Start());
}
@@ -288,7 +296,8 @@ TEST_F(CFI, BadId32) {
ByteReader byte_reader(ENDIANNESS_BIG);
byte_reader.SetAddressSize(8);
- CallFrameInfo parser(contents.data(), contents.size(),
+ CallFrameInfo parser(reinterpret_cast<const uint8_t *>(contents.data()),
+ contents.size(),
&byte_reader, &handler, &reporter);
EXPECT_FALSE(parser.Start());
}
@@ -309,7 +318,8 @@ TEST_F(CFI, SingleCIE) {
EXPECT_TRUE(section.GetContents(&contents));
ByteReader byte_reader(ENDIANNESS_LITTLE);
byte_reader.SetAddressSize(4);
- CallFrameInfo parser(contents.data(), contents.size(),
+ CallFrameInfo parser(reinterpret_cast<const uint8_t *>(contents.data()),
+ contents.size(),
&byte_reader, &handler, &reporter);
EXPECT_TRUE(parser.Start());
}
@@ -339,7 +349,8 @@ TEST_F(CFI, OneFDE) {
EXPECT_TRUE(section.GetContents(&contents));
ByteReader byte_reader(ENDIANNESS_BIG);
byte_reader.SetAddressSize(4);
- CallFrameInfo parser(contents.data(), contents.size(),
+ CallFrameInfo parser(reinterpret_cast<const uint8_t *>(contents.data()),
+ contents.size(),
&byte_reader, &handler, &reporter);
EXPECT_TRUE(parser.Start());
}
@@ -382,7 +393,8 @@ TEST_F(CFI, TwoFDEsOneCIE) {
EXPECT_TRUE(section.GetContents(&contents));
ByteReader byte_reader(ENDIANNESS_BIG);
byte_reader.SetAddressSize(4);
- CallFrameInfo parser(contents.data(), contents.size(),
+ CallFrameInfo parser(reinterpret_cast<const uint8_t *>(contents.data()),
+ contents.size(),
&byte_reader, &handler, &reporter);
EXPECT_TRUE(parser.Start());
}
@@ -431,7 +443,8 @@ TEST_F(CFI, TwoFDEsTwoCIEs) {
EXPECT_TRUE(section.GetContents(&contents));
ByteReader byte_reader(ENDIANNESS_LITTLE);
byte_reader.SetAddressSize(8);
- CallFrameInfo parser(contents.data(), contents.size(),
+ CallFrameInfo parser(reinterpret_cast<const uint8_t *>(contents.data()),
+ contents.size(),
&byte_reader, &handler, &reporter);
EXPECT_TRUE(parser.Start());
}
@@ -475,7 +488,8 @@ TEST_F(CFI, BadVersion) {
EXPECT_TRUE(section.GetContents(&contents));
ByteReader byte_reader(ENDIANNESS_BIG);
byte_reader.SetAddressSize(4);
- CallFrameInfo parser(contents.data(), contents.size(),
+ CallFrameInfo parser(reinterpret_cast<const uint8_t *>(contents.data()),
+ contents.size(),
&byte_reader, &handler, &reporter);
EXPECT_FALSE(parser.Start());
}
@@ -519,7 +533,8 @@ TEST_F(CFI, BadAugmentation) {
EXPECT_TRUE(section.GetContents(&contents));
ByteReader byte_reader(ENDIANNESS_BIG);
byte_reader.SetAddressSize(4);
- CallFrameInfo parser(contents.data(), contents.size(),
+ CallFrameInfo parser(reinterpret_cast<const uint8_t *>(contents.data()),
+ contents.size(),
&byte_reader, &handler, &reporter);
EXPECT_FALSE(parser.Start());
}
@@ -553,7 +568,8 @@ TEST_F(CFI, CIEVersion1ReturnColumn) {
EXPECT_TRUE(section.GetContents(&contents));
ByteReader byte_reader(ENDIANNESS_BIG);
byte_reader.SetAddressSize(4);
- CallFrameInfo parser(contents.data(), contents.size(),
+ CallFrameInfo parser(reinterpret_cast<const uint8_t *>(contents.data()),
+ contents.size(),
&byte_reader, &handler, &reporter);
EXPECT_TRUE(parser.Start());
}
@@ -587,11 +603,124 @@ TEST_F(CFI, CIEVersion3ReturnColumn) {
EXPECT_TRUE(section.GetContents(&contents));
ByteReader byte_reader(ENDIANNESS_BIG);
byte_reader.SetAddressSize(4);
- CallFrameInfo parser(contents.data(), contents.size(),
+ CallFrameInfo parser(reinterpret_cast<const uint8_t *>(contents.data()),
+ contents.size(),
&byte_reader, &handler, &reporter);
EXPECT_TRUE(parser.Start());
}
+TEST_F(CFI, CIEVersion4AdditionalFields) {
+ CFISection section(kBigEndian, 8);
+ Label cie;
+ section
+ .Mark(&cie)
+ // CIE version 4 with expected address (64bit) and segment size.
+ .CIEHeader(0x0ab4758d, 0xc010fdf7, 0x89, 4, "", true, 8, 0)
+ .FinishEntry()
+ // FDE, citing that CIE.
+ .FDEHeader(cie, 0x86763f2b, 0x2a66dc23)
+ .FinishEntry();
+
+ PERHAPS_WRITE_DEBUG_FRAME_FILE("CIEVersion3ReturnColumn", section);
+
+ {
+ InSequence s;
+ EXPECT_CALL(handler, Entry(_, 0x86763f2b, 0x2a66dc23, 4, "", 0x89))
+ .WillOnce(Return(true));
+ EXPECT_CALL(handler, End()).WillOnce(Return(true));
+ }
+
+ string contents;
+ EXPECT_TRUE(section.GetContents(&contents));
+ ByteReader byte_reader(ENDIANNESS_BIG);
+ CallFrameInfo parser(reinterpret_cast<const uint8_t *>(contents.data()),
+ contents.size(),
+ &byte_reader, &handler, &reporter);
+ EXPECT_TRUE(parser.Start());
+}
+
+TEST_F(CFI, CIEVersion4AdditionalFields32BitAddress) {
+ CFISection section(kBigEndian, 4);
+ Label cie;
+ section
+ .Mark(&cie)
+ // CIE version 4 with expected address (32bit) and segment size.
+ .CIEHeader(0x0ab4758d, 0xc010fdf7, 0x89, 4, "", true, 4, 0)
+ .FinishEntry()
+ // FDE, citing that CIE.
+ .FDEHeader(cie, 0x86763f2b, 0x2a66dc23)
+ .FinishEntry();
+
+ PERHAPS_WRITE_DEBUG_FRAME_FILE("CIEVersion3ReturnColumn", section);
+
+ {
+ InSequence s;
+ EXPECT_CALL(handler, Entry(_, 0x86763f2b, 0x2a66dc23, 4, "", 0x89))
+ .WillOnce(Return(true));
+ EXPECT_CALL(handler, End()).WillOnce(Return(true));
+ }
+
+ string contents;
+ EXPECT_TRUE(section.GetContents(&contents));
+ ByteReader byte_reader(ENDIANNESS_BIG);
+ CallFrameInfo parser(reinterpret_cast<const uint8_t *>(contents.data()),
+ contents.size(),
+ &byte_reader, &handler, &reporter);
+ EXPECT_TRUE(parser.Start());
+}
+
+TEST_F(CFI, CIEVersion4AdditionalFieldsUnexpectedAddressSize) {
+ CFISection section(kBigEndian, 4);
+ Label cie;
+
+ section
+ .Mark(&cie)
+ // Unexpected address size.
+ .CIEHeader(0x4be22f75, 0x2492236e, 0x6b6efb87, 4, "", true, 3, 0)
+ .FinishEntry()
+ // FDE, citing that CIE.
+ .FDEHeader(cie, 0x86763f2b, 0x2a66dc23)
+ .FinishEntry();
+
+ PERHAPS_WRITE_DEBUG_FRAME_FILE("AdditionalFieldsUnexpectedAddress", section);
+
+ EXPECT_CALL(reporter, UnexpectedAddressSize(_, 3))
+ .WillOnce(Return());
+
+ string contents;
+ EXPECT_TRUE(section.GetContents(&contents));
+ ByteReader byte_reader(ENDIANNESS_BIG);
+ CallFrameInfo parser(reinterpret_cast<const uint8_t *>(contents.data()),
+ contents.size(),
+ &byte_reader, &handler, &reporter);
+ EXPECT_FALSE(parser.Start());
+}
+
+TEST_F(CFI, CIEVersion4AdditionalFieldsUnexpectedSegmentSize) {
+ CFISection section(kBigEndian, 8);
+ Label cie;
+
+ section
+ .Mark(&cie)
+ .CIEHeader(0xf8bc4399, 0x8cf09931, 0xf2f519b2, 4, "", true, 8, 7)
+ .FinishEntry()
+ .FDEHeader(cie, 0x7bf0fda0, 0xcbcd28d8)
+ .FinishEntry();
+
+ PERHAPS_WRITE_DEBUG_FRAME_FILE("AdditionalFieldsUnexpectedSegment", section);
+
+ EXPECT_CALL(reporter, UnexpectedSegmentSize(_, 7))
+ .WillOnce(Return());
+
+ string contents;
+ EXPECT_TRUE(section.GetContents(&contents));
+ ByteReader byte_reader(ENDIANNESS_BIG);
+ CallFrameInfo parser(reinterpret_cast<const uint8_t *>(contents.data()),
+ contents.size(),
+ &byte_reader, &handler, &reporter);
+ EXPECT_FALSE(parser.Start());
+}
+
struct CFIInsnFixture: public CFIFixture {
CFIInsnFixture() : CFIFixture() {
data_factor = 0xb6f;
@@ -668,7 +797,8 @@ struct CFIInsnFixture: public CFIFixture {
}
ByteReader byte_reader(endianness);
byte_reader.SetAddressSize(section->AddressSize());
- CallFrameInfo parser(contents.data(), contents.size(),
+ CallFrameInfo parser(reinterpret_cast<const uint8_t *>(contents.data()),
+ contents.size(),
&byte_reader, &handler, &reporter);
if (succeeds)
EXPECT_TRUE(parser.Start());
@@ -678,13 +808,13 @@ struct CFIInsnFixture: public CFIFixture {
Label cie_label;
Sequence s;
- uint64 code_factor;
+ uint64_t code_factor;
int data_factor;
unsigned return_register;
unsigned version;
unsigned cfa_base_register;
int cfa_offset;
- uint64 fde_start, fde_size;
+ uint64_t fde_start, fde_size;
};
class CFIInsn: public CFIInsnFixture, public Test { };
@@ -1320,7 +1450,7 @@ TEST_F(CFIInsn, DW_CFA_remember_and_restore_state) {
.D8(dwarf2reader::DW_CFA_restore_state)
.FinishEntry();
- uint64 addr = fde_start;
+ uint64_t addr = fde_start;
// Expect the incoming rules to be reported.
EXPECT_CALL(handler, OffsetRule(addr, 2, kCFARegister, 0x9806 * data_factor))
@@ -1989,10 +2119,12 @@ struct EHFrameFixture: public CFIInsnFixture {
}
ByteReader byte_reader(endianness);
byte_reader.SetAddressSize(section->AddressSize());
- byte_reader.SetCFIDataBase(encoded_pointer_bases.cfi, contents.data());
+ byte_reader.SetCFIDataBase(encoded_pointer_bases.cfi,
+ reinterpret_cast<const uint8_t *>(contents.data()));
byte_reader.SetTextBase(encoded_pointer_bases.text);
byte_reader.SetDataBase(encoded_pointer_bases.data);
- CallFrameInfo parser(contents.data(), contents.size(),
+ CallFrameInfo parser(reinterpret_cast<const uint8_t *>(contents.data()),
+ contents.size(),
&byte_reader, &handler, &reporter, true);
if (succeeds)
EXPECT_TRUE(parser.Start());
diff --git a/src/common/dwarf/dwarf2reader_die_unittest.cc b/src/common/dwarf/dwarf2reader_die_unittest.cc
index 4e344369..ca44cad0 100644
--- a/src/common/dwarf/dwarf2reader_die_unittest.cc
+++ b/src/common/dwarf/dwarf2reader_die_unittest.cc
@@ -31,6 +31,7 @@
// dwarf2reader_die_unittest.cc: Unit tests for dwarf2reader::CompilationUnit
+#include <stdint.h>
#include <stdlib.h>
#include <iostream>
@@ -72,36 +73,37 @@ using testing::_;
class MockDwarf2Handler: public Dwarf2Handler {
public:
- MOCK_METHOD5(StartCompilationUnit, bool(uint64 offset, uint8 address_size,
- uint8 offset_size, uint64 cu_length,
- uint8 dwarf_version));
- MOCK_METHOD2(StartDIE, bool(uint64 offset, enum DwarfTag tag));
- MOCK_METHOD4(ProcessAttributeUnsigned, void(uint64 offset,
+ MOCK_METHOD5(StartCompilationUnit, bool(uint64_t offset, uint8_t address_size,
+ uint8_t offset_size,
+ uint64_t cu_length,
+ uint8_t dwarf_version));
+ MOCK_METHOD2(StartDIE, bool(uint64_t offset, enum DwarfTag tag));
+ MOCK_METHOD4(ProcessAttributeUnsigned, void(uint64_t offset,
DwarfAttribute attr,
enum DwarfForm form,
- uint64 data));
- MOCK_METHOD4(ProcessAttributeSigned, void(uint64 offset,
+ uint64_t data));
+ MOCK_METHOD4(ProcessAttributeSigned, void(uint64_t offset,
enum DwarfAttribute attr,
enum DwarfForm form,
- int64 data));
- MOCK_METHOD4(ProcessAttributeReference, void(uint64 offset,
+ int64_t data));
+ MOCK_METHOD4(ProcessAttributeReference, void(uint64_t offset,
enum DwarfAttribute attr,
enum DwarfForm form,
- uint64 data));
- MOCK_METHOD5(ProcessAttributeBuffer, void(uint64 offset,
+ uint64_t data));
+ MOCK_METHOD5(ProcessAttributeBuffer, void(uint64_t offset,
enum DwarfAttribute attr,
enum DwarfForm form,
- const char* data,
- uint64 len));
- MOCK_METHOD4(ProcessAttributeString, void(uint64 offset,
+ const uint8_t *data,
+ uint64_t len));
+ MOCK_METHOD4(ProcessAttributeString, void(uint64_t offset,
enum DwarfAttribute attr,
enum DwarfForm form,
const string& data));
- MOCK_METHOD4(ProcessAttributeSignature, void(uint64 offset,
+ MOCK_METHOD4(ProcessAttributeSignature, void(uint64_t offset,
DwarfAttribute attr,
enum DwarfForm form,
- uint64 signature));
- MOCK_METHOD1(EndDIE, void(uint64 offset));
+ uint64_t signature));
+ MOCK_METHOD1(EndDIE, void(uint64_t offset));
};
struct DIEFixture {
@@ -132,9 +134,11 @@ struct DIEFixture {
assert(info.GetContents(&info_contents));
assert(abbrevs.GetContents(&abbrevs_contents));
section_map.clear();
- section_map[".debug_info"].first = info_contents.data();
+ section_map[".debug_info"].first
+ = reinterpret_cast<const uint8_t *>(info_contents.data());
section_map[".debug_info"].second = info_contents.size();
- section_map[".debug_abbrev"].first = abbrevs_contents.data();
+ section_map[".debug_abbrev"].first
+ = reinterpret_cast<const uint8_t *>(abbrevs_contents.data());
section_map[".debug_abbrev"].second = abbrevs_contents.size();
return section_map;
}
@@ -196,7 +200,7 @@ TEST_P(DwarfHeader, Header) {
ByteReader byte_reader(GetParam().endianness == kLittleEndian ?
ENDIANNESS_LITTLE : ENDIANNESS_BIG);
- CompilationUnit parser(MakeSectionMap(), 0, &byte_reader, &handler);
+ CompilationUnit parser("", MakeSectionMap(), 0, &byte_reader, &handler);
EXPECT_EQ(parser.Start(), info_contents.size());
}
@@ -253,7 +257,7 @@ struct DwarfFormsFixture: public DIEFixture {
// containing one childless DIE of the given tag, in the sequence s. Stop
// just before the expectations.
void ExpectBeginCompilationUnit(const DwarfHeaderParams &params,
- DwarfTag tag, uint64 offset=0) {
+ DwarfTag tag, uint64_t offset=0) {
EXPECT_CALL(handler,
StartCompilationUnit(offset, params.address_size,
params.format_size, _,
@@ -271,10 +275,11 @@ struct DwarfFormsFixture: public DIEFixture {
.WillOnce(Return());
}
- void ParseCompilationUnit(const DwarfHeaderParams &params, uint64 offset=0) {
+ void ParseCompilationUnit(const DwarfHeaderParams &params,
+ uint64_t offset=0) {
ByteReader byte_reader(params.endianness == kLittleEndian ?
ENDIANNESS_LITTLE : ENDIANNESS_BIG);
- CompilationUnit parser(MakeSectionMap(), offset, &byte_reader, &handler);
+ CompilationUnit parser("", MakeSectionMap(), offset, &byte_reader, &handler);
EXPECT_EQ(offset + parser.Start(), info_contents.size());
}
diff --git a/src/common/dwarf/elf_reader.cc b/src/common/dwarf/elf_reader.cc
new file mode 100644
index 00000000..1b665213
--- /dev/null
+++ b/src/common/dwarf/elf_reader.cc
@@ -0,0 +1,1274 @@
+// Copyright 2005 Google Inc. All Rights Reserved.
+// Author: chatham@google.com (Andrew Chatham)
+// Author: satorux@google.com (Satoru Takabayashi)
+//
+// Code for reading in ELF files.
+//
+// For information on the ELF format, see
+// http://www.x86.org/ftp/manuals/tools/elf.pdf
+//
+// I also liked:
+// http://www.caldera.com/developers/gabi/1998-04-29/contents.html
+//
+// A note about types: When dealing with the file format, we use types
+// like Elf32_Word, but in the public interfaces we treat all
+// addresses as uint64. As a result, we should be able to symbolize
+// 64-bit binaries from a 32-bit process (which we don't do,
+// anyway). size_t should therefore be avoided, except where required
+// by things like mmap().
+//
+// Although most of this code can deal with arbitrary ELF files of
+// either word size, the public ElfReader interface only examines
+// files loaded into the current address space, which must all match
+// the machine's native word size. This code cannot handle ELF files
+// with a non-native byte ordering.
+//
+// TODO(chatham): It would be nice if we could accomplish this task
+// without using malloc(), so we could use it as the process is dying.
+
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE // needed for pread()
+#endif
+
+#include <fcntl.h>
+#include <limits.h>
+#include <string.h>
+#include <sys/mman.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+#include <algorithm>
+#include <map>
+#include <string>
+#include <vector>
+// TODO(saugustine): Add support for compressed debug.
+// Also need to add configure tests for zlib.
+//#include "zlib.h"
+
+#include "third_party/musl/include/elf.h"
+#include "elf_reader.h"
+#include "common/using_std_string.h"
+
+// EM_AARCH64 is not defined by elf.h of GRTE v3 on x86.
+// TODO(dougkwan): Remove this when v17 is retired.
+#if !defined(EM_AARCH64)
+#define EM_AARCH64 183 /* ARM AARCH64 */
+#endif
+
+// Map Linux macros to their Apple equivalents.
+#if __APPLE__
+#ifndef __LITTLE_ENDIAN
+#define __LITTLE_ENDIAN __ORDER_LITTLE_ENDIAN__
+#endif // __LITTLE_ENDIAN
+#ifndef __BIG_ENDIAN
+#define __BIG_ENDIAN __ORDER_BIG_ENDIAN__
+#endif // __BIG_ENDIAN
+#ifndef __BYTE_ORDER
+#define __BYTE_ORDER __BYTE_ORDER__
+#endif // __BYTE_ORDER
+#endif // __APPLE__
+
+// TODO(dthomson): Can be removed once all Java code is using the Google3
+// launcher. We need to avoid processing PLT functions as it causes memory
+// fragmentation in malloc, which is fixed in tcmalloc - and if the Google3
+// launcher is used the JVM will then use tcmalloc. b/13735638
+//DEFINE_bool(elfreader_process_dynsyms, true,
+// "Activate PLT function processing");
+
+using std::vector;
+
+namespace {
+
+// The lowest bit of an ARM symbol value is used to indicate a Thumb address.
+const int kARMThumbBitOffset = 0;
+
+// Converts an ARM Thumb symbol value to a true aligned address value.
+template <typename T>
+T AdjustARMThumbSymbolValue(const T& symbol_table_value) {
+ return symbol_table_value & ~(1 << kARMThumbBitOffset);
+}
+
+// Names of PLT-related sections.
+const char kElfPLTRelSectionName[] = ".rel.plt"; // Use Rel struct.
+const char kElfPLTRelaSectionName[] = ".rela.plt"; // Use Rela struct.
+const char kElfPLTSectionName[] = ".plt";
+const char kElfDynSymSectionName[] = ".dynsym";
+
+const int kX86PLTCodeSize = 0x10; // Size of one x86 PLT function in bytes.
+const int kARMPLTCodeSize = 0xc;
+const int kAARCH64PLTCodeSize = 0x10;
+
+const int kX86PLT0Size = 0x10; // Size of the special PLT0 entry.
+const int kARMPLT0Size = 0x14;
+const int kAARCH64PLT0Size = 0x20;
+
+// Suffix for PLT functions when it needs to be explicitly identified as such.
+const char kPLTFunctionSuffix[] = "@plt";
+
+} // namespace
+
+namespace dwarf2reader {
+
+template <class ElfArch> class ElfReaderImpl;
+
+// 32-bit and 64-bit ELF files are processed exactly the same, except
+// for various field sizes. Elf32 and Elf64 encompass all of the
+// differences between the two formats, and all format-specific code
+// in this file is templated on one of them.
+class Elf32 {
+ public:
+ typedef Elf32_Ehdr Ehdr;
+ typedef Elf32_Shdr Shdr;
+ typedef Elf32_Phdr Phdr;
+ typedef Elf32_Word Word;
+ typedef Elf32_Sym Sym;
+ typedef Elf32_Rel Rel;
+ typedef Elf32_Rela Rela;
+
+ // What should be in the EI_CLASS header.
+ static const int kElfClass = ELFCLASS32;
+
+ // Given a symbol pointer, return the binding type (eg STB_WEAK).
+ static char Bind(const Elf32_Sym *sym) {
+ return ELF32_ST_BIND(sym->st_info);
+ }
+ // Given a symbol pointer, return the symbol type (eg STT_FUNC).
+ static char Type(const Elf32_Sym *sym) {
+ return ELF32_ST_TYPE(sym->st_info);
+ }
+
+ // Extract the symbol index from the r_info field of a relocation.
+ static int r_sym(const Elf32_Word r_info) {
+ return ELF32_R_SYM(r_info);
+ }
+};
+
+
+class Elf64 {
+ public:
+ typedef Elf64_Ehdr Ehdr;
+ typedef Elf64_Shdr Shdr;
+ typedef Elf64_Phdr Phdr;
+ typedef Elf64_Word Word;
+ typedef Elf64_Sym Sym;
+ typedef Elf64_Rel Rel;
+ typedef Elf64_Rela Rela;
+
+ // What should be in the EI_CLASS header.
+ static const int kElfClass = ELFCLASS64;
+
+ static char Bind(const Elf64_Sym *sym) {
+ return ELF64_ST_BIND(sym->st_info);
+ }
+ static char Type(const Elf64_Sym *sym) {
+ return ELF64_ST_TYPE(sym->st_info);
+ }
+ static int r_sym(const Elf64_Xword r_info) {
+ return ELF64_R_SYM(r_info);
+ }
+};
+
+
+// ElfSectionReader mmaps a section of an ELF file ("section" is ELF
+// terminology). The ElfReaderImpl object providing the section header
+// must exist for the lifetime of this object.
+//
+// The motivation for mmaping individual sections of the file is that
+// many Google executables are large enough when unstripped that we
+// have to worry about running out of virtual address space.
+//
+// For compressed sections we have no choice but to allocate memory.
+template<class ElfArch>
+class ElfSectionReader {
+ public:
+ ElfSectionReader(const char *name, const string &path, int fd,
+ const typename ElfArch::Shdr &section_header)
+ : contents_aligned_(NULL),
+ contents_(NULL),
+ header_(section_header) {
+ // Back up to the beginning of the page we're interested in.
+ const size_t additional = header_.sh_offset % getpagesize();
+ const size_t offset_aligned = header_.sh_offset - additional;
+ section_size_ = header_.sh_size;
+ size_aligned_ = section_size_ + additional;
+ // If the section has been stripped or is empty, do not attempt
+ // to process its contents.
+ if (header_.sh_type == SHT_NOBITS || header_.sh_size == 0)
+ return;
+ contents_aligned_ = mmap(NULL, size_aligned_, PROT_READ, MAP_SHARED,
+ fd, offset_aligned);
+ // Set where the offset really should begin.
+ contents_ = reinterpret_cast<char *>(contents_aligned_) +
+ (header_.sh_offset - offset_aligned);
+
+ // Check for and handle any compressed contents.
+ //if (strncmp(name, ".zdebug_", strlen(".zdebug_")) == 0)
+ // DecompressZlibContents();
+ // TODO(saugustine): Add support for proposed elf-section flag
+ // "SHF_COMPRESS".
+ }
+
+ ~ElfSectionReader() {
+ if (contents_aligned_ != NULL)
+ munmap(contents_aligned_, size_aligned_);
+ else
+ delete[] contents_;
+ }
+
+ // Return the section header for this section.
+ typename ElfArch::Shdr const &header() const { return header_; }
+
+ // Return memory at the given offset within this section.
+ const char *GetOffset(typename ElfArch::Word bytes) const {
+ return contents_ + bytes;
+ }
+
+ const char *contents() const { return contents_; }
+ size_t section_size() const { return section_size_; }
+
+ private:
+ // page-aligned file contents
+ void *contents_aligned_;
+ // contents as usable by the client. For non-compressed sections,
+ // pointer within contents_aligned_ to where the section data
+ // begins; for compressed sections, pointer to the decompressed
+ // data.
+ char *contents_;
+ // size of contents_aligned_
+ size_t size_aligned_;
+ // size of contents.
+ size_t section_size_;
+ const typename ElfArch::Shdr header_;
+};
+
+// An iterator over symbols in a given section. It handles walking
+// through the entries in the specified section and mapping symbol
+// entries to their names in the appropriate string table (in
+// another section).
+template<class ElfArch>
+class SymbolIterator {
+ public:
+ SymbolIterator(ElfReaderImpl<ElfArch> *reader,
+ typename ElfArch::Word section_type)
+ : symbol_section_(reader->GetSectionByType(section_type)),
+ string_section_(NULL),
+ num_symbols_in_section_(0),
+ symbol_within_section_(0) {
+
+ // If this section type doesn't exist, leave
+ // num_symbols_in_section_ as zero, so this iterator is already
+ // done().
+ if (symbol_section_ != NULL) {
+ num_symbols_in_section_ = symbol_section_->header().sh_size /
+ symbol_section_->header().sh_entsize;
+
+ // Symbol sections have sh_link set to the section number of
+ // the string section containing the symbol names.
+ string_section_ = reader->GetSection(symbol_section_->header().sh_link);
+ }
+ }
+
+ // Return true iff we have passed all symbols in this section.
+ bool done() const {
+ return symbol_within_section_ >= num_symbols_in_section_;
+ }
+
+ // Advance to the next symbol in this section.
+ // REQUIRES: !done()
+ void Next() { ++symbol_within_section_; }
+
+ // Return a pointer to the current symbol.
+ // REQUIRES: !done()
+ const typename ElfArch::Sym *GetSymbol() const {
+ return reinterpret_cast<const typename ElfArch::Sym*>(
+ symbol_section_->GetOffset(symbol_within_section_ *
+ symbol_section_->header().sh_entsize));
+ }
+
+ // Return the name of the current symbol, NULL if it has none.
+ // REQUIRES: !done()
+ const char *GetSymbolName() const {
+ int name_offset = GetSymbol()->st_name;
+ if (name_offset == 0)
+ return NULL;
+ return string_section_->GetOffset(name_offset);
+ }
+
+ int GetCurrentSymbolIndex() const {
+ return symbol_within_section_;
+ }
+
+ private:
+ const ElfSectionReader<ElfArch> *const symbol_section_;
+ const ElfSectionReader<ElfArch> *string_section_;
+ int num_symbols_in_section_;
+ int symbol_within_section_;
+};
+
+
+// Copied from strings/strutil.h. Per chatham,
+// this library should not depend on strings.
+
+static inline bool MyHasSuffixString(const string& str, const string& suffix) {
+ int len = str.length();
+ int suflen = suffix.length();
+ return (suflen <= len) && (str.compare(len-suflen, suflen, suffix) == 0);
+}
+
+
+// ElfReader loads an ELF binary and can provide information about its
+// contents. It is most useful for matching addresses to function
+// names. It does not understand debugging formats (eg dwarf2), so it
+// can't print line numbers. It takes a path to an elf file and a
+// readable file descriptor for that file, which it does not assume
+// ownership of.
+template<class ElfArch>
+class ElfReaderImpl {
+ public:
+ explicit ElfReaderImpl(const string &path, int fd)
+ : path_(path),
+ fd_(fd),
+ section_headers_(NULL),
+ program_headers_(NULL),
+ opd_section_(NULL),
+ base_for_text_(0),
+ plts_supported_(false),
+ plt_code_size_(0),
+ plt0_size_(0),
+ visited_relocation_entries_(false) {
+ string error;
+ is_dwp_ = MyHasSuffixString(path, ".dwp");
+ ParseHeaders(fd, path);
+ // Currently we need some extra information for PowerPC64 binaries
+ // including a way to read the .opd section for function descriptors and a
+ // way to find the linked base for function symbols.
+ if (header_.e_machine == EM_PPC64) {
+ // "opd_section_" must always be checked for NULL before use.
+ opd_section_ = GetSectionInfoByName(".opd", &opd_info_);
+ for (unsigned int k = 0u; k < GetNumSections(); ++k) {
+ const char *name = GetSectionName(section_headers_[k].sh_name);
+ if (strncmp(name, ".text", strlen(".text")) == 0) {
+ base_for_text_ =
+ section_headers_[k].sh_addr - section_headers_[k].sh_offset;
+ break;
+ }
+ }
+ }
+ // Turn on PLTs.
+ if (header_.e_machine == EM_386 || header_.e_machine == EM_X86_64) {
+ plt_code_size_ = kX86PLTCodeSize;
+ plt0_size_ = kX86PLT0Size;
+ plts_supported_ = true;
+ } else if (header_.e_machine == EM_ARM) {
+ plt_code_size_ = kARMPLTCodeSize;
+ plt0_size_ = kARMPLT0Size;
+ plts_supported_ = true;
+ } else if (header_.e_machine == EM_AARCH64) {
+ plt_code_size_ = kAARCH64PLTCodeSize;
+ plt0_size_ = kAARCH64PLT0Size;
+ plts_supported_ = true;
+ }
+ }
+
+ ~ElfReaderImpl() {
+ for (unsigned int i = 0u; i < sections_.size(); ++i)
+ delete sections_[i];
+ delete [] section_headers_;
+ delete [] program_headers_;
+ }
+
+ // Examine the headers of the file and return whether the file looks
+ // like an ELF file for this architecture. Takes an already-open
+ // file descriptor for the candidate file, reading in the prologue
+ // to see if the ELF file appears to match the current
+ // architecture. If error is non-NULL, it will be set with a reason
+ // in case of failure.
+ static bool IsArchElfFile(int fd, string *error) {
+ unsigned char header[EI_NIDENT];
+ if (pread(fd, header, sizeof(header), 0) != sizeof(header)) {
+ if (error != NULL) *error = "Could not read header";
+ return false;
+ }
+
+ if (memcmp(header, ELFMAG, SELFMAG) != 0) {
+ if (error != NULL) *error = "Missing ELF magic";
+ return false;
+ }
+
+ if (header[EI_CLASS] != ElfArch::kElfClass) {
+ if (error != NULL) *error = "Different word size";
+ return false;
+ }
+
+ int endian = 0;
+ if (header[EI_DATA] == ELFDATA2LSB)
+ endian = __LITTLE_ENDIAN;
+ else if (header[EI_DATA] == ELFDATA2MSB)
+ endian = __BIG_ENDIAN;
+ if (endian != __BYTE_ORDER) {
+ if (error != NULL) *error = "Different byte order";
+ return false;
+ }
+
+ return true;
+ }
+
+ // Return true if we can use this symbol in Address-to-Symbol map.
+ bool CanUseSymbol(const char *name, const typename ElfArch::Sym *sym) {
+ // For now we only save FUNC and NOTYPE symbols. For now we just
+ // care about functions, but some functions written in assembler
+ // don't have a proper ELF type attached to them, so we store
+ // NOTYPE symbols as well. The remaining significant type is
+ // OBJECT (eg global variables), which represent about 25% of
+ // the symbols in a typical google3 binary.
+ if (ElfArch::Type(sym) != STT_FUNC &&
+ ElfArch::Type(sym) != STT_NOTYPE) {
+ return false;
+ }
+
+ // Target specific filtering.
+ switch (header_.e_machine) {
+ case EM_AARCH64:
+ case EM_ARM:
+ // Filter out '$x' special local symbols used by tools
+ return name[0] != '$' || ElfArch::Bind(sym) != STB_LOCAL;
+ case EM_X86_64:
+ // Filter out read-only constants like .LC123.
+ return name[0] != '.' || ElfArch::Bind(sym) != STB_LOCAL;
+ default:
+ return true;
+ }
+ }
+
+ // Iterate over the symbols in a section, either SHT_DYNSYM or
+ // SHT_SYMTAB. Add all symbols to the given SymbolMap.
+ /*
+ void GetSymbolPositions(SymbolMap *symbols,
+ typename ElfArch::Word section_type,
+ uint64_t mem_offset,
+ uint64_t file_offset) {
+ // This map is used to filter out "nested" functions.
+ // See comment below.
+ AddrToSymMap addr_to_sym_map;
+ for (SymbolIterator<ElfArch> it(this, section_type);
+ !it.done(); it.Next()) {
+ const char *name = it.GetSymbolName();
+ if (name == NULL)
+ continue;
+ const typename ElfArch::Sym *sym = it.GetSymbol();
+ if (CanUseSymbol(name, sym)) {
+ const int sec = sym->st_shndx;
+
+ // We don't support special section indices. The most common
+ // is SHN_ABS, for absolute symbols used deep in the bowels of
+ // glibc. Also ignore any undefined symbols.
+ if (sec == SHN_UNDEF ||
+ (sec >= SHN_LORESERVE && sec <= SHN_HIRESERVE)) {
+ continue;
+ }
+
+ const typename ElfArch::Shdr& hdr = section_headers_[sec];
+
+ // Adjust for difference between where we expected to mmap
+ // this section, and where it was actually mmapped.
+ const int64_t expected_base = hdr.sh_addr - hdr.sh_offset;
+ const int64_t real_base = mem_offset - file_offset;
+ const int64_t adjust = real_base - expected_base;
+
+ uint64_t start = sym->st_value + adjust;
+
+ // Adjust function symbols for PowerPC64 by dereferencing and adjusting
+ // the function descriptor to get the function address.
+ if (header_.e_machine == EM_PPC64 && ElfArch::Type(sym) == STT_FUNC) {
+ const uint64_t opd_addr =
+ AdjustPPC64FunctionDescriptorSymbolValue(sym->st_value);
+ // Only adjust the returned value if the function address was found.
+ if (opd_addr != sym->st_value) {
+ const int64_t adjust_function_symbols =
+ real_base - base_for_text_;
+ start = opd_addr + adjust_function_symbols;
+ }
+ }
+
+ addr_to_sym_map.push_back(std::make_pair(start, sym));
+ }
+ }
+ std::sort(addr_to_sym_map.begin(), addr_to_sym_map.end(), &AddrToSymSorter);
+ addr_to_sym_map.erase(std::unique(addr_to_sym_map.begin(),
+ addr_to_sym_map.end(), &AddrToSymEquals),
+ addr_to_sym_map.end());
+
+ // Squeeze out any "nested functions".
+ // Nested functions are not allowed in C, but libc plays tricks.
+ //
+ // For example, here is disassembly of /lib64/tls/libc-2.3.5.so:
+ // 0x00000000000aa380 <read+0>: cmpl $0x0,0x2781b9(%rip)
+ // 0x00000000000aa387 <read+7>: jne 0xaa39b <read+27>
+ // 0x00000000000aa389 <__read_nocancel+0>: mov $0x0,%rax
+ // 0x00000000000aa390 <__read_nocancel+7>: syscall
+ // 0x00000000000aa392 <__read_nocancel+9>: cmp $0xfffffffffffff001,%rax
+ // 0x00000000000aa398 <__read_nocancel+15>: jae 0xaa3ef <read+111>
+ // 0x00000000000aa39a <__read_nocancel+17>: retq
+ // 0x00000000000aa39b <read+27>: sub $0x28,%rsp
+ // 0x00000000000aa39f <read+31>: mov %rdi,0x8(%rsp)
+ // ...
+ // Without removing __read_nocancel, symbolizer will return NULL
+ // given e.g. 0xaa39f (because the lower bound is __read_nocancel,
+ // but 0xaa39f is beyond its end.
+ if (addr_to_sym_map.empty()) {
+ return;
+ }
+ const ElfSectionReader<ElfArch> *const symbol_section =
+ this->GetSectionByType(section_type);
+ const ElfSectionReader<ElfArch> *const string_section =
+ this->GetSection(symbol_section->header().sh_link);
+
+ typename AddrToSymMap::iterator curr = addr_to_sym_map.begin();
+ // Always insert the first symbol.
+ symbols->AddSymbol(string_section->GetOffset(curr->second->st_name),
+ curr->first, curr->second->st_size);
+ typename AddrToSymMap::iterator prev = curr++;
+ for (; curr != addr_to_sym_map.end(); ++curr) {
+ const uint64_t prev_addr = prev->first;
+ const uint64_t curr_addr = curr->first;
+ const typename ElfArch::Sym *const prev_sym = prev->second;
+ const typename ElfArch::Sym *const curr_sym = curr->second;
+ if (prev_addr + prev_sym->st_size <= curr_addr ||
+ // The next condition is true if two symbols overlap like this:
+ //
+ // Previous symbol |----------------------------|
+ // Current symbol |-------------------------------|
+ //
+ // These symbols are not found in google3 codebase, but in
+ // jdk1.6.0_01_gg1/jre/lib/i386/server/libjvm.so.
+ //
+ // 0619e040 00000046 t CardTableModRefBS::write_region_work()
+ // 0619e070 00000046 t CardTableModRefBS::write_ref_array_work()
+ //
+ // We allow overlapped symbols rather than ignore these.
+ // Due to the way SymbolMap::GetSymbolAtPosition() works,
+ // lookup for any address in [curr_addr, curr_addr + its size)
+ // (e.g. 0619e071) will produce the current symbol,
+ // which is the desired outcome.
+ prev_addr + prev_sym->st_size < curr_addr + curr_sym->st_size) {
+ const char *name = string_section->GetOffset(curr_sym->st_name);
+ symbols->AddSymbol(name, curr_addr, curr_sym->st_size);
+ prev = curr;
+ } else {
+ // Current symbol is "nested" inside previous one like this:
+ //
+ // Previous symbol |----------------------------|
+ // Current symbol |---------------------|
+ //
+ // This happens within glibc, e.g. __read_nocancel is nested
+ // "inside" __read. Ignore "inner" symbol.
+ //DCHECK_LE(curr_addr + curr_sym->st_size,
+ // prev_addr + prev_sym->st_size);
+ ;
+ }
+ }
+ }
+*/
+
+ void VisitSymbols(typename ElfArch::Word section_type,
+ ElfReader::SymbolSink *sink) {
+ VisitSymbols(section_type, sink, -1, -1, false);
+ }
+
+ void VisitSymbols(typename ElfArch::Word section_type,
+ ElfReader::SymbolSink *sink,
+ int symbol_binding,
+ int symbol_type,
+ bool get_raw_symbol_values) {
+ for (SymbolIterator<ElfArch> it(this, section_type);
+ !it.done(); it.Next()) {
+ const char *name = it.GetSymbolName();
+ if (!name) continue;
+ const typename ElfArch::Sym *sym = it.GetSymbol();
+ if ((symbol_binding < 0 || ElfArch::Bind(sym) == symbol_binding) &&
+ (symbol_type < 0 || ElfArch::Type(sym) == symbol_type)) {
+ typename ElfArch::Sym symbol = *sym;
+ // Add a PLT symbol in addition to the main undefined symbol.
+ // Only do this for SHT_DYNSYM, because PLT symbols are dynamic.
+ int symbol_index = it.GetCurrentSymbolIndex();
+ // TODO(dthomson): Can be removed once all Java code is using the
+ // Google3 launcher.
+ if (section_type == SHT_DYNSYM &&
+ static_cast<unsigned int>(symbol_index) < symbols_plt_offsets_.size() &&
+ symbols_plt_offsets_[symbol_index] != 0) {
+ string plt_name = string(name) + kPLTFunctionSuffix;
+ if (plt_function_names_[symbol_index].empty()) {
+ plt_function_names_[symbol_index] = plt_name;
+ } else if (plt_function_names_[symbol_index] != plt_name) {
+ ;
+ }
+ sink->AddSymbol(plt_function_names_[symbol_index].c_str(),
+ symbols_plt_offsets_[it.GetCurrentSymbolIndex()],
+ plt_code_size_);
+ }
+ if (!get_raw_symbol_values)
+ AdjustSymbolValue(&symbol);
+ sink->AddSymbol(name, symbol.st_value, symbol.st_size);
+ }
+ }
+ }
+
+ void VisitRelocationEntries() {
+ if (visited_relocation_entries_) {
+ return;
+ }
+ visited_relocation_entries_ = true;
+
+ if (!plts_supported_) {
+ return;
+ }
+ // First determine if PLTs exist. If not, then there is nothing to do.
+ ElfReader::SectionInfo plt_section_info;
+ const char* plt_section =
+ GetSectionInfoByName(kElfPLTSectionName, &plt_section_info);
+ if (!plt_section) {
+ return;
+ }
+ if (plt_section_info.size == 0) {
+ return;
+ }
+
+ // The PLTs could be referenced by either a Rel or Rela (Rel with Addend)
+ // section.
+ ElfReader::SectionInfo rel_section_info;
+ ElfReader::SectionInfo rela_section_info;
+ const char* rel_section =
+ GetSectionInfoByName(kElfPLTRelSectionName, &rel_section_info);
+ const char* rela_section =
+ GetSectionInfoByName(kElfPLTRelaSectionName, &rela_section_info);
+
+ const typename ElfArch::Rel* rel =
+ reinterpret_cast<const typename ElfArch::Rel*>(rel_section);
+ const typename ElfArch::Rela* rela =
+ reinterpret_cast<const typename ElfArch::Rela*>(rela_section);
+
+ if (!rel_section && !rela_section) {
+ return;
+ }
+
+ // Use either Rel or Rela section, depending on which one exists.
+ size_t section_size = rel_section ? rel_section_info.size
+ : rela_section_info.size;
+ size_t entry_size = rel_section ? sizeof(typename ElfArch::Rel)
+ : sizeof(typename ElfArch::Rela);
+
+ // Determine the number of entries in the dynamic symbol table.
+ ElfReader::SectionInfo dynsym_section_info;
+ const char* dynsym_section =
+ GetSectionInfoByName(kElfDynSymSectionName, &dynsym_section_info);
+ // The dynsym section might not exist, or it might be empty. In either case
+ // there is nothing to be done so return.
+ if (!dynsym_section || dynsym_section_info.size == 0) {
+ return;
+ }
+ size_t num_dynamic_symbols =
+ dynsym_section_info.size / dynsym_section_info.entsize;
+ symbols_plt_offsets_.resize(num_dynamic_symbols, 0);
+
+ // TODO(dthomson): Can be removed once all Java code is using the
+ // Google3 launcher.
+ // Make storage room for PLT function name strings.
+ plt_function_names_.resize(num_dynamic_symbols);
+
+ for (size_t i = 0; i < section_size / entry_size; ++i) {
+ // Determine symbol index from the |r_info| field.
+ int sym_index = ElfArch::r_sym(rel_section ? rel[i].r_info
+ : rela[i].r_info);
+ if (static_cast<unsigned int>(sym_index) >= symbols_plt_offsets_.size()) {
+ continue;
+ }
+ symbols_plt_offsets_[sym_index] =
+ plt_section_info.addr + plt0_size_ + i * plt_code_size_;
+ }
+ }
+
+ // Return an ElfSectionReader for the first section of the given
+ // type by iterating through all section headers. Returns NULL if
+ // the section type is not found.
+ const ElfSectionReader<ElfArch> *GetSectionByType(
+ typename ElfArch::Word section_type) {
+ for (unsigned int k = 0u; k < GetNumSections(); ++k) {
+ if (section_headers_[k].sh_type == section_type) {
+ return GetSection(k);
+ }
+ }
+ return NULL;
+ }
+
+ // Return the name of section "shndx". Returns NULL if the section
+ // is not found.
+ const char *GetSectionNameByIndex(int shndx) {
+ return GetSectionName(section_headers_[shndx].sh_name);
+ }
+
+ // Return a pointer to section "shndx", and store the size in
+ // "size". Returns NULL if the section is not found.
+ const char *GetSectionContentsByIndex(int shndx, size_t *size) {
+ const ElfSectionReader<ElfArch> *section = GetSection(shndx);
+ if (section != NULL) {
+ *size = section->section_size();
+ return section->contents();
+ }
+ return NULL;
+ }
+
+ // Return a pointer to the first section of the given name by
+ // iterating through all section headers, and store the size in
+ // "size". Returns NULL if the section name is not found.
+ const char *GetSectionContentsByName(const string &section_name,
+ size_t *size) {
+ for (unsigned int k = 0u; k < GetNumSections(); ++k) {
+ // When searching for sections in a .dwp file, the sections
+ // we're looking for will always be at the end of the section
+ // table, so reverse the direction of iteration.
+ int shndx = is_dwp_ ? GetNumSections() - k - 1 : k;
+ const char *name = GetSectionName(section_headers_[shndx].sh_name);
+ if (name != NULL && ElfReader::SectionNamesMatch(section_name, name)) {
+ const ElfSectionReader<ElfArch> *section = GetSection(shndx);
+ if (section == NULL) {
+ return NULL;
+ } else {
+ *size = section->section_size();
+ return section->contents();
+ }
+ }
+ }
+ return NULL;
+ }
+
+ // This is like GetSectionContentsByName() but it returns a lot of extra
+ // information about the section.
+ const char *GetSectionInfoByName(const string &section_name,
+ ElfReader::SectionInfo *info) {
+ for (unsigned int k = 0u; k < GetNumSections(); ++k) {
+ // When searching for sections in a .dwp file, the sections
+ // we're looking for will always be at the end of the section
+ // table, so reverse the direction of iteration.
+ int shndx = is_dwp_ ? GetNumSections() - k - 1 : k;
+ const char *name = GetSectionName(section_headers_[shndx].sh_name);
+ if (name != NULL && ElfReader::SectionNamesMatch(section_name, name)) {
+ const ElfSectionReader<ElfArch> *section = GetSection(shndx);
+ if (section == NULL) {
+ return NULL;
+ } else {
+ info->type = section->header().sh_type;
+ info->flags = section->header().sh_flags;
+ info->addr = section->header().sh_addr;
+ info->offset = section->header().sh_offset;
+ info->size = section->header().sh_size;
+ info->link = section->header().sh_link;
+ info->info = section->header().sh_info;
+ info->addralign = section->header().sh_addralign;
+ info->entsize = section->header().sh_entsize;
+ return section->contents();
+ }
+ }
+ }
+ return NULL;
+ }
+
+ // p_vaddr of the first PT_LOAD segment (if any), or 0 if no PT_LOAD
+ // segments are present. This is the address an ELF image was linked
+ // (by static linker) to be loaded at. Usually (but not always) 0 for
+ // shared libraries and position-independent executables.
+ uint64_t VaddrOfFirstLoadSegment() const {
+ // Relocatable objects (of type ET_REL) do not have LOAD segments.
+ if (header_.e_type == ET_REL) {
+ return 0;
+ }
+ for (int i = 0; i < GetNumProgramHeaders(); ++i) {
+ if (program_headers_[i].p_type == PT_LOAD) {
+ return program_headers_[i].p_vaddr;
+ }
+ }
+ return 0;
+ }
+
+ // According to the LSB ("ELF special sections"), sections with debug
+ // info are prefixed by ".debug". The names are not specified, but they
+ // look like ".debug_line", ".debug_info", etc.
+ bool HasDebugSections() {
+ // Debug sections are likely to be near the end, so reverse the
+ // direction of iteration.
+ for (int k = GetNumSections() - 1; k >= 0; --k) {
+ const char *name = GetSectionName(section_headers_[k].sh_name);
+ if (strncmp(name, ".debug", strlen(".debug")) == 0) return true;
+ if (strncmp(name, ".zdebug", strlen(".zdebug")) == 0) return true;
+ }
+ return false;
+ }
+
+ bool IsDynamicSharedObject() const {
+ return header_.e_type == ET_DYN;
+ }
+
+ // Return the number of sections.
+ uint64_t GetNumSections() const {
+ if (HasManySections())
+ return first_section_header_.sh_size;
+ return header_.e_shnum;
+ }
+
+ private:
+ typedef vector<pair<uint64_t, const typename ElfArch::Sym *> > AddrToSymMap;
+
+ static bool AddrToSymSorter(const typename AddrToSymMap::value_type& lhs,
+ const typename AddrToSymMap::value_type& rhs) {
+ return lhs.first < rhs.first;
+ }
+
+ static bool AddrToSymEquals(const typename AddrToSymMap::value_type& lhs,
+ const typename AddrToSymMap::value_type& rhs) {
+ return lhs.first == rhs.first;
+ }
+
+ // Does this ELF file have too many sections to fit in the program header?
+ bool HasManySections() const {
+ return header_.e_shnum == SHN_UNDEF;
+ }
+
+ // Return the number of program headers.
+ int GetNumProgramHeaders() const {
+ if (HasManySections() && header_.e_phnum == 0xffff &&
+ first_section_header_.sh_info != 0)
+ return first_section_header_.sh_info;
+ return header_.e_phnum;
+ }
+
+ // Return the index of the string table.
+ int GetStringTableIndex() const {
+ if (HasManySections()) {
+ if (header_.e_shstrndx == 0xffff)
+ return first_section_header_.sh_link;
+ else if (header_.e_shstrndx >= GetNumSections())
+ return 0;
+ }
+ return header_.e_shstrndx;
+ }
+
+ // Given an offset into the section header string table, return the
+ // section name.
+ const char *GetSectionName(typename ElfArch::Word sh_name) {
+ const ElfSectionReader<ElfArch> *shstrtab =
+ GetSection(GetStringTableIndex());
+ if (shstrtab != NULL) {
+ return shstrtab->GetOffset(sh_name);
+ }
+ return NULL;
+ }
+
+ // Return an ElfSectionReader for the given section. The reader will
+ // be freed when this object is destroyed.
+ const ElfSectionReader<ElfArch> *GetSection(int num) {
+ const char *name;
+ // Hard-coding the name for the section-name string table prevents
+ // infinite recursion.
+ if (num == GetStringTableIndex())
+ name = ".shstrtab";
+ else
+ name = GetSectionNameByIndex(num);
+ ElfSectionReader<ElfArch> *& reader = sections_[num];
+ if (reader == NULL)
+ reader = new ElfSectionReader<ElfArch>(name, path_, fd_,
+ section_headers_[num]);
+ return reader;
+ }
+
+ // Parse out the overall header information from the file and assert
+ // that it looks sane. This contains information like the magic
+ // number and target architecture.
+ bool ParseHeaders(int fd, const string &path) {
+ // Read in the global ELF header.
+ if (pread(fd, &header_, sizeof(header_), 0) != sizeof(header_)) {
+ return false;
+ }
+
+ // Must be an executable, dynamic shared object or relocatable object
+ if (header_.e_type != ET_EXEC &&
+ header_.e_type != ET_DYN &&
+ header_.e_type != ET_REL) {
+ return false;
+ }
+ // Need a section header.
+ if (header_.e_shoff == 0) {
+ return false;
+ }
+
+ if (header_.e_shnum == SHN_UNDEF) {
+ // The number of sections in the program header is only a 16-bit value. In
+ // the event of overflow (greater than SHN_LORESERVE sections), e_shnum
+ // will read SHN_UNDEF and the true number of section header table entries
+ // is found in the sh_size field of the first section header.
+ // See: http://www.sco.com/developers/gabi/2003-12-17/ch4.sheader.html
+ if (pread(fd, &first_section_header_, sizeof(first_section_header_),
+ header_.e_shoff) != sizeof(first_section_header_)) {
+ return false;
+ }
+ }
+
+ // Dynamically allocate enough space to store the section headers
+ // and read them out of the file.
+ const int section_headers_size =
+ GetNumSections() * sizeof(*section_headers_);
+ section_headers_ = new typename ElfArch::Shdr[section_headers_size];
+ if (pread(fd, section_headers_, section_headers_size, header_.e_shoff) !=
+ section_headers_size) {
+ return false;
+ }
+
+ // Dynamically allocate enough space to store the program headers
+ // and read them out of the file.
+ //const int program_headers_size =
+ // GetNumProgramHeaders() * sizeof(*program_headers_);
+ program_headers_ = new typename ElfArch::Phdr[GetNumProgramHeaders()];
+
+ // Presize the sections array for efficiency.
+ sections_.resize(GetNumSections(), NULL);
+ return true;
+ }
+
+ // Given the "value" of a function descriptor return the address of the
+ // function (i.e. the dereferenced value). Otherwise return "value".
+ uint64_t AdjustPPC64FunctionDescriptorSymbolValue(uint64_t value) {
+ if (opd_section_ != NULL &&
+ opd_info_.addr <= value &&
+ value < opd_info_.addr + opd_info_.size) {
+ uint64_t offset = value - opd_info_.addr;
+ return (*reinterpret_cast<const uint64_t*>(opd_section_ + offset));
+ }
+ return value;
+ }
+
+ void AdjustSymbolValue(typename ElfArch::Sym* sym) {
+ switch (header_.e_machine) {
+ case EM_ARM:
+ // For ARM architecture, if the LSB of the function symbol offset is set,
+ // it indicates a Thumb function. This bit should not be taken literally.
+ // Clear it.
+ if (ElfArch::Type(sym) == STT_FUNC)
+ sym->st_value = AdjustARMThumbSymbolValue(sym->st_value);
+ break;
+ case EM_386:
+ // No adjustment needed for Intel x86 architecture. However, explicitly
+ // define this case as we use it quite often.
+ break;
+ case EM_PPC64:
+ // PowerPC64 currently has function descriptors as part of the ABI.
+ // Function symbols need to be adjusted accordingly.
+ if (ElfArch::Type(sym) == STT_FUNC)
+ sym->st_value = AdjustPPC64FunctionDescriptorSymbolValue(sym->st_value);
+ break;
+ default:
+ break;
+ }
+ }
+
+ friend class SymbolIterator<ElfArch>;
+
+ // The file we're reading.
+ const string path_;
+ // Open file descriptor for path_. Not owned by this object.
+ const int fd_;
+
+ // The global header of the ELF file.
+ typename ElfArch::Ehdr header_;
+
+ // The header of the first section. This may be used to supplement the ELF
+ // file header.
+ typename ElfArch::Shdr first_section_header_;
+
+ // Array of GetNumSections() section headers, allocated when we read
+ // in the global header.
+ typename ElfArch::Shdr *section_headers_;
+
+ // Array of GetNumProgramHeaders() program headers, allocated when we read
+ // in the global header.
+ typename ElfArch::Phdr *program_headers_;
+
+ // An array of pointers to ElfSectionReaders. Sections are
+ // mmaped as they're needed and not released until this object is
+ // destroyed.
+ vector<ElfSectionReader<ElfArch>*> sections_;
+
+ // For PowerPC64 we need to keep track of function descriptors when looking up
+ // values for funtion symbols values. Function descriptors are kept in the
+ // .opd section and are dereferenced to find the function address.
+ ElfReader::SectionInfo opd_info_;
+ const char *opd_section_; // Must be checked for NULL before use.
+ int64_t base_for_text_;
+
+ // Read PLT-related sections for the current architecture.
+ bool plts_supported_;
+ // Code size of each PLT function for the current architecture.
+ size_t plt_code_size_;
+ // Size of the special first entry in the .plt section that calls the runtime
+ // loader resolution routine, and that all other entries jump to when doing
+ // lazy symbol binding.
+ size_t plt0_size_;
+
+ // Maps a dynamic symbol index to a PLT offset.
+ // The vector entry index is the dynamic symbol index.
+ std::vector<uint64_t> symbols_plt_offsets_;
+
+ // Container for PLT function name strings. These strings are passed by
+ // reference to SymbolSink::AddSymbol() so they need to be stored somewhere.
+ std::vector<string> plt_function_names_;
+
+ bool visited_relocation_entries_;
+
+ // True if this is a .dwp file.
+ bool is_dwp_;
+};
+
+ElfReader::ElfReader(const string &path)
+ : path_(path), fd_(-1), impl32_(NULL), impl64_(NULL) {
+ // linux 2.6.XX kernel can show deleted files like this:
+ // /var/run/nscd/dbYLJYaE (deleted)
+ // and the kernel-supplied vdso and vsyscall mappings like this:
+ // [vdso]
+ // [vsyscall]
+ if (MyHasSuffixString(path, " (deleted)"))
+ return;
+ if (path == "[vdso]")
+ return;
+ if (path == "[vsyscall]")
+ return;
+
+ fd_ = open(path.c_str(), O_RDONLY);
+}
+
+ElfReader::~ElfReader() {
+ if (fd_ != -1)
+ close(fd_);
+ if (impl32_ != NULL)
+ delete impl32_;
+ if (impl64_ != NULL)
+ delete impl64_;
+}
+
+
+// The only word-size specific part of this file is IsNativeElfFile().
+#if ULONG_MAX == 0xffffffff
+#define NATIVE_ELF_ARCH Elf32
+#elif ULONG_MAX == 0xffffffffffffffff
+#define NATIVE_ELF_ARCH Elf64
+#else
+#error "Invalid word size"
+#endif
+
+template <typename ElfArch>
+static bool IsElfFile(const int fd, const string &path) {
+ if (fd < 0)
+ return false;
+ if (!ElfReaderImpl<ElfArch>::IsArchElfFile(fd, NULL)) {
+ // No error message here. IsElfFile gets called many times.
+ return false;
+ }
+ return true;
+}
+
+bool ElfReader::IsNativeElfFile() const {
+ return IsElfFile<NATIVE_ELF_ARCH>(fd_, path_);
+}
+
+bool ElfReader::IsElf32File() const {
+ return IsElfFile<Elf32>(fd_, path_);
+}
+
+bool ElfReader::IsElf64File() const {
+ return IsElfFile<Elf64>(fd_, path_);
+}
+
+/*
+void ElfReader::AddSymbols(SymbolMap *symbols,
+ uint64_t mem_offset, uint64_t file_offset,
+ uint64_t length) {
+ if (fd_ < 0)
+ return;
+ // TODO(chatham): Actually use the information about file offset and
+ // the length of the mapped section. On some machines the data
+ // section gets mapped as executable, and we'll end up reading the
+ // file twice and getting some of the offsets wrong.
+ if (IsElf32File()) {
+ GetImpl32()->GetSymbolPositions(symbols, SHT_SYMTAB,
+ mem_offset, file_offset);
+ GetImpl32()->GetSymbolPositions(symbols, SHT_DYNSYM,
+ mem_offset, file_offset);
+ } else if (IsElf64File()) {
+ GetImpl64()->GetSymbolPositions(symbols, SHT_SYMTAB,
+ mem_offset, file_offset);
+ GetImpl64()->GetSymbolPositions(symbols, SHT_DYNSYM,
+ mem_offset, file_offset);
+ }
+}
+*/
+
+void ElfReader::VisitSymbols(ElfReader::SymbolSink *sink) {
+ VisitSymbols(sink, -1, -1);
+}
+
+void ElfReader::VisitSymbols(ElfReader::SymbolSink *sink,
+ int symbol_binding,
+ int symbol_type) {
+ VisitSymbols(sink, symbol_binding, symbol_type, false);
+}
+
+void ElfReader::VisitSymbols(ElfReader::SymbolSink *sink,
+ int symbol_binding,
+ int symbol_type,
+ bool get_raw_symbol_values) {
+ if (IsElf32File()) {
+ GetImpl32()->VisitRelocationEntries();
+ GetImpl32()->VisitSymbols(SHT_SYMTAB, sink, symbol_binding, symbol_type,
+ get_raw_symbol_values);
+ GetImpl32()->VisitSymbols(SHT_DYNSYM, sink, symbol_binding, symbol_type,
+ get_raw_symbol_values);
+ } else if (IsElf64File()) {
+ GetImpl64()->VisitRelocationEntries();
+ GetImpl64()->VisitSymbols(SHT_SYMTAB, sink, symbol_binding, symbol_type,
+ get_raw_symbol_values);
+ GetImpl64()->VisitSymbols(SHT_DYNSYM, sink, symbol_binding, symbol_type,
+ get_raw_symbol_values);
+ }
+}
+
+uint64_t ElfReader::VaddrOfFirstLoadSegment() {
+ if (IsElf32File()) {
+ return GetImpl32()->VaddrOfFirstLoadSegment();
+ } else if (IsElf64File()) {
+ return GetImpl64()->VaddrOfFirstLoadSegment();
+ } else {
+ return 0;
+ }
+}
+
+const char *ElfReader::GetSectionName(int shndx) {
+ if (shndx < 0 || static_cast<unsigned int>(shndx) >= GetNumSections()) return NULL;
+ if (IsElf32File()) {
+ return GetImpl32()->GetSectionNameByIndex(shndx);
+ } else if (IsElf64File()) {
+ return GetImpl64()->GetSectionNameByIndex(shndx);
+ } else {
+ return NULL;
+ }
+}
+
+uint64_t ElfReader::GetNumSections() {
+ if (IsElf32File()) {
+ return GetImpl32()->GetNumSections();
+ } else if (IsElf64File()) {
+ return GetImpl64()->GetNumSections();
+ } else {
+ return 0;
+ }
+}
+
+const char *ElfReader::GetSectionByIndex(int shndx, size_t *size) {
+ if (IsElf32File()) {
+ return GetImpl32()->GetSectionContentsByIndex(shndx, size);
+ } else if (IsElf64File()) {
+ return GetImpl64()->GetSectionContentsByIndex(shndx, size);
+ } else {
+ return NULL;
+ }
+}
+
+const char *ElfReader::GetSectionByName(const string &section_name,
+ size_t *size) {
+ if (IsElf32File()) {
+ return GetImpl32()->GetSectionContentsByName(section_name, size);
+ } else if (IsElf64File()) {
+ return GetImpl64()->GetSectionContentsByName(section_name, size);
+ } else {
+ return NULL;
+ }
+}
+
+const char *ElfReader::GetSectionInfoByName(const string &section_name,
+ SectionInfo *info) {
+ if (IsElf32File()) {
+ return GetImpl32()->GetSectionInfoByName(section_name, info);
+ } else if (IsElf64File()) {
+ return GetImpl64()->GetSectionInfoByName(section_name, info);
+ } else {
+ return NULL;
+ }
+}
+
+bool ElfReader::SectionNamesMatch(const string &name, const string &sh_name) {
+ if ((name.find(".debug_", 0) == 0) && (sh_name.find(".zdebug_", 0) == 0)) {
+ const string name_suffix(name, strlen(".debug_"));
+ const string sh_name_suffix(sh_name, strlen(".zdebug_"));
+ return name_suffix == sh_name_suffix;
+ }
+ return name == sh_name;
+}
+
+bool ElfReader::IsDynamicSharedObject() {
+ if (IsElf32File()) {
+ return GetImpl32()->IsDynamicSharedObject();
+ } else if (IsElf64File()) {
+ return GetImpl64()->IsDynamicSharedObject();
+ } else {
+ return false;
+ }
+}
+
+ElfReaderImpl<Elf32> *ElfReader::GetImpl32() {
+ if (impl32_ == NULL) {
+ impl32_ = new ElfReaderImpl<Elf32>(path_, fd_);
+ }
+ return impl32_;
+}
+
+ElfReaderImpl<Elf64> *ElfReader::GetImpl64() {
+ if (impl64_ == NULL) {
+ impl64_ = new ElfReaderImpl<Elf64>(path_, fd_);
+ }
+ return impl64_;
+}
+
+// Return true if file is an ELF binary of ElfArch, with unstripped
+// debug info (debug_only=true) or symbol table (debug_only=false).
+// Otherwise, return false.
+template <typename ElfArch>
+static bool IsNonStrippedELFBinaryImpl(const string &path, const int fd,
+ bool debug_only) {
+ if (!ElfReaderImpl<ElfArch>::IsArchElfFile(fd, NULL)) return false;
+ ElfReaderImpl<ElfArch> elf_reader(path, fd);
+ return debug_only ?
+ elf_reader.HasDebugSections()
+ : (elf_reader.GetSectionByType(SHT_SYMTAB) != NULL);
+}
+
+// Helper for the IsNon[Debug]StrippedELFBinary functions.
+static bool IsNonStrippedELFBinaryHelper(const string &path,
+ bool debug_only) {
+ const int fd = open(path.c_str(), O_RDONLY);
+ if (fd == -1) {
+ return false;
+ }
+
+ if (IsNonStrippedELFBinaryImpl<Elf32>(path, fd, debug_only) ||
+ IsNonStrippedELFBinaryImpl<Elf64>(path, fd, debug_only)) {
+ close(fd);
+ return true;
+ }
+ close(fd);
+ return false;
+}
+
+bool ElfReader::IsNonStrippedELFBinary(const string &path) {
+ return IsNonStrippedELFBinaryHelper(path, false);
+}
+
+bool ElfReader::IsNonDebugStrippedELFBinary(const string &path) {
+ return IsNonStrippedELFBinaryHelper(path, true);
+}
+} // namespace dwarf2reader
diff --git a/src/common/dwarf/elf_reader.h b/src/common/dwarf/elf_reader.h
new file mode 100644
index 00000000..8eaa5aa9
--- /dev/null
+++ b/src/common/dwarf/elf_reader.h
@@ -0,0 +1,167 @@
+// Copyright 2005 Google Inc. All Rights Reserved.
+// Author: chatham@google.com (Andrew Chatham)
+// Author: satorux@google.com (Satoru Takabayashi)
+//
+// ElfReader handles reading in ELF. It can extract symbols from the
+// current process, which may be used to symbolize stack traces
+// without having to make a potentially dangerous call to fork().
+//
+// ElfReader dynamically allocates memory, so it is not appropriate to
+// use once the address space might be corrupted, such as during
+// process death.
+//
+// ElfReader supports both 32-bit and 64-bit ELF binaries.
+
+#ifndef COMMON_DWARF_ELF_READER_H__
+#define COMMON_DWARF_ELF_READER_H__
+
+#include <string>
+#include <vector>
+
+#include "common/dwarf/types.h"
+#include "common/using_std_string.h"
+
+using std::vector;
+using std::pair;
+
+namespace dwarf2reader {
+
+class SymbolMap;
+class Elf32;
+class Elf64;
+template<typename ElfArch>
+class ElfReaderImpl;
+
+class ElfReader {
+ public:
+ explicit ElfReader(const string &path);
+ ~ElfReader();
+
+ // Parse the ELF prologue of this file and return whether it was
+ // successfully parsed and matches the word size and byte order of
+ // the current process.
+ bool IsNativeElfFile() const;
+
+ // Similar to IsNativeElfFile but checks if it's a 32-bit ELF file.
+ bool IsElf32File() const;
+
+ // Similar to IsNativeElfFile but checks if it's a 64-bit ELF file.
+ bool IsElf64File() const;
+
+ // Checks if it's an ELF file of type ET_DYN (shared object file).
+ bool IsDynamicSharedObject();
+
+ // Add symbols in the given ELF file into the provided SymbolMap,
+ // assuming that the file has been loaded into the specified
+ // offset.
+ //
+ // The remaining arguments are typically taken from a
+ // ProcMapsIterator (base/sysinfo.h) and describe which portions of
+ // the ELF file are mapped into which parts of memory:
+ //
+ // mem_offset - position at which the segment is mapped into memory
+ // file_offset - offset in the file where the mapping begins
+ // length - length of the mapped segment
+ void AddSymbols(SymbolMap *symbols,
+ uint64_t mem_offset, uint64_t file_offset,
+ uint64_t length);
+
+ class SymbolSink {
+ public:
+ virtual ~SymbolSink() {}
+ virtual void AddSymbol(const char *name, uint64_t address,
+ uint64_t size) = 0;
+ };
+
+ // Like AddSymbols above, but with no address correction.
+ // Processes any SHT_SYMTAB section, followed by any SHT_DYNSYM section.
+ void VisitSymbols(SymbolSink *sink);
+
+ // Like VisitSymbols above, but for a specific symbol binding/type.
+ // A negative value for the binding and type parameters means any
+ // binding or type.
+ void VisitSymbols(SymbolSink *sink, int symbol_binding, int symbol_type);
+
+ // Like VisitSymbols above but can optionally export raw symbol values instead
+ // of adjusted ones.
+ void VisitSymbols(SymbolSink *sink, int symbol_binding, int symbol_type,
+ bool get_raw_symbol_values);
+
+ // p_vaddr of the first PT_LOAD segment (if any), or 0 if no PT_LOAD
+ // segments are present. This is the address an ELF image was linked
+ // (by static linker) to be loaded at. Usually (but not always) 0 for
+ // shared libraries and position-independent executables.
+ uint64_t VaddrOfFirstLoadSegment();
+
+ // Return the name of section "shndx". Returns NULL if the section
+ // is not found.
+ const char *GetSectionName(int shndx);
+
+ // Return the number of sections in the given ELF file.
+ uint64_t GetNumSections();
+
+ // Get section "shndx" from the given ELF file. On success, return
+ // the pointer to the section and store the size in "size".
+ // On error, return NULL. The returned section data is only valid
+ // until the ElfReader gets destroyed.
+ const char *GetSectionByIndex(int shndx, size_t *size);
+
+ // Get section with "section_name" (ex. ".text", ".symtab") in the
+ // given ELF file. On success, return the pointer to the section
+ // and store the size in "size". On error, return NULL. The
+ // returned section data is only valid until the ElfReader gets
+ // destroyed.
+ const char *GetSectionByName(const string &section_name, size_t *size);
+
+ // This is like GetSectionByName() but it returns a lot of extra information
+ // about the section. The SectionInfo structure is almost identical to
+ // the typedef struct Elf64_Shdr defined in <elf.h>, but is redefined
+ // here so that the many short macro names in <elf.h> don't have to be
+ // added to our already cluttered namespace.
+ struct SectionInfo {
+ uint32_t type; // Section type (SHT_xxx constant from elf.h).
+ uint64_t flags; // Section flags (SHF_xxx constants from elf.h).
+ uint64_t addr; // Section virtual address at execution.
+ uint64_t offset; // Section file offset.
+ uint64_t size; // Section size in bytes.
+ uint32_t link; // Link to another section.
+ uint32_t info; // Additional section information.
+ uint64_t addralign; // Section alignment.
+ uint64_t entsize; // Entry size if section holds a table.
+ };
+ const char *GetSectionInfoByName(const string &section_name,
+ SectionInfo *info);
+
+ // Check if "path" is an ELF binary that has not been stripped of symbol
+ // tables. This function supports both 32-bit and 64-bit ELF binaries.
+ static bool IsNonStrippedELFBinary(const string &path);
+
+ // Check if "path" is an ELF binary that has not been stripped of debug
+ // info. Unlike IsNonStrippedELFBinary, this function will return
+ // false for binaries passed through "strip -S".
+ static bool IsNonDebugStrippedELFBinary(const string &path);
+
+ // Match a requested section name with the section name as it
+ // appears in the elf-file, adjusting for compressed debug section
+ // names. For example, returns true if name == ".debug_abbrev" and
+ // sh_name == ".zdebug_abbrev"
+ static bool SectionNamesMatch(const string &name, const string &sh_name);
+
+ private:
+ // Lazily initialize impl32_ and return it.
+ ElfReaderImpl<Elf32> *GetImpl32();
+ // Ditto for impl64_.
+ ElfReaderImpl<Elf64> *GetImpl64();
+
+ // Path of the file we're reading.
+ const string path_;
+ // Read-only file descriptor for the file. May be -1 if there was an
+ // error during open.
+ int fd_;
+ ElfReaderImpl<Elf32> *impl32_;
+ ElfReaderImpl<Elf64> *impl64_;
+};
+
+} // namespace dwarf2reader
+
+#endif // COMMON_DWARF_ELF_READER_H__
diff --git a/src/common/dwarf/functioninfo.cc b/src/common/dwarf/functioninfo.cc
index 55a255ed..358a6eef 100644
--- a/src/common/dwarf/functioninfo.cc
+++ b/src/common/dwarf/functioninfo.cc
@@ -62,15 +62,15 @@ CULineInfoHandler::CULineInfoHandler(std::vector<SourceFileInfo>* files,
files->push_back(s);
}
-void CULineInfoHandler::DefineDir(const string& name, uint32 dir_num) {
+void CULineInfoHandler::DefineDir(const string& name, uint32_t dir_num) {
// These should never come out of order, actually
assert(dir_num == dirs_->size());
dirs_->push_back(name);
}
void CULineInfoHandler::DefineFile(const string& name,
- int32 file_num, uint32 dir_num,
- uint64 mod_time, uint64 length) {
+ int32 file_num, uint32_t dir_num,
+ uint64_t mod_time, uint64_t length) {
assert(dir_num >= 0);
assert(dir_num < dirs_->size());
@@ -93,8 +93,9 @@ void CULineInfoHandler::DefineFile(const string& name,
}
}
-void CULineInfoHandler::AddLine(uint64 address, uint64 length, uint32 file_num,
- uint32 line_num, uint32 column_num) {
+void CULineInfoHandler::AddLine(uint64_t address, uint64_t length,
+ uint32_t file_num, uint32_t line_num,
+ uint32_t column_num) {
if (file_num < files_->size()) {
linemap_->insert(
std::make_pair(address,
@@ -109,11 +110,11 @@ void CULineInfoHandler::AddLine(uint64 address, uint64 length, uint32 file_num,
}
}
-bool CUFunctionInfoHandler::StartCompilationUnit(uint64 offset,
- uint8 address_size,
- uint8 offset_size,
- uint64 cu_length,
- uint8 dwarf_version) {
+bool CUFunctionInfoHandler::StartCompilationUnit(uint64_t offset,
+ uint8_t address_size,
+ uint8_t offset_size,
+ uint64_t cu_length,
+ uint8_t dwarf_version) {
current_compilation_unit_offset_ = offset;
return true;
}
@@ -123,7 +124,7 @@ bool CUFunctionInfoHandler::StartCompilationUnit(uint64 offset,
// subroutines. For line info, the DW_AT_stmt_list lives in the
// compile unit tag.
-bool CUFunctionInfoHandler::StartDIE(uint64 offset, enum DwarfTag tag) {
+bool CUFunctionInfoHandler::StartDIE(uint64_t offset, enum DwarfTag tag) {
switch (tag) {
case DW_TAG_subprogram:
case DW_TAG_inlined_subroutine: {
@@ -146,7 +147,7 @@ bool CUFunctionInfoHandler::StartDIE(uint64 offset, enum DwarfTag tag) {
// Only care about the name attribute for functions
-void CUFunctionInfoHandler::ProcessAttributeString(uint64 offset,
+void CUFunctionInfoHandler::ProcessAttributeString(uint64_t offset,
enum DwarfAttribute attr,
enum DwarfForm form,
const string &data) {
@@ -158,10 +159,10 @@ void CUFunctionInfoHandler::ProcessAttributeString(uint64 offset,
}
}
-void CUFunctionInfoHandler::ProcessAttributeUnsigned(uint64 offset,
+void CUFunctionInfoHandler::ProcessAttributeUnsigned(uint64_t offset,
enum DwarfAttribute attr,
enum DwarfForm form,
- uint64 data) {
+ uint64_t data) {
if (attr == DW_AT_stmt_list) {
SectionMap::const_iterator iter = sections_.find("__debug_line");
assert(iter != sections_.end());
@@ -184,16 +185,19 @@ void CUFunctionInfoHandler::ProcessAttributeUnsigned(uint64 offset,
case DW_AT_decl_file:
current_function_info_->file = files_->at(data).name;
break;
+ case DW_AT_ranges:
+ current_function_info_->ranges = data;
+ break;
default:
break;
}
}
}
-void CUFunctionInfoHandler::ProcessAttributeReference(uint64 offset,
+void CUFunctionInfoHandler::ProcessAttributeReference(uint64_t offset,
enum DwarfAttribute attr,
enum DwarfForm form,
- uint64 data) {
+ uint64_t data) {
if (current_function_info_) {
switch (attr) {
case DW_AT_specification: {
@@ -222,7 +226,7 @@ void CUFunctionInfoHandler::ProcessAttributeReference(uint64 offset,
}
}
-void CUFunctionInfoHandler::EndDIE(uint64 offset) {
+void CUFunctionInfoHandler::EndDIE(uint64_t offset) {
if (current_function_info_ && current_function_info_->lowpc)
address_to_funcinfo_->insert(std::make_pair(current_function_info_->lowpc,
current_function_info_));
diff --git a/src/common/dwarf/functioninfo.h b/src/common/dwarf/functioninfo.h
index 0b08a5fc..5c733c6d 100644
--- a/src/common/dwarf/functioninfo.h
+++ b/src/common/dwarf/functioninfo.h
@@ -53,18 +53,20 @@ struct FunctionInfo {
// File containing this function
string file;
// Line number for start of function.
- uint32 line;
+ uint32_t line;
// Beginning address for this function
- uint64 lowpc;
+ uint64_t lowpc;
// End address for this function.
- uint64 highpc;
+ uint64_t highpc;
+ // Ranges offset
+ uint64_t ranges;
};
struct SourceFileInfo {
// Name of the source file name
string name;
// Low address of source file name
- uint64 lowpc;
+ uint64_t lowpc;
};
typedef std::map<uint64, FunctionInfo*> FunctionMap;
@@ -84,12 +86,12 @@ class CULineInfoHandler: public LineInfoHandler {
// Called when we define a directory. We just place NAME into dirs_
// at position DIR_NUM.
- virtual void DefineDir(const string& name, uint32 dir_num);
+ virtual void DefineDir(const string& name, uint32_t dir_num);
// Called when we define a filename. We just place
// concat(dirs_[DIR_NUM], NAME) into files_ at position FILE_NUM.
virtual void DefineFile(const string& name, int32 file_num,
- uint32 dir_num, uint64 mod_time, uint64 length);
+ uint32_t dir_num, uint64_t mod_time, uint64_t length);
// Called when the line info reader has a new line, address pair
@@ -98,8 +100,9 @@ class CULineInfoHandler: public LineInfoHandler {
// containing the code, LINE_NUM is the line number in that file for
// the code, and COLUMN_NUM is the column number the code starts at,
// if we know it (0 otherwise).
- virtual void AddLine(uint64 address, uint64 length,
- uint32 file_num, uint32 line_num, uint32 column_num);
+ virtual void AddLine(uint64_t address, uint64_t length,
+ uint32_t file_num, uint32_t line_num,
+ uint32_t column_num);
private:
LineMap* linemap_;
@@ -129,38 +132,38 @@ class CUFunctionInfoHandler: public Dwarf2Handler {
// .debug_info section. We want to see all compilation units, so we
// always return true.
- virtual bool StartCompilationUnit(uint64 offset, uint8 address_size,
- uint8 offset_size, uint64 cu_length,
- uint8 dwarf_version);
+ virtual bool StartCompilationUnit(uint64_t offset, uint8_t address_size,
+ uint8_t offset_size, uint64_t cu_length,
+ uint8_t dwarf_version);
// Start to process a DIE at OFFSET from the beginning of the
// .debug_info section. We only care about function related DIE's.
- virtual bool StartDIE(uint64 offset, enum DwarfTag tag);
+ virtual bool StartDIE(uint64_t offset, enum DwarfTag tag);
// Called when we have an attribute with unsigned data to give to
// our handler. The attribute is for the DIE at OFFSET from the
// beginning of the .debug_info section, has a name of ATTR, a form of
// FORM, and the actual data of the attribute is in DATA.
- virtual void ProcessAttributeUnsigned(uint64 offset,
+ virtual void ProcessAttributeUnsigned(uint64_t offset,
enum DwarfAttribute attr,
enum DwarfForm form,
- uint64 data);
+ uint64_t data);
// Called when we have an attribute with a DIE reference to give to
// our handler. The attribute is for the DIE at OFFSET from the
// beginning of the .debug_info section, has a name of ATTR, a form of
// FORM, and the offset of the referenced DIE from the start of the
// .debug_info section is in DATA.
- virtual void ProcessAttributeReference(uint64 offset,
+ virtual void ProcessAttributeReference(uint64_t offset,
enum DwarfAttribute attr,
enum DwarfForm form,
- uint64 data);
+ uint64_t data);
// Called when we have an attribute with string data to give to
// our handler. The attribute is for the DIE at OFFSET from the
// beginning of the .debug_info section, has a name of ATTR, a form of
// FORM, and the actual data of the attribute is in DATA.
- virtual void ProcessAttributeString(uint64 offset,
+ virtual void ProcessAttributeString(uint64_t offset,
enum DwarfAttribute attr,
enum DwarfForm form,
const string& data);
@@ -169,7 +172,7 @@ class CUFunctionInfoHandler: public Dwarf2Handler {
// Because DWARF2/3 specifies a tree of DIEs, you may get starts
// before ends of the previous DIE, as we process children before
// ending the parent.
- virtual void EndDIE(uint64 offset);
+ virtual void EndDIE(uint64_t offset);
private:
std::vector<SourceFileInfo>* files_;
@@ -181,7 +184,7 @@ class CUFunctionInfoHandler: public Dwarf2Handler {
const SectionMap& sections_;
ByteReader* reader_;
FunctionInfo* current_function_info_;
- uint64 current_compilation_unit_offset_;
+ uint64_t current_compilation_unit_offset_;
};
} // namespace dwarf2reader
diff --git a/src/common/dwarf/line_state_machine.h b/src/common/dwarf/line_state_machine.h
index 0ff72abc..fc301c76 100644
--- a/src/common/dwarf/line_state_machine.h
+++ b/src/common/dwarf/line_state_machine.h
@@ -46,10 +46,10 @@ struct LineStateMachine {
end_sequence = false;
}
- uint32 file_num;
- uint64 address;
- uint32 line_num;
- uint32 column_num;
+ uint32_t file_num;
+ uint64_t address;
+ uint32_t line_num;
+ uint32_t column_num;
bool is_stmt; // stmt means statement.
bool basic_block;
bool end_sequence;
diff --git a/src/common/dwarf/types.h b/src/common/dwarf/types.h
index 61ca4579..23412d0e 100644
--- a/src/common/dwarf/types.h
+++ b/src/common/dwarf/types.h
@@ -35,21 +35,7 @@
#include <stdint.h>
-typedef signed char int8;
-typedef short int16;
-typedef int int32;
-typedef long long int64;
-
-typedef unsigned char uint8;
-typedef unsigned short uint16;
-typedef unsigned int uint32;
-typedef unsigned long long uint64;
-
-#ifdef __PTRDIFF_TYPE__
-typedef __PTRDIFF_TYPE__ intptr;
-typedef unsigned __PTRDIFF_TYPE__ uintptr;
-#else
-#error "Can't find pointer-sized integral types."
-#endif
+typedef intptr_t intptr;
+typedef uintptr_t uintptr;
#endif // _COMMON_DWARF_TYPES_H__
diff --git a/src/common/dwarf_cfi_to_module.cc b/src/common/dwarf_cfi_to_module.cc
index 1bf1d96d..3dd85edd 100644
--- a/src/common/dwarf_cfi_to_module.cc
+++ b/src/common/dwarf_cfi_to_module.cc
@@ -142,8 +142,8 @@ vector<string> DwarfCFIToModule::RegisterNames::MIPS() {
sizeof(kRegisterNames) / sizeof(kRegisterNames[0]));
}
-bool DwarfCFIToModule::Entry(size_t offset, uint64 address, uint64 length,
- uint8 version, const string &augmentation,
+bool DwarfCFIToModule::Entry(size_t offset, uint64_t address, uint64_t length,
+ uint8_t version, const string &augmentation,
unsigned return_address) {
assert(!entry_);
@@ -195,7 +195,7 @@ void DwarfCFIToModule::Record(Module::Address address, int reg,
// Place the name in our global set of strings, and then use the string
// from the set. Even though the assignment looks like a copy, all the
- // major std::string implementations use reference counting internally,
+ // major string implementations use reference counting internally,
// so the effect is to have all our data structures share copies of rules
// whenever possible. Since register names are drawn from a
// vector<string>, register names are already shared.
@@ -209,20 +209,20 @@ void DwarfCFIToModule::Record(Module::Address address, int reg,
entry_->rule_changes[address][RegisterName(reg)] = shared_rule;
}
-bool DwarfCFIToModule::UndefinedRule(uint64 address, int reg) {
+bool DwarfCFIToModule::UndefinedRule(uint64_t address, int reg) {
reporter_->UndefinedNotSupported(entry_offset_, RegisterName(reg));
// Treat this as a non-fatal error.
return true;
}
-bool DwarfCFIToModule::SameValueRule(uint64 address, int reg) {
+bool DwarfCFIToModule::SameValueRule(uint64_t address, int reg) {
ostringstream s;
s << RegisterName(reg);
Record(address, reg, s.str());
return true;
}
-bool DwarfCFIToModule::OffsetRule(uint64 address, int reg,
+bool DwarfCFIToModule::OffsetRule(uint64_t address, int reg,
int base_register, long offset) {
ostringstream s;
s << RegisterName(base_register) << " " << offset << " + ^";
@@ -230,7 +230,7 @@ bool DwarfCFIToModule::OffsetRule(uint64 address, int reg,
return true;
}
-bool DwarfCFIToModule::ValOffsetRule(uint64 address, int reg,
+bool DwarfCFIToModule::ValOffsetRule(uint64_t address, int reg,
int base_register, long offset) {
ostringstream s;
s << RegisterName(base_register) << " " << offset << " +";
@@ -238,7 +238,7 @@ bool DwarfCFIToModule::ValOffsetRule(uint64 address, int reg,
return true;
}
-bool DwarfCFIToModule::RegisterRule(uint64 address, int reg,
+bool DwarfCFIToModule::RegisterRule(uint64_t address, int reg,
int base_register) {
ostringstream s;
s << RegisterName(base_register);
@@ -246,14 +246,14 @@ bool DwarfCFIToModule::RegisterRule(uint64 address, int reg,
return true;
}
-bool DwarfCFIToModule::ExpressionRule(uint64 address, int reg,
+bool DwarfCFIToModule::ExpressionRule(uint64_t address, int reg,
const string &expression) {
reporter_->ExpressionsNotSupported(entry_offset_, RegisterName(reg));
// Treat this as a non-fatal error.
return true;
}
-bool DwarfCFIToModule::ValExpressionRule(uint64 address, int reg,
+bool DwarfCFIToModule::ValExpressionRule(uint64_t address, int reg,
const string &expression) {
reporter_->ExpressionsNotSupported(entry_offset_, RegisterName(reg));
// Treat this as a non-fatal error.
diff --git a/src/common/dwarf_cfi_to_module.h b/src/common/dwarf_cfi_to_module.h
index 084b8f5a..4d2db7ee 100644
--- a/src/common/dwarf_cfi_to_module.h
+++ b/src/common/dwarf_cfi_to_module.h
@@ -137,19 +137,19 @@ class DwarfCFIToModule: public CallFrameInfo::Handler {
}
virtual ~DwarfCFIToModule() { delete entry_; }
- virtual bool Entry(size_t offset, uint64 address, uint64 length,
- uint8 version, const string &augmentation,
+ virtual bool Entry(size_t offset, uint64_t address, uint64_t length,
+ uint8_t version, const string &augmentation,
unsigned return_address);
- virtual bool UndefinedRule(uint64 address, int reg);
- virtual bool SameValueRule(uint64 address, int reg);
- virtual bool OffsetRule(uint64 address, int reg,
+ virtual bool UndefinedRule(uint64_t address, int reg);
+ virtual bool SameValueRule(uint64_t address, int reg);
+ virtual bool OffsetRule(uint64_t address, int reg,
int base_register, long offset);
- virtual bool ValOffsetRule(uint64 address, int reg,
+ virtual bool ValOffsetRule(uint64_t address, int reg,
int base_register, long offset);
- virtual bool RegisterRule(uint64 address, int reg, int base_register);
- virtual bool ExpressionRule(uint64 address, int reg,
+ virtual bool RegisterRule(uint64_t address, int reg, int base_register);
+ virtual bool ExpressionRule(uint64_t address, int reg,
const string &expression);
- virtual bool ValExpressionRule(uint64 address, int reg,
+ virtual bool ValExpressionRule(uint64_t address, int reg,
const string &expression);
virtual bool End();
@@ -181,7 +181,7 @@ class DwarfCFIToModule: public CallFrameInfo::Handler {
// The names of the return address and canonical frame address. Putting
// these here instead of using string literals allows us to share their
- // texts in reference-counted std::string implementations (all the
+ // texts in reference-counted string implementations (all the
// popular ones). Many, many rules cite these strings.
string cfa_name_, ra_name_;
@@ -189,7 +189,7 @@ class DwarfCFIToModule: public CallFrameInfo::Handler {
// our data structures, insert it into this set, and then use the string
// from the set.
//
- // Because std::string uses reference counting internally, simply using
+ // Because string uses reference counting internally, simply using
// strings from this set, even if passed by value, assigned, or held
// directly in structures and containers (map<string, ...>, for example),
// causes those strings to share a single instance of each distinct piece
diff --git a/src/common/dwarf_cfi_to_module_unittest.cc b/src/common/dwarf_cfi_to_module_unittest.cc
index 807d1b20..60a9a3ee 100644
--- a/src/common/dwarf_cfi_to_module_unittest.cc
+++ b/src/common/dwarf_cfi_to_module_unittest.cc
@@ -125,7 +125,7 @@ struct RuleFixture: public DwarfCFIToModuleFixture {
EXPECT_EQ(entry_address, entries[0]->address);
EXPECT_EQ(entry_size, entries[0]->size);
}
- uint64 entry_address, entry_size;
+ uint64_t entry_address, entry_size;
unsigned return_reg;
};
diff --git a/src/common/dwarf_cu_to_module.cc b/src/common/dwarf_cu_to_module.cc
index 1729d4ac..ad873059 100644
--- a/src/common/dwarf_cu_to_module.cc
+++ b/src/common/dwarf_cu_to_module.cc
@@ -39,20 +39,21 @@
#include "common/dwarf_cu_to_module.h"
#include <assert.h>
-#if !defined(__ANDROID__)
-#include <cxxabi.h>
-#endif
#include <inttypes.h>
+#include <stdint.h>
#include <stdio.h>
#include <algorithm>
+#include <numeric>
#include <utility>
#include "common/dwarf_line_to_module.h"
#include "common/unordered.h"
+#include "google_breakpad/common/breakpad_types.h"
namespace google_breakpad {
+using std::accumulate;
using std::map;
using std::pair;
using std::sort;
@@ -95,7 +96,7 @@ struct AbstractOrigin {
string name;
};
-typedef map<uint64, AbstractOrigin> AbstractOriginByOffset;
+typedef map<uint64_t, AbstractOrigin> AbstractOriginByOffset;
// Data global to the DWARF-bearing file that is private to the
// DWARF-to-Module process.
@@ -140,7 +141,7 @@ DwarfCUToModule::FileContext::~FileContext() {
}
void DwarfCUToModule::FileContext::AddSectionToSectionMap(
- const string& name, const char* contents, uint64 length) {
+ const string& name, const uint8_t *contents, uint64_t length) {
section_map_[name] = std::make_pair(contents, length);
}
@@ -159,7 +160,7 @@ void DwarfCUToModule::FileContext::ClearSpecifications() {
}
bool DwarfCUToModule::FileContext::IsUnhandledInterCUReference(
- uint64 offset, uint64 compilation_unit_start) const {
+ uint64_t offset, uint64_t compilation_unit_start) const {
if (handle_inter_cu_refs_)
return false;
return offset < compilation_unit_start;
@@ -169,10 +170,15 @@ bool DwarfCUToModule::FileContext::IsUnhandledInterCUReference(
// parsing. This is for data shared across the CU's entire DIE tree,
// and parameters from the code invoking the CU parser.
struct DwarfCUToModule::CUContext {
- CUContext(FileContext *file_context_arg, WarningReporter *reporter_arg)
+ CUContext(FileContext *file_context_arg, WarningReporter *reporter_arg,
+ RangesHandler *ranges_handler_arg)
: file_context(file_context_arg),
reporter(reporter_arg),
- language(Language::CPlusPlus) {}
+ ranges_handler(ranges_handler_arg),
+ language(Language::CPlusPlus),
+ low_pc(0),
+ high_pc(0),
+ ranges(0) {}
~CUContext() {
for (vector<Module::Function *>::iterator it = functions.begin();
@@ -187,15 +193,29 @@ struct DwarfCUToModule::CUContext {
// For printing error messages.
WarningReporter *reporter;
+ // For reading ranges from the .debug_ranges section
+ RangesHandler *ranges_handler;
+
// The source language of this compilation unit.
const Language *language;
+ // Addresses covered by this CU. If high_pc_ is non-zero then the CU covers
+ // low_pc to high_pc, otherwise ranges is non-zero and low_pc represents
+ // the base address of the ranges covered by the CU.
+ uint64_t low_pc;
+ uint64_t high_pc;
+ uint64_t ranges;
+
// The functions defined in this compilation unit. We accumulate
// them here during parsing. Then, in DwarfCUToModule::Finish, we
// assign them lines and add them to file_context->module.
//
// Destroying this destroys all the functions this vector points to.
vector<Module::Function *> functions;
+
+ // Keep a list of forward references from DW_AT_abstract_origin and
+ // DW_AT_specification attributes so names can be fixed up.
+ std::map<uint64_t, Module::Function *> forward_ref_die_to_func;
};
// Information about the context of a particular DIE. This is for
@@ -222,24 +242,25 @@ class DwarfCUToModule::GenericDIEHandler: public dwarf2reader::DIEHandler {
// described by CU_CONTEXT, and whose immediate context is described
// by PARENT_CONTEXT.
GenericDIEHandler(CUContext *cu_context, DIEContext *parent_context,
- uint64 offset)
+ uint64_t offset)
: cu_context_(cu_context),
parent_context_(parent_context),
offset_(offset),
declaration_(false),
- specification_(NULL) { }
+ specification_(NULL),
+ forward_ref_die_offset_(0) { }
// Derived classes' ProcessAttributeUnsigned can defer to this to
// handle DW_AT_declaration, or simply not override it.
void ProcessAttributeUnsigned(enum DwarfAttribute attr,
enum DwarfForm form,
- uint64 data);
+ uint64_t data);
// Derived classes' ProcessAttributeReference can defer to this to
// handle DW_AT_specification, or simply not override it.
void ProcessAttributeReference(enum DwarfAttribute attr,
enum DwarfForm form,
- uint64 data);
+ uint64_t data);
// Derived classes' ProcessAttributeReference can defer to this to
// handle DW_AT_specification, or simply not override it.
@@ -260,10 +281,10 @@ class DwarfCUToModule::GenericDIEHandler: public dwarf2reader::DIEHandler {
CUContext *cu_context_;
DIEContext *parent_context_;
- uint64 offset_;
+ uint64_t offset_;
// Place the name in the global set of strings. Even though this looks
- // like a copy, all the major std::string implementations use reference
+ // like a copy, all the major string implementations use reference
// counting internally, so the effect is to have all the data structures
// share copies of strings whenever possible.
// FIXME: Should this return something like a string_ref to avoid the
@@ -279,6 +300,11 @@ class DwarfCUToModule::GenericDIEHandler: public dwarf2reader::DIEHandler {
// Otherwise, this is NULL.
Specification *specification_;
+ // If this DIE has a DW_AT_specification or DW_AT_abstract_origin and it is a
+ // forward reference, no Specification will be available. Track the reference
+ // to be fixed up when the DIE is parsed.
+ uint64_t forward_ref_die_offset_;
+
// The value of the DW_AT_name attribute, or the empty string if the
// DIE has no such attribute.
string name_attribute_;
@@ -287,12 +313,16 @@ class DwarfCUToModule::GenericDIEHandler: public dwarf2reader::DIEHandler {
// string if the DIE has no such attribute or its content could not be
// demangled.
string demangled_name_;
+
+ // The non-demangled value of the DW_AT_MIPS_linkage_name attribute,
+ // it its content count not be demangled.
+ string raw_name_;
};
void DwarfCUToModule::GenericDIEHandler::ProcessAttributeUnsigned(
enum DwarfAttribute attr,
enum DwarfForm form,
- uint64 data) {
+ uint64_t data) {
switch (attr) {
case dwarf2reader::DW_AT_declaration: declaration_ = (data != 0); break;
default: break;
@@ -302,7 +332,7 @@ void DwarfCUToModule::GenericDIEHandler::ProcessAttributeUnsigned(
void DwarfCUToModule::GenericDIEHandler::ProcessAttributeReference(
enum DwarfAttribute attr,
enum DwarfForm form,
- uint64 data) {
+ uint64_t data) {
switch (attr) {
case dwarf2reader::DW_AT_specification: {
FileContext *file_context = cu_context_->file_context;
@@ -321,12 +351,9 @@ void DwarfCUToModule::GenericDIEHandler::ProcessAttributeReference(
SpecificationByOffset::iterator spec = specifications->find(data);
if (spec != specifications->end()) {
specification_ = &spec->second;
+ } else if (data > offset_) {
+ forward_ref_die_offset_ = data;
} else {
- // Technically, there's no reason a DW_AT_specification
- // couldn't be a forward reference, but supporting that would
- // be a lot of work (changing to a two-pass structure), and I
- // don't think any producers we care about ever emit such
- // things.
cu_context_->reporter->UnknownSpecification(offset_, data);
}
break;
@@ -349,20 +376,24 @@ void DwarfCUToModule::GenericDIEHandler::ProcessAttributeString(
case dwarf2reader::DW_AT_name:
name_attribute_ = AddStringToPool(data);
break;
- case dwarf2reader::DW_AT_MIPS_linkage_name: {
- char* demangled = NULL;
- int status = -1;
-#if !defined(__ANDROID__) // Android NDK doesn't provide abi::__cxa_demangle.
- demangled = abi::__cxa_demangle(data.c_str(), NULL, NULL, &status);
-#endif
- if (status != 0) {
- cu_context_->reporter->DemangleError(data, status);
- demangled_name_ = "";
- break;
- }
- if (demangled) {
- demangled_name_ = AddStringToPool(demangled);
- free(reinterpret_cast<void*>(demangled));
+ case dwarf2reader::DW_AT_MIPS_linkage_name:
+ case dwarf2reader::DW_AT_linkage_name: {
+ string demangled;
+ Language::DemangleResult result =
+ cu_context_->language->DemangleName(data, &demangled);
+ switch (result) {
+ case Language::kDemangleSuccess:
+ demangled_name_ = AddStringToPool(demangled);
+ break;
+
+ case Language::kDemangleFailure:
+ cu_context_->reporter->DemangleError(data);
+ // fallthrough
+ [[fallthrough]];
+ case Language::kDontDemangle:
+ demangled_name_.clear();
+ raw_name_ = AddStringToPool(data);
+ break;
}
break;
}
@@ -383,17 +414,19 @@ string DwarfCUToModule::GenericDIEHandler::ComputeQualifiedName() {
qualified_name = &specification_->qualified_name;
}
- const string *unqualified_name;
+ const string *unqualified_name = NULL;
const string *enclosing_name;
if (!qualified_name) {
- // Find our unqualified name. If the DIE has its own DW_AT_name
- // attribute, then use that; otherwise, check our specification.
- if (name_attribute_.empty() && specification_)
- unqualified_name = &specification_->unqualified_name;
- else
+ // Find the unqualified name. If the DIE has its own DW_AT_name
+ // attribute, then use that; otherwise, check the specification.
+ if (!name_attribute_.empty())
unqualified_name = &name_attribute_;
+ else if (specification_)
+ unqualified_name = &specification_->unqualified_name;
+ else if (!raw_name_.empty())
+ unqualified_name = &raw_name_;
- // Find the name of our enclosing context. If we have a
+ // Find the name of the enclosing context. If this DIE has a
// specification, it's the specification's enclosing context that
// counts; otherwise, use this DIE's context.
if (specification_)
@@ -407,7 +440,7 @@ string DwarfCUToModule::GenericDIEHandler::ComputeQualifiedName() {
string return_value;
if (qualified_name) {
return_value = *qualified_name;
- } else {
+ } else if (unqualified_name && enclosing_name) {
// Combine the enclosing name and unqualified name to produce our
// own fully-qualified name.
return_value = cu_context_->language->MakeQualifiedName(*enclosing_name,
@@ -416,7 +449,8 @@ string DwarfCUToModule::GenericDIEHandler::ComputeQualifiedName() {
// If this DIE was marked as a declaration, record its names in the
// specification table.
- if (declaration_) {
+ if ((declaration_ && qualified_name) ||
+ (unqualified_name && enclosing_name)) {
Specification spec;
if (qualified_name) {
spec.qualified_name = *qualified_name;
@@ -434,19 +468,19 @@ string DwarfCUToModule::GenericDIEHandler::ComputeQualifiedName() {
class DwarfCUToModule::FuncHandler: public GenericDIEHandler {
public:
FuncHandler(CUContext *cu_context, DIEContext *parent_context,
- uint64 offset)
+ uint64_t offset)
: GenericDIEHandler(cu_context, parent_context, offset),
low_pc_(0), high_pc_(0), high_pc_form_(dwarf2reader::DW_FORM_addr),
- abstract_origin_(NULL), inline_(false) { }
+ ranges_(0), abstract_origin_(NULL), inline_(false) { }
void ProcessAttributeUnsigned(enum DwarfAttribute attr,
enum DwarfForm form,
- uint64 data);
+ uint64_t data);
void ProcessAttributeSigned(enum DwarfAttribute attr,
enum DwarfForm form,
- int64 data);
+ int64_t data);
void ProcessAttributeReference(enum DwarfAttribute attr,
enum DwarfForm form,
- uint64 data);
+ uint64_t data);
bool EndAttributes();
void Finish();
@@ -455,8 +489,9 @@ class DwarfCUToModule::FuncHandler: public GenericDIEHandler {
// The fully-qualified name, as derived from name_attribute_,
// specification_, parent_context_. Computed in EndAttributes.
string name_;
- uint64 low_pc_, high_pc_; // DW_AT_low_pc, DW_AT_high_pc
+ uint64_t low_pc_, high_pc_; // DW_AT_low_pc, DW_AT_high_pc
DwarfForm high_pc_form_; // DW_AT_high_pc can be length or address.
+ uint64_t ranges_; // DW_AT_ranges
const AbstractOrigin* abstract_origin_;
bool inline_;
};
@@ -464,7 +499,7 @@ class DwarfCUToModule::FuncHandler: public GenericDIEHandler {
void DwarfCUToModule::FuncHandler::ProcessAttributeUnsigned(
enum DwarfAttribute attr,
enum DwarfForm form,
- uint64 data) {
+ uint64_t data) {
switch (attr) {
// If this attribute is present at all --- even if its value is
// DW_INL_not_inlined --- then GCC may cite it as someone else's
@@ -476,6 +511,9 @@ void DwarfCUToModule::FuncHandler::ProcessAttributeUnsigned(
high_pc_form_ = form;
high_pc_ = data;
break;
+ case dwarf2reader::DW_AT_ranges:
+ ranges_ = data;
+ break;
default:
GenericDIEHandler::ProcessAttributeUnsigned(attr, form, data);
@@ -486,7 +524,7 @@ void DwarfCUToModule::FuncHandler::ProcessAttributeUnsigned(
void DwarfCUToModule::FuncHandler::ProcessAttributeSigned(
enum DwarfAttribute attr,
enum DwarfForm form,
- int64 data) {
+ int64_t data) {
switch (attr) {
// If this attribute is present at all --- even if its value is
// DW_INL_not_inlined --- then GCC may cite it as someone else's
@@ -501,7 +539,7 @@ void DwarfCUToModule::FuncHandler::ProcessAttributeSigned(
void DwarfCUToModule::FuncHandler::ProcessAttributeReference(
enum DwarfAttribute attr,
enum DwarfForm form,
- uint64 data) {
+ uint64_t data) {
switch (attr) {
case dwarf2reader::DW_AT_abstract_origin: {
const AbstractOriginByOffset& origins =
@@ -509,6 +547,8 @@ void DwarfCUToModule::FuncHandler::ProcessAttributeReference(
AbstractOriginByOffset::const_iterator origin = origins.find(data);
if (origin != origins.end()) {
abstract_origin_ = &(origin->second);
+ } else if (data > offset_) {
+ forward_ref_die_offset_ = data;
} else {
cu_context_->reporter->UnknownAbstractOrigin(offset_, data);
}
@@ -529,37 +569,91 @@ bool DwarfCUToModule::FuncHandler::EndAttributes() {
return true;
}
+static bool IsEmptyRange(const vector<Module::Range>& ranges) {
+ uint64_t size = accumulate(ranges.cbegin(), ranges.cend(), 0,
+ [](uint64_t total, Module::Range entry) {
+ return total + entry.size;
+ }
+ );
+
+ return size == 0;
+}
+
void DwarfCUToModule::FuncHandler::Finish() {
- // Make high_pc_ an address, if it isn't already.
- if (high_pc_form_ != dwarf2reader::DW_FORM_addr) {
- high_pc_ += low_pc_;
+ vector<Module::Range> ranges;
+
+ // Check if this DIE was one of the forward references that was not able
+ // to be processed, and fix up the name of the appropriate Module::Function.
+ // "name_" will have already been fixed up in EndAttributes().
+ if (!name_.empty()) {
+ auto iter = cu_context_->forward_ref_die_to_func.find(offset_);
+ if (iter != cu_context_->forward_ref_die_to_func.end())
+ iter->second->name = name_;
+ }
+
+ if (!ranges_) {
+ // Make high_pc_ an address, if it isn't already.
+ if (high_pc_form_ != dwarf2reader::DW_FORM_addr &&
+ high_pc_form_ != dwarf2reader::DW_FORM_GNU_addr_index) {
+ high_pc_ += low_pc_;
+ }
+
+ Module::Range range(low_pc_, high_pc_ - low_pc_);
+ ranges.push_back(range);
+ } else {
+ RangesHandler *ranges_handler = cu_context_->ranges_handler;
+
+ if (ranges_handler) {
+ if (!ranges_handler->ReadRanges(ranges_, cu_context_->low_pc, &ranges)) {
+ ranges.clear();
+ cu_context_->reporter->MalformedRangeList(ranges_);
+ }
+ } else {
+ cu_context_->reporter->MissingRanges();
+ }
}
// Did we collect the information we need? Not all DWARF function
- // entries have low and high addresses (for example, inlined
- // functions that were never used), but all the ones we're
- // interested in cover a non-empty range of bytes.
- if (low_pc_ < high_pc_) {
+ // entries are non-empty (for example, inlined functions that were never
+ // used), but all the ones we're interested in cover a non-empty range of
+ // bytes.
+ if (!IsEmptyRange(ranges)) {
+ low_pc_ = ranges.front().address;
+
// Malformed DWARF may omit the name, but all Module::Functions must
// have names.
string name;
if (!name_.empty()) {
name = name_;
} else {
- cu_context_->reporter->UnnamedFunction(offset_);
+ // If we have a forward reference to a DW_AT_specification or
+ // DW_AT_abstract_origin, then don't warn, the name will be fixed up
+ // later
+ if (forward_ref_die_offset_ == 0)
+ cu_context_->reporter->UnnamedFunction(offset_);
name = "<name omitted>";
}
// Create a Module::Function based on the data we've gathered, and
// add it to the functions_ list.
scoped_ptr<Module::Function> func(new Module::Function(name, low_pc_));
- func->size = high_pc_ - low_pc_;
+ func->ranges = ranges;
func->parameter_size = 0;
if (func->address) {
- // If the function address is zero this is a sign that this function
- // description is just empty debug data and should just be discarded.
- cu_context_->functions.push_back(func.release());
- }
+ // If the function address is zero this is a sign that this function
+ // description is just empty debug data and should just be discarded.
+ cu_context_->functions.push_back(func.release());
+ if (forward_ref_die_offset_ != 0) {
+ auto iter =
+ cu_context_->forward_ref_die_to_func.find(forward_ref_die_offset_);
+ if (iter == cu_context_->forward_ref_die_to_func.end()) {
+ cu_context_->reporter->UnknownSpecification(offset_,
+ forward_ref_die_offset_);
+ } else {
+ iter->second = cu_context_->functions.back();
+ }
+ }
+ }
} else if (inline_) {
AbstractOrigin origin(name_);
cu_context_->file_context->file_private_->origins[offset_] = origin;
@@ -571,10 +665,10 @@ void DwarfCUToModule::FuncHandler::Finish() {
class DwarfCUToModule::NamedScopeHandler: public GenericDIEHandler {
public:
NamedScopeHandler(CUContext *cu_context, DIEContext *parent_context,
- uint64 offset)
+ uint64_t offset)
: GenericDIEHandler(cu_context, parent_context, offset) { }
bool EndAttributes();
- DIEHandler *FindChildHandler(uint64 offset, enum DwarfTag tag);
+ DIEHandler *FindChildHandler(uint64_t offset, enum DwarfTag tag);
private:
DIEContext child_context_; // A context for our children.
@@ -586,7 +680,7 @@ bool DwarfCUToModule::NamedScopeHandler::EndAttributes() {
}
dwarf2reader::DIEHandler *DwarfCUToModule::NamedScopeHandler::FindChildHandler(
- uint64 offset,
+ uint64_t offset,
enum DwarfTag tag) {
switch (tag) {
case dwarf2reader::DW_TAG_subprogram:
@@ -604,26 +698,26 @@ dwarf2reader::DIEHandler *DwarfCUToModule::NamedScopeHandler::FindChildHandler(
void DwarfCUToModule::WarningReporter::CUHeading() {
if (printed_cu_header_)
return;
- fprintf(stderr, "%s: in compilation unit '%s' (offset 0x%llx):\n",
+ fprintf(stderr, "%s: in compilation unit '%s' (offset 0x%" PRIx64 "):\n",
filename_.c_str(), cu_name_.c_str(), cu_offset_);
printed_cu_header_ = true;
}
-void DwarfCUToModule::WarningReporter::UnknownSpecification(uint64 offset,
- uint64 target) {
+void DwarfCUToModule::WarningReporter::UnknownSpecification(uint64_t offset,
+ uint64_t target) {
CUHeading();
- fprintf(stderr, "%s: the DIE at offset 0x%llx has a DW_AT_specification"
- " attribute referring to the die at offset 0x%llx, which either"
- " was not marked as a declaration, or comes later in the file\n",
+ fprintf(stderr, "%s: the DIE at offset 0x%" PRIx64 " has a "
+ "DW_AT_specification attribute referring to the DIE at offset 0x%"
+ PRIx64 ", which was not marked as a declaration\n",
filename_.c_str(), offset, target);
}
-void DwarfCUToModule::WarningReporter::UnknownAbstractOrigin(uint64 offset,
- uint64 target) {
+void DwarfCUToModule::WarningReporter::UnknownAbstractOrigin(uint64_t offset,
+ uint64_t target) {
CUHeading();
- fprintf(stderr, "%s: the DIE at offset 0x%llx has a DW_AT_abstract_origin"
- " attribute referring to the die at offset 0x%llx, which either"
- " was not marked as an inline, or comes later in the file\n",
+ fprintf(stderr, "%s: the DIE at offset 0x%" PRIx64 " has a "
+ "DW_AT_abstract_origin attribute referring to the DIE at offset 0x%"
+ PRIx64 ", which was not marked as an inline\n",
filename_.c_str(), offset, target);
}
@@ -633,7 +727,7 @@ void DwarfCUToModule::WarningReporter::MissingSection(const string &name) {
filename_.c_str(), name.c_str());
}
-void DwarfCUToModule::WarningReporter::BadLineInfoOffset(uint64 offset) {
+void DwarfCUToModule::WarningReporter::BadLineInfoOffset(uint64_t offset) {
CUHeading();
fprintf(stderr, "%s: warning: line number data offset beyond end"
" of '.debug_line' section\n",
@@ -655,7 +749,7 @@ void DwarfCUToModule::WarningReporter::UncoveredFunction(
return;
UncoveredHeading();
fprintf(stderr, " function%s: %s\n",
- function.size == 0 ? " (zero-length)" : "",
+ IsEmptyRange(function.ranges) ? " (zero-length)" : "",
function.name.c_str());
}
@@ -668,33 +762,46 @@ void DwarfCUToModule::WarningReporter::UncoveredLine(const Module::Line &line) {
line.file->name.c_str(), line.number, line.address);
}
-void DwarfCUToModule::WarningReporter::UnnamedFunction(uint64 offset) {
+void DwarfCUToModule::WarningReporter::UnnamedFunction(uint64_t offset) {
CUHeading();
- fprintf(stderr, "%s: warning: function at offset 0x%llx has no name\n",
+ fprintf(stderr, "%s: warning: function at offset 0x%" PRIx64 " has no name\n",
filename_.c_str(), offset);
}
-void DwarfCUToModule::WarningReporter::DemangleError(
- const string &input, int error) {
+void DwarfCUToModule::WarningReporter::DemangleError(const string &input) {
CUHeading();
- fprintf(stderr, "%s: warning: failed to demangle %s with error %d\n",
- filename_.c_str(), input.c_str(), error);
+ fprintf(stderr, "%s: warning: failed to demangle %s\n",
+ filename_.c_str(), input.c_str());
}
void DwarfCUToModule::WarningReporter::UnhandledInterCUReference(
- uint64 offset, uint64 target) {
+ uint64_t offset, uint64_t target) {
CUHeading();
- fprintf(stderr, "%s: warning: the DIE at offset 0x%llx has a "
+ fprintf(stderr, "%s: warning: the DIE at offset 0x%" PRIx64 " has a "
"DW_FORM_ref_addr attribute with an inter-CU reference to "
- "0x%llx, but inter-CU reference handling is turned off.\n",
- filename_.c_str(), offset, target);
+ "0x%" PRIx64 ", but inter-CU reference handling is turned "
+ " off.\n", filename_.c_str(), offset, target);
+}
+
+void DwarfCUToModule::WarningReporter::MalformedRangeList(uint64_t offset) {
+ CUHeading();
+ fprintf(stderr, "%s: warning: the range list at offset 0x%" PRIx64 " falls "
+ " out of the .debug_ranges section.\n",
+ filename_.c_str(), offset);
+}
+
+void DwarfCUToModule::WarningReporter::MissingRanges() {
+ CUHeading();
+ fprintf(stderr, "%s: warning: A DW_AT_ranges attribute was encountered but "
+ "the .debug_ranges section is missing.\n", filename_.c_str());
}
DwarfCUToModule::DwarfCUToModule(FileContext *file_context,
LineToModuleHandler *line_reader,
+ RangesHandler *ranges_handler,
WarningReporter *reporter)
: line_reader_(line_reader),
- cu_context_(new CUContext(file_context, reporter)),
+ cu_context_(new CUContext(file_context, reporter, ranges_handler)),
child_context_(new DIEContext()),
has_source_line_info_(false) {
}
@@ -704,7 +811,7 @@ DwarfCUToModule::~DwarfCUToModule() {
void DwarfCUToModule::ProcessAttributeSigned(enum DwarfAttribute attr,
enum DwarfForm form,
- int64 data) {
+ int64_t data) {
switch (attr) {
case dwarf2reader::DW_AT_language: // source language of this CU
SetLanguage(static_cast<DwarfLanguage>(data));
@@ -716,7 +823,7 @@ void DwarfCUToModule::ProcessAttributeSigned(enum DwarfAttribute attr,
void DwarfCUToModule::ProcessAttributeUnsigned(enum DwarfAttribute attr,
enum DwarfForm form,
- uint64 data) {
+ uint64_t data) {
switch (attr) {
case dwarf2reader::DW_AT_stmt_list: // Line number information.
has_source_line_info_ = true;
@@ -725,6 +832,16 @@ void DwarfCUToModule::ProcessAttributeUnsigned(enum DwarfAttribute attr,
case dwarf2reader::DW_AT_language: // source language of this CU
SetLanguage(static_cast<DwarfLanguage>(data));
break;
+ case dwarf2reader::DW_AT_low_pc:
+ cu_context_->low_pc = data;
+ break;
+ case dwarf2reader::DW_AT_high_pc:
+ cu_context_->high_pc = data;
+ break;
+ case dwarf2reader::DW_AT_ranges:
+ cu_context_->ranges = data;
+ break;
+
default:
break;
}
@@ -750,7 +867,7 @@ bool DwarfCUToModule::EndAttributes() {
}
dwarf2reader::DIEHandler *DwarfCUToModule::FindChildHandler(
- uint64 offset,
+ uint64_t offset,
enum DwarfTag tag) {
switch (tag) {
case dwarf2reader::DW_TAG_subprogram:
@@ -759,6 +876,7 @@ dwarf2reader::DIEHandler *DwarfCUToModule::FindChildHandler(
case dwarf2reader::DW_TAG_class_type:
case dwarf2reader::DW_TAG_structure_type:
case dwarf2reader::DW_TAG_union_type:
+ case dwarf2reader::DW_TAG_module:
return new NamedScopeHandler(cu_context_.get(), child_context_.get(),
offset);
default:
@@ -772,6 +890,14 @@ void DwarfCUToModule::SetLanguage(DwarfLanguage language) {
cu_context_->language = Language::Java;
break;
+ case dwarf2reader::DW_LANG_Swift:
+ cu_context_->language = Language::Swift;
+ break;
+
+ case dwarf2reader::DW_LANG_Rust:
+ cu_context_->language = Language::Rust;
+ break;
+
// DWARF has no generic language code for assembly language; this is
// what the GNU toolchain uses.
case dwarf2reader::DW_LANG_Mips_Assembler:
@@ -801,7 +927,7 @@ void DwarfCUToModule::SetLanguage(DwarfLanguage language) {
}
}
-void DwarfCUToModule::ReadSourceLines(uint64 offset) {
+void DwarfCUToModule::ReadSourceLines(uint64_t offset) {
const dwarf2reader::SectionMap &section_map
= cu_context_->file_context->section_map();
dwarf2reader::SectionMap::const_iterator map_entry
@@ -814,8 +940,8 @@ void DwarfCUToModule::ReadSourceLines(uint64 offset) {
cu_context_->reporter->MissingSection(".debug_line");
return;
}
- const char *section_start = map_entry->second.first;
- uint64 section_length = map_entry->second.second;
+ const uint8_t *section_start = map_entry->second.first;
+ uint64_t section_length = map_entry->second.second;
if (offset >= section_length) {
cu_context_->reporter->BadLineInfoOffset(offset);
return;
@@ -825,6 +951,49 @@ void DwarfCUToModule::ReadSourceLines(uint64 offset) {
}
namespace {
+class FunctionRange {
+ public:
+ FunctionRange(const Module::Range &range, Module::Function *function) :
+ address(range.address), size(range.size), function(function) { }
+
+ void AddLine(Module::Line &line) {
+ function->lines.push_back(line);
+ }
+
+ Module::Address address;
+ Module::Address size;
+ Module::Function *function;
+};
+
+// Fills an array of ranges with pointers to the functions which owns
+// them. The array is sorted in ascending order and the ranges are non
+// empty and non-overlapping.
+
+static void FillSortedFunctionRanges(vector<FunctionRange> &dest_ranges,
+ vector<Module::Function *> *functions) {
+ for (vector<Module::Function *>::const_iterator func_it = functions->cbegin();
+ func_it != functions->cend();
+ func_it++)
+ {
+ Module::Function *func = *func_it;
+ vector<Module::Range> &ranges = func->ranges;
+ for (vector<Module::Range>::const_iterator ranges_it = ranges.cbegin();
+ ranges_it != ranges.cend();
+ ++ranges_it) {
+ FunctionRange range(*ranges_it, func);
+ if (range.size != 0) {
+ dest_ranges.push_back(range);
+ }
+ }
+ }
+
+ sort(dest_ranges.begin(), dest_ranges.end(),
+ [](const FunctionRange &fr1, const FunctionRange &fr2) {
+ return fr1.address < fr2.address;
+ }
+ );
+}
+
// Return true if ADDRESS falls within the range of ITEM.
template <class T>
inline bool within(const T &item, Module::Address address) {
@@ -864,47 +1033,50 @@ void DwarfCUToModule::AssignLinesToFunctions() {
const Module::Function *last_function_cited = NULL;
const Module::Line *last_line_cited = NULL;
- // Make a single pass through both vectors from lower to higher
- // addresses, populating each Function's lines vector with lines
- // from our lines_ vector that fall within the function's address
- // range.
- vector<Module::Function *>::iterator func_it = functions->begin();
+ // Prepare a sorted list of ranges with range-to-function mapping
+ vector<FunctionRange> sorted_ranges;
+ FillSortedFunctionRanges(sorted_ranges, functions);
+
+ // Make a single pass through both the range and line vectors from lower to
+ // higher addresses, populating each range's function lines vector with lines
+ // from our lines_ vector that fall within the range.
+ vector<FunctionRange>::iterator range_it = sorted_ranges.begin();
vector<Module::Line>::const_iterator line_it = lines_.begin();
Module::Address current;
// Pointers to the referents of func_it and line_it, or NULL if the
// iterator is at the end of the sequence.
- Module::Function *func;
+ FunctionRange *range;
const Module::Line *line;
// Start current at the beginning of the first line or function,
// whichever is earlier.
- if (func_it != functions->end() && line_it != lines_.end()) {
- func = *func_it;
+ if (range_it != sorted_ranges.end() && line_it != lines_.end()) {
+ range = &*range_it;
line = &*line_it;
- current = std::min(func->address, line->address);
+ current = std::min(range->address, line->address);
} else if (line_it != lines_.end()) {
- func = NULL;
+ range = NULL;
line = &*line_it;
current = line->address;
- } else if (func_it != functions->end()) {
- func = *func_it;
+ } else if (range_it != sorted_ranges.end()) {
+ range = &*range_it;
line = NULL;
- current = (*func_it)->address;
+ current = range->address;
} else {
return;
}
- while (func || line) {
+ while (range || line) {
// This loop has two invariants that hold at the top.
//
// First, at least one of the iterators is not at the end of its
// sequence, and those that are not refer to the earliest
- // function or line that contains or starts after CURRENT.
+ // range or line that contains or starts after CURRENT.
//
// Note that every byte is in one of four states: it is covered
- // or not covered by a function, and, independently, it is
+ // or not covered by a range, and, independently, it is
// covered or not covered by a line.
//
// The second invariant is that CURRENT refers to a byte whose
@@ -914,7 +1086,7 @@ void DwarfCUToModule::AssignLinesToFunctions() {
//
// Note that, although each iteration advances CURRENT from one
// transition address to the next in each iteration, it might
- // not advance the iterators. Suppose we have a function that
+ // not advance the iterators. Suppose we have a range that
// starts with a line, has a gap, and then a second line, and
// suppose that we enter an iteration with CURRENT at the end of
// the first line. The next transition address is the start of
@@ -922,11 +1094,11 @@ void DwarfCUToModule::AssignLinesToFunctions() {
// advance CURRENT to that point. At the head of that iteration,
// the invariants require that the line iterator be pointing at
// the second line. But this is also true at the head of the
- // next. And clearly, the iteration must not change the function
+ // next. And clearly, the iteration must not change the range
// iterator. So neither iterator moves.
// Assert the first invariant (see above).
- assert(!func || current < func->address || within(*func, current));
+ assert(!range || current < range->address || within(*range, current));
assert(!line || current < line->address || within(*line, current));
// The next transition after CURRENT.
@@ -934,33 +1106,33 @@ void DwarfCUToModule::AssignLinesToFunctions() {
// Figure out which state we're in, add lines or warn, and compute
// the next transition address.
- if (func && current >= func->address) {
+ if (range && current >= range->address) {
if (line && current >= line->address) {
- // Covered by both a line and a function.
- Module::Address func_left = func->size - (current - func->address);
+ // Covered by both a line and a range.
+ Module::Address range_left = range->size - (current - range->address);
Module::Address line_left = line->size - (current - line->address);
// This may overflow, but things work out.
- next_transition = current + std::min(func_left, line_left);
+ next_transition = current + std::min(range_left, line_left);
Module::Line l = *line;
l.address = current;
l.size = next_transition - current;
- func->lines.push_back(l);
+ range->AddLine(l);
last_line_used = line;
} else {
- // Covered by a function, but no line.
- if (func != last_function_cited) {
- reporter->UncoveredFunction(*func);
- last_function_cited = func;
+ // Covered by a range, but no line.
+ if (range->function != last_function_cited) {
+ reporter->UncoveredFunction(*(range->function));
+ last_function_cited = range->function;
}
- if (line && within(*func, line->address))
+ if (line && within(*range, line->address))
next_transition = line->address;
else
// If this overflows, we'll catch it below.
- next_transition = func->address + func->size;
+ next_transition = range->address + range->size;
}
} else {
if (line && current >= line->address) {
- // Covered by a line, but no function.
+ // Covered by a line, but no range.
//
// If GCC emits padding after one function to align the start
// of the next, then it will attribute the padding
@@ -972,27 +1144,27 @@ void DwarfCUToModule::AssignLinesToFunctions() {
// start of the next function, then assume this is what
// happened, and don't warn.
if (line != last_line_cited
- && !(func
+ && !(range
&& line == last_line_used
- && func->address - line->address == line->size)) {
+ && range->address - line->address == line->size)) {
reporter->UncoveredLine(*line);
last_line_cited = line;
}
- if (func && within(*line, func->address))
- next_transition = func->address;
+ if (range && within(*line, range->address))
+ next_transition = range->address;
else
// If this overflows, we'll catch it below.
next_transition = line->address + line->size;
} else {
- // Covered by neither a function nor a line. By the invariant,
- // both func and line begin after CURRENT. The next transition
- // is the start of the next function or next line, whichever
+ // Covered by neither a range nor a line. By the invariant,
+ // both range and line begin after CURRENT. The next transition
+ // is the start of the next range or next line, whichever
// is earliest.
- assert(func || line);
- if (func && line)
- next_transition = std::min(func->address, line->address);
- else if (func)
- next_transition = func->address;
+ assert(range || line);
+ if (range && line)
+ next_transition = std::min(range->address, line->address);
+ else if (range)
+ next_transition = range->address;
else
next_transition = line->address;
}
@@ -1009,11 +1181,11 @@ void DwarfCUToModule::AssignLinesToFunctions() {
// then we could go around more than once. We don't worry too much
// about what result we produce in that case, just as long as we don't
// hang or crash.
- while (func_it != functions->end()
- && next_transition >= (*func_it)->address
- && !within(**func_it, next_transition))
- func_it++;
- func = (func_it != functions->end()) ? *func_it : NULL;
+ while (range_it != sorted_ranges.end()
+ && next_transition >= range_it->address
+ && !within(*range_it, next_transition))
+ range_it++;
+ range = (range_it != sorted_ranges.end()) ? &(*range_it) : NULL;
while (line_it != lines_.end()
&& next_transition >= line_it->address
&& !within(*line_it, next_transition))
@@ -1056,15 +1228,15 @@ void DwarfCUToModule::Finish() {
cu_context_->file_context->ClearSpecifications();
}
-bool DwarfCUToModule::StartCompilationUnit(uint64 offset,
- uint8 address_size,
- uint8 offset_size,
- uint64 cu_length,
- uint8 dwarf_version) {
+bool DwarfCUToModule::StartCompilationUnit(uint64_t offset,
+ uint8_t address_size,
+ uint8_t offset_size,
+ uint64_t cu_length,
+ uint8_t dwarf_version) {
return dwarf_version >= 2;
}
-bool DwarfCUToModule::StartRootDIE(uint64 offset, enum DwarfTag tag) {
+bool DwarfCUToModule::StartRootDIE(uint64_t offset, enum DwarfTag tag) {
// We don't deal with partial compilation units (the only other tag
// likely to be used for root DIE).
return tag == dwarf2reader::DW_TAG_compile_unit;
diff --git a/src/common/dwarf_cu_to_module.h b/src/common/dwarf_cu_to_module.h
index fd9c380d..2153bd96 100644
--- a/src/common/dwarf_cu_to_module.h
+++ b/src/common/dwarf_cu_to_module.h
@@ -39,6 +39,8 @@
#ifndef COMMON_LINUX_DWARF_CU_TO_MODULE_H__
#define COMMON_LINUX_DWARF_CU_TO_MODULE_H__
+#include <stdint.h>
+
#include <string>
#include "common/language.h"
@@ -84,8 +86,8 @@ class DwarfCUToModule: public dwarf2reader::RootDIEHandler {
// Add CONTENTS of size LENGTH to the section map as NAME.
void AddSectionToSectionMap(const string& name,
- const char* contents,
- uint64 length);
+ const uint8_t *contents,
+ uint64_t length);
// Clear the section map for testing.
void ClearSectionMapForTest();
@@ -101,8 +103,8 @@ class DwarfCUToModule: public dwarf2reader::RootDIEHandler {
// Given an OFFSET and a CU that starts at COMPILATION_UNIT_START, returns
// true if this is an inter-compilation unit reference that is not being
// handled.
- bool IsUnhandledInterCUReference(uint64 offset,
- uint64 compilation_unit_start) const;
+ bool IsUnhandledInterCUReference(uint64_t offset,
+ uint64_t compilation_unit_start) const;
// The name of this file, for use in error messages.
const string filename_;
@@ -121,6 +123,22 @@ class DwarfCUToModule: public dwarf2reader::RootDIEHandler {
scoped_ptr<FilePrivate> file_private_;
};
+ // An abstract base class for handlers that handle DWARF range lists for
+ // DwarfCUToModule.
+ class RangesHandler {
+ public:
+ RangesHandler() { }
+ virtual ~RangesHandler() { }
+
+ // Called when finishing a function to populate the function's ranges.
+ // The ranges' entries are read starting from offset in the .debug_ranges
+ // section, base_address holds the base PC the range list values are
+ // offsets off. Return false if the rangelist falls out of the
+ // .debug_ranges section.
+ virtual bool ReadRanges(uint64_t offset, Module::Address base_address,
+ vector<Module::Range>* ranges) = 0;
+ };
+
// An abstract base class for handlers that handle DWARF line data
// for DwarfCUToModule. DwarfCUToModule could certainly just use
// dwarf2reader::LineInfo itself directly, but decoupling things
@@ -140,7 +158,7 @@ class DwarfCUToModule: public dwarf2reader::RootDIEHandler {
// mappings, given a pointer to some DWARF line number data
// PROGRAM, and an overestimate of its size. Add no zero-length
// lines to LINES.
- virtual void ReadProgram(const char *program, uint64 length,
+ virtual void ReadProgram(const uint8_t *program, uint64_t length,
Module *module, vector<Module::Line> *lines) = 0;
};
@@ -152,7 +170,7 @@ class DwarfCUToModule: public dwarf2reader::RootDIEHandler {
public:
// Warn about problems in the DWARF file FILENAME, in the
// compilation unit at OFFSET.
- WarningReporter(const string &filename, uint64 cu_offset)
+ WarningReporter(const string &filename, uint64_t cu_offset)
: filename_(filename), cu_offset_(cu_offset), printed_cu_header_(false),
printed_unpaired_header_(false),
uncovered_warnings_enabled_(false) { }
@@ -175,17 +193,17 @@ class DwarfCUToModule: public dwarf2reader::RootDIEHandler {
// A DW_AT_specification in the DIE at OFFSET refers to a DIE we
// haven't processed yet, or that wasn't marked as a declaration,
// at TARGET.
- virtual void UnknownSpecification(uint64 offset, uint64 target);
+ virtual void UnknownSpecification(uint64_t offset, uint64_t target);
// A DW_AT_abstract_origin in the DIE at OFFSET refers to a DIE we
// haven't processed yet, or that wasn't marked as inline, at TARGET.
- virtual void UnknownAbstractOrigin(uint64 offset, uint64 target);
+ virtual void UnknownAbstractOrigin(uint64_t offset, uint64_t target);
// We were unable to find the DWARF section named SECTION_NAME.
virtual void MissingSection(const string &section_name);
// The CU's DW_AT_stmt_list offset OFFSET is bogus.
- virtual void BadLineInfoOffset(uint64 offset);
+ virtual void BadLineInfoOffset(uint64_t offset);
// FUNCTION includes code covered by no line number data.
virtual void UncoveredFunction(const Module::Function &function);
@@ -197,22 +215,30 @@ class DwarfCUToModule: public dwarf2reader::RootDIEHandler {
// The DW_TAG_subprogram DIE at OFFSET has no name specified directly
// in the DIE, nor via a DW_AT_specification or DW_AT_abstract_origin
// link.
- virtual void UnnamedFunction(uint64 offset);
+ virtual void UnnamedFunction(uint64_t offset);
// __cxa_demangle() failed to demangle INPUT.
- virtual void DemangleError(const string &input, int error);
+ virtual void DemangleError(const string &input);
// The DW_FORM_ref_addr at OFFSET to TARGET was not handled because
// FilePrivate did not retain the inter-CU specification data.
- virtual void UnhandledInterCUReference(uint64 offset, uint64 target);
+ virtual void UnhandledInterCUReference(uint64_t offset, uint64_t target);
+
+ // The DW_AT_ranges at offset is malformed (truncated or outside of the
+ // .debug_ranges section's bound).
+ virtual void MalformedRangeList(uint64_t offset);
+
+ // A DW_AT_ranges attribute was encountered but the no .debug_ranges
+ // section was found.
+ virtual void MissingRanges();
- uint64 cu_offset() const {
+ uint64_t cu_offset() const {
return cu_offset_;
}
protected:
const string filename_;
- const uint64 cu_offset_;
+ const uint64_t cu_offset_;
string cu_name_;
bool printed_cu_header_;
bool printed_unpaired_header_;
@@ -233,29 +259,30 @@ class DwarfCUToModule: public dwarf2reader::RootDIEHandler {
// data we find.
DwarfCUToModule(FileContext *file_context,
LineToModuleHandler *line_reader,
+ RangesHandler *ranges_handler,
WarningReporter *reporter);
~DwarfCUToModule();
void ProcessAttributeSigned(enum DwarfAttribute attr,
enum DwarfForm form,
- int64 data);
+ int64_t data);
void ProcessAttributeUnsigned(enum DwarfAttribute attr,
enum DwarfForm form,
- uint64 data);
+ uint64_t data);
void ProcessAttributeString(enum DwarfAttribute attr,
enum DwarfForm form,
const string &data);
bool EndAttributes();
- DIEHandler *FindChildHandler(uint64 offset, enum DwarfTag tag);
+ DIEHandler *FindChildHandler(uint64_t offset, enum DwarfTag tag);
// Assign all our source Lines to the Functions that cover their
// addresses, and then add them to module_.
void Finish();
- bool StartCompilationUnit(uint64 offset, uint8 address_size,
- uint8 offset_size, uint64 cu_length,
- uint8 dwarf_version);
- bool StartRootDIE(uint64 offset, enum DwarfTag tag);
+ bool StartCompilationUnit(uint64_t offset, uint8_t address_size,
+ uint8_t offset_size, uint64_t cu_length,
+ uint8_t dwarf_version);
+ bool StartRootDIE(uint64_t offset, enum DwarfTag tag);
private:
// Used internally by the handler. Full definitions are in
@@ -268,7 +295,7 @@ class DwarfCUToModule: public dwarf2reader::RootDIEHandler {
class NamedScopeHandler;
// A map from section offsets to specifications.
- typedef map<uint64, Specification> SpecificationByOffset;
+ typedef map<uint64_t, Specification> SpecificationByOffset;
// Set this compilation unit's source language to LANGUAGE.
void SetLanguage(DwarfLanguage language);
@@ -277,7 +304,7 @@ class DwarfCUToModule: public dwarf2reader::RootDIEHandler {
// section. Record source files in module_, but record source lines
// in lines_; we apportion them to functions in
// AssignLinesToFunctions.
- void ReadSourceLines(uint64 offset);
+ void ReadSourceLines(uint64_t offset);
// Assign the lines in lines_ to the individual line lists of the
// functions in functions_. (DWARF line information maps an entire
@@ -305,7 +332,7 @@ class DwarfCUToModule: public dwarf2reader::RootDIEHandler {
// The offset of this compilation unit's line number information in
// the .debug_line section.
- uint64 source_line_offset_;
+ uint64_t source_line_offset_;
// The line numbers we have seen thus far. We accumulate these here
// during parsing. Then, in Finish, we call AssignLinesToFunctions
diff --git a/src/common/dwarf_cu_to_module_unittest.cc b/src/common/dwarf_cu_to_module_unittest.cc
index 9ff842c8..ed1d7c9b 100644
--- a/src/common/dwarf_cu_to_module_unittest.cc
+++ b/src/common/dwarf_cu_to_module_unittest.cc
@@ -31,6 +31,8 @@
// dwarf_cu_to_module.cc: Unit tests for google_breakpad::DwarfCUToModule.
+#include <stdint.h>
+
#include <string>
#include <utility>
#include <vector>
@@ -65,24 +67,24 @@ using ::testing::ValuesIn;
class MockLineToModuleHandler: public DwarfCUToModule::LineToModuleHandler {
public:
MOCK_METHOD1(StartCompilationUnit, void(const string& compilation_dir));
- MOCK_METHOD4(ReadProgram, void(const char* program, uint64 length,
+ MOCK_METHOD4(ReadProgram, void(const uint8_t *program, uint64_t length,
Module *module, vector<Module::Line> *lines));
};
class MockWarningReporter: public DwarfCUToModule::WarningReporter {
public:
- MockWarningReporter(const string &filename, uint64 cu_offset)
+ MockWarningReporter(const string &filename, uint64_t cu_offset)
: DwarfCUToModule::WarningReporter(filename, cu_offset) { }
MOCK_METHOD1(SetCUName, void(const string &name));
- MOCK_METHOD2(UnknownSpecification, void(uint64 offset, uint64 target));
- MOCK_METHOD2(UnknownAbstractOrigin, void(uint64 offset, uint64 target));
+ MOCK_METHOD2(UnknownSpecification, void(uint64_t offset, uint64_t target));
+ MOCK_METHOD2(UnknownAbstractOrigin, void(uint64_t offset, uint64_t target));
MOCK_METHOD1(MissingSection, void(const string &section_name));
- MOCK_METHOD1(BadLineInfoOffset, void(uint64 offset));
+ MOCK_METHOD1(BadLineInfoOffset, void(uint64_t offset));
MOCK_METHOD1(UncoveredFunction, void(const Module::Function &function));
MOCK_METHOD1(UncoveredLine, void(const Module::Line &line));
- MOCK_METHOD1(UnnamedFunction, void(uint64 offset));
- MOCK_METHOD2(DemangleError, void(const string &input, int error));
- MOCK_METHOD2(UnhandledInterCUReference, void(uint64 offset, uint64 target));
+ MOCK_METHOD1(UnnamedFunction, void(uint64_t offset));
+ MOCK_METHOD1(DemangleError, void(const string &input));
+ MOCK_METHOD2(UnhandledInterCUReference, void(uint64_t offset, uint64_t target));
};
// A fixture class including all the objects needed to handle a
@@ -111,7 +113,7 @@ class CUFixtureBase {
public:
explicit AppendLinesFunctor(
const vector<Module::Line> *lines) : lines_(lines) { }
- void operator()(const char *program, uint64 length,
+ void operator()(const uint8_t *program, uint64_t length,
Module *module, vector<Module::Line> *lines) {
lines->insert(lines->end(), lines_->begin(), lines_->end());
}
@@ -126,7 +128,8 @@ class CUFixtureBase {
language_signed_(false),
appender_(&lines_),
reporter_("dwarf-filename", 0xcf8f9bb6443d29b5LL),
- root_handler_(&file_context_, &line_reader_, &reporter_),
+ root_handler_(&file_context_, &line_reader_,
+ /* ranges_reader */ nullptr, &reporter_),
functions_filled_(false) {
// By default, expect no warnings to be reported, and expect the
// compilation unit's name to be provided. The test can override
@@ -193,7 +196,7 @@ class CUFixtureBase {
// not Finish. If NAME is non-zero, use it as the DW_AT_name
// attribute.
DIEHandler *StartSpecifiedDIE(DIEHandler *parent, DwarfTag tag,
- uint64 specification, const char *name = NULL);
+ uint64_t specification, const char *name = NULL);
// Define a function as a child of PARENT with the given name, address, and
// size. If high_pc_form is DW_FORM_addr then the DW_AT_high_pc attribute
@@ -208,7 +211,7 @@ class CUFixtureBase {
// Create a declaration DIE as a child of PARENT with the given
// offset, tag and name. If NAME is the empty string, don't provide
// a DW_AT_name attribute. Call EndAttributes and Finish.
- void DeclarationDIE(DIEHandler *parent, uint64 offset,
+ void DeclarationDIE(DIEHandler *parent, uint64_t offset,
DwarfTag tag, const string &name,
const string &mangled_name);
@@ -218,15 +221,15 @@ class CUFixtureBase {
// attribute. If SIZE is non-zero, record ADDRESS and SIZE as
// low_pc/high_pc attributes.
void DefinitionDIE(DIEHandler *parent, DwarfTag tag,
- uint64 specification, const string &name,
+ uint64_t specification, const string &name,
Module::Address address = 0, Module::Address size = 0);
// Create an inline DW_TAG_subprogram DIE as a child of PARENT. If
// SPECIFICATION is non-zero, then the DIE refers to the declaration DIE at
// offset SPECIFICATION as its specification. If Name is non-empty, pass it
// as the DW_AT_name attribute.
- void AbstractInstanceDIE(DIEHandler *parent, uint64 offset,
- DwarfInline type, uint64 specification,
+ void AbstractInstanceDIE(DIEHandler *parent, uint64_t offset,
+ DwarfInline type, uint64_t specification,
const string &name,
DwarfForm form = dwarf2reader::DW_FORM_data1);
@@ -234,7 +237,7 @@ class CUFixtureBase {
// ORIGIN in its DW_AT_abstract_origin attribute. If NAME is the empty
// string, don't provide a DW_AT_name attribute.
void DefineInlineInstanceDIE(DIEHandler *parent, const string &name,
- uint64 origin, Module::Address address,
+ uint64_t origin, Module::Address address,
Module::Address size);
// The following Test* functions should be called after calling
@@ -285,7 +288,7 @@ class CUFixtureBase {
// Mock line program reader.
MockLineToModuleHandler line_reader_;
AppendLinesFunctor appender_;
- static const char dummy_line_program_[];
+ static const uint8_t dummy_line_program_[];
static const size_t dummy_line_size_;
MockWarningReporter reporter_;
@@ -302,7 +305,7 @@ class CUFixtureBase {
bool functions_filled_;
};
-const char CUFixtureBase::dummy_line_program_[] = "lots of fun data";
+const uint8_t CUFixtureBase::dummy_line_program_[] = "lots of fun data";
const size_t CUFixtureBase::dummy_line_size_ =
sizeof(CUFixtureBase::dummy_line_program_);
@@ -375,7 +378,7 @@ void CUFixtureBase::ProcessStrangeAttributes(
handler->ProcessAttributeReference((DwarfAttribute) 0xf7f7480f,
(DwarfForm) 0x829e038a,
0x50fddef44734fdecULL);
- static const char buffer[10] = "frobynode";
+ static const uint8_t buffer[10] = "frobynode";
handler->ProcessAttributeBuffer((DwarfAttribute) 0xa55ffb51,
(DwarfForm) 0x2f43b041,
buffer, sizeof(buffer));
@@ -406,7 +409,7 @@ DIEHandler *CUFixtureBase::StartNamedDIE(DIEHandler *parent,
DIEHandler *CUFixtureBase::StartSpecifiedDIE(DIEHandler *parent,
DwarfTag tag,
- uint64 specification,
+ uint64_t specification,
const char *name) {
dwarf2reader::DIEHandler *handler
= parent->FindChildHandler(0x8f4c783c0467c989ULL, tag);
@@ -463,7 +466,7 @@ void CUFixtureBase::DefineFunction(dwarf2reader::DIEHandler *parent,
delete func;
}
-void CUFixtureBase::DeclarationDIE(DIEHandler *parent, uint64 offset,
+void CUFixtureBase::DeclarationDIE(DIEHandler *parent, uint64_t offset,
DwarfTag tag,
const string &name,
const string &mangled_name) {
@@ -488,7 +491,7 @@ void CUFixtureBase::DeclarationDIE(DIEHandler *parent, uint64 offset,
void CUFixtureBase::DefinitionDIE(DIEHandler *parent,
DwarfTag tag,
- uint64 specification,
+ uint64_t specification,
const string &name,
Module::Address address,
Module::Address size) {
@@ -516,9 +519,9 @@ void CUFixtureBase::DefinitionDIE(DIEHandler *parent,
}
void CUFixtureBase::AbstractInstanceDIE(DIEHandler *parent,
- uint64 offset,
+ uint64_t offset,
DwarfInline type,
- uint64 specification,
+ uint64_t specification,
const string &name,
DwarfForm form) {
dwarf2reader::DIEHandler *die
@@ -545,7 +548,7 @@ void CUFixtureBase::AbstractInstanceDIE(DIEHandler *parent,
void CUFixtureBase::DefineInlineInstanceDIE(DIEHandler *parent,
const string &name,
- uint64 origin,
+ uint64_t origin,
Module::Address address,
Module::Address size) {
dwarf2reader::DIEHandler *func
@@ -595,7 +598,7 @@ void CUFixtureBase::TestFunction(int i, const string &name,
Module::Function *function = functions_[i];
EXPECT_EQ(name, function->name);
EXPECT_EQ(address, function->address);
- EXPECT_EQ(size, function->size);
+ EXPECT_EQ(size, function->ranges[0].size);
EXPECT_EQ(0U, function->parameter_size);
}
@@ -1203,6 +1206,7 @@ TEST_F(Specifications, Function) {
}
TEST_F(Specifications, MangledName) {
+ // Language defaults to C++, so no need to set it here.
PushLine(0x93cd3dfc1aa10097ULL, 0x0397d47a0b4ca0d4ULL, "line-file", 54883661);
StartCU();
@@ -1219,6 +1223,53 @@ TEST_F(Specifications, MangledName) {
0x93cd3dfc1aa10097ULL, 0x0397d47a0b4ca0d4ULL);
}
+TEST_F(Specifications, MangledNameSwift) {
+ // Swift mangled names should pass through untouched.
+ SetLanguage(dwarf2reader::DW_LANG_Swift);
+ PushLine(0x93cd3dfc1aa10097ULL, 0x0397d47a0b4ca0d4ULL, "line-file", 54883661);
+ StartCU();
+ const string kName = "_TFC9swifttest5Shape17simpleDescriptionfS0_FT_Si";
+ DeclarationDIE(&root_handler_, 0xcd3c51b946fb1eeeLL,
+ dwarf2reader::DW_TAG_subprogram, "declaration-name",
+ kName);
+ DefinitionDIE(&root_handler_, dwarf2reader::DW_TAG_subprogram,
+ 0xcd3c51b946fb1eeeLL, "",
+ 0x93cd3dfc1aa10097ULL, 0x0397d47a0b4ca0d4ULL);
+ root_handler_.Finish();
+
+ TestFunctionCount(1);
+ TestFunction(0, kName,
+ 0x93cd3dfc1aa10097ULL, 0x0397d47a0b4ca0d4ULL);
+}
+
+TEST_F(Specifications, MangledNameRust) {
+ SetLanguage(dwarf2reader::DW_LANG_Rust);
+ PushLine(0x93cd3dfc1aa10097ULL, 0x0397d47a0b4ca0d4ULL, "line-file", 54883661);
+
+ StartCU();
+ const string kName = "_ZN14rustc_demangle8demangle17h373defa94bffacdeE";
+ DeclarationDIE(&root_handler_, 0xcd3c51b946fb1eeeLL,
+ dwarf2reader::DW_TAG_subprogram, "declaration-name",
+ kName);
+ DefinitionDIE(&root_handler_, dwarf2reader::DW_TAG_subprogram,
+ 0xcd3c51b946fb1eeeLL, "",
+ 0x93cd3dfc1aa10097ULL, 0x0397d47a0b4ca0d4ULL);
+ root_handler_.Finish();
+
+ TestFunctionCount(1);
+ TestFunction(0,
+#ifndef HAVE_RUST_DEMANGLE
+ // Rust mangled names should pass through untouched if not
+ // using rust-demangle.
+ kName,
+#else
+ // If rust-demangle is available this should be properly
+ // demangled.
+ "rustc_demangle::demangle",
+#endif
+ 0x93cd3dfc1aa10097ULL, 0x0397d47a0b4ca0d4ULL);
+}
+
TEST_F(Specifications, MemberFunction) {
PushLine(0x3341a248634e7170ULL, 0x5f6938ee5553b953ULL, "line-file", 18116691);
@@ -1321,6 +1372,29 @@ TEST_F(Specifications, InlineFunction) {
0x1758a0f941b71efbULL, 0x1cf154f1f545e146ULL);
}
+// An inline function in a namespace should correctly derive its
+// name from its abstract origin, and not just the namespace name.
+TEST_F(Specifications, InlineFunctionInNamespace) {
+ PushLine(0x1758a0f941b71efbULL, 0x1cf154f1f545e146ULL, "line-file", 75173118);
+
+ StartCU();
+ DIEHandler* space_handler
+ = StartNamedDIE(&root_handler_, dwarf2reader::DW_TAG_namespace,
+ "Namespace");
+ ASSERT_TRUE(space_handler != NULL);
+ AbstractInstanceDIE(space_handler, 0x1e8dac5d507ed7abULL,
+ dwarf2reader::DW_INL_inlined, 0LL, "func-name");
+ DefineInlineInstanceDIE(space_handler, "", 0x1e8dac5d507ed7abULL,
+ 0x1758a0f941b71efbULL, 0x1cf154f1f545e146ULL);
+ space_handler->Finish();
+ delete space_handler;
+ root_handler_.Finish();
+
+ TestFunctionCount(1);
+ TestFunction(0, "Namespace::func-name",
+ 0x1758a0f941b71efbULL, 0x1cf154f1f545e146ULL);
+}
+
// Check name construction for a long chain containing each combination of:
// - struct, union, class, namespace
// - direct and definition
@@ -1442,7 +1516,7 @@ TEST_F(Specifications, InterCU) {
// First CU. Declares class_A.
{
- DwarfCUToModule root1_handler(&fc, &lr, &reporter_);
+ DwarfCUToModule root1_handler(&fc, &lr, nullptr, &reporter_);
ASSERT_TRUE(root1_handler.StartCompilationUnit(0, 1, 2, 3, 3));
ASSERT_TRUE(root1_handler.StartRootDIE(1,
dwarf2reader::DW_TAG_compile_unit));
@@ -1455,7 +1529,7 @@ TEST_F(Specifications, InterCU) {
// Second CU. Defines class_A, declares member_func_B.
{
- DwarfCUToModule root2_handler(&fc, &lr, &reporter_);
+ DwarfCUToModule root2_handler(&fc, &lr, nullptr, &reporter_);
ASSERT_TRUE(root2_handler.StartCompilationUnit(0, 1, 2, 3, 3));
ASSERT_TRUE(root2_handler.StartRootDIE(1,
dwarf2reader::DW_TAG_compile_unit));
@@ -1472,7 +1546,7 @@ TEST_F(Specifications, InterCU) {
// Third CU. Defines member_func_B.
{
- DwarfCUToModule root3_handler(&fc, &lr, &reporter_);
+ DwarfCUToModule root3_handler(&fc, &lr, nullptr, &reporter_);
ASSERT_TRUE(root3_handler.StartCompilationUnit(0, 1, 2, 3, 3));
ASSERT_TRUE(root3_handler.StartRootDIE(1,
dwarf2reader::DW_TAG_compile_unit));
@@ -1501,7 +1575,7 @@ TEST_F(Specifications, UnhandledInterCU) {
// First CU. Declares class_A.
{
- DwarfCUToModule root1_handler(&fc, &lr, &reporter_);
+ DwarfCUToModule root1_handler(&fc, &lr, nullptr, &reporter_);
ASSERT_TRUE(root1_handler.StartCompilationUnit(0, 1, 2, 3, 3));
ASSERT_TRUE(root1_handler.StartRootDIE(1,
dwarf2reader::DW_TAG_compile_unit));
@@ -1514,7 +1588,7 @@ TEST_F(Specifications, UnhandledInterCU) {
// Second CU. Defines class_A, declares member_func_B.
{
- DwarfCUToModule root2_handler(&fc, &lr, &reporter_);
+ DwarfCUToModule root2_handler(&fc, &lr, nullptr, &reporter_);
ASSERT_TRUE(root2_handler.StartCompilationUnit(0, 1, 2, 3, 3));
ASSERT_TRUE(root2_handler.StartRootDIE(1,
dwarf2reader::DW_TAG_compile_unit));
@@ -1532,7 +1606,7 @@ TEST_F(Specifications, UnhandledInterCU) {
// Third CU. Defines member_func_B.
{
- DwarfCUToModule root3_handler(&fc, &lr, &reporter_);
+ DwarfCUToModule root3_handler(&fc, &lr, nullptr, &reporter_);
ASSERT_TRUE(root3_handler.StartCompilationUnit(0, 1, 2, 3, 3));
ASSERT_TRUE(root3_handler.StartRootDIE(1,
dwarf2reader::DW_TAG_compile_unit));
@@ -1718,7 +1792,8 @@ struct Reporter: public Test {
file("source file name") {
reporter.SetCUName("compilation-unit-name");
- function.size = 0x89808a5bdfa0a6a3ULL;
+ Module::Range range(0x19c45c30770c1eb0ULL, 0x89808a5bdfa0a6a3ULL);
+ function.ranges.push_back(range);
function.parameter_size = 0x6a329f18683dcd51ULL;
line.address = 0x3606ac6267aebeccULL;
diff --git a/src/common/dwarf_line_to_module.cc b/src/common/dwarf_line_to_module.cc
index 258b0b60..443d7448 100644
--- a/src/common/dwarf_line_to_module.cc
+++ b/src/common/dwarf_line_to_module.cc
@@ -63,16 +63,16 @@ static string ExpandPath(const string &path,
namespace google_breakpad {
-void DwarfLineToModule::DefineDir(const string &name, uint32 dir_num) {
+void DwarfLineToModule::DefineDir(const string &name, uint32_t dir_num) {
// Directory number zero is reserved to mean the compilation
// directory. Silently ignore attempts to redefine it.
if (dir_num != 0)
directories_[dir_num] = ExpandPath(name, compilation_dir_);
}
-void DwarfLineToModule::DefineFile(const string &name, int32 file_num,
- uint32 dir_num, uint64 mod_time,
- uint64 length) {
+void DwarfLineToModule::DefineFile(const string &name, int32_t file_num,
+ uint32_t dir_num, uint64_t mod_time,
+ uint64_t length) {
if (file_num == -1)
file_num = ++highest_file_number_;
else if (file_num > highest_file_number_)
@@ -103,9 +103,9 @@ void DwarfLineToModule::DefineFile(const string &name, int32 file_num,
files_[file_num] = module_->FindFile(full_name);
}
-void DwarfLineToModule::AddLine(uint64 address, uint64 length,
- uint32 file_num, uint32 line_num,
- uint32 column_num) {
+void DwarfLineToModule::AddLine(uint64_t address, uint64_t length,
+ uint32_t file_num, uint32_t line_num,
+ uint32_t column_num) {
if (length == 0)
return;
diff --git a/src/common/dwarf_line_to_module.h b/src/common/dwarf_line_to_module.h
index 1fdd4cb7..f54ccaf5 100644
--- a/src/common/dwarf_line_to_module.h
+++ b/src/common/dwarf_line_to_module.h
@@ -132,17 +132,17 @@ class DwarfLineToModule: public dwarf2reader::LineInfoHandler {
~DwarfLineToModule() { }
- void DefineDir(const string &name, uint32 dir_num);
- void DefineFile(const string &name, int32 file_num,
- uint32 dir_num, uint64 mod_time,
- uint64 length);
- void AddLine(uint64 address, uint64 length,
- uint32 file_num, uint32 line_num, uint32 column_num);
+ void DefineDir(const string &name, uint32_t dir_num);
+ void DefineFile(const string &name, int32_t file_num,
+ uint32_t dir_num, uint64_t mod_time,
+ uint64_t length);
+ void AddLine(uint64_t address, uint64_t length,
+ uint32_t file_num, uint32_t line_num, uint32_t column_num);
private:
- typedef std::map<uint32, string> DirectoryTable;
- typedef std::map<uint32, Module::File *> FileTable;
+ typedef std::map<uint32_t, string> DirectoryTable;
+ typedef std::map<uint32_t, Module::File *> FileTable;
// The module we're contributing debugging info to. Owned by our
// client.
@@ -171,12 +171,12 @@ class DwarfLineToModule: public dwarf2reader::LineInfoHandler {
// The highest file number we've seen so far, or -1 if we've seen
// none. Used for dynamically defined file numbers.
- int32 highest_file_number_;
+ int32_t highest_file_number_;
// This is the ending address of the last line we omitted, or zero if we
// didn't omit the previous line. It is zero before we have received any
// AddLine calls.
- uint64 omitted_line_end_;
+ uint64_t omitted_line_end_;
// True if we've warned about:
bool warned_bad_file_number_; // bad file numbers
diff --git a/src/client/linux/dump_writer_common/seccomp_unwinder.h b/src/common/dwarf_range_list_handler.cc
index 0f5637b6..cc9e39ce 100644
--- a/src/client/linux/dump_writer_common/seccomp_unwinder.h
+++ b/src/common/dwarf_range_list_handler.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2014, Google Inc.
+// Copyright (c) 2018 Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
@@ -27,24 +27,34 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef CLIENT_LINUX_DUMP_WRITER_COMMON_SECCOMP_UNWINDER_H
-#define CLIENT_LINUX_DUMP_WRITER_COMMON_SECCOMP_UNWINDER_H
+// Original author: Gabriele Svelto <gsvelto@mozilla.com>
+// <gabriele.svelto@gmail.com>
-#include "client/linux/dump_writer_common/raw_context_cpu.h"
-#include "google_breakpad/common/minidump_format.h"
+// dwarf_range_list_handler.cc: Implementation of DwarfRangeListHandler class.
+// See dwarf_range_list_handler.h for details.
+
+#include <algorithm>
+
+#include "common/dwarf_range_list_handler.h"
namespace google_breakpad {
-struct SeccompUnwinder {
+void DwarfRangeListHandler::AddRange(uint64_t begin, uint64_t end) {
+ Module::Range r(begin + base_address_, end - begin);
+
+ ranges_->push_back(r);
+}
- // Check if the top of the stack is part of a system call that has been
- // redirected by the seccomp sandbox. If so, try to pop the stack frames
- // all the way back to the point where the interception happened.
- static void PopSeccompStackFrame(RawContextCPU* cpu,
- const MDRawThread& thread,
- uint8_t* stack_copy);
-};
+void DwarfRangeListHandler::SetBaseAddress(uint64_t base_address) {
+ base_address_ = base_address;
+}
-} // namespace google_breakpad
+void DwarfRangeListHandler::Finish() {
+ std::sort(ranges_->begin(), ranges_->end(),
+ [](const Module::Range &a, const Module::Range &b) {
+ return a.address < b.address;
+ }
+ );
+}
-#endif // CLIENT_LINUX_DUMP_WRITER_COMMON_SECCOMP_UNWINDER_H
+} // namespace google_breakpad
diff --git a/src/testing/gtest/samples/sample2.h b/src/common/dwarf_range_list_handler.h
index cb485c70..83a34694 100644
--- a/src/testing/gtest/samples/sample2.h
+++ b/src/common/dwarf_range_list_handler.h
@@ -1,4 +1,6 @@
-// Copyright 2005, Google Inc.
+// -*- mode: c++ -*-
+
+// Copyright (c) 2018 Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
@@ -27,59 +29,51 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-// A sample program demonstrating using Google C++ testing framework.
-//
-// Author: wan@google.com (Zhanyong Wan)
+// Original author: Gabriele Svelto <gsvelto@mozilla.com>
+// <gabriele.svelto@gmail.com>
-#ifndef GTEST_SAMPLES_SAMPLE2_H_
-#define GTEST_SAMPLES_SAMPLE2_H_
+// The DwarfRangeListHandler class accepts rangelist data from a DWARF parser
+// and adds it to a google_breakpad::Function or other objects supporting
+// ranges.
-#include <string.h>
+#ifndef COMMON_LINUX_DWARF_RANGE_LIST_HANDLER_H
+#define COMMON_LINUX_DWARF_RANGE_LIST_HANDLER_H
+#include <vector>
-// A simple string class.
-class MyString {
- private:
- const char* c_string_;
- const MyString& operator=(const MyString& rhs);
+#include "common/module.h"
+#include "common/dwarf/dwarf2reader.h"
- public:
- // Clones a 0-terminated C string, allocating memory using new.
- static const char* CloneCString(const char* a_c_string);
+namespace google_breakpad {
- ////////////////////////////////////////////////////////////
- //
- // C'tors
+// A class for producing a vector of google_breakpad::Module::Range
+// instances from a parsed DWARF range list.
- // The default c'tor constructs a NULL string.
- MyString() : c_string_(NULL) {}
+class DwarfRangeListHandler: public dwarf2reader::RangeListHandler {
+ public:
+ DwarfRangeListHandler(uint64_t base_address, vector<Module::Range> *ranges)
+ : base_address_(base_address), ranges_(ranges) { }
- // Constructs a MyString by cloning a 0-terminated C string.
- explicit MyString(const char* a_c_string) : c_string_(NULL) {
- Set(a_c_string);
- }
+ ~DwarfRangeListHandler() { }
- // Copy c'tor
- MyString(const MyString& string) : c_string_(NULL) {
- Set(string.c_string_);
- }
+ // Add a range to the list
+ void AddRange(uint64_t begin, uint64_t end);
- ////////////////////////////////////////////////////////////
- //
- // D'tor. MyString is intended to be a final class, so the d'tor
- // doesn't need to be virtual.
- ~MyString() { delete[] c_string_; }
+ // Record the new base address and use it for the following entries
+ void SetBaseAddress(uint64_t base_address);
- // Gets the 0-terminated C string this MyString object represents.
- const char* c_string() const { return c_string_; }
+ // Sort the ranges so that they are in ascending order of starting address
+ void Finish();
- size_t Length() const {
- return c_string_ == NULL ? 0 : strlen(c_string_);
- }
+ private:
+ // The current PC to add to every entry, this can be overridden by a special
+ // list entry
+ uint64_t base_address_;
- // Sets the 0-terminated C string this MyString object represents.
- void Set(const char* c_string);
+ // The list of ranges to be populated
+ vector<Module::Range> *ranges_;
};
+} // namespace google_breakpad
-#endif // GTEST_SAMPLES_SAMPLE2_H_
+#endif // COMMON_LINUX_DWARF_RANGE_LIST_HANDLER_H
diff --git a/src/common/language.cc b/src/common/language.cc
index c2fd81f6..978fb855 100644
--- a/src/common/language.cc
+++ b/src/common/language.cc
@@ -34,18 +34,70 @@
#include "common/language.h"
+#include <stdlib.h>
+
+#if !defined(__ANDROID__)
+#include <cxxabi.h>
+#endif
+
+#if defined(HAVE_RUST_DEMANGLE)
+#include <rust_demangle.h>
+#endif
+
+#include <limits>
+
+namespace {
+
+string MakeQualifiedNameWithSeparator(const string& parent_name,
+ const char* separator,
+ const string& name) {
+ if (parent_name.empty()) {
+ return name;
+ }
+
+ return parent_name + separator + name;
+}
+
+} // namespace
+
namespace google_breakpad {
// C++ language-specific operations.
class CPPLanguage: public Language {
public:
CPPLanguage() {}
+
string MakeQualifiedName(const string &parent_name,
const string &name) const {
- if (parent_name.empty())
- return name;
- else
- return parent_name + "::" + name;
+ return MakeQualifiedNameWithSeparator(parent_name, "::", name);
+ }
+
+ virtual DemangleResult DemangleName(const string& mangled,
+ string* demangled) const {
+#if defined(__ANDROID__)
+ // Android NDK doesn't provide abi::__cxa_demangle.
+ demangled->clear();
+ return kDontDemangle;
+#else
+ int status;
+ char* demangled_c =
+ abi::__cxa_demangle(mangled.c_str(), NULL, NULL, &status);
+
+ DemangleResult result;
+ if (status == 0) {
+ result = kDemangleSuccess;
+ demangled->assign(demangled_c);
+ } else {
+ result = kDemangleFailure;
+ demangled->clear();
+ }
+
+ if (demangled_c) {
+ free(reinterpret_cast<void*>(demangled_c));
+ }
+
+ return result;
+#endif
}
};
@@ -54,19 +106,79 @@ CPPLanguage CPPLanguageSingleton;
// Java language-specific operations.
class JavaLanguage: public Language {
public:
+ JavaLanguage() {}
+
string MakeQualifiedName(const string &parent_name,
const string &name) const {
- if (parent_name.empty())
- return name;
- else
- return parent_name + "." + name;
+ return MakeQualifiedNameWithSeparator(parent_name, ".", name);
}
};
JavaLanguage JavaLanguageSingleton;
+// Swift language-specific operations.
+class SwiftLanguage: public Language {
+ public:
+ SwiftLanguage() {}
+
+ string MakeQualifiedName(const string &parent_name,
+ const string &name) const {
+ return MakeQualifiedNameWithSeparator(parent_name, ".", name);
+ }
+
+ virtual DemangleResult DemangleName(const string& mangled,
+ string* demangled) const {
+ // There is no programmatic interface to a Swift demangler. Pass through the
+ // mangled form because it encodes more information than the qualified name
+ // that would have been built by MakeQualifiedName(). The output can be
+ // post-processed by xcrun swift-demangle to transform mangled Swift names
+ // into something more readable.
+ demangled->assign(mangled);
+ return kDemangleSuccess;
+ }
+};
+
+SwiftLanguage SwiftLanguageSingleton;
+
+// Rust language-specific operations.
+class RustLanguage: public Language {
+ public:
+ RustLanguage() {}
+
+ string MakeQualifiedName(const string &parent_name,
+ const string &name) const {
+ return MakeQualifiedNameWithSeparator(parent_name, ".", name);
+ }
+
+ virtual DemangleResult DemangleName(const string& mangled,
+ string* demangled) const {
+ // Rust names use GCC C++ name mangling, but demangling them with
+ // abi_demangle doesn't produce stellar results due to them having
+ // another layer of encoding.
+ // If callers provide rustc-demangle, use that.
+#if defined(HAVE_RUST_DEMANGLE)
+ char* rust_demangled = rust_demangle(mangled.c_str());
+ if (rust_demangled == nullptr) {
+ return kDemangleFailure;
+ }
+ demangled->assign(rust_demangled);
+ free_rust_demangled_name(rust_demangled);
+#else
+ // Otherwise, pass through the mangled name so callers can demangle
+ // after the fact.
+ demangled->assign(mangled);
+#endif
+ return kDemangleSuccess;
+ }
+};
+
+RustLanguage RustLanguageSingleton;
+
// Assembler language-specific operations.
class AssemblerLanguage: public Language {
+ public:
+ AssemblerLanguage() {}
+
bool HasFunctions() const { return false; }
string MakeQualifiedName(const string &parent_name,
const string &name) const {
@@ -78,6 +190,8 @@ AssemblerLanguage AssemblerLanguageSingleton;
const Language * const Language::CPlusPlus = &CPPLanguageSingleton;
const Language * const Language::Java = &JavaLanguageSingleton;
+const Language * const Language::Swift = &SwiftLanguageSingleton;
+const Language * const Language::Rust = &RustLanguageSingleton;
const Language * const Language::Assembler = &AssemblerLanguageSingleton;
} // namespace google_breakpad
diff --git a/src/common/language.h b/src/common/language.h
index bbe30334..2d2dbcd9 100644
--- a/src/common/language.h
+++ b/src/common/language.h
@@ -77,9 +77,26 @@ class Language {
virtual string MakeQualifiedName (const string &parent_name,
const string &name) const = 0;
+ enum DemangleResult {
+ // Demangling was not performed because it’s not appropriate to attempt.
+ kDontDemangle = -1,
+
+ kDemangleSuccess,
+ kDemangleFailure,
+ };
+
+ // Wraps abi::__cxa_demangle() or similar for languages where appropriate.
+ virtual DemangleResult DemangleName(const string& mangled,
+ string* demangled) const {
+ demangled->clear();
+ return kDontDemangle;
+ }
+
// Instances for specific languages.
static const Language * const CPlusPlus,
* const Java,
+ * const Swift,
+ * const Rust,
* const Assembler;
};
diff --git a/src/common/android/breakpad_getcontext.S b/src/common/linux/breakpad_getcontext.S
index fd6326ad..fea0109d 100644
--- a/src/common/android/breakpad_getcontext.S
+++ b/src/common/linux/breakpad_getcontext.S
@@ -28,9 +28,9 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// A minimalistic implementation of getcontext() to be used by
-// Google Breakpad on Android.
+// Google Breakpad when getcontext() is not available in libc.
-#include "common/android/ucontext_constants.h"
+#include "common/linux/ucontext_constants.h"
/* int getcontext (ucontext_t *ucp) */
@@ -230,16 +230,13 @@ breakpad_getcontext:
#elif defined(__mips__)
// This implementation is inspired by implementation of getcontext in glibc.
+#include <asm-mips/asm.h>
+#include <asm-mips/regdef.h>
#if _MIPS_SIM == _ABIO32
-#include <asm/asm.h>
-#include <asm/regdef.h>
-#include <asm/fpregdef.h>
-#else
-#include <machine/asm.h>
-#include <machine/regdef.h>
+#include <asm-mips/fpregdef.h>
#endif
-// from asm/asm.h
+// from asm-mips/asm.h
#if _MIPS_SIM == _ABIO32
#define ALSZ 7
#define ALMASK ~7
diff --git a/src/testing/gtest/samples/sample4.h b/src/common/linux/breakpad_getcontext.h
index cd60f0dd..1418cde6 100644
--- a/src/testing/gtest/samples/sample4.h
+++ b/src/common/linux/breakpad_getcontext.h
@@ -1,4 +1,4 @@
-// Copyright 2005, Google Inc.
+// Copyright (c) 2012, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
@@ -27,27 +27,30 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-// A sample program demonstrating using Google C++ testing framework.
-//
-// Author: wan@google.com (Zhanyong Wan)
+#ifndef GOOGLE_BREAKPAD_COMMON_LINUX_INCLUDE_UCONTEXT_H
+#define GOOGLE_BREAKPAD_COMMON_LINUX_INCLUDE_UCONTEXT_H
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#ifndef HAVE_GETCONTEXT
+
+#include <signal.h>
-#ifndef GTEST_SAMPLES_SAMPLE4_H_
-#define GTEST_SAMPLES_SAMPLE4_H_
+#ifdef __cplusplus
+extern "C" {
+#endif // __cplusplus
-// A simple monotonic counter.
-class Counter {
- private:
- int counter_;
+// Provided by src/common/linux/breakpad_getcontext.S
+int breakpad_getcontext(ucontext_t* ucp);
- public:
- // Creates a counter that starts at 0.
- Counter() : counter_(0) {}
+#define getcontext(x) breakpad_getcontext(x)
- // Returns the current counter value, and increments it.
- int Increment();
+#ifdef __cplusplus
+} // extern "C"
+#endif // __cplusplus
- // Prints the current counter value to STDOUT.
- void Print() const;
-};
+#endif // HAVE_GETCONTEXT
-#endif // GTEST_SAMPLES_SAMPLE4_H_
+#endif // GOOGLE_BREAKPAD_COMMON_LINUX_INCLUDE_UCONTEXT_H
diff --git a/src/common/android/breakpad_getcontext_unittest.cc b/src/common/linux/breakpad_getcontext_unittest.cc
index 2c550bf2..a57bfedf 100644
--- a/src/common/android/breakpad_getcontext_unittest.cc
+++ b/src/common/linux/breakpad_getcontext_unittest.cc
@@ -27,14 +27,18 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#if defined(__x86_64__)
+// asm/sigcontext.h can't be included with signal.h on glibc or
+// musl, so only compare _libc_fpstate and _fpstate on Android.
+#if defined(__ANDROID__) && defined(__x86_64__)
#include <asm/sigcontext.h>
#endif
#include <sys/ucontext.h>
+#include <type_traits>
+
#include "breakpad_googletest_includes.h"
-#include "common/android/ucontext_constants.h"
+#include "common/linux/ucontext_constants.h"
template <int left, int right>
struct CompileAssertEquals {
@@ -139,6 +143,8 @@ TEST(AndroidUContext, GRegsOffset) {
// sigcontext is an analog to mcontext_t. The layout should be the same.
COMPILE_ASSERT_EQ(offsetof(mcontext_t,fpregs),
offsetof(sigcontext,fpstate), sigcontext_fpstate);
+
+#if defined(__ANDROID__)
// Check that _fpstate from asm/sigcontext.h is essentially the same
// as _libc_fpstate.
COMPILE_ASSERT_EQ(sizeof(_libc_fpstate), sizeof(_fpstate),
@@ -164,13 +170,15 @@ TEST(AndroidUContext, GRegsOffset) {
sigcontext_fpstate_stspace);
COMPILE_ASSERT_EQ(offsetof(_libc_fpstate,_xmm), offsetof(_fpstate,xmm_space),
sigcontext_fpstate_xmm_space);
+#endif
COMPILE_ASSERT_EQ(MCONTEXT_FPREGS_PTR,
offsetof(ucontext_t,uc_mcontext.fpregs),
mcontext_fpregs_ptr);
COMPILE_ASSERT_EQ(MCONTEXT_FPREGS_MEM, offsetof(ucontext_t,__fpregs_mem),
mcontext_fpregs_mem);
- COMPILE_ASSERT_EQ(FPREGS_OFFSET_MXCSR, offsetof(_libc_fpstate,mxcsr),
+ COMPILE_ASSERT_EQ(FPREGS_OFFSET_MXCSR,
+ offsetof(std::remove_pointer<fpregset_t>::type,mxcsr),
fpregs_offset_mxcsr);
COMPILE_ASSERT_EQ(UCONTEXT_SIGMASK_OFFSET, offsetof(ucontext_t, uc_sigmask),
ucontext_sigmask);
diff --git a/src/common/linux/dump_symbols.cc b/src/common/linux/dump_symbols.cc
index 0bcc18ab..b7e77ab7 100644
--- a/src/common/linux/dump_symbols.cc
+++ b/src/common/linux/dump_symbols.cc
@@ -38,7 +38,9 @@
#include <elf.h>
#include <errno.h>
#include <fcntl.h>
+#include <limits.h>
#include <link.h>
+#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -57,13 +59,16 @@
#include "common/dwarf_cfi_to_module.h"
#include "common/dwarf_cu_to_module.h"
#include "common/dwarf_line_to_module.h"
+#include "common/dwarf_range_list_handler.h"
#include "common/linux/crc32.h"
#include "common/linux/eintr_wrapper.h"
#include "common/linux/elfutils.h"
#include "common/linux/elfutils-inl.h"
#include "common/linux/elf_symbols_to_module.h"
#include "common/linux/file_id.h"
+#include "common/memory_allocator.h"
#include "common/module.h"
+#include "common/path_helper.h"
#include "common/scoped_ptr.h"
#ifndef NO_STABS_SUPPORT
#include "common/stabs_reader.h"
@@ -78,17 +83,22 @@ using google_breakpad::DumpOptions;
using google_breakpad::DwarfCFIToModule;
using google_breakpad::DwarfCUToModule;
using google_breakpad::DwarfLineToModule;
+using google_breakpad::DwarfRangeListHandler;
using google_breakpad::ElfClass;
using google_breakpad::ElfClass32;
using google_breakpad::ElfClass64;
+using google_breakpad::FileID;
using google_breakpad::FindElfSectionByName;
using google_breakpad::GetOffset;
using google_breakpad::IsValidElf;
+using google_breakpad::kDefaultBuildIdSize;
using google_breakpad::Module;
+using google_breakpad::PageAllocator;
#ifndef NO_STABS_SUPPORT
using google_breakpad::StabsToModule;
#endif
using google_breakpad::scoped_ptr;
+using google_breakpad::wasteful_vector;
// Define AARCH64 ELF architecture if host machine does not include this define.
#ifndef EM_AARCH64
@@ -172,6 +182,23 @@ typename ElfClass::Addr GetLoadingAddress(
return 0;
}
+// Find the set of address ranges for all PT_LOAD segments.
+template <typename ElfClass>
+vector<Module::Range> GetPtLoadSegmentRanges(
+ const typename ElfClass::Phdr* program_headers,
+ int nheader) {
+ typedef typename ElfClass::Phdr Phdr;
+ vector<Module::Range> ranges;
+
+ for (int i = 0; i < nheader; ++i) {
+ const Phdr& header = program_headers[i];
+ if (header.p_type == PT_LOAD) {
+ ranges.push_back(Module::Range(header.p_vaddr, header.p_memsz));
+ }
+ }
+ return ranges;
+}
+
#ifndef NO_STABS_SUPPORT
template<typename ElfClass>
bool LoadStabs(const typename ElfClass::Ehdr* elf_header,
@@ -200,6 +227,30 @@ bool LoadStabs(const typename ElfClass::Ehdr* elf_header,
}
#endif // NO_STABS_SUPPORT
+// A range handler that accepts rangelist data parsed by
+// dwarf2reader::RangeListReader and populates a range vector (typically
+// owned by a function) with the results.
+class DumperRangesHandler : public DwarfCUToModule::RangesHandler {
+ public:
+ DumperRangesHandler(const uint8_t *buffer, uint64_t size,
+ dwarf2reader::ByteReader* reader)
+ : buffer_(buffer), size_(size), reader_(reader) { }
+
+ bool ReadRanges(uint64_t offset, Module::Address base_address,
+ vector<Module::Range>* ranges) {
+ DwarfRangeListHandler handler(base_address, ranges);
+ dwarf2reader::RangeListReader rangelist_reader(buffer_, size_, reader_,
+ &handler);
+
+ return rangelist_reader.ReadRangeList(offset);
+ }
+
+ private:
+ const uint8_t *buffer_;
+ uint64_t size_;
+ dwarf2reader::ByteReader* reader_;
+};
+
// A line-to-module loader that accepts line number info parsed by
// dwarf2reader::LineInfo and populates a Module and a line vector
// with the results.
@@ -211,7 +262,7 @@ class DumperLineToModule: public DwarfCUToModule::LineToModuleHandler {
void StartCompilationUnit(const string& compilation_dir) {
compilation_dir_ = compilation_dir;
}
- void ReadProgram(const char* program, uint64 length,
+ void ReadProgram(const uint8_t *program, uint64_t length,
Module* module, std::vector<Module::Line>* lines) {
DwarfLineToModule handler(module, compilation_dir_, lines);
dwarf2reader::LineInfo parser(program, length, byte_reader_, &handler);
@@ -249,31 +300,45 @@ bool LoadDwarf(const string& dwarf_filename,
string name = GetOffset<ElfClass, char>(elf_header,
section_names->sh_offset) +
section->sh_name;
- const char* contents = GetOffset<ElfClass, char>(elf_header,
- section->sh_offset);
+ const uint8_t *contents = GetOffset<ElfClass, uint8_t>(elf_header,
+ section->sh_offset);
file_context.AddSectionToSectionMap(name, contents, section->sh_size);
}
+ // Optional .debug_ranges reader
+ scoped_ptr<DumperRangesHandler> ranges_handler;
+ dwarf2reader::SectionMap::const_iterator ranges_entry =
+ file_context.section_map().find(".debug_ranges");
+ if (ranges_entry != file_context.section_map().end()) {
+ const std::pair<const uint8_t *, uint64_t>& ranges_section =
+ ranges_entry->second;
+ ranges_handler.reset(
+ new DumperRangesHandler(ranges_section.first, ranges_section.second,
+ &byte_reader));
+ }
+
// Parse all the compilation units in the .debug_info section.
DumperLineToModule line_to_module(&byte_reader);
dwarf2reader::SectionMap::const_iterator debug_info_entry =
file_context.section_map().find(".debug_info");
assert(debug_info_entry != file_context.section_map().end());
- const std::pair<const char*, uint64>& debug_info_section =
+ const std::pair<const uint8_t *, uint64_t>& debug_info_section =
debug_info_entry->second;
// This should never have been called if the file doesn't have a
// .debug_info section.
assert(debug_info_section.first);
- uint64 debug_info_length = debug_info_section.second;
- for (uint64 offset = 0; offset < debug_info_length;) {
+ uint64_t debug_info_length = debug_info_section.second;
+ for (uint64_t offset = 0; offset < debug_info_length;) {
// Make a handler for the root DIE that populates MODULE with the
// data that was found.
DwarfCUToModule::WarningReporter reporter(dwarf_filename, offset);
- DwarfCUToModule root_handler(&file_context, &line_to_module, &reporter);
+ DwarfCUToModule root_handler(&file_context, &line_to_module,
+ ranges_handler.get(), &reporter);
// Make a Dwarf2Handler that drives the DIEHandler.
dwarf2reader::DIEDispatcher die_dispatcher(&root_handler);
// Make a DWARF parser for the compilation unit at OFFSET.
- dwarf2reader::CompilationUnit reader(file_context.section_map(),
+ dwarf2reader::CompilationUnit reader(dwarf_filename,
+ file_context.section_map(),
offset,
&byte_reader,
&die_dispatcher);
@@ -336,8 +401,8 @@ bool LoadDwarfCFI(const string& dwarf_filename,
dwarf2reader::ENDIANNESS_BIG : dwarf2reader::ENDIANNESS_LITTLE;
// Find the call frame information and its size.
- const char* cfi =
- GetOffset<ElfClass, char>(elf_header, section->sh_offset);
+ const uint8_t *cfi =
+ GetOffset<ElfClass, uint8_t>(elf_header, section->sh_offset);
size_t cfi_size = section->sh_size;
// Plug together the parser, handler, and their entourages.
@@ -424,12 +489,13 @@ bool IsSameFile(const char* left_abspath, const string& right_path) {
// Read the .gnu_debuglink and get the debug file name. If anything goes
// wrong, return an empty string.
-string ReadDebugLink(const char* debuglink,
+string ReadDebugLink(const uint8_t *debuglink,
const size_t debuglink_size,
const bool big_endian,
const string& obj_file,
const std::vector<string>& debug_dirs) {
- size_t debuglink_len = strlen(debuglink) + 5; // Include '\0' + CRC32.
+ // Include '\0' + CRC32 (4 bytes).
+ size_t debuglink_len = strlen(reinterpret_cast<const char *>(debuglink)) + 5;
debuglink_len = 4 * ((debuglink_len + 3) / 4); // Round up to 4 bytes.
// Sanity check.
@@ -450,7 +516,8 @@ string ReadDebugLink(const char* debuglink,
std::vector<string>::const_iterator it;
for (it = debug_dirs.begin(); it < debug_dirs.end(); ++it) {
const string& debug_dir = *it;
- debuglink_path = debug_dir + "/" + debuglink;
+ debuglink_path = debug_dir + "/" +
+ reinterpret_cast<const char *>(debuglink);
// There is the annoying case of /path/to/foo.so having foo.so as the
// debug link file name. Thus this may end up opening /path/to/foo.so again,
@@ -592,7 +659,6 @@ bool LoadSymbols(const string& obj_file,
typedef typename ElfClass::Addr Addr;
typedef typename ElfClass::Phdr Phdr;
typedef typename ElfClass::Shdr Shdr;
- typedef typename ElfClass::Word Word;
Addr loading_addr = GetLoadingAddress<ElfClass>(
GetOffset<ElfClass, Phdr>(elf_header, elf_header->e_phoff),
@@ -600,8 +666,14 @@ bool LoadSymbols(const string& obj_file,
module->SetLoadAddress(loading_addr);
info->set_loading_addr(loading_addr, obj_file);
- Word debug_section_type =
- elf_header->e_machine == EM_MIPS ? SHT_MIPS_DWARF : SHT_PROGBITS;
+ // Allow filtering of extraneous debug information in partitioned libraries.
+ // Such libraries contain debug information for all libraries extracted from
+ // the same combined library, implying extensive duplication.
+ vector<Module::Range> address_ranges = GetPtLoadSegmentRanges<ElfClass>(
+ GetOffset<ElfClass, Phdr>(elf_header, elf_header->e_phoff),
+ elf_header->e_phnum);
+ module->SetAddressRanges(address_ranges);
+
const Shdr* sections =
GetOffset<ElfClass, Shdr>(elf_header, elf_header->e_shoff);
const Shdr* section_names = sections + elf_header->e_shstrndx;
@@ -635,9 +707,19 @@ bool LoadSymbols(const string& obj_file,
// Look for DWARF debugging information, and load it if present.
const Shdr* dwarf_section =
- FindElfSectionByName<ElfClass>(".debug_info", debug_section_type,
+ FindElfSectionByName<ElfClass>(".debug_info", SHT_PROGBITS,
sections, names, names_end,
elf_header->e_shnum);
+
+ // .debug_info section type is SHT_PROGBITS for mips on pnacl toolchains,
+ // but MIPS_DWARF for regular gnu toolchains, so both need to be checked
+ if (elf_header->e_machine == EM_MIPS && !dwarf_section) {
+ dwarf_section =
+ FindElfSectionByName<ElfClass>(".debug_info", SHT_MIPS_DWARF,
+ sections, names, names_end,
+ elf_header->e_shnum);
+ }
+
if (dwarf_section) {
found_debug_info_section = true;
found_usable_info = true;
@@ -650,32 +732,61 @@ bool LoadSymbols(const string& obj_file,
}
// See if there are export symbols available.
- const Shdr* dynsym_section =
- FindElfSectionByName<ElfClass>(".dynsym", SHT_DYNSYM,
- sections, names, names_end,
- elf_header->e_shnum);
- const Shdr* dynstr_section =
- FindElfSectionByName<ElfClass>(".dynstr", SHT_STRTAB,
- sections, names, names_end,
- elf_header->e_shnum);
- if (dynsym_section && dynstr_section) {
- info->LoadedSection(".dynsym");
+ const Shdr* symtab_section =
+ FindElfSectionByName<ElfClass>(".symtab", SHT_SYMTAB,
+ sections, names, names_end,
+ elf_header->e_shnum);
+ const Shdr* strtab_section =
+ FindElfSectionByName<ElfClass>(".strtab", SHT_STRTAB,
+ sections, names, names_end,
+ elf_header->e_shnum);
+ if (symtab_section && strtab_section) {
+ info->LoadedSection(".symtab");
- const uint8_t* dynsyms =
+ const uint8_t* symtab =
GetOffset<ElfClass, uint8_t>(elf_header,
- dynsym_section->sh_offset);
- const uint8_t* dynstrs =
+ symtab_section->sh_offset);
+ const uint8_t* strtab =
GetOffset<ElfClass, uint8_t>(elf_header,
- dynstr_section->sh_offset);
+ strtab_section->sh_offset);
bool result =
- ELFSymbolsToModule(dynsyms,
- dynsym_section->sh_size,
- dynstrs,
- dynstr_section->sh_size,
+ ELFSymbolsToModule(symtab,
+ symtab_section->sh_size,
+ strtab,
+ strtab_section->sh_size,
big_endian,
ElfClass::kAddrSize,
module);
found_usable_info = found_usable_info || result;
+ } else {
+ // Look in dynsym only if full symbol table was not available.
+ const Shdr* dynsym_section =
+ FindElfSectionByName<ElfClass>(".dynsym", SHT_DYNSYM,
+ sections, names, names_end,
+ elf_header->e_shnum);
+ const Shdr* dynstr_section =
+ FindElfSectionByName<ElfClass>(".dynstr", SHT_STRTAB,
+ sections, names, names_end,
+ elf_header->e_shnum);
+ if (dynsym_section && dynstr_section) {
+ info->LoadedSection(".dynsym");
+
+ const uint8_t* dynsyms =
+ GetOffset<ElfClass, uint8_t>(elf_header,
+ dynsym_section->sh_offset);
+ const uint8_t* dynstrs =
+ GetOffset<ElfClass, uint8_t>(elf_header,
+ dynstr_section->sh_offset);
+ bool result =
+ ELFSymbolsToModule(dynsyms,
+ dynsym_section->sh_size,
+ dynstrs,
+ dynstr_section->sh_size,
+ big_endian,
+ ElfClass::kAddrSize,
+ module);
+ found_usable_info = found_usable_info || result;
+ }
}
}
@@ -683,9 +794,19 @@ bool LoadSymbols(const string& obj_file,
// Dwarf Call Frame Information (CFI) is actually independent from
// the other DWARF debugging information, and can be used alone.
const Shdr* dwarf_cfi_section =
- FindElfSectionByName<ElfClass>(".debug_frame", debug_section_type,
+ FindElfSectionByName<ElfClass>(".debug_frame", SHT_PROGBITS,
sections, names, names_end,
elf_header->e_shnum);
+
+ // .debug_frame section type is SHT_PROGBITS for mips on pnacl toolchains,
+ // but MIPS_DWARF for regular gnu toolchains, so both need to be checked
+ if (elf_header->e_machine == EM_MIPS && !dwarf_cfi_section) {
+ dwarf_cfi_section =
+ FindElfSectionByName<ElfClass>(".debug_frame", SHT_MIPS_DWARF,
+ sections, names, names_end,
+ elf_header->e_shnum);
+ }
+
if (dwarf_cfi_section) {
// Ignore the return value of this function; even without call frame
// information, the other debugging information could be perfectly
@@ -738,9 +859,9 @@ bool LoadSymbols(const string& obj_file,
names_end, elf_header->e_shnum);
if (gnu_debuglink_section) {
if (!info->debug_dirs().empty()) {
- const char* debuglink_contents =
- GetOffset<ElfClass, char>(elf_header,
- gnu_debuglink_section->sh_offset);
+ const uint8_t *debuglink_contents =
+ GetOffset<ElfClass, uint8_t>(elf_header,
+ gnu_debuglink_section->sh_offset);
string debuglink_file =
ReadDebugLink(debuglink_contents,
gnu_debuglink_section->sh_size,
@@ -791,35 +912,6 @@ const char* ElfArchitecture(const typename ElfClass::Ehdr* elf_header) {
}
}
-// Format the Elf file identifier in IDENTIFIER as a UUID with the
-// dashes removed.
-string FormatIdentifier(unsigned char identifier[16]) {
- char identifier_str[40];
- google_breakpad::FileID::ConvertIdentifierToString(
- identifier,
- identifier_str,
- sizeof(identifier_str));
- string id_no_dash;
- for (int i = 0; identifier_str[i] != '\0'; ++i)
- if (identifier_str[i] != '-')
- id_no_dash += identifier_str[i];
- // Add an extra "0" by the end. PDB files on Windows have an 'age'
- // number appended to the end of the file identifier; this isn't
- // really used or necessary on other platforms, but be consistent.
- id_no_dash += '0';
- return id_no_dash;
-}
-
-// Return the non-directory portion of FILENAME: the portion after the
-// last slash, or the whole filename if there are no slashes.
-string BaseFileName(const string &filename) {
- // Lots of copies! basename's behavior is less than ideal.
- char* c_filename = strdup(filename.c_str());
- string base = basename(c_filename);
- free(c_filename);
- return base;
-}
-
template<typename ElfClass>
bool SanitizeDebugFile(const typename ElfClass::Ehdr* debug_elf_header,
const string& debuglink_file,
@@ -852,19 +944,13 @@ bool SanitizeDebugFile(const typename ElfClass::Ehdr* debug_elf_header,
}
template<typename ElfClass>
-bool ReadSymbolDataElfClass(const typename ElfClass::Ehdr* elf_header,
- const string& obj_filename,
- const std::vector<string>& debug_dirs,
- const DumpOptions& options,
- Module** out_module) {
- typedef typename ElfClass::Ehdr Ehdr;
- typedef typename ElfClass::Shdr Shdr;
-
- *out_module = NULL;
-
- unsigned char identifier[16];
- if (!google_breakpad::FileID::ElfFileIdentifierFromMappedFile(elf_header,
- identifier)) {
+bool InitModuleForElfClass(const typename ElfClass::Ehdr* elf_header,
+ const string& obj_filename,
+ const string& obj_os,
+ scoped_ptr<Module>& module) {
+ PageAllocator allocator;
+ wasteful_vector<uint8_t> identifier(&allocator, kDefaultBuildIdSize);
+ if (!FileID::ElfFileIdentifierFromMappedFile(elf_header, identifier)) {
fprintf(stderr, "%s: unable to generate file identifier\n",
obj_filename.c_str());
return false;
@@ -877,17 +963,47 @@ bool ReadSymbolDataElfClass(const typename ElfClass::Ehdr* elf_header,
return false;
}
+ char name_buf[NAME_MAX] = {};
+ std::string name = google_breakpad::ElfFileSoNameFromMappedFile(
+ elf_header, name_buf, sizeof(name_buf))
+ ? name_buf
+ : google_breakpad::BaseName(obj_filename);
+
+ // Add an extra "0" at the end. PDB files on Windows have an 'age'
+ // number appended to the end of the file identifier; this isn't
+ // really used or necessary on other platforms, but be consistent.
+ string id = FileID::ConvertIdentifierToUUIDString(identifier) + "0";
+ // This is just the raw Build ID in hex.
+ string code_id = FileID::ConvertIdentifierToString(identifier);
+
+ module.reset(new Module(name, obj_os, architecture, id, code_id));
+
+ return true;
+}
+
+template<typename ElfClass>
+bool ReadSymbolDataElfClass(const typename ElfClass::Ehdr* elf_header,
+ const string& obj_filename,
+ const string& obj_os,
+ const std::vector<string>& debug_dirs,
+ const DumpOptions& options,
+ Module** out_module) {
+ typedef typename ElfClass::Ehdr Ehdr;
+
+ *out_module = NULL;
+
+ scoped_ptr<Module> module;
+ if (!InitModuleForElfClass<ElfClass>(elf_header, obj_filename, obj_os,
+ module)) {
+ return false;
+ }
+
// Figure out what endianness this file is.
bool big_endian;
if (!ElfEndianness<ElfClass>(elf_header, &big_endian))
return false;
- string name = BaseFileName(obj_filename);
- string os = "Linux";
- string id = FormatIdentifier(identifier);
-
LoadSymbolsInfo<ElfClass> info(debug_dirs);
- scoped_ptr<Module> module(new Module(name, os, architecture, id));
if (!LoadSymbols<ElfClass>(obj_filename, big_endian, elf_header,
!debug_dirs.empty(), &info,
options, module.get())) {
@@ -902,7 +1018,9 @@ bool ReadSymbolDataElfClass(const typename ElfClass::Ehdr* elf_header,
if (!LoadELF(debuglink_file, &debug_map_wrapper,
reinterpret_cast<void**>(&debug_elf_header)) ||
!SanitizeDebugFile<ElfClass>(debug_elf_header, debuglink_file,
- obj_filename, architecture, big_endian)) {
+ obj_filename,
+ module->architecture().c_str(),
+ big_endian)) {
return false;
}
@@ -924,6 +1042,7 @@ namespace google_breakpad {
// Not explicitly exported, but not static so it can be used in unit tests.
bool ReadSymbolDataInternal(const uint8_t* obj_file,
const string& obj_filename,
+ const string& obj_os,
const std::vector<string>& debug_dirs,
const DumpOptions& options,
Module** module) {
@@ -935,24 +1054,27 @@ bool ReadSymbolDataInternal(const uint8_t* obj_file,
int elfclass = ElfClass(obj_file);
if (elfclass == ELFCLASS32) {
return ReadSymbolDataElfClass<ElfClass32>(
- reinterpret_cast<const Elf32_Ehdr*>(obj_file), obj_filename, debug_dirs,
- options, module);
+ reinterpret_cast<const Elf32_Ehdr*>(obj_file), obj_filename, obj_os,
+ debug_dirs, options, module);
}
if (elfclass == ELFCLASS64) {
return ReadSymbolDataElfClass<ElfClass64>(
- reinterpret_cast<const Elf64_Ehdr*>(obj_file), obj_filename, debug_dirs,
- options, module);
+ reinterpret_cast<const Elf64_Ehdr*>(obj_file), obj_filename, obj_os,
+ debug_dirs, options, module);
}
return false;
}
-bool WriteSymbolFile(const string &obj_file,
+bool WriteSymbolFile(const string &load_path,
+ const string &obj_file,
+ const string &obj_os,
const std::vector<string>& debug_dirs,
const DumpOptions& options,
std::ostream &sym_stream) {
Module* module;
- if (!ReadSymbolData(obj_file, debug_dirs, options, &module))
+ if (!ReadSymbolData(load_path, obj_file, obj_os, debug_dirs, options,
+ &module))
return false;
bool result = module->Write(sym_stream, options.symbol_data);
@@ -960,17 +1082,62 @@ bool WriteSymbolFile(const string &obj_file,
return result;
}
-bool ReadSymbolData(const string& obj_file,
+// Read the selected object file's debugging information, and write out the
+// header only to |stream|. Return true on success; if an error occurs, report
+// it and return false.
+bool WriteSymbolFileHeader(const string& load_path,
+ const string& obj_file,
+ const string& obj_os,
+ std::ostream &sym_stream) {
+ MmapWrapper map_wrapper;
+ void* elf_header = NULL;
+ if (!LoadELF(load_path, &map_wrapper, &elf_header)) {
+ fprintf(stderr, "Could not load ELF file: %s\n", obj_file.c_str());
+ return false;
+ }
+
+ if (!IsValidElf(elf_header)) {
+ fprintf(stderr, "Not a valid ELF file: %s\n", obj_file.c_str());
+ return false;
+ }
+
+ int elfclass = ElfClass(elf_header);
+ scoped_ptr<Module> module;
+ if (elfclass == ELFCLASS32) {
+ if (!InitModuleForElfClass<ElfClass32>(
+ reinterpret_cast<const Elf32_Ehdr*>(elf_header), obj_file, obj_os,
+ module)) {
+ fprintf(stderr, "Failed to load ELF module: %s\n", obj_file.c_str());
+ return false;
+ }
+ } else if (elfclass == ELFCLASS64) {
+ if (!InitModuleForElfClass<ElfClass64>(
+ reinterpret_cast<const Elf64_Ehdr*>(elf_header), obj_file, obj_os,
+ module)) {
+ fprintf(stderr, "Failed to load ELF module: %s\n", obj_file.c_str());
+ return false;
+ }
+ } else {
+ fprintf(stderr, "Unsupported module file: %s\n", obj_file.c_str());
+ return false;
+ }
+
+ return module->Write(sym_stream, ALL_SYMBOL_DATA);
+}
+
+bool ReadSymbolData(const string& load_path,
+ const string& obj_file,
+ const string& obj_os,
const std::vector<string>& debug_dirs,
const DumpOptions& options,
Module** module) {
MmapWrapper map_wrapper;
void* elf_header = NULL;
- if (!LoadELF(obj_file, &map_wrapper, &elf_header))
+ if (!LoadELF(load_path, &map_wrapper, &elf_header))
return false;
return ReadSymbolDataInternal(reinterpret_cast<uint8_t*>(elf_header),
- obj_file, debug_dirs, options, module);
+ obj_file, obj_os, debug_dirs, options, module);
}
} // namespace google_breakpad
diff --git a/src/common/linux/dump_symbols.h b/src/common/linux/dump_symbols.h
index 636bb72f..eaddd8b2 100644
--- a/src/common/linux/dump_symbols.h
+++ b/src/common/linux/dump_symbols.h
@@ -62,15 +62,28 @@ struct DumpOptions {
// If OBJ_FILE has been stripped but contains a .gnu_debuglink section,
// then look for the debug file in DEBUG_DIRS.
// SYMBOL_DATA allows limiting the type of symbol data written.
-bool WriteSymbolFile(const string &obj_file,
+bool WriteSymbolFile(const string &load_path,
+ const string &obj_file,
+ const string &obj_os,
const std::vector<string>& debug_dirs,
const DumpOptions& options,
std::ostream &sym_stream);
+// Read the selected object file's debugging information, and write out the
+// header only to |stream|. Return true on success; if an error occurs, report
+// it and return false. |obj_file| becomes the MODULE file name and |obj_os|
+// becomes the MODULE operating system.
+bool WriteSymbolFileHeader(const string& load_path,
+ const string& obj_file,
+ const string& obj_os,
+ std::ostream &sym_stream);
+
// As above, but simply return the debugging information in MODULE
// instead of writing it to a stream. The caller owns the resulting
// Module object and must delete it when finished.
-bool ReadSymbolData(const string& obj_file,
+bool ReadSymbolData(const string& load_path,
+ const string& obj_file,
+ const string& obj_os,
const std::vector<string>& debug_dirs,
const DumpOptions& options,
Module** module);
diff --git a/src/common/linux/dump_symbols_unittest.cc b/src/common/linux/dump_symbols_unittest.cc
index 3f86dbe6..54c21096 100644
--- a/src/common/linux/dump_symbols_unittest.cc
+++ b/src/common/linux/dump_symbols_unittest.cc
@@ -40,6 +40,8 @@
#include <vector>
#include "breakpad_googletest_includes.h"
+#include "common/linux/elf_gnu_compat.h"
+#include "common/linux/elfutils.h"
#include "common/linux/dump_symbols.h"
#include "common/linux/synth_elf.h"
#include "common/module.h"
@@ -49,11 +51,13 @@ namespace google_breakpad {
bool ReadSymbolDataInternal(const uint8_t* obj_file,
const string& obj_filename,
+ const string& obj_os,
const std::vector<string>& debug_dir,
const DumpOptions& options,
Module** module);
using google_breakpad::synth_elf::ELF;
+using google_breakpad::synth_elf::Notes;
using google_breakpad::synth_elf::StringTable;
using google_breakpad::synth_elf::SymbolTable;
using google_breakpad::test_assembler::kLittleEndian;
@@ -61,7 +65,9 @@ using google_breakpad::test_assembler::Section;
using std::stringstream;
using std::vector;
using ::testing::Test;
+using ::testing::Types;
+template<typename ElfClass>
class DumpSymbols : public Test {
public:
void GetElfContents(ELF& elf) {
@@ -78,20 +84,25 @@ class DumpSymbols : public Test {
uint8_t* elfdata;
};
-TEST_F(DumpSymbols, Invalid) {
+typedef Types<ElfClass32, ElfClass64> ElfClasses;
+
+TYPED_TEST_SUITE(DumpSymbols, ElfClasses);
+
+TYPED_TEST(DumpSymbols, Invalid) {
Elf32_Ehdr header;
memset(&header, 0, sizeof(header));
Module* module;
DumpOptions options(ALL_SYMBOL_DATA, true);
EXPECT_FALSE(ReadSymbolDataInternal(reinterpret_cast<uint8_t*>(&header),
"foo",
+ "Linux",
vector<string>(),
options,
&module));
}
-TEST_F(DumpSymbols, SimplePublic32) {
- ELF elf(EM_386, ELFCLASS32, kLittleEndian);
+TYPED_TEST(DumpSymbols, SimplePublic) {
+ ELF elf(TypeParam::kMachine, TypeParam::kClass, kLittleEndian);
// Zero out text section for simplicity.
Section text(kLittleEndian);
text.Append(4096, 0);
@@ -99,8 +110,11 @@ TEST_F(DumpSymbols, SimplePublic32) {
// Add a public symbol.
StringTable table(kLittleEndian);
- SymbolTable syms(kLittleEndian, 4, table);
- syms.AddSymbol("superfunc", (uint32_t)0x1000, (uint32_t)0x10,
+ SymbolTable syms(kLittleEndian, TypeParam::kAddrSize, table);
+ syms.AddSymbol("superfunc",
+ (typename TypeParam::Addr)0x1000,
+ (typename TypeParam::Addr)0x10,
+ // ELF32_ST_INFO works for 32-or 64-bit.
ELF32_ST_INFO(STB_GLOBAL, STT_FUNC),
SHN_UNDEF + 1);
int index = elf.AddSection(".dynstr", table, SHT_STRTAB);
@@ -109,39 +123,56 @@ TEST_F(DumpSymbols, SimplePublic32) {
SHF_ALLOC, // flags
0, // addr
index, // link
- sizeof(Elf32_Sym)); // entsize
+ sizeof(typename TypeParam::Sym)); // entsize
elf.Finish();
- GetElfContents(elf);
+ this->GetElfContents(elf);
Module* module;
DumpOptions options(ALL_SYMBOL_DATA, true);
- EXPECT_TRUE(ReadSymbolDataInternal(elfdata,
+ EXPECT_TRUE(ReadSymbolDataInternal(this->elfdata,
"foo",
+ "Linux",
vector<string>(),
options,
&module));
stringstream s;
module->Write(s, ALL_SYMBOL_DATA);
- EXPECT_EQ("MODULE Linux x86 000000000000000000000000000000000 foo\n"
- "PUBLIC 1000 0 superfunc\n",
- s.str());
+ const string expected =
+ string("MODULE Linux ") + TypeParam::kMachineName
+ + " 000000000000000000000000000000000 foo\n"
+ "INFO CODE_ID 00000000000000000000000000000000\n"
+ "PUBLIC 1000 0 superfunc\n";
+ EXPECT_EQ(expected, s.str());
delete module;
}
-TEST_F(DumpSymbols, SimplePublic64) {
- ELF elf(EM_X86_64, ELFCLASS64, kLittleEndian);
+TYPED_TEST(DumpSymbols, SimpleBuildID) {
+ ELF elf(TypeParam::kMachine, TypeParam::kClass, kLittleEndian);
// Zero out text section for simplicity.
Section text(kLittleEndian);
text.Append(4096, 0);
elf.AddSection(".text", text, SHT_PROGBITS);
+ // Add a Build ID
+ const uint8_t kExpectedIdentifierBytes[] =
+ {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+ 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
+ 0x10, 0x11, 0x12, 0x13};
+ Notes notes(kLittleEndian);
+ notes.AddNote(NT_GNU_BUILD_ID, "GNU", kExpectedIdentifierBytes,
+ sizeof(kExpectedIdentifierBytes));
+ elf.AddSection(".note.gnu.build-id", notes, SHT_NOTE);
+
// Add a public symbol.
StringTable table(kLittleEndian);
- SymbolTable syms(kLittleEndian, 8, table);
- syms.AddSymbol("superfunc", (uint64_t)0x1000, (uint64_t)0x10,
- ELF64_ST_INFO(STB_GLOBAL, STT_FUNC),
+ SymbolTable syms(kLittleEndian, TypeParam::kAddrSize, table);
+ syms.AddSymbol("superfunc",
+ (typename TypeParam::Addr)0x1000,
+ (typename TypeParam::Addr)0x10,
+ // ELF32_ST_INFO works for 32-or 64-bit.
+ ELF32_ST_INFO(STB_GLOBAL, STT_FUNC),
SHN_UNDEF + 1);
int index = elf.AddSection(".dynstr", table, SHT_STRTAB);
elf.AddSection(".dynsym", syms,
@@ -149,24 +180,29 @@ TEST_F(DumpSymbols, SimplePublic64) {
SHF_ALLOC, // flags
0, // addr
index, // link
- sizeof(Elf64_Sym)); // entsize
+ sizeof(typename TypeParam::Sym)); // entsize
elf.Finish();
- GetElfContents(elf);
+ this->GetElfContents(elf);
Module* module;
DumpOptions options(ALL_SYMBOL_DATA, true);
- EXPECT_TRUE(ReadSymbolDataInternal(elfdata,
+ EXPECT_TRUE(ReadSymbolDataInternal(this->elfdata,
"foo",
+ "Linux",
vector<string>(),
options,
&module));
stringstream s;
module->Write(s, ALL_SYMBOL_DATA);
- EXPECT_EQ("MODULE Linux x86_64 000000000000000000000000000000000 foo\n"
- "PUBLIC 1000 0 superfunc\n",
- s.str());
+ const string expected =
+ string("MODULE Linux ") + TypeParam::kMachineName
+ + " 030201000504070608090A0B0C0D0E0F0 foo\n"
+ "INFO CODE_ID 000102030405060708090A0B0C0D0E0F10111213\n"
+ "PUBLIC 1000 0 superfunc\n";
+ EXPECT_EQ(expected, s.str());
+ delete module;
}
} // namespace google_breakpad
diff --git a/src/common/linux/elf_core_dump.h b/src/common/linux/elf_core_dump.h
index d03c7a88..6e153745 100644
--- a/src/common/linux/elf_core_dump.h
+++ b/src/common/linux/elf_core_dump.h
@@ -34,6 +34,7 @@
#define COMMON_LINUX_ELF_CORE_DUMP_H_
#include <elf.h>
+#include <limits.h>
#include <link.h>
#include <stddef.h>
@@ -45,18 +46,18 @@ namespace google_breakpad {
// provides methods for accessing program headers and the note section.
class ElfCoreDump {
public:
- // ELF types based on the value of __WORDSIZE.
+ // ELF types based on the native word size.
typedef ElfW(Ehdr) Ehdr;
typedef ElfW(Nhdr) Nhdr;
typedef ElfW(Phdr) Phdr;
typedef ElfW(Word) Word;
typedef ElfW(Addr) Addr;
-#if __WORDSIZE == 32
+#if ULONG_MAX == 0xffffffff
static const int kClass = ELFCLASS32;
-#elif __WORDSIZE == 64
+#elif ULONG_MAX == 0xffffffffffffffff
static const int kClass = ELFCLASS64;
#else
-#error "Unsupported __WORDSIZE for ElfCoreDump."
+#error "Unsupported word size for ElfCoreDump."
#endif
// A class encapsulating the note content in a core dump, which provides
diff --git a/src/common/linux/elf_core_dump_unittest.cc b/src/common/linux/elf_core_dump_unittest.cc
index 9b41dcee..2399c12f 100644
--- a/src/common/linux/elf_core_dump_unittest.cc
+++ b/src/common/linux/elf_core_dump_unittest.cc
@@ -244,9 +244,18 @@ TEST(ElfCoreDumpTest, ValidCoreFile) {
note = note.GetNextNote();
}
- EXPECT_TRUE(expected_thread_ids == actual_thread_ids);
+#if defined(THREAD_SANITIZER)
+ for (std::set<pid_t>::const_iterator expected = expected_thread_ids.begin();
+ expected != expected_thread_ids.end();
+ ++expected) {
+ EXPECT_NE(actual_thread_ids.find(*expected), actual_thread_ids.end());
+ }
+ EXPECT_GE(num_nt_prstatus, kNumOfThreads);
+#else
+ EXPECT_EQ(actual_thread_ids, expected_thread_ids);
+ EXPECT_EQ(num_nt_prstatus, kNumOfThreads);
+#endif
EXPECT_EQ(1U, num_nt_prpsinfo);
- EXPECT_EQ(kNumOfThreads, num_nt_prstatus);
#if defined(__i386__) || defined(__x86_64__)
EXPECT_EQ(num_pr_fpvalid, num_nt_fpregset);
#endif
diff --git a/src/common/linux/elf_gnu_compat.h b/src/common/linux/elf_gnu_compat.h
index f870cbc7..0a3dfedb 100644
--- a/src/common/linux/elf_gnu_compat.h
+++ b/src/common/linux/elf_gnu_compat.h
@@ -43,4 +43,9 @@
#define NT_GNU_BUILD_ID 3
#endif
+// Newer Linux systems offer this.
+#ifndef NT_SIGINFO
+#define NT_SIGINFO 0x53494749
+#endif
+
#endif // COMMON_LINUX_ELF_GNU_COMPAT_H_
diff --git a/src/common/linux/elfutils.cc b/src/common/linux/elfutils.cc
index a79391c1..9532d5ad 100644
--- a/src/common/linux/elfutils.cc
+++ b/src/common/linux/elfutils.cc
@@ -78,14 +78,12 @@ void FindElfClassSection(const char *elf_base,
template<typename ElfClass>
void FindElfClassSegment(const char *elf_base,
typename ElfClass::Word segment_type,
- const void **segment_start,
- size_t *segment_size) {
+ wasteful_vector<ElfSegment> *segments) {
typedef typename ElfClass::Ehdr Ehdr;
typedef typename ElfClass::Phdr Phdr;
assert(elf_base);
- assert(segment_start);
- assert(segment_size);
+ assert(segments);
assert(my_strncmp(elf_base, ELFMAG, SELFMAG) == 0);
@@ -97,9 +95,10 @@ void FindElfClassSegment(const char *elf_base,
for (int i = 0; i < elf_header->e_phnum; ++i) {
if (phdrs[i].p_type == segment_type) {
- *segment_start = elf_base + phdrs[i].p_offset;
- *segment_size = phdrs[i].p_filesz;
- return;
+ ElfSegment seg = {};
+ seg.start = elf_base + phdrs[i].p_offset;
+ seg.size = phdrs[i].p_filesz;
+ segments->push_back(seg);
}
}
}
@@ -122,8 +121,7 @@ bool FindElfSection(const void *elf_mapped_base,
const char *section_name,
uint32_t section_type,
const void **section_start,
- size_t *section_size,
- int *elfclass) {
+ size_t *section_size) {
assert(elf_mapped_base);
assert(section_start);
assert(section_size);
@@ -135,10 +133,6 @@ bool FindElfSection(const void *elf_mapped_base,
return false;
int cls = ElfClass(elf_mapped_base);
- if (elfclass) {
- *elfclass = cls;
- }
-
const char* elf_base =
static_cast<const char*>(elf_mapped_base);
@@ -155,40 +149,89 @@ bool FindElfSection(const void *elf_mapped_base,
return false;
}
-bool FindElfSegment(const void *elf_mapped_base,
- uint32_t segment_type,
- const void **segment_start,
- size_t *segment_size,
- int *elfclass) {
+bool FindElfSegments(const void* elf_mapped_base,
+ uint32_t segment_type,
+ wasteful_vector<ElfSegment>* segments) {
assert(elf_mapped_base);
- assert(segment_start);
- assert(segment_size);
-
- *segment_start = NULL;
- *segment_size = 0;
+ assert(segments);
if (!IsValidElf(elf_mapped_base))
return false;
int cls = ElfClass(elf_mapped_base);
- if (elfclass) {
- *elfclass = cls;
- }
-
const char* elf_base =
static_cast<const char*>(elf_mapped_base);
if (cls == ELFCLASS32) {
- FindElfClassSegment<ElfClass32>(elf_base, segment_type,
- segment_start, segment_size);
- return *segment_start != NULL;
+ FindElfClassSegment<ElfClass32>(elf_base, segment_type, segments);
+ return true;
} else if (cls == ELFCLASS64) {
- FindElfClassSegment<ElfClass64>(elf_base, segment_type,
- segment_start, segment_size);
- return *segment_start != NULL;
+ FindElfClassSegment<ElfClass64>(elf_base, segment_type, segments);
+ return true;
+ }
+
+ return false;
+}
+
+template <typename ElfClass>
+bool FindElfSoNameFromDynamicSection(const void* section_start,
+ size_t section_size,
+ const void* dynstr_start,
+ size_t dynstr_size,
+ char* soname,
+ size_t soname_size) {
+ typedef typename ElfClass::Dyn Dyn;
+
+ auto* dynamic = static_cast<const Dyn*>(section_start);
+ size_t dcount = section_size / sizeof(Dyn);
+ for (const Dyn* dyn = dynamic; dyn < dynamic + dcount; ++dyn) {
+ if (dyn->d_tag == DT_SONAME) {
+ const char* dynstr = static_cast<const char*>(dynstr_start);
+ if (dyn->d_un.d_val >= dynstr_size) {
+ // Beyond the end of the dynstr section
+ return false;
+ }
+ const char* str = dynstr + dyn->d_un.d_val;
+ const size_t maxsize = dynstr_size - dyn->d_un.d_val;
+ my_strlcpy(soname, str, maxsize < soname_size ? maxsize : soname_size);
+ return true;
+ }
}
return false;
}
+bool ElfFileSoNameFromMappedFile(const void* elf_base,
+ char* soname,
+ size_t soname_size) {
+ if (!IsValidElf(elf_base)) {
+ // Not ELF
+ return false;
+ }
+
+ const void* segment_start;
+ size_t segment_size;
+ if (!FindElfSection(elf_base, ".dynamic", SHT_DYNAMIC, &segment_start,
+ &segment_size)) {
+ // No dynamic section
+ return false;
+ }
+
+ const void* dynstr_start;
+ size_t dynstr_size;
+ if (!FindElfSection(elf_base, ".dynstr", SHT_STRTAB, &dynstr_start,
+ &dynstr_size)) {
+ // No dynstr section
+ return false;
+ }
+
+ int cls = ElfClass(elf_base);
+ return cls == ELFCLASS32 ? FindElfSoNameFromDynamicSection<ElfClass32>(
+ segment_start, segment_size, dynstr_start,
+ dynstr_size, soname, soname_size)
+ : FindElfSoNameFromDynamicSection<ElfClass64>(
+ segment_start, segment_size, dynstr_start,
+ dynstr_size, soname, soname_size);
+}
+
} // namespace google_breakpad
diff --git a/src/common/linux/elfutils.h b/src/common/linux/elfutils.h
index dccdc235..aefb6cf5 100644
--- a/src/common/linux/elfutils.h
+++ b/src/common/linux/elfutils.h
@@ -37,34 +37,46 @@
#include <link.h>
#include <stdint.h>
+#include "common/memory_allocator.h"
+
namespace google_breakpad {
// Traits classes so consumers can write templatized code to deal
// with specific ELF bits.
struct ElfClass32 {
typedef Elf32_Addr Addr;
+ typedef Elf32_Dyn Dyn;
typedef Elf32_Ehdr Ehdr;
typedef Elf32_Nhdr Nhdr;
typedef Elf32_Phdr Phdr;
typedef Elf32_Shdr Shdr;
typedef Elf32_Half Half;
typedef Elf32_Off Off;
+ typedef Elf32_Sym Sym;
typedef Elf32_Word Word;
+
static const int kClass = ELFCLASS32;
+ static const uint16_t kMachine = EM_386;
static const size_t kAddrSize = sizeof(Elf32_Addr);
+ static constexpr const char* kMachineName = "x86";
};
struct ElfClass64 {
typedef Elf64_Addr Addr;
+ typedef Elf64_Dyn Dyn;
typedef Elf64_Ehdr Ehdr;
typedef Elf64_Nhdr Nhdr;
typedef Elf64_Phdr Phdr;
typedef Elf64_Shdr Shdr;
typedef Elf64_Half Half;
typedef Elf64_Off Off;
+ typedef Elf64_Sym Sym;
typedef Elf64_Word Word;
+
static const int kClass = ELFCLASS64;
+ static const uint16_t kMachine = EM_X86_64;
static const size_t kAddrSize = sizeof(Elf64_Addr);
+ static constexpr const char* kMachineName = "x86_64";
};
bool IsValidElf(const void* elf_header);
@@ -73,14 +85,12 @@ int ElfClass(const void* elf_base);
// Attempt to find a section named |section_name| of type |section_type|
// in the ELF binary data at |elf_mapped_base|. On success, returns true
// and sets |*section_start| to point to the start of the section data,
-// and |*section_size| to the size of the section's data. If |elfclass|
-// is not NULL, set |*elfclass| to the ELF file class.
+// and |*section_size| to the size of the section's data.
bool FindElfSection(const void *elf_mapped_base,
const char *section_name,
uint32_t section_type,
const void **section_start,
- size_t *section_size,
- int *elfclass);
+ size_t *section_size);
// Internal helper method, exposed for convenience for callers
// that already have more info.
@@ -93,16 +103,17 @@ FindElfSectionByName(const char* name,
const char* names_end,
int nsection);
-// Attempt to find the first segment of type |segment_type| in the ELF
-// binary data at |elf_mapped_base|. On success, returns true and sets
-// |*segment_start| to point to the start of the segment data, and
-// and |*segment_size| to the size of the segment's data. If |elfclass|
-// is not NULL, set |*elfclass| to the ELF file class.
-bool FindElfSegment(const void *elf_mapped_base,
- uint32_t segment_type,
- const void **segment_start,
- size_t *segment_size,
- int *elfclass);
+struct ElfSegment {
+ const void* start;
+ size_t size;
+};
+
+// Attempt to find all segments of type |segment_type| in the ELF
+// binary data at |elf_mapped_base|. On success, returns true and fills
+// |*segments| with a list of segments of the given type.
+bool FindElfSegments(const void* elf_mapped_base,
+ uint32_t segment_type,
+ wasteful_vector<ElfSegment>* segments);
// Convert an offset from an Elf header into a pointer to the mapped
// address in the current process. Takes an extra template parameter
@@ -113,6 +124,12 @@ const T*
GetOffset(const typename ElfClass::Ehdr* elf_header,
typename ElfClass::Off offset);
+// Read the value of DT_SONAME from the elf file mapped at |elf_base|. Returns
+// true and fills |soname| with the result if found.
+bool ElfFileSoNameFromMappedFile(const void* elf_base,
+ char* soname,
+ size_t soname_size);
+
} // namespace google_breakpad
#endif // COMMON_LINUX_ELFUTILS_H_
diff --git a/src/common/linux/file_id.cc b/src/common/linux/file_id.cc
index 00b37313..67921c45 100644
--- a/src/common/linux/file_id.cc
+++ b/src/common/linux/file_id.cc
@@ -39,15 +39,20 @@
#include <string.h>
#include <algorithm>
+#include <string>
#include "common/linux/elf_gnu_compat.h"
#include "common/linux/elfutils.h"
#include "common/linux/linux_libc_support.h"
#include "common/linux/memory_mapped_file.h"
+#include "common/using_std_string.h"
#include "third_party/lss/linux_syscall_support.h"
namespace google_breakpad {
+// Used in a few places for backwards-compatibility.
+const size_t kMDGUIDSize = sizeof(MDGUID);
+
FileID::FileID(const char* path) : path_(path) {}
// ELF note name and desc are 32-bits word padded.
@@ -56,10 +61,11 @@ FileID::FileID(const char* path) : path_(path) {}
// These functions are also used inside the crashed process, so be safe
// and use the syscall/libc wrappers instead of direct syscalls or libc.
-template<typename ElfClass>
static bool ElfClassBuildIDNoteIdentifier(const void *section, size_t length,
- uint8_t identifier[kMDGUIDSize]) {
- typedef typename ElfClass::Nhdr Nhdr;
+ wasteful_vector<uint8_t>& identifier) {
+ static_assert(sizeof(ElfClass32::Nhdr) == sizeof(ElfClass64::Nhdr),
+ "Elf32_Nhdr and Elf64_Nhdr should be the same");
+ typedef typename ElfClass32::Nhdr Nhdr;
const void* section_end = reinterpret_cast<const char*>(section) + length;
const Nhdr* note_header = reinterpret_cast<const Nhdr*>(section);
@@ -76,39 +82,35 @@ static bool ElfClassBuildIDNoteIdentifier(const void *section, size_t length,
return false;
}
- const char* build_id = reinterpret_cast<const char*>(note_header) +
+ const uint8_t* build_id = reinterpret_cast<const uint8_t*>(note_header) +
sizeof(Nhdr) + NOTE_PADDING(note_header->n_namesz);
- // Copy as many bits of the build ID as will fit
- // into the GUID space.
- my_memset(identifier, 0, kMDGUIDSize);
- memcpy(identifier, build_id,
- std::min(kMDGUIDSize, (size_t)note_header->n_descsz));
+ identifier.insert(identifier.end(),
+ build_id,
+ build_id + note_header->n_descsz);
return true;
}
// Attempt to locate a .note.gnu.build-id section in an ELF binary
-// and copy as many bytes of it as will fit into |identifier|.
-static bool FindElfBuildIDNote(const void *elf_mapped_base,
- uint8_t identifier[kMDGUIDSize]) {
- void* note_section;
- size_t note_size;
- int elfclass;
- if ((!FindElfSegment(elf_mapped_base, PT_NOTE,
- (const void**)&note_section, &note_size, &elfclass) ||
- note_size == 0) &&
- (!FindElfSection(elf_mapped_base, ".note.gnu.build-id", SHT_NOTE,
- (const void**)&note_section, &note_size, &elfclass) ||
- note_size == 0)) {
- return false;
+// and copy it into |identifier|.
+static bool FindElfBuildIDNote(const void* elf_mapped_base,
+ wasteful_vector<uint8_t>& identifier) {
+ PageAllocator allocator;
+ // lld normally creates 2 PT_NOTEs, gold normally creates 1.
+ auto_wasteful_vector<ElfSegment, 2> segs(&allocator);
+ if (FindElfSegments(elf_mapped_base, PT_NOTE, &segs)) {
+ for (ElfSegment& seg : segs) {
+ if (ElfClassBuildIDNoteIdentifier(seg.start, seg.size, identifier)) {
+ return true;
+ }
+ }
}
- if (elfclass == ELFCLASS32) {
- return ElfClassBuildIDNoteIdentifier<ElfClass32>(note_section, note_size,
- identifier);
- } else if (elfclass == ELFCLASS64) {
- return ElfClassBuildIDNoteIdentifier<ElfClass64>(note_section, note_size,
- identifier);
+ void* note_section;
+ size_t note_size;
+ if (FindElfSection(elf_mapped_base, ".note.gnu.build-id", SHT_NOTE,
+ (const void**)&note_section, &note_size)) {
+ return ElfClassBuildIDNoteIdentifier(note_section, note_size, identifier);
}
return false;
@@ -116,17 +118,21 @@ static bool FindElfBuildIDNote(const void *elf_mapped_base,
// Attempt to locate the .text section of an ELF binary and generate
// a simple hash by XORing the first page worth of bytes into |identifier|.
-static bool HashElfTextSection(const void *elf_mapped_base,
- uint8_t identifier[kMDGUIDSize]) {
+static bool HashElfTextSection(const void* elf_mapped_base,
+ wasteful_vector<uint8_t>& identifier) {
+ identifier.resize(kMDGUIDSize);
+
void* text_section;
size_t text_size;
if (!FindElfSection(elf_mapped_base, ".text", SHT_PROGBITS,
- (const void**)&text_section, &text_size, NULL) ||
+ (const void**)&text_section, &text_size) ||
text_size == 0) {
return false;
}
- my_memset(identifier, 0, kMDGUIDSize);
+ // Only provide |kMDGUIDSize| bytes to keep identifiers produced by this
+ // function backwards-compatible.
+ my_memset(&identifier[0], 0, kMDGUIDSize);
const uint8_t* ptr = reinterpret_cast<const uint8_t*>(text_section);
const uint8_t* ptr_end = ptr + std::min(text_size, static_cast<size_t>(4096));
while (ptr < ptr_end) {
@@ -139,7 +145,7 @@ static bool HashElfTextSection(const void *elf_mapped_base,
// static
bool FileID::ElfFileIdentifierFromMappedFile(const void* base,
- uint8_t identifier[kMDGUIDSize]) {
+ wasteful_vector<uint8_t>& identifier) {
// Look for a build id note first.
if (FindElfBuildIDNote(base, identifier))
return true;
@@ -148,7 +154,7 @@ bool FileID::ElfFileIdentifierFromMappedFile(const void* base,
return HashElfTextSection(base, identifier);
}
-bool FileID::ElfFileIdentifier(uint8_t identifier[kMDGUIDSize]) {
+bool FileID::ElfFileIdentifier(wasteful_vector<uint8_t>& identifier) {
MemoryMappedFile mapped_file(path_.c_str(), 0);
if (!mapped_file.data()) // Should probably check if size >= ElfW(Ehdr)?
return false;
@@ -156,13 +162,26 @@ bool FileID::ElfFileIdentifier(uint8_t identifier[kMDGUIDSize]) {
return ElfFileIdentifierFromMappedFile(mapped_file.data(), identifier);
}
+// These three functions are not ever called in an unsafe context, so it's OK
+// to allocate memory and use libc.
+static string bytes_to_hex_string(const uint8_t* bytes, size_t count) {
+ string result;
+ for (unsigned int idx = 0; idx < count; ++idx) {
+ char buf[3];
+ snprintf(buf, sizeof(buf), "%02X", bytes[idx]);
+ result.append(buf);
+ }
+ return result;
+}
+
// static
-void FileID::ConvertIdentifierToString(const uint8_t identifier[kMDGUIDSize],
- char* buffer, int buffer_length) {
- uint8_t identifier_swapped[kMDGUIDSize];
+string FileID::ConvertIdentifierToUUIDString(
+ const wasteful_vector<uint8_t>& identifier) {
+ uint8_t identifier_swapped[kMDGUIDSize] = { 0 };
// Endian-ness swap to match dump processor expectation.
- memcpy(identifier_swapped, identifier, kMDGUIDSize);
+ memcpy(identifier_swapped, &identifier[0],
+ std::min(kMDGUIDSize, identifier.size()));
uint32_t* data1 = reinterpret_cast<uint32_t*>(identifier_swapped);
*data1 = htonl(*data1);
uint16_t* data2 = reinterpret_cast<uint16_t*>(identifier_swapped + 4);
@@ -170,22 +189,13 @@ void FileID::ConvertIdentifierToString(const uint8_t identifier[kMDGUIDSize],
uint16_t* data3 = reinterpret_cast<uint16_t*>(identifier_swapped + 6);
*data3 = htons(*data3);
- int buffer_idx = 0;
- for (unsigned int idx = 0;
- (buffer_idx < buffer_length) && (idx < kMDGUIDSize);
- ++idx) {
- int hi = (identifier_swapped[idx] >> 4) & 0x0F;
- int lo = (identifier_swapped[idx]) & 0x0F;
-
- if (idx == 4 || idx == 6 || idx == 8 || idx == 10)
- buffer[buffer_idx++] = '-';
-
- buffer[buffer_idx++] = (hi >= 10) ? 'A' + hi - 10 : '0' + hi;
- buffer[buffer_idx++] = (lo >= 10) ? 'A' + lo - 10 : '0' + lo;
- }
+ return bytes_to_hex_string(identifier_swapped, kMDGUIDSize);
+}
- // NULL terminate
- buffer[(buffer_idx < buffer_length) ? buffer_idx : buffer_idx - 1] = 0;
+// static
+string FileID::ConvertIdentifierToString(
+ const wasteful_vector<uint8_t>& identifier) {
+ return bytes_to_hex_string(&identifier[0], identifier.size());
}
} // namespace google_breakpad
diff --git a/src/common/linux/file_id.h b/src/common/linux/file_id.h
index 2642722a..4aff021d 100644
--- a/src/common/linux/file_id.h
+++ b/src/common/linux/file_id.h
@@ -37,10 +37,16 @@
#include <string>
#include "common/linux/guid_creator.h"
+#include "common/memory_allocator.h"
+#include "common/using_std_string.h"
namespace google_breakpad {
-static const size_t kMDGUIDSize = sizeof(MDGUID);
+// GNU binutils' ld defaults to 'sha1', which is 160 bits == 20 bytes,
+// so this is enough to fit that, which most binaries will use.
+// This is just a sensible default for auto_wasteful_vector so most
+// callers can get away with stack allocation.
+static const size_t kDefaultBuildIdSize = 20;
class FileID {
public:
@@ -48,29 +54,33 @@ class FileID {
~FileID() {}
// Load the identifier for the elf file path specified in the constructor into
- // |identifier|. Return false if the identifier could not be created for the
- // file.
+ // |identifier|.
+ //
// The current implementation will look for a .note.gnu.build-id
// section and use that as the file id, otherwise it falls back to
// XORing the first 4096 bytes of the .text section to generate an identifier.
- bool ElfFileIdentifier(uint8_t identifier[kMDGUIDSize]);
+ bool ElfFileIdentifier(wasteful_vector<uint8_t>& identifier);
// Load the identifier for the elf file mapped into memory at |base| into
- // |identifier|. Return false if the identifier could not be created for the
+ // |identifier|. Return false if the identifier could not be created for this
// file.
- static bool ElfFileIdentifierFromMappedFile(const void* base,
- uint8_t identifier[kMDGUIDSize]);
+ static bool ElfFileIdentifierFromMappedFile(
+ const void* base,
+ wasteful_vector<uint8_t>& identifier);
+
+ // Convert the |identifier| data to a string. The string will
+ // be formatted as a UUID in all uppercase without dashes.
+ // (e.g., 22F065BBFC9C49F780FE26A7CEBD7BCE).
+ static string ConvertIdentifierToUUIDString(
+ const wasteful_vector<uint8_t>& identifier);
- // Convert the |identifier| data to a NULL terminated string. The string will
- // be formatted as a UUID (e.g., 22F065BB-FC9C-49F7-80FE-26A7CEBD7BCE).
- // The |buffer| should be at least 37 bytes long to receive all of the data
- // and termination. Shorter buffers will contain truncated data.
- static void ConvertIdentifierToString(const uint8_t identifier[kMDGUIDSize],
- char* buffer, int buffer_length);
+ // Convert the entire |identifier| data to a hex string.
+ static string ConvertIdentifierToString(
+ const wasteful_vector<uint8_t>& identifier);
private:
// Storage for the path specified
- std::string path_;
+ string path_;
};
} // namespace google_breakpad
diff --git a/src/common/linux/file_id_unittest.cc b/src/common/linux/file_id_unittest.cc
index 760eae82..f4f9ac45 100644
--- a/src/common/linux/file_id_unittest.cc
+++ b/src/common/linux/file_id_unittest.cc
@@ -33,6 +33,7 @@
#include <stdlib.h>
#include <string>
+#include <vector>
#include "common/linux/elf_gnu_compat.h"
#include "common/linux/elfutils.h"
@@ -45,13 +46,11 @@
#include "breakpad_googletest_includes.h"
using namespace google_breakpad;
-using google_breakpad::ElfClass32;
-using google_breakpad::ElfClass64;
-using google_breakpad::SafeReadLink;
using google_breakpad::synth_elf::ELF;
using google_breakpad::synth_elf::Notes;
using google_breakpad::test_assembler::kLittleEndian;
using google_breakpad::test_assembler::Section;
+using std::vector;
using ::testing::Types;
namespace {
@@ -64,6 +63,8 @@ void PopulateSection(Section* section, int size, int prime_number) {
section->Append(1, (i % prime_number) % 256);
}
+typedef wasteful_vector<uint8_t> id_vector;
+
} // namespace
#ifndef __ANDROID__
@@ -87,19 +88,20 @@ TEST(FileIDStripTest, StripSelf) {
sprintf(cmdline, "strip \"%s\"", templ.c_str());
ASSERT_EQ(0, system(cmdline)) << "Failed to execute: " << cmdline;
- uint8_t identifier1[sizeof(MDGUID)];
- uint8_t identifier2[sizeof(MDGUID)];
+ PageAllocator allocator;
+ id_vector identifier1(&allocator, kDefaultBuildIdSize);
+ id_vector identifier2(&allocator, kDefaultBuildIdSize);
+
FileID fileid1(exe_name);
EXPECT_TRUE(fileid1.ElfFileIdentifier(identifier1));
FileID fileid2(templ.c_str());
EXPECT_TRUE(fileid2.ElfFileIdentifier(identifier2));
- char identifier_string1[37];
- char identifier_string2[37];
- FileID::ConvertIdentifierToString(identifier1, identifier_string1,
- 37);
- FileID::ConvertIdentifierToString(identifier2, identifier_string2,
- 37);
- EXPECT_STREQ(identifier_string1, identifier_string2);
+
+ string identifier_string1 =
+ FileID::ConvertIdentifierToUUIDString(identifier1);
+ string identifier_string2 =
+ FileID::ConvertIdentifierToUUIDString(identifier2);
+ EXPECT_EQ(identifier_string1, identifier_string2);
}
#endif // !__ANDROID__
@@ -116,19 +118,31 @@ public:
elfdata = &elfdata_v[0];
}
+ id_vector make_vector() {
+ return id_vector(&allocator, kDefaultBuildIdSize);
+ }
+
+ template<size_t N>
+ string get_file_id(const uint8_t (&data)[N]) {
+ id_vector expected_identifier(make_vector());
+ expected_identifier.insert(expected_identifier.end(),
+ &data[0],
+ data + N);
+ return FileID::ConvertIdentifierToUUIDString(expected_identifier);
+ }
+
vector<uint8_t> elfdata_v;
uint8_t* elfdata;
+ PageAllocator allocator;
};
typedef Types<ElfClass32, ElfClass64> ElfClasses;
-TYPED_TEST_CASE(FileIDTest, ElfClasses);
+TYPED_TEST_SUITE(FileIDTest, ElfClasses);
TYPED_TEST(FileIDTest, ElfClass) {
- uint8_t identifier[sizeof(MDGUID)];
const char expected_identifier_string[] =
- "80808080-8080-0000-0000-008080808080";
- char identifier_string[sizeof(expected_identifier_string)];
+ "80808080808000000000008080808080";
const size_t kTextSectionSize = 128;
ELF elf(EM_386, TypeParam::kClass, kLittleEndian);
@@ -140,58 +154,106 @@ TYPED_TEST(FileIDTest, ElfClass) {
elf.Finish();
this->GetElfContents(elf);
+ id_vector identifier(this->make_vector());
EXPECT_TRUE(FileID::ElfFileIdentifierFromMappedFile(this->elfdata,
identifier));
- FileID::ConvertIdentifierToString(identifier, identifier_string,
- sizeof(identifier_string));
- EXPECT_STREQ(expected_identifier_string, identifier_string);
+ string identifier_string = FileID::ConvertIdentifierToUUIDString(identifier);
+ EXPECT_EQ(expected_identifier_string, identifier_string);
}
TYPED_TEST(FileIDTest, BuildID) {
- const uint8_t kExpectedIdentifier[sizeof(MDGUID)] =
+ const uint8_t kExpectedIdentifierBytes[] =
{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
- 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F};
- char expected_identifier_string[] =
- "00000000-0000-0000-0000-000000000000";
- FileID::ConvertIdentifierToString(kExpectedIdentifier,
- expected_identifier_string,
- sizeof(expected_identifier_string));
+ 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
+ 0x10, 0x11, 0x12, 0x13};
+ const string expected_identifier_string =
+ this->get_file_id(kExpectedIdentifierBytes);
- uint8_t identifier[sizeof(MDGUID)];
- char identifier_string[sizeof(expected_identifier_string)];
+ ELF elf(EM_386, TypeParam::kClass, kLittleEndian);
+ Section text(kLittleEndian);
+ text.Append(4096, 0);
+ elf.AddSection(".text", text, SHT_PROGBITS);
+ Notes notes(kLittleEndian);
+ notes.AddNote(NT_GNU_BUILD_ID, "GNU", kExpectedIdentifierBytes,
+ sizeof(kExpectedIdentifierBytes));
+ elf.AddSection(".note.gnu.build-id", notes, SHT_NOTE);
+ elf.Finish();
+ this->GetElfContents(elf);
+
+ id_vector identifier(this->make_vector());
+ EXPECT_TRUE(FileID::ElfFileIdentifierFromMappedFile(this->elfdata,
+ identifier));
+ EXPECT_EQ(sizeof(kExpectedIdentifierBytes), identifier.size());
+
+ string identifier_string = FileID::ConvertIdentifierToUUIDString(identifier);
+ EXPECT_EQ(expected_identifier_string, identifier_string);
+}
+
+// Test that a build id note with fewer bytes than usual is handled.
+TYPED_TEST(FileIDTest, BuildIDShort) {
+ const uint8_t kExpectedIdentifierBytes[] =
+ {0x00, 0x01, 0x02, 0x03};
+ const string expected_identifier_string =
+ this->get_file_id(kExpectedIdentifierBytes);
ELF elf(EM_386, TypeParam::kClass, kLittleEndian);
Section text(kLittleEndian);
text.Append(4096, 0);
elf.AddSection(".text", text, SHT_PROGBITS);
Notes notes(kLittleEndian);
- notes.AddNote(NT_GNU_BUILD_ID, "GNU", kExpectedIdentifier,
- sizeof(kExpectedIdentifier));
+ notes.AddNote(NT_GNU_BUILD_ID, "GNU", kExpectedIdentifierBytes,
+ sizeof(kExpectedIdentifierBytes));
elf.AddSection(".note.gnu.build-id", notes, SHT_NOTE);
elf.Finish();
this->GetElfContents(elf);
+ id_vector identifier(this->make_vector());
EXPECT_TRUE(FileID::ElfFileIdentifierFromMappedFile(this->elfdata,
identifier));
+ EXPECT_EQ(sizeof(kExpectedIdentifierBytes), identifier.size());
- FileID::ConvertIdentifierToString(identifier, identifier_string,
- sizeof(identifier_string));
- EXPECT_STREQ(expected_identifier_string, identifier_string);
+ string identifier_string = FileID::ConvertIdentifierToUUIDString(identifier);
+ EXPECT_EQ(expected_identifier_string, identifier_string);
}
-TYPED_TEST(FileIDTest, BuildIDPH) {
- const uint8_t kExpectedIdentifier[sizeof(MDGUID)] =
+// Test that a build id note with more bytes than usual is handled.
+TYPED_TEST(FileIDTest, BuildIDLong) {
+ const uint8_t kExpectedIdentifierBytes[] =
{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
- 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F};
- char expected_identifier_string[] =
- "00000000-0000-0000-0000-000000000000";
- FileID::ConvertIdentifierToString(kExpectedIdentifier,
- expected_identifier_string,
- sizeof(expected_identifier_string));
+ 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
+ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
+ 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F};
+ const string expected_identifier_string =
+ this->get_file_id(kExpectedIdentifierBytes);
- uint8_t identifier[sizeof(MDGUID)];
- char identifier_string[sizeof(expected_identifier_string)];
+ ELF elf(EM_386, TypeParam::kClass, kLittleEndian);
+ Section text(kLittleEndian);
+ text.Append(4096, 0);
+ elf.AddSection(".text", text, SHT_PROGBITS);
+ Notes notes(kLittleEndian);
+ notes.AddNote(NT_GNU_BUILD_ID, "GNU", kExpectedIdentifierBytes,
+ sizeof(kExpectedIdentifierBytes));
+ elf.AddSection(".note.gnu.build-id", notes, SHT_NOTE);
+ elf.Finish();
+ this->GetElfContents(elf);
+
+ id_vector identifier(this->make_vector());
+ EXPECT_TRUE(FileID::ElfFileIdentifierFromMappedFile(this->elfdata,
+ identifier));
+ EXPECT_EQ(sizeof(kExpectedIdentifierBytes), identifier.size());
+
+ string identifier_string = FileID::ConvertIdentifierToUUIDString(identifier);
+ EXPECT_EQ(expected_identifier_string, identifier_string);
+}
+
+TYPED_TEST(FileIDTest, BuildIDPH) {
+ const uint8_t kExpectedIdentifierBytes[] =
+ {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+ 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
+ 0x10, 0x11, 0x12, 0x13};
+ const string expected_identifier_string =
+ this->get_file_id(kExpectedIdentifierBytes);
ELF elf(EM_386, TypeParam::kClass, kLittleEndian);
Section text(kLittleEndian);
@@ -200,31 +262,59 @@ TYPED_TEST(FileIDTest, BuildIDPH) {
Notes notes(kLittleEndian);
notes.AddNote(0, "Linux",
reinterpret_cast<const uint8_t *>("\0x42\0x02\0\0"), 4);
- notes.AddNote(NT_GNU_BUILD_ID, "GNU", kExpectedIdentifier,
- sizeof(kExpectedIdentifier));
+ notes.AddNote(NT_GNU_BUILD_ID, "GNU", kExpectedIdentifierBytes,
+ sizeof(kExpectedIdentifierBytes));
int note_idx = elf.AddSection(".note", notes, SHT_NOTE);
elf.AddSegment(note_idx, note_idx, PT_NOTE);
elf.Finish();
this->GetElfContents(elf);
+ id_vector identifier(this->make_vector());
+ EXPECT_TRUE(FileID::ElfFileIdentifierFromMappedFile(this->elfdata,
+ identifier));
+ EXPECT_EQ(sizeof(kExpectedIdentifierBytes), identifier.size());
+
+ string identifier_string = FileID::ConvertIdentifierToUUIDString(identifier);
+ EXPECT_EQ(expected_identifier_string, identifier_string);
+}
+
+TYPED_TEST(FileIDTest, BuildIDMultiplePH) {
+ const uint8_t kExpectedIdentifierBytes[] =
+ {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+ 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
+ 0x10, 0x11, 0x12, 0x13};
+ const string expected_identifier_string =
+ this->get_file_id(kExpectedIdentifierBytes);
+
+ ELF elf(EM_386, TypeParam::kClass, kLittleEndian);
+ Section text(kLittleEndian);
+ text.Append(4096, 0);
+ elf.AddSection(".text", text, SHT_PROGBITS);
+ Notes notes1(kLittleEndian);
+ notes1.AddNote(0, "Linux",
+ reinterpret_cast<const uint8_t *>("\0x42\0x02\0\0"), 4);
+ Notes notes2(kLittleEndian);
+ notes2.AddNote(NT_GNU_BUILD_ID, "GNU", kExpectedIdentifierBytes,
+ sizeof(kExpectedIdentifierBytes));
+ int note1_idx = elf.AddSection(".note1", notes1, SHT_NOTE);
+ int note2_idx = elf.AddSection(".note2", notes2, SHT_NOTE);
+ elf.AddSegment(note1_idx, note1_idx, PT_NOTE);
+ elf.AddSegment(note2_idx, note2_idx, PT_NOTE);
+ elf.Finish();
+ this->GetElfContents(elf);
+
+ id_vector identifier(this->make_vector());
EXPECT_TRUE(FileID::ElfFileIdentifierFromMappedFile(this->elfdata,
identifier));
+ EXPECT_EQ(sizeof(kExpectedIdentifierBytes), identifier.size());
- FileID::ConvertIdentifierToString(identifier, identifier_string,
- sizeof(identifier_string));
- EXPECT_STREQ(expected_identifier_string, identifier_string);
+ string identifier_string = FileID::ConvertIdentifierToUUIDString(identifier);
+ EXPECT_EQ(expected_identifier_string, identifier_string);
}
// Test to make sure two files with different text sections produce
// different hashes when not using a build id.
TYPED_TEST(FileIDTest, UniqueHashes) {
- char identifier_string_1[] =
- "00000000-0000-0000-0000-000000000000";
- char identifier_string_2[] =
- "00000000-0000-0000-0000-000000000000";
- uint8_t identifier_1[sizeof(MDGUID)];
- uint8_t identifier_2[sizeof(MDGUID)];
-
{
ELF elf1(EM_386, TypeParam::kClass, kLittleEndian);
Section foo_1(kLittleEndian);
@@ -237,10 +327,11 @@ TYPED_TEST(FileIDTest, UniqueHashes) {
this->GetElfContents(elf1);
}
+ id_vector identifier_1(this->make_vector());
EXPECT_TRUE(FileID::ElfFileIdentifierFromMappedFile(this->elfdata,
identifier_1));
- FileID::ConvertIdentifierToString(identifier_1, identifier_string_1,
- sizeof(identifier_string_1));
+ string identifier_string_1 =
+ FileID::ConvertIdentifierToUUIDString(identifier_1);
{
ELF elf2(EM_386, TypeParam::kClass, kLittleEndian);
@@ -254,10 +345,28 @@ TYPED_TEST(FileIDTest, UniqueHashes) {
this->GetElfContents(elf2);
}
+ id_vector identifier_2(this->make_vector());
EXPECT_TRUE(FileID::ElfFileIdentifierFromMappedFile(this->elfdata,
identifier_2));
- FileID::ConvertIdentifierToString(identifier_2, identifier_string_2,
- sizeof(identifier_string_2));
+ string identifier_string_2 =
+ FileID::ConvertIdentifierToUUIDString(identifier_2);
- EXPECT_STRNE(identifier_string_1, identifier_string_2);
+ EXPECT_NE(identifier_string_1, identifier_string_2);
+}
+
+TYPED_TEST(FileIDTest, ConvertIdentifierToString) {
+ const uint8_t kIdentifierBytes[] =
+ {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+ 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
+ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
+ 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F};
+ const char* kExpected =
+ "000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F";
+
+ id_vector identifier(this->make_vector());
+ identifier.insert(identifier.end(),
+ kIdentifierBytes,
+ kIdentifierBytes + sizeof(kIdentifierBytes));
+ ASSERT_EQ(kExpected,
+ FileID::ConvertIdentifierToString(identifier));
}
diff --git a/src/common/linux/google_crashdump_uploader.cc b/src/common/linux/google_crashdump_uploader.cc
index 6d86fb36..a0d940b6 100644
--- a/src/common/linux/google_crashdump_uploader.cc
+++ b/src/common/linux/google_crashdump_uploader.cc
@@ -193,10 +193,15 @@ bool GoogleCrashdumpUploader::Upload(int* http_status_code,
return false;
}
std::cout << "Sending request to " << crash_server_;
- return http_layer_->SendRequest(crash_server_,
- parameters_,
- http_status_code,
- http_response_header,
- http_response_body);
+ long status_code;
+ bool success = http_layer_->SendRequest(crash_server_,
+ parameters_,
+ &status_code,
+ http_response_header,
+ http_response_body);
+ if (http_status_code) {
+ *http_status_code = status_code;
+ }
+ return success;
}
}
diff --git a/src/common/linux/google_crashdump_uploader_test.cc b/src/common/linux/google_crashdump_uploader_test.cc
index e94c5d62..3d6612e8 100644
--- a/src/common/linux/google_crashdump_uploader_test.cc
+++ b/src/common/linux/google_crashdump_uploader_test.cc
@@ -50,7 +50,7 @@ class MockLibcurlWrapper : public LibcurlWrapper {
MOCK_METHOD5(SendRequest,
bool(const string& url,
const std::map<string, string>& parameters,
- int* http_status_code,
+ long* http_status_code,
string* http_header_data,
string* http_response_data));
};
diff --git a/src/common/linux/guid_creator.cc b/src/common/linux/guid_creator.cc
index bfb308ee..03e3d781 100644
--- a/src/common/linux/guid_creator.cc
+++ b/src/common/linux/guid_creator.cc
@@ -27,15 +27,27 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "common/linux/eintr_wrapper.h"
#include "common/linux/guid_creator.h"
#include <assert.h>
+#include <fcntl.h>
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
+#include <sys/stat.h>
#include <time.h>
#include <unistd.h>
+#if defined(HAVE_SYS_RANDOM_H)
+#include <sys/random.h>
+#endif
+
//
// GUIDGenerator
//
@@ -61,28 +73,101 @@ class GUIDGenerator {
}
static bool CreateGUID(GUID *guid) {
- InitOnce();
- guid->data1 = random();
- guid->data2 = (uint16_t)(random());
- guid->data3 = (uint16_t)(random());
- UInt32ToBytes(&guid->data4[0], random());
- UInt32ToBytes(&guid->data4[4], random());
+#if defined(HAVE_ARC4RANDOM) // Android, BSD, ...
+ CreateGuidFromArc4Random(guid);
+#else // Linux
+ bool success = false;
+
+#if defined(HAVE_SYS_RANDOM_H) && defined(HAVE_GETRANDOM)
+ success = CreateGUIDFromGetrandom(guid);
+#endif // HAVE_SYS_RANDOM_H && HAVE_GETRANDOM
+ if (!success) {
+ success = CreateGUIDFromDevUrandom(guid);
+ }
+
+ if (!success) {
+ CreateGUIDFromRand(guid);
+ success = true;
+ }
+#endif
+
+ // Put in the version according to RFC 4122.
+ guid->data3 &= 0x0fff;
+ guid->data3 |= 0x4000;
+
+ // Put in the variant according to RFC 4122.
+ guid->data4[0] &= 0x3f;
+ guid->data4[0] |= 0x80;
+
return true;
}
private:
+#ifdef HAVE_ARC4RANDOM
+ static void CreateGuidFromArc4Random(GUID *guid) {
+ char *buf = reinterpret_cast<char *>(guid);
+
+ for (size_t i = 0; i < sizeof(GUID); i += sizeof(uint32_t)) {
+ uint32_t random_data = arc4random();
+
+ memcpy(buf + i, &random_data, sizeof(uint32_t));
+ }
+ }
+#else
static void InitOnce() {
pthread_once(&once_control, &InitOnceImpl);
}
static void InitOnceImpl() {
- srandom(time(NULL));
+ // time(NULL) is a very poor seed, so lacking anything better mix an
+ // address into it. We drop the four rightmost bits as they're likely to
+ // be 0 on almost all architectures.
+ srand(time(NULL) | ((uintptr_t)&once_control >> 4));
}
static pthread_once_t once_control;
+
+#if defined(HAVE_SYS_RANDOM_H) && defined(HAVE_GETRANDOM)
+ static bool CreateGUIDFromGetrandom(GUID *guid) {
+ char *buf = reinterpret_cast<char *>(guid);
+ int read_bytes = getrandom(buf, sizeof(GUID), GRND_NONBLOCK);
+
+ return (read_bytes == static_cast<int>(sizeof(GUID)));
+ }
+#endif // HAVE_SYS_RANDOM_H && HAVE_GETRANDOM
+
+ // Populate the GUID using random bytes read from /dev/urandom, returns false
+ // if the GUID wasn't fully populated with random data.
+ static bool CreateGUIDFromDevUrandom(GUID *guid) {
+ char *buf = reinterpret_cast<char *>(guid);
+ int fd = open("/dev/urandom", O_RDONLY | O_CLOEXEC);
+
+ if (fd == -1) {
+ return false;
+ }
+
+ ssize_t read_bytes = HANDLE_EINTR(read(fd, buf, sizeof(GUID)));
+ close(fd);
+
+ return (read_bytes == static_cast<ssize_t>(sizeof(GUID)));
+ }
+
+ // Populate the GUID using a stream of random bytes obtained from rand().
+ static void CreateGUIDFromRand(GUID *guid) {
+ char *buf = reinterpret_cast<char *>(guid);
+
+ InitOnce();
+
+ for (size_t i = 0; i < sizeof(GUID); i++) {
+ buf[i] = rand();
+ }
+ }
+#endif
};
+#ifndef HAVE_ARC4RANDOM
pthread_once_t GUIDGenerator::once_control = PTHREAD_ONCE_INIT;
+#endif
bool CreateGUID(GUID *guid) {
return GUIDGenerator::CreateGUID(guid);
diff --git a/src/common/linux/http_upload.cc b/src/common/linux/http_upload.cc
index d49f2276..702526af 100644
--- a/src/common/linux/http_upload.cc
+++ b/src/common/linux/http_upload.cc
@@ -56,8 +56,7 @@ static const char kUserAgent[] = "Breakpad/1.0 (Linux)";
// static
bool HTTPUpload::SendRequest(const string &url,
const map<string, string> &parameters,
- const string &upload_file,
- const string &file_part_name,
+ const map<string, string> &files,
const string &proxy,
const string &proxy_user_pwd,
const string &ca_certificate_file,
@@ -73,7 +72,9 @@ bool HTTPUpload::SendRequest(const string &url,
// We may have been linked statically; if curl_easy_init is in the
// current binary, no need to search for a dynamic version.
void* curl_lib = dlopen(NULL, RTLD_NOW);
- if (!curl_lib || dlsym(curl_lib, "curl_easy_init") == NULL) {
+ if (!CheckCurlLib(curl_lib)) {
+ fprintf(stderr,
+ "Failed to open curl lib from binary, use libcurl.so instead\n");
dlerror(); // Clear dlerror before attempting to open libraries.
dlclose(curl_lib);
curl_lib = NULL;
@@ -114,6 +115,10 @@ bool HTTPUpload::SendRequest(const string &url,
*(void**) (&curl_easy_setopt) = dlsym(curl_lib, "curl_easy_setopt");
(*curl_easy_setopt)(curl, CURLOPT_URL, url.c_str());
(*curl_easy_setopt)(curl, CURLOPT_USERAGENT, kUserAgent);
+ // Support multithread by disabling timeout handling, would get SIGSEGV with
+ // Curl_resolv_timeout in stack trace otherwise.
+ // See https://curl.haxx.se/libcurl/c/threadsafe.html
+ (*curl_easy_setopt)(curl, CURLOPT_NOSIGNAL, 1);
// Set proxy information if necessary.
if (!proxy.empty())
(*curl_easy_setopt)(curl, CURLOPT_PROXY, proxy.c_str());
@@ -135,11 +140,13 @@ bool HTTPUpload::SendRequest(const string &url,
CURLFORM_COPYCONTENTS, iter->second.c_str(),
CURLFORM_END);
- // Add form file.
- (*curl_formadd)(&formpost, &lastptr,
- CURLFORM_COPYNAME, file_part_name.c_str(),
- CURLFORM_FILE, upload_file.c_str(),
- CURLFORM_END);
+ // Add form files.
+ for (iter = files.begin(); iter != files.end(); ++iter) {
+ (*curl_formadd)(&formpost, &lastptr,
+ CURLFORM_COPYNAME, iter->first.c_str(),
+ CURLFORM_FILE, iter->second.c_str(),
+ CURLFORM_END);
+ }
(*curl_easy_setopt)(curl, CURLOPT_HTTPPOST, formpost);
@@ -197,6 +204,13 @@ bool HTTPUpload::SendRequest(const string &url,
}
// static
+bool HTTPUpload::CheckCurlLib(void* curl_lib) {
+ return curl_lib &&
+ dlsym(curl_lib, "curl_easy_init") &&
+ dlsym(curl_lib, "curl_easy_setopt");
+}
+
+// static
bool HTTPUpload::CheckParameters(const map<string, string> &parameters) {
for (map<string, string>::const_iterator pos = parameters.begin();
pos != parameters.end(); ++pos) {
diff --git a/src/common/linux/http_upload.h b/src/common/linux/http_upload.h
index 6dd36ea0..bc1d5d57 100644
--- a/src/common/linux/http_upload.h
+++ b/src/common/linux/http_upload.h
@@ -45,9 +45,9 @@ using std::map;
class HTTPUpload {
public:
- // Sends the given set of parameters, along with the contents of
- // upload_file, as a multipart POST request to the given URL.
- // file_part_name contains the name of the file part of the request
+ // Sends the given sets of parameters and files as a multipart POST
+ // request to the given URL.
+ // Each key in |files| is the name of the file part of the request
// (i.e. it corresponds to the name= attribute on an <input type="file">.
// Parameter names must contain only printable ASCII characters,
// and may not contain a quote (") character.
@@ -60,8 +60,7 @@ class HTTPUpload {
// returned in error_description.
static bool SendRequest(const string &url,
const map<string, string> &parameters,
- const string &upload_file,
- const string &file_part_name,
+ const map<string, string> &files,
const string &proxy,
const string &proxy_user_pwd,
const string &ca_certificate_file,
@@ -75,6 +74,9 @@ class HTTPUpload {
// any quote (") characters. Returns true if so.
static bool CheckParameters(const map<string, string> &parameters);
+ // Checks the curl_lib parameter points to a valid curl lib.
+ static bool CheckCurlLib(void* curl_lib);
+
// No instances of this class should be created.
// Disallow all constructors, destructors, and operator=.
HTTPUpload();
diff --git a/src/common/linux/ignore_ret.h b/src/common/linux/ignore_ret.h
index f60384bb..efd274c2 100644
--- a/src/common/linux/ignore_ret.h
+++ b/src/common/linux/ignore_ret.h
@@ -35,6 +35,6 @@
// the call fails, IGNORE_RET() can be used to mark the return code as ignored.
// This avoids spurious compiler warnings.
-#define IGNORE_RET(x) do { if (x); } while (0)
+#define IGNORE_RET(x) do { if (x) {} } while (0)
#endif // COMMON_LINUX_IGNORE_RET_H_
diff --git a/src/common/linux/libcurl_wrapper.cc b/src/common/linux/libcurl_wrapper.cc
index fd4e34cd..e96c2038 100644
--- a/src/common/linux/libcurl_wrapper.cc
+++ b/src/common/linux/libcurl_wrapper.cc
@@ -38,32 +38,24 @@
namespace google_breakpad {
LibcurlWrapper::LibcurlWrapper()
: init_ok_(false),
- formpost_(NULL),
- lastptr_(NULL),
- headerlist_(NULL) {
- curl_lib_ = dlopen("libcurl.so", RTLD_NOW);
- if (!curl_lib_) {
- curl_lib_ = dlopen("libcurl.so.4", RTLD_NOW);
- }
- if (!curl_lib_) {
- curl_lib_ = dlopen("libcurl.so.3", RTLD_NOW);
- }
- if (!curl_lib_) {
- std::cout << "Could not find libcurl via dlopen";
- return;
+ curl_lib_(nullptr),
+ last_curl_error_(""),
+ curl_(nullptr),
+ formpost_(nullptr),
+ lastptr_(nullptr),
+ headerlist_(nullptr) {}
+
+LibcurlWrapper::~LibcurlWrapper() {
+ if (init_ok_) {
+ (*easy_cleanup_)(curl_);
+ dlclose(curl_lib_);
}
- std::cout << "LibcurlWrapper init succeeded";
- init_ok_ = true;
- return;
}
-LibcurlWrapper::~LibcurlWrapper() {}
-
bool LibcurlWrapper::SetProxy(const string& proxy_host,
const string& proxy_userpwd) {
- if (!init_ok_) {
- return false;
- }
+ if (!CheckInit()) return false;
+
// Set proxy information if necessary.
if (!proxy_host.empty()) {
(*easy_setopt_)(curl_, CURLOPT_PROXY, proxy_host.c_str());
@@ -83,9 +75,8 @@ bool LibcurlWrapper::SetProxy(const string& proxy_host,
bool LibcurlWrapper::AddFile(const string& upload_file_path,
const string& basename) {
- if (!init_ok_) {
- return false;
- }
+ if (!CheckInit()) return false;
+
std::cout << "Adding " << upload_file_path << " to form upload.";
// Add form file.
(*formadd_)(&formpost_, &lastptr_,
@@ -110,10 +101,11 @@ static size_t WriteCallback(void *ptr, size_t size,
bool LibcurlWrapper::SendRequest(const string& url,
const std::map<string, string>& parameters,
- int* http_status_code,
+ long* http_status_code,
string* http_header_data,
string* http_response_data) {
- (*easy_setopt_)(curl_, CURLOPT_URL, url.c_str());
+ if (!CheckInit()) return false;
+
std::map<string, string>::const_iterator iter = parameters.begin();
for (; iter != parameters.end(); ++iter)
(*formadd_)(&formpost_, &lastptr_,
@@ -122,55 +114,91 @@ bool LibcurlWrapper::SendRequest(const string& url,
CURLFORM_END);
(*easy_setopt_)(curl_, CURLOPT_HTTPPOST, formpost_);
- if (http_response_data != NULL) {
- http_response_data->clear();
- (*easy_setopt_)(curl_, CURLOPT_WRITEFUNCTION, WriteCallback);
- (*easy_setopt_)(curl_, CURLOPT_WRITEDATA,
- reinterpret_cast<void *>(http_response_data));
- }
- if (http_header_data != NULL) {
- http_header_data->clear();
- (*easy_setopt_)(curl_, CURLOPT_HEADERFUNCTION, WriteCallback);
- (*easy_setopt_)(curl_, CURLOPT_HEADERDATA,
- reinterpret_cast<void *>(http_header_data));
- }
- CURLcode err_code = CURLE_OK;
- err_code = (*easy_perform_)(curl_);
- easy_strerror_ = reinterpret_cast<const char* (*)(CURLcode)>
- (dlsym(curl_lib_, "curl_easy_strerror"));
+ return SendRequestInner(url, http_status_code, http_header_data,
+ http_response_data);
+}
- if (http_status_code != NULL) {
- (*easy_getinfo_)(curl_, CURLINFO_RESPONSE_CODE, http_status_code);
- }
+bool LibcurlWrapper::SendGetRequest(const string& url,
+ long* http_status_code,
+ string* http_header_data,
+ string* http_response_data) {
+ if (!CheckInit()) return false;
-#ifndef NDEBUG
- if (err_code != CURLE_OK)
- fprintf(stderr, "Failed to send http request to %s, error: %s\n",
- url.c_str(),
- (*easy_strerror_)(err_code));
-#endif
- if (headerlist_ != NULL) {
- (*slist_free_all_)(headerlist_);
- }
+ (*easy_setopt_)(curl_, CURLOPT_HTTPGET, 1L);
- (*easy_cleanup_)(curl_);
- if (formpost_ != NULL) {
- (*formfree_)(formpost_);
+ return SendRequestInner(url, http_status_code, http_header_data,
+ http_response_data);
+}
+
+bool LibcurlWrapper::SendPutRequest(const string& url,
+ const string& path,
+ long* http_status_code,
+ string* http_header_data,
+ string* http_response_data) {
+ if (!CheckInit()) return false;
+
+ FILE* file = fopen(path.c_str(), "rb");
+ (*easy_setopt_)(curl_, CURLOPT_UPLOAD, 1L);
+ (*easy_setopt_)(curl_, CURLOPT_PUT, 1L);
+ (*easy_setopt_)(curl_, CURLOPT_READDATA, file);
+
+ bool success = SendRequestInner(url, http_status_code, http_header_data,
+ http_response_data);
+
+ fclose(file);
+ return success;
+}
+
+bool LibcurlWrapper::SendSimplePostRequest(const string& url,
+ const string& body,
+ const string& content_type,
+ long* http_status_code,
+ string* http_header_data,
+ string* http_response_data) {
+ if (!CheckInit()) return false;
+
+ (*easy_setopt_)(curl_, CURLOPT_POSTFIELDSIZE, body.size());
+ (*easy_setopt_)(curl_, CURLOPT_COPYPOSTFIELDS, body.c_str());
+
+ if (!content_type.empty()) {
+ string content_type_header = "Content-Type: " + content_type;
+ headerlist_ = (*slist_append_)(
+ headerlist_,
+ content_type_header.c_str());
}
- return err_code == CURLE_OK;
+ return SendRequestInner(url, http_status_code, http_header_data,
+ http_response_data);
}
bool LibcurlWrapper::Init() {
- if (!init_ok_) {
- std::cout << "Init_OK was not true in LibcurlWrapper::Init(), check earlier log messages";
+ // First check to see if libcurl was statically linked:
+ curl_lib_ = dlopen(nullptr, RTLD_NOW);
+ if (curl_lib_ &&
+ (!dlsym(curl_lib_, "curl_easy_init") ||
+ !dlsym(curl_lib_, "curl_easy_setopt"))) {
+ // Not statically linked, try again below.
+ dlerror(); // Clear dlerror before attempting to open libraries.
+ dlclose(curl_lib_);
+ curl_lib_ = nullptr;
+ }
+ if (!curl_lib_) {
+ curl_lib_ = dlopen("libcurl.so", RTLD_NOW);
+ }
+ if (!curl_lib_) {
+ curl_lib_ = dlopen("libcurl.so.4", RTLD_NOW);
+ }
+ if (!curl_lib_) {
+ curl_lib_ = dlopen("libcurl.so.3", RTLD_NOW);
+ }
+ if (!curl_lib_) {
+ std::cout << "Could not find libcurl via dlopen";
return false;
}
if (!SetFunctionPointers()) {
std::cout << "Could not find function pointers";
- init_ok_ = false;
return false;
}
@@ -184,11 +212,7 @@ bool LibcurlWrapper::Init() {
return false;
}
- // Disable 100-continue header.
- char buf[] = "Expect:";
-
- headerlist_ = (*slist_append_)(headerlist_, buf);
- (*easy_setopt_)(curl_, CURLOPT_HTTPHEADER, headerlist_);
+ init_ok_ = true;
return true;
}
@@ -228,6 +252,10 @@ bool LibcurlWrapper::SetFunctionPointers() {
"curl_easy_getinfo",
CURLcode(*)(CURL *, CURLINFO info, ...));
+ SET_AND_CHECK_FUNCTION_POINTER(easy_reset_,
+ "curl_easy_reset",
+ void(*)(CURL*));
+
SET_AND_CHECK_FUNCTION_POINTER(slist_free_all_,
"curl_slist_free_all",
void(*)(curl_slist*));
@@ -238,4 +266,73 @@ bool LibcurlWrapper::SetFunctionPointers() {
return true;
}
+bool LibcurlWrapper::SendRequestInner(const string& url,
+ long* http_status_code,
+ string* http_header_data,
+ string* http_response_data) {
+ string url_copy(url);
+ (*easy_setopt_)(curl_, CURLOPT_URL, url_copy.c_str());
+
+ // Disable 100-continue header.
+ char buf[] = "Expect:";
+ headerlist_ = (*slist_append_)(headerlist_, buf);
+ (*easy_setopt_)(curl_, CURLOPT_HTTPHEADER, headerlist_);
+
+ if (http_response_data != nullptr) {
+ http_response_data->clear();
+ (*easy_setopt_)(curl_, CURLOPT_WRITEFUNCTION, WriteCallback);
+ (*easy_setopt_)(curl_, CURLOPT_WRITEDATA,
+ reinterpret_cast<void*>(http_response_data));
+ }
+ if (http_header_data != nullptr) {
+ http_header_data->clear();
+ (*easy_setopt_)(curl_, CURLOPT_HEADERFUNCTION, WriteCallback);
+ (*easy_setopt_)(curl_, CURLOPT_HEADERDATA,
+ reinterpret_cast<void*>(http_header_data));
+ }
+ CURLcode err_code = CURLE_OK;
+ err_code = (*easy_perform_)(curl_);
+ easy_strerror_ = reinterpret_cast<const char* (*)(CURLcode)>
+ (dlsym(curl_lib_, "curl_easy_strerror"));
+
+ if (http_status_code != nullptr) {
+ (*easy_getinfo_)(curl_, CURLINFO_RESPONSE_CODE, http_status_code);
+ }
+
+#ifndef NDEBUG
+ if (err_code != CURLE_OK)
+ fprintf(stderr, "Failed to send http request to %s, error: %s\n",
+ url.c_str(),
+ (*easy_strerror_)(err_code));
+#endif
+
+ Reset();
+
+ return err_code == CURLE_OK;
}
+
+void LibcurlWrapper::Reset() {
+ if (headerlist_ != nullptr) {
+ (*slist_free_all_)(headerlist_);
+ headerlist_ = nullptr;
+ }
+
+ if (formpost_ != nullptr) {
+ (*formfree_)(formpost_);
+ formpost_ = nullptr;
+ }
+
+ (*easy_reset_)(curl_);
+}
+
+bool LibcurlWrapper::CheckInit() {
+ if (!init_ok_) {
+ std::cout << "LibcurlWrapper: You must call Init(), and have it return "
+ "'true' before invoking any other methods.\n";
+ return false;
+ }
+
+ return true;
+}
+
+} // namespace google_breakpad
diff --git a/src/common/linux/libcurl_wrapper.h b/src/common/linux/libcurl_wrapper.h
index de84a63b..77aa6cbb 100644
--- a/src/common/linux/libcurl_wrapper.h
+++ b/src/common/linux/libcurl_wrapper.h
@@ -43,7 +43,7 @@ namespace google_breakpad {
class LibcurlWrapper {
public:
LibcurlWrapper();
- ~LibcurlWrapper();
+ virtual ~LibcurlWrapper();
virtual bool Init();
virtual bool SetProxy(const string& proxy_host,
const string& proxy_userpwd);
@@ -51,14 +51,39 @@ class LibcurlWrapper {
const string& basename);
virtual bool SendRequest(const string& url,
const std::map<string, string>& parameters,
- int* http_status_code,
+ long* http_status_code,
string* http_header_data,
string* http_response_data);
+ bool SendGetRequest(const string& url,
+ long* http_status_code,
+ string* http_header_data,
+ string* http_response_data);
+ bool SendPutRequest(const string& url,
+ const string& path,
+ long* http_status_code,
+ string* http_header_data,
+ string* http_response_data);
+ bool SendSimplePostRequest(const string& url,
+ const string& body,
+ const string& content_type,
+ long* http_status_code,
+ string* http_header_data,
+ string* http_response_data);
+
private:
// This function initializes class state corresponding to function
// pointers into the CURL library.
bool SetFunctionPointers();
+ bool SendRequestInner(const string& url,
+ long* http_status_code,
+ string* http_header_data,
+ string* http_response_data);
+
+ void Reset();
+
+ bool CheckInit();
+
bool init_ok_; // Whether init succeeded
void* curl_lib_; // Pointer to result of dlopen() on
// curl library
@@ -85,6 +110,7 @@ class LibcurlWrapper {
const char* (*easy_strerror_)(CURLcode);
void (*easy_cleanup_)(CURL *);
CURLcode (*easy_getinfo_)(CURL *, CURLINFO info, ...);
+ void (*easy_reset_)(CURL*);
void (*formfree_)(struct curl_httppost *);
};
diff --git a/src/common/linux/memory_mapped_file.cc b/src/common/linux/memory_mapped_file.cc
index 592b66c8..4e938269 100644
--- a/src/common/linux/memory_mapped_file.cc
+++ b/src/common/linux/memory_mapped_file.cc
@@ -87,18 +87,7 @@ bool MemoryMappedFile::Map(const char* path, size_t offset) {
return true;
}
-#if defined(__x86_64__) || defined(__aarch64__) || \
- (defined(__mips__) && _MIPS_SIM == _ABI64)
void* data = sys_mmap(NULL, file_len, PROT_READ, MAP_PRIVATE, fd, offset);
-#else
- if ((offset & 4095) != 0) {
- // Not page aligned.
- sys_close(fd);
- return false;
- }
- void* data = sys_mmap2(
- NULL, file_len, PROT_READ, MAP_PRIVATE, fd, offset >> 12);
-#endif
sys_close(fd);
if (data == MAP_FAILED) {
return false;
diff --git a/src/common/linux/symbol_collector_client.cc b/src/common/linux/symbol_collector_client.cc
new file mode 100644
index 00000000..92b25ddb
--- /dev/null
+++ b/src/common/linux/symbol_collector_client.cc
@@ -0,0 +1,195 @@
+// Copyright (c) 2019 Google Inc.
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#include "common/linux/symbol_collector_client.h"
+
+#include <stdio.h>
+
+#include <iostream>
+#include <regex>
+
+#include "common/linux/libcurl_wrapper.h"
+
+namespace google_breakpad {
+namespace sym_upload {
+
+// static
+bool SymbolCollectorClient::CreateUploadUrl(
+ LibcurlWrapper* libcurl_wrapper,
+ const string& api_url,
+ const string& api_key,
+ UploadUrlResponse* uploadUrlResponse) {
+ string header, response;
+ long response_code;
+
+ string url = api_url + "/v1/uploads:create";
+ if (!api_key.empty()) {
+ url += "?key=" + api_key;
+ }
+
+ if (!libcurl_wrapper->SendSimplePostRequest(url,
+ /*body=*/"",
+ /*content_type=*/"",
+ &response_code,
+ &header,
+ &response)) {
+ printf("Failed to create upload url.\n");
+ printf("Response code: %ld\n", response_code);
+ printf("Response:\n");
+ printf("%s\n", response.c_str());
+ return false;
+ }
+
+ // Note camel-case rather than underscores.
+ std::regex upload_url_regex("\"uploadUrl\": \"([^\"]+)\"");
+ std::regex upload_key_regex("\"uploadKey\": \"([^\"]+)\"");
+
+ std::smatch upload_url_match;
+ if (!std::regex_search(response, upload_url_match, upload_url_regex) ||
+ upload_url_match.size() != 2) {
+ printf("Failed to parse create url response.");
+ printf("Response:\n");
+ printf("%s\n", response.c_str());
+ return false;
+ }
+ string upload_url = upload_url_match[1].str();
+
+ std::smatch upload_key_match;
+ if (!std::regex_search(response, upload_key_match, upload_key_regex) ||
+ upload_key_match.size() != 2) {
+ printf("Failed to parse create url response.");
+ printf("Response:\n");
+ printf("%s\n", response.c_str());
+ return false;
+ }
+ string upload_key = upload_key_match[1].str();
+
+ uploadUrlResponse->upload_url = upload_url;
+ uploadUrlResponse->upload_key = upload_key;
+ return true;
+}
+
+// static
+CompleteUploadResult SymbolCollectorClient::CompleteUpload(
+ LibcurlWrapper* libcurl_wrapper,
+ const string& api_url,
+ const string& api_key,
+ const string& upload_key,
+ const string& debug_file,
+ const string& debug_id,
+ const string& type) {
+ string header, response;
+ long response_code;
+
+ string url = api_url + "/v1/uploads/" + upload_key + ":complete";
+ if (!api_key.empty()) {
+ url += "?key=" + api_key;
+ }
+ string body =
+ "{ symbol_id: {"
+ "debug_file: \"" + debug_file + "\", "
+ "debug_id: \"" + debug_id + "\" }, "
+ "symbol_upload_type: \"" + type + "\" }";
+
+ if (!libcurl_wrapper->SendSimplePostRequest(url,
+ body,
+ "application/son",
+ &response_code,
+ &header,
+ &response)) {
+ printf("Failed to complete upload.\n");
+ printf("Response code: %ld\n", response_code);
+ printf("Response:\n");
+ printf("%s\n", response.c_str());
+ return CompleteUploadResult::Error;
+ }
+
+ std::regex result_regex("\"result\": \"([^\"]+)\"");
+ std::smatch result_match;
+ if (!std::regex_search(response, result_match, result_regex) ||
+ result_match.size() != 2) {
+ printf("Failed to parse complete upload response.");
+ printf("Response:\n");
+ printf("%s\n", response.c_str());
+ return CompleteUploadResult::Error;
+ }
+ string result = result_match[1].str();
+
+ if (result.compare("DUPLICATE_DATA") == 0) {
+ return CompleteUploadResult::DuplicateData;
+ }
+
+ return CompleteUploadResult::Ok;
+}
+
+// static
+SymbolStatus SymbolCollectorClient::CheckSymbolStatus(
+ LibcurlWrapper* libcurl_wrapper,
+ const string& api_url,
+ const string& api_key,
+ const string& debug_file,
+ const string& debug_id) {
+ string header, response;
+ long response_code;
+ string url = api_url +
+ "/v1/symbols/" + debug_file + "/" + debug_id + ":checkStatus";
+ if (!api_key.empty()) {
+ url += "?key=" + api_key;
+ }
+
+ if (!libcurl_wrapper->SendGetRequest(
+ url,
+ &response_code,
+ &header,
+ &response)) {
+ printf("Failed to check symbol status, error message.\n");
+ printf("Response code: %ld\n", response_code);
+ printf("Response:\n");
+ printf("%s\n", response.c_str());
+ return SymbolStatus::Unknown;
+ }
+
+ std::regex status_regex("\"status\": \"([^\"]+)\"");
+ std::smatch status_match;
+ if (!std::regex_search(response, status_match, status_regex) ||
+ status_match.size() != 2) {
+ printf("Failed to parse check symbol status response.");
+ printf("Response:\n");
+ printf("%s\n", response.c_str());
+ return SymbolStatus::Unknown;
+ }
+ string status = status_match[1].str();
+
+ return (status.compare("FOUND") == 0) ?
+ SymbolStatus::Found :
+ SymbolStatus::Missing;
+}
+
+} // namespace sym_upload
+} // namespace google_breakpad
diff --git a/src/common/linux/symbol_collector_client.h b/src/common/linux/symbol_collector_client.h
new file mode 100644
index 00000000..0e23242a
--- /dev/null
+++ b/src/common/linux/symbol_collector_client.h
@@ -0,0 +1,88 @@
+// Copyright (c) 2019, Google Inc.
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef COMMON_LINUX_SYMBOL_COLLECTOR_CLIENT_H_
+#define COMMON_LINUX_SYMBOL_COLLECTOR_CLIENT_H_
+
+#include <string>
+
+#include "common/linux/libcurl_wrapper.h"
+#include "common/using_std_string.h"
+
+namespace google_breakpad {
+namespace sym_upload {
+
+struct UploadUrlResponse {
+ string upload_url;
+ string upload_key;
+};
+
+enum SymbolStatus {
+ Found,
+ Missing,
+ Unknown
+};
+
+enum CompleteUploadResult {
+ Ok,
+ DuplicateData,
+ Error
+};
+
+// Helper class to communicate with a sym-upload-v2 service over HTTP/REST,
+// via libcurl.
+class SymbolCollectorClient {
+ public:
+ static bool CreateUploadUrl(
+ LibcurlWrapper* libcurl_wrapper,
+ const string& api_url,
+ const string& api_key,
+ UploadUrlResponse* uploadUrlResponse);
+
+ static CompleteUploadResult CompleteUpload(
+ LibcurlWrapper* libcurl_wrapper,
+ const string& api_url,
+ const string& api_key,
+ const string& upload_key,
+ const string& debug_file,
+ const string& debug_id,
+ const string& type);
+
+ static SymbolStatus CheckSymbolStatus(
+ LibcurlWrapper* libcurl_wrapper,
+ const string& api_url,
+ const string& api_key,
+ const string& debug_file,
+ const string& debug_id);
+};
+
+} // namespace sym_upload
+} // namespace google_breakpad
+
+#endif // COMMON_LINUX_SYMBOL_COLLECTOR_CLIENT_H_
diff --git a/src/common/linux/symbol_upload.cc b/src/common/linux/symbol_upload.cc
new file mode 100644
index 00000000..87741a0a
--- /dev/null
+++ b/src/common/linux/symbol_upload.cc
@@ -0,0 +1,284 @@
+// Copyright (c) 2011 Google Inc.
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// symbol_upload.cc: implemented google_breakpad::sym_upload::Start, a helper
+// function for linux symbol upload tool.
+
+#include "common/linux/symbol_upload.h"
+
+#include <assert.h>
+#include <stdio.h>
+
+#include <functional>
+#include <iostream>
+#include <vector>
+
+#include "common/linux/http_upload.h"
+#include "common/linux/libcurl_wrapper.h"
+#include "common/linux/symbol_collector_client.h"
+
+namespace google_breakpad {
+namespace sym_upload {
+
+void TokenizeByChar(const string &source_string, int c,
+ std::vector<string> *results) {
+ assert(results);
+ string::size_type cur_pos = 0, next_pos = 0;
+ while ((next_pos = source_string.find(c, cur_pos)) != string::npos) {
+ if (next_pos != cur_pos)
+ results->push_back(source_string.substr(cur_pos, next_pos - cur_pos));
+ cur_pos = next_pos + 1;
+ }
+ if (cur_pos < source_string.size() && next_pos != cur_pos)
+ results->push_back(source_string.substr(cur_pos));
+}
+
+//=============================================================================
+// Parse out the module line which have 5 parts.
+// MODULE <os> <cpu> <uuid> <module-name>
+bool ModuleDataForSymbolFile(const string &file,
+ std::vector<string> *module_parts) {
+ assert(module_parts);
+ const size_t kModulePartNumber = 5;
+ FILE* fp = fopen(file.c_str(), "r");
+ if (fp) {
+ char buffer[1024];
+ if (fgets(buffer, sizeof(buffer), fp)) {
+ string line(buffer);
+ string::size_type line_break_pos = line.find_first_of('\n');
+ if (line_break_pos == string::npos) {
+ assert(0 && "The file is invalid!");
+ fclose(fp);
+ return false;
+ }
+ line.resize(line_break_pos);
+ const char kDelimiter = ' ';
+ TokenizeByChar(line, kDelimiter, module_parts);
+ if (module_parts->size() != kModulePartNumber)
+ module_parts->clear();
+ }
+ fclose(fp);
+ }
+
+ return module_parts->size() == kModulePartNumber;
+}
+
+//=============================================================================
+string CompactIdentifier(const string &uuid) {
+ std::vector<string> components;
+ TokenizeByChar(uuid, '-', &components);
+ string result;
+ for (size_t i = 0; i < components.size(); ++i)
+ result += components[i];
+ return result;
+}
+
+// |options| describes the current sym_upload options.
+// |module_parts| contains the strings parsed from the MODULE entry of the
+// Breakpad symbol file being uploaded.
+// |compacted_id| is the debug_id from the MODULE entry of the Breakpad symbol
+// file being uploaded, with all hyphens removed.
+bool SymUploadV1Start(
+ const Options& options,
+ std::vector<string> module_parts,
+ const string& compacted_id) {
+ std::map<string, string> parameters;
+ // Add parameters
+ if (!options.version.empty())
+ parameters["version"] = options.version;
+
+ // MODULE <os> <cpu> <uuid> <module-name>
+ // 0 1 2 3 4
+ parameters["os"] = module_parts[1];
+ parameters["cpu"] = module_parts[2];
+ parameters["debug_file"] = module_parts[4];
+ parameters["code_file"] = module_parts[4];
+ parameters["debug_identifier"] = compacted_id;
+
+ std::map<string, string> files;
+ files["symbol_file"] = options.symbolsPath;
+
+ string response, error;
+ long response_code;
+ bool success = HTTPUpload::SendRequest(options.uploadURLStr,
+ parameters,
+ files,
+ options.proxy,
+ options.proxy_user_pwd,
+ /*ca_certificate_file=*/"",
+ &response,
+ &response_code,
+ &error);
+
+ if (!success) {
+ printf("Failed to send symbol file: %s\n", error.c_str());
+ printf("Response code: %ld\n", response_code);
+ printf("Response:\n");
+ printf("%s\n", response.c_str());
+ } else if (response_code == 0) {
+ printf("Failed to send symbol file: No response code\n");
+ } else if (response_code != 200) {
+ printf("Failed to send symbol file: Response code %ld\n", response_code);
+ printf("Response:\n");
+ printf("%s\n", response.c_str());
+ } else {
+ printf("Successfully sent the symbol file.\n");
+ }
+
+ return success;
+}
+
+// |options| describes the current sym_upload options.
+// |code_id| is the basename of the module for which symbols are being
+// uploaded.
+// |debug_id| is the debug_id of the module for which symbols are being
+// uploaded.
+bool SymUploadV2Start(
+ const Options& options,
+ const string& code_file,
+ const string& debug_id,
+ const string& type) {
+ google_breakpad::LibcurlWrapper libcurl_wrapper;
+ if (!libcurl_wrapper.Init()) {
+ printf("Failed to init google_breakpad::LibcurlWrapper.\n");
+ return false;
+ }
+
+ if (!options.force) {
+ SymbolStatus symbolStatus = SymbolCollectorClient::CheckSymbolStatus(
+ &libcurl_wrapper,
+ options.uploadURLStr,
+ options.api_key,
+ code_file,
+ debug_id);
+ if (symbolStatus == SymbolStatus::Found) {
+ printf("Symbol file already exists, upload aborted."
+ " Use \"-f\" to overwrite.\n");
+ return true;
+ } else if (symbolStatus == SymbolStatus::Unknown) {
+ printf("Failed to check for existing symbol.\n");
+ return false;
+ }
+ }
+
+ UploadUrlResponse uploadUrlResponse;
+ if (!SymbolCollectorClient::CreateUploadUrl(
+ &libcurl_wrapper,
+ options.uploadURLStr,
+ options.api_key,
+ &uploadUrlResponse)) {
+ printf("Failed to create upload URL.\n");
+ return false;
+ }
+
+ string signed_url = uploadUrlResponse.upload_url;
+ string upload_key = uploadUrlResponse.upload_key;
+ string header;
+ string response;
+ long response_code;
+
+ if (!libcurl_wrapper.SendPutRequest(signed_url,
+ options.symbolsPath,
+ &response_code,
+ &header,
+ &response)) {
+ printf("Failed to send symbol file.\n");
+ printf("Response code: %ld\n", response_code);
+ printf("Response:\n");
+ printf("%s\n", response.c_str());
+ return false;
+ } else if (response_code == 0) {
+ printf("Failed to send symbol file: No response code\n");
+ return false;
+ } else if (response_code != 200) {
+ printf("Failed to send symbol file: Response code %ld\n", response_code);
+ printf("Response:\n");
+ printf("%s\n", response.c_str());
+ return false;
+ }
+
+ CompleteUploadResult completeUploadResult =
+ SymbolCollectorClient::CompleteUpload(&libcurl_wrapper,
+ options.uploadURLStr,
+ options.api_key,
+ upload_key,
+ code_file,
+ debug_id,
+ type);
+ if (completeUploadResult == CompleteUploadResult::Error) {
+ printf("Failed to complete upload.\n");
+ return false;
+ } else if (completeUploadResult == CompleteUploadResult::DuplicateData) {
+ printf("Uploaded file checksum matched existing file checksum,"
+ " no change necessary.\n");
+ } else {
+ printf("Successfully sent the symbol file.\n");
+ }
+
+ return true;
+}
+
+//=============================================================================
+void Start(Options* options) {
+ if (options->upload_protocol == UploadProtocol::SYM_UPLOAD_V2) {
+ string code_file;
+ string debug_id;
+ string type;
+
+ if (options->type.empty() || options->type == kBreakpadSymbolType) {
+ // Breakpad upload so read these from input file.
+ std::vector<string> module_parts;
+ if (!ModuleDataForSymbolFile(options->symbolsPath, &module_parts)) {
+ fprintf(stderr, "Failed to parse symbol file!\n");
+ return;
+ }
+ code_file = module_parts[4];
+ debug_id = CompactIdentifier(module_parts[3]);
+ type = kBreakpadSymbolType;
+ } else {
+ // Native upload so these must be explicitly set.
+ code_file = options->code_file;
+ debug_id = options->debug_id;
+ type = options->type;
+ }
+
+ options->success = SymUploadV2Start(*options, code_file, debug_id, type);
+ } else {
+ std::vector<string> module_parts;
+ if (!ModuleDataForSymbolFile(options->symbolsPath, &module_parts)) {
+ fprintf(stderr, "Failed to parse symbol file!\n");
+ return;
+ }
+ const string compacted_id = CompactIdentifier(module_parts[3]);
+ options->success = SymUploadV1Start(*options, module_parts, compacted_id);
+ }
+}
+
+} // namespace sym_upload
+} // namespace google_breakpad
diff --git a/src/testing/gtest/test/gtest_list_tests_unittest_.cc b/src/common/linux/symbol_upload.h
index 2b1d0780..9033152b 100644
--- a/src/testing/gtest/test/gtest_list_tests_unittest_.cc
+++ b/src/common/linux/symbol_upload.h
@@ -1,4 +1,6 @@
-// Copyright 2006, Google Inc.
+// -*- mode: c++ -*-
+
+// Copyright (c) 2011 Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
@@ -26,60 +28,49 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: phanna@google.com (Patrick Hanna)
-
-// Unit test for Google Test's --gtest_list_tests flag.
-//
-// A user can ask Google Test to list all tests that will run
-// so that when using a filter, a user will know what
-// tests to look for. The tests will not be run after listing.
-//
-// This program will be invoked from a Python unit test.
-// Don't run it directly.
-
-#include "gtest/gtest.h"
-namespace {
+// symbol_upload.h: helper functions for linux symbol upload tool.
-// Several different test cases and tests that will be listed.
-TEST(Foo, Bar1) {
-}
+#ifndef COMMON_LINUX_SYMBOL_UPLOAD_H_
+#define COMMON_LINUX_SYMBOL_UPLOAD_H_
-TEST(Foo, Bar2) {
-}
+#include <string>
-TEST(Foo, DISABLED_Bar3) {
-}
+#include "common/using_std_string.h"
-TEST(Abc, Xyz) {
-}
+namespace google_breakpad {
+namespace sym_upload {
-TEST(Abc, Def) {
-}
-
-TEST(FooBar, Baz) {
-}
-
-class FooTest : public testing::Test {
+enum class UploadProtocol {
+ SYM_UPLOAD_V1,
+ SYM_UPLOAD_V2,
};
-TEST_F(FooTest, Test1) {
-}
-
-TEST_F(FooTest, DISABLED_Test2) {
-}
-
-TEST_F(FooTest, Test3) {
-}
-
-TEST(FooDeathTest, Test1) {
-}
+constexpr char kBreakpadSymbolType[] = "BREAKPAD";
+
+struct Options {
+ Options() : upload_protocol(UploadProtocol::SYM_UPLOAD_V1), force(false) {}
+
+ string symbolsPath;
+ string uploadURLStr;
+ string proxy;
+ string proxy_user_pwd;
+ string version;
+ bool success;
+ UploadProtocol upload_protocol;
+ bool force;
+ string api_key;
+
+ // These only need to be set for native symbol uploads.
+ string code_file;
+ string debug_id;
+ string type;
+};
-} // namespace
+// Starts upload to symbol server with options.
+void Start(Options* options);
-int main(int argc, char **argv) {
- ::testing::InitGoogleTest(&argc, argv);
+} // namespace sym_upload
+} // namespace google_breakpad
- return RUN_ALL_TESTS();
-}
+#endif // COMMON_LINUX_SYMBOL_UPLOAD_H_
diff --git a/src/common/linux/synth_elf.cc b/src/common/linux/synth_elf.cc
index b978550f..98e81dab 100644
--- a/src/common/linux/synth_elf.cc
+++ b/src/common/linux/synth_elf.cc
@@ -213,8 +213,10 @@ void ELF::Finish() {
SymbolTable::SymbolTable(Endianness endianness,
size_t addr_size,
StringTable& table) : Section(endianness),
- addr_size_(addr_size),
table_(table) {
+#ifndef NDEBUG
+ addr_size_ = addr_size;
+#endif
assert(addr_size_ == 4 || addr_size_ == 8);
}
diff --git a/src/common/linux/synth_elf.h b/src/common/linux/synth_elf.h
index 330ceae8..1d2a20ca 100644
--- a/src/common/linux/synth_elf.h
+++ b/src/common/linux/synth_elf.h
@@ -173,7 +173,9 @@ class SymbolTable : public Section {
uint64_t size, unsigned info, uint16_t shndx);
private:
+#ifndef NDEBUG
size_t addr_size_;
+#endif
StringTable& table_;
};
diff --git a/src/common/linux/synth_elf_unittest.cc b/src/common/linux/synth_elf_unittest.cc
index 3715b6e6..cd74c286 100644
--- a/src/common/linux/synth_elf_unittest.cc
+++ b/src/common/linux/synth_elf_unittest.cc
@@ -193,7 +193,7 @@ class BasicElf : public Test {};
typedef Types<ElfClass32, ElfClass64> ElfClasses;
-TYPED_TEST_CASE(BasicElf, ElfClasses);
+TYPED_TEST_SUITE(BasicElf, ElfClasses);
TYPED_TEST(BasicElf, EmptyLE) {
typedef typename TypeParam::Ehdr Ehdr;
diff --git a/src/common/linux/tests/crash_generator.cc b/src/common/linux/tests/crash_generator.cc
index c9491f6f..6896a688 100644
--- a/src/common/linux/tests/crash_generator.cc
+++ b/src/common/linux/tests/crash_generator.cc
@@ -33,6 +33,7 @@
#include "common/linux/tests/crash_generator.h"
#include <pthread.h>
+#include <sched.h>
#include <signal.h>
#include <stdio.h>
#include <sys/mman.h>
@@ -88,7 +89,7 @@ void *thread_function(void *data) {
exit(1);
}
while (true) {
- pthread_yield();
+ sched_yield();
}
}
@@ -184,6 +185,12 @@ bool CrashGenerator::CreateChildCrash(
pid_t pid = fork();
if (pid == 0) {
+ // Custom signal handlers, which may have been installed by a test launcher,
+ // are undesirable in this child.
+ if (signal(crash_signal, SIG_DFL) == SIG_ERR) {
+ perror("CrashGenerator: signal");
+ exit(1);
+ }
if (chdir(temp_dir_.path().c_str()) == -1) {
perror("CrashGenerator: Failed to change directory");
exit(1);
@@ -202,7 +209,7 @@ bool CrashGenerator::CreateChildCrash(
// On Android the signal sometimes doesn't seem to get sent even though
// tkill returns '0'. Retry a couple of times if the signal doesn't get
// through on the first go:
- // https://code.google.com/p/google-breakpad/issues/detail?id=579
+ // https://bugs.chromium.org/p/google-breakpad/issues/detail?id=579
#if defined(__ANDROID__)
const int kRetries = 60;
const unsigned int kSleepTimeInSeconds = 1;
diff --git a/src/common/linux/ucontext_constants.h b/src/common/linux/ucontext_constants.h
new file mode 100644
index 00000000..c390508a
--- /dev/null
+++ b/src/common/linux/ucontext_constants.h
@@ -0,0 +1,153 @@
+// Copyright (c) 2012, Google Inc.
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// This header can be included either from a C, C++ or Assembly file.
+// Its purpose is to contain constants that must match the offsets of
+// various fields in ucontext_t.
+//
+// They should match the definitions from signal.h.
+//
+// Used by src/common/linux/breakpad_getcontext.S
+// Tested by src/common/linux/breakpad_getcontext_unittest.cc
+//
+// This header should not be used by anything else.
+
+#ifndef GOOGLEBREAKPAD_COMMON_LINUX_UCONTEXT_CONSTANTS_H
+#define GOOGLEBREAKPAD_COMMON_LINUX_UCONTEXT_CONSTANTS_H
+
+#if defined(__arm__)
+
+#define MCONTEXT_GREGS_OFFSET 32
+#define UCONTEXT_SIGMASK_OFFSET 104
+
+#elif defined(__aarch64__)
+
+#define UCONTEXT_SIGMASK_OFFSET 40
+
+#define MCONTEXT_GREGS_OFFSET 184
+#define MCONTEXT_SP_OFFSET 432
+#define MCONTEXT_PC_OFFSET 440
+#define MCONTEXT_PSTATE_OFFSET 448
+#define MCONTEXT_EXTENSION_OFFSET 464
+
+#define FPSIMD_MAGIC 0x46508001
+
+#define FPSIMD_CONTEXT_MAGIC_OFFSET 0
+#define FPSIMD_CONTEXT_SIZE_OFFSET 4
+#define FPSIMD_CONTEXT_FPSR_OFFSET 8
+#define FPSIMD_CONTEXT_FPCR_OFFSET 12
+#define FPSIMD_CONTEXT_VREGS_OFFSET 16
+#define FPSIMD_CONTEXT_SIZE 528
+
+#define REGISTER_SIZE 8
+#define SIMD_REGISTER_SIZE 16
+
+#elif defined(__i386__)
+
+#define MCONTEXT_GREGS_OFFSET 20
+#define MCONTEXT_GS_OFFSET (MCONTEXT_GREGS_OFFSET + 0*4)
+#define MCONTEXT_FS_OFFSET (MCONTEXT_GREGS_OFFSET + 1*4)
+#define MCONTEXT_ES_OFFSET (MCONTEXT_GREGS_OFFSET + 2*4)
+#define MCONTEXT_DS_OFFSET (MCONTEXT_GREGS_OFFSET + 3*4)
+#define MCONTEXT_EDI_OFFSET (MCONTEXT_GREGS_OFFSET + 4*4)
+#define MCONTEXT_ESI_OFFSET (MCONTEXT_GREGS_OFFSET + 5*4)
+#define MCONTEXT_EBP_OFFSET (MCONTEXT_GREGS_OFFSET + 6*4)
+#define MCONTEXT_ESP_OFFSET (MCONTEXT_GREGS_OFFSET + 7*4)
+#define MCONTEXT_EBX_OFFSET (MCONTEXT_GREGS_OFFSET + 8*4)
+#define MCONTEXT_EDX_OFFSET (MCONTEXT_GREGS_OFFSET + 9*4)
+#define MCONTEXT_ECX_OFFSET (MCONTEXT_GREGS_OFFSET + 10*4)
+#define MCONTEXT_EAX_OFFSET (MCONTEXT_GREGS_OFFSET + 11*4)
+#define MCONTEXT_TRAPNO_OFFSET (MCONTEXT_GREGS_OFFSET + 12*4)
+#define MCONTEXT_ERR_OFFSET (MCONTEXT_GREGS_OFFSET + 13*4)
+#define MCONTEXT_EIP_OFFSET (MCONTEXT_GREGS_OFFSET + 14*4)
+#define MCONTEXT_CS_OFFSET (MCONTEXT_GREGS_OFFSET + 15*4)
+#define MCONTEXT_EFL_OFFSET (MCONTEXT_GREGS_OFFSET + 16*4)
+#define MCONTEXT_UESP_OFFSET (MCONTEXT_GREGS_OFFSET + 17*4)
+#define MCONTEXT_SS_OFFSET (MCONTEXT_GREGS_OFFSET + 18*4)
+
+#define UCONTEXT_SIGMASK_OFFSET 108
+
+#define UCONTEXT_FPREGS_OFFSET 96
+#if defined(__BIONIC__)
+#define UCONTEXT_FPREGS_MEM_OFFSET 116
+#else
+#define UCONTEXT_FPREGS_MEM_OFFSET 236
+#endif
+
+#elif defined(__mips__)
+
+#if _MIPS_SIM == _ABIO32
+#define MCONTEXT_PC_OFFSET 32
+#define MCONTEXT_GREGS_OFFSET 40
+#define MCONTEXT_FPREGS_OFFSET 296
+#define MCONTEXT_FPC_CSR 556
+#define UCONTEXT_SIGMASK_OFFSET 616
+#else
+#define MCONTEXT_GREGS_OFFSET 40
+#define MCONTEXT_FPREGS_OFFSET 296
+#define MCONTEXT_PC_OFFSET 616
+#define MCONTEXT_FPC_CSR 624
+#define UCONTEXT_SIGMASK_OFFSET 640
+#endif
+
+#elif defined(__x86_64__)
+
+#define MCONTEXT_GREGS_OFFSET 40
+#define UCONTEXT_SIGMASK_OFFSET 296
+
+#define MCONTEXT_GREGS_R8 40
+#define MCONTEXT_GREGS_R9 48
+#define MCONTEXT_GREGS_R10 56
+#define MCONTEXT_GREGS_R11 64
+#define MCONTEXT_GREGS_R12 72
+#define MCONTEXT_GREGS_R13 80
+#define MCONTEXT_GREGS_R14 88
+#define MCONTEXT_GREGS_R15 96
+#define MCONTEXT_GREGS_RDI 104
+#define MCONTEXT_GREGS_RSI 112
+#define MCONTEXT_GREGS_RBP 120
+#define MCONTEXT_GREGS_RBX 128
+#define MCONTEXT_GREGS_RDX 136
+#define MCONTEXT_GREGS_RAX 144
+#define MCONTEXT_GREGS_RCX 152
+#define MCONTEXT_GREGS_RSP 160
+#define MCONTEXT_GREGS_RIP 168
+#define MCONTEXT_FPREGS_PTR 224
+#if defined(__BIONIC__)
+#define MCONTEXT_FPREGS_MEM 304
+#else
+#define MCONTEXT_FPREGS_MEM 424
+#endif
+#define FPREGS_OFFSET_MXCSR 24
+
+#else
+#error "This header has not been ported for your CPU"
+#endif
+
+#endif // GOOGLEBREAKPAD_COMMON_ANDROID_UCONTEXT_CONSTANTS_H
diff --git a/src/common/long_string_dictionary.cc b/src/common/long_string_dictionary.cc
new file mode 100644
index 00000000..46bbf613
--- /dev/null
+++ b/src/common/long_string_dictionary.cc
@@ -0,0 +1,178 @@
+// Copyright (c) 2017, Google Inc.
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#include "common/long_string_dictionary.h"
+
+#include <assert.h>
+#include <string.h>
+
+#include <algorithm>
+#include <string>
+
+#include "common/simple_string_dictionary.h"
+
+#define arraysize(f) (sizeof(f) / sizeof(*f))
+
+namespace {
+// Suffixes for segment keys.
+const char* const kSuffixes[] = {"__1", "__2", "__3", "__4", "__5", "__6",
+ "__7", "__8", "__9", "__10"};
+#if !defined(NDEBUG)
+// The maximum suffix string length.
+const size_t kMaxSuffixLength = 4;
+#endif
+} // namespace
+
+namespace google_breakpad {
+
+using std::string;
+
+void LongStringDictionary::SetKeyValue(const char* key, const char* value) {
+ assert(key);
+ if (!key)
+ return;
+
+ RemoveKey(key);
+
+ if (!value) {
+ return;
+ }
+
+ // Key must not be an empty string.
+ assert(key[0] != '\0');
+ if (key[0] == '\0')
+ return;
+
+ // If the value is not valid for segmentation, forwards the key and the value
+ // to SetKeyValue of SimpleStringDictionary and returns.
+ size_t value_length = strlen(value);
+ if (value_length <= (value_size - 1)) {
+ SimpleStringDictionary::SetKeyValue(key, value);
+ return;
+ }
+
+ size_t key_length = strlen(key);
+ assert(key_length + kMaxSuffixLength <= (key_size - 1));
+
+ char segment_key[key_size];
+ char segment_value[value_size];
+
+ strcpy(segment_key, key);
+
+ const char* remain_value = value;
+ size_t remain_value_length = strlen(value);
+
+ for (unsigned long i = 0; i < arraysize(kSuffixes); i++) {
+ if (remain_value_length == 0) {
+ return;
+ }
+
+ strcpy(segment_key + key_length, kSuffixes[i]);
+
+ size_t segment_value_length =
+ std::min(remain_value_length, value_size - 1);
+
+ strncpy(segment_value, remain_value, segment_value_length);
+ segment_value[segment_value_length] = '\0';
+
+ remain_value += segment_value_length;
+ remain_value_length -= segment_value_length;
+
+ SimpleStringDictionary::SetKeyValue(segment_key, segment_value);
+ }
+}
+
+bool LongStringDictionary::RemoveKey(const char* key) {
+ assert(key);
+ if (!key)
+ return false;
+
+ if (SimpleStringDictionary::RemoveKey(key)) {
+ return true;
+ }
+
+ size_t key_length = strlen(key);
+ assert(key_length + kMaxSuffixLength <= (key_size - 1));
+
+ char segment_key[key_size];
+ strcpy(segment_key, key);
+
+ unsigned long i = 0;
+ for (; i < arraysize(kSuffixes); i++) {
+ strcpy(segment_key + key_length, kSuffixes[i]);
+ if (!SimpleStringDictionary::RemoveKey(segment_key)) {
+ break;
+ }
+ }
+ return i != 0;
+}
+
+const string LongStringDictionary::GetValueForKey(const char* key) const {
+ assert(key);
+ if (!key)
+ return "";
+
+ // Key must not be an empty string.
+ assert(key[0] != '\0');
+ if (key[0] == '\0')
+ return "";
+
+ const char* value = SimpleStringDictionary::GetValueForKey(key);
+ if (value)
+ return string(value);
+
+ size_t key_length = strlen(key);
+ assert(key_length + kMaxSuffixLength <= (key_size - 1));
+
+ bool found_segment = false;
+ char segment_key[key_size];
+ string return_value;
+
+ strcpy(segment_key, key);
+ for (unsigned long i = 0; i < arraysize(kSuffixes); i++) {
+ strcpy(segment_key + key_length, kSuffixes[i]);
+
+ const char* segment_value =
+ SimpleStringDictionary::GetValueForKey(segment_key);
+
+ if (segment_value != NULL) {
+ found_segment = true;
+ return_value.append(segment_value);
+ } else {
+ break;
+ }
+ }
+
+ if (found_segment) {
+ return return_value;
+ }
+ return "";
+}
+
+} // namespace google_breakpad
diff --git a/src/common/long_string_dictionary.h b/src/common/long_string_dictionary.h
new file mode 100644
index 00000000..68bf03de
--- /dev/null
+++ b/src/common/long_string_dictionary.h
@@ -0,0 +1,87 @@
+// Copyright (c) 2017, Google Inc.
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef COMMON_LONG_STRING_DICTIONARY_H_
+#define COMMON_LONG_STRING_DICTIONARY_H_
+
+#include <string>
+
+#include "common/simple_string_dictionary.h"
+
+namespace google_breakpad {
+// key_size is the maxium size that |key| can take in
+// SimpleStringDictionary which is defined in simple_string_dictionary.h.
+//
+// value_size is the maxium size that |value| can take in
+// SimpleStringDictionary which is defined in simple_string_dictionary.h.
+//
+// LongStringDictionary is a subclass of SimpleStringDictionary which supports
+// longer values to be stored in the dictionary. The maximum length supported is
+// (value_size - 1) * 10.
+//
+// For example, LongStringDictionary will store long value with key 'abc' into
+// segment values with segment keys 'abc__1', 'abc__2', 'abc__3', ...
+//
+// Clients must avoid using the same suffixes as their key's suffix when
+// LongStringDictionary is used.
+class LongStringDictionary : public SimpleStringDictionary {
+ public:
+ // Stores |value| into |key|, or segment values into segment keys. The maxium
+ // number of segments is 10. If |value| can not be stored in 10 segments, it
+ // will be truncated. Replacing the existing value if |key| is already present
+ // and replacing the existing segment values if segment keys are already
+ // present.
+ //
+ // |key| must not be NULL. If the |value| need to be divided into segments,
+ // the lengh of |key| must be smaller enough so that lengths of segment keys
+ // which are key with suffixes are all samller than (key_size - 1). Currently,
+ // the max length of suffixes are 4.
+ //
+ // If |value| is NULL, the key and its corresponding segment keys are removed
+ // from the map. If there is no more space in the map, then the operation
+ // silently fails.
+ void SetKeyValue(const char* key, const char* value);
+
+ // Given |key|, removes any associated value or associated segment values.
+ // |key| must not be NULL. If the key is not found, searchs its segment keys
+ // and removes corresponding segment values if found.
+ bool RemoveKey(const char* key);
+
+ // Given |key|, returns its corresponding |value|. |key| must not be NULL. If
+ // the key is found, its corresponding |value| is returned.
+ //
+ // If no corresponding |value| is found, segment keys of the given |key| will
+ // be used to search for corresponding segment values. If segment values
+ // exist, assembled value from them is returned. If no segment value exists,
+ // NULL is returned.
+ const std::string GetValueForKey(const char* key) const;
+};
+} // namespace google_breakpad
+
+#endif // COMMON_LONG_STRING_DICTIONARY_H_
diff --git a/src/common/long_string_dictionary_unittest.cc b/src/common/long_string_dictionary_unittest.cc
new file mode 100644
index 00000000..f9b645ba
--- /dev/null
+++ b/src/common/long_string_dictionary_unittest.cc
@@ -0,0 +1,301 @@
+// Copyright (c) 2017, Google Inc.
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#include <algorithm>
+#include <string>
+
+#include "breakpad_googletest_includes.h"
+#include "common/long_string_dictionary.h"
+
+namespace google_breakpad {
+
+using std::string;
+
+TEST(LongStringDictionary, LongStringDictionary) {
+ // Make a new dictionary
+ LongStringDictionary dict;
+
+ // Set three distinct values on three keys
+ dict.SetKeyValue("key1", "value1");
+ dict.SetKeyValue("key2", "value2");
+ dict.SetKeyValue("key3", "value3");
+
+ EXPECT_EQ("value1", dict.GetValueForKey("key1"));
+ EXPECT_EQ("value2", dict.GetValueForKey("key2"));
+ EXPECT_EQ("value3", dict.GetValueForKey("key3"));
+ EXPECT_EQ(3u, dict.GetCount());
+ // try an unknown key
+ EXPECT_EQ("", dict.GetValueForKey("key4"));
+
+ // Remove a key
+ dict.RemoveKey("key3");
+
+ // Now make sure it's not there anymore
+ EXPECT_EQ("", dict.GetValueForKey("key3"));
+
+ // Remove by setting value to NULL
+ dict.SetKeyValue("key2", NULL);
+
+ // Now make sure it's not there anymore
+ EXPECT_EQ("", dict.GetValueForKey("key2"));
+}
+
+// Add a bunch of values to the dictionary, remove some entries in the middle,
+// and then add more.
+TEST(LongStringDictionary, Iterator) {
+ LongStringDictionary* dict = new LongStringDictionary();
+ ASSERT_TRUE(dict);
+
+ char key[LongStringDictionary::key_size];
+ char value[LongStringDictionary::value_size];
+
+ const int kDictionaryCapacity = LongStringDictionary::num_entries;
+ const int kPartitionIndex = kDictionaryCapacity - 5;
+
+ // We assume at least this size in the tests below
+ ASSERT_GE(kDictionaryCapacity, 64);
+
+ // We'll keep track of the number of key/value pairs we think should
+ // be in the dictionary
+ int expectedDictionarySize = 0;
+
+ // Set a bunch of key/value pairs like key0/value0, key1/value1, ...
+ for (int i = 0; i < kPartitionIndex; ++i) {
+ sprintf(key, "key%d", i);
+ sprintf(value, "value%d", i);
+ dict->SetKeyValue(key, value);
+ }
+ expectedDictionarySize = kPartitionIndex;
+
+ // set a couple of the keys twice (with the same value) - should be nop
+ dict->SetKeyValue("key2", "value2");
+ dict->SetKeyValue("key4", "value4");
+ dict->SetKeyValue("key15", "value15");
+
+ // Remove some random elements in the middle
+ dict->RemoveKey("key7");
+ dict->RemoveKey("key18");
+ dict->RemoveKey("key23");
+ dict->RemoveKey("key31");
+ expectedDictionarySize -= 4; // we just removed four key/value pairs
+
+ // Set some more key/value pairs like key59/value59, key60/value60, ...
+ for (int i = kPartitionIndex; i < kDictionaryCapacity; ++i) {
+ sprintf(key, "key%d", i);
+ sprintf(value, "value%d", i);
+ dict->SetKeyValue(key, value);
+ }
+ expectedDictionarySize += kDictionaryCapacity - kPartitionIndex;
+
+ // Now create an iterator on the dictionary
+ SimpleStringDictionary::Iterator iter(*dict);
+
+ // We then verify that it iterates through exactly the number of
+ // key/value pairs we expect, and that they match one-for-one with what we
+ // would expect. The ordering of the iteration does not matter...
+
+ // used to keep track of number of occurrences found for key/value pairs
+ int count[kDictionaryCapacity];
+ memset(count, 0, sizeof(count));
+
+ int totalCount = 0;
+
+ const SimpleStringDictionary::Entry* entry;
+ while ((entry = iter.Next())) {
+ totalCount++;
+
+ // Extract keyNumber from a string of the form key<keyNumber>
+ int keyNumber;
+ sscanf(entry->key, "key%d", &keyNumber);
+
+ // Extract valueNumber from a string of the form value<valueNumber>
+ int valueNumber;
+ sscanf(entry->value, "value%d", &valueNumber);
+
+ // The value number should equal the key number since that's how we set them
+ EXPECT_EQ(keyNumber, valueNumber);
+
+ // Key and value numbers should be in proper range:
+ // 0 <= keyNumber < kDictionaryCapacity
+ bool isKeyInGoodRange = (keyNumber >= 0 && keyNumber < kDictionaryCapacity);
+ bool isValueInGoodRange =
+ (valueNumber >= 0 && valueNumber < kDictionaryCapacity);
+ EXPECT_TRUE(isKeyInGoodRange);
+ EXPECT_TRUE(isValueInGoodRange);
+
+ if (isKeyInGoodRange && isValueInGoodRange) {
+ ++count[keyNumber];
+ }
+ }
+
+ // Make sure each of the key/value pairs showed up exactly one time, except
+ // for the ones which we removed.
+ for (size_t i = 0; i < kDictionaryCapacity; ++i) {
+ // Skip over key7, key18, key23, and key31, since we removed them
+ if (!(i == 7 || i == 18 || i == 23 || i == 31)) {
+ EXPECT_EQ(count[i], 1);
+ }
+ }
+
+ // Make sure the number of iterations matches the expected dictionary size.
+ EXPECT_EQ(totalCount, expectedDictionarySize);
+}
+
+TEST(LongStringDictionary, AddRemove) {
+ LongStringDictionary dict;
+ dict.SetKeyValue("rob", "ert");
+ dict.SetKeyValue("mike", "pink");
+ dict.SetKeyValue("mark", "allays");
+
+ EXPECT_EQ(3u, dict.GetCount());
+ EXPECT_EQ("ert", dict.GetValueForKey("rob"));
+ EXPECT_EQ("pink", dict.GetValueForKey("mike"));
+ EXPECT_EQ("allays", dict.GetValueForKey("mark"));
+
+ dict.RemoveKey("mike");
+
+ EXPECT_EQ(2u, dict.GetCount());
+ EXPECT_EQ("", dict.GetValueForKey("mike"));
+
+ dict.SetKeyValue("mark", "mal");
+ EXPECT_EQ(2u, dict.GetCount());
+ EXPECT_EQ("mal", dict.GetValueForKey("mark"));
+
+ dict.RemoveKey("mark");
+ EXPECT_EQ(1u, dict.GetCount());
+ EXPECT_EQ("", dict.GetValueForKey("mark"));
+}
+
+TEST(LongStringDictionary, AddRemoveLongValue) {
+ LongStringDictionary dict;
+
+ string long_value = string(256, 'x');
+ dict.SetKeyValue("rob", long_value.c_str());
+
+ EXPECT_EQ(2u, dict.GetCount());
+
+ string long_value_part_1 = string(255, 'x');
+
+ EXPECT_EQ(long_value_part_1, dict.GetValueForKey("rob__1"));
+ EXPECT_EQ("x", dict.GetValueForKey("rob__2"));
+
+ EXPECT_EQ(long_value, dict.GetValueForKey("rob"));
+
+ dict.RemoveKey("rob");
+ EXPECT_EQ(0u, dict.GetCount());
+}
+
+TEST(LongStringDictionary, AddRemoveSuperLongValue) {
+ LongStringDictionary dict;
+
+ string long_value = string(255 * 10, 'x');
+ dict.SetKeyValue("rob", long_value.c_str());
+
+ EXPECT_EQ(10u, dict.GetCount());
+
+ string long_value_part = string(255, 'x');
+
+ EXPECT_EQ(long_value_part, dict.GetValueForKey("rob__1"));
+ EXPECT_EQ(long_value_part, dict.GetValueForKey("rob__2"));
+ EXPECT_EQ(long_value_part, dict.GetValueForKey("rob__3"));
+ EXPECT_EQ(long_value_part, dict.GetValueForKey("rob__4"));
+ EXPECT_EQ(long_value_part, dict.GetValueForKey("rob__5"));
+ EXPECT_EQ(long_value_part, dict.GetValueForKey("rob__6"));
+ EXPECT_EQ(long_value_part, dict.GetValueForKey("rob__7"));
+ EXPECT_EQ(long_value_part, dict.GetValueForKey("rob__8"));
+ EXPECT_EQ(long_value_part, dict.GetValueForKey("rob__9"));
+ EXPECT_EQ(long_value_part, dict.GetValueForKey("rob__10"));
+ EXPECT_EQ(10u, dict.GetCount());
+
+ EXPECT_EQ(long_value, dict.GetValueForKey("rob"));
+
+ dict.RemoveKey("rob");
+ EXPECT_EQ(0u, dict.GetCount());
+}
+
+TEST(LongStringDictionary, TruncateSuperLongValue) {
+ LongStringDictionary dict;
+
+ string long_value = string(255 * 11, 'x');
+ dict.SetKeyValue("rob", long_value.c_str());
+
+ EXPECT_EQ(10u, dict.GetCount());
+
+ string long_value_part = string(255, 'x');
+
+ EXPECT_EQ(long_value_part, dict.GetValueForKey("rob__1"));
+ EXPECT_EQ(long_value_part, dict.GetValueForKey("rob__2"));
+ EXPECT_EQ(long_value_part, dict.GetValueForKey("rob__3"));
+ EXPECT_EQ(long_value_part, dict.GetValueForKey("rob__4"));
+ EXPECT_EQ(long_value_part, dict.GetValueForKey("rob__5"));
+ EXPECT_EQ(long_value_part, dict.GetValueForKey("rob__6"));
+ EXPECT_EQ(long_value_part, dict.GetValueForKey("rob__7"));
+ EXPECT_EQ(long_value_part, dict.GetValueForKey("rob__8"));
+ EXPECT_EQ(long_value_part, dict.GetValueForKey("rob__9"));
+ EXPECT_EQ(long_value_part, dict.GetValueForKey("rob__10"));
+ EXPECT_EQ(10u, dict.GetCount());
+
+ string expected_long_value = string(255 * 10, 'x');
+ EXPECT_EQ(expected_long_value, dict.GetValueForKey("rob"));
+
+ dict.RemoveKey("rob");
+ EXPECT_EQ(0u, dict.GetCount());
+}
+
+TEST(LongStringDictionary, OverrideLongValue) {
+ LongStringDictionary dict;
+
+ string long_value = string(255 * 10, 'x');
+ dict.SetKeyValue("rob", long_value.c_str());
+
+ EXPECT_EQ(10u, dict.GetCount());
+ EXPECT_EQ(long_value, dict.GetValueForKey("rob"));
+
+ dict.SetKeyValue("rob", "short_value");
+
+ EXPECT_EQ(1u, dict.GetCount());
+ EXPECT_EQ("short_value", dict.GetValueForKey("rob"));
+}
+
+TEST(LongStringDictionary, OverrideShortValue) {
+ LongStringDictionary dict;
+
+ dict.SetKeyValue("rob", "short_value");
+
+ EXPECT_EQ(1u, dict.GetCount());
+ EXPECT_EQ("short_value", dict.GetValueForKey("rob"));
+
+ string long_value = string(255 * 10, 'x');
+ dict.SetKeyValue("rob", long_value.c_str());
+
+ EXPECT_EQ(10u, dict.GetCount());
+ EXPECT_EQ(long_value, dict.GetValueForKey("rob"));
+}
+
+} // namespace google_breakpad
diff --git a/src/common/mac/Breakpad.xcconfig b/src/common/mac/Breakpad.xcconfig
index 672be2ce..f0913690 100644
--- a/src/common/mac/Breakpad.xcconfig
+++ b/src/common/mac/Breakpad.xcconfig
@@ -27,12 +27,6 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-ARCHS = $(ARCHS_STANDARD_32_64_BIT)
-SDKROOT = macosx10.5
-
-GCC_VERSION = 4.2
-GCC_VERSION[sdk=macosx10.4][arch=*] = 4.0
-
GCC_C_LANGUAGE_STANDARD = c99
GCC_WARN_CHECK_SWITCH_STATEMENTS = YES
@@ -41,7 +35,10 @@ GCC_WARN_64_TO_32_BIT_CONVERSION = NO
GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES
GCC_WARN_ABOUT_RETURN_TYPE = YES
GCC_WARN_MISSING_PARENTHESES = YES
-GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES
+
+// Once https://bugs.chromium.org/p/google-breakpad/issues/detail?id=697
+// is fixed this should be reenabled.
+//GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES
GCC_WARN_ABOUT_MISSING_NEWLINE = YES
GCC_WARN_SIGN_COMPARE = YES
GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES
@@ -51,6 +48,5 @@ GCC_WARN_UNUSED_VARIABLE = YES
GCC_TREAT_WARNINGS_AS_ERRORS = YES
DEBUG_INFORMATION_FORMAT = dwarf-with-dsym
-DEBUG_INFORMATION_FORMAT[sdk=macosx10.4][arch=*] = stabs
ALWAYS_SEARCH_USER_PATHS = NO
diff --git a/src/common/mac/GTMDefines.h b/src/common/mac/GTMDefines.h
index 14ffa7e1..04fcf6d0 100644
--- a/src/common/mac/GTMDefines.h
+++ b/src/common/mac/GTMDefines.h
@@ -117,7 +117,7 @@
// developer level errors. This implementation simply macros to NSLog/NSAssert.
// It is not intended to be a general logging/reporting system.
//
-// Please see http://code.google.com/p/google-toolbox-for-mac/wiki/DevLogNAssert
+// Please see https://github.com/google/google-toolbox-for-mac/wiki/DevLogNAssert
// for a little more background on the usage of these macros.
//
// _GTMDevLog log some error/problem in debug builds
diff --git a/src/common/mac/HTTPMultipartUpload.m b/src/common/mac/HTTPMultipartUpload.m
index 29fa040b..a3677f25 100644
--- a/src/common/mac/HTTPMultipartUpload.m
+++ b/src/common/mac/HTTPMultipartUpload.m
@@ -30,6 +30,65 @@
#import "HTTPMultipartUpload.h"
#import "GTMDefines.h"
+// As -[NSString stringByAddingPercentEscapesUsingEncoding:] has been
+// deprecated with iOS 9.0 / OS X 10.11 SDKs, this function re-implements it
+// using -[NSString stringByAddingPercentEncodingWithAllowedCharacters:] when
+// using those SDKs.
+static NSString *PercentEncodeNSString(NSString *key) {
+#if (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && defined(__IPHONE_9_0) && \
+ __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_9_0) || \
+ (defined(MAC_OS_X_VERSION_MIN_REQUIRED) && \
+ defined(MAC_OS_X_VERSION_10_11) && \
+ MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11)
+ return [key stringByAddingPercentEncodingWithAllowedCharacters:
+ [NSCharacterSet URLQueryAllowedCharacterSet]];
+#else
+ return [key stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
+#endif
+}
+
+// As -[NSURLConnection sendSynchronousRequest:returningResponse:error:] has
+// been deprecated with iOS 9.0 / OS X 10.11 SDKs, this function re-implements
+// it using -[NSURLSession dataTaskWithRequest:completionHandler:] which is
+// available on iOS 7+.
+static NSData *SendSynchronousNSURLRequest(NSURLRequest *req,
+ NSURLResponse **out_response,
+ NSError **out_error) {
+#if (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && defined(__IPHONE_7_0) && \
+ __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_7_0) || \
+ (defined(MAC_OS_X_VERSION_MIN_REQUIRED) && \
+ defined(MAC_OS_X_VERSION_10_11) && \
+ MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11)
+ __block NSData* result = nil;
+ __block NSError* error = nil;
+ __block NSURLResponse* response = nil;
+ dispatch_semaphore_t wait_semaphone = dispatch_semaphore_create(0);
+ [[[NSURLSession sharedSession]
+ dataTaskWithRequest:req
+ completionHandler:^(NSData *data,
+ NSURLResponse *resp,
+ NSError *err) {
+ if (out_error)
+ error = [err retain];
+ if (out_response)
+ response = [resp retain];
+ if (err == nil)
+ result = [data retain];
+ dispatch_semaphore_signal(wait_semaphone);
+ }] resume];
+ dispatch_semaphore_wait(wait_semaphone, DISPATCH_TIME_FOREVER);
+ dispatch_release(wait_semaphone);
+ if (out_error)
+ *out_error = [error autorelease];
+ if (out_response)
+ *out_response = [response autorelease];
+ return [result autorelease];
+#else
+ return [NSURLConnection sendSynchronousRequest:req
+ returningResponse:out_response
+ error:out_error];
+#endif
+}
@interface HTTPMultipartUpload(PrivateMethods)
- (NSString *)multipartBoundary;
// Each of the following methods will append the starting multipart boundary,
@@ -52,8 +111,7 @@
//=============================================================================
- (NSData *)formDataForKey:(NSString *)key value:(NSString *)value {
- NSString *escaped =
- [key stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
+ NSString *escaped = PercentEncodeNSString(key);
NSString *fmt =
@"--%@\r\nContent-Disposition: form-data; name=\"%@\"\r\n\r\n%@\r\n";
NSString *form = [NSString stringWithFormat:fmt, boundary_, escaped, value];
@@ -64,8 +122,7 @@
//=============================================================================
- (NSData *)formDataForFileContents:(NSData *)contents name:(NSString *)name {
NSMutableData *data = [NSMutableData data];
- NSString *escaped =
- [name stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
+ NSString *escaped = PercentEncodeNSString(name);
NSString *fmt = @"--%@\r\nContent-Disposition: form-data; name=\"%@\"; "
"filename=\"minidump.dmp\"\r\nContent-Type: application/octet-stream\r\n\r\n";
NSString *pre = [NSString stringWithFormat:fmt, boundary_, escaped];
@@ -146,7 +203,7 @@
NSMutableURLRequest *req =
[[NSMutableURLRequest alloc]
initWithURL:url_ cachePolicy:NSURLRequestUseProtocolCachePolicy
- timeoutInterval:10.0 ];
+ timeoutInterval:60.0];
NSMutableData *postBody = [NSMutableData data];
@@ -166,9 +223,7 @@
// Add any files to the message
NSArray *fileNames = [files_ allKeys];
- count = [fileNames count];
- for (NSInteger i = 0; i < count; ++i) {
- NSString *name = [fileNames objectAtIndex:i];
+ for (NSString *name in fileNames) {
id fileOrData = [files_ objectForKey:name];
NSData *fileData;
@@ -195,10 +250,9 @@
if ([[req URL] isFileURL]) {
[[req HTTPBody] writeToURL:[req URL] options:0 error:error];
} else {
- data = [NSURLConnection sendSynchronousRequest:req
- returningResponse:&response_
- error:error];
- [response_ retain];
+ NSURLResponse *response = nil;
+ data = SendSynchronousNSURLRequest(req, &response, error);
+ response_ = (NSHTTPURLResponse *)[response retain];
}
[req release];
diff --git a/src/common/mac/MachIPC.h b/src/common/mac/MachIPC.h
index 8df9165b..71419be9 100644
--- a/src/common/mac/MachIPC.h
+++ b/src/common/mac/MachIPC.h
@@ -236,7 +236,7 @@ class MachMessage {
//==============================================================================
class MachReceiveMessage : public MachMessage {
public:
- MachReceiveMessage() : MachMessage() {};
+ MachReceiveMessage() : MachMessage() {}
};
//==============================================================================
diff --git a/src/common/mac/arch_utilities.cc b/src/common/mac/arch_utilities.cc
index 94e3be3b..c0e4bac5 100644
--- a/src/common/mac/arch_utilities.cc
+++ b/src/common/mac/arch_utilities.cc
@@ -30,38 +30,47 @@
#include "common/mac/arch_utilities.h"
#include <mach-o/arch.h>
+#include <mach-o/fat.h>
#include <stdio.h>
#include <string.h>
-#ifndef CPU_TYPE_ARM
-#define CPU_TYPE_ARM (static_cast<cpu_type_t>(12))
-#endif // CPU_TYPE_ARM
-
-#ifndef CPU_SUBTYPE_ARM_V7
-#define CPU_SUBTYPE_ARM_V7 (static_cast<cpu_subtype_t>(9))
-#endif // CPU_SUBTYPE_ARM_V7
-
#ifndef CPU_SUBTYPE_ARM_V7S
#define CPU_SUBTYPE_ARM_V7S (static_cast<cpu_subtype_t>(11))
#endif // CPU_SUBTYPE_ARM_V7S
#ifndef CPU_TYPE_ARM64
-#define CPU_TYPE_ARM64 (static_cast<cpu_type_t>(16777228))
+#define CPU_TYPE_ARM64 (CPU_TYPE_ARM | CPU_ARCH_ABI64)
#endif // CPU_TYPE_ARM64
#ifndef CPU_SUBTYPE_ARM64_ALL
-#define CPU_SUBTYPE_ARM64_ALL (static_cast<cpu_type_t>(0))
+#define CPU_SUBTYPE_ARM64_ALL (static_cast<cpu_subtype_t>(0))
#endif // CPU_SUBTYPE_ARM64_ALL
+#ifndef CPU_SUBTYPE_ARM64_E
+#define CPU_SUBTYPE_ARM64_E (static_cast<cpu_subtype_t>(2))
+#endif // CPU_SUBTYPE_ARM64_E
+
namespace {
-const NXArchInfo* ArchInfo_arm64() {
+const NXArchInfo* ArchInfo_arm64(cpu_subtype_t cpu_subtype) {
+ const char* name = NULL;
+ switch (cpu_subtype) {
+ case CPU_SUBTYPE_ARM64_ALL:
+ name = "arm64";
+ break;
+ case CPU_SUBTYPE_ARM64_E:
+ name = "arm64e";
+ break;
+ default:
+ return NULL;
+ }
+
NXArchInfo* arm64 = new NXArchInfo;
*arm64 = *NXGetArchInfoFromCpuType(CPU_TYPE_ARM,
CPU_SUBTYPE_ARM_V7);
- arm64->name = "arm64";
+ arm64->name = name;
arm64->cputype = CPU_TYPE_ARM64;
- arm64->cpusubtype = CPU_SUBTYPE_ARM64_ALL;
+ arm64->cpusubtype = cpu_subtype;
arm64->description = "arm 64";
return arm64;
}
@@ -86,6 +95,10 @@ const NXArchInfo* BreakpadGetArchInfoFromName(const char* arch_name) {
return BreakpadGetArchInfoFromCpuType(CPU_TYPE_ARM64,
CPU_SUBTYPE_ARM64_ALL);
+ if (!strcmp("arm64e", arch_name))
+ return BreakpadGetArchInfoFromCpuType(CPU_TYPE_ARM64,
+ CPU_SUBTYPE_ARM64_E);
+
// TODO: Remove this when the OS knows about armv7s.
if (!strcmp("armv7s", arch_name))
return BreakpadGetArchInfoFromCpuType(CPU_TYPE_ARM, CPU_SUBTYPE_ARM_V7S);
@@ -97,10 +110,15 @@ const NXArchInfo* BreakpadGetArchInfoFromCpuType(cpu_type_t cpu_type,
cpu_subtype_t cpu_subtype) {
// TODO: Remove this when the OS knows about arm64.
if (cpu_type == CPU_TYPE_ARM64 && cpu_subtype == CPU_SUBTYPE_ARM64_ALL) {
- static const NXArchInfo* arm64 = ArchInfo_arm64();
+ static const NXArchInfo* arm64 = ArchInfo_arm64(cpu_subtype);
return arm64;
}
+ if (cpu_type == CPU_TYPE_ARM64 && cpu_subtype == CPU_SUBTYPE_ARM64_E) {
+ static const NXArchInfo* arm64e = ArchInfo_arm64(cpu_subtype);
+ return arm64e;
+ }
+
// TODO: Remove this when the OS knows about armv7s.
if (cpu_type == CPU_TYPE_ARM && cpu_subtype == CPU_SUBTYPE_ARM_V7S) {
static const NXArchInfo* armv7s = ArchInfo_armv7s();
@@ -111,3 +129,136 @@ const NXArchInfo* BreakpadGetArchInfoFromCpuType(cpu_type_t cpu_type,
}
} // namespace google_breakpad
+
+#ifndef __APPLE__
+namespace {
+
+enum Architecture {
+ kArch_i386 = 0,
+ kArch_x86_64,
+ kArch_x86_64h,
+ kArch_arm,
+ kArch_arm64,
+ kArch_arm64e,
+ kArch_ppc,
+ // This must be last.
+ kNumArchitectures
+};
+
+// enum Architecture above and kKnownArchitectures below
+// must be kept in sync.
+const NXArchInfo kKnownArchitectures[] = {
+ {
+ "i386",
+ CPU_TYPE_I386,
+ CPU_SUBTYPE_I386_ALL,
+ NX_LittleEndian,
+ "Intel 80x86"
+ },
+ {
+ "x86_64",
+ CPU_TYPE_X86_64,
+ CPU_SUBTYPE_X86_64_ALL,
+ NX_LittleEndian,
+ "Intel x86-64"
+ },
+ {
+ "x86_64h",
+ CPU_TYPE_X86_64,
+ CPU_SUBTYPE_X86_64_H,
+ NX_LittleEndian,
+ "Intel x86-64h Haswell"
+ },
+ {
+ "arm",
+ CPU_TYPE_ARM,
+ CPU_SUBTYPE_ARM_ALL,
+ NX_LittleEndian,
+ "ARM"
+ },
+ {
+ "arm64",
+ CPU_TYPE_ARM64,
+ CPU_SUBTYPE_ARM64_ALL,
+ NX_LittleEndian,
+ "ARM64"
+ },
+ {
+ "arm64e",
+ CPU_TYPE_ARM64,
+ CPU_SUBTYPE_ARM64_E,
+ NX_LittleEndian,
+ "ARM64e"
+ },
+ {
+ "ppc",
+ CPU_TYPE_POWERPC,
+ CPU_SUBTYPE_POWERPC_ALL,
+ NX_BigEndian,
+ "PowerPC"
+ }
+};
+
+} // namespace
+
+const NXArchInfo *NXGetLocalArchInfo(void) {
+ Architecture arch;
+#if defined(__i386__)
+ arch = kArch_i386;
+#elif defined(__x86_64__)
+ arch = kArch_x86_64;
+#elif defined(__arm64)
+ arch = kArch_arm64;
+#elif defined(__arm__)
+ arch = kArch_arm;
+#elif defined(__powerpc__)
+ arch = kArch_ppc;
+#else
+ #error "Unsupported CPU architecture"
+#endif
+ return &kKnownArchitectures[arch];
+}
+
+const NXArchInfo *NXGetArchInfoFromName(const char *name) {
+ for (int arch = 0; arch < kNumArchitectures; ++arch) {
+ if (!strcmp(name, kKnownArchitectures[arch].name)) {
+ return &kKnownArchitectures[arch];
+ }
+ }
+ return NULL;
+}
+
+const NXArchInfo *NXGetArchInfoFromCpuType(cpu_type_t cputype,
+ cpu_subtype_t cpusubtype) {
+ const NXArchInfo *candidate = NULL;
+ for (int arch = 0; arch < kNumArchitectures; ++arch) {
+ if (kKnownArchitectures[arch].cputype == cputype) {
+ if (kKnownArchitectures[arch].cpusubtype == cpusubtype) {
+ return &kKnownArchitectures[arch];
+ }
+ if (!candidate) {
+ candidate = &kKnownArchitectures[arch];
+ }
+ }
+ }
+ return candidate;
+}
+
+struct fat_arch *NXFindBestFatArch(cpu_type_t cputype,
+ cpu_subtype_t cpusubtype,
+ struct fat_arch *fat_archs,
+ uint32_t nfat_archs) {
+ struct fat_arch *candidate = NULL;
+ for (uint32_t f = 0; f < nfat_archs; ++f) {
+ if (fat_archs[f].cputype == cputype) {
+ if (fat_archs[f].cpusubtype == cpusubtype) {
+ return &fat_archs[f];
+ }
+ if (!candidate) {
+ candidate = &fat_archs[f];
+ }
+ }
+ }
+ return candidate;
+}
+#endif // !__APPLE__
diff --git a/src/common/mac/byteswap.h b/src/common/mac/byteswap.h
index a5d745b3..b7bbc0b9 100644
--- a/src/common/mac/byteswap.h
+++ b/src/common/mac/byteswap.h
@@ -36,6 +36,7 @@
#ifndef COMMON_MAC_BYTESWAP_H_
#define COMMON_MAC_BYTESWAP_H_
+#ifdef __APPLE__
#include <libkern/OSByteOrder.h>
static inline uint16_t ByteSwap(uint16_t v) { return OSSwapInt16(v); }
@@ -45,4 +46,28 @@ static inline int16_t ByteSwap(int16_t v) { return OSSwapInt16(v); }
static inline int32_t ByteSwap(int32_t v) { return OSSwapInt32(v); }
static inline int64_t ByteSwap(int64_t v) { return OSSwapInt64(v); }
+#elif defined(__linux__)
+// For NXByteOrder
+#include <architecture/byte_order.h>
+#include <stdint.h>
+#include <endian.h>
+#include_next <byteswap.h>
+
+static inline uint16_t ByteSwap(uint16_t v) { return bswap_16(v); }
+static inline uint32_t ByteSwap(uint32_t v) { return bswap_32(v); }
+static inline uint64_t ByteSwap(uint64_t v) { return bswap_64(v); }
+static inline int16_t ByteSwap(int16_t v) { return bswap_16(v); }
+static inline int32_t ByteSwap(int32_t v) { return bswap_32(v); }
+static inline int64_t ByteSwap(int64_t v) { return bswap_64(v); }
+
+static inline NXByteOrder NXHostByteOrder() {
+#ifdef __LITTLE_ENDIAN
+ return NX_LittleEndian;
+#else
+ return NX_BigEndian;
+#endif
+}
+
+#endif // __APPLE__
+
#endif // COMMON_MAC_BYTESWAP_H_
diff --git a/src/common/mac/dump_syms.mm b/src/common/mac/dump_syms.cc
index f2420f17..3fbedd95 100644
--- a/src/common/mac/dump_syms.mm
+++ b/src/common/mac/dump_syms.cc
@@ -31,14 +31,20 @@
// Author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com>
-// dump_syms.mm: Create a symbol file for use with minidumps
+// dump_syms.cc: Create a symbol file for use with minidumps
#include "common/mac/dump_syms.h"
-#include <Foundation/Foundation.h>
+#include <assert.h>
+#include <dirent.h>
+#include <errno.h>
#include <mach-o/arch.h>
#include <mach-o/fat.h>
+#include <stdint.h>
#include <stdio.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <unistd.h>
#include <ostream>
#include <string>
@@ -49,10 +55,12 @@
#include "common/dwarf_cfi_to_module.h"
#include "common/dwarf_cu_to_module.h"
#include "common/dwarf_line_to_module.h"
+#include "common/dwarf_range_list_handler.h"
#include "common/mac/file_id.h"
#include "common/mac/arch_utilities.h"
#include "common/mac/macho_reader.h"
#include "common/module.h"
+#include "common/path_helper.h"
#include "common/scoped_ptr.h"
#include "common/stabs_reader.h"
#include "common/stabs_to_module.h"
@@ -69,6 +77,7 @@
using dwarf2reader::ByteReader;
using google_breakpad::DwarfCUToModule;
using google_breakpad::DwarfLineToModule;
+using google_breakpad::DwarfRangeListHandler;
using google_breakpad::FileID;
using google_breakpad::mach_o::FatReader;
using google_breakpad::mach_o::Section;
@@ -82,104 +91,120 @@ using std::pair;
using std::string;
using std::vector;
+namespace {
+// Return a vector<string> with absolute paths to all the entries
+// in directory (excluding . and ..).
+vector<string> list_directory(const string& directory) {
+ vector<string> entries;
+ DIR* dir = opendir(directory.c_str());
+ if (!dir) {
+ return entries;
+ }
+
+ string path = directory;
+ if (path[path.length() - 1] != '/') {
+ path += '/';
+ }
+
+ struct dirent* entry = NULL;
+ while ((entry = readdir(dir))) {
+ if (strcmp(entry->d_name, ".") != 0 && strcmp(entry->d_name, "..") != 0) {
+ entries.push_back(path + entry->d_name);
+ }
+ }
+
+ closedir(dir);
+ return entries;
+}
+}
+
namespace google_breakpad {
-bool DumpSymbols::Read(NSString *filename) {
- if (![[NSFileManager defaultManager] fileExistsAtPath:filename]) {
- fprintf(stderr, "Object file does not exist: %s\n",
- [filename fileSystemRepresentation]);
+bool DumpSymbols::Read(const string &filename) {
+ struct stat st;
+ if (stat(filename.c_str(), &st) == -1) {
+ fprintf(stderr, "Could not access object file %s: %s\n",
+ filename.c_str(), strerror(errno));
return false;
}
- input_pathname_ = [filename retain];
+ input_pathname_ = filename;
// Does this filename refer to a dSYM bundle?
- NSBundle *bundle = [NSBundle bundleWithPath:input_pathname_];
-
- if (bundle) {
- // Filenames referring to bundles usually have names of the form
- // "<basename>.dSYM"; however, if the user has specified a wrapper
- // suffix (the WRAPPER_SUFFIX and WRAPPER_EXTENSION build settings),
- // then the name may have the form "<basename>.<extension>.dSYM". In
- // either case, the resource name for the file containing the DWARF
- // info within the bundle is <basename>.
- //
- // Since there's no way to tell how much to strip off, remove one
- // extension at a time, and use the first one that
- // pathForResource:ofType:inDirectory likes.
- NSString *base_name = [input_pathname_ lastPathComponent];
- NSString *dwarf_resource;
-
- do {
- NSString *new_base_name = [base_name stringByDeletingPathExtension];
-
- // If stringByDeletingPathExtension returned the name unchanged, then
- // there's nothing more for us to strip off --- lose.
- if ([new_base_name isEqualToString:base_name]) {
- fprintf(stderr, "Unable to find DWARF-bearing file in bundle: %s\n",
- [input_pathname_ fileSystemRepresentation]);
- return false;
- }
-
- // Take the shortened result as our new base_name.
- base_name = new_base_name;
-
- // Try to find a DWARF resource in the bundle under the new base_name.
- dwarf_resource = [bundle pathForResource:base_name
- ofType:nil inDirectory:@"DWARF"];
- } while (!dwarf_resource);
+ string contents_path = input_pathname_ + "/Contents/Resources/DWARF";
+ if (S_ISDIR(st.st_mode) &&
+ access(contents_path.c_str(), F_OK) == 0) {
+ // If there's one file under Contents/Resources/DWARF then use that,
+ // otherwise bail out.
+ const vector<string> entries = list_directory(contents_path);
+ if (entries.size() == 0) {
+ fprintf(stderr, "Unable to find DWARF-bearing file in bundle: %s\n",
+ input_pathname_.c_str());
+ return false;
+ }
+ if (entries.size() > 1) {
+ fprintf(stderr, "Too many DWARF files in bundle: %s\n",
+ input_pathname_.c_str());
+ return false;
+ }
- object_filename_ = [dwarf_resource retain];
+ object_filename_ = entries[0];
} else {
- object_filename_ = [input_pathname_ retain];
+ object_filename_ = input_pathname_;
}
// Read the file's contents into memory.
- //
- // The documentation for dataWithContentsOfMappedFile says:
- //
- // Because of file mapping restrictions, this method should only be
- // used if the file is guaranteed to exist for the duration of the
- // data object’s existence. It is generally safer to use the
- // dataWithContentsOfFile: method.
- //
- // I gather this means that OS X doesn't have (or at least, that method
- // doesn't use) a form of mapping like Linux's MAP_PRIVATE, where the
- // process appears to get its own copy of the data, and changes to the
- // file don't affect memory and vice versa).
- NSError *error;
- contents_ = [NSData dataWithContentsOfFile:object_filename_
- options:0
- error:&error];
- if (!contents_) {
+ bool read_ok = true;
+ string error;
+ if (stat(object_filename_.c_str(), &st) != -1) {
+ FILE* f = fopen(object_filename_.c_str(), "rb");
+ if (f) {
+ contents_.reset(new uint8_t[st.st_size]);
+ off_t total = 0;
+ while (total < st.st_size && !feof(f)) {
+ size_t read = fread(&contents_[0] + total, 1, st.st_size - total, f);
+ if (read == 0) {
+ if (ferror(f)) {
+ read_ok = false;
+ error = strerror(errno);
+ }
+ break;
+ }
+ total += read;
+ }
+ fclose(f);
+ } else {
+ error = strerror(errno);
+ }
+ }
+
+ if (!read_ok) {
fprintf(stderr, "Error reading object file: %s: %s\n",
- [object_filename_ fileSystemRepresentation],
- [[error localizedDescription] UTF8String]);
+ object_filename_.c_str(),
+ error.c_str());
return false;
}
- [contents_ retain];
// Get the list of object files present in the file.
- FatReader::Reporter fat_reporter([object_filename_
- fileSystemRepresentation]);
+ FatReader::Reporter fat_reporter(object_filename_);
FatReader fat_reader(&fat_reporter);
- if (!fat_reader.Read(reinterpret_cast<const uint8_t *>([contents_ bytes]),
- [contents_ length])) {
+ if (!fat_reader.Read(&contents_[0],
+ st.st_size)) {
return false;
}
// Get our own copy of fat_reader's object file list.
size_t object_files_count;
- const struct fat_arch *object_files =
+ const SuperFatArch *object_files =
fat_reader.object_files(&object_files_count);
if (object_files_count == 0) {
fprintf(stderr, "Fat binary file contains *no* architectures: %s\n",
- [object_filename_ fileSystemRepresentation]);
+ object_filename_.c_str());
return false;
}
object_files_.resize(object_files_count);
memcpy(&object_files_[0], object_files,
- sizeof(struct fat_arch) * object_files_count);
+ sizeof(SuperFatArch) * object_files_count);
return true;
}
@@ -187,9 +212,8 @@ bool DumpSymbols::Read(NSString *filename) {
bool DumpSymbols::SetArchitecture(cpu_type_t cpu_type,
cpu_subtype_t cpu_subtype) {
// Find the best match for the architecture the user requested.
- const struct fat_arch *best_match
- = NXFindBestFatArch(cpu_type, cpu_subtype, &object_files_[0],
- static_cast<uint32_t>(object_files_.size()));
+ const SuperFatArch *best_match = FindBestMatchForArchitecture(
+ cpu_type, cpu_subtype);
if (!best_match) return false;
// Record the selected object file.
@@ -207,14 +231,65 @@ bool DumpSymbols::SetArchitecture(const std::string &arch_name) {
return arch_set;
}
+SuperFatArch* DumpSymbols::FindBestMatchForArchitecture(
+ cpu_type_t cpu_type, cpu_subtype_t cpu_subtype) {
+ // Check if all the object files can be converted to struct fat_arch.
+ bool can_convert_to_fat_arch = true;
+ vector<struct fat_arch> fat_arch_vector;
+ for (vector<SuperFatArch>::const_iterator it = object_files_.begin();
+ it != object_files_.end();
+ ++it) {
+ struct fat_arch arch;
+ bool success = it->ConvertToFatArch(&arch);
+ if (!success) {
+ can_convert_to_fat_arch = false;
+ break;
+ }
+ fat_arch_vector.push_back(arch);
+ }
+
+ // If all the object files can be converted to struct fat_arch, use
+ // NXFindBestFatArch.
+ if (can_convert_to_fat_arch) {
+ const struct fat_arch *best_match
+ = NXFindBestFatArch(cpu_type, cpu_subtype, &fat_arch_vector[0],
+ static_cast<uint32_t>(fat_arch_vector.size()));
+
+ for (size_t i = 0; i < fat_arch_vector.size(); ++i) {
+ if (best_match == &fat_arch_vector[i])
+ return &object_files_[i];
+ }
+ assert(best_match == NULL);
+ return NULL;
+ }
+
+ // Check for an exact match with cpu_type and cpu_subtype.
+ for (vector<SuperFatArch>::iterator it = object_files_.begin();
+ it != object_files_.end();
+ ++it) {
+ if (static_cast<cpu_type_t>(it->cputype) == cpu_type &&
+ static_cast<cpu_subtype_t>(it->cpusubtype) == cpu_subtype)
+ return &*it;
+ }
+
+ // No exact match found.
+ // TODO(erikchen): If it becomes necessary, we can copy the implementation of
+ // NXFindBestFatArch, located at
+ // http://web.mit.edu/darwin/src/modules/cctools/libmacho/arch.c.
+ fprintf(stderr, "Failed to find an exact match for an object file with cpu "
+ "type: %d and cpu subtype: %d. Furthermore, at least one object file is "
+ "larger than 2**32.\n", cpu_type, cpu_subtype);
+ return NULL;
+}
+
string DumpSymbols::Identifier() {
- FileID file_id([object_filename_ fileSystemRepresentation]);
+ FileID file_id(object_filename_.c_str());
unsigned char identifier_bytes[16];
cpu_type_t cpu_type = selected_object_file_->cputype;
cpu_subtype_t cpu_subtype = selected_object_file_->cpusubtype;
if (!file_id.MachoIdentifier(cpu_type, cpu_subtype, identifier_bytes)) {
fprintf(stderr, "Unable to calculate UUID of mach-o binary %s!\n",
- [object_filename_ fileSystemRepresentation]);
+ object_filename_.c_str());
return "";
}
@@ -230,6 +305,31 @@ string DumpSymbols::Identifier() {
return compacted;
}
+// A range handler that accepts rangelist data parsed by
+// dwarf2reader::RangeListReader and populates a range vector (typically
+// owned by a function) with the results.
+class DumpSymbols::DumperRangesHandler:
+ public DwarfCUToModule::RangesHandler {
+ public:
+ DumperRangesHandler(const uint8_t *buffer, uint64_t size,
+ dwarf2reader::ByteReader* reader)
+ : buffer_(buffer), size_(size), reader_(reader) { }
+
+ bool ReadRanges(uint64_t offset, Module::Address base_address,
+ vector<Module::Range>* ranges) {
+ DwarfRangeListHandler handler(base_address, ranges);
+ dwarf2reader::RangeListReader rangelist_reader(buffer_, size_, reader_,
+ &handler);
+
+ return rangelist_reader.ReadRangeList(offset);
+ }
+
+ private:
+ const uint8_t *buffer_;
+ uint64_t size_;
+ dwarf2reader::ByteReader* reader_;
+};
+
// A line-to-module loader that accepts line number info parsed by
// dwarf2reader::LineInfo and populates a Module and a line vector
// with the results.
@@ -244,7 +344,7 @@ class DumpSymbols::DumperLineToModule:
compilation_dir_ = compilation_dir;
}
- void ReadProgram(const char *program, uint64 length,
+ void ReadProgram(const uint8_t *program, uint64_t length,
Module *module, vector<Module::Line> *lines) {
DwarfLineToModule handler(module, compilation_dir_, lines);
dwarf2reader::LineInfo parser(program, length, byte_reader_, &handler);
@@ -255,7 +355,65 @@ class DumpSymbols::DumperLineToModule:
dwarf2reader::ByteReader *byte_reader_; // WEAK
};
-bool DumpSymbols::ReadDwarf(google_breakpad::Module *module,
+bool DumpSymbols::CreateEmptyModule(scoped_ptr<Module>& module) {
+ // Select an object file, if SetArchitecture hasn't been called to set one
+ // explicitly.
+ if (!selected_object_file_) {
+ // If there's only one architecture, that's the one.
+ if (object_files_.size() == 1)
+ selected_object_file_ = &object_files_[0];
+ else {
+ // Look for an object file whose architecture matches our own.
+ const NXArchInfo *local_arch = NXGetLocalArchInfo();
+ if (!SetArchitecture(local_arch->cputype, local_arch->cpusubtype)) {
+ fprintf(stderr, "%s: object file contains more than one"
+ " architecture, none of which match the current"
+ " architecture; specify an architecture explicitly"
+ " with '-a ARCH' to resolve the ambiguity\n",
+ object_filename_.c_str());
+ return false;
+ }
+ }
+ }
+
+ assert(selected_object_file_);
+
+ // Find the name of the selected file's architecture, to appear in
+ // the MODULE record and in error messages.
+ const NXArchInfo *selected_arch_info =
+ google_breakpad::BreakpadGetArchInfoFromCpuType(
+ selected_object_file_->cputype, selected_object_file_->cpusubtype);
+
+ const char *selected_arch_name = selected_arch_info->name;
+ if (strcmp(selected_arch_name, "i386") == 0)
+ selected_arch_name = "x86";
+
+ // Produce a name to use in error messages that includes the
+ // filename, and the architecture, if there is more than one.
+ selected_object_name_ = object_filename_;
+ if (object_files_.size() > 1) {
+ selected_object_name_ += ", architecture ";
+ selected_object_name_ + selected_arch_name;
+ }
+
+ // Compute a module name, to appear in the MODULE record.
+ string module_name = google_breakpad::BaseName(object_filename_);
+
+ // Choose an identifier string, to appear in the MODULE record.
+ string identifier = Identifier();
+ if (identifier.empty())
+ return false;
+ identifier += "0";
+
+ // Create a module to hold the debugging information.
+ module.reset(new Module(module_name,
+ "mac",
+ selected_arch_name,
+ identifier));
+ return true;
+}
+
+void DumpSymbols::ReadDwarf(google_breakpad::Module *module,
const mach_o::Reader &macho_reader,
const mach_o::SectionMap &dwarf_sections,
bool handle_inter_cu_refs) const {
@@ -274,46 +432,57 @@ bool DumpSymbols::ReadDwarf(google_breakpad::Module *module,
it != dwarf_sections.end(); ++it) {
file_context.AddSectionToSectionMap(
it->first,
- reinterpret_cast<const char *>(it->second.contents.start),
+ it->second.contents.start,
it->second.contents.Size());
}
// Find the __debug_info section.
dwarf2reader::SectionMap::const_iterator debug_info_entry =
file_context.section_map().find("__debug_info");
- assert(debug_info_entry != file_context.section_map().end());
- const std::pair<const char*, uint64>& debug_info_section =
- debug_info_entry->second;
// There had better be a __debug_info section!
- if (!debug_info_section.first) {
+ if (debug_info_entry == file_context.section_map().end()) {
fprintf(stderr, "%s: __DWARF segment of file has no __debug_info section\n",
selected_object_name_.c_str());
- return false;
+ return;
}
+ const std::pair<const uint8_t*, uint64_t>& debug_info_section =
+ debug_info_entry->second;
// Build a line-to-module loader for the root handler to use.
DumperLineToModule line_to_module(&byte_reader);
+ // Optional .debug_ranges reader
+ scoped_ptr<DumperRangesHandler> ranges_handler;
+ dwarf2reader::SectionMap::const_iterator ranges_entry =
+ file_context.section_map().find("__debug_ranges");
+ if (ranges_entry != file_context.section_map().end()) {
+ const std::pair<const uint8_t *, uint64_t>& ranges_section =
+ ranges_entry->second;
+ ranges_handler.reset(
+ new DumperRangesHandler(ranges_section.first, ranges_section.second,
+ &byte_reader));
+ }
+
// Walk the __debug_info section, one compilation unit at a time.
- uint64 debug_info_length = debug_info_section.second;
- for (uint64 offset = 0; offset < debug_info_length;) {
+ uint64_t debug_info_length = debug_info_section.second;
+ for (uint64_t offset = 0; offset < debug_info_length;) {
// Make a handler for the root DIE that populates MODULE with the
// debug info.
DwarfCUToModule::WarningReporter reporter(selected_object_name_,
offset);
- DwarfCUToModule root_handler(&file_context, &line_to_module, &reporter);
+ DwarfCUToModule root_handler(&file_context, &line_to_module,
+ ranges_handler.get(), &reporter);
// Make a Dwarf2Handler that drives our DIEHandler.
dwarf2reader::DIEDispatcher die_dispatcher(&root_handler);
// Make a DWARF parser for the compilation unit at OFFSET.
- dwarf2reader::CompilationUnit dwarf_reader(file_context.section_map(),
+ dwarf2reader::CompilationUnit dwarf_reader(selected_object_name_,
+ file_context.section_map(),
offset,
&byte_reader,
&die_dispatcher);
// Process the entire compilation unit; get the offset of the next.
offset += dwarf_reader.Start();
}
-
- return true;
}
bool DumpSymbols::ReadCFI(google_breakpad::Module *module,
@@ -352,7 +521,7 @@ bool DumpSymbols::ReadCFI(google_breakpad::Module *module,
}
// Find the call frame information and its size.
- const char *cfi = reinterpret_cast<const char *>(section.contents.start);
+ const uint8_t *cfi = section.contents.start;
size_t cfi_size = section.contents.Size();
// Plug together the parser, handler, and their entourages.
@@ -426,10 +595,7 @@ bool DumpSymbols::LoadCommandDumper::SegmentCommand(const Segment &segment) {
if (segment.name == "__DWARF") {
if (symbol_data_ != ONLY_CFI) {
- if (!dumper_.ReadDwarf(module_, reader_, section_map,
- handle_inter_cu_refs_)) {
- return false;
- }
+ dumper_.ReadDwarf(module_, reader_, section_map, handle_inter_cu_refs_);
}
if (symbol_data_ != NO_CFI) {
mach_o::SectionMap::const_iterator debug_frame
@@ -462,65 +628,14 @@ bool DumpSymbols::LoadCommandDumper::SymtabCommand(const ByteBuffer &entries,
}
bool DumpSymbols::ReadSymbolData(Module** out_module) {
- // Select an object file, if SetArchitecture hasn't been called to set one
- // explicitly.
- if (!selected_object_file_) {
- // If there's only one architecture, that's the one.
- if (object_files_.size() == 1)
- selected_object_file_ = &object_files_[0];
- else {
- // Look for an object file whose architecture matches our own.
- const NXArchInfo *local_arch = NXGetLocalArchInfo();
- if (!SetArchitecture(local_arch->cputype, local_arch->cpusubtype)) {
- fprintf(stderr, "%s: object file contains more than one"
- " architecture, none of which match the current"
- " architecture; specify an architecture explicitly"
- " with '-a ARCH' to resolve the ambiguity\n",
- [object_filename_ fileSystemRepresentation]);
- return false;
- }
- }
- }
-
- assert(selected_object_file_);
-
- // Find the name of the selected file's architecture, to appear in
- // the MODULE record and in error messages.
- const NXArchInfo *selected_arch_info =
- google_breakpad::BreakpadGetArchInfoFromCpuType(
- selected_object_file_->cputype, selected_object_file_->cpusubtype);
-
- const char *selected_arch_name = selected_arch_info->name;
- if (strcmp(selected_arch_name, "i386") == 0)
- selected_arch_name = "x86";
-
- // Produce a name to use in error messages that includes the
- // filename, and the architecture, if there is more than one.
- selected_object_name_ = [object_filename_ UTF8String];
- if (object_files_.size() > 1) {
- selected_object_name_ += ", architecture ";
- selected_object_name_ + selected_arch_name;
- }
-
- // Compute a module name, to appear in the MODULE record.
- NSString *module_name = [object_filename_ lastPathComponent];
-
- // Choose an identifier string, to appear in the MODULE record.
- string identifier = Identifier();
- if (identifier.empty())
+ scoped_ptr<Module> module;
+ if (!CreateEmptyModule(module))
return false;
- identifier += "0";
-
- // Create a module to hold the debugging information.
- scoped_ptr<Module> module(new Module([module_name UTF8String],
- "mac",
- selected_arch_name,
- identifier));
// Parse the selected object file.
mach_o::Reader::Reporter reporter(selected_object_name_);
mach_o::Reader reader(&reporter);
- if (!reader.Read(reinterpret_cast<const uint8_t *>([contents_ bytes])
+ if (!reader.Read(&contents_[0]
+ selected_object_file_->offset,
selected_object_file_->size,
selected_object_file_->cputype,
@@ -550,4 +665,15 @@ bool DumpSymbols::WriteSymbolFile(std::ostream &stream) {
return false;
}
+// Read the selected object file's debugging information, and write out the
+// header only to |stream|. Return true on success; if an error occurs, report
+// it and return false.
+bool DumpSymbols::WriteSymbolFileHeader(std::ostream &stream) {
+ scoped_ptr<Module> module;
+ if (!CreateEmptyModule(module))
+ return false;
+
+ return module->Write(stream, symbol_data_);
+}
+
} // namespace google_breakpad
diff --git a/src/common/mac/dump_syms.h b/src/common/mac/dump_syms.h
index 34e83976..1e57f86d 100644
--- a/src/common/mac/dump_syms.h
+++ b/src/common/mac/dump_syms.h
@@ -35,7 +35,6 @@
// reading debugging information from Mach-O files and writing it out as a
// Breakpad symbol file.
-#include <Foundation/Foundation.h>
#include <mach-o/loader.h>
#include <stdio.h>
#include <stdlib.h>
@@ -46,7 +45,9 @@
#include "common/byte_cursor.h"
#include "common/mac/macho_reader.h"
+#include "common/mac/super_fat_arch.h"
#include "common/module.h"
+#include "common/scoped_ptr.h"
#include "common/symbol_data.h"
namespace google_breakpad {
@@ -59,23 +60,17 @@ class DumpSymbols {
input_pathname_(),
object_filename_(),
contents_(),
+ object_files_(),
selected_object_file_(),
selected_object_name_() { }
~DumpSymbols() {
- [input_pathname_ release];
- [object_filename_ release];
- [contents_ release];
}
// Prepare to read debugging information from |filename|. |filename| may be
// the name of a universal binary, a Mach-O file, or a dSYM bundle
// containing either of the above. On success, return true; if there is a
// problem reading |filename|, report it and return false.
- //
- // (This class uses NSString for filenames and related values,
- // because the Mac Foundation framework seems to support
- // filename-related operations more fully on NSString values.)
- bool Read(NSString *filename);
+ bool Read(const std::string &filename);
// If this dumper's file includes an object file for |cpu_type| and
// |cpu_subtype|, then select that object file for dumping, and return
@@ -98,14 +93,14 @@ class DumpSymbols {
// architecture matches that of this dumper program.
bool SetArchitecture(const std::string &arch_name);
- // Return a pointer to an array of 'struct fat_arch' structures,
- // describing the object files contained in this dumper's file. Set
- // *|count| to the number of elements in the array. The returned array is
- // owned by this DumpSymbols instance.
+ // Return a pointer to an array of SuperFatArch structures describing the
+ // object files contained in this dumper's file. Set *|count| to the number
+ // of elements in the array. The returned array is owned by this DumpSymbols
+ // instance.
//
// If there are no available architectures, this function
// may return NULL.
- const struct fat_arch *AvailableArchitectures(size_t *count) {
+ const SuperFatArch* AvailableArchitectures(size_t *count) {
*count = object_files_.size();
if (object_files_.size() > 0)
return &object_files_[0];
@@ -117,6 +112,11 @@ class DumpSymbols {
// return false.
bool WriteSymbolFile(std::ostream &stream);
+ // Read the selected object file's debugging information, and write out the
+ // header only to |stream|. Return true on success; if an error occurs, report
+ // it and return false.
+ bool WriteSymbolFileHeader(std::ostream &stream);
+
// As above, but simply return the debugging information in module
// instead of writing it to a stream. The caller owns the resulting
// module object and must delete it when finished.
@@ -125,15 +125,24 @@ class DumpSymbols {
private:
// Used internally.
class DumperLineToModule;
+ class DumperRangesHandler;
class LoadCommandDumper;
+ // This method behaves similarly to NXFindBestFatArch, but it supports
+ // SuperFatArch.
+ SuperFatArch* FindBestMatchForArchitecture(
+ cpu_type_t cpu_type, cpu_subtype_t cpu_subtype);
+
// Return an identifier string for the file this DumpSymbols is dumping.
std::string Identifier();
+
+ // Creates an empty module object.
+ bool CreateEmptyModule(scoped_ptr<Module>& module);
+
// Read debugging information from |dwarf_sections|, which was taken from
- // |macho_reader|, and add it to |module|. On success, return true;
- // on failure, report the problem and return false.
- bool ReadDwarf(google_breakpad::Module *module,
+ // |macho_reader|, and add it to |module|.
+ void ReadDwarf(google_breakpad::Module *module,
const mach_o::Reader &macho_reader,
const mach_o::SectionMap &dwarf_sections,
bool handle_inter_cu_refs) const;
@@ -156,26 +165,26 @@ class DumpSymbols {
// The name of the file or bundle whose symbols this will dump.
// This is the path given to Read, for use in error messages.
- NSString *input_pathname_;
+ std::string input_pathname_;
// The name of the file this DumpSymbols will actually read debugging
// information from. Normally, this is the same as input_pathname_, but if
// filename refers to a dSYM bundle, then this is the resource file
// within that bundle.
- NSString *object_filename_;
+ std::string object_filename_;
// The complete contents of object_filename_, mapped into memory.
- NSData *contents_;
+ scoped_array<uint8_t> contents_;
- // A vector of fat_arch structures describing the object files
+ // A vector of SuperFatArch structures describing the object files
// object_filename_ contains. If object_filename_ refers to a fat binary,
// this may have more than one element; if it refers to a Mach-O file, this
// has exactly one element.
- vector<struct fat_arch> object_files_;
+ vector<SuperFatArch> object_files_;
// The object file in object_files_ selected to dump, or NULL if
// SetArchitecture hasn't been called yet.
- const struct fat_arch *selected_object_file_;
+ const SuperFatArch *selected_object_file_;
// A string that identifies the selected object file, for use in error
// messages. This is usually object_filename_, but if that refers to a
diff --git a/src/common/mac/file_id.cc b/src/common/mac/file_id.cc
index c5d7ed56..4661d5d6 100644
--- a/src/common/mac/file_id.cc
+++ b/src/common/mac/file_id.cc
@@ -34,6 +34,7 @@
// Author: Dan Waylonis
#include <fcntl.h>
+#include <stdio.h>
#include <string.h>
#include <unistd.h>
@@ -45,7 +46,7 @@ using MacFileUtilities::MachoID;
namespace google_breakpad {
FileID::FileID(const char *path) {
- strlcpy(path_, path, sizeof(path_));
+ snprintf(path_, sizeof(path_), "%s", path);
}
bool FileID::FileIdentifier(unsigned char identifier[16]) {
diff --git a/src/common/mac/file_id.h b/src/common/mac/file_id.h
index 1d6dfde1..5d60e84c 100644
--- a/src/common/mac/file_id.h
+++ b/src/common/mac/file_id.h
@@ -42,7 +42,7 @@ namespace google_breakpad {
class FileID {
public:
FileID(const char *path);
- ~FileID() {};
+ ~FileID() {}
// Load the identifier for the file path specified in the constructor into
// |identifier|. Return false if the identifier could not be created for the
diff --git a/src/common/mac/macho_id.cc b/src/common/mac/macho_id.cc
index 09a2a82e..c396ad88 100644
--- a/src/common/mac/macho_id.cc
+++ b/src/common/mac/macho_id.cc
@@ -33,17 +33,15 @@
//
// Author: Dan Waylonis
-extern "C" { // necessary for Leopard
- #include <fcntl.h>
- #include <mach-o/loader.h>
- #include <mach-o/swap.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include <sys/time.h>
- #include <sys/types.h>
- #include <unistd.h>
-}
+
+#include <fcntl.h>
+#include <mach-o/loader.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <unistd.h>
#include "common/mac/macho_id.h"
#include "common/mac/macho_walker.h"
@@ -61,7 +59,7 @@ MachoID::MachoID(const char *path)
crc_(0),
md5_context_(),
update_function_(NULL) {
- strlcpy(path_, path, sizeof(path_));
+ snprintf(path_, sizeof(path_), "%s", path);
}
MachoID::MachoID(const char *path, void *memory, size_t size)
@@ -70,7 +68,7 @@ MachoID::MachoID(const char *path, void *memory, size_t size)
crc_(0),
md5_context_(),
update_function_(NULL) {
- strlcpy(path_, path, sizeof(path_));
+ snprintf(path_, sizeof(path_), "%s", path);
}
MachoID::~MachoID() {
@@ -261,7 +259,7 @@ bool MachoID::WalkerCB(MachoWalker *walker, load_command *cmd, off_t offset,
return false;
if (swap)
- swap_segment_command(&seg, NXHostByteOrder());
+ breakpad_swap_segment_command(&seg);
struct mach_header_64 header;
off_t header_offset;
@@ -278,7 +276,7 @@ bool MachoID::WalkerCB(MachoWalker *walker, load_command *cmd, off_t offset,
return false;
if (swap)
- swap_section(&sec, 1, NXHostByteOrder());
+ breakpad_swap_section(&sec, 1);
// sections of type S_ZEROFILL are "virtual" and contain no data
// in the file itself
@@ -294,7 +292,7 @@ bool MachoID::WalkerCB(MachoWalker *walker, load_command *cmd, off_t offset,
return false;
if (swap)
- breakpad_swap_segment_command_64(&seg64, NXHostByteOrder());
+ breakpad_swap_segment_command_64(&seg64);
struct mach_header_64 header;
off_t header_offset;
@@ -311,7 +309,7 @@ bool MachoID::WalkerCB(MachoWalker *walker, load_command *cmd, off_t offset,
return false;
if (swap)
- breakpad_swap_section_64(&sec64, 1, NXHostByteOrder());
+ breakpad_swap_section_64(&sec64, 1);
// sections of type S_ZEROFILL are "virtual" and contain no data
// in the file itself
@@ -340,7 +338,7 @@ bool MachoID::UUIDWalkerCB(MachoWalker *walker, load_command *cmd, off_t offset,
return false;
if (swap)
- breakpad_swap_uuid_command(uuid_cmd, NXHostByteOrder());
+ breakpad_swap_uuid_command(uuid_cmd);
return false;
}
@@ -359,7 +357,7 @@ bool MachoID::IDWalkerCB(MachoWalker *walker, load_command *cmd, off_t offset,
return false;
if (swap)
- swap_dylib_command(dylib_cmd, NXHostByteOrder());
+ breakpad_swap_dylib_command(dylib_cmd);
return false;
}
diff --git a/src/common/mac/macho_reader.cc b/src/common/mac/macho_reader.cc
index 84b595a3..91e1fdd2 100644
--- a/src/common/mac/macho_reader.cc
+++ b/src/common/mac/macho_reader.cc
@@ -38,6 +38,8 @@
#include <stdio.h>
#include <stdlib.h>
+#include <limits>
+
// Unfortunately, CPU_TYPE_ARM is not define for 10.4.
#if !defined(CPU_TYPE_ARM)
#define CPU_TYPE_ARM 12
@@ -101,22 +103,26 @@ bool FatReader::Read(const uint8_t *buffer, size_t size) {
// Read the list of object files.
object_files_.resize(object_files_count);
for (size_t i = 0; i < object_files_count; i++) {
- struct fat_arch *objfile = &object_files_[i];
+ struct fat_arch objfile;
// Read this object file entry, byte-swapping as appropriate.
- cursor >> objfile->cputype
- >> objfile->cpusubtype
- >> objfile->offset
- >> objfile->size
- >> objfile->align;
+ cursor >> objfile.cputype
+ >> objfile.cpusubtype
+ >> objfile.offset
+ >> objfile.size
+ >> objfile.align;
+
+ SuperFatArch super_fat_arch(objfile);
+ object_files_[i] = super_fat_arch;
+
if (!cursor) {
reporter_->TooShort();
return false;
}
// Does the file actually have the bytes this entry refers to?
size_t fat_size = buffer_.Size();
- if (objfile->offset > fat_size ||
- objfile->size > fat_size - objfile->offset) {
+ if (objfile.offset > fat_size ||
+ objfile.size > fat_size - objfile.offset) {
reporter_->MisplacedObjectFile();
return false;
}
@@ -139,16 +145,14 @@ bool FatReader::Read(const uint8_t *buffer, size_t size) {
}
object_files_[0].offset = 0;
- object_files_[0].size = static_cast<uint32_t>(buffer_.Size());
+ object_files_[0].size = static_cast<uint64_t>(buffer_.Size());
// This alignment is correct for 32 and 64-bit x86 and ppc.
// See get_align in the lipo source for other architectures:
// http://www.opensource.apple.com/source/cctools/cctools-773/misc/lipo.c
object_files_[0].align = 12; // 2^12 == 4096
-
return true;
}
}
-
reporter_->BadHeader();
return false;
}
@@ -179,15 +183,15 @@ void Reader::Reporter::LoadCommandRegionTruncated() {
void Reader::Reporter::LoadCommandsOverrun(size_t claimed, size_t i,
LoadCommandType type) {
- fprintf(stderr, "%s: file's header claims there are %ld"
- " load commands, but load command #%ld",
+ fprintf(stderr, "%s: file's header claims there are %zu"
+ " load commands, but load command #%zu",
filename_.c_str(), claimed, i);
if (type) fprintf(stderr, ", of type %d,", type);
fprintf(stderr, " extends beyond the end of the load command region\n");
}
void Reader::Reporter::LoadCommandTooShort(size_t i, LoadCommandType type) {
- fprintf(stderr, "%s: the contents of load command #%ld, of type %d,"
+ fprintf(stderr, "%s: the contents of load command #%zu, of type %d,"
" extend beyond the size given in the load command's header\n",
filename_.c_str(), i, type);
}
@@ -315,7 +319,7 @@ bool Reader::WalkLoadCommands(Reader::LoadCommandHandler *handler) const {
// remainder of the load command series.
ByteBuffer command(list_cursor.here(), list_cursor.Available());
ByteCursor cursor(&command, big_endian_);
-
+
// Read the command type and size --- fields common to all commands.
uint32_t type, size;
if (!(cursor >> type)) {
@@ -338,12 +342,11 @@ bool Reader::WalkLoadCommands(Reader::LoadCommandHandler *handler) const {
segment.bits_64 = (type == LC_SEGMENT_64);
size_t word_size = segment.bits_64 ? 8 : 4;
cursor.CString(&segment.name, 16);
- size_t file_offset, file_size;
cursor
.Read(word_size, false, &segment.vmaddr)
.Read(word_size, false, &segment.vmsize)
- .Read(word_size, false, &file_offset)
- .Read(word_size, false, &file_size);
+ .Read(word_size, false, &segment.fileoff)
+ .Read(word_size, false, &segment.filesize);
cursor >> segment.maxprot
>> segment.initprot
>> segment.nsects
@@ -352,8 +355,8 @@ bool Reader::WalkLoadCommands(Reader::LoadCommandHandler *handler) const {
reporter_->LoadCommandTooShort(index, type);
return false;
}
- if (file_offset > buffer_.Size() ||
- file_size > buffer_.Size() - file_offset) {
+ if (segment.fileoff > buffer_.Size() ||
+ segment.filesize > buffer_.Size() - segment.fileoff) {
reporter_->MisplacedSegmentData(segment.name);
return false;
}
@@ -361,11 +364,11 @@ bool Reader::WalkLoadCommands(Reader::LoadCommandHandler *handler) const {
// segments removed, and their file offsets and file sizes zeroed
// out. To help us handle this special case properly, give such
// segments' contents NULL starting and ending pointers.
- if (file_offset == 0 && file_size == 0) {
+ if (segment.fileoff == 0 && segment.filesize == 0) {
segment.contents.start = segment.contents.end = NULL;
} else {
- segment.contents.start = buffer_.start + file_offset;
- segment.contents.end = segment.contents.start + file_size;
+ segment.contents.start = buffer_.start + segment.fileoff;
+ segment.contents.end = segment.contents.start + segment.filesize;
}
// The section list occupies the remainder of this load command's space.
segment.section_list.start = cursor.here();
@@ -400,7 +403,7 @@ bool Reader::WalkLoadCommands(Reader::LoadCommandHandler *handler) const {
return false;
break;
}
-
+
default: {
if (!handler->UnknownCommand(type, command))
return false;
@@ -419,7 +422,7 @@ class Reader::SegmentFinder : public LoadCommandHandler {
public:
// Create a load command handler that looks for a segment named NAME,
// and sets SEGMENT to describe it if found.
- SegmentFinder(const string &name, Segment *segment)
+ SegmentFinder(const string &name, Segment *segment)
: name_(name), segment_(segment), found_() { }
// Return true if the traversal found the segment, false otherwise.
@@ -459,14 +462,14 @@ bool Reader::WalkSegmentSections(const Segment &segment,
for (size_t i = 0; i < segment.nsects; i++) {
Section section;
section.bits_64 = segment.bits_64;
- uint64_t size;
- uint32_t offset, dummy32;
+ uint64_t size, offset;
+ uint32_t dummy32;
cursor
.CString(&section.section_name, 16)
.CString(&section.segment_name, 16)
.Read(word_size, false, &section.address)
.Read(word_size, false, &size)
- >> offset
+ .Read(sizeof(uint32_t), false, &offset) // clears high bits of |offset|
>> section.align
>> dummy32
>> dummy32
@@ -479,10 +482,30 @@ bool Reader::WalkSegmentSections(const Segment &segment,
reporter_->SectionsMissing(segment.name);
return false;
}
- if ((section.flags & SECTION_TYPE) == S_ZEROFILL) {
+
+ // Even 64-bit Mach-O isn’t a true 64-bit format in that it doesn’t handle
+ // 64-bit file offsets gracefully. Segment load commands do contain 64-bit
+ // file offsets, but sections within do not. Because segments load
+ // contiguously, recompute each section’s file offset on the basis of its
+ // containing segment’s file offset and the difference between the section’s
+ // and segment’s load addresses. If truncation is detected, honor the
+ // recomputed offset.
+ if (segment.bits_64 &&
+ segment.fileoff + segment.filesize >
+ std::numeric_limits<uint32_t>::max()) {
+ const uint64_t section_offset_recomputed =
+ segment.fileoff + section.address - segment.vmaddr;
+ if (offset == static_cast<uint32_t>(section_offset_recomputed)) {
+ offset = section_offset_recomputed;
+ }
+ }
+
+ const uint32_t section_type = section.flags & SECTION_TYPE;
+ if (section_type == S_ZEROFILL || section_type == S_THREAD_LOCAL_ZEROFILL ||
+ section_type == S_GB_ZEROFILL) {
// Zero-fill sections have a size, but no contents.
section.contents.start = section.contents.end = NULL;
- } else if (segment.contents.start == NULL &&
+ } else if (segment.contents.start == NULL &&
segment.contents.end == NULL) {
// Mach-O files in .dSYM bundles have the contents of the loaded
// segments removed, and their file offsets and file sizes zeroed
diff --git a/src/common/mac/macho_reader.h b/src/common/mac/macho_reader.h
index 75376482..145d17d1 100644
--- a/src/common/mac/macho_reader.h
+++ b/src/common/mac/macho_reader.h
@@ -47,6 +47,7 @@
#include <vector>
#include "common/byte_cursor.h"
+#include "common/mac/super_fat_arch.h"
namespace google_breakpad {
namespace mach_o {
@@ -93,7 +94,7 @@ class FatReader {
// complete header, or the header implies that contents are present
// beyond the actual end of the file.
virtual void TooShort();
-
+
private:
// The filename to which the reader should attribute problems.
string filename_;
@@ -101,7 +102,7 @@ class FatReader {
// Create a fat binary file reader that uses |reporter| to report problems.
explicit FatReader(Reporter *reporter) : reporter_(reporter) { }
-
+
// Read the |size| bytes at |buffer| as a fat binary file. On success,
// return true; on failure, report the problem to reporter_ and return
// false.
@@ -111,13 +112,13 @@ class FatReader {
// single object file is the Mach-O file.
bool Read(const uint8_t *buffer, size_t size);
- // Return an array of 'struct fat_arch' structures describing the
+ // Return an array of 'SuperFatArch' structures describing the
// object files present in this fat binary file. Set |size| to the
// number of elements in the array.
//
- // Assuming Read returned true, the entries are validated: it is
- // safe to assume that the offsets and sizes in each 'struct
- // fat_arch' refer to subranges of the bytes passed to Read.
+ // Assuming Read returned true, the entries are validated: it is safe to
+ // assume that the offsets and sizes in each SuperFatArch refer to subranges
+ // of the bytes passed to Read.
//
// If there are no object files in this fat binary, then this
// function can return NULL.
@@ -129,7 +130,7 @@ class FatReader {
// possible to use the result with OS X functions like NXFindBestFatArch,
// so that the symbol dumper will behave consistently with other OS X
// utilities that work with fat binaries.
- const struct fat_arch *object_files(size_t *count) const {
+ const SuperFatArch* object_files(size_t *count) const {
*count = object_files_.size();
if (object_files_.size() > 0)
return &object_files_[0];
@@ -149,7 +150,7 @@ class FatReader {
// The list of object files in this binary.
// object_files_.size() == fat_header.nfat_arch
- vector<struct fat_arch> object_files_;
+ vector<SuperFatArch> object_files_;
};
// A segment in a Mach-O file. All these fields have been byte-swapped as
@@ -174,10 +175,14 @@ struct Segment {
// of this value are valid.
uint64_t vmsize;
+ // The file offset and size of the segment in the Mach-O image.
+ uint64_t fileoff;
+ uint64_t filesize;
+
// The maximum and initial VM protection of this segment's contents.
uint32_t maxprot;
uint32_t initprot;
-
+
// The number of sections in section_list.
uint32_t nsects;
@@ -376,7 +381,7 @@ class Reader {
return Read(buffer.start,
buffer.Size(),
expected_cpu_type,
- expected_cpu_subtype);
+ expected_cpu_subtype);
}
// Return this file's characteristics, as found in the Mach-O header.
diff --git a/src/common/mac/macho_reader_unittest.cc b/src/common/mac/macho_reader_unittest.cc
index 9bc6d25a..d8459d8c 100644
--- a/src/common/mac/macho_reader_unittest.cc
+++ b/src/common/mac/macho_reader_unittest.cc
@@ -196,7 +196,7 @@ struct FatReaderFixture {
FatReaderFixture()
: fat(kBigEndian),
reporter("reporter filename"),
- reader(&reporter), object_files(), object_files_size() {
+ reader(&reporter), object_files() {
EXPECT_CALL(reporter, BadHeader()).Times(0);
EXPECT_CALL(reporter, TooShort()).Times(0);
@@ -224,7 +224,12 @@ struct FatReaderFixture {
fat_bytes = reinterpret_cast<const uint8_t *>(contents.data());
if (expect_parse_success) {
EXPECT_TRUE(reader.Read(fat_bytes, contents.size()));
- object_files = reader.object_files(&object_files_size);
+ size_t fat_files_count;
+ const SuperFatArch* fat_files = reader.object_files(&fat_files_count);
+ object_files.resize(fat_files_count);
+ for (size_t i = 0; i < fat_files_count; ++i) {
+ EXPECT_TRUE(fat_files[i].ConvertToFatArch(&object_files[i]));
+ }
}
else
EXPECT_FALSE(reader.Read(fat_bytes, contents.size()));
@@ -234,8 +239,7 @@ struct FatReaderFixture {
FatReader reader;
string contents;
const uint8_t *fat_bytes;
- const struct fat_arch *object_files;
- size_t object_files_size;
+ vector<struct fat_arch> object_files;
};
class FatReaderTest: public FatReaderFixture, public Test { };
@@ -289,7 +293,7 @@ TEST_F(FatReaderTest, NoObjectFiles) {
.B32(0xcafebabe) // magic number
.B32(0); // number of architectures
ReadFat();
- EXPECT_EQ(0U, object_files_size);
+ EXPECT_EQ(0U, object_files.size());
}
TEST_F(FatReaderTest, OneObjectFile) {
@@ -304,7 +308,7 @@ TEST_F(FatReaderTest, OneObjectFile) {
.Mark(&obj1_offset)
.Append(0x42, '*'); // dummy contents
ReadFat();
- ASSERT_EQ(1U, object_files_size);
+ ASSERT_EQ(1U, object_files.size());
EXPECT_EQ(0x5e3a6e91, object_files[0].cputype);
EXPECT_EQ(0x52ccd852, object_files[0].cpusubtype);
EXPECT_EQ(obj1_offset.Value(), object_files[0].offset);
@@ -334,7 +338,7 @@ TEST_F(FatReaderTest, ThreeObjectFiles) {
ReadFat();
- ASSERT_EQ(3U, object_files_size);
+ ASSERT_EQ(3U, object_files.size());
// First object file.
EXPECT_EQ(0x0cb92c30, object_files[0].cputype);
@@ -373,7 +377,7 @@ TEST_F(FatReaderTest, BigEndianMachO32) {
// FatReader should treat a Mach-O file as if it were a fat binary file
// containing one object file --- the whole thing.
- ASSERT_EQ(1U, object_files_size);
+ ASSERT_EQ(1U, object_files.size());
EXPECT_EQ(0x1a9d0518, object_files[0].cputype);
EXPECT_EQ(0x1b779357, object_files[0].cpusubtype);
EXPECT_EQ(0U, object_files[0].offset);
@@ -395,7 +399,7 @@ TEST_F(FatReaderTest, BigEndianMachO64) {
// FatReader should treat a Mach-O file as if it were a fat binary file
// containing one object file --- the whole thing.
- ASSERT_EQ(1U, object_files_size);
+ ASSERT_EQ(1U, object_files.size());
EXPECT_EQ(0x5aff8487, object_files[0].cputype);
EXPECT_EQ(0x4c6a57f7, object_files[0].cpusubtype);
EXPECT_EQ(0U, object_files[0].offset);
@@ -417,7 +421,7 @@ TEST_F(FatReaderTest, LittleEndianMachO32) {
// FatReader should treat a Mach-O file as if it were a fat binary file
// containing one object file --- the whole thing.
- ASSERT_EQ(1U, object_files_size);
+ ASSERT_EQ(1U, object_files.size());
EXPECT_EQ(0x1a9d0518, object_files[0].cputype);
EXPECT_EQ(0x1b779357, object_files[0].cpusubtype);
EXPECT_EQ(0U, object_files[0].offset);
@@ -439,7 +443,7 @@ TEST_F(FatReaderTest, LittleEndianMachO64) {
// FatReader should treat a Mach-O file as if it were a fat binary file
// containing one object file --- the whole thing.
- ASSERT_EQ(1U, object_files_size);
+ ASSERT_EQ(1U, object_files.size());
EXPECT_EQ(0x5aff8487, object_files[0].cputype);
EXPECT_EQ(0x4c6a57f7, object_files[0].cpusubtype);
EXPECT_EQ(0U, object_files[0].offset);
@@ -1110,7 +1114,7 @@ TEST_F(LoadCommand, SegmentBE32) {
Return(true)));
EXPECT_TRUE(reader.WalkLoadCommands(&load_command_handler));
- EXPECT_EQ(false, actual_segment.bits_64);
+ EXPECT_FALSE(actual_segment.bits_64);
EXPECT_EQ("froon", actual_segment.name);
EXPECT_EQ(0x1891139cU, actual_segment.vmaddr);
EXPECT_EQ(0xcb76584fU, actual_segment.vmsize);
@@ -1147,7 +1151,7 @@ TEST_F(LoadCommand, SegmentLE32) {
Return(true)));
EXPECT_TRUE(reader.WalkLoadCommands(&load_command_handler));
- EXPECT_EQ(false, actual_segment.bits_64);
+ EXPECT_FALSE(actual_segment.bits_64);
EXPECT_EQ("sixteenprecisely", actual_segment.name);
EXPECT_EQ(0x4b877866U, actual_segment.vmaddr);
EXPECT_EQ(0xcb76584fU, actual_segment.vmsize);
diff --git a/src/common/mac/macho_utilities.cc b/src/common/mac/macho_utilities.cc
index 89f9e775..f56fe768 100644
--- a/src/common/mac/macho_utilities.cc
+++ b/src/common/mac/macho_utilities.cc
@@ -34,16 +34,44 @@
#include "common/mac/byteswap.h"
#include "common/mac/macho_utilities.h"
-void breakpad_swap_uuid_command(struct breakpad_uuid_command *uc,
- enum NXByteOrder target_byte_order)
-{
+#include <mach-o/fat.h>
+#include <mach-o/loader.h>
+
+void breakpad_swap_uuid_command(struct breakpad_uuid_command *uc) {
uc->cmd = ByteSwap(uc->cmd);
uc->cmdsize = ByteSwap(uc->cmdsize);
}
-void breakpad_swap_segment_command_64(struct segment_command_64 *sg,
- enum NXByteOrder target_byte_order)
-{
+void breakpad_swap_load_command(struct load_command *lc) {
+ lc->cmd = ByteSwap(lc->cmd);
+ lc->cmdsize = ByteSwap(lc->cmdsize);
+}
+
+void breakpad_swap_dylib_command(struct dylib_command *dc) {
+ dc->cmd = ByteSwap(dc->cmd);
+ dc->cmdsize = ByteSwap(dc->cmdsize);
+
+ dc->dylib.name.offset = ByteSwap(dc->dylib.name.offset);
+ dc->dylib.timestamp = ByteSwap(dc->dylib.timestamp);
+ dc->dylib.current_version = ByteSwap(dc->dylib.current_version);
+ dc->dylib.compatibility_version = ByteSwap(dc->dylib.compatibility_version);
+}
+
+void breakpad_swap_segment_command(struct segment_command *sc) {
+ sc->cmd = ByteSwap(sc->cmd);
+ sc->cmdsize = ByteSwap(sc->cmdsize);
+
+ sc->vmaddr = ByteSwap(sc->vmaddr);
+ sc->vmsize = ByteSwap(sc->vmsize);
+ sc->fileoff = ByteSwap(sc->fileoff);
+ sc->filesize = ByteSwap(sc->filesize);
+ sc->maxprot = ByteSwap(sc->maxprot);
+ sc->initprot = ByteSwap(sc->initprot);
+ sc->nsects = ByteSwap(sc->nsects);
+ sc->flags = ByteSwap(sc->flags);
+}
+
+void breakpad_swap_segment_command_64(struct segment_command_64 *sg) {
sg->cmd = ByteSwap(sg->cmd);
sg->cmdsize = ByteSwap(sg->cmdsize);
@@ -58,9 +86,32 @@ void breakpad_swap_segment_command_64(struct segment_command_64 *sg,
sg->flags = ByteSwap(sg->flags);
}
-void breakpad_swap_mach_header_64(struct mach_header_64 *mh,
- enum NXByteOrder target_byte_order)
-{
+void breakpad_swap_fat_header(struct fat_header *fh) {
+ fh->magic = ByteSwap(fh->magic);
+ fh->nfat_arch = ByteSwap(fh->nfat_arch);
+}
+
+void breakpad_swap_fat_arch(struct fat_arch *fa, uint32_t narchs) {
+ for (uint32_t i = 0; i < narchs; ++i) {
+ fa[i].cputype = ByteSwap(fa[i].cputype);
+ fa[i].cpusubtype = ByteSwap(fa[i].cpusubtype);
+ fa[i].offset = ByteSwap(fa[i].offset);
+ fa[i].size = ByteSwap(fa[i].size);
+ fa[i].align = ByteSwap(fa[i].align);
+ }
+}
+
+void breakpad_swap_mach_header(struct mach_header *mh) {
+ mh->magic = ByteSwap(mh->magic);
+ mh->cputype = ByteSwap(mh->cputype);
+ mh->cpusubtype = ByteSwap(mh->cpusubtype);
+ mh->filetype = ByteSwap(mh->filetype);
+ mh->ncmds = ByteSwap(mh->ncmds);
+ mh->sizeofcmds = ByteSwap(mh->sizeofcmds);
+ mh->flags = ByteSwap(mh->flags);
+}
+
+void breakpad_swap_mach_header_64(struct mach_header_64 *mh) {
mh->magic = ByteSwap(mh->magic);
mh->cputype = ByteSwap(mh->cputype);
mh->cpusubtype = ByteSwap(mh->cpusubtype);
@@ -71,10 +122,24 @@ void breakpad_swap_mach_header_64(struct mach_header_64 *mh,
mh->reserved = ByteSwap(mh->reserved);
}
+void breakpad_swap_section(struct section *s,
+ uint32_t nsects) {
+ for (uint32_t i = 0; i < nsects; i++) {
+ s[i].addr = ByteSwap(s[i].addr);
+ s[i].size = ByteSwap(s[i].size);
+
+ s[i].offset = ByteSwap(s[i].offset);
+ s[i].align = ByteSwap(s[i].align);
+ s[i].reloff = ByteSwap(s[i].reloff);
+ s[i].nreloc = ByteSwap(s[i].nreloc);
+ s[i].flags = ByteSwap(s[i].flags);
+ s[i].reserved1 = ByteSwap(s[i].reserved1);
+ s[i].reserved2 = ByteSwap(s[i].reserved2);
+ }
+}
+
void breakpad_swap_section_64(struct section_64 *s,
- uint32_t nsects,
- enum NXByteOrder target_byte_order)
-{
+ uint32_t nsects) {
for (uint32_t i = 0; i < nsects; i++) {
s[i].addr = ByteSwap(s[i].addr);
s[i].size = ByteSwap(s[i].size);
diff --git a/src/common/mac/macho_utilities.h b/src/common/mac/macho_utilities.h
index a200c0f7..00563a77 100644
--- a/src/common/mac/macho_utilities.h
+++ b/src/common/mac/macho_utilities.h
@@ -62,23 +62,34 @@ struct breakpad_uuid_command {
uint8_t uuid[16]; /* the 128-bit uuid */
};
-void breakpad_swap_uuid_command(struct breakpad_uuid_command *uc,
- enum NXByteOrder target_byte_order);
+void breakpad_swap_uuid_command(struct breakpad_uuid_command *uc);
+
+void breakpad_swap_load_command(struct load_command *lc);
+
+void breakpad_swap_dylib_command(struct dylib_command *dc);
// Older SDKs defines thread_state_data_t as an int[] instead
// of the natural_t[] it should be.
typedef natural_t breakpad_thread_state_data_t[THREAD_STATE_MAX];
+void breakpad_swap_segment_command(struct segment_command *sc);
+
// The 64-bit swap routines were added during the 10.4 series, their
// presence isn't guaranteed.
-void breakpad_swap_segment_command_64(struct segment_command_64 *sg,
- enum NXByteOrder target_byte_order);
+void breakpad_swap_segment_command_64(struct segment_command_64 *sg);
+
+void breakpad_swap_fat_header(struct fat_header *fh);
+
+void breakpad_swap_fat_arch(struct fat_arch *fa, uint32_t narchs);
+
+void breakpad_swap_mach_header(struct mach_header *mh);
+
+void breakpad_swap_mach_header_64(struct mach_header_64 *mh);
-void breakpad_swap_mach_header_64(struct mach_header_64 *mh,
- enum NXByteOrder target_byte_order);
+void breakpad_swap_section(struct section *s,
+ uint32_t nsects);
void breakpad_swap_section_64(struct section_64 *s,
- uint32_t nsects,
- enum NXByteOrder target_byte_order);
+ uint32_t nsects);
#endif
diff --git a/src/common/mac/macho_walker.cc b/src/common/mac/macho_walker.cc
index eee27d64..1acd8665 100644
--- a/src/common/mac/macho_walker.cc
+++ b/src/common/mac/macho_walker.cc
@@ -33,15 +33,13 @@
//
// Author: Dan Waylonis
-extern "C" { // necessary for Leopard
- #include <assert.h>
- #include <fcntl.h>
- #include <mach-o/arch.h>
- #include <mach-o/loader.h>
- #include <mach-o/swap.h>
- #include <string.h>
- #include <unistd.h>
-}
+#include <assert.h>
+#include <fcntl.h>
+#include <mach-o/arch.h>
+#include <mach-o/fat.h>
+#include <mach-o/loader.h>
+#include <string.h>
+#include <unistd.h>
#include "common/mac/byteswap.h"
#include "common/mac/macho_walker.h"
@@ -156,7 +154,7 @@ bool MachoWalker::FindHeader(cpu_type_t cpu_type,
return false;
if (magic == MH_CIGAM || magic == MH_CIGAM_64)
- swap_mach_header(&header, NXHostByteOrder());
+ breakpad_swap_mach_header(&header);
if (cpu_type != header.cputype ||
(cpu_subtype != CPU_SUBTYPE_MULTIPLE &&
@@ -174,7 +172,7 @@ bool MachoWalker::FindHeader(cpu_type_t cpu_type,
return false;
if (NXHostByteOrder() != NX_BigEndian)
- swap_fat_header(&fat, NXHostByteOrder());
+ breakpad_swap_fat_header(&fat);
offset += sizeof(fat);
@@ -185,7 +183,7 @@ bool MachoWalker::FindHeader(cpu_type_t cpu_type,
return false;
if (NXHostByteOrder() != NX_BigEndian)
- swap_fat_arch(&arch, 1, NXHostByteOrder());
+ breakpad_swap_fat_arch(&arch, 1);
if (arch.cputype == cpu_type &&
(cpu_subtype == CPU_SUBTYPE_MULTIPLE ||
@@ -208,7 +206,7 @@ bool MachoWalker::WalkHeaderAtOffset(off_t offset) {
bool swap = (header.magic == MH_CIGAM);
if (swap)
- swap_mach_header(&header, NXHostByteOrder());
+ breakpad_swap_mach_header(&header);
// Copy the data into the mach_header_64 structure. Since the 32-bit and
// 64-bit only differ in the last field (reserved), this is safe to do.
@@ -234,7 +232,7 @@ bool MachoWalker::WalkHeader64AtOffset(off_t offset) {
bool swap = (header.magic == MH_CIGAM_64);
if (swap)
- breakpad_swap_mach_header_64(&header, NXHostByteOrder());
+ breakpad_swap_mach_header_64(&header);
current_header_ = &header;
current_header_size_ = sizeof(header);
@@ -255,7 +253,7 @@ bool MachoWalker::WalkHeaderCore(off_t offset, uint32_t number_of_commands,
return false;
if (swap)
- swap_load_command(&cmd, NXHostByteOrder());
+ breakpad_swap_load_command(&cmd);
// Call the user callback
if (callback_ && !callback_(this, &cmd, offset, swap, callback_context_))
diff --git a/src/common/mac/super_fat_arch.h b/src/common/mac/super_fat_arch.h
new file mode 100644
index 00000000..501c8652
--- /dev/null
+++ b/src/common/mac/super_fat_arch.h
@@ -0,0 +1,88 @@
+// Copyright (c) 2015, Google Inc.
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Original author: Erik Chen <erikchen@chromium.org>
+
+// super_fat_arch.h: A class to handle 64-bit object files. Has conversions to
+// and from struct fat_arch.
+
+#ifndef BREAKPAD_COMMON_MAC_SUPER_FAT_ARCH_H_
+#define BREAKPAD_COMMON_MAC_SUPER_FAT_ARCH_H_
+
+#include <limits>
+#include <mach-o/fat.h>
+#include <stdint.h>
+
+// Similar to struct fat_arch, except size-related parameters support
+// 64-bits.
+class SuperFatArch {
+ public:
+ uint32_t cputype;
+ uint32_t cpusubtype;
+ uint64_t offset;
+ uint64_t size;
+ uint64_t align;
+
+ SuperFatArch() :
+ cputype(0),
+ cpusubtype(0),
+ offset(0),
+ size(0),
+ align(0) {
+ }
+
+ explicit SuperFatArch(const struct fat_arch &arch) :
+ cputype(arch.cputype),
+ cpusubtype(arch.cpusubtype),
+ offset(arch.offset),
+ size(arch.size),
+ align(arch.align) {
+ }
+
+ // Returns false if the conversion cannot be made.
+ // If the conversion succeeds, the result is placed in |output_arch|.
+ bool ConvertToFatArch(struct fat_arch* output_arch) const {
+ if (offset > std::numeric_limits<uint32_t>::max())
+ return false;
+ if (size > std::numeric_limits<uint32_t>::max())
+ return false;
+ if (align > std::numeric_limits<uint32_t>::max())
+ return false;
+ struct fat_arch arch;
+ arch.cputype = cputype;
+ arch.cpusubtype = cpusubtype;
+ arch.offset = offset;
+ arch.size = size;
+ arch.align = align;
+ *output_arch = arch;
+ return true;
+ }
+};
+
+#endif // BREAKPAD_COMMON_MAC_SUPER_FAT_ARCH_H_
diff --git a/src/common/mac/testing/GTMSenTestCase.m b/src/common/mac/testing/GTMSenTestCase.m
index 5607c316..162f01e9 100644
--- a/src/common/mac/testing/GTMSenTestCase.m
+++ b/src/common/mac/testing/GTMSenTestCase.m
@@ -26,10 +26,6 @@
#import "GTMObjC2Runtime.h"
#import "GTMUnitTestDevLog.h"
-#if !GTM_IPHONE_SDK
-#import "GTMGarbageCollection.h"
-#endif // !GTM_IPHONE_SDK
-
#if GTM_IPHONE_SDK && !GTM_IPHONE_USE_SENTEST
#import <stdarg.h>
@@ -430,71 +426,3 @@ static int MethodSort(id a, id b, void *context) {
}
@end
-
-// Leak detection
-#if !GTM_IPHONE_DEVICE && !GTM_SUPPRESS_RUN_LEAKS_HOOK
-// Don't want to get leaks on the iPhone Device as the device doesn't
-// have 'leaks'. The simulator does though.
-
-// COV_NF_START
-// We don't have leak checking on by default, so this won't be hit.
-static void _GTMRunLeaks(void) {
- // This is an atexit handler. It runs leaks for us to check if we are
- // leaking anything in our tests.
- const char* cExclusionsEnv = getenv("GTM_LEAKS_SYMBOLS_TO_IGNORE");
- NSMutableString *exclusions = [NSMutableString string];
- if (cExclusionsEnv) {
- NSString *exclusionsEnv = [NSString stringWithUTF8String:cExclusionsEnv];
- NSArray *exclusionsArray = [exclusionsEnv componentsSeparatedByString:@","];
- NSString *exclusion;
- NSCharacterSet *wcSet = [NSCharacterSet whitespaceCharacterSet];
- GTM_FOREACH_OBJECT(exclusion, exclusionsArray) {
- exclusion = [exclusion stringByTrimmingCharactersInSet:wcSet];
- [exclusions appendFormat:@"-exclude \"%@\" ", exclusion];
- }
- }
- // Clearing out DYLD_ROOT_PATH because iPhone Simulator framework libraries
- // are different from regular OS X libraries and leaks will fail to run
- // because of missing symbols. Also capturing the output of leaks and then
- // pipe rather than a direct pipe, because otherwise if leaks failed,
- // the system() call will still be successful. Bug:
- // http://code.google.com/p/google-toolbox-for-mac/issues/detail?id=56
- NSString *string
- = [NSString stringWithFormat:
- @"LeakOut=`DYLD_ROOT_PATH='' /usr/bin/leaks %@%d` &&"
- @"echo \"$LeakOut\"|/usr/bin/sed -e 's/Leak: /Leaks:0: warning: Leak /'",
- exclusions, getpid()];
- int ret = system([string UTF8String]);
- if (ret) {
- fprintf(stderr,
- "%s:%d: Error: Unable to run leaks. 'system' returned: %d\n",
- __FILE__, __LINE__, ret);
- fflush(stderr);
- }
-}
-// COV_NF_END
-
-static __attribute__((constructor)) void _GTMInstallLeaks(void) {
- BOOL checkLeaks = YES;
-#if !GTM_IPHONE_SDK
- checkLeaks = GTMIsGarbageCollectionEnabled() ? NO : YES;
-#endif // !GTM_IPHONE_SDK
- if (checkLeaks) {
- checkLeaks = getenv("GTM_ENABLE_LEAKS") ? YES : NO;
- if (checkLeaks) {
- // COV_NF_START
- // We don't have leak checking on by default, so this won't be hit.
- fprintf(stderr, "Leak Checking Enabled\n");
- fflush(stderr);
- int ret = atexit(&_GTMRunLeaks);
- // To avoid unused variable warning when _GTMDevAssert is stripped.
- (void)ret;
- _GTMDevAssert(ret == 0,
- @"Unable to install _GTMRunLeaks as an atexit handler (%d)",
- errno);
- // COV_NF_END
- }
- }
-}
-
-#endif // !GTM_IPHONE_DEVICE && !GTM_SUPPRESS_RUN_LEAKS_HOOK
diff --git a/src/testing/gtest/test/gtest_help_test_.cc b/src/common/macros.h
index 31f78c24..14bb3f7b 100644
--- a/src/testing/gtest/test/gtest_help_test_.cc
+++ b/src/common/macros.h
@@ -1,4 +1,4 @@
-// Copyright 2009, Google Inc.
+// Copyright (c) 2019, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
@@ -26,21 +26,20 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-// This program is meant to be run by gtest_help_test.py. Do not run
-// it directly.
-#include "gtest/gtest.h"
+#ifndef BREAKPAD_COMMON_MACROS_H_
+#define BREAKPAD_COMMON_MACROS_H_
-// When a help flag is specified, this program should skip the tests
-// and exit with 0; otherwise the following test will be executed,
-// causing this program to exit with a non-zero code.
-TEST(HelpFlagTest, ShouldNotBeRun) {
- ASSERT_TRUE(false) << "Tests shouldn't be run when --help is specified.";
-}
-
-#if GTEST_HAS_DEATH_TEST
-TEST(DeathTest, UsedByPythonScriptToDetectSupportForDeathTestsInThisBinary) {}
+// Ensure that this macro definition stays in a private header file: clang
+// suggests the first macro expanding to [[clang::fallthrough]] in its
+// diagnostics, so if BP_FALLTHROUGH is visible in code depending on breakpad,
+// clang would suggest BP_FALLTHROUGH for code depending on breakpad, instead of
+// the client code's own fallthrough macro.
+// TODO(thakis): Once everyone uses C++17, use its [[fallthrough]] instead.
+#if defined(__clang__)
+#define BP_FALLTHROUGH [[clang::fallthrough]]
+#else
+#define BP_FALLTHROUGH
#endif
+
+#endif // BREAKPAD_COMMON_MACROS_H_
diff --git a/src/common/md5.cc b/src/common/md5.cc
index a0d9a1bd..4f1ac8ca 100644
--- a/src/common/md5.cc
+++ b/src/common/md5.cc
@@ -138,8 +138,8 @@ void MD5Final(unsigned char digest[16], struct MD5Context *ctx)
byteReverse(ctx->in, 14);
/* Append length in bits and transform */
- ((u32 *) ctx->in)[14] = ctx->bits[0];
- ((u32 *) ctx->in)[15] = ctx->bits[1];
+ memcpy(&ctx->in[14], &ctx->bits[0], sizeof(u32));
+ memcpy(&ctx->in[15], &ctx->bits[1], sizeof(u32));
MD5Transform(ctx->buf, (u32 *) ctx->in);
byteReverse((unsigned char *) ctx->buf, 4);
diff --git a/src/common/memory.h b/src/common/memory_allocator.h
index d6aa137d..a3159ea4 100644
--- a/src/common/memory.h
+++ b/src/common/memory_allocator.h
@@ -27,8 +27,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef GOOGLE_BREAKPAD_COMMON_MEMORY_H_
-#define GOOGLE_BREAKPAD_COMMON_MEMORY_H_
+#ifndef GOOGLE_BREAKPAD_COMMON_MEMORY_ALLOCATOR_H_
+#define GOOGLE_BREAKPAD_COMMON_MEMORY_ALLOCATOR_H_
#include <stdint.h>
#include <stdlib.h>
@@ -44,7 +44,6 @@
#ifdef __APPLE__
#define sys_mmap mmap
-#define sys_mmap2 mmap
#define sys_munmap munmap
#define MAP_ANONYMOUS MAP_ANON
#else
@@ -64,7 +63,8 @@ class PageAllocator {
: page_size_(getpagesize()),
last_(NULL),
current_page_(NULL),
- page_offset_(0) {
+ page_offset_(0),
+ pages_allocated_(0) {
}
~PageAllocator() {
@@ -112,16 +112,12 @@ class PageAllocator {
return false;
}
+ unsigned long pages_allocated() { return pages_allocated_; }
+
private:
uint8_t *GetNPages(size_t num_pages) {
-#if defined(__x86_64__) || defined(__aarch64__) || defined(__aarch64__) || \
- ((defined(__mips__) && _MIPS_SIM == _ABI64))
void *a = sys_mmap(NULL, page_size_ * num_pages, PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
-#else
- void *a = sys_mmap2(NULL, page_size_ * num_pages, PROT_READ | PROT_WRITE,
- MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
-#endif
if (a == MAP_FAILED)
return NULL;
@@ -136,6 +132,8 @@ class PageAllocator {
header->num_pages = num_pages;
last_ = header;
+ pages_allocated_ += num_pages;
+
return reinterpret_cast<uint8_t*>(a);
}
@@ -157,6 +155,7 @@ class PageAllocator {
PageHeader *last_;
uint8_t *current_page_;
size_t page_offset_;
+ unsigned long pages_allocated_;
};
// Wrapper to use with STL containers
@@ -165,12 +164,30 @@ struct PageStdAllocator : public std::allocator<T> {
typedef typename std::allocator<T>::pointer pointer;
typedef typename std::allocator<T>::size_type size_type;
- explicit PageStdAllocator(PageAllocator& allocator): allocator_(allocator) {}
+ explicit PageStdAllocator(PageAllocator& allocator) : allocator_(allocator),
+ stackdata_(NULL),
+ stackdata_size_(0)
+ {}
+
template <class Other> PageStdAllocator(const PageStdAllocator<Other>& other)
- : allocator_(other.allocator_) {}
+ : allocator_(other.allocator_),
+ stackdata_(nullptr),
+ stackdata_size_(0)
+ {}
+
+ explicit PageStdAllocator(PageAllocator& allocator,
+ pointer stackdata,
+ size_type stackdata_size) : allocator_(allocator),
+ stackdata_(stackdata),
+ stackdata_size_(stackdata_size)
+ {}
inline pointer allocate(size_type n, const void* = 0) {
- return static_cast<pointer>(allocator_.Alloc(sizeof(T) * n));
+ const size_type size = sizeof(T) * n;
+ if (size <= stackdata_size_) {
+ return stackdata_;
+ }
+ return static_cast<pointer>(allocator_.Alloc(size));
}
inline void deallocate(pointer, size_type) {
@@ -188,6 +205,8 @@ struct PageStdAllocator : public std::allocator<T> {
template<typename Other> friend struct PageStdAllocator;
PageAllocator& allocator_;
+ pointer stackdata_;
+ size_type stackdata_size_;
};
// A wasteful vector is a std::vector, except that it allocates memory from a
@@ -200,6 +219,24 @@ class wasteful_vector : public std::vector<T, PageStdAllocator<T> > {
: std::vector<T, PageStdAllocator<T> >(PageStdAllocator<T>(*allocator)) {
std::vector<T, PageStdAllocator<T> >::reserve(size_hint);
}
+ protected:
+ wasteful_vector(PageStdAllocator<T> allocator)
+ : std::vector<T, PageStdAllocator<T> >(allocator) {}
+};
+
+// auto_wasteful_vector allocates space on the stack for N entries to avoid
+// using the PageAllocator for small data, while still allowing for larger data.
+template<class T, unsigned int N>
+class auto_wasteful_vector : public wasteful_vector<T> {
+ T stackdata_[N];
+ public:
+ auto_wasteful_vector(PageAllocator* allocator)
+ : wasteful_vector<T>(
+ PageStdAllocator<T>(*allocator,
+ &stackdata_[0],
+ sizeof(stackdata_))) {
+ std::vector<T, PageStdAllocator<T> >::reserve(N);
+ }
};
} // namespace google_breakpad
@@ -209,4 +246,4 @@ inline void* operator new(size_t nbytes,
return allocator.Alloc(nbytes);
}
-#endif // GOOGLE_BREAKPAD_COMMON_MEMORY_H_
+#endif // GOOGLE_BREAKPAD_COMMON_MEMORY_ALLOCATOR_H_
diff --git a/src/common/memory_unittest.cc b/src/common/memory_allocator_unittest.cc
index 1e511ca5..43c86314 100644
--- a/src/common/memory_unittest.cc
+++ b/src/common/memory_allocator_unittest.cc
@@ -28,7 +28,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "breakpad_googletest_includes.h"
-#include "common/memory.h"
+#include "common/memory_allocator.h"
using namespace google_breakpad;
@@ -38,11 +38,13 @@ typedef testing::Test PageAllocatorTest;
TEST(PageAllocatorTest, Setup) {
PageAllocator allocator;
+ EXPECT_EQ(0U, allocator.pages_allocated());
}
TEST(PageAllocatorTest, SmallObjects) {
PageAllocator allocator;
+ EXPECT_EQ(0U, allocator.pages_allocated());
for (unsigned i = 1; i < 1024; ++i) {
uint8_t *p = reinterpret_cast<uint8_t*>(allocator.Alloc(i));
ASSERT_FALSE(p == NULL);
@@ -53,8 +55,10 @@ TEST(PageAllocatorTest, SmallObjects) {
TEST(PageAllocatorTest, LargeObject) {
PageAllocator allocator;
+ EXPECT_EQ(0U, allocator.pages_allocated());
uint8_t *p = reinterpret_cast<uint8_t*>(allocator.Alloc(10000));
ASSERT_FALSE(p == NULL);
+ EXPECT_EQ(3U, allocator.pages_allocated());
for (unsigned i = 1; i < 10; ++i) {
uint8_t *p = reinterpret_cast<uint8_t*>(allocator.Alloc(i));
ASSERT_FALSE(p == NULL);
@@ -75,6 +79,7 @@ TEST(WastefulVectorTest, Setup) {
TEST(WastefulVectorTest, Simple) {
PageAllocator allocator_;
+ EXPECT_EQ(0U, allocator_.pages_allocated());
wasteful_vector<unsigned> v(&allocator_);
for (unsigned i = 0; i < 256; ++i) {
@@ -84,6 +89,7 @@ TEST(WastefulVectorTest, Simple) {
}
ASSERT_FALSE(v.empty());
ASSERT_EQ(v.size(), 256u);
+ EXPECT_EQ(1U, allocator_.pages_allocated());
for (unsigned i = 0; i < 256; ++i)
ASSERT_EQ(v[i], i);
}
@@ -91,7 +97,28 @@ TEST(WastefulVectorTest, Simple) {
TEST(WastefulVectorTest, UsesPageAllocator) {
PageAllocator allocator_;
wasteful_vector<unsigned> v(&allocator_);
+ EXPECT_EQ(1U, allocator_.pages_allocated());
v.push_back(1);
ASSERT_TRUE(allocator_.OwnsPointer(&v[0]));
}
+
+TEST(WastefulVectorTest, AutoWastefulVector) {
+ PageAllocator allocator_;
+ EXPECT_EQ(0U, allocator_.pages_allocated());
+
+ auto_wasteful_vector<unsigned, 4> v(&allocator_);
+ EXPECT_EQ(0U, allocator_.pages_allocated());
+
+ v.push_back(1);
+ EXPECT_EQ(0U, allocator_.pages_allocated());
+ EXPECT_FALSE(allocator_.OwnsPointer(&v[0]));
+
+ v.resize(4);
+ EXPECT_EQ(0U, allocator_.pages_allocated());
+ EXPECT_FALSE(allocator_.OwnsPointer(&v[0]));
+
+ v.resize(10);
+ EXPECT_EQ(1U, allocator_.pages_allocated());
+ EXPECT_TRUE(allocator_.OwnsPointer(&v[0]));
+}
diff --git a/src/common/module.cc b/src/common/module.cc
index fa798f48..aff22127 100644
--- a/src/common/module.cc
+++ b/src/common/module.cc
@@ -44,16 +44,17 @@
namespace google_breakpad {
using std::dec;
-using std::endl;
using std::hex;
Module::Module(const string &name, const string &os,
- const string &architecture, const string &id) :
+ const string &architecture, const string &id,
+ const string &code_id /* = "" */) :
name_(name),
os_(os),
architecture_(architecture),
id_(id),
+ code_id_(code_id),
load_address_(0) { }
Module::~Module() {
@@ -75,11 +76,19 @@ void Module::SetLoadAddress(Address address) {
load_address_ = address;
}
+void Module::SetAddressRanges(const vector<Range>& ranges) {
+ address_ranges_ = ranges;
+}
+
void Module::AddFunction(Function *function) {
// FUNC lines must not hold an empty name, so catch the problem early if
// callers try to add one.
assert(!function->name.empty());
+ if (!AddressIsInModule(function->address)) {
+ return;
+ }
+
// FUNCs are better than PUBLICs as they come with sizes, so remove an extern
// with the same address if present.
Extern ext(function->address);
@@ -98,10 +107,12 @@ void Module::AddFunction(Function *function) {
#if _DEBUG
{
// There should be no other PUBLIC symbols that overlap with the function.
- Extern debug_ext(function->address);
- ExternSet::iterator it_debug = externs_.lower_bound(&ext);
- assert(it_debug == externs_.end() ||
- (*it_debug)->address >= function->address + function->size);
+ for (const Range& range : function->ranges) {
+ Extern debug_ext(range.address);
+ ExternSet::iterator it_debug = externs_.lower_bound(&ext);
+ assert(it_debug == externs_.end() ||
+ (*it_debug)->address >= range.address + range.size);
+ }
}
#endif
@@ -120,10 +131,18 @@ void Module::AddFunctions(vector<Function *>::iterator begin,
}
void Module::AddStackFrameEntry(StackFrameEntry *stack_frame_entry) {
+ if (!AddressIsInModule(stack_frame_entry->address)) {
+ return;
+ }
+
stack_frame_entries_.push_back(stack_frame_entry);
}
void Module::AddExtern(Extern *ext) {
+ if (!AddressIsInModule(ext->address)) {
+ return;
+ }
+
std::pair<ExternSet::iterator,bool> ret = externs_.insert(ext);
if (!ret.second) {
// Free the duplicate that was not inserted because this Module
@@ -229,12 +248,29 @@ bool Module::WriteRuleMap(const RuleMap &rule_map, std::ostream &stream) {
return stream.good();
}
+bool Module::AddressIsInModule(Address address) const {
+ if (address_ranges_.empty()) {
+ return true;
+ }
+ for (const auto& segment : address_ranges_) {
+ if (address >= segment.address &&
+ address < segment.address + segment.size) {
+ return true;
+ }
+ }
+ return false;
+}
+
bool Module::Write(std::ostream &stream, SymbolData symbol_data) {
stream << "MODULE " << os_ << " " << architecture_ << " "
- << id_ << " " << name_ << endl;
+ << id_ << " " << name_ << "\n";
if (!stream.good())
return ReportError();
+ if (!code_id_.empty()) {
+ stream << "INFO CODE_ID " << code_id_ << "\n";
+ }
+
if (symbol_data != ONLY_CFI) {
AssignSourceIds();
@@ -243,7 +279,7 @@ bool Module::Write(std::ostream &stream, SymbolData symbol_data) {
file_it != files_.end(); ++file_it) {
File *file = file_it->second;
if (file->source_id >= 0) {
- stream << "FILE " << file->source_id << " " << file->name << endl;
+ stream << "FILE " << file->source_id << " " << file->name << "\n";
if (!stream.good())
return ReportError();
}
@@ -253,24 +289,33 @@ bool Module::Write(std::ostream &stream, SymbolData symbol_data) {
for (FunctionSet::const_iterator func_it = functions_.begin();
func_it != functions_.end(); ++func_it) {
Function *func = *func_it;
- stream << "FUNC " << hex
- << (func->address - load_address_) << " "
- << func->size << " "
- << func->parameter_size << " "
- << func->name << dec << endl;
- if (!stream.good())
- return ReportError();
+ vector<Line>::iterator line_it = func->lines.begin();
+ for (auto range_it = func->ranges.cbegin();
+ range_it != func->ranges.cend(); ++range_it) {
+ stream << "FUNC " << hex
+ << (range_it->address - load_address_) << " "
+ << range_it->size << " "
+ << func->parameter_size << " "
+ << func->name << dec << "\n";
- for (vector<Line>::iterator line_it = func->lines.begin();
- line_it != func->lines.end(); ++line_it) {
- stream << hex
- << (line_it->address - load_address_) << " "
- << line_it->size << " "
- << dec
- << line_it->number << " "
- << line_it->file->source_id << endl;
if (!stream.good())
return ReportError();
+
+ while ((line_it != func->lines.end()) &&
+ (line_it->address >= range_it->address) &&
+ (line_it->address < (range_it->address + range_it->size))) {
+ stream << hex
+ << (line_it->address - load_address_) << " "
+ << line_it->size << " "
+ << dec
+ << line_it->number << " "
+ << line_it->file->source_id << "\n";
+
+ if (!stream.good())
+ return ReportError();
+
+ ++line_it;
+ }
}
}
@@ -280,7 +325,7 @@ bool Module::Write(std::ostream &stream, SymbolData symbol_data) {
Extern *ext = *extern_it;
stream << "PUBLIC " << hex
<< (ext->address - load_address_) << " 0 "
- << ext->name << dec << endl;
+ << ext->name << dec << "\n";
}
}
@@ -297,7 +342,7 @@ bool Module::Write(std::ostream &stream, SymbolData symbol_data) {
|| !WriteRuleMap(entry->initial_rules, stream))
return ReportError();
- stream << endl;
+ stream << "\n";
// Write out this entry's delta rules as 'STACK CFI' records.
for (RuleChangeMap::const_iterator delta_it = entry->rule_changes.begin();
@@ -308,7 +353,7 @@ bool Module::Write(std::ostream &stream, SymbolData symbol_data) {
|| !WriteRuleMap(delta_it->second, stream))
return ReportError();
- stream << endl;
+ stream << "\n";
}
}
}
diff --git a/src/common/module.h b/src/common/module.h
index 65b5595d..7309cedd 100644
--- a/src/common/module.h
+++ b/src/common/module.h
@@ -85,10 +85,19 @@ class Module {
int source_id;
};
+ // An address range.
+ struct Range {
+ Range(const Address address_input, const Address size_input) :
+ address(address_input), size(size_input) { }
+
+ Address address;
+ Address size;
+ };
+
// A function.
struct Function {
Function(const string &name_input, const Address &address_input) :
- name(name_input), address(address_input), size(0), parameter_size(0) {}
+ name(name_input), address(address_input), parameter_size(0) {}
// For sorting by address. (Not style-guide compliant, but it's
// stupid not to put this in the struct.)
@@ -97,11 +106,11 @@ class Module {
}
// The function's name.
- const string name;
+ string name;
- // The start address and length of the function's code.
+ // The start address and the address ranges covered by the function.
const Address address;
- Address size;
+ vector<Range> ranges;
// The function's parameter size.
Address parameter_size;
@@ -179,7 +188,7 @@ class Module {
// Create a new module with the given name, operating system,
// architecture, and ID string.
Module(const string &name, const string &os, const string &architecture,
- const string &id);
+ const string &id, const string &code_id = "");
~Module();
// Set the module's load address to LOAD_ADDRESS; addresses given
@@ -196,6 +205,14 @@ class Module {
// Write is used.
void SetLoadAddress(Address load_address);
+ // Sets address filtering on elements added to the module. This allows
+ // libraries with extraneous debug symbols to generate symbol files containing
+ // only relevant symbols. For example, an LLD-generated partition library may
+ // contain debug information pertaining to all partitions derived from a
+ // single "combined" library. Filtering applies only to elements added after
+ // this method is called.
+ void SetAddressRanges(const vector<Range>& ranges);
+
// Add FUNCTION to the module. FUNCTION's name must not be empty.
// This module owns all Function objects added with this function:
// destroying the module destroys them as well.
@@ -281,6 +298,7 @@ class Module {
string os() const { return os_; }
string architecture() const { return architecture_; }
string identifier() const { return id_; }
+ string code_identifier() const { return code_id_; }
private:
// Report an error that has occurred writing the symbol file, using
@@ -292,14 +310,22 @@ class Module {
// if an error occurs, return false, and leave errno set.
static bool WriteRuleMap(const RuleMap &rule_map, std::ostream &stream);
+ // Returns true of the specified address resides with an specified address
+ // range, or if no ranges have been specified.
+ bool AddressIsInModule(Address address) const;
+
// Module header entries.
- string name_, os_, architecture_, id_;
+ string name_, os_, architecture_, id_, code_id_;
// The module's nominal load address. Addresses for functions and
// lines are absolute, assuming the module is loaded at this
// address.
Address load_address_;
+ // The set of valid address ranges of the module. If specified, attempts to
+ // add elements residing outside these ranges will be silently filtered.
+ vector<Range> address_ranges_;
+
// Relation for maps whose keys are strings shared with some other
// structure.
struct CompareStringPtrs {
diff --git a/src/common/module_unittest.cc b/src/common/module_unittest.cc
index 0b643271..37fee5dd 100644
--- a/src/common/module_unittest.cc
+++ b/src/common/module_unittest.cc
@@ -49,13 +49,14 @@ using std::stringstream;
using std::vector;
using testing::ContainerEq;
-static Module::Function *generate_duplicate_function(const string &name) {
- const Module::Address DUP_ADDRESS = 0xd35402aac7a7ad5cLL;
- const Module::Address DUP_SIZE = 0x200b26e605f99071LL;
- const Module::Address DUP_PARAMETER_SIZE = 0xf14ac4fed48c4a99LL;
-
- Module::Function *function = new Module::Function(name, DUP_ADDRESS);
- function->size = DUP_SIZE;
+static Module::Function* generate_duplicate_function(const string &name) {
+ const Module::Address DUP_ADDRESS = 0xd35402aac7a7ad5cULL;
+ const Module::Address DUP_SIZE = 0x200b26e605f99071ULL;
+ const Module::Address DUP_PARAMETER_SIZE = 0xf14ac4fed48c4a99ULL;
+
+ Module::Function* function = new Module::Function(name, DUP_ADDRESS);
+ Module::Range range(DUP_ADDRESS, DUP_SIZE);
+ function->ranges.push_back(range);
function->parameter_size = DUP_PARAMETER_SIZE;
return function;
}
@@ -64,6 +65,7 @@ static Module::Function *generate_duplicate_function(const string &name) {
#define MODULE_OS "os-name"
#define MODULE_ARCH "architecture"
#define MODULE_ID "id-string"
+#define MODULE_CODE_ID "code-id-string"
TEST(Write, Header) {
stringstream s;
@@ -74,16 +76,27 @@ TEST(Write, Header) {
contents.c_str());
}
+TEST(Write, HeaderCodeId) {
+ stringstream s;
+ Module m(MODULE_NAME, MODULE_OS, MODULE_ARCH, MODULE_ID, MODULE_CODE_ID);
+ m.Write(s, ALL_SYMBOL_DATA);
+ string contents = s.str();
+ EXPECT_STREQ("MODULE os-name architecture id-string name with spaces\n"
+ "INFO CODE_ID code-id-string\n",
+ contents.c_str());
+}
+
TEST(Write, OneLineFunc) {
stringstream s;
Module m(MODULE_NAME, MODULE_OS, MODULE_ARCH, MODULE_ID);
- Module::File *file = m.FindFile("file_name.cc");
- Module::Function *function = new Module::Function(
- "function_name", 0xe165bf8023b9d9abLL);
- function->size = 0x1e4bb0eb1cbf5b09LL;
- function->parameter_size = 0x772beee89114358aLL;
- Module::Line line = { 0xe165bf8023b9d9abLL, 0x1e4bb0eb1cbf5b09LL,
+ Module::File* file = m.FindFile("file_name.cc");
+ Module::Function* function = new Module::Function(
+ "function_name", 0xe165bf8023b9d9abULL);
+ Module::Range range(0xe165bf8023b9d9abULL, 0x1e4bb0eb1cbf5b09ULL);
+ function->ranges.push_back(range);
+ function->parameter_size = 0x772beee89114358aULL;
+ Module::Line line = { 0xe165bf8023b9d9abULL, 0x1e4bb0eb1cbf5b09ULL,
file, 67519080 };
function->lines.push_back(line);
m.AddFunction(function);
@@ -103,19 +116,20 @@ TEST(Write, RelativeLoadAddress) {
Module m(MODULE_NAME, MODULE_OS, MODULE_ARCH, MODULE_ID);
// Some source files. We will expect to see them in lexicographic order.
- Module::File *file1 = m.FindFile("filename-b.cc");
- Module::File *file2 = m.FindFile("filename-a.cc");
+ Module::File* file1 = m.FindFile("filename-b.cc");
+ Module::File* file2 = m.FindFile("filename-a.cc");
// A function.
- Module::Function *function = new Module::Function(
- "A_FLIBBERTIJIBBET::a_will_o_the_wisp(a clown)", 0xbec774ea5dd935f3LL);
- function->size = 0x2922088f98d3f6fcLL;
- function->parameter_size = 0xe5e9aa008bd5f0d0LL;
+ Module::Function* function = new Module::Function(
+ "A_FLIBBERTIJIBBET::a_will_o_the_wisp(a clown)", 0xbec774ea5dd935f3ULL);
+ Module::Range range(0xbec774ea5dd935f3ULL, 0x2922088f98d3f6fcULL);
+ function->ranges.push_back(range);
+ function->parameter_size = 0xe5e9aa008bd5f0d0ULL;
// Some source lines. The module should not sort these.
- Module::Line line1 = { 0xbec774ea5dd935f3LL, 0x1c2be6d6c5af2611LL,
+ Module::Line line1 = { 0xbec774ea5dd935f3ULL, 0x1c2be6d6c5af2611ULL,
file1, 41676901 };
- Module::Line line2 = { 0xdaf35bc123885c04LL, 0xcf621b8d324d0ebLL,
+ Module::Line line2 = { 0xdaf35bc123885c04ULL, 0xcf621b8d324d0ebULL,
file2, 67519080 };
function->lines.push_back(line2);
function->lines.push_back(line1);
@@ -123,7 +137,7 @@ TEST(Write, RelativeLoadAddress) {
m.AddFunction(function);
// Some stack information.
- Module::StackFrameEntry *entry = new Module::StackFrameEntry();
+ Module::StackFrameEntry* entry = new Module::StackFrameEntry();
entry->address = 0x30f9e5c83323973dULL;
entry->size = 0x49fc9ca7c7c13dc2ULL;
entry->initial_rules[".cfa"] = "he was a handsome man";
@@ -135,7 +149,7 @@ TEST(Write, RelativeLoadAddress) {
// Set the load address. Doing this after adding all the data to
// the module must work fine.
- m.SetLoadAddress(0x2ab698b0b6407073LL);
+ m.SetLoadAddress(0x2ab698b0b6407073ULL);
m.Write(s, ALL_SYMBOL_DATA);
string contents = s.str();
@@ -159,20 +173,21 @@ TEST(Write, OmitUnusedFiles) {
Module m(MODULE_NAME, MODULE_OS, MODULE_ARCH, MODULE_ID);
// Create some source files.
- Module::File *file1 = m.FindFile("filename1");
+ Module::File* file1 = m.FindFile("filename1");
m.FindFile("filename2"); // not used by any line
- Module::File *file3 = m.FindFile("filename3");
+ Module::File* file3 = m.FindFile("filename3");
// Create a function.
- Module::Function *function = new Module::Function(
- "function_name", 0x9b926d464f0b9384LL);
- function->size = 0x4f524a4ba795e6a6LL;
- function->parameter_size = 0xbbe8133a6641c9b7LL;
+ Module::Function* function = new Module::Function(
+ "function_name", 0x9b926d464f0b9384ULL);
+ Module::Range range(0x9b926d464f0b9384ULL, 0x4f524a4ba795e6a6ULL);
+ function->ranges.push_back(range);
+ function->parameter_size = 0xbbe8133a6641c9b7ULL;
// Source files that refer to some files, but not others.
- Module::Line line1 = { 0x595fa44ebacc1086LL, 0x1e1e0191b066c5b3LL,
+ Module::Line line1 = { 0xab415089485e1a20ULL, 0x126e3124979291f2ULL,
file1, 137850127 };
- Module::Line line2 = { 0x401ce8c8a12d25e3LL, 0x895751c41b8d2ce2LL,
+ Module::Line line2 = { 0xb2675b5c3c2ed33fULL, 0x1df77f5551dbd68cULL,
file3, 28113549 };
function->lines.push_back(line1);
function->lines.push_back(line2);
@@ -180,7 +195,7 @@ TEST(Write, OmitUnusedFiles) {
m.AssignSourceIds();
- vector<Module::File *> vec;
+ vector<Module::File*> vec;
m.GetFiles(&vec);
EXPECT_EQ((size_t) 3, vec.size());
EXPECT_STREQ("filename1", vec[0]->name.c_str());
@@ -199,8 +214,8 @@ TEST(Write, OmitUnusedFiles) {
"FILE 1 filename3\n"
"FUNC 9b926d464f0b9384 4f524a4ba795e6a6 bbe8133a6641c9b7"
" function_name\n"
- "595fa44ebacc1086 1e1e0191b066c5b3 137850127 0\n"
- "401ce8c8a12d25e3 895751c41b8d2ce2 28113549 1\n",
+ "ab415089485e1a20 126e3124979291f2 137850127 0\n"
+ "b2675b5c3c2ed33f 1df77f5551dbd68c 28113549 1\n",
contents.c_str());
}
@@ -209,23 +224,24 @@ TEST(Write, NoCFI) {
Module m(MODULE_NAME, MODULE_OS, MODULE_ARCH, MODULE_ID);
// Some source files. We will expect to see them in lexicographic order.
- Module::File *file1 = m.FindFile("filename.cc");
+ Module::File* file1 = m.FindFile("filename.cc");
// A function.
- Module::Function *function = new Module::Function(
- "A_FLIBBERTIJIBBET::a_will_o_the_wisp(a clown)", 0xbec774ea5dd935f3LL);
- function->size = 0x2922088f98d3f6fcLL;
- function->parameter_size = 0xe5e9aa008bd5f0d0LL;
+ Module::Function* function = new Module::Function(
+ "A_FLIBBERTIJIBBET::a_will_o_the_wisp(a clown)", 0xbec774ea5dd935f3ULL);
+ Module::Range range(0xbec774ea5dd935f3ULL, 0x2922088f98d3f6fcULL);
+ function->ranges.push_back(range);
+ function->parameter_size = 0xe5e9aa008bd5f0d0ULL;
// Some source lines. The module should not sort these.
- Module::Line line1 = { 0xbec774ea5dd935f3LL, 0x1c2be6d6c5af2611LL,
+ Module::Line line1 = { 0xbec774ea5dd935f3ULL, 0x1c2be6d6c5af2611ULL,
file1, 41676901 };
function->lines.push_back(line1);
m.AddFunction(function);
// Some stack information.
- Module::StackFrameEntry *entry = new Module::StackFrameEntry();
+ Module::StackFrameEntry* entry = new Module::StackFrameEntry();
entry->address = 0x30f9e5c83323973dULL;
entry->size = 0x49fc9ca7c7c13dc2ULL;
entry->initial_rules[".cfa"] = "he was a handsome man";
@@ -237,7 +253,7 @@ TEST(Write, NoCFI) {
// Set the load address. Doing this after adding all the data to
// the module must work fine.
- m.SetLoadAddress(0x2ab698b0b6407073LL);
+ m.SetLoadAddress(0x2ab698b0b6407073ULL);
m.Write(s, NO_CFI);
string contents = s.str();
@@ -254,18 +270,20 @@ TEST(Construct, AddFunctions) {
Module m(MODULE_NAME, MODULE_OS, MODULE_ARCH, MODULE_ID);
// Two functions.
- Module::Function *function1 = new Module::Function(
- "_without_form", 0xd35024aa7ca7da5cLL);
- function1->size = 0x200b26e605f99071LL;
- function1->parameter_size = 0xf14ac4fed48c4a99LL;
-
- Module::Function *function2 = new Module::Function(
- "_and_void", 0x2987743d0b35b13fLL);
- function2->size = 0xb369db048deb3010LL;
- function2->parameter_size = 0x938e556cb5a79988LL;
+ Module::Function* function1 = new Module::Function(
+ "_without_form", 0xd35024aa7ca7da5cULL);
+ Module::Range r1(0xd35024aa7ca7da5cULL, 0x200b26e605f99071ULL);
+ function1->ranges.push_back(r1);
+ function1->parameter_size = 0xf14ac4fed48c4a99ULL;
+
+ Module::Function* function2 = new Module::Function(
+ "_and_void", 0x2987743d0b35b13fULL);
+ Module::Range r2(0x2987743d0b35b13fULL, 0xb369db048deb3010ULL);
+ function2->ranges.push_back(r2);
+ function2->parameter_size = 0x938e556cb5a79988ULL;
// Put them in a vector.
- vector<Module::Function *> vec;
+ vector<Module::Function*> vec;
vec.push_back(function1);
vec.push_back(function2);
@@ -293,13 +311,13 @@ TEST(Construct, AddFrames) {
Module m(MODULE_NAME, MODULE_OS, MODULE_ARCH, MODULE_ID);
// First STACK CFI entry, with no initial rules or deltas.
- Module::StackFrameEntry *entry1 = new Module::StackFrameEntry();
+ Module::StackFrameEntry* entry1 = new Module::StackFrameEntry();
entry1->address = 0xddb5f41285aa7757ULL;
entry1->size = 0x1486493370dc5073ULL;
m.AddStackFrameEntry(entry1);
// Second STACK CFI entry, with initial rules but no deltas.
- Module::StackFrameEntry *entry2 = new Module::StackFrameEntry();
+ Module::StackFrameEntry* entry2 = new Module::StackFrameEntry();
entry2->address = 0x8064f3af5e067e38ULL;
entry2->size = 0x0de2a5ee55509407ULL;
entry2->initial_rules[".cfa"] = "I think that I shall never see";
@@ -308,7 +326,7 @@ TEST(Construct, AddFrames) {
m.AddStackFrameEntry(entry2);
// Third STACK CFI entry, with initial rules and deltas.
- Module::StackFrameEntry *entry3 = new Module::StackFrameEntry();
+ Module::StackFrameEntry* entry3 = new Module::StackFrameEntry();
entry3->address = 0x5e8d0db0a7075c6cULL;
entry3->size = 0x1c7edb12a7aea229ULL;
entry3->initial_rules[".cfa"] = "Whose woods are these";
@@ -342,7 +360,7 @@ TEST(Construct, AddFrames) {
contents.c_str());
// Check that GetStackFrameEntries works.
- vector<Module::StackFrameEntry *> entries;
+ vector<Module::StackFrameEntry*> entries;
m.GetStackFrameEntries(&entries);
ASSERT_EQ(3U, entries.size());
// Check first entry.
@@ -377,10 +395,10 @@ TEST(Construct, AddFrames) {
TEST(Construct, UniqueFiles) {
Module m(MODULE_NAME, MODULE_OS, MODULE_ARCH, MODULE_ID);
- Module::File *file1 = m.FindFile("foo");
- Module::File *file2 = m.FindFile(string("bar"));
- Module::File *file3 = m.FindFile(string("foo"));
- Module::File *file4 = m.FindFile("bar");
+ Module::File* file1 = m.FindFile("foo");
+ Module::File* file2 = m.FindFile(string("bar"));
+ Module::File* file3 = m.FindFile(string("foo"));
+ Module::File* file4 = m.FindFile("bar");
EXPECT_NE(file1, file2);
EXPECT_EQ(file1, file3);
EXPECT_EQ(file2, file4);
@@ -393,8 +411,8 @@ TEST(Construct, DuplicateFunctions) {
Module m(MODULE_NAME, MODULE_OS, MODULE_ARCH, MODULE_ID);
// Two functions.
- Module::Function *function1 = generate_duplicate_function("_without_form");
- Module::Function *function2 = generate_duplicate_function("_without_form");
+ Module::Function* function1 = generate_duplicate_function("_without_form");
+ Module::Function* function2 = generate_duplicate_function("_without_form");
m.AddFunction(function1);
m.AddFunction(function2);
@@ -412,8 +430,8 @@ TEST(Construct, FunctionsWithSameAddress) {
Module m(MODULE_NAME, MODULE_OS, MODULE_ARCH, MODULE_ID);
// Two functions.
- Module::Function *function1 = generate_duplicate_function("_without_form");
- Module::Function *function2 = generate_duplicate_function("_and_void");
+ Module::Function* function1 = generate_duplicate_function("_without_form");
+ Module::Function* function2 = generate_duplicate_function("_and_void");
m.AddFunction(function1);
m.AddFunction(function2);
@@ -435,9 +453,9 @@ TEST(Construct, Externs) {
Module m(MODULE_NAME, MODULE_OS, MODULE_ARCH, MODULE_ID);
// Two externs.
- Module::Extern *extern1 = new Module::Extern(0xffff);
+ Module::Extern* extern1 = new Module::Extern(0xffff);
extern1->name = "_abc";
- Module::Extern *extern2 = new Module::Extern(0xaaaa);
+ Module::Extern* extern2 = new Module::Extern(0xaaaa);
extern2->name = "_xyz";
m.AddExtern(extern1);
@@ -460,9 +478,9 @@ TEST(Construct, DuplicateExterns) {
Module m(MODULE_NAME, MODULE_OS, MODULE_ARCH, MODULE_ID);
// Two externs.
- Module::Extern *extern1 = new Module::Extern(0xffff);
+ Module::Extern* extern1 = new Module::Extern(0xffff);
extern1->name = "_xyz";
- Module::Extern *extern2 = new Module::Extern(0xffff);
+ Module::Extern* extern2 = new Module::Extern(0xffff);
extern2->name = "_abc";
m.AddExtern(extern1);
@@ -493,7 +511,8 @@ TEST(Construct, FunctionsAndExternsWithSameAddress) {
m.AddExtern(extern2);
Module::Function* function = new Module::Function("_xyz", 0xfff0);
- function->size = 0x10;
+ Module::Range range(0xfff0, 0x10);
+ function->ranges.push_back(range);
function->parameter_size = 0;
m.AddFunction(function);
@@ -530,7 +549,8 @@ TEST(Construct, FunctionsAndThumbExternsWithSameAddress) {
// The corresponding function from the DWARF debug data have the actual
// address.
Module::Function* function = new Module::Function("_thumb_xyz", 0xfff0);
- function->size = 0x10;
+ Module::Range range(0xfff0, 0x10);
+ function->ranges.push_back(range);
function->parameter_size = 0;
m.AddFunction(function);
@@ -544,3 +564,53 @@ TEST(Construct, FunctionsAndThumbExternsWithSameAddress) {
"PUBLIC cc00 0 arm_func\n",
contents.c_str());
}
+
+TEST(Write, OutOfRangeAddresses) {
+ stringstream s;
+ Module m(MODULE_NAME, MODULE_OS, MODULE_ARCH, MODULE_ID);
+
+ // Specify an allowed address range, representing a PT_LOAD segment in a
+ // module.
+ vector<Module::Range> address_ranges = {
+ Module::Range(0x2000ULL, 0x1000ULL),
+ };
+ m.SetAddressRanges(address_ranges);
+
+ // Add three stack frames (one lower, one in, and one higher than the allowed
+ // address range). Only the middle frame should be captured.
+ Module::StackFrameEntry* entry1 = new Module::StackFrameEntry();
+ entry1->address = 0x1000ULL;
+ entry1->size = 0x100ULL;
+ m.AddStackFrameEntry(entry1);
+ Module::StackFrameEntry* entry2 = new Module::StackFrameEntry();
+ entry2->address = 0x2000ULL;
+ entry2->size = 0x100ULL;
+ m.AddStackFrameEntry(entry2);
+ Module::StackFrameEntry* entry3 = new Module::StackFrameEntry();
+ entry3->address = 0x3000ULL;
+ entry3->size = 0x100ULL;
+ m.AddStackFrameEntry(entry3);
+
+ // Add a function outside the allowed range.
+ Module::File* file = m.FindFile("file_name.cc");
+ Module::Function* function = new Module::Function(
+ "function_name", 0x4000ULL);
+ Module::Range range(0x4000ULL, 0x1000ULL);
+ function->ranges.push_back(range);
+ function->parameter_size = 0x100ULL;
+ Module::Line line = { 0x4000ULL, 0x100ULL, file, 67519080 };
+ function->lines.push_back(line);
+ m.AddFunction(function);
+
+ // Add an extern outside the allowed range.
+ Module::Extern* extern1 = new Module::Extern(0x5000ULL);
+ extern1->name = "_xyz";
+ m.AddExtern(extern1);
+
+ m.Write(s, ALL_SYMBOL_DATA);
+
+ EXPECT_STREQ("MODULE os-name architecture id-string name with spaces\n"
+ "STACK CFI INIT 2000 100 \n",
+ s.str().c_str());
+
+}
diff --git a/src/testing/gtest/samples/sample4.cc b/src/common/path_helper.cc
index ae44bda6..61a6e318 100644
--- a/src/testing/gtest/samples/sample4.cc
+++ b/src/common/path_helper.cc
@@ -1,4 +1,4 @@
-// Copyright 2005, Google Inc.
+// Copyright 2017, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
@@ -27,20 +27,29 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-// A sample program demonstrating using Google C++ testing framework.
-//
-// Author: wan@google.com (Zhanyong Wan)
+#include "common/path_helper.h"
-#include <stdio.h>
+#include <assert.h>
+#include <libgen.h>
+#include <stdlib.h>
+#include <string.h>
-#include "sample4.h"
+namespace google_breakpad {
-// Returns the current counter value, and increments it.
-int Counter::Increment() {
- return counter_++;
+string BaseName(const string& path) {
+ char* path_tmp = strdup(path.c_str());
+ assert(path_tmp);
+ string result(basename(path_tmp));
+ free(path_tmp);
+ return result;
}
-// Prints the current counter value to STDOUT.
-void Counter::Print() const {
- printf("%d", counter_);
+string DirName(const string& path) {
+ char* path_tmp = strdup(path.c_str());
+ assert(path_tmp);
+ string result(dirname(path_tmp));
+ free(path_tmp);
+ return result;
}
+
+} // namespace google_breakpad
diff --git a/src/testing/gtest/test/gtest_main_unittest.cc b/src/common/path_helper.h
index ecd9bb87..2166ba01 100644
--- a/src/testing/gtest/test/gtest_main_unittest.cc
+++ b/src/common/path_helper.h
@@ -1,4 +1,4 @@
-// Copyright 2006, Google Inc.
+// Copyright 2017, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
@@ -26,20 +26,19 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-#include "gtest/gtest.h"
+#ifndef GOOGLE_BREAKPAD_COMMON_PATH_HELPER_H
+#define GOOGLE_BREAKPAD_COMMON_PATH_HELPER_H
+
+#include <string>
-// Tests that we don't have to define main() when we link to
-// gtest_main instead of gtest.
+#include "common/using_std_string.h"
-namespace {
+namespace google_breakpad {
-TEST(GTestMainTest, ShouldSucceed) {
-}
+string BaseName(const string& path);
+string DirName(const string& path);
-} // namespace
+} // namespace google_breakpad
-// We are using the main() function defined in src/gtest_main.cc, so
-// we don't define it here.
+#endif // GOOGLE_BREAKPAD_COMMON_PATH_HELPER_H
diff --git a/src/common/simple_string_dictionary.h b/src/common/simple_string_dictionary.h
index d2ab17fd..94849205 100644
--- a/src/common/simple_string_dictionary.h
+++ b/src/common/simple_string_dictionary.h
@@ -147,39 +147,42 @@ class NonAllocatingMap {
if (!key)
return NULL;
- const Entry* entry = GetConstEntryForKey(key);
- if (!entry)
+ size_t index = GetEntryIndexForKey(key);
+ if (index == num_entries)
return NULL;
- return entry->value;
+ return entries_[index].value;
}
// Stores |value| into |key|, replacing the existing value if |key| is
// already present. |key| must not be NULL. If |value| is NULL, the key is
// removed from the map. If there is no more space in the map, then the
- // operation silently fails.
- void SetKeyValue(const char* key, const char* value) {
+ // operation silently fails. Returns an index into the map that can be used
+ // to quickly access the entry, or |num_entries| on failure or when clearing
+ // a key with a null value.
+ size_t SetKeyValue(const char* key, const char* value) {
if (!value) {
RemoveKey(key);
- return;
+ return num_entries;
}
assert(key);
if (!key)
- return;
+ return num_entries;
// Key must not be an empty string.
assert(key[0] != '\0');
if (key[0] == '\0')
- return;
+ return num_entries;
- Entry* entry = GetEntryForKey(key);
+ size_t entry_index = GetEntryIndexForKey(key);
// If it does not yet exist, attempt to insert it.
- if (!entry) {
+ if (entry_index == num_entries) {
for (size_t i = 0; i < num_entries; ++i) {
if (!entries_[i].is_active()) {
- entry = &entries_[i];
+ entry_index = i;
+ Entry* entry = &entries_[i];
strncpy(entry->key, key, key_size);
entry->key[key_size - 1] = '\0';
@@ -190,8 +193,8 @@ class NonAllocatingMap {
}
// If the map is out of space, entry will be NULL.
- if (!entry)
- return;
+ if (entry_index == num_entries)
+ return num_entries;
#ifndef NDEBUG
// Sanity check that the key only appears once.
@@ -203,26 +206,46 @@ class NonAllocatingMap {
assert(count == 1);
#endif
+ strncpy(entries_[entry_index].value, value, value_size);
+ entries_[entry_index].value[value_size - 1] = '\0';
+
+ return entry_index;
+ }
+
+ // Sets a value for a key that has already been set with SetKeyValue(), using
+ // the index returned from that function.
+ void SetValueAtIndex(size_t index, const char* value) {
+ assert(index < num_entries);
+ if (index >= num_entries)
+ return;
+
+ Entry* entry = &entries_[index];
+ assert(entry->key[0] != '\0');
+
strncpy(entry->value, value, value_size);
entry->value[value_size - 1] = '\0';
}
// Given |key|, removes any associated value. |key| must not be NULL. If
- // the key is not found, this is a noop.
- void RemoveKey(const char* key) {
+ // the key is not found, this is a noop. This invalidates the index
+ // returned by SetKeyValue().
+ bool RemoveKey(const char* key) {
assert(key);
if (!key)
- return;
+ return false;
- Entry* entry = GetEntryForKey(key);
- if (entry) {
- entry->key[0] = '\0';
- entry->value[0] = '\0';
- }
+ return RemoveAtIndex(GetEntryIndexForKey(key));
+ }
-#ifndef NDEBUG
- assert(GetEntryForKey(key) == NULL);
-#endif
+ // Removes a value and key using an index that was returned from
+ // SetKeyValue(). After a call to this function, the index is invalidated.
+ bool RemoveAtIndex(size_t index) {
+ if (index >= num_entries)
+ return false;
+
+ entries_[index].key[0] = '\0';
+ entries_[index].value[0] = '\0';
+ return true;
}
// Places a serialized version of the map into |map| and returns the size.
@@ -235,17 +258,13 @@ class NonAllocatingMap {
}
private:
- const Entry* GetConstEntryForKey(const char* key) const {
+ size_t GetEntryIndexForKey(const char* key) const {
for (size_t i = 0; i < num_entries; ++i) {
if (strncmp(key, entries_[i].key, key_size) == 0) {
- return &entries_[i];
+ return i;
}
}
- return NULL;
- }
-
- Entry* GetEntryForKey(const char* key) {
- return const_cast<Entry*>(GetConstEntryForKey(key));
+ return num_entries;
}
Entry entries_[NumEntries];
diff --git a/src/common/simple_string_dictionary_unittest.cc b/src/common/simple_string_dictionary_unittest.cc
index 34f4b9ef..e7b8fd76 100644
--- a/src/common/simple_string_dictionary_unittest.cc
+++ b/src/common/simple_string_dictionary_unittest.cc
@@ -288,6 +288,37 @@ TEST(NonAllocatingMapTest, OutOfSpace) {
EXPECT_FALSE(map.GetValueForKey("c"));
}
+TEST(NonAllocatingMapTest, ByIndex) {
+ NonAllocatingMap<10, 10, 3> map;
+
+ size_t index1 = map.SetKeyValue("test", "one");
+ EXPECT_TRUE(index1 >= 0 && index1 <= map.num_entries);
+
+ size_t index2 = map.SetKeyValue("moo", "foo");
+ EXPECT_TRUE(index2 >= 0 && index2 <= map.num_entries);
+ EXPECT_NE(index1, index2);
+
+ size_t index3 = map.SetKeyValue("blob", "kebab");
+ EXPECT_TRUE(index3 >= 0 && index3 <= map.num_entries);
+ EXPECT_NE(index2, index3);
+
+ size_t index4 = map.SetKeyValue("nogo", "full");
+ EXPECT_TRUE(index4 == map.num_entries);
+
+ EXPECT_STREQ("one", map.GetValueForKey("test"));
+ EXPECT_STREQ("foo", map.GetValueForKey("moo"));
+ EXPECT_STREQ("kebab", map.GetValueForKey("blob"));
+
+ map.SetValueAtIndex(index2, "booo");
+ EXPECT_STREQ("booo", map.GetValueForKey("moo"));
+
+ EXPECT_TRUE(map.RemoveAtIndex(index1));
+ EXPECT_FALSE(map.GetValueForKey("test"));
+
+ EXPECT_FALSE(map.RemoveAtIndex(map.num_entries));
+ EXPECT_FALSE(map.RemoveAtIndex(9999));
+}
+
#ifndef NDEBUG
TEST(NonAllocatingMapTest, NullKey) {
diff --git a/src/common/solaris/guid_creator.cc b/src/common/solaris/guid_creator.cc
index c4d58e0a..e9e6c6f5 100644
--- a/src/common/solaris/guid_creator.cc
+++ b/src/common/solaris/guid_creator.cc
@@ -66,7 +66,7 @@ const GUIDGenerator kGuidGenerator;
bool CreateGUID(GUID *guid) {
return kGuidGenerator.CreateGUID(guid);
-};
+}
// Parse guid to string.
bool GUIDToString(const GUID *guid, char *buf, int buf_len) {
diff --git a/src/common/stabs_reader.h b/src/common/stabs_reader.h
index d89afc00..98ee2dd5 100644
--- a/src/common/stabs_reader.h
+++ b/src/common/stabs_reader.h
@@ -53,11 +53,10 @@
#include <config.h>
#endif
-#ifdef HAVE_A_OUT_H
-#include <a.out.h>
-#endif
#ifdef HAVE_MACH_O_NLIST_H
#include <mach-o/nlist.h>
+#elif defined(HAVE_A_OUT_H)
+#include <a.out.h>
#endif
#include <string>
diff --git a/src/common/stabs_to_module.cc b/src/common/stabs_to_module.cc
index 0a83cf21..049a6cc6 100644
--- a/src/common/stabs_to_module.cc
+++ b/src/common/stabs_to_module.cc
@@ -91,7 +91,8 @@ bool StabsToModule::StartFunction(const string &name,
uint64_t address) {
assert(!current_function_);
Module::Function *f = new Module::Function(Demangle(name), address);
- f->size = 0; // We compute this in StabsToModule::Finalize().
+ Module::Range r(address, 0); // We compute this in StabsToModule::Finalize().
+ f->ranges.push_back(r);
f->parameter_size = 0; // We don't provide this information.
current_function_ = f;
boundaries_.push_back(static_cast<Module::Address>(address));
@@ -167,14 +168,14 @@ void StabsToModule::Finalize() {
vector<Module::Address>::const_iterator boundary
= std::upper_bound(boundaries_.begin(), boundaries_.end(), f->address);
if (boundary != boundaries_.end())
- f->size = *boundary - f->address;
+ f->ranges[0].size = *boundary - f->address;
else
// If this is the last function in the module, and the STABS
// reader was unable to give us its ending address, then assign
// it a bogus, very large value. This will happen at most once
// per module: since we've added all functions' addresses to the
// boundary table, only one can be the last.
- f->size = kFallbackSize;
+ f->ranges[0].size = kFallbackSize;
// Compute sizes for each of the function f's lines --- if it has any.
if (!f->lines.empty()) {
@@ -185,7 +186,8 @@ void StabsToModule::Finalize() {
line_it != last_line; line_it++)
line_it[0].size = line_it[1].address - line_it[0].address;
// Compute the size of the last line from f's end address.
- last_line->size = (f->address + f->size) - last_line->address;
+ last_line->size =
+ (f->ranges[0].address + f->ranges[0].size) - last_line->address;
}
}
// Now that everything has a size, add our functions to the module, and
diff --git a/src/common/stabs_to_module_unittest.cc b/src/common/stabs_to_module_unittest.cc
index d445d1d6..aae00476 100644
--- a/src/common/stabs_to_module_unittest.cc
+++ b/src/common/stabs_to_module_unittest.cc
@@ -64,7 +64,7 @@ TEST(StabsToModule, SimpleCU) {
Module::Function *function = functions[0];
EXPECT_STREQ("function", function->name.c_str());
EXPECT_EQ(0xfde4abbed390c394LL, function->address);
- EXPECT_EQ(0x10U, function->size);
+ EXPECT_EQ(0x10U, function->ranges[0].size);
EXPECT_EQ(0U, function->parameter_size);
ASSERT_EQ((size_t) 1, function->lines.size());
Module::Line *line = &function->lines[0];
@@ -130,7 +130,7 @@ TEST(StabsToModule, DuplicateFunctionNames) {
Module::Function *function = functions[0];
EXPECT_EQ(0xf2cfda36ecf7f46dLL, function->address);
- EXPECT_LT(0U, function->size); // should have used dummy size
+ EXPECT_LT(0U, function->ranges[0].size); // should have used dummy size
EXPECT_EQ(0U, function->parameter_size);
ASSERT_EQ(0U, function->lines.size());
}
@@ -166,7 +166,7 @@ TEST(InferSizes, LineSize) {
Module::Function *function = functions[0];
EXPECT_STREQ("function", function->name.c_str());
EXPECT_EQ(0xb4513962eff94e92LL, function->address);
- EXPECT_EQ(0x1000100000000ULL, function->size); // inferred from CU end
+ EXPECT_EQ(0x1000100000000ULL, function->ranges[0].size); // inferred from CU end
EXPECT_EQ(0U, function->parameter_size);
ASSERT_EQ((size_t) 2, function->lines.size());
@@ -216,7 +216,7 @@ TEST(FunctionNames, Mangled) {
"push_back(unsigned long long const&)",
function->name.c_str());
EXPECT_EQ(0xf2cfda63cef7f46dLL, function->address);
- EXPECT_LT(0U, function->size); // should have used dummy size
+ EXPECT_LT(0U, function->ranges[0].size); // should have used dummy size
EXPECT_EQ(0U, function->parameter_size);
ASSERT_EQ(0U, function->lines.size());
}
diff --git a/src/testing/gtest/src/gtest_main.cc b/src/common/stdio_wrapper.h
index f3028225..a3dd50aa 100644
--- a/src/testing/gtest/src/gtest_main.cc
+++ b/src/common/stdio_wrapper.h
@@ -1,4 +1,4 @@
-// Copyright 2006, Google Inc.
+// Copyright (c) 2016, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
@@ -27,12 +27,17 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#ifndef GOOGLE_BREAKPAD_COMMON_STDIO_WRAPPER_H
+#define GOOGLE_BREAKPAD_COMMON_STDIO_WRAPPER_H
+
#include <stdio.h>
-#include "gtest/gtest.h"
+#if defined(_MSC_VER) && MSC_VER < 1900
+#include <basetsd.h>
+
+#define snprintf _snprintf
+typedef SSIZE_T ssize_t;
+#endif
+
-GTEST_API_ int main(int argc, char **argv) {
- printf("Running main() from gtest_main.cc\n");
- testing::InitGoogleTest(&argc, argv);
- return RUN_ALL_TESTS();
-}
+#endif // GOOGLE_BREAKPAD_COMMON_STDIO_WRAPPER_H
diff --git a/src/common/string_conversion.cc b/src/common/string_conversion.cc
index 9c0d623f..11d60a36 100644
--- a/src/common/string_conversion.cc
+++ b/src/common/string_conversion.cc
@@ -46,7 +46,7 @@ void UTF8ToUTF16(const char *in, vector<uint16_t> *out) {
out->clear();
out->insert(out->begin(), source_length, 0);
uint16_t *target_ptr = &(*out)[0];
- uint16_t *target_end_ptr = target_ptr + out->capacity() * sizeof(uint16_t);
+ uint16_t *target_end_ptr = target_ptr + out->capacity();
ConversionResult result = ConvertUTF8toUTF16(&source_ptr, source_end_ptr,
&target_ptr, target_end_ptr,
strictConversion);
@@ -57,9 +57,9 @@ void UTF8ToUTF16(const char *in, vector<uint16_t> *out) {
int UTF8ToUTF16Char(const char *in, int in_length, uint16_t out[2]) {
const UTF8 *source_ptr = reinterpret_cast<const UTF8 *>(in);
- const UTF8 *source_end_ptr = source_ptr + sizeof(char);
+ const UTF8 *source_end_ptr = source_ptr + 1;
uint16_t *target_ptr = out;
- uint16_t *target_end_ptr = target_ptr + 2 * sizeof(uint16_t);
+ uint16_t *target_end_ptr = target_ptr + 2;
out[0] = out[1] = 0;
// Process one character at a time
@@ -90,7 +90,7 @@ void UTF32ToUTF16(const wchar_t *in, vector<uint16_t> *out) {
out->clear();
out->insert(out->begin(), source_length, 0);
uint16_t *target_ptr = &(*out)[0];
- uint16_t *target_end_ptr = target_ptr + out->capacity() * sizeof(uint16_t);
+ uint16_t *target_end_ptr = target_ptr + out->capacity();
ConversionResult result = ConvertUTF32toUTF16(&source_ptr, source_end_ptr,
&target_ptr, target_end_ptr,
strictConversion);
@@ -103,7 +103,7 @@ void UTF32ToUTF16Char(wchar_t in, uint16_t out[2]) {
const UTF32 *source_ptr = reinterpret_cast<const UTF32 *>(&in);
const UTF32 *source_end_ptr = source_ptr + 1;
uint16_t *target_ptr = out;
- uint16_t *target_end_ptr = target_ptr + 2 * sizeof(uint16_t);
+ uint16_t *target_end_ptr = target_ptr + 2;
out[0] = out[1] = 0;
ConversionResult result = ConvertUTF32toUTF16(&source_ptr, source_end_ptr,
&target_ptr, target_end_ptr,
diff --git a/src/testing/gtest/test/gtest_sole_header_test.cc b/src/common/string_conversion_unittest.cc
index ccd091a2..e9f9b55d 100644
--- a/src/testing/gtest/test/gtest_sole_header_test.cc
+++ b/src/common/string_conversion_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright 2008, Google Inc.
+// Copyright (c) 2019, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
@@ -26,32 +26,39 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: mheule@google.com (Markus Heule)
-//
-// This test verifies that it's possible to use Google Test by including
-// the gtest.h header file alone.
-#include "gtest/gtest.h"
+// string_conversion_unittest.cc: Unit tests for google_breakpad::UTF* helpers.
-namespace {
+#include <string>
+#include <vector>
-void Subroutine() {
- EXPECT_EQ(42, 42);
-}
+#include "breakpad_googletest_includes.h"
+#include "common/string_conversion.h"
-TEST(NoFatalFailureTest, ExpectNoFatalFailure) {
- EXPECT_NO_FATAL_FAILURE(;);
- EXPECT_NO_FATAL_FAILURE(SUCCEED());
- EXPECT_NO_FATAL_FAILURE(Subroutine());
- EXPECT_NO_FATAL_FAILURE({ SUCCEED(); });
+using google_breakpad::UTF8ToUTF16;
+using google_breakpad::UTF8ToUTF16Char;
+using google_breakpad::UTF16ToUTF8;
+using std::vector;
+
+TEST(StringConversionTest, UTF8ToUTF16) {
+ const char in[] = "aßc";
+ vector<uint16_t> out;
+ vector<uint16_t> exp{'a', 0xdf, 'c', 0};
+ UTF8ToUTF16(in, &out);
+ EXPECT_EQ(4u, out.size());
+ EXPECT_EQ(exp, out);
}
-TEST(NoFatalFailureTest, AssertNoFatalFailure) {
- ASSERT_NO_FATAL_FAILURE(;);
- ASSERT_NO_FATAL_FAILURE(SUCCEED());
- ASSERT_NO_FATAL_FAILURE(Subroutine());
- ASSERT_NO_FATAL_FAILURE({ SUCCEED(); });
+TEST(StringConversionTest, UTF8ToUTF16Char) {
+ const char in[] = "a";
+ uint16_t out[3] = {0xff, 0xff, 0xff};
+ EXPECT_EQ(1, UTF8ToUTF16Char(in, 1, out));
+ EXPECT_EQ('a', out[0]);
+ EXPECT_EQ(0, out[1]);
+ EXPECT_EQ(0xff, out[2]);
}
-} // namespace
+TEST(StringConversionTest, UTF16ToUTF8) {
+ vector<uint16_t> in{'a', 0xdf, 'c', 0};
+ EXPECT_EQ("aßc", UTF16ToUTF8(in, false));
+}
diff --git a/src/common/unordered.h b/src/common/unordered.h
index ec665cc0..c9cbd585 100644
--- a/src/common/unordered.h
+++ b/src/common/unordered.h
@@ -42,9 +42,9 @@
#include "util/hash/hash.h"
template <class T, class U, class H = __gnu_cxx::hash<T> >
-struct unordered_map : public hash_map<T, U, H> {};
+struct unordered_map : public __gnu_cxx::hash_map<T, U, H> {};
template <class T, class H = __gnu_cxx::hash<T> >
-struct unordered_set : public hash_set<T, H> {};
+struct unordered_set : public __gnu_cxx::hash_set<T, H> {};
#elif defined(_LIBCPP_VERSION) // c++11
#include <unordered_map>
diff --git a/src/common/windows/common_windows.gyp b/src/common/windows/common_windows.gyp
index c98333a3..5f7594b1 100644
--- a/src/common/windows/common_windows.gyp
+++ b/src/common/windows/common_windows.gyp
@@ -77,13 +77,20 @@
'guid_string.h',
'http_upload.cc',
'http_upload.h',
+ 'module_info.h',
'omap.cc',
'omap.h',
'omap_internal.h',
'pdb_source_line_writer.cc',
'pdb_source_line_writer.h',
+ 'pe_source_line_writer.cc',
+ 'pe_source_line_writer.h',
+ 'pe_util.h',
+ 'pe_util.cc',
'string_utils.cc',
'string_utils-inl.h',
+ 'symbol_collector_client.cc',
+ 'symbol_collector_client.h',
],
'dependencies': [
'dia_sdk',
diff --git a/src/common/windows/http_upload.cc b/src/common/windows/http_upload.cc
index ba04d7d0..b0cc9078 100644
--- a/src/common/windows/http_upload.cc
+++ b/src/common/windows/http_upload.cc
@@ -33,388 +33,478 @@
#pragma warning(disable:4530)
#include <fstream>
+#include <vector>
#include "common/windows/string_utils-inl.h"
#include "common/windows/http_upload.h"
-namespace google_breakpad {
+namespace {
+ using std::string;
+ using std::wstring;
+ using std::map;
+ using std::vector;
+ using std::ifstream;
+ using std::ios;
+
+ const wchar_t kUserAgent[] = L"Breakpad/1.0 (Windows)";
+
+ // Helper class which closes an internet handle when it goes away
+ class AutoInternetHandle {
+ public:
+ explicit AutoInternetHandle(HINTERNET handle) : handle_(handle) {}
+ ~AutoInternetHandle() {
+ if (handle_) {
+ InternetCloseHandle(handle_);
+ }
+ }
-using std::ifstream;
-using std::ios;
+ HINTERNET get() { return handle_; }
-static const wchar_t kUserAgent[] = L"Breakpad/1.0 (Windows)";
+ private:
+ HINTERNET handle_;
+ };
-// Helper class which closes an internet handle when it goes away
-class HTTPUpload::AutoInternetHandle {
- public:
- explicit AutoInternetHandle(HINTERNET handle) : handle_(handle) {}
- ~AutoInternetHandle() {
- if (handle_) {
- InternetCloseHandle(handle_);
+ wstring UTF8ToWide(const string &utf8) {
+ if (utf8.length() == 0) {
+ return wstring();
}
- }
- HINTERNET get() { return handle_; }
-
- private:
- HINTERNET handle_;
-};
-
-// static
-bool HTTPUpload::SendRequest(const wstring &url,
- const map<wstring, wstring> &parameters,
- const wstring &upload_file,
- const wstring &file_part_name,
- int *timeout,
- wstring *response_body,
- int *response_code) {
- if (response_code) {
- *response_code = 0;
- }
+ // compute the length of the buffer we'll need
+ int charcount = MultiByteToWideChar(CP_UTF8, 0, utf8.c_str(), -1, NULL, 0);
- // TODO(bryner): support non-ASCII parameter names
- if (!CheckParameters(parameters)) {
- return false;
- }
+ if (charcount == 0) {
+ return wstring();
+ }
- // Break up the URL and make sure we can handle it
- wchar_t scheme[16], host[256], path[256];
- URL_COMPONENTS components;
- memset(&components, 0, sizeof(components));
- components.dwStructSize = sizeof(components);
- components.lpszScheme = scheme;
- components.dwSchemeLength = sizeof(scheme) / sizeof(scheme[0]);
- components.lpszHostName = host;
- components.dwHostNameLength = sizeof(host) / sizeof(host[0]);
- components.lpszUrlPath = path;
- components.dwUrlPathLength = sizeof(path) / sizeof(path[0]);
- if (!InternetCrackUrl(url.c_str(), static_cast<DWORD>(url.size()),
- 0, &components)) {
- return false;
- }
- bool secure = false;
- if (wcscmp(scheme, L"https") == 0) {
- secure = true;
- } else if (wcscmp(scheme, L"http") != 0) {
- return false;
+ // convert
+ wchar_t* buf = new wchar_t[charcount];
+ MultiByteToWideChar(CP_UTF8, 0, utf8.c_str(), -1, buf, charcount);
+ wstring result(buf);
+ delete[] buf;
+ return result;
}
- AutoInternetHandle internet(InternetOpen(kUserAgent,
- INTERNET_OPEN_TYPE_PRECONFIG,
- NULL, // proxy name
- NULL, // proxy bypass
- 0)); // flags
- if (!internet.get()) {
- return false;
- }
+ string WideToMBCP(const wstring &wide, unsigned int cp) {
+ if (wide.length() == 0) {
+ return string();
+ }
- AutoInternetHandle connection(InternetConnect(internet.get(),
- host,
- components.nPort,
- NULL, // user name
- NULL, // password
- INTERNET_SERVICE_HTTP,
- 0, // flags
- NULL)); // context
- if (!connection.get()) {
- return false;
- }
+ // compute the length of the buffer we'll need
+ int charcount = WideCharToMultiByte(cp, 0, wide.c_str(), -1,
+ NULL, 0, NULL, NULL);
+ if (charcount == 0) {
+ return string();
+ }
- DWORD http_open_flags = secure ? INTERNET_FLAG_SECURE : 0;
- http_open_flags |= INTERNET_FLAG_NO_COOKIES;
- AutoInternetHandle request(HttpOpenRequest(connection.get(),
- L"POST",
- path,
- NULL, // version
- NULL, // referer
- NULL, // agent type
- http_open_flags,
- NULL)); // context
- if (!request.get()) {
- return false;
- }
+ // convert
+ char *buf = new char[charcount];
+ WideCharToMultiByte(cp, 0, wide.c_str(), -1, buf, charcount,
+ NULL, NULL);
- wstring boundary = GenerateMultipartBoundary();
- wstring content_type_header = GenerateRequestHeader(boundary);
- HttpAddRequestHeaders(request.get(),
- content_type_header.c_str(),
- static_cast<DWORD>(-1),
- HTTP_ADDREQ_FLAG_ADD);
-
- string request_body;
- if (!GenerateRequestBody(parameters, upload_file,
- file_part_name, boundary, &request_body)) {
- return false;
+ string result(buf);
+ delete[] buf;
+ return result;
}
- if (timeout) {
- if (!InternetSetOption(request.get(),
- INTERNET_OPTION_SEND_TIMEOUT,
- timeout,
- sizeof(*timeout))) {
- fwprintf(stderr, L"Could not unset send timeout, continuing...\n");
+ bool GetFileContents(const wstring &filename, vector<char> *contents) {
+ bool rv = false;
+ // The "open" method on pre-MSVC8 ifstream implementations doesn't accept a
+ // wchar_t* filename, so use _wfopen directly in that case. For VC8 and
+ // later, _wfopen has been deprecated in favor of _wfopen_s, which does
+ // not exist in earlier versions, so let the ifstream open the file itself.
+ // GCC doesn't support wide file name and opening on FILE* requires ugly
+ // hacks, so fallback to multi byte file.
+#ifdef _MSC_VER
+ ifstream file;
+ file.open(filename.c_str(), ios::binary);
+#else // GCC
+ ifstream file(WideToMBCP(filename, CP_ACP).c_str(), ios::binary);
+#endif // _MSC_VER >= 1400
+ if (file.is_open()) {
+ file.seekg(0, ios::end);
+ std::streamoff length = file.tellg();
+ // Check for loss of data when converting lenght from std::streamoff into
+ // std::vector<char>::size_type
+ std::vector<char>::size_type vector_size =
+ static_cast<std::vector<char>::size_type>(length);
+ if (static_cast<std::streamoff>(vector_size) == length) {
+ contents->resize(vector_size);
+ if (length != 0) {
+ file.seekg(0, ios::beg);
+ file.read(&((*contents)[0]), length);
+ }
+ rv = true;
+ }
+ file.close();
}
+ return rv;
+ }
- if (!InternetSetOption(request.get(),
- INTERNET_OPTION_RECEIVE_TIMEOUT,
- timeout,
- sizeof(*timeout))) {
- fwprintf(stderr, L"Could not unset receive timeout, continuing...\n");
+ bool CheckParameters(const map<wstring, wstring> &parameters) {
+ for (map<wstring, wstring>::const_iterator pos = parameters.begin();
+ pos != parameters.end(); ++pos) {
+ const wstring &str = pos->first;
+ if (str.size() == 0) {
+ return false; // disallow empty parameter names
+ }
+ for (unsigned int i = 0; i < str.size(); ++i) {
+ wchar_t c = str[i];
+ if (c < 32 || c == '"' || c > 127) {
+ return false;
+ }
+ }
}
+ return true;
}
- if (!HttpSendRequest(request.get(), NULL, 0,
- const_cast<char *>(request_body.data()),
- static_cast<DWORD>(request_body.size()))) {
- return false;
+ // Converts a UTF16 string to UTF8.
+ string WideToUTF8(const wstring &wide) {
+ return WideToMBCP(wide, CP_UTF8);
}
- // The server indicates a successful upload with HTTP status 200.
- wchar_t http_status[4];
- DWORD http_status_size = sizeof(http_status);
- if (!HttpQueryInfo(request.get(), HTTP_QUERY_STATUS_CODE,
- static_cast<LPVOID>(&http_status), &http_status_size,
- 0)) {
- return false;
- }
+ bool ReadResponse(HINTERNET request, wstring *response) {
+ bool has_content_length_header = false;
+ wchar_t content_length[32];
+ DWORD content_length_size = sizeof(content_length);
+ DWORD claimed_size = 0;
+ string response_body;
+
+ if (HttpQueryInfo(request, HTTP_QUERY_CONTENT_LENGTH,
+ static_cast<LPVOID>(&content_length),
+ &content_length_size, 0)) {
+ has_content_length_header = true;
+ claimed_size = wcstol(content_length, NULL, 10);
+ response_body.reserve(claimed_size);
+ }
- int http_response = wcstol(http_status, NULL, 10);
- if (response_code) {
- *response_code = http_response;
- }
+ DWORD bytes_available;
+ DWORD total_read = 0;
+ BOOL return_code;
- bool result = (http_response == 200);
+ while (((return_code = InternetQueryDataAvailable(request, &bytes_available,
+ 0, 0)) != 0) && bytes_available > 0) {
+ vector<char> response_buffer(bytes_available);
+ DWORD size_read;
- if (result) {
- result = ReadResponse(request.get(), response_body);
- }
+ return_code = InternetReadFile(request,
+ &response_buffer[0],
+ bytes_available, &size_read);
- return result;
-}
+ if (return_code && size_read > 0) {
+ total_read += size_read;
+ response_body.append(&response_buffer[0], size_read);
+ }
+ else {
+ break;
+ }
+ }
+
+ bool succeeded = return_code && (!has_content_length_header ||
+ (total_read == claimed_size));
+ if (succeeded && response) {
+ *response = UTF8ToWide(response_body);
+ }
-// static
-bool HTTPUpload::ReadResponse(HINTERNET request, wstring *response) {
- bool has_content_length_header = false;
- wchar_t content_length[32];
- DWORD content_length_size = sizeof(content_length);
- DWORD claimed_size = 0;
- string response_body;
-
- if (HttpQueryInfo(request, HTTP_QUERY_CONTENT_LENGTH,
- static_cast<LPVOID>(&content_length),
- &content_length_size, 0)) {
- has_content_length_header = true;
- claimed_size = wcstol(content_length, NULL, 10);
- response_body.reserve(claimed_size);
+ return succeeded;
}
+ bool SendRequestInner(
+ const wstring& url,
+ const wstring& http_method,
+ const wstring& content_type_header,
+ const string& request_body,
+ int* timeout_ms,
+ wstring* response_body,
+ int* response_code) {
+ if (response_code) {
+ *response_code = 0;
+ }
- DWORD bytes_available;
- DWORD total_read = 0;
- BOOL return_code;
+ // Break up the URL and make sure we can handle it
+ wchar_t scheme[16], host[256], path[1024];
+ URL_COMPONENTS components;
+ memset(&components, 0, sizeof(components));
+ components.dwStructSize = sizeof(components);
+ components.lpszScheme = scheme;
+ components.dwSchemeLength = sizeof(scheme) / sizeof(scheme[0]);
+ components.lpszHostName = host;
+ components.dwHostNameLength = sizeof(host) / sizeof(host[0]);
+ components.lpszUrlPath = path;
+ components.dwUrlPathLength = sizeof(path) / sizeof(path[0]);
+ if (!InternetCrackUrl(url.c_str(), static_cast<DWORD>(url.size()),
+ 0, &components)) {
+ DWORD err = GetLastError();
+ wprintf(L"%d\n", err);
+ return false;
+ }
+ bool secure = false;
+ if (wcscmp(scheme, L"https") == 0) {
+ secure = true;
+ }
+ else if (wcscmp(scheme, L"http") != 0) {
+ return false;
+ }
- while (((return_code = InternetQueryDataAvailable(request, &bytes_available,
- 0, 0)) != 0) && bytes_available > 0) {
- vector<char> response_buffer(bytes_available);
- DWORD size_read;
+ AutoInternetHandle internet(InternetOpen(kUserAgent,
+ INTERNET_OPEN_TYPE_PRECONFIG,
+ NULL, // proxy name
+ NULL, // proxy bypass
+ 0)); // flags
+ if (!internet.get()) {
+ return false;
+ }
- return_code = InternetReadFile(request,
- &response_buffer[0],
- bytes_available, &size_read);
+ AutoInternetHandle connection(InternetConnect(internet.get(),
+ host,
+ components.nPort,
+ NULL, // user name
+ NULL, // password
+ INTERNET_SERVICE_HTTP,
+ 0, // flags
+ NULL)); // context
+ if (!connection.get()) {
+ return false;
+ }
- if (return_code && size_read > 0) {
- total_read += size_read;
- response_body.append(&response_buffer[0], size_read);
- } else {
- break;
+ DWORD http_open_flags = secure ? INTERNET_FLAG_SECURE : 0;
+ http_open_flags |= INTERNET_FLAG_NO_COOKIES;
+ AutoInternetHandle request(HttpOpenRequest(connection.get(),
+ http_method.c_str(),
+ path,
+ NULL, // version
+ NULL, // referer
+ NULL, // agent type
+ http_open_flags,
+ NULL)); // context
+ if (!request.get()) {
+ return false;
}
- }
- bool succeeded = return_code && (!has_content_length_header ||
- (total_read == claimed_size));
- if (succeeded && response) {
- *response = UTF8ToWide(response_body);
- }
+ if (!content_type_header.empty()) {
+ HttpAddRequestHeaders(request.get(),
+ content_type_header.c_str(),
+ static_cast<DWORD>(-1),
+ HTTP_ADDREQ_FLAG_ADD);
+ }
- return succeeded;
-}
+ if (timeout_ms) {
+ if (!InternetSetOption(request.get(),
+ INTERNET_OPTION_SEND_TIMEOUT,
+ timeout_ms,
+ sizeof(*timeout_ms))) {
+ fwprintf(stderr, L"Could not unset send timeout, continuing...\n");
+ }
-// static
-wstring HTTPUpload::GenerateMultipartBoundary() {
- // The boundary has 27 '-' characters followed by 16 hex digits
- static const wchar_t kBoundaryPrefix[] = L"---------------------------";
- static const int kBoundaryLength = 27 + 16 + 1;
+ if (!InternetSetOption(request.get(),
+ INTERNET_OPTION_RECEIVE_TIMEOUT,
+ timeout_ms,
+ sizeof(*timeout_ms))) {
+ fwprintf(stderr, L"Could not unset receive timeout, continuing...\n");
+ }
+ }
- // Generate some random numbers to fill out the boundary
- int r0 = rand();
- int r1 = rand();
+ if (!HttpSendRequest(request.get(), NULL, 0,
+ const_cast<char *>(request_body.data()),
+ static_cast<DWORD>(request_body.size()))) {
+ return false;
+ }
- wchar_t temp[kBoundaryLength];
- swprintf(temp, kBoundaryLength, L"%s%08X%08X", kBoundaryPrefix, r0, r1);
+ // The server indicates a successful upload with HTTP status 200.
+ wchar_t http_status[4];
+ DWORD http_status_size = sizeof(http_status);
+ if (!HttpQueryInfo(request.get(), HTTP_QUERY_STATUS_CODE,
+ static_cast<LPVOID>(&http_status), &http_status_size,
+ 0)) {
+ return false;
+ }
- // remove when VC++7.1 is no longer supported
- temp[kBoundaryLength - 1] = L'\0';
+ int http_response = wcstol(http_status, NULL, 10);
+ if (response_code) {
+ *response_code = http_response;
+ }
- return wstring(temp);
-}
+ bool result = (http_response == 200);
-// static
-wstring HTTPUpload::GenerateRequestHeader(const wstring &boundary) {
- wstring header = L"Content-Type: multipart/form-data; boundary=";
- header += boundary;
- return header;
-}
+ if (result) {
+ result = ReadResponse(request.get(), response_body);
+ }
-// static
-bool HTTPUpload::GenerateRequestBody(const map<wstring, wstring> &parameters,
- const wstring &upload_file,
- const wstring &file_part_name,
- const wstring &boundary,
- string *request_body) {
- vector<char> contents;
- if (!GetFileContents(upload_file, &contents)) {
- return false;
+ return result;
}
- string boundary_str = WideToUTF8(boundary);
- if (boundary_str.empty()) {
- return false;
- }
+ wstring GenerateMultipartBoundary() {
+ // The boundary has 27 '-' characters followed by 16 hex digits
+ static const wchar_t kBoundaryPrefix[] = L"---------------------------";
+ static const int kBoundaryLength = 27 + 16 + 1;
- request_body->clear();
+ // Generate some random numbers to fill out the boundary
+ int r0 = rand();
+ int r1 = rand();
- // Append each of the parameter pairs as a form-data part
- for (map<wstring, wstring>::const_iterator pos = parameters.begin();
- pos != parameters.end(); ++pos) {
- request_body->append("--" + boundary_str + "\r\n");
- request_body->append("Content-Disposition: form-data; name=\"" +
- WideToUTF8(pos->first) + "\"\r\n\r\n" +
- WideToUTF8(pos->second) + "\r\n");
- }
+ wchar_t temp[kBoundaryLength];
+ swprintf(temp, kBoundaryLength, L"%s%08X%08X", kBoundaryPrefix, r0, r1);
- // Now append the upload file as a binary (octet-stream) part
- string filename_utf8 = WideToUTF8(upload_file);
- if (filename_utf8.empty()) {
- return false;
+ // remove when VC++7.1 is no longer supported
+ temp[kBoundaryLength - 1] = L'\0';
+
+ return wstring(temp);
}
- string file_part_name_utf8 = WideToUTF8(file_part_name);
- if (file_part_name_utf8.empty()) {
- return false;
+ wstring GenerateMultipartPostRequestHeader(const wstring &boundary) {
+ wstring header = L"Content-Type: multipart/form-data; boundary=";
+ header += boundary;
+ return header;
}
- request_body->append("--" + boundary_str + "\r\n");
- request_body->append("Content-Disposition: form-data; "
- "name=\"" + file_part_name_utf8 + "\"; "
- "filename=\"" + filename_utf8 + "\"\r\n");
- request_body->append("Content-Type: application/octet-stream\r\n");
- request_body->append("\r\n");
+ bool AppendFileToRequestBody(
+ const wstring& file_part_name,
+ const wstring& filename,
+ string* request_body) {
+ string file_part_name_utf8 = WideToUTF8(file_part_name);
+ if (file_part_name_utf8.empty()) {
+ return false;
+ }
+
+ string filename_utf8 = WideToUTF8(filename);
+ if (filename_utf8.empty()) {
+ return false;
+ }
+
+ request_body->append("Content-Disposition: form-data; "
+ "name=\"" + file_part_name_utf8 + "\"; "
+ "filename=\"" + filename_utf8 + "\"\r\n");
+ request_body->append("Content-Type: application/octet-stream\r\n");
+ request_body->append("\r\n");
- if (!contents.empty()) {
+ vector<char> contents;
+ if (!GetFileContents(filename, &contents)) {
+ return false;
+ }
+
+ if (!contents.empty()) {
request_body->append(&(contents[0]), contents.size());
+ }
+ request_body->append("\r\n");
+
+ return true;
}
- request_body->append("\r\n");
- request_body->append("--" + boundary_str + "--\r\n");
- return true;
-}
-// static
-bool HTTPUpload::GetFileContents(const wstring &filename,
- vector<char> *contents) {
- bool rv = false;
- // The "open" method on pre-MSVC8 ifstream implementations doesn't accept a
- // wchar_t* filename, so use _wfopen directly in that case. For VC8 and
- // later, _wfopen has been deprecated in favor of _wfopen_s, which does
- // not exist in earlier versions, so let the ifstream open the file itself.
- // GCC doesn't support wide file name and opening on FILE* requires ugly
- // hacks, so fallback to multi byte file.
-#ifdef _MSC_VER
- ifstream file;
- file.open(filename.c_str(), ios::binary);
-#else // GCC
- ifstream file(WideToMBCP(filename, CP_ACP).c_str(), ios::binary);
-#endif // _MSC_VER >= 1400
- if (file.is_open()) {
- file.seekg(0, ios::end);
- std::streamoff length = file.tellg();
- // Check for loss of data when converting lenght from std::streamoff into
- // std::vector<char>::size_type
- std::vector<char>::size_type vector_size =
- static_cast<std::vector<char>::size_type>(length);
- if (static_cast<std::streamoff>(vector_size) == length) {
- contents->resize(vector_size);
- if (length != 0) {
- file.seekg(0, ios::beg);
- file.read(&((*contents)[0]), length);
- }
- rv = true;
+ bool GenerateRequestBody(const map<wstring, wstring> &parameters,
+ const map<wstring, wstring> &files,
+ const wstring &boundary,
+ string *request_body) {
+ string boundary_str = WideToUTF8(boundary);
+ if (boundary_str.empty()) {
+ return false;
}
- file.close();
- }
- return rv;
-}
-// static
-wstring HTTPUpload::UTF8ToWide(const string &utf8) {
- if (utf8.length() == 0) {
- return wstring();
- }
+ request_body->clear();
- // compute the length of the buffer we'll need
- int charcount = MultiByteToWideChar(CP_UTF8, 0, utf8.c_str(), -1, NULL, 0);
+ // Append each of the parameter pairs as a form-data part
+ for (map<wstring, wstring>::const_iterator pos = parameters.begin();
+ pos != parameters.end(); ++pos) {
+ request_body->append("--" + boundary_str + "\r\n");
+ request_body->append("Content-Disposition: form-data; name=\"" +
+ WideToUTF8(pos->first) + "\"\r\n\r\n" +
+ WideToUTF8(pos->second) + "\r\n");
+ }
- if (charcount == 0) {
- return wstring();
- }
+ // Now append each upload file as a binary (octet-stream) part
+ for (map<wstring, wstring>::const_iterator pos = files.begin();
+ pos != files.end(); ++pos) {
+ request_body->append("--" + boundary_str + "\r\n");
- // convert
- wchar_t* buf = new wchar_t[charcount];
- MultiByteToWideChar(CP_UTF8, 0, utf8.c_str(), -1, buf, charcount);
- wstring result(buf);
- delete[] buf;
- return result;
+ if (!AppendFileToRequestBody(pos->first, pos->second, request_body)) {
+ return false;
+ }
+ }
+ request_body->append("--" + boundary_str + "--\r\n");
+ return true;
+ }
}
-// static
-string HTTPUpload::WideToMBCP(const wstring &wide, unsigned int cp) {
- if (wide.length() == 0) {
- return string();
+namespace google_breakpad {
+ bool HTTPUpload::SendPutRequest(
+ const wstring& url,
+ const wstring& path,
+ int* timeout_ms,
+ wstring* response_body,
+ int* response_code) {
+ string request_body;
+ if (!AppendFileToRequestBody(L"symbol_file", path, &request_body)) {
+ return false;
+ }
+
+ return SendRequestInner(
+ url,
+ L"PUT",
+ L"",
+ request_body,
+ timeout_ms,
+ response_body,
+ response_code);
}
- // compute the length of the buffer we'll need
- int charcount = WideCharToMultiByte(cp, 0, wide.c_str(), -1,
- NULL, 0, NULL, NULL);
- if (charcount == 0) {
- return string();
+ bool HTTPUpload::SendGetRequest(
+ const wstring& url,
+ int* timeout_ms,
+ wstring* response_body,
+ int* response_code) {
+ return SendRequestInner(
+ url,
+ L"GET",
+ L"",
+ "",
+ timeout_ms,
+ response_body,
+ response_code);
}
- // convert
- char *buf = new char[charcount];
- WideCharToMultiByte(cp, 0, wide.c_str(), -1, buf, charcount,
- NULL, NULL);
+ bool HTTPUpload::SendMultipartPostRequest(
+ const wstring& url,
+ const map<wstring, wstring>& parameters,
+ const map<wstring, wstring>& files,
+ int* timeout_ms,
+ wstring* response_body,
+ int* response_code) {
+ // TODO(bryner): support non-ASCII parameter names
+ if (!CheckParameters(parameters)) {
+ return false;
+ }
- string result(buf);
- delete[] buf;
- return result;
-}
+ wstring boundary = GenerateMultipartBoundary();
+ wstring content_type_header = GenerateMultipartPostRequestHeader(boundary);
-// static
-bool HTTPUpload::CheckParameters(const map<wstring, wstring> &parameters) {
- for (map<wstring, wstring>::const_iterator pos = parameters.begin();
- pos != parameters.end(); ++pos) {
- const wstring &str = pos->first;
- if (str.size() == 0) {
- return false; // disallow empty parameter names
- }
- for (unsigned int i = 0; i < str.size(); ++i) {
- wchar_t c = str[i];
- if (c < 32 || c == '"' || c > 127) {
- return false;
- }
+ string request_body;
+ if (!GenerateRequestBody(parameters, files, boundary, &request_body)) {
+ return false;
}
+
+ return SendRequestInner(
+ url,
+ L"POST",
+ content_type_header,
+ request_body,
+ timeout_ms,
+ response_body,
+ response_code);
}
- return true;
-}
+ bool HTTPUpload::SendSimplePostRequest(
+ const wstring& url,
+ const wstring& body,
+ const wstring& content_type,
+ int *timeout_ms,
+ wstring *response_body,
+ int *response_code) {
+ return SendRequestInner(
+ url,
+ L"POST",
+ content_type,
+ WideToUTF8(body),
+ timeout_ms,
+ response_body,
+ response_code);
+ }
} // namespace google_breakpad
diff --git a/src/common/windows/http_upload.h b/src/common/windows/http_upload.h
index e485b70e..57e526e3 100644
--- a/src/common/windows/http_upload.h
+++ b/src/common/windows/http_upload.h
@@ -42,21 +42,44 @@
#include <wininet.h>
#include <map>
-#include <string>
-#include <vector>
namespace google_breakpad {
using std::string;
using std::wstring;
using std::map;
-using std::vector;
class HTTPUpload {
public:
- // Sends the given set of parameters, along with the contents of
- // upload_file, as a multipart POST request to the given URL.
- // file_part_name contains the name of the file part of the request
+ // Sends a PUT request containing the data in |path| to the given
+ // URL.
+ // Only HTTP(S) URLs are currently supported. Returns true on success.
+ // If the request is successful and response_body is non-NULL,
+ // the response body will be returned in response_body.
+ // If response_code is non-NULL, it will be set to the HTTP response code
+ // received (or 0 if the request failed before getting an HTTP response).
+ static bool SendPutRequest(
+ const wstring& url,
+ const wstring& path,
+ int* timeout_ms,
+ wstring* response_body,
+ int* response_code);
+
+ // Sends a GET request to the given URL.
+ // Only HTTP(S) URLs are currently supported. Returns true on success.
+ // If the request is successful and response_body is non-NULL,
+ // the response body will be returned in response_body.
+ // If response_code is non-NULL, it will be set to the HTTP response code
+ // received (or 0 if the request failed before getting an HTTP response).
+ static bool SendGetRequest(
+ const wstring& url,
+ int* timeout_ms,
+ wstring* response_body,
+ int* response_code);
+
+ // Sends the given sets of parameters and files as a multipart POST
+ // request to the given URL.
+ // Each key in |files| is the name of the file part of the request
// (i.e. it corresponds to the name= attribute on an <input type="file">.
// Parameter names must contain only printable ASCII characters,
// and may not contain a quote (") character.
@@ -65,57 +88,29 @@ class HTTPUpload {
// the response body will be returned in response_body.
// If response_code is non-NULL, it will be set to the HTTP response code
// received (or 0 if the request failed before getting an HTTP response).
- static bool SendRequest(const wstring &url,
- const map<wstring, wstring> &parameters,
- const wstring &upload_file,
- const wstring &file_part_name,
- int *timeout,
- wstring *response_body,
- int *response_code);
+ static bool SendMultipartPostRequest(
+ const wstring& url,
+ const map<wstring, wstring>& parameters,
+ const map<wstring, wstring>& files,
+ int *timeout_ms,
+ wstring *response_body,
+ int *response_code);
+
+ // Sends a POST request, with the body set to |body|, to the given URL.
+ // Only HTTP(S) URLs are currently supported. Returns true on success.
+ // If the request is successful and response_body is non-NULL,
+ // the response body will be returned in response_body.
+ // If response_code is non-NULL, it will be set to the HTTP response code
+ // received (or 0 if the request failed before getting an HTTP response).
+ static bool SendSimplePostRequest(
+ const wstring& url,
+ const wstring& body,
+ const wstring& content_type,
+ int *timeout_ms,
+ wstring *response_body,
+ int *response_code);
private:
- class AutoInternetHandle;
-
- // Retrieves the HTTP response. If NULL is passed in for response,
- // this merely checks (via the return value) that we were successfully
- // able to retrieve exactly as many bytes of content in the response as
- // were specified in the Content-Length header.
- static bool ReadResponse(HINTERNET request, wstring* response);
-
- // Generates a new multipart boundary for a POST request
- static wstring GenerateMultipartBoundary();
-
- // Generates a HTTP request header for a multipart form submit.
- static wstring GenerateRequestHeader(const wstring &boundary);
-
- // Given a set of parameters, an upload filename, and a file part name,
- // generates a multipart request body string with these parameters
- // and minidump contents. Returns true on success.
- static bool GenerateRequestBody(const map<wstring, wstring> &parameters,
- const wstring &upload_file,
- const wstring &file_part_name,
- const wstring &boundary,
- string *request_body);
-
- // Fills the supplied vector with the contents of filename.
- static bool GetFileContents(const wstring &filename, vector<char> *contents);
-
- // Converts a UTF8 string to UTF16.
- static wstring UTF8ToWide(const string &utf8);
-
- // Converts a UTF16 string to UTF8.
- static string WideToUTF8(const wstring &wide) {
- return WideToMBCP(wide, CP_UTF8);
- }
-
- // Converts a UTF16 string to specified code page.
- static string WideToMBCP(const wstring &wide, unsigned int cp);
-
- // Checks that the given list of parameters has only printable
- // ASCII characters in the parameter name, and does not contain
- // any quote (") characters. Returns true if so.
- static bool CheckParameters(const map<wstring, wstring> &parameters);
-
// No instances of this class should be created.
// Disallow all constructors, destructors, and operator=.
HTTPUpload();
diff --git a/src/common/windows/module_info.h b/src/common/windows/module_info.h
new file mode 100644
index 00000000..3dccc808
--- /dev/null
+++ b/src/common/windows/module_info.h
@@ -0,0 +1,75 @@
+// Copyright (c) 2019, Google Inc.
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef COMMON_WINDOWS_MODULE_INFO_H_
+#define COMMON_WINDOWS_MODULE_INFO_H_
+
+#include <string>
+
+namespace google_breakpad {
+
+using std::wstring;
+// A structure that carries information that identifies a module.
+struct PDBModuleInfo {
+public:
+ // The basename of the pe/pdb file from which information was loaded.
+ wstring debug_file;
+
+ // The module's identifier. For recent pe/pdb files, the identifier consists
+ // of the pe/pdb's guid, in uppercase hexadecimal form without any dashes
+ // or separators, followed immediately by the pe/pdb's age, also in
+ // uppercase hexadecimal form. For older pe/pdb files which have no guid,
+ // the identifier is the pe/pdb's 32-bit signature value, in zero-padded
+ // hexadecimal form, followed immediately by the pe/pdb's age, in lowercase
+ // hexadecimal form.
+ wstring debug_identifier;
+
+ // A string identifying the cpu that the pe/pdb is associated with.
+ // Currently, this may be "x86" or "unknown".
+ wstring cpu;
+};
+
+// A structure that carries information that identifies a PE file,
+// either an EXE or a DLL.
+struct PEModuleInfo {
+ // The basename of the PE file.
+ wstring code_file;
+
+ // The PE file's code identifier, which consists of its timestamp
+ // and file size concatenated together into a single hex string.
+ // (The fields IMAGE_OPTIONAL_HEADER::SizeOfImage and
+ // IMAGE_FILE_HEADER::TimeDateStamp, as defined in the ImageHlp
+ // documentation.) This is not well documented, if it's documented
+ // at all, but it's what symstore does and what DbgHelp supports.
+ wstring code_identifier;
+};
+
+} // namespace google_breakpad
+
+#endif // COMMON_WINDOWS_MODULE_INFO_H_
diff --git a/src/common/windows/omap.cc b/src/common/windows/omap.cc
index 67b92065..ba3ce86b 100644
--- a/src/common/windows/omap.cc
+++ b/src/common/windows/omap.cc
@@ -210,7 +210,7 @@ bool FindAndLoadOmapTable(const wchar_t* name,
reinterpret_cast<BYTE*>(&table->at(0)),
&count_read))) {
fprintf(stderr, "IDiaEnumDebugStreamData::Next failed while reading "
- "data from stream \"%ws\"\n");
+ "data from stream \"%ws\"\n", name);
return false;
}
@@ -449,6 +449,27 @@ void BuildEndpointIndexMap(ImageMap* image_map) {
}
}
+void BuildSubsequentRVAMap(const OmapData &omap_data,
+ std::map<DWORD, DWORD> *subsequent) {
+ assert(subsequent->empty());
+ const OmapFromTable &orig2tran =
+ reinterpret_cast<const OmapFromTable &>(omap_data.omap_from);
+
+ if (orig2tran.empty())
+ return;
+
+ for (size_t i = 0; i < orig2tran.size() - 1; ++i) {
+ // Expect that orig2tran is sorted.
+ if (orig2tran[i].rva_original >= orig2tran[i + 1].rva_original) {
+ fprintf(stderr, "OMAP 'from' table unexpectedly unsorted\n");
+ subsequent->clear();
+ return;
+ }
+ subsequent->insert(std::make_pair(orig2tran[i].rva_original,
+ orig2tran[i + 1].rva_original));
+ }
+}
+
// Clips the given mapped range.
void ClipMappedRangeOriginal(const AddressRange& clip_range,
MappedRange* mapped_range) {
@@ -576,6 +597,7 @@ void BuildImageMap(const OmapData& omap_data, ImageMap* image_map) {
BuildMapping(omap_data, &image_map->mapping);
BuildEndpointIndexMap(image_map);
+ BuildSubsequentRVAMap(omap_data, &image_map->subsequent_rva_block);
}
void MapAddressRange(const ImageMap& image_map,
@@ -691,4 +713,4 @@ void MapAddressRange(const ImageMap& image_map,
return;
}
-} // namespace google_breakpad \ No newline at end of file
+} // namespace google_breakpad
diff --git a/src/common/windows/omap_internal.h b/src/common/windows/omap_internal.h
index 3f904d7a..2a4713d9 100644
--- a/src/common/windows/omap_internal.h
+++ b/src/common/windows/omap_internal.h
@@ -35,6 +35,7 @@
#include <windows.h>
#include <dia2.h>
+#include <map>
#include <vector>
namespace google_breakpad {
@@ -130,6 +131,8 @@ struct ImageMap {
// an interval in |mapping| that contains the endpoint. Useful for doing
// interval intersection queries.
EndpointIndexMap endpoint_index_map;
+
+ std::map<DWORD, DWORD> subsequent_rva_block;
};
} // namespace google_breakpad
diff --git a/src/common/windows/omap_unittest.cc b/src/common/windows/omap_unittest.cc
index 960a33f4..7fe66bd4 100644
--- a/src/common/windows/omap_unittest.cc
+++ b/src/common/windows/omap_unittest.cc
@@ -30,8 +30,7 @@
#include "common/windows/omap.h"
-#include "gmock/gmock.h"
-#include "gtest/gtest.h"
+#include "breakpad_googletest_includes.h"
namespace google_breakpad {
diff --git a/src/common/windows/pdb_source_line_writer.cc b/src/common/windows/pdb_source_line_writer.cc
index a3213dc3..4030a2e9 100644
--- a/src/common/windows/pdb_source_line_writer.cc
+++ b/src/common/windows/pdb_source_line_writer.cc
@@ -33,14 +33,19 @@
#include <winnt.h>
#include <atlbase.h>
#include <dia2.h>
+#include <diacreate.h>
#include <ImageHlp.h>
#include <stdio.h>
+#include <algorithm>
#include <limits>
+#include <map>
#include <set>
+#include <utility>
#include "common/windows/dia_util.h"
#include "common/windows/guid_string.h"
+#include "common/windows/pe_util.h"
#include "common/windows/string_utils-inl.h"
// This constant may be missing from DbgHelp.h. See the documentation for
@@ -49,77 +54,105 @@
#define UNDNAME_NO_ECSU 0x8000 // Suppresses enum/class/struct/union.
#endif // UNDNAME_NO_ECSU
-/*
- * Not defined in WinNT.h for some reason. Definitions taken from:
- * http://uninformed.org/index.cgi?v=4&a=1&p=13
- *
- */
-typedef unsigned char UBYTE;
-
-#if !defined(_WIN64)
-#define UNW_FLAG_EHANDLER 0x01
-#define UNW_FLAG_UHANDLER 0x02
-#define UNW_FLAG_CHAININFO 0x04
-#endif
-
-union UnwindCode {
- struct {
- UBYTE offset_in_prolog;
- UBYTE unwind_operation_code : 4;
- UBYTE operation_info : 4;
- };
- USHORT frame_offset;
-};
+namespace google_breakpad {
-enum UnwindOperationCodes {
- UWOP_PUSH_NONVOL = 0, /* info == register number */
- UWOP_ALLOC_LARGE, /* no info, alloc size in next 2 slots */
- UWOP_ALLOC_SMALL, /* info == size of allocation / 8 - 1 */
- UWOP_SET_FPREG, /* no info, FP = RSP + UNWIND_INFO.FPRegOffset*16 */
- UWOP_SAVE_NONVOL, /* info == register number, offset in next slot */
- UWOP_SAVE_NONVOL_FAR, /* info == register number, offset in next 2 slots */
- // XXX: these are missing from MSDN!
- // See: http://www.osronline.com/ddkx/kmarch/64bitamd_4rs7.htm
- UWOP_SAVE_XMM,
- UWOP_SAVE_XMM_FAR,
- UWOP_SAVE_XMM128, /* info == XMM reg number, offset in next slot */
- UWOP_SAVE_XMM128_FAR, /* info == XMM reg number, offset in next 2 slots */
- UWOP_PUSH_MACHFRAME /* info == 0: no error-code, 1: error-code */
-};
+namespace {
+
+using std::vector;
-// See: http://msdn.microsoft.com/en-us/library/ddssxxy8.aspx
-// Note: some fields removed as we don't use them.
-struct UnwindInfo {
- UBYTE version : 3;
- UBYTE flags : 5;
- UBYTE size_of_prolog;
- UBYTE count_of_codes;
- UBYTE frame_register : 4;
- UBYTE frame_offset : 4;
- UnwindCode unwind_code[1];
+// The symbol (among possibly many) selected to represent an rva.
+struct SelectedSymbol {
+ SelectedSymbol(const CComPtr<IDiaSymbol>& symbol, bool is_public)
+ : symbol(symbol), is_public(is_public), is_multiple(false) {}
+
+ // The symbol to use for an rva.
+ CComPtr<IDiaSymbol> symbol;
+ // Whether this is a public or function symbol.
+ bool is_public;
+ // Whether the rva has multiple associated symbols. An rva will correspond to
+ // multiple symbols in the case of linker identical symbol folding.
+ bool is_multiple;
};
-namespace google_breakpad {
+// Maps rva to the symbol to use for that address.
+typedef std::map<DWORD, SelectedSymbol> SymbolMap;
+
+// Record this in the map as the selected symbol for the rva if it satisfies the
+// necessary conditions.
+void MaybeRecordSymbol(DWORD rva,
+ const CComPtr<IDiaSymbol> symbol,
+ bool is_public,
+ SymbolMap* map) {
+ SymbolMap::iterator loc = map->find(rva);
+ if (loc == map->end()) {
+ map->insert(std::make_pair(rva, SelectedSymbol(symbol, is_public)));
+ return;
+ }
-namespace {
+ // Prefer function symbols to public symbols.
+ if (is_public && !loc->second.is_public) {
+ return;
+ }
-using std::vector;
+ loc->second.is_multiple = true;
+
+ // Take the 'least' symbol by lexicographical order of the decorated name. We
+ // use the decorated rather than undecorated name because computing the latter
+ // is expensive.
+ BSTR current_name, new_name;
+ loc->second.symbol->get_name(&current_name);
+ symbol->get_name(&new_name);
+ if (wcscmp(new_name, current_name) < 0) {
+ loc->second.symbol = symbol;
+ loc->second.is_public = is_public;
+ }
+}
+
+
+
+bool SymbolsMatch(IDiaSymbol* a, IDiaSymbol* b) {
+ DWORD a_section, a_offset, b_section, b_offset;
+ if (FAILED(a->get_addressSection(&a_section)) ||
+ FAILED(a->get_addressOffset(&a_offset)) ||
+ FAILED(b->get_addressSection(&b_section)) ||
+ FAILED(b->get_addressOffset(&b_offset)))
+ return false;
+ return a_section == b_section && a_offset == b_offset;
+}
-// A helper class to scope a PLOADED_IMAGE.
-class AutoImage {
- public:
- explicit AutoImage(PLOADED_IMAGE img) : img_(img) {}
- ~AutoImage() {
- if (img_)
- ImageUnload(img_);
+bool CreateDiaDataSourceInstance(CComPtr<IDiaDataSource> &data_source) {
+ if (SUCCEEDED(data_source.CoCreateInstance(CLSID_DiaSource))) {
+ return true;
}
- operator PLOADED_IMAGE() { return img_; }
- PLOADED_IMAGE operator->() { return img_; }
+ class DECLSPEC_UUID("B86AE24D-BF2F-4ac9-B5A2-34B14E4CE11D") DiaSource100;
+ class DECLSPEC_UUID("761D3BCD-1304-41D5-94E8-EAC54E4AC172") DiaSource110;
+ class DECLSPEC_UUID("3BFCEA48-620F-4B6B-81F7-B9AF75454C7D") DiaSource120;
+ class DECLSPEC_UUID("E6756135-1E65-4D17-8576-610761398C3C") DiaSource140;
+
+ // If the CoCreateInstance call above failed, msdia*.dll is not registered.
+ // We can try loading the DLL corresponding to the #included DIA SDK, but
+ // the DIA headers don't provide a version. Lets try to figure out which DIA
+ // version we're compiling against by comparing CLSIDs.
+ const wchar_t *msdia_dll = nullptr;
+ if (CLSID_DiaSource == _uuidof(DiaSource100)) {
+ msdia_dll = L"msdia100.dll";
+ } else if (CLSID_DiaSource == _uuidof(DiaSource110)) {
+ msdia_dll = L"msdia110.dll";
+ } else if (CLSID_DiaSource == _uuidof(DiaSource120)) {
+ msdia_dll = L"msdia120.dll";
+ } else if (CLSID_DiaSource == _uuidof(DiaSource140)) {
+ msdia_dll = L"msdia140.dll";
+ }
- private:
- PLOADED_IMAGE img_;
-};
+ if (msdia_dll &&
+ SUCCEEDED(NoRegCoCreate(msdia_dll, CLSID_DiaSource, IID_IDiaDataSource,
+ reinterpret_cast<void **>(&data_source)))) {
+ return true;
+ }
+
+ return false;
+}
} // namespace
@@ -127,6 +160,7 @@ PDBSourceLineWriter::PDBSourceLineWriter() : output_(NULL) {
}
PDBSourceLineWriter::~PDBSourceLineWriter() {
+ Close();
}
bool PDBSourceLineWriter::SetCodeFile(const wstring &exe_file) {
@@ -149,13 +183,10 @@ bool PDBSourceLineWriter::Open(const wstring &file, FileFormat format) {
}
CComPtr<IDiaDataSource> data_source;
- if (FAILED(data_source.CoCreateInstance(CLSID_DiaSource))) {
+ if (!CreateDiaDataSourceInstance(data_source)) {
const int kGuidSize = 64;
wchar_t classid[kGuidSize] = {0};
StringFromGUID2(CLSID_DiaSource, classid, kGuidSize);
- // vc80 uses bce36434-2c24-499e-bf49-8bd99b0eeb68.
- // vc90 uses 4C41678E-887B-4365-A09E-925D28DB33C2.
- // vc100 uses B86AE24D-BF2F-4AC9-B5A2-34B14E4CE11D.
fprintf(stderr, "CoCreateInstance CLSID_DiaSource %S failed "
"(msdia*.dll unregistered?)\n", classid);
return false;
@@ -233,7 +264,7 @@ bool PDBSourceLineWriter::PrintLines(IDiaEnumLineNumbers *lines) {
AddressRangeVector ranges;
MapAddressRange(image_map_, AddressRange(rva, length), &ranges);
for (size_t i = 0; i < ranges.size(); ++i) {
- fprintf(output_, "%x %x %d %d\n", ranges[i].rva, ranges[i].length,
+ fprintf(output_, "%lx %lx %lu %lu\n", ranges[i].rva, ranges[i].length,
line_num, source_id);
}
line.Release();
@@ -242,7 +273,8 @@ bool PDBSourceLineWriter::PrintLines(IDiaEnumLineNumbers *lines) {
}
bool PDBSourceLineWriter::PrintFunction(IDiaSymbol *function,
- IDiaSymbol *block) {
+ IDiaSymbol *block,
+ bool has_multiple_symbols) {
// The function format is:
// FUNC <address> <length> <param_stack_size> <function>
DWORD rva;
@@ -278,8 +310,9 @@ bool PDBSourceLineWriter::PrintFunction(IDiaSymbol *function,
MapAddressRange(image_map_, AddressRange(rva, static_cast<DWORD>(length)),
&ranges);
for (size_t i = 0; i < ranges.size(); ++i) {
- fprintf(output_, "FUNC %x %x %x %ws\n",
- ranges[i].rva, ranges[i].length, stack_param_size, name);
+ const char* optional_multiple_field = has_multiple_symbols ? "m " : "";
+ fprintf(output_, "FUNC %s%lx %lx %x %ws\n", optional_multiple_field,
+ ranges[i].rva, ranges[i].length, stack_param_size, name.m_str);
}
CComPtr<IDiaEnumLineNumbers> lines;
@@ -330,7 +363,7 @@ bool PDBSourceLineWriter::PrintSourceFiles() {
if (!FileIDIsCached(file_name_string)) {
// this is a new file name, cache it and output a FILE line.
CacheFileID(file_name_string, file_id);
- fwprintf(output_, L"FILE %d %s\n", file_id, file_name);
+ fwprintf(output_, L"FILE %d %ws\n", file_id, file_name_string.c_str());
} else {
// this file name has already been seen, just save this
// ID for later lookup.
@@ -357,7 +390,7 @@ bool PDBSourceLineWriter::PrintFunctions() {
CComPtr<IDiaEnumSymbols> symbols = NULL;
// Find all function symbols first.
- std::set<DWORD> rvas;
+ SymbolMap rva_symbol;
hr = global->findChildren(SymTagFunction, NULL, nsNone, &symbols);
if (SUCCEEDED(hr)) {
@@ -365,9 +398,8 @@ bool PDBSourceLineWriter::PrintFunctions() {
while (SUCCEEDED(symbols->Next(1, &symbol, &count)) && count == 1) {
if (SUCCEEDED(symbol->get_relativeVirtualAddress(&rva))) {
- // To maintain existing behavior of one symbol per address, place the
- // rva onto a set here to uniquify them.
- rvas.insert(rva);
+ // Potentially record this as the canonical symbol for this rva.
+ MaybeRecordSymbol(rva, symbol, false, &rva_symbol);
} else {
fprintf(stderr, "get_relativeVirtualAddress failed on the symbol\n");
return false;
@@ -379,9 +411,8 @@ bool PDBSourceLineWriter::PrintFunctions() {
symbols.Release();
}
- // Find all public symbols. Store public symbols that are not also private
- // symbols for later.
- std::set<DWORD> public_only_rvas;
+ // Find all public symbols and record public symbols that are not also private
+ // symbols.
hr = global->findChildren(SymTagPublicSymbol, NULL, nsNone, &symbols);
if (SUCCEEDED(hr)) {
@@ -389,10 +420,8 @@ bool PDBSourceLineWriter::PrintFunctions() {
while (SUCCEEDED(symbols->Next(1, &symbol, &count)) && count == 1) {
if (SUCCEEDED(symbol->get_relativeVirtualAddress(&rva))) {
- if (rvas.count(rva) == 0) {
- rvas.insert(rva); // Keep symbols in rva order.
- public_only_rvas.insert(rva);
- }
+ // Potentially record this as the canonical symbol for this rva.
+ MaybeRecordSymbol(rva, symbol, true, &rva_symbol);
} else {
fprintf(stderr, "get_relativeVirtualAddress failed on the symbol\n");
return false;
@@ -404,39 +433,17 @@ bool PDBSourceLineWriter::PrintFunctions() {
symbols.Release();
}
- std::set<DWORD>::iterator it;
-
- // For each rva, dump the first symbol DIA knows about at the address.
- for (it = rvas.begin(); it != rvas.end(); ++it) {
- CComPtr<IDiaSymbol> symbol = NULL;
- // If the symbol is not in the public list, look for SymTagFunction. This is
- // a workaround to a bug where DIA will hang if searching for a private
- // symbol at an address where only a public symbol exists.
- // See http://connect.microsoft.com/VisualStudio/feedback/details/722366
- if (public_only_rvas.count(*it) == 0) {
- if (SUCCEEDED(session_->findSymbolByRVA(*it, SymTagFunction, &symbol))) {
- // Sometimes findSymbolByRVA returns S_OK, but NULL.
- if (symbol) {
- if (!PrintFunction(symbol, symbol))
- return false;
- symbol.Release();
- }
- } else {
- fprintf(stderr, "findSymbolByRVA SymTagFunction failed\n");
+ // For each rva, dump the selected symbol at the address.
+ SymbolMap::iterator it;
+ for (it = rva_symbol.begin(); it != rva_symbol.end(); ++it) {
+ CComPtr<IDiaSymbol> symbol = it->second.symbol;
+ // Only print public symbols if there is no function symbol for the address.
+ if (!it->second.is_public) {
+ if (!PrintFunction(symbol, symbol, it->second.is_multiple))
return false;
- }
- } else if (SUCCEEDED(session_->findSymbolByRVA(*it,
- SymTagPublicSymbol,
- &symbol))) {
- // Sometimes findSymbolByRVA returns S_OK, but NULL.
- if (symbol) {
- if (!PrintCodePublicSymbol(symbol))
- return false;
- symbol.Release();
- }
} else {
- fprintf(stderr, "findSymbolByRVA SymTagPublicSymbol failed\n");
- return false;
+ if (!PrintCodePublicSymbol(symbol, it->second.is_multiple))
+ return false;
}
}
@@ -479,7 +486,7 @@ bool PDBSourceLineWriter::PrintFunctions() {
SUCCEEDED(parent->get_relativeVirtualAddress(&func_rva)) &&
SUCCEEDED(parent->get_length(&func_length))) {
if (block_rva < func_rva || block_rva > (func_rva + func_length)) {
- if (!PrintFunction(parent, block)) {
+ if (!PrintFunction(parent, block, false)) {
return false;
}
}
@@ -630,12 +637,12 @@ bool PDBSourceLineWriter::PrintFrameDataUsingPDB() {
for (size_t i = 0; i < frame_infos.size(); ++i) {
const FrameInfo& fi(frame_infos[i]);
- fprintf(output_, "STACK WIN %x %x %x %x %x %x %x %x %x %d ",
+ fprintf(output_, "STACK WIN %lx %lx %lx %lx %x %lx %lx %lx %lx %d ",
type, fi.rva, fi.code_size, fi.prolog_size,
0 /* epilog_size */, parameter_size, saved_register_size,
local_size, max_stack_size, program_string_result == S_OK);
if (program_string_result == S_OK) {
- fprintf(output_, "%ws\n", program_string);
+ fprintf(output_, "%ws\n", program_string.m_str);
} else {
fprintf(output_, "%d\n", allocates_base_pointer);
}
@@ -659,131 +666,7 @@ bool PDBSourceLineWriter::PrintFrameDataUsingEXE() {
return false;
}
- // Convert wchar to native charset because ImageLoad only takes
- // a PSTR as input.
- string code_file;
- if (!WindowsStringUtils::safe_wcstombs(code_file_, &code_file)) {
- return false;
- }
-
- AutoImage img(ImageLoad((PSTR)code_file.c_str(), NULL));
- if (!img) {
- fprintf(stderr, "Failed to load %s\n", code_file.c_str());
- return false;
- }
- PIMAGE_OPTIONAL_HEADER64 optional_header =
- &(reinterpret_cast<PIMAGE_NT_HEADERS64>(img->FileHeader))->OptionalHeader;
- if (optional_header->Magic != IMAGE_NT_OPTIONAL_HDR64_MAGIC) {
- fprintf(stderr, "Not a PE32+ image\n");
- return false;
- }
-
- // Read Exception Directory
- DWORD exception_rva = optional_header->
- DataDirectory[IMAGE_DIRECTORY_ENTRY_EXCEPTION].VirtualAddress;
- DWORD exception_size = optional_header->
- DataDirectory[IMAGE_DIRECTORY_ENTRY_EXCEPTION].Size;
- PIMAGE_RUNTIME_FUNCTION_ENTRY funcs =
- static_cast<PIMAGE_RUNTIME_FUNCTION_ENTRY>(
- ImageRvaToVa(img->FileHeader,
- img->MappedAddress,
- exception_rva,
- &img->LastRvaSection));
- for (DWORD i = 0; i < exception_size / sizeof(*funcs); i++) {
- DWORD unwind_rva = funcs[i].UnwindInfoAddress;
- // handle chaining
- while (unwind_rva & 0x1) {
- unwind_rva ^= 0x1;
- PIMAGE_RUNTIME_FUNCTION_ENTRY chained_func =
- static_cast<PIMAGE_RUNTIME_FUNCTION_ENTRY>(
- ImageRvaToVa(img->FileHeader,
- img->MappedAddress,
- unwind_rva,
- &img->LastRvaSection));
- unwind_rva = chained_func->UnwindInfoAddress;
- }
-
- UnwindInfo *unwind_info = static_cast<UnwindInfo *>(
- ImageRvaToVa(img->FileHeader,
- img->MappedAddress,
- unwind_rva,
- &img->LastRvaSection));
-
- DWORD stack_size = 8; // minimal stack size is 8 for RIP
- DWORD rip_offset = 8;
- do {
- for (UBYTE c = 0; c < unwind_info->count_of_codes; c++) {
- UnwindCode *unwind_code = &unwind_info->unwind_code[c];
- switch (unwind_code->unwind_operation_code) {
- case UWOP_PUSH_NONVOL: {
- stack_size += 8;
- break;
- }
- case UWOP_ALLOC_LARGE: {
- if (unwind_code->operation_info == 0) {
- c++;
- if (c < unwind_info->count_of_codes)
- stack_size += (unwind_code + 1)->frame_offset * 8;
- } else {
- c += 2;
- if (c < unwind_info->count_of_codes)
- stack_size += (unwind_code + 1)->frame_offset |
- ((unwind_code + 2)->frame_offset << 16);
- }
- break;
- }
- case UWOP_ALLOC_SMALL: {
- stack_size += unwind_code->operation_info * 8 + 8;
- break;
- }
- case UWOP_SET_FPREG:
- case UWOP_SAVE_XMM:
- case UWOP_SAVE_XMM_FAR:
- break;
- case UWOP_SAVE_NONVOL:
- case UWOP_SAVE_XMM128: {
- c++; // skip slot with offset
- break;
- }
- case UWOP_SAVE_NONVOL_FAR:
- case UWOP_SAVE_XMM128_FAR: {
- c += 2; // skip 2 slots with offset
- break;
- }
- case UWOP_PUSH_MACHFRAME: {
- if (unwind_code->operation_info) {
- stack_size += 88;
- } else {
- stack_size += 80;
- }
- rip_offset += 80;
- break;
- }
- }
- }
- if (unwind_info->flags & UNW_FLAG_CHAININFO) {
- PIMAGE_RUNTIME_FUNCTION_ENTRY chained_func =
- reinterpret_cast<PIMAGE_RUNTIME_FUNCTION_ENTRY>(
- (unwind_info->unwind_code +
- ((unwind_info->count_of_codes + 1) & ~1)));
-
- unwind_info = static_cast<UnwindInfo *>(
- ImageRvaToVa(img->FileHeader,
- img->MappedAddress,
- chained_func->UnwindInfoAddress,
- &img->LastRvaSection));
- } else {
- unwind_info = NULL;
- }
- } while (unwind_info);
- fprintf(output_, "STACK CFI INIT %x %x .cfa: $rsp .ra: .cfa %d - ^\n",
- funcs[i].BeginAddress,
- funcs[i].EndAddress - funcs[i].BeginAddress, rip_offset);
- fprintf(output_, "STACK CFI %x .cfa: $rsp %d +\n",
- funcs[i].BeginAddress, stack_size);
- }
-
- return true;
+ return PrintPEFrameData(code_file_, output_);
}
bool PDBSourceLineWriter::PrintFrameData() {
@@ -796,7 +679,8 @@ bool PDBSourceLineWriter::PrintFrameData() {
return false;
}
-bool PDBSourceLineWriter::PrintCodePublicSymbol(IDiaSymbol *symbol) {
+bool PDBSourceLineWriter::PrintCodePublicSymbol(IDiaSymbol *symbol,
+ bool has_multiple_symbols) {
BOOL is_code;
if (FAILED(symbol->get_code(&is_code))) {
return false;
@@ -819,9 +703,44 @@ bool PDBSourceLineWriter::PrintCodePublicSymbol(IDiaSymbol *symbol) {
AddressRangeVector ranges;
MapAddressRange(image_map_, AddressRange(rva, 1), &ranges);
for (size_t i = 0; i < ranges.size(); ++i) {
- fprintf(output_, "PUBLIC %x %x %ws\n", ranges[i].rva,
- stack_param_size > 0 ? stack_param_size : 0, name);
+ const char* optional_multiple_field = has_multiple_symbols ? "m " : "";
+ fprintf(output_, "PUBLIC %s%lx %x %ws\n", optional_multiple_field,
+ ranges[i].rva, stack_param_size > 0 ? stack_param_size : 0,
+ name.m_str);
+ }
+
+ // Now walk the function in the original untranslated space, asking DIA
+ // what function is at that location, stepping through OMAP blocks. If
+ // we're still in the same function, emit another entry, because the
+ // symbol could have been split into multiple pieces. If we've gotten to
+ // another symbol in the original address space, then we're done for
+ // this symbol. See https://crbug.com/678874.
+ for (;;) {
+ // This steps to the next block in the original image. Simply doing
+ // rva++ would also be correct, but would emit tons of unnecessary
+ // entries.
+ rva = image_map_.subsequent_rva_block[rva];
+ if (rva == 0)
+ break;
+
+ CComPtr<IDiaSymbol> next_sym = NULL;
+ LONG displacement;
+ if (FAILED(session_->findSymbolByRVAEx(rva, SymTagPublicSymbol, &next_sym,
+ &displacement))) {
+ break;
+ }
+
+ if (!SymbolsMatch(symbol, next_sym))
+ break;
+
+ AddressRangeVector next_ranges;
+ MapAddressRange(image_map_, AddressRange(rva, 1), &next_ranges);
+ for (size_t i = 0; i < next_ranges.size(); ++i) {
+ fprintf(output_, "PUBLIC %lx %x %ws\n", next_ranges[i].rva,
+ stack_param_size > 0 ? stack_param_size : 0, name.m_str);
+ }
}
+
return true;
}
@@ -903,7 +822,7 @@ bool PDBSourceLineWriter::FindPEFile() {
// Look for an EXE or DLL file.
const wchar_t *extensions[] = { L"exe", L"dll" };
- for (int i = 0; i < sizeof(extensions) / sizeof(extensions[0]); i++) {
+ for (size_t i = 0; i < sizeof(extensions) / sizeof(extensions[0]); i++) {
size_t dot_pos = file.find_last_of(L".");
if (dot_pos != wstring::npos) {
file.replace(dot_pos + 1, wstring::npos, extensions[i]);
@@ -941,6 +860,16 @@ bool PDBSourceLineWriter::GetSymbolFunctionName(IDiaSymbol *function,
fprintf(stderr, "failed to get function name\n");
return false;
}
+
+ // It's possible for get_name to return an empty string, so
+ // special-case that.
+ if (wcscmp(*name, L"") == 0) {
+ SysFreeString(*name);
+ // dwarf_cu_to_module.cc uses "<name omitted>", so match that.
+ *name = SysAllocString(L"<name omitted>");
+ return true;
+ }
+
// If a name comes from get_name because no undecorated form existed,
// it's already formatted properly to be used as output. Don't do any
// additional processing.
@@ -1079,12 +1008,15 @@ int PDBSourceLineWriter::GetFunctionStackParamSize(IDiaSymbol *function) {
goto next_child;
}
- int child_end = child_register_offset + static_cast<ULONG>(child_length);
- if (child_register_offset < lowest_base) {
- lowest_base = child_register_offset;
- }
- if (child_end > highest_end) {
- highest_end = child_end;
+ // Extra scope to avoid goto jumping over variable initialization
+ {
+ int child_end = child_register_offset + static_cast<ULONG>(child_length);
+ if (child_register_offset < lowest_base) {
+ lowest_base = child_register_offset;
+ }
+ if (child_end > highest_end) {
+ highest_end = child_end;
+ }
}
next_child:
@@ -1118,8 +1050,8 @@ next_child:
return param_size;
}
-bool PDBSourceLineWriter::WriteMap(FILE *map_file) {
- output_ = map_file;
+bool PDBSourceLineWriter::WriteSymbols(FILE *symbol_file) {
+ output_ = symbol_file;
// Load the OMAP information, and disable auto-translation of addresses in
// preference of doing it ourselves.
@@ -1141,7 +1073,9 @@ bool PDBSourceLineWriter::WriteMap(FILE *map_file) {
}
void PDBSourceLineWriter::Close() {
- session_.Release();
+ if (session_ != nullptr) {
+ session_.Release();
+ }
}
bool PDBSourceLineWriter::GetModuleInfo(PDBModuleInfo *info) {
@@ -1166,17 +1100,7 @@ bool PDBSourceLineWriter::GetModuleInfo(PDBModuleInfo *info) {
// Instead, it returns one of the IMAGE_FILE_MACHINE values as
// defined here:
// http://msdn.microsoft.com/en-us/library/ms680313%28VS.85%29.aspx
- switch (machine_type) {
- case IMAGE_FILE_MACHINE_I386:
- info->cpu = L"x86";
- break;
- case IMAGE_FILE_MACHINE_AMD64:
- info->cpu = L"x86_64";
- break;
- default:
- info->cpu = L"unknown";
- break;
- }
+ info->cpu = FileHeaderMachineToCpuString(static_cast<WORD>(machine_type));
} else {
// Unexpected, but handle gracefully.
info->cpu = L"unknown";
@@ -1199,35 +1123,14 @@ bool PDBSourceLineWriter::GetModuleInfo(PDBModuleInfo *info) {
return false;
}
- // Use the same format that the MS symbol server uses in filesystem
- // hierarchies.
- wchar_t age_string[9];
- swprintf(age_string, sizeof(age_string) / sizeof(age_string[0]),
- L"%x", age);
-
- // remove when VC++7.1 is no longer supported
- age_string[sizeof(age_string) / sizeof(age_string[0]) - 1] = L'\0';
-
- info->debug_identifier = GUIDString::GUIDToSymbolServerWString(&guid);
- info->debug_identifier.append(age_string);
+ info->debug_identifier = GenerateDebugIdentifier(age, guid);
} else {
DWORD signature;
if (FAILED(global->get_signature(&signature))) {
return false;
}
- // Use the same format that the MS symbol server uses in filesystem
- // hierarchies.
- wchar_t identifier_string[17];
- swprintf(identifier_string,
- sizeof(identifier_string) / sizeof(identifier_string[0]),
- L"%08X%x", signature, age);
-
- // remove when VC++7.1 is no longer supported
- identifier_string[sizeof(identifier_string) /
- sizeof(identifier_string[0]) - 1] = L'\0';
-
- info->debug_identifier = identifier_string;
+ info->debug_identifier = GenerateDebugIdentifier(age, signature);
}
CComBSTR debug_file_string;
@@ -1250,41 +1153,7 @@ bool PDBSourceLineWriter::GetPEInfo(PEModuleInfo *info) {
return false;
}
- // Convert wchar to native charset because ImageLoad only takes
- // a PSTR as input.
- string code_file;
- if (!WindowsStringUtils::safe_wcstombs(code_file_, &code_file)) {
- return false;
- }
-
- AutoImage img(ImageLoad((PSTR)code_file.c_str(), NULL));
- if (!img) {
- fprintf(stderr, "Failed to open PE file: %s\n", code_file.c_str());
- return false;
- }
-
- info->code_file = WindowsStringUtils::GetBaseName(code_file_);
-
- // The date and time that the file was created by the linker.
- DWORD TimeDateStamp = img->FileHeader->FileHeader.TimeDateStamp;
- // The size of the file in bytes, including all headers.
- DWORD SizeOfImage = 0;
- PIMAGE_OPTIONAL_HEADER64 opt =
- &((PIMAGE_NT_HEADERS64)img->FileHeader)->OptionalHeader;
- if (opt->Magic == IMAGE_NT_OPTIONAL_HDR64_MAGIC) {
- // 64-bit PE file.
- SizeOfImage = opt->SizeOfImage;
- } else {
- // 32-bit PE file.
- SizeOfImage = img->FileHeader->OptionalHeader.SizeOfImage;
- }
- wchar_t code_identifier[32];
- swprintf(code_identifier,
- sizeof(code_identifier) / sizeof(code_identifier[0]),
- L"%08X%X", TimeDateStamp, SizeOfImage);
- info->code_identifier = code_identifier;
-
- return true;
+ return ReadPEInfo(code_file_, info);
}
bool PDBSourceLineWriter::UsesGUID(bool *uses_guid) {
diff --git a/src/common/windows/pdb_source_line_writer.h b/src/common/windows/pdb_source_line_writer.h
index e9e89bb2..c0adf29f 100644
--- a/src/common/windows/pdb_source_line_writer.h
+++ b/src/common/windows/pdb_source_line_writer.h
@@ -35,9 +35,10 @@
#include <atlcomcli.h>
-#include <unordered_map>
#include <string>
+#include <unordered_map>
+#include "common/windows/module_info.h"
#include "common/windows/omap.h"
struct IDiaEnumLineNumbers;
@@ -49,41 +50,6 @@ namespace google_breakpad {
using std::wstring;
using std::unordered_map;
-// A structure that carries information that identifies a pdb file.
-struct PDBModuleInfo {
- public:
- // The basename of the pdb file from which information was loaded.
- wstring debug_file;
-
- // The pdb's identifier. For recent pdb files, the identifier consists
- // of the pdb's guid, in uppercase hexadecimal form without any dashes
- // or separators, followed immediately by the pdb's age, also in
- // uppercase hexadecimal form. For older pdb files which have no guid,
- // the identifier is the pdb's 32-bit signature value, in zero-padded
- // hexadecimal form, followed immediately by the pdb's age, in lowercase
- // hexadecimal form.
- wstring debug_identifier;
-
- // A string identifying the cpu that the pdb is associated with.
- // Currently, this may be "x86" or "unknown".
- wstring cpu;
-};
-
-// A structure that carries information that identifies a PE file,
-// either an EXE or a DLL.
-struct PEModuleInfo {
- // The basename of the PE file.
- wstring code_file;
-
- // The PE file's code identifier, which consists of its timestamp
- // and file size concatenated together into a single hex string.
- // (The fields IMAGE_OPTIONAL_HEADER::SizeOfImage and
- // IMAGE_FILE_HEADER::TimeDateStamp, as defined in the ImageHlp
- // documentation.) This is not well documented, if it's documented
- // at all, but it's what symstore does and what DbgHelp supports.
- wstring code_identifier;
-};
-
class PDBSourceLineWriter {
public:
enum FileFormat {
@@ -101,6 +67,9 @@ class PDBSourceLineWriter {
// Returns true on success.
bool Open(const wstring &file, FileFormat format);
+ // Closes the current pdb file and its associated resources.
+ void Close();
+
// Sets the code file full path. This is optional for 32-bit modules. It is
// also optional for 64-bit modules when there is an executable file stored
// in the same directory as the PDB file. It is only required for 64-bit
@@ -110,12 +79,9 @@ class PDBSourceLineWriter {
// SetCodeFile() with a different file path and it will return false.
bool SetCodeFile(const wstring &exe_file);
- // Writes a map file from the current pdb file to the given file stream.
+ // Writes a Breakpad symbol file from the current pdb file to |symbol_file|.
// Returns true on success.
- bool WriteMap(FILE *map_file);
-
- // Closes the current pdb file and its associated resources.
- void Close();
+ bool WriteSymbols(FILE *symbol_file);
// Retrieves information about the module's debugging file. Returns
// true on success and false on failure.
@@ -138,11 +104,12 @@ class PDBSourceLineWriter {
bool PrintLines(IDiaEnumLineNumbers *lines);
// Outputs a function address and name, followed by its source line list.
- // block can be the same object as function, or it can be a reference
- // to a code block that is lexically part of this function, but
- // resides at a separate address.
- // Returns true on success.
- bool PrintFunction(IDiaSymbol *function, IDiaSymbol *block);
+ // block can be the same object as function, or it can be a reference to a
+ // code block that is lexically part of this function, but resides at a
+ // separate address. If has_multiple_symbols is true, this function's
+ // instructions correspond to multiple symbols. Returns true on success.
+ bool PrintFunction(IDiaSymbol *function, IDiaSymbol *block,
+ bool has_multiple_symbols);
// Outputs all functions as described above. Returns true on success.
bool PrintFunctions();
@@ -167,8 +134,10 @@ class PDBSourceLineWriter {
// Outputs a single public symbol address and name, if the symbol corresponds
// to a code address. Returns true on success. If symbol is does not
- // correspond to code, returns true without outputting anything.
- bool PrintCodePublicSymbol(IDiaSymbol *symbol);
+ // correspond to code, returns true without outputting anything. If
+ // has_multiple_symbols is true, the symbol corresponds to a code address and
+ // the instructions correspond to multiple symbols.
+ bool PrintCodePublicSymbol(IDiaSymbol *symbol, bool has_multiple_symbols);
// Outputs a line identifying the PDB file that is being dumped, along with
// its uuid and age.
diff --git a/src/testing/gtest/test/gtest_color_test_.cc b/src/common/windows/pe_source_line_writer.cc
index f61ebb89..cb6cc713 100644
--- a/src/testing/gtest/test/gtest_color_test_.cc
+++ b/src/common/windows/pe_source_line_writer.cc
@@ -1,71 +1,77 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-// A helper program for testing how Google Test determines whether to use
-// colors in the output. It prints "YES" and returns 1 if Google Test
-// decides to use colors, and prints "NO" and returns 0 otherwise.
-
-#include <stdio.h>
-
-#include "gtest/gtest.h"
-
-// Indicates that this translation unit is part of Google Test's
-// implementation. It must come before gtest-internal-inl.h is
-// included, or there will be a compiler error. This trick is to
-// prevent a user from accidentally including gtest-internal-inl.h in
-// his code.
-#define GTEST_IMPLEMENTATION_ 1
-#include "src/gtest-internal-inl.h"
-#undef GTEST_IMPLEMENTATION_
-
-using testing::internal::ShouldUseColor;
-
-// The purpose of this is to ensure that the UnitTest singleton is
-// created before main() is entered, and thus that ShouldUseColor()
-// works the same way as in a real Google-Test-based test. We don't actual
-// run the TEST itself.
-TEST(GTestColorTest, Dummy) {
-}
-
-int main(int argc, char** argv) {
- testing::InitGoogleTest(&argc, argv);
-
- if (ShouldUseColor(true)) {
- // Google Test decides to use colors in the output (assuming it
- // goes to a TTY).
- printf("YES\n");
- return 1;
- } else {
- // Google Test decides not to use colors in the output.
- printf("NO\n");
- return 0;
- }
-}
+// Copyright (c) 2019, Google Inc.
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#include "common/windows/pe_source_line_writer.h"
+
+#include "common/windows/pe_util.h"
+
+namespace google_breakpad {
+PESourceLineWriter::PESourceLineWriter(const wstring& pe_file) :
+ pe_file_(pe_file) {
+}
+
+PESourceLineWriter::~PESourceLineWriter() {
+}
+
+bool PESourceLineWriter::WriteSymbols(FILE* symbol_file) {
+ PDBModuleInfo module_info;
+ if (!GetModuleInfo(&module_info)) {
+ return false;
+ }
+ // Hard-code "windows" for the OS because that's the only thing that makes
+ // sense for PDB files. (This might not be strictly correct for Windows CE
+ // support, but we don't care about that at the moment.)
+ fprintf(symbol_file, "MODULE windows %ws %ws %ws\n",
+ module_info.cpu.c_str(), module_info.debug_identifier.c_str(),
+ module_info.debug_file.c_str());
+
+ PEModuleInfo pe_info;
+ if (!GetPEInfo(&pe_info)) {
+ return false;
+ }
+ fprintf(symbol_file, "INFO CODE_ID %ws %ws\n",
+ pe_info.code_identifier.c_str(),
+ pe_info.code_file.c_str());
+
+ if (!PrintPEFrameData(pe_file_, symbol_file)) {
+ return false;
+ }
+
+ return true;
+}
+
+bool PESourceLineWriter::GetModuleInfo(PDBModuleInfo* info) {
+ return ReadModuleInfo(pe_file_, info);
+}
+
+bool PESourceLineWriter::GetPEInfo(PEModuleInfo* info) {
+ return ReadPEInfo(pe_file_, info);
+}
+
+} // namespace google_breakpad
diff --git a/src/testing/gtest/xcode/Samples/FrameworkSample/widget_test.cc b/src/common/windows/pe_source_line_writer.h
index 87259942..2bf1d4fd 100644
--- a/src/testing/gtest/xcode/Samples/FrameworkSample/widget_test.cc
+++ b/src/common/windows/pe_source_line_writer.h
@@ -1,68 +1,69 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: preston.a.jackson@gmail.com (Preston Jackson)
-//
-// Google Test - FrameworkSample
-// widget_test.cc
-//
-
-// This is a simple test file for the Widget class in the Widget.framework
-
-#include <string>
-#include "gtest/gtest.h"
-
-#include <Widget/widget.h>
-
-// This test verifies that the constructor sets the internal state of the
-// Widget class correctly.
-TEST(WidgetInitializerTest, TestConstructor) {
- Widget widget(1.0f, "name");
- EXPECT_FLOAT_EQ(1.0f, widget.GetFloatValue());
- EXPECT_EQ(std::string("name"), widget.GetStringValue());
-}
-
-// This test verifies the conversion of the float and string values to int and
-// char*, respectively.
-TEST(WidgetInitializerTest, TestConversion) {
- Widget widget(1.0f, "name");
- EXPECT_EQ(1, widget.GetIntValue());
-
- size_t max_size = 128;
- char buffer[max_size];
- widget.GetCharPtrValue(buffer, max_size);
- EXPECT_STREQ("name", buffer);
-}
-
-// Use the Google Test main that is linked into the framework. It does something
-// like this:
-// int main(int argc, char** argv) {
-// testing::InitGoogleTest(&argc, argv);
-// return RUN_ALL_TESTS();
-// }
+// Copyright (c) 2019, Google Inc.
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef COMMON_WINDOWS_PE_SOURCE_LINE_WRITER_H_
+#define COMMON_WINDOWS_PE_SOURCE_LINE_WRITER_H_
+
+#include <string>
+
+#include "common/basictypes.h"
+#include "common/windows/module_info.h"
+
+namespace google_breakpad {
+
+using std::wstring;
+
+// PESourceLineWriter uses a pe file produced by Visual C++ to output
+// a line/address map for use with BasicSourceLineResolver.
+// NOTE: Only supports PE32+ format, ie. a 64bit PE file.
+class PESourceLineWriter {
+public:
+ explicit PESourceLineWriter(const wstring& pe_file);
+ ~PESourceLineWriter();
+
+ // Writes Breakpad symbols from the pe file to |symbol_file|.
+ // Returns true on success.
+ bool WriteSymbols(FILE* symbol_file);
+
+ // Retrieves information about the module. Returns true on success.
+ bool GetModuleInfo(PDBModuleInfo* info);
+
+ // Retrieves information about the module's PE file. Returns
+ // true on success.
+ bool GetPEInfo(PEModuleInfo* info);
+
+private:
+ const wstring pe_file_;
+
+ DISALLOW_COPY_AND_ASSIGN(PESourceLineWriter);
+};
+
+} // namespace google_breakpad
+
+#endif // COMMON_WINDOWS_PE_SOURCE_LINE_WRITER_H_
diff --git a/src/common/windows/pe_util.cc b/src/common/windows/pe_util.cc
new file mode 100644
index 00000000..6fa63fa3
--- /dev/null
+++ b/src/common/windows/pe_util.cc
@@ -0,0 +1,407 @@
+// Copyright (c) 2019, Google Inc.
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#include "pe_util.h"
+
+#include <windows.h>
+#include <winnt.h>
+#include <atlbase.h>
+#include <ImageHlp.h>
+
+#include <functional>
+
+#include "common/windows/string_utils-inl.h"
+#include "common/windows/guid_string.h"
+
+namespace {
+
+/*
+ * Not defined in WinNT.h for some reason. Definitions taken from:
+ * http://uninformed.org/index.cgi?v=4&a=1&p=13
+ *
+ */
+typedef unsigned char UBYTE;
+
+#if !defined(_WIN64)
+#define UNW_FLAG_EHANDLER 0x01
+#define UNW_FLAG_UHANDLER 0x02
+#define UNW_FLAG_CHAININFO 0x04
+#endif
+
+union UnwindCode {
+ struct {
+ UBYTE offset_in_prolog;
+ UBYTE unwind_operation_code : 4;
+ UBYTE operation_info : 4;
+ };
+ USHORT frame_offset;
+};
+
+enum UnwindOperationCodes {
+ UWOP_PUSH_NONVOL = 0, /* info == register number */
+ UWOP_ALLOC_LARGE, /* no info, alloc size in next 2 slots */
+ UWOP_ALLOC_SMALL, /* info == size of allocation / 8 - 1 */
+ UWOP_SET_FPREG, /* no info, FP = RSP + UNWIND_INFO.FPRegOffset*16 */
+ UWOP_SAVE_NONVOL, /* info == register number, offset in next slot */
+ UWOP_SAVE_NONVOL_FAR, /* info == register number, offset in next 2 slots */
+ // XXX: these are missing from MSDN!
+ // See: http://www.osronline.com/ddkx/kmarch/64bitamd_4rs7.htm
+ UWOP_SAVE_XMM,
+ UWOP_SAVE_XMM_FAR,
+ UWOP_SAVE_XMM128, /* info == XMM reg number, offset in next slot */
+ UWOP_SAVE_XMM128_FAR, /* info == XMM reg number, offset in next 2 slots */
+ UWOP_PUSH_MACHFRAME /* info == 0: no error-code, 1: error-code */
+};
+
+// See: http://msdn.microsoft.com/en-us/library/ddssxxy8.aspx
+// Note: some fields removed as we don't use them.
+struct UnwindInfo {
+ UBYTE version : 3;
+ UBYTE flags : 5;
+ UBYTE size_of_prolog;
+ UBYTE count_of_codes;
+ UBYTE frame_register : 4;
+ UBYTE frame_offset : 4;
+ UnwindCode unwind_code[1];
+};
+
+struct CV_INFO_PDB70 {
+ ULONG cv_signature;
+ GUID signature;
+ ULONG age;
+ CHAR pdb_filename[ANYSIZE_ARRAY];
+};
+
+#define CV_SIGNATURE_RSDS 'SDSR'
+
+// A helper class to scope a PLOADED_IMAGE.
+class AutoImage {
+public:
+ explicit AutoImage(PLOADED_IMAGE img) : img_(img) {}
+ ~AutoImage() {
+ if (img_)
+ ImageUnload(img_);
+ }
+
+ operator PLOADED_IMAGE() { return img_; }
+ PLOADED_IMAGE operator->() { return img_; }
+
+private:
+ PLOADED_IMAGE img_;
+};
+} // namespace
+
+namespace google_breakpad {
+
+using std::unique_ptr;
+using google_breakpad::GUIDString;
+
+bool ReadModuleInfo(const wstring & pe_file, PDBModuleInfo * info) {
+ // Convert wchar to native charset because ImageLoad only takes
+ // a PSTR as input.
+ string img_file;
+ if (!WindowsStringUtils::safe_wcstombs(pe_file, &img_file)) {
+ fprintf(stderr, "Image path '%S' contains unrecognized characters.\n",
+ pe_file.c_str());
+ return false;
+ }
+
+ AutoImage img(ImageLoad((PSTR)img_file.c_str(), NULL));
+ if (!img) {
+ fprintf(stderr, "Failed to load %s\n", img_file.c_str());
+ return false;
+ }
+
+ info->cpu = FileHeaderMachineToCpuString(
+ img->FileHeader->FileHeader.Machine);
+
+ PIMAGE_OPTIONAL_HEADER64 optional_header =
+ &(reinterpret_cast<PIMAGE_NT_HEADERS64>(img->FileHeader))->OptionalHeader;
+
+ // Search debug directories for a guid signature & age
+ DWORD debug_rva = optional_header->
+ DataDirectory[IMAGE_DIRECTORY_ENTRY_DEBUG].VirtualAddress;
+ DWORD debug_size = optional_header->
+ DataDirectory[IMAGE_DIRECTORY_ENTRY_DEBUG].Size;
+ PIMAGE_DEBUG_DIRECTORY debug_directories =
+ static_cast<PIMAGE_DEBUG_DIRECTORY>(
+ ImageRvaToVa(img->FileHeader,
+ img->MappedAddress,
+ debug_rva,
+ &img->LastRvaSection));
+
+ for (DWORD i = 0; i < debug_size / sizeof(*debug_directories); i++) {
+ if (debug_directories[i].Type != IMAGE_DEBUG_TYPE_CODEVIEW ||
+ debug_directories[i].SizeOfData < sizeof(CV_INFO_PDB70)) {
+ continue;
+ }
+
+ struct CV_INFO_PDB70* cv_info = static_cast<CV_INFO_PDB70*>(ImageRvaToVa(
+ img->FileHeader,
+ img->MappedAddress,
+ debug_directories[i].AddressOfRawData,
+ &img->LastRvaSection));
+ if (cv_info->cv_signature != CV_SIGNATURE_RSDS) {
+ continue;
+ }
+
+ info->debug_identifier = GenerateDebugIdentifier(cv_info->age,
+ cv_info->signature);
+
+ // This code assumes that the pdb_filename is stored as ASCII without
+ // multibyte characters, but it's not clear if that's true.
+ size_t debug_file_length = strnlen_s(cv_info->pdb_filename, MAX_PATH);
+ if (debug_file_length < 0 || debug_file_length >= MAX_PATH) {
+ fprintf(stderr, "PE debug directory is corrupt.\n");
+ return false;
+ }
+ std::string debug_file(cv_info->pdb_filename, debug_file_length);
+ if (!WindowsStringUtils::safe_mbstowcs(debug_file, &info->debug_file)) {
+ fprintf(stderr, "PDB filename '%s' contains unrecognized characters.\n",
+ debug_file.c_str());
+ return false;
+ }
+ info->debug_file = WindowsStringUtils::GetBaseName(info->debug_file);
+
+ return true;
+ }
+
+ fprintf(stderr, "Image is missing debug information.\n");
+ return false;
+}
+
+bool ReadPEInfo(const wstring & pe_file, PEModuleInfo * info) {
+ // Convert wchar to native charset because ImageLoad only takes
+ // a PSTR as input.
+ string img_file;
+ if (!WindowsStringUtils::safe_wcstombs(pe_file, &img_file)) {
+ fprintf(stderr, "Image path '%S' contains unrecognized characters.\n",
+ pe_file.c_str());
+ return false;
+ }
+
+ AutoImage img(ImageLoad((PSTR)img_file.c_str(), NULL));
+ if (!img) {
+ fprintf(stderr, "Failed to open PE file: %S\n", pe_file.c_str());
+ return false;
+ }
+
+ info->code_file = WindowsStringUtils::GetBaseName(pe_file);
+
+ // The date and time that the file was created by the linker.
+ DWORD TimeDateStamp = img->FileHeader->FileHeader.TimeDateStamp;
+ // The size of the file in bytes, including all headers.
+ DWORD SizeOfImage = 0;
+ PIMAGE_OPTIONAL_HEADER64 opt =
+ &((PIMAGE_NT_HEADERS64)img->FileHeader)->OptionalHeader;
+ if (opt->Magic == IMAGE_NT_OPTIONAL_HDR64_MAGIC) {
+ // 64-bit PE file.
+ SizeOfImage = opt->SizeOfImage;
+ }
+ else {
+ // 32-bit PE file.
+ SizeOfImage = img->FileHeader->OptionalHeader.SizeOfImage;
+ }
+ wchar_t code_identifier[32];
+ swprintf(code_identifier,
+ sizeof(code_identifier) / sizeof(code_identifier[0]),
+ L"%08X%X", TimeDateStamp, SizeOfImage);
+ info->code_identifier = code_identifier;
+
+ return true;
+}
+
+bool PrintPEFrameData(const wstring & pe_file, FILE * out_file)
+{
+ // Convert wchar to native charset because ImageLoad only takes
+ // a PSTR as input.
+ string img_file;
+ if (!WindowsStringUtils::safe_wcstombs(pe_file, &img_file)) {
+ fprintf(stderr, "Image path '%S' contains unrecognized characters.\n",
+ pe_file.c_str());
+ return false;
+ }
+
+ AutoImage img(ImageLoad((PSTR)img_file.c_str(), NULL));
+ if (!img) {
+ fprintf(stderr, "Failed to load %s\n", img_file.c_str());
+ return false;
+ }
+ PIMAGE_OPTIONAL_HEADER64 optional_header =
+ &(reinterpret_cast<PIMAGE_NT_HEADERS64>(img->FileHeader))->OptionalHeader;
+ if (optional_header->Magic != IMAGE_NT_OPTIONAL_HDR64_MAGIC) {
+ fprintf(stderr, "Not a PE32+ image\n");
+ return false;
+ }
+
+ // Read Exception Directory
+ DWORD exception_rva = optional_header->
+ DataDirectory[IMAGE_DIRECTORY_ENTRY_EXCEPTION].VirtualAddress;
+ DWORD exception_size = optional_header->
+ DataDirectory[IMAGE_DIRECTORY_ENTRY_EXCEPTION].Size;
+ PIMAGE_RUNTIME_FUNCTION_ENTRY funcs =
+ static_cast<PIMAGE_RUNTIME_FUNCTION_ENTRY>(
+ ImageRvaToVa(img->FileHeader,
+ img->MappedAddress,
+ exception_rva,
+ &img->LastRvaSection));
+ for (DWORD i = 0; i < exception_size / sizeof(*funcs); i++) {
+ DWORD unwind_rva = funcs[i].UnwindInfoAddress;
+ // handle chaining
+ while (unwind_rva & 0x1) {
+ unwind_rva ^= 0x1;
+ PIMAGE_RUNTIME_FUNCTION_ENTRY chained_func =
+ static_cast<PIMAGE_RUNTIME_FUNCTION_ENTRY>(
+ ImageRvaToVa(img->FileHeader,
+ img->MappedAddress,
+ unwind_rva,
+ &img->LastRvaSection));
+ unwind_rva = chained_func->UnwindInfoAddress;
+ }
+
+ UnwindInfo *unwind_info = static_cast<UnwindInfo *>(
+ ImageRvaToVa(img->FileHeader,
+ img->MappedAddress,
+ unwind_rva,
+ &img->LastRvaSection));
+
+ DWORD stack_size = 8; // minimal stack size is 8 for RIP
+ DWORD rip_offset = 8;
+ do {
+ for (UBYTE c = 0; c < unwind_info->count_of_codes; c++) {
+ UnwindCode *unwind_code = &unwind_info->unwind_code[c];
+ switch (unwind_code->unwind_operation_code) {
+ case UWOP_PUSH_NONVOL: {
+ stack_size += 8;
+ break;
+ }
+ case UWOP_ALLOC_LARGE: {
+ if (unwind_code->operation_info == 0) {
+ c++;
+ if (c < unwind_info->count_of_codes)
+ stack_size += (unwind_code + 1)->frame_offset * 8;
+ }
+ else {
+ c += 2;
+ if (c < unwind_info->count_of_codes)
+ stack_size += (unwind_code + 1)->frame_offset |
+ ((unwind_code + 2)->frame_offset << 16);
+ }
+ break;
+ }
+ case UWOP_ALLOC_SMALL: {
+ stack_size += unwind_code->operation_info * 8 + 8;
+ break;
+ }
+ case UWOP_SET_FPREG:
+ case UWOP_SAVE_XMM:
+ case UWOP_SAVE_XMM_FAR:
+ break;
+ case UWOP_SAVE_NONVOL:
+ case UWOP_SAVE_XMM128: {
+ c++; // skip slot with offset
+ break;
+ }
+ case UWOP_SAVE_NONVOL_FAR:
+ case UWOP_SAVE_XMM128_FAR: {
+ c += 2; // skip 2 slots with offset
+ break;
+ }
+ case UWOP_PUSH_MACHFRAME: {
+ if (unwind_code->operation_info) {
+ stack_size += 88;
+ }
+ else {
+ stack_size += 80;
+ }
+ rip_offset += 80;
+ break;
+ }
+ }
+ }
+ if (unwind_info->flags & UNW_FLAG_CHAININFO) {
+ PIMAGE_RUNTIME_FUNCTION_ENTRY chained_func =
+ reinterpret_cast<PIMAGE_RUNTIME_FUNCTION_ENTRY>(
+ (unwind_info->unwind_code +
+ ((unwind_info->count_of_codes + 1) & ~1)));
+
+ unwind_info = static_cast<UnwindInfo *>(
+ ImageRvaToVa(img->FileHeader,
+ img->MappedAddress,
+ chained_func->UnwindInfoAddress,
+ &img->LastRvaSection));
+ }
+ else {
+ unwind_info = NULL;
+ }
+ } while (unwind_info);
+ fprintf(out_file, "STACK CFI INIT %lx %lx .cfa: $rsp .ra: .cfa %lu - ^\n",
+ funcs[i].BeginAddress,
+ funcs[i].EndAddress - funcs[i].BeginAddress, rip_offset);
+ fprintf(out_file, "STACK CFI %lx .cfa: $rsp %lu +\n",
+ funcs[i].BeginAddress, stack_size);
+ }
+
+ return true;
+}
+
+wstring GenerateDebugIdentifier(DWORD age, GUID signature)
+{
+ // Use the same format that the MS symbol server uses in filesystem
+ // hierarchies.
+ wchar_t age_string[9];
+ swprintf(age_string, sizeof(age_string) / sizeof(age_string[0]),
+ L"%x", age);
+
+ // remove when VC++7.1 is no longer supported
+ age_string[sizeof(age_string) / sizeof(age_string[0]) - 1] = L'\0';
+
+ wstring debug_identifier = GUIDString::GUIDToSymbolServerWString(&signature);
+ debug_identifier.append(age_string);
+
+ return debug_identifier;
+}
+
+wstring GenerateDebugIdentifier(DWORD age, DWORD signature)
+{
+ // Use the same format that the MS symbol server uses in filesystem
+ // hierarchies.
+ wchar_t identifier_string[17];
+ swprintf(identifier_string,
+ sizeof(identifier_string) / sizeof(identifier_string[0]),
+ L"%08X%x", signature, age);
+
+ // remove when VC++7.1 is no longer supported
+ identifier_string[sizeof(identifier_string) /
+ sizeof(identifier_string[0]) - 1] = L'\0';
+
+ return wstring(identifier_string);
+}
+
+} // namespace google_breakpad
diff --git a/src/common/windows/pe_util.h b/src/common/windows/pe_util.h
new file mode 100644
index 00000000..634ba293
--- /dev/null
+++ b/src/common/windows/pe_util.h
@@ -0,0 +1,78 @@
+// Copyright (c) 2019, Google Inc.
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef COMMON_WINDOWS_PE_UTIL_H_
+#define COMMON_WINDOWS_PE_UTIL_H_
+
+#include <windows.h>
+
+#include "common/windows/module_info.h"
+
+namespace google_breakpad {
+
+using std::wstring;
+
+// Reads |pe_file| and populates |info|. Returns true on success.
+// Only supports PE32+ format, ie. a 64bit PE file.
+// Will fail if |pe_file| does not contain a valid CodeView record.
+bool ReadModuleInfo(const wstring& pe_file, PDBModuleInfo* info);
+
+// Reads |pe_file| and populates |info|. Returns true on success.
+bool ReadPEInfo(const wstring& pe_file, PEModuleInfo* info);
+
+// Reads |pe_file| and prints frame data (aka. unwind info) to |out_file|.
+// Only supports PE32+ format, ie. a 64bit PE file.
+bool PrintPEFrameData(const wstring& pe_file, FILE* out_file);
+
+// Combines a GUID |signature| and DWORD |age| to create a Breakpad debug
+// identifier.
+wstring GenerateDebugIdentifier(DWORD age, GUID signature);
+
+// Combines a DWORD |signature| and DWORD |age| to create a Breakpad debug
+// identifier.
+wstring GenerateDebugIdentifier(DWORD age, DWORD signature);
+
+// Converts |machine| enum value to the corresponding string used by Breakpad.
+// The enum is IMAGE_FILE_MACHINE_*, contained in winnt.h.
+constexpr const wchar_t* FileHeaderMachineToCpuString(WORD machine) {
+ switch (machine) {
+ case IMAGE_FILE_MACHINE_I386: {
+ return L"x86";
+ }
+ case IMAGE_FILE_MACHINE_IA64:
+ case IMAGE_FILE_MACHINE_AMD64: {
+ return L"x86_64";
+ }
+ default: { return L"unknown"; }
+ }
+}
+
+} // namespace google_breakpad
+
+#endif // COMMON_WINDOWS_PE_UTIL_H_
diff --git a/src/common/windows/symbol_collector_client.cc b/src/common/windows/symbol_collector_client.cc
new file mode 100644
index 00000000..30c663ed
--- /dev/null
+++ b/src/common/windows/symbol_collector_client.cc
@@ -0,0 +1,155 @@
+#include "common/windows/symbol_collector_client.h"
+
+#include <stdio.h>
+
+#include <regex>
+
+#include "common/windows/http_upload.h"
+
+namespace google_breakpad {
+
+ // static
+ bool SymbolCollectorClient::CreateUploadUrl(
+ wstring& api_url,
+ wstring& api_key,
+ UploadUrlResponse *uploadUrlResponse) {
+ wstring url = api_url +
+ L"/v1/uploads:create"
+ L"?key=" + api_key;
+ wstring response;
+ int response_code;
+
+ if (!HTTPUpload::SendSimplePostRequest(
+ url,
+ L"",
+ L"",
+ NULL,
+ &response,
+ &response_code)) {
+ wprintf(L"Failed to create upload url.\n");
+ wprintf(L"Response code: %ld\n", response_code);
+ wprintf(L"Response:\n");
+ wprintf(L"%s\n", response.c_str());
+ return false;
+ }
+
+ // Note camel-case rather than underscores.
+ std::wregex upload_url_regex(L"\"uploadUrl\": \"([^\"]+)\"");
+ std::wregex upload_key_regex(L"\"uploadKey\": \"([^\"]+)\"");
+
+ std::wsmatch upload_url_match;
+ if (!std::regex_search(response, upload_url_match, upload_url_regex) ||
+ upload_url_match.size() != 2) {
+ wprintf(L"Failed to parse create url response.");
+ wprintf(L"Response:\n");
+ wprintf(L"%s\n", response.c_str());
+ return false;
+ }
+ wstring upload_url = upload_url_match[1].str();
+
+ std::wsmatch upload_key_match;
+ if (!std::regex_search(response, upload_key_match, upload_key_regex) ||
+ upload_key_match.size() != 2) {
+ wprintf(L"Failed to parse create url response.");
+ wprintf(L"Response:\n");
+ wprintf(L"%s\n", response.c_str());
+ return false;
+ }
+ wstring upload_key = upload_key_match[1].str();
+
+ uploadUrlResponse->upload_url = upload_url;
+ uploadUrlResponse->upload_key = upload_key;
+ return true;
+ }
+
+ // static
+ CompleteUploadResult SymbolCollectorClient::CompleteUpload(
+ wstring& api_url,
+ wstring& api_key,
+ const wstring& upload_key,
+ const wstring& debug_file,
+ const wstring& debug_id) {
+ wstring url = api_url +
+ L"/v1/uploads/" + upload_key + L":complete"
+ L"?key=" + api_key;
+ wstring body =
+ L"{ symbol_id: {"
+ L"debug_file: \"" + debug_file + L"\", "
+ L"debug_id: \"" + debug_id + L"\" "
+ L"} }";
+ wstring response;
+ int response_code;
+
+ if (!HTTPUpload::SendSimplePostRequest(
+ url,
+ body,
+ L"application/json",
+ NULL,
+ &response,
+ &response_code)) {
+ wprintf(L"Failed to complete upload.\n");
+ wprintf(L"Response code: %ld\n", response_code);
+ wprintf(L"Response:\n");
+ wprintf(L"%s\n", response.c_str());
+ return CompleteUploadResult::Error;
+ }
+
+ std::wregex result_regex(L"\"result\": \"([^\"]+)\"");
+ std::wsmatch result_match;
+ if (!std::regex_search(response, result_match, result_regex) ||
+ result_match.size() != 2) {
+ wprintf(L"Failed to parse complete upload response.");
+ wprintf(L"Response:\n");
+ wprintf(L"%s\n", response.c_str());
+ return CompleteUploadResult::Error;
+ }
+ wstring result = result_match[1].str();
+
+ if (result.compare(L"DUPLICATE_DATA") == 0) {
+ return CompleteUploadResult::DuplicateData;
+ }
+
+ return CompleteUploadResult::Ok;
+ }
+
+ // static
+ SymbolStatus SymbolCollectorClient::CheckSymbolStatus(
+ wstring& api_url,
+ wstring& api_key,
+ const wstring& debug_file,
+ const wstring& debug_id) {
+ wstring response;
+ int response_code;
+ wstring url = api_url +
+ L"/v1/symbols/" + debug_file + L"/" + debug_id + L":checkStatus"
+ L"?key=" + api_key;
+
+ if (!HTTPUpload::SendGetRequest(
+ url,
+ NULL,
+ &response,
+ &response_code)) {
+ wprintf(L"Failed to check symbol status.\n");
+ wprintf(L"Response code: %ld\n", response_code);
+ wprintf(L"Response:\n");
+ wprintf(L"%s\n", response.c_str());
+ return SymbolStatus::Unknown;
+ }
+
+ std::wregex status_regex(L"\"status\": \"([^\"]+)\"");
+ std::wsmatch status_match;
+ if (!std::regex_search(response, status_match, status_regex) ||
+ status_match.size() != 2) {
+ wprintf(L"Failed to parse check symbol status response.");
+ wprintf(L"Response:\n");
+ wprintf(L"%s\n", response.c_str());
+ return SymbolStatus::Unknown;
+ }
+ wstring status = status_match[1].str();
+
+ return (status.compare(L"FOUND") == 0) ?
+ SymbolStatus::Found :
+ SymbolStatus::Missing;
+ }
+
+} // namespace google_breakpad \ No newline at end of file
diff --git a/src/common/windows/symbol_collector_client.h b/src/common/windows/symbol_collector_client.h
new file mode 100644
index 00000000..30e0cb32
--- /dev/null
+++ b/src/common/windows/symbol_collector_client.h
@@ -0,0 +1,89 @@
+// Copyright (c) 2019, Google Inc.
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef COMMON_WINDOWS_SYMBOL_COLLECTOR_CLIENT_H_
+#define COMMON_WINDOWS_SYMBOL_COLLECTOR_CLIENT_H_
+
+#include <string>
+
+namespace google_breakpad {
+
+ using std::wstring;
+
+ struct UploadUrlResponse {
+ // URL at which to HTTP PUT symbol file.
+ wstring upload_url;
+ // Unique key used to complete upload of symbol file.
+ wstring upload_key;
+ };
+
+ enum SymbolStatus {
+ Found,
+ Missing,
+ Unknown
+ };
+
+ enum CompleteUploadResult {
+ Ok,
+ DuplicateData,
+ Error
+ };
+
+ // Client to interact with sym-upload-v2 API server via HTTP/REST.
+ class SymbolCollectorClient {
+ public:
+ // Returns a URL at which a symbol file can be HTTP PUT without
+ // authentication, along with an upload key that can be used to
+ // complete the upload process with CompleteUpload.
+ static bool CreateUploadUrl(
+ wstring& api_url,
+ wstring& api_key,
+ UploadUrlResponse *uploadUrlResponse);
+
+ // Notify the API that symbol file upload is finished and its contents
+ // are ready to be read and/or used for further processing.
+ static CompleteUploadResult CompleteUpload(
+ wstring& api_url,
+ wstring& api_key,
+ const wstring& upload_key,
+ const wstring& debug_file,
+ const wstring& debug_id);
+
+ // Returns whether or not a symbol file corresponding to the debug_file/
+ // debug_id pair is already present in symbol storage.
+ static SymbolStatus CheckSymbolStatus(
+ wstring& api_url,
+ wstring& api_key,
+ const wstring& debug_file,
+ const wstring& debug_id);
+ };
+
+} // namespace google_breakpad
+
+#endif // COMMON_WINDOWS_SYMBOL_COLLECTOR_CLIENT_H_
diff --git a/src/config.h.in b/src/config.h.in
index 1db01593..0553a24b 100644
--- a/src/config.h.in
+++ b/src/config.h.in
@@ -1,8 +1,20 @@
/* src/config.h.in. Generated from configure.ac by autoheader. */
+/* Define to 1 if you have the `arc4random' function. */
+#undef HAVE_ARC4RANDOM
+
/* Define to 1 if you have the <a.out.h> header file. */
#undef HAVE_A_OUT_H
+/* define if the compiler supports basic C++11 syntax */
+#undef HAVE_CXX11
+
+/* Define to 1 if you have the `getcontext' function. */
+#undef HAVE_GETCONTEXT
+
+/* Define to 1 if you have the `getrandom' function. */
+#undef HAVE_GETRANDOM
+
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
@@ -24,6 +36,9 @@
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
+/* Define to 1 if you have the <sys/random.h> header file. */
+#undef HAVE_SYS_RANDOM_H
+
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
@@ -33,6 +48,9 @@
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
+/* Fallback definition for old systems */
+#undef O_CLOEXEC
+
/* Name of package */
#undef PACKAGE
diff --git a/src/google_breakpad/common/breakpad_types.h b/src/google_breakpad/common/breakpad_types.h
index e92436ff..d8828043 100644
--- a/src/google_breakpad/common/breakpad_types.h
+++ b/src/google_breakpad/common/breakpad_types.h
@@ -40,35 +40,17 @@
#ifndef GOOGLE_BREAKPAD_COMMON_BREAKPAD_TYPES_H__
#define GOOGLE_BREAKPAD_COMMON_BREAKPAD_TYPES_H__
-#ifndef _WIN32
+#if (defined(_INTTYPES_H) || defined(_INTTYPES_H_)) && \
+ !defined(__STDC_FORMAT_MACROS)
+#error "inttypes.h has already been included before this header file, but "
+#error "without __STDC_FORMAT_MACROS defined."
+#endif
#ifndef __STDC_FORMAT_MACROS
#define __STDC_FORMAT_MACROS
#endif /* __STDC_FORMAT_MACROS */
#include <inttypes.h>
-#else /* !_WIN32 */
-
-#if _MSC_VER >= 1600
-#include <stdint.h>
-#elif defined(BREAKPAD_CUSTOM_STDINT_H)
-/* Visual C++ Pre-2010 did not ship a stdint.h, so allow
- * consumers of this library to provide their own because
- * there are often subtle type incompatibilities.
- */
-#include BREAKPAD_CUSTOM_STDINT_H
-#else
-#include <wtypes.h>
-
-typedef unsigned __int8 uint8_t;
-typedef unsigned __int16 uint16_t;
-typedef __int32 int32_t;
-typedef unsigned __int32 uint32_t;
-typedef unsigned __int64 uint64_t;
-#endif
-
-#endif /* !_WIN32 */
-
typedef struct {
uint64_t high;
uint64_t low;
diff --git a/src/google_breakpad/common/minidump_cpu_arm64.h b/src/google_breakpad/common/minidump_cpu_arm64.h
index 5ace0d9d..0411bebb 100644
--- a/src/google_breakpad/common/minidump_cpu_arm64.h
+++ b/src/google_breakpad/common/minidump_cpu_arm64.h
@@ -66,7 +66,61 @@
#ifndef GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_ARM64_H__
#define GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_ARM64_H__
+#include "google_breakpad/common/breakpad_types.h"
+
#define MD_FLOATINGSAVEAREA_ARM64_FPR_COUNT 32
+#define MD_CONTEXT_ARM64_GPR_COUNT 33
+
+typedef struct {
+ /* 32 128-bit floating point registers, d0 .. d31. */
+ uint128_struct regs[MD_FLOATINGSAVEAREA_ARM64_FPR_COUNT];
+
+ uint32_t fpcr; /* FPU control register */
+ uint32_t fpsr; /* FPU status register */
+} MDFloatingSaveAreaARM64;
+
+/* For (MDRawContextARM64).context_flags. These values indicate the type of
+ * context stored in the structure. */
+#define MD_CONTEXT_ARM64 0x00400000
+#define MD_CONTEXT_ARM64_CONTROL (MD_CONTEXT_ARM64 | 0x00000001)
+#define MD_CONTEXT_ARM64_INTEGER (MD_CONTEXT_ARM64 | 0x00000002)
+#define MD_CONTEXT_ARM64_FLOATING_POINT (MD_CONTEXT_ARM64 | 0x00000004)
+#define MD_CONTEXT_ARM64_DEBUG (MD_CONTEXT_ARM64 | 0x00000008)
+#define MD_CONTEXT_ARM64_FULL (MD_CONTEXT_ARM64_CONTROL | \
+ MD_CONTEXT_ARM64_INTEGER | \
+ MD_CONTEXT_ARM64_FLOATING_POINT)
+#define MD_CONTEXT_ARM64_ALL (MD_CONTEXT_ARM64_FULL | MD_CONTEXT_ARM64_DEBUG)
+
+typedef struct {
+ /* Determines which fields of this struct are populated */
+ uint32_t context_flags;
+
+ /* CPSR (flags, basically): 32 bits:
+ bit 31 - N (negative)
+ bit 30 - Z (zero)
+ bit 29 - C (carry)
+ bit 28 - V (overflow)
+ bit 27 - Q (saturation flag, sticky)
+ All other fields -- ignore */
+ uint32_t cpsr;
+
+ /* 33 64-bit integer registers, x0 .. x31 + the PC
+ * Note the following fixed uses:
+ * x29 is the frame pointer
+ * x30 is the link register
+ * x31 is the stack pointer
+ * The PC is effectively x32.
+ */
+ uint64_t iregs[MD_CONTEXT_ARM64_GPR_COUNT];
+
+ /* The next field is included with MD_CONTEXT64_ARM_FLOATING_POINT */
+ MDFloatingSaveAreaARM64 float_save;
+
+ uint32_t bcr[8];
+ uint64_t bvr[8];
+ uint32_t wcr[2];
+ uint64_t wvr[2];
+} MDRawContextARM64;
typedef struct {
uint32_t fpsr; /* FPU status register */
@@ -74,9 +128,7 @@ typedef struct {
/* 32 128-bit floating point registers, d0 .. d31. */
uint128_struct regs[MD_FLOATINGSAVEAREA_ARM64_FPR_COUNT];
-} MDFloatingSaveAreaARM64;
-
-#define MD_CONTEXT_ARM64_GPR_COUNT 33
+} MDFloatingSaveAreaARM64_Old;
/* Use the same 32-bit alignment when accessing this structure from 64-bit code
* as is used natively in 32-bit code. */
@@ -107,9 +159,9 @@ typedef struct {
uint32_t cpsr;
/* The next field is included with MD_CONTEXT64_ARM_FLOATING_POINT */
- MDFloatingSaveAreaARM64 float_save;
+ MDFloatingSaveAreaARM64_Old float_save;
-} MDRawContextARM64;
+} MDRawContextARM64_Old;
#pragma pack(pop)
@@ -123,18 +175,18 @@ enum MDARM64RegisterNumbers {
MD_CONTEXT_ARM64_REG_PC = 32
};
-/* For (MDRawContextARM64).context_flags. These values indicate the type of
- * context stored in the structure. MD_CONTEXT_ARM64 is Breakpad-defined.
+/* For (MDRawContextARM64_Old).context_flags. These values indicate the type of
+ * context stored in the structure. MD_CONTEXT_ARM64_OLD is Breakpad-defined.
* This value was chosen to avoid likely conflicts with MD_CONTEXT_*
* for other CPUs. */
-#define MD_CONTEXT_ARM64 0x80000000
-#define MD_CONTEXT_ARM64_INTEGER (MD_CONTEXT_ARM64 | 0x00000002)
-#define MD_CONTEXT_ARM64_FLOATING_POINT (MD_CONTEXT_ARM64 | 0x00000004)
+#define MD_CONTEXT_ARM64_OLD 0x80000000
+#define MD_CONTEXT_ARM64_INTEGER_OLD (MD_CONTEXT_ARM64_OLD | 0x00000002)
+#define MD_CONTEXT_ARM64_FLOATING_POINT_OLD (MD_CONTEXT_ARM64_OLD | 0x00000004)
-#define MD_CONTEXT_ARM64_FULL (MD_CONTEXT_ARM64_INTEGER | \
- MD_CONTEXT_ARM64_FLOATING_POINT)
+#define MD_CONTEXT_ARM64_FULL_OLD (MD_CONTEXT_ARM64_INTEGER_OLD | \
+ MD_CONTEXT_ARM64_FLOATING_POINT_OLD)
-#define MD_CONTEXT_ARM64_ALL (MD_CONTEXT_ARM64_INTEGER | \
- MD_CONTEXT_ARM64_FLOATING_POINT)
+#define MD_CONTEXT_ARM64_ALL_OLD (MD_CONTEXT_ARM64_INTEGER_OLD | \
+ MD_CONTEXT_ARM64_FLOATING_POINT_OLD)
#endif /* GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_ARM64_H__ */
diff --git a/src/google_breakpad/common/minidump_cpu_mips.h b/src/google_breakpad/common/minidump_cpu_mips.h
index 4378aac2..f4e2b589 100644
--- a/src/google_breakpad/common/minidump_cpu_mips.h
+++ b/src/google_breakpad/common/minidump_cpu_mips.h
@@ -66,24 +66,6 @@
#ifndef GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_MIPS_H__
#define GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_MIPS_H__
-#if defined(__mips__) && !defined(__ANDROID__)
-typedef struct {
- uint64_t regs[32];
- uint64_t lo;
- uint64_t hi;
- uint64_t epc;
- uint64_t badvaddr;
- uint64_t status;
- uint64_t cause;
-} user_regs_struct;
-
-typedef struct {
- uint64_t regs[32];
- uint32_t fpcsr;
- uint32_t fir;
-} user_fpregs_struct;
-#endif
-
#define MD_CONTEXT_MIPS_GPR_COUNT 32
#define MD_FLOATINGSAVEAREA_MIPS_FPR_COUNT 32
#define MD_CONTEXT_MIPS_DSP_COUNT 3
@@ -112,8 +94,8 @@ typedef struct {
/* 32 64-bit integer registers, r0..r31.
* Note the following fixed uses:
- * r30 is the stack pointer.
- * r31 is the return address (link register).
+ * r29 is the stack pointer.
+ * r31 is the return address.
*/
uint64_t iregs[MD_CONTEXT_MIPS_GPR_COUNT];
@@ -175,4 +157,20 @@ enum MDMIPSRegisterNumbers {
MD_CONTEXT_MIPS_FLOATING_POINT \
MD_CONTEXT_MIPS_DSP)
+/**
+ * Breakpad defines for MIPS64
+ */
+#define MD_CONTEXT_MIPS64 0x00080000
+#define MD_CONTEXT_MIPS64_INTEGER (MD_CONTEXT_MIPS64 | 0x00000002)
+#define MD_CONTEXT_MIPS64_FLOATING_POINT (MD_CONTEXT_MIPS64 | 0x00000004)
+#define MD_CONTEXT_MIPS64_DSP (MD_CONTEXT_MIPS64 | 0x00000008)
+
+#define MD_CONTEXT_MIPS64_FULL (MD_CONTEXT_MIPS64_INTEGER | \
+ MD_CONTEXT_MIPS64_FLOATING_POINT | \
+ MD_CONTEXT_MIPS64_DSP)
+
+#define MD_CONTEXT_MIPS64_ALL (MD_CONTEXT_MIPS64_INTEGER | \
+ MD_CONTEXT_MIPS64_FLOATING_POINT \
+ MD_CONTEXT_MIPS64_DSP)
+
#endif // GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_MIPS_H__
diff --git a/src/google_breakpad/common/minidump_cpu_ppc.h b/src/google_breakpad/common/minidump_cpu_ppc.h
index 02ac3220..b24cc424 100644
--- a/src/google_breakpad/common/minidump_cpu_ppc.h
+++ b/src/google_breakpad/common/minidump_cpu_ppc.h
@@ -140,6 +140,11 @@ typedef struct {
MDVectorSaveAreaPPC vector_save;
} MDRawContextPPC; /* Based on ppc_thread_state */
+/* Indices into gpr for registers with a dedicated or conventional purpose. */
+enum MDPPCRegisterNumbers {
+ MD_CONTEXT_PPC_REG_SP = 1
+};
+
#if defined(__SUNPRO_C) || defined(__SUNPRO_CC)
#pragma pack(0)
#else
diff --git a/src/google_breakpad/common/minidump_cpu_ppc64.h b/src/google_breakpad/common/minidump_cpu_ppc64.h
index 3a883230..61f41938 100644
--- a/src/google_breakpad/common/minidump_cpu_ppc64.h
+++ b/src/google_breakpad/common/minidump_cpu_ppc64.h
@@ -112,6 +112,11 @@ typedef struct {
MDVectorSaveAreaPPC vector_save;
} MDRawContextPPC64; /* Based on ppc_thread_state */
+/* Indices into gpr for registers with a dedicated or conventional purpose. */
+enum MDPPC64RegisterNumbers {
+ MD_CONTEXT_PPC64_REG_SP = 1
+};
+
/* For (MDRawContextPPC).context_flags. These values indicate the type of
* context stored in the structure. MD_CONTEXT_PPC is Breakpad-defined. Its
* value was chosen to avoid likely conflicts with MD_CONTEXT_* for other
diff --git a/src/google_breakpad/common/minidump_cpu_sparc.h b/src/google_breakpad/common/minidump_cpu_sparc.h
index ddc4c759..95c08b17 100644
--- a/src/google_breakpad/common/minidump_cpu_sparc.h
+++ b/src/google_breakpad/common/minidump_cpu_sparc.h
@@ -138,6 +138,11 @@ typedef struct {
} MDRawContextSPARC; /* CONTEXT_SPARC */
+/* Indices into g_r for registers with a dedicated or conventional purpose. */
+enum MDSPARCRegisterNumbers {
+ MD_CONTEXT_SPARC_REG_SP = 14
+};
+
/* For (MDRawContextSPARC).context_flags. These values indicate the type of
* context stored in the structure. MD_CONTEXT_SPARC is Breakpad-defined. Its
* value was chosen to avoid likely conflicts with MD_CONTEXT_* for other
diff --git a/src/google_breakpad/common/minidump_exception_fuchsia.h b/src/google_breakpad/common/minidump_exception_fuchsia.h
new file mode 100644
index 00000000..f26a8a2a
--- /dev/null
+++ b/src/google_breakpad/common/minidump_exception_fuchsia.h
@@ -0,0 +1,58 @@
+/* Copyright (c) 2019, Google Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
+
+/* minidump_exception_fuchsia.h: A definition of exception codes for Fuchsia.
+ *
+ * Author: Ivan Penkov */
+
+#ifndef GOOGLE_BREAKPAD_COMMON_MINIDUMP_EXCEPTION_FUCHSIA_H_
+#define GOOGLE_BREAKPAD_COMMON_MINIDUMP_EXCEPTION_FUCHSIA_H_
+
+#include <stddef.h>
+
+#include "google_breakpad/common/breakpad_types.h"
+
+// Based on zircon/system/public/zircon/syscalls/exception.h
+typedef enum {
+ // Architectural exceptions
+ MD_EXCEPTION_CODE_FUCHSIA_GENERAL = 0x8,
+ MD_EXCEPTION_CODE_FUCHSIA_FATAL_PAGE_FAULT = 0x108,
+ MD_EXCEPTION_CODE_FUCHSIA_UNDEFINED_INSTRUCTION = 0x208,
+ MD_EXCEPTION_CODE_FUCHSIA_SW_BREAKPOINT = 0x308,
+ MD_EXCEPTION_CODE_FUCHSIA_HW_BREAKPOINT = 0x408,
+ MD_EXCEPTION_CODE_FUCHSIA_UNALIGNED_ACCESS = 0x508,
+ //
+ // Synthetic exceptions
+ MD_EXCEPTION_CODE_FUCHSIA_THREAD_STARTING = 0x8008,
+ MD_EXCEPTION_CODE_FUCHSIA_THREAD_EXITING = 0x8108,
+ MD_EXCEPTION_CODE_FUCHSIA_POLICY_ERROR = 0x8208,
+ MD_EXCEPTION_CODE_FUCHSIA_PROCESS_STARTING = 0x8308,
+} MDExceptionCodeFuchsia;
+
+#endif // GOOGLE_BREAKPAD_COMMON_MINIDUMP_EXCEPTION_FUCHSIA_H_
diff --git a/src/google_breakpad/common/minidump_exception_linux.h b/src/google_breakpad/common/minidump_exception_linux.h
index 9e7e4f1e..6138d5d7 100644
--- a/src/google_breakpad/common/minidump_exception_linux.h
+++ b/src/google_breakpad/common/minidump_exception_linux.h
@@ -84,4 +84,42 @@ typedef enum {
dump requested. */
} MDExceptionCodeLinux;
+/* For (MDException).exception_flags. These values come from
+ * asm-generic/siginfo.h.
+ */
+typedef enum {
+ /* SIGILL */
+ MD_EXCEPTION_FLAG_LIN_ILL_ILLOPC = 1,
+ MD_EXCEPTION_FLAG_LIN_ILL_ILLOPN = 2,
+ MD_EXCEPTION_FLAG_LIN_ILL_ILLADR = 3,
+ MD_EXCEPTION_FLAG_LIN_ILL_ILLTRP = 4,
+ MD_EXCEPTION_FLAG_LIN_ILL_PRVOPC = 5,
+ MD_EXCEPTION_FLAG_LIN_ILL_PRVREG = 6,
+ MD_EXCEPTION_FLAG_LIN_ILL_COPROC = 7,
+ MD_EXCEPTION_FLAG_LIN_ILL_BADSTK = 8,
+
+ /* SIGFPE */
+ MD_EXCEPTION_FLAG_LIN_FPE_INTDIV = 1,
+ MD_EXCEPTION_FLAG_LIN_FPE_INTOVF = 2,
+ MD_EXCEPTION_FLAG_LIN_FPE_FLTDIV = 3,
+ MD_EXCEPTION_FLAG_LIN_FPE_FLTOVF = 4,
+ MD_EXCEPTION_FLAG_LIN_FPE_FLTUND = 5,
+ MD_EXCEPTION_FLAG_LIN_FPE_FLTRES = 6,
+ MD_EXCEPTION_FLAG_LIN_FPE_FLTINV = 7,
+ MD_EXCEPTION_FLAG_LIN_FPE_FLTSUB = 8,
+
+ /* SIGSEGV */
+ MD_EXCEPTION_FLAG_LIN_SEGV_MAPERR = 1,
+ MD_EXCEPTION_FLAG_LIN_SEGV_ACCERR = 2,
+ MD_EXCEPTION_FLAG_LIN_SEGV_BNDERR = 3,
+ MD_EXCEPTION_FLAG_LIN_SEGV_PKUERR = 4,
+
+ /* SIGBUS */
+ MD_EXCEPTION_FLAG_LIN_BUS_ADRALN = 1,
+ MD_EXCEPTION_FLAG_LIN_BUS_ADRERR = 2,
+ MD_EXCEPTION_FLAG_LIN_BUS_OBJERR = 3,
+ MD_EXCEPTION_FLAG_LIN_BUS_MCEERR_AR = 4,
+ MD_EXCEPTION_FLAG_LIN_BUS_MCEERR_AO = 5,
+} MDExceptionFlagLinux;
+
#endif /* GOOGLE_BREAKPAD_COMMON_MINIDUMP_EXCEPTION_LINUX_H__ */
diff --git a/src/google_breakpad/common/minidump_exception_mac.h b/src/google_breakpad/common/minidump_exception_mac.h
index 91c1c097..fadbf4ef 100644
--- a/src/google_breakpad/common/minidump_exception_mac.h
+++ b/src/google_breakpad/common/minidump_exception_mac.h
@@ -34,7 +34,7 @@
*
* Author: Mark Mentovai
* Split into its own file: Neal Sidhwaney */
-
+
#ifndef GOOGLE_BREAKPAD_COMMON_MINIDUMP_EXCEPTION_MAC_H__
#define GOOGLE_BREAKPAD_COMMON_MINIDUMP_EXCEPTION_MAC_H__
@@ -65,8 +65,10 @@ typedef enum {
/* EXC_SYSCALL */
MD_EXCEPTION_MAC_MACH_SYSCALL = 8,
/* EXC_MACH_SYSCALL */
- MD_EXCEPTION_MAC_RPC_ALERT = 9
+ MD_EXCEPTION_MAC_RPC_ALERT = 9,
/* EXC_RPC_ALERT */
+ MD_EXCEPTION_MAC_SIMULATED = 0x43507378
+ /* Fake exception code used by Crashpad's SimulateCrash ('CPsx'). */
} MDExceptionMac;
/* For (MDException).exception_flags. Breakpad minidump extension for Mac OS X
@@ -85,6 +87,8 @@ typedef enum {
/* KERN_MEMORY_FAILURE */
MD_EXCEPTION_CODE_MAC_MEMORY_ERROR = 10,
/* KERN_MEMORY_ERROR */
+ MD_EXCEPTION_CODE_MAC_CODESIGN_ERROR = 50,
+ /* KERN_CODESIGN_ERROR */
/* With MD_EXCEPTION_SOFTWARE */
MD_EXCEPTION_CODE_MAC_BAD_SYSCALL = 0x00010000, /* Mach SIGSYS */
diff --git a/src/google_breakpad/common/minidump_exception_win32.h b/src/google_breakpad/common/minidump_exception_win32.h
index e4cd59ed..4b5d57c8 100644
--- a/src/google_breakpad/common/minidump_exception_win32.h
+++ b/src/google_breakpad/common/minidump_exception_win32.h
@@ -94,15 +94,23 @@ typedef enum {
/* EXCEPTION_PRIV_INSTRUCTION */
MD_EXCEPTION_CODE_WIN_STACK_OVERFLOW = 0xc00000fd,
/* EXCEPTION_STACK_OVERFLOW */
+ MD_EXCEPTION_CODE_WIN_BAD_FUNCTION_TABLE = 0xc00000ff,
+ /* EXCEPTION_BAD_FUNCTION_TABLE */
MD_EXCEPTION_CODE_WIN_POSSIBLE_DEADLOCK = 0xc0000194,
/* EXCEPTION_POSSIBLE_DEADLOCK */
MD_EXCEPTION_CODE_WIN_STACK_BUFFER_OVERRUN = 0xc0000409,
/* STATUS_STACK_BUFFER_OVERRUN */
MD_EXCEPTION_CODE_WIN_HEAP_CORRUPTION = 0xc0000374,
/* STATUS_HEAP_CORRUPTION */
- MD_EXCEPTION_CODE_WIN_UNHANDLED_CPP_EXCEPTION = 0xe06d7363
+ MD_EXCEPTION_OUT_OF_MEMORY = 0xe0000008,
+ /* Exception thrown by Chromium allocators to indicate OOM.
+ See base/process/memory.h in Chromium for rationale. */
+ MD_EXCEPTION_CODE_WIN_UNHANDLED_CPP_EXCEPTION = 0xe06d7363,
/* Per http://support.microsoft.com/kb/185294,
generated by Visual C++ compiler */
+ MD_EXCEPTION_CODE_WIN_SIMULATED = 0x0517a7ed
+ /* Fake exception code used by Crashpad's
+ CrashpadClient::DumpWithoutCrash. */
} MDExceptionCodeWin;
diff --git a/src/google_breakpad/common/minidump_format.h b/src/google_breakpad/common/minidump_format.h
index 17a5abba..6eceddbb 100644
--- a/src/google_breakpad/common/minidump_format.h
+++ b/src/google_breakpad/common/minidump_format.h
@@ -328,6 +328,10 @@ typedef enum {
MD_MEMORY_INFO_LIST_STREAM = 16, /* MDRawMemoryInfoList */
MD_THREAD_INFO_LIST_STREAM = 17,
MD_HANDLE_OPERATION_LIST_STREAM = 18,
+ MD_TOKEN_STREAM = 19,
+ MD_JAVASCRIPT_DATA_STREAM = 20,
+ MD_SYSTEM_MEMORY_INFO_STREAM = 21,
+ MD_PROCESS_VM_COUNTERS_STREAM = 22,
MD_LAST_RESERVED_STREAM = 0x0000ffff,
/* Breakpad extension types. 0x4767 = "Gg" */
@@ -342,7 +346,11 @@ typedef enum {
MD_LINUX_ENVIRON = 0x47670007, /* /proc/$x/environ */
MD_LINUX_AUXV = 0x47670008, /* /proc/$x/auxv */
MD_LINUX_MAPS = 0x47670009, /* /proc/$x/maps */
- MD_LINUX_DSO_DEBUG = 0x4767000A /* MDRawDebug{32,64} */
+ MD_LINUX_DSO_DEBUG = 0x4767000A, /* MDRawDebug{32,64} */
+
+ /* Crashpad extension types. 0x4350 = "CP"
+ * See Crashpad's minidump/minidump_extensions.h. */
+ MD_CRASHPAD_INFO_STREAM = 0x43500001, /* MDRawCrashpadInfo */
} MDStreamType; /* MINIDUMP_STREAM_TYPE */
@@ -449,15 +457,26 @@ static const size_t MDCVInfoPDB70_minsize = offsetof(MDCVInfoPDB70,
#define MD_CVINFOPDB70_SIGNATURE 0x53445352 /* cvSignature = 'SDSR' */
+/*
+ * Modern ELF toolchains insert a "build id" into the ELF headers that
+ * usually contains a hash of some ELF headers + sections to uniquely
+ * identify a binary.
+ *
+ * https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Developer_Guide/compiling-build-id.html
+ * https://sourceware.org/binutils/docs-2.26/ld/Options.html#index-g_t_002d_002dbuild_002did-292
+ */
typedef struct {
- uint32_t data1[2];
- uint32_t data2;
- uint32_t data3;
- uint32_t data4;
- uint32_t data5[3];
- uint8_t extra[2];
+ uint32_t cv_signature;
+ uint8_t build_id[1]; /* Bytes of build id from GNU_BUILD_ID ELF note.
+ * This is variable-length, but usually 20 bytes
+ * as the binutils ld default is a SHA-1 hash. */
} MDCVInfoELF;
+static const size_t MDCVInfoELF_minsize = offsetof(MDCVInfoELF,
+ build_id[0]);
+
+#define MD_CVINFOELF_SIGNATURE 0x4270454c /* cvSignature = 'BpEL' */
+
/* In addition to the two CodeView record formats above, used for linking
* to external pdb files, it is possible for debugging data to be carried
* directly in the CodeView record itself. These signature values will
@@ -530,6 +549,7 @@ typedef struct {
uint64_t exception_information[MD_EXCEPTION_MAXIMUM_PARAMETERS];
} MDException; /* MINIDUMP_EXCEPTION */
+#include "minidump_exception_fuchsia.h"
#include "minidump_exception_linux.h"
#include "minidump_exception_mac.h"
#include "minidump_exception_ps3.h"
@@ -635,9 +655,11 @@ typedef enum {
MD_CPU_ARCHITECTURE_AMD64 = 9, /* PROCESSOR_ARCHITECTURE_AMD64 */
MD_CPU_ARCHITECTURE_X86_WIN64 = 10,
/* PROCESSOR_ARCHITECTURE_IA32_ON_WIN64 (WoW64) */
+ MD_CPU_ARCHITECTURE_ARM64 = 12, /* PROCESSOR_ARCHITECTURE_ARM64 */
MD_CPU_ARCHITECTURE_SPARC = 0x8001, /* Breakpad-defined value for SPARC */
MD_CPU_ARCHITECTURE_PPC64 = 0x8002, /* Breakpad-defined value for PPC64 */
- MD_CPU_ARCHITECTURE_ARM64 = 0x8003, /* Breakpad-defined value for ARM64 */
+ MD_CPU_ARCHITECTURE_ARM64_OLD = 0x8003, /* Breakpad-defined value for ARM64 */
+ MD_CPU_ARCHITECTURE_MIPS64 = 0x8004, /* Breakpad-defined value for MIPS64 */
MD_CPU_ARCHITECTURE_UNKNOWN = 0xffff /* PROCESSOR_ARCHITECTURE_UNKNOWN */
} MDCPUArchitecture;
@@ -657,10 +679,25 @@ typedef enum {
MD_OS_SOLARIS = 0x8202, /* Solaris */
MD_OS_ANDROID = 0x8203, /* Android */
MD_OS_PS3 = 0x8204, /* PS3 */
- MD_OS_NACL = 0x8205 /* Native Client (NaCl) */
+ MD_OS_NACL = 0x8205, /* Native Client (NaCl) */
+ MD_OS_FUCHSIA = 0x8206 /* Fuchsia */
} MDOSPlatform;
typedef struct {
+ uint64_t base_of_image;
+ uint32_t size_of_image;
+ uint32_t checksum;
+ uint32_t time_date_stamp;
+ MDRVA module_name_rva;
+} MDRawUnloadedModule;
+
+typedef struct {
+ uint32_t size_of_header;
+ uint32_t size_of_entry;
+ uint32_t number_of_entries;
+} MDRawUnloadedModuleList; /* MINIDUMP_UNLOADED_MODULE_LIST */
+
+typedef struct {
uint16_t year;
uint16_t month;
uint16_t day_of_week;
@@ -705,6 +742,41 @@ typedef struct {
/* MAX_PATH from windef.h */
#define MD_MAX_PATH 260
+/* For MDXStateConfigFeatureMscInfo.features */
+typedef struct {
+ uint32_t offset;
+ uint32_t size;
+} MDXStateFeature;
+
+/* For MDXStateConfigFeatureMscInfo.enabled_features from winnt.h */
+typedef enum {
+ MD_XSTATE_LEGACY_FLOATING_POINT = 0, /* XSTATE_LEGACY_FLOATING_POINT */
+ MD_XSTATE_LEGACY_SSE = 1, /* XSTATE_LEGACY_SSE */
+ MD_XSTATE_GSSE = 2, /* XSTATE_GSSE */
+ MD_XSTATE_AVX = MD_XSTATE_GSSE, /* XSTATE_AVX */
+ MD_XSTATE_MPX_BNDREGS = 3, /* XSTATE_MPX_BNDREGS */
+ MD_XSTATE_MPX_BNDCSR = 4, /* XSTATE_MPX_BNDCSR */
+ MD_XSTATE_AVX512_KMASK = 5, /* XSTATE_AVX512_KMASK */
+ MD_XSTATE_AVX512_ZMM_H = 6, /* XSTATE_AVX512_ZMM_H */
+ MD_XSTATE_AVX512_ZMM = 7, /* XSTATE_AVX512_ZMM */
+ MD_XSTATE_IPT = 8, /* XSTATE_IPT */
+ MD_XSTATE_LWP = 62 /* XSTATE_LWP */
+} MDXStateFeatureFlag;
+
+/* MAXIMUM_XSTATE_FEATURES from winnt.h */
+#define MD_MAXIMUM_XSTATE_FEATURES 64
+
+/* For MDRawMiscInfo.xstate_data */
+typedef struct {
+ uint32_t size_of_info;
+ uint32_t context_size;
+ /* An entry in the features array is valid only if the corresponding bit in
+ * the enabled_features flag is set. */
+ uint64_t enabled_features;
+ MDXStateFeature features[MD_MAXIMUM_XSTATE_FEATURES];
+} MDXStateConfigFeatureMscInfo;
+
+
/* The miscellaneous information stream contains a variety
* of small pieces of information. A member is valid if
* it's within the available size and its corresponding
@@ -765,9 +837,22 @@ typedef struct {
* MD_MISCINFO_FLAGS1_BUILDSTRING. */
uint16_t build_string[MD_MAX_PATH]; /* UTF-16-encoded, 0-terminated */
uint16_t dbg_bld_str[40]; /* UTF-16-encoded, 0-terminated */
+
+ /* The following fields are not present in MINIDUMP_MISC_INFO_4 but are
+ * in MINIDUMP_MISC_INFO_5. When this struct is populated, these values
+ * may not be set. Use flags1 and size_of_info to determine whether these
+ * values are present. */
+
+ /* The following field has its own flags for establishing the validity of
+ * the structure's contents.*/
+ MDXStateConfigFeatureMscInfo xstate_data;
+
+ /* The following field is only valid if flags1 contains
+ * MD_MISCINFO_FLAGS1_PROCESS_COOKIE. */
+ uint32_t process_cookie;
} MDRawMiscInfo; /* MINIDUMP_MISC_INFO, MINIDUMP_MISC_INFO_2,
* MINIDUMP_MISC_INFO_3, MINIDUMP_MISC_INFO_4,
- * MINIDUMP_MISC_INFO_N */
+ * MINIDUMP_MISC_INFO_5, MINIDUMP_MISC_INFO_N */
static const size_t MD_MISCINFO_SIZE =
offsetof(MDRawMiscInfo, processor_max_mhz);
@@ -775,7 +860,14 @@ static const size_t MD_MISCINFO2_SIZE =
offsetof(MDRawMiscInfo, process_integrity_level);
static const size_t MD_MISCINFO3_SIZE =
offsetof(MDRawMiscInfo, build_string[0]);
-static const size_t MD_MISCINFO4_SIZE = sizeof(MDRawMiscInfo);
+static const size_t MD_MISCINFO4_SIZE =
+ offsetof(MDRawMiscInfo, xstate_data);
+/* Version 5 of the MDRawMiscInfo structure is not a multiple of 8 in size and
+ * yet it contains some 8-bytes sized fields. This causes many compilers to
+ * round the structure size up to a multiple of 8 by adding padding at the end.
+ * The following hack is thus required for matching the proper on-disk size. */
+static const size_t MD_MISCINFO5_SIZE =
+ offsetof(MDRawMiscInfo, process_cookie) + sizeof(uint32_t);
/* For (MDRawMiscInfo).flags1. These values indicate which fields in the
* MDRawMiscInfoStructure are valid. */
@@ -796,6 +888,8 @@ typedef enum {
/* MINIDUMP_MISC3_PROTECTED_PROCESS */
MD_MISCINFO_FLAGS1_BUILDSTRING = 0x00000100,
/* MINIDUMP_MISC4_BUILDSTRING */
+ MD_MISCINFO_FLAGS1_PROCESS_COOKIE = 0x00000200,
+ /* MINIDUMP_MISC5_PROCESS_COOKIE */
} MDMiscInfoFlags1;
/*
@@ -964,6 +1058,42 @@ typedef struct {
uint64_t dynamic;
} MDRawDebug64;
+/* Crashpad extension types. See Crashpad's minidump/minidump_extensions.h. */
+
+typedef struct {
+ MDRVA key;
+ MDRVA value;
+} MDRawSimpleStringDictionaryEntry;
+
+typedef struct {
+ uint32_t count;
+ MDRawSimpleStringDictionaryEntry entries[0];
+} MDRawSimpleStringDictionary;
+
+typedef struct {
+ uint32_t version;
+ MDLocationDescriptor list_annotations;
+ MDLocationDescriptor simple_annotations; /* MDRawSimpleStringDictionary */
+} MDRawModuleCrashpadInfo;
+
+typedef struct {
+ uint32_t minidump_module_list_index;
+ MDLocationDescriptor location; /* MDRawModuleCrashpadInfo */
+} MDRawModuleCrashpadInfoLink;
+
+typedef struct {
+ uint32_t count;
+ MDLocationDescriptor modules[0]; /* MDRawModuleCrashpadInfoLink */
+} MDRawModuleCrashpadInfoList;
+
+typedef struct {
+ uint32_t version;
+ MDGUID report_id;
+ MDGUID client_id;
+ MDLocationDescriptor simple_annotations; /* MDRawSimpleStringDictionary */
+ MDLocationDescriptor module_list; /* MDRawModuleCrashpadInfoList */
+} MDRawCrashpadInfo;
+
#if defined(_MSC_VER)
#pragma warning(pop)
#endif /* _MSC_VER */
diff --git a/src/google_breakpad/common/minidump_size.h b/src/google_breakpad/common/minidump_size.h
index 918544b6..fae57923 100644
--- a/src/google_breakpad/common/minidump_size.h
+++ b/src/google_breakpad/common/minidump_size.h
@@ -76,6 +76,12 @@ class minidump_size<MDCVInfoPDB70> {
};
template<>
+class minidump_size<MDCVInfoELF> {
+ public:
+ static size_t size() { return MDCVInfoELF_minsize; }
+};
+
+template<>
class minidump_size<MDImageDebugMisc> {
public:
static size_t size() { return MDImageDebugMisc_minsize; }
diff --git a/src/google_breakpad/processor/basic_source_line_resolver.h b/src/google_breakpad/processor/basic_source_line_resolver.h
index 6bb6d863..91fb7841 100644
--- a/src/google_breakpad/processor/basic_source_line_resolver.h
+++ b/src/google_breakpad/processor/basic_source_line_resolver.h
@@ -95,12 +95,14 @@ class SymbolParseHelper {
char **filename); // out
// Parses a |function_line| declaration. Returns true on success.
- // Format: FUNC <address> <size> <stack_param_size> <name>.
+ // Format: FUNC [<multiple>] <address> <size> <stack_param_size> <name>.
// Notice, that this method modifies the input |function_line| which is why it
- // can't be const. On success, <address>, <size>, <stack_param_size>, and
- // <name> are stored in |*address|, |*size|, |*stack_param_size|, and |*name|.
- // No allocation is done, |*name| simply points inside |function_line|.
+ // can't be const. On success, the presence of <multiple>, <address>, <size>,
+ // <stack_param_size>, and <name> are stored in |*is_multiple|, |*address|,
+ // |*size|, |*stack_param_size|, and |*name|. No allocation is done, |*name|
+ // simply points inside |function_line|.
static bool ParseFunction(char *function_line, // in
+ bool *is_multiple, // out
uint64_t *address, // out
uint64_t *size, // out
long *stack_param_size, // out
@@ -119,12 +121,14 @@ class SymbolParseHelper {
long *source_file); // out
// Parses a |public_line| declaration. Returns true on success.
- // Format: PUBLIC <address> <stack_param_size> <name>
+ // Format: PUBLIC [<multiple>] <address> <stack_param_size> <name>
// Notice, that this method modifies the input |function_line| which is why
- // it can't be const. On success, <address>, <stack_param_size>, <name>
- // are stored in |*address|, |*stack_param_size|, and |*name|.
- // No allocation is done, |*name| simply points inside |public_line|.
+ // it can't be const. On success, the presence of <multiple>, <address>,
+ // <stack_param_size>, <name> are stored in |*is_multiple|, |*address|,
+ // |*stack_param_size|, and |*name|. No allocation is done, |*name| simply
+ // points inside |public_line|.
static bool ParsePublicSymbol(char *public_line, // in
+ bool *is_multiple, // out
uint64_t *address, // out
long *stack_param_size, // out
char **name); // out
diff --git a/src/google_breakpad/processor/call_stack.h b/src/google_breakpad/processor/call_stack.h
index 21f595e7..c5914231 100644
--- a/src/google_breakpad/processor/call_stack.h
+++ b/src/google_breakpad/processor/call_stack.h
@@ -45,6 +45,7 @@
#ifndef GOOGLE_BREAKPAD_PROCESSOR_CALL_STACK_H__
#define GOOGLE_BREAKPAD_PROCESSOR_CALL_STACK_H__
+#include <cstdint>
#include <vector>
namespace google_breakpad {
@@ -61,15 +62,24 @@ class CallStack {
// Resets the CallStack to its initial empty state
void Clear();
-
+
const vector<StackFrame*>* frames() const { return &frames_; }
+ // Set the TID associated with this call stack.
+ void set_tid(uint32_t tid) { tid_ = tid; }
+
+ uint32_t tid() const { return tid_; }
+
private:
// Stackwalker is responsible for building the frames_ vector.
friend class Stackwalker;
// Storage for pushed frames.
vector<StackFrame*> frames_;
+
+ // The TID associated with this call stack. Default to 0 if it's not
+ // available.
+ uint32_t tid_;
};
} // namespace google_breakpad
diff --git a/src/google_breakpad/processor/code_module.h b/src/google_breakpad/processor/code_module.h
index 4e892824..29b8d9c9 100644
--- a/src/google_breakpad/processor/code_module.h
+++ b/src/google_breakpad/processor/code_module.h
@@ -86,7 +86,17 @@ class CodeModule {
// ownership of. The new CodeModule may be of a different concrete class
// than the CodeModule being copied, but will behave identically to the
// copied CodeModule as far as the CodeModule interface is concerned.
- virtual const CodeModule* Copy() const = 0;
+ virtual CodeModule* Copy() const = 0;
+
+ // Getter and setter for shrink_down_delta. This is used when the address
+ // range for a module is shrunk down due to address range conflicts with
+ // other modules. The base_address and size fields are not updated and they
+ // should always reflect the original values (reported in the minidump).
+ virtual uint64_t shrink_down_delta() const = 0;
+ virtual void SetShrinkDownDelta(uint64_t shrink_down_delta) = 0;
+
+ // Whether the module was unloaded from memory.
+ virtual bool is_unloaded() const = 0;
};
} // namespace google_breakpad
diff --git a/src/google_breakpad/processor/code_modules.h b/src/google_breakpad/processor/code_modules.h
index a38579af..74f113c1 100644
--- a/src/google_breakpad/processor/code_modules.h
+++ b/src/google_breakpad/processor/code_modules.h
@@ -35,7 +35,12 @@
#ifndef GOOGLE_BREAKPAD_PROCESSOR_CODE_MODULES_H__
#define GOOGLE_BREAKPAD_PROCESSOR_CODE_MODULES_H__
+#include <stddef.h>
+
+#include <vector>
+
#include "google_breakpad/common/breakpad_types.h"
+#include "processor/linked_ptr.h"
namespace google_breakpad {
@@ -91,6 +96,11 @@ class CodeModules {
// returns objects in may differ between a copy and the original CodeModules
// object.
virtual const CodeModules* Copy() const = 0;
+
+ // Returns a vector of all modules which address ranges needed to be shrunk
+ // down due to address range conflicts with other modules.
+ virtual std::vector<linked_ptr<const CodeModule> >
+ GetShrunkRangeModules() const = 0;
};
} // namespace google_breakpad
diff --git a/src/google_breakpad/processor/dump_context.h b/src/google_breakpad/processor/dump_context.h
index f6238ffa..df80bf7e 100644
--- a/src/google_breakpad/processor/dump_context.h
+++ b/src/google_breakpad/processor/dump_context.h
@@ -67,6 +67,10 @@ class DumpContext : public DumpObject {
// MDRawContext, since it varies per-CPU architecture.
bool GetInstructionPointer(uint64_t* ip) const;
+ // Similar to the GetInstructionPointer method, this method gets the stack
+ // pointer for all CPU architectures.
+ bool GetStackPointer(uint64_t* sp) const;
+
// Print a human-readable representation of the object to stdout.
void Print();
diff --git a/src/google_breakpad/processor/exception_record.h b/src/google_breakpad/processor/exception_record.h
new file mode 100644
index 00000000..eac6c90a
--- /dev/null
+++ b/src/google_breakpad/processor/exception_record.h
@@ -0,0 +1,124 @@
+// Copyright (c) 2019 Google Inc.
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// exception_record.h: A snapshot of an exception record.
+//
+// Author: Ivan Penkov
+
+#ifndef THIRD_PARTY_BREAKPAD_SRC_GOOGLE_BREAKPAD_PROCESSOR_EXCEPTION_RECORD_H_
+#define THIRD_PARTY_BREAKPAD_SRC_GOOGLE_BREAKPAD_PROCESSOR_EXCEPTION_RECORD_H_
+
+#include <vector>
+
+namespace google_breakpad {
+
+// Additional argument that describes the exception.
+class ExceptionParameter {
+ public:
+ ExceptionParameter(uint64_t value, const string& description)
+ : value_(value), description_(description) {}
+ // Accessors. See the data declarations below.
+ uint64_t value() const { return value_; }
+ void set_value(uint64_t value) { value_ = value; }
+ const string& description() const { return description_; }
+ void set_description(const string& description) {
+ description_ = description;
+ }
+
+ private:
+ // Parameter value.
+ uint64_t value_;
+ // Human readable description/interpretation of the above value.
+ string description_;
+};
+
+// A snapshot of an exception record. Contains exception record details: code,
+// flags, address, parameters.
+class ExceptionRecord {
+ public:
+ // Accessors. See the data declarations below.
+ uint32_t code() const { return code_; }
+ const string& code_description() const { return code_description_; }
+ void set_code(uint32_t code, const string& description) {
+ code_ = code;
+ code_description_ = description;
+ }
+
+ uint32_t flags() const { return flags_; }
+ const string& flags_description() const { return flags_description_; }
+ void set_flags(uint32_t flags, const string& description) {
+ flags_ = flags;
+ flags_description_ = description;
+ }
+
+ uint64_t nested_exception_record_address() const {
+ return nested_exception_record_address_;
+ }
+ void set_nested_exception_record_address(
+ uint64_t nested_exception_record_address) {
+ nested_exception_record_address_ = nested_exception_record_address;
+ }
+
+ uint64_t address() const { return address_; }
+ void set_address(uint64_t address) { address_ = address; }
+
+ const std::vector<ExceptionParameter>* parameters() const {
+ return &parameters_;
+ }
+ void add_parameter(uint64_t value, const string& description) {
+ parameters_.push_back(ExceptionParameter(value, description));
+ }
+
+ private:
+ // Exception code.
+ uint32_t code_;
+ string code_description_;
+
+ // Exception flags.
+ uint32_t flags_;
+ string flags_description_;
+
+ // The address of an associated MDException structure. Exception records can
+ // be chained together to provide additional information when nested
+ // exceptions occur.
+ uint64_t nested_exception_record_address_;
+
+ // The memory address that caused the exception. For data access errors,
+ // this will be the data address that caused the fault. For code errors,
+ // this will be the address of the instruction that caused the fault.
+ uint64_t address_;
+
+ // An array of additional arguments that describe the exception.
+ std::vector<ExceptionParameter> parameters_;
+};
+
+} // namespace google_breakpad
+
+
+#endif // THIRD_PARTY_BREAKPAD_SRC_GOOGLE_BREAKPAD_PROCESSOR_EXCEPTION_RECORD_H_
diff --git a/src/google_breakpad/processor/exploitability.h b/src/google_breakpad/processor/exploitability.h
index 67255a3a..014413c9 100644
--- a/src/google_breakpad/processor/exploitability.h
+++ b/src/google_breakpad/processor/exploitability.h
@@ -53,6 +53,15 @@ class Exploitability {
static Exploitability *ExploitabilityForPlatform(Minidump *dump,
ProcessState *process_state);
+ // The boolean parameter signals whether the exploitability engine is
+ // enabled to call out to objdump for disassembly. This is disabled by
+ // default. It is used to check the identity of the instruction that
+ // caused the program to crash. This should not be enabled if there are
+ // portability concerns.
+ static Exploitability *ExploitabilityForPlatform(Minidump *dump,
+ ProcessState *process_state,
+ bool enable_objdump);
+
ExploitabilityRating CheckExploitability();
bool AddressIsAscii(uint64_t);
diff --git a/src/google_breakpad/processor/microdump.h b/src/google_breakpad/processor/microdump.h
index abdaecb1..02ebdcd7 100644
--- a/src/google_breakpad/processor/microdump.h
+++ b/src/google_breakpad/processor/microdump.h
@@ -58,6 +58,9 @@ class MicrodumpModules : public BasicCodeModules {
public:
// Takes over ownership of |module|.
void Add(const CodeModule* module);
+
+ // Enables/disables module address range shrink.
+ void SetEnableModuleShrink(bool is_enabled);
};
// MicrodumpContext carries a CPU-specific context.
@@ -66,6 +69,9 @@ class MicrodumpContext : public DumpContext {
public:
virtual void SetContextARM(MDRawContextARM* arm);
virtual void SetContextARM64(MDRawContextARM64* arm64);
+ virtual void SetContextX86(MDRawContextX86* x86);
+ virtual void SetContextMIPS(MDRawContextMIPS* mips32);
+ virtual void SetContextMIPS64(MDRawContextMIPS* mips64);
};
// This class provides access to microdump memory regions.
@@ -113,14 +119,17 @@ class Microdump {
MicrodumpModules* GetModules() { return modules_.get(); }
SystemInfo* GetSystemInfo() { return system_info_.get(); }
+ string GetCrashReason() { return crash_reason_; }
+ uint64_t GetCrashAddress() { return crash_address_; }
private:
scoped_ptr<MicrodumpContext> context_;
scoped_ptr<MicrodumpMemoryRegion> stack_region_;
scoped_ptr<MicrodumpModules> modules_;
scoped_ptr<SystemInfo> system_info_;
+ string crash_reason_;
+ uint64_t crash_address_;
};
} // namespace google_breakpad
#endif // GOOGLE_BREAKPAD_PROCESSOR_MICRODUMP_H__
-
diff --git a/src/google_breakpad/processor/microdump_processor.h b/src/google_breakpad/processor/microdump_processor.h
index 1322a01c..60d14a54 100644
--- a/src/google_breakpad/processor/microdump_processor.h
+++ b/src/google_breakpad/processor/microdump_processor.h
@@ -40,9 +40,10 @@
namespace google_breakpad {
+class Microdump;
class ProcessState;
class StackFrameSymbolizer;
-
+
class MicrodumpProcessor {
public:
// Initializes the MicrodumpProcessor with a stack frame symbolizer.
@@ -52,7 +53,7 @@ class MicrodumpProcessor {
virtual ~MicrodumpProcessor();
// Processes the microdump contents and fills process_state with the result.
- google_breakpad::ProcessResult Process(const string& microdump_contents,
+ google_breakpad::ProcessResult Process(Microdump* microdump,
ProcessState* process_state);
private:
StackFrameSymbolizer* frame_symbolizer_;
diff --git a/src/google_breakpad/processor/minidump.h b/src/google_breakpad/processor/minidump.h
index 51f15025..d712cb66 100644
--- a/src/google_breakpad/processor/minidump.h
+++ b/src/google_breakpad/processor/minidump.h
@@ -79,6 +79,8 @@
#ifndef GOOGLE_BREAKPAD_PROCESSOR_MINIDUMP_H__
#define GOOGLE_BREAKPAD_PROCESSOR_MINIDUMP_H__
+#include <stdint.h>
+
#ifndef _WIN32
#include <unistd.h>
#endif
@@ -88,12 +90,14 @@
#include <string>
#include <vector>
+#include "common/basictypes.h"
#include "common/using_std_string.h"
#include "google_breakpad/processor/code_module.h"
#include "google_breakpad/processor/code_modules.h"
#include "google_breakpad/processor/dump_context.h"
#include "google_breakpad/processor/dump_object.h"
#include "google_breakpad/processor/memory_region.h"
+#include "google_breakpad/processor/proc_maps_linux.h"
namespace google_breakpad {
@@ -147,6 +151,8 @@ class MinidumpStream : public MinidumpObject {
// that implements MinidumpStream can compare expected_size to a
// known size as an integrity check.
virtual bool Read(uint32_t expected_size) = 0;
+
+ DISALLOW_COPY_AND_ASSIGN(MinidumpStream);
};
@@ -187,6 +193,8 @@ class MinidumpContext : public DumpContext {
// for access to data about the minidump file itself, such as whether
// it should be byte-swapped.
Minidump* minidump_;
+
+ DISALLOW_COPY_AND_ASSIGN(MinidumpContext);
};
@@ -228,6 +236,7 @@ class MinidumpMemoryRegion : public MinidumpObject,
// Print a human-readable representation of the object to stdout.
void Print() const;
+ void SetPrintMode(bool hexdump, unsigned int width);
protected:
explicit MinidumpMemoryRegion(Minidump* minidump);
@@ -244,8 +253,11 @@ class MinidumpMemoryRegion : public MinidumpObject,
template<typename T> bool GetMemoryAtAddressInternal(uint64_t address,
T* value) const;
- // The largest memory region that will be read from a minidump. The
- // default is 1MB.
+ // Knobs for controlling display of memory printing.
+ bool hexdump_;
+ unsigned int hexdump_width_;
+
+ // The largest memory region that will be read from a minidump.
static uint32_t max_bytes_;
// Base address and size of the memory region, and its position in the
@@ -342,7 +354,7 @@ class MinidumpThreadList : public MinidumpStream {
static const uint32_t kStreamType = MD_THREAD_LIST_STREAM;
- bool Read(uint32_t aExpectedSize);
+ bool Read(uint32_t aExpectedSize) override;
// The largest number of threads that will be read from a minidump. The
// default is 256.
@@ -354,6 +366,8 @@ class MinidumpThreadList : public MinidumpStream {
// The list of threads.
MinidumpThreads* threads_;
uint32_t thread_count_;
+
+ DISALLOW_COPY_AND_ASSIGN(MinidumpThreadList);
};
@@ -388,7 +402,15 @@ class MinidumpModule : public MinidumpObject,
virtual string debug_file() const;
virtual string debug_identifier() const;
virtual string version() const;
- virtual const CodeModule* Copy() const;
+ virtual CodeModule* Copy() const;
+ virtual bool is_unloaded() const { return false; }
+
+ // Getter and setter for shrink_down_delta. This is used when the address
+ // range for a module is shrunk down due to address range conflicts with
+ // other modules. The base_address and size fields are not updated and they
+ // should always reflect the original values (reported in the minidump).
+ virtual uint64_t shrink_down_delta() const;
+ virtual void SetShrinkDownDelta(uint64_t shrink_down_delta);
// The CodeView record, which contains information to locate the module's
// debugging information (pdb). This is returned as uint8_t* because
@@ -497,6 +519,10 @@ class MinidumpModuleList : public MinidumpStream,
virtual const MinidumpModule* GetModuleAtIndex(unsigned int index) const;
virtual const CodeModules* Copy() const;
+ // Returns a vector of all modules which address ranges needed to be shrunk
+ // down due to address range conflicts with other modules.
+ virtual vector<linked_ptr<const CodeModule> > GetShrunkRangeModules() const;
+
// Print a human-readable representation of the object to stdout.
void Print();
@@ -512,6 +538,12 @@ class MinidumpModuleList : public MinidumpStream,
bool Read(uint32_t expected_size);
+ bool StoreRange(const MinidumpModule& module,
+ uint64_t base_address,
+ uint32_t module_index,
+ uint32_t module_count,
+ bool is_android);
+
// The largest number of modules that will be read from a minidump. The
// default is 1024.
static uint32_t max_modules_;
@@ -521,6 +553,8 @@ class MinidumpModuleList : public MinidumpStream,
MinidumpModules *modules_;
uint32_t module_count_;
+
+ DISALLOW_COPY_AND_ASSIGN(MinidumpModuleList);
};
@@ -565,7 +599,7 @@ class MinidumpMemoryList : public MinidumpStream {
explicit MinidumpMemoryList(Minidump* minidump);
- bool Read(uint32_t expected_size);
+ bool Read(uint32_t expected_size) override;
// The largest number of memory regions that will be read from a minidump.
// The default is 256.
@@ -583,6 +617,8 @@ class MinidumpMemoryList : public MinidumpStream {
// The list of regions.
MemoryRegions *regions_;
uint32_t region_count_;
+
+ DISALLOW_COPY_AND_ASSIGN(MinidumpMemoryList);
};
@@ -618,10 +654,12 @@ class MinidumpException : public MinidumpStream {
explicit MinidumpException(Minidump* minidump);
- bool Read(uint32_t expected_size);
+ bool Read(uint32_t expected_size) override;
MDRawExceptionStream exception_;
MinidumpContext* context_;
+
+ DISALLOW_COPY_AND_ASSIGN(MinidumpException);
};
// MinidumpAssertion wraps MDRawAssertionInfo, which contains information
@@ -656,12 +694,14 @@ class MinidumpAssertion : public MinidumpStream {
explicit MinidumpAssertion(Minidump* minidump);
- bool Read(uint32_t expected_size);
+ bool Read(uint32_t expected_size) override;
MDRawAssertionInfo assertion_;
string expression_;
string function_;
string file_;
+
+ DISALLOW_COPY_AND_ASSIGN(MinidumpAssertion);
};
@@ -711,10 +751,123 @@ class MinidumpSystemInfo : public MinidumpStream {
static const uint32_t kStreamType = MD_SYSTEM_INFO_STREAM;
- bool Read(uint32_t expected_size);
+ bool Read(uint32_t expected_size) override;
// A string identifying the CPU vendor, if known.
const string* cpu_vendor_;
+
+ DISALLOW_COPY_AND_ASSIGN(MinidumpSystemInfo);
+};
+
+
+// MinidumpUnloadedModule wraps MDRawUnloadedModule
+class MinidumpUnloadedModule : public MinidumpObject,
+ public CodeModule {
+ public:
+ ~MinidumpUnloadedModule() override;
+
+ const MDRawUnloadedModule* module() const {
+ return valid_ ? &unloaded_module_ : NULL;
+ }
+
+ // CodeModule implementation
+ uint64_t base_address() const override {
+ return valid_ ? unloaded_module_.base_of_image : 0;
+ }
+ uint64_t size() const override {
+ return valid_ ? unloaded_module_.size_of_image : 0;
+ }
+ string code_file() const override;
+ string code_identifier() const override;
+ string debug_file() const override;
+ string debug_identifier() const override;
+ string version() const override;
+ CodeModule* Copy() const override;
+ bool is_unloaded() const override { return true; }
+ uint64_t shrink_down_delta() const override;
+ void SetShrinkDownDelta(uint64_t shrink_down_delta) override;
+
+ protected:
+ explicit MinidumpUnloadedModule(Minidump* minidump);
+
+ private:
+ // These objects are managed by MinidumpUnloadedModuleList
+ friend class MinidumpUnloadedModuleList;
+
+ // This works like MinidumpStream::Read, but is driven by
+ // MinidumpUnloadedModuleList.
+ bool Read(uint32_t expected_size);
+
+ // Reads the module name. This is done separately from Read to
+ // allow contiguous reading of code modules by MinidumpUnloadedModuleList.
+ bool ReadAuxiliaryData();
+
+ // True after a successful Read. This is different from valid_, which
+ // is not set true until ReadAuxiliaryData also completes successfully.
+ // module_valid_ is only used by ReadAuxiliaryData and the functions it
+ // calls to determine whether the object is ready for auxiliary data to
+ // be read.
+ bool module_valid_;
+
+ MDRawUnloadedModule unloaded_module_;
+
+ // Cached module name
+ const string* name_;
+};
+
+
+// MinidumpUnloadedModuleList contains all the unloaded code modules for a
+// process in the form of MinidumpUnloadedModules. It maintains a map of
+// these modules so that it may easily provide a code module corresponding
+// to a specific address. If multiple modules in the list have identical
+// ranges, only the first module encountered is recorded in the range map.
+class MinidumpUnloadedModuleList : public MinidumpStream,
+ public CodeModules {
+ public:
+ ~MinidumpUnloadedModuleList() override;
+
+ static void set_max_modules(uint32_t max_modules) {
+ max_modules_ = max_modules;
+ }
+ static uint32_t max_modules() { return max_modules_; }
+
+ // CodeModules implementation.
+ unsigned int module_count() const override {
+ return valid_ ? module_count_ : 0;
+ }
+ const MinidumpUnloadedModule*
+ GetModuleForAddress(uint64_t address) const override;
+ const MinidumpUnloadedModule* GetMainModule() const override;
+ const MinidumpUnloadedModule*
+ GetModuleAtSequence(unsigned int sequence) const override;
+ const MinidumpUnloadedModule*
+ GetModuleAtIndex(unsigned int index) const override;
+ const CodeModules* Copy() const override;
+ vector<linked_ptr<const CodeModule>> GetShrunkRangeModules() const override;
+
+ protected:
+ explicit MinidumpUnloadedModuleList(Minidump* minidump_);
+
+ private:
+ friend class Minidump;
+
+ typedef vector<MinidumpUnloadedModule> MinidumpUnloadedModules;
+
+ static const uint32_t kStreamType = MD_UNLOADED_MODULE_LIST_STREAM;
+
+ bool Read(uint32_t expected_size_) override;
+
+ // The largest number of modules that will be read from a minidump. The
+ // default is 1024.
+ static uint32_t max_modules_;
+
+ // Access to module indices using addresses as the key.
+ RangeMap<uint64_t, unsigned int> *range_map_;
+
+ MinidumpUnloadedModules *unloaded_modules_;
+ uint32_t module_count_;
+
+ DISALLOW_COPY_AND_ASSIGN(MinidumpUnloadedModuleList);
};
@@ -738,7 +891,7 @@ class MinidumpMiscInfo : public MinidumpStream {
explicit MinidumpMiscInfo(Minidump* minidump_);
- bool Read(uint32_t expected_size_);
+ bool Read(uint32_t expected_size_) override;
MDRawMiscInfo misc_info_;
@@ -748,6 +901,8 @@ class MinidumpMiscInfo : public MinidumpStream {
string daylight_name_;
string build_string_;
string dbg_bld_str_;
+
+ DISALLOW_COPY_AND_ASSIGN(MinidumpMiscInfo);
};
@@ -777,9 +932,11 @@ class MinidumpBreakpadInfo : public MinidumpStream {
explicit MinidumpBreakpadInfo(Minidump* minidump_);
- bool Read(uint32_t expected_size_);
+ bool Read(uint32_t expected_size_) override;
MDRawBreakpadInfo breakpad_info_;
+
+ DISALLOW_COPY_AND_ASSIGN(MinidumpBreakpadInfo);
};
// MinidumpMemoryInfo wraps MDRawMemoryInfo, which provides information
@@ -808,7 +965,7 @@ class MinidumpMemoryInfo : public MinidumpObject {
// These objects are managed by MinidumpMemoryInfoList.
friend class MinidumpMemoryInfoList;
- explicit MinidumpMemoryInfo(Minidump* minidump);
+ explicit MinidumpMemoryInfo(Minidump* minidump_);
// This works like MinidumpStream::Read, but is driven by
// MinidumpMemoryInfoList. No size checking is done, because
@@ -841,15 +998,141 @@ class MinidumpMemoryInfoList : public MinidumpStream {
static const uint32_t kStreamType = MD_MEMORY_INFO_LIST_STREAM;
- explicit MinidumpMemoryInfoList(Minidump* minidump);
+ explicit MinidumpMemoryInfoList(Minidump* minidump_);
- bool Read(uint32_t expected_size);
+ bool Read(uint32_t expected_size) override;
// Access to memory info using addresses as the key.
RangeMap<uint64_t, unsigned int> *range_map_;
MinidumpMemoryInfos* infos_;
uint32_t info_count_;
+
+ DISALLOW_COPY_AND_ASSIGN(MinidumpMemoryInfoList);
+};
+
+// MinidumpLinuxMaps wraps information about a single mapped memory region
+// from /proc/self/maps.
+class MinidumpLinuxMaps : public MinidumpObject {
+ public:
+ // The memory address of the base of the mapped region.
+ uint64_t GetBase() const { return valid_ ? region_.start : 0; }
+ // The size of the mapped region.
+ uint64_t GetSize() const { return valid_ ? region_.end - region_.start : 0; }
+
+ // The permissions of the mapped region.
+ bool IsReadable() const {
+ return valid_ ? region_.permissions & MappedMemoryRegion::READ : false;
+ }
+ bool IsWriteable() const {
+ return valid_ ? region_.permissions & MappedMemoryRegion::WRITE : false;
+ }
+ bool IsExecutable() const {
+ return valid_ ? region_.permissions & MappedMemoryRegion::EXECUTE : false;
+ }
+ bool IsPrivate() const {
+ return valid_ ? region_.permissions & MappedMemoryRegion::PRIVATE : false;
+ }
+
+ // The offset of the mapped region.
+ uint64_t GetOffset() const { return valid_ ? region_.offset : 0; }
+
+ // The major device number.
+ uint8_t GetMajorDevice() const { return valid_ ? region_.major_device : 0; }
+ // The minor device number.
+ uint8_t GetMinorDevice() const { return valid_ ? region_.minor_device : 0; }
+
+ // The inode of the mapped region.
+ uint64_t GetInode() const { return valid_ ? region_.inode : 0; }
+
+ // The pathname of the mapped region.
+ const string GetPathname() const { return valid_ ? region_.path : ""; }
+
+ // Print the contents of this mapping.
+ void Print() const;
+
+ private:
+ // These objects are managed by MinidumpLinuxMapsList.
+ friend class MinidumpLinuxMapsList;
+
+ // This caller owns the pointer.
+ explicit MinidumpLinuxMaps(Minidump *minidump);
+
+ // The memory region struct that this class wraps.
+ MappedMemoryRegion region_;
+
+ DISALLOW_COPY_AND_ASSIGN(MinidumpLinuxMaps);
+};
+
+// MinidumpLinuxMapsList corresponds to the Linux-exclusive MD_LINUX_MAPS
+// stream, which contains the contents of /prod/self/maps, which contains
+// the mapped memory regions and their access permissions.
+class MinidumpLinuxMapsList : public MinidumpStream {
+ public:
+ virtual ~MinidumpLinuxMapsList();
+
+ // Get number of mappings.
+ unsigned int get_maps_count() const { return valid_ ? maps_count_ : 0; }
+
+ // Get mapping at the given memory address. The caller owns the pointer.
+ const MinidumpLinuxMaps *GetLinuxMapsForAddress(uint64_t address) const;
+ // Get mapping at the given index. The caller owns the pointer.
+ const MinidumpLinuxMaps *GetLinuxMapsAtIndex(unsigned int index) const;
+
+ // Print the contents of /proc/self/maps to stdout.
+ void Print() const;
+
+ private:
+ friend class Minidump;
+
+ typedef vector<MinidumpLinuxMaps *> MinidumpLinuxMappings;
+
+ static const uint32_t kStreamType = MD_LINUX_MAPS;
+
+ // The caller owns the pointer.
+ explicit MinidumpLinuxMapsList(Minidump *minidump);
+
+ // Read and load the contents of the process mapping data.
+ // The stream should have data in the form of /proc/self/maps.
+ // This method returns whether the stream was read successfully.
+ bool Read(uint32_t expected_size) override;
+
+ // The list of individual mappings.
+ MinidumpLinuxMappings *maps_;
+ // The number of mappings.
+ uint32_t maps_count_;
+
+ DISALLOW_COPY_AND_ASSIGN(MinidumpLinuxMapsList);
+};
+
+// MinidumpCrashpadInfo wraps MDRawCrashpadInfo, which is an optional stream in
+// a minidump that provides additional information about the process state
+// at the time the minidump was generated.
+class MinidumpCrashpadInfo : public MinidumpStream {
+ public:
+ const MDRawCrashpadInfo* crashpad_info() const {
+ return valid_ ? &crashpad_info_ : NULL;
+ }
+
+ // Print a human-readable representation of the object to stdout.
+ void Print();
+
+ private:
+ friend class Minidump;
+
+ static const uint32_t kStreamType = MD_CRASHPAD_INFO_STREAM;
+
+ explicit MinidumpCrashpadInfo(Minidump* minidump_);
+
+ bool Read(uint32_t expected_size);
+
+ MDRawCrashpadInfo crashpad_info_;
+ std::vector<uint32_t> module_crashpad_info_links_;
+ std::vector<MDRawModuleCrashpadInfo> module_crashpad_info_;
+ std::vector<std::vector<std::string>> module_crashpad_info_list_annotations_;
+ std::vector<std::map<std::string, std::string>>
+ module_crashpad_info_simple_annotations_;
+ std::map<std::string, std::string> simple_annotations_;
};
@@ -858,7 +1141,9 @@ class MinidumpMemoryInfoList : public MinidumpStream {
class Minidump {
public:
// path is the pathname of a file containing the minidump.
- explicit Minidump(const string& path);
+ explicit Minidump(const string& path,
+ bool hexdump=false,
+ unsigned int hexdump_width=16);
// input is an istream wrapping minidump data. Minidump holds a
// weak pointer to input, and the caller must ensure that the stream
// is valid as long as the Minidump object is.
@@ -908,9 +1193,14 @@ class Minidump {
virtual MinidumpException* GetException();
virtual MinidumpAssertion* GetAssertion();
virtual MinidumpSystemInfo* GetSystemInfo();
+ virtual MinidumpUnloadedModuleList* GetUnloadedModuleList();
virtual MinidumpMiscInfo* GetMiscInfo();
virtual MinidumpBreakpadInfo* GetBreakpadInfo();
virtual MinidumpMemoryInfoList* GetMemoryInfoList();
+ MinidumpCrashpadInfo* GetCrashpadInfo();
+
+ // The next method also calls GetStream, but is exclusive for Linux dumps.
+ virtual MinidumpLinuxMapsList *GetLinuxMapsList();
// The next set of methods are provided for users who wish to access
// data in minidump files directly, while leveraging the rest of
@@ -935,13 +1225,21 @@ class Minidump {
// Returns the current position of the minidump file.
off_t Tell();
- // The next 2 methods are medium-level I/O routines.
+ // Medium-level I/O routines.
// ReadString returns a string which is owned by the caller! offset
// specifies the offset that a length-encoded string is stored at in the
// minidump file.
string* ReadString(off_t offset);
+ bool ReadUTF8String(off_t offset, string* string_utf8);
+
+ bool ReadStringList(off_t offset, std::vector<std::string>* string_list);
+
+ bool ReadSimpleStringDictionary(
+ off_t offset,
+ std::map<std::string, std::string>* simple_string_dictionary);
+
// SeekToStreamType positions the file at the beginning of a stream
// identified by stream_type, and informs the caller of the stream's
// length by setting *stream_length. Because stream_map maps each stream
@@ -958,9 +1256,21 @@ class Minidump {
bool swap() const { return valid_ ? swap_ : false; }
+ bool is_big_endian() const { return valid_ ? is_big_endian_ : false; }
+
// Print a human-readable representation of the object to stdout.
void Print();
+ // Is the OS Android.
+ bool IsAndroid();
+
+ // Determines the platform where the minidump was produced. |platform| is
+ // valid iff this method returns true.
+ bool GetPlatform(MDOSPlatform* platform);
+
+ // Get current hexdump display settings.
+ unsigned int HexdumpMode() const { return hexdump_ ? hexdump_width_ : 0; }
+
private:
// MinidumpStreamInfo is used in the MinidumpStreamMap. It lets
// the Minidump object locate interesting streams quickly, and
@@ -1017,10 +1327,19 @@ class Minidump {
// same-endian, this will be false.
bool swap_;
+ // true if the minidump was produced by a big-endian cpu.
+ bool is_big_endian_;
+
// Validity of the Minidump structure, false immediately after
// construction or after a failed Read(); true following a successful
// Read().
bool valid_;
+
+ // Knobs for controlling display of memory printing.
+ bool hexdump_;
+ unsigned int hexdump_width_;
+
+ DISALLOW_COPY_AND_ASSIGN(Minidump);
};
diff --git a/src/google_breakpad/processor/minidump_processor.h b/src/google_breakpad/processor/minidump_processor.h
index d2c94e2b..387115ef 100644
--- a/src/google_breakpad/processor/minidump_processor.h
+++ b/src/google_breakpad/processor/minidump_processor.h
@@ -125,6 +125,8 @@ class MinidumpProcessor {
// does not exist or cannot be determined.
static string GetAssertion(Minidump* dump);
+ void set_enable_objdump(bool enabled) { enable_objdump_ = enabled; }
+
private:
StackFrameSymbolizer* frame_symbolizer_;
// Indicate whether resolver_helper_ is owned by this instance.
@@ -134,6 +136,10 @@ class MinidumpProcessor {
// guess how likely it is that the crash represents an exploitable
// memory corruption issue.
bool enable_exploitability_;
+
+ // This flag permits the exploitability scanner to shell out to objdump
+ // for purposes of disassembly.
+ bool enable_objdump_;
};
} // namespace google_breakpad
diff --git a/src/google_breakpad/processor/proc_maps_linux.h b/src/google_breakpad/processor/proc_maps_linux.h
new file mode 100644
index 00000000..3045daa5
--- /dev/null
+++ b/src/google_breakpad/processor/proc_maps_linux.h
@@ -0,0 +1,60 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef BASE_DEBUG_PROC_MAPS_LINUX_H_
+#define BASE_DEBUG_PROC_MAPS_LINUX_H_
+
+#include <string>
+#include <vector>
+
+#include "common/using_std_string.h"
+#include "google_breakpad/common/breakpad_types.h"
+
+namespace google_breakpad {
+
+// Describes a region of mapped memory and the path of the file mapped.
+struct MappedMemoryRegion {
+ enum Permission {
+ READ = 1 << 0,
+ WRITE = 1 << 1,
+ EXECUTE = 1 << 2,
+ PRIVATE = 1 << 3, // If set, region is private, otherwise it is shared.
+ };
+
+ // The address range [start,end) of mapped memory.
+ uint64_t start;
+ uint64_t end;
+
+ // Byte offset into |path| of the range mapped into memory.
+ uint64_t offset;
+
+ // Bitmask of read/write/execute/private/shared permissions.
+ uint8_t permissions;
+
+ // Major and minor devices.
+ uint8_t major_device;
+ uint8_t minor_device;
+
+ // Value of the inode.
+ uint64_t inode;
+
+ // Name of the file mapped into memory.
+ //
+ // NOTE: path names aren't guaranteed to point at valid files. For example,
+ // "[heap]" and "[stack]" are used to represent the location of the process'
+ // heap and stack, respectively.
+ string path;
+
+ // The line from /proc/<pid>/maps that this struct represents.
+ string line;
+};
+
+// Parses /proc/<pid>/maps input data and stores in |regions|. Returns true
+// and updates |regions| if and only if all of |input| was successfully parsed.
+bool ParseProcMaps(const string& input,
+ std::vector<MappedMemoryRegion>* regions);
+
+} // namespace google_breakpad
+
+#endif // BASE_DEBUG_PROC_MAPS_LINUX_H_
diff --git a/src/google_breakpad/processor/process_state.h b/src/google_breakpad/processor/process_state.h
index ac3b6039..9bc44c45 100644
--- a/src/google_breakpad/processor/process_state.h
+++ b/src/google_breakpad/processor/process_state.h
@@ -39,8 +39,11 @@
#include "common/using_std_string.h"
#include "google_breakpad/common/breakpad_types.h"
-#include "google_breakpad/processor/system_info.h"
+#include "google_breakpad/processor/code_modules.h"
+#include "google_breakpad/processor/exception_record.h"
#include "google_breakpad/processor/minidump.h"
+#include "google_breakpad/processor/system_info.h"
+#include "processor/linked_ptr.h"
namespace google_breakpad {
@@ -89,7 +92,7 @@ enum ExploitabilityRating {
class ProcessState {
public:
- ProcessState() : modules_(NULL) { Clear(); }
+ ProcessState() : modules_(NULL), unloaded_modules_(NULL) { Clear(); }
~ProcessState();
// Resets the ProcessState to its default values
@@ -103,12 +106,17 @@ class ProcessState {
uint64_t crash_address() const { return crash_address_; }
string assertion() const { return assertion_; }
int requesting_thread() const { return requesting_thread_; }
+ const ExceptionRecord* exception_record() const { return &exception_record_; }
const vector<CallStack*>* threads() const { return &threads_; }
const vector<MemoryRegion*>* thread_memory_regions() const {
return &thread_memory_regions_;
}
const SystemInfo* system_info() const { return &system_info_; }
const CodeModules* modules() const { return modules_; }
+ const CodeModules* unloaded_modules() const { return unloaded_modules_; }
+ const vector<linked_ptr<const CodeModule> >* shrunk_range_modules() const {
+ return &shrunk_range_modules_;
+ }
const vector<const CodeModule*>* modules_without_symbols() const {
return &modules_without_symbols_;
}
@@ -160,6 +168,9 @@ class ProcessState {
// indicating that the dump thread is not available.
int requesting_thread_;
+ // Exception record details: code, flags, address, parameters.
+ ExceptionRecord exception_record_;
+
// Stacks for each thread (except possibly the exception handler
// thread) at the time of the crash.
vector<CallStack*> threads_;
@@ -172,6 +183,14 @@ class ProcessState {
// ProcessState.
const CodeModules *modules_;
+ // The modules that have been unloaded from the process represented by the
+ // ProcessState.
+ const CodeModules *unloaded_modules_;
+
+ // The modules which virtual address ranges were shrunk down due to
+ // virtual address conflicts.
+ vector<linked_ptr<const CodeModule> > shrunk_range_modules_;
+
// The modules that didn't have symbols when the report was processed.
vector<const CodeModule*> modules_without_symbols_;
@@ -180,7 +199,7 @@ class ProcessState {
// The exploitability rating as determined by the exploitability
// engine. When the exploitability engine is not enabled this
- // defaults to EXPLOITABILITY_NONE.
+ // defaults to EXPLOITABILITY_NOT_ANALYZED.
ExploitabilityRating exploitability_;
};
diff --git a/src/google_breakpad/processor/stack_frame.h b/src/google_breakpad/processor/stack_frame.h
index b55eb9c7..1491d788 100644
--- a/src/google_breakpad/processor/stack_frame.h
+++ b/src/google_breakpad/processor/stack_frame.h
@@ -84,7 +84,7 @@ struct StackFrame {
default:
return "unknown";
}
- };
+ }
// Return the actual return address, as saved on the stack or in a
// register. See the comments for 'instruction', below, for details.
diff --git a/src/google_breakpad/processor/stack_frame_symbolizer.h b/src/google_breakpad/processor/stack_frame_symbolizer.h
index 074907cb..0bbaae0a 100644
--- a/src/google_breakpad/processor/stack_frame_symbolizer.h
+++ b/src/google_breakpad/processor/stack_frame_symbolizer.h
@@ -75,9 +75,11 @@ class StackFrameSymbolizer {
// Encapsulate the step of resolving source line info for a stack frame.
// "frame" must not be NULL.
- virtual SymbolizerResult FillSourceLineInfo(const CodeModules* modules,
- const SystemInfo* system_info,
- StackFrame* stack_frame);
+ virtual SymbolizerResult FillSourceLineInfo(
+ const CodeModules* modules,
+ const CodeModules* unloaded_modules,
+ const SystemInfo* system_info,
+ StackFrame* stack_frame);
virtual WindowsFrameInfo* FindWindowsFrameInfo(const StackFrame* frame);
diff --git a/src/google_breakpad/processor/stackwalker.h b/src/google_breakpad/processor/stackwalker.h
index a1bd3e7f..0c458d50 100644
--- a/src/google_breakpad/processor/stackwalker.h
+++ b/src/google_breakpad/processor/stackwalker.h
@@ -89,8 +89,10 @@ class Stackwalker {
DumpContext* context,
MemoryRegion* memory,
const CodeModules* modules,
+ const CodeModules* unloaded_modules,
StackFrameSymbolizer* resolver_helper);
+
static void set_max_frames(uint32_t max_frames) {
max_frames_ = max_frames;
max_frames_set_ = true;
@@ -124,7 +126,15 @@ class Stackwalker {
// * This address is within a loaded module for which we have symbols,
// and falls inside a function in that module.
// Returns false otherwise.
- bool InstructionAddressSeemsValid(uint64_t address);
+ bool InstructionAddressSeemsValid(uint64_t address) const;
+
+ // Checks whether we should stop the stack trace.
+ // (either we reached the end-of-stack or we detected a
+ // broken callstack invariant)
+ bool TerminateWalk(uint64_t caller_ip,
+ uint64_t caller_sp,
+ uint64_t callee_sp,
+ bool first_unwind) const;
// The default number of words to search through on the stack
// for a return address.
@@ -189,6 +199,11 @@ class Stackwalker {
// This field is optional and may be NULL.
const CodeModules* modules_;
+ // A list of unloaded modules, for populating frames which aren't matched
+ // to any loaded modules.
+ // This field is optional and may be NULL.
+ const CodeModules* unloaded_modules_;
+
protected:
// The StackFrameSymbolizer implementation.
StackFrameSymbolizer* frame_symbolizer_;
@@ -210,6 +225,13 @@ class Stackwalker {
// the caller. |stack_scan_allowed| controls whether stack scanning is
// an allowable frame-recovery method, since it is desirable to be able to
// disable stack scanning in performance-critical use cases.
+ //
+ // CONSIDER: a way to differentiate between:
+ // - full stack traces
+ // - explicitly truncated traces (max_frames_)
+ // - stopping after max scanned frames
+ // - failed stack walk (breaking one of the stack walk invariants)
+ //
virtual StackFrame* GetCallerFrame(const CallStack* stack,
bool stack_scan_allowed) = 0;
diff --git a/src/google_breakpad/processor/system_info.h b/src/google_breakpad/processor/system_info.h
index 9583d9e8..8d2f60be 100644
--- a/src/google_breakpad/processor/system_info.h
+++ b/src/google_breakpad/processor/system_info.h
@@ -44,7 +44,7 @@ namespace google_breakpad {
struct SystemInfo {
public:
SystemInfo() : os(), os_short(), os_version(), cpu(), cpu_info(),
- cpu_count(0) {}
+ cpu_count(0), gl_version(), gl_vendor(), gl_renderer() {}
// Resets the SystemInfo object to its default values.
void Clear() {
@@ -54,6 +54,9 @@ struct SystemInfo {
cpu.clear();
cpu_info.clear();
cpu_count = 0;
+ gl_version.clear();
+ gl_vendor.clear();
+ gl_renderer.clear();
}
// A string identifying the operating system, such as "Windows NT",
@@ -91,6 +94,11 @@ struct SystemInfo {
// The number of processors in the system. Will be greater than one for
// multi-core systems.
int cpu_count;
+
+ // The GPU information. Currently only populated in microdumps.
+ string gl_version;
+ string gl_vendor;
+ string gl_renderer;
};
} // namespace google_breakpad
diff --git a/src/processor/basic_code_module.h b/src/processor/basic_code_module.h
index 3fe782bb..35d66a60 100644
--- a/src/processor/basic_code_module.h
+++ b/src/processor/basic_code_module.h
@@ -57,25 +57,30 @@ class BasicCodeModule : public CodeModule {
explicit BasicCodeModule(const CodeModule *that)
: base_address_(that->base_address()),
size_(that->size()),
+ shrink_down_delta_(that->shrink_down_delta()),
code_file_(that->code_file()),
code_identifier_(that->code_identifier()),
debug_file_(that->debug_file()),
debug_identifier_(that->debug_identifier()),
- version_(that->version()) {}
+ version_(that->version()),
+ is_unloaded_(that->is_unloaded()) {}
BasicCodeModule(uint64_t base_address, uint64_t size,
- const string &code_file,
- const string &code_identifier,
- const string &debug_file,
- const string &debug_identifier,
- const string &version)
- : base_address_(base_address),
- size_(size),
- code_file_(code_file),
- code_identifier_(code_identifier),
- debug_file_(debug_file),
- debug_identifier_(debug_identifier),
- version_(version)
+ const string &code_file,
+ const string &code_identifier,
+ const string &debug_file,
+ const string &debug_identifier,
+ const string &version,
+ const bool is_unloaded = false)
+ : base_address_(base_address),
+ size_(size),
+ shrink_down_delta_(0),
+ code_file_(code_file),
+ code_identifier_(code_identifier),
+ debug_file_(debug_file),
+ debug_identifier_(debug_identifier),
+ version_(version),
+ is_unloaded_(is_unloaded)
{}
virtual ~BasicCodeModule() {}
@@ -83,21 +88,28 @@ class BasicCodeModule : public CodeModule {
// members.
virtual uint64_t base_address() const { return base_address_; }
virtual uint64_t size() const { return size_; }
+ virtual uint64_t shrink_down_delta() const { return shrink_down_delta_; }
+ virtual void SetShrinkDownDelta(uint64_t shrink_down_delta) {
+ shrink_down_delta_ = shrink_down_delta;
+ }
virtual string code_file() const { return code_file_; }
virtual string code_identifier() const { return code_identifier_; }
virtual string debug_file() const { return debug_file_; }
virtual string debug_identifier() const { return debug_identifier_; }
virtual string version() const { return version_; }
- virtual const CodeModule* Copy() const { return new BasicCodeModule(this); }
+ virtual CodeModule* Copy() const { return new BasicCodeModule(this); }
+ virtual bool is_unloaded() const { return is_unloaded_; }
private:
uint64_t base_address_;
uint64_t size_;
+ uint64_t shrink_down_delta_;
string code_file_;
string code_identifier_;
string debug_file_;
string debug_identifier_;
string version_;
+ bool is_unloaded_;
// Disallow copy constructor and assignment operator.
BasicCodeModule(const BasicCodeModule &that);
diff --git a/src/processor/basic_code_modules.cc b/src/processor/basic_code_modules.cc
index 40b45a8b..f71aeb74 100644
--- a/src/processor/basic_code_modules.cc
+++ b/src/processor/basic_code_modules.cc
@@ -38,6 +38,8 @@
#include <assert.h>
+#include <vector>
+
#include "google_breakpad/processor/code_module.h"
#include "processor/linked_ptr.h"
#include "processor/logging.h"
@@ -45,51 +47,67 @@
namespace google_breakpad {
-BasicCodeModules::BasicCodeModules(const CodeModules *that)
- : main_address_(0),
- map_(new RangeMap<uint64_t, linked_ptr<const CodeModule> >()) {
+using std::vector;
+
+BasicCodeModules::BasicCodeModules(const CodeModules* that,
+ MergeRangeStrategy strategy)
+ : main_address_(0), map_() {
BPLOG_IF(ERROR, !that) << "BasicCodeModules::BasicCodeModules requires "
"|that|";
assert(that);
+ map_.SetMergeStrategy(strategy);
+
const CodeModule *main_module = that->GetMainModule();
if (main_module)
main_address_ = main_module->base_address();
unsigned int count = that->module_count();
- for (unsigned int module_sequence = 0;
- module_sequence < count;
- ++module_sequence) {
+ for (unsigned int i = 0; i < count; ++i) {
// Make a copy of the module and insert it into the map. Use
// GetModuleAtIndex because ordering is unimportant when slurping the
// entire list, and GetModuleAtIndex may be faster than
// GetModuleAtSequence.
- linked_ptr<const CodeModule> module(
- that->GetModuleAtIndex(module_sequence)->Copy());
- if (!map_->StoreRange(module->base_address(), module->size(), module)) {
- BPLOG(ERROR) << "Module " << module->code_file() <<
- " could not be stored";
+ linked_ptr<const CodeModule> module(that->GetModuleAtIndex(i)->Copy());
+ if (!map_.StoreRange(module->base_address(), module->size(), module)) {
+ BPLOG(ERROR) << "Module " << module->code_file()
+ << " could not be stored";
+ }
+ }
+
+ // Report modules with shrunk ranges.
+ for (unsigned int i = 0; i < count; ++i) {
+ linked_ptr<const CodeModule> module(that->GetModuleAtIndex(i)->Copy());
+ uint64_t delta = 0;
+ if (map_.RetrieveRange(module->base_address() + module->size() - 1,
+ &module, NULL /* base */, &delta, NULL /* size */) &&
+ delta > 0) {
+ BPLOG(INFO) << "The range for module " << module->code_file()
+ << " was shrunk down by " << HexString(delta) << " bytes.";
+ linked_ptr<CodeModule> shrunk_range_module(module->Copy());
+ shrunk_range_module->SetShrinkDownDelta(delta);
+ shrunk_range_modules_.push_back(shrunk_range_module);
}
}
-}
-BasicCodeModules::BasicCodeModules()
- : main_address_(0),
- map_(new RangeMap<uint64_t, linked_ptr<const CodeModule> >()) {
+ // TODO(ivanpe): Report modules with conflicting ranges. The list of such
+ // modules should be copied from |that|.
}
+BasicCodeModules::BasicCodeModules() : main_address_(0), map_() { }
+
BasicCodeModules::~BasicCodeModules() {
- delete map_;
}
unsigned int BasicCodeModules::module_count() const {
- return map_->GetCount();
+ return map_.GetCount();
}
const CodeModule* BasicCodeModules::GetModuleForAddress(
uint64_t address) const {
linked_ptr<const CodeModule> module;
- if (!map_->RetrieveRange(address, &module, NULL, NULL)) {
+ if (!map_.RetrieveRange(address, &module, NULL /* base */, NULL /* delta */,
+ NULL /* size */)) {
BPLOG(INFO) << "No module at " << HexString(address);
return NULL;
}
@@ -104,7 +122,8 @@ const CodeModule* BasicCodeModules::GetMainModule() const {
const CodeModule* BasicCodeModules::GetModuleAtSequence(
unsigned int sequence) const {
linked_ptr<const CodeModule> module;
- if (!map_->RetrieveRangeAtIndex(sequence, &module, NULL, NULL)) {
+ if (!map_.RetrieveRangeAtIndex(sequence, &module, NULL /* base */,
+ NULL /* delta */, NULL /* size */)) {
BPLOG(ERROR) << "RetrieveRangeAtIndex failed for sequence " << sequence;
return NULL;
}
@@ -122,7 +141,12 @@ const CodeModule* BasicCodeModules::GetModuleAtIndex(
}
const CodeModules* BasicCodeModules::Copy() const {
- return new BasicCodeModules(this);
+ return new BasicCodeModules(this, map_.GetMergeStrategy());
+}
+
+vector<linked_ptr<const CodeModule> >
+BasicCodeModules::GetShrunkRangeModules() const {
+ return shrunk_range_modules_;
}
} // namespace google_breakpad
diff --git a/src/processor/basic_code_modules.h b/src/processor/basic_code_modules.h
index ace569b8..45ebc53b 100644
--- a/src/processor/basic_code_modules.h
+++ b/src/processor/basic_code_modules.h
@@ -41,13 +41,16 @@
#ifndef PROCESSOR_BASIC_CODE_MODULES_H__
#define PROCESSOR_BASIC_CODE_MODULES_H__
+#include <stddef.h>
+
+#include <vector>
+
#include "google_breakpad/processor/code_modules.h"
+#include "processor/linked_ptr.h"
+#include "processor/range_map.h"
namespace google_breakpad {
-template<typename T> class linked_ptr;
-template<typename AddressType, typename EntryType> class RangeMap;
-
class BasicCodeModules : public CodeModules {
public:
// Creates a new BasicCodeModules object given any existing CodeModules
@@ -55,7 +58,7 @@ class BasicCodeModules : public CodeModules {
// the CodeModules and CodeModule interfaces without requiring all of the
// resources that other implementations may require. A copy will be
// made of each contained CodeModule using CodeModule::Copy.
- explicit BasicCodeModules(const CodeModules *that);
+ BasicCodeModules(const CodeModules *that, MergeRangeStrategy strategy);
virtual ~BasicCodeModules();
@@ -66,6 +69,8 @@ class BasicCodeModules : public CodeModules {
virtual const CodeModule* GetModuleAtSequence(unsigned int sequence) const;
virtual const CodeModule* GetModuleAtIndex(unsigned int index) const;
virtual const CodeModules* Copy() const;
+ virtual std::vector<linked_ptr<const CodeModule> >
+ GetShrunkRangeModules() const;
protected:
BasicCodeModules();
@@ -75,7 +80,11 @@ class BasicCodeModules : public CodeModules {
// The map used to contain each CodeModule, keyed by each CodeModule's
// address range.
- RangeMap<uint64_t, linked_ptr<const CodeModule> > *map_;
+ RangeMap<uint64_t, linked_ptr<const CodeModule> > map_;
+
+ // A vector of all CodeModules that were shrunk downs due to
+ // address range conflicts.
+ std::vector<linked_ptr<const CodeModule> > shrunk_range_modules_;
private:
// Disallow copy constructor and assignment operator.
diff --git a/src/processor/basic_source_line_resolver.cc b/src/processor/basic_source_line_resolver.cc
index 62aa4138..c4aa949c 100644
--- a/src/processor/basic_source_line_resolver.cc
+++ b/src/processor/basic_source_line_resolver.cc
@@ -56,10 +56,48 @@ using std::make_pair;
namespace google_breakpad {
#ifdef _WIN32
+#ifdef _MSC_VER
#define strtok_r strtok_s
+#endif
#define strtoull _strtoui64
#endif
+namespace {
+
+// Utility function to tokenize given the presence of an optional initial
+// field. In this case, optional_field is the expected string for the optional
+// field, and max_tokens is the maximum number of tokens including the optional
+// field. Refer to the documentation for Tokenize for descriptions of the other
+// arguments.
+bool TokenizeWithOptionalField(char *line,
+ const char *optional_field,
+ const char *separators,
+ int max_tokens,
+ vector<char*> *tokens) {
+ // First tokenize assuming the optional field is not present. If we then see
+ // the optional field, additionally tokenize the last token into two tokens.
+ if (!Tokenize(line, separators, max_tokens - 1, tokens)) {
+ return false;
+ }
+
+ if (strcmp(tokens->front(), optional_field) == 0) {
+ // The optional field is present. Split the last token in two to recover the
+ // field prior to the last.
+ vector<char*> last_tokens;
+ if (!Tokenize(tokens->back(), separators, 2, &last_tokens)) {
+ return false;
+ }
+ // Replace the previous last token with the two new tokens.
+ tokens->pop_back();
+ tokens->push_back(last_tokens[0]);
+ tokens->push_back(last_tokens[1]);
+ }
+
+ return true;
+}
+
+} // namespace
+
static const char *kWhitespace = " \r\n";
static const int kMaxErrorsPrinted = 5;
static const int kMaxErrorsBeforeBailing = 100;
@@ -201,15 +239,16 @@ void BasicSourceLineResolver::Module::LookupAddress(StackFrame *frame) const {
MemAddr function_base;
MemAddr function_size;
MemAddr public_address;
- if (functions_.RetrieveNearestRange(address, &func,
- &function_base, &function_size) &&
+ if (functions_.RetrieveNearestRange(address, &func, &function_base,
+ NULL /* delta */, &function_size) &&
address >= function_base && address - function_base < function_size) {
frame->function_name = func->name;
frame->function_base = frame->module->base_address() + function_base;
linked_ptr<Line> line;
MemAddr line_base;
- if (func->lines.RetrieveRange(address, &line, &line_base, NULL)) {
+ if (func->lines.RetrieveRange(address, &line, &line_base, NULL /* delta */,
+ NULL /* size */)) {
FileMap::const_iterator it = files_.find(line->source_file_id);
if (it != files_.end()) {
frame->source_file_name = files_.find(line->source_file_id)->second;
@@ -254,8 +293,8 @@ WindowsFrameInfo *BasicSourceLineResolver::Module::FindWindowsFrameInfo(
// comparison in an overflow-friendly way.
linked_ptr<Function> function;
MemAddr function_base, function_size;
- if (functions_.RetrieveNearestRange(address, &function,
- &function_base, &function_size) &&
+ if (functions_.RetrieveNearestRange(address, &function, &function_base,
+ NULL /* delta */, &function_size) &&
address >= function_base && address - function_base < function_size) {
result->parameter_size = function->parameter_size;
result->valid |= WindowsFrameInfo::VALID_PARAMETER_SIZE;
@@ -284,8 +323,8 @@ CFIFrameInfo *BasicSourceLineResolver::Module::FindCFIFrameInfo(
// provides an initial set of register recovery rules. Then, walk
// forward from the initial rule's starting address to frame's
// instruction address, applying delta rules.
- if (!cfi_initial_rules_.RetrieveRange(address, &initial_rules,
- &initial_base, &initial_size)) {
+ if (!cfi_initial_rules_.RetrieveRange(address, &initial_rules, &initial_base,
+ NULL /* delta */, &initial_size)) {
return NULL;
}
@@ -320,13 +359,14 @@ bool BasicSourceLineResolver::Module::ParseFile(char *file_line) {
BasicSourceLineResolver::Function*
BasicSourceLineResolver::Module::ParseFunction(char *function_line) {
+ bool is_multiple;
uint64_t address;
uint64_t size;
long stack_param_size;
char *name;
- if (SymbolParseHelper::ParseFunction(function_line, &address, &size,
- &stack_param_size, &name)) {
- return new Function(name, address, size, stack_param_size);
+ if (SymbolParseHelper::ParseFunction(function_line, &is_multiple, &address,
+ &size, &stack_param_size, &name)) {
+ return new Function(name, address, size, stack_param_size, is_multiple);
}
return NULL;
}
@@ -346,11 +386,12 @@ BasicSourceLineResolver::Line* BasicSourceLineResolver::Module::ParseLine(
}
bool BasicSourceLineResolver::Module::ParsePublicSymbol(char *public_line) {
+ bool is_multiple;
uint64_t address;
long stack_param_size;
char *name;
- if (SymbolParseHelper::ParsePublicSymbol(public_line, &address,
+ if (SymbolParseHelper::ParsePublicSymbol(public_line, &is_multiple, &address,
&stack_param_size, &name)) {
// A few public symbols show up with an address of 0. This has been seen
// in the dumped output of ntdll.pdb for symbols such as _CIlog, _CIpow,
@@ -363,7 +404,8 @@ bool BasicSourceLineResolver::Module::ParsePublicSymbol(char *public_line) {
}
linked_ptr<PublicSymbol> symbol(new PublicSymbol(name, address,
- stack_param_size));
+ stack_param_size,
+ is_multiple));
return public_symbols_.Store(address, symbol);
}
return false;
@@ -480,7 +522,7 @@ bool SymbolParseHelper::ParseFile(char *file_line, long *index,
}
*filename = tokens[1];
- if (!filename) {
+ if (!*filename) {
return false;
}
@@ -488,36 +530,39 @@ bool SymbolParseHelper::ParseFile(char *file_line, long *index,
}
// static
-bool SymbolParseHelper::ParseFunction(char *function_line, uint64_t *address,
- uint64_t *size, long *stack_param_size,
- char **name) {
- // FUNC <address> <size> <stack_param_size> <name>
+bool SymbolParseHelper::ParseFunction(char *function_line, bool *is_multiple,
+ uint64_t *address, uint64_t *size,
+ long *stack_param_size, char **name) {
+ // FUNC [<multiple>] <address> <size> <stack_param_size> <name>
assert(strncmp(function_line, "FUNC ", 5) == 0);
function_line += 5; // skip prefix
vector<char*> tokens;
- if (!Tokenize(function_line, kWhitespace, 4, &tokens)) {
+ if (!TokenizeWithOptionalField(function_line, "m", kWhitespace, 5, &tokens)) {
return false;
}
+ *is_multiple = strcmp(tokens[0], "m") == 0;
+ int next_token = *is_multiple ? 1 : 0;
+
char *after_number;
- *address = strtoull(tokens[0], &after_number, 16);
+ *address = strtoull(tokens[next_token++], &after_number, 16);
if (!IsValidAfterNumber(after_number) ||
*address == std::numeric_limits<unsigned long long>::max()) {
return false;
}
- *size = strtoull(tokens[1], &after_number, 16);
+ *size = strtoull(tokens[next_token++], &after_number, 16);
if (!IsValidAfterNumber(after_number) ||
*size == std::numeric_limits<unsigned long long>::max()) {
return false;
}
- *stack_param_size = strtol(tokens[2], &after_number, 16);
+ *stack_param_size = strtol(tokens[next_token++], &after_number, 16);
if (!IsValidAfterNumber(after_number) ||
*stack_param_size == std::numeric_limits<long>::max() ||
*stack_param_size < 0) {
return false;
}
- *name = tokens[3];
+ *name = tokens[next_token++];
return true;
}
@@ -568,32 +613,35 @@ bool SymbolParseHelper::ParseLine(char *line_line, uint64_t *address,
}
// static
-bool SymbolParseHelper::ParsePublicSymbol(char *public_line,
+bool SymbolParseHelper::ParsePublicSymbol(char *public_line, bool *is_multiple,
uint64_t *address,
long *stack_param_size,
char **name) {
- // PUBLIC <address> <stack_param_size> <name>
+ // PUBLIC [<multiple>] <address> <stack_param_size> <name>
assert(strncmp(public_line, "PUBLIC ", 7) == 0);
public_line += 7; // skip prefix
vector<char*> tokens;
- if (!Tokenize(public_line, kWhitespace, 3, &tokens)) {
+ if (!TokenizeWithOptionalField(public_line, "m", kWhitespace, 4, &tokens)) {
return false;
}
+ *is_multiple = strcmp(tokens[0], "m") == 0;
+ int next_token = *is_multiple ? 1 : 0;
+
char *after_number;
- *address = strtoull(tokens[0], &after_number, 16);
+ *address = strtoull(tokens[next_token++], &after_number, 16);
if (!IsValidAfterNumber(after_number) ||
*address == std::numeric_limits<unsigned long long>::max()) {
return false;
}
- *stack_param_size = strtol(tokens[1], &after_number, 16);
+ *stack_param_size = strtol(tokens[next_token++], &after_number, 16);
if (!IsValidAfterNumber(after_number) ||
*stack_param_size == std::numeric_limits<long>::max() ||
*stack_param_size < 0) {
return false;
}
- *name = tokens[2];
+ *name = tokens[next_token++];
return true;
}
diff --git a/src/processor/basic_source_line_resolver_types.h b/src/processor/basic_source_line_resolver_types.h
index a022bc0d..89eb57e8 100644
--- a/src/processor/basic_source_line_resolver_types.h
+++ b/src/processor/basic_source_line_resolver_types.h
@@ -60,11 +60,13 @@ BasicSourceLineResolver::Function : public SourceLineResolverBase::Function {
Function(const string &function_name,
MemAddr function_address,
MemAddr code_size,
- int set_parameter_size) : Base(function_name,
- function_address,
- code_size,
- set_parameter_size),
- lines() { }
+ int set_parameter_size,
+ bool is_mutiple) : Base(function_name,
+ function_address,
+ code_size,
+ set_parameter_size,
+ is_mutiple),
+ lines() { }
RangeMap< MemAddr, linked_ptr<Line> > lines;
private:
typedef SourceLineResolverBase::Function Base;
diff --git a/src/processor/basic_source_line_resolver_unittest.cc b/src/processor/basic_source_line_resolver_unittest.cc
index 7d4cd5c5..90c34172 100644
--- a/src/processor/basic_source_line_resolver_unittest.cc
+++ b/src/processor/basic_source_line_resolver_unittest.cc
@@ -68,9 +68,12 @@ class TestCodeModule : public CodeModule {
virtual string debug_file() const { return ""; }
virtual string debug_identifier() const { return ""; }
virtual string version() const { return ""; }
- virtual const CodeModule* Copy() const {
+ virtual CodeModule* Copy() const {
return new TestCodeModule(code_file_);
}
+ virtual bool is_unloaded() const { return false; }
+ virtual uint64_t shrink_down_delta() const { return 0; }
+ virtual void SetShrinkDownDelta(uint64_t shrink_down_delta) {}
private:
string code_file_;
@@ -452,16 +455,19 @@ TEST(SymbolParseHelper, ParseFileInvalid) {
}
// Test parsing of valid FUNC lines. The format is:
-// FUNC <address> <size> <stack_param_size> <name>
+// FUNC [<multiple>] <address> <size> <stack_param_size> <name>
TEST(SymbolParseHelper, ParseFunctionValid) {
+ bool multiple;
uint64_t address;
uint64_t size;
long stack_param_size;
char *name;
char kTestLine[] = "FUNC 1 2 3 function name";
- ASSERT_TRUE(SymbolParseHelper::ParseFunction(kTestLine, &address, &size,
- &stack_param_size, &name));
+ ASSERT_TRUE(SymbolParseHelper::ParseFunction(kTestLine, &multiple, &address,
+ &size, &stack_param_size,
+ &name));
+ EXPECT_FALSE(multiple);
EXPECT_EQ(1ULL, address);
EXPECT_EQ(2ULL, size);
EXPECT_EQ(3, stack_param_size);
@@ -469,25 +475,41 @@ TEST(SymbolParseHelper, ParseFunctionValid) {
// Test hex address, size, and param size.
char kTestLine1[] = "FUNC a1 a2 a3 function name";
- ASSERT_TRUE(SymbolParseHelper::ParseFunction(kTestLine1, &address, &size,
- &stack_param_size, &name));
+ ASSERT_TRUE(SymbolParseHelper::ParseFunction(kTestLine1, &multiple, &address,
+ &size, &stack_param_size,
+ &name));
+ EXPECT_FALSE(multiple);
EXPECT_EQ(0xa1ULL, address);
EXPECT_EQ(0xa2ULL, size);
EXPECT_EQ(0xa3, stack_param_size);
EXPECT_EQ("function name", string(name));
char kTestLine2[] = "FUNC 0 0 0 function name";
- ASSERT_TRUE(SymbolParseHelper::ParseFunction(kTestLine2, &address, &size,
- &stack_param_size, &name));
+ ASSERT_TRUE(SymbolParseHelper::ParseFunction(kTestLine2, &multiple, &address,
+ &size, &stack_param_size,
+ &name));
+ EXPECT_FALSE(multiple);
EXPECT_EQ(0ULL, address);
EXPECT_EQ(0ULL, size);
EXPECT_EQ(0, stack_param_size);
EXPECT_EQ("function name", string(name));
+
+ // Test optional multiple field.
+ char kTestLine3[] = "FUNC m a1 a2 a3 function name";
+ ASSERT_TRUE(SymbolParseHelper::ParseFunction(kTestLine3, &multiple, &address,
+ &size, &stack_param_size,
+ &name));
+ EXPECT_TRUE(multiple);
+ EXPECT_EQ(0xa1ULL, address);
+ EXPECT_EQ(0xa2ULL, size);
+ EXPECT_EQ(0xa3, stack_param_size);
+ EXPECT_EQ("function name", string(name));
}
// Test parsing of invalid FUNC lines. The format is:
-// FUNC <address> <size> <stack_param_size> <name>
+// FUNC [<multiple>] <address> <size> <stack_param_size> <name>
TEST(SymbolParseHelper, ParseFunctionInvalid) {
+ bool multiple;
uint64_t address;
uint64_t size;
long stack_param_size;
@@ -495,36 +517,49 @@ TEST(SymbolParseHelper, ParseFunctionInvalid) {
// Test missing function name.
char kTestLine[] = "FUNC 1 2 3 ";
- ASSERT_FALSE(SymbolParseHelper::ParseFunction(kTestLine, &address, &size,
- &stack_param_size, &name));
+ ASSERT_FALSE(SymbolParseHelper::ParseFunction(kTestLine, &multiple, &address,
+ &size, &stack_param_size,
+ &name));
// Test bad address.
char kTestLine1[] = "FUNC 1z 2 3 function name";
- ASSERT_FALSE(SymbolParseHelper::ParseFunction(kTestLine1, &address, &size,
- &stack_param_size, &name));
+ ASSERT_FALSE(SymbolParseHelper::ParseFunction(kTestLine1, &multiple, &address,
+ &size, &stack_param_size,
+ &name));
// Test large address.
char kTestLine2[] = "FUNC 123123123123123123123123123 2 3 function name";
- ASSERT_FALSE(SymbolParseHelper::ParseFunction(kTestLine2, &address, &size,
- &stack_param_size, &name));
+ ASSERT_FALSE(SymbolParseHelper::ParseFunction(kTestLine2, &multiple, &address,
+ &size, &stack_param_size,
+ &name));
// Test bad size.
char kTestLine3[] = "FUNC 1 z2 3 function name";
- ASSERT_FALSE(SymbolParseHelper::ParseFunction(kTestLine3, &address, &size,
- &stack_param_size, &name));
+ ASSERT_FALSE(SymbolParseHelper::ParseFunction(kTestLine3, &multiple, &address,
+ &size, &stack_param_size,
+ &name));
// Test large size.
char kTestLine4[] = "FUNC 1 231231231231231231231231232 3 function name";
- ASSERT_FALSE(SymbolParseHelper::ParseFunction(kTestLine4, &address, &size,
- &stack_param_size, &name));
+ ASSERT_FALSE(SymbolParseHelper::ParseFunction(kTestLine4, &multiple, &address,
+ &size, &stack_param_size,
+ &name));
// Test bad param size.
char kTestLine5[] = "FUNC 1 2 3z function name";
- ASSERT_FALSE(SymbolParseHelper::ParseFunction(kTestLine5, &address, &size,
- &stack_param_size, &name));
+ ASSERT_FALSE(SymbolParseHelper::ParseFunction(kTestLine5, &multiple, &address,
+ &size, &stack_param_size,
+ &name));
// Test large param size.
char kTestLine6[] = "FUNC 1 2 312312312312312312312312323 function name";
- ASSERT_FALSE(SymbolParseHelper::ParseFunction(kTestLine6, &address, &size,
- &stack_param_size, &name));
+ ASSERT_FALSE(SymbolParseHelper::ParseFunction(kTestLine6, &multiple, &address,
+ &size, &stack_param_size,
+ &name));
// Negative param size.
char kTestLine7[] = "FUNC 1 2 -5 function name";
- ASSERT_FALSE(SymbolParseHelper::ParseFunction(kTestLine7, &address, &size,
- &stack_param_size, &name));
+ ASSERT_FALSE(SymbolParseHelper::ParseFunction(kTestLine7, &multiple, &address,
+ &size, &stack_param_size,
+ &name));
+ // Test invalid optional field.
+ char kTestLine8[] = "FUNC x 1 2 5 function name";
+ ASSERT_FALSE(SymbolParseHelper::ParseFunction(kTestLine8, &multiple, &address,
+ &size, &stack_param_size,
+ &name));
}
// Test parsing of valid lines. The format is:
@@ -609,67 +644,96 @@ TEST(SymbolParseHelper, ParseLineInvalid) {
}
// Test parsing of valid PUBLIC lines. The format is:
-// PUBLIC <address> <stack_param_size> <name>
+// PUBLIC [<multiple>] <address> <stack_param_size> <name>
TEST(SymbolParseHelper, ParsePublicSymbolValid) {
+ bool multiple;
uint64_t address;
long stack_param_size;
char *name;
char kTestLine[] = "PUBLIC 1 2 3";
- ASSERT_TRUE(SymbolParseHelper::ParsePublicSymbol(kTestLine, &address,
- &stack_param_size, &name));
+ ASSERT_TRUE(SymbolParseHelper::ParsePublicSymbol(kTestLine, &multiple,
+ &address, &stack_param_size,
+ &name));
+ EXPECT_FALSE(multiple);
EXPECT_EQ(1ULL, address);
EXPECT_EQ(2, stack_param_size);
EXPECT_EQ("3", string(name));
// Test hex size and address.
char kTestLine1[] = "PUBLIC a1 a2 function name";
- ASSERT_TRUE(SymbolParseHelper::ParsePublicSymbol(kTestLine1, &address,
- &stack_param_size, &name));
+ ASSERT_TRUE(SymbolParseHelper::ParsePublicSymbol(kTestLine1, &multiple,
+ &address, &stack_param_size,
+ &name));
+ EXPECT_FALSE(multiple);
EXPECT_EQ(0xa1ULL, address);
EXPECT_EQ(0xa2, stack_param_size);
EXPECT_EQ("function name", string(name));
// Test 0 is a valid address.
char kTestLine2[] = "PUBLIC 0 a2 function name";
- ASSERT_TRUE(SymbolParseHelper::ParsePublicSymbol(kTestLine2, &address,
- &stack_param_size, &name));
+ ASSERT_TRUE(SymbolParseHelper::ParsePublicSymbol(kTestLine2, &multiple,
+ &address, &stack_param_size,
+ &name));
+ EXPECT_FALSE(multiple);
EXPECT_EQ(0ULL, address);
EXPECT_EQ(0xa2, stack_param_size);
EXPECT_EQ("function name", string(name));
+
+ // Test optional multiple field.
+ char kTestLine3[] = "PUBLIC m a1 a2 function name";
+ ASSERT_TRUE(SymbolParseHelper::ParsePublicSymbol(kTestLine3, &multiple,
+ &address, &stack_param_size,
+ &name));
+ EXPECT_TRUE(multiple);
+ EXPECT_EQ(0xa1ULL, address);
+ EXPECT_EQ(0xa2, stack_param_size);
+ EXPECT_EQ("function name", string(name));
}
// Test parsing of invalid PUBLIC lines. The format is:
-// PUBLIC <address> <stack_param_size> <name>
+// PUBLIC [<multiple>] <address> <stack_param_size> <name>
TEST(SymbolParseHelper, ParsePublicSymbolInvalid) {
+ bool multiple;
uint64_t address;
long stack_param_size;
char *name;
// Test missing source function name.
char kTestLine[] = "PUBLIC 1 2 ";
- ASSERT_FALSE(SymbolParseHelper::ParsePublicSymbol(kTestLine, &address,
- &stack_param_size, &name));
+ ASSERT_FALSE(SymbolParseHelper::ParsePublicSymbol(kTestLine, &multiple,
+ &address, &stack_param_size,
+ &name));
// Test bad address.
char kTestLine1[] = "PUBLIC 1z 2 3";
- ASSERT_FALSE(SymbolParseHelper::ParsePublicSymbol(kTestLine1, &address,
- &stack_param_size, &name));
+ ASSERT_FALSE(SymbolParseHelper::ParsePublicSymbol(kTestLine1, &multiple,
+ &address, &stack_param_size,
+ &name));
// Test large address.
char kTestLine2[] = "PUBLIC 123123123123123123123123 2 3";
- ASSERT_FALSE(SymbolParseHelper::ParsePublicSymbol(kTestLine2, &address,
- &stack_param_size, &name));
+ ASSERT_FALSE(SymbolParseHelper::ParsePublicSymbol(kTestLine2, &multiple,
+ &address, &stack_param_size,
+ &name));
// Test bad param stack size.
char kTestLine3[] = "PUBLIC 1 z2 3";
- ASSERT_FALSE(SymbolParseHelper::ParsePublicSymbol(kTestLine3, &address,
- &stack_param_size, &name));
+ ASSERT_FALSE(SymbolParseHelper::ParsePublicSymbol(kTestLine3, &multiple,
+ &address, &stack_param_size,
+ &name));
// Test large param stack size.
char kTestLine4[] = "PUBLIC 1 123123123123123123123123123 3";
- ASSERT_FALSE(SymbolParseHelper::ParsePublicSymbol(kTestLine4, &address,
- &stack_param_size, &name));
+ ASSERT_FALSE(SymbolParseHelper::ParsePublicSymbol(kTestLine4, &multiple,
+ &address, &stack_param_size,
+ &name));
// Test negative param stack size.
char kTestLine5[] = "PUBLIC 1 -5 3";
- ASSERT_FALSE(SymbolParseHelper::ParsePublicSymbol(kTestLine5, &address,
- &stack_param_size, &name));
+ ASSERT_FALSE(SymbolParseHelper::ParsePublicSymbol(kTestLine5, &multiple,
+ &address, &stack_param_size,
+ &name));
+ // Test invalid optional field.
+ char kTestLine6[] = "PUBLIC x 1 5 3";
+ ASSERT_FALSE(SymbolParseHelper::ParsePublicSymbol(kTestLine6, &multiple,
+ &address, &stack_param_size,
+ &name));
}
} // namespace
diff --git a/src/processor/binarystream.cc b/src/processor/binarystream.cc
deleted file mode 100644
index bf92225b..00000000
--- a/src/processor/binarystream.cc
+++ /dev/null
@@ -1,124 +0,0 @@
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include <arpa/inet.h>
-#include <limits.h>
-
-#include <string>
-#include <vector>
-
-#include "common/using_std_string.h"
-#include "processor/binarystream.h"
-
-namespace google_breakpad {
-using std::vector;
-
-binarystream &binarystream::operator>>(string &str) {
- uint16_t length;
- *this >> length;
- if (eof())
- return *this;
- if (length == 0) {
- str.clear();
- return *this;
- }
- vector<char> buffer(length);
- stream_.read(&buffer[0], length);
- if (!eof())
- str.assign(&buffer[0], length);
- return *this;
-}
-
-binarystream &binarystream::operator>>(uint8_t &u8) {
- stream_.read((char *)&u8, 1);
- return *this;
-}
-
-binarystream &binarystream::operator>>(uint16_t &u16) {
- uint16_t temp;
- stream_.read((char *)&temp, 2);
- if (!eof())
- u16 = ntohs(temp);
- return *this;
-}
-
-binarystream &binarystream::operator>>(uint32_t &u32) {
- uint32_t temp;
- stream_.read((char *)&temp, 4);
- if (!eof())
- u32 = ntohl(temp);
- return *this;
-}
-
-binarystream &binarystream::operator>>(uint64_t &u64) {
- uint32_t lower, upper;
- *this >> lower >> upper;
- if (!eof())
- u64 = static_cast<uint64_t>(lower) | (static_cast<uint64_t>(upper) << 32);
- return *this;
-}
-
-binarystream &binarystream::operator<<(const string &str) {
- if (str.length() > USHRT_MAX) {
- // truncate to 16-bit length
- *this << static_cast<uint16_t>(USHRT_MAX);
- stream_.write(str.c_str(), USHRT_MAX);
- } else {
- *this << (uint16_t)(str.length() & 0xFFFF);
- stream_.write(str.c_str(), str.length());
- }
- return *this;
-}
-
-binarystream &binarystream::operator<<(uint8_t u8) {
- stream_.write((const char*)&u8, 1);
- return *this;
-}
-
-binarystream &binarystream::operator<<(uint16_t u16) {
- u16 = htons(u16);
- stream_.write((const char*)&u16, 2);
- return *this;
-}
-
-binarystream &binarystream::operator<<(uint32_t u32) {
- u32 = htonl(u32);
- stream_.write((const char*)&u32, 4);
- return *this;
-}
-
-binarystream &binarystream::operator<<(uint64_t u64) {
- // write 64-bit ints as two 32-bit ints, so we can byte-swap them easily
- uint32_t lower = static_cast<uint32_t>(u64 & 0xFFFFFFFF);
- uint32_t upper = static_cast<uint32_t>(u64 >> 32);
- *this << lower << upper;
- return *this;
-}
-
-} // namespace google_breakpad
diff --git a/src/processor/binarystream.h b/src/processor/binarystream.h
deleted file mode 100644
index 172e09b9..00000000
--- a/src/processor/binarystream.h
+++ /dev/null
@@ -1,92 +0,0 @@
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// binarystream implements part of the std::iostream interface as a
-// wrapper around std::stringstream to allow reading and writing strings
-// and integers of known size.
-
-#ifndef GOOGLE_BREAKPAD_PROCESSOR_BINARYSTREAM_H_
-#define GOOGLE_BREAKPAD_PROCESSOR_BINARYSTREAM_H_
-
-#include <sstream>
-#include <string>
-
-#include "common/using_std_string.h"
-#include "google_breakpad/common/breakpad_types.h"
-
-namespace google_breakpad {
-using std::ios_base;
-using std::ios;
-
-class binarystream {
- public:
- explicit binarystream(ios_base::openmode which = ios_base::out|ios_base::in)
- : stream_(which) {}
- explicit binarystream(const string &str,
- ios_base::openmode which = ios_base::out|ios_base::in)
- : stream_(str, which) {}
- explicit binarystream(const char *str, size_t size,
- ios_base::openmode which = ios_base::out|ios_base::in)
- : stream_(string(str, size), which) {}
-
- binarystream &operator>>(string &str);
- binarystream &operator>>(uint8_t &u8);
- binarystream &operator>>(uint16_t &u16);
- binarystream &operator>>(uint32_t &u32);
- binarystream &operator>>(uint64_t &u64);
-
- // Note: strings are truncated at 65535 characters
- binarystream &operator<<(const string &str);
- binarystream &operator<<(uint8_t u8);
- binarystream &operator<<(uint16_t u16);
- binarystream &operator<<(uint32_t u32);
- binarystream &operator<<(uint64_t u64);
-
- // Forward a few methods directly from the stream object
- bool eof() const { return stream_.eof(); }
- void clear() { stream_.clear(); }
- string str() const { return stream_.str(); }
- void str(const string &s) { stream_.str(s); }
-
- // Seek both read and write pointers to the beginning of the stream.
- void rewind() {
- stream_.seekg (0, ios::beg);
- stream_.seekp (0, ios::beg);
- // This is to clear all the error flags, since only the EOF flag is cleared
- // with seekg().
- stream_.clear();
- }
-
- private:
- std::stringstream stream_;
-};
-
-} // namespace google_breakpad
-
-#endif // GOOGLE_BREAKPAD_PROCESSOR_BINARYSTREAM_H_
diff --git a/src/processor/binarystream_unittest.cc b/src/processor/binarystream_unittest.cc
deleted file mode 100644
index bf020edb..00000000
--- a/src/processor/binarystream_unittest.cc
+++ /dev/null
@@ -1,432 +0,0 @@
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include <ios>
-#include <string>
-#include <vector>
-
-#include "breakpad_googletest_includes.h"
-#include "common/using_std_string.h"
-#include "processor/binarystream.h"
-
-namespace {
-using std::ios_base;
-using std::vector;
-using google_breakpad::binarystream;
-
-
-class BinaryStreamBasicTest : public ::testing::Test {
-protected:
- binarystream stream;
-};
-
-TEST_F(BinaryStreamBasicTest, ReadU8) {
- uint8_t u8 = 0;
- ASSERT_FALSE(stream.eof());
- stream >> u8;
- ASSERT_TRUE(stream.eof());
- EXPECT_EQ(0U, u8);
- stream.rewind();
- stream.clear();
- stream << (uint8_t)1;
- ASSERT_FALSE(stream.eof());
- stream >> u8;
- EXPECT_EQ(1, u8);
- EXPECT_FALSE(stream.eof());
-}
-
-TEST_F(BinaryStreamBasicTest, ReadU16) {
- uint16_t u16 = 0;
- ASSERT_FALSE(stream.eof());
- stream >> u16;
- ASSERT_TRUE(stream.eof());
- EXPECT_EQ(0U, u16);
- stream.rewind();
- stream.clear();
- stream << (uint16_t)1;
- ASSERT_FALSE(stream.eof());
- stream >> u16;
- EXPECT_EQ(1, u16);
- EXPECT_FALSE(stream.eof());
-}
-
-TEST_F(BinaryStreamBasicTest, ReadU32) {
- uint32_t u32 = 0;
- ASSERT_FALSE(stream.eof());
- stream >> u32;
- ASSERT_TRUE(stream.eof());
- EXPECT_EQ(0U, u32);
- stream.rewind();
- stream.clear();
- stream << (uint32_t)1;
- ASSERT_FALSE(stream.eof());
- stream >> u32;
- EXPECT_EQ(1U, u32);
- EXPECT_FALSE(stream.eof());
-}
-
-TEST_F(BinaryStreamBasicTest, ReadU64) {
- uint64_t u64 = 0;
- ASSERT_FALSE(stream.eof());
- stream >> u64;
- ASSERT_TRUE(stream.eof());
- EXPECT_EQ(0U, u64);
- stream.rewind();
- stream.clear();
- stream << (uint64_t)1;
- ASSERT_FALSE(stream.eof());
- stream >> u64;
- EXPECT_EQ(1U, u64);
- EXPECT_FALSE(stream.eof());
-}
-
-TEST_F(BinaryStreamBasicTest, ReadString) {
- string s("");
- ASSERT_FALSE(stream.eof());
- stream >> s;
- ASSERT_TRUE(stream.eof());
- EXPECT_EQ("", s);
- // write an empty string to the stream, read it back
- s = "abcd";
- stream.rewind();
- stream.clear();
- stream << string("");
- stream >> s;
- EXPECT_EQ("", s);
- EXPECT_FALSE(stream.eof());
- stream.rewind();
- stream.clear();
- stream << string("test");
- ASSERT_FALSE(stream.eof());
- stream >> s;
- EXPECT_EQ("test", s);
- EXPECT_FALSE(stream.eof());
-}
-
-TEST_F(BinaryStreamBasicTest, ReadEmptyString) {
- string s("abc");
- stream << string("");
- stream >> s;
- EXPECT_EQ("", s);
-}
-
-TEST_F(BinaryStreamBasicTest, ReadMultiU8) {
- const uint8_t ea = 0, eb = 100, ec = 200, ed = 0xFF;
- uint8_t a, b, c, d, e;
- stream << ea << eb << ec << ed;
- stream >> a >> b >> c >> d;
- ASSERT_FALSE(stream.eof());
- EXPECT_EQ(ea, a);
- EXPECT_EQ(eb, b);
- EXPECT_EQ(ec, c);
- EXPECT_EQ(ed, d);
- ASSERT_FALSE(stream.eof());
- e = 0;
- stream >> e;
- EXPECT_EQ(0U, e);
- ASSERT_TRUE(stream.eof());
- // try reading all at once, including one past eof
- stream.rewind();
- stream.clear();
- ASSERT_FALSE(stream.eof());
- a = b = c = d = e = 0;
- stream << ea << eb << ec << ed;
- stream >> a >> b >> c >> d >> e;
- EXPECT_EQ(ea, a);
- EXPECT_EQ(eb, b);
- EXPECT_EQ(ec, c);
- EXPECT_EQ(ed, d);
- EXPECT_EQ(0U, e);
- EXPECT_TRUE(stream.eof());
-}
-
-TEST_F(BinaryStreamBasicTest, ReadMultiU16) {
- const uint16_t ea = 0, eb = 0x100, ec = 0x8000, ed = 0xFFFF;
- uint16_t a, b, c, d, e;
- stream << ea << eb << ec << ed;
- stream >> a >> b >> c >> d;
- ASSERT_FALSE(stream.eof());
- EXPECT_EQ(ea, a);
- EXPECT_EQ(eb, b);
- EXPECT_EQ(ec, c);
- EXPECT_EQ(ed, d);
- ASSERT_FALSE(stream.eof());
- e = 0;
- stream >> e;
- EXPECT_EQ(0U, e);
- EXPECT_TRUE(stream.eof());
- // try reading all at once, including one past eof
- stream.rewind();
- stream.clear();
- ASSERT_FALSE(stream.eof());
- a = b = c = d = e = 0;
- stream << ea << eb << ec << ed;
- stream >> a >> b >> c >> d >> e;
- EXPECT_EQ(ea, a);
- EXPECT_EQ(eb, b);
- EXPECT_EQ(ec, c);
- EXPECT_EQ(ed, d);
- EXPECT_EQ(0U, e);
- EXPECT_TRUE(stream.eof());
-}
-
-TEST_F(BinaryStreamBasicTest, ReadMultiU32) {
- const uint32_t ea = 0, eb = 0x10000, ec = 0x8000000, ed = 0xFFFFFFFF;
- uint32_t a, b, c, d, e;
- stream << ea << eb << ec << ed;
- stream >> a >> b >> c >> d;
- ASSERT_FALSE(stream.eof());
- EXPECT_EQ(ea, a);
- EXPECT_EQ(eb, b);
- EXPECT_EQ(ec, c);
- EXPECT_EQ(ed, d);
- ASSERT_FALSE(stream.eof());
- e = 0;
- stream >> e;
- EXPECT_EQ(0U, e);
- EXPECT_TRUE(stream.eof());
- // try reading all at once, including one past eof
- stream.rewind();
- stream.clear();
- ASSERT_FALSE(stream.eof());
- a = b = c = d = e = 0;
- stream << ea << eb << ec << ed;
- stream >> a >> b >> c >> d >> e;
- EXPECT_EQ(ea, a);
- EXPECT_EQ(eb, b);
- EXPECT_EQ(ec, c);
- EXPECT_EQ(ed, d);
- EXPECT_EQ(0U, e);
- EXPECT_TRUE(stream.eof());
-}
-
-TEST_F(BinaryStreamBasicTest, ReadMultiU64) {
- const uint64_t ea = 0, eb = 0x10000, ec = 0x100000000ULL,
- ed = 0xFFFFFFFFFFFFFFFFULL;
- uint64_t a, b, c, d, e;
- stream << ea << eb << ec << ed;
- stream >> a >> b >> c >> d;
- ASSERT_FALSE(stream.eof());
- EXPECT_EQ(ea, a);
- EXPECT_EQ(eb, b);
- EXPECT_EQ(ec, c);
- EXPECT_EQ(ed, d);
- ASSERT_FALSE(stream.eof());
- e = 0;
- stream >> e;
- EXPECT_EQ(0U, e);
- EXPECT_TRUE(stream.eof());
- // try reading all at once, including one past eof
- stream.rewind();
- stream.clear();
- ASSERT_FALSE(stream.eof());
- a = b = c = d = e = 0;
- stream << ea << eb << ec << ed;
- stream >> a >> b >> c >> d >> e;
- EXPECT_EQ(ea, a);
- EXPECT_EQ(eb, b);
- EXPECT_EQ(ec, c);
- EXPECT_EQ(ed, d);
- EXPECT_EQ(0U, e);
- EXPECT_TRUE(stream.eof());
-}
-
-TEST_F(BinaryStreamBasicTest, ReadMixed) {
- const uint8_t e8 = 0x10;
- const uint16_t e16 = 0x2020;
- const uint32_t e32 = 0x30303030;
- const uint64_t e64 = 0x4040404040404040ULL;
- const string es = "test";
- uint8_t u8 = 0;
- uint16_t u16 = 0;
- uint32_t u32 = 0;
- uint64_t u64 = 0;
- string s("test");
- stream << e8 << e16 << e32 << e64 << es;
- stream >> u8 >> u16 >> u32 >> u64 >> s;
- EXPECT_FALSE(stream.eof());
- EXPECT_EQ(e8, u8);
- EXPECT_EQ(e16, u16);
- EXPECT_EQ(e32, u32);
- EXPECT_EQ(e64, u64);
- EXPECT_EQ(es, s);
-}
-
-TEST_F(BinaryStreamBasicTest, ReadStringMissing) {
- // ensure that reading a string where only the length is present fails
- uint16_t u16 = 8;
- stream << u16;
- stream.rewind();
- string s("");
- stream >> s;
- EXPECT_EQ("", s);
- EXPECT_TRUE(stream.eof());
-}
-
-TEST_F(BinaryStreamBasicTest, ReadStringTruncated) {
- // ensure that reading a string where not all the data is present fails
- uint16_t u16 = 8;
- stream << u16;
- stream << (uint8_t)'t' << (uint8_t)'e' << (uint8_t)'s' << (uint8_t)'t';
- stream.rewind();
- string s("");
- stream >> s;
- EXPECT_EQ("", s);
- EXPECT_TRUE(stream.eof());
-}
-
-TEST_F(BinaryStreamBasicTest, StreamByteLength) {
- // Test that the stream buffer contains the right amount of data
- stream << (uint8_t)0 << (uint16_t)1 << (uint32_t)2 << (uint64_t)3
- << string("test");
- string s = stream.str();
- EXPECT_EQ(21U, s.length());
-}
-
-TEST_F(BinaryStreamBasicTest, AppendStreamResultsByteLength) {
- // Test that appending the str() results from two streams
- // gives the right byte length
- binarystream stream2;
- stream << (uint8_t)0 << (uint16_t)1;
- stream2 << (uint32_t)0 << (uint64_t)2
- << string("test");
- string s = stream.str();
- string s2 = stream2.str();
- s.append(s2);
- EXPECT_EQ(21U, s.length());
-}
-
-TEST_F(BinaryStreamBasicTest, StreamSetStr) {
- const string es("test");
- stream << es;
- binarystream stream2;
- stream2.str(stream.str());
- string s;
- stream2 >> s;
- EXPECT_FALSE(stream2.eof());
- EXPECT_EQ("test", s);
- s = "";
- stream2.str(stream.str());
- stream2.rewind();
- stream2 >> s;
- EXPECT_FALSE(stream2.eof());
- EXPECT_EQ("test", s);
-}
-
-class BinaryStreamU8Test : public ::testing::Test {
-protected:
- binarystream stream;
-
- void SetUp() {
- stream << (uint8_t)1;
- }
-};
-
-TEST_F(BinaryStreamU8Test, ReadU16) {
- uint16_t u16 = 0;
- ASSERT_FALSE(stream.eof());
- stream >> u16;
- ASSERT_TRUE(stream.eof());
- EXPECT_EQ(0U, u16);
-}
-
-TEST_F(BinaryStreamU8Test, ReadU32) {
- uint32_t u32 = 0;
- ASSERT_FALSE(stream.eof());
- stream >> u32;
- ASSERT_TRUE(stream.eof());
- EXPECT_EQ(0U, u32);
-}
-
-TEST_F(BinaryStreamU8Test, ReadU64) {
- uint64_t u64 = 0;
- ASSERT_FALSE(stream.eof());
- stream >> u64;
- ASSERT_TRUE(stream.eof());
- EXPECT_EQ(0U, u64);
-}
-
-TEST_F(BinaryStreamU8Test, ReadString) {
- string s("");
- ASSERT_FALSE(stream.eof());
- stream >> s;
- ASSERT_TRUE(stream.eof());
- EXPECT_EQ("", s);
-}
-
-
-TEST(BinaryStreamTest, InitWithData) {
- const char *data = "abcd";
- binarystream stream(data);
- uint8_t a, b, c, d;
- stream >> a >> b >> c >> d;
- ASSERT_FALSE(stream.eof());
- EXPECT_EQ('a', a);
- EXPECT_EQ('b', b);
- EXPECT_EQ('c', c);
- EXPECT_EQ('d', d);
-}
-
-TEST(BinaryStreamTest, InitWithDataLeadingNull) {
- const char *data = "\0abcd";
- binarystream stream(data, 5);
- uint8_t z, a, b, c, d;
- stream >> z >> a >> b >> c >> d;
- ASSERT_FALSE(stream.eof());
- EXPECT_EQ(0U, z);
- EXPECT_EQ('a', a);
- EXPECT_EQ('b', b);
- EXPECT_EQ('c', c);
- EXPECT_EQ('d', d);
-}
-
-TEST(BinaryStreamTest, InitWithDataVector) {
- vector<char> data;
- data.push_back('a');
- data.push_back('b');
- data.push_back('c');
- data.push_back('d');
- data.push_back('e');
- data.resize(4);
- binarystream stream(&data[0], data.size());
- uint8_t a, b, c, d;
- stream >> a >> b >> c >> d;
- ASSERT_FALSE(stream.eof());
- EXPECT_EQ('a', a);
- EXPECT_EQ('b', b);
- EXPECT_EQ('c', c);
- EXPECT_EQ('d', d);
-}
-
-} // namespace
-
-int main(int argc, char *argv[]) {
- ::testing::InitGoogleTest(&argc, argv);
- return RUN_ALL_TESTS();
-}
diff --git a/src/processor/call_stack.cc b/src/processor/call_stack.cc
index e3276716..925f0846 100644
--- a/src/processor/call_stack.cc
+++ b/src/processor/call_stack.cc
@@ -48,6 +48,7 @@ void CallStack::Clear() {
++iterator) {
delete *iterator;
}
+ tid_ = 0;
}
} // namespace google_breakpad
diff --git a/src/processor/cfi_frame_info.cc b/src/processor/cfi_frame_info.cc
index 5106ba09..0c4af7ba 100644
--- a/src/processor/cfi_frame_info.cc
+++ b/src/processor/cfi_frame_info.cc
@@ -43,7 +43,7 @@
namespace google_breakpad {
-#ifdef _WIN32
+#ifdef _MSC_VER
#define strtok_r strtok_s
#endif
diff --git a/src/processor/cfi_frame_info.h b/src/processor/cfi_frame_info.h
index bba2978e..90a1b3d7 100644
--- a/src/processor/cfi_frame_info.h
+++ b/src/processor/cfi_frame_info.h
@@ -54,7 +54,7 @@ class MemoryRegion;
// values, when the PC is at a given address in the current frame's
// function. See the description of 'STACK CFI' records at:
//
-// http://code.google.com/p/google-breakpad/wiki/SymbolFiles
+// https://chromium.googlesource.com/breakpad/breakpad/+/master/docs/symbol_files.md
//
// To prepare an instance of CFIFrameInfo for use at a given
// instruction, first populate it with the rules from the 'STACK CFI
diff --git a/src/testing/gtest/samples/sample2.cc b/src/processor/convert_old_arm64_context.cc
index 5f763b9b..d4b749e7 100644
--- a/src/testing/gtest/samples/sample2.cc
+++ b/src/processor/convert_old_arm64_context.cc
@@ -1,4 +1,4 @@
-// Copyright 2005, Google Inc.
+// Copyright (c) 2018, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
@@ -27,30 +27,41 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-// A sample program demonstrating using Google C++ testing framework.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-#include "sample2.h"
+#include "processor/convert_old_arm64_context.h"
#include <string.h>
-// Clones a 0-terminated C string, allocating memory using new.
-const char* MyString::CloneCString(const char* a_c_string) {
- if (a_c_string == NULL) return NULL;
+namespace google_breakpad {
- const size_t len = strlen(a_c_string);
- char* const clone = new char[ len + 1 ];
- memcpy(clone, a_c_string, len + 1);
+void ConvertOldARM64Context(const MDRawContextARM64_Old& old,
+ MDRawContextARM64* context) {
+ context->context_flags = MD_CONTEXT_ARM64;
+ if (old.context_flags & MD_CONTEXT_ARM64_INTEGER_OLD) {
+ context->context_flags |=
+ MD_CONTEXT_ARM64_INTEGER | MD_CONTEXT_ARM64_CONTROL;
+ }
+ if (old.context_flags & MD_CONTEXT_ARM64_FLOATING_POINT_OLD) {
+ context->context_flags |= MD_CONTEXT_ARM64_FLOATING_POINT;
+ }
- return clone;
-}
+ context->cpsr = old.cpsr;
-// Sets the 0-terminated C string this MyString object
-// represents.
-void MyString::Set(const char* a_c_string) {
- // Makes sure this works when c_string == c_string_
- const char* const temp = MyString::CloneCString(a_c_string);
- delete[] c_string_;
- c_string_ = temp;
+ static_assert(sizeof(old.iregs) == sizeof(context->iregs),
+ "iregs size mismatch");
+ memcpy(context->iregs, old.iregs, sizeof(context->iregs));
+
+ static_assert(sizeof(old.float_save.regs) == sizeof(context->float_save.regs),
+ "float_save.regs size mismatch");
+ memcpy(context->float_save.regs,
+ old.float_save.regs,
+ sizeof(context->float_save.regs));
+ context->float_save.fpcr = old.float_save.fpcr;
+ context->float_save.fpsr = old.float_save.fpsr;
+
+ memset(context->bcr, 0, sizeof(context->bcr));
+ memset(context->bvr, 0, sizeof(context->bvr));
+ memset(context->wcr, 0, sizeof(context->wcr));
+ memset(context->wvr, 0, sizeof(context->wvr));
}
+
+} // namespace google_breakpad
diff --git a/src/testing/gtest/samples/sample1.h b/src/processor/convert_old_arm64_context.h
index 3dfeb98c..8c0dfe90 100644
--- a/src/testing/gtest/samples/sample1.h
+++ b/src/processor/convert_old_arm64_context.h
@@ -1,4 +1,4 @@
-// Copyright 2005, Google Inc.
+// Copyright (c) 2018, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
@@ -27,17 +27,16 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-// A sample program demonstrating using Google C++ testing framework.
-//
-// Author: wan@google.com (Zhanyong Wan)
+#ifndef PROCESSOR_CONVERT_OLD_ARM64_CONTEXT_H__
+#define PROCESSOR_CONVERT_OLD_ARM64_CONTEXT_H__
+
+#include "google_breakpad/common/minidump_cpu_arm64.h"
-#ifndef GTEST_SAMPLES_SAMPLE1_H_
-#define GTEST_SAMPLES_SAMPLE1_H_
+namespace google_breakpad {
-// Returns n! (the factorial of n). For negative n, n! is defined to be 1.
-int Factorial(int n);
+void ConvertOldARM64Context(const MDRawContextARM64_Old& old,
+ MDRawContextARM64* context);
-// Returns true iff n is a prime number.
-bool IsPrime(int n);
+} // namespace google_breakpad
-#endif // GTEST_SAMPLES_SAMPLE1_H_
+#endif // PROCESSOR_CONVERT_OLD_ARM64_CONTEXT_H__
diff --git a/src/processor/disassembler_x86.cc b/src/processor/disassembler_x86.cc
index 9eba848d..55902240 100644
--- a/src/processor/disassembler_x86.cc
+++ b/src/processor/disassembler_x86.cc
@@ -27,7 +27,6 @@
#include "processor/disassembler_x86.h"
#include <string.h>
-#include <unistd.h>
namespace google_breakpad {
diff --git a/src/processor/dump_context.cc b/src/processor/dump_context.cc
index cadf93f7..da531b74 100644
--- a/src/processor/dump_context.cc
+++ b/src/processor/dump_context.cc
@@ -34,17 +34,14 @@
#include "google_breakpad/processor/dump_context.h"
#include <assert.h>
-#include <stdio.h>
#ifdef _WIN32
#include <io.h>
-#define PRIx64 "llx"
-#define PRIx32 "lx"
-#define snprintf _snprintf
#else // _WIN32
#include <unistd.h>
#endif // _WIN32
+#include "common/stdio_wrapper.h"
#include "processor/logging.h"
namespace google_breakpad {
@@ -134,7 +131,8 @@ const MDRawContextARM64* DumpContext::GetContextARM64() const {
}
const MDRawContextMIPS* DumpContext::GetContextMIPS() const {
- if (GetContextCPU() != MD_CONTEXT_MIPS) {
+ if ((GetContextCPU() != MD_CONTEXT_MIPS) &&
+ (GetContextCPU() != MD_CONTEXT_MIPS64)) {
BPLOG(ERROR) << "DumpContext cannot get MIPS context";
return NULL;
}
@@ -175,6 +173,7 @@ bool DumpContext::GetInstructionPointer(uint64_t* ip) const {
*ip = GetContextX86()->eip;
break;
case MD_CONTEXT_MIPS:
+ case MD_CONTEXT_MIPS64:
*ip = GetContextMIPS()->epc;
break;
default:
@@ -185,6 +184,50 @@ bool DumpContext::GetInstructionPointer(uint64_t* ip) const {
return true;
}
+bool DumpContext::GetStackPointer(uint64_t* sp) const {
+ BPLOG_IF(ERROR, !sp) << "DumpContext::GetStackPointer requires |sp|";
+ assert(sp);
+ *sp = 0;
+
+ if (!valid_) {
+ BPLOG(ERROR) << "Invalid DumpContext for GetStackPointer";
+ return false;
+ }
+
+ switch (GetContextCPU()) {
+ case MD_CONTEXT_AMD64:
+ *sp = GetContextAMD64()->rsp;
+ break;
+ case MD_CONTEXT_ARM:
+ *sp = GetContextARM()->iregs[MD_CONTEXT_ARM_REG_SP];
+ break;
+ case MD_CONTEXT_ARM64:
+ *sp = GetContextARM64()->iregs[MD_CONTEXT_ARM64_REG_SP];
+ break;
+ case MD_CONTEXT_PPC:
+ *sp = GetContextPPC()->gpr[MD_CONTEXT_PPC_REG_SP];
+ break;
+ case MD_CONTEXT_PPC64:
+ *sp = GetContextPPC64()->gpr[MD_CONTEXT_PPC64_REG_SP];
+ break;
+ case MD_CONTEXT_SPARC:
+ *sp = GetContextSPARC()->g_r[MD_CONTEXT_SPARC_REG_SP];
+ break;
+ case MD_CONTEXT_X86:
+ *sp = GetContextX86()->esp;
+ break;
+ case MD_CONTEXT_MIPS:
+ case MD_CONTEXT_MIPS64:
+ *sp = GetContextMIPS()->iregs[MD_CONTEXT_MIPS_REG_SP];
+ break;
+ default:
+ // This should never happen.
+ BPLOG(ERROR) << "Unknown CPU architecture in GetStackPointer";
+ return false;
+ }
+ return true;
+}
+
void DumpContext::SetContextFlags(uint32_t context_flags) {
context_flags_ = context_flags;
}
@@ -252,6 +295,7 @@ void DumpContext::FreeContext() {
break;
case MD_CONTEXT_MIPS:
+ case MD_CONTEXT_MIPS64:
delete context_.ctx_mips;
break;
@@ -505,22 +549,26 @@ void DumpContext::Print() {
case MD_CONTEXT_ARM: {
const MDRawContextARM* context_arm = GetContextARM();
+ const char * const names[] = {
+ "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
+ "r8", "r9", "r10", "r11", "r12", "sp", "lr", "pc",
+ };
printf("MDRawContextARM\n");
- printf(" context_flags = 0x%x\n",
+ printf(" context_flags = 0x%x\n",
context_arm->context_flags);
for (unsigned int ireg_index = 0;
ireg_index < MD_CONTEXT_ARM_GPR_COUNT;
++ireg_index) {
- printf(" iregs[%2d] = 0x%x\n",
- ireg_index, context_arm->iregs[ireg_index]);
+ printf(" %-3s = 0x%x\n",
+ names[ireg_index], context_arm->iregs[ireg_index]);
}
- printf(" cpsr = 0x%x\n", context_arm->cpsr);
+ printf(" cpsr = 0x%x\n", context_arm->cpsr);
printf(" float_save.fpscr = 0x%" PRIx64 "\n",
context_arm->float_save.fpscr);
for (unsigned int fpr_index = 0;
fpr_index < MD_FLOATINGSAVEAREA_ARM_FPR_COUNT;
++fpr_index) {
- printf(" float_save.regs[%2d] = 0x%" PRIx64 "\n",
+ printf(" float_save.regs[%2d] = 0x%" PRIx64 "\n",
fpr_index, context_arm->float_save.regs[fpr_index]);
}
for (unsigned int fpe_index = 0;
@@ -536,7 +584,7 @@ void DumpContext::Print() {
case MD_CONTEXT_ARM64: {
const MDRawContextARM64* context_arm64 = GetContextARM64();
printf("MDRawContextARM64\n");
- printf(" context_flags = 0x%" PRIx64 "\n",
+ printf(" context_flags = 0x%x\n",
context_arm64->context_flags);
for (unsigned int ireg_index = 0;
ireg_index < MD_CONTEXT_ARM64_GPR_COUNT;
@@ -555,10 +603,12 @@ void DumpContext::Print() {
printf(" float_save.regs[%2d] = 0x%" PRIx64 "%" PRIx64 "\n",
freg_index, fp_value.high, fp_value.low);
}
+
break;
}
- case MD_CONTEXT_MIPS: {
+ case MD_CONTEXT_MIPS:
+ case MD_CONTEXT_MIPS64: {
const MDRawContextMIPS* context_mips = GetContextMIPS();
printf("MDRawContextMIPS\n");
printf(" context_flags = 0x%x\n",
diff --git a/src/processor/exploitability.cc b/src/processor/exploitability.cc
index 384c499c..5f05b510 100644
--- a/src/processor/exploitability.cc
+++ b/src/processor/exploitability.cc
@@ -58,6 +58,13 @@ ExploitabilityRating Exploitability::CheckExploitability() {
Exploitability *Exploitability::ExploitabilityForPlatform(
Minidump *dump,
ProcessState *process_state) {
+ return ExploitabilityForPlatform(dump, process_state, false);
+}
+
+Exploitability *Exploitability::ExploitabilityForPlatform(
+ Minidump *dump,
+ ProcessState *process_state,
+ bool enable_objdump) {
Exploitability *platform_exploitability = NULL;
MinidumpSystemInfo *minidump_system_info = dump->GetSystemInfo();
if (!minidump_system_info)
@@ -75,7 +82,9 @@ Exploitability *Exploitability::ExploitabilityForPlatform(
break;
}
case MD_OS_LINUX: {
- platform_exploitability = new ExploitabilityLinux(dump, process_state);
+ platform_exploitability = new ExploitabilityLinux(dump,
+ process_state,
+ enable_objdump);
break;
}
case MD_OS_MAC_OS_X:
@@ -84,6 +93,7 @@ Exploitability *Exploitability::ExploitabilityForPlatform(
case MD_OS_SOLARIS:
case MD_OS_ANDROID:
case MD_OS_PS3:
+ case MD_OS_FUCHSIA:
default: {
platform_exploitability = NULL;
break;
diff --git a/src/processor/exploitability_linux.cc b/src/processor/exploitability_linux.cc
index 13ebad12..ccc9f145 100644
--- a/src/processor/exploitability_linux.cc
+++ b/src/processor/exploitability_linux.cc
@@ -36,20 +36,42 @@
#include "processor/exploitability_linux.h"
-#include "google_breakpad/processor/process_state.h"
+#ifndef _WIN32
+#include <regex.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <sstream>
+#include <iterator>
+#endif // _WIN32
+
+#include <string.h>
+
+#include "google_breakpad/common/minidump_exception_linux.h"
#include "google_breakpad/processor/call_stack.h"
+#include "google_breakpad/processor/process_state.h"
#include "google_breakpad/processor/stack_frame.h"
+#include "processor/logging.h"
namespace {
+// Prefixes for memory mapping names.
+constexpr char kHeapPrefix[] = "[heap";
+constexpr char kStackPrefix[] = "[stack";
+
// This function in libc is called if the program was compiled with
// -fstack-protector and a function's stack canary changes.
-const char kStackCheckFailureFunction[] = "__stack_chk_fail";
+constexpr char kStackCheckFailureFunction[] = "__stack_chk_fail";
// This function in libc is called if the program was compiled with
// -D_FORTIFY_SOURCE=2, a function like strcpy() is called, and the runtime
// can determine that the call would overflow the target buffer.
-const char kBoundsCheckFailureFunction[] = "__chk_fail";
+constexpr char kBoundsCheckFailureFunction[] = "__chk_fail";
+
+#ifndef _WIN32
+const unsigned int MAX_INSTRUCTION_LEN = 15;
+const unsigned int MAX_OBJDUMP_BUFFER_LEN = 4096;
+#endif // _WIN32
} // namespace
@@ -57,7 +79,15 @@ namespace google_breakpad {
ExploitabilityLinux::ExploitabilityLinux(Minidump *dump,
ProcessState *process_state)
- : Exploitability(dump, process_state) { }
+ : Exploitability(dump, process_state),
+ enable_objdump_(false) { }
+
+ExploitabilityLinux::ExploitabilityLinux(Minidump *dump,
+ ProcessState *process_state,
+ bool enable_objdump)
+ : Exploitability(dump, process_state),
+ enable_objdump_(enable_objdump) { }
+
ExploitabilityRating ExploitabilityLinux::CheckPlatformExploitability() {
// Check the crashing thread for functions suggesting a buffer overflow or
@@ -80,7 +110,517 @@ ExploitabilityRating ExploitabilityLinux::CheckPlatformExploitability() {
}
}
- return EXPLOITABILITY_NONE;
+ // Getting exception data. (It should exist for all minidumps.)
+ MinidumpException *exception = dump_->GetException();
+ if (exception == NULL) {
+ BPLOG(INFO) << "No exception record.";
+ return EXPLOITABILITY_ERR_PROCESSING;
+ }
+ const MDRawExceptionStream *raw_exception_stream = exception->exception();
+ if (raw_exception_stream == NULL) {
+ BPLOG(INFO) << "No raw exception stream.";
+ return EXPLOITABILITY_ERR_PROCESSING;
+ }
+
+ // Checking for benign exceptions that caused the crash.
+ if (this->BenignCrashTrigger(raw_exception_stream)) {
+ return EXPLOITABILITY_NONE;
+ }
+
+ // Check if the instruction pointer is in a valid instruction region
+ // by finding if it maps to an executable part of memory.
+ uint64_t instruction_ptr = 0;
+ uint64_t stack_ptr = 0;
+
+ const MinidumpContext *context = exception->GetContext();
+ if (context == NULL) {
+ BPLOG(INFO) << "No exception context.";
+ return EXPLOITABILITY_ERR_PROCESSING;
+ }
+
+ // Getting the instruction pointer.
+ if (!context->GetInstructionPointer(&instruction_ptr)) {
+ BPLOG(INFO) << "Failed to retrieve instruction pointer.";
+ return EXPLOITABILITY_ERR_PROCESSING;
+ }
+
+ // Getting the stack pointer.
+ if (!context->GetStackPointer(&stack_ptr)) {
+ BPLOG(INFO) << "Failed to retrieve stack pointer.";
+ return EXPLOITABILITY_ERR_PROCESSING;
+ }
+
+ // Checking for the instruction pointer in a valid instruction region,
+ // a misplaced stack pointer, and an executable stack or heap.
+ if (!this->InstructionPointerInCode(instruction_ptr) ||
+ this->StackPointerOffStack(stack_ptr) ||
+ this->ExecutableStackOrHeap()) {
+ return EXPLOITABILITY_HIGH;
+ }
+
+ // Check for write to read only memory or invalid memory, shelling out
+ // to objdump is enabled.
+ if (enable_objdump_ && this->EndedOnIllegalWrite(instruction_ptr)) {
+ return EXPLOITABILITY_HIGH;
+ }
+
+ // There was no strong evidence suggesting exploitability, but the minidump
+ // does not appear totally benign either.
+ return EXPLOITABILITY_INTERESTING;
+}
+
+bool ExploitabilityLinux::EndedOnIllegalWrite(uint64_t instruction_ptr) {
+#ifdef _WIN32
+ BPLOG(INFO) << "MinGW does not support fork and exec. Terminating method.";
+#else
+ // Get memory region containing instruction pointer.
+ MinidumpMemoryList *memory_list = dump_->GetMemoryList();
+ MinidumpMemoryRegion *memory_region =
+ memory_list ?
+ memory_list->GetMemoryRegionForAddress(instruction_ptr) : NULL;
+ if (!memory_region) {
+ BPLOG(INFO) << "No memory region around instruction pointer.";
+ return false;
+ }
+
+ // Get exception data to find architecture.
+ string architecture = "";
+ MinidumpException *exception = dump_->GetException();
+ // This should never evaluate to true, since this should not be reachable
+ // without checking for exception data earlier.
+ if (!exception) {
+ BPLOG(INFO) << "No exception data.";
+ return false;
+ }
+ const MDRawExceptionStream *raw_exception_stream = exception->exception();
+ const MinidumpContext *context = exception->GetContext();
+ // This should not evaluate to true, for the same reason mentioned above.
+ if (!raw_exception_stream || !context) {
+ BPLOG(INFO) << "No exception or architecture data.";
+ return false;
+ }
+ // Check architecture and set architecture variable to corresponding flag
+ // in objdump.
+ switch (context->GetContextCPU()) {
+ case MD_CONTEXT_X86:
+ architecture = "i386";
+ break;
+ case MD_CONTEXT_AMD64:
+ architecture = "i386:x86-64";
+ break;
+ default:
+ // Unsupported architecture. Note that ARM architectures are not
+ // supported because objdump does not support ARM.
+ return false;
+ break;
+ }
+
+ // Get memory region around instruction pointer and the number of bytes
+ // before and after the instruction pointer in the memory region.
+ const uint8_t *raw_memory = memory_region->GetMemory();
+ const uint64_t base = memory_region->GetBase();
+ if (base > instruction_ptr) {
+ BPLOG(ERROR) << "Memory region base value exceeds instruction pointer.";
+ return false;
+ }
+ const uint64_t offset = instruction_ptr - base;
+ if (memory_region->GetSize() < MAX_INSTRUCTION_LEN + offset) {
+ BPLOG(INFO) << "Not enough bytes left to guarantee complete instruction.";
+ return false;
+ }
+
+ // Convert bytes into objdump output.
+ char objdump_output_buffer[MAX_OBJDUMP_BUFFER_LEN] = {0};
+ DisassembleBytes(architecture,
+ raw_memory + offset,
+ MAX_OBJDUMP_BUFFER_LEN,
+ objdump_output_buffer);
+
+ string line;
+ if (!GetObjdumpInstructionLine(objdump_output_buffer, &line)) {
+ return false;
+ }
+
+ // Convert objdump instruction line into the operation and operands.
+ string instruction = "";
+ string dest = "";
+ string src = "";
+ TokenizeObjdumpInstruction(line, &instruction, &dest, &src);
+
+ // Check if the operation is a write to memory. First, the instruction
+ // must one that can write to memory. Second, the write destination
+ // must be a spot in memory rather than a register. Since there are no
+ // symbols from objdump, the destination will be enclosed by brackets.
+ if (dest.size() > 2 && dest.at(0) == '[' && dest.at(dest.size() - 1) == ']' &&
+ (!instruction.compare("mov") || !instruction.compare("inc") ||
+ !instruction.compare("dec") || !instruction.compare("and") ||
+ !instruction.compare("or") || !instruction.compare("xor") ||
+ !instruction.compare("not") || !instruction.compare("neg") ||
+ !instruction.compare("add") || !instruction.compare("sub") ||
+ !instruction.compare("shl") || !instruction.compare("shr"))) {
+ // Strip away enclosing brackets from the destination address.
+ dest = dest.substr(1, dest.size() - 2);
+ uint64_t write_address = 0;
+ CalculateAddress(dest, *context, &write_address);
+
+ // If the program crashed as a result of a write, the destination of
+ // the write must have been an address that did not permit writing.
+ // However, if the address is under 4k, due to program protections,
+ // the crash does not suggest exploitability for writes with such a
+ // low target address.
+ return write_address > 4096;
+ }
+#endif // _WIN32
+ return false;
+}
+
+#ifndef _WIN32
+bool ExploitabilityLinux::CalculateAddress(const string &address_expression,
+ const DumpContext &context,
+ uint64_t *write_address) {
+ // The destination should be the format reg+a or reg-a, where reg
+ // is a register and a is a hexadecimal constant. Although more complex
+ // expressions can make valid instructions, objdump's disassembly outputs
+ // it in this simpler format.
+ // TODO(liuandrew): Handle more complex formats, should they arise.
+
+ if (!write_address) {
+ BPLOG(ERROR) << "Null parameter.";
+ return false;
+ }
+
+ // Clone parameter into a non-const string.
+ string expression = address_expression;
+
+ // Parse out the constant that is added to the address (if it exists).
+ size_t delim = expression.find('+');
+ bool positive_add_constant = true;
+ // Check if constant is subtracted instead of added.
+ if (delim == string::npos) {
+ positive_add_constant = false;
+ delim = expression.find('-');
+ }
+ uint32_t add_constant = 0;
+ // Save constant and remove it from the expression.
+ if (delim != string::npos) {
+ if (!sscanf(expression.substr(delim + 1).c_str(), "%x", &add_constant)) {
+ BPLOG(ERROR) << "Failed to scan constant.";
+ return false;
+ }
+ expression = expression.substr(0, delim);
+ }
+
+ // Set the the write address to the corresponding register.
+ // TODO(liuandrew): Add support for partial registers, such as
+ // the rax/eax/ax/ah/al chain.
+ switch (context.GetContextCPU()) {
+ case MD_CONTEXT_X86:
+ if (!expression.compare("eax")) {
+ *write_address = context.GetContextX86()->eax;
+ } else if (!expression.compare("ebx")) {
+ *write_address = context.GetContextX86()->ebx;
+ } else if (!expression.compare("ecx")) {
+ *write_address = context.GetContextX86()->ecx;
+ } else if (!expression.compare("edx")) {
+ *write_address = context.GetContextX86()->edx;
+ } else if (!expression.compare("edi")) {
+ *write_address = context.GetContextX86()->edi;
+ } else if (!expression.compare("esi")) {
+ *write_address = context.GetContextX86()->esi;
+ } else if (!expression.compare("ebp")) {
+ *write_address = context.GetContextX86()->ebp;
+ } else if (!expression.compare("esp")) {
+ *write_address = context.GetContextX86()->esp;
+ } else if (!expression.compare("eip")) {
+ *write_address = context.GetContextX86()->eip;
+ } else {
+ BPLOG(ERROR) << "Unsupported register";
+ return false;
+ }
+ break;
+ case MD_CONTEXT_AMD64:
+ if (!expression.compare("rax")) {
+ *write_address = context.GetContextAMD64()->rax;
+ } else if (!expression.compare("rbx")) {
+ *write_address = context.GetContextAMD64()->rbx;
+ } else if (!expression.compare("rcx")) {
+ *write_address = context.GetContextAMD64()->rcx;
+ } else if (!expression.compare("rdx")) {
+ *write_address = context.GetContextAMD64()->rdx;
+ } else if (!expression.compare("rdi")) {
+ *write_address = context.GetContextAMD64()->rdi;
+ } else if (!expression.compare("rsi")) {
+ *write_address = context.GetContextAMD64()->rsi;
+ } else if (!expression.compare("rbp")) {
+ *write_address = context.GetContextAMD64()->rbp;
+ } else if (!expression.compare("rsp")) {
+ *write_address = context.GetContextAMD64()->rsp;
+ } else if (!expression.compare("rip")) {
+ *write_address = context.GetContextAMD64()->rip;
+ } else if (!expression.compare("r8")) {
+ *write_address = context.GetContextAMD64()->r8;
+ } else if (!expression.compare("r9")) {
+ *write_address = context.GetContextAMD64()->r9;
+ } else if (!expression.compare("r10")) {
+ *write_address = context.GetContextAMD64()->r10;
+ } else if (!expression.compare("r11")) {
+ *write_address = context.GetContextAMD64()->r11;
+ } else if (!expression.compare("r12")) {
+ *write_address = context.GetContextAMD64()->r12;
+ } else if (!expression.compare("r13")) {
+ *write_address = context.GetContextAMD64()->r13;
+ } else if (!expression.compare("r14")) {
+ *write_address = context.GetContextAMD64()->r14;
+ } else if (!expression.compare("r15")) {
+ *write_address = context.GetContextAMD64()->r15;
+ } else {
+ BPLOG(ERROR) << "Unsupported register";
+ return false;
+ }
+ break;
+ default:
+ // This should not occur since the same switch condition
+ // should have terminated this method.
+ return false;
+ break;
+ }
+
+ // Add or subtract constant from write address (if applicable).
+ *write_address =
+ positive_add_constant ?
+ *write_address + add_constant : *write_address - add_constant;
+
+ return true;
+}
+
+// static
+bool ExploitabilityLinux::GetObjdumpInstructionLine(
+ const char *objdump_output_buffer,
+ string *instruction_line) {
+ // Put buffer data into stream to output line-by-line.
+ std::stringstream objdump_stream;
+ objdump_stream.str(string(objdump_output_buffer));
+
+ // Pipe each output line into the string until the string contains the first
+ // instruction from objdump. All lines before the "<.data>:" section are
+ // skipped. Loop until the line shows the first instruction or there are no
+ // lines left.
+ bool data_section_seen = false;
+ do {
+ if (!getline(objdump_stream, *instruction_line)) {
+ BPLOG(INFO) << "Objdump instructions not found";
+ return false;
+ }
+ if (instruction_line->find("<.data>:") != string::npos) {
+ data_section_seen = true;
+ }
+ } while (!data_section_seen || instruction_line->find("0:") == string::npos);
+ // This first instruction contains the above substring.
+
+ return true;
+}
+
+bool ExploitabilityLinux::TokenizeObjdumpInstruction(const string &line,
+ string *operation,
+ string *dest,
+ string *src) {
+ if (!operation || !dest || !src) {
+ BPLOG(ERROR) << "Null parameters passed.";
+ return false;
+ }
+
+ // Set all pointer values to empty strings.
+ *operation = "";
+ *dest = "";
+ *src = "";
+
+ // Tokenize the objdump line.
+ vector<string> tokens;
+ std::istringstream line_stream(line);
+ copy(std::istream_iterator<string>(line_stream),
+ std::istream_iterator<string>(),
+ std::back_inserter(tokens));
+
+ // Regex for the data in hex form. Each byte is two hex digits.
+ regex_t regex;
+ regcomp(&regex, "^[[:xdigit:]]{2}$", REG_EXTENDED | REG_NOSUB);
+
+ // Find and set the location of the operator. The operator appears
+ // directly after the chain of bytes that define the instruction. The
+ // operands will be the last token, given that the instruction has operands.
+ // If not, the operator is the last token. The loop skips the first token
+ // because the first token is the instruction number (namely "0:").
+ string operands = "";
+ for (size_t i = 1; i < tokens.size(); i++) {
+ // Check if current token no longer is in byte format.
+ if (regexec(&regex, tokens[i].c_str(), 0, NULL, 0)) {
+ // instruction = tokens[i];
+ *operation = tokens[i];
+ // If the operator is the last token, there are no operands.
+ if (i != tokens.size() - 1) {
+ operands = tokens[tokens.size() - 1];
+ }
+ break;
+ }
+ }
+ regfree(&regex);
+
+ if (operation->empty()) {
+ BPLOG(ERROR) << "Failed to parse out operation from objdump instruction.";
+ return false;
+ }
+
+ // Split operands into source and destination (if applicable).
+ if (!operands.empty()) {
+ size_t delim = operands.find(',');
+ if (delim == string::npos) {
+ *dest = operands;
+ } else {
+ *dest = operands.substr(0, delim);
+ *src = operands.substr(delim + 1);
+ }
+ }
+ return true;
+}
+
+bool ExploitabilityLinux::DisassembleBytes(const string &architecture,
+ const uint8_t *raw_bytes,
+ const unsigned int buffer_len,
+ char *objdump_output_buffer) {
+ if (!raw_bytes || !objdump_output_buffer) {
+ BPLOG(ERROR) << "Bad input parameters.";
+ return false;
+ }
+
+ // Write raw bytes around instruction pointer to a temporary file to
+ // pass as an argument to objdump.
+ char raw_bytes_tmpfile[] = "/tmp/breakpad_mem_region-raw_bytes-XXXXXX";
+ int raw_bytes_fd = mkstemp(raw_bytes_tmpfile);
+ if (raw_bytes_fd < 0) {
+ BPLOG(ERROR) << "Failed to create tempfile.";
+ unlink(raw_bytes_tmpfile);
+ return false;
+ }
+ if (write(raw_bytes_fd, raw_bytes, MAX_INSTRUCTION_LEN)
+ != MAX_INSTRUCTION_LEN) {
+ BPLOG(ERROR) << "Writing of raw bytes failed.";
+ unlink(raw_bytes_tmpfile);
+ return false;
+ }
+
+ char cmd[1024] = {0};
+ snprintf(cmd,
+ 1024,
+ "objdump -D -b binary -M intel -m %s %s",
+ architecture.c_str(),
+ raw_bytes_tmpfile);
+ FILE *objdump_fp = popen(cmd, "r");
+ if (!objdump_fp) {
+ fclose(objdump_fp);
+ unlink(raw_bytes_tmpfile);
+ BPLOG(ERROR) << "Failed to call objdump.";
+ return false;
+ }
+ if (fread(objdump_output_buffer, 1, buffer_len, objdump_fp) <= 0) {
+ fclose(objdump_fp);
+ unlink(raw_bytes_tmpfile);
+ BPLOG(ERROR) << "Failed to read objdump output.";
+ return false;
+ }
+ fclose(objdump_fp);
+ unlink(raw_bytes_tmpfile);
+ return true;
+}
+#endif // _WIN32
+
+bool ExploitabilityLinux::StackPointerOffStack(uint64_t stack_ptr) {
+ MinidumpLinuxMapsList *linux_maps_list = dump_->GetLinuxMapsList();
+ // Inconclusive if there are no mappings available.
+ if (!linux_maps_list) {
+ return false;
+ }
+ const MinidumpLinuxMaps *linux_maps =
+ linux_maps_list->GetLinuxMapsForAddress(stack_ptr);
+ // Checks if the stack pointer maps to a valid mapping and if the mapping
+ // is not the stack. If the mapping has no name, it is inconclusive whether
+ // it is off the stack.
+ return !linux_maps || (linux_maps->GetPathname().compare("") &&
+ linux_maps->GetPathname().compare(
+ 0, strlen(kStackPrefix), kStackPrefix));
+}
+
+bool ExploitabilityLinux::ExecutableStackOrHeap() {
+ MinidumpLinuxMapsList *linux_maps_list = dump_->GetLinuxMapsList();
+ if (linux_maps_list) {
+ for (size_t i = 0; i < linux_maps_list->get_maps_count(); i++) {
+ const MinidumpLinuxMaps *linux_maps =
+ linux_maps_list->GetLinuxMapsAtIndex(i);
+ // Check for executable stack or heap for each mapping.
+ if (linux_maps && (!linux_maps->GetPathname().compare(
+ 0, strlen(kStackPrefix), kStackPrefix) ||
+ !linux_maps->GetPathname().compare(
+ 0, strlen(kHeapPrefix), kHeapPrefix)) &&
+ linux_maps->IsExecutable()) {
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
+bool ExploitabilityLinux::InstructionPointerInCode(uint64_t instruction_ptr) {
+ // Get Linux memory mapping from /proc/self/maps. Checking whether the
+ // region the instruction pointer is in has executable permission can tell
+ // whether it is in a valid code region. If there is no mapping for the
+ // instruction pointer, it is indicative that the instruction pointer is
+ // not within a module, which implies that it is outside a valid area.
+ MinidumpLinuxMapsList *linux_maps_list = dump_->GetLinuxMapsList();
+ const MinidumpLinuxMaps *linux_maps =
+ linux_maps_list ?
+ linux_maps_list->GetLinuxMapsForAddress(instruction_ptr) : NULL;
+ return linux_maps ? linux_maps->IsExecutable() : false;
+}
+
+bool ExploitabilityLinux::BenignCrashTrigger(const MDRawExceptionStream
+ *raw_exception_stream) {
+ // Check the cause of crash.
+ // If the exception of the crash is a benign exception,
+ // it is probably not exploitable.
+ switch (raw_exception_stream->exception_record.exception_code) {
+ case MD_EXCEPTION_CODE_LIN_SIGHUP:
+ case MD_EXCEPTION_CODE_LIN_SIGINT:
+ case MD_EXCEPTION_CODE_LIN_SIGQUIT:
+ case MD_EXCEPTION_CODE_LIN_SIGTRAP:
+ case MD_EXCEPTION_CODE_LIN_SIGABRT:
+ case MD_EXCEPTION_CODE_LIN_SIGFPE:
+ case MD_EXCEPTION_CODE_LIN_SIGKILL:
+ case MD_EXCEPTION_CODE_LIN_SIGUSR1:
+ case MD_EXCEPTION_CODE_LIN_SIGUSR2:
+ case MD_EXCEPTION_CODE_LIN_SIGPIPE:
+ case MD_EXCEPTION_CODE_LIN_SIGALRM:
+ case MD_EXCEPTION_CODE_LIN_SIGTERM:
+ case MD_EXCEPTION_CODE_LIN_SIGCHLD:
+ case MD_EXCEPTION_CODE_LIN_SIGCONT:
+ case MD_EXCEPTION_CODE_LIN_SIGSTOP:
+ case MD_EXCEPTION_CODE_LIN_SIGTSTP:
+ case MD_EXCEPTION_CODE_LIN_SIGTTIN:
+ case MD_EXCEPTION_CODE_LIN_SIGTTOU:
+ case MD_EXCEPTION_CODE_LIN_SIGURG:
+ case MD_EXCEPTION_CODE_LIN_SIGXCPU:
+ case MD_EXCEPTION_CODE_LIN_SIGXFSZ:
+ case MD_EXCEPTION_CODE_LIN_SIGVTALRM:
+ case MD_EXCEPTION_CODE_LIN_SIGPROF:
+ case MD_EXCEPTION_CODE_LIN_SIGWINCH:
+ case MD_EXCEPTION_CODE_LIN_SIGIO:
+ case MD_EXCEPTION_CODE_LIN_SIGPWR:
+ case MD_EXCEPTION_CODE_LIN_SIGSYS:
+ case MD_EXCEPTION_CODE_LIN_DUMP_REQUESTED:
+ return true;
+ break;
+ default:
+ return false;
+ break;
+ }
}
} // namespace google_breakpad
diff --git a/src/processor/exploitability_linux.h b/src/processor/exploitability_linux.h
index c63c0457..e3ff13b6 100644
--- a/src/processor/exploitability_linux.h
+++ b/src/processor/exploitability_linux.h
@@ -47,7 +47,81 @@ class ExploitabilityLinux : public Exploitability {
ExploitabilityLinux(Minidump *dump,
ProcessState *process_state);
+ // Parameters are the minidump to analyze, the object representing process
+ // state, and whether to enable objdump disassembly.
+ // Enabling objdump will allow exploitability analysis to call out to
+ // objdump for diassembly. It is used to check the identity of the
+ // instruction that caused the program to crash. If there are any
+ // portability concerns, this should not be enabled.
+ ExploitabilityLinux(Minidump *dump,
+ ProcessState *process_state,
+ bool enable_objdump);
+
virtual ExploitabilityRating CheckPlatformExploitability();
+
+ private:
+ friend class ExploitabilityLinuxTest;
+
+ // Takes the address of the instruction pointer and returns
+ // whether the instruction pointer lies in a valid instruction region.
+ bool InstructionPointerInCode(uint64_t instruction_ptr);
+
+ // Checks the exception that triggered the creation of the
+ // minidump and reports whether the exception suggests no exploitability.
+ bool BenignCrashTrigger(const MDRawExceptionStream *raw_exception_stream);
+
+ // This method checks if the crash occurred during a write to read-only or
+ // invalid memory. It does so by checking if the instruction at the
+ // instruction pointer is a write instruction, and if the target of the
+ // instruction is at a spot in memory that prohibits writes.
+ bool EndedOnIllegalWrite(uint64_t instruction_ptr);
+
+#ifndef _WIN32
+ // Disassembles raw bytes via objdump and pipes the output into the provided
+ // buffer, given the desired architecture, the file from which objdump will
+ // read, and the buffer length. The method returns whether the disassembly
+ // was a success, and the caller owns all pointers.
+ static bool DisassembleBytes(const string &architecture,
+ const uint8_t *raw_bytes,
+ const unsigned int MAX_OBJDUMP_BUFFER_LEN,
+ char *objdump_output_buffer);
+
+ // Parses the objdump output given in |objdump_output_buffer| and extracts
+ // the line of the first instruction into |instruction_line|. Returns true
+ // when the instruction line is successfully extracted.
+ static bool GetObjdumpInstructionLine(
+ const char *objdump_output_buffer,
+ string *instruction_line);
+
+ // Tokenizes out the operation and operands from a line of instruction
+ // disassembled by objdump. This method modifies the pointers to match the
+ // tokens of the instruction, and returns if the tokenizing was a success.
+ // The caller owns all pointers.
+ static bool TokenizeObjdumpInstruction(const string &line,
+ string *operation,
+ string *dest,
+ string *src);
+
+ // Calculates the effective address of an expression in the form reg+a or
+ // reg-a, where 'reg' is a register and 'a' is a constant, and writes the
+ // result in the pointer. The method returns whether the calculation was
+ // a success. The caller owns the pointer.
+ static bool CalculateAddress(const string &address_expression,
+ const DumpContext &context,
+ uint64_t *write_address);
+#endif // _WIN32
+
+ // Checks if the stack pointer points to a memory mapping that is not
+ // labelled as the stack.
+ bool StackPointerOffStack(uint64_t stack_ptr);
+
+ // Checks if the stack or heap are marked executable according
+ // to the memory mappings.
+ bool ExecutableStackOrHeap();
+
+ // Whether this exploitability engine is permitted to shell out to objdump
+ // to disassemble raw bytes.
+ bool enable_objdump_;
};
} // namespace google_breakpad
diff --git a/src/processor/exploitability_unittest.cc b/src/processor/exploitability_unittest.cc
index 72994d5a..528ee5f2 100644
--- a/src/processor/exploitability_unittest.cc
+++ b/src/processor/exploitability_unittest.cc
@@ -37,11 +37,42 @@
#include "google_breakpad/processor/basic_source_line_resolver.h"
#include "google_breakpad/processor/minidump_processor.h"
#include "google_breakpad/processor/process_state.h"
+#ifndef _WIN32
+#include "processor/exploitability_linux.h"
+#endif // _WIN32
#include "processor/simple_symbol_supplier.h"
+#ifndef _WIN32
+namespace google_breakpad {
+
+class ExploitabilityLinuxTest : public ExploitabilityLinux {
+ public:
+ using ExploitabilityLinux::CalculateAddress;
+ using ExploitabilityLinux::DisassembleBytes;
+ using ExploitabilityLinux::GetObjdumpInstructionLine;
+ using ExploitabilityLinux::TokenizeObjdumpInstruction;
+};
+
+class ExploitabilityLinuxTestMinidumpContext : public MinidumpContext {
+ public:
+ explicit ExploitabilityLinuxTestMinidumpContext(
+ const MDRawContextAMD64& context) : MinidumpContext(NULL) {
+ valid_ = true;
+ SetContextAMD64(new MDRawContextAMD64(context));
+ SetContextFlags(MD_CONTEXT_AMD64);
+ }
+};
+
+} // namespace google_breakpad
+#endif // _WIN32
+
namespace {
using google_breakpad::BasicSourceLineResolver;
+#ifndef _WIN32
+using google_breakpad::ExploitabilityLinuxTest;
+using google_breakpad::ExploitabilityLinuxTestMinidumpContext;
+#endif // _WIN32
using google_breakpad::MinidumpProcessor;
using google_breakpad::ProcessState;
using google_breakpad::SimpleSymbolSupplier;
@@ -59,6 +90,7 @@ ExploitabilityFor(const string& filename) {
SimpleSymbolSupplier supplier(TestDataDir() + "/symbols");
BasicSourceLineResolver resolver;
MinidumpProcessor processor(&supplier, &resolver, true);
+ processor.set_enable_objdump(true);
ProcessState state;
string minidump_file = TestDataDir() + "/" + filename;
@@ -107,11 +139,168 @@ TEST(ExploitabilityTest, TestWindowsEngine) {
}
TEST(ExploitabilityTest, TestLinuxEngine) {
- ASSERT_EQ(google_breakpad::EXPLOITABILITY_NONE,
+ ASSERT_EQ(google_breakpad::EXPLOITABILITY_INTERESTING,
ExploitabilityFor("linux_null_read_av.dmp"));
ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
ExploitabilityFor("linux_overflow.dmp"));
ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
ExploitabilityFor("linux_stacksmash.dmp"));
+ ASSERT_EQ(google_breakpad::EXPLOITABILITY_NONE,
+ ExploitabilityFor("linux_divide_by_zero.dmp"));
+ ASSERT_EQ(google_breakpad::EXPLOITABILITY_INTERESTING,
+ ExploitabilityFor("linux_null_dereference.dmp"));
+ ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
+ ExploitabilityFor("linux_jmp_to_0.dmp"));
+ ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
+ ExploitabilityFor("linux_outside_module.dmp"));
+ ASSERT_EQ(google_breakpad::EXPLOITABILITY_NONE,
+ ExploitabilityFor("linux_raise_sigabrt.dmp"));
+ ASSERT_EQ(google_breakpad::EXPLOITABILITY_INTERESTING,
+ ExploitabilityFor("linux_inside_module_exe_region1.dmp"));
+ ASSERT_EQ(google_breakpad::EXPLOITABILITY_INTERESTING,
+ ExploitabilityFor("linux_inside_module_exe_region2.dmp"));
+ ASSERT_EQ(google_breakpad::EXPLOITABILITY_INTERESTING,
+ ExploitabilityFor("linux_stack_pointer_in_stack.dmp"));
+ ASSERT_EQ(google_breakpad::EXPLOITABILITY_INTERESTING,
+ ExploitabilityFor("linux_stack_pointer_in_stack_alt_name.dmp"));
+ ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
+ ExploitabilityFor("linux_stack_pointer_in_module.dmp"));
+ ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
+ ExploitabilityFor("linux_executable_stack.dmp"));
+ ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
+ ExploitabilityFor("linux_executable_heap.dmp"));
+ ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
+ ExploitabilityFor("linux_jmp_to_module_not_exe_region.dmp"));
+#ifndef _WIN32
+ ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
+ ExploitabilityFor("linux_write_to_nonwritable_module.dmp"));
+ ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
+ ExploitabilityFor("linux_write_to_nonwritable_region_math.dmp"));
+ ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
+ ExploitabilityFor("linux_write_to_outside_module.dmp"));
+ ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
+ ExploitabilityFor("linux_write_to_outside_module_via_math.dmp"));
+ ASSERT_EQ(google_breakpad::EXPLOITABILITY_INTERESTING,
+ ExploitabilityFor("linux_write_to_under_4k.dmp"));
+#endif // _WIN32
}
+
+#ifndef _WIN32
+TEST(ExploitabilityLinuxUtilsTest, DisassembleBytesTest) {
+ ASSERT_FALSE(ExploitabilityLinuxTest::DisassembleBytes("", NULL, 5, NULL));
+ uint8_t bytes[6] = {0xc7, 0x0, 0x5, 0x0, 0x0, 0x0};
+ char buffer[1024] = {0};
+ ASSERT_TRUE(ExploitabilityLinuxTest::DisassembleBytes("i386:x86-64",
+ bytes,
+ 1024,
+ buffer));
+ std::stringstream objdump_stream;
+ objdump_stream.str(string(buffer));
+ string line = "";
+ while (line.find("<.data>") == string::npos)
+ getline(objdump_stream, line);
+ getline(objdump_stream, line);
+ ASSERT_EQ(line, " 0:\tc7 00 05 00 00 00 \tmov DWORD PTR [rax],0x5");
}
+
+TEST(ExploitabilityLinuxUtilsTest, GetObjdumpInstructionLine) {
+ string disassebly =
+ "\n"
+ "/tmp/breakpad_mem_region-raw_bytes-tMmMo0: file format binary\n"
+ "// Trying to confuse the parser 0:\n"
+ "\n"
+ "Disassembly of section .data:\n"
+ "\n"
+ "0000000000000000 <.data>:\n"
+ " 0:\tc7 00 01 00 00 00 \tmov DWORD PTR [rax],0x1\n"
+ " 6:\t5d \tpop rbp\n"
+ " 7:\tc3 \tret \n"
+ " 8:\t55 \tpush rbp\n"
+ " 9:\t48 89 e5 \tmov rbp,rsp\n"
+ " c:\t53 \tpush rbx\n"
+ " d:\t48 \trex.W\n"
+ " e:\t81 \t.byte 0x81\n";
+ string line;
+ EXPECT_TRUE(ExploitabilityLinuxTest::GetObjdumpInstructionLine(
+ disassebly.c_str(), &line));
+ EXPECT_EQ(" 0:\tc7 00 01 00 00 00 \tmov DWORD PTR [rax],0x1", line);
+
+ // There is no "0:" after "<.data>:". Expected to return false.
+ disassebly =
+ "\n"
+ "/tmp/breakpad_mem_region-raw_bytes-tMmMo0: file format binary\n"
+ "// Trying to confuse the parser 0:\n"
+ "\n"
+ "Disassembly of section .data:\n"
+ "\n"
+ " 0:\tc7 00 01 00 00 00 \tmov DWORD PTR [rax],0x1\n"
+ " 6:\t5d \tpop rbp\n"
+ " 7:\tc3 \tret \n"
+ " 8:\t55 \tpush rbp\n"
+ " 9:\t48 89 e5 \tmov rbp,rsp\n"
+ " d:\t48 \trex.W\n"
+ "0000000000000000 <.data>:\n"
+ " c:\t53 \tpush rbx\n";
+ EXPECT_FALSE(ExploitabilityLinuxTest::GetObjdumpInstructionLine(
+ disassebly.c_str(), &line));
+}
+
+TEST(ExploitabilityLinuxUtilsTest, TokenizeObjdumpInstructionTest) {
+ ASSERT_FALSE(ExploitabilityLinuxTest::TokenizeObjdumpInstruction("",
+ NULL,
+ NULL,
+ NULL));
+ string line = "0: c7 00 05 00 00 00 mov DWORD PTR [rax],0x5";
+ string operation = "";
+ string dest = "";
+ string src = "";
+ ASSERT_TRUE(ExploitabilityLinuxTest::TokenizeObjdumpInstruction(line,
+ &operation,
+ &dest,
+ &src));
+ ASSERT_EQ(operation, "mov");
+ ASSERT_EQ(dest, "[rax]");
+ ASSERT_EQ(src, "0x5");
+ line = "0: c3 ret";
+ ASSERT_TRUE(ExploitabilityLinuxTest::TokenizeObjdumpInstruction(line,
+ &operation,
+ &dest,
+ &src));
+ ASSERT_EQ(operation, "ret");
+ ASSERT_EQ(dest, "");
+ ASSERT_EQ(src, "");
+ line = "0: 5f pop rdi";
+ ASSERT_TRUE(ExploitabilityLinuxTest::TokenizeObjdumpInstruction(line,
+ &operation,
+ &dest,
+ &src));
+ ASSERT_EQ(operation, "pop");
+ ASSERT_EQ(dest, "rdi");
+ ASSERT_EQ(src, "");
+}
+
+TEST(ExploitabilityLinuxUtilsTest, CalculateAddressTest) {
+ MDRawContextAMD64 raw_context;
+ raw_context.rdx = 12345;
+ ExploitabilityLinuxTestMinidumpContext context(raw_context);
+ ASSERT_EQ(context.GetContextAMD64()->rdx, 12345U);
+ ASSERT_FALSE(ExploitabilityLinuxTest::CalculateAddress("", context, NULL));
+ uint64_t write_address = 0;
+ ASSERT_TRUE(ExploitabilityLinuxTest::CalculateAddress("rdx-0x4D2",
+ context,
+ &write_address));
+ ASSERT_EQ(write_address, 11111U);
+ ASSERT_TRUE(ExploitabilityLinuxTest::CalculateAddress("rdx+0x4D2",
+ context,
+ &write_address));
+ ASSERT_EQ(write_address, 13579U);
+ ASSERT_FALSE(ExploitabilityLinuxTest::CalculateAddress("rdx+rax",
+ context,
+ &write_address));
+ ASSERT_FALSE(ExploitabilityLinuxTest::CalculateAddress("0x3482+0x4D2",
+ context,
+ &write_address));
+}
+#endif // _WIN32
+
+} // namespace
diff --git a/src/processor/exploitability_win.cc b/src/processor/exploitability_win.cc
index 8a444eb2..a1f8703a 100644
--- a/src/processor/exploitability_win.cc
+++ b/src/processor/exploitability_win.cc
@@ -106,18 +106,14 @@ ExploitabilityRating ExploitabilityWin::CheckPlatformExploitability() {
uint64_t stack_ptr = 0;
uint64_t instruction_ptr = 0;
- switch (context->GetContextCPU()) {
- case MD_CONTEXT_X86:
- stack_ptr = context->GetContextX86()->esp;
- instruction_ptr = context->GetContextX86()->eip;
- break;
- case MD_CONTEXT_AMD64:
- stack_ptr = context->GetContextAMD64()->rsp;
- instruction_ptr = context->GetContextAMD64()->rip;
- break;
- default:
- BPLOG(INFO) << "Unsupported architecture.";
- return EXPLOITABILITY_ERR_PROCESSING;
+ // Getting the instruction pointer.
+ if (!context->GetInstructionPointer(&instruction_ptr)) {
+ return EXPLOITABILITY_ERR_PROCESSING;
+ }
+
+ // Getting the stack pointer.
+ if (!context->GetStackPointer(&stack_ptr)) {
+ return EXPLOITABILITY_ERR_PROCESSING;
}
// Check if we are executing on the stack.
diff --git a/src/processor/fast_source_line_resolver_unittest.cc b/src/processor/fast_source_line_resolver_unittest.cc
index 72632f84..87b13c52 100644
--- a/src/processor/fast_source_line_resolver_unittest.cc
+++ b/src/processor/fast_source_line_resolver_unittest.cc
@@ -79,9 +79,12 @@ class TestCodeModule : public CodeModule {
virtual string debug_file() const { return ""; }
virtual string debug_identifier() const { return ""; }
virtual string version() const { return ""; }
- virtual const CodeModule* Copy() const {
+ virtual CodeModule* Copy() const {
return new TestCodeModule(code_file_);
}
+ virtual bool is_unloaded() const { return false; }
+ virtual uint64_t shrink_down_delta() const { return 0; }
+ virtual void SetShrinkDownDelta(uint64_t shrink_down_delta) {}
private:
string code_file_;
diff --git a/src/processor/logging.cc b/src/processor/logging.cc
index 8bb95a69..d59175a7 100644
--- a/src/processor/logging.cc
+++ b/src/processor/logging.cc
@@ -35,20 +35,16 @@
#include <assert.h>
#include <errno.h>
-#include <stdio.h>
#include <string.h>
#include <time.h>
#include <string>
+#include "common/stdio_wrapper.h"
#include "common/using_std_string.h"
#include "processor/logging.h"
#include "processor/pathname_stripper.h"
-#ifdef _WIN32
-#define snprintf _snprintf
-#endif
-
namespace google_breakpad {
LogStream::LogStream(std::ostream &stream, Severity severity,
@@ -73,6 +69,9 @@ LogStream::LogStream(std::ostream &stream, Severity severity,
case SEVERITY_ERROR:
severity_string = "ERROR";
break;
+ case SEVERITY_CRITICAL:
+ severity_string = "CRITICAL";
+ break;
}
stream_ << time_string << ": " << PathnameStripper::File(file) << ":" <<
diff --git a/src/processor/logging.h b/src/processor/logging.h
index 406fb67c..a9f30920 100644
--- a/src/processor/logging.h
+++ b/src/processor/logging.h
@@ -94,7 +94,8 @@ class LogStream {
public:
enum Severity {
SEVERITY_INFO,
- SEVERITY_ERROR
+ SEVERITY_ERROR,
+ SEVERITY_CRITICAL
};
// Begin logging a message to the stream identified by |stream|, at the
@@ -146,9 +147,11 @@ int ErrnoString(string *error_string);
#define BPLOG_INIT(pargc, pargv)
#endif // BPLOG_INIT
+#ifndef BPLOG_LAZY_STREAM
#define BPLOG_LAZY_STREAM(stream, condition) \
!(condition) ? (void) 0 : \
google_breakpad::LogMessageVoidify() & (BPLOG_ ## stream)
+#endif
#ifndef BPLOG_MINIMUM_SEVERITY
#define BPLOG_MINIMUM_SEVERITY SEVERITY_INFO
@@ -180,7 +183,18 @@ int ErrnoString(string *error_string);
__FILE__, __LINE__)
#endif // BPLOG_ERROR
+#ifndef BPLOG_CRITICAL
+#ifndef BPLOG_CRITICAL_STREAM
+#define BPLOG_CRITICAL_STREAM std::cerr
+#endif // BPLOG_CRITICAL_STREAM
+#define BPLOG_CRITICAL google_breakpad::LogStream(BPLOG_CRITICAL_STREAM, \
+ google_breakpad::LogStream::SEVERITY_CRITICAL, \
+ __FILE__, __LINE__)
+#endif // BPLOG_CRITICAL
+
+#ifndef BPLOG_IF
#define BPLOG_IF(severity, condition) \
BPLOG_LAZY_STREAM(severity, ((condition) && BPLOG_LOG_IS_ON(severity)))
+#endif // BPLOG_IF
#endif // PROCESSOR_LOGGING_H__
diff --git a/src/processor/microdump.cc b/src/processor/microdump.cc
index bf628552..d8141a2a 100644
--- a/src/processor/microdump.cc
+++ b/src/processor/microdump.cc
@@ -44,6 +44,7 @@
#include "google_breakpad/common/minidump_cpu_arm.h"
#include "google_breakpad/processor/code_module.h"
#include "processor/basic_code_module.h"
+#include "processor/convert_old_arm64_context.h"
#include "processor/linked_ptr.h"
#include "processor/logging.h"
#include "processor/range_map-inl.h"
@@ -54,11 +55,17 @@ static const char kMicrodumpBegin[] = "-----BEGIN BREAKPAD MICRODUMP-----";
static const char kMicrodumpEnd[] = "-----END BREAKPAD MICRODUMP-----";
static const char kOsKey[] = ": O ";
static const char kCpuKey[] = ": C ";
+static const char kCrashReasonKey[] = ": R ";
+static const char kGpuKey[] = ": G ";
static const char kMmapKey[] = ": M ";
static const char kStackKey[] = ": S ";
static const char kStackFirstLineKey[] = ": S 0 ";
static const char kArmArchitecture[] = "arm";
static const char kArm64Architecture[] = "arm64";
+static const char kX86Architecture[] = "x86";
+static const char kMipsArchitecture[] = "mips";
+static const char kMips64Architecture[] = "mips64";
+static const char kGpuUnknown[] = "UNKNOWN";
template<typename T>
T HexStrToL(const string& str) {
@@ -76,6 +83,19 @@ std::vector<uint8_t> ParseHexBuf(const string& str) {
return buf;
}
+bool GetLine(std::istringstream* istream, string* str) {
+ if (std::getline(*istream, *str)) {
+ // Trim any trailing newline from the end of the line. Allows us
+ // to seamlessly handle both Windows/DOS and Unix formatted input. The
+ // adb tool generally writes logcat dumps in Windows/DOS format.
+ if (!str->empty() && str->at(str->size() - 1) == '\r') {
+ str->erase(str->size() - 1);
+ }
+ return true;
+ }
+ return false;
+}
+
} // namespace
namespace google_breakpad {
@@ -86,12 +106,16 @@ namespace google_breakpad {
void MicrodumpModules::Add(const CodeModule* module) {
linked_ptr<const CodeModule> module_ptr(module);
- if (!map_->StoreRange(module->base_address(), module->size(), module_ptr)) {
+ if (!map_.StoreRange(module->base_address(), module->size(), module_ptr)) {
BPLOG(ERROR) << "Module " << module->code_file() <<
" could not be stored";
}
}
+void MicrodumpModules::SetEnableModuleShrink(bool is_enabled) {
+ map_.SetMergeStrategy(is_enabled ? MergeRangeStrategy::kTruncateUpper
+ : MergeRangeStrategy::kExclusiveRanges);
+}
//
// MicrodumpContext
@@ -109,6 +133,24 @@ void MicrodumpContext::SetContextARM64(MDRawContextARM64* arm64) {
valid_ = true;
}
+void MicrodumpContext::SetContextX86(MDRawContextX86* x86) {
+ DumpContext::SetContextFlags(MD_CONTEXT_X86);
+ DumpContext::SetContextX86(x86);
+ valid_ = true;
+}
+
+void MicrodumpContext::SetContextMIPS(MDRawContextMIPS* mips32) {
+ DumpContext::SetContextFlags(MD_CONTEXT_MIPS);
+ DumpContext::SetContextMIPS(mips32);
+ valid_ = true;
+}
+
+void MicrodumpContext::SetContextMIPS64(MDRawContextMIPS* mips64) {
+ DumpContext::SetContextFlags(MD_CONTEXT_MIPS64);
+ DumpContext::SetContextMIPS(mips64);
+ valid_ = true;
+}
+
//
// MicrodumpMemoryRegion
@@ -173,7 +215,9 @@ Microdump::Microdump(const string& contents)
: context_(new MicrodumpContext()),
stack_region_(new MicrodumpMemoryRegion()),
modules_(new MicrodumpModules()),
- system_info_(new SystemInfo()) {
+ system_info_(new SystemInfo()),
+ crash_reason_(),
+ crash_address_(0u) {
assert(!contents.empty());
bool in_microdump = false;
@@ -183,7 +227,7 @@ Microdump::Microdump(const string& contents)
string arch;
std::istringstream stream(contents);
- while (std::getline(stream, line)) {
+ while (GetLine(&stream, &line)) {
if (line.find(kGoogleBreakpadKey) == string::npos) {
continue;
}
@@ -191,13 +235,12 @@ Microdump::Microdump(const string& contents)
in_microdump = true;
continue;
}
- if (line.find(kMicrodumpEnd) != string::npos) {
- break;
- }
-
if (!in_microdump) {
continue;
}
+ if (line.find(kMicrodumpEnd) != string::npos) {
+ break;
+ }
size_t pos;
if ((pos = line.find(kOsKey)) != string::npos) {
@@ -214,10 +257,10 @@ Microdump::Microdump(const string& contents)
os_tokens >> arch;
os_tokens >> num_cpus;
os_tokens >> hw_arch;
- std::getline(os_tokens, os_version);
+ GetLine(&os_tokens, &os_version);
os_version.erase(0, 1); // remove leading space.
- system_info_->cpu = hw_arch;
+ system_info_->cpu = arch;
system_info_->cpu_count = HexStrToL<uint8_t>(num_cpus);
system_info_->os_version = os_version;
@@ -227,6 +270,7 @@ Microdump::Microdump(const string& contents)
} else if (os_id == "A") {
system_info_->os = "Android";
system_info_->os_short = "android";
+ modules_->SetEnableModuleShrink(true);
}
// OS line also contains release and version for future use.
@@ -260,25 +304,81 @@ Microdump::Microdump(const string& contents)
std::vector<uint8_t> cpu_state_raw = ParseHexBuf(cpu_state_str);
if (strcmp(arch.c_str(), kArmArchitecture) == 0) {
if (cpu_state_raw.size() != sizeof(MDRawContextARM)) {
- std::cerr << "Malformed CPU context. Got " << cpu_state_raw.size() <<
- " bytes instead of " << sizeof(MDRawContextARM) << std::endl;
+ std::cerr << "Malformed CPU context. Got " << cpu_state_raw.size()
+ << " bytes instead of " << sizeof(MDRawContextARM)
+ << std::endl;
continue;
}
MDRawContextARM* arm = new MDRawContextARM();
memcpy(arm, &cpu_state_raw[0], cpu_state_raw.size());
context_->SetContextARM(arm);
} else if (strcmp(arch.c_str(), kArm64Architecture) == 0) {
- if (cpu_state_raw.size() != sizeof(MDRawContextARM64)) {
- std::cerr << "Malformed CPU context. Got " << cpu_state_raw.size() <<
- " bytes instead of " << sizeof(MDRawContextARM64) << std::endl;
+ if (cpu_state_raw.size() == sizeof(MDRawContextARM64)) {
+ MDRawContextARM64* arm = new MDRawContextARM64();
+ memcpy(arm, &cpu_state_raw[0], cpu_state_raw.size());
+ context_->SetContextARM64(arm);
+ } else if (cpu_state_raw.size() == sizeof(MDRawContextARM64_Old)) {
+ MDRawContextARM64_Old old_arm;
+ memcpy(&old_arm, &cpu_state_raw[0], cpu_state_raw.size());
+ MDRawContextARM64* new_arm = new MDRawContextARM64();
+ ConvertOldARM64Context(old_arm, new_arm);
+ context_->SetContextARM64(new_arm);
+ } else {
+ std::cerr << "Malformed CPU context. Got " << cpu_state_raw.size()
+ << " bytes instead of " << sizeof(MDRawContextARM64)
+ << std::endl;
continue;
}
- MDRawContextARM64* arm = new MDRawContextARM64();
- memcpy(arm, &cpu_state_raw[0], cpu_state_raw.size());
- context_->SetContextARM64(arm);
+ } else if (strcmp(arch.c_str(), kX86Architecture) == 0) {
+ if (cpu_state_raw.size() != sizeof(MDRawContextX86)) {
+ std::cerr << "Malformed CPU context. Got " << cpu_state_raw.size()
+ << " bytes instead of " << sizeof(MDRawContextX86)
+ << std::endl;
+ continue;
+ }
+ MDRawContextX86* x86 = new MDRawContextX86();
+ memcpy(x86, &cpu_state_raw[0], cpu_state_raw.size());
+ context_->SetContextX86(x86);
+ } else if (strcmp(arch.c_str(), kMipsArchitecture) == 0) {
+ if (cpu_state_raw.size() != sizeof(MDRawContextMIPS)) {
+ std::cerr << "Malformed CPU context. Got " << cpu_state_raw.size()
+ << " bytes instead of " << sizeof(MDRawContextMIPS)
+ << std::endl;
+ continue;
+ }
+ MDRawContextMIPS* mips32 = new MDRawContextMIPS();
+ memcpy(mips32, &cpu_state_raw[0], cpu_state_raw.size());
+ context_->SetContextMIPS(mips32);
+ } else if (strcmp(arch.c_str(), kMips64Architecture) == 0) {
+ if (cpu_state_raw.size() != sizeof(MDRawContextMIPS)) {
+ std::cerr << "Malformed CPU context. Got " << cpu_state_raw.size()
+ << " bytes instead of " << sizeof(MDRawContextMIPS)
+ << std::endl;
+ continue;
+ }
+ MDRawContextMIPS* mips64 = new MDRawContextMIPS();
+ memcpy(mips64, &cpu_state_raw[0], cpu_state_raw.size());
+ context_->SetContextMIPS64(mips64);
} else {
std::cerr << "Unsupported architecture: " << arch << std::endl;
}
+ } else if ((pos = line.find(kCrashReasonKey)) != string::npos) {
+ string crash_reason_str(line, pos + strlen(kCrashReasonKey));
+ std::istringstream crash_reason_tokens(crash_reason_str);
+ string signal;
+ string address;
+ crash_reason_tokens >> signal;
+ crash_reason_tokens >> crash_reason_;
+ crash_reason_tokens >> address;
+ crash_address_ = HexStrToL<uint64_t>(address);
+ } else if ((pos = line.find(kGpuKey)) != string::npos) {
+ string gpu_str(line, pos + strlen(kGpuKey));
+ if (strcmp(gpu_str.c_str(), kGpuUnknown) != 0) {
+ std::istringstream gpu_tokens(gpu_str);
+ std::getline(gpu_tokens, system_info_->gl_version, '|');
+ std::getline(gpu_tokens, system_info_->gl_vendor, '|');
+ std::getline(gpu_tokens, system_info_->gl_renderer, '|');
+ }
} else if ((pos = line.find(kMmapKey)) != string::npos) {
string mmap_line(line, pos + strlen(kMmapKey));
std::istringstream mmap_tokens(mmap_line);
@@ -303,4 +403,3 @@ Microdump::Microdump(const string& contents)
}
} // namespace google_breakpad
-
diff --git a/src/processor/microdump_processor.cc b/src/processor/microdump_processor.cc
index 366e3f30..2d3a9558 100644
--- a/src/processor/microdump_processor.cc
+++ b/src/processor/microdump_processor.cc
@@ -54,25 +54,20 @@ MicrodumpProcessor::MicrodumpProcessor(StackFrameSymbolizer* frame_symbolizer)
MicrodumpProcessor::~MicrodumpProcessor() {}
-ProcessResult MicrodumpProcessor::Process(const string &microdump_contents,
+ProcessResult MicrodumpProcessor::Process(Microdump *microdump,
ProcessState* process_state) {
assert(process_state);
process_state->Clear();
- if (microdump_contents.empty()) {
- BPLOG(ERROR) << "Microdump is empty.";
- return PROCESS_ERROR_MINIDUMP_NOT_FOUND;
- }
-
- Microdump microdump(microdump_contents);
- process_state->modules_ = microdump.GetModules()->Copy();
+ process_state->modules_ = microdump->GetModules()->Copy();
scoped_ptr<Stackwalker> stackwalker(
Stackwalker::StackwalkerForCPU(
&process_state->system_info_,
- microdump.GetContext(),
- microdump.GetMemory(),
+ microdump->GetContext(),
+ microdump->GetMemory(),
process_state->modules_,
+ /* unloaded_modules= */ NULL,
frame_symbolizer_));
scoped_ptr<CallStack> stack(new CallStack());
@@ -89,10 +84,12 @@ ProcessResult MicrodumpProcessor::Process(const string &microdump_contents,
}
process_state->threads_.push_back(stack.release());
- process_state->thread_memory_regions_.push_back(microdump.GetMemory());
+ process_state->thread_memory_regions_.push_back(microdump->GetMemory());
process_state->crashed_ = true;
process_state->requesting_thread_ = 0;
- process_state->system_info_ = *microdump.GetSystemInfo();
+ process_state->system_info_ = *microdump->GetSystemInfo();
+ process_state->crash_reason_ = microdump->GetCrashReason();
+ process_state->crash_address_ = microdump->GetCrashAddress();
return PROCESS_OK;
}
diff --git a/src/processor/microdump_processor_unittest.cc b/src/processor/microdump_processor_unittest.cc
index 10e5351c..83bdef95 100644
--- a/src/processor/microdump_processor_unittest.cc
+++ b/src/processor/microdump_processor_unittest.cc
@@ -37,6 +37,7 @@
#include "breakpad_googletest_includes.h"
#include "google_breakpad/processor/basic_source_line_resolver.h"
#include "google_breakpad/processor/call_stack.h"
+#include "google_breakpad/processor/microdump.h"
#include "google_breakpad/processor/microdump_processor.h"
#include "google_breakpad/processor/process_state.h"
#include "google_breakpad/processor/stack_frame.h"
@@ -47,6 +48,7 @@
namespace {
using google_breakpad::BasicSourceLineResolver;
+using google_breakpad::Microdump;
using google_breakpad::MicrodumpProcessor;
using google_breakpad::ProcessState;
using google_breakpad::SimpleSymbolSupplier;
@@ -83,11 +85,12 @@ class MicrodumpProcessorTest : public ::testing::Test {
StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
MicrodumpProcessor processor(&frame_symbolizer);
- return processor.Process(microdump_contents, state);
+ Microdump microdump(microdump_contents);
+ return processor.Process(&microdump, state);
}
- void AnalyzeDump(const string& microdump_file_name, ProcessState* state,
- bool omit_symbols) {
+ void AnalyzeDump(const string& microdump_file_name, bool omit_symbols,
+ int expected_cpu_count, ProcessState* state) {
string symbols_file = omit_symbols ? "" : files_path_ + "symbols/microdump";
string microdump_file_path = files_path_ + microdump_file_name;
string microdump_contents;
@@ -101,7 +104,7 @@ class MicrodumpProcessorTest : public ::testing::Test {
ASSERT_EQ(0, state->requesting_thread());
ASSERT_EQ(1U, state->threads()->size());
- ASSERT_EQ(2, state->system_info()->cpu_count);
+ ASSERT_EQ(expected_cpu_count, state->system_info()->cpu_count);
ASSERT_EQ("android", state->system_info()->os_short);
ASSERT_EQ("Android", state->system_info()->os);
}
@@ -109,13 +112,6 @@ class MicrodumpProcessorTest : public ::testing::Test {
string files_path_;
};
-TEST_F(MicrodumpProcessorTest, TestProcess_Empty) {
- ProcessState state;
- google_breakpad::ProcessResult result =
- ProcessMicrodump("", "", &state);
- ASSERT_EQ(google_breakpad::PROCESS_ERROR_MINIDUMP_NOT_FOUND, result);
-}
-
TEST_F(MicrodumpProcessorTest, TestProcess_Invalid) {
ProcessState state;
google_breakpad::ProcessResult result =
@@ -123,15 +119,32 @@ TEST_F(MicrodumpProcessorTest, TestProcess_Invalid) {
ASSERT_EQ(google_breakpad::PROCESS_ERROR_NO_THREAD_LIST, result);
}
+TEST_F(MicrodumpProcessorTest, TestProcess_WithoutCrashReason) {
+ ProcessState state;
+ AnalyzeDump("microdump-arm64.dmp", true /* omit_symbols */,
+ 2 /* expected_cpu_count */, &state);
+ ASSERT_EQ(state.crash_reason(), "");
+ ASSERT_EQ(state.crash_address(), 0x0u);
+}
+
+TEST_F(MicrodumpProcessorTest, TestProcess_WithCrashReason) {
+ ProcessState state;
+ AnalyzeDump("microdump-withcrashreason.dmp", true /* omit_symbols */,
+ 8 /* expected_cpu_count */, &state);
+ ASSERT_EQ(state.crash_reason(), "SIGTRAP");
+ ASSERT_EQ(state.crash_address(), 0x4A7CB000u);
+}
+
TEST_F(MicrodumpProcessorTest, TestProcess_MissingSymbols) {
ProcessState state;
- AnalyzeDump("microdump-arm64.dmp", &state, true /* omit_symbols */);
+ AnalyzeDump("microdump-arm64.dmp", true /* omit_symbols */,
+ 2 /* expected_cpu_count */, &state);
ASSERT_EQ(8U, state.modules()->module_count());
- ASSERT_EQ("aarch64", state.system_info()->cpu);
+ ASSERT_EQ("arm64", state.system_info()->cpu);
ASSERT_EQ("OS 64 VERSION INFO", state.system_info()->os_version);
ASSERT_EQ(1U, state.threads()->size());
- ASSERT_EQ(12U, state.threads()->at(0)->frames()->size());
+ ASSERT_EQ(11U, state.threads()->at(0)->frames()->size());
ASSERT_EQ("",
state.threads()->at(0)->frames()->at(0)->function_name);
@@ -155,10 +168,15 @@ TEST_F(MicrodumpProcessorTest, TestProcess_UnsupportedArch) {
TEST_F(MicrodumpProcessorTest, TestProcessArm) {
ProcessState state;
- AnalyzeDump("microdump-arm.dmp", &state, false /* omit_symbols */);
+ AnalyzeDump("microdump-arm.dmp", false /* omit_symbols */,
+ 2 /* expected_cpu_count*/, &state);
ASSERT_EQ(6U, state.modules()->module_count());
- ASSERT_EQ("armv7l", state.system_info()->cpu);
+ ASSERT_EQ("arm", state.system_info()->cpu);
+ ASSERT_EQ("OpenGL ES 3.0 V@104.0 AU@ (GIT@Id3510ff6dc)",
+ state.system_info()->gl_version);
+ ASSERT_EQ("Qualcomm", state.system_info()->gl_vendor);
+ ASSERT_EQ("Adreno (TM) 330", state.system_info()->gl_renderer);
ASSERT_EQ("OS VERSION INFO", state.system_info()->os_version);
ASSERT_EQ(8U, state.threads()->at(0)->frames()->size());
ASSERT_EQ("MicrodumpWriterTest_Setup_Test::TestBody",
@@ -173,10 +191,11 @@ TEST_F(MicrodumpProcessorTest, TestProcessArm) {
TEST_F(MicrodumpProcessorTest, TestProcessArm64) {
ProcessState state;
- AnalyzeDump("microdump-arm64.dmp", &state, false /* omit_symbols */);
+ AnalyzeDump("microdump-arm64.dmp", false /* omit_symbols */,
+ 2 /* expected_cpu_count*/, &state);
ASSERT_EQ(8U, state.modules()->module_count());
- ASSERT_EQ("aarch64", state.system_info()->cpu);
+ ASSERT_EQ("arm64", state.system_info()->cpu);
ASSERT_EQ("OS 64 VERSION INFO", state.system_info()->os_version);
ASSERT_EQ(9U, state.threads()->at(0)->frames()->size());
ASSERT_EQ("MicrodumpWriterTest_Setup_Test::TestBody",
@@ -189,6 +208,75 @@ TEST_F(MicrodumpProcessorTest, TestProcessArm64) {
state.threads()->at(0)->frames()->at(7)->module->code_file());
}
+TEST_F(MicrodumpProcessorTest, TestProcessX86) {
+ ProcessState state;
+ AnalyzeDump("microdump-x86.dmp", false /* omit_symbols */,
+ 4 /* expected_cpu_count */, &state);
+
+ ASSERT_EQ(124U, state.modules()->module_count());
+ ASSERT_EQ("x86", state.system_info()->cpu);
+ ASSERT_EQ("asus/WW_Z00A/Z00A:5.0/LRX21V/2.19.40.22_20150627_5104_user:user/"
+ "release-keys", state.system_info()->os_version);
+ ASSERT_EQ(17U, state.threads()->at(0)->frames()->size());
+ ASSERT_EQ("libc.so",
+ state.threads()->at(0)->frames()->at(0)->module->debug_file());
+ // TODO(mmandlis): Get symbols for the test X86 microdump and test function
+ // names.
+}
+
+TEST_F(MicrodumpProcessorTest, TestProcessMultiple) {
+ ProcessState state;
+ AnalyzeDump("microdump-multiple.dmp", false /* omit_symbols */,
+ 6 /* expected_cpu_count */, &state);
+ ASSERT_EQ(156U, state.modules()->module_count());
+ ASSERT_EQ("arm", state.system_info()->cpu);
+ ASSERT_EQ("lge/p1_tmo_us/p1:6.0/MRA58K/1603210524c8d:user/release-keys",
+ state.system_info()->os_version);
+ ASSERT_EQ(5U, state.threads()->at(0)->frames()->size());
+}
+
+TEST_F(MicrodumpProcessorTest, TestProcessMips) {
+ ProcessState state;
+ AnalyzeDump("microdump-mips32.dmp", false /* omit_symbols */,
+ 2 /* expected_cpu_count */, &state);
+
+ ASSERT_EQ(7U, state.modules()->module_count());
+ ASSERT_EQ("mips", state.system_info()->cpu);
+ ASSERT_EQ("3.0.8-g893bf16 #7 SMP PREEMPT Fri Jul 10 15:20:59 PDT 2015",
+ state.system_info()->os_version);
+ ASSERT_EQ(4U, state.threads()->at(0)->frames()->size());
+
+ ASSERT_EQ("blaTest",
+ state.threads()->at(0)->frames()->at(0)->function_name);
+ ASSERT_EQ("Crash",
+ state.threads()->at(0)->frames()->at(1)->function_name);
+ ASSERT_EQ("main",
+ state.threads()->at(0)->frames()->at(2)->function_name);
+ ASSERT_EQ("crash_example",
+ state.threads()->at(0)->frames()->at(0)->module->debug_file());
+}
+
+TEST_F(MicrodumpProcessorTest, TestProcessMips64) {
+ ProcessState state;
+ AnalyzeDump("microdump-mips64.dmp", false /* omit_symbols */,
+ 1 /* expected_cpu_count */, &state);
+
+ ASSERT_EQ(8U, state.modules()->module_count());
+ ASSERT_EQ("mips64", state.system_info()->cpu);
+ ASSERT_EQ("3.10.0-gf185e20 #112 PREEMPT Mon Oct 5 11:12:49 PDT 2015",
+ state.system_info()->os_version);
+ ASSERT_EQ(4U, state.threads()->at(0)->frames()->size());
+
+ ASSERT_EQ("blaTest",
+ state.threads()->at(0)->frames()->at(0)->function_name);
+ ASSERT_EQ("Crash",
+ state.threads()->at(0)->frames()->at(1)->function_name);
+ ASSERT_EQ("main",
+ state.threads()->at(0)->frames()->at(2)->function_name);
+ ASSERT_EQ("crash_example",
+ state.threads()->at(0)->frames()->at(0)->module->debug_file());
+}
+
} // namespace
int main(int argc, char* argv[]) {
diff --git a/src/processor/microdump_stackwalk.cc b/src/processor/microdump_stackwalk.cc
index 7ea80495..220396ed 100644
--- a/src/processor/microdump_stackwalk.cc
+++ b/src/processor/microdump_stackwalk.cc
@@ -32,14 +32,17 @@
#include <stdio.h>
#include <string.h>
+#include <unistd.h>
#include <fstream>
#include <string>
#include <vector>
+#include "common/path_helper.h"
#include "common/scoped_ptr.h"
#include "common/using_std_string.h"
#include "google_breakpad/processor/basic_source_line_resolver.h"
+#include "google_breakpad/processor/microdump.h"
#include "google_breakpad/processor/microdump_processor.h"
#include "google_breakpad/processor/process_state.h"
#include "google_breakpad/processor/stack_frame_symbolizer.h"
@@ -50,7 +53,16 @@
namespace {
+struct Options {
+ bool machine_readable;
+ bool output_stack_contents;
+
+ string microdump_file;
+ std::vector<string> symbol_paths;
+};
+
using google_breakpad::BasicSourceLineResolver;
+using google_breakpad::Microdump;
using google_breakpad::MicrodumpProcessor;
using google_breakpad::ProcessResult;
using google_breakpad::ProcessState;
@@ -58,43 +70,47 @@ using google_breakpad::scoped_ptr;
using google_breakpad::SimpleSymbolSupplier;
using google_breakpad::StackFrameSymbolizer;
-// Processes |microdump_file| using MicrodumpProcessor. |symbol_path|, if
-// non-empty, is the base directory of a symbol storage area, laid out in
-// the format required by SimpleSymbolSupplier. If such a storage area
-// is specified, it is made available for use by the MicrodumpProcessor.
+// Processes |options.microdump_file| using
+// MicrodumpProcessor. |options.symbol_path|, if non-empty, is the
+// base directory of a symbol storage area, laid out in the format
+// required by SimpleSymbolSupplier. If such a storage area is
+// specified, it is made available for use by the MicrodumpProcessor.
//
// Returns the value of MicrodumpProcessor::Process. If processing succeeds,
// prints identifying OS and CPU information from the microdump, crash
// information and call stacks for the crashing thread.
// All information is printed to stdout.
-int PrintMicrodumpProcess(const char* microdump_file,
- const std::vector<string>& symbol_paths,
- bool machine_readable) {
- std::ifstream file_stream(microdump_file);
+int PrintMicrodumpProcess(const Options& options) {
+ std::ifstream file_stream(options.microdump_file);
std::vector<char> bytes;
file_stream.seekg(0, std::ios_base::end);
bytes.resize(file_stream.tellg());
+ if (bytes.empty()) {
+ BPLOG(ERROR) << "Microdump is empty.";
+ return 1;
+ }
file_stream.seekg(0, std::ios_base::beg);
file_stream.read(&bytes[0], bytes.size());
string microdump_content(&bytes[0], bytes.size());
scoped_ptr<SimpleSymbolSupplier> symbol_supplier;
- if (!symbol_paths.empty()) {
- symbol_supplier.reset(new SimpleSymbolSupplier(symbol_paths));
+ if (!options.symbol_paths.empty()) {
+ symbol_supplier.reset(new SimpleSymbolSupplier(options.symbol_paths));
}
BasicSourceLineResolver resolver;
StackFrameSymbolizer frame_symbolizer(symbol_supplier.get(), &resolver);
ProcessState process_state;
MicrodumpProcessor microdump_processor(&frame_symbolizer);
- ProcessResult res = microdump_processor.Process(microdump_content,
+ Microdump microdump(microdump_content);
+ ProcessResult res = microdump_processor.Process(&microdump,
&process_state);
if (res == google_breakpad::PROCESS_OK) {
- if (machine_readable) {
+ if (options.machine_readable) {
PrintProcessStateMachineReadable(process_state);
} else {
- PrintProcessState(process_state, false, &resolver);
+ PrintProcessState(process_state, options.output_stack_contents, &resolver);
}
return 0;
}
@@ -103,49 +119,63 @@ int PrintMicrodumpProcess(const char* microdump_file,
return 1;
}
-void usage(const char *program_name) {
- fprintf(stderr, "usage: %s [-m] <microdump-file> [symbol-path ...]\n"
- " -m : Output in machine-readable format\n",
- program_name);
-}
-
} // namespace
-int main(int argc, char** argv) {
- BPLOG_INIT(&argc, &argv);
+static void Usage(int argc, const char *argv[], bool error) {
+ fprintf(error ? stderr : stdout,
+ "Usage: %s [options] <microdump-file> [symbol-path ...]\n"
+ "\n"
+ "Output a stack trace for the provided microdump\n"
+ "\n"
+ "Options:\n"
+ "\n"
+ " -m Output in machine-readable format\n"
+ " -s Output stack contents\n",
+ google_breakpad::BaseName(argv[0]).c_str());
+}
- if (argc < 2) {
- usage(argv[0]);
- return 1;
+static void SetupOptions(int argc, const char *argv[], Options* options) {
+ int ch;
+
+ options->machine_readable = false;
+ options->output_stack_contents = false;
+
+ while ((ch = getopt(argc, (char * const *)argv, "hms")) != -1) {
+ switch (ch) {
+ case 'h':
+ Usage(argc, argv, false);
+ exit(0);
+ break;
+
+ case 'm':
+ options->machine_readable = true;
+ break;
+ case 's':
+ options->output_stack_contents = true;
+ break;
+
+ case '?':
+ Usage(argc, argv, true);
+ exit(1);
+ break;
+ }
}
- const char* microdump_file;
- bool machine_readable;
- int symbol_path_arg;
+ if ((argc - optind) == 0) {
+ fprintf(stderr, "%s: Missing microdump file\n", argv[0]);
+ Usage(argc, argv, true);
+ exit(1);
+ }
- if (strcmp(argv[1], "-m") == 0) {
- if (argc < 3) {
- usage(argv[0]);
- return 1;
- }
+ options->microdump_file = argv[optind];
- machine_readable = true;
- microdump_file = argv[2];
- symbol_path_arg = 3;
- } else {
- machine_readable = false;
- microdump_file = argv[1];
- symbol_path_arg = 2;
- }
+ for (int argi = optind + 1; argi < argc; ++argi)
+ options->symbol_paths.push_back(argv[argi]);
+}
- // extra arguments are symbol paths
- std::vector<string> symbol_paths;
- if (argc > symbol_path_arg) {
- for (int argi = symbol_path_arg; argi < argc; ++argi)
- symbol_paths.push_back(argv[argi]);
- }
+int main(int argc, const char* argv[]) {
+ Options options;
+ SetupOptions(argc, argv, &options);
- return PrintMicrodumpProcess(microdump_file,
- symbol_paths,
- machine_readable);
+ return PrintMicrodumpProcess(options);
}
diff --git a/src/processor/microdump_stackwalk_machine_readable_test b/src/processor/microdump_stackwalk_machine_readable_test
index fadec264..f5614e20 100755
--- a/src/processor/microdump_stackwalk_machine_readable_test
+++ b/src/processor/microdump_stackwalk_machine_readable_test
@@ -29,7 +29,7 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-source "${0%/*}/microdump_stackwalk_test_vars" # for MICRODUMP_SUPPORTED_ARCHS.
+. "${0%/*}/microdump_stackwalk_test_vars" || exit 1 # for MICRODUMP_SUPPORTED_ARCHS.
testdata_dir=$srcdir/src/processor/testdata
set -e # Bail out with an error if any of the commands below fails.
diff --git a/src/processor/microdump_stackwalk_test b/src/processor/microdump_stackwalk_test
index 5a1f3d59..e1897656 100755
--- a/src/processor/microdump_stackwalk_test
+++ b/src/processor/microdump_stackwalk_test
@@ -29,7 +29,7 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-source "${0%/*}/microdump_stackwalk_test_vars" # for MICRODUMP_SUPPORTED_ARCHS.
+. "${0%/*}/microdump_stackwalk_test_vars" || exit 1 # for MICRODUMP_SUPPORTED_ARCHS.
testdata_dir=$srcdir/src/processor/testdata
set -e # Bail out with an error if any of the commands below fails.
diff --git a/src/processor/minidump.cc b/src/processor/minidump.cc
index 08f64652..4c0b26ab 100644
--- a/src/processor/minidump.cc
+++ b/src/processor/minidump.cc
@@ -38,46 +38,45 @@
#include <assert.h>
#include <fcntl.h>
#include <stddef.h>
-#include <stdio.h>
#include <string.h>
#include <time.h>
#ifdef _WIN32
#include <io.h>
-#define PRIx64 "llx"
-#define PRIx32 "lx"
-#define snprintf _snprintf
#else // _WIN32
#include <unistd.h>
#endif // _WIN32
+#include <algorithm>
#include <fstream>
-#include <iostream>
#include <limits>
-#include <map>
-#include <vector>
+#include <utility>
#include "processor/range_map-inl.h"
+#include "common/macros.h"
#include "common/scoped_ptr.h"
+#include "common/stdio_wrapper.h"
#include "google_breakpad/processor/dump_context.h"
#include "processor/basic_code_module.h"
#include "processor/basic_code_modules.h"
+#include "processor/convert_old_arm64_context.h"
#include "processor/logging.h"
namespace google_breakpad {
-
using std::istream;
using std::ifstream;
using std::numeric_limits;
using std::vector;
+namespace {
+
// Returns true iff |context_size| matches exactly one of the sizes of the
// various MDRawContext* types.
// TODO(blundell): This function can be removed once
-// http://code.google.com/p/google-breakpad/issues/detail?id=550 is fixed.
-static bool IsContextSizeUnique(uint32_t context_size) {
+// https://bugs.chromium.org/p/google-breakpad/issues/detail?id=550 is fixed.
+bool IsContextSizeUnique(uint32_t context_size) {
int num_matching_contexts = 0;
if (context_size == sizeof(MDRawContextX86))
num_matching_contexts++;
@@ -93,6 +92,8 @@ static bool IsContextSizeUnique(uint32_t context_size) {
num_matching_contexts++;
if (context_size == sizeof(MDRawContextARM64))
num_matching_contexts++;
+ if (context_size == sizeof(MDRawContextARM64_Old))
+ num_matching_contexts++;
if (context_size == sizeof(MDRawContextMIPS))
num_matching_contexts++;
return num_matching_contexts == 1;
@@ -110,9 +111,7 @@ static bool IsContextSizeUnique(uint32_t context_size) {
// to account for certain templatized operations that require swapping for
// wider types but handle uint8_t too
// (MinidumpMemoryRegion::GetMemoryAtAddressInternal).
-static inline void Swap(uint8_t* value) {
-}
-
+inline void Swap(uint8_t* value) {}
// Optimization: don't need to AND the furthest right shift, because we're
// shifting an unsigned quantity. The standard requires zero-filling in this
@@ -120,22 +119,18 @@ static inline void Swap(uint8_t* value) {
// right shift to avoid an arithmetic shift (which retains the sign bit).
// The furthest left shift never needs to be ANDed bitmask.
-
-static inline void Swap(uint16_t* value) {
- *value = (*value >> 8) |
- (*value << 8);
+inline void Swap(uint16_t* value) {
+ *value = (*value >> 8) | (*value << 8);
}
-
-static inline void Swap(uint32_t* value) {
+inline void Swap(uint32_t* value) {
*value = (*value >> 24) |
((*value >> 8) & 0x0000ff00) |
((*value << 8) & 0x00ff0000) |
(*value << 24);
}
-
-static inline void Swap(uint64_t* value) {
+inline void Swap(uint64_t* value) {
uint32_t* value32 = reinterpret_cast<uint32_t*>(value);
Swap(&value32[0]);
Swap(&value32[1]);
@@ -147,7 +142,7 @@ static inline void Swap(uint64_t* value) {
// Given a pointer to a 128-bit int in the minidump data, set the "low"
// and "high" fields appropriately.
-static void Normalize128(uint128_struct* value, bool is_big_endian) {
+void Normalize128(uint128_struct* value, bool is_big_endian) {
// The struct format is [high, low], so if the format is big-endian,
// the most significant bytes will already be in the high field.
if (!is_big_endian) {
@@ -159,45 +154,34 @@ static void Normalize128(uint128_struct* value, bool is_big_endian) {
// This just swaps each int64 half of the 128-bit value.
// The value should also be normalized by calling Normalize128().
-static void Swap(uint128_struct* value) {
+void Swap(uint128_struct* value) {
Swap(&value->low);
Swap(&value->high);
}
// Swapping signed integers
-static inline void Swap(int16_t* value) {
- Swap(reinterpret_cast<uint16_t*>(value));
-}
-
-static inline void Swap(int32_t* value) {
+inline void Swap(int32_t* value) {
Swap(reinterpret_cast<uint32_t*>(value));
}
-static inline void Swap(int64_t* value) {
- Swap(reinterpret_cast<uint64_t*>(value));
-}
-
-
-static inline void Swap(MDLocationDescriptor* location_descriptor) {
+inline void Swap(MDLocationDescriptor* location_descriptor) {
Swap(&location_descriptor->data_size);
Swap(&location_descriptor->rva);
}
-
-static inline void Swap(MDMemoryDescriptor* memory_descriptor) {
+inline void Swap(MDMemoryDescriptor* memory_descriptor) {
Swap(&memory_descriptor->start_of_memory_range);
Swap(&memory_descriptor->memory);
}
-
-static inline void Swap(MDGUID* guid) {
+inline void Swap(MDGUID* guid) {
Swap(&guid->data1);
Swap(&guid->data2);
Swap(&guid->data3);
// Don't swap guid->data4[] because it contains 8-bit quantities.
}
-static inline void Swap(MDSystemTime* system_time) {
+inline void Swap(MDSystemTime* system_time) {
Swap(&system_time->year);
Swap(&system_time->month);
Swap(&system_time->day_of_week);
@@ -208,7 +192,27 @@ static inline void Swap(MDSystemTime* system_time) {
Swap(&system_time->milliseconds);
}
-static inline void Swap(uint16_t* data, size_t size_in_bytes) {
+inline void Swap(MDXStateFeature* xstate_feature) {
+ Swap(&xstate_feature->offset);
+ Swap(&xstate_feature->size);
+}
+
+inline void Swap(MDXStateConfigFeatureMscInfo* xstate_feature_info) {
+ Swap(&xstate_feature_info->size_of_info);
+ Swap(&xstate_feature_info->context_size);
+ Swap(&xstate_feature_info->enabled_features);
+
+ for (size_t i = 0; i < MD_MAXIMUM_XSTATE_FEATURES; i++) {
+ Swap(&xstate_feature_info->features[i]);
+ }
+}
+
+inline void Swap(MDRawSimpleStringDictionaryEntry* entry) {
+ Swap(&entry->key);
+ Swap(&entry->value);
+}
+
+inline void Swap(uint16_t* data, size_t size_in_bytes) {
size_t data_length = size_in_bytes / sizeof(data[0]);
for (size_t i = 0; i < data_length; i++) {
Swap(&data[i]);
@@ -229,8 +233,7 @@ static inline void Swap(uint16_t* data, size_t size_in_bytes) {
// parameter, a converter that uses iconv would also need to take the host
// CPU's endianness into consideration. It doesn't seems worth the trouble
// of making it a dependency when we don't care about anything but UTF-16.
-static string* UTF16ToUTF8(const vector<uint16_t>& in,
- bool swap) {
+string* UTF16ToUTF8(const vector<uint16_t>& in, bool swap) {
scoped_ptr<string> out(new string());
// Set the string's initial capacity to the number of UTF-16 characters,
@@ -303,14 +306,14 @@ static string* UTF16ToUTF8(const vector<uint16_t>& in,
// Return the smaller of the number of code units in the UTF-16 string,
// not including the terminating null word, or maxlen.
-static size_t UTF16codeunits(const uint16_t *string, size_t maxlen) {
+size_t UTF16codeunits(const uint16_t* string, size_t maxlen) {
size_t count = 0;
while (count < maxlen && string[count] != 0)
count++;
return count;
}
-static inline void Swap(MDTimeZoneInformation* time_zone) {
+inline void Swap(MDTimeZoneInformation* time_zone) {
Swap(&time_zone->bias);
// Skip time_zone->standard_name. No need to swap UTF-16 fields.
// The swap will be done as part of the conversion to UTF-8.
@@ -322,10 +325,10 @@ static inline void Swap(MDTimeZoneInformation* time_zone) {
Swap(&time_zone->daylight_bias);
}
-static void ConvertUTF16BufferToUTF8String(const uint16_t* utf16_data,
- size_t max_length_in_bytes,
- string* utf8_result,
- bool swap) {
+void ConvertUTF16BufferToUTF8String(const uint16_t* utf16_data,
+ size_t max_length_in_bytes,
+ string* utf8_result,
+ bool swap) {
// Since there is no explicit byte length for each string, use
// UTF16codeunits to calculate word length, then derive byte
// length from that.
@@ -354,9 +357,9 @@ enum NumberFormat {
kNumberFormatHexadecimal,
};
-static void PrintValueOrInvalid(bool valid,
- NumberFormat number_format,
- uint32_t value) {
+void PrintValueOrInvalid(bool valid,
+ NumberFormat number_format,
+ uint32_t value) {
if (!valid) {
printf("(invalid)\n");
} else if (number_format == kNumberFormatDecimal) {
@@ -376,7 +379,7 @@ string TimeTToUTCString(time_t tt) {
#endif
char timestr[20];
- int rv = strftime(timestr, 20, "%Y-%m-%d %H:%M:%S", &timestruct);
+ size_t rv = strftime(timestr, 20, "%Y-%m-%d %H:%M:%S", &timestruct);
if (rv == 0) {
return string();
}
@@ -384,6 +387,29 @@ string TimeTToUTCString(time_t tt) {
return string(timestr);
}
+string MDGUIDToString(const MDGUID& uuid) {
+ char buf[37];
+ snprintf(buf, sizeof(buf), "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
+ uuid.data1,
+ uuid.data2,
+ uuid.data3,
+ uuid.data4[0],
+ uuid.data4[1],
+ uuid.data4[2],
+ uuid.data4[3],
+ uuid.data4[4],
+ uuid.data4[5],
+ uuid.data4[6],
+ uuid.data4[7]);
+ return std::string(buf);
+}
+
+bool IsDevAshmem(const string& filename) {
+ const string kDevAshmem("/dev/ashmem/");
+ return filename.compare(0, kDevAshmem.length(), kDevAshmem) == 0;
+}
+
+} // namespace
//
// MinidumpObject
@@ -433,8 +459,8 @@ bool MinidumpContext::Read(uint32_t expected_size) {
<< "other raw context";
return false;
}
- if (!IsContextSizeUnique(sizeof(MDRawContextARM64))) {
- BPLOG(ERROR) << "sizeof(MDRawContextARM64) cannot match the size of any "
+ if (!IsContextSizeUnique(sizeof(MDRawContextARM64_Old))) {
+ BPLOG(ERROR) << "sizeof(MDRawContextARM64_Old) cannot match the size of any "
<< "other raw context";
return false;
}
@@ -469,7 +495,7 @@ bool MinidumpContext::Read(uint32_t expected_size) {
if (cpu_type != MD_CONTEXT_AMD64) {
// TODO: Fall through to switch below.
- // http://code.google.com/p/google-breakpad/issues/detail?id=550
+ // https://bugs.chromium.org/p/google-breakpad/issues/detail?id=550
BPLOG(ERROR) << "MinidumpContext not actually amd64 context";
return false;
}
@@ -571,7 +597,7 @@ bool MinidumpContext::Read(uint32_t expected_size) {
if (cpu_type != MD_CONTEXT_PPC64) {
// TODO: Fall through to switch below.
- // http://code.google.com/p/google-breakpad/issues/detail?id=550
+ // https://bugs.chromium.org/p/google-breakpad/issues/detail?id=550
BPLOG(ERROR) << "MinidumpContext not actually ppc64 context";
return false;
}
@@ -640,8 +666,8 @@ bool MinidumpContext::Read(uint32_t expected_size) {
}
SetContextPPC64(context_ppc64.release());
- } else if (expected_size == sizeof(MDRawContextARM64)) {
- // |context_flags| of MDRawContextARM64 is 64 bits, but other MDRawContext
+ } else if (expected_size == sizeof(MDRawContextARM64_Old)) {
+ // |context_flags| of MDRawContextARM64_Old is 64 bits, but other MDRawContext
// in the else case have 32 bits |context_flags|, so special case it here.
uint64_t context_flags;
@@ -654,7 +680,7 @@ bool MinidumpContext::Read(uint32_t expected_size) {
if (minidump_->swap())
Swap(&context_flags);
- scoped_ptr<MDRawContextARM64> context_arm64(new MDRawContextARM64());
+ scoped_ptr<MDRawContextARM64_Old> context_arm64(new MDRawContextARM64_Old());
uint32_t cpu_type = context_flags & MD_CONTEXT_CPU_MASK;
if (cpu_type == 0) {
@@ -666,9 +692,9 @@ bool MinidumpContext::Read(uint32_t expected_size) {
}
}
- if (cpu_type != MD_CONTEXT_ARM64) {
+ if (cpu_type != MD_CONTEXT_ARM64_OLD) {
// TODO: Fall through to switch below.
- // http://code.google.com/p/google-breakpad/issues/detail?id=550
+ // https://bugs.chromium.org/p/google-breakpad/issues/detail?id=550
BPLOG(ERROR) << "MinidumpContext not actually arm64 context";
return false;
}
@@ -682,7 +708,7 @@ bool MinidumpContext::Read(uint32_t expected_size) {
uint8_t* context_after_flags =
reinterpret_cast<uint8_t*>(context_arm64.get()) + flags_size;
if (!minidump_->ReadBytes(context_after_flags,
- sizeof(MDRawContextARM64) - flags_size)) {
+ sizeof(MDRawContextARM64_Old) - flags_size)) {
BPLOG(ERROR) << "MinidumpContext could not read arm64 context";
return false;
}
@@ -707,24 +733,16 @@ bool MinidumpContext::Read(uint32_t expected_size) {
for (unsigned int fpr_index = 0;
fpr_index < MD_FLOATINGSAVEAREA_ARM64_FPR_COUNT;
++fpr_index) {
- // While ARM64 is bi-endian, iOS (currently the only platform
- // for which ARM64 support has been brought up) uses ARM64 exclusively
- // in little-endian mode.
- Normalize128(&context_arm64->float_save.regs[fpr_index], false);
+ Normalize128(&context_arm64->float_save.regs[fpr_index],
+ minidump_->is_big_endian());
Swap(&context_arm64->float_save.regs[fpr_index]);
}
}
- SetContextFlags(static_cast<uint32_t>(context_arm64->context_flags));
-
- // Check for data loss when converting context flags from uint64_t into
- // uint32_t
- if (static_cast<uint64_t>(GetContextFlags()) !=
- context_arm64->context_flags) {
- BPLOG(ERROR) << "Data loss detected when converting ARM64 context_flags";
- return false;
- }
- SetContextARM64(context_arm64.release());
+ scoped_ptr<MDRawContextARM64> new_context(new MDRawContextARM64());
+ ConvertOldARM64Context(*context_arm64.get(), new_context.get());
+ SetContextFlags(new_context->context_flags);
+ SetContextARM64(new_context.release());
} else {
uint32_t context_flags;
if (!minidump_->ReadBytes(&context_flags, sizeof(context_flags))) {
@@ -1021,7 +1039,60 @@ bool MinidumpContext::Read(uint32_t expected_size) {
break;
}
- case MD_CONTEXT_MIPS: {
+ case MD_CONTEXT_ARM64: {
+ if (expected_size != sizeof(MDRawContextARM64)) {
+ BPLOG(ERROR) << "MinidumpContext arm64 size mismatch, " <<
+ expected_size << " != " << sizeof(MDRawContextARM64);
+ return false;
+ }
+
+ scoped_ptr<MDRawContextARM64> context_arm64(new MDRawContextARM64());
+
+ // Set the context_flags member, which has already been read, and
+ // read the rest of the structure beginning with the first member
+ // after context_flags.
+ context_arm64->context_flags = context_flags;
+
+ size_t flags_size = sizeof(context_arm64->context_flags);
+ uint8_t* context_after_flags =
+ reinterpret_cast<uint8_t*>(context_arm64.get()) + flags_size;
+ if (!minidump_->ReadBytes(context_after_flags,
+ sizeof(*context_arm64) - flags_size)) {
+ BPLOG(ERROR) << "MinidumpContext could not read arm64 context";
+ return false;
+ }
+
+ // Do this after reading the entire MDRawContext structure because
+ // GetSystemInfo may seek minidump to a new position.
+ if (!CheckAgainstSystemInfo(cpu_type)) {
+ BPLOG(ERROR) << "MinidumpContext arm does not match system info";
+ return false;
+ }
+
+ if (minidump_->swap()) {
+ // context_arm64->context_flags was already swapped.
+ for (unsigned int ireg_index = 0;
+ ireg_index < MD_CONTEXT_ARM64_GPR_COUNT;
+ ++ireg_index) {
+ Swap(&context_arm64->iregs[ireg_index]);
+ }
+ Swap(&context_arm64->cpsr);
+ Swap(&context_arm64->float_save.fpsr);
+ Swap(&context_arm64->float_save.fpcr);
+ for (unsigned int fpr_index = 0;
+ fpr_index < MD_FLOATINGSAVEAREA_ARM64_FPR_COUNT;
+ ++fpr_index) {
+ Normalize128(&context_arm64->float_save.regs[fpr_index],
+ minidump_->is_big_endian());
+ Swap(&context_arm64->float_save.regs[fpr_index]);
+ }
+ }
+ SetContextARM64(context_arm64.release());
+ break;
+ }
+
+ case MD_CONTEXT_MIPS:
+ case MD_CONTEXT_MIPS64: {
if (expected_size != sizeof(MDRawContextMIPS)) {
BPLOG(ERROR) << "MinidumpContext MIPS size mismatch, "
<< expected_size
@@ -1165,10 +1236,20 @@ bool MinidumpContext::CheckAgainstSystemInfo(uint32_t context_cpu_type) {
return_value = true;
break;
+ case MD_CONTEXT_ARM64_OLD:
+ if (system_info_cpu_type == MD_CPU_ARCHITECTURE_ARM64_OLD)
+ return_value = true;
+ break;
+
case MD_CONTEXT_MIPS:
if (system_info_cpu_type == MD_CPU_ARCHITECTURE_MIPS)
return_value = true;
break;
+
+ case MD_CONTEXT_MIPS64:
+ if (system_info_cpu_type == MD_CPU_ARCHITECTURE_MIPS64)
+ return_value = true;
+ break;
}
BPLOG_IF(ERROR, !return_value) << "MinidumpContext CPU " <<
@@ -1185,13 +1266,15 @@ bool MinidumpContext::CheckAgainstSystemInfo(uint32_t context_cpu_type) {
//
-uint32_t MinidumpMemoryRegion::max_bytes_ = 1024 * 1024; // 1MB
+uint32_t MinidumpMemoryRegion::max_bytes_ = 64 * 1024 * 1024; // 64MB
MinidumpMemoryRegion::MinidumpMemoryRegion(Minidump* minidump)
: MinidumpObject(minidump),
descriptor_(NULL),
memory_(NULL) {
+ hexdump_width_ = minidump_ ? minidump_->HexdumpMode() : 0;
+ hexdump_ = hexdump_width_ != 0;
}
@@ -1350,19 +1433,77 @@ void MinidumpMemoryRegion::Print() const {
const uint8_t* memory = GetMemory();
if (memory) {
- printf("0x");
- for (unsigned int byte_index = 0;
- byte_index < descriptor_->memory.data_size;
- byte_index++) {
- printf("%02x", memory[byte_index]);
+ if (hexdump_) {
+ // Pretty hexdump view.
+ for (unsigned int byte_index = 0;
+ byte_index < descriptor_->memory.data_size;
+ byte_index += hexdump_width_) {
+ // In case the memory won't fill a whole line.
+ unsigned int num_bytes = std::min(
+ descriptor_->memory.data_size - byte_index, hexdump_width_);
+
+ // Display the leading address.
+ printf("%08x ", byte_index);
+
+ // Show the bytes in hex.
+ for (unsigned int i = 0; i < hexdump_width_; ++i) {
+ if (i < num_bytes) {
+ // Show the single byte of memory in hex.
+ printf("%02x ", memory[byte_index + i]);
+ } else {
+ // If this line doesn't fill up, pad it out.
+ printf(" ");
+ }
+
+ // Insert a space every 8 bytes to make it more readable.
+ if (((i + 1) % 8) == 0) {
+ printf(" ");
+ }
+ }
+
+ // Decode the line as ASCII.
+ printf("|");
+ for (unsigned int i = 0; i < hexdump_width_; ++i) {
+ if (i < num_bytes) {
+ uint8_t byte = memory[byte_index + i];
+ printf("%c", isprint(byte) ? byte : '.');
+ } else {
+ // If this line doesn't fill up, pad it out.
+ printf(" ");
+ }
+ }
+ printf("|\n");
+ }
+ } else {
+ // Ugly raw string view.
+ printf("0x");
+ for (unsigned int i = 0;
+ i < descriptor_->memory.data_size;
+ i++) {
+ printf("%02x", memory[i]);
+ }
+ printf("\n");
}
- printf("\n");
} else {
printf("No memory\n");
}
}
+void MinidumpMemoryRegion::SetPrintMode(bool hexdump,
+ unsigned int hexdump_width) {
+ // Require the width to be a multiple of 8 bytes.
+ if (hexdump_width == 0 || (hexdump_width % 8) != 0) {
+ BPLOG(ERROR) << "MinidumpMemoryRegion print hexdump_width must be "
+ "multiple of 8, not " << hexdump_width;
+ return;
+ }
+
+ hexdump_ = hexdump;
+ hexdump_width_ = hexdump_width;
+}
+
+
//
// MinidumpThread
//
@@ -1859,11 +2000,32 @@ string MinidumpModule::code_identifier() const {
break;
}
+ case MD_OS_ANDROID:
+ case MD_OS_FUCHSIA:
+ case MD_OS_LINUX: {
+ // If ELF CodeView data is present, return the debug id.
+ if (cv_record_ && cv_record_signature_ == MD_CVINFOELF_SIGNATURE) {
+ const MDCVInfoELF* cv_record_elf =
+ reinterpret_cast<const MDCVInfoELF*>(&(*cv_record_)[0]);
+ assert(cv_record_elf->cv_signature == MD_CVINFOELF_SIGNATURE);
+
+ for (unsigned int build_id_index = 0;
+ build_id_index < (cv_record_->size() - MDCVInfoELF_minsize);
+ ++build_id_index) {
+ char hexbyte[3];
+ snprintf(hexbyte, sizeof(hexbyte), "%02x",
+ cv_record_elf->build_id[build_id_index]);
+ identifier += hexbyte;
+ }
+ break;
+ }
+ // Otherwise fall through to the case below.
+ BP_FALLTHROUGH;
+ }
+
case MD_OS_MAC_OS_X:
case MD_OS_IOS:
case MD_OS_SOLARIS:
- case MD_OS_ANDROID:
- case MD_OS_LINUX:
case MD_OS_NACL:
case MD_OS_PS3: {
// TODO(mmentovai): support uuid extension if present, otherwise fall
@@ -1914,6 +2076,13 @@ string MinidumpModule::debug_file() const {
// GetCVRecord guarantees pdb_file_name is null-terminated.
file = reinterpret_cast<const char*>(cv_record_20->pdb_file_name);
+ } else if (cv_record_signature_ == MD_CVINFOELF_SIGNATURE) {
+ // It's actually an MDCVInfoELF structure.
+ assert(reinterpret_cast<const MDCVInfoELF*>(&(*cv_record_)[0])->
+ cv_signature == MD_CVINFOELF_SIGNATURE);
+
+ // For MDCVInfoELF, the debug file is the code file.
+ file = *name_;
}
// If there's a CodeView record but it doesn't match a known signature,
@@ -1938,10 +2107,10 @@ string MinidumpModule::debug_file() const {
// that this method (and all other methods in the Minidump family)
// return.
- unsigned int bytes =
+ size_t bytes =
module_.misc_record.data_size - MDImageDebugMisc_minsize;
if (bytes % 2 == 0) {
- unsigned int utf16_words = bytes / 2;
+ size_t utf16_words = bytes / 2;
// UTF16ToUTF8 expects a vector<uint16_t>, so create a temporary one
// and copy the UTF-16 data into it.
@@ -1952,7 +2121,9 @@ string MinidumpModule::debug_file() const {
// GetMiscRecord already byte-swapped the data[] field if it contains
// UTF-16, so pass false as the swap argument.
scoped_ptr<string> new_file(UTF16ToUTF8(string_utf16, false));
- file = *new_file;
+ if (new_file.get() != nullptr) {
+ file = *new_file;
+ }
}
}
}
@@ -1965,6 +2136,25 @@ string MinidumpModule::debug_file() const {
return file;
}
+static string guid_and_age_to_debug_id(const MDGUID& guid,
+ uint32_t age) {
+ char identifier_string[41];
+ snprintf(identifier_string, sizeof(identifier_string),
+ "%08X%04X%04X%02X%02X%02X%02X%02X%02X%02X%02X%x",
+ guid.data1,
+ guid.data2,
+ guid.data3,
+ guid.data4[0],
+ guid.data4[1],
+ guid.data4[2],
+ guid.data4[3],
+ guid.data4[4],
+ guid.data4[5],
+ guid.data4[6],
+ guid.data4[7],
+ age);
+ return identifier_string;
+}
string MinidumpModule::debug_identifier() const {
if (!valid_) {
@@ -1987,22 +2177,8 @@ string MinidumpModule::debug_identifier() const {
// Use the same format that the MS symbol server uses in filesystem
// hierarchies.
- char identifier_string[41];
- snprintf(identifier_string, sizeof(identifier_string),
- "%08X%04X%04X%02X%02X%02X%02X%02X%02X%02X%02X%x",
- cv_record_70->signature.data1,
- cv_record_70->signature.data2,
- cv_record_70->signature.data3,
- cv_record_70->signature.data4[0],
- cv_record_70->signature.data4[1],
- cv_record_70->signature.data4[2],
- cv_record_70->signature.data4[3],
- cv_record_70->signature.data4[4],
- cv_record_70->signature.data4[5],
- cv_record_70->signature.data4[6],
- cv_record_70->signature.data4[7],
- cv_record_70->age);
- identifier = identifier_string;
+ identifier = guid_and_age_to_debug_id(cv_record_70->signature,
+ cv_record_70->age);
} else if (cv_record_signature_ == MD_CVINFOPDB20_SIGNATURE) {
// It's actually an MDCVInfoPDB20 structure.
const MDCVInfoPDB20* cv_record_20 =
@@ -2015,6 +2191,22 @@ string MinidumpModule::debug_identifier() const {
snprintf(identifier_string, sizeof(identifier_string),
"%08X%x", cv_record_20->signature, cv_record_20->age);
identifier = identifier_string;
+ } else if (cv_record_signature_ == MD_CVINFOELF_SIGNATURE) {
+ // It's actually an MDCVInfoELF structure.
+ const MDCVInfoELF* cv_record_elf =
+ reinterpret_cast<const MDCVInfoELF*>(&(*cv_record_)[0]);
+ assert(cv_record_elf->cv_signature == MD_CVINFOELF_SIGNATURE);
+
+ // For backwards-compatibility, stuff as many bytes as will fit into
+ // a MDGUID and use the MS symbol server format as MDCVInfoPDB70 does
+ // with age = 0. Historically Breakpad would do this during dump
+ // writing to fit the build id data into a MDCVInfoPDB70 struct.
+ // The full build id is available by calling code_identifier.
+ MDGUID guid = {};
+ memcpy(&guid, &cv_record_elf->build_id,
+ std::min(cv_record_->size() - MDCVInfoELF_minsize,
+ sizeof(MDGUID)));
+ identifier = guid_and_age_to_debug_id(guid, 0);
}
}
@@ -2067,11 +2259,21 @@ string MinidumpModule::version() const {
}
-const CodeModule* MinidumpModule::Copy() const {
+CodeModule* MinidumpModule::Copy() const {
return new BasicCodeModule(this);
}
+uint64_t MinidumpModule::shrink_down_delta() const {
+ return 0;
+}
+
+void MinidumpModule::SetShrinkDownDelta(uint64_t shrink_down_delta) {
+ // Not implemented
+ assert(false);
+}
+
+
const uint8_t* MinidumpModule::GetCVRecord(uint32_t* size) {
if (!module_valid_) {
BPLOG(ERROR) << "Invalid MinidumpModule for GetCVRecord";
@@ -2122,8 +2324,9 @@ const uint8_t* MinidumpModule::GetCVRecord(uint32_t* size) {
}
if (signature == MD_CVINFOPDB70_SIGNATURE) {
- // Now that the structure type is known, recheck the size.
- if (MDCVInfoPDB70_minsize > module_.cv_record.data_size) {
+ // Now that the structure type is known, recheck the size,
+ // ensuring at least one byte for the null terminator.
+ if (MDCVInfoPDB70_minsize + 1 > module_.cv_record.data_size) {
BPLOG(ERROR) << "MinidumpModule CodeView7 record size mismatch, " <<
MDCVInfoPDB70_minsize << " > " <<
module_.cv_record.data_size;
@@ -2148,8 +2351,9 @@ const uint8_t* MinidumpModule::GetCVRecord(uint32_t* size) {
return NULL;
}
} else if (signature == MD_CVINFOPDB20_SIGNATURE) {
- // Now that the structure type is known, recheck the size.
- if (MDCVInfoPDB20_minsize > module_.cv_record.data_size) {
+ // Now that the structure type is known, recheck the size,
+ // ensuring at least one byte for the null terminator.
+ if (MDCVInfoPDB20_minsize + 1 > module_.cv_record.data_size) {
BPLOG(ERROR) << "MinidumpModule CodeView2 record size mismatch, " <<
MDCVInfoPDB20_minsize << " > " <<
module_.cv_record.data_size;
@@ -2173,6 +2377,19 @@ const uint8_t* MinidumpModule::GetCVRecord(uint32_t* size) {
"0-terminated";
return NULL;
}
+ } else if (signature == MD_CVINFOELF_SIGNATURE) {
+ // Now that the structure type is known, recheck the size.
+ if (MDCVInfoELF_minsize > module_.cv_record.data_size) {
+ BPLOG(ERROR) << "MinidumpModule CodeViewELF record size mismatch, " <<
+ MDCVInfoELF_minsize << " > " <<
+ module_.cv_record.data_size;
+ return NULL;
+ }
+ if (minidump_->swap()) {
+ MDCVInfoELF* cv_record_elf =
+ reinterpret_cast<MDCVInfoELF*>(&(*cv_record)[0]);
+ Swap(&cv_record_elf->cv_signature);
+ }
}
// If the signature doesn't match something above, it's not something
@@ -2252,8 +2469,8 @@ const MDImageDebugMisc* MinidumpModule::GetMiscRecord(uint32_t* size) {
// There is a potential alignment problem, but shouldn't be a problem
// in practice due to the layout of MDImageDebugMisc.
uint16_t* data16 = reinterpret_cast<uint16_t*>(&(misc_record->data));
- unsigned int dataBytes = module_.misc_record.data_size -
- MDImageDebugMisc_minsize;
+ size_t dataBytes = module_.misc_record.data_size -
+ MDImageDebugMisc_minsize;
Swap(data16, dataBytes);
}
}
@@ -2341,18 +2558,8 @@ void MinidumpModule::Print() {
printf(" (cv_record).cv_signature = 0x%x\n",
cv_record_70->cv_signature);
- printf(" (cv_record).signature = %08x-%04x-%04x-%02x%02x-",
- cv_record_70->signature.data1,
- cv_record_70->signature.data2,
- cv_record_70->signature.data3,
- cv_record_70->signature.data4[0],
- cv_record_70->signature.data4[1]);
- for (unsigned int guidIndex = 2;
- guidIndex < 8;
- ++guidIndex) {
- printf("%02x", cv_record_70->signature.data4[guidIndex]);
- }
- printf("\n");
+ printf(" (cv_record).signature = %s\n",
+ MDGUIDToString(cv_record_70->signature).c_str());
printf(" (cv_record).age = %d\n",
cv_record_70->age);
printf(" (cv_record).pdb_file_name = \"%s\"\n",
@@ -2373,6 +2580,20 @@ void MinidumpModule::Print() {
cv_record_20->age);
printf(" (cv_record).pdb_file_name = \"%s\"\n",
cv_record_20->pdb_file_name);
+ } else if (cv_record_signature_ == MD_CVINFOELF_SIGNATURE) {
+ const MDCVInfoELF* cv_record_elf =
+ reinterpret_cast<const MDCVInfoELF*>(cv_record);
+ assert(cv_record_elf->cv_signature == MD_CVINFOELF_SIGNATURE);
+
+ printf(" (cv_record).cv_signature = 0x%x\n",
+ cv_record_elf->cv_signature);
+ printf(" (cv_record).build_id = ");
+ for (unsigned int build_id_index = 0;
+ build_id_index < (cv_record_size - MDCVInfoELF_minsize);
+ ++build_id_index) {
+ printf("%02x", cv_record_elf->build_id[build_id_index]);
+ }
+ printf("\n");
} else {
printf(" (cv_record) = ");
for (unsigned int cv_byte_index = 0;
@@ -2424,7 +2645,7 @@ void MinidumpModule::Print() {
//
-uint32_t MinidumpModuleList::max_modules_ = 1024;
+uint32_t MinidumpModuleList::max_modules_ = 2048;
MinidumpModuleList::MinidumpModuleList(Minidump* minidump)
@@ -2432,6 +2653,11 @@ MinidumpModuleList::MinidumpModuleList(Minidump* minidump)
range_map_(new RangeMap<uint64_t, unsigned int>()),
modules_(NULL),
module_count_(0) {
+ MDOSPlatform platform;
+ if (minidump_->GetPlatform(&platform) &&
+ (platform == MD_OS_ANDROID || platform == MD_OS_LINUX)) {
+ range_map_->SetMergeStrategy(MergeRangeStrategy::kTruncateLower);
+ }
}
@@ -2490,7 +2716,7 @@ bool MinidumpModuleList::Read(uint32_t expected_size) {
}
if (module_count > max_modules_) {
- BPLOG(ERROR) << "MinidumpModuleList count " << module_count_ <<
+ BPLOG(ERROR) << "MinidumpModuleList count " << module_count <<
" exceeds maximum " << max_modules_;
return false;
}
@@ -2499,8 +2725,7 @@ bool MinidumpModuleList::Read(uint32_t expected_size) {
scoped_ptr<MinidumpModules> modules(
new MinidumpModules(module_count, MinidumpModule(minidump_)));
- for (unsigned int module_index = 0;
- module_index < module_count;
+ for (uint32_t module_index = 0; module_index < module_count;
++module_index) {
MinidumpModule* module = &(*modules)[module_index];
@@ -2517,17 +2742,17 @@ bool MinidumpModuleList::Read(uint32_t expected_size) {
// MinidumpModule::ReadAuxiliaryData seeks around, and if it were
// included in the loop above, additional seeks would be needed where
// none are now to read contiguous data.
- for (unsigned int module_index = 0;
- module_index < module_count;
+ uint64_t last_end_address = 0;
+ for (uint32_t module_index = 0; module_index < module_count;
++module_index) {
- MinidumpModule* module = &(*modules)[module_index];
+ MinidumpModule& module = (*modules)[module_index];
// ReadAuxiliaryData fails if any data that the module indicates should
// exist is missing, but we treat some such cases as valid anyway. See
// issue #222: if a debugging record is of a format that's too large to
// handle, it shouldn't render the entire dump invalid. Check module
// validity before giving up.
- if (!module->ReadAuxiliaryData() && !module->valid()) {
+ if (!module.ReadAuxiliaryData() && !module.valid()) {
BPLOG(ERROR) << "MinidumpModuleList could not read required module "
"auxiliary data for module " <<
module_index << "/" << module_count;
@@ -2537,37 +2762,57 @@ bool MinidumpModuleList::Read(uint32_t expected_size) {
// It is safe to use module->code_file() after successfully calling
// module->ReadAuxiliaryData or noting that the module is valid.
- uint64_t base_address = module->base_address();
- uint64_t module_size = module->size();
+ uint64_t base_address = module.base_address();
+ uint64_t module_size = module.size();
if (base_address == static_cast<uint64_t>(-1)) {
- BPLOG(ERROR) << "MinidumpModuleList found bad base address "
- "for module " << module_index << "/" << module_count <<
- ", " << module->code_file();
+ BPLOG(ERROR) << "MinidumpModuleList found bad base address for module "
+ << module_index << "/" << module_count << ", "
+ << module.code_file();
return false;
}
- if (!range_map_->StoreRange(base_address, module_size, module_index)) {
- // Android's shared memory implementation /dev/ashmem can contain
- // duplicate entries for JITted code, so ignore these.
- // TODO(wfh): Remove this code when Android is fixed.
- // See https://crbug.com/439531
- const string kDevAshmem("/dev/ashmem/");
- if (module->code_file().compare(
- 0, kDevAshmem.length(), kDevAshmem) != 0) {
- BPLOG(ERROR) << "MinidumpModuleList could not store module " <<
- module_index << "/" << module_count << ", " <<
- module->code_file() << ", " <<
- HexString(base_address) << "+" <<
- HexString(module_size);
+ // Some minidumps have additional modules in the list that are duplicates.
+ // Ignore them. See https://crbug.com/838322
+ uint32_t existing_module_index;
+ if (range_map_->RetrieveRange(base_address, &existing_module_index,
+ nullptr, nullptr, nullptr) &&
+ existing_module_index < module_count) {
+ const MinidumpModule& existing_module =
+ (*modules)[existing_module_index];
+ if (existing_module.base_address() == module.base_address() &&
+ existing_module.size() == module.size() &&
+ existing_module.code_file() == module.code_file() &&
+ existing_module.code_identifier() == module.code_identifier()) {
+ continue;
+ }
+ }
+
+ const bool is_android = minidump_->IsAndroid();
+ if (!StoreRange(module, base_address, module_index, module_count,
+ is_android)) {
+ if (!is_android || base_address >= last_end_address) {
+ BPLOG(ERROR) << "MinidumpModuleList could not store module "
+ << module_index << "/" << module_count << ", "
+ << module.code_file() << ", " << HexString(base_address)
+ << "+" << HexString(module_size);
+ return false;
+ }
+
+ // If failed due to apparent range overlap the cause may be the client
+ // correction applied for Android packed relocations. If this is the
+ // case, back out the client correction and retry.
+ assert(is_android);
+ module_size -= last_end_address - base_address;
+ base_address = last_end_address;
+ if (!range_map_->StoreRange(base_address, module_size, module_index)) {
+ BPLOG(ERROR) << "MinidumpModuleList could not store module "
+ << module_index << "/" << module_count << ", "
+ << module.code_file() << ", " << HexString(base_address)
+ << "+" << HexString(module_size) << ", after adjusting";
return false;
- } else {
- BPLOG(INFO) << "MinidumpModuleList ignoring overlapping module " <<
- module_index << "/" << module_count << ", " <<
- module->code_file() << ", " <<
- HexString(base_address) << "+" <<
- HexString(module_size);
}
}
+ last_end_address = base_address + module_size;
}
modules_ = modules.release();
@@ -2579,6 +2824,28 @@ bool MinidumpModuleList::Read(uint32_t expected_size) {
return true;
}
+bool MinidumpModuleList::StoreRange(const MinidumpModule& module,
+ uint64_t base_address,
+ uint32_t module_index,
+ uint32_t module_count,
+ bool is_android) {
+ if (range_map_->StoreRange(base_address, module.size(), module_index))
+ return true;
+
+ // Android's shared memory implementation /dev/ashmem can contain duplicate
+ // entries for JITted code, so ignore these.
+ // TODO(wfh): Remove this code when Android is fixed.
+ // See https://crbug.com/439531
+ if (is_android && IsDevAshmem(module.code_file())) {
+ BPLOG(INFO) << "MinidumpModuleList ignoring overlapping module "
+ << module_index << "/" << module_count << ", "
+ << module.code_file() << ", " << HexString(base_address) << "+"
+ << HexString(module.size());
+ return true;
+ }
+
+ return false;
+}
const MinidumpModule* MinidumpModuleList::GetModuleForAddress(
uint64_t address) const {
@@ -2588,7 +2855,8 @@ const MinidumpModule* MinidumpModuleList::GetModuleForAddress(
}
unsigned int module_index;
- if (!range_map_->RetrieveRange(address, &module_index, NULL, NULL)) {
+ if (!range_map_->RetrieveRange(address, &module_index, NULL /* base */,
+ NULL /* delta */, NULL /* size */)) {
BPLOG(INFO) << "MinidumpModuleList has no module at " <<
HexString(address);
return NULL;
@@ -2624,7 +2892,9 @@ const MinidumpModule* MinidumpModuleList::GetModuleAtSequence(
}
unsigned int module_index;
- if (!range_map_->RetrieveRangeAtIndex(sequence, &module_index, NULL, NULL)) {
+ if (!range_map_->RetrieveRangeAtIndex(sequence, &module_index,
+ NULL /* base */, NULL /* delta */,
+ NULL /* size */)) {
BPLOG(ERROR) << "MinidumpModuleList has no module at sequence " << sequence;
return NULL;
}
@@ -2651,9 +2921,13 @@ const MinidumpModule* MinidumpModuleList::GetModuleAtIndex(
const CodeModules* MinidumpModuleList::Copy() const {
- return new BasicCodeModules(this);
+ return new BasicCodeModules(this, range_map_->GetMergeStrategy());
}
+vector<linked_ptr<const CodeModule> >
+MinidumpModuleList::GetShrunkRangeModules() const {
+ return vector<linked_ptr<const CodeModule> >();
+}
void MinidumpModuleList::Print() {
if (!valid_) {
@@ -2839,7 +3113,8 @@ MinidumpMemoryRegion* MinidumpMemoryList::GetMemoryRegionForAddress(
}
unsigned int region_index;
- if (!range_map_->RetrieveRange(address, &region_index, NULL, NULL)) {
+ if (!range_map_->RetrieveRange(address, &region_index, NULL /* base */,
+ NULL /* delta */, NULL /* size */)) {
BPLOG(INFO) << "MinidumpMemoryList has no memory region at " <<
HexString(address);
return NULL;
@@ -3210,6 +3485,10 @@ string MinidumpSystemInfo::GetOS() {
os = "nacl";
break;
+ case MD_OS_FUCHSIA:
+ os = "fuchsia";
+ break;
+
default:
BPLOG(ERROR) << "MinidumpSystemInfo unknown OS for platform " <<
HexString(system_info_.platform_id);
@@ -3255,6 +3534,7 @@ string MinidumpSystemInfo::GetCPU() {
break;
case MD_CPU_ARCHITECTURE_ARM64:
+ case MD_CPU_ARCHITECTURE_ARM64_OLD:
cpu = "arm64";
break;
@@ -3388,6 +3668,386 @@ void MinidumpSystemInfo::Print() {
//
+// MinidumpUnloadedModule
+//
+
+
+MinidumpUnloadedModule::MinidumpUnloadedModule(Minidump* minidump)
+ : MinidumpObject(minidump),
+ module_valid_(false),
+ unloaded_module_(),
+ name_(NULL) {
+
+}
+
+MinidumpUnloadedModule::~MinidumpUnloadedModule() {
+ delete name_;
+}
+
+string MinidumpUnloadedModule::code_file() const {
+ if (!valid_) {
+ BPLOG(ERROR) << "Invalid MinidumpUnloadedModule for code_file";
+ return "";
+ }
+
+ return *name_;
+}
+
+string MinidumpUnloadedModule::code_identifier() const {
+ if (!valid_) {
+ BPLOG(ERROR) << "Invalid MinidumpUnloadedModule for code_identifier";
+ return "";
+ }
+
+ MinidumpSystemInfo *minidump_system_info = minidump_->GetSystemInfo();
+ if (!minidump_system_info) {
+ BPLOG(ERROR) << "MinidumpUnloadedModule code_identifier requires "
+ "MinidumpSystemInfo";
+ return "";
+ }
+
+ const MDRawSystemInfo *raw_system_info = minidump_system_info->system_info();
+ if (!raw_system_info) {
+ BPLOG(ERROR) << "MinidumpUnloadedModule code_identifier requires "
+ << "MDRawSystemInfo";
+ return "";
+ }
+
+ string identifier;
+
+ switch (raw_system_info->platform_id) {
+ case MD_OS_WIN32_NT:
+ case MD_OS_WIN32_WINDOWS: {
+ // Use the same format that the MS symbol server uses in filesystem
+ // hierarchies.
+ char identifier_string[17];
+ snprintf(identifier_string, sizeof(identifier_string), "%08X%x",
+ unloaded_module_.time_date_stamp,
+ unloaded_module_.size_of_image);
+ identifier = identifier_string;
+ break;
+ }
+
+ case MD_OS_ANDROID:
+ case MD_OS_LINUX:
+ case MD_OS_MAC_OS_X:
+ case MD_OS_IOS:
+ case MD_OS_SOLARIS:
+ case MD_OS_NACL:
+ case MD_OS_PS3: {
+ // TODO(mmentovai): support uuid extension if present, otherwise fall
+ // back to version (from LC_ID_DYLIB?), otherwise fall back to something
+ // else.
+ identifier = "id";
+ break;
+ }
+
+ default: {
+ // Without knowing what OS generated the dump, we can't generate a good
+ // identifier. Return an empty string, signalling failure.
+ BPLOG(ERROR) << "MinidumpUnloadedModule code_identifier requires known "
+ << "platform, found "
+ << HexString(raw_system_info->platform_id);
+ break;
+ }
+ }
+
+ return identifier;
+}
+
+string MinidumpUnloadedModule::debug_file() const {
+ return ""; // No debug info provided with unloaded modules
+}
+
+string MinidumpUnloadedModule::debug_identifier() const {
+ return ""; // No debug info provided with unloaded modules
+}
+
+string MinidumpUnloadedModule::version() const {
+ return ""; // No version info provided with unloaded modules
+}
+
+CodeModule* MinidumpUnloadedModule::Copy() const {
+ return new BasicCodeModule(this);
+}
+
+uint64_t MinidumpUnloadedModule::shrink_down_delta() const {
+ return 0;
+}
+
+void MinidumpUnloadedModule::SetShrinkDownDelta(uint64_t shrink_down_delta) {
+ // Not implemented
+ assert(false);
+}
+
+bool MinidumpUnloadedModule::Read(uint32_t expected_size) {
+
+ delete name_;
+ valid_ = false;
+
+ if (expected_size < sizeof(unloaded_module_)) {
+ BPLOG(ERROR) << "MinidumpUnloadedModule expected size is less than size "
+ << "of struct " << expected_size << " < "
+ << sizeof(unloaded_module_);
+ return false;
+ }
+
+ if (!minidump_->ReadBytes(&unloaded_module_, sizeof(unloaded_module_))) {
+ BPLOG(ERROR) << "MinidumpUnloadedModule cannot read module";
+ return false;
+ }
+
+ if (expected_size > sizeof(unloaded_module_)) {
+ uint32_t module_bytes_remaining = expected_size - sizeof(unloaded_module_);
+ off_t pos = minidump_->Tell();
+ if (!minidump_->SeekSet(pos + module_bytes_remaining)) {
+ BPLOG(ERROR) << "MinidumpUnloadedModule unable to seek to end of module";
+ return false;
+ }
+ }
+
+ if (minidump_->swap()) {
+ Swap(&unloaded_module_.base_of_image);
+ Swap(&unloaded_module_.size_of_image);
+ Swap(&unloaded_module_.checksum);
+ Swap(&unloaded_module_.time_date_stamp);
+ Swap(&unloaded_module_.module_name_rva);
+ }
+
+ // Check for base + size overflow or undersize.
+ if (unloaded_module_.size_of_image == 0 ||
+ unloaded_module_.size_of_image >
+ numeric_limits<uint64_t>::max() - unloaded_module_.base_of_image) {
+ BPLOG(ERROR) << "MinidumpUnloadedModule has a module problem, " <<
+ HexString(unloaded_module_.base_of_image) << "+" <<
+ HexString(unloaded_module_.size_of_image);
+ return false;
+ }
+
+
+ module_valid_ = true;
+ return true;
+}
+
+bool MinidumpUnloadedModule::ReadAuxiliaryData() {
+ if (!module_valid_) {
+ BPLOG(ERROR) << "Invalid MinidumpUnloadedModule for ReadAuxiliaryData";
+ return false;
+ }
+
+ // Each module must have a name.
+ name_ = minidump_->ReadString(unloaded_module_.module_name_rva);
+ if (!name_) {
+ BPLOG(ERROR) << "MinidumpUnloadedModule could not read name";
+ return false;
+ }
+
+ // At this point, we have enough info for the module to be valid.
+ valid_ = true;
+ return true;
+}
+
+//
+// MinidumpUnloadedModuleList
+//
+
+
+uint32_t MinidumpUnloadedModuleList::max_modules_ = 2048;
+
+
+MinidumpUnloadedModuleList::MinidumpUnloadedModuleList(Minidump* minidump)
+ : MinidumpStream(minidump),
+ range_map_(new RangeMap<uint64_t, unsigned int>()),
+ unloaded_modules_(NULL),
+ module_count_(0) {
+ range_map_->SetMergeStrategy(MergeRangeStrategy::kTruncateLower);
+}
+
+MinidumpUnloadedModuleList::~MinidumpUnloadedModuleList() {
+ delete range_map_;
+ delete unloaded_modules_;
+}
+
+
+bool MinidumpUnloadedModuleList::Read(uint32_t expected_size) {
+ range_map_->Clear();
+ delete unloaded_modules_;
+ unloaded_modules_ = NULL;
+ module_count_ = 0;
+
+ valid_ = false;
+
+ uint32_t size_of_header;
+ if (!minidump_->ReadBytes(&size_of_header, sizeof(size_of_header))) {
+ BPLOG(ERROR) << "MinidumpUnloadedModuleList could not read header size";
+ return false;
+ }
+
+ uint32_t size_of_entry;
+ if (!minidump_->ReadBytes(&size_of_entry, sizeof(size_of_entry))) {
+ BPLOG(ERROR) << "MinidumpUnloadedModuleList could not read entry size";
+ return false;
+ }
+
+ uint32_t number_of_entries;
+ if (!minidump_->ReadBytes(&number_of_entries, sizeof(number_of_entries))) {
+ BPLOG(ERROR) <<
+ "MinidumpUnloadedModuleList could not read number of entries";
+ return false;
+ }
+
+ if (minidump_->swap()) {
+ Swap(&size_of_header);
+ Swap(&size_of_entry);
+ Swap(&number_of_entries);
+ }
+
+ uint32_t header_bytes_remaining = size_of_header - sizeof(size_of_header) -
+ sizeof(size_of_entry) - sizeof(number_of_entries);
+ if (header_bytes_remaining) {
+ off_t pos = minidump_->Tell();
+ if (!minidump_->SeekSet(pos + header_bytes_remaining)) {
+ BPLOG(ERROR) << "MinidumpUnloadedModuleList could not read header sized "
+ << size_of_header;
+ return false;
+ }
+ }
+
+ if (expected_size != size_of_header + (size_of_entry * number_of_entries)) {
+ BPLOG(ERROR) << "MinidumpUnloadedModuleList expected_size mismatch " <<
+ expected_size << " != " << size_of_header << " + (" <<
+ size_of_entry << " * " << number_of_entries << ")";
+ return false;
+ }
+
+ if (number_of_entries > max_modules_) {
+ BPLOG(ERROR) << "MinidumpUnloadedModuleList count " <<
+ number_of_entries << " exceeds maximum " << max_modules_;
+ return false;
+ }
+
+ if (number_of_entries != 0) {
+ scoped_ptr<MinidumpUnloadedModules> modules(
+ new MinidumpUnloadedModules(number_of_entries,
+ MinidumpUnloadedModule(minidump_)));
+
+ for (unsigned int module_index = 0;
+ module_index < number_of_entries;
+ ++module_index) {
+ MinidumpUnloadedModule* module = &(*modules)[module_index];
+
+ if (!module->Read(size_of_entry)) {
+ BPLOG(ERROR) << "MinidumpUnloadedModuleList could not read module " <<
+ module_index << "/" << number_of_entries;
+ return false;
+ }
+ }
+
+ for (unsigned int module_index = 0;
+ module_index < number_of_entries;
+ ++module_index) {
+ MinidumpUnloadedModule* module = &(*modules)[module_index];
+
+ if (!module->ReadAuxiliaryData()) {
+ BPLOG(ERROR) << "MinidumpUnloadedModuleList could not read required "
+ "module auxiliary data for module " <<
+ module_index << "/" << number_of_entries;
+ return false;
+ }
+
+ uint64_t base_address = module->base_address();
+ uint64_t module_size = module->size();
+
+ // Ignore any failures for conflicting address ranges
+ range_map_->StoreRange(base_address, module_size, module_index);
+
+ }
+ unloaded_modules_ = modules.release();
+ }
+
+ module_count_ = number_of_entries;
+ valid_ = true;
+ return true;
+}
+
+const MinidumpUnloadedModule* MinidumpUnloadedModuleList::GetModuleForAddress(
+ uint64_t address) const {
+ if (!valid_) {
+ BPLOG(ERROR)
+ << "Invalid MinidumpUnloadedModuleList for GetModuleForAddress";
+ return NULL;
+ }
+
+ unsigned int module_index;
+ if (!range_map_->RetrieveRange(address, &module_index, NULL /* base */,
+ NULL /* delta */, NULL /* size */)) {
+ BPLOG(INFO) << "MinidumpUnloadedModuleList has no module at "
+ << HexString(address);
+ return NULL;
+ }
+
+ return GetModuleAtIndex(module_index);
+}
+
+const MinidumpUnloadedModule*
+MinidumpUnloadedModuleList::GetMainModule() const {
+ return NULL;
+}
+
+const MinidumpUnloadedModule*
+MinidumpUnloadedModuleList::GetModuleAtSequence(unsigned int sequence) const {
+ if (!valid_) {
+ BPLOG(ERROR)
+ << "Invalid MinidumpUnloadedModuleList for GetModuleAtSequence";
+ return NULL;
+ }
+
+ if (sequence >= module_count_) {
+ BPLOG(ERROR) << "MinidumpUnloadedModuleList sequence out of range: "
+ << sequence << "/" << module_count_;
+ return NULL;
+ }
+
+ unsigned int module_index;
+ if (!range_map_->RetrieveRangeAtIndex(sequence, &module_index,
+ NULL /* base */, NULL /* delta */,
+ NULL /* size */)) {
+ BPLOG(ERROR) << "MinidumpUnloadedModuleList has no module at sequence "
+ << sequence;
+ return NULL;
+ }
+
+ return GetModuleAtIndex(module_index);
+}
+
+const MinidumpUnloadedModule*
+MinidumpUnloadedModuleList::GetModuleAtIndex(
+ unsigned int index) const {
+ if (!valid_) {
+ BPLOG(ERROR) << "Invalid MinidumpUnloadedModuleList for GetModuleAtIndex";
+ return NULL;
+ }
+
+ if (index >= module_count_) {
+ BPLOG(ERROR) << "MinidumpUnloadedModuleList index out of range: "
+ << index << "/" << module_count_;
+ return NULL;
+ }
+
+ return &(*unloaded_modules_)[index];
+}
+
+const CodeModules* MinidumpUnloadedModuleList::Copy() const {
+ return new BasicCodeModules(this, range_map_->GetMergeStrategy());
+}
+
+vector<linked_ptr<const CodeModule>>
+MinidumpUnloadedModuleList::GetShrunkRangeModules() const {
+ return vector<linked_ptr<const CodeModule> >();
+}
+
+
+//
// MinidumpMiscInfo
//
@@ -3401,15 +4061,25 @@ MinidumpMiscInfo::MinidumpMiscInfo(Minidump* minidump)
bool MinidumpMiscInfo::Read(uint32_t expected_size) {
valid_ = false;
+ size_t padding = 0;
if (expected_size != MD_MISCINFO_SIZE &&
expected_size != MD_MISCINFO2_SIZE &&
expected_size != MD_MISCINFO3_SIZE &&
- expected_size != MD_MISCINFO4_SIZE) {
- BPLOG(ERROR) << "MinidumpMiscInfo size mismatch, " << expected_size
- << " != " << MD_MISCINFO_SIZE << ", " << MD_MISCINFO2_SIZE
- << ", " << MD_MISCINFO3_SIZE << ", " << MD_MISCINFO4_SIZE
- << ")";
- return false;
+ expected_size != MD_MISCINFO4_SIZE &&
+ expected_size != MD_MISCINFO5_SIZE) {
+ if (expected_size > MD_MISCINFO5_SIZE) {
+ // Only read the part of the misc info structure we know how to handle
+ BPLOG(INFO) << "MinidumpMiscInfo size larger than expected "
+ << expected_size << ", skipping over the unknown part";
+ padding = expected_size - MD_MISCINFO5_SIZE;
+ expected_size = MD_MISCINFO5_SIZE;
+ } else {
+ BPLOG(ERROR) << "MinidumpMiscInfo size mismatch, " << expected_size
+ << " != " << MD_MISCINFO_SIZE << ", " << MD_MISCINFO2_SIZE
+ << ", " << MD_MISCINFO3_SIZE << ", " << MD_MISCINFO4_SIZE
+ << ", " << MD_MISCINFO5_SIZE << ")";
+ return false;
+ }
}
if (!minidump_->ReadBytes(&misc_info_, expected_size)) {
@@ -3417,6 +4087,20 @@ bool MinidumpMiscInfo::Read(uint32_t expected_size) {
return false;
}
+ if (padding != 0) {
+ off_t saved_position = minidump_->Tell();
+ if (saved_position == -1) {
+ BPLOG(ERROR) << "MinidumpMiscInfo could not tell the current position";
+ return false;
+ }
+
+ if (!minidump_->SeekSet(saved_position + static_cast<off_t>(padding))) {
+ BPLOG(ERROR) << "MinidumpMiscInfo could not seek past the miscellaneous "
+ << "info structure";
+ return false;
+ }
+ }
+
if (minidump_->swap()) {
// Swap version 1 fields
Swap(&misc_info_.size_of_info);
@@ -3446,9 +4130,14 @@ bool MinidumpMiscInfo::Read(uint32_t expected_size) {
// Do not swap UTF-16 strings. The swap is done as part of the
// conversion to UTF-8 (code follows below).
}
+ if (misc_info_.size_of_info > MD_MISCINFO4_SIZE) {
+ // Swap version 5 fields
+ Swap(&misc_info_.xstate_data);
+ Swap(&misc_info_.process_cookie);
+ }
}
- if (expected_size != misc_info_.size_of_info) {
+ if (expected_size + padding != misc_info_.size_of_info) {
BPLOG(ERROR) << "MinidumpMiscInfo size mismatch, " <<
expected_size << " != " << misc_info_.size_of_info;
return false;
@@ -3598,6 +4287,35 @@ void MinidumpMiscInfo::Print() {
printf(" dbg_bld_str = (invalid)\n");
}
}
+ if (misc_info_.size_of_info > MD_MISCINFO4_SIZE) {
+ // Print version 5 fields
+ if (misc_info_.flags1 & MD_MISCINFO_FLAGS1_PROCESS_COOKIE) {
+ printf(" xstate_data.size_of_info = %d\n",
+ misc_info_.xstate_data.size_of_info);
+ printf(" xstate_data.context_size = %d\n",
+ misc_info_.xstate_data.context_size);
+ printf(" xstate_data.enabled_features = 0x%" PRIx64 "\n",
+ misc_info_.xstate_data.enabled_features);
+ for (size_t i = 0; i < MD_MAXIMUM_XSTATE_FEATURES; i++) {
+ if ((misc_info_.xstate_data.enabled_features >> i) & 1) {
+ printf(" xstate_data.features[%02zu] = { %d, %d }\n", i,
+ misc_info_.xstate_data.features[i].offset,
+ misc_info_.xstate_data.features[i].size);
+ }
+ }
+ if (misc_info_.xstate_data.enabled_features == 0) {
+ printf(" xstate_data.features[] = (empty)\n");
+ }
+ printf(" process_cookie = %d\n",
+ misc_info_.process_cookie);
+ } else {
+ printf(" xstate_data.size_of_info = (invalid)\n");
+ printf(" xstate_data.context_size = (invalid)\n");
+ printf(" xstate_data.enabled_features = (invalid)\n");
+ printf(" xstate_data.features[] = (invalid)\n");
+ printf(" process_cookie = (invalid)\n");
+ }
+ }
printf("\n");
}
@@ -3910,7 +4628,7 @@ bool MinidumpMemoryInfoList::Read(uint32_t expected_size) {
infos_ = infos.release();
}
- info_count_ = header_number_of_entries;
+ info_count_ = static_cast<uint32_t>(header_number_of_entries);
valid_ = true;
return true;
@@ -3943,7 +4661,8 @@ const MinidumpMemoryInfo* MinidumpMemoryInfoList::GetMemoryInfoForAddress(
}
unsigned int info_index;
- if (!range_map_->RetrieveRange(address, &info_index, NULL, NULL)) {
+ if (!range_map_->RetrieveRange(address, &info_index, NULL /* base */,
+ NULL /* delta */, NULL /* size */)) {
BPLOG(INFO) << "MinidumpMemoryInfoList has no memory info at " <<
HexString(address);
return NULL;
@@ -3972,6 +4691,335 @@ void MinidumpMemoryInfoList::Print() {
}
}
+//
+// MinidumpLinuxMaps
+//
+
+MinidumpLinuxMaps::MinidumpLinuxMaps(Minidump *minidump)
+ : MinidumpObject(minidump) {
+}
+
+void MinidumpLinuxMaps::Print() const {
+ if (!valid_) {
+ BPLOG(ERROR) << "MinidumpLinuxMaps cannot print invalid data";
+ return;
+ }
+ std::cout << region_.line << std::endl;
+}
+
+//
+// MinidumpLinuxMapsList
+//
+
+MinidumpLinuxMapsList::MinidumpLinuxMapsList(Minidump *minidump)
+ : MinidumpStream(minidump),
+ maps_(NULL),
+ maps_count_(0) {
+}
+
+MinidumpLinuxMapsList::~MinidumpLinuxMapsList() {
+ if (maps_) {
+ for (unsigned int i = 0; i < maps_->size(); i++) {
+ delete (*maps_)[i];
+ }
+ delete maps_;
+ }
+}
+
+const MinidumpLinuxMaps *MinidumpLinuxMapsList::GetLinuxMapsForAddress(
+ uint64_t address) const {
+ if (!valid_ || (maps_ == NULL)) {
+ BPLOG(ERROR) << "Invalid MinidumpLinuxMapsList for GetLinuxMapsForAddress";
+ return NULL;
+ }
+
+ // Search every memory mapping.
+ for (unsigned int index = 0; index < maps_count_; index++) {
+ // Check if address is within bounds of the current memory region.
+ if ((*maps_)[index]->GetBase() <= address &&
+ (*maps_)[index]->GetBase() + (*maps_)[index]->GetSize() > address) {
+ return (*maps_)[index];
+ }
+ }
+
+ // No mapping encloses the memory address.
+ BPLOG(ERROR) << "MinidumpLinuxMapsList has no mapping at "
+ << HexString(address);
+ return NULL;
+}
+
+const MinidumpLinuxMaps *MinidumpLinuxMapsList::GetLinuxMapsAtIndex(
+ unsigned int index) const {
+ if (!valid_ || (maps_ == NULL)) {
+ BPLOG(ERROR) << "Invalid MinidumpLinuxMapsList for GetLinuxMapsAtIndex";
+ return NULL;
+ }
+
+ // Index out of bounds.
+ if (index >= maps_count_ || (maps_ == NULL)) {
+ BPLOG(ERROR) << "MinidumpLinuxMapsList index of out range: "
+ << index
+ << "/"
+ << maps_count_;
+ return NULL;
+ }
+ return (*maps_)[index];
+}
+
+bool MinidumpLinuxMapsList::Read(uint32_t expected_size) {
+ // Invalidate cached data.
+ if (maps_) {
+ for (unsigned int i = 0; i < maps_->size(); i++) {
+ delete (*maps_)[i];
+ }
+ delete maps_;
+ }
+ maps_ = NULL;
+ maps_count_ = 0;
+
+ valid_ = false;
+
+ // Load and check expected stream length.
+ uint32_t length = 0;
+ if (!minidump_->SeekToStreamType(MD_LINUX_MAPS, &length)) {
+ BPLOG(ERROR) << "MinidumpLinuxMapsList stream type not found";
+ return false;
+ }
+ if (expected_size != length) {
+ BPLOG(ERROR) << "MinidumpLinuxMapsList size mismatch: "
+ << expected_size
+ << " != "
+ << length;
+ return false;
+ }
+
+ // Create a vector to read stream data. The vector needs to have
+ // at least enough capacity to read all the data.
+ vector<char> mapping_bytes(length);
+ if (!minidump_->ReadBytes(&mapping_bytes[0], length)) {
+ BPLOG(ERROR) << "MinidumpLinuxMapsList failed to read bytes";
+ return false;
+ }
+ string map_string(mapping_bytes.begin(), mapping_bytes.end());
+ vector<MappedMemoryRegion> all_regions;
+
+ // Parse string into mapping data.
+ if (!ParseProcMaps(map_string, &all_regions)) {
+ return false;
+ }
+
+ scoped_ptr<MinidumpLinuxMappings> maps(new MinidumpLinuxMappings());
+
+ // Push mapping data into wrapper classes.
+ for (size_t i = 0; i < all_regions.size(); i++) {
+ scoped_ptr<MinidumpLinuxMaps> ele(new MinidumpLinuxMaps(minidump_));
+ ele->region_ = all_regions[i];
+ ele->valid_ = true;
+ maps->push_back(ele.release());
+ }
+
+ // Set instance variables.
+ maps_ = maps.release();
+ maps_count_ = static_cast<uint32_t>(maps_->size());
+ valid_ = true;
+ return true;
+}
+
+void MinidumpLinuxMapsList::Print() const {
+ if (!valid_ || (maps_ == NULL)) {
+ BPLOG(ERROR) << "MinidumpLinuxMapsList cannot print valid data";
+ return;
+ }
+ for (size_t i = 0; i < maps_->size(); i++) {
+ (*maps_)[i]->Print();
+ }
+}
+
+//
+// MinidumpCrashpadInfo
+//
+
+
+MinidumpCrashpadInfo::MinidumpCrashpadInfo(Minidump* minidump)
+ : MinidumpStream(minidump),
+ crashpad_info_(),
+ module_crashpad_info_links_(),
+ module_crashpad_info_(),
+ module_crashpad_info_list_annotations_(),
+ module_crashpad_info_simple_annotations_(),
+ simple_annotations_() {
+}
+
+
+bool MinidumpCrashpadInfo::Read(uint32_t expected_size) {
+ valid_ = false;
+
+ if (expected_size != sizeof(crashpad_info_)) {
+ BPLOG(ERROR) << "MinidumpCrashpadInfo size mismatch, " << expected_size <<
+ " != " << sizeof(crashpad_info_);
+ return false;
+ }
+
+ if (!minidump_->ReadBytes(&crashpad_info_, sizeof(crashpad_info_))) {
+ BPLOG(ERROR) << "MinidumpCrashpadInfo cannot read Crashpad info";
+ return false;
+ }
+
+ if (minidump_->swap()) {
+ Swap(&crashpad_info_.version);
+ Swap(&crashpad_info_.report_id);
+ Swap(&crashpad_info_.client_id);
+ Swap(&crashpad_info_.simple_annotations);
+ Swap(&crashpad_info_.module_list);
+ }
+
+ if (crashpad_info_.simple_annotations.data_size) {
+ if (!minidump_->ReadSimpleStringDictionary(
+ crashpad_info_.simple_annotations.rva,
+ &simple_annotations_)) {
+ BPLOG(ERROR) << "MinidumpCrashpadInfo cannot read simple_annotations";
+ return false;
+ }
+ }
+
+ if (crashpad_info_.module_list.data_size) {
+ if (!minidump_->SeekSet(crashpad_info_.module_list.rva)) {
+ BPLOG(ERROR) << "MinidumpCrashpadInfo cannot seek to module_list";
+ return false;
+ }
+
+ uint32_t count;
+ if (!minidump_->ReadBytes(&count, sizeof(count))) {
+ BPLOG(ERROR) << "MinidumpCrashpadInfo cannot read module_list count";
+ return false;
+ }
+
+ if (minidump_->swap()) {
+ Swap(&count);
+ }
+
+ scoped_array<MDRawModuleCrashpadInfoLink> module_crashpad_info_links(
+ new MDRawModuleCrashpadInfoLink[count]);
+
+ // Read the entire array in one fell swoop, instead of reading one entry
+ // at a time in the loop.
+ if (!minidump_->ReadBytes(
+ &module_crashpad_info_links[0],
+ sizeof(MDRawModuleCrashpadInfoLink) * count)) {
+ BPLOG(ERROR)
+ << "MinidumpCrashpadInfo could not read Crashpad module links";
+ return false;
+ }
+
+ for (uint32_t index = 0; index < count; ++index) {
+ if (minidump_->swap()) {
+ Swap(&module_crashpad_info_links[index].minidump_module_list_index);
+ Swap(&module_crashpad_info_links[index].location);
+ }
+
+ if (!minidump_->SeekSet(module_crashpad_info_links[index].location.rva)) {
+ BPLOG(ERROR)
+ << "MinidumpCrashpadInfo cannot seek to Crashpad module info";
+ return false;
+ }
+
+ MDRawModuleCrashpadInfo module_crashpad_info;
+ if (!minidump_->ReadBytes(&module_crashpad_info,
+ sizeof(module_crashpad_info))) {
+ BPLOG(ERROR) << "MinidumpCrashpadInfo cannot read Crashpad module info";
+ return false;
+ }
+
+ if (minidump_->swap()) {
+ Swap(&module_crashpad_info.version);
+ Swap(&module_crashpad_info.list_annotations);
+ Swap(&module_crashpad_info.simple_annotations);
+ }
+
+ std::vector<std::string> list_annotations;
+ if (module_crashpad_info.list_annotations.data_size) {
+ if (!minidump_->ReadStringList(
+ module_crashpad_info.list_annotations.rva,
+ &list_annotations)) {
+ BPLOG(ERROR) << "MinidumpCrashpadInfo cannot read Crashpad module "
+ "info list annotations";
+ return false;
+ }
+ }
+
+ std::map<std::string, std::string> simple_annotations;
+ if (module_crashpad_info.simple_annotations.data_size) {
+ if (!minidump_->ReadSimpleStringDictionary(
+ module_crashpad_info.simple_annotations.rva,
+ &simple_annotations)) {
+ BPLOG(ERROR) << "MinidumpCrashpadInfo cannot read Crashpad module "
+ "info simple annotations";
+ return false;
+ }
+ }
+
+ module_crashpad_info_links_.push_back(
+ module_crashpad_info_links[index].minidump_module_list_index);
+ module_crashpad_info_.push_back(module_crashpad_info);
+ module_crashpad_info_list_annotations_.push_back(list_annotations);
+ module_crashpad_info_simple_annotations_.push_back(simple_annotations);
+ }
+ }
+
+ valid_ = true;
+ return true;
+}
+
+
+void MinidumpCrashpadInfo::Print() {
+ if (!valid_) {
+ BPLOG(ERROR) << "MinidumpCrashpadInfo cannot print invalid data";
+ return;
+ }
+
+ printf("MDRawCrashpadInfo\n");
+ printf(" version = %d\n", crashpad_info_.version);
+ printf(" report_id = %s\n",
+ MDGUIDToString(crashpad_info_.report_id).c_str());
+ printf(" client_id = %s\n",
+ MDGUIDToString(crashpad_info_.client_id).c_str());
+ for (std::map<std::string, std::string>::const_iterator iterator =
+ simple_annotations_.begin();
+ iterator != simple_annotations_.end();
+ ++iterator) {
+ printf(" simple_annotations[\"%s\"] = %s\n",
+ iterator->first.c_str(), iterator->second.c_str());
+ }
+ for (uint32_t module_index = 0;
+ module_index < module_crashpad_info_links_.size();
+ ++module_index) {
+ printf(" module_list[%d].minidump_module_list_index = %d\n",
+ module_index, module_crashpad_info_links_[module_index]);
+ printf(" module_list[%d].version = %d\n",
+ module_index, module_crashpad_info_[module_index].version);
+ for (uint32_t annotation_index = 0;
+ annotation_index <
+ module_crashpad_info_list_annotations_[module_index].size();
+ ++annotation_index) {
+ printf(" module_list[%d].list_annotations[%d] = %s\n",
+ module_index,
+ annotation_index,
+ module_crashpad_info_list_annotations_
+ [module_index][annotation_index].c_str());
+ }
+ for (std::map<std::string, std::string>::const_iterator iterator =
+ module_crashpad_info_simple_annotations_[module_index].begin();
+ iterator !=
+ module_crashpad_info_simple_annotations_[module_index].end();
+ ++iterator) {
+ printf(" module_list[%d].simple_annotations[\"%s\"] = %s\n",
+ module_index, iterator->first.c_str(), iterator->second.c_str());
+ }
+ }
+
+ printf("\n");
+}
+
//
// Minidump
@@ -3982,14 +5030,17 @@ uint32_t Minidump::max_streams_ = 128;
unsigned int Minidump::max_string_length_ = 1024;
-Minidump::Minidump(const string& path)
+Minidump::Minidump(const string& path, bool hexdump, unsigned int hexdump_width)
: header_(),
directory_(NULL),
stream_map_(new MinidumpStreamMap()),
path_(path),
stream_(NULL),
swap_(false),
- valid_(false) {
+ is_big_endian_(false),
+ valid_(false),
+ hexdump_(hexdump),
+ hexdump_width_(hexdump_width) {
}
Minidump::Minidump(istream& stream)
@@ -3999,7 +5050,10 @@ Minidump::Minidump(istream& stream)
path_(),
stream_(&stream),
swap_(false),
- valid_(false) {
+ is_big_endian_(false),
+ valid_(false),
+ hexdump_(false),
+ hexdump_width_(0) {
}
Minidump::~Minidump() {
@@ -4059,6 +5113,9 @@ bool Minidump::GetContextCPUFlagsFromSystemInfo(uint32_t *context_cpu_flags) {
case MD_CPU_ARCHITECTURE_MIPS:
*context_cpu_flags = MD_CONTEXT_MIPS;
break;
+ case MD_CPU_ARCHITECTURE_MIPS64:
+ *context_cpu_flags = MD_CONTEXT_MIPS64;
+ break;
case MD_CPU_ARCHITECTURE_ALPHA:
*context_cpu_flags = MD_CONTEXT_ALPHA;
break;
@@ -4077,6 +5134,9 @@ bool Minidump::GetContextCPUFlagsFromSystemInfo(uint32_t *context_cpu_flags) {
case MD_CPU_ARCHITECTURE_ARM64:
*context_cpu_flags = MD_CONTEXT_ARM64;
break;
+ case MD_CPU_ARCHITECTURE_ARM64_OLD:
+ *context_cpu_flags = MD_CONTEXT_ARM64_OLD;
+ break;
case MD_CPU_ARCHITECTURE_IA64:
*context_cpu_flags = MD_CONTEXT_IA64;
break;
@@ -4149,6 +5209,13 @@ bool Minidump::Read() {
swap_ = false;
}
+#if defined(__BIG_ENDIAN__) || \
+ (defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
+ is_big_endian_ = !swap_;
+#else
+ is_big_endian_ = swap_;
+#endif
+
BPLOG(INFO) << "Minidump " << (swap_ ? "" : "not ") <<
"byte-swapping minidump";
@@ -4214,7 +5281,8 @@ bool Minidump::Read() {
case MD_EXCEPTION_STREAM:
case MD_SYSTEM_INFO_STREAM:
case MD_MISC_INFO_STREAM:
- case MD_BREAKPAD_INFO_STREAM: {
+ case MD_BREAKPAD_INFO_STREAM:
+ case MD_CRASHPAD_INFO_STREAM: {
if (stream_map_->find(stream_type) != stream_map_->end()) {
// Another stream with this type was already found. A minidump
// file should contain at most one of each of these stream types.
@@ -4222,7 +5290,7 @@ bool Minidump::Read() {
stream_type << ", but can only deal with one";
return false;
}
- // Fall through to default
+ BP_FALLTHROUGH;
}
default: {
@@ -4276,6 +5344,12 @@ MinidumpSystemInfo* Minidump::GetSystemInfo() {
}
+MinidumpUnloadedModuleList* Minidump::GetUnloadedModuleList() {
+ MinidumpUnloadedModuleList* unloaded_module_list;
+ return GetStream(&unloaded_module_list);
+}
+
+
MinidumpMiscInfo* Minidump::GetMiscInfo() {
MinidumpMiscInfo* misc_info;
return GetStream(&misc_info);
@@ -4292,6 +5366,43 @@ MinidumpMemoryInfoList* Minidump::GetMemoryInfoList() {
return GetStream(&memory_info_list);
}
+MinidumpLinuxMapsList *Minidump::GetLinuxMapsList() {
+ MinidumpLinuxMapsList *linux_maps_list;
+ return GetStream(&linux_maps_list);
+}
+
+bool Minidump::IsAndroid() {
+ MDOSPlatform platform;
+ return GetPlatform(&platform) && platform == MD_OS_ANDROID;
+}
+
+bool Minidump::GetPlatform(MDOSPlatform* platform) {
+ // Save the current stream position
+ off_t saved_position = Tell();
+ if (saved_position == -1) {
+ return false;
+ }
+ const MDRawSystemInfo* system_info =
+ GetSystemInfo() ? GetSystemInfo()->system_info() : NULL;
+
+ // Restore position and return
+ if (!SeekSet(saved_position)) {
+ BPLOG(ERROR) << "Couldn't seek back to saved position";
+ return false;
+ }
+
+ if (!system_info) {
+ return false;
+ }
+ *platform = static_cast<MDOSPlatform>(system_info->platform_id);
+ return true;
+}
+
+MinidumpCrashpadInfo* Minidump::GetCrashpadInfo() {
+ MinidumpCrashpadInfo* crashpad_info;
+ return GetStream(&crashpad_info);
+}
+
static const char* get_stream_name(uint32_t stream_type) {
switch (stream_type) {
case MD_UNUSED_STREAM:
@@ -4332,6 +5443,14 @@ static const char* get_stream_name(uint32_t stream_type) {
return "MD_THREAD_INFO_LIST_STREAM";
case MD_HANDLE_OPERATION_LIST_STREAM:
return "MD_HANDLE_OPERATION_LIST_STREAM";
+ case MD_TOKEN_STREAM:
+ return "MD_TOKEN_STREAM";
+ case MD_JAVASCRIPT_DATA_STREAM:
+ return "MD_JAVASCRIPT_DATA_STREAM";
+ case MD_SYSTEM_MEMORY_INFO_STREAM:
+ return "MD_SYSTEM_MEMORY_INFO_STREAM";
+ case MD_PROCESS_VM_COUNTERS_STREAM:
+ return "MD_PROCESS_VM_COUNTERS_STREAM";
case MD_LAST_RESERVED_STREAM:
return "MD_LAST_RESERVED_STREAM";
case MD_BREAKPAD_INFO_STREAM:
@@ -4354,6 +5473,8 @@ static const char* get_stream_name(uint32_t stream_type) {
return "MD_LINUX_MAPS";
case MD_LINUX_DSO_DEBUG:
return "MD_LINUX_DSO_DEBUG";
+ case MD_CRASHPAD_INFO_STREAM:
+ return "MD_CRASHPAD_INFO_STREAM";
default:
return "unknown";
}
@@ -4397,7 +5518,7 @@ void Minidump::Print() {
iterator != stream_map_->end();
++iterator) {
uint32_t stream_type = iterator->first;
- MinidumpStreamInfo info = iterator->second;
+ const MinidumpStreamInfo& info = iterator->second;
printf(" stream type 0x%x (%s) at index %d\n", stream_type,
get_stream_name(stream_type),
info.stream_index);
@@ -4535,6 +5656,158 @@ string* Minidump::ReadString(off_t offset) {
}
+bool Minidump::ReadUTF8String(off_t offset, string* string_utf8) {
+ if (!valid_) {
+ BPLOG(ERROR) << "Invalid Minidump for ReadString";
+ return false;
+ }
+ if (!SeekSet(offset)) {
+ BPLOG(ERROR) << "ReadUTF8String could not seek to string at offset "
+ << offset;
+ return false;
+ }
+
+ uint32_t bytes;
+ if (!ReadBytes(&bytes, sizeof(bytes))) {
+ BPLOG(ERROR) << "ReadUTF8String could not read string size at offset " <<
+ offset;
+ return false;
+ }
+
+ if (swap_) {
+ Swap(&bytes);
+ }
+
+ if (bytes > max_string_length_) {
+ BPLOG(ERROR) << "ReadUTF8String string length " << bytes <<
+ " exceeds maximum " << max_string_length_ <<
+ " at offset " << offset;
+ return false;
+ }
+
+ string_utf8->resize(bytes);
+
+ if (!ReadBytes(&(*string_utf8)[0], bytes)) {
+ BPLOG(ERROR) << "ReadUTF8String could not read " << bytes <<
+ "-byte string at offset " << offset;
+ return false;
+ }
+
+ return true;
+}
+
+
+bool Minidump::ReadStringList(
+ off_t offset,
+ std::vector<std::string>* string_list) {
+ string_list->clear();
+
+ if (!SeekSet(offset)) {
+ BPLOG(ERROR) << "Minidump cannot seek to string_list";
+ return false;
+ }
+
+ uint32_t count;
+ if (!ReadBytes(&count, sizeof(count))) {
+ BPLOG(ERROR) << "Minidump cannot read string_list count";
+ return false;
+ }
+
+ if (swap_) {
+ Swap(&count);
+ }
+
+ scoped_array<MDRVA> rvas(new MDRVA[count]);
+
+ // Read the entire array in one fell swoop, instead of reading one entry
+ // at a time in the loop.
+ if (!ReadBytes(&rvas[0], sizeof(MDRVA) * count)) {
+ BPLOG(ERROR) << "Minidump could not read string_list";
+ return false;
+ }
+
+ for (uint32_t index = 0; index < count; ++index) {
+ if (swap()) {
+ Swap(&rvas[index]);
+ }
+
+ string entry;
+ if (!ReadUTF8String(rvas[index], &entry)) {
+ BPLOG(ERROR) << "Minidump could not read string_list entry";
+ return false;
+ }
+
+ string_list->push_back(entry);
+ }
+
+ return true;
+}
+
+
+bool Minidump::ReadSimpleStringDictionary(
+ off_t offset,
+ std::map<std::string, std::string>* simple_string_dictionary) {
+ simple_string_dictionary->clear();
+
+ if (!SeekSet(offset)) {
+ BPLOG(ERROR) << "Minidump cannot seek to simple_string_dictionary";
+ return false;
+ }
+
+ uint32_t count;
+ if (!ReadBytes(&count, sizeof(count))) {
+ BPLOG(ERROR)
+ << "Minidump cannot read simple_string_dictionary count";
+ return false;
+ }
+
+ if (swap()) {
+ Swap(&count);
+ }
+
+ scoped_array<MDRawSimpleStringDictionaryEntry> entries(
+ new MDRawSimpleStringDictionaryEntry[count]);
+
+ // Read the entire array in one fell swoop, instead of reading one entry
+ // at a time in the loop.
+ if (!ReadBytes(
+ &entries[0],
+ sizeof(MDRawSimpleStringDictionaryEntry) * count)) {
+ BPLOG(ERROR) << "Minidump could not read simple_string_dictionary";
+ return false;
+ }
+
+ for (uint32_t index = 0; index < count; ++index) {
+ if (swap()) {
+ Swap(&entries[index]);
+ }
+
+ string key;
+ if (!ReadUTF8String(entries[index].key, &key)) {
+ BPLOG(ERROR) << "Minidump could not read simple_string_dictionary key";
+ return false;
+ }
+
+ string value;
+ if (!ReadUTF8String(entries[index].value, &value)) {
+ BPLOG(ERROR) << "Minidump could not read simple_string_dictionary value";
+ return false;
+ }
+
+ if (simple_string_dictionary->find(key) !=
+ simple_string_dictionary->end()) {
+ BPLOG(ERROR)
+ << "Minidump: discarding duplicate simple_string_dictionary value "
+ << value << " for key " << key;
+ } else {
+ simple_string_dictionary->insert(std::make_pair(key, value));
+ }
+ }
+
+ return true;
+}
+
+
bool Minidump::SeekToStreamType(uint32_t stream_type,
uint32_t* stream_length) {
BPLOG_IF(ERROR, !stream_length) << "Minidump::SeekToStreamType requires "
@@ -4554,7 +5827,7 @@ bool Minidump::SeekToStreamType(uint32_t stream_type,
return false;
}
- MinidumpStreamInfo info = iterator->second;
+ const MinidumpStreamInfo& info = iterator->second;
if (info.stream_index >= header_.stream_count) {
BPLOG(ERROR) << "SeekToStreamType: type " << stream_type <<
" out of range: " <<
@@ -4627,5 +5900,4 @@ T* Minidump::GetStream(T** stream) {
return *stream;
}
-
} // namespace google_breakpad
diff --git a/src/processor/minidump_dump.cc b/src/processor/minidump_dump.cc
index 343f0442..4716aa08 100644
--- a/src/processor/minidump_dump.cc
+++ b/src/processor/minidump_dump.cc
@@ -34,6 +34,7 @@
#include <stdio.h>
#include <string.h>
+#include <unistd.h>
#include "common/scoped_ptr.h"
#include "google_breakpad/processor/minidump.h"
@@ -51,6 +52,16 @@ using google_breakpad::MinidumpAssertion;
using google_breakpad::MinidumpSystemInfo;
using google_breakpad::MinidumpMiscInfo;
using google_breakpad::MinidumpBreakpadInfo;
+using google_breakpad::MinidumpCrashpadInfo;
+
+struct Options {
+ Options()
+ : minidumpPath(), hexdump(false), hexdump_width(16) {}
+
+ string minidumpPath;
+ bool hexdump;
+ unsigned int hexdump_width;
+};
static void DumpRawStream(Minidump *minidump,
uint32_t stream_type,
@@ -91,8 +102,9 @@ static void DumpRawStream(Minidump *minidump,
printf("\n\n");
}
-static bool PrintMinidumpDump(const char *minidump_file) {
- Minidump minidump(minidump_file);
+static bool PrintMinidumpDump(const Options& options) {
+ Minidump minidump(options.minidumpPath,
+ options.hexdump);
if (!minidump.Read()) {
BPLOG(ERROR) << "minidump.Read() failed";
return false;
@@ -109,6 +121,9 @@ static bool PrintMinidumpDump(const char *minidump_file) {
thread_list->Print();
}
+ // It's useful to be able to see the full list of modules here even if it
+ // would cause minidump_stackwalk to fail.
+ MinidumpModuleList::set_max_modules(UINT32_MAX);
MinidumpModuleList *module_list = minidump.GetModuleList();
if (!module_list) {
++errors;
@@ -171,6 +186,12 @@ static bool PrintMinidumpDump(const char *minidump_file) {
memory_info_list->Print();
}
+ MinidumpCrashpadInfo *crashpad_info = minidump.GetCrashpadInfo();
+ if (crashpad_info) {
+ // Crashpad info is optional, so don't treat absence as an error.
+ crashpad_info->Print();
+ }
+
DumpRawStream(&minidump,
MD_LINUX_CMD_LINE,
"MD_LINUX_CMD_LINE",
@@ -199,15 +220,56 @@ static bool PrintMinidumpDump(const char *minidump_file) {
return errors == 0;
}
-} // namespace
+//=============================================================================
+static void
+Usage(int argc, char *argv[], bool error) {
+ FILE *fp = error ? stderr : stdout;
-int main(int argc, char **argv) {
- BPLOG_INIT(&argc, &argv);
+ fprintf(fp,
+ "Usage: %s [options...] <minidump>\n"
+ "Dump data in a minidump.\n"
+ "\n"
+ "Options:\n"
+ " <minidump> should be a minidump.\n"
+ " -x:\t Display memory in a hexdump like format\n"
+ " -h:\t Usage\n",
+ argv[0]);
+}
+
+//=============================================================================
+static void
+SetupOptions(int argc, char *argv[], Options *options) {
+ int ch;
- if (argc != 2) {
- fprintf(stderr, "usage: %s <file>\n", argv[0]);
- return 1;
+ while ((ch = getopt(argc, (char * const *)argv, "xh")) != -1) {
+ switch (ch) {
+ case 'x':
+ options->hexdump = true;
+ break;
+ case 'h':
+ Usage(argc, argv, false);
+ exit(0);
+
+ default:
+ Usage(argc, argv, true);
+ exit(1);
+ break;
+ }
+ }
+
+ if ((argc - optind) != 1) {
+ fprintf(stderr, "%s: Missing minidump file\n", argv[0]);
+ exit(1);
}
- return PrintMinidumpDump(argv[1]) ? 0 : 1;
+ options->minidumpPath = argv[optind];
+}
+
+} // namespace
+
+int main(int argc, char *argv[]) {
+ Options options;
+ BPLOG_INIT(&argc, &argv);
+ SetupOptions(argc, argv, &options);
+ return PrintMinidumpDump(options) ? 0 : 1;
}
diff --git a/src/processor/minidump_processor.cc b/src/processor/minidump_processor.cc
index 71dedaba..4ea4cb70 100644
--- a/src/processor/minidump_processor.cc
+++ b/src/processor/minidump_processor.cc
@@ -30,11 +30,11 @@
#include "google_breakpad/processor/minidump_processor.h"
#include <assert.h>
-#include <stdio.h>
#include <string>
#include "common/scoped_ptr.h"
+#include "common/stdio_wrapper.h"
#include "common/using_std_string.h"
#include "google_breakpad/processor/call_stack.h"
#include "google_breakpad/processor/minidump.h"
@@ -51,7 +51,8 @@ MinidumpProcessor::MinidumpProcessor(SymbolSupplier *supplier,
SourceLineResolverInterface *resolver)
: frame_symbolizer_(new StackFrameSymbolizer(supplier, resolver)),
own_frame_symbolizer_(true),
- enable_exploitability_(false) {
+ enable_exploitability_(false),
+ enable_objdump_(false) {
}
MinidumpProcessor::MinidumpProcessor(SymbolSupplier *supplier,
@@ -59,14 +60,16 @@ MinidumpProcessor::MinidumpProcessor(SymbolSupplier *supplier,
bool enable_exploitability)
: frame_symbolizer_(new StackFrameSymbolizer(supplier, resolver)),
own_frame_symbolizer_(true),
- enable_exploitability_(enable_exploitability) {
+ enable_exploitability_(enable_exploitability),
+ enable_objdump_(false) {
}
MinidumpProcessor::MinidumpProcessor(StackFrameSymbolizer *frame_symbolizer,
bool enable_exploitability)
: frame_symbolizer_(frame_symbolizer),
own_frame_symbolizer_(false),
- enable_exploitability_(enable_exploitability) {
+ enable_exploitability_(enable_exploitability),
+ enable_objdump_(false) {
assert(frame_symbolizer_);
}
@@ -113,6 +116,25 @@ ProcessResult MinidumpProcessor::Process(
process_state->crash_reason_ = GetCrashReason(
dump, &process_state->crash_address_);
+
+ process_state->exception_record_.set_code(
+ exception->exception()->exception_record.exception_code,
+ // TODO(ivanpe): Populate description.
+ /* description = */ "");
+ process_state->exception_record_.set_flags(
+ exception->exception()->exception_record.exception_flags,
+ // TODO(ivanpe): Populate description.
+ /* description = */ "");
+ process_state->exception_record_.set_nested_exception_record_address(
+ exception->exception()->exception_record.exception_record);
+ process_state->exception_record_.set_address(process_state->crash_address_);
+ for (uint32_t i = 0;
+ i < exception->exception()->exception_record.number_parameters; i++) {
+ process_state->exception_record_.add_parameter(
+ exception->exception()->exception_record.exception_information[i],
+ // TODO(ivanpe): Populate description.
+ /* description = */ "");
+ }
}
// This will just return an empty string if it doesn't exist.
@@ -123,8 +145,26 @@ ProcessResult MinidumpProcessor::Process(
// Put a copy of the module list into ProcessState object. This is not
// necessarily a MinidumpModuleList, but it adheres to the CodeModules
// interface, which is all that ProcessState needs to expose.
- if (module_list)
+ if (module_list) {
process_state->modules_ = module_list->Copy();
+ process_state->shrunk_range_modules_ =
+ process_state->modules_->GetShrunkRangeModules();
+ for (unsigned int i = 0;
+ i < process_state->shrunk_range_modules_.size();
+ i++) {
+ linked_ptr<const CodeModule> module =
+ process_state->shrunk_range_modules_[i];
+ BPLOG(INFO) << "The range for module " << module->code_file()
+ << " was shrunk down by " << HexString(
+ module->shrink_down_delta()) << " bytes. ";
+ }
+ }
+
+ MinidumpUnloadedModuleList *unloaded_module_list =
+ dump->GetUnloadedModuleList();
+ if (unloaded_module_list) {
+ process_state->unloaded_modules_ = unloaded_module_list->Copy();
+ }
MinidumpMemoryList *memory_list = dump->GetMemoryList();
if (memory_list) {
@@ -247,6 +287,7 @@ ProcessResult MinidumpProcessor::Process(
context,
thread_memory,
process_state->modules_,
+ process_state->unloaded_modules_,
frame_symbolizer_));
scoped_ptr<CallStack> stack(new CallStack());
@@ -264,6 +305,7 @@ ProcessResult MinidumpProcessor::Process(
// one bad thread.
BPLOG(ERROR) << "No stackwalker for " << thread_string;
}
+ stack->set_tid(thread_id);
process_state->threads_.push_back(stack.release());
process_state->thread_memory_regions_.push_back(thread_memory);
}
@@ -289,7 +331,9 @@ ProcessResult MinidumpProcessor::Process(
// rating.
if (enable_exploitability_) {
scoped_ptr<Exploitability> exploitability(
- Exploitability::ExploitabilityForPlatform(dump, process_state));
+ Exploitability::ExploitabilityForPlatform(dump,
+ process_state,
+ enable_objdump_));
// The engine will be null if the platform is not supported
if (exploitability != NULL) {
process_state->exploitability_ = exploitability->CheckExploitability();
@@ -330,6 +374,26 @@ static const MDRawSystemInfo* GetSystemInfo(Minidump *dump,
return minidump_system_info->system_info();
}
+static uint64_t GetAddressForArchitecture(const MDCPUArchitecture architecture,
+ size_t raw_address)
+{
+ switch (architecture) {
+ case MD_CPU_ARCHITECTURE_X86:
+ case MD_CPU_ARCHITECTURE_MIPS:
+ case MD_CPU_ARCHITECTURE_PPC:
+ case MD_CPU_ARCHITECTURE_SHX:
+ case MD_CPU_ARCHITECTURE_ARM:
+ case MD_CPU_ARCHITECTURE_X86_WIN64:
+ // 32-bit architectures, mask the upper bits.
+ return raw_address & 0xffffffffULL;
+
+ default:
+ // All other architectures either have 64-bit pointers or it's impossible
+ // to tell from the minidump (e.g. MSIL or SPARC) so use 64-bits anyway.
+ return raw_address;
+ }
+}
+
// Extract CPU info string from ARM-specific MDRawSystemInfo structure.
// raw_info: pointer to source MDRawSystemInfo.
// cpu_info: address of target string, cpu info text will be appended to it.
@@ -510,7 +574,8 @@ bool MinidumpProcessor::GetCPUInfo(Minidump *dump, SystemInfo *info) {
break;
}
- case MD_CPU_ARCHITECTURE_ARM64: {
+ case MD_CPU_ARCHITECTURE_ARM64:
+ case MD_CPU_ARCHITECTURE_ARM64_OLD: {
info->cpu = "arm64";
break;
}
@@ -519,6 +584,10 @@ bool MinidumpProcessor::GetCPUInfo(Minidump *dump, SystemInfo *info) {
info->cpu = "mips";
break;
}
+ case MD_CPU_ARCHITECTURE_MIPS64: {
+ info->cpu = "mips64";
+ break;
+ }
default: {
// Assign the numeric architecture ID into the CPU string.
@@ -597,6 +666,11 @@ bool MinidumpProcessor::GetOSInfo(Minidump *dump, SystemInfo *info) {
break;
}
+ case MD_OS_FUCHSIA: {
+ info->os = "Fuchsia";
+ break;
+ }
+
default: {
// Assign the numeric platform ID into the OS string.
char os_string[11];
@@ -667,10 +741,12 @@ string MinidumpProcessor::GetCrashReason(Minidump *dump, uint64_t *address) {
// map the codes to a string (because there's no system info, or because
// it's an unrecognized platform, or because it's an unrecognized code.)
char reason_string[24];
+ char flags_string[11];
uint32_t exception_code = raw_exception->exception_record.exception_code;
uint32_t exception_flags = raw_exception->exception_record.exception_flags;
- snprintf(reason_string, sizeof(reason_string), "0x%08x / 0x%08x",
- exception_code, exception_flags);
+ snprintf(flags_string, sizeof(flags_string), "0x%08x", exception_flags);
+ snprintf(reason_string, sizeof(reason_string), "0x%08x / %s", exception_code,
+ flags_string);
string reason = reason_string;
const MDRawSystemInfo *raw_system_info = GetSystemInfo(dump, NULL);
@@ -678,10 +754,56 @@ string MinidumpProcessor::GetCrashReason(Minidump *dump, uint64_t *address) {
return reason;
switch (raw_system_info->platform_id) {
+ case MD_OS_FUCHSIA: {
+ switch (exception_code) {
+ case MD_EXCEPTION_CODE_FUCHSIA_GENERAL:
+ reason = "GENERAL / ";
+ reason.append(flags_string);
+ break;
+ case MD_EXCEPTION_CODE_FUCHSIA_FATAL_PAGE_FAULT:
+ reason = "FATAL_PAGE_FAULT / ";
+ reason.append(flags_string);
+ break;
+ case MD_EXCEPTION_CODE_FUCHSIA_UNDEFINED_INSTRUCTION:
+ reason = "UNDEFINED_INSTRUCTION / ";
+ reason.append(flags_string);
+ break;
+ case MD_EXCEPTION_CODE_FUCHSIA_SW_BREAKPOINT:
+ reason = "SW_BREAKPOINT / ";
+ reason.append(flags_string);
+ break;
+ case MD_EXCEPTION_CODE_FUCHSIA_HW_BREAKPOINT:
+ reason = "HW_BREAKPOINT / ";
+ reason.append(flags_string);
+ break;
+ case MD_EXCEPTION_CODE_FUCHSIA_UNALIGNED_ACCESS:
+ reason = "UNALIGNED_ACCESS / ";
+ reason.append(flags_string);
+ break;
+ case MD_EXCEPTION_CODE_FUCHSIA_THREAD_STARTING:
+ reason = "THREAD_STARTING / ";
+ reason.append(flags_string);
+ break;
+ case MD_EXCEPTION_CODE_FUCHSIA_THREAD_EXITING:
+ reason = "THREAD_EXITING / ";
+ reason.append(flags_string);
+ break;
+ case MD_EXCEPTION_CODE_FUCHSIA_POLICY_ERROR:
+ reason = "POLICY_ERROR / ";
+ reason.append(flags_string);
+ break;
+ case MD_EXCEPTION_CODE_FUCHSIA_PROCESS_STARTING:
+ reason = "PROCESS_STARTING / ";
+ reason.append(flags_string);
+ break;
+ default:
+ BPLOG(INFO) << "Unknown exception reason " << reason;
+ }
+ break;
+ }
+
case MD_OS_MAC_OS_X:
case MD_OS_IOS: {
- char flags_string[11];
- snprintf(flags_string, sizeof(flags_string), "0x%08x", exception_flags);
switch (exception_code) {
case MD_EXCEPTION_MAC_BAD_ACCESS:
reason = "EXC_BAD_ACCESS / ";
@@ -701,12 +823,15 @@ string MinidumpProcessor::GetCrashReason(Minidump *dump, uint64_t *address) {
case MD_EXCEPTION_CODE_MAC_MEMORY_ERROR:
reason.append("KERN_MEMORY_ERROR");
break;
+ case MD_EXCEPTION_CODE_MAC_CODESIGN_ERROR:
+ reason.append("KERN_CODESIGN_ERROR");
+ break;
default:
// arm and ppc overlap
if (raw_system_info->processor_architecture ==
MD_CPU_ARCHITECTURE_ARM ||
raw_system_info->processor_architecture ==
- MD_CPU_ARCHITECTURE_ARM64) {
+ MD_CPU_ARCHITECTURE_ARM64_OLD) {
switch (exception_flags) {
case MD_EXCEPTION_CODE_MAC_ARM_DA_ALIGN:
reason.append("EXC_ARM_DA_ALIGN");
@@ -736,6 +861,19 @@ string MinidumpProcessor::GetCrashReason(Minidump *dump, uint64_t *address) {
BPLOG(INFO) << "Unknown exception reason " << reason;
break;
}
+ } else if (raw_system_info->processor_architecture ==
+ MD_CPU_ARCHITECTURE_X86 ||
+ raw_system_info->processor_architecture ==
+ MD_CPU_ARCHITECTURE_AMD64) {
+ switch (exception_flags) {
+ case MD_EXCEPTION_CODE_MAC_X86_GENERAL_PROTECTION_FAULT:
+ reason.append("EXC_I386_GPFLT");
+ break;
+ default:
+ reason.append(flags_string);
+ BPLOG(INFO) << "Unknown exception reason " << reason;
+ break;
+ }
} else {
reason.append(flags_string);
BPLOG(INFO) << "Unknown exception reason " << reason;
@@ -747,7 +885,7 @@ string MinidumpProcessor::GetCrashReason(Minidump *dump, uint64_t *address) {
reason = "EXC_BAD_INSTRUCTION / ";
switch (raw_system_info->processor_architecture) {
case MD_CPU_ARCHITECTURE_ARM:
- case MD_CPU_ARCHITECTURE_ARM64: {
+ case MD_CPU_ARCHITECTURE_ARM64_OLD: {
switch (exception_flags) {
case MD_EXCEPTION_CODE_MAC_ARM_UNDEFINED:
reason.append("EXC_ARM_UNDEFINED");
@@ -786,25 +924,26 @@ string MinidumpProcessor::GetCrashReason(Minidump *dump, uint64_t *address) {
}
break;
}
+ case MD_CPU_ARCHITECTURE_AMD64:
case MD_CPU_ARCHITECTURE_X86: {
switch (exception_flags) {
case MD_EXCEPTION_CODE_MAC_X86_INVALID_OPERATION:
reason.append("EXC_I386_INVOP");
break;
case MD_EXCEPTION_CODE_MAC_X86_INVALID_TASK_STATE_SEGMENT:
- reason.append("EXC_INVTSSFLT");
+ reason.append("EXC_I386_INVTSSFLT");
break;
case MD_EXCEPTION_CODE_MAC_X86_SEGMENT_NOT_PRESENT:
- reason.append("EXC_SEGNPFLT");
+ reason.append("EXC_I386_SEGNPFLT");
break;
case MD_EXCEPTION_CODE_MAC_X86_STACK_FAULT:
- reason.append("EXC_STKFLT");
+ reason.append("EXC_I386_STKFLT");
break;
case MD_EXCEPTION_CODE_MAC_X86_GENERAL_PROTECTION_FAULT:
- reason.append("EXC_GPFLT");
+ reason.append("EXC_I386_GPFLT");
break;
case MD_EXCEPTION_CODE_MAC_X86_ALIGNMENT_FAULT:
- reason.append("EXC_ALIGNFLT");
+ reason.append("EXC_I386_ALIGNFLT");
break;
default:
reason.append(flags_string);
@@ -850,6 +989,7 @@ string MinidumpProcessor::GetCrashReason(Minidump *dump, uint64_t *address) {
break;
case MD_EXCEPTION_CODE_MAC_PPC_ALTIVEC_ASSIST:
reason.append("EXC_PPC_ALTIVECASSIST");
+ break;
default:
reason.append(flags_string);
BPLOG(INFO) << "Unknown exception reason " << reason;
@@ -857,6 +997,7 @@ string MinidumpProcessor::GetCrashReason(Minidump *dump, uint64_t *address) {
}
break;
}
+ case MD_CPU_ARCHITECTURE_AMD64:
case MD_CPU_ARCHITECTURE_X86: {
switch (exception_flags) {
case MD_EXCEPTION_CODE_MAC_X86_DIV:
@@ -927,7 +1068,7 @@ string MinidumpProcessor::GetCrashReason(Minidump *dump, uint64_t *address) {
reason = "EXC_BREAKPOINT / ";
switch (raw_system_info->processor_architecture) {
case MD_CPU_ARCHITECTURE_ARM:
- case MD_CPU_ARCHITECTURE_ARM64: {
+ case MD_CPU_ARCHITECTURE_ARM64_OLD: {
switch (exception_flags) {
case MD_EXCEPTION_CODE_MAC_ARM_DA_ALIGN:
reason.append("EXC_ARM_DA_ALIGN");
@@ -957,6 +1098,7 @@ string MinidumpProcessor::GetCrashReason(Minidump *dump, uint64_t *address) {
}
break;
}
+ case MD_CPU_ARCHITECTURE_AMD64:
case MD_CPU_ARCHITECTURE_X86: {
switch (exception_flags) {
case MD_EXCEPTION_CODE_MAC_X86_SGL:
@@ -990,6 +1132,9 @@ string MinidumpProcessor::GetCrashReason(Minidump *dump, uint64_t *address) {
reason = "EXC_RPC_ALERT / ";
reason.append(flags_string);
break;
+ case MD_EXCEPTION_MAC_SIMULATED:
+ reason = "Simulated Exception";
+ break;
}
break;
}
@@ -1139,6 +1284,9 @@ string MinidumpProcessor::GetCrashReason(Minidump *dump, uint64_t *address) {
case MD_EXCEPTION_CODE_WIN_STACK_OVERFLOW:
reason = "EXCEPTION_STACK_OVERFLOW";
break;
+ case MD_EXCEPTION_CODE_WIN_BAD_FUNCTION_TABLE:
+ reason = "EXCEPTION_BAD_FUNCTION_TABLE";
+ break;
case MD_EXCEPTION_CODE_WIN_POSSIBLE_DEADLOCK:
reason = "EXCEPTION_POSSIBLE_DEADLOCK";
break;
@@ -1148,9 +1296,15 @@ string MinidumpProcessor::GetCrashReason(Minidump *dump, uint64_t *address) {
case MD_EXCEPTION_CODE_WIN_HEAP_CORRUPTION:
reason = "EXCEPTION_HEAP_CORRUPTION";
break;
+ case MD_EXCEPTION_OUT_OF_MEMORY:
+ reason = "Out of Memory";
+ break;
case MD_EXCEPTION_CODE_WIN_UNHANDLED_CPP_EXCEPTION:
reason = "Unhandled C++ Exception";
break;
+ case MD_EXCEPTION_CODE_WIN_SIMULATED:
+ reason = "Simulated Exception";
+ break;
default:
BPLOG(INFO) << "Unknown exception reason " << reason;
break;
@@ -1171,7 +1325,37 @@ string MinidumpProcessor::GetCrashReason(Minidump *dump, uint64_t *address) {
reason = "SIGQUIT";
break;
case MD_EXCEPTION_CODE_LIN_SIGILL:
- reason = "SIGILL";
+ reason = "SIGILL / ";
+ switch (exception_flags) {
+ case MD_EXCEPTION_FLAG_LIN_ILL_ILLOPC:
+ reason.append("ILL_ILLOPC");
+ break;
+ case MD_EXCEPTION_FLAG_LIN_ILL_ILLOPN:
+ reason.append("ILL_ILLOPN");
+ break;
+ case MD_EXCEPTION_FLAG_LIN_ILL_ILLADR:
+ reason.append("ILL_ILLADR");
+ break;
+ case MD_EXCEPTION_FLAG_LIN_ILL_ILLTRP:
+ reason.append("ILL_ILLTRP");
+ break;
+ case MD_EXCEPTION_FLAG_LIN_ILL_PRVOPC:
+ reason.append("ILL_PRVOPC");
+ break;
+ case MD_EXCEPTION_FLAG_LIN_ILL_PRVREG:
+ reason.append("ILL_PRVREG");
+ break;
+ case MD_EXCEPTION_FLAG_LIN_ILL_COPROC:
+ reason.append("ILL_COPROC");
+ break;
+ case MD_EXCEPTION_FLAG_LIN_ILL_BADSTK:
+ reason.append("ILL_BADSTK");
+ break;
+ default:
+ reason.append(flags_string);
+ BPLOG(INFO) << "Unknown exception reason " << reason;
+ break;
+ }
break;
case MD_EXCEPTION_CODE_LIN_SIGTRAP:
reason = "SIGTRAP";
@@ -1180,10 +1364,61 @@ string MinidumpProcessor::GetCrashReason(Minidump *dump, uint64_t *address) {
reason = "SIGABRT";
break;
case MD_EXCEPTION_CODE_LIN_SIGBUS:
- reason = "SIGBUS";
+ reason = "SIGBUS / ";
+ switch (exception_flags) {
+ case MD_EXCEPTION_FLAG_LIN_BUS_ADRALN:
+ reason.append("BUS_ADRALN");
+ break;
+ case MD_EXCEPTION_FLAG_LIN_BUS_ADRERR:
+ reason.append("BUS_ADRERR");
+ break;
+ case MD_EXCEPTION_FLAG_LIN_BUS_OBJERR:
+ reason.append("BUS_OBJERR");
+ break;
+ case MD_EXCEPTION_FLAG_LIN_BUS_MCEERR_AR:
+ reason.append("BUS_MCEERR_AR");
+ break;
+ case MD_EXCEPTION_FLAG_LIN_BUS_MCEERR_AO:
+ reason.append("BUS_MCEERR_AO");
+ break;
+ default:
+ reason.append(flags_string);
+ BPLOG(INFO) << "Unknown exception reason " << reason;
+ break;
+ }
break;
case MD_EXCEPTION_CODE_LIN_SIGFPE:
- reason = "SIGFPE";
+ reason = "SIGFPE / ";
+ switch (exception_flags) {
+ case MD_EXCEPTION_FLAG_LIN_FPE_INTDIV:
+ reason.append("FPE_INTDIV");
+ break;
+ case MD_EXCEPTION_FLAG_LIN_FPE_INTOVF:
+ reason.append("FPE_INTOVF");
+ break;
+ case MD_EXCEPTION_FLAG_LIN_FPE_FLTDIV:
+ reason.append("FPE_FLTDIV");
+ break;
+ case MD_EXCEPTION_FLAG_LIN_FPE_FLTOVF:
+ reason.append("FPE_FLTOVF");
+ break;
+ case MD_EXCEPTION_FLAG_LIN_FPE_FLTUND:
+ reason.append("FPE_FLTUND");
+ break;
+ case MD_EXCEPTION_FLAG_LIN_FPE_FLTRES:
+ reason.append("FPE_FLTRES");
+ break;
+ case MD_EXCEPTION_FLAG_LIN_FPE_FLTINV:
+ reason.append("FPE_FLTINV");
+ break;
+ case MD_EXCEPTION_FLAG_LIN_FPE_FLTSUB:
+ reason.append("FPE_FLTSUB");
+ break;
+ default:
+ reason.append(flags_string);
+ BPLOG(INFO) << "Unknown exception reason " << reason;
+ break;
+ }
break;
case MD_EXCEPTION_CODE_LIN_SIGKILL:
reason = "SIGKILL";
@@ -1192,7 +1427,25 @@ string MinidumpProcessor::GetCrashReason(Minidump *dump, uint64_t *address) {
reason = "SIGUSR1";
break;
case MD_EXCEPTION_CODE_LIN_SIGSEGV:
- reason = "SIGSEGV";
+ reason = "SIGSEGV /";
+ switch (exception_flags) {
+ case MD_EXCEPTION_FLAG_LIN_SEGV_MAPERR:
+ reason.append("SEGV_MAPERR");
+ break;
+ case MD_EXCEPTION_FLAG_LIN_SEGV_ACCERR:
+ reason.append("SEGV_ACCERR");
+ break;
+ case MD_EXCEPTION_FLAG_LIN_SEGV_BNDERR:
+ reason.append("SEGV_BNDERR");
+ break;
+ case MD_EXCEPTION_FLAG_LIN_SEGV_PKUERR:
+ reason.append("SEGV_PKUERR");
+ break;
+ default:
+ reason.append(flags_string);
+ BPLOG(INFO) << "Unknown exception reason " << reason;
+ break;
+ }
break;
case MD_EXCEPTION_CODE_LIN_SIGUSR2:
reason = "SIGUSR2";
@@ -1477,6 +1730,12 @@ string MinidumpProcessor::GetCrashReason(Minidump *dump, uint64_t *address) {
}
}
+ if (address) {
+ *address = GetAddressForArchitecture(
+ static_cast<MDCPUArchitecture>(raw_system_info->processor_architecture),
+ *address);
+ }
+
return reason;
}
diff --git a/src/processor/minidump_processor_unittest.cc b/src/processor/minidump_processor_unittest.cc
index 69e1f42e..a4ac3685 100644
--- a/src/processor/minidump_processor_unittest.cc
+++ b/src/processor/minidump_processor_unittest.cc
@@ -71,9 +71,25 @@ class MockMinidump : public Minidump {
MOCK_METHOD0(GetException, MinidumpException*());
MOCK_METHOD0(GetAssertion, MinidumpAssertion*());
MOCK_METHOD0(GetModuleList, MinidumpModuleList*());
+ MOCK_METHOD0(GetUnloadedModuleList, MinidumpUnloadedModuleList*());
MOCK_METHOD0(GetMemoryList, MinidumpMemoryList*());
};
+class MockMinidumpUnloadedModule : public MinidumpUnloadedModule {
+ public:
+ MockMinidumpUnloadedModule() : MinidumpUnloadedModule(NULL) {}
+};
+
+class MockMinidumpUnloadedModuleList : public MinidumpUnloadedModuleList {
+ public:
+ MockMinidumpUnloadedModuleList() : MinidumpUnloadedModuleList(NULL) {}
+
+ ~MockMinidumpUnloadedModuleList() {}
+ MOCK_CONST_METHOD0(Copy, CodeModules*());
+ MOCK_CONST_METHOD1(GetModuleForAddress,
+ const MinidumpUnloadedModule*(uint64_t));
+};
+
class MockMinidumpThreadList : public MinidumpThreadList {
public:
MockMinidumpThreadList() : MinidumpThreadList(NULL) {}
@@ -157,6 +173,8 @@ using google_breakpad::MockMinidumpMemoryList;
using google_breakpad::MockMinidumpMemoryRegion;
using google_breakpad::MockMinidumpThread;
using google_breakpad::MockMinidumpThreadList;
+using google_breakpad::MockMinidumpUnloadedModule;
+using google_breakpad::MockMinidumpUnloadedModuleList;
using google_breakpad::ProcessState;
using google_breakpad::scoped_ptr;
using google_breakpad::SymbolSupplier;
@@ -185,6 +203,12 @@ static const char *kSystemInfoCPUInfo =
#define ASSERT_EQ_ABORT(e1, e2) ASSERT_TRUE_ABORT((e1) == (e2))
+static string GetTestDataPath() {
+ char *srcdir = getenv("srcdir");
+
+ return string(srcdir ? srcdir : ".") + "/src/processor/testdata/";
+}
+
class TestSymbolSupplier : public SymbolSupplier {
public:
TestSymbolSupplier() : interrupt_(false) {}
@@ -231,10 +255,8 @@ SymbolSupplier::SymbolResult TestSymbolSupplier::GetSymbolFile(
}
if (module && module->code_file() == "c:\\test_app.exe") {
- *symbol_file = string(getenv("srcdir") ? getenv("srcdir") : ".") +
- "/src/processor/testdata/symbols/test_app.pdb/" +
- module->debug_identifier() +
- "/test_app.sym";
+ *symbol_file = GetTestDataPath() + "symbols/test_app.pdb/" +
+ module->debug_identifier() + "/test_app.sym";
return FOUND;
}
@@ -320,6 +342,90 @@ class TestMinidumpContext : public MinidumpContext {
class MinidumpProcessorTest : public ::testing::Test {
};
+TEST_F(MinidumpProcessorTest, TestUnloadedModules) {
+ MockMinidump dump;
+
+ EXPECT_CALL(dump, path()).WillRepeatedly(Return("mock minidump"));
+ EXPECT_CALL(dump, Read()).WillRepeatedly(Return(true));
+
+ MDRawHeader fake_header;
+ fake_header.time_date_stamp = 0;
+ EXPECT_CALL(dump, header()).WillRepeatedly(Return(&fake_header));
+
+ MDRawSystemInfo raw_system_info;
+ memset(&raw_system_info, 0, sizeof(raw_system_info));
+ raw_system_info.processor_architecture = MD_CPU_ARCHITECTURE_X86;
+ raw_system_info.platform_id = MD_OS_WIN32_NT;
+ TestMinidumpSystemInfo dump_system_info(raw_system_info);
+
+ EXPECT_CALL(dump, GetSystemInfo()).
+ WillRepeatedly(Return(&dump_system_info));
+
+ // No loaded modules
+
+ MockMinidumpUnloadedModuleList unloaded_module_list;
+ EXPECT_CALL(dump, GetUnloadedModuleList()).
+ WillOnce(Return(&unloaded_module_list));
+
+ MockMinidumpMemoryList memory_list;
+ EXPECT_CALL(dump, GetMemoryList()).
+ WillOnce(Return(&memory_list));
+
+ MockMinidumpThreadList thread_list;
+ EXPECT_CALL(dump, GetThreadList()).
+ WillOnce(Return(&thread_list));
+
+ EXPECT_CALL(thread_list, thread_count()).
+ WillRepeatedly(Return(1));
+
+ MockMinidumpThread thread;
+ EXPECT_CALL(thread_list, GetThreadAtIndex(0)).
+ WillOnce(Return(&thread));
+
+ EXPECT_CALL(thread, GetThreadID(_)).
+ WillRepeatedly(DoAll(SetArgumentPointee<0>(1),
+ Return(true)));
+
+ MDRawContextX86 thread_raw_context;
+ memset(&thread_raw_context, 0,
+ sizeof(thread_raw_context));
+ thread_raw_context.context_flags = MD_CONTEXT_X86_FULL;
+ const uint32_t kExpectedEIP = 0xabcd1234;
+ thread_raw_context.eip = kExpectedEIP;
+ TestMinidumpContext thread_context(thread_raw_context);
+ EXPECT_CALL(thread, GetContext()).
+ WillRepeatedly(Return(&thread_context));
+
+ // The memory contents don't really matter here, since it won't be used.
+ MockMinidumpMemoryRegion thread_memory(0x1234, "xxx");
+ EXPECT_CALL(thread, GetMemory()).
+ WillRepeatedly(Return(&thread_memory));
+ EXPECT_CALL(thread, GetStartOfStackMemoryRange()).
+ Times(0);
+ EXPECT_CALL(memory_list, GetMemoryRegionForAddress(_)).
+ Times(0);
+
+ MockMinidumpUnloadedModuleList* unloaded_module_list_copy =
+ new MockMinidumpUnloadedModuleList();
+ EXPECT_CALL(unloaded_module_list, Copy()).
+ WillOnce(Return(unloaded_module_list_copy));
+
+ MockMinidumpUnloadedModule unloaded_module;
+ EXPECT_CALL(*unloaded_module_list_copy, GetModuleForAddress(kExpectedEIP)).
+ WillOnce(Return(&unloaded_module));
+
+ MinidumpProcessor processor(reinterpret_cast<SymbolSupplier*>(NULL), NULL);
+ ProcessState state;
+ EXPECT_EQ(processor.Process(&dump, &state),
+ google_breakpad::PROCESS_OK);
+
+ // The single frame should be populated with the unloaded module.
+ ASSERT_EQ(1U, state.threads()->size());
+ ASSERT_EQ(1U, state.threads()->at(0)->frames()->size());
+ ASSERT_EQ(kExpectedEIP, state.threads()->at(0)->frames()->at(0)->instruction);
+ ASSERT_EQ(&unloaded_module, state.threads()->at(0)->frames()->at(0)->module);
+}
+
TEST_F(MinidumpProcessorTest, TestCorruptMinidumps) {
MockMinidump dump;
TestSymbolSupplier supplier;
@@ -358,8 +464,7 @@ TEST_F(MinidumpProcessorTest, TestSymbolSupplierLookupCounts) {
BasicSourceLineResolver resolver;
MinidumpProcessor processor(&supplier, &resolver);
- string minidump_file = string(getenv("srcdir") ? getenv("srcdir") : ".") +
- "/src/processor/testdata/minidump2.dmp";
+ string minidump_file = GetTestDataPath() + "minidump2.dmp";
ProcessState state;
EXPECT_CALL(supplier, GetCStringSymbolData(
Property(&google_breakpad::CodeModule::code_file,
@@ -399,8 +504,7 @@ TEST_F(MinidumpProcessorTest, TestBasicProcessing) {
BasicSourceLineResolver resolver;
MinidumpProcessor processor(&supplier, &resolver);
- string minidump_file = string(getenv("srcdir") ? getenv("srcdir") : ".") +
- "/src/processor/testdata/minidump2.dmp";
+ string minidump_file = GetTestDataPath() + "minidump2.dmp";
ProcessState state;
ASSERT_EQ(processor.Process(minidump_file, &state),
@@ -414,6 +518,7 @@ TEST_F(MinidumpProcessorTest, TestBasicProcessing) {
ASSERT_EQ(state.crash_reason(), "EXCEPTION_ACCESS_VIOLATION_WRITE");
ASSERT_EQ(state.crash_address(), 0x45U);
ASSERT_EQ(state.threads()->size(), size_t(1));
+ EXPECT_EQ((*state.threads())[0]->tid(), 3060U);
ASSERT_EQ(state.requesting_thread(), 0);
EXPECT_EQ(1171480435U, state.time_date_stamp());
EXPECT_EQ(1171480435U, state.process_create_time());
@@ -636,6 +741,26 @@ TEST_F(MinidumpProcessorTest, TestThreadMissingContext) {
ASSERT_EQ(0U, state.threads()->at(0)->frames()->size());
}
+TEST_F(MinidumpProcessorTest, Test32BitCrashingAddress) {
+ TestSymbolSupplier supplier;
+ BasicSourceLineResolver resolver;
+ MinidumpProcessor processor(&supplier, &resolver);
+
+ string minidump_file = GetTestDataPath() + "minidump_32bit_crash_addr.dmp";
+
+ ProcessState state;
+ ASSERT_EQ(processor.Process(minidump_file, &state),
+ google_breakpad::PROCESS_OK);
+ ASSERT_EQ(state.system_info()->os, kSystemInfoOS);
+ ASSERT_EQ(state.system_info()->os_short, kSystemInfoOSShort);
+ ASSERT_EQ(state.system_info()->os_version, kSystemInfoOSVersion);
+ ASSERT_EQ(state.system_info()->cpu, kSystemInfoCPU);
+ ASSERT_EQ(state.system_info()->cpu_info, kSystemInfoCPUInfo);
+ ASSERT_TRUE(state.crashed());
+ ASSERT_EQ(state.crash_reason(), "EXCEPTION_ACCESS_VIOLATION_WRITE");
+ ASSERT_EQ(state.crash_address(), 0x45U);
+}
+
} // namespace
int main(int argc, char *argv[]) {
diff --git a/src/processor/minidump_stackwalk.cc b/src/processor/minidump_stackwalk.cc
index 8f83969f..acf80972 100644
--- a/src/processor/minidump_stackwalk.cc
+++ b/src/processor/minidump_stackwalk.cc
@@ -34,10 +34,13 @@
#include <stdio.h>
#include <string.h>
+#include <unistd.h>
+#include <limits>
#include <string>
#include <vector>
+#include "common/path_helper.h"
#include "common/scoped_ptr.h"
#include "common/using_std_string.h"
#include "google_breakpad/processor/basic_source_line_resolver.h"
@@ -51,38 +54,49 @@
namespace {
+struct Options {
+ bool machine_readable;
+ bool output_stack_contents;
+
+ string minidump_file;
+ std::vector<string> symbol_paths;
+};
+
using google_breakpad::BasicSourceLineResolver;
using google_breakpad::Minidump;
+using google_breakpad::MinidumpMemoryList;
+using google_breakpad::MinidumpThreadList;
using google_breakpad::MinidumpProcessor;
using google_breakpad::ProcessState;
using google_breakpad::SimpleSymbolSupplier;
using google_breakpad::scoped_ptr;
-// Processes |minidump_file| using MinidumpProcessor. |symbol_path|, if
-// non-empty, is the base directory of a symbol storage area, laid out in
-// the format required by SimpleSymbolSupplier. If such a storage area
-// is specified, it is made available for use by the MinidumpProcessor.
+// Processes |options.minidump_file| using MinidumpProcessor.
+// |options.symbol_path|, if non-empty, is the base directory of a
+// symbol storage area, laid out in the format required by
+// SimpleSymbolSupplier. If such a storage area is specified, it is
+// made available for use by the MinidumpProcessor.
//
// Returns the value of MinidumpProcessor::Process. If processing succeeds,
// prints identifying OS and CPU information from the minidump, crash
// information if the minidump was produced as a result of a crash, and
// call stacks for each thread contained in the minidump. All information
// is printed to stdout.
-bool PrintMinidumpProcess(const string &minidump_file,
- const std::vector<string> &symbol_paths,
- bool machine_readable,
- bool output_stack_contents) {
+bool PrintMinidumpProcess(const Options& options) {
scoped_ptr<SimpleSymbolSupplier> symbol_supplier;
- if (!symbol_paths.empty()) {
+ if (!options.symbol_paths.empty()) {
// TODO(mmentovai): check existence of symbol_path if specified?
- symbol_supplier.reset(new SimpleSymbolSupplier(symbol_paths));
+ symbol_supplier.reset(new SimpleSymbolSupplier(options.symbol_paths));
}
BasicSourceLineResolver resolver;
MinidumpProcessor minidump_processor(symbol_supplier.get(), &resolver);
+ // Increase the maximum number of threads and regions.
+ MinidumpThreadList::set_max_threads(std::numeric_limits<uint32_t>::max());
+ MinidumpMemoryList::set_max_regions(std::numeric_limits<uint32_t>::max());
// Process the minidump.
- Minidump dump(minidump_file);
+ Minidump dump(options.minidump_file);
if (!dump.Read()) {
BPLOG(ERROR) << "Minidump " << dump.path() << " could not be read";
return false;
@@ -94,69 +108,72 @@ bool PrintMinidumpProcess(const string &minidump_file,
return false;
}
- if (machine_readable) {
+ if (options.machine_readable) {
PrintProcessStateMachineReadable(process_state);
} else {
- PrintProcessState(process_state, output_stack_contents, &resolver);
+ PrintProcessState(process_state, options.output_stack_contents, &resolver);
}
return true;
}
-void usage(const char *program_name) {
- fprintf(stderr, "usage: %s [-m|-s] <minidump-file> [symbol-path ...]\n"
- " -m : Output in machine-readable format\n"
- " -s : Output stack contents\n",
- program_name);
-}
-
} // namespace
-int main(int argc, char **argv) {
- BPLOG_INIT(&argc, &argv);
+static void Usage(int argc, const char *argv[], bool error) {
+ fprintf(error ? stderr : stdout,
+ "Usage: %s [options] <minidump-file> [symbol-path ...]\n"
+ "\n"
+ "Output a stack trace for the provided minidump\n"
+ "\n"
+ "Options:\n"
+ "\n"
+ " -m Output in machine-readable format\n"
+ " -s Output stack contents\n",
+ google_breakpad::BaseName(argv[0]).c_str());
+}
- if (argc < 2) {
- usage(argv[0]);
- return 1;
+static void SetupOptions(int argc, const char *argv[], Options* options) {
+ int ch;
+
+ options->machine_readable = false;
+ options->output_stack_contents = false;
+
+ while ((ch = getopt(argc, (char * const *)argv, "hms")) != -1) {
+ switch (ch) {
+ case 'h':
+ Usage(argc, argv, false);
+ exit(0);
+ break;
+
+ case 'm':
+ options->machine_readable = true;
+ break;
+ case 's':
+ options->output_stack_contents = true;
+ break;
+
+ case '?':
+ Usage(argc, argv, true);
+ exit(1);
+ break;
+ }
}
- const char *minidump_file;
- bool machine_readable = false;
- bool output_stack_contents = false;
- int symbol_path_arg;
-
- if (strcmp(argv[1], "-m") == 0) {
- if (argc < 3) {
- usage(argv[0]);
- return 1;
- }
+ if ((argc - optind) == 0) {
+ fprintf(stderr, "%s: Missing minidump file\n", argv[0]);
+ Usage(argc, argv, true);
+ exit(1);
+ }
- machine_readable = true;
- minidump_file = argv[2];
- symbol_path_arg = 3;
- } else if (strcmp(argv[1], "-s") == 0) {
- if (argc < 3) {
- usage(argv[0]);
- return 1;
- }
+ options->minidump_file = argv[optind];
- output_stack_contents = true;
- minidump_file = argv[2];
- symbol_path_arg = 3;
- } else {
- minidump_file = argv[1];
- symbol_path_arg = 2;
- }
+ for (int argi = optind + 1; argi < argc; ++argi)
+ options->symbol_paths.push_back(argv[argi]);
+}
- // extra arguments are symbol paths
- std::vector<string> symbol_paths;
- if (argc > symbol_path_arg) {
- for (int argi = symbol_path_arg; argi < argc; ++argi)
- symbol_paths.push_back(argv[argi]);
- }
+int main(int argc, const char* argv[]) {
+ Options options;
+ SetupOptions(argc, argv, &options);
- return PrintMinidumpProcess(minidump_file,
- symbol_paths,
- machine_readable,
- output_stack_contents) ? 0 : 1;
+ return PrintMinidumpProcess(options) ? 0 : 1;
}
diff --git a/src/processor/minidump_unittest.cc b/src/processor/minidump_unittest.cc
index bb7dac64..036d03f1 100644
--- a/src/processor/minidump_unittest.cc
+++ b/src/processor/minidump_unittest.cc
@@ -56,6 +56,8 @@ using google_breakpad::MinidumpMemoryRegion;
using google_breakpad::MinidumpModule;
using google_breakpad::MinidumpModuleList;
using google_breakpad::MinidumpSystemInfo;
+using google_breakpad::MinidumpUnloadedModule;
+using google_breakpad::MinidumpUnloadedModuleList;
using google_breakpad::MinidumpThread;
using google_breakpad::MinidumpThreadList;
using google_breakpad::SynthMinidump::Context;
@@ -63,6 +65,8 @@ using google_breakpad::SynthMinidump::Dump;
using google_breakpad::SynthMinidump::Exception;
using google_breakpad::SynthMinidump::Memory;
using google_breakpad::SynthMinidump::Module;
+using google_breakpad::SynthMinidump::UnloadedModule;
+using google_breakpad::SynthMinidump::Section;
using google_breakpad::SynthMinidump::Stream;
using google_breakpad::SynthMinidump::String;
using google_breakpad::SynthMinidump::SystemInfo;
@@ -90,7 +94,15 @@ TEST_F(MinidumpTest, TestMinidumpFromFile) {
const MDRawHeader* header = minidump.header();
ASSERT_NE(header, (MDRawHeader*)NULL);
ASSERT_EQ(header->signature, uint32_t(MD_HEADER_SIGNATURE));
- //TODO: add more checks here
+
+ MinidumpModuleList *md_module_list = minidump.GetModuleList();
+ ASSERT_TRUE(md_module_list != NULL);
+ const MinidumpModule *md_module = md_module_list->GetModuleAtIndex(0);
+ ASSERT_TRUE(md_module != NULL);
+ ASSERT_EQ("c:\\test_app.exe", md_module->code_file());
+ ASSERT_EQ("c:\\test_app.pdb", md_module->debug_file());
+ ASSERT_EQ("45D35F6C2d000", md_module->code_identifier());
+ ASSERT_EQ("5A9832E5287241C1838ED98914E9B7FF1", md_module->debug_identifier());
}
TEST_F(MinidumpTest, TestMinidumpFromStream) {
@@ -385,44 +397,116 @@ TEST(Dump, ThreadMissingContext) {
ASSERT_EQ(reinterpret_cast<MinidumpContext*>(NULL), md_context);
}
-TEST(Dump, OneModule) {
- static const MDVSFixedFileInfo fixed_file_info = {
- 0xb2fba33a, // signature
- 0x33d7a728, // struct_version
- 0x31afcb20, // file_version_hi
- 0xe51cdab1, // file_version_lo
- 0xd1ea6907, // product_version_hi
- 0x03032857, // product_version_lo
- 0x11bf71d7, // file_flags_mask
- 0x5fb8cdbf, // file_flags
- 0xe45d0d5d, // file_os
- 0x107d9562, // file_type
- 0x5a8844d4, // file_subtype
- 0xa8d30b20, // file_date_hi
- 0x651c3e4e // file_date_lo
- };
+TEST(Dump, OneUnloadedModule) {
+ Dump dump(0, kBigEndian);
+ String module_name(dump, "unloaded module");
+
+ String csd_version(dump, "Windows 9000");
+ SystemInfo system_info(dump, SystemInfo::windows_x86, csd_version);
+
+ UnloadedModule unloaded_module(
+ dump,
+ 0xa90206ca83eb2852ULL,
+ 0xada542bd,
+ module_name,
+ 0x34571371,
+ 0xb1054d2a);
+
+ dump.Add(&unloaded_module);
+ dump.Add(&module_name);
+ dump.Add(&system_info);
+ dump.Add(&csd_version);
+ dump.Finish();
+
+ string contents;
+ ASSERT_TRUE(dump.GetContents(&contents));
+ istringstream minidump_stream(contents);
+ Minidump minidump(minidump_stream);
+ ASSERT_TRUE(minidump.Read());
+ ASSERT_EQ(2U, minidump.GetDirectoryEntryCount());
+
+ const MDRawDirectory *dir = minidump.GetDirectoryEntryAtIndex(1);
+ ASSERT_TRUE(dir != NULL);
+ EXPECT_EQ((uint32_t) MD_UNLOADED_MODULE_LIST_STREAM, dir->stream_type);
+
+ MinidumpUnloadedModuleList *md_unloaded_module_list =
+ minidump.GetUnloadedModuleList();
+ ASSERT_TRUE(md_unloaded_module_list != NULL);
+ ASSERT_EQ(1U, md_unloaded_module_list->module_count());
+
+ const MinidumpUnloadedModule *md_unloaded_module =
+ md_unloaded_module_list->GetModuleAtIndex(0);
+ ASSERT_TRUE(md_unloaded_module != NULL);
+ ASSERT_EQ(0xa90206ca83eb2852ULL, md_unloaded_module->base_address());
+ ASSERT_EQ(0xada542bd, md_unloaded_module->size());
+ ASSERT_EQ("unloaded module", md_unloaded_module->code_file());
+ ASSERT_EQ("", md_unloaded_module->debug_file());
+ // time_date_stamp and size_of_image concatenated
+ ASSERT_EQ("B1054D2Aada542bd", md_unloaded_module->code_identifier());
+ ASSERT_EQ("", md_unloaded_module->debug_identifier());
+
+ const MDRawUnloadedModule *md_raw_unloaded_module =
+ md_unloaded_module->module();
+ ASSERT_TRUE(md_raw_unloaded_module != NULL);
+ ASSERT_EQ(0xb1054d2aU, md_raw_unloaded_module->time_date_stamp);
+ ASSERT_EQ(0x34571371U, md_raw_unloaded_module->checksum);
+}
+static const MDVSFixedFileInfo fixed_file_info = {
+ 0xb2fba33a, // signature
+ 0x33d7a728, // struct_version
+ 0x31afcb20, // file_version_hi
+ 0xe51cdab1, // file_version_lo
+ 0xd1ea6907, // product_version_hi
+ 0x03032857, // product_version_lo
+ 0x11bf71d7, // file_flags_mask
+ 0x5fb8cdbf, // file_flags
+ 0xe45d0d5d, // file_os
+ 0x107d9562, // file_type
+ 0x5a8844d4, // file_subtype
+ 0xa8d30b20, // file_date_hi
+ 0x651c3e4e // file_date_lo
+};
+
+TEST(Dump, OneModule) {
Dump dump(0, kBigEndian);
String module_name(dump, "single module");
+ Section cv_info(dump);
+ cv_info
+ .D32(MD_CVINFOPDB70_SIGNATURE) // signature
+ // signature, a MDGUID
+ .D32(0xabcd1234)
+ .D16(0xf00d)
+ .D16(0xbeef)
+ .Append("\x01\x02\x03\x04\x05\x06\x07\x08")
+ .D32(1) // age
+ .AppendCString("c:\\foo\\file.pdb"); // pdb_file_name
+
+ String csd_version(dump, "Windows 9000");
+ SystemInfo system_info(dump, SystemInfo::windows_x86, csd_version);
+
Module module(dump, 0xa90206ca83eb2852ULL, 0xada542bd,
module_name,
0xb1054d2a,
0x34571371,
fixed_file_info, // from synth_minidump_unittest_data.h
- NULL, NULL);
+ &cv_info, nullptr);
dump.Add(&module);
dump.Add(&module_name);
+ dump.Add(&cv_info);
+ dump.Add(&system_info);
+ dump.Add(&csd_version);
dump.Finish();
-
+
string contents;
ASSERT_TRUE(dump.GetContents(&contents));
istringstream minidump_stream(contents);
Minidump minidump(minidump_stream);
ASSERT_TRUE(minidump.Read());
- ASSERT_EQ(1U, minidump.GetDirectoryEntryCount());
+ ASSERT_EQ(2U, minidump.GetDirectoryEntryCount());
- const MDRawDirectory *dir = minidump.GetDirectoryEntryAtIndex(0);
+ const MDRawDirectory *dir = minidump.GetDirectoryEntryAtIndex(1);
ASSERT_TRUE(dir != NULL);
EXPECT_EQ((uint32_t) MD_MODULE_LIST_STREAM, dir->stream_type);
@@ -435,6 +519,92 @@ TEST(Dump, OneModule) {
ASSERT_EQ(0xa90206ca83eb2852ULL, md_module->base_address());
ASSERT_EQ(0xada542bd, md_module->size());
ASSERT_EQ("single module", md_module->code_file());
+ ASSERT_EQ("c:\\foo\\file.pdb", md_module->debug_file());
+ // time_date_stamp and size_of_image concatenated
+ ASSERT_EQ("B1054D2Aada542bd", md_module->code_identifier());
+ ASSERT_EQ("ABCD1234F00DBEEF01020304050607081", md_module->debug_identifier());
+
+ const MDRawModule *md_raw_module = md_module->module();
+ ASSERT_TRUE(md_raw_module != NULL);
+ ASSERT_EQ(0xb1054d2aU, md_raw_module->time_date_stamp);
+ ASSERT_EQ(0x34571371U, md_raw_module->checksum);
+ ASSERT_TRUE(memcmp(&md_raw_module->version_info, &fixed_file_info,
+ sizeof(fixed_file_info)) == 0);
+}
+
+// Test that a module with a MDCVInfoELF CV record is handled properly.
+TEST(Dump, OneModuleCVELF) {
+ Dump dump(0, kLittleEndian);
+ String module_name(dump, "elf module");
+ Section cv_info(dump);
+ cv_info
+ .D32(MD_CVINFOELF_SIGNATURE) // signature
+ // build_id
+ .Append("\x5f\xa9\xcd\xb4\x10\x53\xdf\x1b\x86\xfa\xb7\x33\xb4\xdf"
+ "\x37\x38\xce\xa3\x4a\x87");
+
+ const MDRawSystemInfo linux_x86 = {
+ MD_CPU_ARCHITECTURE_X86, // processor_architecture
+ 6, // processor_level
+ 0xd08, // processor_revision
+ 1, // number_of_processors
+ 0, // product_type
+ 0, // major_version
+ 0, // minor_version
+ 0, // build_number
+ MD_OS_LINUX, // platform_id
+ 0xdeadbeef, // csd_version_rva
+ 0x100, // suite_mask
+ 0, // reserved2
+ { // cpu
+ { // x86_cpu_info
+ { 0x756e6547, 0x49656e69, 0x6c65746e }, // vendor_id
+ 0x6d8, // version_information
+ 0xafe9fbff, // feature_information
+ 0xffffffff // amd_extended_cpu_features
+ }
+ }
+ };
+ String csd_version(dump, "Literally Linux");
+ SystemInfo system_info(dump, linux_x86, csd_version);
+
+ Module module(dump, 0xa90206ca83eb2852ULL, 0xada542bd,
+ module_name,
+ 0xb1054d2a,
+ 0x34571371,
+ fixed_file_info, // from synth_minidump_unittest_data.h
+ &cv_info, nullptr);
+
+ dump.Add(&module);
+ dump.Add(&module_name);
+ dump.Add(&cv_info);
+ dump.Add(&system_info);
+ dump.Add(&csd_version);
+ dump.Finish();
+
+ string contents;
+ ASSERT_TRUE(dump.GetContents(&contents));
+ istringstream minidump_stream(contents);
+ Minidump minidump(minidump_stream);
+ ASSERT_TRUE(minidump.Read());
+
+ MinidumpModuleList *md_module_list = minidump.GetModuleList();
+ ASSERT_TRUE(md_module_list != NULL);
+ ASSERT_EQ(1U, md_module_list->module_count());
+
+ const MinidumpModule *md_module = md_module_list->GetModuleAtIndex(0);
+ ASSERT_TRUE(md_module != NULL);
+ ASSERT_EQ(0xa90206ca83eb2852ULL, md_module->base_address());
+ ASSERT_EQ(0xada542bd, md_module->size());
+ ASSERT_EQ("elf module", md_module->code_file());
+ // debug_file == code_file
+ ASSERT_EQ("elf module", md_module->debug_file());
+ // just the build_id, directly
+ ASSERT_EQ("5fa9cdb41053df1b86fab733b4df3738cea34a87",
+ md_module->code_identifier());
+ // build_id truncted to GUID length and treated as such, with zero
+ // age appended
+ ASSERT_EQ("B4CDA95F53101BDF86FAB733B4DF37380", md_module->debug_identifier());
const MDRawModule *md_raw_module = md_module->module();
ASSERT_TRUE(md_raw_module != NULL);
@@ -444,6 +614,149 @@ TEST(Dump, OneModule) {
sizeof(fixed_file_info)) == 0);
}
+// Test that a build_id that's shorter than a GUID is handled properly.
+TEST(Dump, CVELFShort) {
+ Dump dump(0, kLittleEndian);
+ String module_name(dump, "elf module");
+ Section cv_info(dump);
+ cv_info
+ .D32(MD_CVINFOELF_SIGNATURE) // signature
+ // build_id, shorter than a GUID
+ .Append("\x5f\xa9\xcd\xb4");
+
+ const MDRawSystemInfo linux_x86 = {
+ MD_CPU_ARCHITECTURE_X86, // processor_architecture
+ 6, // processor_level
+ 0xd08, // processor_revision
+ 1, // number_of_processors
+ 0, // product_type
+ 0, // major_version
+ 0, // minor_version
+ 0, // build_number
+ MD_OS_LINUX, // platform_id
+ 0xdeadbeef, // csd_version_rva
+ 0x100, // suite_mask
+ 0, // reserved2
+ { // cpu
+ { // x86_cpu_info
+ { 0x756e6547, 0x49656e69, 0x6c65746e }, // vendor_id
+ 0x6d8, // version_information
+ 0xafe9fbff, // feature_information
+ 0xffffffff // amd_extended_cpu_features
+ }
+ }
+ };
+ String csd_version(dump, "Literally Linux");
+ SystemInfo system_info(dump, linux_x86, csd_version);
+
+ Module module(dump, 0xa90206ca83eb2852ULL, 0xada542bd,
+ module_name,
+ 0xb1054d2a,
+ 0x34571371,
+ fixed_file_info, // from synth_minidump_unittest_data.h
+ &cv_info, nullptr);
+
+ dump.Add(&module);
+ dump.Add(&module_name);
+ dump.Add(&cv_info);
+ dump.Add(&system_info);
+ dump.Add(&csd_version);
+ dump.Finish();
+
+ string contents;
+ ASSERT_TRUE(dump.GetContents(&contents));
+ istringstream minidump_stream(contents);
+ Minidump minidump(minidump_stream);
+ ASSERT_TRUE(minidump.Read());
+ ASSERT_EQ(2U, minidump.GetDirectoryEntryCount());
+
+ MinidumpModuleList *md_module_list = minidump.GetModuleList();
+ ASSERT_TRUE(md_module_list != NULL);
+ ASSERT_EQ(1U, md_module_list->module_count());
+
+ const MinidumpModule *md_module = md_module_list->GetModuleAtIndex(0);
+ ASSERT_TRUE(md_module != NULL);
+ // just the build_id, directly
+ ASSERT_EQ("5fa9cdb4", md_module->code_identifier());
+ // build_id expanded to GUID length and treated as such, with zero
+ // age appended
+ ASSERT_EQ("B4CDA95F0000000000000000000000000", md_module->debug_identifier());
+}
+
+// Test that a build_id that's very long is handled properly.
+TEST(Dump, CVELFLong) {
+ Dump dump(0, kLittleEndian);
+ String module_name(dump, "elf module");
+ Section cv_info(dump);
+ cv_info
+ .D32(MD_CVINFOELF_SIGNATURE) // signature
+ // build_id, lots of bytes
+ .Append("\x5f\xa9\xcd\xb4\x10\x53\xdf\x1b\x86\xfa\xb7\x33\xb4\xdf"
+ "\x37\x38\xce\xa3\x4a\x87\x01\x02\x03\x04\x05\x06\x07\x08"
+ "\x09\x0a\x0b\x0c\x0d\x0e\x0f");
+
+
+ const MDRawSystemInfo linux_x86 = {
+ MD_CPU_ARCHITECTURE_X86, // processor_architecture
+ 6, // processor_level
+ 0xd08, // processor_revision
+ 1, // number_of_processors
+ 0, // product_type
+ 0, // major_version
+ 0, // minor_version
+ 0, // build_number
+ MD_OS_LINUX, // platform_id
+ 0xdeadbeef, // csd_version_rva
+ 0x100, // suite_mask
+ 0, // reserved2
+ { // cpu
+ { // x86_cpu_info
+ { 0x756e6547, 0x49656e69, 0x6c65746e }, // vendor_id
+ 0x6d8, // version_information
+ 0xafe9fbff, // feature_information
+ 0xffffffff // amd_extended_cpu_features
+ }
+ }
+ };
+ String csd_version(dump, "Literally Linux");
+ SystemInfo system_info(dump, linux_x86, csd_version);
+
+ Module module(dump, 0xa90206ca83eb2852ULL, 0xada542bd,
+ module_name,
+ 0xb1054d2a,
+ 0x34571371,
+ fixed_file_info, // from synth_minidump_unittest_data.h
+ &cv_info, nullptr);
+
+ dump.Add(&module);
+ dump.Add(&module_name);
+ dump.Add(&cv_info);
+ dump.Add(&system_info);
+ dump.Add(&csd_version);
+ dump.Finish();
+
+ string contents;
+ ASSERT_TRUE(dump.GetContents(&contents));
+ istringstream minidump_stream(contents);
+ Minidump minidump(minidump_stream);
+ ASSERT_TRUE(minidump.Read());
+ ASSERT_EQ(2U, minidump.GetDirectoryEntryCount());
+
+ MinidumpModuleList *md_module_list = minidump.GetModuleList();
+ ASSERT_TRUE(md_module_list != NULL);
+ ASSERT_EQ(1U, md_module_list->module_count());
+
+ const MinidumpModule *md_module = md_module_list->GetModuleAtIndex(0);
+ ASSERT_TRUE(md_module != NULL);
+ // just the build_id, directly
+ ASSERT_EQ(
+ "5fa9cdb41053df1b86fab733b4df3738cea34a870102030405060708090a0b0c0d0e0f",
+ md_module->code_identifier());
+ // build_id truncated to GUID length and treated as such, with zero
+ // age appended.
+ ASSERT_EQ("B4CDA95F53101BDF86FAB733B4DF37380", md_module->debug_identifier());
+}
+
TEST(Dump, OneSystemInfo) {
Dump dump(0, kLittleEndian);
String csd_version(dump, "Petulant Pierogi");
@@ -558,6 +871,32 @@ TEST(Dump, BigDump) {
dump.Add(&module3_name);
dump.Add(&module3);
+ // Unloaded modules!
+ uint64_t umodule1_base = 0xeb77da57b5d4cbdaULL;
+ uint32_t umodule1_size = 0x83cd5a37;
+ String umodule1_name(dump, "unloaded module one");
+ UnloadedModule unloaded_module1(dump, umodule1_base, umodule1_size,
+ umodule1_name);
+ dump.Add(&umodule1_name);
+ dump.Add(&unloaded_module1);
+
+ uint64_t umodule2_base = 0xeb77da57b5d4cbdaULL;
+ uint32_t umodule2_size = 0x83cd5a37;
+ String umodule2_name(dump, "unloaded module two");
+ UnloadedModule unloaded_module2(dump, umodule2_base, umodule2_size,
+ umodule2_name);
+ dump.Add(&umodule2_name);
+ dump.Add(&unloaded_module2);
+
+ uint64_t umodule3_base = 0xeb77da5839a20000ULL;
+ uint32_t umodule3_size = 0x83cd5a37;
+ String umodule3_name(dump, "unloaded module three");
+ UnloadedModule unloaded_module3(dump, umodule3_base, umodule3_size,
+ umodule3_name);
+ dump.Add(&umodule3_name);
+ dump.Add(&unloaded_module3);
+
+
// Add one more memory region, on top of the five stacks.
Memory memory5(dump, 0x61979e828040e564ULL);
memory5.Append("contents of memory 5");
@@ -570,7 +909,7 @@ TEST(Dump, BigDump) {
istringstream minidump_stream(contents);
Minidump minidump(minidump_stream);
ASSERT_TRUE(minidump.Read());
- ASSERT_EQ(4U, minidump.GetDirectoryEntryCount());
+ ASSERT_EQ(5U, minidump.GetDirectoryEntryCount());
// Check the threads.
MinidumpThreadList *thread_list = minidump.GetThreadList();
@@ -627,6 +966,29 @@ TEST(Dump, BigDump) {
md_module_list->GetModuleAtIndex(1)->base_address());
EXPECT_EQ(0x95fc1544da321b6cULL,
md_module_list->GetModuleAtIndex(2)->base_address());
+
+ // Check unloaded modules
+ MinidumpUnloadedModuleList *md_unloaded_module_list =
+ minidump.GetUnloadedModuleList();
+ ASSERT_TRUE(md_unloaded_module_list != NULL);
+ ASSERT_EQ(3U, md_unloaded_module_list->module_count());
+ EXPECT_EQ(umodule1_base,
+ md_unloaded_module_list->GetModuleAtIndex(0)->base_address());
+ EXPECT_EQ(umodule2_base,
+ md_unloaded_module_list->GetModuleAtIndex(1)->base_address());
+ EXPECT_EQ(umodule3_base,
+ md_unloaded_module_list->GetModuleAtIndex(2)->base_address());
+
+ const MinidumpUnloadedModule *umodule =
+ md_unloaded_module_list->GetModuleForAddress(
+ umodule1_base + umodule1_size / 2);
+ EXPECT_EQ(umodule1_base, umodule->base_address());
+
+ umodule = md_unloaded_module_list->GetModuleAtSequence(0);
+ EXPECT_EQ(umodule1_base, umodule->base_address());
+
+ EXPECT_EQ(NULL, md_unloaded_module_list->GetMainModule());
+
}
TEST(Dump, OneMemoryInfo) {
diff --git a/src/processor/proc_maps_linux.cc b/src/processor/proc_maps_linux.cc
new file mode 100644
index 00000000..3c0dea25
--- /dev/null
+++ b/src/processor/proc_maps_linux.cc
@@ -0,0 +1,106 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef __STDC_FORMAT_MACROS
+#define __STDC_FORMAT_MACROS
+#endif
+
+#include "google_breakpad/processor/proc_maps_linux.h"
+
+#include <fcntl.h>
+#include <inttypes.h>
+#include <stdio.h>
+
+#include "common/using_std_string.h"
+#include "processor/logging.h"
+
+#if defined(OS_ANDROID) && !defined(__LP64__)
+// In 32-bit mode, Bionic's inttypes.h defines PRI/SCNxPTR as an
+// unsigned long int, which is incompatible with Bionic's stdint.h
+// defining uintptr_t as an unsigned int:
+// https://code.google.com/p/android/issues/detail?id=57218
+#undef SCNxPTR
+#define SCNxPTR "x"
+#endif
+
+namespace google_breakpad {
+
+bool ParseProcMaps(const string& input,
+ std::vector<MappedMemoryRegion>* regions_out) {
+ std::vector<MappedMemoryRegion> regions;
+
+ // This isn't async safe nor terribly efficient, but it doesn't need to be at
+ // this point in time.
+
+ // Split the string by newlines.
+ std::vector<string> lines;
+ string l = "";
+ for (size_t i = 0; i < input.size(); i++) {
+ if (input[i] != '\n' && input[i] != '\r') {
+ l.push_back(input[i]);
+ } else if (l.size() > 0) {
+ lines.push_back(l);
+ l.clear();
+ }
+ }
+ if (l.size() > 0) {
+ BPLOG(ERROR) << "Input doesn't end in newline";
+ return false;
+ }
+
+ for (size_t i = 0; i < lines.size(); ++i) {
+ MappedMemoryRegion region;
+ const char* line = lines[i].c_str();
+ char permissions[5] = {'\0'}; // Ensure NUL-terminated string.
+ int path_index = 0;
+
+ // Sample format from man 5 proc:
+ //
+ // address perms offset dev inode pathname
+ // 08048000-08056000 r-xp 00000000 03:0c 64593 /usr/sbin/gpm
+ //
+ // The final %n term captures the offset in the input string, which is used
+ // to determine the path name. It *does not* increment the return value.
+ // Refer to man 3 sscanf for details.
+ if (sscanf(line, "%" SCNx64 "-%" SCNx64 " %4c %" SCNx64" %hhx:%hhx %"
+ SCNd64 " %n", &region.start, &region.end, permissions,
+ &region.offset, &region.major_device, &region.minor_device,
+ &region.inode, &path_index) < 7) {
+ BPLOG(ERROR) << "sscanf failed for line: " << line;
+ return false;
+ }
+
+ region.permissions = 0;
+
+ if (permissions[0] == 'r')
+ region.permissions |= MappedMemoryRegion::READ;
+ else if (permissions[0] != '-')
+ return false;
+
+ if (permissions[1] == 'w')
+ region.permissions |= MappedMemoryRegion::WRITE;
+ else if (permissions[1] != '-')
+ return false;
+
+ if (permissions[2] == 'x')
+ region.permissions |= MappedMemoryRegion::EXECUTE;
+ else if (permissions[2] != '-')
+ return false;
+
+ if (permissions[3] == 'p')
+ region.permissions |= MappedMemoryRegion::PRIVATE;
+ else if (permissions[3] != 's' && permissions[3] != 'S') // Shared memory.
+ return false;
+
+ // Pushing then assigning saves us a string copy.
+ regions.push_back(region);
+ regions.back().path.assign(line + path_index);
+ regions.back().line.assign(line);
+ }
+
+ regions_out->swap(regions);
+ return true;
+}
+
+} // namespace google_breakpad
diff --git a/src/processor/proc_maps_linux_unittest.cc b/src/processor/proc_maps_linux_unittest.cc
new file mode 100644
index 00000000..466f2345
--- /dev/null
+++ b/src/processor/proc_maps_linux_unittest.cc
@@ -0,0 +1,251 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "breakpad_googletest_includes.h"
+#include "common/using_std_string.h"
+#include "google_breakpad/processor/proc_maps_linux.h"
+
+namespace {
+
+TEST(ProcMapsTest, Empty) {
+ std::vector<google_breakpad::MappedMemoryRegion> regions;
+ EXPECT_TRUE(ParseProcMaps("", &regions));
+ EXPECT_EQ(0u, regions.size());
+}
+
+TEST(ProcMapsTest, NoSpaces) {
+ static const char kNoSpaces[] =
+ "00400000-0040b000 r-xp 00002200 fc:00 794418 /bin/cat\n";
+
+ std::vector<google_breakpad::MappedMemoryRegion> regions;
+ ASSERT_TRUE(ParseProcMaps(kNoSpaces, &regions));
+ ASSERT_EQ(1u, regions.size());
+
+ EXPECT_EQ(0x00400000u, regions[0].start);
+ EXPECT_EQ(0x0040b000u, regions[0].end);
+ EXPECT_EQ(0x00002200u, regions[0].offset);
+ EXPECT_EQ("/bin/cat", regions[0].path);
+}
+
+TEST(ProcMapsTest, Spaces) {
+ static const char kSpaces[] =
+ "00400000-0040b000 r-xp 00002200 fc:00 794418 /bin/space cat\n";
+
+ std::vector<google_breakpad::MappedMemoryRegion> regions;
+ ASSERT_TRUE(ParseProcMaps(kSpaces, &regions));
+ ASSERT_EQ(1u, regions.size());
+
+ EXPECT_EQ(0x00400000u, regions[0].start);
+ EXPECT_EQ(0x0040b000u, regions[0].end);
+ EXPECT_EQ(0x00002200u, regions[0].offset);
+ EXPECT_EQ("/bin/space cat", regions[0].path);
+}
+
+TEST(ProcMapsTest, NoNewline) {
+ static const char kNoSpaces[] =
+ "00400000-0040b000 r-xp 00002200 fc:00 794418 /bin/cat";
+
+ std::vector<google_breakpad::MappedMemoryRegion> regions;
+ ASSERT_FALSE(ParseProcMaps(kNoSpaces, &regions));
+}
+
+TEST(ProcMapsTest, NoPath) {
+ static const char kNoPath[] =
+ "00400000-0040b000 rw-p 00000000 00:00 0 \n";
+
+ std::vector<google_breakpad::MappedMemoryRegion> regions;
+ ASSERT_TRUE(ParseProcMaps(kNoPath, &regions));
+ ASSERT_EQ(1u, regions.size());
+
+ EXPECT_EQ(0x00400000u, regions[0].start);
+ EXPECT_EQ(0x0040b000u, regions[0].end);
+ EXPECT_EQ(0x00000000u, regions[0].offset);
+ EXPECT_EQ("", regions[0].path);
+}
+
+TEST(ProcMapsTest, Heap) {
+ static const char kHeap[] =
+ "022ac000-022cd000 rw-p 00000000 00:00 0 [heap]\n";
+
+ std::vector<google_breakpad::MappedMemoryRegion> regions;
+ ASSERT_TRUE(ParseProcMaps(kHeap, &regions));
+ ASSERT_EQ(1u, regions.size());
+
+ EXPECT_EQ(0x022ac000u, regions[0].start);
+ EXPECT_EQ(0x022cd000u, regions[0].end);
+ EXPECT_EQ(0x00000000u, regions[0].offset);
+ EXPECT_EQ("[heap]", regions[0].path);
+}
+
+#if defined(ARCH_CPU_32_BITS)
+TEST(ProcMapsTest, Stack32) {
+ static const char kStack[] =
+ "beb04000-beb25000 rw-p 00000000 00:00 0 [stack]\n";
+
+ std::vector<google_breakpad::MappedMemoryRegion> regions;
+ ASSERT_TRUE(ParseProcMaps(kStack, &regions));
+ ASSERT_EQ(1u, regions.size());
+
+ EXPECT_EQ(0xbeb04000u, regions[0].start);
+ EXPECT_EQ(0xbeb25000u, regions[0].end);
+ EXPECT_EQ(0x00000000u, regions[0].offset);
+ EXPECT_EQ("[stack]", regions[0].path);
+}
+#elif defined(ARCH_CPU_64_BITS)
+TEST(ProcMapsTest, Stack64) {
+ static const char kStack[] =
+ "7fff69c5b000-7fff69c7d000 rw-p 00000000 00:00 0 [stack]\n";
+
+ std::vector<google_breakpad::MappedMemoryRegion> regions;
+ ASSERT_TRUE(ParseProcMaps(kStack, &regions));
+ ASSERT_EQ(1u, regions.size());
+
+ EXPECT_EQ(0x7fff69c5b000u, regions[0].start);
+ EXPECT_EQ(0x7fff69c7d000u, regions[0].end);
+ EXPECT_EQ(0x00000000u, regions[0].offset);
+ EXPECT_EQ("[stack]", regions[0].path);
+}
+#endif
+
+TEST(ProcMapsTest, Multiple) {
+ static const char kMultiple[] =
+ "00400000-0040b000 r-xp 00000000 fc:00 794418 /bin/cat\n"
+ "0060a000-0060b000 r--p 0000a000 fc:00 794418 /bin/cat\n"
+ "0060b000-0060c000 rw-p 0000b000 fc:00 794418 /bin/cat\n";
+
+ std::vector<google_breakpad::MappedMemoryRegion> regions;
+ ASSERT_TRUE(ParseProcMaps(kMultiple, &regions));
+ ASSERT_EQ(3u, regions.size());
+
+ EXPECT_EQ(0x00400000u, regions[0].start);
+ EXPECT_EQ(0x0040b000u, regions[0].end);
+ EXPECT_EQ(0x00000000u, regions[0].offset);
+ EXPECT_EQ("/bin/cat", regions[0].path);
+
+ EXPECT_EQ(0x0060a000u, regions[1].start);
+ EXPECT_EQ(0x0060b000u, regions[1].end);
+ EXPECT_EQ(0x0000a000u, regions[1].offset);
+ EXPECT_EQ("/bin/cat", regions[1].path);
+
+ EXPECT_EQ(0x0060b000u, regions[2].start);
+ EXPECT_EQ(0x0060c000u, regions[2].end);
+ EXPECT_EQ(0x0000b000u, regions[2].offset);
+ EXPECT_EQ("/bin/cat", regions[2].path);
+}
+
+TEST(ProcMapsTest, Permissions) {
+ static struct {
+ const char* input;
+ uint8_t permissions;
+ } kTestCases[] = {
+ {"00400000-0040b000 ---s 00000000 fc:00 794418 /bin/cat\n", 0},
+ {"00400000-0040b000 ---S 00000000 fc:00 794418 /bin/cat\n", 0},
+ {"00400000-0040b000 r--s 00000000 fc:00 794418 /bin/cat\n",
+ google_breakpad::MappedMemoryRegion::READ},
+ {"00400000-0040b000 -w-s 00000000 fc:00 794418 /bin/cat\n",
+ google_breakpad::MappedMemoryRegion::WRITE},
+ {"00400000-0040b000 --xs 00000000 fc:00 794418 /bin/cat\n",
+ google_breakpad::MappedMemoryRegion::EXECUTE},
+ {"00400000-0040b000 rwxs 00000000 fc:00 794418 /bin/cat\n",
+ google_breakpad::MappedMemoryRegion::READ
+ | google_breakpad::MappedMemoryRegion::WRITE
+ | google_breakpad::MappedMemoryRegion::EXECUTE},
+ {"00400000-0040b000 ---p 00000000 fc:00 794418 /bin/cat\n",
+ google_breakpad::MappedMemoryRegion::PRIVATE},
+ {"00400000-0040b000 r--p 00000000 fc:00 794418 /bin/cat\n",
+ google_breakpad::MappedMemoryRegion::READ
+ | google_breakpad::MappedMemoryRegion::PRIVATE},
+ {"00400000-0040b000 -w-p 00000000 fc:00 794418 /bin/cat\n",
+ google_breakpad::MappedMemoryRegion::WRITE
+ | google_breakpad::MappedMemoryRegion::PRIVATE},
+ {"00400000-0040b000 --xp 00000000 fc:00 794418 /bin/cat\n",
+ google_breakpad::MappedMemoryRegion::EXECUTE
+ | google_breakpad::MappedMemoryRegion::PRIVATE},
+ {"00400000-0040b000 rwxp 00000000 fc:00 794418 /bin/cat\n",
+ google_breakpad::MappedMemoryRegion::READ
+ | google_breakpad::MappedMemoryRegion::WRITE
+ | google_breakpad::MappedMemoryRegion::EXECUTE
+ | google_breakpad::MappedMemoryRegion::PRIVATE},
+ };
+
+ for (size_t i = 0; i < sizeof(kTestCases) / sizeof(kTestCases[0]); ++i) {
+ std::vector<google_breakpad::MappedMemoryRegion> regions;
+ EXPECT_TRUE(ParseProcMaps(kTestCases[i].input, &regions));
+ EXPECT_EQ(1u, regions.size());
+ if (regions.empty())
+ continue;
+ EXPECT_EQ(kTestCases[i].permissions, regions[0].permissions);
+ }
+}
+
+TEST(ProcMapsTest, MissingFields) {
+ static const char* kTestCases[] = {
+ "00400000\n", // Missing end + beyond.
+ "00400000-0040b000\n", // Missing perms + beyond.
+ "00400000-0040b000 r-xp\n", // Missing offset + beyond.
+ "00400000-0040b000 r-xp 00000000\n", // Missing device + beyond.
+ "00400000-0040b000 r-xp 00000000 fc:00\n", // Missing inode + beyond.
+ "00400000-0040b000 00000000 fc:00 794418 /bin/cat\n", // Missing perms.
+ "00400000-0040b000 r-xp fc:00 794418 /bin/cat\n", // Missing offset.
+ "00400000-0040b000 r-xp 00000000 fc:00 /bin/cat\n", // Missing inode.
+ "00400000 r-xp 00000000 fc:00 794418 /bin/cat\n", // Missing end.
+ "-0040b000 r-xp 00000000 fc:00 794418 /bin/cat\n", // Missing start.
+ "00400000-0040b000 r-xp 00000000 794418 /bin/cat\n", // Missing device.
+ };
+
+ for (size_t i = 0; i < sizeof(kTestCases) / sizeof(kTestCases[0]); ++i) {
+ std::vector<google_breakpad::MappedMemoryRegion> regions;
+ EXPECT_FALSE(ParseProcMaps(kTestCases[i], &regions));
+ }
+}
+
+TEST(ProcMapsTest, InvalidInput) {
+ static const char* kTestCases[] = {
+ "thisisal-0040b000 rwxp 00000000 fc:00 794418 /bin/cat\n",
+ "0040000d-linvalid rwxp 00000000 fc:00 794418 /bin/cat\n",
+ "00400000-0040b000 inpu 00000000 fc:00 794418 /bin/cat\n",
+ "00400000-0040b000 rwxp tforproc fc:00 794418 /bin/cat\n",
+ "00400000-0040b000 rwxp 00000000 ma:ps 794418 /bin/cat\n",
+ "00400000-0040b000 rwxp 00000000 fc:00 parse! /bin/cat\n",
+ };
+
+ for (size_t i = 0; i < sizeof(kTestCases) / sizeof(kTestCases[0]); ++i) {
+ std::vector<google_breakpad::MappedMemoryRegion> regions;
+ EXPECT_FALSE(ParseProcMaps(kTestCases[i], &regions));
+ }
+}
+
+TEST(ProcMapsTest, ParseProcMapsEmptyString) {
+ std::vector<google_breakpad::MappedMemoryRegion> regions;
+ EXPECT_TRUE(ParseProcMaps("", &regions));
+ EXPECT_EQ(0ULL, regions.size());
+}
+
+// Testing a couple of remotely possible weird things in the input:
+// - Line ending with \r\n or \n\r.
+// - File name contains quotes.
+// - File name has whitespaces.
+TEST(ProcMapsTest, ParseProcMapsWeirdCorrectInput) {
+ std::vector<google_breakpad::MappedMemoryRegion> regions;
+ const string kContents =
+ "00400000-0040b000 r-xp 00000000 fc:00 2106562 "
+ " /bin/cat\r\n"
+ "7f53b7dad000-7f53b7f62000 r-xp 00000000 fc:00 263011 "
+ " /lib/x86_64-linux-gnu/libc-2.15.so\n\r"
+ "7f53b816d000-7f53b818f000 r-xp 00000000 fc:00 264284 "
+ " /lib/x86_64-linux-gnu/ld-2.15.so\n"
+ "7fff9c7ff000-7fff9c800000 r-xp 00000000 00:00 0 "
+ " \"vd so\"\n"
+ "ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 "
+ " [vsys call]\n";
+ EXPECT_TRUE(ParseProcMaps(kContents, &regions));
+ EXPECT_EQ(5ULL, regions.size());
+ EXPECT_EQ("/bin/cat", regions[0].path);
+ EXPECT_EQ("/lib/x86_64-linux-gnu/libc-2.15.so", regions[1].path);
+ EXPECT_EQ("/lib/x86_64-linux-gnu/ld-2.15.so", regions[2].path);
+ EXPECT_EQ("\"vd so\"", regions[3].path);
+ EXPECT_EQ("[vsys call]", regions[4].path);
+}
+
+} // namespace
diff --git a/src/processor/process_state.cc b/src/processor/process_state.cc
index 5a5cd7f6..43c4a4b8 100644
--- a/src/processor/process_state.cc
+++ b/src/processor/process_state.cc
@@ -64,6 +64,8 @@ void ProcessState::Clear() {
modules_with_corrupt_symbols_.clear();
delete modules_;
modules_ = NULL;
+ delete unloaded_modules_;
+ unloaded_modules_ = NULL;
}
} // namespace google_breakpad
diff --git a/src/processor/processor.gyp b/src/processor/processor.gyp
index fb3d7cde..93896c0e 100644
--- a/src/processor/processor.gyp
+++ b/src/processor/processor.gyp
@@ -28,6 +28,7 @@
{
'includes': [
+ '../build/common.gypi',
'processor_tools.gypi',
],
'targets': [
@@ -42,14 +43,14 @@
'basic_code_modules.h',
'basic_source_line_resolver.cc',
'basic_source_line_resolver_types.h',
- 'binarystream.cc',
- 'binarystream.h',
'call_stack.cc',
'cfi_frame_info-inl.h',
'cfi_frame_info.cc',
'cfi_frame_info.h',
'contained_range_map-inl.h',
'contained_range_map.h',
+ 'convert_old_arm64_context.cc',
+ 'convert_old_arm64_context.h',
'disassembler_x86.cc',
'disassembler_x86.h',
'dump_context.cc',
@@ -78,6 +79,7 @@
'pathname_stripper.h',
'postfix_evaluator-inl.h',
'postfix_evaluator.h',
+ 'proc_maps_linux.cc',
'process_state.cc',
'range_map-inl.h',
'range_map.h',
@@ -143,7 +145,6 @@
'sources': [
'address_map_unittest.cc',
'basic_source_line_resolver_unittest.cc',
- 'binarystream_unittest.cc',
'cfi_frame_info_unittest.cc',
'contained_range_map_unittest.cc',
'disassembler_x86_unittest.cc',
@@ -155,12 +156,15 @@
'minidump_unittest.cc',
'pathname_stripper_unittest.cc',
'postfix_evaluator_unittest.cc',
+ 'range_map_truncate_lower_unittest.cc',
+ 'range_map_truncate_upper_unittest.cc',
'range_map_unittest.cc',
'stackwalker_address_list_unittest.cc',
'stackwalker_amd64_unittest.cc',
'stackwalker_arm64_unittest.cc',
'stackwalker_arm_unittest.cc',
'stackwalker_mips_unittest.cc',
+ 'stackwalker_mips64_unittest.cc',
'stackwalker_unittest_utils.h',
'stackwalker_x86_unittest.cc',
'static_address_map_unittest.cc',
@@ -175,8 +179,8 @@
],
'dependencies': [
'processor',
- '../build/testing.gypi:gmock',
- '../build/testing.gypi:gtest',
+ '../build/testing.gyp:gmock',
+ '../build/testing.gyp:gtest',
],
},
],
diff --git a/src/processor/proto/README b/src/processor/proto/README
index df37b6f3..f9e5a4d3 100644
--- a/src/processor/proto/README
+++ b/src/processor/proto/README
@@ -1,5 +1,5 @@
If you wish to use these protobufs, you must generate their source files
-using protoc from the protobuf project (http://code.google.com/p/protobuf/).
+using protoc from the protobuf project (https://github.com/google/protobuf).
-----
Troubleshooting for Protobuf:
diff --git a/src/processor/range_map-inl.h b/src/processor/range_map-inl.h
index 55dae839..4d3b0eb9 100644
--- a/src/processor/range_map-inl.h
+++ b/src/processor/range_map-inl.h
@@ -40,26 +40,34 @@
#include <assert.h>
#include "processor/range_map.h"
+#include "processor/linked_ptr.h"
#include "processor/logging.h"
namespace google_breakpad {
-
template<typename AddressType, typename EntryType>
bool RangeMap<AddressType, EntryType>::StoreRange(const AddressType &base,
const AddressType &size,
const EntryType &entry) {
- AddressType high = base + size - 1;
+ return StoreRangeInternal(base, 0 /* delta */, size, entry);
+}
+
+template<typename AddressType, typename EntryType>
+bool RangeMap<AddressType, EntryType>::StoreRangeInternal(
+ const AddressType &base, const AddressType &delta,
+ const AddressType &size, const EntryType &entry) {
+ AddressType high = base + (size - 1);
// Check for undersize or overflow.
if (size <= 0 || high < base) {
// The processor will hit this case too frequently with common symbol
// files in the size == 0 case, which is more suited to a DEBUG channel.
// Filter those out since there's no DEBUG channel at the moment.
- BPLOG_IF(INFO, size != 0) << "StoreRange failed, " << HexString(base) <<
- "+" << HexString(size) << ", " <<
- HexString(high);
+ BPLOG_IF(INFO, size != 0) << "StoreRangeInternal failed, "
+ << HexString(base) << "+" << HexString(size)
+ << ", " << HexString(high)
+ << ", delta: " << HexString(delta);
return false;
}
@@ -69,55 +77,112 @@ bool RangeMap<AddressType, EntryType>::StoreRange(const AddressType &base,
MapConstIterator iterator_high = map_.lower_bound(high);
if (iterator_base != iterator_high) {
- // Some other range begins in the space used by this range. It may be
+ // Some other range ends in the space used by this range. It may be
// contained within the space used by this range, or it may extend lower.
- // Regardless, it is an error.
- // The processor hits this case too frequently with common symbol files.
- // This is most appropriate for a DEBUG channel, but since none exists now
- // simply comment out this logging.
- //
- // AddressType other_base = iterator_base->second.base();
- // AddressType other_size = iterator_base->first - other_base + 1;
- // BPLOG(INFO) << "StoreRange failed, an existing range is contained by or "
- // "extends lower than the new range: new " <<
- // HexString(base) << "+" << HexString(size) <<
- // ", existing " << HexString(other_base) << "+" <<
- // HexString(other_size);
-
- return false;
+ if (merge_strategy_ == MergeRangeStrategy::kTruncateLower) {
+ // kTruncate the range with the lower base address.
+ AddressType other_base = iterator_base->second.base();
+ if (base < other_base) {
+ return StoreRangeInternal(base, delta, other_base - base, entry);
+ } else if (other_base < base) {
+ EntryType other_entry;
+ AddressType other_high, other_size, other_delta;
+ other_high = iterator_base->first;
+ RetrieveRange(other_high, &other_entry, &other_base, &other_delta,
+ &other_size);
+ map_.erase(iterator_base);
+ map_.insert(
+ MapValue(base - 1, Range(other_base, other_delta, other_entry)));
+ return StoreRangeInternal(base, delta, size, entry);
+ } else {
+ return false;
+ }
+ } else if (merge_strategy_ == MergeRangeStrategy::kTruncateUpper) {
+ // Truncate the lower portion of this range.
+ AddressType additional_delta = iterator_base->first - base + 1;
+ return StoreRangeInternal(base + additional_delta,
+ delta + additional_delta,
+ size - additional_delta, entry);
+ } else {
+ // The processor hits this case too frequently with common symbol files.
+ // This is most appropriate for a DEBUG channel, but since none exists
+ // now simply comment out this logging.
+ // AddressType other_base = iterator_base->second.base();
+ // AddressType other_size = iterator_base->first - other_base + 1;
+ // BPLOG(INFO) << "StoreRangeInternal failed, an existing range is "
+ // << "overlapping with the new range: new "
+ // << HexString(base) << "+" << HexString(size)
+ // << ", existing " << HexString(other_base) << "+"
+ // << HexString(other_size);
+ return false;
+ }
}
- if (iterator_high != map_.end()) {
- if (iterator_high->second.base() <= high) {
- // The range above this one overlaps with this one. It may fully
- // contain this range, or it may begin within this range and extend
- // higher. Regardless, it's an error.
+ if (iterator_high != map_.end() && iterator_high->second.base() <= high) {
+ // The range above this one overlaps with this one. It may fully
+ // contain this range, or it may begin within this range and extend
+ // higher.
+ if (merge_strategy_ == MergeRangeStrategy::kTruncateLower) {
+ AddressType other_base = iterator_high->second.base();
+ if (base < other_base) {
+ return StoreRangeInternal(base, delta, other_base - base, entry);
+ } else if (other_base < base) {
+ EntryType other_entry;
+ AddressType other_high, other_size, other_delta;
+ other_high = iterator_high->first;
+ RetrieveRange(other_high, &other_entry, &other_base, &other_delta,
+ &other_size);
+ map_.erase(iterator_high);
+ map_.insert(
+ MapValue(base - 1, Range(other_base, other_delta, other_entry)));
+ return StoreRangeInternal(base, delta, size, entry);
+ } else {
+ return false;
+ }
+ } else if (merge_strategy_ == MergeRangeStrategy::kTruncateUpper &&
+ iterator_high->first > high) {
+ // Shrink the other range down.
+ AddressType other_high = iterator_high->first;
+ AddressType additional_delta = high - iterator_high->second.base() + 1;
+ EntryType other_entry;
+ AddressType other_base = AddressType();
+ AddressType other_size = AddressType();
+ AddressType other_delta = AddressType();
+ RetrieveRange(other_high, &other_entry, &other_base, &other_delta,
+ &other_size);
+ map_.erase(iterator_high);
+ map_.insert(MapValue(other_high,
+ Range(other_base + additional_delta,
+ other_delta + additional_delta, other_entry)));
+ // Retry to store this range.
+ return StoreRangeInternal(base, delta, size, entry);
+ } else {
// The processor hits this case too frequently with common symbol files.
- // This is most appropriate for a DEBUG channel, but since none exists now
- // simply comment out this logging.
+ // This is most appropriate for a DEBUG channel, but since none exists
+ // now simply comment out this logging.
//
// AddressType other_base = iterator_high->second.base();
// AddressType other_size = iterator_high->first - other_base + 1;
- // BPLOG(INFO) << "StoreRange failed, an existing range contains or "
- // "extends higher than the new range: new " <<
- // HexString(base) << "+" << HexString(size) <<
- // ", existing " << HexString(other_base) << "+" <<
- // HexString(other_size);
+ // BPLOG(INFO) << "StoreRangeInternal failed, an existing range "
+ // << "contains or extends higher than the new range: new "
+ // << HexString(base) << "+" << HexString(size)
+ // << ", existing " << HexString(other_base) << "+"
+ // << HexString(other_size);
return false;
}
}
// Store the range in the map by its high address, so that lower_bound can
// be used to quickly locate a range by address.
- map_.insert(MapValue(high, Range(base, entry)));
+ map_.insert(MapValue(high, Range(base, delta, entry)));
return true;
}
template<typename AddressType, typename EntryType>
bool RangeMap<AddressType, EntryType>::RetrieveRange(
- const AddressType &address, EntryType *entry,
- AddressType *entry_base, AddressType *entry_size) const {
+ const AddressType &address, EntryType *entry, AddressType *entry_base,
+ AddressType *entry_delta, AddressType *entry_size) const {
BPLOG_IF(ERROR, !entry) << "RangeMap::RetrieveRange requires |entry|";
assert(entry);
@@ -136,6 +201,8 @@ bool RangeMap<AddressType, EntryType>::RetrieveRange(
*entry = iterator->second.entry();
if (entry_base)
*entry_base = iterator->second.base();
+ if (entry_delta)
+ *entry_delta = iterator->second.delta();
if (entry_size)
*entry_size = iterator->first - iterator->second.base() + 1;
@@ -145,13 +212,13 @@ bool RangeMap<AddressType, EntryType>::RetrieveRange(
template<typename AddressType, typename EntryType>
bool RangeMap<AddressType, EntryType>::RetrieveNearestRange(
- const AddressType &address, EntryType *entry,
- AddressType *entry_base, AddressType *entry_size) const {
+ const AddressType &address, EntryType *entry, AddressType *entry_base,
+ AddressType *entry_delta, AddressType *entry_size) const {
BPLOG_IF(ERROR, !entry) << "RangeMap::RetrieveNearestRange requires |entry|";
assert(entry);
// If address is within a range, RetrieveRange can handle it.
- if (RetrieveRange(address, entry, entry_base, entry_size))
+ if (RetrieveRange(address, entry, entry_base, entry_delta, entry_size))
return true;
// upper_bound gives the first element whose key is greater than address,
@@ -167,6 +234,8 @@ bool RangeMap<AddressType, EntryType>::RetrieveNearestRange(
*entry = iterator->second.entry();
if (entry_base)
*entry_base = iterator->second.base();
+ if (entry_delta)
+ *entry_delta = iterator->second.delta();
if (entry_size)
*entry_size = iterator->first - iterator->second.base() + 1;
@@ -176,8 +245,8 @@ bool RangeMap<AddressType, EntryType>::RetrieveNearestRange(
template<typename AddressType, typename EntryType>
bool RangeMap<AddressType, EntryType>::RetrieveRangeAtIndex(
- int index, EntryType *entry,
- AddressType *entry_base, AddressType *entry_size) const {
+ int index, EntryType *entry, AddressType *entry_base,
+ AddressType *entry_delta, AddressType *entry_size) const {
BPLOG_IF(ERROR, !entry) << "RangeMap::RetrieveRangeAtIndex requires |entry|";
assert(entry);
@@ -195,6 +264,8 @@ bool RangeMap<AddressType, EntryType>::RetrieveRangeAtIndex(
*entry = iterator->second.entry();
if (entry_base)
*entry_base = iterator->second.base();
+ if (entry_delta)
+ *entry_delta = iterator->second.delta();
if (entry_size)
*entry_size = iterator->first - iterator->second.base() + 1;
@@ -204,7 +275,7 @@ bool RangeMap<AddressType, EntryType>::RetrieveRangeAtIndex(
template<typename AddressType, typename EntryType>
int RangeMap<AddressType, EntryType>::GetCount() const {
- return map_.size();
+ return static_cast<int>(map_.size());
}
diff --git a/src/processor/range_map.h b/src/processor/range_map.h
index 2572e492..33f32973 100644
--- a/src/processor/range_map.h
+++ b/src/processor/range_map.h
@@ -49,43 +49,70 @@ namespace google_breakpad {
// Forward declarations (for later friend declarations of specialized template).
template<class, class> class RangeMapSerializer;
+// Determines what happens when two ranges overlap.
+enum class MergeRangeStrategy {
+ // When two ranges overlap, the new range fails to be inserted. The default
+ // strategy.
+ kExclusiveRanges,
+
+ // The range with the lower base address will be truncated such that it's
+ // high address is one less than the range above it.
+ kTruncateLower,
+
+ // The range with the greater high address has its range truncated such that
+ // its base address is one higher than the range below it.
+ kTruncateUpper
+};
+
template<typename AddressType, typename EntryType>
class RangeMap {
public:
- RangeMap() : map_() {}
+ RangeMap() : merge_strategy_(MergeRangeStrategy::kExclusiveRanges), map_() {}
+
+ void SetMergeStrategy(MergeRangeStrategy strat) { merge_strategy_ = strat; }
+
+ MergeRangeStrategy GetMergeStrategy() const { return merge_strategy_; }
// Inserts a range into the map. Returns false for a parameter error,
// or if the location of the range would conflict with a range already
- // stored in the map.
- bool StoreRange(const AddressType &base,
- const AddressType &size,
+ // stored in the map. If enable_shrink_down is true and there is an overlap
+ // between the current range and some other range (already in the map),
+ // shrink down the range which ends at a higher address.
+ bool StoreRange(const AddressType &base, const AddressType &size,
const EntryType &entry);
- // Locates the range encompassing the supplied address. If there is
- // no such range, returns false. entry_base and entry_size, if non-NULL,
- // are set to the base and size of the entry's range.
+ // Locates the range encompassing the supplied address. If there is no such
+ // range, returns false. entry_base, entry_delta, and entry_size, if
+ // non-NULL, are set to the base, delta, and size of the entry's range.
+ // A positive entry delta (> 0) indicates that there was an overlap and the
+ // entry was shrunk down (original start address was increased by delta).
bool RetrieveRange(const AddressType &address, EntryType *entry,
- AddressType *entry_base, AddressType *entry_size) const;
+ AddressType *entry_base, AddressType *entry_delta,
+ AddressType *entry_size) const;
// Locates the range encompassing the supplied address, if one exists.
// If no range encompasses the supplied address, locates the nearest range
// to the supplied address that is lower than the address. Returns false
- // if no range meets these criteria. entry_base and entry_size, if
- // non-NULL, are set to the base and size of the entry's range.
+ // if no range meets these criteria. entry_base, entry_delta, and entry_size,
+ // if non-NULL, are set to the base, delta, and size of the entry's range.
+ // A positive entry delta (> 0) indicates that there was an overlap and the
+ // entry was shrunk down (original start address was increased by delta).
bool RetrieveNearestRange(const AddressType &address, EntryType *entry,
- AddressType *entry_base, AddressType *entry_size)
- const;
+ AddressType *entry_base, AddressType *entry_delta,
+ AddressType *entry_size) const;
// Treating all ranges as a list ordered by the address spaces that they
// occupy, locates the range at the index specified by index. Returns
- // false if index is larger than the number of ranges stored. entry_base
- // and entry_size, if non-NULL, are set to the base and size of the entry's
- // range.
+ // false if index is larger than the number of ranges stored. entry_base,
+ // entry_delta, and entry_size, if non-NULL, are set to the base, delta, and
+ // size of the entry's range.
+ // A positive entry delta (> 0) indicates that there was an overlap and the
+ // entry was shrunk down (original start address was increased by delta).
//
// RetrieveRangeAtIndex is not optimized for speedy operation.
bool RetrieveRangeAtIndex(int index, EntryType *entry,
- AddressType *entry_base, AddressType *entry_size)
- const;
+ AddressType *entry_base, AddressType *entry_delta,
+ AddressType *entry_size) const;
// Returns the number of ranges stored in the RangeMap.
int GetCount() const;
@@ -99,12 +126,19 @@ class RangeMap {
friend class ModuleComparer;
friend class RangeMapSerializer<AddressType, EntryType>;
+ // Same a StoreRange() with the only exception that the |delta| can be
+ // passed in.
+ bool StoreRangeInternal(const AddressType &base, const AddressType &delta,
+ const AddressType &size, const EntryType &entry);
+
class Range {
public:
- Range(const AddressType &base, const EntryType &entry)
- : base_(base), entry_(entry) {}
+ Range(const AddressType &base, const AddressType &delta,
+ const EntryType &entry)
+ : base_(base), delta_(delta), entry_(entry) {}
AddressType base() const { return base_; }
+ AddressType delta() const { return delta_; }
EntryType entry() const { return entry_; }
private:
@@ -112,6 +146,9 @@ class RangeMap {
// be stored, because RangeMap uses it as the key to the map.
const AddressType base_;
+ // The delta when the range is shrunk down.
+ const AddressType delta_;
+
// The entry corresponding to a range.
const EntryType entry_;
};
@@ -121,6 +158,8 @@ class RangeMap {
typedef typename AddressToRangeMap::const_iterator MapConstIterator;
typedef typename AddressToRangeMap::value_type MapValue;
+ MergeRangeStrategy merge_strategy_;
+
// Maps the high address of each range to a EntryType.
AddressToRangeMap map_;
};
diff --git a/src/processor/range_map_truncate_lower_unittest.cc b/src/processor/range_map_truncate_lower_unittest.cc
new file mode 100644
index 00000000..a933c956
--- /dev/null
+++ b/src/processor/range_map_truncate_lower_unittest.cc
@@ -0,0 +1,346 @@
+// Copyright (c) 2019, Google Inc.
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
+
+#include <limits.h>
+#include <stdio.h>
+
+#include "processor/range_map-inl.h"
+
+#include "breakpad_googletest_includes.h"
+#include "processor/linked_ptr.h"
+#include "processor/logging.h"
+
+namespace {
+
+using google_breakpad::linked_ptr;
+using google_breakpad::MergeRangeStrategy;
+using google_breakpad::RangeMap;
+
+// A CountedObject holds an int. A global (not thread safe!) count of
+// allocated CountedObjects is maintained to help test memory management.
+class CountedObject {
+ public:
+ explicit CountedObject(int id) : id_(id) { ++count_; }
+ ~CountedObject() { --count_; }
+
+ static int count() { return count_; }
+ int id() const { return id_; }
+
+ private:
+ static int count_;
+ int id_;
+};
+
+int CountedObject::count_;
+
+typedef int AddressType;
+typedef RangeMap<AddressType, linked_ptr<CountedObject>> TestMap;
+
+// Same range cannot be stored wice.
+TEST(RangeMapTruncateLower, SameRange) {
+ TestMap range_map;
+ range_map.SetMergeStrategy(MergeRangeStrategy::kTruncateLower);
+ linked_ptr<CountedObject> object_1(new CountedObject(1));
+ EXPECT_TRUE(
+ range_map.StoreRange(0 /* base address */, 100 /* size */, object_1));
+
+ // Same range cannot be stored wice.
+ linked_ptr<CountedObject> object_2(new CountedObject(2));
+ EXPECT_FALSE(
+ range_map.StoreRange(0 /* base address */, 100 /* size */, object_2));
+}
+
+// If a range is completely contained by another range, then the larger range
+// should be truncated.
+TEST(RangeMapTruncateLower, CompletelyContained) {
+ TestMap range_map;
+ range_map.SetMergeStrategy(MergeRangeStrategy::kTruncateLower);
+ // Larger range is added first.
+ linked_ptr<CountedObject> object_1(new CountedObject(1));
+ EXPECT_TRUE(
+ range_map.StoreRange(0 /* base address */, 100 /* size */, object_1));
+ // Smaller (contained) range is added second.
+ linked_ptr<CountedObject> object_2(new CountedObject(2));
+ EXPECT_TRUE(
+ range_map.StoreRange(10 /* base address */, 80 /* size */, object_2));
+ linked_ptr<CountedObject> object;
+ AddressType retrieved_base = AddressType();
+ AddressType retrieved_delta = AddressType();
+ AddressType retrieved_size = AddressType();
+ // The first range contains the second, so the first range should have been
+ // shrunk to [0, 10]. Range [90, 99] should be free.
+ EXPECT_FALSE(range_map.RetrieveRange(90, &object, &retrieved_base,
+ &retrieved_delta, &retrieved_size));
+ EXPECT_FALSE(range_map.RetrieveRange(99, &object, &retrieved_base,
+ &retrieved_delta, &retrieved_size));
+ EXPECT_TRUE(range_map.RetrieveRange(9, &object, &retrieved_base,
+ &retrieved_delta, &retrieved_size));
+ EXPECT_EQ(1, object->id());
+ EXPECT_EQ(0, retrieved_base);
+ EXPECT_EQ(0, retrieved_delta);
+ EXPECT_EQ(10, retrieved_size);
+ // Validate the properties of the smaller range (should be untouched).
+ EXPECT_TRUE(range_map.RetrieveRange(10, &object, &retrieved_base,
+ &retrieved_delta, &retrieved_size));
+ EXPECT_EQ(2, object->id());
+ EXPECT_EQ(10, retrieved_base);
+ EXPECT_EQ(0, retrieved_delta);
+ EXPECT_EQ(80, retrieved_size);
+}
+
+// Same as the previous test, however the larger range is added second.
+TEST(RangeMapTruncateLower, CompletelyContained_LargerAddedSecond) {
+ TestMap range_map;
+ range_map.SetMergeStrategy(MergeRangeStrategy::kTruncateLower);
+ // Smaller (contained) range is added first.
+ linked_ptr<CountedObject> object_1(new CountedObject(1));
+ EXPECT_TRUE(
+ range_map.StoreRange(10 /* base address */, 80 /* size */, object_1));
+ // Larger range is added second.
+ linked_ptr<CountedObject> object_2(new CountedObject(2));
+ EXPECT_TRUE(
+ range_map.StoreRange(0 /* base address */, 100 /* size */, object_2));
+ linked_ptr<CountedObject> object;
+ AddressType retrieved_base = AddressType();
+ AddressType retrieved_delta = AddressType();
+ AddressType retrieved_size = AddressType();
+ // The second range contains the first, so the second range should have been
+ // truncated to [0, 9]. Range [90, 99] should be free.
+ EXPECT_FALSE(range_map.RetrieveRange(90, &object, &retrieved_base,
+ &retrieved_delta, &retrieved_size));
+ EXPECT_FALSE(range_map.RetrieveRange(99, &object, &retrieved_base,
+ &retrieved_delta, &retrieved_size));
+ EXPECT_TRUE(range_map.RetrieveRange(9, &object, &retrieved_base,
+ &retrieved_delta, &retrieved_size));
+ EXPECT_EQ(2, object->id());
+ EXPECT_EQ(0, retrieved_base);
+ EXPECT_EQ(0, retrieved_delta);
+ EXPECT_EQ(10, retrieved_size);
+ // Validate the properties of the smaller range (should be untouched).
+ EXPECT_TRUE(range_map.RetrieveRange(10, &object, &retrieved_base,
+ &retrieved_delta, &retrieved_size));
+ EXPECT_EQ(1, object->id());
+ EXPECT_EQ(10, retrieved_base);
+ EXPECT_EQ(0, retrieved_delta);
+ EXPECT_EQ(80, retrieved_size);
+}
+
+TEST(RangeMapTruncateLower, PartialOverlap_AtBeginning) {
+ TestMap range_map;
+ range_map.SetMergeStrategy(MergeRangeStrategy::kTruncateLower);
+ linked_ptr<CountedObject> object_1(new CountedObject(1));
+ EXPECT_TRUE(
+ range_map.StoreRange(0 /* base address */, 100 /* size */, object_1));
+
+ // Partial overlap at the beginning of the new range.
+ linked_ptr<CountedObject> object_2(new CountedObject(2));
+ EXPECT_TRUE(
+ range_map.StoreRange(90 /* base address */, 110 /* size */, object_2));
+
+ linked_ptr<CountedObject> object;
+ AddressType retrieved_base = AddressType();
+ AddressType retrieved_delta = AddressType();
+ AddressType retrieved_size = AddressType();
+ // The first range should be truncated, so 99 should address the second range.
+ EXPECT_TRUE(range_map.RetrieveRange(99, &object, &retrieved_base,
+ &retrieved_delta, &retrieved_size));
+ EXPECT_EQ(2, object->id());
+ EXPECT_EQ(90, retrieved_base);
+ EXPECT_EQ(0, retrieved_delta);
+ EXPECT_EQ(110, retrieved_size);
+ // Validate the properties of the truncated range.
+ EXPECT_TRUE(range_map.RetrieveRange(89, &object, &retrieved_base,
+ &retrieved_delta, &retrieved_size));
+ EXPECT_EQ(1, object->id());
+ EXPECT_EQ(0, retrieved_base);
+ EXPECT_EQ(0, retrieved_delta);
+ EXPECT_EQ(90, retrieved_size);
+}
+
+TEST(RangeMapTruncateLower, PartialOverlap_AtEnd) {
+ TestMap range_map;
+ range_map.SetMergeStrategy(MergeRangeStrategy::kTruncateLower);
+ linked_ptr<CountedObject> object_1(new CountedObject(1));
+ EXPECT_TRUE(
+ range_map.StoreRange(50 /* base address */, 50 /* size */, object_1));
+
+ // Partial overlap at the end of the new range.
+ linked_ptr<CountedObject> object_2(new CountedObject(2));
+ EXPECT_TRUE(
+ range_map.StoreRange(0 /* base address */, 70 /* size */, object_2));
+
+ linked_ptr<CountedObject> object;
+ AddressType retrieved_base = AddressType();
+ AddressType retrieved_delta = AddressType();
+ AddressType retrieved_size = AddressType();
+ // The second range should be truncated so 69 addresses the first range.
+ EXPECT_TRUE(range_map.RetrieveRange(69, &object, &retrieved_base,
+ &retrieved_delta, &retrieved_size));
+ EXPECT_EQ(1, object->id());
+ EXPECT_EQ(50, retrieved_base);
+ EXPECT_EQ(0, retrieved_delta);
+ EXPECT_EQ(50, retrieved_size);
+ // Validate the properties of the truncated range.
+ EXPECT_TRUE(range_map.RetrieveRange(49, &object, &retrieved_base,
+ &retrieved_delta, &retrieved_size));
+ EXPECT_EQ(2, object->id());
+ EXPECT_EQ(0, retrieved_base);
+ EXPECT_EQ(0, retrieved_delta);
+ EXPECT_EQ(50, retrieved_size);
+}
+
+// A new range is overlapped at both ends. The new range and the range
+// that overlaps at the beginning should be truncated. The range that overlaps
+// at the end should be left untouched.
+TEST(RangeMapTruncateLower, OverlapAtBothEnds) {
+ TestMap range_map;
+ range_map.SetMergeStrategy(MergeRangeStrategy::kTruncateLower);
+ // This should overlap object_3 at the beginning.
+ linked_ptr<CountedObject> object_1(new CountedObject(1));
+ EXPECT_TRUE(
+ range_map.StoreRange(0 /* base address */, 100 /* size */, object_1));
+
+ // This should overlap object_3 at the end.
+ linked_ptr<CountedObject> object_2(new CountedObject(2));
+ EXPECT_TRUE(
+ range_map.StoreRange(100 /* base address */, 100 /* size */, object_2));
+
+ // This should be overlapped on both ends by object_1 and object_2.
+ linked_ptr<CountedObject> object_3(new CountedObject(3));
+ EXPECT_TRUE(
+ range_map.StoreRange(50 /* base address */, 100 /* size */, object_3));
+
+ linked_ptr<CountedObject> object;
+ AddressType retrieved_base = AddressType();
+ AddressType retrieved_delta = AddressType();
+ AddressType retrieved_size = AddressType();
+ // The first range should be truncated.
+ EXPECT_TRUE(range_map.RetrieveRange(0, &object, &retrieved_base,
+ &retrieved_delta, &retrieved_size));
+ EXPECT_EQ(1, object->id());
+ EXPECT_EQ(0, retrieved_base);
+ EXPECT_EQ(0, retrieved_delta);
+ EXPECT_EQ(50, retrieved_size);
+ // The second range should be intact.
+ EXPECT_TRUE(range_map.RetrieveRange(150, &object, &retrieved_base,
+ &retrieved_delta, &retrieved_size));
+ EXPECT_EQ(2, object->id());
+ EXPECT_EQ(100, retrieved_base);
+ EXPECT_EQ(0, retrieved_delta);
+ EXPECT_EQ(100, retrieved_size);
+ // The third range (in the middle) should be truncated.
+ EXPECT_TRUE(range_map.RetrieveRange(99, &object, &retrieved_base,
+ &retrieved_delta, &retrieved_size));
+ EXPECT_EQ(3, object->id());
+ EXPECT_EQ(50, retrieved_base);
+ EXPECT_EQ(0, retrieved_delta);
+ EXPECT_EQ(50, retrieved_size);
+}
+
+TEST(RangeMapTruncateLower, MultipleConflicts) {
+ TestMap range_map;
+ range_map.SetMergeStrategy(MergeRangeStrategy::kTruncateLower);
+ // This should overlap with object_3.
+ linked_ptr<CountedObject> object_1(new CountedObject(1));
+ EXPECT_TRUE(
+ range_map.StoreRange(10 /* base address */, 90 /* size */, object_1));
+
+ // This should also overlap with object_3 but after object_1.
+ linked_ptr<CountedObject> object_2(new CountedObject(2));
+ EXPECT_TRUE(
+ range_map.StoreRange(100 /* base address */, 100 /* size */, object_2));
+
+ // This should be overlapped on both object_1 and object_2.
+ linked_ptr<CountedObject> object_3(new CountedObject(3));
+ EXPECT_TRUE(
+ range_map.StoreRange(0 /* base address */, 300 /* size */, object_3));
+
+ linked_ptr<CountedObject> object;
+ AddressType retrieved_base = AddressType();
+ AddressType retrieved_delta = AddressType();
+ AddressType retrieved_size = AddressType();
+ // The first range should be intact.
+ EXPECT_TRUE(range_map.RetrieveRange(99, &object, &retrieved_base,
+ &retrieved_delta, &retrieved_size));
+ EXPECT_EQ(1, object->id());
+ EXPECT_EQ(10, retrieved_base);
+ EXPECT_EQ(0, retrieved_delta);
+ EXPECT_EQ(90, retrieved_size);
+ // The second range should be intact.
+ EXPECT_TRUE(range_map.RetrieveRange(199, &object, &retrieved_base,
+ &retrieved_delta, &retrieved_size));
+ EXPECT_EQ(2, object->id());
+ EXPECT_EQ(100, retrieved_base);
+ EXPECT_EQ(0, retrieved_delta);
+ EXPECT_EQ(100, retrieved_size);
+ // The third range should be truncated.
+ EXPECT_TRUE(range_map.RetrieveRange(9, &object, &retrieved_base,
+ &retrieved_delta, &retrieved_size));
+ EXPECT_EQ(3, object->id());
+ EXPECT_EQ(0, retrieved_base);
+ EXPECT_EQ(0, retrieved_delta);
+ EXPECT_EQ(10, retrieved_size);
+}
+
+// Adding two ranges without overlap should succeed and the ranges should
+// be left intact.
+TEST(RangeMapTruncateLower, NoConflicts) {
+ TestMap range_map;
+ range_map.SetMergeStrategy(MergeRangeStrategy::kTruncateLower);
+ // Adding range 1.
+ linked_ptr<CountedObject> object_1(new CountedObject(1));
+ EXPECT_TRUE(
+ range_map.StoreRange(10 /* base address */, 90 /* size */, object_1));
+
+ // Adding range 2 - no overlap with range 1.
+ linked_ptr<CountedObject> object_2(new CountedObject(2));
+ EXPECT_TRUE(
+ range_map.StoreRange(110 /* base address */, 90 /* size */, object_2));
+
+ linked_ptr<CountedObject> object;
+ AddressType retrieved_base = AddressType();
+ AddressType retrieved_delta = AddressType();
+ AddressType retrieved_size = AddressType();
+ // The first range should be intact.
+ EXPECT_TRUE(range_map.RetrieveRange(99, &object, &retrieved_base,
+ &retrieved_delta, &retrieved_size));
+ EXPECT_EQ(1, object->id());
+ EXPECT_EQ(10, retrieved_base);
+ EXPECT_EQ(0, retrieved_delta);
+ EXPECT_EQ(90, retrieved_size);
+ // The second range should be intact.
+ EXPECT_TRUE(range_map.RetrieveRange(199, &object, &retrieved_base,
+ &retrieved_delta, &retrieved_size));
+ EXPECT_EQ(2, object->id());
+ EXPECT_EQ(110, retrieved_base);
+ EXPECT_EQ(0, retrieved_delta);
+ EXPECT_EQ(90, retrieved_size);
+}
+
+} // namespace
diff --git a/src/processor/range_map_truncate_upper_unittest.cc b/src/processor/range_map_truncate_upper_unittest.cc
new file mode 100644
index 00000000..7e3034f2
--- /dev/null
+++ b/src/processor/range_map_truncate_upper_unittest.cc
@@ -0,0 +1,354 @@
+// Copyright (c) 2016, Google Inc.
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
+
+// range_map_shrink_down_unittest.cc: Unit tests for RangeMap that specifically
+// test shrink down when ranges overlap.
+//
+// Author: Ivan Penkov
+
+#include <limits.h>
+#include <stdio.h>
+
+#include "processor/range_map-inl.h"
+
+#include "breakpad_googletest_includes.h"
+#include "processor/linked_ptr.h"
+#include "processor/logging.h"
+
+namespace {
+
+using google_breakpad::linked_ptr;
+using google_breakpad::MergeRangeStrategy;
+using google_breakpad::RangeMap;
+
+// A CountedObject holds an int. A global (not thread safe!) count of
+// allocated CountedObjects is maintained to help test memory management.
+class CountedObject {
+ public:
+ explicit CountedObject(int id) : id_(id) { ++count_; }
+ ~CountedObject() { --count_; }
+
+ static int count() { return count_; }
+ int id() const { return id_; }
+
+ private:
+ static int count_;
+ int id_;
+};
+
+int CountedObject::count_;
+
+typedef int AddressType;
+typedef RangeMap<AddressType, linked_ptr<CountedObject>> TestMap;
+
+// Same range cannot be stored wice.
+TEST(RangeMapTruncateUpper, SameRange) {
+ TestMap range_map;
+ range_map.SetMergeStrategy(MergeRangeStrategy::kTruncateUpper);
+ linked_ptr<CountedObject> object_1(new CountedObject(1));
+ EXPECT_TRUE(range_map.StoreRange(0 /* base address */, 100 /* size */,
+ object_1));
+
+ // Same range cannot be stored wice.
+ linked_ptr<CountedObject> object_2(new CountedObject(2));
+ EXPECT_FALSE(range_map.StoreRange(0 /* base address */, 100 /* size */,
+ object_2));
+}
+
+// If a range is completely contained by another range, then the larger range
+// should be shrinked down.
+TEST(RangeMapTruncateUpper, CompletelyContained) {
+ TestMap range_map;
+ range_map.SetMergeStrategy(MergeRangeStrategy::kTruncateUpper);
+ // Larger range is added first.
+ linked_ptr<CountedObject> object_1(new CountedObject(1));
+ EXPECT_TRUE(range_map.StoreRange(0 /* base address */, 100 /* size */,
+ object_1));
+ // Smaller (contained) range is added second.
+ linked_ptr<CountedObject> object_2(new CountedObject(2));
+ EXPECT_TRUE(range_map.StoreRange(10 /* base address */, 80 /* size */,
+ object_2));
+ linked_ptr<CountedObject> object;
+ AddressType retrieved_base = AddressType();
+ AddressType retrieved_delta = AddressType();
+ AddressType retrieved_size = AddressType();
+ // The first range contains the second, so the first range should have been
+ // shrunk to [90, 99]. Range [0, 9] should be free.
+ EXPECT_FALSE(range_map.RetrieveRange(0, &object, &retrieved_base,
+ &retrieved_delta, &retrieved_size));
+ EXPECT_FALSE(range_map.RetrieveRange(9, &object, &retrieved_base,
+ &retrieved_delta, &retrieved_size));
+ EXPECT_TRUE(range_map.RetrieveRange(90, &object, &retrieved_base,
+ &retrieved_delta, &retrieved_size));
+ EXPECT_EQ(1, object->id());
+ EXPECT_EQ(90, retrieved_base);
+ EXPECT_EQ(90, retrieved_delta);
+ EXPECT_EQ(10, retrieved_size);
+ // Validate the properties of the smaller range (should be untouched).
+ EXPECT_TRUE(range_map.RetrieveRange(10, &object, &retrieved_base,
+ &retrieved_delta, &retrieved_size));
+ EXPECT_EQ(2, object->id());
+ EXPECT_EQ(10, retrieved_base);
+ EXPECT_EQ(0, retrieved_delta);
+ EXPECT_EQ(80, retrieved_size);
+}
+
+// Same as the previous test, however the larger range is added second.
+TEST(RangeMapTruncateUpper, CompletelyContained_LargerAddedSecond) {
+ TestMap range_map;
+ range_map.SetMergeStrategy(MergeRangeStrategy::kTruncateUpper);
+ // Smaller (contained) range is added first.
+ linked_ptr<CountedObject> object_1(new CountedObject(1));
+ EXPECT_TRUE(range_map.StoreRange(10 /* base address */, 80 /* size */,
+ object_1));
+ // Larger range is added second.
+ linked_ptr<CountedObject> object_2(new CountedObject(2));
+ EXPECT_TRUE(range_map.StoreRange(0 /* base address */, 100 /* size */,
+ object_2));
+ linked_ptr<CountedObject> object;
+ AddressType retrieved_base = AddressType();
+ AddressType retrieved_delta = AddressType();
+ AddressType retrieved_size = AddressType();
+ // The second range contains the first, so the second range should have been
+ // shrunk to [90, 99]. Range [0, 9] should be free.
+ EXPECT_FALSE(range_map.RetrieveRange(0, &object, &retrieved_base,
+ &retrieved_delta, &retrieved_size));
+ EXPECT_FALSE(range_map.RetrieveRange(9, &object, &retrieved_base,
+ &retrieved_delta, &retrieved_size));
+ EXPECT_TRUE(range_map.RetrieveRange(90, &object, &retrieved_base,
+ &retrieved_delta, &retrieved_size));
+ EXPECT_EQ(2, object->id());
+ EXPECT_EQ(90, retrieved_base);
+ EXPECT_EQ(90, retrieved_delta);
+ EXPECT_EQ(10, retrieved_size);
+ // Validate the properties of the smaller range (should be untouched).
+ EXPECT_TRUE(range_map.RetrieveRange(10, &object, &retrieved_base,
+ &retrieved_delta, &retrieved_size));
+ EXPECT_EQ(1, object->id());
+ EXPECT_EQ(10, retrieved_base);
+ EXPECT_EQ(0, retrieved_delta);
+ EXPECT_EQ(80, retrieved_size);
+}
+
+TEST(RangeMapTruncateUpper, PartialOverlap_AtBeginning) {
+ TestMap range_map;
+ range_map.SetMergeStrategy(MergeRangeStrategy::kTruncateUpper);
+ linked_ptr<CountedObject> object_1(new CountedObject(1));
+ EXPECT_TRUE(range_map.StoreRange(0 /* base address */, 100 /* size */,
+ object_1));
+
+ // Partial overlap at the beginning of the new range.
+ linked_ptr<CountedObject> object_2(new CountedObject(2));
+ EXPECT_TRUE(range_map.StoreRange(90 /* base address */, 110 /* size */,
+ object_2));
+
+ linked_ptr<CountedObject> object;
+ AddressType retrieved_base = AddressType();
+ AddressType retrieved_delta = AddressType();
+ AddressType retrieved_size = AddressType();
+ // The second range is supposed to be shrunk down so the following address
+ // should resize in the first range.
+ EXPECT_TRUE(range_map.RetrieveRange(99, &object, &retrieved_base,
+ &retrieved_delta, &retrieved_size));
+ EXPECT_EQ(1, object->id());
+ EXPECT_EQ(0, retrieved_base);
+ EXPECT_EQ(0, retrieved_delta);
+ EXPECT_EQ(100, retrieved_size);
+ // Validate the properties of the shrunk down range.
+ EXPECT_TRUE(range_map.RetrieveRange(100, &object, &retrieved_base,
+ &retrieved_delta, &retrieved_size));
+ EXPECT_EQ(2, object->id());
+ EXPECT_EQ(100, retrieved_base);
+ EXPECT_EQ(10, retrieved_delta);
+ EXPECT_EQ(100, retrieved_size);
+}
+
+TEST(RangeMapTruncateUpper, PartialOverlap_AtEnd) {
+ TestMap range_map;
+ range_map.SetMergeStrategy(MergeRangeStrategy::kTruncateUpper);
+ linked_ptr<CountedObject> object_1(new CountedObject(1));
+ EXPECT_TRUE(range_map.StoreRange(50 /* base address */, 50 /* size */,
+ object_1));
+
+ // Partial overlap at the end of the new range.
+ linked_ptr<CountedObject> object_2(new CountedObject(2));
+ EXPECT_TRUE(range_map.StoreRange(0 /* base address */, 70 /* size */,
+ object_2));
+
+ linked_ptr<CountedObject> object;
+ AddressType retrieved_base = AddressType();
+ AddressType retrieved_delta = AddressType();
+ AddressType retrieved_size = AddressType();
+ // The first range is supposed to be shrunk down so the following address
+ // should resize in the first range.
+ EXPECT_TRUE(range_map.RetrieveRange(69, &object, &retrieved_base,
+ &retrieved_delta, &retrieved_size));
+ EXPECT_EQ(2, object->id());
+ EXPECT_EQ(0, retrieved_base);
+ EXPECT_EQ(0, retrieved_delta);
+ EXPECT_EQ(70, retrieved_size);
+ // Validate the properties of the shrunk down range.
+ EXPECT_TRUE(range_map.RetrieveRange(70, &object, &retrieved_base,
+ &retrieved_delta, &retrieved_size));
+ EXPECT_EQ(1, object->id());
+ EXPECT_EQ(70, retrieved_base);
+ EXPECT_EQ(20, retrieved_delta);
+ EXPECT_EQ(30, retrieved_size);
+}
+
+// A new range is overlapped at both ends. The new range and the range
+// that overlaps at the end should be shrink. The range that overlaps at the
+// beginning should be left untouched.
+TEST(RangeMapTruncateUpper, OverlapAtBothEnds) {
+ TestMap range_map;
+ range_map.SetMergeStrategy(MergeRangeStrategy::kTruncateUpper);
+ // This should overlap object_3 at the beginning.
+ linked_ptr<CountedObject> object_1(new CountedObject(1));
+ EXPECT_TRUE(range_map.StoreRange(0 /* base address */, 100 /* size */,
+ object_1));
+
+ // This should overlap object_3 at the end.
+ linked_ptr<CountedObject> object_2(new CountedObject(2));
+ EXPECT_TRUE(range_map.StoreRange(100 /* base address */, 100 /* size */,
+ object_2));
+
+ // This should be overlapped on both ends by object_1 and object_2.
+ linked_ptr<CountedObject> object_3(new CountedObject(3));
+ EXPECT_TRUE(range_map.StoreRange(50 /* base address */, 100 /* size */,
+ object_3));
+
+ linked_ptr<CountedObject> object;
+ AddressType retrieved_base = AddressType();
+ AddressType retrieved_delta = AddressType();
+ AddressType retrieved_size = AddressType();
+ // The first range should be intact.
+ EXPECT_TRUE(range_map.RetrieveRange(0, &object, &retrieved_base,
+ &retrieved_delta, &retrieved_size));
+ EXPECT_EQ(1, object->id());
+ EXPECT_EQ(0, retrieved_base);
+ EXPECT_EQ(0, retrieved_delta);
+ EXPECT_EQ(100, retrieved_size);
+ // The second range should be shrunk down by 50.
+ EXPECT_TRUE(range_map.RetrieveRange(150, &object, &retrieved_base,
+ &retrieved_delta, &retrieved_size));
+ EXPECT_EQ(2, object->id());
+ EXPECT_EQ(150, retrieved_base);
+ EXPECT_EQ(50, retrieved_delta);
+ EXPECT_EQ(50, retrieved_size);
+ // The third range (in the middle) should be shrunk down by 50.
+ EXPECT_TRUE(range_map.RetrieveRange(100, &object, &retrieved_base,
+ &retrieved_delta, &retrieved_size));
+ EXPECT_EQ(3, object->id());
+ EXPECT_EQ(100, retrieved_base);
+ EXPECT_EQ(50, retrieved_delta);
+ EXPECT_EQ(50, retrieved_size);
+}
+
+TEST(RangeMapTruncateUpper, MultipleConflicts) {
+ TestMap range_map;
+ range_map.SetMergeStrategy(MergeRangeStrategy::kTruncateUpper);
+ // This should overlap with object_3.
+ linked_ptr<CountedObject> object_1(new CountedObject(1));
+ EXPECT_TRUE(range_map.StoreRange(10 /* base address */, 90 /* size */,
+ object_1));
+
+ // This should also overlap with object_3 but after object_1.
+ linked_ptr<CountedObject> object_2(new CountedObject(2));
+ EXPECT_TRUE(range_map.StoreRange(100 /* base address */, 100 /* size */,
+ object_2));
+
+ // This should be overlapped on both object_1 and object_2. Since
+ // object_3 ends with the higher address it must be shrunk.
+ linked_ptr<CountedObject> object_3(new CountedObject(3));
+ EXPECT_TRUE(range_map.StoreRange(0 /* base address */, 300 /* size */,
+ object_3));
+
+ linked_ptr<CountedObject> object;
+ AddressType retrieved_base = AddressType();
+ AddressType retrieved_delta = AddressType();
+ AddressType retrieved_size = AddressType();
+ // The first range should be intact.
+ EXPECT_TRUE(range_map.RetrieveRange(99, &object, &retrieved_base,
+ &retrieved_delta, &retrieved_size));
+ EXPECT_EQ(1, object->id());
+ EXPECT_EQ(10, retrieved_base);
+ EXPECT_EQ(0, retrieved_delta);
+ EXPECT_EQ(90, retrieved_size);
+ // The second range should be intact.
+ EXPECT_TRUE(range_map.RetrieveRange(199, &object, &retrieved_base,
+ &retrieved_delta, &retrieved_size));
+ EXPECT_EQ(2, object->id());
+ EXPECT_EQ(100, retrieved_base);
+ EXPECT_EQ(0, retrieved_delta);
+ EXPECT_EQ(100, retrieved_size);
+ // The third range should be shrunk down by 200.
+ EXPECT_TRUE(range_map.RetrieveRange(299, &object, &retrieved_base,
+ &retrieved_delta, &retrieved_size));
+ EXPECT_EQ(3, object->id());
+ EXPECT_EQ(200, retrieved_base);
+ EXPECT_EQ(200, retrieved_delta);
+ EXPECT_EQ(100, retrieved_size);
+}
+
+// Adding two ranges without overlap should succeed and the ranges should
+// be left intact.
+TEST(RangeMapTruncateUpper, NoConflicts) {
+ TestMap range_map;
+ range_map.SetMergeStrategy(MergeRangeStrategy::kTruncateUpper);
+ // Adding range 1.
+ linked_ptr<CountedObject> object_1(new CountedObject(1));
+ EXPECT_TRUE(range_map.StoreRange(10 /* base address */, 90 /* size */,
+ object_1));
+
+ // Adding range 2 - no overlap with range 1.
+ linked_ptr<CountedObject> object_2(new CountedObject(2));
+ EXPECT_TRUE(range_map.StoreRange(110 /* base address */, 90 /* size */,
+ object_2));
+
+ linked_ptr<CountedObject> object;
+ AddressType retrieved_base = AddressType();
+ AddressType retrieved_delta = AddressType();
+ AddressType retrieved_size = AddressType();
+ // The first range should be intact.
+ EXPECT_TRUE(range_map.RetrieveRange(99, &object, &retrieved_base,
+ &retrieved_delta, &retrieved_size));
+ EXPECT_EQ(1, object->id());
+ EXPECT_EQ(10, retrieved_base);
+ EXPECT_EQ(0, retrieved_delta);
+ EXPECT_EQ(90, retrieved_size);
+ // The second range should be intact.
+ EXPECT_TRUE(range_map.RetrieveRange(199, &object, &retrieved_base,
+ &retrieved_delta, &retrieved_size));
+ EXPECT_EQ(2, object->id());
+ EXPECT_EQ(110, retrieved_base);
+ EXPECT_EQ(0, retrieved_delta);
+ EXPECT_EQ(90, retrieved_size);
+}
+
+} // namespace
diff --git a/src/processor/range_map_unittest.cc b/src/processor/range_map_unittest.cc
index bf9b7279..31b89e5d 100644
--- a/src/processor/range_map_unittest.cc
+++ b/src/processor/range_map_unittest.cc
@@ -166,8 +166,10 @@ static bool RetrieveTest(TestMap *range_map, const RangeTest *range_test) {
linked_ptr<CountedObject> object;
AddressType retrieved_base = AddressType();
AddressType retrieved_size = AddressType();
+ AddressType retrieved_delta = AddressType();
bool retrieved = range_map->RetrieveRange(address, &object,
&retrieved_base,
+ &retrieved_delta,
&retrieved_size);
bool observed_result = retrieved && object->id() == range_test->id;
@@ -209,10 +211,12 @@ static bool RetrieveTest(TestMap *range_map, const RangeTest *range_test) {
linked_ptr<CountedObject> nearest_object;
AddressType nearest_base = AddressType();
+ AddressType nearest_delta = AddressType();
AddressType nearest_size = AddressType();
bool retrieved_nearest = range_map->RetrieveNearestRange(address,
&nearest_object,
&nearest_base,
+ &nearest_delta,
&nearest_size);
// When checking one greater than the high side, RetrieveNearestRange
@@ -274,7 +278,8 @@ static bool RetrieveIndexTest(TestMap *range_map, int set) {
int object_count = range_map->GetCount();
for (int object_index = 0; object_index < object_count; ++object_index) {
AddressType base;
- if (!range_map->RetrieveRangeAtIndex(object_index, &object, &base, NULL)) {
+ if (!range_map->RetrieveRangeAtIndex(object_index, &object, &base,
+ NULL /* delta */, NULL /* size */)) {
fprintf(stderr, "FAILED: RetrieveRangeAtIndex set %d index %d, "
"expected success, observed failure\n",
set, object_index);
@@ -314,7 +319,8 @@ static bool RetrieveIndexTest(TestMap *range_map, int set) {
// Make sure that RetrieveRangeAtIndex doesn't allow lookups at indices that
// are too high.
- if (range_map->RetrieveRangeAtIndex(object_count, &object, NULL, NULL)) {
+ if (range_map->RetrieveRangeAtIndex(object_count, &object, NULL /* base */,
+ NULL /* delta */, NULL /* size */)) {
fprintf(stderr, "FAILED: RetrieveRangeAtIndex set %d index %d (too large), "
"expected failure, observed success\n",
set, object_count);
@@ -343,7 +349,8 @@ static bool RetriveAtIndexTest2() {
int object_count = range_map->GetCount();
for (int object_index = 0; object_index < object_count; ++object_index) {
AddressType base;
- if (!range_map->RetrieveRangeAtIndex(object_index, &object, &base, NULL)) {
+ if (!range_map->RetrieveRangeAtIndex(object_index, &object, &base,
+ NULL /* delta */, NULL /* size */)) {
fprintf(stderr, "FAILED: RetrieveAtIndexTest2 index %d, "
"expected success, observed failure\n", object_index);
return false;
diff --git a/src/processor/source_line_resolver_base_types.h b/src/processor/source_line_resolver_base_types.h
index 4a9dfb3c..ca744e00 100644
--- a/src/processor/source_line_resolver_base_types.h
+++ b/src/processor/source_line_resolver_base_types.h
@@ -85,9 +85,10 @@ struct SourceLineResolverBase::Function {
Function(const string &function_name,
MemAddr function_address,
MemAddr code_size,
- int set_parameter_size)
+ int set_parameter_size,
+ bool is_multiple)
: name(function_name), address(function_address), size(code_size),
- parameter_size(set_parameter_size) { }
+ parameter_size(set_parameter_size), is_multiple(is_multiple) { }
string name;
MemAddr address;
@@ -95,16 +96,21 @@ struct SourceLineResolverBase::Function {
// The size of parameters passed to this function on the stack.
int32_t parameter_size;
+
+ // If the function's instructions correspond to multiple symbols.
+ bool is_multiple;
};
struct SourceLineResolverBase::PublicSymbol {
PublicSymbol() { }
PublicSymbol(const string& set_name,
MemAddr set_address,
- int set_parameter_size)
+ int set_parameter_size,
+ bool is_multiple)
: name(set_name),
address(set_address),
- parameter_size(set_parameter_size) {}
+ parameter_size(set_parameter_size),
+ is_multiple(is_multiple) {}
string name;
MemAddr address;
@@ -113,6 +119,9 @@ struct SourceLineResolverBase::PublicSymbol {
// is set to the size of the parameters passed to the funciton on the
// stack, if known.
int32_t parameter_size;
+
+ // If the function's instructions correspond to multiple symbols.
+ bool is_multiple;
};
class SourceLineResolverBase::Module {
diff --git a/src/processor/stack_frame_symbolizer.cc b/src/processor/stack_frame_symbolizer.cc
index 5c8dbe5e..7a44f243 100644
--- a/src/processor/stack_frame_symbolizer.cc
+++ b/src/processor/stack_frame_symbolizer.cc
@@ -55,12 +55,19 @@ StackFrameSymbolizer::StackFrameSymbolizer(
StackFrameSymbolizer::SymbolizerResult StackFrameSymbolizer::FillSourceLineInfo(
const CodeModules* modules,
+ const CodeModules* unloaded_modules,
const SystemInfo* system_info,
StackFrame* frame) {
assert(frame);
- if (!modules) return kError;
- const CodeModule* module = modules->GetModuleForAddress(frame->instruction);
+ const CodeModule* module = NULL;
+ if (modules) {
+ module = modules->GetModuleForAddress(frame->instruction);
+ }
+ if (!module && unloaded_modules) {
+ module = unloaded_modules->GetModuleForAddress(frame->instruction);
+ }
+
if (!module) return kError;
frame->module = module;
diff --git a/src/processor/stackwalk_common.cc b/src/processor/stackwalk_common.cc
index 3a6e17fe..704039f3 100644
--- a/src/processor/stackwalk_common.cc
+++ b/src/processor/stackwalk_common.cc
@@ -35,13 +35,13 @@
#include "processor/stackwalk_common.h"
#include <assert.h>
-#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <vector>
+#include "common/stdio_wrapper.h"
#include "common/using_std_string.h"
#include "google_breakpad/processor/call_stack.h"
#include "google_breakpad/processor/code_module.h"
@@ -112,10 +112,10 @@ static string StripSeparator(const string &original) {
}
// PrintStackContents prints the stack contents of the current frame to stdout.
-static void PrintStackContents(const std::string &indent,
+static void PrintStackContents(const string &indent,
const StackFrame *frame,
const StackFrame *prev_frame,
- const std::string &cpu,
+ const string &cpu,
const MemoryRegion *memory,
const CodeModules* modules,
SourceLineResolverInterface *resolver) {
@@ -181,7 +181,7 @@ static void PrintStackContents(const std::string &indent,
// Print data in hex.
const int kBytesPerRow = 16;
- std::string data_as_string;
+ string data_as_string;
for (int i = 0; i < kBytesPerRow; ++i, ++address) {
uint8_t value = 0;
if (address < stack_end &&
@@ -546,7 +546,7 @@ static void PrintStack(const CallStack *stack,
sequence =
PrintRegister64("pc", frame_arm64->context.iregs[32], sequence);
}
- } else if (cpu == "mips") {
+ } else if ((cpu == "mips") || (cpu == "mips64")) {
const StackFrameMIPS* frame_mips =
reinterpret_cast<const StackFrameMIPS*>(frame);
@@ -607,7 +607,7 @@ static void PrintStack(const CallStack *stack,
// Print stack contents.
if (output_stack_contents && frame_index + 1 < frame_count) {
- const std::string indent(" ");
+ const string indent(" ");
PrintStackContents(indent, frame, stack->frames()->at(frame_index + 1),
cpu, memory, modules, resolver);
}
@@ -803,6 +803,20 @@ void PrintProcessState(const ProcessState& process_state,
process_state.system_info()->cpu_count != 1 ? "s" : "");
printf("\n");
+ // Print GPU information
+ string gl_version = process_state.system_info()->gl_version;
+ string gl_vendor = process_state.system_info()->gl_vendor;
+ string gl_renderer = process_state.system_info()->gl_renderer;
+ printf("GPU:");
+ if (!gl_version.empty() || !gl_vendor.empty() || !gl_renderer.empty()) {
+ printf(" %s\n", gl_version.c_str());
+ printf(" %s\n", gl_vendor.c_str());
+ printf(" %s\n", gl_renderer.c_str());
+ } else {
+ printf(" UNKNOWN\n");
+ }
+ printf("\n");
+
// Print crash information.
if (process_state.crashed()) {
printf("Crash reason: %s\n", process_state.crash_reason().c_str());
@@ -865,6 +879,7 @@ void PrintProcessStateMachineReadable(const ProcessState& process_state) {
// Print OS and CPU information.
// OS|{OS Name}|{OS Version}
// CPU|{CPU Name}|{CPU Info}|{Number of CPUs}
+ // GPU|{GPU version}|{GPU vendor}|{GPU renderer}
printf("OS%c%s%c%s\n", kOutputSeparator,
StripSeparator(process_state.system_info()->os).c_str(),
kOutputSeparator,
@@ -876,6 +891,12 @@ void PrintProcessStateMachineReadable(const ProcessState& process_state) {
StripSeparator(process_state.system_info()->cpu_info).c_str(),
kOutputSeparator,
process_state.system_info()->cpu_count);
+ printf("GPU%c%s%c%s%c%s\n", kOutputSeparator,
+ StripSeparator(process_state.system_info()->gl_version).c_str(),
+ kOutputSeparator,
+ StripSeparator(process_state.system_info()->gl_vendor).c_str(),
+ kOutputSeparator,
+ StripSeparator(process_state.system_info()->gl_renderer).c_str());
int requesting_thread = process_state.requesting_thread();
diff --git a/src/processor/stackwalker.cc b/src/processor/stackwalker.cc
index 424cf4c4..4988ef1e 100644
--- a/src/processor/stackwalker.cc
+++ b/src/processor/stackwalker.cc
@@ -58,12 +58,17 @@
namespace google_breakpad {
-const int Stackwalker::kRASearchWords = 30;
-
-uint32_t Stackwalker::max_frames_ = 1024;
+const int Stackwalker::kRASearchWords = 40;
+
+// This default is just a sanity check: a large enough value
+// that allow capturing unbounded recursion traces, yet provide a
+// guardrail against stack walking bugs. The stack walking invariants
+// guarantee that the unwinding process is strictly monotonic and
+// practically bounded by the size of the stack memory range.
+uint32_t Stackwalker::max_frames_ = 1 << 20; // 1M
bool Stackwalker::max_frames_set_ = false;
-uint32_t Stackwalker::max_frames_scanned_ = 1024;
+uint32_t Stackwalker::max_frames_scanned_ = 1 << 14; // 16k
Stackwalker::Stackwalker(const SystemInfo* system_info,
MemoryRegion* memory,
@@ -72,6 +77,7 @@ Stackwalker::Stackwalker(const SystemInfo* system_info,
: system_info_(system_info),
memory_(memory),
modules_(modules),
+ unloaded_modules_(NULL),
frame_symbolizer_(frame_symbolizer) {
assert(frame_symbolizer_);
}
@@ -134,8 +140,9 @@ bool Stackwalker::Walk(
// Resolve the module information, if a module map was provided.
StackFrameSymbolizer::SymbolizerResult symbolizer_result =
- frame_symbolizer_->FillSourceLineInfo(modules_, system_info_,
- frame.get());
+ frame_symbolizer_->FillSourceLineInfo(modules_, unloaded_modules_,
+ system_info_,
+ frame.get());
switch (symbolizer_result) {
case StackFrameSymbolizer::kInterrupt:
BPLOG(INFO) << "Stack walk is interrupted.";
@@ -186,13 +193,13 @@ bool Stackwalker::Walk(
return true;
}
-
// static
Stackwalker* Stackwalker::StackwalkerForCPU(
const SystemInfo* system_info,
DumpContext* context,
MemoryRegion* memory,
const CodeModules* modules,
+ const CodeModules* unloaded_modules,
StackFrameSymbolizer* frame_symbolizer) {
if (!context) {
BPLOG(ERROR) << "Can't choose a stackwalker implementation without context";
@@ -232,8 +239,9 @@ Stackwalker* Stackwalker::StackwalkerForCPU(
context->GetContextSPARC(),
memory, modules, frame_symbolizer);
break;
-
+
case MD_CONTEXT_MIPS:
+ case MD_CONTEXT_MIPS64:
cpu_stackwalker = new StackwalkerMIPS(system_info,
context->GetContextMIPS(),
memory, modules, frame_symbolizer);
@@ -250,7 +258,7 @@ Stackwalker* Stackwalker::StackwalkerForCPU(
frame_symbolizer);
break;
}
-
+
case MD_CONTEXT_ARM64:
cpu_stackwalker = new StackwalkerARM64(system_info,
context->GetContextARM64(),
@@ -262,14 +270,44 @@ Stackwalker* Stackwalker::StackwalkerForCPU(
BPLOG_IF(ERROR, !cpu_stackwalker) << "Unknown CPU type " << HexString(cpu) <<
", can't choose a stackwalker "
"implementation";
+ if (cpu_stackwalker) {
+ cpu_stackwalker->unloaded_modules_ = unloaded_modules;
+ }
return cpu_stackwalker;
}
-bool Stackwalker::InstructionAddressSeemsValid(uint64_t address) {
+// CONSIDER: check stack alignment?
+bool Stackwalker::TerminateWalk(uint64_t caller_ip,
+ uint64_t caller_sp,
+ uint64_t callee_sp,
+ bool first_unwind) const {
+ // Treat an instruction address less than 4k as end-of-stack.
+ // (using InstructionAddressSeemsValid() here is very tempting,
+ // but we need to handle JITted code)
+ if (caller_ip < (1 << 12)) {
+ return true;
+ }
+
+ // NOTE: The stack address range is implicitly checked
+ // when the stack memory is accessed.
+
+ // The stack pointer should monotonically increase. For first unwind
+ // we allow caller_sp == callee_sp to account for architectures where
+ // the return address is stored in a register (so it's possible to have
+ // leaf functions which don't move the stack pointer)
+ if (first_unwind ? (caller_sp < callee_sp) : (caller_sp <= callee_sp)) {
+ return true;
+ }
+
+ return false;
+}
+
+bool Stackwalker::InstructionAddressSeemsValid(uint64_t address) const {
StackFrame frame;
frame.instruction = address;
StackFrameSymbolizer::SymbolizerResult symbolizer_result =
- frame_symbolizer_->FillSourceLineInfo(modules_, system_info_, &frame);
+ frame_symbolizer_->FillSourceLineInfo(modules_, unloaded_modules_,
+ system_info_, &frame);
if (!frame.module) {
// not inside any loaded module
diff --git a/src/processor/stackwalker_amd64.cc b/src/processor/stackwalker_amd64.cc
index f252a33b..d5ac6c65 100644
--- a/src/processor/stackwalker_amd64.cc
+++ b/src/processor/stackwalker_amd64.cc
@@ -147,10 +147,15 @@ StackFrameAMD64* StackwalkerAMD64::GetCallerByCFIFrameInfo(
return frame.release();
}
+// Returns true if `ptr` is not in x86-64 canonical form.
+// https://en.wikipedia.org/wiki/X86-64#Virtual_address_space_details
+static bool is_non_canonical(uint64_t ptr) {
+ return ptr > 0x7FFFFFFFFFFF && ptr < 0xFFFF800000000000;
+}
+
StackFrameAMD64* StackwalkerAMD64::GetCallerByFramePointerRecovery(
const vector<StackFrame*>& frames) {
StackFrameAMD64* last_frame = static_cast<StackFrameAMD64*>(frames.back());
- uint64_t last_rsp = last_frame->context.rsp;
uint64_t last_rbp = last_frame->context.rbp;
// Assume the presence of a frame pointer. This is not mandated by the
@@ -169,14 +174,32 @@ StackFrameAMD64* StackwalkerAMD64::GetCallerByFramePointerRecovery(
// %caller_rip = *(%callee_rbp + 8)
// %caller_rbp = *(%callee_rbp)
+ // If rbp is not 8-byte aligned it can't be a frame pointer.
+ if (last_rbp % 8 != 0) {
+ return NULL;
+ }
+
uint64_t caller_rip, caller_rbp;
if (memory_->GetMemoryAtAddress(last_rbp + 8, &caller_rip) &&
memory_->GetMemoryAtAddress(last_rbp, &caller_rbp)) {
uint64_t caller_rsp = last_rbp + 16;
- // Simple sanity check that the stack is growing downwards as expected.
- if (caller_rbp < last_rbp || caller_rsp < last_rsp)
+ // If the recovered rip is not a canonical address it can't be
+ // the return address, so rbp must not have been a frame pointer.
+ if (is_non_canonical(caller_rip)) {
+ return NULL;
+ }
+
+ // Check that rbp is within the right frame
+ if (caller_rsp <= last_rbp || caller_rbp < caller_rsp) {
+ return NULL;
+ }
+
+ // Sanity check that resulting rbp is still inside stack memory.
+ uint64_t unused;
+ if (!memory_->GetMemoryAtAddress(caller_rbp, &unused)) {
return NULL;
+ }
StackFrameAMD64* frame = new StackFrameAMD64();
frame->trust = StackFrame::FRAME_TRUST_FP;
@@ -284,15 +307,11 @@ StackFrame* StackwalkerAMD64::GetCallerFrame(const CallStack* stack,
new_frame->context.rbp = static_cast<uint32_t>(new_frame->context.rbp);
}
- // Treat an instruction address of 0 as end-of-stack.
- if (new_frame->context.rip == 0)
- return NULL;
-
- // If the new stack pointer is at a lower address than the old, then
- // that's clearly incorrect. Treat this as end-of-stack to enforce
- // progress and avoid infinite loops.
- if (new_frame->context.rsp <= last_frame->context.rsp)
+ // Should we terminate the stack walk? (end-of-stack or broken invariant)
+ if (TerminateWalk(new_frame->context.rip, new_frame->context.rsp,
+ last_frame->context.rsp, frames.size() == 1)) {
return NULL;
+ }
// new_frame->context.rip is the return address, which is the instruction
// after the CALL that caused us to arrive at the callee. Set
diff --git a/src/processor/stackwalker_amd64_unittest.cc b/src/processor/stackwalker_amd64_unittest.cc
index a54198bf..efcd812a 100644
--- a/src/processor/stackwalker_amd64_unittest.cc
+++ b/src/processor/stackwalker_amd64_unittest.cc
@@ -62,6 +62,7 @@ using google_breakpad::test_assembler::Section;
using std::vector;
using testing::_;
using testing::AnyNumber;
+using testing::DoAll;
using testing::Return;
using testing::SetArgumentPointee;
using testing::Test;
@@ -72,8 +73,8 @@ class StackwalkerAMD64Fixture {
: stack_section(kLittleEndian),
// Give the two modules reasonable standard locations and names
// for tests to play with.
- module1(0x40000000c0000000ULL, 0x10000, "module1", "version1"),
- module2(0x50000000b0000000ULL, 0x10000, "module2", "version2") {
+ module1(0x00007400c0000000ULL, 0x10000, "module1", "version1"),
+ module2(0x00007500b0000000ULL, 0x10000, "module2", "version2") {
// Identify the system as a Linux system.
system_info.os = "Linux";
system_info.os_short = "linux";
@@ -149,7 +150,7 @@ TEST_F(SanityCheck, NoResolver) {
// provide any call frame information, so trying to reconstruct the
// context frame's caller should fail. So there's no need for us to
// provide stack contents.
- raw_context.rip = 0x40000000c0000200ULL;
+ raw_context.rip = 0x00007400c0000200ULL;
raw_context.rbp = 0x8000000080000000ULL;
StackFrameSymbolizer frame_symbolizer(NULL, NULL);
@@ -176,7 +177,7 @@ TEST_F(GetContextFrame, Simple) {
// provide any call frame information, so trying to reconstruct the
// context frame's caller should fail. So there's no need for us to
// provide stack contents.
- raw_context.rip = 0x40000000c0000200ULL;
+ raw_context.rip = 0x00007400c0000200ULL;
raw_context.rbp = 0x8000000080000000ULL;
StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
@@ -200,7 +201,7 @@ TEST_F(GetContextFrame, Simple) {
// The stackwalker should be able to produce the context frame even
// without stack memory present.
TEST_F(GetContextFrame, NoStackMemory) {
- raw_context.rip = 0x40000000c0000200ULL;
+ raw_context.rip = 0x00007400c0000200ULL;
raw_context.rbp = 0x8000000080000000ULL;
StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
@@ -230,23 +231,23 @@ TEST_F(GetCallerFrame, ScanWithoutSymbols) {
// Force scanning through three frames to ensure that the
// stack pointer is set properly in scan-recovered frames.
stack_section.start() = 0x8000000080000000ULL;
- uint64_t return_address1 = 0x50000000b0000100ULL;
- uint64_t return_address2 = 0x50000000b0000900ULL;
+ uint64_t return_address1 = 0x00007500b0000100ULL;
+ uint64_t return_address2 = 0x00007500b0000900ULL;
Label frame1_sp, frame2_sp, frame1_rbp;
stack_section
// frame 0
.Append(16, 0) // space
- .D64(0x40000000b0000000ULL) // junk that's not
- .D64(0x50000000d0000000ULL) // a return address
+ .D64(0x00007400b0000000ULL) // junk that's not
+ .D64(0x00007500d0000000ULL) // a return address
.D64(return_address1) // actual return address
// frame 1
.Mark(&frame1_sp)
.Append(16, 0) // space
- .D64(0x40000000b0000000ULL) // more junk
- .D64(0x50000000d0000000ULL)
+ .D64(0x00007400b0000000ULL) // more junk
+ .D64(0x00007500d0000000ULL)
.Mark(&frame1_rbp)
.D64(stack_section.start()) // This is in the right place to be
@@ -260,7 +261,7 @@ TEST_F(GetCallerFrame, ScanWithoutSymbols) {
RegionFromSection();
- raw_context.rip = 0x40000000c0000200ULL;
+ raw_context.rip = 0x00007400c0000200ULL;
raw_context.rbp = frame1_rbp.Value();
raw_context.rsp = stack_section.start().Value();
@@ -308,18 +309,18 @@ TEST_F(GetCallerFrame, ScanWithFunctionSymbols) {
// it is only considered a valid return address if it
// lies within a function's bounds.
stack_section.start() = 0x8000000080000000ULL;
- uint64_t return_address = 0x50000000b0000110ULL;
+ uint64_t return_address = 0x00007500b0000110ULL;
Label frame1_sp, frame1_rbp;
stack_section
// frame 0
.Append(16, 0) // space
- .D64(0x40000000b0000000ULL) // junk that's not
- .D64(0x50000000b0000000ULL) // a return address
+ .D64(0x00007400b0000000ULL) // junk that's not
+ .D64(0x00007500b0000000ULL) // a return address
- .D64(0x40000000c0001000ULL) // a couple of plausible addresses
- .D64(0x50000000b000aaaaULL) // that are not within functions
+ .D64(0x00007400c0001000ULL) // a couple of plausible addresses
+ .D64(0x00007500b000aaaaULL) // that are not within functions
.D64(return_address) // actual return address
// frame 1
@@ -328,7 +329,7 @@ TEST_F(GetCallerFrame, ScanWithFunctionSymbols) {
.Mark(&frame1_rbp);
RegionFromSection();
- raw_context.rip = 0x40000000c0000200ULL;
+ raw_context.rip = 0x00007400c0000200ULL;
raw_context.rbp = frame1_rbp.Value();
raw_context.rsp = stack_section.start().Value();
@@ -355,7 +356,7 @@ TEST_F(GetCallerFrame, ScanWithFunctionSymbols) {
EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
ASSERT_EQ(StackFrameAMD64::CONTEXT_VALID_ALL, frame0->context_validity);
EXPECT_EQ("platypus", frame0->function_name);
- EXPECT_EQ(0x40000000c0000100ULL, frame0->function_base);
+ EXPECT_EQ(0x00007400c0000100ULL, frame0->function_base);
StackFrameAMD64 *frame1 = static_cast<StackFrameAMD64 *>(frames->at(1));
EXPECT_EQ(StackFrame::FRAME_TRUST_SCAN, frame1->trust);
@@ -367,7 +368,240 @@ TEST_F(GetCallerFrame, ScanWithFunctionSymbols) {
EXPECT_EQ(frame1_sp.Value(), frame1->context.rsp);
EXPECT_EQ(frame1_rbp.Value(), frame1->context.rbp);
EXPECT_EQ("echidna", frame1->function_name);
- EXPECT_EQ(0x50000000b0000100ULL, frame1->function_base);
+ EXPECT_EQ(0x00007500b0000100ULL, frame1->function_base);
+}
+
+// StackwalkerAMD64::GetCallerByFramePointerRecovery should never return an
+// instruction pointer of 0 because IP of 0 is an end of stack marker and the
+// stack walk may be terminated prematurely. Instead it should return NULL
+// so that the stack walking code can proceed to stack scanning.
+TEST_F(GetCallerFrame, GetCallerByFramePointerRecovery) {
+ MockCodeModule user32_dll(0x00007ff9cb8a0000ULL, 0x14E000, "user32.dll",
+ "version1");
+ SetModuleSymbols(&user32_dll, // user32.dll
+ "PUBLIC fa60 0 DispatchMessageWorker\n"
+ "PUBLIC fee0 0 UserCallWinProcCheckWow\n"
+ "PUBLIC 1cdb0 0 _fnHkINLPMSG\n"
+ "STACK CFI INIT fa60 340 .cfa: $rsp .ra: .cfa 8 - ^\n"
+ "STACK CFI fa60 .cfa: $rsp 128 +\n"
+ "STACK CFI INIT fee0 49f .cfa: $rsp .ra: .cfa 8 - ^\n"
+ "STACK CFI fee0 .cfa: $rsp 240 +\n"
+ "STACK CFI INIT 1cdb0 9f .cfa: $rsp .ra: .cfa 8 - ^\n"
+ "STACK CFI 1cdb0 .cfa: $rsp 80 +\n");
+
+ // Create some modules with some stock debugging information.
+ MockCodeModules local_modules;
+ local_modules.Add(&user32_dll);
+
+ Label frame0_rsp;
+ Label frame0_rbp;
+ Label frame1_rsp;
+ Label frame2_rsp;
+
+ stack_section.start() = 0x00000099abf0f238ULL;
+ stack_section
+ .Mark(&frame0_rsp)
+ .D64(0x00007ff9cb8b00dcULL)
+ .Mark(&frame1_rsp)
+ .D64(0x0000000000000000ULL)
+ .D64(0x0000000000000001ULL)
+ .D64(0x00000099abf0f308ULL)
+ .D64(0x00007ff9cb8bce3aULL) // Stack residue from execution of
+ // user32!_fnHkINLPMSG+0x8a
+ .D64(0x000000000000c2e0ULL)
+ .D64(0x00000099abf0f328ULL)
+ .D64(0x0000000100000001ULL)
+ .D64(0x0000000000000000ULL)
+ .D64(0x0000000000000000ULL)
+ .D64(0x0000000000000000ULL)
+ .D64(0x0000000000000000ULL)
+ .D64(0x0000000000000000ULL)
+ .D64(0x0000000000000000ULL)
+ .D64(0x00007ff9ccad53e4ULL)
+ .D64(0x0000000000000048ULL)
+ .D64(0x0000000000000001ULL)
+ .D64(0x00000099abf0f5e0ULL)
+ .D64(0x00000099b61f7388ULL)
+ .D64(0x0000000000000030ULL)
+ .D64(0xffffff66540f0a1fULL)
+ .D64(0xffffff6649e08c77ULL)
+ .D64(0x00007ff9cb8affb4ULL) // Return address in
+ // user32!UserCallWinProcCheckWow+0xd4
+ .D64(0x0000000000000000ULL)
+ .D64(0x00000099abf0f368ULL)
+ .D64(0x0000000000000000ULL)
+ .D64(0x0000000000000000ULL)
+ .D64(0x0000000000000000ULL)
+ .D64(0x00000099a8150fd8ULL)
+ .D64(0x00000099abf0f3e8ULL)
+ .D64(0x00007ff9cb8afc07ULL) // Return address in
+ // user32!DispatchMessageWorker+0x1a7
+ .Mark(&frame2_rsp)
+ .Append(256, 0)
+ .Mark(&frame0_rbp) // The following are expected by
+ // GetCallerByFramePointerRecovery.
+ .D64(0xfffffffffffffffeULL) // %caller_rbp = *(%callee_rbp)
+ .D64(0x0000000000000000ULL) // %caller_rip = *(%callee_rbp + 8)
+ .D64(0x00000099a3e31040ULL) // %caller_rsp = *(%callee_rbp + 16)
+ .Append(256, 0);
+
+ RegionFromSection();
+ raw_context.rip = 0x00000099a8150fd8ULL; // IP in context frame is guarbage
+ raw_context.rsp = frame0_rsp.Value();
+ raw_context.rbp = frame0_rbp.Value();
+
+ StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
+ StackwalkerAMD64 walker(&system_info, &raw_context, &stack_region,
+ &local_modules, &frame_symbolizer);
+ vector<const CodeModule*> modules_without_symbols;
+ vector<const CodeModule*> modules_with_corrupt_symbols;
+ ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
+ &modules_with_corrupt_symbols));
+ ASSERT_EQ(0U, modules_without_symbols.size());
+ ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
+ frames = call_stack.frames();
+
+ ASSERT_EQ(3U, frames->size());
+
+ { // To avoid reusing locals by mistake
+ StackFrameAMD64 *frame = static_cast<StackFrameAMD64 *>(frames->at(0));
+ EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame->trust);
+ ASSERT_EQ(StackFrameAMD64::CONTEXT_VALID_ALL, frame->context_validity);
+ EXPECT_EQ("", frame->function_name);
+ EXPECT_EQ(0x00000099a8150fd8ULL, frame->instruction);
+ EXPECT_EQ(0x00000099a8150fd8ULL, frame->context.rip);
+ EXPECT_EQ(frame0_rsp.Value(), frame->context.rsp);
+ EXPECT_EQ(frame0_rbp.Value(), frame->context.rbp);
+ }
+
+ { // To avoid reusing locals by mistake
+ StackFrameAMD64 *frame = static_cast<StackFrameAMD64 *>(frames->at(1));
+ EXPECT_EQ(StackFrame::FRAME_TRUST_SCAN, frame->trust);
+ ASSERT_EQ((StackFrameAMD64::CONTEXT_VALID_RIP |
+ StackFrameAMD64::CONTEXT_VALID_RSP |
+ StackFrameAMD64::CONTEXT_VALID_RBP),
+ frame->context_validity);
+ EXPECT_EQ("UserCallWinProcCheckWow", frame->function_name);
+ EXPECT_EQ(140710838468828ULL, frame->instruction + 1);
+ EXPECT_EQ(140710838468828ULL, frame->context.rip);
+ EXPECT_EQ(frame1_rsp.Value(), frame->context.rsp);
+ EXPECT_EQ(&user32_dll, frame->module);
+ }
+
+ { // To avoid reusing locals by mistake
+ StackFrameAMD64 *frame = static_cast<StackFrameAMD64 *>(frames->at(2));
+ EXPECT_EQ(StackFrame::FRAME_TRUST_CFI, frame->trust);
+ ASSERT_EQ((StackFrameAMD64::CONTEXT_VALID_RIP |
+ StackFrameAMD64::CONTEXT_VALID_RSP |
+ StackFrameAMD64::CONTEXT_VALID_RBP),
+ frame->context_validity);
+ EXPECT_EQ("DispatchMessageWorker", frame->function_name);
+ EXPECT_EQ(140710838467591ULL, frame->instruction + 1);
+ EXPECT_EQ(140710838467591ULL, frame->context.rip);
+ EXPECT_EQ(frame2_rsp.Value(), frame->context.rsp);
+ EXPECT_EQ(&user32_dll, frame->module);
+ }
+}
+
+// Don't use frame pointer recovery if %rbp is not 8-byte aligned, which
+// indicates that it's not being used as a frame pointer.
+TEST_F(GetCallerFrame, FramePointerNotAligned) {
+ stack_section.start() = 0x8000000080000000ULL;
+ uint64_t return_address1 = 0x00007500b0000100ULL;
+ Label frame0_rbp, not_frame1_rbp, frame1_sp;
+ stack_section
+ // frame 0
+ .Align(8, 0)
+ .Append(2, 0) // mis-align the frame pointer
+ .Mark(&frame0_rbp)
+ .D64(not_frame1_rbp) // not the previous frame pointer
+ .D64(0x00007500b0000a00ULL) // plausible but wrong return address
+ .Align(8, 0)
+ .D64(return_address1) // return address
+ // frame 1
+ .Mark(&frame1_sp)
+ .Mark(&not_frame1_rbp)
+ .Append(32, 0); // end of stack
+
+
+ RegionFromSection();
+
+ raw_context.rip = 0x00007400c0000200ULL;
+ raw_context.rbp = frame0_rbp.Value();
+ raw_context.rsp = stack_section.start().Value();
+
+ StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
+ StackwalkerAMD64 walker(&system_info, &raw_context, &stack_region, &modules,
+ &frame_symbolizer);
+ vector<const CodeModule*> modules_without_symbols;
+ vector<const CodeModule*> modules_with_corrupt_symbols;
+ ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
+ &modules_with_corrupt_symbols));
+ frames = call_stack.frames();
+ ASSERT_EQ(2U, frames->size());
+
+ StackFrameAMD64 *frame0 = static_cast<StackFrameAMD64 *>(frames->at(0));
+ EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
+ ASSERT_EQ(StackFrameAMD64::CONTEXT_VALID_ALL, frame0->context_validity);
+ EXPECT_EQ(0, memcmp(&raw_context, &frame0->context, sizeof(raw_context)));
+
+ StackFrameAMD64 *frame1 = static_cast<StackFrameAMD64 *>(frames->at(1));
+ EXPECT_EQ(StackFrame::FRAME_TRUST_SCAN, frame1->trust);
+ ASSERT_EQ((StackFrameAMD64::CONTEXT_VALID_RIP |
+ StackFrameAMD64::CONTEXT_VALID_RSP),
+ frame1->context_validity);
+ EXPECT_EQ(return_address1, frame1->context.rip);
+ EXPECT_EQ(frame1_sp.Value(), frame1->context.rsp);
+}
+
+// Don't use frame pointer recovery if the recovered %rip is not
+// a canonical x86-64 address.
+TEST_F(GetCallerFrame, NonCanonicalInstructionPointerFromFramePointer) {
+ stack_section.start() = 0x8000000080000000ULL;
+ uint64_t return_address1 = 0x00007500b0000100ULL;
+ Label frame0_rbp, frame1_sp, not_frame1_bp;
+ stack_section
+ // frame 0
+ .Align(8, 0)
+ .Mark(&frame0_rbp)
+ .D64(not_frame1_bp) // some junk on the stack
+ .D64(0xDADADADADADADADA) // not the return address
+ .D64(return_address1) // return address
+ // frame 1
+ .Mark(&frame1_sp)
+ .Append(16, 0)
+ .Mark(&not_frame1_bp)
+ .Append(32, 0); // end of stack
+
+
+ RegionFromSection();
+
+ raw_context.rip = 0x00007400c0000200ULL;
+ raw_context.rbp = frame0_rbp.Value();
+ raw_context.rsp = stack_section.start().Value();
+
+ StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
+ StackwalkerAMD64 walker(&system_info, &raw_context, &stack_region, &modules,
+ &frame_symbolizer);
+ vector<const CodeModule*> modules_without_symbols;
+ vector<const CodeModule*> modules_with_corrupt_symbols;
+ ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
+ &modules_with_corrupt_symbols));
+ frames = call_stack.frames();
+ ASSERT_EQ(2U, frames->size());
+
+ StackFrameAMD64 *frame0 = static_cast<StackFrameAMD64 *>(frames->at(0));
+ EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
+ ASSERT_EQ(StackFrameAMD64::CONTEXT_VALID_ALL, frame0->context_validity);
+ EXPECT_EQ(0, memcmp(&raw_context, &frame0->context, sizeof(raw_context)));
+
+ StackFrameAMD64 *frame1 = static_cast<StackFrameAMD64 *>(frames->at(1));
+ EXPECT_EQ(StackFrame::FRAME_TRUST_SCAN, frame1->trust);
+ ASSERT_EQ((StackFrameAMD64::CONTEXT_VALID_RIP |
+ StackFrameAMD64::CONTEXT_VALID_RSP),
+ frame1->context_validity);
+ EXPECT_EQ(return_address1, frame1->context.rip);
+ EXPECT_EQ(frame1_sp.Value(), frame1->context.rsp);
}
// Test that set_max_frames_scanned prevents using stack scanning
@@ -377,23 +611,23 @@ TEST_F(GetCallerFrame, ScanningNotAllowed) {
// only addresses located within loaded modules are
// considered valid return addresses.
stack_section.start() = 0x8000000080000000ULL;
- uint64_t return_address1 = 0x50000000b0000100ULL;
- uint64_t return_address2 = 0x50000000b0000900ULL;
+ uint64_t return_address1 = 0x00007500b0000100ULL;
+ uint64_t return_address2 = 0x00007500b0000900ULL;
Label frame1_sp, frame2_sp, frame1_rbp;
stack_section
// frame 0
.Append(16, 0) // space
- .D64(0x40000000b0000000ULL) // junk that's not
- .D64(0x50000000d0000000ULL) // a return address
+ .D64(0x00007400b0000000ULL) // junk that's not
+ .D64(0x00007500d0000000ULL) // a return address
.D64(return_address1) // actual return address
// frame 1
.Mark(&frame1_sp)
.Append(16, 0) // space
- .D64(0x40000000b0000000ULL) // more junk
- .D64(0x50000000d0000000ULL)
+ .D64(0x00007400b0000000ULL) // more junk
+ .D64(0x00007500d0000000ULL)
.Mark(&frame1_rbp)
.D64(stack_section.start()) // This is in the right place to be
@@ -407,7 +641,7 @@ TEST_F(GetCallerFrame, ScanningNotAllowed) {
RegionFromSection();
- raw_context.rip = 0x40000000c0000200ULL;
+ raw_context.rip = 0x00007400c0000200ULL;
raw_context.rbp = frame1_rbp.Value();
raw_context.rsp = stack_section.start().Value();
@@ -438,18 +672,18 @@ TEST_F(GetCallerFrame, CallerPushedRBP) {
// %rbp directly below the return address, assume that it is indeed the
// next frame's %rbp.
stack_section.start() = 0x8000000080000000ULL;
- uint64_t return_address = 0x50000000b0000110ULL;
+ uint64_t return_address = 0x00007500b0000110ULL;
Label frame0_rbp, frame1_sp, frame1_rbp;
stack_section
// frame 0
.Append(16, 0) // space
- .D64(0x40000000b0000000ULL) // junk that's not
- .D64(0x50000000b0000000ULL) // a return address
+ .D64(0x00007400b0000000ULL) // junk that's not
+ .D64(0x00007500b0000000ULL) // a return address
- .D64(0x40000000c0001000ULL) // a couple of plausible addresses
- .D64(0x50000000b000aaaaULL) // that are not within functions
+ .D64(0x00007400c0001000ULL) // a couple of plausible addresses
+ .D64(0x00007500b000aaaaULL) // that are not within functions
.Mark(&frame0_rbp)
.D64(frame1_rbp) // caller-pushed %rbp
@@ -457,10 +691,11 @@ TEST_F(GetCallerFrame, CallerPushedRBP) {
// frame 1
.Mark(&frame1_sp)
.Append(32, 0) // body of frame1
- .Mark(&frame1_rbp); // end of stack
+ .Mark(&frame1_rbp) // end of stack
+ .D64(0);
RegionFromSection();
- raw_context.rip = 0x40000000c0000200ULL;
+ raw_context.rip = 0x00007400c0000200ULL;
raw_context.rbp = frame0_rbp.Value();
raw_context.rsp = stack_section.start().Value();
@@ -488,7 +723,7 @@ TEST_F(GetCallerFrame, CallerPushedRBP) {
ASSERT_EQ(StackFrameAMD64::CONTEXT_VALID_ALL, frame0->context_validity);
EXPECT_EQ(frame0_rbp.Value(), frame0->context.rbp);
EXPECT_EQ("sasquatch", frame0->function_name);
- EXPECT_EQ(0x40000000c0000100ULL, frame0->function_base);
+ EXPECT_EQ(0x00007400c0000100ULL, frame0->function_base);
StackFrameAMD64 *frame1 = static_cast<StackFrameAMD64 *>(frames->at(1));
EXPECT_EQ(StackFrame::FRAME_TRUST_FP, frame1->trust);
@@ -500,7 +735,7 @@ TEST_F(GetCallerFrame, CallerPushedRBP) {
EXPECT_EQ(frame1_sp.Value(), frame1->context.rsp);
EXPECT_EQ(frame1_rbp.Value(), frame1->context.rbp);
EXPECT_EQ("yeti", frame1->function_name);
- EXPECT_EQ(0x50000000b0000100ULL, frame1->function_base);
+ EXPECT_EQ(0x00007500b0000100ULL, frame1->function_base);
}
struct CFIFixture: public StackwalkerAMD64Fixture {
@@ -531,7 +766,7 @@ struct CFIFixture: public StackwalkerAMD64Fixture {
// Provide some distinctive values for the caller's registers.
expected.rsp = 0x8000000080000000ULL;
- expected.rip = 0x40000000c0005510ULL;
+ expected.rip = 0x00007400c0005510ULL;
expected.rbp = 0x68995b1de4700266ULL;
expected.rbx = 0x5a5beeb38de23be8ULL;
expected.r12 = 0xed1b02e8cc0fc79cULL;
@@ -568,7 +803,7 @@ struct CFIFixture: public StackwalkerAMD64Fixture {
EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
ASSERT_EQ(StackFrameAMD64::CONTEXT_VALID_ALL, frame0->context_validity);
EXPECT_EQ("enchiridion", frame0->function_name);
- EXPECT_EQ(0x40000000c0004000ULL, frame0->function_base);
+ EXPECT_EQ(0x00007400c0004000ULL, frame0->function_base);
StackFrameAMD64 *frame1 = static_cast<StackFrameAMD64 *>(frames->at(1));
EXPECT_EQ(StackFrame::FRAME_TRUST_CFI, frame1->trust);
@@ -601,9 +836,9 @@ class CFI: public CFIFixture, public Test { };
TEST_F(CFI, At4000) {
Label frame1_rsp = expected.rsp;
stack_section
- .D64(0x40000000c0005510ULL) // return address
+ .D64(0x00007400c0005510ULL) // return address
.Mark(&frame1_rsp); // This effectively sets stack_section.start().
- raw_context.rip = 0x40000000c0004000ULL;
+ raw_context.rip = 0x00007400c0004000ULL;
CheckWalk();
}
@@ -611,9 +846,9 @@ TEST_F(CFI, At4001) {
Label frame1_rsp = expected.rsp;
stack_section
.D64(0x5a5beeb38de23be8ULL) // saved %rbx
- .D64(0x40000000c0005510ULL) // return address
+ .D64(0x00007400c0005510ULL) // return address
.Mark(&frame1_rsp); // This effectively sets stack_section.start().
- raw_context.rip = 0x40000000c0004001ULL;
+ raw_context.rip = 0x00007400c0004001ULL;
raw_context.rbx = 0xbe0487d2f9eafe29ULL; // callee's (distinct) %rbx value
CheckWalk();
}
@@ -622,9 +857,9 @@ TEST_F(CFI, At4002) {
Label frame1_rsp = expected.rsp;
stack_section
.D64(0x5a5beeb38de23be8ULL) // saved %rbx
- .D64(0x40000000c0005510ULL) // return address
+ .D64(0x00007400c0005510ULL) // return address
.Mark(&frame1_rsp); // This effectively sets stack_section.start().
- raw_context.rip = 0x40000000c0004002ULL;
+ raw_context.rip = 0x00007400c0004002ULL;
raw_context.rbx = 0xed1b02e8cc0fc79cULL; // saved %r12
raw_context.r12 = 0xb0118de918a4bceaULL; // callee's (distinct) %r12 value
CheckWalk();
@@ -637,9 +872,9 @@ TEST_F(CFI, At4003) {
.D64(0x1d20ad8acacbe930ULL) // saved %r13
.D64(0x319e68b49e3ace0fULL) // garbage
.D64(0x5a5beeb38de23be8ULL) // saved %rbx
- .D64(0x40000000c0005510ULL) // return address
+ .D64(0x00007400c0005510ULL) // return address
.Mark(&frame1_rsp); // This effectively sets stack_section.start().
- raw_context.rip = 0x40000000c0004003ULL;
+ raw_context.rip = 0x00007400c0004003ULL;
raw_context.rbx = 0xed1b02e8cc0fc79cULL; // saved %r12
raw_context.r12 = 0x89d04fa804c87a43ULL; // callee's (distinct) %r12
raw_context.r13 = 0x5118e02cbdb24b03ULL; // callee's (distinct) %r13
@@ -654,9 +889,9 @@ TEST_F(CFI, At4004) {
.D64(0x1d20ad8acacbe930ULL) // saved %r13
.D64(0x319e68b49e3ace0fULL) // garbage
.D64(0x5a5beeb38de23be8ULL) // saved %rbx
- .D64(0x40000000c0005510ULL) // return address
+ .D64(0x00007400c0005510ULL) // return address
.Mark(&frame1_rsp); // This effectively sets stack_section.start().
- raw_context.rip = 0x40000000c0004004ULL;
+ raw_context.rip = 0x00007400c0004004ULL;
raw_context.rbx = 0xed1b02e8cc0fc79cULL; // saved %r12
raw_context.r12 = 0x89d04fa804c87a43ULL; // callee's (distinct) %r12
raw_context.r13 = 0x5118e02cbdb24b03ULL; // callee's (distinct) %r13
@@ -672,10 +907,10 @@ TEST_F(CFI, At4005) {
.D64(0x5a5beeb38de23be8ULL) // saved %rbx
.D64(0xaa95fa054aedfbaeULL) // garbage
.Mark(&frame1_rsp); // This effectively sets stack_section.start().
- raw_context.rip = 0x40000000c0004005ULL;
+ raw_context.rip = 0x00007400c0004005ULL;
raw_context.rbx = 0xed1b02e8cc0fc79cULL; // saved %r12
raw_context.r12 = 0x46b1b8868891b34aULL; // callee's %r12
- raw_context.r13 = 0x40000000c0005510ULL; // return address
+ raw_context.r13 = 0x00007400c0005510ULL; // return address
CheckWalk();
}
@@ -690,10 +925,10 @@ TEST_F(CFI, At4006) {
.D64(0x5a5beeb38de23be8ULL) // saved %rbx
.D64(0xf015ee516ad89eabULL) // garbage
.Mark(&frame1_rsp); // This effectively sets stack_section.start().
- raw_context.rip = 0x40000000c0004006ULL;
+ raw_context.rip = 0x00007400c0004006ULL;
raw_context.rbp = frame0_rbp.Value();
raw_context.rbx = 0xed1b02e8cc0fc79cULL; // saved %r12
raw_context.r12 = 0x26e007b341acfebdULL; // callee's %r12
- raw_context.r13 = 0x40000000c0005510ULL; // return address
+ raw_context.r13 = 0x00007400c0005510ULL; // return address
CheckWalk();
}
diff --git a/src/processor/stackwalker_arm.cc b/src/processor/stackwalker_arm.cc
index e4fc5869..1313416f 100644
--- a/src/processor/stackwalker_arm.cc
+++ b/src/processor/stackwalker_arm.cc
@@ -40,6 +40,7 @@
#include "google_breakpad/processor/memory_region.h"
#include "google_breakpad/processor/source_line_resolver_interface.h"
#include "google_breakpad/processor/stack_frame_cpu.h"
+#include "google_breakpad/processor/system_info.h"
#include "processor/cfi_frame_info.h"
#include "processor/logging.h"
#include "processor/stackwalker_arm.h"
@@ -249,10 +250,14 @@ StackFrame* StackwalkerARM::GetCallerFrame(const CallStack* stack,
scoped_ptr<StackFrameARM> frame;
// See if there is DWARF call frame information covering this address.
- scoped_ptr<CFIFrameInfo> cfi_frame_info(
- frame_symbolizer_->FindCFIFrameInfo(last_frame));
- if (cfi_frame_info.get())
- frame.reset(GetCallerByCFIFrameInfo(frames, cfi_frame_info.get()));
+ // TODO(jperaza): Ignore iOS CFI info until it is properly collected.
+ // https://bugs.chromium.org/p/google-breakpad/issues/detail?id=764
+ if (!system_info_ || system_info_->os != "iOS") {
+ scoped_ptr<CFIFrameInfo> cfi_frame_info(
+ frame_symbolizer_->FindCFIFrameInfo(last_frame));
+ if (cfi_frame_info.get())
+ frame.reset(GetCallerByCFIFrameInfo(frames, cfi_frame_info.get()));
+ }
// If CFI failed, or there wasn't CFI available, fall back
// to frame pointer, if this is configured.
@@ -267,17 +272,13 @@ StackFrame* StackwalkerARM::GetCallerFrame(const CallStack* stack,
if (!frame.get())
return NULL;
-
- // An instruction address of zero marks the end of the stack.
- if (frame->context.iregs[MD_CONTEXT_ARM_REG_PC] == 0)
- return NULL;
-
- // If the new stack pointer is at a lower address than the old, then
- // that's clearly incorrect. Treat this as end-of-stack to enforce
- // progress and avoid infinite loops.
- if (frame->context.iregs[MD_CONTEXT_ARM_REG_SP]
- < last_frame->context.iregs[MD_CONTEXT_ARM_REG_SP])
+ // Should we terminate the stack walk? (end-of-stack or broken invariant)
+ if (TerminateWalk(frame->context.iregs[MD_CONTEXT_ARM_REG_PC],
+ frame->context.iregs[MD_CONTEXT_ARM_REG_SP],
+ last_frame->context.iregs[MD_CONTEXT_ARM_REG_SP],
+ frames.size() == 1)) {
return NULL;
+ }
// The new frame's context's PC is the return address, which is one
// instruction past the instruction that caused us to arrive at the
diff --git a/src/processor/stackwalker_arm64.cc b/src/processor/stackwalker_arm64.cc
index 31119a97..5bfd2636 100644
--- a/src/processor/stackwalker_arm64.cc
+++ b/src/processor/stackwalker_arm64.cc
@@ -54,8 +54,29 @@ StackwalkerARM64::StackwalkerARM64(const SystemInfo* system_info,
StackFrameSymbolizer* resolver_helper)
: Stackwalker(system_info, memory, modules, resolver_helper),
context_(context),
- context_frame_validity_(StackFrameARM64::CONTEXT_VALID_ALL) { }
+ context_frame_validity_(StackFrameARM64::CONTEXT_VALID_ALL),
+ address_range_mask_(0xffffffffffffffff) {
+ if (modules && modules->module_count() > 0) {
+ // ARM64 supports storing pointer authentication codes in the upper bits of
+ // a pointer. Make a best guess at the range of valid addresses based on the
+ // range of loaded modules.
+ const CodeModule *high_module =
+ modules->GetModuleAtSequence(modules->module_count() - 1);
+ uint64_t mask = high_module->base_address() + high_module->size();
+ mask |= mask >> 1;
+ mask |= mask >> 2;
+ mask |= mask >> 4;
+ mask |= mask >> 8;
+ mask |= mask >> 16;
+ mask |= mask >> 32;
+ address_range_mask_ = mask;
+ }
+}
+uint64_t StackwalkerARM64::PtrauthStrip(uint64_t ptr) {
+ uint64_t stripped = ptr & address_range_mask_;
+ return modules_ && modules_->GetModuleForAddress(stripped) ? stripped : ptr;
+}
StackFrame* StackwalkerARM64::GetContextFrame() {
if (!context_) {
@@ -71,6 +92,8 @@ StackFrame* StackwalkerARM64::GetContextFrame() {
frame->context_validity = context_frame_validity_;
frame->trust = StackFrame::FRAME_TRUST_CONTEXT;
frame->instruction = frame->context.iregs[MD_CONTEXT_ARM64_REG_PC];
+ frame->context.iregs[MD_CONTEXT_ARM64_REG_LR] =
+ PtrauthStrip(frame->context.iregs[MD_CONTEXT_ARM64_REG_LR]);
return frame;
}
@@ -185,6 +208,9 @@ StackFrameARM64* StackwalkerARM64::GetCallerByStackScan(
StackFrameARM64* StackwalkerARM64::GetCallerByFramePointer(
const vector<StackFrame*> &frames) {
StackFrameARM64* last_frame = static_cast<StackFrameARM64*>(frames.back());
+ if (!(last_frame->context_validity & StackFrameARM64::CONTEXT_VALID_LR)) {
+ CorrectRegLRByFramePointer(frames, last_frame);
+ }
uint64_t last_fp = last_frame->context.iregs[MD_CONTEXT_ARM64_REG_FP];
@@ -202,6 +228,8 @@ StackFrameARM64* StackwalkerARM64::GetCallerByFramePointer(
return NULL;
}
+ caller_lr = PtrauthStrip(caller_lr);
+
uint64_t caller_sp = last_fp ? last_fp + 16 :
last_frame->context.iregs[MD_CONTEXT_ARM64_REG_SP];
@@ -223,6 +251,42 @@ StackFrameARM64* StackwalkerARM64::GetCallerByFramePointer(
return frame;
}
+void StackwalkerARM64::CorrectRegLRByFramePointer(
+ const vector<StackFrame*>& frames,
+ StackFrameARM64* last_frame) {
+ // Need at least two frames to correct and
+ // register $FP should always be greater than register $SP.
+ if (frames.size() < 2 || !last_frame ||
+ last_frame->context.iregs[MD_CONTEXT_ARM64_REG_FP] <=
+ last_frame->context.iregs[MD_CONTEXT_ARM64_REG_SP])
+ return;
+
+ StackFrameARM64* last_last_frame =
+ static_cast<StackFrameARM64*>(*(frames.end() - 2));
+ uint64_t last_last_fp =
+ last_last_frame->context.iregs[MD_CONTEXT_ARM64_REG_FP];
+
+ uint64_t last_fp = 0;
+ if (last_last_fp && !memory_->GetMemoryAtAddress(last_last_fp, &last_fp)) {
+ BPLOG(ERROR) << "Unable to read last_fp from last_last_fp: 0x"
+ << std::hex << last_last_fp;
+ return;
+ }
+ // Give up if STACK CFI doesn't agree with frame pointer.
+ if (last_frame->context.iregs[MD_CONTEXT_ARM64_REG_FP] != last_fp)
+ return;
+
+ uint64_t last_lr = 0;
+ if (last_last_fp && !memory_->GetMemoryAtAddress(last_last_fp + 8, &last_lr)) {
+ BPLOG(ERROR) << "Unable to read last_lr from (last_last_fp + 8): 0x"
+ << std::hex << (last_last_fp + 8);
+ return;
+ }
+ last_lr = PtrauthStrip(last_lr);
+
+ last_frame->context.iregs[MD_CONTEXT_ARM64_REG_LR] = last_lr;
+}
+
StackFrame* StackwalkerARM64::GetCallerFrame(const CallStack* stack,
bool stack_scan_allowed) {
if (!memory_ || !stack) {
@@ -252,16 +316,13 @@ StackFrame* StackwalkerARM64::GetCallerFrame(const CallStack* stack,
if (!frame.get())
return NULL;
- // An instruction address of zero marks the end of the stack.
- if (frame->context.iregs[MD_CONTEXT_ARM64_REG_PC] == 0)
- return NULL;
-
- // If the new stack pointer is at a lower address than the old, then
- // that's clearly incorrect. Treat this as end-of-stack to enforce
- // progress and avoid infinite loops.
- if (frame->context.iregs[MD_CONTEXT_ARM64_REG_SP]
- < last_frame->context.iregs[MD_CONTEXT_ARM64_REG_SP])
+ // Should we terminate the stack walk? (end-of-stack or broken invariant)
+ if (TerminateWalk(frame->context.iregs[MD_CONTEXT_ARM64_REG_PC],
+ frame->context.iregs[MD_CONTEXT_ARM64_REG_SP],
+ last_frame->context.iregs[MD_CONTEXT_ARM64_REG_SP],
+ frames.size() == 1)) {
return NULL;
+ }
// The new frame's context's PC is the return address, which is one
// instruction past the instruction that caused us to arrive at the callee.
diff --git a/src/processor/stackwalker_arm64.h b/src/processor/stackwalker_arm64.h
index 121e8246..39735c67 100644
--- a/src/processor/stackwalker_arm64.h
+++ b/src/processor/stackwalker_arm64.h
@@ -68,6 +68,9 @@ class StackwalkerARM64 : public Stackwalker {
}
private:
+ // Strip pointer authentication codes from an address.
+ uint64_t PtrauthStrip(uint64_t ptr);
+
// Implementation of Stackwalker, using arm64 context and stack conventions.
virtual StackFrame* GetContextFrame();
virtual StackFrame* GetCallerFrame(const CallStack* stack,
@@ -87,6 +90,13 @@ class StackwalkerARM64 : public Stackwalker {
// of the returned frame. Return NULL on failure.
StackFrameARM64* GetCallerByStackScan(const vector<StackFrame*> &frames);
+ // GetCallerByFramePointer() depends on the previous frame having recovered
+ // x30($LR) which may not have been done when using CFI.
+ // This function recovers $LR in the previous frame by using the frame-pointer
+ // two frames back to read it from the stack.
+ void CorrectRegLRByFramePointer(const vector<StackFrame*>& frames,
+ StackFrameARM64* last_frame);
+
// Stores the CPU context corresponding to the youngest stack frame, to
// be returned by GetContextFrame.
const MDRawContextARM64* context_;
@@ -95,6 +105,10 @@ class StackwalkerARM64 : public Stackwalker {
// CONTEXT_VALID_ALL in real use; it is only changeable for the sake of
// unit tests.
uint64_t context_frame_validity_;
+
+ // A mask of the valid address bits, determined from the address range of
+ // modules_.
+ uint64_t address_range_mask_;
};
diff --git a/src/processor/stackwalker_arm64_unittest.cc b/src/processor/stackwalker_arm64_unittest.cc
index dd617f69..d86fa127 100644
--- a/src/processor/stackwalker_arm64_unittest.cc
+++ b/src/processor/stackwalker_arm64_unittest.cc
@@ -64,6 +64,7 @@ using google_breakpad::test_assembler::Section;
using std::vector;
using testing::_;
using testing::AnyNumber;
+using testing::DoAll;
using testing::Return;
using testing::SetArgumentPointee;
using testing::Test;
@@ -349,7 +350,7 @@ TEST_F(GetCallerFrame, ScanFirstFrame) {
.D64(0xF0000000) // more junk
.D64(0x0000000D)
- .Append(256, 0) // more space
+ .Append(336, 0) // more space
.D64(return_address2) // actual return address
// (won't be found)
diff --git a/src/processor/stackwalker_arm_unittest.cc b/src/processor/stackwalker_arm_unittest.cc
index c73322e6..256f7648 100644
--- a/src/processor/stackwalker_arm_unittest.cc
+++ b/src/processor/stackwalker_arm_unittest.cc
@@ -64,6 +64,7 @@ using google_breakpad::test_assembler::Section;
using std::vector;
using testing::_;
using testing::AnyNumber;
+using testing::DoAll;
using testing::Return;
using testing::SetArgumentPointee;
using testing::Test;
@@ -370,7 +371,7 @@ TEST_F(GetCallerFrame, ScanFirstFrame) {
.D32(0xF0000000) // more junk
.D32(0x0000000D)
- .Append(96, 0) // more space
+ .Append(136, 0) // more space
.D32(return_address2) // actual return address
// (won't be found)
@@ -782,8 +783,12 @@ TEST_F(CFI, RejectBadExpressions) {
class StackwalkerARMFixtureIOS : public StackwalkerARMFixture {
public:
StackwalkerARMFixtureIOS() {
- system_info.os = "iOS";
- system_info.os_short = "ios";
+ // iOS_test is used instead of iOS because the stackwalker has a check to
+ // avoid using CFI for iOS dumps. This is a workaround for bad CFI being
+ // produced by dump_syms for iOS.
+ // https://bugs.chromium.org/p/google-breakpad/issues/detail?id=764
+ system_info.os = "iOS_test";
+ system_info.os_short = "ios_test";
}
};
diff --git a/src/processor/stackwalker_mips.cc b/src/processor/stackwalker_mips.cc
index 7db34219..c33ecdbe 100644
--- a/src/processor/stackwalker_mips.cc
+++ b/src/processor/stackwalker_mips.cc
@@ -53,14 +53,26 @@ StackwalkerMIPS::StackwalkerMIPS(const SystemInfo* system_info,
MemoryRegion* memory,
const CodeModules* modules,
StackFrameSymbolizer* resolver_helper)
- : Stackwalker(system_info, memory, modules, resolver_helper),
- context_(context) {
- if (memory_ && memory_->GetBase() + memory_->GetSize() - 1 > 0xffffffff) {
- BPLOG(ERROR) << "Memory out of range for stackwalking: "
- << HexString(memory_->GetBase())
- << "+"
- << HexString(memory_->GetSize());
- memory_ = NULL;
+: Stackwalker(system_info, memory, modules, resolver_helper),
+ context_(context) {
+ if (memory_) {
+ if (context_->context_flags & MD_CONTEXT_MIPS64 ) {
+ if (0xffffffffffffffff - memory_->GetBase() < memory_->GetSize() - 1) {
+ BPLOG(ERROR) << "Memory out of range for stackwalking mips64: "
+ << HexString(memory_->GetBase())
+ << "+"
+ << HexString(memory_->GetSize());
+ memory_ = NULL;
+ }
+ } else {
+ if (0xffffffff - memory_->GetBase() < memory_->GetSize() - 1) {
+ BPLOG(ERROR) << "Memory out of range for stackwalking mips32: "
+ << HexString(memory_->GetBase())
+ << "+"
+ << HexString(memory_->GetSize());
+ memory_ = NULL;
+ }
+ }
}
}
@@ -96,73 +108,141 @@ StackFrameMIPS* StackwalkerMIPS::GetCallerByCFIFrameInfo(
CFIFrameInfo* cfi_frame_info) {
StackFrameMIPS* last_frame = static_cast<StackFrameMIPS*>(frames.back());
- uint32_t sp = 0, pc = 0;
+ if (context_->context_flags & MD_CONTEXT_MIPS) {
+ uint32_t pc = 0;
- // Populate a dictionary with the valid register values in last_frame.
- CFIFrameInfo::RegisterValueMap<uint32_t> callee_registers;
- // Use the STACK CFI data to recover the caller's register values.
- CFIFrameInfo::RegisterValueMap<uint32_t> caller_registers;
+ // Populate a dictionary with the valid register values in last_frame.
+ CFIFrameInfo::RegisterValueMap<uint32_t> callee_registers;
+ // Use the STACK CFI data to recover the caller's register values.
+ CFIFrameInfo::RegisterValueMap<uint32_t> caller_registers;
- for (int i = 0; kRegisterNames[i]; ++i) {
- caller_registers[kRegisterNames[i]] = last_frame->context.iregs[i];
- callee_registers[kRegisterNames[i]] = last_frame->context.iregs[i];
- }
+ for (int i = 0; kRegisterNames[i]; ++i) {
+ caller_registers[kRegisterNames[i]] = last_frame->context.iregs[i];
+ callee_registers[kRegisterNames[i]] = last_frame->context.iregs[i];
+ }
- if (!cfi_frame_info->FindCallerRegs(callee_registers, *memory_,
- &caller_registers)) {
- return NULL;
- }
+ if (!cfi_frame_info->FindCallerRegs(callee_registers, *memory_,
+ &caller_registers)) {
+ return NULL;
+ }
- CFIFrameInfo::RegisterValueMap<uint32_t>::const_iterator entry =
- caller_registers.find(".cfa");
+ CFIFrameInfo::RegisterValueMap<uint32_t>::const_iterator entry =
+ caller_registers.find(".cfa");
- if (entry != caller_registers.end()) {
- sp = entry->second;
- caller_registers["$sp"] = entry->second;
- }
+ if (entry != caller_registers.end()) {
+ caller_registers["$sp"] = entry->second;
+ }
- entry = caller_registers.find(".ra");
- if (entry != caller_registers.end()) {
- caller_registers["$ra"] = entry->second;
- pc = entry->second - 2 * sizeof(pc);
- }
- caller_registers["$pc"] = pc;
- // Construct a new stack frame given the values the CFI recovered.
- scoped_ptr<StackFrameMIPS> frame(new StackFrameMIPS());
-
- for (int i = 0; kRegisterNames[i]; ++i) {
- CFIFrameInfo::RegisterValueMap<uint32_t>::const_iterator caller_entry =
- caller_registers.find(kRegisterNames[i]);
-
- if (caller_entry != caller_registers.end()) {
- // The value of this register is recovered; fill the context with the
- // value from caller_registers.
- frame->context.iregs[i] = caller_entry->second;
- frame->context_validity |= StackFrameMIPS::RegisterValidFlag(i);
- } else if (((i >= INDEX_MIPS_REG_S0 && i <= INDEX_MIPS_REG_S7) ||
- (i > INDEX_MIPS_REG_GP && i < INDEX_MIPS_REG_RA)) &&
- (last_frame->context_validity &
- StackFrameMIPS::RegisterValidFlag(i))) {
- // If the STACK CFI data doesn't mention some callee-save register, and
- // it is valid in the callee, assume the callee has not yet changed it.
- // Calee-save registers according to the MIPS o32 ABI specification are:
- // $s0 to $s7
- // $sp, $s8
- frame->context.iregs[i] = last_frame->context.iregs[i];
- frame->context_validity |= StackFrameMIPS::RegisterValidFlag(i);
+ entry = caller_registers.find(".ra");
+ if (entry != caller_registers.end()) {
+ caller_registers["$ra"] = entry->second;
+ pc = entry->second - 2 * sizeof(pc);
+ }
+ caller_registers["$pc"] = pc;
+ // Construct a new stack frame given the values the CFI recovered.
+ scoped_ptr<StackFrameMIPS> frame(new StackFrameMIPS());
+
+ for (int i = 0; kRegisterNames[i]; ++i) {
+ CFIFrameInfo::RegisterValueMap<uint32_t>::const_iterator caller_entry =
+ caller_registers.find(kRegisterNames[i]);
+
+ if (caller_entry != caller_registers.end()) {
+ // The value of this register is recovered; fill the context with the
+ // value from caller_registers.
+ frame->context.iregs[i] = caller_entry->second;
+ frame->context_validity |= StackFrameMIPS::RegisterValidFlag(i);
+ } else if (((i >= INDEX_MIPS_REG_S0 && i <= INDEX_MIPS_REG_S7) ||
+ (i > INDEX_MIPS_REG_GP && i < INDEX_MIPS_REG_RA)) &&
+ (last_frame->context_validity &
+ StackFrameMIPS::RegisterValidFlag(i))) {
+ // If the STACK CFI data doesn't mention some callee-save register, and
+ // it is valid in the callee, assume the callee has not yet changed it.
+ // Calee-save registers according to the MIPS o32 ABI specification are:
+ // $s0 to $s7
+ // $sp, $s8
+ frame->context.iregs[i] = last_frame->context.iregs[i];
+ frame->context_validity |= StackFrameMIPS::RegisterValidFlag(i);
+ }
}
- }
- frame->context.epc = caller_registers["$pc"];
- frame->instruction = caller_registers["$pc"];
- frame->context_validity |= StackFrameMIPS::CONTEXT_VALID_PC;
-
- frame->context.iregs[MD_CONTEXT_MIPS_REG_RA] = caller_registers["$ra"];
- frame->context_validity |= StackFrameMIPS::CONTEXT_VALID_RA;
+ frame->context.epc = caller_registers["$pc"];
+ frame->instruction = caller_registers["$pc"];
+ frame->context_validity |= StackFrameMIPS::CONTEXT_VALID_PC;
- frame->trust = StackFrame::FRAME_TRUST_CFI;
+ frame->context.iregs[MD_CONTEXT_MIPS_REG_RA] = caller_registers["$ra"];
+ frame->context_validity |= StackFrameMIPS::CONTEXT_VALID_RA;
+
+ frame->trust = StackFrame::FRAME_TRUST_CFI;
+
+ return frame.release();
+ } else {
+ uint64_t pc = 0;
+
+ // Populate a dictionary with the valid register values in last_frame.
+ CFIFrameInfo::RegisterValueMap<uint64_t> callee_registers;
+ // Use the STACK CFI data to recover the caller's register values.
+ CFIFrameInfo::RegisterValueMap<uint64_t> caller_registers;
+
+ for (int i = 0; kRegisterNames[i]; ++i) {
+ caller_registers[kRegisterNames[i]] = last_frame->context.iregs[i];
+ callee_registers[kRegisterNames[i]] = last_frame->context.iregs[i];
+ }
+
+ if (!cfi_frame_info->FindCallerRegs(callee_registers, *memory_,
+ &caller_registers)) {
+ return NULL;
+ }
+
+ CFIFrameInfo::RegisterValueMap<uint64_t>::const_iterator entry =
+ caller_registers.find(".cfa");
+
+ if (entry != caller_registers.end()) {
+ caller_registers["$sp"] = entry->second;
+ }
- return frame.release();
+ entry = caller_registers.find(".ra");
+ if (entry != caller_registers.end()) {
+ caller_registers["$ra"] = entry->second;
+ pc = entry->second - 2 * sizeof(pc);
+ }
+ caller_registers["$pc"] = pc;
+ // Construct a new stack frame given the values the CFI recovered.
+ scoped_ptr<StackFrameMIPS> frame(new StackFrameMIPS());
+
+ for (int i = 0; kRegisterNames[i]; ++i) {
+ CFIFrameInfo::RegisterValueMap<uint64_t>::const_iterator caller_entry =
+ caller_registers.find(kRegisterNames[i]);
+
+ if (caller_entry != caller_registers.end()) {
+ // The value of this register is recovered; fill the context with the
+ // value from caller_registers.
+ frame->context.iregs[i] = caller_entry->second;
+ frame->context_validity |= StackFrameMIPS::RegisterValidFlag(i);
+ } else if (((i >= INDEX_MIPS_REG_S0 && i <= INDEX_MIPS_REG_S7) ||
+ (i >= INDEX_MIPS_REG_GP && i < INDEX_MIPS_REG_RA)) &&
+ (last_frame->context_validity &
+ StackFrameMIPS::RegisterValidFlag(i))) {
+ // If the STACK CFI data doesn't mention some callee-save register, and
+ // it is valid in the callee, assume the callee has not yet changed it.
+ // Calee-save registers according to the MIPS o32 ABI specification are:
+ // $s0 to $s7
+ // $sp, $s8
+ frame->context.iregs[i] = last_frame->context.iregs[i];
+ frame->context_validity |= StackFrameMIPS::RegisterValidFlag(i);
+ }
+ }
+
+ frame->context.epc = caller_registers["$pc"];
+ frame->instruction = caller_registers["$pc"];
+ frame->context_validity |= StackFrameMIPS::CONTEXT_VALID_PC;
+
+ frame->context.iregs[MD_CONTEXT_MIPS_REG_RA] = caller_registers["$ra"];
+ frame->context_validity |= StackFrameMIPS::CONTEXT_VALID_RA;
+
+ frame->trust = StackFrame::FRAME_TRUST_CFI;
+
+ return frame.release();
+ }
}
StackFrame* StackwalkerMIPS::GetCallerFrame(const CallStack* stack,
@@ -192,19 +272,14 @@ StackFrame* StackwalkerMIPS::GetCallerFrame(const CallStack* stack,
return NULL;
}
- // Treat an instruction address of 0 as end-of-stack.
- if (new_frame->context.epc == 0) {
+ // Should we terminate the stack walk? (end-of-stack or broken invariant)
+ if (TerminateWalk(new_frame->context.epc,
+ new_frame->context.iregs[MD_CONTEXT_MIPS_REG_SP],
+ last_frame->context.iregs[MD_CONTEXT_MIPS_REG_SP],
+ frames.size() == 1)) {
return NULL;
}
- // If the new stack pointer is at a lower address than the old, then
- // that's clearly incorrect. Treat this as end-of-stack to enforce
- // progress and avoid infinite loops.
- if (new_frame->context.iregs[MD_CONTEXT_MIPS_REG_SP] <=
- last_frame->context.iregs[MD_CONTEXT_MIPS_REG_SP]) {
- return NULL;
- }
-
return new_frame.release();
}
@@ -215,19 +290,20 @@ StackFrameMIPS* StackwalkerMIPS::GetCallerByStackScan(
StackFrameMIPS* last_frame = static_cast<StackFrameMIPS*>(frames.back());
- uint32_t last_sp = last_frame->context.iregs[MD_CONTEXT_MIPS_REG_SP];
- uint32_t caller_pc, caller_sp, caller_fp;
+ if (context_->context_flags & MD_CONTEXT_MIPS) {
+ uint32_t last_sp = last_frame->context.iregs[MD_CONTEXT_MIPS_REG_SP];
+ uint32_t caller_pc, caller_sp, caller_fp;
- // Return address cannot be obtained directly.
- // Force stackwalking.
+ // Return address cannot be obtained directly.
+ // Force stackwalking.
- // We cannot use frame pointer to get the return address.
- // We'll scan the stack for a
- // return address. This can happen if last_frame is executing code
- // for a module for which we don't have symbols.
- int count = kMaxFrameStackSize / sizeof(caller_pc);
+ // We cannot use frame pointer to get the return address.
+ // We'll scan the stack for a
+ // return address. This can happen if last_frame is executing code
+ // for a module for which we don't have symbols.
+ int count = kMaxFrameStackSize / sizeof(caller_pc);
- if (frames.size() > 1) {
+ if (frames.size() > 1) {
// In case of mips32 ABI stack frame of a nonleaf function
// must have minimum stack frame assigned for 4 arguments (4 words).
// Move stack pointer for 4 words to avoid reporting non-existing frames
@@ -235,65 +311,131 @@ StackFrameMIPS* StackwalkerMIPS::GetCallerByStackScan(
// There is no way of knowing if topmost frame belongs to a leaf or
// a nonleaf function.
last_sp += kMinArgsOnStack * sizeof(caller_pc);
- // Adjust 'count' so that return address is scanned only in limits
+ // Adjust 'count' so that return address is scanned only in limits
// of one stack frame.
count -= kMinArgsOnStack;
- }
+ }
- do {
- // Scanning for return address from stack pointer of the last frame.
- if (!ScanForReturnAddress(last_sp, &caller_sp, &caller_pc, count)) {
- // If we can't find an instruction pointer even with stack scanning,
- // give up.
- BPLOG(ERROR) << " ScanForReturnAddress failed ";
+ do {
+ // Scanning for return address from stack pointer of the last frame.
+ if (!ScanForReturnAddress(last_sp, &caller_sp, &caller_pc, count)) {
+ // If we can't find an instruction pointer even with stack scanning,
+ // give up.
+ BPLOG(ERROR) << " ScanForReturnAddress failed ";
+ return NULL;
+ }
+ // Get $fp stored in the stack frame.
+ if (!memory_->GetMemoryAtAddress(caller_sp - sizeof(caller_pc),
+ &caller_fp)) {
+ BPLOG(INFO) << " GetMemoryAtAddress for fp failed " ;
+ return NULL;
+ }
+
+ count = count - (caller_sp - last_sp) / sizeof(caller_pc);
+ // Now scan the next address in the stack.
+ last_sp = caller_sp + sizeof(caller_pc);
+ } while ((caller_fp - caller_sp >= kMaxFrameStackSize) && count > 0);
+
+ if (!count) {
+ BPLOG(INFO) << " No frame found " ;
return NULL;
}
- // Get $fp stored in the stack frame.
- if (!memory_->GetMemoryAtAddress(caller_sp - sizeof(caller_pc),
- &caller_fp)) {
- BPLOG(INFO) << " GetMemoryAtAddress for fp failed " ;
+
+ // ScanForReturnAddress found a reasonable return address. Advance
+ // $sp to the location above the one where the return address was
+ // found.
+ caller_sp += sizeof(caller_pc);
+ // caller_pc is actually containing $ra value;
+ // $pc is two instructions before $ra,
+ // so the caller_pc needs to be decremented accordingly.
+ caller_pc -= 2 * sizeof(caller_pc);
+
+ // Create a new stack frame (ownership will be transferred to the caller)
+ // and fill it in.
+ StackFrameMIPS* frame = new StackFrameMIPS();
+ frame->trust = StackFrame::FRAME_TRUST_SCAN;
+ frame->context = last_frame->context;
+ frame->context.epc = caller_pc;
+ frame->context_validity |= StackFrameMIPS::CONTEXT_VALID_PC;
+ frame->instruction = caller_pc;
+
+ frame->context.iregs[MD_CONTEXT_MIPS_REG_SP] = caller_sp;
+ frame->context_validity |= StackFrameMIPS::CONTEXT_VALID_SP;
+ frame->context.iregs[MD_CONTEXT_MIPS_REG_FP] = caller_fp;
+ frame->context_validity |= StackFrameMIPS::CONTEXT_VALID_FP;
+
+ frame->context.iregs[MD_CONTEXT_MIPS_REG_RA] =
+ caller_pc + 2 * sizeof(caller_pc);
+ frame->context_validity |= StackFrameMIPS::CONTEXT_VALID_RA;
+
+ return frame;
+ } else {
+ uint64_t last_sp = last_frame->context.iregs[MD_CONTEXT_MIPS_REG_SP];
+ uint64_t caller_pc, caller_sp, caller_fp;
+
+ // Return address cannot be obtained directly.
+ // Force stackwalking.
+
+ // We cannot use frame pointer to get the return address.
+ // We'll scan the stack for a
+ // return address. This can happen if last_frame is executing code
+ // for a module for which we don't have symbols.
+ int count = kMaxFrameStackSize / sizeof(caller_pc);
+
+ do {
+ // Scanning for return address from stack pointer of the last frame.
+ if (!ScanForReturnAddress(last_sp, &caller_sp, &caller_pc, count)) {
+ // If we can't find an instruction pointer even with stack scanning,
+ // give up.
+ BPLOG(ERROR) << " ScanForReturnAddress failed ";
+ return NULL;
+ }
+ // Get $fp stored in the stack frame.
+ if (!memory_->GetMemoryAtAddress(caller_sp - sizeof(caller_pc),
+ &caller_fp)) {
+ BPLOG(INFO) << " GetMemoryAtAddress for fp failed " ;
+ return NULL;
+ }
+
+ count = count - (caller_sp - last_sp) / sizeof(caller_pc);
+ // Now scan the next address in the stack.
+ last_sp = caller_sp + sizeof(caller_pc);
+ } while ((caller_fp - caller_sp >= kMaxFrameStackSize) && count > 0);
+
+ if (!count) {
+ BPLOG(INFO) << " No frame found " ;
return NULL;
}
- count = count - (caller_sp - last_sp) / sizeof(caller_pc);
- // Now scan the next address in the stack.
- last_sp = caller_sp + sizeof(caller_pc);
- } while ((caller_fp - caller_sp >= kMaxFrameStackSize) && count > 0);
-
- if (!count) {
- BPLOG(INFO) << " No frame found " ;
- return NULL;
+ // ScanForReturnAddress found a reasonable return address. Advance
+ // $sp to the location above the one where the return address was
+ // found.
+ caller_sp += sizeof(caller_pc);
+ // caller_pc is actually containing $ra value;
+ // $pc is two instructions before $ra,
+ // so the caller_pc needs to be decremented accordingly.
+ caller_pc -= 2 * sizeof(caller_pc);
+
+ // Create a new stack frame (ownership will be transferred to the caller)
+ // and fill it in.
+ StackFrameMIPS* frame = new StackFrameMIPS();
+ frame->trust = StackFrame::FRAME_TRUST_SCAN;
+ frame->context = last_frame->context;
+ frame->context.epc = caller_pc;
+ frame->context_validity |= StackFrameMIPS::CONTEXT_VALID_PC;
+ frame->instruction = caller_pc;
+
+ frame->context.iregs[MD_CONTEXT_MIPS_REG_SP] = caller_sp;
+ frame->context_validity |= StackFrameMIPS::CONTEXT_VALID_SP;
+ frame->context.iregs[MD_CONTEXT_MIPS_REG_FP] = caller_fp;
+ frame->context_validity |= StackFrameMIPS::CONTEXT_VALID_FP;
+
+ frame->context.iregs[MD_CONTEXT_MIPS_REG_RA] =
+ caller_pc + 2 * sizeof(caller_pc);
+ frame->context_validity |= StackFrameMIPS::CONTEXT_VALID_RA;
+
+ return frame;
}
-
- // ScanForReturnAddress found a reasonable return address. Advance
- // $sp to the location above the one where the return address was
- // found.
- caller_sp += sizeof(caller_pc);
- // caller_pc is actually containing $ra value;
- // $pc is two instructions before $ra,
- // so the caller_pc needs to be decremented accordingly.
- caller_pc -= 2 * sizeof(caller_pc);
-
-
- // Create a new stack frame (ownership will be transferred to the caller)
- // and fill it in.
- StackFrameMIPS* frame = new StackFrameMIPS();
- frame->trust = StackFrame::FRAME_TRUST_SCAN;
- frame->context = last_frame->context;
- frame->context.epc = caller_pc;
- frame->context_validity |= StackFrameMIPS::CONTEXT_VALID_PC;
- frame->instruction = caller_pc;
-
- frame->context.iregs[MD_CONTEXT_MIPS_REG_SP] = caller_sp;
- frame->context_validity |= StackFrameMIPS::CONTEXT_VALID_SP;
- frame->context.iregs[MD_CONTEXT_MIPS_REG_FP] = caller_fp;
- frame->context_validity |= StackFrameMIPS::CONTEXT_VALID_FP;
-
- frame->context.iregs[MD_CONTEXT_MIPS_REG_RA] =
- caller_pc + 2 * sizeof(caller_pc);
- frame->context_validity |= StackFrameMIPS::CONTEXT_VALID_RA;
-
- return frame;
}
} // namespace google_breakpad
diff --git a/src/processor/stackwalker_mips64_unittest.cc b/src/processor/stackwalker_mips64_unittest.cc
new file mode 100644
index 00000000..2a9784bf
--- /dev/null
+++ b/src/processor/stackwalker_mips64_unittest.cc
@@ -0,0 +1,716 @@
+// Copyright (c) 2013, Google Inc.
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Original author: Veljko Mihailovic <veljko.mihailovic@imgtec.com>
+
+// stackwalker_mips64_unittest.cc: Unit tests for StackwalkerMIPS class for
+// mips64 platforms.
+
+#include <string.h>
+#include <string>
+#include <vector>
+
+#include "breakpad_googletest_includes.h"
+#include "common/test_assembler.h"
+#include "common/using_std_string.h"
+#include "google_breakpad/common/minidump_format.h"
+#include "google_breakpad/processor/basic_source_line_resolver.h"
+#include "google_breakpad/processor/call_stack.h"
+#include "google_breakpad/processor/code_module.h"
+#include "google_breakpad/processor/source_line_resolver_interface.h"
+#include "google_breakpad/processor/stack_frame_cpu.h"
+#include "processor/stackwalker_unittest_utils.h"
+#include "processor/stackwalker_mips.h"
+#include "processor/windows_frame_info.h"
+
+using google_breakpad::BasicSourceLineResolver;
+using google_breakpad::CallStack;
+using google_breakpad::CodeModule;
+using google_breakpad::StackFrameSymbolizer;
+using google_breakpad::StackFrame;
+using google_breakpad::StackFrameMIPS;
+using google_breakpad::Stackwalker;
+using google_breakpad::StackwalkerMIPS;
+using google_breakpad::SystemInfo;
+using google_breakpad::WindowsFrameInfo;
+using google_breakpad::test_assembler::kLittleEndian;
+using google_breakpad::test_assembler::Label;
+using google_breakpad::test_assembler::Section;
+using std::vector;
+using testing::_;
+using testing::AnyNumber;
+using testing::Return;
+using testing::SetArgumentPointee;
+using testing::Test;
+
+class StackwalkerMIPSFixture {
+ public:
+ StackwalkerMIPSFixture()
+ : stack_section(kLittleEndian),
+ // Give the two modules reasonable standard locations and names
+ // for tests to play with.
+ module1(0x00400000, 0x10000, "module1", "version1"),
+ module2(0x00500000, 0x10000, "module2", "version2") {
+ // Identify the system as a Linux system.
+ system_info.os = "Linux";
+ system_info.os_short = "linux";
+ system_info.os_version = "Observant Opossum"; // Jealous Jellyfish
+ system_info.cpu = "mips64";
+ system_info.cpu_info = "";
+
+ // Put distinctive values in the raw CPU context.
+ BrandContext(&raw_context);
+
+ // Create some modules with some stock debugging information.
+ modules.Add(&module1);
+ modules.Add(&module2);
+
+ // By default, none of the modules have symbol info; call
+ // SetModuleSymbols to override this.
+ EXPECT_CALL(supplier, GetCStringSymbolData(_, _, _, _, _))
+ .WillRepeatedly(Return(MockSymbolSupplier::NOT_FOUND));
+
+ // Avoid GMOCK WARNING "Uninteresting mock function call - returning
+ // directly" for FreeSymbolData().
+ EXPECT_CALL(supplier, FreeSymbolData(_)).Times(AnyNumber());
+
+ // Reset max_frames_scanned since it's static.
+ Stackwalker::set_max_frames_scanned(1024);
+ }
+
+ // Set the Breakpad symbol information that supplier should return for
+ // MODULE to INFO.
+ void SetModuleSymbols(MockCodeModule* module, const string& info) {
+ size_t buffer_size;
+ char* buffer = supplier.CopySymbolDataAndOwnTheCopy(info, &buffer_size);
+ EXPECT_CALL(supplier, GetCStringSymbolData(module, &system_info, _, _, _))
+ .WillRepeatedly(DoAll(SetArgumentPointee<3>(buffer),
+ SetArgumentPointee<4>(buffer_size),
+ Return(MockSymbolSupplier::FOUND)));
+ }
+
+ // Populate stack_region with the contents of stack_section. Use
+ // stack_section.start() as the region's starting address.
+ void RegionFromSection() {
+ string contents;
+ ASSERT_TRUE(stack_section.GetContents(&contents));
+ stack_region.Init(stack_section.start().Value(), contents);
+ }
+
+ // Fill RAW_CONTEXT with pseudo-random data, for round-trip checking.
+ void BrandContext(MDRawContextMIPS* raw_context) {
+ uint8_t x = 173;
+ for (size_t i = 0; i < sizeof(*raw_context); ++i)
+ reinterpret_cast<uint8_t*>(raw_context)[i] = (x += 17);
+ }
+
+ SystemInfo system_info;
+ MDRawContextMIPS raw_context;
+ Section stack_section;
+ MockMemoryRegion stack_region;
+ MockCodeModule module1;
+ MockCodeModule module2;
+ MockCodeModules modules;
+ MockSymbolSupplier supplier;
+ BasicSourceLineResolver resolver;
+ CallStack call_stack;
+ const vector<StackFrame*>* frames;
+};
+
+class SanityCheck: public StackwalkerMIPSFixture, public Test { };
+
+TEST_F(SanityCheck, NoResolver) {
+ raw_context.context_flags =
+ raw_context.context_flags | MD_CONTEXT_MIPS64_FULL;
+ stack_section.start() = 0x80000000;
+ stack_section.D64(0).D64(0x0);
+ RegionFromSection();
+ raw_context.epc = 0x00400020;
+ raw_context.iregs[MD_CONTEXT_MIPS_REG_SP] = 0x80000000;
+
+ StackFrameSymbolizer frame_symbolizer(NULL, NULL);
+ StackwalkerMIPS walker(&system_info, &raw_context, &stack_region, &modules,
+ &frame_symbolizer);
+ // This should succeed, even without a resolver or supplier.
+ vector<const CodeModule*> modules_without_symbols;
+ vector<const CodeModule*> modules_with_corrupt_symbols;
+ ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
+ &modules_with_corrupt_symbols));
+ ASSERT_EQ(1U, modules_without_symbols.size());
+ ASSERT_EQ("module1", modules_without_symbols[0]->debug_file());
+ ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
+ frames = call_stack.frames();
+ ASSERT_EQ(1U, frames->size());
+ StackFrameMIPS* frame = static_cast<StackFrameMIPS*>(frames->at(0));
+ // Check that the values from the original raw context made it
+ // through to the context in the stack frame.
+ EXPECT_EQ(0, memcmp(&raw_context, &frame->context, sizeof(raw_context)));
+}
+
+class GetContextFrame: public StackwalkerMIPSFixture, public Test { };
+
+TEST_F(GetContextFrame, Simple) {
+ raw_context.context_flags =
+ raw_context.context_flags | MD_CONTEXT_MIPS64_FULL;
+ stack_section.start() = 0x80000000;
+ stack_section.D64(0).D64(0x0);
+ RegionFromSection();
+ raw_context.epc = 0x00400020;
+ raw_context.iregs[MD_CONTEXT_MIPS_REG_SP] = 0x80000000;
+
+ StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
+ StackwalkerMIPS walker(&system_info, &raw_context, &stack_region, &modules,
+ &frame_symbolizer);
+ vector<const CodeModule*> modules_without_symbols;
+ vector<const CodeModule*> modules_with_corrupt_symbols;
+ ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
+ &modules_with_corrupt_symbols));
+ ASSERT_EQ(1U, modules_without_symbols.size());
+ ASSERT_EQ("module1", modules_without_symbols[0]->debug_file());
+ ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
+ frames = call_stack.frames();
+ StackFrameMIPS* frame = static_cast<StackFrameMIPS*>(frames->at(0));
+ // Check that the values from the original raw context made it
+ // through to the context in the stack frame.
+ EXPECT_EQ(0, memcmp(&raw_context, &frame->context, sizeof(raw_context)));
+}
+
+// The stackwalker should be able to produce the context frame even
+// without stack memory present.
+TEST_F(GetContextFrame, NoStackMemory) {
+ raw_context.context_flags =
+ raw_context.context_flags | MD_CONTEXT_MIPS64_FULL;
+ raw_context.epc = 0x00400020;
+ raw_context.iregs[MD_CONTEXT_MIPS_REG_SP] = 0x80000000;
+
+ StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
+ StackwalkerMIPS walker(&system_info, &raw_context, NULL, &modules,
+ &frame_symbolizer);
+ vector<const CodeModule*> modules_without_symbols;
+ vector<const CodeModule*> modules_with_corrupt_symbols;
+ ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
+ &modules_with_corrupt_symbols));
+ ASSERT_EQ(1U, modules_without_symbols.size());
+ ASSERT_EQ("module1", modules_without_symbols[0]->debug_file());
+ ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
+ frames = call_stack.frames();
+ StackFrameMIPS* frame = static_cast<StackFrameMIPS*>(frames->at(0));
+ // Check that the values from the original raw context made it
+ // through to the context in the stack frame.
+ EXPECT_EQ(0, memcmp(&raw_context, &frame->context, sizeof(raw_context)));
+}
+
+class GetCallerFrame: public StackwalkerMIPSFixture, public Test { };
+
+TEST_F(GetCallerFrame, ScanWithoutSymbols) {
+ raw_context.context_flags =
+ raw_context.context_flags | MD_CONTEXT_MIPS64_FULL;
+ // When the stack walker resorts to scanning the stack,
+ // only addresses located within loaded modules are
+ // considered valid return addresses.
+ // Force scanning through three frames to ensure that the
+ // stack pointer is set properly in scan-recovered frames.
+ stack_section.start() = 0x80000000;
+ uint64_t return_address1 = 0x00400100;
+ uint64_t return_address2 = 0x00400900;
+ Label frame1_sp, frame2_sp;
+ stack_section
+ // frame 0
+ .Append(32, 0) // space
+
+ .D64(0x00490000) // junk that's not
+ .D64(0x00600000) // a return address
+
+ .D64(frame1_sp) // stack pointer
+ .D64(return_address1) // actual return address
+ // frame 1
+ .Mark(&frame1_sp)
+ .Append(32, 0) // space
+
+ .D64(0xF0000000) // more junk
+ .D64(0x0000000D)
+
+ .D64(frame2_sp) // stack pointer
+ .D64(return_address2) // actual return address
+ // frame 2
+ .Mark(&frame2_sp)
+ .Append(64, 0); // end of stack
+ RegionFromSection();
+
+ raw_context.epc = 0x00405510;
+ raw_context.iregs[MD_CONTEXT_MIPS_REG_SP] = stack_section.start().Value();
+ raw_context.iregs[MD_CONTEXT_MIPS_REG_RA] = return_address1;
+
+ StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
+ StackwalkerMIPS walker(&system_info, &raw_context, &stack_region, &modules,
+ &frame_symbolizer);
+ vector<const CodeModule*> modules_without_symbols;
+ vector<const CodeModule*> modules_with_corrupt_symbols;
+ ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
+ &modules_with_corrupt_symbols));
+ ASSERT_EQ(1U, modules_without_symbols.size());
+ ASSERT_EQ("module1", modules_without_symbols[0]->debug_file());
+ ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
+ frames = call_stack.frames();
+ ASSERT_EQ(3U, frames->size());
+
+ StackFrameMIPS* frame0 = static_cast<StackFrameMIPS*>(frames->at(0));
+ EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
+ ASSERT_EQ(StackFrameMIPS::CONTEXT_VALID_ALL, frame0->context_validity);
+ EXPECT_EQ(0, memcmp(&raw_context, &frame0->context, sizeof(raw_context)));
+
+ StackFrameMIPS* frame1 = static_cast<StackFrameMIPS*>(frames->at(1));
+ EXPECT_EQ(StackFrame::FRAME_TRUST_SCAN, frame1->trust);
+ ASSERT_EQ((StackFrameMIPS::CONTEXT_VALID_PC |
+ StackFrameMIPS::CONTEXT_VALID_SP |
+ StackFrameMIPS::CONTEXT_VALID_FP |
+ StackFrameMIPS::CONTEXT_VALID_RA),
+ frame1->context_validity);
+ EXPECT_EQ(return_address1 - 2 * sizeof(return_address1), frame1->context.epc);
+ EXPECT_EQ(frame1_sp.Value(), frame1->context.iregs[MD_CONTEXT_MIPS_REG_SP]);
+
+ StackFrameMIPS* frame2 = static_cast<StackFrameMIPS*>(frames->at(2));
+ EXPECT_EQ(StackFrame::FRAME_TRUST_SCAN, frame2->trust);
+ ASSERT_EQ((StackFrameMIPS::CONTEXT_VALID_PC |
+ StackFrameMIPS::CONTEXT_VALID_SP |
+ StackFrameMIPS::CONTEXT_VALID_FP |
+ StackFrameMIPS::CONTEXT_VALID_RA),
+ frame2->context_validity);
+ EXPECT_EQ(return_address2 - 2 * sizeof(return_address2), frame2->context.epc);
+ EXPECT_EQ(frame2_sp.Value(), frame2->context.iregs[MD_CONTEXT_MIPS_REG_SP]);
+}
+
+TEST_F(GetCallerFrame, ScanWithFunctionSymbols) {
+ raw_context.context_flags =
+ raw_context.context_flags | MD_CONTEXT_MIPS64_FULL;
+ // During stack scanning, if a potential return address
+ // is located within a loaded module that has symbols,
+ // it is only considered a valid return address if it
+ // lies within a function's bounds.
+ stack_section.start() = 0x80000000;
+ uint64_t return_address = 0x00500200;
+ Label frame1_sp;
+ stack_section
+ // frame 0
+ .Append(16, 0) // space
+
+ .D64(0x00490000) // junk that's not
+ .D64(0x00600000) // a return address
+
+ .D64(0x00401000) // a couple of plausible addresses
+ .D64(0x0050F000) // that are not within functions
+
+ .D64(frame1_sp) // stack pointer
+ .D64(return_address) // actual return address
+ // frame 1
+ .Mark(&frame1_sp)
+ .Append(64, 0); // end of stack
+ RegionFromSection();
+
+ raw_context.epc = 0x00400200;
+ raw_context.iregs[MD_CONTEXT_MIPS_REG_SP] = stack_section.start().Value();
+ raw_context.iregs[MD_CONTEXT_MIPS_REG_RA] = return_address;
+
+ SetModuleSymbols(&module1,
+ // The youngest frame's function.
+ "FUNC 100 400 10 monotreme\n");
+ SetModuleSymbols(&module2,
+ // The calling frame's function.
+ "FUNC 100 400 10 marsupial\n");
+
+ StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
+ StackwalkerMIPS walker(&system_info, &raw_context, &stack_region, &modules,
+ &frame_symbolizer);
+ vector<const CodeModule*> modules_without_symbols;
+ vector<const CodeModule*> modules_with_corrupt_symbols;
+ ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
+ &modules_with_corrupt_symbols));
+ ASSERT_EQ(0U, modules_without_symbols.size());
+ ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
+ frames = call_stack.frames();
+ ASSERT_EQ(2U, frames->size());
+
+ StackFrameMIPS* frame0 = static_cast<StackFrameMIPS*>(frames->at(0));
+ EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
+ ASSERT_EQ(StackFrameMIPS::CONTEXT_VALID_ALL, frame0->context_validity);
+ EXPECT_EQ(0, memcmp(&raw_context, &frame0->context, sizeof(raw_context)));
+ EXPECT_EQ("monotreme", frame0->function_name);
+ EXPECT_EQ(0x00400100U, frame0->function_base);
+
+ StackFrameMIPS* frame1 = static_cast<StackFrameMIPS*>(frames->at(1));
+ EXPECT_EQ(StackFrame::FRAME_TRUST_SCAN, frame1->trust);
+ ASSERT_EQ((StackFrameMIPS::CONTEXT_VALID_PC |
+ StackFrameMIPS::CONTEXT_VALID_SP |
+ StackFrameMIPS::CONTEXT_VALID_FP |
+ StackFrameMIPS::CONTEXT_VALID_RA),
+ frame1->context_validity);
+ EXPECT_EQ(return_address - 2 * sizeof(return_address), frame1->context.epc);
+ EXPECT_EQ(frame1_sp.Value(), frame1->context.iregs[MD_CONTEXT_MIPS_REG_SP]);
+ EXPECT_EQ("marsupial", frame1->function_name);
+ EXPECT_EQ(0x00500100U, frame1->function_base);
+}
+
+TEST_F(GetCallerFrame, CheckStackFrameSizeLimit) {
+ raw_context.context_flags =
+ raw_context.context_flags | MD_CONTEXT_MIPS64_FULL;
+ // If the stackwalker resorts to stack scanning, it will scan only
+ // 1024 bytes of stack which correspondes to maximum size of stack frame.
+ stack_section.start() = 0x80000000;
+ uint64_t return_address1 = 0x00500100;
+ uint64_t return_address2 = 0x00500900;
+ Label frame1_sp, frame2_sp;
+ stack_section
+ // frame 0
+ .Append(32, 0) // space
+
+ .D64(0x00490000) // junk that's not
+ .D64(0x00600000) // a return address
+
+ .Append(96, 0) // more space
+
+ .D64(frame1_sp) // stack pointer
+ .D64(return_address1) // actual return address
+ // frame 1
+ .Mark(&frame1_sp)
+ .Append(128 * 4, 0) // space
+
+ .D64(0x00F00000) // more junk
+ .D64(0x0000000D)
+
+ .Append(128 * 4, 0) // more space
+
+ .D64(frame2_sp) // stack pointer
+ .D64(return_address2) // actual return address
+ // (won't be found)
+ // frame 2
+ .Mark(&frame2_sp)
+ .Append(64, 0); // end of stack
+ RegionFromSection();
+
+ raw_context.epc = 0x00405510;
+ raw_context.iregs[MD_CONTEXT_MIPS_REG_SP] = stack_section.start().Value();
+ raw_context.iregs[MD_CONTEXT_MIPS_REG_RA] = return_address1;
+
+ StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
+ StackwalkerMIPS walker(&system_info, &raw_context, &stack_region, &modules,
+ &frame_symbolizer);
+ vector<const CodeModule*> modules_without_symbols;
+ vector<const CodeModule*> modules_with_corrupt_symbols;
+ ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
+ &modules_with_corrupt_symbols));
+ ASSERT_EQ(2U, modules_without_symbols.size());
+ ASSERT_EQ("module1", modules_without_symbols[0]->debug_file());
+ ASSERT_EQ("module2", modules_without_symbols[1]->debug_file());
+ ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
+ frames = call_stack.frames();
+ ASSERT_EQ(2U, frames->size());
+
+ StackFrameMIPS* frame0 = static_cast<StackFrameMIPS*>(frames->at(0));
+ EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
+ ASSERT_EQ(StackFrameMIPS::CONTEXT_VALID_ALL, frame0->context_validity);
+ EXPECT_EQ(0, memcmp(&raw_context, &frame0->context, sizeof(raw_context)));
+
+ StackFrameMIPS* frame1 = static_cast<StackFrameMIPS*>(frames->at(1));
+ EXPECT_EQ(StackFrame::FRAME_TRUST_SCAN, frame1->trust);
+ ASSERT_EQ((StackFrameMIPS::CONTEXT_VALID_PC |
+ StackFrameMIPS::CONTEXT_VALID_SP |
+ StackFrameMIPS::CONTEXT_VALID_FP |
+ StackFrameMIPS::CONTEXT_VALID_RA),
+ frame1->context_validity);
+ EXPECT_EQ(return_address1 - 2 * sizeof(return_address1), frame1->context.epc);
+ EXPECT_EQ(frame1_sp.Value(), frame1->context.iregs[MD_CONTEXT_MIPS_REG_SP]);
+}
+
+// Test that set_max_frames_scanned prevents using stack scanning
+// to find caller frames.
+TEST_F(GetCallerFrame, ScanningNotAllowed) {
+ raw_context.context_flags =
+ raw_context.context_flags | MD_CONTEXT_MIPS64_FULL;
+ // When the stack walker resorts to scanning the stack,
+ // only fixed number of frames are allowed to be scanned out from stack
+ stack_section.start() = 0x80000000;
+ uint64_t return_address1 = 0x00500100;
+ uint64_t return_address2 = 0x00500900;
+ Label frame1_sp, frame2_sp;
+ stack_section
+ // frame 0
+ .Append(32, 0) // space
+
+ .D64(0x00490000) // junk that's not
+ .D64(0x00600000) // a return address
+
+ .Append(96, 0) // more space
+
+ .D64(frame1_sp) // stack pointer
+ .D64(return_address1) // actual return address
+ // frame 1
+ .Mark(&frame1_sp)
+ .Append(128 * 4, 0) // space
+
+ .D64(0x00F00000) // more junk
+ .D64(0x0000000D)
+
+ .Append(128 * 4, 0) // more space
+
+ .D64(frame2_sp) // stack pointer
+ .D64(return_address2) // actual return address
+ // (won't be found)
+ // frame 2
+ .Mark(&frame2_sp)
+ .Append(64, 0); // end of stack
+ RegionFromSection();
+
+ raw_context.epc = 0x00405510;
+ raw_context.iregs[MD_CONTEXT_MIPS_REG_SP] = stack_section.start().Value();
+ raw_context.iregs[MD_CONTEXT_MIPS_REG_RA] = return_address1;
+
+ StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
+ StackwalkerMIPS walker(&system_info, &raw_context, &stack_region, &modules,
+ &frame_symbolizer);
+ Stackwalker::set_max_frames_scanned(0);
+
+ vector<const CodeModule*> modules_without_symbols;
+ vector<const CodeModule*> modules_with_corrupt_symbols;
+ ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
+ &modules_with_corrupt_symbols));
+ ASSERT_EQ(1U, modules_without_symbols.size());
+ ASSERT_EQ("module1", modules_without_symbols[0]->debug_file());
+ ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
+ frames = call_stack.frames();
+ ASSERT_EQ(1U, frames->size());
+
+ StackFrameMIPS* frame0 = static_cast<StackFrameMIPS*>(frames->at(0));
+ EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
+ ASSERT_EQ(StackFrameMIPS::CONTEXT_VALID_ALL, frame0->context_validity);
+ EXPECT_EQ(0, memcmp(&raw_context, &frame0->context, sizeof(raw_context)));
+}
+
+struct CFIFixture: public StackwalkerMIPSFixture {
+ CFIFixture() {
+ // Provide some STACK CFI records;
+ SetModuleSymbols(&module1,
+ // The youngest frame's function.
+ "FUNC 4000 1000 0 enchiridion\n"
+ // Initially, nothing has been pushed on the stack,
+ // and the return address is still in the $ra register.
+ "STACK CFI INIT 4000 1000 .cfa: $sp 0 + .ra: $ra\n"
+ // Move stack pointer.
+ "STACK CFI 4004 .cfa: $sp 32 +\n"
+ // store $fp and ra
+ "STACK CFI 4008 $fp: .cfa -8 + ^ .ra: .cfa -4 + ^\n"
+ // restore $fp
+ "STACK CFI 400c .cfa: $fp 32 +\n"
+ // restore $sp
+ "STACK CFI 4018 .cfa: $sp 32 +\n"
+
+ "STACK CFI 4020 $fp: $fp .cfa: $sp 0 + .ra: .ra\n"
+
+ // The calling function.
+ "FUNC 5000 1000 0 epictetus\n"
+ // Mark it as end of stack.
+ "STACK CFI INIT 5000 8 .cfa: $sp 0 + .ra: $ra\n"
+
+ // A function whose CFI makes the stack pointer
+ // go backwards.
+ "FUNC 6000 1000 20 palinal\n"
+ "STACK CFI INIT 6000 1000 .cfa: $sp 4 - .ra: $ra\n"
+
+ // A function with CFI expressions that can't be
+ // evaluated.
+ "FUNC 7000 1000 20 rhetorical\n"
+ "STACK CFI INIT 7000 1000 .cfa: moot .ra: ambiguous\n"
+ );
+
+ // Provide some distinctive values for the caller's registers.
+ expected.epc = 0x00405500;
+ expected.iregs[MD_CONTEXT_MIPS_REG_S0] = 0x0;
+ expected.iregs[MD_CONTEXT_MIPS_REG_S1] = 0x1;
+ expected.iregs[MD_CONTEXT_MIPS_REG_S2] = 0x2;
+ expected.iregs[MD_CONTEXT_MIPS_REG_S3] = 0x3;
+ expected.iregs[MD_CONTEXT_MIPS_REG_S4] = 0x4;
+ expected.iregs[MD_CONTEXT_MIPS_REG_S5] = 0x5;
+ expected.iregs[MD_CONTEXT_MIPS_REG_S6] = 0x6;
+ expected.iregs[MD_CONTEXT_MIPS_REG_S7] = 0x7;
+ expected.iregs[MD_CONTEXT_MIPS_REG_SP] = 0x80000000;
+ expected.iregs[MD_CONTEXT_MIPS_REG_FP] = 0x80000000;
+ expected.iregs[MD_CONTEXT_MIPS_REG_RA] = 0x00405510;
+
+ // Expect CFI to recover all callee-save registers. Since CFI is the
+ // only stack frame construction technique we have, aside from the
+ // context frame itself, there's no way for us to have a set of valid
+ // registers smaller than this.
+ expected_validity = (StackFrameMIPS::CONTEXT_VALID_PC |
+ StackFrameMIPS::CONTEXT_VALID_S0 |
+ StackFrameMIPS::CONTEXT_VALID_S1 |
+ StackFrameMIPS::CONTEXT_VALID_S2 |
+ StackFrameMIPS::CONTEXT_VALID_S3 |
+ StackFrameMIPS::CONTEXT_VALID_S4 |
+ StackFrameMIPS::CONTEXT_VALID_S5 |
+ StackFrameMIPS::CONTEXT_VALID_S6 |
+ StackFrameMIPS::CONTEXT_VALID_S7 |
+ StackFrameMIPS::CONTEXT_VALID_SP |
+ StackFrameMIPS::CONTEXT_VALID_FP |
+ StackFrameMIPS::CONTEXT_VALID_GP |
+ StackFrameMIPS::CONTEXT_VALID_RA);
+
+ // By default, context frames provide all registers, as normal.
+ context_frame_validity = StackFrameMIPS::CONTEXT_VALID_ALL;
+
+ // By default, registers are unchanged.
+ raw_context = expected;
+ }
+
+ // Walk the stack, using stack_section as the contents of the stack
+ // and raw_context as the current register values. (Set the stack
+ // pointer to the stack's starting address.) Expect two stack
+ // frames; in the older frame, expect the callee-saves registers to
+ // have values matching those in 'expected'.
+ void CheckWalk() {
+ RegionFromSection();
+ raw_context.iregs[MD_CONTEXT_MIPS_REG_SP] = stack_section.start().Value();
+
+ StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
+ StackwalkerMIPS walker(&system_info, &raw_context, &stack_region,
+ &modules, &frame_symbolizer);
+ vector<const CodeModule*> modules_without_symbols;
+ vector<const CodeModule*> modules_with_corrupt_symbols;
+ ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
+ &modules_with_corrupt_symbols));
+ ASSERT_EQ(0U, modules_without_symbols.size());
+ ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
+ frames = call_stack.frames();
+ ASSERT_EQ(2U, frames->size());
+
+ StackFrameMIPS* frame0 = static_cast<StackFrameMIPS*>(frames->at(0));
+ EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
+ ASSERT_EQ(StackFrameMIPS::CONTEXT_VALID_ALL, frame0->context_validity);
+ EXPECT_EQ("enchiridion", frame0->function_name);
+ EXPECT_EQ(0x00404000U, frame0->function_base);
+
+ StackFrameMIPS* frame1 = static_cast<StackFrameMIPS*>(frames->at(1));
+ EXPECT_EQ(StackFrame::FRAME_TRUST_CFI, frame1->trust);
+ ASSERT_EQ(expected_validity, frame1->context_validity);
+ EXPECT_EQ(expected.iregs[MD_CONTEXT_MIPS_REG_S0],
+ frame1->context.iregs[MD_CONTEXT_MIPS_REG_S0]);
+ EXPECT_EQ(expected.iregs[MD_CONTEXT_MIPS_REG_S1],
+ frame1->context.iregs[MD_CONTEXT_MIPS_REG_S1]);
+ EXPECT_EQ(expected.iregs[MD_CONTEXT_MIPS_REG_S2],
+ frame1->context.iregs[MD_CONTEXT_MIPS_REG_S2]);
+ EXPECT_EQ(expected.iregs[MD_CONTEXT_MIPS_REG_S3],
+ frame1->context.iregs[MD_CONTEXT_MIPS_REG_S3]);
+ EXPECT_EQ(expected.iregs[MD_CONTEXT_MIPS_REG_S4],
+ frame1->context.iregs[MD_CONTEXT_MIPS_REG_S4]);
+ EXPECT_EQ(expected.iregs[MD_CONTEXT_MIPS_REG_S5],
+ frame1->context.iregs[MD_CONTEXT_MIPS_REG_S5]);
+ EXPECT_EQ(expected.iregs[MD_CONTEXT_MIPS_REG_S6],
+ frame1->context.iregs[MD_CONTEXT_MIPS_REG_S6]);
+ EXPECT_EQ(expected.iregs[MD_CONTEXT_MIPS_REG_S7],
+ frame1->context.iregs[MD_CONTEXT_MIPS_REG_S7]);
+ EXPECT_EQ(expected.iregs[MD_CONTEXT_MIPS_REG_FP],
+ frame1->context.iregs[MD_CONTEXT_MIPS_REG_FP]);
+ EXPECT_EQ(expected.iregs[MD_CONTEXT_MIPS_REG_RA],
+ frame1->context.iregs[MD_CONTEXT_MIPS_REG_RA]);
+ EXPECT_EQ(expected.iregs[MD_CONTEXT_MIPS_REG_SP],
+ frame1->context.iregs[MD_CONTEXT_MIPS_REG_SP]);
+ EXPECT_EQ(expected.epc, frame1->context.epc);
+ EXPECT_EQ(expected.epc, frame1->instruction);
+ EXPECT_EQ("epictetus", frame1->function_name);
+ EXPECT_EQ(0x00405000U, frame1->function_base);
+ }
+
+ // The values we expect to find for the caller's registers.
+ MDRawContextMIPS expected;
+
+ // The validity mask for expected.
+ int expected_validity;
+
+ // The validity mask to impose on the context frame.
+ int context_frame_validity;
+};
+
+class CFI: public CFIFixture, public Test { };
+
+// TODO(gordanac): add CFI tests
+
+TEST_F(CFI, At4004) {
+ raw_context.context_flags =
+ raw_context.context_flags | MD_CONTEXT_MIPS64_FULL;
+ Label frame1_sp = expected.iregs[MD_CONTEXT_MIPS_REG_SP];
+ stack_section
+ // frame0
+ .Append(16, 0) // space
+ .D64(frame1_sp) // stack pointer
+ .D64(0x00405510) // return address
+ .Mark(&frame1_sp); // This effectively sets stack_section.start().
+ raw_context.epc = 0x00404004;
+ CheckWalk();
+}
+
+// Check that we reject rules that would cause the stack pointer to
+// move in the wrong direction.
+TEST_F(CFI, RejectBackwards) {
+ raw_context.context_flags =
+ raw_context.context_flags | MD_CONTEXT_MIPS64_FULL;
+ raw_context.epc = 0x40005000;
+ raw_context.iregs[MD_CONTEXT_MIPS_REG_SP] = 0x80000000;
+ raw_context.iregs[MD_CONTEXT_MIPS_REG_RA] = 0x00405510;
+
+ StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
+ StackwalkerMIPS walker(&system_info, &raw_context, &stack_region, &modules,
+ &frame_symbolizer);
+ vector<const CodeModule*> modules_without_symbols;
+ vector<const CodeModule*> modules_with_corrupt_symbols;
+ ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
+ &modules_with_corrupt_symbols));
+ ASSERT_EQ(0U, modules_without_symbols.size());
+ ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
+ frames = call_stack.frames();
+ ASSERT_EQ(1U, frames->size());
+}
+
+// Check that we reject rules whose expressions' evaluation fails.
+TEST_F(CFI, RejectBadExpressions) {
+ raw_context.context_flags =
+ raw_context.context_flags | MD_CONTEXT_MIPS64_FULL;
+ raw_context.epc = 0x00407000;
+ raw_context.iregs[MD_CONTEXT_MIPS_REG_SP] = 0x80000000;
+ raw_context.iregs[MD_CONTEXT_MIPS_REG_RA] = 0x00405510;
+
+ StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
+ StackwalkerMIPS walker(&system_info, &raw_context, &stack_region, &modules,
+ &frame_symbolizer);
+ vector<const CodeModule*> modules_without_symbols;
+ vector<const CodeModule*> modules_with_corrupt_symbols;
+ ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
+ &modules_with_corrupt_symbols));
+ ASSERT_EQ(0U, modules_without_symbols.size());
+ ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
+ frames = call_stack.frames();
+ ASSERT_EQ(1U, frames->size());
+}
diff --git a/src/processor/stackwalker_mips_unittest.cc b/src/processor/stackwalker_mips_unittest.cc
index ed4be4f5..a172f17b 100644
--- a/src/processor/stackwalker_mips_unittest.cc
+++ b/src/processor/stackwalker_mips_unittest.cc
@@ -145,6 +145,7 @@ class StackwalkerMIPSFixture {
class SanityCheck: public StackwalkerMIPSFixture, public Test { };
TEST_F(SanityCheck, NoResolver) {
+ raw_context.context_flags = raw_context.context_flags | MD_CONTEXT_MIPS_FULL;
stack_section.start() = 0x80000000;
stack_section.D32(0).D32(0x0);
RegionFromSection();
@@ -173,6 +174,7 @@ TEST_F(SanityCheck, NoResolver) {
class GetContextFrame: public StackwalkerMIPSFixture, public Test { };
TEST_F(GetContextFrame, Simple) {
+ raw_context.context_flags = raw_context.context_flags | MD_CONTEXT_MIPS_FULL;
stack_section.start() = 0x80000000;
stack_section.D32(0).D32(0x0);
RegionFromSection();
@@ -199,6 +201,7 @@ TEST_F(GetContextFrame, Simple) {
// The stackwalker should be able to produce the context frame even
// without stack memory present.
TEST_F(GetContextFrame, NoStackMemory) {
+ raw_context.context_flags = raw_context.context_flags | MD_CONTEXT_MIPS_FULL;
raw_context.epc = 0x00400020;
raw_context.iregs[MD_CONTEXT_MIPS_REG_SP] = 0x80000000;
@@ -222,6 +225,7 @@ TEST_F(GetContextFrame, NoStackMemory) {
class GetCallerFrame: public StackwalkerMIPSFixture, public Test { };
TEST_F(GetCallerFrame, ScanWithoutSymbols) {
+ raw_context.context_flags = raw_context.context_flags | MD_CONTEXT_MIPS_FULL;
// When the stack walker resorts to scanning the stack,
// only addresses located within loaded modules are
// considered valid return addresses.
@@ -298,6 +302,7 @@ TEST_F(GetCallerFrame, ScanWithoutSymbols) {
}
TEST_F(GetCallerFrame, ScanWithFunctionSymbols) {
+ raw_context.context_flags = raw_context.context_flags | MD_CONTEXT_MIPS_FULL;
// During stack scanning, if a potential return address
// is located within a loaded module that has symbols,
// it is only considered a valid return address if it
@@ -366,6 +371,7 @@ TEST_F(GetCallerFrame, ScanWithFunctionSymbols) {
}
TEST_F(GetCallerFrame, CheckStackFrameSizeLimit) {
+ raw_context.context_flags = raw_context.context_flags | MD_CONTEXT_MIPS_FULL;
// If the stackwalker resorts to stack scanning, it will scan only
// 1024 bytes of stack which correspondes to maximum size of stack frame.
stack_section.start() = 0x80000000;
@@ -437,6 +443,7 @@ TEST_F(GetCallerFrame, CheckStackFrameSizeLimit) {
// Test that set_max_frames_scanned prevents using stack scanning
// to find caller frames.
TEST_F(GetCallerFrame, ScanningNotAllowed) {
+ raw_context.context_flags = raw_context.context_flags | MD_CONTEXT_MIPS_FULL;
// When the stack walker resorts to scanning the stack,
// only fixed number of frames are allowed to be scanned out from stack
stack_section.start() = 0x80000000;
@@ -518,9 +525,6 @@ struct CFIFixture: public StackwalkerMIPSFixture {
// The calling function.
"FUNC 5000 1000 0 epictetus\n"
- // Initially, nothing has been pushed on the stack,
- // and the return address is still in the $ra register.
- "STACK CFI INIT 5000 1000 .cfa: $sp .ra: $ra\n"
// Mark it as end of stack.
"STACK CFI INIT 5000 8 .cfa: $sp 0 + .ra: $ra\n"
@@ -646,6 +650,7 @@ class CFI: public CFIFixture, public Test { };
// TODO(gordanac): add CFI tests
TEST_F(CFI, At4004) {
+ raw_context.context_flags = raw_context.context_flags | MD_CONTEXT_MIPS_FULL;
Label frame1_sp = expected.iregs[MD_CONTEXT_MIPS_REG_SP];
stack_section
// frame0
@@ -660,6 +665,7 @@ TEST_F(CFI, At4004) {
// Check that we reject rules that would cause the stack pointer to
// move in the wrong direction.
TEST_F(CFI, RejectBackwards) {
+ raw_context.context_flags = raw_context.context_flags | MD_CONTEXT_MIPS_FULL;
raw_context.epc = 0x40005000;
raw_context.iregs[MD_CONTEXT_MIPS_REG_SP] = 0x80000000;
raw_context.iregs[MD_CONTEXT_MIPS_REG_RA] = 0x00405510;
@@ -679,6 +685,7 @@ TEST_F(CFI, RejectBackwards) {
// Check that we reject rules whose expressions' evaluation fails.
TEST_F(CFI, RejectBadExpressions) {
+ raw_context.context_flags = raw_context.context_flags | MD_CONTEXT_MIPS_FULL;
raw_context.epc = 0x00407000;
raw_context.iregs[MD_CONTEXT_MIPS_REG_SP] = 0x80000000;
raw_context.iregs[MD_CONTEXT_MIPS_REG_RA] = 0x00405510;
diff --git a/src/processor/stackwalker_ppc.cc b/src/processor/stackwalker_ppc.cc
index 7e208844..1e34c383 100644
--- a/src/processor/stackwalker_ppc.cc
+++ b/src/processor/stackwalker_ppc.cc
@@ -34,6 +34,7 @@
// Author: Mark Mentovai
+#include "common/scoped_ptr.h"
#include "processor/stackwalker_ppc.h"
#include "google_breakpad/processor/call_stack.h"
#include "google_breakpad/processor/memory_region.h"
@@ -121,7 +122,7 @@ StackFrame* StackwalkerPPC::GetCallerFrame(const CallStack* stack,
return NULL;
}
- StackFramePPC* frame = new StackFramePPC();
+ scoped_ptr<StackFramePPC> frame(new StackFramePPC());
frame->context = last_frame->context;
frame->context.srr0 = instruction;
@@ -130,6 +131,14 @@ StackFrame* StackwalkerPPC::GetCallerFrame(const CallStack* stack,
StackFramePPC::CONTEXT_VALID_GPR1;
frame->trust = StackFrame::FRAME_TRUST_FP;
+ // Should we terminate the stack walk? (end-of-stack or broken invariant)
+ if (TerminateWalk(instruction,
+ stack_pointer,
+ last_frame->context.gpr[1],
+ stack->frames()->size() == 1)) {
+ return NULL;
+ }
+
// frame->context.srr0 is the return address, which is one instruction
// past the branch that caused us to arrive at the callee. Set
// frame_ppc->instruction to four less than that. Since all ppc
@@ -139,7 +148,7 @@ StackFrame* StackwalkerPPC::GetCallerFrame(const CallStack* stack,
// return address value may access the context.srr0 field of StackFramePPC.
frame->instruction = frame->context.srr0 - 4;
- return frame;
+ return frame.release();
}
diff --git a/src/processor/stackwalker_ppc64.cc b/src/processor/stackwalker_ppc64.cc
index 51c71fe5..fb2bac3c 100644
--- a/src/processor/stackwalker_ppc64.cc
+++ b/src/processor/stackwalker_ppc64.cc
@@ -32,6 +32,7 @@
// See stackwalker_ppc64.h for documentation.
+#include "common/scoped_ptr.h"
#include "processor/stackwalker_ppc64.h"
#include "google_breakpad/processor/call_stack.h"
#include "google_breakpad/processor/memory_region.h"
@@ -112,7 +113,7 @@ StackFrame* StackwalkerPPC64::GetCallerFrame(const CallStack* stack,
return NULL;
}
- StackFramePPC64* frame = new StackFramePPC64();
+ scoped_ptr<StackFramePPC64> frame(new StackFramePPC64());
frame->context = last_frame->context;
frame->context.srr0 = instruction;
@@ -121,6 +122,14 @@ StackFrame* StackwalkerPPC64::GetCallerFrame(const CallStack* stack,
StackFramePPC64::CONTEXT_VALID_GPR1;
frame->trust = StackFrame::FRAME_TRUST_FP;
+ // Should we terminate the stack walk? (end-of-stack or broken invariant)
+ if (TerminateWalk(instruction,
+ stack_pointer,
+ last_frame->context.gpr[1],
+ stack->frames()->size() == 1)) {
+ return NULL;
+ }
+
// frame->context.srr0 is the return address, which is one instruction
// past the branch that caused us to arrive at the callee. Set
// frame_ppc64->instruction to eight less than that. Since all ppc64
@@ -130,7 +139,7 @@ StackFrame* StackwalkerPPC64::GetCallerFrame(const CallStack* stack,
// return address value may access the context.srr0 field of StackFramePPC64.
frame->instruction = frame->context.srr0 - 8;
- return frame;
+ return frame.release();
}
diff --git a/src/processor/stackwalker_sparc.cc b/src/processor/stackwalker_sparc.cc
index ff2ea75a..4de838af 100644
--- a/src/processor/stackwalker_sparc.cc
+++ b/src/processor/stackwalker_sparc.cc
@@ -111,6 +111,14 @@ StackFrame* StackwalkerSPARC::GetCallerFrame(const CallStack* stack,
return NULL;
}
+ // Should we terminate the stack walk? (end-of-stack or broken invariant)
+ if (TerminateWalk(instruction,
+ stack_pointer,
+ last_frame->context.g_r[14],
+ stack->frames()->size() == 1)) {
+ return NULL;
+ }
+
StackFrameSPARC* frame = new StackFrameSPARC();
frame->context = last_frame->context;
diff --git a/src/processor/stackwalker_unittest_utils.h b/src/processor/stackwalker_unittest_utils.h
index 73ceb199..3a92a5ea 100644
--- a/src/processor/stackwalker_unittest_utils.h
+++ b/src/processor/stackwalker_unittest_utils.h
@@ -48,6 +48,7 @@
#include "google_breakpad/processor/memory_region.h"
#include "google_breakpad/processor/symbol_supplier.h"
#include "google_breakpad/processor/system_info.h"
+#include "processor/linked_ptr.h"
class MockMemoryRegion: public google_breakpad::MemoryRegion {
public:
@@ -114,9 +115,12 @@ class MockCodeModule: public google_breakpad::CodeModule {
string debug_file() const { return code_file_; }
string debug_identifier() const { return code_file_; }
string version() const { return version_; }
- const google_breakpad::CodeModule *Copy() const {
+ google_breakpad::CodeModule *Copy() const {
abort(); // Tests won't use this.
}
+ virtual bool is_unloaded() const { return false; }
+ virtual uint64_t shrink_down_delta() const { return 0; }
+ virtual void SetShrinkDownDelta(uint64_t shrink_down_delta) {}
private:
uint64_t base_address_;
@@ -126,11 +130,11 @@ class MockCodeModule: public google_breakpad::CodeModule {
};
class MockCodeModules: public google_breakpad::CodeModules {
- public:
+ public:
typedef google_breakpad::CodeModule CodeModule;
typedef google_breakpad::CodeModules CodeModules;
- void Add(const MockCodeModule *module) {
+ void Add(const MockCodeModule *module) {
modules_.push_back(module);
}
@@ -157,9 +161,14 @@ class MockCodeModules: public google_breakpad::CodeModules {
return modules_.at(index);
}
- const CodeModules *Copy() const { abort(); } // Tests won't use this.
+ CodeModules *Copy() const { abort(); } // Tests won't use this
+
+ virtual std::vector<google_breakpad::linked_ptr<const CodeModule> >
+ GetShrunkRangeModules() const {
+ return std::vector<google_breakpad::linked_ptr<const CodeModule> >();
+ }
- private:
+ private:
typedef std::vector<const MockCodeModule *> ModuleVector;
ModuleVector modules_;
};
@@ -184,7 +193,7 @@ class MockSymbolSupplier: public google_breakpad::SymbolSupplier {
// Copies the passed string contents into a newly allocated buffer.
// The newly allocated buffer will be freed during destruction.
- char* CopySymbolDataAndOwnTheCopy(const std::string &info,
+ char* CopySymbolDataAndOwnTheCopy(const string &info,
size_t *symbol_data_size) {
*symbol_data_size = info.size() + 1;
char *symbol_data = new char[*symbol_data_size];
diff --git a/src/processor/stackwalker_x86.cc b/src/processor/stackwalker_x86.cc
index 29d98e4b..ed2b383d 100644
--- a/src/processor/stackwalker_x86.cc
+++ b/src/processor/stackwalker_x86.cc
@@ -200,13 +200,15 @@ StackFrameX86* StackwalkerX86::GetCallerByWindowsFrameInfo(
}
}
- // Set up the dictionary for the PostfixEvaluator. %ebp and %esp are used
- // in each program string, and their previous values are known, so set them
- // here.
+ // Set up the dictionary for the PostfixEvaluator. %ebp, %esp, and sometimes
+ // %ebx are used in program strings, and their previous values are known, so
+ // set them here.
PostfixEvaluator<uint32_t>::DictionaryType dictionary;
// Provide the current register values.
dictionary["$ebp"] = last_frame->context.ebp;
dictionary["$esp"] = last_frame->context.esp;
+ if (last_frame->context_validity & StackFrameX86::CONTEXT_VALID_EBX)
+ dictionary["$ebx"] = last_frame->context.ebx;
// Provide constants from the debug info for last_frame and its callee.
// .cbCalleeParams is a Breakpad extension that allows us to use the
// PostfixEvaluator engine when certain types of debugging information
@@ -330,11 +332,19 @@ StackFrameX86* StackwalkerX86::GetCallerByWindowsFrameInfo(
// evaluation. The stack will not be examined to locate a saved
// %ebp value, because these frames do not save (or use) %ebp.
//
+ // We also propagate %ebx through, as it is commonly unmodifed after
+ // calling simple forwarding functions in ntdll (that are this non-EBP
+ // using type). It's not clear that this is always correct, but it is
+ // important for some functions to get a correct walk.
+ //
// %eip_new = *(%esp_old + callee_params + saved_regs + locals)
// %esp_new = %esp_old + callee_params + saved_regs + locals + 4
// %ebp_new = %ebp_old
+ // %ebx_new = %ebx_old // If available.
program_string = "$eip .raSearchStart ^ = "
- "$esp .raSearchStart 4 + =";
+ "$esp .raSearchStart 4 + =";
+ if (last_frame->context_validity & StackFrameX86::CONTEXT_VALID_EBX)
+ program_string += " $ebx $ebx =";
recover_ebp = false;
}
@@ -649,15 +659,13 @@ StackFrame* StackwalkerX86::GetCallerFrame(const CallStack* stack,
if (!new_frame.get())
return NULL;
- // Treat an instruction address of 0 as end-of-stack.
- if (new_frame->context.eip == 0)
- return NULL;
-
- // If the new stack pointer is at a lower address than the old, then
- // that's clearly incorrect. Treat this as end-of-stack to enforce
- // progress and avoid infinite loops.
- if (new_frame->context.esp <= last_frame->context.esp)
+ // Should we terminate the stack walk? (end-of-stack or broken invariant)
+ if (TerminateWalk(new_frame->context.eip,
+ new_frame->context.esp,
+ last_frame->context.esp,
+ frames.size() == 1)) {
return NULL;
+ }
// new_frame->context.eip is the return address, which is the instruction
// after the CALL that caused us to arrive at the callee. Set
diff --git a/src/processor/stackwalker_x86_unittest.cc b/src/processor/stackwalker_x86_unittest.cc
index 008b496b..359f1c86 100644
--- a/src/processor/stackwalker_x86_unittest.cc
+++ b/src/processor/stackwalker_x86_unittest.cc
@@ -63,6 +63,7 @@ using google_breakpad::test_assembler::Section;
using std::vector;
using testing::_;
using testing::AnyNumber;
+using testing::DoAll;
using testing::Return;
using testing::SetArgumentPointee;
using testing::Test;
@@ -979,7 +980,8 @@ TEST_F(GetCallerFrame, WindowsFPOUnchangedEBP) {
EXPECT_EQ(StackFrame::FRAME_TRUST_CFI, frame1->trust);
ASSERT_EQ((StackFrameX86::CONTEXT_VALID_EIP
| StackFrameX86::CONTEXT_VALID_ESP
- | StackFrameX86::CONTEXT_VALID_EBP),
+ | StackFrameX86::CONTEXT_VALID_EBP
+ | StackFrameX86::CONTEXT_VALID_EBX),
frame1->context_validity);
EXPECT_EQ(0x40009b5bU, frame1->instruction + 1);
EXPECT_EQ(0x40009b5bU, frame1->context.eip);
@@ -1074,6 +1076,141 @@ TEST_F(GetCallerFrame, WindowsFPOUsedEBP) {
}
}
+// This is a regression test for FPO code that references the initial value of
+// EBX.
+TEST_F(GetCallerFrame, WindowsFPOReferencesEBX) {
+ MockCodeModule ntdll(0x776e0000, 0x142000, "ntdll", "ntdllver");
+ MockCodeModule kernel32(0x77250000, 0xd5000, "kernel32", "kernel32ver");
+ MockCodeModule chrome_child(0x5a710000, 0x2b7c000, "chrome_child",
+ "chrome_childver");
+ MockCodeModules modules;
+ modules.Add(&ntdll);
+ modules.Add(&kernel32);
+ modules.Add(&chrome_child);
+ SetModuleSymbols(&ntdll,
+ "PUBLIC 46bf4 0 KiFastSystemCallRet\n"
+ "STACK WIN 0 46bf4 1 0 0 0 0 0 0 0 0\n"
+
+ "PUBLIC 46550 10 NtWaitForKeyedEvent\n"
+ "STACK WIN 0 46550 f 0 0 10 0 0 0 0 0\n"
+
+ "PUBLIC 4965 10 RtlSleepConditionVariableSRW\n"
+
+ "STACK WIN 4 4965 23 23 0 10 8 38 0 1 $T0 $ebx = "
+ "$eip $T0 4 + ^ = $ebx $T0 ^ = $esp $T0 8 + = "
+ "$ebp $ebp ^ = $L $ebp = $P $T0 8 + .cbParams + =\n"
+
+ "STACK WIN 4 4988 e3 0 0 10 8 38 0 1 $T0 $ebx = "
+ "$eip $T0 4 + ^ = $ebx $T0 ^ = $esp $T0 8 + = "
+ "$ebp $ebp ^ = $L $ebp = $P $T0 8 + .cbParams + =\n"
+
+ "STACK WIN 4 4b2e b 0 0 10 8 38 0 1 $T0 $ebx = "
+ "$eip $T0 4 + ^ = $ebx $T0 ^ = $esp $T0 8 + = "
+ "$ebp $ebp ^ = $L $ebp = $P $T0 8 + .cbParams + =\n");
+
+ SetModuleSymbols(&kernel32,
+ "PUBLIC 3217a 10 SleepConditionVariableSRW\n"
+ "STACK WIN 4 3217a 40 8 0 10 0 8 0 1 $T0 $ebp = $eip $T0 4 "
+ "+ ^ = $ebp $T0 ^ = $esp $T0 8 + = $L $T0 .cbSavedRegs - = "
+ "$P $T0 8 + .cbParams + =\n");
+
+ SetModuleSymbols(&chrome_child,
+ "FUNC 4f4851 20 0 base::ConditionVariable::TimedWait\n");
+
+ stack_section.start() = 0x0026c048;
+ stack_section
+ .D32(0x7772655c)
+ .D32(0x776e4a3f)
+ .D32(0x00000000)
+ .D32(0x0026c070)
+ .D32(0x00000000)
+ .D32(0x00000000)
+ .D32(0x00000001)
+ .D32(0x0026c168)
+ .D32(0x00000000)
+ .D32(0x00000000)
+ .D32(0x00000000)
+ .D32(0x0026c070)
+ .D32(0x00000000)
+ .D32(0x00000000)
+ .D32(0x00000000)
+ .D32(0x0026c164)
+ .D32(0x00be0000)
+ .D32(0x0026fc60)
+ .D32(0x0026c164)
+ .D32(0x00000000)
+ .D32(0xfffffffe)
+ .D32(0x00000000)
+ .D32(0x0026c0d0)
+ .D32(0x7728219e)
+ .D32(0x000003e8)
+ .D32(0x00000000)
+ .D32(0x7728219e)
+ .D32(0x0026c168)
+ .D32(0x0026c164)
+ .D32(0x00000000)
+ .D32(0x00000000)
+ .D32(0x0026c168)
+ .D32(0x000003e8)
+ .D32(0x000003e8)
+ .D32(0x0026c0ec)
+ .D32(0x5ac0486c)
+ .D32(0x0026c168)
+ .D32(0x0026c108)
+ .D32(0x5ac0484c)
+ .D32(0x0026c100)
+ .D32(0x0026c160);
+
+ RegionFromSection();
+ raw_context.eip = 0x77726bf4; // in ntdll!KiFastSystemCallRet
+ raw_context.esp = stack_section.start().Value();
+ raw_context.ebp = 0x26c0a0;
+ raw_context.ebx = 0x26c0ac;
+
+ StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
+ StackwalkerX86 walker(&system_info, &raw_context, &stack_region, &modules,
+ &frame_symbolizer);
+ vector<const CodeModule *> modules_without_symbols;
+ vector<const CodeModule *> modules_with_corrupt_symbols;
+ ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
+ &modules_with_corrupt_symbols));
+ ASSERT_EQ(0U, modules_without_symbols.size());
+ ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
+ frames = call_stack.frames();
+
+ ASSERT_EQ(5U, frames->size());
+ {
+ const StackFrameX86 &frame = *static_cast<StackFrameX86 *>(frames->at(0));
+ EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame.trust);
+ EXPECT_EQ(0x77726bf4U, frame.context.eip);
+ EXPECT_EQ("KiFastSystemCallRet", frame.function_name);
+ }
+ {
+ const StackFrameX86 &frame = *static_cast<StackFrameX86 *>(frames->at(1));
+ EXPECT_EQ(StackFrame::FRAME_TRUST_CFI, frame.trust);
+ EXPECT_EQ(0x7772655cU, frame.context.eip);
+ EXPECT_EQ("NtWaitForKeyedEvent", frame.function_name);
+ }
+ {
+ const StackFrameX86 &frame = *static_cast<StackFrameX86 *>(frames->at(2));
+ EXPECT_EQ(StackFrame::FRAME_TRUST_CFI, frame.trust);
+ EXPECT_EQ(0x776e4a3fU, frame.context.eip);
+ EXPECT_EQ("RtlSleepConditionVariableSRW", frame.function_name);
+ }
+ {
+ const StackFrameX86 &frame = *static_cast<StackFrameX86 *>(frames->at(3));
+ EXPECT_EQ(StackFrame::FRAME_TRUST_CFI, frame.trust);
+ EXPECT_EQ(0x7728219eU, frame.context.eip);
+ EXPECT_EQ("SleepConditionVariableSRW", frame.function_name);
+ }
+ {
+ const StackFrameX86 &frame = *static_cast<StackFrameX86 *>(frames->at(4));
+ EXPECT_EQ(StackFrame::FRAME_TRUST_CFI, frame.trust);
+ EXPECT_EQ(0x5ac0486cU, frame.context.eip);
+ EXPECT_EQ("base::ConditionVariable::TimedWait", frame.function_name);
+ }
+}
+
// This is a regression unit test which covers a bug which has to do with
// FPO-optimized Windows system call stubs in the context frame. There is
// a more recent Windows system call dispatch mechanism which differs from
@@ -1205,7 +1342,8 @@ TEST_F(GetCallerFrame, WindowsFPOSystemCall) {
EXPECT_EQ(StackFrame::FRAME_TRUST_CFI, frame1->trust);
ASSERT_EQ((StackFrameX86::CONTEXT_VALID_EIP
| StackFrameX86::CONTEXT_VALID_ESP
- | StackFrameX86::CONTEXT_VALID_EBP),
+ | StackFrameX86::CONTEXT_VALID_EBP
+ | StackFrameX86::CONTEXT_VALID_EBX),
frame1->context_validity);
EXPECT_EQ(0x75fa0a91U, frame1->instruction + 1);
EXPECT_EQ(0x75fa0a91U, frame1->context.eip);
@@ -1228,9 +1366,9 @@ TEST_F(GetCallerFrame, WindowsFPOSystemCall) {
// Scan the stack for a better return address and potentially skip frames
// when the calculated return address is not in a known module. Note, that
-// the span of this scan is somewhat arbitrarily limited to 120 search words
-// for the context frame and 30 search words (pointers) for the other frames:
-// const int kRASearchWords = 30;
+// the span of this scan is somewhat arbitrarily limited to 160 search words
+// for the context frame and 40 search words (pointers) for the other frames:
+// const int kRASearchWords = 40;
// This means that frames can be skipped only when their size is relatively
// small: smaller than 4 * kRASearchWords * sizeof(InstructionType)
TEST_F(GetCallerFrame, ReturnAddressIsNotInKnownModule) {
diff --git a/src/processor/static_map_unittest.cc b/src/processor/static_map_unittest.cc
index 97b1e61a..393d43d5 100644
--- a/src/processor/static_map_unittest.cc
+++ b/src/processor/static_map_unittest.cc
@@ -180,7 +180,7 @@ class TestValidMap : public ::testing::Test {
void TearDown() {
for (int i = 0;i < kNumberTestCases; ++i)
- delete map_data[i];
+ ::operator delete(map_data[i]);
}
diff --git a/src/processor/symbolic_constants_win.cc b/src/processor/symbolic_constants_win.cc
index 333aa041..8cf283f6 100644
--- a/src/processor/symbolic_constants_win.cc
+++ b/src/processor/symbolic_constants_win.cc
@@ -33,17 +33,17 @@
//
// Author: Ben Wagner
-#include <cstdio>
#include <string>
+#include "common/stdio_wrapper.h"
#include "google_breakpad/common/breakpad_types.h"
#include "google_breakpad/common/minidump_exception_win32.h"
#include "processor/symbolic_constants_win.h"
namespace google_breakpad {
-std::string NTStatusToString(uint32_t ntstatus) {
- std::string reason;
+string NTStatusToString(uint32_t ntstatus) {
+ string reason;
// The content of this switch was created from ntstatus.h in the 8.1 SDK with
//
// egrep '#define [A-Z_0-9]+\s+\(\(NTSTATUS\)0xC[0-9A-F]+L\)' ntstatus.h
@@ -6406,7 +6406,7 @@ std::string NTStatusToString(uint32_t ntstatus) {
break;
default: {
char reason_string[11];
- std::snprintf(reason_string, sizeof(reason_string), "0x%08x", ntstatus);
+ snprintf(reason_string, sizeof(reason_string), "0x%08x", ntstatus);
reason = reason_string;
break;
}
diff --git a/src/processor/symbolic_constants_win.h b/src/processor/symbolic_constants_win.h
index c05c9169..3f4d38eb 100644
--- a/src/processor/symbolic_constants_win.h
+++ b/src/processor/symbolic_constants_win.h
@@ -38,12 +38,13 @@
#include <string>
+#include "common/using_std_string.h"
#include "google_breakpad/common/breakpad_types.h"
namespace google_breakpad {
/* Converts a NTSTATUS code to a reason string. */
-std::string NTStatusToString(uint32_t ntstatus);
+string NTStatusToString(uint32_t ntstatus);
} // namespace google_breakpad
diff --git a/src/processor/synth_minidump.cc b/src/processor/synth_minidump.cc
index 2cfbb088..aa86d248 100644
--- a/src/processor/synth_minidump.cc
+++ b/src/processor/synth_minidump.cc
@@ -41,10 +41,7 @@ Section::Section(const Dump &dump)
: test_assembler::Section(dump.endianness()) { }
void Section::CiteLocationIn(test_assembler::Section *section) const {
- if (this)
- (*section).D32(size_).D32(file_offset_);
- else
- (*section).D32(0).D32(0);
+ (*section).D32(size_).D32(file_offset_);
}
void Stream::CiteStreamIn(test_assembler::Section *section) const {
@@ -272,8 +269,14 @@ Module::Module(const Dump &dump,
D32(version_info.file_subtype);
D32(version_info.file_date_hi);
D32(version_info.file_date_lo);
- cv_record->CiteLocationIn(this);
- misc_record->CiteLocationIn(this);
+ if (cv_record)
+ cv_record->CiteLocationIn(this);
+ else
+ D32(0).D32(0);
+ if (misc_record)
+ misc_record->CiteLocationIn(this);
+ else
+ D32(0).D32(0);
D64(0).D64(0);
}
@@ -294,6 +297,26 @@ const MDVSFixedFileInfo Module::stock_version_info = {
0 // file_date_lo
};
+UnloadedModule::UnloadedModule(const Dump &dump,
+ uint64_t base_of_image,
+ uint32_t size_of_image,
+ const String &name,
+ uint32_t checksum,
+ uint32_t time_date_stamp) : Section(dump) {
+ D64(base_of_image);
+ D32(size_of_image);
+ D32(checksum);
+ D32(time_date_stamp);
+ name.CiteStringIn(this);
+}
+
+UnloadedModuleList::UnloadedModuleList(const Dump &dump, uint32_t type)
+ : List<UnloadedModule>(dump, type, false) {
+ D32(sizeof(MDRawUnloadedModuleList));
+ D32(sizeof(MDRawUnloadedModule));
+ D32(count_label_);
+}
+
Exception::Exception(const Dump &dump,
const Context &context,
uint32_t thread_id,
@@ -325,6 +348,7 @@ Dump::Dump(uint64_t flags,
stream_count_(0),
thread_list_(*this, MD_THREAD_LIST_STREAM),
module_list_(*this, MD_MODULE_LIST_STREAM),
+ unloaded_module_list_(*this, MD_UNLOADED_MODULE_LIST_STREAM),
memory_list_(*this, MD_MEMORY_LIST_STREAM)
{
D32(MD_HEADER_SIGNATURE);
@@ -372,9 +396,15 @@ Dump &Dump::Add(Module *module) {
return *this;
}
+Dump &Dump::Add(UnloadedModule *unloaded_module) {
+ unloaded_module_list_.Add(unloaded_module);
+ return *this;
+}
+
void Dump::Finish() {
if (!thread_list_.Empty()) Add(&thread_list_);
if (!module_list_.Empty()) Add(&module_list_);
+ if (!unloaded_module_list_.Empty()) Add(&unloaded_module_list_);
if (!memory_list_.Empty()) Add(&memory_list_);
// Create the stream directory. We don't use
diff --git a/src/processor/synth_minidump.h b/src/processor/synth_minidump.h
index 8dac8784..8f49cfff 100644
--- a/src/processor/synth_minidump.h
+++ b/src/processor/synth_minidump.h
@@ -270,6 +270,16 @@ class Module: public Section {
static const MDVSFixedFileInfo stock_version_info;
};
+class UnloadedModule: public Section {
+ public:
+ UnloadedModule(const Dump &dump,
+ uint64_t base_of_image,
+ uint32_t size_of_image,
+ const String &name,
+ uint32_t checksum = 0,
+ uint32_t time_date_stamp = 1262805309);
+};
+
class Exception : public Stream {
public:
Exception(const Dump &dump,
@@ -308,9 +318,20 @@ class List: public Stream {
private:
size_t count_;
+
+ protected:
+ // This constructor allows derived lists to specify their own layout
+ // rather than starting with count as specified in the public constructor.
+ List(const Dump &dump, uint32_t type, bool) : Stream(dump, type), count_(0) {}
+
Label count_label_;
};
+class UnloadedModuleList : public List<UnloadedModule> {
+ public:
+ UnloadedModuleList(const Dump &dump, uint32_t type);
+};
+
class Dump: public test_assembler::Section {
public:
@@ -333,6 +354,7 @@ class Dump: public test_assembler::Section {
Dump &Add(Memory *object); // append, record in memory list
Dump &Add(Thread *object); // append, record in thread list
Dump &Add(Module *object); // append, record in module list
+ Dump &Add(UnloadedModule *object); // append, record in unloaded module list
// Complete the construction of the minidump, given the Add calls
// we've seen up to this point. After this call, this Dump's
@@ -359,6 +381,10 @@ class Dump: public test_assembler::Section {
// Add(Module *) calls.
List<Module> module_list_;
+ // This minidump's unloaded module list. We construct this incrementally from
+ // Add(UnloadedModule *) calls.
+ UnloadedModuleList unloaded_module_list_;
+
// This minidump's memory list. We construct this incrementally from
// Add(Memory *) calls. This is actually a list of MDMemoryDescriptors,
// not memory ranges --- thus the odd type.
diff --git a/src/processor/testdata/linux_divide_by_zero.dmp b/src/processor/testdata/linux_divide_by_zero.dmp
new file mode 100644
index 00000000..e7b37cf2
--- /dev/null
+++ b/src/processor/testdata/linux_divide_by_zero.dmp
Binary files differ
diff --git a/src/processor/testdata/linux_executable_heap.dmp b/src/processor/testdata/linux_executable_heap.dmp
new file mode 100644
index 00000000..f8c807fa
--- /dev/null
+++ b/src/processor/testdata/linux_executable_heap.dmp
Binary files differ
diff --git a/src/processor/testdata/linux_executable_stack.dmp b/src/processor/testdata/linux_executable_stack.dmp
new file mode 100644
index 00000000..c424cb20
--- /dev/null
+++ b/src/processor/testdata/linux_executable_stack.dmp
Binary files differ
diff --git a/src/processor/testdata/linux_inside_module_exe_region1.dmp b/src/processor/testdata/linux_inside_module_exe_region1.dmp
new file mode 100644
index 00000000..62a74132
--- /dev/null
+++ b/src/processor/testdata/linux_inside_module_exe_region1.dmp
Binary files differ
diff --git a/src/processor/testdata/linux_inside_module_exe_region2.dmp b/src/processor/testdata/linux_inside_module_exe_region2.dmp
new file mode 100644
index 00000000..b8473e76
--- /dev/null
+++ b/src/processor/testdata/linux_inside_module_exe_region2.dmp
Binary files differ
diff --git a/src/processor/testdata/linux_jmp_to_0.dmp b/src/processor/testdata/linux_jmp_to_0.dmp
new file mode 100644
index 00000000..40e4b15f
--- /dev/null
+++ b/src/processor/testdata/linux_jmp_to_0.dmp
Binary files differ
diff --git a/src/processor/testdata/linux_jmp_to_module_not_exe_region.dmp b/src/processor/testdata/linux_jmp_to_module_not_exe_region.dmp
new file mode 100644
index 00000000..82e266b2
--- /dev/null
+++ b/src/processor/testdata/linux_jmp_to_module_not_exe_region.dmp
Binary files differ
diff --git a/src/processor/testdata/linux_null_dereference.dmp b/src/processor/testdata/linux_null_dereference.dmp
new file mode 100644
index 00000000..d216a802
--- /dev/null
+++ b/src/processor/testdata/linux_null_dereference.dmp
Binary files differ
diff --git a/src/processor/testdata/linux_outside_module.dmp b/src/processor/testdata/linux_outside_module.dmp
new file mode 100644
index 00000000..97f78bdd
--- /dev/null
+++ b/src/processor/testdata/linux_outside_module.dmp
Binary files differ
diff --git a/src/processor/testdata/linux_raise_sigabrt.dmp b/src/processor/testdata/linux_raise_sigabrt.dmp
new file mode 100644
index 00000000..7b6dde50
--- /dev/null
+++ b/src/processor/testdata/linux_raise_sigabrt.dmp
Binary files differ
diff --git a/src/processor/testdata/linux_stack_pointer_in_module.dmp b/src/processor/testdata/linux_stack_pointer_in_module.dmp
new file mode 100644
index 00000000..92b6c21a
--- /dev/null
+++ b/src/processor/testdata/linux_stack_pointer_in_module.dmp
Binary files differ
diff --git a/src/processor/testdata/linux_stack_pointer_in_stack.dmp b/src/processor/testdata/linux_stack_pointer_in_stack.dmp
new file mode 100644
index 00000000..f70b881f
--- /dev/null
+++ b/src/processor/testdata/linux_stack_pointer_in_stack.dmp
Binary files differ
diff --git a/src/processor/testdata/linux_stack_pointer_in_stack_alt_name.dmp b/src/processor/testdata/linux_stack_pointer_in_stack_alt_name.dmp
new file mode 100644
index 00000000..55b34e8a
--- /dev/null
+++ b/src/processor/testdata/linux_stack_pointer_in_stack_alt_name.dmp
Binary files differ
diff --git a/src/processor/testdata/linux_write_to_nonwritable_module.dmp b/src/processor/testdata/linux_write_to_nonwritable_module.dmp
new file mode 100644
index 00000000..46456acf
--- /dev/null
+++ b/src/processor/testdata/linux_write_to_nonwritable_module.dmp
Binary files differ
diff --git a/src/processor/testdata/linux_write_to_nonwritable_region_math.dmp b/src/processor/testdata/linux_write_to_nonwritable_region_math.dmp
new file mode 100644
index 00000000..6cf98610
--- /dev/null
+++ b/src/processor/testdata/linux_write_to_nonwritable_region_math.dmp
Binary files differ
diff --git a/src/processor/testdata/linux_write_to_outside_module.dmp b/src/processor/testdata/linux_write_to_outside_module.dmp
new file mode 100644
index 00000000..2ceeefb6
--- /dev/null
+++ b/src/processor/testdata/linux_write_to_outside_module.dmp
Binary files differ
diff --git a/src/processor/testdata/linux_write_to_outside_module_via_math.dmp b/src/processor/testdata/linux_write_to_outside_module_via_math.dmp
new file mode 100644
index 00000000..4663d3c2
--- /dev/null
+++ b/src/processor/testdata/linux_write_to_outside_module_via_math.dmp
Binary files differ
diff --git a/src/processor/testdata/linux_write_to_under_4k.dmp b/src/processor/testdata/linux_write_to_under_4k.dmp
new file mode 100644
index 00000000..a3ddd621
--- /dev/null
+++ b/src/processor/testdata/linux_write_to_under_4k.dmp
Binary files differ
diff --git a/src/processor/testdata/microdump-arm.dmp b/src/processor/testdata/microdump-arm.dmp
index 5f52e419..cd409d37 100644
--- a/src/processor/testdata/microdump-arm.dmp
+++ b/src/processor/testdata/microdump-arm.dmp
@@ -1,5 +1,6 @@
W/google-breakpad( 3745): -----BEGIN BREAKPAD MICRODUMP-----
W/google-breakpad( 3745): O A arm 02 armv7l OS VERSION INFO
+W/google-breakpad( 3745): G OpenGL ES 3.0 V@104.0 AU@ (GIT@Id3510ff6dc)|Qualcomm|Adreno (TM) 330
W/google-breakpad( 3745): S 0 FFEA68C0 FFEA6000 00002000
W/google-breakpad( 3745): S FFEA6000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080020000A000002CA705F728000000000000000A000000000000000000000028000000
W/google-breakpad( 3745): S FFEA6180 2168EAFFC59104F77C67EAFF7C62EAFF4062EAFF1E71B3AA040000001E71B3AA4062EAFF020000007C62EAFFD062EAFFE867EAFFFAFFFFFF8263EAFFC9A404F700000000000000000000000000000000000000008363EAFF000000005462EAFFFFFFFFFF7C67EAFF1E71B3AA00000000000000003B62EAFF800000000600000000000000000000003C62EAFF06000000000000001B71B3AA000000005C62EAFF0000000000000000000000004462EAFF80000000D4ED06F7000000000000000000000000000000000000000000000000000000000000000000000000E467EAFF00000000000000000000000000000000000000000000000000000000C862EAFF0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008263EAFF06000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
diff --git a/src/processor/testdata/microdump-mips32.dmp b/src/processor/testdata/microdump-mips32.dmp
new file mode 100644
index 00000000..1b02fa9f
--- /dev/null
+++ b/src/processor/testdata/microdump-mips32.dmp
@@ -0,0 +1,37 @@
+F/google-breakpad(11976): -----BEGIN BREAKPAD MICRODUMP-----
+F/google-breakpad(11976): V UNKNOWN:0.0.0.0
+F/google-breakpad(11976): O A mips 02 mips 3.0.8-g893bf16 #7 SMP PREEMPT Fri Jul 10 15:20:59 PDT 2015
+F/google-breakpad(11976): G UNKNOWN
+F/google-breakpad(11976): S 0 7F92FC38 7F92F000 00002000
+F/google-breakpad(11976): S 7F92F000 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+F/google-breakpad(11976): S 7F92F180 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+F/google-breakpad(11976): S 7F92F300 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000C801007701000000880140770000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000094020077010000008801407700000000880200770100000088014077000000005043BD770000000099999999000000000500000000000000030000000945BA7791F4927F0000000090F8927F90F4927F5043BD7700F8927F000000005432B67790F4927F00000000
+F/google-breakpad(11976): S 7F92F480 18000077000000005043BD77000000003100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000FFFFFFFF000000005043BD77000000009402B877FFFFFFFF0000400000004000000040000456B2774041C177000000005043BD7700000000FFFFFFFF9402B87700000000000000005043BD77C000407700000077700FB877000040006805B877E02FBA7700000000C8C6BA77000000005043BD77000000009402B877EC0EB877D02F007723000000C0004077FC0300000030B7770487B7775043BD77044BBF779402B8770000000000000000010000005043BD7700000000020000000000000000000077040000005043BD7754D2BC771E000000E00C4077
+F/google-breakpad(11976): S 7F92F600 D02F007701000000C0004077FC0300000030B7770487B777C0004077FC0300000030B7770487B77700000000010000005043BD770030B777000000000000000000000077370000000100000054D2BC770200000060024077C8004077888BB77717000000400A4077C8004077888BB7770100000054D2BC775043BD77A00140771000000000700377007003000030B777C00040772865BD775043BD77FC8CB777C0004077020000000070037780000000C00040772865BD77286AB77760024077C80040774CA4B777286AB777400A4077C80040774CA4B7775043BD7794D2BC770010000060300077C0004077020000005043BD77000000008001407702000000180000000000000028700377DCB0B77700000000000000000000000024AAB7775043BD7780D2BC7750300077180000000004000080D2BC77B8F7927F8C37BD7778D2BC77A0F8927F5043BD773C7EB9775043BD77B8F7927F9837BD779C37BD77B8F7927F8C37BD7778D2BC77A0F8927FE87BBC77307DB9770300000000000000
+F/google-breakpad(11976): S 7F92F780 5043BD77FF00000028700377000400005043BD77B8F7927F8C37BD77E03ABD7798A4BA770000000070A7BA7784A6BA7700000000A8A8BA77E87BBC776090B67702000000A0F8927FE03ABD770445BA77A4F9927FA0F9927F7CD2BC77E87BBC7728A6BF7778F5B5778004000000040000A4F9927FF4E0B5775043BD77F844BA77A0F8927F070000005043BD770400BC77A0F8927F070000005043BD77E03ABD775043BD77D0F4B577E03ABD7788EEB5775043BD77E03ABD7700000000E03ABD775043BD7700000000A002007701000000880140770445BA77A4F9927F64DCB3775043BD770000000002000000A0F8927F5043BD770445BA77A4F9927F02000000A0F8927F5426B2779402B877FFFFFFFFA0F9927FA4F9927F5043BD770456B277736F667469727100313736373431313720302032363138303938203020313436D002007701000000880140773431383020313136383631335043BD772031333136373332504E00775043BD77C000000000000000040000000000000000000000
+F/google-breakpad(11976): S 7F92F900 0000000024AAB777302030203020302030203020302032335043BD7720302030203020382865BD774000000000010000800000000030BD77504E00771800000050000000004E007702000000100000007CD2BC77E87BBC7728A6BF772C60B9772030203020302030020000000030BD7700000000000000005043BD776CD2BC7740000000DCDEB877203020302030203020302030203020305043BD7720302000010000008CD2BC775043BD77010000005043BD77000000005043BD770030BD77008D4077400000000030BD770030BD770030BD77E4F9B777A8C8B877F0C2B1775043BD770030BD775043BD77010000005043BD770000000000000000C000407768D2BC7770D2BC7702000000C4CFB877FCD185095043BD775043BD77FCD185095043BD7758F1B177C0004077144FB177D02F007701000000C0004077FC0300000030B7770487B77707000000AC50B17700000000B452C07700000000010000005043BD77B866B177040000000000000000000077380000000100000054D2BC77
+F/google-breakpad(11976): S 7F92FA80 0100000000024077C8004077888BB7770300000060CDC0775043BD7788C2BE770100000003000000D02F007704000000C0004077FC0300000030B7770487B777C00040772865BD775043BD77FC8CB77700000000010000005043BD77400000005043BD770400000000400000204E00775043BD7700000000000000000400000000000000000000000000000024AAB7770010000030D9BE7704000000040000005043BD7700024077009003772865BD7700000000000000000000000000000000204E00770800000020000000004E00770000000000000000EC17C87700E0C77700E0C7772C60B9774489B7770100000000000000588AB77700000000000000005043BD770800000000000000DCDEB8775043BD7701000000400D4077004000005043BD77009003770000000048B7B7775043BD770450C0775043BD77DCDEB877080000080020C177A80600002090C877040000000100000054FC927F0400000000E0C77784CBC177B00DC177C011BF772090C877000000000800000830800377
+F/google-breakpad(11976): S 7F92FC00 000000003828C17700000000000000002472C376E4FC927F5043BD775014C177E4FC927F004000005014C17700E0C77700E0C7778C2BC177C4FC927FC4FC927FC4FC927FC4FC927F2090C877C4FC927FC4FC927FEC10C17700000000E4FD927F010000006C11C1772090C8772472C3760100000000000000E86A98771012C177B0FC927FA821C77700000000000000000000000001000000FFFFFFFF080000002090C8770090BE7700500200E4FD927F03000000FFFFFFFF00000000000000000000000000000000000000000000000014000000FFFFFFFF000000000000000000000000000000006C0FC177000000000000000003000000FFFFFFFF00000000000000000000000000000000000000000000000000000000FFFFFFFF00000000000000000000000000000000030000000400000034FD927F34FD927F0000000040FD927F40FD927F0000000013AD8CAFECFD927F6465B177010000000000000000000000000000005043BD778B0000000100000060C7C077FFFFFFFFE86A9877
+F/google-breakpad(11976): S 7F92FD80 00E09677500EC1771C40C07700000000F0FB927F0090C0772090C877CCEDBE77480DC877500DC877580DC877600DC877680DC87700E0967701000000DC0DC1770100000000000000E86A987764B1BE7700000000000000000000000000000000010000007E0B937F000000008E0B937FA00B937FB30B937FD60B937FE10B937FFC0B937F070C937F1E0C937F370C937F4B0C937F640C937FE30C937FFD0C937FB90E937FCE0E937FE10E937F0D0F937F370F937F470F937F510F937F8E0F937FAD0F937FC20F937F000000001000000000000000060000000010000011000000640000000300000034E0C0770400000020000000050000000B000000070000000090BE77080000000000000009000000B00DC1770B000000000000000C000000000000000D000000000000000E00000000000000170000000000000019000000D8FE927F1F000000EC0F937F00000000000000000000000013AD8CAF8ABDF68B3A80A7E02317024E000000000000000000000000000000000000000000000000
+F/google-breakpad(11976): S 7F92FF00 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+F/google-breakpad(11976): S 7F930080 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+F/google-breakpad(11976): S 7F930200 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+F/google-breakpad(11976): S 7F930380 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+F/google-breakpad(11976): S 7F930500 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+F/google-breakpad(11976): S 7F930680 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+F/google-breakpad(11976): S 7F930800 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+F/google-breakpad(11976): S 7F930980 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+F/google-breakpad(11976): S 7F930B00 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002E2F63726173685F6578616D706C65005F3D2E2F63726173685F6578616D706C6500414E44524F49445F444154413D2F64617461005345434F4E444152595F53544F524147453D2F73746F726167652F7364636172643100484F4D453D2F6461746100414E44524F49445F4153534554533D2F73797374656D2F617070005445524D3D767431303000414E44524F49445F534F434B45545F616462643D313000414E44524F49445F53544F524147453D2F73746F72616765004D4B53483D2F73797374656D2F62696E2F7368004C4F4F505F4D4F554E54504F494E543D2F6D6E742F6F62620053595354454D534552564552434C415353504154483D2F7379737465
+F/google-breakpad(11976): S 7F930C80 6D2F6672616D65776F726B2F73657276696365732E6A61723A2F73797374656D2F6672616D65776F726B2F65746865726E65742D736572766963652E6A61723A2F73797374656D2F6672616D65776F726B2F776966692D736572766963652E6A617200415345435F4D4F554E54504F494E543D2F6D6E742F6173656300424F4F54434C415353504154483D2F73797374656D2F6672616D65776F726B2F636F72652D6C69626172742E6A61723A2F73797374656D2F6672616D65776F726B2F636F6E7363727970742E6A61723A2F73797374656D2F6672616D65776F726B2F6F6B687474702E6A61723A2F73797374656D2F6672616D65776F726B2F636F72652D6A756E69742E6A61723A2F73797374656D2F6672616D65776F726B2F626F756E6379636173746C652E6A61723A2F73797374656D2F6672616D65776F726B2F6578742E6A61723A2F73797374656D2F6672616D65776F726B2F6672616D65776F726B2E6A61723A2F73797374656D2F6672616D65776F726B2F74656C657068
+F/google-breakpad(11976): S 7F930E00 6F6E792D636F6D6D6F6E2E6A61723A2F73797374656D2F6672616D65776F726B2F766F69702D636F6D6D6F6E2E6A61723A2F73797374656D2F6672616D65776F726B2F696D732D636F6D6D6F6E2E6A61723A2F73797374656D2F6672616D65776F726B2F6D6D732D636F6D6D6F6E2E6A61723A2F73797374656D2F6672616D65776F726B2F616E64726F69642E706F6C6963792E6A61723A2F73797374656D2F6672616D65776F726B2F6170616368652D786D6C2E6A6172005348454C4C3D2F73797374656D2F62696E2F736800414E44524F49445F424F4F544C4F474F3D3100454D554C415445445F53544F524147455F534F555243453D2F6D6E742F7368656C6C2F656D756C6174656400454D554C415445445F53544F524147455F5441524745543D2F73746F726167652F656D756C6174656400484F53544E414D453D6E706D38303100555345523D726F6F7400504154483D2F7362696E3A2F76656E646F722F62696E3A2F73797374656D2F7362696E3A2F73797374656D2F62696E
+F/google-breakpad(11976): S 7F930F80 3A2F73797374656D2F7862696E00414E44524F49445F50524F50455254595F574F524B53504143453D382C3000414E44524F49445F524F4F543D2F73797374656D0045585445524E414C5F53544F524147453D2F73746F726167652F656D756C617465642F6C6567616379002E2F63726173685F6578616D706C650000000000
+F/google-breakpad(11976): C 0E0004000000000000000000000000000100000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000006830007700000000683000770000000068300077000000002865BD770000000000000000000000002870037700000000284400000000000000000000000000003044000000000000ECFD927F00000000E4FD927F0000000001000000000000006C11C1770000000001000000000000002472C376000000000100000000000000000000000000000001000000000000005810C17700000000000000000000000000000000000000002090C8770000000038FC927F00000000E86A987700000000EC10C177000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000007C10C1770000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+F/google-breakpad(11976): M 77C0E000 00000000 0006D000 8F36148CC4647A8116CAF2A25F591F570 crash_example
+F/google-breakpad(11976): M 77A9B000 00000000 00012000 3A1A14AAD5B1EB3BC54F2E1C36CE3ACB0 libnetd_client.so
+F/google-breakpad(11976): M 77ACD000 00000000 00012000 E8FC3CD6F45E059AD5849A4BEE176D0F0 libstdc++.so
+F/google-breakpad(11976): M 77ADF000 00000000 00024000 07C6570597295683DE36D8FE97E6AEC30 libm.so
+F/google-breakpad(11976): M 77B03000 00000000 000CB000 D1E0DFA8390BAADD25564F8B0E139FF90 libc.so
+F/google-breakpad(11976): M 77BD7000 00000000 00012000 EC0B4DDBEFC52282C34AF60EEEB8EAAA0 liblog.so
+F/google-breakpad(11976): M 77BE9000 00000000 00014000 8C70B1BF8FBAC1170EB21E350AB2E7580 linker
+F/google-breakpad(11976): -----END BREAKPAD MICRODUMP-----
+
diff --git a/src/processor/testdata/microdump-mips64.dmp b/src/processor/testdata/microdump-mips64.dmp
new file mode 100644
index 00000000..e8ead871
--- /dev/null
+++ b/src/processor/testdata/microdump-mips64.dmp
@@ -0,0 +1,26 @@
+02-23 15:49:14.700 1740 1739 F google-breakpad: -----BEGIN BREAKPAD MICRODUMP-----
+02-23 15:49:14.700 1740 1739 F google-breakpad: V UNKNOWN:0.0.0.0
+02-23 15:49:14.702 1740 1739 F google-breakpad: O A mips64 01 mips64 3.10.0-gf185e20 #112 PREEMPT Mon Oct 5 11:12:49 PDT 2015
+02-23 15:49:14.702 1740 1739 F google-breakpad: G UNKNOWN
+02-23 15:49:14.702 1740 1739 F google-breakpad: S 0 000000FFFFCCF650 000000FFFFCCF000 0000000000001000
+02-23 15:49:14.707 1740 1739 F google-breakpad: S 000000FFFFCCF000 FF0000000000000000301DF1FF00000040701DF1FF0000008C7216F1FF000000704F1DF1FF00000000301DF1FF000000604F1DF1FF000000E0511DF1FF00000040701DF1FF0000001C2E16F1FF00000080501DF1FF000000A04F1DF1FF00000090501DF1FF000000E0511DF1FF000000C08416F1FF0000000000000000000000B0501DF1FF000000C08416F1FF0000000000000000000000C0501DF1FF000000C08416F1FF000000000000000000000008521DF1FF000000C08416F1FF0000000000000000000000F8511DF1FF000000C08416F1FF000000000000000000000000000000000000001000F5F0FF0000001000F5F0FF0000001000F5F0FF0000000800F5F0FF0000000010F5F0FF00000001000000000000000010F5F0FF0000000010F5F0FF0000000800F5F0FF0000000010F5F0FF0000000800F5F0FF0000000010F5F0FF0000000010F5F0FF0000000010F5F0FF0000001010F5F0FF0000001010F5F0FF0000000010F5F0FF0000000800F5F0FF0000000010F5F0FF000000
+02-23 15:49:14.708 1740 1739 F google-breakpad: S 000000FFFFCCF180 0010F5F0FF0000000010F5F0FF0000001010F5F0FF0000001010F5F0FF0000000010F5F0FF0000000800F5F0FF000000306042F1FF00000018F4CCFFFF00000018F4CCFFFF0000001010F5F0FF000000306042F1FF000000000000000000000018F4CCFFFF00000018F4CCFFFF000000000000000000000018F4CCFFFF0000000000000000000000000000000000000020F4CCFFFF00000000000000000000000010F5F0FF00000020F4CCFFFF0000000010F5F0FF00000020F4CCFFFF0000000810F5F0FF00000028F4CCFFFF0000000810F5F0FF00000028F4CCFFFF0000000010F5F0FF0000001010F5F0FF0000001010F5F0FF00000018F4CCFFFF00000030F4CCFFFF00000030F4CCFFFF0000001010F5F0FF00000030F4CCFFFF0000001010F5F0FF00000030F4CCFFFF0000000010F5F0FF0000000010F5F0FF000000306042F1FF00000060DF38F1FF000000A8F4CCFFFF0000000010F5F0FF0000000040000000000000880000000000000078462EF1FF000000D06B28F1FF000000
+02-23 15:49:14.710 1740 1739 F google-breakpad: S 000000FFFFCCF300 01000000000000001010F5F0FF0000000010F5F0FF0000001010F5F0FF0000001010F5F0FF0000000010F5F0FF0000000010F5F0FF000000FFFFFFFFFFFFFF1F0010F5F0FF0000000010F5F0FF0000000010F5F0FF0000001010F5F0FF0000001010F5F0FF000000000000000000000018F4CCFFFF00000000F3CCFFFF00000018F4CCFFFF00000000F3CCFFFF0000000010F5F0FF0000000800F5F0FF000000A8F4CCFFFF0000001010F5F0FF0000000800F5F0FF000000A8F4CCFFFF000000A8F4CCFFFF0000001010F5F0FF0000000800F5F0FF000000A8F4CCFFFF000000A8F4CCFFFF0000001010F5F0FF0000000800F5F0FF000000A8F4CCFFFF000000A8F4CCFFFF00000008000000000000000800F5F0FF00000000000000000000000000000000000000000000000000000000000000000000001010F5F0FF00000078F8CCFFFF00000088F8CCFFFF000000306042F1FF00000024BB38F1FF000000FFFFFFFF0100000000000000000000005CA138F1FF0000000000000000000000
+02-23 15:49:14.711 1740 1739 F google-breakpad: S 000000FFFFCCF480 A8F6CCFFFF00000008F7CCFFFF000000404538F1FF000000344E33F1FF0000004B3838F1FF00000008F7CCFFFF00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000098F7CCFFFF00000098F7CCFFFF00000098F7CCFFFF00000098F7CCFFFF00000098F7CCFFFF00000098F7CCFFFF00000098F7CCFFFF000000A8F7CCFFFF000000A8F7CCFFFF000000A8F7CCFFFF000000B0F7CCFFFF000000B0F7CCFFFF000000B0F7CCFFFF000000B0F7CCFFFF000000B0F7CCFFFF000000B0F7CCFFFF000000B0F7CCFFFF000000C0F7CCFFFF000000C0F7CCFFFF000000C0F7CCFFFF0000000010F5F0FF0000000010F5F0FF0000000010F5F0FF0000001010F5F0FF0000001010F5F0FF0000001010F5F0FF0000000010F5F0FF0000000010F5F0FF0000001010F5F0FF0000001010F5F0FF000000389732F1FF000000E09432F1FF00000011000000000000001900000000000000389432F1FF0000007C9432F1FF000000
+02-23 15:49:14.713 1740 1739 F google-breakpad: S 000000FFFFCCF600 50C537F1FF000000C8F6CCFFFF0000000000000000000000C8F6CCFFFF000000D100000003000000C8F6CCFFFF000000C8F6CCFFFF000000C8F6CCFFFF000000C8F6CCFFFF000000C8F6CCFFFF000000C8F6CCFFFF0000000000000000000000306042F1FF000000B0A238F1FF00000078F8CCFFFF0000000000000000000000306042F1FF000000B0A338F1FF00000078F8CCFFFF0000000000000001000000000000000000000003000000FFFFFFFF0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000FFFFFFFFFFFFFFFF00000000000000000000000000000000000000000000000000000000000000005CA138F1FF0000000000000000000000000000000000000003000000FFFFFFFF0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000FFFFFFFFFFFFFFFF00000000000000000000000000000000
+02-23 15:49:14.715 1740 1739 F google-breakpad: S 000000FFFFCCF780 00000000000000000000000000000000030000000400000098F7CCFFFF00000098F7CCFFFF0000000000000000000000B0F7CCFFFF000000B0F7CCFFFF0000000000000000000000EF89807E722BAE6F0820BAECFF00000078F8CCFFFF00000080462EF1FF000000ACBB1FF1FF00000008D537F1FF000000FFFFFFFFFFFFFFFF06261800000000000020B8ECFF000000306042F1FF0000003CA038F1FF000000D8DC41F1FF000000E8DC41F1FF000000F8DC41F1FF00000048C472ECFF000000306042F1FF000000D09F38F1FF0000000626180000000000443333F1FF000000404538F1FF000000000000000000000001000000000000000AFCCCFFFF00000000000000000000001AFCCCFFFF0000002CFCCCFFFF0000003FFCCCFFFF00000053FCCCFFFF0000005EFCCCFFFF00000068FCCCFFFF0000007DFCCCFFFF00000088FCCCFFFF0000009DFCCCFFFF000000B0FCCCFFFF000000C7FCCCFFFF000000E2FCCCFFFF0000008AFECCFFFF000000A4FECCFFFF000000BBFECCFFFF000000
+02-23 15:49:14.716 1740 1739 F google-breakpad: S 000000FFFFCCF900 D3FECCFFFF000000F4FECCFFFF0000000DFFCCFFFF0000004AFFCCFFFF000000C9FFCCFFFF00000000000000000000001000000000000000030000000000000006000000000000000010000000000000110000000000000064000000000000000300000000000000402038F1FF0000000400000000000000380000000000000005000000000000000B000000000000000700000000000000009032F1FF000000080000000000000000000000000000000900000000000000A09F38F1FF0000000B0000000000000000000000000000000C0000000000000000000000000000000D0000000000000000000000000000000E00000000000000000000000000000017000000000000000000000000000000190000000000000040FACCFFFF0000001F00000000000000E8FFCCFFFF00000000000000000000000000000000000000EF89807E722BAE6F9B236B56712BD221000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+02-23 15:49:14.717 1740 1739 F google-breakpad: S 000000FFFFCCFA80 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+02-23 15:49:14.719 1740 1739 F google-breakpad: S 000000FFFFCCFC00 000000000000000000002E2F63726173685F6578616D706C65005F3D2E2F63726173685F6578616D706C6500414E44524F49445F444154413D2F64617461004D4B53483D2F73797374656D2F62696E2F736800484F4D453D2F6461746100555345523D726F6F7400414E44524F49445F524F4F543D2F73797374656D005445524D3D787465726D005348454C4C3D2F73797374656D2F62696E2F736800414E44524F49445F424F4F544C4F474F3D3100544D504449523D2F646174612F6C6F63616C2F746D7000414E44524F49445F4153534554533D2F73797374656D2F61707000424F4F54434C415353504154483D2F73797374656D2F6672616D65776F726B2F636F72652D6C69626172742E6A61723A2F73797374656D2F6672616D65776F726B2F636F6E7363727970742E6A61723A2F73797374656D2F6672616D65776F726B2F6F6B687474702E6A61723A2F73797374656D2F6672616D65776F726B2F636F72652D6A756E69742E6A61723A2F73797374656D2F6672616D65776F72
+02-23 15:49:14.720 1740 1739 F google-breakpad: S 000000FFFFCCFD80 6B2F626F756E6379636173746C652E6A61723A2F73797374656D2F6672616D65776F726B2F6578742E6A61723A2F73797374656D2F6672616D65776F726B2F6672616D65776F726B2E6A61723A2F73797374656D2F6672616D65776F726B2F74656C6570686F6E792D636F6D6D6F6E2E6A61723A2F73797374656D2F6672616D65776F726B2F766F69702D636F6D6D6F6E2E6A61723A2F73797374656D2F6672616D65776F726B2F696D732D636F6D6D6F6E2E6A61723A2F73797374656D2F6672616D65776F726B2F6170616368652D786D6C2E6A61723A2F73797374656D2F6672616D65776F726B2F6F72672E6170616368652E687474702E6C65676163792E626F6F742E6A617200415345435F4D4F554E54504F494E543D2F6D6E742F6173656300414E44524F49445F534F434B45545F616462643D313000484F53544E414D453D67656E657269635F6D69707336340045585445524E414C5F53544F524147453D2F73746F726167652F73646361726400414E44524F49445F53544F52
+02-23 15:49:14.720 1740 1739 F google-breakpad: S 000000FFFFCCFF00 4147453D2F73746F7261676500504154483D2F7362696E3A2F76656E646F722F62696E3A2F73797374656D2F7362696E3A2F73797374656D2F62696E3A2F73797374656D2F7862696E0053595354454D534552564552434C415353504154483D2F73797374656D2F6672616D65776F726B2F73657276696365732E6A61723A2F73797374656D2F6672616D65776F726B2F65746865726E65742D736572766963652E6A61723A2F73797374656D2F6672616D65776F726B2F776966692D736572766963652E6A617200414E44524F49445F50524F50455254595F574F524B53504143453D392C30002E2F63726173685F6578616D706C65000000000000000000
+02-23 15:49:14.723 1740 1739 F google-breakpad: C 0E000800000000000000000000000000010000000000000000000000000000000100000000000000000000000000000038F241F1FF0000000000FFFFFFFFFFFF0000000000000000FFFF000000000000FCFFFFFFFFFFFFFF00000000000000000100000000000000010000000000000000000000000000000100000000000000010000000000000078F8CCFFFF00000088F8CCFFFF00000001000000000000001CA338F1FF00000000001000000000000820BAECFF00000048C472ECFF0000000000000000000000000000000000000028A238F1FF00000010000000000000000000000000000000306042F1FF00000050F6CCFFFF0000000626180000000000B0A238F1FF0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004CA238F1FF00000000000000000000000000000000000000FFFFFFFFFFFFFF7FFFFFFFFFFFFFFF7FFFFFFFFFFFFFFF7FFFFFFFFFFFFFFF7FFFFFFFFFFFFFFF7FFFFFFFFFFFFFFF7FFFFFFFFFFFFFFF7FFFFFFFFFFFFFFF7FFFFFFFFFFFFFFF7FFFFFFFFFFFFFFF7FFFFFFFFFFFFFFF7FFFFFFFFFFFFFFF7FFFFFFFFFFFFFFF7FFFFFFFFFFFFFFF7FFFFFFFFFFFFFFF7FFFFFFFFFFFFFFF7FFFFFFFFFFFFFFF7FFFFFFFFFFFFFFF7FFFFFFFFFFFFFFF7FFFFFFFFFFFFFFF7FFFFFFFFFFFFFFF7FFFFFFFFFFFFFFF7FFFFFFFFFFFFFFF7FFFFFFFFFFFFFFF7FFFFFFFFFFFFFFF7FFFFFFFFFFFFFFF7FFFFFFFFFFFFFFF7FFFFFFFFFFFFFFF7FFFFFFFFFFFFFFF7FFFFFFFFFFFFFFF7FFFFFFFFFFFFFFF7FFFFFFFFFFFFFFF7F0000000000000000
+02-23 15:49:14.725 1740 1739 F google-breakpad: M 000000FFF1382000 0000000000000000 0000000000081000 6E72E2F1A5F59AB3D51356FDFE394D490 crash_example
+02-23 15:49:14.725 1740 1739 F google-breakpad: M 000000FFF0FE2000 0000000000000000 0000000000014000 3C1F908C8C62D8A2EBFC12D8AF285F670 libnetd_client.so
+02-23 15:49:14.726 1740 1739 F google-breakpad: M 000000FFF1016000 0000000000000000 000000000005D000 F53A8A43C039FF5DB65F78E97ADAAE000 libm.so
+02-23 15:49:14.726 1740 1739 F google-breakpad: M 000000FFF1073000 0000000000000000 0000000000014000 906759235C65BD24385BA1376F1C4A0D0 libstdc++.so
+02-23 15:49:14.726 1740 1739 F google-breakpad: M 000000FFF1083000 0000000000000000 0000000000150000 FF1D9D1DA2F0B636817320E78C3E2AF20 libc++.so
+02-23 15:49:14.726 1740 1739 F google-breakpad: M 000000FFF11D6000 0000000000000000 0000000000109000 3A55BF92DE1E4C51F6F6140479CFA5080 libc.so
+02-23 15:49:14.726 1740 1739 F google-breakpad: M 000000FFF12ED000 0000000000000000 000000000001C000 44F1FB3127301036FA2EFE040F09CF6C0 liblog.so
+02-23 15:49:14.726 1740 1739 F google-breakpad: M 000000FFF1329000 0000000000000000 000000000003A000 519DF595D6558C61E962693B460A31C80 linker64
+02-23 15:49:14.726 1740 1739 F google-breakpad: -----END BREAKPAD MICRODUMP-----
diff --git a/src/processor/testdata/microdump-multiple.dmp b/src/processor/testdata/microdump-multiple.dmp
new file mode 100644
index 00000000..5bdc0572
--- /dev/null
+++ b/src/processor/testdata/microdump-multiple.dmp
@@ -0,0 +1,197 @@
+02-25 07:54:01.688 F/google-breakpad(13589): M F6F86000 00000000 00032000 9475E844ABDBBE3B512F5232E393E5590 libbinder.so
+02-25 07:54:01.688 F/google-breakpad(13589): M F6FB8000 00000000 0000A000 51CB626B9BC61903D8FB79C054262BA70 liblog.so
+02-25 07:54:01.688 F/google-breakpad(13589): M F6FC2000 00000000 0001B000 9E35C45774B38BC266DAB3081CB02E890 libutils.so
+02-25 07:54:01.688 F/google-breakpad(13589): M F6FDD000 00000000 00011000 B4E57058D30C724FB546974E8F0D99690 libcutils.so
+02-25 07:54:01.688 F/google-breakpad(13589): M F7019000 00000000 00020000 143F053EC6AACF47A289E950D893D9EE0 linker
+02-25 07:54:01.688 F/google-breakpad(13589): -----END BREAKPAD MICRODUMP-----
+02-25 07:59:17.030 F/google-breakpad(16162): -----BEGIN BREAKPAD MICRODUMP-----
+02-25 07:59:17.030 F/google-breakpad(16162): V WebView:48.0.2564.106
+02-25 07:59:17.030 F/google-breakpad(16162): O A arm 06 armv8l lge/p1_tmo_us/p1:6.0/MRA58K/1603210524c8d:user/release-keys
+02-25 07:59:17.030 F/google-breakpad(16162): G OpenGL ES 3.1 V@136.0 (GIT@I86756fd4a8)|Qualcomm|Adreno (TM) 418
+02-25 07:59:17.030 F/google-breakpad(16162): S 0 C3A397E8 C3A39000 00002000
+02-25 07:59:17.034 F/google-breakpad(16162): S C3A39000 60000000C1AF24E50000000000000000CC5E93CD0C000000CC90A3C30000000000000000000000006094A3C3000000000100000000000000208644C501000000AC90A3C3000000005C9CA3C300000000C0CEDDF6B490A3C30000000001000000CC90A3C3000000000086E5C00200000002000000DC90A3C3A490A3C34097A3C34497A3C3A490A3C388BD54E55097A3C30091A3C3010000000000000001000000C0CEDDF6010000000091A3C3000000000091A3C30091A3C300000000010000000100000000000000F490A3C300000000000000000100000001000000000000000000000001000000010000000400000000000000010000005091A3C30000000008C5BBBB00000000000000000000000000000000000000000000000000000000000000002000000020000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+02-25 07:59:17.034 F/google-breakpad(16162): S C3A39180 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+02-25 07:59:17.035 F/google-breakpad(16162): S C3A39300 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000091A3C3700C93CD000000002000000000000000000000000000000000000000000000000F00000000000000
+02-25 07:59:17.035 F/google-breakpad(16162): S C3A39480 000000000000000000809ABB000000000000000080000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000010000000100000020000000010000001C0000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000AA92CDA48644C500000000A48644C500000000C3FB25E5340000005CE6DAC0A44310CE55FB25E5FC67A8CD00000000EC014BCEE7F51BE50C531FC2E04310CE00000000D0064BCE01000000004310CE000000000100000001000000DC23000001000000000000000C531FC297FD1BE5000000800000000002000000004310CE208644C588BD54E5030000000C531FC2
+02-25 07:59:17.036 F/google-breakpad(16162): S C3A39600 18531FC20C00000000301FC218531FC20C531FC21C96A3C30000008000301FC20000000000301FC28053D9C000000000400000004897A3C3010000006C9CA3C301000000D30418E5D689F39BD6C00300000000BE0320BE1F180000006F300000000000006C9CA3C3010000000000000001000000000000004097A3C34897A3C301000000971518E54097A3C34497A3C35097A3C3D30418E5D688F39B4097A3C34497A3C30100000000000000010000000100000000301FC28053D9C001000000DC9DA3C301000000000000000000000069B717E56C97A3C3010000000000000000000000BC9CA3C369B717E5000000005097A3C30000000001000000ABAAAAAA00000000000000005C97A3C39A4F1FC20000000020989BD5010000000100000000000000000000004C97A3C30000000088BD54E50100000008280000F18FDBF600000000000000000030000003000000010000000100000000000000000000000000000001000000010000000000000000000000000000000000000000000000
+02-25 07:59:17.036 F/google-breakpad(16162): S C3A39780 00000000000000009897A3C3010000000000000000000000010000000100000001000000010000000100000000000000000000000828000000001AC200000000007F82E408280000008004C22168F2E408280000008004C200001AC2CECD01E50100000001000000000000000000FFFF000000000000000000000000000000000000000000000000007F82E44046F4C3D08004C294160000000000005008000090150000CECD01E501CE01E5048CFDE46ACD01E502000000000000000000000000000000D08104C2408D04C200000000000000000000000000000000B407000050080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+02-25 07:59:17.037 F/google-breakpad(16162): S C3A39900 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000010000000100000000000000BC9CA3C30000000000301FC26C9CA3C3E51D18E50000000000000000000000000000000000000000000000000000000000000000000000000000000001000000010000000100000001000000010000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000001000000010000000100000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000D08904C22C8A04C2888A04C200000000E48A04C20000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+02-25 07:59:17.037 F/google-breakpad(16162): S C3A39A80 408B04C20000000000000000010000000100000001000000FC9BA3C30200000000301FC200000000000000000000000001000000010000000100000001000000304F66D5D0B018F40000000000000000040000003C0000000100000001000000010000003C0000000300000067C1DAF625000000009BA3C3A1C257E534091CC0649BA3C31C000000F052DEF6000000000000000000000000000000000000000000000000DC9504C2389604C2949604C2000000000400000024A3A3C31F7518E50200000024A3A3C3000000000000000000000000004310CEBC9CA3C30000000000301FC2040000000004000000000000000100000080030000E0ABCD000000001401000000000000482C87C500000000400773F30080030000E0ABCD9485DDF61402000000000000482C87C50000000000E7DAC04DEEDAF60000000014010000400100000000000000000000800200000025DDF6130200004001000014020000482C87C580020000402C87C5400773F30025DDF6CD9FDBF61402000000000000
+02-25 07:59:17.037 F/google-breakpad(16162): S C3A39C00 000000000000000000E0ABCD41BB25E5308B0000408B000020000000000100001F000000100000006000000010000000000100000100000001000000010000000000000000000000000000000000000000000000010000000100000000000000000000000100000001000000050000005C9CA3C3000000000086E5C00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007C02E4F3FFFFFFFF3813C8F3FFFFFFFF3C12C8F3FFFFFFFF941170F3010000004405D8F400000000000000000000000000000000000000000000000000010000C0B0EBC0C0CEDDF68CA1A3C3000000000037F2E790A1A3C388A1A3C300020000C0B0EBC0C0CEDDF68CA1A3C3000000000037F2E790A1A3C388A1A3C355B24ADD000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+02-25 07:59:17.038 F/google-breakpad(16162): S C3A39D80 000000000000000000000000000000000000000028D7D056C1000000BD214CDD3E0AACDEFFFFFFFFB421B22D4A00000054010000000000003E0AACDE0000000084000000409EA3C360FE4ACE78FE4ACE0000000000000000000000000000000088A1A3C3DCD7A1B2409EA3C30100000010ED5CCF409EA3C3C017B5D4089FA3000000000010ED5CCFF0E1D2C389ABCDEFFEDCBA9876543210409EA3C3689EA3C36E3066B42DC2BDAB9656B500CF56A0C900000000689EA3C3B0A0A3C3C0CEDDF6F0E1D2C3000000000000000038000000000000007FE94ADDD89FA3C37C9EA3C3B0A0A3C319EA4ADD7D330C8F234046F4EAD5458272B2B035AC7BDDE189C4831AA004025082FB2C80FF5109419643AC1A000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000C00100000000000000000000800300000000000000000000000700000000000080030000000000004046F4C300000000001C0000
+02-25 07:59:17.038 F/google-breakpad(16162): S C3A39F00 00000000C0CEDDF6349FA3C34046F4C3007F82E4000000000828000000001AC20000000075FCEEE40000000000000000000000000000000000000000000000000400000000000000000000000000000004000000DCD7A1B2000000004046F4C30828000000001AC200001AC20828000000000000BFEDF2E400000000007F82E4082800004046F4C35082CBF34055E6F3006610CED16B1CE500001AC2006610CE4C6610CE00301FC200001AC240870000082800002F6F1BE5082800004C6610CE00301FC200301FC2006610CE0000000000001AC2F39317E50828000008280000B0A0A3C37D381AE500001AC24087000001000000C8A0A3C3406693CD006793CD88A0A3C3797A16E5082800009CA0A3C320A0A3C308280000C06193CDC06193CDB0A0A3C301000000F823F6DEA9E651DD0828000000000000B0A0A3C30000000058A0A3C39CA0A3C3C0CEDDF601000000F42E66D570A0A3C30C53DEF6402C87C59485DDF6482C87C5806691C09FA7DBF62100000014000000806691C0739E4ADD
+02-25 07:59:17.039 F/google-breakpad(16162): S C3A3A080 02000000E86373F364A04321DAAA00899A15B6BF55337DFB8AAB0941F101072981F46CF1416F8EB9B27C5A0C04375D8689C4831AA004025082FB2C80FF5109419643AC1ADCD7A1B2198D4ADD209319C2C0DAF3DED9E551DD20114BCE18A1A3C3F42E66D500000000E813F6DE195952DD889319C2A09319C200000000F42E66D5C91653DDC0CEDDF6A4E5C55294000000A09319C2889319C2A4E5C55294000000482C87C5006D93CD00E0ABCD010000000C53DEF6402C87C59485DDF6C000000054DABDDEC10500002D040000009EE5C0C10500009803000000A4E5C0DCD7A1B20000000000000000002C66D5209319C2D0A1A3C300000000010000000500000012000000175650DD3F000000002C66D5410000003FF14FDD0C53DEF6402C87C59485DDF6482C87C500DC64D19FA7DBF6C1000000BD000000006D93CDDCD7A1B2006793CD00000000304F66D503000000A1E5C5529400000000AC58C508E246D2006610CE00000000002C66D51BF34BDD0100000000AC58C500301FC202000000
+02-25 07:59:17.039 F/google-breakpad(16162): S C3A3A200 1001000088010000A003B8C003000000002C66D50500000012000000815750DD795750DD11F650DD0CA3A3C31080E7DE1080E7DEC0CEDDF60000000002090CC086E4C5529400000000000000C0CEDDF6D0104BCEC1F255DD606691C0E97C87DD377C87DDC0CEDDF60000000004000000FCA2A3C30900000001000000A0A2A3C3010000007BC557E5317787DD00000000317787DD00000000317787DD0000000009000000FCA2A3C304000000377C87DD9485DDF6406691C00312F6DEC897F6DE00000000A0FF4ACEA40000000D7D87DD00000040DCD7A1B214A3A3C3106373F3F10051DD000000000000B8C0C0CEDDF668A3A3C3F70000000A0000002FFB4DDD0CA3A3C386E4C55294000000000000000000000080C190D30000000086E4C55294000000755D51DD010000000C70F6D2C0CEDDF653B84EDD10A4A3C3D386B0DDE0004BCE0000000054A3A3C300000000DCA3A3C3406691C0D8A3A3C3DF4C87DDDCA3A3C380A6F7CE86E4C5529400000056000000B8A5A3C3A4000000A4000000
+02-25 07:59:17.040 F/google-breakpad(16162): S C3A3A380 406691C07182B0DD00000000A4000000090000000000000002000000A400000009000000000000000200000059000000090000003F194CDD1712F6DEDCD7A1B2002C66D580A6F7CE2C23F7DE1712F6DE7CA4A3C30000000058A5A3C3F70000000A00000071913DDDA573B0DD000000005D913DDD0578B0DD20A4A3C3B8E4ABCDC0CEDDF6239DB0DDF653E3A50000000000000000B3351B70090000003F194CDD00000000090000000000000064DFA7DE200000009ECF2560C1000000BD214CDD6C63AFDEFFFFFFFFB0AB05534200000030010000000000006C63AFDE00000000D007000074A4A3C3A4000000090000000000000002000000580000009CA4A3C350A5A3C3084617F468A5A3C350A5A3C301000000084617F480A6F7CE0100000068A5A3C301000000010000000C70F6D2C0CEDDF64B95B0DD0795B0DD020000009C7214F4DCD7A1B200000000F081CBF3F081CBF3943217F4000000000000000060FE4ACE492C4CDD00000000B8A5A3C3D0A5A3C3D4A5A3C300000000B8A5A3C3
+02-25 07:59:17.040 F/google-breakpad(16162): S C3A3A500 9CA5A3C3D0A5A3C30C70F6D201000000A4A5A3C30800000001000000D199B0DD419CB0DD0000000060332BC500E0ABCD08000000482C87C59485DDF600000000809BBDDE1379DBF60400000060332BC5F70000000A00000000000000000000000000000009000000486CCBF3000000000000000060FE4ACE00000000F0A6A3C3C04517F4419CB0DD00000000C7C852DD804FA8CD603217F440DA64D1A05C45D20000000019C752DDAC5C45D2D04517F4D0A5A3C3C4A5A3C3A4000000A4000000AC5C45D2000000000000000000000000F081CBF3000000000000000001000000C1000000DCD7A1B260332BC540DA64D1F84517F480A6F7CE084617F460332BC5010000000C70F6D2809BBDDE975FB0DDE86254D9D4F95CCF000000000100000060FE4ACE492C4CDD40A6A3C3E86254D910A8A3C350A6A3C3F0A6A3C3E86254D900000000000000000C70F6D2E12C4CDD00000000DCD7A1B24411F6DE10A8A3C3F0A6A3C3E8A6A3C3EB11F6DEA870F6D200000000E33F49DD00E0ABCDC0CEDDF6
+02-25 07:59:17.041 F/google-breakpad(16162): S C3A3A680 C0CEDDF684CEDDF610A7A3C300000000C0CEDDF6C0CEDDF6C0CEDDF684CEDDF60000000054A7A3C3C0CEDDF6DDBBD7F676D7C552940000000000000000000000C0C2B852940000000000000000000000000000009400000000000000000000006541B0DDC0CEDDF60000000084CEDDF6000000000000000060FE4ACE000000009CA8A3C300000000000000002322DAF6C0C2B85294000000000000000070F6D2E411F6DE10A8A3C30000000000000000C1C0C0C00C70F6D218A8A3C3EB434ADD00000000F18FDBF640070000E852DEF61000000007000100010087C5C0302BC576D7C5520100000080A9A3C334A8A3C3020000000000000080000000C0A7A3C366A64519B923DAF634A8A3C38000010000000000D917DAF6C0A7A3C334A8A3C382B8090034A8A3C338A8A3C30000000038A8A3C3000000008C6E58F0A718DAF60E00000021580C2B80A9A3C310A8A3C30070F6D20070F6D20100000028A8A3C3C1C0C0C00C70F6D218A8A3C3A5484ADD00000000607346CE10A8A3C30070F6D2
+02-25 07:59:17.041 F/google-breakpad(16162): S C3A3A800 20A8A3C328A8A3C3C1C0C0C0354C4ADDA8AA5CE3000000000000000000000000606691C055048ADD80B2CDDEB760AFDECA0000006541B0DD2D0000000100A3C3A8A28AE9000000000070F6D276D7C55294000000A8A28AE9B8A28AE900C093C3A9C54BDDBB564ADD76D7C55294000000B8A4E000000000004411F6DEC0A8A3C39CA8A3C3C844F4C30070F6D2804928D3944128D331E64ADDA8A8A3C3000000000000000060FE4ACE0000000000000000C844F4C3C044F4C3C0CEDDF6F53D4ADD0070F6D200000000010000000100010000000000C0A8A3C3C044F4C351EE4BDD2100000016000000E0F5A7CDDCD7A1B27800000030A9A3C3C044F4C3609152D978000000E5C54BDD30A9A3C370A9A3C330A9A3C3A519DAF68519DAF638A9A3C38519DAF6C7C0D7F678A9A3C30000000030F96FC530C984C2113F0000E03C00000000000000C093C330E90F000010000000000000000000000000000000000000A9C54BDD60FEF6C3000000000090AAD40100000000F00F0078A9A3C330A9A3C3
+02-25 07:59:17.042 F/google-breakpad(16162): S C3A3A980 1600000058B38AF600000000DCD7A1B2F4ADA3C30000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000402C87C500000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000008E246D2000000000000000001000000A0F1ABCD0000000000000000000000000000000001000000882715F401000000005822C40100000050FF4ACE0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000004E419C20000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+02-25 07:59:17.042 F/google-breakpad(16162): S C3A3AB00 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+02-25 07:59:17.043 F/google-breakpad(16162): S C3A3AC80 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000756E646566696E6564207379
+02-25 07:59:17.043 F/google-breakpad(16162): S C3A3AE00 6D626F6C3A20676C5761697453796E630072696249506F696E74657200696E6773006D706C6545585400760000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+02-25 07:59:17.043 F/google-breakpad(16162): S C3A3AF80 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+02-25 07:59:17.044 F/google-breakpad(16162): C 06000040008004C2949604C2008003C20000FFFF008004C200001AC203000000949604C2949AA3C301000000010000000100000024FB09E5E897A3C31774F2E4F870F2E4300007A00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+02-25 07:59:17.044 F/google-breakpad(16162): M AAB37000 00000000 00005000 CDDB210E1401729DD9368E97D91BFA6F0 app_process32
+02-25 07:59:17.044 F/google-breakpad(16162): M D403B000 00000000 0000C000 04BEB4408EDD689C7C9D16B3935B434C0 eglSubDriverAndroid.so
+02-25 07:59:17.044 F/google-breakpad(16162): M D6666000 00000000 0130E000 632AB61E504FB945701535B3D9CC8D6F0 libllvm-qcom.so
+02-25 07:59:17.044 F/google-breakpad(16162): M D7E76000 00000000 00102000 6A49ABB973AC76966D0BF9EB151B1DAA0 libCB.so
+02-25 07:59:17.044 F/google-breakpad(16162): M D7F79000 00000000 000C7000 E965EAB3ED52E0D9033467CF35BA54FA0 libblas.so
+02-25 07:59:17.044 F/google-breakpad(16162): M D94D4000 00000000 0002C000 F15305FE3A594A9A8EDD43DC502FABFA0 librs_adreno.so
+02-25 07:59:17.044 F/google-breakpad(16162): M DD1C0000 00000000 01C47000 8506F83DD6FA1E55AAEDF5288D23914C0 libwebviewchromium.so
+02-25 07:59:17.044 F/google-breakpad(16162): M E388F000 00000000 0003B000 6FA4AB536BB4518557BC07CA8FC573C90 libRSCpuRef.so
+02-25 07:59:17.044 F/google-breakpad(16162): M E38CA000 00000000 00033000 F7FA517643A376EFD12A7B3D2EFEE6F90 libRSDriver_adreno.so
+02-25 07:59:17.045 F/google-breakpad(16162): M E3C80000 00000000 0000C000 7630048E025652922B3F1588F02A8F2B0 librsjni.so
+02-25 07:59:17.045 F/google-breakpad(16162): M E3C96000 00000000 0000D000 561706F94B94192BF9ED468A3E068D7D0 librs_jni.so
+02-25 07:59:17.045 F/google-breakpad(16162): M E3CA3000 00000000 00006000 C359CF7872D4C441EF00D6FC60798F460 libwebviewchromium_loader.so
+02-25 07:59:17.045 F/google-breakpad(16162): M E3CAB000 00000000 00006000 8F426AC7147B1BCAFB00A84FA30818A60 libwebviewchromium_plat_support.so
+02-25 07:59:17.045 F/google-breakpad(16162): M E48C1000 00000000 00005000 45F29673A241F20E48A7F4A69C94558F0 libjnigraphics.so
+02-25 07:59:17.045 F/google-breakpad(16162): M E48C5000 00000000 00013000 9C1B0414377D9B563658C37B62D890D00 libandroid.so
+02-25 07:59:17.045 F/google-breakpad(16162): M E48D7000 00000000 0000B000 2A0263F47116D42F23AEA8976017142A0 libqservice.so
+02-25 07:59:17.045 F/google-breakpad(16162): M E48E2000 00000000 0000D000 9A42EE0ADA890E52077B660CBA9E6F9F0 libqdutils.so
+02-25 07:59:17.045 F/google-breakpad(16162): M E48EF000 00000000 00005000 7B806100E8814ADC4926CAED36A155C90 libqdMetaData.so
+02-25 07:59:17.045 F/google-breakpad(16162): M E48F4000 00000000 00008000 2265B4F6E87C3AB2B24ADF3AD7916DAC0 libmemalloc.so
+02-25 07:59:17.045 F/google-breakpad(16162): M E48FC000 00000000 00009000 66E98553EFB870D30328E6E7236C33D30 gralloc.msm8992.so
+02-25 07:59:17.045 F/google-breakpad(16162): M E4907000 00000000 0000A000 AD580971FA6754A290D06A3B18E8E81D0 libcompiler_rt.so
+02-25 07:59:17.045 F/google-breakpad(16162): M E4911000 00000000 00026000 7A54ADD97509B2BA34F02CD72D7CE1EB0 libGLESv1_CM_adreno.so
+02-25 07:59:17.045 F/google-breakpad(16162): M E4919000 00000000 0078F000 9F67EE99805EFC8AA9D25EC32DE705C80 libllvm-glnext.so
+02-25 07:59:17.045 F/google-breakpad(16162): M E50A2000 00000000 004B9000 D7CC9C6F6A2C2F9B53C5DB501AC4E51B0 libGLESv2_adreno.so
+02-25 07:59:17.045 F/google-breakpad(16162): M E555D000 00000000 0003D000 C9EA007BBDDEC224D1E0C7AFEE4E45330 libgsl.so
+02-25 07:59:17.045 F/google-breakpad(16162): M E559A000 00000000 00008000 CD7367DF671CBD3EDBED183581789FA70 libadreno_utils.so
+02-25 07:59:17.045 F/google-breakpad(16162): M E55A4000 00000000 00012000 B4E6C005EC6CC69155CC735B3EFFECDE0 libEGL_adreno.so
+02-25 07:59:17.045 F/google-breakpad(16162): M E7ECE000 00000000 0001B000 2B30B67A31DE9BF64555151EA17005B90 libkeymaster1.so
+02-25 07:59:17.045 F/google-breakpad(16162): M E7EE9000 00000000 00017000 54102E8ACB90A9125408636632CD808D0 libsoftkeymasterdevice.so
+02-25 07:59:17.045 F/google-breakpad(16162): M E7F40000 00000000 0000B000 26B523F5A4D29ADFFC9E5424083E7A430 libkeymaster_messages.so
+02-25 07:59:17.045 F/google-breakpad(16162): M E7F4B000 00000000 0000E000 ACC6C5A530F89DFAF9D49763349280FD0 libkeystore_binder.so
+02-25 07:59:17.046 F/google-breakpad(16162): M E7F59000 00000000 00006000 3427C2F006C3794AE74735BE6DB0C11D0 libkeystore-engine.so
+02-25 07:59:17.046 F/google-breakpad(16162): M E7F5E000 00000000 00019000 315244E498B82AC7DC9417BC69BEE0D10 libjavacrypto.so
+02-25 07:59:17.046 F/google-breakpad(16162): M E7F77000 00000000 00006000 C22F0B9417EE729F3F103A2099BABE2A0 libemoji.so
+02-25 07:59:17.046 F/google-breakpad(16162): M E7F7D000 00000000 00006000 A1DC8D6A0E0FFBE3CDD733E2C1A656E90 libextmedia_jni.so
+02-25 07:59:17.046 F/google-breakpad(16162): M E7F83000 00000000 00010000 9DB457B0E067D0E3319B0AA6F5658BD70 libstagefright_amrnb_common.so
+02-25 07:59:17.046 F/google-breakpad(16162): M E7F90000 00000000 0002F000 40852323FEC1ADB356FEB0F3EF22BBC90 libexif.so
+02-25 07:59:17.046 F/google-breakpad(16162): M E7FBF000 00000000 0000E000 E63910A6D6C98BCEF90CCDFF910A7BAA0 libjhead.so
+02-25 07:59:17.046 F/google-breakpad(16162): M E7FCE000 00000000 00018000 BC53BCECC219F8AA3641A10B8AA0784C0 libmtp.so
+02-25 07:59:17.046 F/google-breakpad(16162): M E7FE4000 00000000 0004B000 D9429A5D3289DA7E416BAAC35181F8240 libmedia_jni.so
+02-25 07:59:17.046 F/google-breakpad(16162): M E818A000 00000000 00036000 5D7E900D07265C7CAEEAF336A4E5C63C0 liblgDivxDrm.so
+02-25 07:59:17.046 F/google-breakpad(16162): M E98C0000 00000000 00007000 DCEA7FBB2F6009454EF32A08356F56BA0 libqmi_encdec.so
+02-25 07:59:17.046 F/google-breakpad(16162): M E98C6000 00000000 00011000 D60B8FE7332A5FEC91B053060DE9F6FC0 libsensor1.so
+02-25 07:59:17.046 F/google-breakpad(16162): M E98D8000 00000000 0000D000 3659AA2CD6F8DC14B4DD7B781BE06C0C0 libmtpexif.so
+02-25 07:59:17.046 F/google-breakpad(16162): M E98F1000 00000000 00007000 093F37D73F3782B9CA6AD929FC59020D0 libsensor_reg.so
+02-25 07:59:17.046 F/google-breakpad(16162): M EA169000 00000000 00007000 332FEA72D63439385A9B130899F943D50 libsensor_lge_cal.so
+02-25 07:59:17.046 F/google-breakpad(16162): M EA94B000 00000000 00009000 5DFEC0CEBA9B6E5D08B85A18DF6F18210 libmtp_ex.so
+02-25 07:59:17.046 F/google-breakpad(16162): M EA954000 00000000 00014000 F2D84209872178839F4780618E1198970 liblgruntime.so
+02-25 07:59:17.046 F/google-breakpad(16162): M F0488000 00000000 00038000 A7A101BB08294CC8BD8C611C1E99A2B50 libjavacore.so
+02-25 07:59:17.046 F/google-breakpad(16162): M F0508000 00000000 00005000 ADCC285BDC45AE9A03B43D1EB9B982370 libqti-at.so
+02-25 07:59:17.046 F/google-breakpad(16162): M F050D000 00000000 00005000 31397DC744C7B604D2E04451B0C017450 memtrack.msm8992.so
+02-25 07:59:17.046 F/google-breakpad(16162): M F4632000 00000000 0044C000 B596BED69EF0A030CE000B15595135270 libart.so
+02-25 07:59:17.047 F/google-breakpad(16162): M F4ADE000 00000000 0001A000 78B64557986220CC0618C7BBF513B6450 liblgalmond.so
+02-25 07:59:17.047 F/google-breakpad(16162): M F4AF8000 00000000 00005000 086CED5EB0F44F0EB0A5D6612670B9F30 libsigchain.so
+02-25 07:59:17.047 F/google-breakpad(16162): M F4AFD000 00000000 00020000 F2636CCC92E2C9D3154DE7D1BBEAB9720 libdashplayer.so
+02-25 07:59:17.047 F/google-breakpad(16162): M F4B1D000 00000000 00005000 78E450DE95D1700FFAEB4754C75C67680 libExtendedExtractor.so
+02-25 07:59:17.047 F/google-breakpad(16162): M F4B22000 00000000 00012000 F64E6A6F48C5BBDB0F2116A4623286870 libLGCodecParserUtils.so
+02-25 07:59:17.047 F/google-breakpad(16162): M F4B34000 00000000 00009000 F6AFB30995F2AF1A03CF5A93FB2EA4860 liblgresampler.so
+02-25 07:59:17.047 F/google-breakpad(16162): M F4B3C000 00000000 0005D000 0C1A50765556AB67675FE067B8A3515B0 libLGParserOSAL.so
+02-25 07:59:17.047 F/google-breakpad(16162): M F4B99000 00000000 00009000 DE2A64F9A04C710DC19C33C1928FE8410 libLGTimedText_ccparser.so
+02-25 07:59:17.047 F/google-breakpad(16162): M F4BA2000 00000000 00007000 83545AED3509EAAEBAE78D667F0FA48C0 libLGTimedText_xsub.so
+02-25 07:59:17.047 F/google-breakpad(16162): M F4BA9000 00000000 00032000 0D0E443B4EDCA0A81486DB513E65D0320 libstagefright_wfd.so
+02-25 07:59:17.047 F/google-breakpad(16162): M F4BDB000 00000000 00027000 E508C5A720E83FD049B04F67C09305880 libstagefright_httplive.so
+02-25 07:59:17.047 F/google-breakpad(16162): M F4BFC000 00000000 000CB000 211023EB29ED67D7BAEFB2CDD27B81910 libmediaplayerservice.so
+02-25 07:59:17.047 F/google-breakpad(16162): M F4CC6000 00000000 0003A000 E4D19B5FF8BFE7BBA363D18FC83E38160 libavenhancements.so
+02-25 07:59:17.047 F/google-breakpad(16162): M F4DC4000 00000000 00013000 DB3836D74FA669D5B70136175A3618FA0 liblge_audioeffect.so
+02-25 07:59:17.047 F/google-breakpad(16162): M F4DD7000 00000000 00009000 D59647F68E3CF58770736388D46690C70 liblgaudioutils.so
+02-25 07:59:17.047 F/google-breakpad(16162): M F4DDF000 00000000 00A80000 4868B28C6E03144A7AF8FA02AE2DBA570 libLLVM.so
+02-25 07:59:17.047 F/google-breakpad(16162): M F5867000 00000000 00038000 3C50F87D21BDDE58DCBD0FC7B0D476A40 libbcinfo.so
+02-25 07:59:17.047 F/google-breakpad(16162): M F589F000 00000000 0005B000 99E203411790EE639624229BDF048A060 libbcc.so
+02-25 07:59:17.047 F/google-breakpad(16162): M F58F9000 00000000 0000F000 0B1C07F5A59090EA875EEB64AA39FC980 libcommon_time_client.so
+02-25 07:59:17.047 F/google-breakpad(16162): M F5908000 00000000 0001A000 AE6052FF75313268848C7D13396423490 libprotobuf-cpp-lite.so
+02-25 07:59:17.047 F/google-breakpad(16162): M F5923000 00000000 0000D000 CFE41500FDCC495A26EE1C462156F57B0 libstreamingpolicy.so
+02-25 07:59:17.047 F/google-breakpad(16162): M F592F000 00000000 0001F000 2F8F7D5FB7E04203F8FDA98680EC8A790 liblgdrm_client.so
+02-25 07:59:17.047 F/google-breakpad(16162): M F594F000 00000000 00009000 BB24CC31D79784F55C4E785A5C0756DC0 libstagefright_avc_common.so
+02-25 07:59:17.048 F/google-breakpad(16162): M F5958000 00000000 00005000 314F92E6AC1822FB41D4F5DCB956F4BF0 libstagefright_enc_common.so
+02-25 07:59:17.048 F/google-breakpad(16162): M F595D000 00000000 00007000 2996388C9A56DCC091AFE5897ECB87420 libpowermanager.so
+02-25 07:59:17.048 F/google-breakpad(16162): M F5964000 00000000 0001F000 09E3F520D8A5ED01B912678FA7755BB70 libvorbisidec.so
+02-25 07:59:17.048 F/google-breakpad(16162): M F5983000 00000000 00007000 F1EBDCC5D77A0008E973267AD4EB70780 libstagefright_yuv.so
+02-25 07:59:17.048 F/google-breakpad(16162): M F5989000 00000000 00033000 5A264F74CAA4BD27A2059ECA2F4F91710 libstagefright_omx.so
+02-25 07:59:17.048 F/google-breakpad(16162): M F59BC000 00000000 0003B000 1F0F2D5FA3E2C08EC77EE7D2BD2255D10 libopus.so
+02-25 07:59:17.048 F/google-breakpad(16162): M F59F7000 00000000 00007000 A9BEBB44C2987437574B9D2F4739898D0 libmediautils.so
+02-25 07:59:17.048 F/google-breakpad(16162): M F59FC000 00000000 0001C000 7829435CE6CA0A5C60F5AACB7DED21390 libdrmframework.so
+02-25 07:59:17.048 F/google-breakpad(16162): M F5A19000 00000000 00021000 E915848185A62DFD6DED2112824D701F0 libRScpp.so
+02-25 07:59:17.048 F/google-breakpad(16162): M F5A3A000 00000000 00042000 55720349AF6FDF693DC39A570F2AECB30 libRS.so
+02-25 07:59:17.048 F/google-breakpad(16162): M F5A7C000 00000000 00009000 1DF91851FB36A8C8D29A31D5A8505CFC0 libspeexresampler.so
+02-25 07:59:17.048 F/google-breakpad(16162): M F5A85000 00000000 00017000 DD81FC74A25EFCCA887C61F71ABD287E0 libbrunch.so
+02-25 07:59:17.048 F/google-breakpad(16162): M F5A9C000 00000000 0000A000 2737A38251A7112EA0568006C3FFA9F10 libmedia_ex.so
+02-25 07:59:17.048 F/google-breakpad(16162): M F5AA6000 00000000 0000B000 EE720194B028BFBE8A292B179616DE210 libnbaio.so
+02-25 07:59:17.048 F/google-breakpad(16162): M F5AB1000 00000000 00014000 9002695E41EE3D59AF4A757AF3C0978B0 libpcre.so
+02-25 07:59:17.048 F/google-breakpad(16162): M F5AC5000 00000000 00007000 24E93BD4CCE0713FA05014B9EDEF2F590 libwpa_client.so
+02-25 07:59:17.048 F/google-breakpad(16162): M F5ACC000 00000000 00008000 A34EF29278866D2CB7506556B789086F0 libvolumevibratorcallback.so
+02-25 07:59:17.048 F/google-breakpad(16162): M F5AD6000 00000000 00071000 8E1F436C87B785BF87EB1CEDA326F7E40 libGLES_trace.so
+02-25 07:59:17.048 F/google-breakpad(16162): M F5B47000 00000000 00007000 E40891DAD8E7B2F6B30188C30D74D7C20 libsnappy.so
+02-25 07:59:17.048 F/google-breakpad(16162): M F5B4E000 00000000 00060000 749CAC9D9C512FE78C3EC16EDB296D680 libft2.so
+02-25 07:59:17.048 F/google-breakpad(16162): M F5BAE000 00000000 00029000 B9CE36FCAA829DC2258A470AD303352E0 libpng.so
+02-25 07:59:17.048 F/google-breakpad(16162): M F5BD7000 00000000 00005000 C018D84B775D61FAF368DF2AA665697F0 libsync.so
+02-25 07:59:17.048 F/google-breakpad(16162): M F5BDC000 00000000 00007000 9A5B1E364901420D8AA63CEC08475AEE0 libstdc++.so
+02-25 07:59:17.048 F/google-breakpad(16162): M F5BE3000 00000000 00012000 26D8F1619C0D09102263C2334BC89C380 libunwind.so
+02-25 07:59:17.049 F/google-breakpad(16162): M F5C3B000 00000000 0000B000 D5090E204623B87A90F7F15DA838EA380 libbase.so
+02-25 07:59:17.049 F/google-breakpad(16162): M F5C46000 00000000 00007000 CF0651C637D52CCB9C593CABBB81E7BF0 libeffects.so
+02-25 07:59:17.049 F/google-breakpad(16162): M F5C4E000 00000000 00006000 C62F88A12F526FE996E1CDFB580D04670 libstagefright_http_support.so
+02-25 07:59:17.049 F/google-breakpad(16162): M F5C54000 00000000 0001B000 E2958E4C4DCD3A1C268168C2B755D9C20 libstagefright_foundation.so
+02-25 07:59:17.049 F/google-breakpad(16162): M F5C67000 00000000 0017D000 C5F6C6E6FFF7561E36B15B79D5F7960A0 libstagefright.so
+02-25 07:59:17.049 F/google-breakpad(16162): M F5DE2000 00000000 0006F000 01E0D36215F9ADFA6376148F110B151E0 libhwui.so
+02-25 07:59:17.049 F/google-breakpad(16162): M F5E51000 00000000 00005000 5E0DC92209DE1A811703898BA40879580 libradio_metadata.so
+02-25 07:59:17.049 F/google-breakpad(16162): M F5E56000 00000000 00006000 1EAD24C94329023E7C914CB60213710C0 libnativebridge.so
+02-25 07:59:17.049 F/google-breakpad(16162): M F5E5C000 00000000 00006000 2B273894878184E5533F6316C78142A90 libprocessgroup.so
+02-25 07:59:17.049 F/google-breakpad(16162): M F5E62000 00000000 00012000 847F69C739C64569AC93DC2BD612B0990 libminikin.so
+02-25 07:59:17.049 F/google-breakpad(16162): M F5E73000 00000000 0000F000 23F0E58C16D9321168B5AD72727C91D80 libsoundtrigger.so
+02-25 07:59:17.049 F/google-breakpad(16162): M F5E82000 00000000 0000F000 9485DC0440DA431817DEB656A1D89C970 libradio.so
+02-25 07:59:17.049 F/google-breakpad(16162): M F5E91000 00000000 00006000 9839EE33771040E0817D04EA1607A2E90 libnetd_client.so
+02-25 07:59:17.049 F/google-breakpad(16162): M F5E97000 00000000 00010000 253056B18E13B3ABBE25335D850E4FCF0 libimg_utils.so
+02-25 07:59:17.049 F/google-breakpad(16162): M F5EA1000 00000000 0040F000 B14E0BC488816A24E8875B05F91D5A020 libpdfium.so
+02-25 07:59:17.049 F/google-breakpad(16162): M F62B1000 00000000 00009000 E700CB5D5EFAD4A0982C6C92AAB24EF20 libaudioutils.so
+02-25 07:59:17.049 F/google-breakpad(16162): M F62BA000 00000000 0001C000 E561DE316E10404961913562EC88C7D00 libz.so
+02-25 07:59:17.049 F/google-breakpad(16162): M F62D6000 00000000 0004C000 E6A19592808FD8CCBACFB4E4585A9A0F0 libharfbuzz_ng.so
+02-25 07:59:17.049 F/google-breakpad(16162): M F6322000 00000000 00007000 FB66B1BB06FB93A55E83675AC33F36980 libusbhost.so
+02-25 07:59:17.049 F/google-breakpad(16162): M F632A000 00000000 0003A000 1D436B4AF7629FD99D73A7246A6BF8420 libjpeg.so
+02-25 07:59:17.050 F/google-breakpad(16162): M F634B000 00000000 000DA000 E3F897ABB8F544220CA13A40126C17DC0 libmedia.so
+02-25 07:59:17.051 F/google-breakpad(16162): M F641E000 00000000 00177000 E7C23CFADC8EFF8C4F22AA261B4964020 libicui18n.so
+02-25 07:59:17.051 F/google-breakpad(16162): M F658E000 00000000 00121000 BD724C85205F8035CA32DB1D56D516A40 libicuuc.so
+02-25 07:59:17.051 F/google-breakpad(16162): M F66B3000 00000000 00026000 CF0E97E48357CAE56758A8A052CED17F0 libssl.so
+02-25 07:59:17.051 F/google-breakpad(16162): M F66D9000 00000000 0009D000 1F63A7690455B59E3DC1BAC22FD35D710 libcrypto.so
+02-25 07:59:17.051 F/google-breakpad(16162): M F6776000 00000000 00088000 92D82F190EDA3EFAE4ABE1D0E9F92A440 libsonivox.so
+02-25 07:59:17.051 F/google-breakpad(16162): M F6803000 00000000 00011000 EA55EB7A4E330F3A321D71A6633A350E0 libselinux.so
+02-25 07:59:17.051 F/google-breakpad(16162): M F6814000 00000000 0000A000 FE9A06EDA059ABD73AA5BE0C50FDF15F0 libhardware_legacy.so
+02-25 07:59:17.051 F/google-breakpad(16162): M F681F000 00000000 00005000 C1528E5AC47440C91D08992754C97A020 libhardware.so
+02-25 07:59:17.051 F/google-breakpad(16162): M F6824000 00000000 00006000 D560734E4C12B1D32A8A01D9872059240 libETC1.so
+02-25 07:59:17.051 F/google-breakpad(16162): M F682A000 00000000 0000F000 FF299F9F7DD8D50AFF9D4AF2FD92FE950 libGLESv2.so
+02-25 07:59:17.052 F/google-breakpad(16162): M F6839000 00000000 0000A000 4ECC7F0C7C9B36FBDAC0181538C1436B0 libGLESv1_CM.so
+02-25 07:59:17.052 F/google-breakpad(16162): M F683B000 00000000 00070000 1F6FBD4345A4742270A85AE7E8E129AA0 libEGL.so
+02-25 07:59:17.052 F/google-breakpad(16162): M F68AD000 00000000 000B2000 5C8AABBE271B00B986091CDE0474DD700 libsqlite.so
+02-25 07:59:17.052 F/google-breakpad(16162): M F694E000 00000000 00289000 5E933FF5391447BF290ADDF4FA2842B60 libskia.so
+02-25 07:59:17.052 F/google-breakpad(16162): M F6BDC000 00000000 0000A000 201B23B91FB159C9C52866ADFAAA8FED0 libcamera_metadata.so
+02-25 07:59:17.052 F/google-breakpad(16162): M F6BE2000 00000000 00031000 3A9285D251F3217BFF5E41689FD922AC0 libcamera_client.so
+02-25 07:59:17.052 F/google-breakpad(16162): M F6C12000 00000000 00041000 80FD1F6AF746B0E1AB7B598DF55AE8D80 libinputflinger.so
+02-25 07:59:17.052 F/google-breakpad(16162): M F6C51000 00000000 00021000 0D56C40D7CC3D423A16A53B3D7DED5DC0 libinput.so
+02-25 07:59:17.052 F/google-breakpad(16162): M F6C69000 00000000 00062000 08E6880DE9F1CB02651AE953A7F6923F0 libgui.so
+02-25 07:59:17.052 F/google-breakpad(16162): M F6CCB000 00000000 00010000 DD09E336297956492AD7C177519A1D6A0 libui.so
+02-25 07:59:17.052 F/google-breakpad(16162): M F6CDB000 00000000 0000B000 F2F0AB06F84A0D783F4E17BBEB01C0690 libnetutils.so
+02-25 07:59:17.053 F/google-breakpad(16162): M F6CE6000 00000000 00009000 9ABC995145EAE750139A08FF17395D920 libnativehelper.so
+02-25 07:59:17.053 F/google-breakpad(16162): M F6CEF000 00000000 00017000 67C16CEE4A7E7012A6440053D4FEC19C0 libexpat.so
+02-25 07:59:17.053 F/google-breakpad(16162): M F6D06000 00000000 0002A000 CF824E9B76F884C161C11A28C0AA231D0 libandroidfw.so
+02-25 07:59:17.053 F/google-breakpad(16162): M F6D30000 00000000 00005000 F800D7423F3487DE8090E30BFAFED02F0 libmemtrack.so
+02-25 07:59:17.053 F/google-breakpad(16162): M F6D35000 00000000 0000B000 F15D32A9F149B74D256C52097B3A55BB0 libbacktrace.so
+02-25 07:59:17.053 F/google-breakpad(16162): M F6D40000 00000000 00022000 554E8A8627D8B1EB593D3AA5B2B3D6020 libm.so
+02-25 07:59:17.053 F/google-breakpad(16162): M F6D62000 00000000 0007A000 E726B74CE5D6F65B006BC7045662C9340 libc.so
+02-25 07:59:17.053 F/google-breakpad(16162): M F6DE4000 00000000 00090000 93219962EC5CCFD98B897B0DC910493D0 libc++.so
+02-25 07:59:17.053 F/google-breakpad(16162): M F6E74000 00000000 0002E000 FD3369BE00741CA1B70811BB61796B4C0 libwilhelm.so
+02-25 07:59:17.053 F/google-breakpad(16162): M F6E93000 00000000 000F1000 3799D3B349DB137A08F3DB434E6A88D70 libandroid_runtime.so
+02-25 07:59:17.053 F/google-breakpad(16162): M F6F86000 00000000 00032000 9475E844ABDBBE3B512F5232E393E5590 libbinder.so
+02-25 07:59:17.053 F/google-breakpad(16162): M F6FB8000 00000000 0000A000 51CB626B9BC61903D8FB79C054262BA70 liblog.so
+02-25 07:59:17.054 F/google-breakpad(16162): M F6FC2000 00000000 0001B000 9E35C45774B38BC266DAB3081CB02E890 libutils.so
+02-25 07:59:17.054 F/google-breakpad(16162): M F6FDD000 00000000 00011000 B4E57058D30C724FB546974E8F0D99690 libcutils.so
+02-25 07:59:17.054 F/google-breakpad(16162): M F7019000 00000000 00020000 143F053EC6AACF47A289E950D893D9EE0 linker
+02-25 07:59:17.054 F/google-breakpad(16162): -----END BREAKPAD MICRODUMP-----
+02-25 08:45:32.669 F/google-breakpad(18894): -----BEGIN BREAKPAD MICRODUMP-----
+02-25 08:45:32.669 F/google-breakpad(18894): V WebView:48.0.2564.106
+02-25 08:45:32.669 F/google-breakpad(18894): O A arm 06 armv8l lge/p1_tmo_us/p1:6.0/MRA58K/1603210524c8d:user/release-keys
+02-25 08:45:32.669 F/google-breakpad(18894): G OpenGL ES 3.1 V@136.0 (GIT@I86756fd4a8)|Qualcomm|Adreno (TM) 418
+02-25 08:45:32.669 F/google-breakpad(18894): S 0 C44FFF18 C44FF000 00002000
+
diff --git a/src/processor/testdata/microdump-withcrashreason.dmp b/src/processor/testdata/microdump-withcrashreason.dmp
new file mode 100644
index 00000000..b27c6a46
--- /dev/null
+++ b/src/processor/testdata/microdump-withcrashreason.dmp
@@ -0,0 +1,1422 @@
+08-17 19:45:06.579 F/google-breakpad(25655): -----BEGIN BREAKPAD MICRODUMP-----
+08-17 19:45:06.579 F/google-breakpad(25655): V AndroidWebView:62.0.3188.0
+08-17 19:45:06.580 F/google-breakpad(25655): O A arm 08 armv8l Nokia/TA-1025_00WW/PLE:7.1.1/NMF26F/00WW_3_32C:user/release-keys
+08-17 19:45:06.580 F/google-breakpad(25655): P webview
+08-17 19:45:06.580 F/google-breakpad(25655): R 00000005 SIGTRAP 4A7CB000
+08-17 19:45:06.580 F/google-breakpad(25655): G
+08-17 19:45:06.605 F/google-breakpad(25655): H 12C00000 FFF73000 00D9 31E89000 975F4000 0C:18 0D:0B 0E:0F 0F:2F 10:09 11:08 12:06 13:1A 14:08 15:06 16:12 17:10 18:0D 19:06 1B:01 1C:02 1D:01
+08-17 19:45:06.608 F/google-breakpad(25655): S 0 C9379C60 C9379000 00002000
+08-17 19:45:06.609 F/google-breakpad(25655): S C9379000 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:45:06.609 F/google-breakpad(25655): S C9379180 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:45:06.610 F/google-breakpad(25655): S C9379300 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:45:06.610 F/google-breakpad(25655): S C9379480 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:45:06.611 F/google-breakpad(25655): S C9379600 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:45:06.612 F/google-breakpad(25655): S C9379780 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:45:06.612 F/google-breakpad(25655): S C9379900 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:45:06.613 F/google-breakpad(25655): S C9379A80 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:45:06.614 F/google-breakpad(25655): S C9379C00 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005C9D37C94C9D37C9509D37C98C9C37C9EDACEF0DEDACEF0D01000000249E37C9010000009D20FCD3EDACEF0DEDACEF0D00000000EDACEF0D0000000000000000EDACEF0DEDACEF0D0000000000000000BC9C37C901000000000000008F02000000000000EDACEF0D00000000200000000000000000002CD4000000000000000000000000000000000000000000000000EDACEF0D000000000000000000000000EDACEF0D00000000EDACEF0D0000000000000000EDACEF0D0000000000000000000000000000000020000000D09C37C9EDACEF0D509D37C94C9D37C9EDACEF0DEDACEF0DD5D92BD4EDACEF0DEDACEF0DEDACEF0D0000000003000000EDACEF0D0000000000000000EDACEF0DEDACEF0DEDACEF0DB7D72BD4C09D37C9B7EF57D2
+08-17 19:45:06.614 F/google-breakpad(25655): S C9379D80 00000000EDACEF0DEDACEF0D0000000000000000EDACEF0D000000000000000001000000EDACEF0D0000000000000000EDACEF0D000000000000000001000000EDACEF0D0000000000000000EDACEF0D000000000000000001000000010000000000000000000000FFFFFFFF000000000000000000000000FFFFFFFF01000000EDACEF0D7C9E37C9849E37C9889E37C9249E37C9D89E37C9789E37C98F0830D4EDACEF0DEDACEF0DEDACEF0DDD7755D2EDACEF0DD89E37C94C9E37C9489E37C9D89E37C9389F37C9749F37C9D89E37C900000000EDACEF0DEDACEF0DEDACEF0D3CA137C947733DD4D89E37C9809E37C9789E37C900000000EDACEF0DEDACEF0DEDACEF0D018D98D200000000000000000400000000000000FFFFFFFF00000000FFFFFFFF00000000FFFFFFFF00000000FFFFFFFF070000001D00000000000000FFFFFFFF00000000FFFFFFFF00CB97D200000000EDACEF0D000000000000000000000000076291D2A0A037C9EDACEF0D389F37C9EDACEF0D4543A7D400000000
+08-17 19:45:06.615 F/google-breakpad(25655): S C9379F00 08A037C9EB8E3DD4A4A037C902000000309F37C9EDACEF0D389F37C9EDACEF0DEDACEF0D31000000EDACEF0DEDACEF0DEDACEF0D31000000EDACEF0DFFFFFFFFFFFFFFFFFFFFFFFFEDACEF0D6C0000000000000001000000EDACEF0DEDACEF0D742F6874EDACEF0D14617274EDACEF0DEDACEF0D3100000024000000EDACEF0D31000000FFFFFFFFFFFFFFFF02000000FFFFFFFFFFFFFFFF01000000FFFFFFFFFFFFFFFFA4A037C9A0A037C934A137C9EDACEF0D4543A7D40000000008A037C93CA137C911A03DD400000000000000000CA037C9EDACEF0DEDACEF0DEDACEF0D00000000EDACEF0D00000000EDACEF0D02000000B9D89CD2EDACEF0DEDACEF0D20A037C970A337C90000000000000000EDACEF0D0000000078A437C923D89CD200000000080000000100000000000000EDACEF0D3D8658D288C83CD3EDACEF0DEDACEF0D78A037C9D8A037C9558758D2000000000000000088A037C9EDACEF0DD8A037C9191592D2178076D2270A000001000000FFFFFFFF0000000000000000
+08-17 19:45:06.616 F/google-breakpad(25655): S C937A080 000000000000000000000000000000000400000000000000FFFFFFFF00000000EDACEF0D00000000EDACEF0DFFFFFFFFFFFFFFFFFFFFFFFF00000000000000000000000000A137C900000000000000000000000000000000000000000000000000000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF02000000FFFFFFFFFFFFFFFF01000000FFFFFFFFFFFFFFFF000000000000000000000000000000000000000007000000440000000200000000000000EDACEF0DEDACEF0D000000000000000000000000EDACEF0DEDACEF0DEDACEF0DEDACEF0DEDACEF0D0000000038A237C94543A7D4EDACEF0D38A237C970A337C928A237C9EDACEF0DEDACEF0D4543A7D400000000EDACEF0D78A437C92DB773D2EDACEF0DEDACEF0DD9C68DD2F1C68DD2EDACEF0D01000000EDACEF0DD9C68DD20100000065C38DD2EDACEF0D0900000009000000EDACEF0D7DF856D2EDACEF0D7D933DD453E29CD2CF228BD2CF228BD2178076D2EDACEF0D38A237C90000000078A437C98D8064D2
+08-17 19:45:06.616 F/google-breakpad(25655): S C937A200 6E70E4D48970E4D400000000000000000000000000000000EDACEF0D000000000000000000000000EDACEF0D0000000000000000A4A237C90000000000000000EDACEF0DEDACEF0DEDACEF0D7B2B84EAEDACEF0DEDACEF0D78A437C9B97855D2EDACEF0DA4A237C9EDACEF0DEDACEF0DEDACEF0D090000000000000009000000EDACEF0DEDACEF0D0000000000000000EDACEF0DEDACEF0D0000000000000000D0A537C9EDACEF0DEDACEF0D00000000EDACEF0DEDACEF0D38A337C900000000EDACEF0DEDACEF0D78A437C93FD49CD203000000F9C973D208A337C9EDACEF0D08A337C9F0A337C904A337C9AFA673D20100000021C973D200000000000000000100000000000000EDACEF0D00000000000000000000000000000000EDACEF0D1B000000FFFFFFFF70A337C94F1B59D2EDACEF0D090000000000000000000000000000000000000025B0B6D4EDACEF0D00000000A1CE9CD2270A000000000000EDACEF0D0200000094A437C905000000EDACEF0DEDACEF0D0000000000000000
+08-17 19:45:06.617 F/google-breakpad(25655): S C937A380 000000000000000000000000D5B0B6D425B0B6D42C0100007D933DD453E29CD2CF228BD2CF228BD2178076D2270A0000EDACEF0DE8A337C9270A000000000000EDACEF0DEDACEF0DEDACEF0D2BC83CD3EDACEF0D090000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000EDACEF0DEDACEF0D98A437C90000000000000000D8A437C90000000078A437C9FBC69CD2EDACEF0D2BC83CD3EDACEF0D0900000088A437C9000000000000000000000000E8030000000000000000000000000000E8030000B0A437C9EDACEF0D80A437C900000000EDACEF0D00000000000000000000000000000000000000000CA3BDD2000000000000000000000000EDACEF0DEDACEF0D2BC83CD3EDACEF0D0900000000000000000000000000000000000000EDACEF0DEDACEF0D00000000EDACEF0DD0A537C965CC73D2000000000000000000000000000000000000000000000000EDACEF0D00000000D0A537C9EDACEF0D0000000000000000
+08-17 19:45:06.617 F/google-breakpad(25655): S C937A500 0000000000000000EDACEF0D28A737C9C0A537C9EDACEF0DEDACEF0D747D92D40000000028A737C9EDACEF0D2DB773D2EDACEF0D30A737C9F0A537C9EDACEF0DEDACEF0D747D92D4000000006BB773D201010000DCA537C9EDACEF0DEDACEF0DB000000080000000EDACEF0D7B2B84EA53E29CD253E29CD2CF228BD2CF228BD2178076D2DCA537C9EDACEF0D0000000007E29CD207E29CD207E29CD207E29CD200000000000000000000000000000000FCA537C9000000000000000000000000EDACEF0D00000000EDACEF0DF6FFFFFF00000000000000004000000000000000EDACEF0DEDACEF0D00000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000EDACEF0DC4A637C9000000000000000040A837C9EDACEF0DEDACEF0D0000000028A737C9A4A637C948A737C92842A7D4EDACEF0D28A737C9EDACEF0D5FB473D2FFFFFFFF7B2B84EAEDACEF0DEDACEF0DFFFFFFFFC0A637C9
+08-17 19:45:06.618 F/google-breakpad(25655): S C937A680 EDACEF0DEDACEF0DEDACEF0DEDACEF0DEDACEF0DEDACEF0DFFFFFFFFC0A637C9020000000000000000000000000000000000000077D5BED2EDACEF0D00000000F4FFFFFFEDACEF0DE4A637C9EDACEF0DB8A737C9EDACEF0D00000000000000000000000000000000EDACEF0DEDACEF0D28A737C9EDACEF0DB8A737C9EDACEF0DC8A737C928A737C970A737C92BAA73D2EDACEF0DEDACEF0D01000000EDACEF0DEDACEF0DEDACEF0DEDACEF0D0000000000000000000000000000000000000000000000002843A7D42842A7D49601000053E29CD253E29CD2CF228BD2CF228BD2178076D2DD020000010037C900000000FFFFFFFFD0A4BDD202000000F0A737C900000000EDACEF0DEDACEF0DEDACEF0DACA737C9FFFFFFFFE0A737C9EDACEF0D010000006B9855D2EDACEF0DEDACEF0DEDACEF0DEDACEF0DEDACEF0D0000000000000000000000000000000000000000000000002843A7D42842A7D49601000053E29CD253E29CD2CF228BD2CF228BD2178076D2DD02000001000000D34657D2
+08-17 19:45:06.619 F/google-breakpad(25655): S C937A800 EDACEF0DEDACEF0DEDACEF0D01000000EDACEF0DEDACEF0D000000005B8173D2020000009BD47ED2CCA837C940A837C9EDACEF0D00000000CCA837C91FA773D20000000000000000EDACEF0D3100000020000000EDACEF0D0000000000000000000000000000000098A837C9EDACEF0DEDACEF0DEDACEF0D94A837C9EDACEF0D00000000CCA837C9000000006B9855D20000000000000000EDACEF0D214657D2000000000000000000000000B34557D2EDACEF0DEDACEF0DEDACEF0DEDACEF0D00000000498473D2EDACEF0DEDACEF0D00000000EDACEF0DEDACEF0D00000000CCA837C9EDACEF0DEDACEF0D20A937C978000000EDACEF0DEDACEF0DA38173D220A937C9CD2F82EA20A937C9E52F82EA28A937C9EF5C7FEA7800000000000000EDACEF0DEDACEF0DEDACEF0DEDACEF0D00000000EDACEF0DEDACEF0D00100000000000000000000000000000000000005B8173D2EDACEF0D00000000EDACEF0D0100000000000000EDACEF0D0000000070A937C920A937C91600000000000000
+08-17 19:45:06.619 F/google-breakpad(25655): S C937A980 00000000EDACEF0D00000000EDACEF0D0000000001000000EDACEF0D0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000EDACEF0D01000000EDACEF0D000000000000000001000000EDACEF0D01000000EDACEF0D01000000EDACEF0D01000000EDACEF0D010000000100000001000000EDACEF0D01000000EDACEF0D01000000EDACEF0D01000000EDACEF0D01000000EDACEF0D00000000000000000000000000000000000000000000000001000000EDACEF0D01000000EDACEF0D00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:45:06.620 F/google-breakpad(25655): S C937AB00 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:45:06.620 F/google-breakpad(25655): S C937AC80 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:45:06.621 F/google-breakpad(25655): S C937AE00 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:45:06.621 F/google-breakpad(25655): S C937AF80 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:45:06.622 F/google-breakpad(25655): C 06000040000000000000000005B88FD2000000008C9C37C9CC9C37C99025E63EAC9C37C94C9D37C95C9D37C9509D37C9809E37C9D9C5F7D3609C37C91B89B3D28684B3D2300001680000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:45:06.622 F/google-breakpad(25655): M AAAAA000 00000000 00005000 8D2477F3B51997BDCC3733B8D1F920BE0 app_process32
+08-17 19:45:06.622 F/google-breakpad(25655): M 70D29000 00000000 00806000 E9166D3ED622EE65A3A4086EBEA4A7950 boot.oat
+08-17 19:45:06.622 F/google-breakpad(25655): M 71531000 00000000 006C0000 668D96384E4368B01BC9B9F365028CA20 boot-core-libart.oat
+08-17 19:45:06.623 F/google-breakpad(25655): M 71BF3000 00000000 000AA000 0D160B642FB1639805B72AC6F4DF3F380 boot-conscrypt.oat
+08-17 19:45:06.623 F/google-breakpad(25655): M 71C9F000 00000000 000D1000 9D69BDC94BD07F2468D5B7DB0AEEF0140 boot-okhttp.oat
+08-17 19:45:06.623 F/google-breakpad(25655): M 71D72000 00000000 0000C000 566CD32860A984FD445A4852058609CB0 boot-core-junit.oat
+08-17 19:45:06.623 F/google-breakpad(25655): M 71D80000 00000000 0019F000 09C1E8B1D7FC826CB75691EC5BDBA1DB0 boot-bouncycastle.oat
+08-17 19:45:06.623 F/google-breakpad(25655): M 71F21000 00000000 0014B000 069BAE4D2D7831B857A3C236021D868A0 boot-ext.oat
+08-17 19:45:06.623 F/google-breakpad(25655): M 7206E000 00000000 0223E000 D0BEBD37E215DDC845099212203F792F0 boot-framework.oat
+08-17 19:45:06.623 F/google-breakpad(25655): M 742AE000 00000000 00502000 B41E052DBA2949CE100713743053E1E40 boot-telephony-common.oat
+08-17 19:45:06.623 F/google-breakpad(25655): M 747B2000 00000000 0003D000 65E4B1E28F33F9C51062E2D0630394830 boot-voip-common.oat
+08-17 19:45:06.624 F/google-breakpad(25655): M 747F1000 00000000 00045000 EB491A6AF6568A675D81746238ACC78B0 boot-ims-common.oat
+08-17 19:45:06.624 F/google-breakpad(25655): M 74838000 00000000 0016C000 C369D6D4F8DCF10CC0AD1800000000000 boot-apache-xml.oat
+08-17 19:45:06.624 F/google-breakpad(25655): M 749A6000 00000000 000FF000 1FAC5317B0FEBD01C31E8039D76CCAF50 boot-org.apache.http.legacy.boot.oat
+08-17 19:45:06.624 F/google-breakpad(25655): M 74AA7000 00000000 00004000 C368F8D0F8DCF10C00BE1800000000000 boot-tcmiface.oat
+08-17 19:45:06.624 F/google-breakpad(25655): M 74AAD000 00000000 00016000 C368FA40F8DCF10C3FB11800000000000 boot-WfdCommon.oat
+08-17 19:45:06.624 F/google-breakpad(25655): M 74AC5000 00000000 00004000 A2EDD62E4499B2C98D8C251F0977951B0 boot-oem-services.oat
+08-17 19:45:06.624 F/google-breakpad(25655): M 74ACB000 00000000 0001C000 3794BA12A18F802DF4E8F10D4B2662FB0 boot-qcom.fmradio.oat
+08-17 19:45:06.624 F/google-breakpad(25655): M 74AE9000 00000000 00009000 C368F9A8F8DCF10C95B41800000000000 boot-qcmediaplayer.oat
+08-17 19:45:06.624 F/google-breakpad(25655): M 74AF4000 00000000 00008000 C368E898F8DCF10CDEAD1800000000000 boot-telephony-ext.oat
+08-17 19:45:06.624 F/google-breakpad(25655): M 74AFE000 00000000 00013000 C368E46FF8DCF10CA3A11800000000000 boot-dolby_ds2.oat
+08-17 19:45:06.625 F/google-breakpad(25655): M 74B13000 00000000 0000A000 C368F9E4F8DCF10C41B01800000000000 boot-dolby_ds1.oat
+08-17 19:45:06.625 F/google-breakpad(25655): M C8F1F000 00000000 00005000 F841612CF1D458AB70296575A996EE5F0 QPerformance.odex
+08-17 19:45:06.625 F/google-breakpad(25655): M CB799000 00000000 00856000 000003F10000000031270A00000000000 base.odex
+08-17 19:45:06.625 F/google-breakpad(25655): M CCAF6000 00000000 00936000 00000F700000000098480B00000000000 base.odex
+08-17 19:45:06.625 F/google-breakpad(25655): M CF4C6000 00000000 02000000 000000000000000000000000000000000 dalvik-jit-code-cache (deleted)
+08-17 19:45:06.625 F/google-breakpad(25655): M D2273000 04247000 02C94000 8A2EFA0DECC3EF7057A1C62BF1AECCA80 libmonochrome.so
+08-17 19:45:06.625 F/google-breakpad(25655): M D9155000 00000000 00004000 C1741AE46077EF13F70D0DC7D8A9DDE80 libwebviewchromium_loader.so
+08-17 19:45:06.625 F/google-breakpad(25655): M D9276000 00000000 00006000 C700FED4854EA9F553FC4EB1AC49DAD50 libqdutils.so
+08-17 19:45:06.625 F/google-breakpad(25655): M D927F000 00000000 00007000 5AF3845B7F31952390092BB2318667B00 gralloc.msm8937.so
+08-17 19:45:06.626 F/google-breakpad(25655): M D926B000 00000000 00823000 A91A29ADD65BB0AF28A4C9A6208E33C40 libllvm-glnext.so
+08-17 19:45:06.626 F/google-breakpad(25655): M D9AB7000 00000000 00316000 9F7E6C49A0A8C88C317716B031320CA30 libESXGLESv2_adreno.so
+08-17 19:45:06.626 F/google-breakpad(25655): M D9F1F000 00000000 0000C000 CEC6F7F71723450F4D1E527FA1BDDA310 libqservice.so
+08-17 19:45:06.626 F/google-breakpad(25655): M D9F30000 00000000 00007000 BB9F7CD0BF1178F273EB8B4D2D5C67C30 libmemalloc.so
+08-17 19:45:06.626 F/google-breakpad(25655): M D9F39000 00000000 00003000 B4B80A1B5D6C50F5C0DD7F1C29A9F6C10 libqdMetaData.so
+08-17 19:45:06.626 F/google-breakpad(25655): M D9F43000 00000000 00009000 0BA85EA850C07E5B86AF8281EF7641E70 libcompiler_rt.so
+08-17 19:45:06.626 F/google-breakpad(25655): M D9F4E000 00000000 0000B000 362BA72B9CF73AB8BD02283F491283E40 eglSubDriverAndroid.so
+08-17 19:45:06.626 F/google-breakpad(25655): M D9F5B000 00000000 0000B000 9BAA0F603A10810D4A6BEE7A903A762F0 libGLESv2_adreno.so
+08-17 19:45:06.626 F/google-breakpad(25655): M D9F68000 00000000 00007000 C08FDBDAB5792096DB0BEDBE3D23B48D0 libGLESv1_CM_adreno.so
+08-17 19:45:06.626 F/google-breakpad(25655): M D9F71000 00000000 00024000 C346DBBCF27F603F9321CCF737B3C0550 libESXGLESv1_CM_adreno.so
+08-17 19:45:06.626 F/google-breakpad(25655): M D9F97000 00000000 00010000 A7800610AD28E2DF469D023E70516C190 libESXEGL_adreno.so
+08-17 19:45:06.626 F/google-breakpad(25655): M D9FAB000 00000000 00006000 6CC274368542A8270BC225BE519068D80 libadreno_utils.so
+08-17 19:45:06.626 F/google-breakpad(25655): M D9FBC000 00000000 00009000 649C0C218A9C0A611E5E0DB24CDD058C0 libEGL_adreno.so
+08-17 19:45:06.626 F/google-breakpad(25655): M DA4BC000 00000000 00020000 1195E0A668F3644AC0EC8D1122457A140 libkeymaster1.so
+08-17 19:45:06.627 F/google-breakpad(25655): M DA4DF000 00000000 00018000 39E3D5620A966F5DB960EEE55CCD8BB30 libsoftkeymasterdevice.so
+08-17 19:45:06.627 F/google-breakpad(25655): M DA4F9000 00000000 0001A000 C1B07DA2D52E6EC3C54992A3A953D63B0 libjavacrypto.so
+08-17 19:45:06.627 F/google-breakpad(25655): M DA516000 00000000 00004000 B051A444B9312E4DAF242DA3A951538A0 libkeystore-engine.so
+08-17 19:45:06.627 F/google-breakpad(25655): M DA51B000 00000000 00016000 1988D915061DDC4921FF608AD3E810AD0 libkeystore_binder.so
+08-17 19:45:06.627 F/google-breakpad(25655): M DA534000 00000000 0000C000 DDF063ABB28459B09548F8329934DDEB0 libkeymaster_messages.so
+08-17 19:45:06.627 F/google-breakpad(25655): M DC57D000 00000000 00016000 A686CFCA0E870C10B425EB769017BE930 libmtp.so
+08-17 19:45:06.627 F/google-breakpad(25655): M DC593000 00000000 00052000 E9F8299757E5E543C03723101E5B1BEC0 libmedia_jni.so
+08-17 19:45:06.627 F/google-breakpad(25655): M DC5E8000 00000000 00020000 ADF61BE35FF269EC7E7B32B1DDCD31E00 libexif.so
+08-17 19:45:06.627 F/google-breakpad(25655): M DC616000 00000000 0000E000 ABA3C77DD3386AE87B586632CE1979D50 libstagefright_amrnb_common.so
+08-17 19:45:06.627 F/google-breakpad(25655): M DC634000 00000000 00007000 CD70BA801CA3E12D258565013535D7440 tcmclient.odex
+08-17 19:45:06.627 F/google-breakpad(25655): M DC645000 00000000 00004000 042B2B738C75036986EB80BC08A71F060 libextmedia_jni.so
+08-17 19:45:06.627 F/google-breakpad(25655): M E1E9B000 00000000 002B2000 FCA7431984CE2AEF979FFEEF99432D320 libart-compiler.so
+08-17 19:45:06.628 F/google-breakpad(25655): M E215E000 00000000 000B1000 1EBE7A1A3E1A3134DE689251E1ABC0380 libvixl.so
+08-17 19:45:06.628 F/google-breakpad(25655): M E2264000 00000000 0002B000 6E46C8EDE63F81CC2A4375E4F85517CD0 libopenjdk.so
+08-17 19:45:06.628 F/google-breakpad(25655): M E2291000 00000000 00029000 4F845000DEA8066D684FEAB08A91A3480 libjavacore.so
+08-17 19:45:06.628 F/google-breakpad(25655): M E22BC000 00000000 00138000 523FDEBEF6ECE577AF3716E9703AD4FF0 lib-imsqimf.so
+08-17 19:45:06.628 F/google-breakpad(25655): M E23FA000 00000000 00004000 48E9F68098728AFF9A198AE7A14A7F700 libmdmdetect.so
+08-17 19:45:06.628 F/google-breakpad(25655): M E2400000 00000000 00005000 12F24D77003A5660A06BA8690696A5C30 libconfigdb.so
+08-17 19:45:06.628 F/google-breakpad(25655): M E2405000 00000000 00085000 DB9D3DADFB06F6B1AB9CEC5443F295370 lib-imsxml.so
+08-17 19:45:06.628 F/google-breakpad(25655): M E2496000 00000000 00005000 F812502D41A460BDD2D9AA83A9564CC70 libqmi_encdec.so
+08-17 19:45:06.628 F/google-breakpad(25655): M E249C000 00000000 0001C000 A53A45C88FFCD4CB3AFF323AF8FFFBAB0 libqdi.so
+08-17 19:45:06.628 F/google-breakpad(25655): M E24B7000 00000000 0006A000 D110B55DE7DB9FD5086D2D1CE57152480 libdsi_netctrl.so
+08-17 19:45:06.628 F/google-breakpad(25655): M E2534000 00000000 00023000 E7FB6A8B99C97103F258028CF27324660 lib-imsrcscm.so
+08-17 19:45:06.628 F/google-breakpad(25655): M E255A000 00000000 0001C000 5BE35B9E5D50332052532AE119C50B930 libnetmgr.so
+08-17 19:45:06.628 F/google-breakpad(25655): M E257A000 00000000 00004000 AB354652140A356C9787104C87CB30E00 libidl.so
+08-17 19:45:06.628 F/google-breakpad(25655): M E2581000 00000000 00004000 63ED38853810ED69BA1AA57CE82E74B10 libtime_genoff.so
+08-17 19:45:06.629 F/google-breakpad(25655): M E2587000 00000000 00004000 51134658113749962ABB7BA3A3C5E9740 libqmi_client_helper.so
+08-17 19:45:06.629 F/google-breakpad(25655): M E258E000 00000000 00009000 1D288EC9F32773EBC0D380D4E238D8D60 libqmi_client_qmux.so
+08-17 19:45:06.629 F/google-breakpad(25655): M E25C9000 00000000 0006A000 60BAE0DAB14BFBC4BE1805CC4CAF8B4D0 lib-imsdpl.so
+08-17 19:45:06.629 F/google-breakpad(25655): M E263D000 00000000 00019000 0333752023452FF1E40F6BA9169471500 libdiag.so
+08-17 19:45:06.629 F/google-breakpad(25655): M E274E000 00000000 0002C000 0FC3AF7C85EA4B0DA653AEA111020A2D0 libqmi.so
+08-17 19:45:06.629 F/google-breakpad(25655): M E27B7000 00000000 000B8000 023971CEF8E022AAD4090C7D1432C3690 libCB.so
+08-17 19:45:06.629 F/google-breakpad(25655): M E7D93000 00000000 00461000 39CBB6C545073B5DB56B60665F81D4B00 libart.so
+08-17 19:45:06.629 F/google-breakpad(25655): M E8384000 00000000 00001000 7691C4BE084B030B3AA118A6F412EE260 libqmi_common_so.so
+08-17 19:45:06.629 F/google-breakpad(25655): M E8387000 00000000 0000A000 37A576E22F2B9973E1734E556E1E99990 libqmi_cci.so
+08-17 19:45:06.629 F/google-breakpad(25655): M E8395000 00000000 00003000 DCDF68ACFBFC2DEFC89FA0F5783199070 libpackagelistparser.so
+08-17 19:45:06.629 F/google-breakpad(25655): M E839A000 00000000 00056000 0C1D30C5E6EA7E82800A2B00935E4B060 libharfbuzz_ng.so
+08-17 19:45:06.629 F/google-breakpad(25655): M E83F3000 00000000 00037000 8AF00237A05209C2E429D0F70ED3EB900 libopus.so
+08-17 19:45:06.629 F/google-breakpad(25655): M E842C000 00000000 00017000 215A7F63855CB46EC59B425BEDFD847D0 libminikin.so
+08-17 19:45:06.630 F/google-breakpad(25655): M E8447000 00000000 00018000 EAB4CCC4544F5D8E2ECF256D527F4A430 libutils.so
+08-17 19:45:06.630 F/google-breakpad(25655): M E8461000 00000000 0001E000 CCAA49412B791630FD4EAD7755A3E4CD0 libvorbisidec.so
+08-17 19:45:06.630 F/google-breakpad(25655): M E8481000 00000000 00008000 F3F7CCE4ADD14C5DB852DF06407AE2FA0 libcamera_metadata.so
+08-17 19:45:06.630 F/google-breakpad(25655): M E848C000 00000000 0000E000 1F6ED3D6536346B3B20CF40C5F9799D80 liblog.so
+08-17 19:45:06.630 F/google-breakpad(25655): M E849D000 00000000 00010000 D6821B30C7A106C623EEE331974C9BF50 libGLESv2.so
+08-17 19:45:06.630 F/google-breakpad(25655): M E84AF000 00000000 00014000 22B107B0382117ED603FF6000B248B8D0 libpcre.so
+08-17 19:45:06.630 F/google-breakpad(25655): M E84C4000 00000000 00040000 9CC9AFC89D88D4C4AE6AEF2E290594B70 libinputflinger.so
+08-17 19:45:06.630 F/google-breakpad(25655): M E8508000 00000000 00005000 459EC08F2C9F91A7E6AB6F293540B4510 libstdc++.so
+08-17 19:45:06.630 F/google-breakpad(25655): M E850F000 00000000 00005000 DE5A396AAF801AF9A298A50BADE143E60 libspeexresampler.so
+08-17 19:45:06.630 F/google-breakpad(25655): M E84F0000 00000000 00B36000 F1644AA2ACE475925E0DA02A814C13DF0 libLLVM.so
+08-17 19:45:06.630 F/google-breakpad(25655): M E9081000 00000000 00008000 225E121AA129BB96606A1B3B91A2737A0 libnbaio.so
+08-17 19:45:06.630 F/google-breakpad(25655): M E908C000 00000000 00017000 9A6B379EB3F10874FC241C570801C6070 libmemunreachable.so
+08-17 19:45:06.630 F/google-breakpad(25655): M E909C000 00000000 0005F000 0FAC08487B9CD62449A19C8D161E7D820 libgui.so
+08-17 19:45:06.631 F/google-breakpad(25655): M E9109000 00000000 00004000 E9B0F0A724940363FCBE11FB96B6ADF30 libnativebridge.so
+08-17 19:45:06.631 F/google-breakpad(25655): M E910D000 00000000 0007B000 B44B5897A497DCB27C105B61AC30F1180 libhwui.so
+08-17 19:45:06.631 F/google-breakpad(25655): M E918B000 00000000 0008B000 DCAB7F6AA60C5E74587E56973C6653120 libc++.so
+08-17 19:45:06.631 F/google-breakpad(25655): M E921C000 00000000 00003000 3C7CC5BEA31C9C85C9BC25EC0891B7B10 libsync.so
+08-17 19:45:06.631 F/google-breakpad(25655): M E9221000 00000000 00009000 4334A7FB3D1CB8582D4D676DE6E5E2930 libpiex.so
+08-17 19:45:06.631 F/google-breakpad(25655): M E922A000 00000000 0000E000 EBD0DA428C58F5CBD72761DD6F1C03A10 libsoundtrigger.so
+08-17 19:45:06.631 F/google-breakpad(25655): M E923D000 00000000 00020000 27C83DAE0AB0E161280BB40C384BD4BC0 libm.so
+08-17 19:45:06.631 F/google-breakpad(25655): M E925F000 00000000 00003000 C9108BAA1E466D60D4591919420BBB6A0 libradio_metadata.so
+08-17 19:45:06.631 F/google-breakpad(25655): M E9264000 00000000 0000E000 63E3F027146D592F9FBE03A33EDC8C6D0 libimg_utils.so
+08-17 19:45:06.631 F/google-breakpad(25655): M E9275000 00000000 00015000 53AF0C4E2096697687AC0081AC7AD97C0 libunwind.so
+08-17 19:45:06.631 F/google-breakpad(25655): M E92D0000 00000000 0001F000 9F74D840029038F65C040D5492CAE7360 libinput.so
+08-17 19:45:06.631 F/google-breakpad(25655): M E92F5000 00000000 00005000 17620CAE201DC01DFD868F3276E8AA810 libpowermanager.so
+08-17 19:45:06.631 F/google-breakpad(25655): M E92FD000 00000000 00055000 5E4B1D0F4D553AA92665AE0925229AF40 libsonivox.so
+08-17 19:45:06.631 F/google-breakpad(25655): M E9359000 00000000 00006000 E727B84B0F5B3D982CAE8FB6E64B88030 libtiff_directory.so
+08-17 19:45:06.632 F/google-breakpad(25655): M E9362000 00000000 00021000 52D2F4BBC71C3EE2E161E009B0331EF80 libstagefright_foundation.so
+08-17 19:45:06.632 F/google-breakpad(25655): M E9386000 00000000 0003B000 2D4A4F8139C7842165EA73A6ACD835340 libjpeg.so
+08-17 19:45:06.632 F/google-breakpad(25655): M E93C3000 00000000 00003000 9945E8F5AE0ADE1ED46FA08B41A6C9BE0 libmemtrack.so
+08-17 19:45:06.632 F/google-breakpad(25655): M E93C6000 00000000 00019000 D2D0067E628DCC03418B99399D251A990 libEGL.so
+08-17 19:45:06.632 F/google-breakpad(25655): M E93E4000 00000000 00019000 6534179E8DC7D8EDBF1236C375D51ECD0 libdrmframework.so
+08-17 19:45:06.632 F/google-breakpad(25655): M E93FB000 00000000 00110000 994744AF5261DAC7CD0003EC5456DBDF0 libicuuc.so
+08-17 19:45:06.632 F/google-breakpad(25655): M E9519000 00000000 00015000 BDA36CE4717D8C1A324C7CA4E1CA9B860 libvulkan.so
+08-17 19:45:06.632 F/google-breakpad(25655): M E9521000 00000000 000F8000 91002184018FFAC8E26ECCB238E392440 libandroid_runtime.so
+08-17 19:45:06.632 F/google-breakpad(25655): M E962A000 00000000 00004000 644559B020FD089F8180BB62CF9420590 libprocessgroup.so
+08-17 19:45:06.632 F/google-breakpad(25655): M E9629000 00000000 00183000 035813361AA690A2E08F1E059823C9D50 libicui18n.so
+08-17 19:45:06.632 F/google-breakpad(25655): M E97B8000 00000000 00008000 9D6466250A83301B3BE4CAA85227525D0 libnativeloader.so
+08-17 19:45:06.632 F/google-breakpad(25655): M E97C0000 00000000 0000E000 031F092D2D476376D52F41FD2ADD2A3E0 libradio.so
+08-17 19:45:06.632 F/google-breakpad(25655): M E97D2000 00000000 00003000 159F2CAC750E3DB60EF444F05BACCC850 libregionalization.so
+08-17 19:45:06.633 F/google-breakpad(25655): M E97D8000 00000000 00008000 16C813B71CC34E81BCF6F5DD8648DC3B0 libGLESv1_CM.so
+08-17 19:45:06.633 F/google-breakpad(25655): M E97E2000 00000000 00003000 AA06FF77B6E4CC83470C006104304D0F0 libhardware.so
+08-17 19:45:06.633 F/google-breakpad(25655): M E97E0000 00000000 00039000 B613B07CCC9703A9AAE92861C92202BD0 libcamera_client.so
+08-17 19:45:06.633 F/google-breakpad(25655): M E980D000 00000000 003A9000 42F6682A5C7E8B66743C6087B578D6C40 libskia.so
+08-17 19:45:06.633 F/google-breakpad(25655): M E9BDC000 00000000 00007000 AD9132F0D394659639CBE5858DD1BB750 libhardware_legacy.so
+08-17 19:45:06.633 F/google-breakpad(25655): M E9BE7000 00000000 00005000 EE5BF022DE057918231B46C6EDDC38690 libstagefright_yuv.so
+08-17 19:45:06.633 F/google-breakpad(25655): M E9BEE000 00000000 00007000 9BC1C9D1E638BF1B7B32AC308B08D9DA0 libimage_type_recognition.so
+08-17 19:45:06.633 F/google-breakpad(25655): M E9BF7000 00000000 0000D000 3C492E547FA88D7E2E85BD9451F613090 libbacktrace.so
+08-17 19:45:06.633 F/google-breakpad(25655): M E9C07000 00000000 00007000 B165EC37228240E1EBEDC14160C16A3A0 libnativehelper.so
+08-17 19:45:06.633 F/google-breakpad(25655): M E9C10000 00000000 0001A000 4D1780AFB25B59BBD625608B400D70C20 libprotobuf-cpp-lite.so
+08-17 19:45:06.633 F/google-breakpad(25655): M E9C2D000 00000000 00004000 989F274AF037FE14219BE6DC42503B950 libnetd_client.so
+08-17 19:45:06.633 F/google-breakpad(25655): M E9C33000 00000000 000A0000 8E23BB4E73E86B4A2AD4C17D7BAFD8A90 libcrypto.so
+08-17 19:45:06.633 F/google-breakpad(25655): M E9CE0000 00000000 00003000 675D9BCC56AB210C8017D6625F994D250 libstagefright_enc_common.so
+08-17 19:45:06.634 F/google-breakpad(25655): M E9CE5000 00000000 00024000 CC51150390EA9EFB0315C02573CCFD000 libpng.so
+08-17 19:45:06.634 F/google-breakpad(25655): M E9D0B000 00000000 0003B000 4FBF4968372FEB1C8D593076E1B171610 libRScpp.so
+08-17 19:45:06.634 F/google-breakpad(25655): M E9D49000 00000000 0000A000 415DAD77CED2441456E20CAD35C536250 libRS.so
+08-17 19:45:06.634 F/google-breakpad(25655): M E9D55000 00000000 00004000 F168A985060F7993C937719998C96FD20 libusbhost.so
+08-17 19:45:06.634 F/google-breakpad(25655): M E9D5B000 00000000 00086000 58C592B73EA51A0AFC3287247961D0940 libdng_sdk.so
+08-17 19:45:06.634 F/google-breakpad(25655): M E9DE1000 00000000 00057000 44C1EA73F38E47E95712BF5848E8937E0 libbinder.so
+08-17 19:45:06.634 F/google-breakpad(25655): M E9E3F000 00000000 0002E000 2824A9CACA3A870AD713A3405D6249530 libwilhelm.so
+08-17 19:45:06.634 F/google-breakpad(25655): M E9E72000 00000000 00030000 E9CE28F8F628E4501925FF4D0FD6168F0 libstagefright_omx.so
+08-17 19:45:06.634 F/google-breakpad(25655): M E9EA0000 00000000 00487000 3CD6A967C46ED23F4AB4B39092B43AB70 libpdfium.so
+08-17 19:45:06.634 F/google-breakpad(25655): M EA337000 00000000 00004000 76B7583F8773D45C53E165CABC841DE70 libETC1.so
+08-17 19:45:06.634 F/google-breakpad(25655): M EA33D000 00000000 00015000 F0658EC8F5FCD09AB82C2EFC3A6834210 libui.so
+08-17 19:45:06.634 F/google-breakpad(25655): M EA355000 00000000 00038000 E4F681ED6DAD0F793516317FBE3DD55A0 libRS_internal.so
+08-17 19:45:06.634 F/google-breakpad(25655): M EA390000 00000000 00016000 0DB58A0AF796EA03A43AAD505A8723310 liblzma.so
+08-17 19:45:06.634 F/google-breakpad(25655): M EA3AE000 00000000 00011000 2618247A47A298A5C4574CC818C7F3280 libselinux.so
+08-17 19:45:06.635 F/google-breakpad(25655): M EA3C1000 00000000 00005000 961542B344C4A0F54F87B49C0F1429E80 libwpa_client.so
+08-17 19:45:06.635 F/google-breakpad(25655): M EA3C8000 00000000 00007000 5FF53AA38050A1DE3BF7A4D755DC75B70 libaudioutils.so
+08-17 19:45:06.635 F/google-breakpad(25655): M EA3D1000 00000000 00017000 31235ADAF427BE11933CD87290CCAF050 libcutils.so
+08-17 19:45:06.635 F/google-breakpad(25655): M EA3EB000 00000000 00036000 CBC6DC0C255BAB785FCD0511A7CBF0690 libbcinfo.so
+08-17 19:45:06.635 F/google-breakpad(25655): M EA423000 00000000 00003000 FDA204F888F3C0D8070BFDEC834066D20 libstagefright_http_support.so
+08-17 19:45:06.635 F/google-breakpad(25655): M EA428000 00000000 00005000 14FB257C9C6F43C8FA0B475D81C47FFC0 libbinary_parse.so
+08-17 19:45:06.635 F/google-breakpad(25655): M EA42F000 00000000 00009000 93F30055C78E1D80E40A8E717405CF500 libmediautils.so
+08-17 19:45:06.635 F/google-breakpad(25655): M EA43B000 00000000 0000A000 0F98C20EB2725367604DCE7EDA8EED9D0 libbase.so
+08-17 19:45:06.635 F/google-breakpad(25655): M EA447000 00000000 00016000 DC1FEB19B377562139F4F8AAFFA610710 libz.so
+08-17 19:45:06.635 F/google-breakpad(25655): M EA460000 00000000 00015000 68F77CDFB35DA081E510A50D11F299D70 libexpat.so
+08-17 19:45:06.635 F/google-breakpad(25655): M EA45D000 00000000 000C3000 3B22B766CDBB99263CF24B4CC2986E510 libmedia.so
+08-17 19:45:06.635 F/google-breakpad(25655): M EA541000 00000000 00031000 335A60B9AA0F00A47BD5A781CCA820740 libandroidfw.so
+08-17 19:45:06.635 F/google-breakpad(25655): M EA574000 00000000 0007A000 21086BE83826AA7DC32AB49C79D5CCE30 libsqlite.so
+08-17 19:45:06.635 F/google-breakpad(25655): M EA5F2000 00000000 0006C000 6EA54A19597F20D46626700FE9F206F50 libft2.so
+08-17 19:45:06.636 F/google-breakpad(25655): M EA64F000 00000000 0016B000 4E69F13734FEABE1CA5BA98594235DCD0 libstagefright.so
+08-17 19:45:06.636 F/google-breakpad(25655): M EA7D3000 00000000 00007000 475E29D0A243BEE93EC1A630C99503FC0 libnetutils.so
+08-17 19:45:06.636 F/google-breakpad(25655): M EA7DC000 00000000 00084000 49B02E01AEC77331A1D6D19B540265610 libc.so
+08-17 19:45:06.636 F/google-breakpad(25655): M EA86E000 00000000 00025000 8B6ECC65C09CAFF5ACAAB6C9249CD2C20 libssl.so
+08-17 19:45:06.636 F/google-breakpad(25655): M EA896000 00000000 00008000 22114C778A7ED1CC3953CCB22323EA1B0 libstagefright_avc_common.so
+08-17 19:45:06.636 F/google-breakpad(25655): M EA8A1000 00000000 00003000 7FA19C935E6148BD8002A3CA630C4E6F0 libsmemlog.so
+08-17 19:45:06.636 F/google-breakpad(25655): M EA8A1000 00000000 00017000 EEAF8ABB6827B80A458A5D483E5562400 libqmiservices.so
+08-17 19:45:06.636 F/google-breakpad(25655): M EA8C1000 00000000 00008000 090640ECFC69E16A25A3E27006AF282E0 libxml.so
+08-17 19:45:06.636 F/google-breakpad(25655): M EA8CC000 00000000 00012000 67F4D476A96F053ACB61531379FCC4810 libdsutils.so
+08-17 19:45:06.636 F/google-breakpad(25655): M EA8EF000 00000000 00014000 EFD5F0A0F81252A037F1C06B8E6809700 libsdsprpc.so
+08-17 19:45:06.636 F/google-breakpad(25655): M EA905000 00000000 0003E000 C4311189AF8DA8405EDC0701CD38FC770 libgsl.so
+08-17 19:45:06.636 F/google-breakpad(25655): M EA99F000 00000000 00014000 75BC34362D3F387A08AE8241CED8E2550 libadsprpc.so
+08-17 19:45:06.636 F/google-breakpad(25655): M EA9B2000 00000000 0001A000 840BD6EAC45DEFC59D2F1E8C681CFF1A0 lib-imsrcscmclient.so
+08-17 19:45:06.636 F/google-breakpad(25655): M EA9DA000 00000000 00011000 6034A9FBADF19CE6C259DA006E8158FC0 lib-imsrcscmservice.so
+08-17 19:45:06.637 F/google-breakpad(25655): M EAA09000 00000000 00003000 7BB31E1D28279A11B8087C3F4DF7D0BA0 libqti-at.so
+08-17 19:45:06.637 F/google-breakpad(25655): M EAA0E000 00000000 0000C000 7D5A1CA22F6A85FCC57B3D36A92461560 lib-ims-rcscmjni.so
+08-17 19:45:06.637 F/google-breakpad(25655): M EAA1C000 00000000 00012000 FAD2DBDF65F36590FFE591C62DBEFA1E0 libOpenCL.so
+08-17 19:45:06.637 F/google-breakpad(25655): M EAA38000 00000000 00003000 025B4D5BBA39265D6260B27597E321730 memtrack.msm8937.so
+08-17 19:45:06.637 F/google-breakpad(25655): M EAA3D000 00000000 00011000 F5FF7C8214A82029405A068BCDF69A580 libmediandk.so
+08-17 19:45:06.637 F/google-breakpad(25655): M EAA53000 00000000 00008000 5373A05304D5AFD8BC2BB49D6C22977D0 libopenjdkjvm.so
+08-17 19:45:06.637 F/google-breakpad(25655): M EAA5C000 00000000 0000F000 96A60B84ED1352C202B6695FD32373790 libmediadrm.so
+08-17 19:45:06.637 F/google-breakpad(25655): M EAA6E000 00000000 00010000 3D880E60A39C482BA4210DA0AD4E20490 libGLESv3.so
+08-17 19:45:06.637 F/google-breakpad(25655): M EAA97000 00000000 00003000 F4CB54FA6F9A644292CE2DCC9FA89DA80 libqti_performance.so
+08-17 19:45:06.637 F/google-breakpad(25655): M EAA9D000 00000000 00004000 B2EAC3688B9EFF0E79EA2C170AA859C50 libwebviewchromium_plat_support.so
+08-17 19:45:06.637 F/google-breakpad(25655): M EAAA5000 00000000 00004000 837BE31E60CD67A2C45BF27A1E8C10140 libOpenSLES.so
+08-17 19:45:06.637 F/google-breakpad(25655): M EAAAB000 00000000 00004000 3C4D0169CD09A3AEEC0868A7FC87CCFA0 libOpenMAXAL.so
+08-17 19:45:06.637 F/google-breakpad(25655): M EAAB0000 00000000 00016000 BAF17608D25635EFA63708C89561474D0 libcamera2ndk.so
+08-17 19:45:06.637 F/google-breakpad(25655): M EAB53000 00000000 00003000 78C8F6360CF612E4333D4EB1796927460 libqti-perfd-client.so
+08-17 19:45:06.638 F/google-breakpad(25655): M EAB57000 00000000 00014000 01EE9AC4109E06B182E77B55242AEBE20 libandroid.so
+08-17 19:45:06.638 F/google-breakpad(25655): M EABAF000 00000000 00003000 4C4B6F03AF5049885FD4A43F149D13630 libjnigraphics.so
+08-17 19:45:06.638 F/google-breakpad(25655): M EABB0000 00000000 00090000 FBA40D2822A0C6DCF7CE29FB42DC37230 libmediaplayerservice.so
+08-17 19:45:06.638 F/google-breakpad(25655): M EAC7B000 00000000 0000A000 52C41240B217BFE92F7381218169FD760 liblz4.so
+08-17 19:45:06.638 F/google-breakpad(25655): M EACF9000 00000000 00038000 FEF1DA3EC5AA99E4FF38C1DF2A9A91570 libavenhancements.so
+08-17 19:45:06.638 F/google-breakpad(25655): M EAD35000 00000000 0002F000 85E4C8F7646AA02A46215564266690BA0 libstagefright_wfd.so
+08-17 19:45:06.638 F/google-breakpad(25655): M EAD6A000 00000000 00026000 7B91D8B6A15FF171BF114D8D638785D80 libstagefright_httplive.so
+08-17 19:45:06.638 F/google-breakpad(25655): M EAD94000 00000000 00003000 6DE080E13BB1741A34C157CE97277ABD0 libsigchain.so
+08-17 19:45:06.638 F/google-breakpad(25655): M EADE7000 00000000 00003000 1390052238CBD9474F1747EA0BA53C740 libExtendedExtractor.so
+08-17 19:45:06.638 F/google-breakpad(25655): M EAE32000 00000000 00006000 3B45281FC4EB699207799FD6018FBD910 libvendorconn.so
+08-17 19:45:06.638 F/google-breakpad(25655): M EAEB2000 00000000 0005F000 7AC50A488023F3DA8182906BDFFA72C10 linker
+08-17 19:45:06.638 F/google-breakpad(25655): -----END BREAKPAD MICRODUMP-----
+08-17 19:45:26.056 F/google-breakpad(25833): -----BEGIN BREAKPAD MICRODUMP-----
+08-17 19:45:26.057 F/google-breakpad(25833): V AndroidWebView:62.0.3188.0
+08-17 19:45:26.057 F/google-breakpad(25833): O A arm 08 armv8l Nokia/TA-1025_00WW/PLE:7.1.1/NMF26F/00WW_3_32C:user/release-keys
+08-17 19:45:26.057 F/google-breakpad(25833): P webview
+08-17 19:45:26.057 F/google-breakpad(25833): R 00000005 SIGTRAP 22F73000
+08-17 19:45:26.057 F/google-breakpad(25833): G
+08-17 19:45:26.074 F/google-breakpad(25833): H 12C00000 FFF73000 00EE 31E89000 95FAB000 0C:1B 0D:0F 0E:0B 0F:35 10:06 11:05 12:05 13:1C 14:0D 15:0D 16:15 17:18 18:0A 19:03 1B:01 1C:02 1D:01
+08-17 19:45:26.076 F/google-breakpad(25833): S 0 C9472C60 C9472000 00002000
+08-17 19:45:26.077 F/google-breakpad(25833): S C9472000 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:45:26.078 F/google-breakpad(25833): S C9472180 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:45:26.078 F/google-breakpad(25833): S C9472300 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:45:26.079 F/google-breakpad(25833): S C9472480 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:45:26.079 F/google-breakpad(25833): S C9472600 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:45:26.080 F/google-breakpad(25833): S C9472780 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:45:26.081 F/google-breakpad(25833): S C9472900 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:45:26.081 F/google-breakpad(25833): S C9472A80 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:45:26.082 F/google-breakpad(25833): S C9472C00 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005C2D47C94C2D47C9502D47C98C2C47C9EDACEF0DEDACEF0D01000000242E47C9010000009D20FCD3EDACEF0DEDACEF0D00000000EDACEF0D0000000000000000EDACEF0DEDACEF0D0000000000000000BC2C47C901000000000000009002000000000000EDACEF0D00000000200000000000000000002CD4000000000000000000000000000000000000000000000000EDACEF0D000000000000000000000000EDACEF0D00000000EDACEF0D0000000000000000EDACEF0D0000000000000000000000000000000020000000D02C47C9EDACEF0D502D47C94C2D47C9EDACEF0DEDACEF0DD5D92BD4EDACEF0DEDACEF0DEDACEF0D0000000003000000EDACEF0D0000000000000000EDACEF0DEDACEF0DEDACEF0DB7D72BD4C02D47C9B7EF57D2
+08-17 19:45:26.083 F/google-breakpad(25833): S C9472D80 00000000EDACEF0DEDACEF0D0000000000000000EDACEF0D000000000000000001000000EDACEF0D0000000000000000EDACEF0D000000000000000001000000EDACEF0D0000000000000000EDACEF0D000000000000000001000000010000000000000000000000FFFFFFFF000000000000000000000000FFFFFFFF01000000EDACEF0D7C2E47C9842E47C9882E47C9242E47C9D82E47C9782E47C98F0830D4EDACEF0DEDACEF0DEDACEF0DDD7755D2EDACEF0DD82E47C94C2E47C9482E47C9D82E47C9382F47C9742F47C9D82E47C900000000EDACEF0DEDACEF0DEDACEF0D3C3147C947733DD4D82E47C9802E47C9782E47C900000000EDACEF0DEDACEF0DEDACEF0D018D98D200000000000000000400000000000000FFFFFFFF00000000FFFFFFFF00000000FFFFFFFF00000000FFFFFFFF070000001D00000000000000FFFFFFFF00000000FFFFFFFF00CB97D200000000EDACEF0D000000000000000000000000076291D2A03047C9EDACEF0D382F47C9EDACEF0D4543A7D400000000
+08-17 19:45:26.083 F/google-breakpad(25833): S C9472F00 083047C9EB8E3DD4A43047C902000000302F47C9EDACEF0D382F47C9EDACEF0DEDACEF0D3C000000EDACEF0DEDACEF0DEDACEF0D3C000000EDACEF0DFFFFFFFFFFFFFFFFFFFFFFFFEDACEF0D6C0000000000000001000000EDACEF0DEDACEF0D742F6874EDACEF0D14617274EDACEF0DEDACEF0D3100000024000000EDACEF0D3C000000FFFFFFFFFFFFFFFF02000000FFFFFFFFFFFFFFFF01000000FFFFFFFFFFFFFFFFA43047C9A03047C9343147C9EDACEF0D4543A7D400000000083047C93C3147C911A03DD400000000000000000C3047C9EDACEF0DEDACEF0DEDACEF0D00000000EDACEF0D00000000EDACEF0D02000000B9D89CD2EDACEF0DEDACEF0D203047C9703347C90000000001000000EDACEF0D00000000783447C923D89CD2000000000800000001000000006291D200000000000000000000000000000000000000000000000000000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF02000000FFFFFFFFFFFFFFFF01000000FFFFFFFFFFFFFFFF00000000
+08-17 19:45:26.084 F/google-breakpad(25833): S C9473080 0000000000000000000000000000000007000000470000006D8741D4EDACEF0DEDACEF0DEDACEF0DEDACEF0DFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000000003147C900000000000000000000000000000000000000000000000000000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF02000000FFFFFFFFFFFFFFFF01000000FFFFFFFFFFFFFFFF000000000000000000000000000000000000000007000000470000000200000000000000EDACEF0DEDACEF0D000000000000000000000000EDACEF0DEDACEF0DEDACEF0DEDACEF0DEDACEF0D00000000383247C94543A7D4EDACEF0D383247C9703347C9283247C9EDACEF0DEDACEF0D4543A7D400000000EDACEF0D783447C92DB773D200000000D5B0B6D425B0B6D42C0100007D933DD453E29CD253E29CD2CF228BD2CF228BD29C0A0000EDACEF0D090000009C0A0000000000007DF856D2EDACEF0D7D933DD453E29CD253E29CD2CF228BD2CF228BD2EDACEF0D383247C900000000783447C98D8064D2
+08-17 19:45:26.084 F/google-breakpad(25833): S C9473200 6E70E4D48970E4D400000000000000000000000000000000EDACEF0D000000000000000000000000EDACEF0D0000000000000000A43247C90000000000000000EDACEF0DEDACEF0DEDACEF0D7B2B84EAEDACEF0DEDACEF0D783447C9B97855D2EDACEF0DA43247C9EDACEF0DEDACEF0DEDACEF0D090000000000000009000000EDACEF0DEDACEF0D0000000000000000EDACEF0DEDACEF0D0000000000000000D03547C9EDACEF0DEDACEF0D00000000EDACEF0DEDACEF0D383347C901000000EDACEF0DEDACEF0D783447C93FD49CD2EDACEF0D09000000083347C9EDACEF0D083347C9F03347C9043347C9AFA673D20100000021C973D2000000000000000001000000000000000000000000000000000000000000000000000000EDACEF0D1B000000FFFFFFFF703347C94F1B59D2EDACEF0D090000000000000000000000000000000000000025B0B6D4EDACEF0D00000000A1CE9CD29C0A000000000000EDACEF0D02000000943447C905000000EDACEF0D000000000000000000000000
+08-17 19:45:26.085 F/google-breakpad(25833): S C9473380 000000000000000000000000D5B0B6D425B0B6D42C0100007D933DD453E29CD253E29CD2CF228BD2CF228BD29C0A0000EDACEF0DE83347C99C0A000000000000EDACEF0DEDACEF0D0000000000000000EDACEF0D090000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000EDACEF0DEDACEF0D983447C90000000001000000D83447C900000000783447C9FBC69CD20000000000000000EDACEF0D09000000883447C9010000000000000000000000E8030000000000000000000000000000E8030000B03447C9EDACEF0D803447C900000000EDACEF0D00000000000000000000000000000000EDACEF0D09000000000000000000000000000000EDACEF0D0000000000000000EDACEF0D0900000000000000000000000000000000000000EDACEF0DEDACEF0D00000000EDACEF0DD03547C965CC73D20000000000000000EDACEF0D02000000EDACEF0D01000000EDACEF0D00000000D03547C9EDACEF0D0000000000000000
+08-17 19:45:26.086 F/google-breakpad(25833): S C9473500 0000000000000000EDACEF0D283747C9C03547C9EDACEF0DEDACEF0D747D92D400000000283747C9EDACEF0D2DB773D2EDACEF0D303747C9F03547C9EDACEF0DEDACEF0D747D92D4000000006BB773D201010000DC3547C9EDACEF0DEDACEF0DB000000080000000EDACEF0D7B2B84EA53E29CD253E29CD2CF228BD2CF228BD2178076D2DC3547C9EDACEF0D0000000007E29CD207E29CD207E29CD207E29CD200000000000000000000000000000000FC3547C9000000000000000000000000EDACEF0D00000000EDACEF0DF6FFFFFF00000000000000004000000000000000EDACEF0DEDACEF0D00000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000EDACEF0DC43647C90000000000000000403847C9EDACEF0DEDACEF0D00000000283747C9A43647C9483747C92842A7D4EDACEF0D283747C9EDACEF0D5FB473D2303747C9C43647C9503747C92842A7D400000000303747C9
+08-17 19:45:26.086 F/google-breakpad(25833): S C9473680 503747C935B573D2EDACEF0DEDACEF0DEDACEF0DEDACEF0DFFFFFFFFC03647C9020000000000000000000000000000000000000077D5BED2EDACEF0D00000000F8FFFFFFEDACEF0DE43647C9EDACEF0DB83747C9EDACEF0D00000000000000000000000000000000EDACEF0DEDACEF0D283747C9EDACEF0DB83747C9EDACEF0DC83747C9283747C9703747C92BAA73D2EDACEF0DEDACEF0D01000000EDACEF0DEDACEF0DEDACEF0DEDACEF0D0000000000000000000000000000000000000000000000002843A7D42842A7D49601000053E29CD253E29CD2CF228BD2CF228BD2178076D2C9020000010047C900000000FFFFFFFFD0A4BDD20B000000F03747C900000000EDACEF0DEDACEF0DEDACEF0DAC3747C9FFFFFFFFE03747C9EDACEF0D010000006B9855D2EDACEF0DEDACEF0DEDACEF0DEDACEF0DEDACEF0D0000000000000000000000000000000000000000000000002843A7D42842A7D49601000053E29CD253E29CD2CF228BD2CF228BD2178076D2C902000001000000D34657D2
+08-17 19:45:26.087 F/google-breakpad(25833): S C9473800 EDACEF0DEDACEF0DEDACEF0D01000000EDACEF0DEDACEF0D000000005B8173D2020000009BD47ED2CC3847C9403847C9EDACEF0D00000000CC3847C91FA773D20000000000000000EDACEF0D3100000020000000EDACEF0D00000000000000000000000000000000983847C9EDACEF0DEDACEF0DEDACEF0D943847C9EDACEF0D00000000CC3847C9000000006B9855D20000000000000000EDACEF0D214657D2000000000000000000000000B34557D2EDACEF0DEDACEF0DEDACEF0DEDACEF0D00000000498473D2EDACEF0DEDACEF0D00000000EDACEF0DEDACEF0D00000000CC3847C9EDACEF0DEDACEF0D203947C978000000EDACEF0DEDACEF0DA38173D2203947C9CD2F82EA203947C9E52F82EA283947C9EF5C7FEA7800000000000000EDACEF0DEDACEF0DEDACEF0DEDACEF0D00000000EDACEF0DEDACEF0D00100000000000000000000000000000000000005B8173D2EDACEF0D00000000EDACEF0D0100000000000000EDACEF0D00000000703947C9203947C91600000000000000
+08-17 19:45:26.087 F/google-breakpad(25833): S C9473980 00000000EDACEF0D00000000EDACEF0D0000000001000000EDACEF0D0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000EDACEF0D01000000EDACEF0D000000000000000001000000EDACEF0D01000000EDACEF0D01000000EDACEF0D01000000EDACEF0D010000000100000001000000EDACEF0D01000000EDACEF0D01000000EDACEF0D01000000EDACEF0D01000000EDACEF0D00000000000000000000000000000000000000000000000001000000EDACEF0D01000000EDACEF0D00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:45:26.088 F/google-breakpad(25833): S C9473B00 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:45:26.089 F/google-breakpad(25833): S C9473C80 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:45:26.089 F/google-breakpad(25833): S C9473E00 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:45:26.089 F/google-breakpad(25833): S C9473F80 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:45:26.090 F/google-breakpad(25833): C 06000040000000000000000005B88FD2000000008C2C47C9CC2C47C960410046AC2C47C94C2D47C95C2D47C9502D47C9802E47C9D9C5F7D3602C47C91B89B3D28684B3D2300001680000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:45:26.090 F/google-breakpad(25833): M AAAAA000 00000000 00005000 8D2477F3B51997BDCC3733B8D1F920BE0 app_process32
+08-17 19:45:26.090 F/google-breakpad(25833): M 70D29000 00000000 00806000 E9166D3ED622EE65A3A4086EBEA4A7950 boot.oat
+08-17 19:45:26.090 F/google-breakpad(25833): M 71531000 00000000 006C0000 668D96384E4368B01BC9B9F365028CA20 boot-core-libart.oat
+08-17 19:45:26.091 F/google-breakpad(25833): M 71BF3000 00000000 000AA000 0D160B642FB1639805B72AC6F4DF3F380 boot-conscrypt.oat
+08-17 19:45:26.091 F/google-breakpad(25833): M 71C9F000 00000000 000D1000 9D69BDC94BD07F2468D5B7DB0AEEF0140 boot-okhttp.oat
+08-17 19:45:26.091 F/google-breakpad(25833): M 71D72000 00000000 0000C000 566CD32860A984FD445A4852058609CB0 boot-core-junit.oat
+08-17 19:45:26.091 F/google-breakpad(25833): M 71D80000 00000000 0019F000 09C1E8B1D7FC826CB75691EC5BDBA1DB0 boot-bouncycastle.oat
+08-17 19:45:26.091 F/google-breakpad(25833): M 71F21000 00000000 0014B000 069BAE4D2D7831B857A3C236021D868A0 boot-ext.oat
+08-17 19:45:26.091 F/google-breakpad(25833): M 7206E000 00000000 0223E000 D0BEBD37E215DDC845099212203F792F0 boot-framework.oat
+08-17 19:45:26.091 F/google-breakpad(25833): M 742AE000 00000000 00502000 B41E052DBA2949CE100713743053E1E40 boot-telephony-common.oat
+08-17 19:45:26.091 F/google-breakpad(25833): M 747B2000 00000000 0003D000 65E4B1E28F33F9C51062E2D0630394830 boot-voip-common.oat
+08-17 19:45:26.092 F/google-breakpad(25833): M 747F1000 00000000 00045000 EB491A6AF6568A675D81746238ACC78B0 boot-ims-common.oat
+08-17 19:45:26.092 F/google-breakpad(25833): M 74838000 00000000 0016C000 C369D6D4F8DCF10CC0AD1800000000000 boot-apache-xml.oat
+08-17 19:45:26.092 F/google-breakpad(25833): M 749A6000 00000000 000FF000 1FAC5317B0FEBD01C31E8039D76CCAF50 boot-org.apache.http.legacy.boot.oat
+08-17 19:45:26.092 F/google-breakpad(25833): M 74AA7000 00000000 00004000 C368F8D0F8DCF10C00BE1800000000000 boot-tcmiface.oat
+08-17 19:45:26.092 F/google-breakpad(25833): M 74AAD000 00000000 00016000 C368FA40F8DCF10C3FB11800000000000 boot-WfdCommon.oat
+08-17 19:45:26.092 F/google-breakpad(25833): M 74AC5000 00000000 00004000 A2EDD62E4499B2C98D8C251F0977951B0 boot-oem-services.oat
+08-17 19:45:26.092 F/google-breakpad(25833): M 74ACB000 00000000 0001C000 3794BA12A18F802DF4E8F10D4B2662FB0 boot-qcom.fmradio.oat
+08-17 19:45:26.092 F/google-breakpad(25833): M 74AE9000 00000000 00009000 C368F9A8F8DCF10C95B41800000000000 boot-qcmediaplayer.oat
+08-17 19:45:26.092 F/google-breakpad(25833): M 74AF4000 00000000 00008000 C368E898F8DCF10CDEAD1800000000000 boot-telephony-ext.oat
+08-17 19:45:26.093 F/google-breakpad(25833): M 74AFE000 00000000 00013000 C368E46FF8DCF10CA3A11800000000000 boot-dolby_ds2.oat
+08-17 19:45:26.093 F/google-breakpad(25833): M 74B13000 00000000 0000A000 C368F9E4F8DCF10C41B01800000000000 boot-dolby_ds1.oat
+08-17 19:45:26.093 F/google-breakpad(25833): M C6B80000 00000000 00005000 F841612CF1D458AB70296575A996EE5F0 QPerformance.odex
+08-17 19:45:26.093 F/google-breakpad(25833): M CB999000 00000000 00856000 000003F10000000031270A00000000000 base.odex
+08-17 19:45:26.093 F/google-breakpad(25833): M CCAF6000 00000000 00936000 00000F700000000098480B00000000000 base.odex
+08-17 19:45:26.093 F/google-breakpad(25833): M CF4C6000 00000000 02000000 000000000000000000000000000000000 dalvik-jit-code-cache (deleted)
+08-17 19:45:26.093 F/google-breakpad(25833): M D2273000 04247000 02C94000 8A2EFA0DECC3EF7057A1C62BF1AECCA80 libmonochrome.so
+08-17 19:45:26.093 F/google-breakpad(25833): M D9155000 00000000 00004000 C1741AE46077EF13F70D0DC7D8A9DDE80 libwebviewchromium_loader.so
+08-17 19:45:26.093 F/google-breakpad(25833): M D9276000 00000000 00006000 C700FED4854EA9F553FC4EB1AC49DAD50 libqdutils.so
+08-17 19:45:26.093 F/google-breakpad(25833): M D927F000 00000000 00007000 5AF3845B7F31952390092BB2318667B00 gralloc.msm8937.so
+08-17 19:45:26.094 F/google-breakpad(25833): M D926B000 00000000 00823000 A91A29ADD65BB0AF28A4C9A6208E33C40 libllvm-glnext.so
+08-17 19:45:26.094 F/google-breakpad(25833): M D9AB7000 00000000 00316000 9F7E6C49A0A8C88C317716B031320CA30 libESXGLESv2_adreno.so
+08-17 19:45:26.094 F/google-breakpad(25833): M D9F1F000 00000000 0000C000 CEC6F7F71723450F4D1E527FA1BDDA310 libqservice.so
+08-17 19:45:26.094 F/google-breakpad(25833): M D9F30000 00000000 00007000 BB9F7CD0BF1178F273EB8B4D2D5C67C30 libmemalloc.so
+08-17 19:45:26.094 F/google-breakpad(25833): M D9F39000 00000000 00003000 B4B80A1B5D6C50F5C0DD7F1C29A9F6C10 libqdMetaData.so
+08-17 19:45:26.094 F/google-breakpad(25833): M D9F43000 00000000 00009000 0BA85EA850C07E5B86AF8281EF7641E70 libcompiler_rt.so
+08-17 19:45:26.094 F/google-breakpad(25833): M D9F4E000 00000000 0000B000 362BA72B9CF73AB8BD02283F491283E40 eglSubDriverAndroid.so
+08-17 19:45:26.094 F/google-breakpad(25833): M D9F5B000 00000000 0000B000 9BAA0F603A10810D4A6BEE7A903A762F0 libGLESv2_adreno.so
+08-17 19:45:26.094 F/google-breakpad(25833): M D9F68000 00000000 00007000 C08FDBDAB5792096DB0BEDBE3D23B48D0 libGLESv1_CM_adreno.so
+08-17 19:45:26.094 F/google-breakpad(25833): M D9F71000 00000000 00024000 C346DBBCF27F603F9321CCF737B3C0550 libESXGLESv1_CM_adreno.so
+08-17 19:45:26.094 F/google-breakpad(25833): M D9F97000 00000000 00010000 A7800610AD28E2DF469D023E70516C190 libESXEGL_adreno.so
+08-17 19:45:26.094 F/google-breakpad(25833): M D9FAB000 00000000 00006000 6CC274368542A8270BC225BE519068D80 libadreno_utils.so
+08-17 19:45:26.094 F/google-breakpad(25833): M D9FBC000 00000000 00009000 649C0C218A9C0A611E5E0DB24CDD058C0 libEGL_adreno.so
+08-17 19:45:26.094 F/google-breakpad(25833): M DA4BC000 00000000 00020000 1195E0A668F3644AC0EC8D1122457A140 libkeymaster1.so
+08-17 19:45:26.095 F/google-breakpad(25833): M DA4DF000 00000000 00018000 39E3D5620A966F5DB960EEE55CCD8BB30 libsoftkeymasterdevice.so
+08-17 19:45:26.095 F/google-breakpad(25833): M DA4F9000 00000000 0001A000 C1B07DA2D52E6EC3C54992A3A953D63B0 libjavacrypto.so
+08-17 19:45:26.095 F/google-breakpad(25833): M DA516000 00000000 00004000 B051A444B9312E4DAF242DA3A951538A0 libkeystore-engine.so
+08-17 19:45:26.095 F/google-breakpad(25833): M DA51B000 00000000 00016000 1988D915061DDC4921FF608AD3E810AD0 libkeystore_binder.so
+08-17 19:45:26.095 F/google-breakpad(25833): M DA534000 00000000 0000C000 DDF063ABB28459B09548F8329934DDEB0 libkeymaster_messages.so
+08-17 19:45:26.095 F/google-breakpad(25833): M DC57D000 00000000 00016000 A686CFCA0E870C10B425EB769017BE930 libmtp.so
+08-17 19:45:26.095 F/google-breakpad(25833): M DC593000 00000000 00052000 E9F8299757E5E543C03723101E5B1BEC0 libmedia_jni.so
+08-17 19:45:26.095 F/google-breakpad(25833): M DC5E8000 00000000 00020000 ADF61BE35FF269EC7E7B32B1DDCD31E00 libexif.so
+08-17 19:45:26.095 F/google-breakpad(25833): M DC616000 00000000 0000E000 ABA3C77DD3386AE87B586632CE1979D50 libstagefright_amrnb_common.so
+08-17 19:45:26.095 F/google-breakpad(25833): M DC634000 00000000 00007000 CD70BA801CA3E12D258565013535D7440 tcmclient.odex
+08-17 19:45:26.095 F/google-breakpad(25833): M DC645000 00000000 00004000 042B2B738C75036986EB80BC08A71F060 libextmedia_jni.so
+08-17 19:45:26.095 F/google-breakpad(25833): M E1E9B000 00000000 002B2000 FCA7431984CE2AEF979FFEEF99432D320 libart-compiler.so
+08-17 19:45:26.095 F/google-breakpad(25833): M E215E000 00000000 000B1000 1EBE7A1A3E1A3134DE689251E1ABC0380 libvixl.so
+08-17 19:45:26.095 F/google-breakpad(25833): M E2264000 00000000 0002B000 6E46C8EDE63F81CC2A4375E4F85517CD0 libopenjdk.so
+08-17 19:45:26.096 F/google-breakpad(25833): M E2291000 00000000 00029000 4F845000DEA8066D684FEAB08A91A3480 libjavacore.so
+08-17 19:45:26.096 F/google-breakpad(25833): M E22BC000 00000000 00138000 523FDEBEF6ECE577AF3716E9703AD4FF0 lib-imsqimf.so
+08-17 19:45:26.096 F/google-breakpad(25833): M E23FA000 00000000 00004000 48E9F68098728AFF9A198AE7A14A7F700 libmdmdetect.so
+08-17 19:45:26.096 F/google-breakpad(25833): M E2400000 00000000 00005000 12F24D77003A5660A06BA8690696A5C30 libconfigdb.so
+08-17 19:45:26.096 F/google-breakpad(25833): M E2405000 00000000 00085000 DB9D3DADFB06F6B1AB9CEC5443F295370 lib-imsxml.so
+08-17 19:45:26.096 F/google-breakpad(25833): M E2496000 00000000 00005000 F812502D41A460BDD2D9AA83A9564CC70 libqmi_encdec.so
+08-17 19:45:26.096 F/google-breakpad(25833): M E249C000 00000000 0001C000 A53A45C88FFCD4CB3AFF323AF8FFFBAB0 libqdi.so
+08-17 19:45:26.096 F/google-breakpad(25833): M E24B7000 00000000 0006A000 D110B55DE7DB9FD5086D2D1CE57152480 libdsi_netctrl.so
+08-17 19:45:26.096 F/google-breakpad(25833): M E2534000 00000000 00023000 E7FB6A8B99C97103F258028CF27324660 lib-imsrcscm.so
+08-17 19:45:26.096 F/google-breakpad(25833): M E255A000 00000000 0001C000 5BE35B9E5D50332052532AE119C50B930 libnetmgr.so
+08-17 19:45:26.096 F/google-breakpad(25833): M E257A000 00000000 00004000 AB354652140A356C9787104C87CB30E00 libidl.so
+08-17 19:45:26.096 F/google-breakpad(25833): M E2581000 00000000 00004000 63ED38853810ED69BA1AA57CE82E74B10 libtime_genoff.so
+08-17 19:45:26.096 F/google-breakpad(25833): M E2587000 00000000 00004000 51134658113749962ABB7BA3A3C5E9740 libqmi_client_helper.so
+08-17 19:45:26.096 F/google-breakpad(25833): M E258E000 00000000 00009000 1D288EC9F32773EBC0D380D4E238D8D60 libqmi_client_qmux.so
+08-17 19:45:26.097 F/google-breakpad(25833): M E25C9000 00000000 0006A000 60BAE0DAB14BFBC4BE1805CC4CAF8B4D0 lib-imsdpl.so
+08-17 19:45:26.097 F/google-breakpad(25833): M E263D000 00000000 00019000 0333752023452FF1E40F6BA9169471500 libdiag.so
+08-17 19:45:26.097 F/google-breakpad(25833): M E274E000 00000000 0002C000 0FC3AF7C85EA4B0DA653AEA111020A2D0 libqmi.so
+08-17 19:45:26.097 F/google-breakpad(25833): M E27B7000 00000000 000B8000 023971CEF8E022AAD4090C7D1432C3690 libCB.so
+08-17 19:45:26.097 F/google-breakpad(25833): M E7D93000 00000000 00461000 39CBB6C545073B5DB56B60665F81D4B00 libart.so
+08-17 19:45:26.097 F/google-breakpad(25833): M E8384000 00000000 00001000 7691C4BE084B030B3AA118A6F412EE260 libqmi_common_so.so
+08-17 19:45:26.097 F/google-breakpad(25833): M E8387000 00000000 0000A000 37A576E22F2B9973E1734E556E1E99990 libqmi_cci.so
+08-17 19:45:26.097 F/google-breakpad(25833): M E8395000 00000000 00003000 DCDF68ACFBFC2DEFC89FA0F5783199070 libpackagelistparser.so
+08-17 19:45:26.097 F/google-breakpad(25833): M E839A000 00000000 00056000 0C1D30C5E6EA7E82800A2B00935E4B060 libharfbuzz_ng.so
+08-17 19:45:26.097 F/google-breakpad(25833): M E83F3000 00000000 00037000 8AF00237A05209C2E429D0F70ED3EB900 libopus.so
+08-17 19:45:26.097 F/google-breakpad(25833): M E842C000 00000000 00017000 215A7F63855CB46EC59B425BEDFD847D0 libminikin.so
+08-17 19:45:26.097 F/google-breakpad(25833): M E8447000 00000000 00018000 EAB4CCC4544F5D8E2ECF256D527F4A430 libutils.so
+08-17 19:45:26.097 F/google-breakpad(25833): M E8461000 00000000 0001E000 CCAA49412B791630FD4EAD7755A3E4CD0 libvorbisidec.so
+08-17 19:45:26.097 F/google-breakpad(25833): M E8481000 00000000 00008000 F3F7CCE4ADD14C5DB852DF06407AE2FA0 libcamera_metadata.so
+08-17 19:45:26.098 F/google-breakpad(25833): M E848C000 00000000 0000E000 1F6ED3D6536346B3B20CF40C5F9799D80 liblog.so
+08-17 19:45:26.098 F/google-breakpad(25833): M E849D000 00000000 00010000 D6821B30C7A106C623EEE331974C9BF50 libGLESv2.so
+08-17 19:45:26.098 F/google-breakpad(25833): M E84AF000 00000000 00014000 22B107B0382117ED603FF6000B248B8D0 libpcre.so
+08-17 19:45:26.098 F/google-breakpad(25833): M E84C4000 00000000 00040000 9CC9AFC89D88D4C4AE6AEF2E290594B70 libinputflinger.so
+08-17 19:45:26.098 F/google-breakpad(25833): M E8508000 00000000 00005000 459EC08F2C9F91A7E6AB6F293540B4510 libstdc++.so
+08-17 19:45:26.098 F/google-breakpad(25833): M E850F000 00000000 00005000 DE5A396AAF801AF9A298A50BADE143E60 libspeexresampler.so
+08-17 19:45:26.098 F/google-breakpad(25833): M E84F0000 00000000 00B36000 F1644AA2ACE475925E0DA02A814C13DF0 libLLVM.so
+08-17 19:45:26.098 F/google-breakpad(25833): M E9081000 00000000 00008000 225E121AA129BB96606A1B3B91A2737A0 libnbaio.so
+08-17 19:45:26.098 F/google-breakpad(25833): M E908C000 00000000 00017000 9A6B379EB3F10874FC241C570801C6070 libmemunreachable.so
+08-17 19:45:26.098 F/google-breakpad(25833): M E909C000 00000000 0005F000 0FAC08487B9CD62449A19C8D161E7D820 libgui.so
+08-17 19:45:26.098 F/google-breakpad(25833): M E9109000 00000000 00004000 E9B0F0A724940363FCBE11FB96B6ADF30 libnativebridge.so
+08-17 19:45:26.098 F/google-breakpad(25833): M E910D000 00000000 0007B000 B44B5897A497DCB27C105B61AC30F1180 libhwui.so
+08-17 19:45:26.098 F/google-breakpad(25833): M E918B000 00000000 0008B000 DCAB7F6AA60C5E74587E56973C6653120 libc++.so
+08-17 19:45:26.098 F/google-breakpad(25833): M E921C000 00000000 00003000 3C7CC5BEA31C9C85C9BC25EC0891B7B10 libsync.so
+08-17 19:45:26.098 F/google-breakpad(25833): M E9221000 00000000 00009000 4334A7FB3D1CB8582D4D676DE6E5E2930 libpiex.so
+08-17 19:45:26.099 F/google-breakpad(25833): M E922A000 00000000 0000E000 EBD0DA428C58F5CBD72761DD6F1C03A10 libsoundtrigger.so
+08-17 19:45:26.099 F/google-breakpad(25833): M E923D000 00000000 00020000 27C83DAE0AB0E161280BB40C384BD4BC0 libm.so
+08-17 19:45:26.099 F/google-breakpad(25833): M E925F000 00000000 00003000 C9108BAA1E466D60D4591919420BBB6A0 libradio_metadata.so
+08-17 19:45:26.099 F/google-breakpad(25833): M E9264000 00000000 0000E000 63E3F027146D592F9FBE03A33EDC8C6D0 libimg_utils.so
+08-17 19:45:26.099 F/google-breakpad(25833): M E9275000 00000000 00015000 53AF0C4E2096697687AC0081AC7AD97C0 libunwind.so
+08-17 19:45:26.099 F/google-breakpad(25833): M E92D0000 00000000 0001F000 9F74D840029038F65C040D5492CAE7360 libinput.so
+08-17 19:45:26.099 F/google-breakpad(25833): M E92F5000 00000000 00005000 17620CAE201DC01DFD868F3276E8AA810 libpowermanager.so
+08-17 19:45:26.099 F/google-breakpad(25833): M E92FD000 00000000 00055000 5E4B1D0F4D553AA92665AE0925229AF40 libsonivox.so
+08-17 19:45:26.099 F/google-breakpad(25833): M E9359000 00000000 00006000 E727B84B0F5B3D982CAE8FB6E64B88030 libtiff_directory.so
+08-17 19:45:26.099 F/google-breakpad(25833): M E9362000 00000000 00021000 52D2F4BBC71C3EE2E161E009B0331EF80 libstagefright_foundation.so
+08-17 19:45:26.099 F/google-breakpad(25833): M E9386000 00000000 0003B000 2D4A4F8139C7842165EA73A6ACD835340 libjpeg.so
+08-17 19:45:26.099 F/google-breakpad(25833): M E93C3000 00000000 00003000 9945E8F5AE0ADE1ED46FA08B41A6C9BE0 libmemtrack.so
+08-17 19:45:26.099 F/google-breakpad(25833): M E93C6000 00000000 00019000 D2D0067E628DCC03418B99399D251A990 libEGL.so
+08-17 19:45:26.099 F/google-breakpad(25833): M E93E4000 00000000 00019000 6534179E8DC7D8EDBF1236C375D51ECD0 libdrmframework.so
+08-17 19:45:26.100 F/google-breakpad(25833): M E93FB000 00000000 00110000 994744AF5261DAC7CD0003EC5456DBDF0 libicuuc.so
+08-17 19:45:26.100 F/google-breakpad(25833): M E9519000 00000000 00015000 BDA36CE4717D8C1A324C7CA4E1CA9B860 libvulkan.so
+08-17 19:45:26.100 F/google-breakpad(25833): M E9521000 00000000 000F8000 91002184018FFAC8E26ECCB238E392440 libandroid_runtime.so
+08-17 19:45:26.100 F/google-breakpad(25833): M E962A000 00000000 00004000 644559B020FD089F8180BB62CF9420590 libprocessgroup.so
+08-17 19:45:26.100 F/google-breakpad(25833): M E9629000 00000000 00183000 035813361AA690A2E08F1E059823C9D50 libicui18n.so
+08-17 19:45:26.100 F/google-breakpad(25833): M E97B8000 00000000 00008000 9D6466250A83301B3BE4CAA85227525D0 libnativeloader.so
+08-17 19:45:26.100 F/google-breakpad(25833): M E97C0000 00000000 0000E000 031F092D2D476376D52F41FD2ADD2A3E0 libradio.so
+08-17 19:45:26.100 F/google-breakpad(25833): M E97D2000 00000000 00003000 159F2CAC750E3DB60EF444F05BACCC850 libregionalization.so
+08-17 19:45:26.100 F/google-breakpad(25833): M E97D8000 00000000 00008000 16C813B71CC34E81BCF6F5DD8648DC3B0 libGLESv1_CM.so
+08-17 19:45:26.100 F/google-breakpad(25833): M E97E2000 00000000 00003000 AA06FF77B6E4CC83470C006104304D0F0 libhardware.so
+08-17 19:45:26.100 F/google-breakpad(25833): M E97E0000 00000000 00039000 B613B07CCC9703A9AAE92861C92202BD0 libcamera_client.so
+08-17 19:45:26.100 F/google-breakpad(25833): M E980D000 00000000 003A9000 42F6682A5C7E8B66743C6087B578D6C40 libskia.so
+08-17 19:45:26.100 F/google-breakpad(25833): M E9BDC000 00000000 00007000 AD9132F0D394659639CBE5858DD1BB750 libhardware_legacy.so
+08-17 19:45:26.100 F/google-breakpad(25833): M E9BE7000 00000000 00005000 EE5BF022DE057918231B46C6EDDC38690 libstagefright_yuv.so
+08-17 19:45:26.101 F/google-breakpad(25833): M E9BEE000 00000000 00007000 9BC1C9D1E638BF1B7B32AC308B08D9DA0 libimage_type_recognition.so
+08-17 19:45:26.101 F/google-breakpad(25833): M E9BF7000 00000000 0000D000 3C492E547FA88D7E2E85BD9451F613090 libbacktrace.so
+08-17 19:45:26.101 F/google-breakpad(25833): M E9C07000 00000000 00007000 B165EC37228240E1EBEDC14160C16A3A0 libnativehelper.so
+08-17 19:45:26.101 F/google-breakpad(25833): M E9C10000 00000000 0001A000 4D1780AFB25B59BBD625608B400D70C20 libprotobuf-cpp-lite.so
+08-17 19:45:26.101 F/google-breakpad(25833): M E9C2D000 00000000 00004000 989F274AF037FE14219BE6DC42503B950 libnetd_client.so
+08-17 19:45:26.101 F/google-breakpad(25833): M E9C33000 00000000 000A0000 8E23BB4E73E86B4A2AD4C17D7BAFD8A90 libcrypto.so
+08-17 19:45:26.101 F/google-breakpad(25833): M E9CE0000 00000000 00003000 675D9BCC56AB210C8017D6625F994D250 libstagefright_enc_common.so
+08-17 19:45:26.101 F/google-breakpad(25833): M E9CE5000 00000000 00024000 CC51150390EA9EFB0315C02573CCFD000 libpng.so
+08-17 19:45:26.101 F/google-breakpad(25833): M E9D0B000 00000000 0003B000 4FBF4968372FEB1C8D593076E1B171610 libRScpp.so
+08-17 19:45:26.101 F/google-breakpad(25833): M E9D49000 00000000 0000A000 415DAD77CED2441456E20CAD35C536250 libRS.so
+08-17 19:45:26.101 F/google-breakpad(25833): M E9D55000 00000000 00004000 F168A985060F7993C937719998C96FD20 libusbhost.so
+08-17 19:45:26.101 F/google-breakpad(25833): M E9D5B000 00000000 00086000 58C592B73EA51A0AFC3287247961D0940 libdng_sdk.so
+08-17 19:45:26.101 F/google-breakpad(25833): M E9DE1000 00000000 00057000 44C1EA73F38E47E95712BF5848E8937E0 libbinder.so
+08-17 19:45:26.102 F/google-breakpad(25833): M E9E3F000 00000000 0002E000 2824A9CACA3A870AD713A3405D6249530 libwilhelm.so
+08-17 19:45:26.102 F/google-breakpad(25833): M E9E72000 00000000 00030000 E9CE28F8F628E4501925FF4D0FD6168F0 libstagefright_omx.so
+08-17 19:45:26.102 F/google-breakpad(25833): M E9EA0000 00000000 00487000 3CD6A967C46ED23F4AB4B39092B43AB70 libpdfium.so
+08-17 19:45:26.102 F/google-breakpad(25833): M EA337000 00000000 00004000 76B7583F8773D45C53E165CABC841DE70 libETC1.so
+08-17 19:45:26.102 F/google-breakpad(25833): M EA33D000 00000000 00015000 F0658EC8F5FCD09AB82C2EFC3A6834210 libui.so
+08-17 19:45:26.102 F/google-breakpad(25833): M EA355000 00000000 00038000 E4F681ED6DAD0F793516317FBE3DD55A0 libRS_internal.so
+08-17 19:45:26.102 F/google-breakpad(25833): M EA390000 00000000 00016000 0DB58A0AF796EA03A43AAD505A8723310 liblzma.so
+08-17 19:45:26.102 F/google-breakpad(25833): M EA3AE000 00000000 00011000 2618247A47A298A5C4574CC818C7F3280 libselinux.so
+08-17 19:45:26.102 F/google-breakpad(25833): M EA3C1000 00000000 00005000 961542B344C4A0F54F87B49C0F1429E80 libwpa_client.so
+08-17 19:45:26.102 F/google-breakpad(25833): M EA3C8000 00000000 00007000 5FF53AA38050A1DE3BF7A4D755DC75B70 libaudioutils.so
+08-17 19:45:26.102 F/google-breakpad(25833): M EA3D1000 00000000 00017000 31235ADAF427BE11933CD87290CCAF050 libcutils.so
+08-17 19:45:26.102 F/google-breakpad(25833): M EA3EB000 00000000 00036000 CBC6DC0C255BAB785FCD0511A7CBF0690 libbcinfo.so
+08-17 19:45:26.103 F/google-breakpad(25833): M EA423000 00000000 00003000 FDA204F888F3C0D8070BFDEC834066D20 libstagefright_http_support.so
+08-17 19:45:26.103 F/google-breakpad(25833): M EA428000 00000000 00005000 14FB257C9C6F43C8FA0B475D81C47FFC0 libbinary_parse.so
+08-17 19:45:26.103 F/google-breakpad(25833): M EA42F000 00000000 00009000 93F30055C78E1D80E40A8E717405CF500 libmediautils.so
+08-17 19:45:26.103 F/google-breakpad(25833): M EA43B000 00000000 0000A000 0F98C20EB2725367604DCE7EDA8EED9D0 libbase.so
+08-17 19:45:26.103 F/google-breakpad(25833): M EA447000 00000000 00016000 DC1FEB19B377562139F4F8AAFFA610710 libz.so
+08-17 19:45:26.103 F/google-breakpad(25833): M EA460000 00000000 00015000 68F77CDFB35DA081E510A50D11F299D70 libexpat.so
+08-17 19:45:26.103 F/google-breakpad(25833): M EA45D000 00000000 000C3000 3B22B766CDBB99263CF24B4CC2986E510 libmedia.so
+08-17 19:45:26.103 F/google-breakpad(25833): M EA541000 00000000 00031000 335A60B9AA0F00A47BD5A781CCA820740 libandroidfw.so
+08-17 19:45:26.103 F/google-breakpad(25833): M EA574000 00000000 0007A000 21086BE83826AA7DC32AB49C79D5CCE30 libsqlite.so
+08-17 19:45:26.103 F/google-breakpad(25833): M EA5F2000 00000000 0006C000 6EA54A19597F20D46626700FE9F206F50 libft2.so
+08-17 19:45:26.103 F/google-breakpad(25833): M EA64F000 00000000 0016B000 4E69F13734FEABE1CA5BA98594235DCD0 libstagefright.so
+08-17 19:45:26.103 F/google-breakpad(25833): M EA7D3000 00000000 00007000 475E29D0A243BEE93EC1A630C99503FC0 libnetutils.so
+08-17 19:45:26.103 F/google-breakpad(25833): M EA7DC000 00000000 00084000 49B02E01AEC77331A1D6D19B540265610 libc.so
+08-17 19:45:26.103 F/google-breakpad(25833): M EA86E000 00000000 00025000 8B6ECC65C09CAFF5ACAAB6C9249CD2C20 libssl.so
+08-17 19:45:26.103 F/google-breakpad(25833): M EA896000 00000000 00008000 22114C778A7ED1CC3953CCB22323EA1B0 libstagefright_avc_common.so
+08-17 19:45:26.104 F/google-breakpad(25833): M EA8A1000 00000000 00003000 7FA19C935E6148BD8002A3CA630C4E6F0 libsmemlog.so
+08-17 19:45:26.104 F/google-breakpad(25833): M EA8A1000 00000000 00017000 EEAF8ABB6827B80A458A5D483E5562400 libqmiservices.so
+08-17 19:45:26.104 F/google-breakpad(25833): M EA8C1000 00000000 00008000 090640ECFC69E16A25A3E27006AF282E0 libxml.so
+08-17 19:45:26.104 F/google-breakpad(25833): M EA8CC000 00000000 00012000 67F4D476A96F053ACB61531379FCC4810 libdsutils.so
+08-17 19:45:26.104 F/google-breakpad(25833): M EA8EF000 00000000 00014000 EFD5F0A0F81252A037F1C06B8E6809700 libsdsprpc.so
+08-17 19:45:26.104 F/google-breakpad(25833): M EA905000 00000000 0003E000 C4311189AF8DA8405EDC0701CD38FC770 libgsl.so
+08-17 19:45:26.104 F/google-breakpad(25833): M EA99F000 00000000 00014000 75BC34362D3F387A08AE8241CED8E2550 libadsprpc.so
+08-17 19:45:26.104 F/google-breakpad(25833): M EA9B2000 00000000 0001A000 840BD6EAC45DEFC59D2F1E8C681CFF1A0 lib-imsrcscmclient.so
+08-17 19:45:26.104 F/google-breakpad(25833): M EA9DA000 00000000 00011000 6034A9FBADF19CE6C259DA006E8158FC0 lib-imsrcscmservice.so
+08-17 19:45:26.104 F/google-breakpad(25833): M EAA09000 00000000 00003000 7BB31E1D28279A11B8087C3F4DF7D0BA0 libqti-at.so
+08-17 19:45:26.104 F/google-breakpad(25833): M EAA0E000 00000000 0000C000 7D5A1CA22F6A85FCC57B3D36A92461560 lib-ims-rcscmjni.so
+08-17 19:45:26.104 F/google-breakpad(25833): M EAA1C000 00000000 00012000 FAD2DBDF65F36590FFE591C62DBEFA1E0 libOpenCL.so
+08-17 19:45:26.104 F/google-breakpad(25833): M EAA38000 00000000 00003000 025B4D5BBA39265D6260B27597E321730 memtrack.msm8937.so
+08-17 19:45:26.104 F/google-breakpad(25833): M EAA3D000 00000000 00011000 F5FF7C8214A82029405A068BCDF69A580 libmediandk.so
+08-17 19:45:26.105 F/google-breakpad(25833): M EAA53000 00000000 00008000 5373A05304D5AFD8BC2BB49D6C22977D0 libopenjdkjvm.so
+08-17 19:45:26.105 F/google-breakpad(25833): M EAA5C000 00000000 0000F000 96A60B84ED1352C202B6695FD32373790 libmediadrm.so
+08-17 19:45:26.105 F/google-breakpad(25833): M EAA6E000 00000000 00010000 3D880E60A39C482BA4210DA0AD4E20490 libGLESv3.so
+08-17 19:45:26.105 F/google-breakpad(25833): M EAA97000 00000000 00003000 F4CB54FA6F9A644292CE2DCC9FA89DA80 libqti_performance.so
+08-17 19:45:26.105 F/google-breakpad(25833): M EAA9D000 00000000 00004000 B2EAC3688B9EFF0E79EA2C170AA859C50 libwebviewchromium_plat_support.so
+08-17 19:45:26.105 F/google-breakpad(25833): M EAAA5000 00000000 00004000 837BE31E60CD67A2C45BF27A1E8C10140 libOpenSLES.so
+08-17 19:45:26.105 F/google-breakpad(25833): M EAAAB000 00000000 00004000 3C4D0169CD09A3AEEC0868A7FC87CCFA0 libOpenMAXAL.so
+08-17 19:45:26.105 F/google-breakpad(25833): M EAAB0000 00000000 00016000 BAF17608D25635EFA63708C89561474D0 libcamera2ndk.so
+08-17 19:45:26.105 F/google-breakpad(25833): M EAB53000 00000000 00003000 78C8F6360CF612E4333D4EB1796927460 libqti-perfd-client.so
+08-17 19:45:26.105 F/google-breakpad(25833): M EAB57000 00000000 00014000 01EE9AC4109E06B182E77B55242AEBE20 libandroid.so
+08-17 19:45:26.105 F/google-breakpad(25833): M EABAF000 00000000 00003000 4C4B6F03AF5049885FD4A43F149D13630 libjnigraphics.so
+08-17 19:45:26.105 F/google-breakpad(25833): M EABB0000 00000000 00090000 FBA40D2822A0C6DCF7CE29FB42DC37230 libmediaplayerservice.so
+08-17 19:45:26.105 F/google-breakpad(25833): M EAC7B000 00000000 0000A000 52C41240B217BFE92F7381218169FD760 liblz4.so
+08-17 19:45:26.105 F/google-breakpad(25833): M EACF9000 00000000 00038000 FEF1DA3EC5AA99E4FF38C1DF2A9A91570 libavenhancements.so
+08-17 19:45:26.106 F/google-breakpad(25833): M EAD35000 00000000 0002F000 85E4C8F7646AA02A46215564266690BA0 libstagefright_wfd.so
+08-17 19:45:26.106 F/google-breakpad(25833): M EAD6A000 00000000 00026000 7B91D8B6A15FF171BF114D8D638785D80 libstagefright_httplive.so
+08-17 19:45:26.106 F/google-breakpad(25833): M EAD94000 00000000 00003000 6DE080E13BB1741A34C157CE97277ABD0 libsigchain.so
+08-17 19:45:26.106 F/google-breakpad(25833): M EADE7000 00000000 00003000 1390052238CBD9474F1747EA0BA53C740 libExtendedExtractor.so
+08-17 19:45:26.106 F/google-breakpad(25833): M EAE32000 00000000 00006000 3B45281FC4EB699207799FD6018FBD910 libvendorconn.so
+08-17 19:45:26.106 F/google-breakpad(25833): M EAEB2000 00000000 0005F000 7AC50A488023F3DA8182906BDFFA72C10 linker
+08-17 19:45:26.106 F/google-breakpad(25833): -----END BREAKPAD MICRODUMP-----
+08-17 19:47:07.900 F/google-breakpad(26081): -----BEGIN BREAKPAD MICRODUMP-----
+08-17 19:47:07.900 F/google-breakpad(26081): V AndroidWebView:62.0.3188.0
+08-17 19:47:07.901 F/google-breakpad(26081): O A arm 08 armv8l Nokia/TA-1025_00WW/PLE:7.1.1/NMF26F/00WW_3_32C:user/release-keys
+08-17 19:47:07.901 F/google-breakpad(26081): P webview
+08-17 19:47:07.901 F/google-breakpad(26081): R 00000005 SIGTRAP 29627000
+08-17 19:47:07.901 F/google-breakpad(26081): G
+08-17 19:47:07.913 F/google-breakpad(26081): H 12C00000 FFF73000 0108 31E89000 9516B000 0C:12 0D:13 0E:13 0F:3A 10:07 11:05 12:12 13:20 14:0F 15:0E 16:19 17:12 18:07 19:05 1B:01 1C:02 1D:01
+08-17 19:47:07.914 F/google-breakpad(26081): S 0 C94F5C60 C94F5000 00002000
+08-17 19:47:07.914 F/google-breakpad(26081): S C94F5000 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:47:07.915 F/google-breakpad(26081): S C94F5180 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:47:07.915 F/google-breakpad(26081): S C94F5300 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:47:07.916 F/google-breakpad(26081): S C94F5480 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:47:07.916 F/google-breakpad(26081): S C94F5600 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:47:07.917 F/google-breakpad(26081): S C94F5780 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:47:07.917 F/google-breakpad(26081): S C94F5900 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:47:07.918 F/google-breakpad(26081): S C94F5A80 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:47:07.918 F/google-breakpad(26081): S C94F5C00 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005C5D4FC94C5D4FC9505D4FC98C5C4FC9EDACEF0DEDACEF0D01000000245E4FC9010000009D20FCD3EDACEF0DEDACEF0D00000000EDACEF0D02000000EDACEF0DEDACEF0DEDACEF0D0000000000000000BC5C4FC901000000000000005206000000000000EDACEF0D00000000200000000000000000002CD4000000000000000000000000000000000000000000000000EDACEF0D000000000000000000000000EDACEF0D00000000EDACEF0D0000000000000000EDACEF0D0000000000000000000000000000000020000000D05C4FC9EDACEF0D505D4FC94C5D4FC9EDACEF0DEDACEF0DD5D92BD4EDACEF0DEDACEF0DEDACEF0D0000000003000000EDACEF0D0000000002000000EDACEF0DEDACEF0DEDACEF0DB7D72BD424000000EDACEF0D
+08-17 19:47:07.919 F/google-breakpad(26081): S C94F5D80 F85D4FC9EDACEF0DEDACEF0D0200000000000000EDACEF0D000000000200000001000000EDACEF0D0200000000000000EDACEF0D000000000200000001000000EDACEF0D0000000002000000EDACEF0D000000000200000001000000EDACEF0D0000000000000000FFFFFFFF000000000000000000000000FFFFFFFF01000000EDACEF0D7C5E4FC9845E4FC9885E4FC9245E4FC9D85E4FC9785E4FC98F0830D4EDACEF0DEDACEF0DEDACEF0DDD7755D2EDACEF0DD85E4FC94C5E4FC9485E4FC9D85E4FC9385F4FC9745F4FC9D85E4FC900000000EDACEF0DEDACEF0DEDACEF0D3C614FC947733DD4D85E4FC9805E4FC9785E4FC901000000EDACEF0DEDACEF0DEDACEF0D018D98D200000000000000000400000000000000FFFFFFFF00000000FFFFFFFF00000000FFFFFFFF00000000FFFFFFFF070000001D00000000000000FFFFFFFF00000000FFFFFFFF00CB97D20000000001B056D2000000000000000000000000F05E4FC9A0604FC9EDACEF0D385F4FC9EDACEF0D4543A7D400000000
+08-17 19:47:07.919 F/google-breakpad(26081): S C94F5F00 08604FC9EB8E3DD4A4604FC9DF8697D2EDACEF0DE38598D2EDACEF0DEDACEF0DEDACEF0D62000000EDACEF0DEDACEF0DEDACEF0D62000000EDACEF0DFFFFFFFFFFFFFFFFFFFFFFFFEDACEF0D6C0000000000000001000000EDACEF0DEDACEF0D742F6874EDACEF0DEDACEF0DEDACEF0D000000003100000024000000EDACEF0D62000000FFFFFFFFFFFFFFFF02000000FFFFFFFFFFFFFFFF01000000FFFFFFFFFFFFFFFFA4604FC9A0604FC934614FC9EDACEF0D4543A7D40000000008604FC93C614FC911A03DD400000000000000000C604FC9EDACEF0DEDACEF0DEDACEF0D00000000EDACEF0D00000000EDACEF0D02000000B9D89CD2EDACEF0DEDACEF0D20604FC970634FC90000000003000000EDACEF0D0000000078644FC923D89CD200000000080000000100000095CD90D2EDACEF0D4543A7D400000000EDACEF0DEDACEF0DEDACEF0DEDACEF0D000000000100000000000000EDACEF0DEDACEF0D00000000000000004543A7D400000000EDACEF0D97C090D2EDACEF0DEDACEF0D
+08-17 19:47:07.920 F/google-breakpad(26081): S C94F6080 9C604FC900000000EDACEF0D00000000EDACEF0DEDACEF0DEDACEF0DEDACEF0DEDACEF0D00604FC9EDACEF0DFFFFFFFFFFFFFFFFFFFFFFFF00000000000000000000000000614FC900000000000000000000000000000000000000000000000000000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF02000000FFFFFFFFFFFFFFFF01000000FFFFFFFFFFFFFFFF00000000000000000000000000000000000000002D000000620000000200000000000000EDACEF0DEDACEF0D000000000000000000000000EDACEF0DEDACEF0DEDACEF0DEDACEF0DEDACEF0D0000000038624FC94543A7D4EDACEF0D38624FC970634FC928624FC9EDACEF0DEDACEF0D4543A7D400000000EDACEF0D78644FC92DB773D2EDACEF0DEDACEF0DD9C68DD2F1C68DD2EDACEF0D07000000EDACEF0DD9C68DD20700000065C38DD2EDACEF0D0900000009000000EDACEF0D7DF856D2EDACEF0D7D933DD4CF228BD2CF228BD2178076D2013B65D2EDACEF0D38624FC90000000078644FC98D8064D2
+08-17 19:47:07.920 F/google-breakpad(26081): S C94F6200 6E70E4D48970E4D400000000000000000000000000000000EDACEF0D000000000000000000000000EDACEF0D0000000000000000A4624FC90000000000000000EDACEF0DEDACEF0DEDACEF0D7B2B84EAEDACEF0DEDACEF0D78644FC9B97855D2EDACEF0DA4624FC9EDACEF0DEDACEF0DEDACEF0D090000000000000009000000EDACEF0DEDACEF0D0000000000000000EDACEF0DEDACEF0D0000000000000000D0654FC9EDACEF0DEDACEF0D00000000EDACEF0DEDACEF0D38634FC903000000EDACEF0DEDACEF0D78644FC93FD49CD2EDACEF0D09000000010000006B9855D2FC624FC90000000048634FC900000000EDACEF0DEDACEF0D0900000005E09CD209000000EDACEF0D0000000000000000000000000000000000000000EDACEF0D1B000000FFFFFFFF70634FC94F1B59D2EDACEF0D090000000000000000000000000000000000000025B0B6D4EDACEF0D00000000A1CE9CD2EDACEF0D00000000EDACEF0D0200000094644FC905000000EDACEF0D000000000000000000000000
+08-17 19:47:07.921 F/google-breakpad(26081): S C94F6380 000000000000000000000000D5B0B6D425B0B6D42C0100007D933DD4CF228BD2CF228BD2178076D2013B65D2EDACEF0DEDACEF0DE8634FC9EDACEF0D00000000EDACEF0DEDACEF0D0000000000000000EDACEF0D090000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000EDACEF0DEDACEF0D98644FC90000000003000000D8644FC90000000078644FC9FBC69CD20000000000000000EDACEF0D0900000088644FC9000000000000000000000000E8030000000000000000000000000000E8030000B0644FC9EDACEF0D80644FC900000000EDACEF0D00000000000000000000000000000000EDACEF0D09000000000000000000000000000000EDACEF0D0000000000000000EDACEF0D0900000000000000000000000000000000000000EDACEF0DEDACEF0D00000000EDACEF0DD0654FC965CC73D2000000000000000000000000000000000000000000000000EDACEF0D00000000D0654FC9EDACEF0D0000000000000000
+08-17 19:47:07.921 F/google-breakpad(26081): S C94F6500 0000000000000000EDACEF0D28674FC9C0654FC9EDACEF0DEDACEF0D747D92D40000000028674FC9EDACEF0D2DB773D2EDACEF0D30674FC9F0654FC9EDACEF0DEDACEF0D747D92D4000000006BB773D201010000DC654FC9EDACEF0DEDACEF0DB000000080000000EDACEF0D7B2B84EACF228BD2CF228BD2178076D2013B65D2479B9CD2DC654FC9EDACEF0D0000000007E29CD253E29CD2CF228BD2CF228BD200000000000000000000000000000000FC654FC9000000000000000000000000EDACEF0D00000000EDACEF0DF6FFFFFF00000000000000004000000000000000EDACEF0DEDACEF0D000000000000000000000000000000002000000000000000000000000000000000000000EDACEF0D000000000000000000000000F76985EA0000000000000000EDACEF0D00000000000000000000000040684FC9EDACEF0DEDACEF0D0000000028674FC9A4664FC948674FC92842A7D4EDACEF0D28674FC9EDACEF0D5FB473D230674FC9C4664FC950674FC92842A7D40000000030674FC9
+08-17 19:47:07.922 F/google-breakpad(26081): S C94F6680 50674FC935B573D2EDACEF0DEDACEF0DEDACEF0DEDACEF0DFFFFFFFFC0664FC9020000000000000000000000000000000000000077D5BED2EDACEF0D00000000FCFFFFFFEDACEF0DE4664FC9EDACEF0DB8674FC9EDACEF0D00000000000000000000000000000000EDACEF0DEDACEF0D28674FC9EDACEF0DB8674FC9EDACEF0DC8674FC928674FC970674FC92BAA73D2EDACEF0DEDACEF0D00000000EDACEF0DEDACEF0DEDACEF0DEDACEF0D0000000000000000000000000000000000000000000000007642A7D42842A7D4C9000000CF228BD2CF228BD2178076D2013B65D2479B9CD2F708000001004FC900000000FFFFFFFFD0A4BDD202000000F0674FC900000000EDACEF0DEDACEF0DEDACEF0DAC674FC9FFFFFFFFE0674FC9EDACEF0D010000006B9855D2EDACEF0DEDACEF0DEDACEF0DEDACEF0DEDACEF0D0000000000000000000000000000000000000000000000007642A7D42842A7D4C9000000CF228BD2CF228BD2178076D2013B65D2479B9CD2F708000001000000D34657D2
+08-17 19:47:07.922 F/google-breakpad(26081): S C94F6800 EDACEF0DEDACEF0DEDACEF0D00000000EDACEF0DEDACEF0D000000005B8173D2020000009BD47ED2CC684FC940684FC9EDACEF0D00000000CC684FC91FA773D20000000000000000EDACEF0D3100000020000000EDACEF0D0000000000000000000000000000000098684FC9EDACEF0DEDACEF0DEDACEF0D94684FC9EDACEF0D00000000CC684FC9000000006B9855D20000000000000000EDACEF0D214657D2000000000000000000000000B34557D2EDACEF0DEDACEF0DEDACEF0DEDACEF0D00000000498473D2EDACEF0DEDACEF0D00000000EDACEF0DEDACEF0D00000000CC684FC9EDACEF0DEDACEF0D20694FC978000000EDACEF0DEDACEF0DA38173D220694FC9CD2F82EA20694FC9E52F82EA28694FC9EF5C7FEA7800000000000000EDACEF0DEDACEF0DEDACEF0DEDACEF0D00000000EDACEF0DEDACEF0D00100000000000000000000000000000000000005B8173D2EDACEF0D00000000EDACEF0D0100000000000000EDACEF0D0000000070694FC920694FC91600000000000000
+08-17 19:47:07.923 F/google-breakpad(26081): S C94F6980 00000000EDACEF0D00000000EDACEF0D0000000001000000EDACEF0D0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000EDACEF0D01000000EDACEF0D000000000000000001000000EDACEF0D01000000EDACEF0D01000000EDACEF0D01000000EDACEF0D010000000100000001000000EDACEF0D01000000EDACEF0D01000000EDACEF0D01000000EDACEF0D01000000EDACEF0D00000000000000000000000000000000000000000000000001000000EDACEF0D01000000EDACEF0D00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:47:07.923 F/google-breakpad(26081): S C94F6B00 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:47:07.924 F/google-breakpad(26081): S C94F6C80 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:47:07.924 F/google-breakpad(26081): S C94F6E00 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:47:07.924 F/google-breakpad(26081): S C94F6F80 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:47:07.925 F/google-breakpad(26081): C 06000040000000000000000005B88FD2020000008C5C4FC9CC5C4FC918F76A2CAC5C4FC94C5D4FC95C5D4FC9505D4FC9805E4FC9D9C5F7D3605C4FC91B89B3D28684B3D2300001680000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:47:07.925 F/google-breakpad(26081): M AAAAA000 00000000 00005000 8D2477F3B51997BDCC3733B8D1F920BE0 app_process32
+08-17 19:47:07.925 F/google-breakpad(26081): M 70D29000 00000000 00806000 E9166D3ED622EE65A3A4086EBEA4A7950 boot.oat
+08-17 19:47:07.925 F/google-breakpad(26081): M 71531000 00000000 006C0000 668D96384E4368B01BC9B9F365028CA20 boot-core-libart.oat
+08-17 19:47:07.926 F/google-breakpad(26081): M 71BF3000 00000000 000AA000 0D160B642FB1639805B72AC6F4DF3F380 boot-conscrypt.oat
+08-17 19:47:07.926 F/google-breakpad(26081): M 71C9F000 00000000 000D1000 9D69BDC94BD07F2468D5B7DB0AEEF0140 boot-okhttp.oat
+08-17 19:47:07.926 F/google-breakpad(26081): M 71D72000 00000000 0000C000 566CD32860A984FD445A4852058609CB0 boot-core-junit.oat
+08-17 19:47:07.926 F/google-breakpad(26081): M 71D80000 00000000 0019F000 09C1E8B1D7FC826CB75691EC5BDBA1DB0 boot-bouncycastle.oat
+08-17 19:47:07.926 F/google-breakpad(26081): M 71F21000 00000000 0014B000 069BAE4D2D7831B857A3C236021D868A0 boot-ext.oat
+08-17 19:47:07.926 F/google-breakpad(26081): M 7206E000 00000000 0223E000 D0BEBD37E215DDC845099212203F792F0 boot-framework.oat
+08-17 19:47:07.926 F/google-breakpad(26081): M 742AE000 00000000 00502000 B41E052DBA2949CE100713743053E1E40 boot-telephony-common.oat
+08-17 19:47:07.926 F/google-breakpad(26081): M 747B2000 00000000 0003D000 65E4B1E28F33F9C51062E2D0630394830 boot-voip-common.oat
+08-17 19:47:07.926 F/google-breakpad(26081): M 747F1000 00000000 00045000 EB491A6AF6568A675D81746238ACC78B0 boot-ims-common.oat
+08-17 19:47:07.927 F/google-breakpad(26081): M 74838000 00000000 0016C000 C369D6D4F8DCF10CC0AD1800000000000 boot-apache-xml.oat
+08-17 19:47:07.927 F/google-breakpad(26081): M 749A6000 00000000 000FF000 1FAC5317B0FEBD01C31E8039D76CCAF50 boot-org.apache.http.legacy.boot.oat
+08-17 19:47:07.927 F/google-breakpad(26081): M 74AA7000 00000000 00004000 C368F8D0F8DCF10C00BE1800000000000 boot-tcmiface.oat
+08-17 19:47:07.927 F/google-breakpad(26081): M 74AAD000 00000000 00016000 C368FA40F8DCF10C3FB11800000000000 boot-WfdCommon.oat
+08-17 19:47:07.927 F/google-breakpad(26081): M 74AC5000 00000000 00004000 A2EDD62E4499B2C98D8C251F0977951B0 boot-oem-services.oat
+08-17 19:47:07.927 F/google-breakpad(26081): M 74ACB000 00000000 0001C000 3794BA12A18F802DF4E8F10D4B2662FB0 boot-qcom.fmradio.oat
+08-17 19:47:07.927 F/google-breakpad(26081): M 74AE9000 00000000 00009000 C368F9A8F8DCF10C95B41800000000000 boot-qcmediaplayer.oat
+08-17 19:47:07.927 F/google-breakpad(26081): M 74AF4000 00000000 00008000 C368E898F8DCF10CDEAD1800000000000 boot-telephony-ext.oat
+08-17 19:47:07.927 F/google-breakpad(26081): M 74AFE000 00000000 00013000 C368E46FF8DCF10CA3A11800000000000 boot-dolby_ds2.oat
+08-17 19:47:07.927 F/google-breakpad(26081): M 74B13000 00000000 0000A000 C368F9E4F8DCF10C41B01800000000000 boot-dolby_ds1.oat
+08-17 19:47:07.927 F/google-breakpad(26081): M C7D92000 00000000 00005000 F841612CF1D458AB70296575A996EE5F0 QPerformance.odex
+08-17 19:47:07.928 F/google-breakpad(26081): M CBA19000 00000000 00856000 000003F10000000031270A00000000000 base.odex
+08-17 19:47:07.928 F/google-breakpad(26081): M CCAF6000 00000000 00936000 00000F700000000098480B00000000000 base.odex
+08-17 19:47:07.928 F/google-breakpad(26081): M CF4C6000 00000000 02000000 000000000000000000000000000000000 dalvik-jit-code-cache (deleted)
+08-17 19:47:07.928 F/google-breakpad(26081): M D2273000 04247000 02C94000 8A2EFA0DECC3EF7057A1C62BF1AECCA80 libmonochrome.so
+08-17 19:47:07.928 F/google-breakpad(26081): M D9155000 00000000 00004000 C1741AE46077EF13F70D0DC7D8A9DDE80 libwebviewchromium_loader.so
+08-17 19:47:07.928 F/google-breakpad(26081): M D9276000 00000000 00006000 C700FED4854EA9F553FC4EB1AC49DAD50 libqdutils.so
+08-17 19:47:07.928 F/google-breakpad(26081): M D927F000 00000000 00007000 5AF3845B7F31952390092BB2318667B00 gralloc.msm8937.so
+08-17 19:47:07.928 F/google-breakpad(26081): M D926B000 00000000 00823000 A91A29ADD65BB0AF28A4C9A6208E33C40 libllvm-glnext.so
+08-17 19:47:07.928 F/google-breakpad(26081): M D9AB7000 00000000 00316000 9F7E6C49A0A8C88C317716B031320CA30 libESXGLESv2_adreno.so
+08-17 19:47:07.929 F/google-breakpad(26081): M D9F1F000 00000000 0000C000 CEC6F7F71723450F4D1E527FA1BDDA310 libqservice.so
+08-17 19:47:07.929 F/google-breakpad(26081): M D9F30000 00000000 00007000 BB9F7CD0BF1178F273EB8B4D2D5C67C30 libmemalloc.so
+08-17 19:47:07.929 F/google-breakpad(26081): M D9F39000 00000000 00003000 B4B80A1B5D6C50F5C0DD7F1C29A9F6C10 libqdMetaData.so
+08-17 19:47:07.929 F/google-breakpad(26081): M D9F43000 00000000 00009000 0BA85EA850C07E5B86AF8281EF7641E70 libcompiler_rt.so
+08-17 19:47:07.929 F/google-breakpad(26081): M D9F4E000 00000000 0000B000 362BA72B9CF73AB8BD02283F491283E40 eglSubDriverAndroid.so
+08-17 19:47:07.929 F/google-breakpad(26081): M D9F5B000 00000000 0000B000 9BAA0F603A10810D4A6BEE7A903A762F0 libGLESv2_adreno.so
+08-17 19:47:07.929 F/google-breakpad(26081): M D9F68000 00000000 00007000 C08FDBDAB5792096DB0BEDBE3D23B48D0 libGLESv1_CM_adreno.so
+08-17 19:47:07.929 F/google-breakpad(26081): M D9F71000 00000000 00024000 C346DBBCF27F603F9321CCF737B3C0550 libESXGLESv1_CM_adreno.so
+08-17 19:47:07.929 F/google-breakpad(26081): M D9F97000 00000000 00010000 A7800610AD28E2DF469D023E70516C190 libESXEGL_adreno.so
+08-17 19:47:07.929 F/google-breakpad(26081): M D9FAB000 00000000 00006000 6CC274368542A8270BC225BE519068D80 libadreno_utils.so
+08-17 19:47:07.929 F/google-breakpad(26081): M D9FBC000 00000000 00009000 649C0C218A9C0A611E5E0DB24CDD058C0 libEGL_adreno.so
+08-17 19:47:07.929 F/google-breakpad(26081): M DA4BC000 00000000 00020000 1195E0A668F3644AC0EC8D1122457A140 libkeymaster1.so
+08-17 19:47:07.929 F/google-breakpad(26081): M DA4DF000 00000000 00018000 39E3D5620A966F5DB960EEE55CCD8BB30 libsoftkeymasterdevice.so
+08-17 19:47:07.929 F/google-breakpad(26081): M DA4F9000 00000000 0001A000 C1B07DA2D52E6EC3C54992A3A953D63B0 libjavacrypto.so
+08-17 19:47:07.929 F/google-breakpad(26081): M DA516000 00000000 00004000 B051A444B9312E4DAF242DA3A951538A0 libkeystore-engine.so
+08-17 19:47:07.929 F/google-breakpad(26081): M DA51B000 00000000 00016000 1988D915061DDC4921FF608AD3E810AD0 libkeystore_binder.so
+08-17 19:47:07.930 F/google-breakpad(26081): M DA534000 00000000 0000C000 DDF063ABB28459B09548F8329934DDEB0 libkeymaster_messages.so
+08-17 19:47:07.930 F/google-breakpad(26081): M DC57D000 00000000 00016000 A686CFCA0E870C10B425EB769017BE930 libmtp.so
+08-17 19:47:07.930 F/google-breakpad(26081): M DC593000 00000000 00052000 E9F8299757E5E543C03723101E5B1BEC0 libmedia_jni.so
+08-17 19:47:07.930 F/google-breakpad(26081): M DC5E8000 00000000 00020000 ADF61BE35FF269EC7E7B32B1DDCD31E00 libexif.so
+08-17 19:47:07.930 F/google-breakpad(26081): M DC616000 00000000 0000E000 ABA3C77DD3386AE87B586632CE1979D50 libstagefright_amrnb_common.so
+08-17 19:47:07.930 F/google-breakpad(26081): M DC634000 00000000 00007000 CD70BA801CA3E12D258565013535D7440 tcmclient.odex
+08-17 19:47:07.930 F/google-breakpad(26081): M DC645000 00000000 00004000 042B2B738C75036986EB80BC08A71F060 libextmedia_jni.so
+08-17 19:47:07.930 F/google-breakpad(26081): M E1E9B000 00000000 002B2000 FCA7431984CE2AEF979FFEEF99432D320 libart-compiler.so
+08-17 19:47:07.930 F/google-breakpad(26081): M E215E000 00000000 000B1000 1EBE7A1A3E1A3134DE689251E1ABC0380 libvixl.so
+08-17 19:47:07.930 F/google-breakpad(26081): M E2264000 00000000 0002B000 6E46C8EDE63F81CC2A4375E4F85517CD0 libopenjdk.so
+08-17 19:47:07.930 F/google-breakpad(26081): M E2291000 00000000 00029000 4F845000DEA8066D684FEAB08A91A3480 libjavacore.so
+08-17 19:47:07.930 F/google-breakpad(26081): M E22BC000 00000000 00138000 523FDEBEF6ECE577AF3716E9703AD4FF0 lib-imsqimf.so
+08-17 19:47:07.930 F/google-breakpad(26081): M E23FA000 00000000 00004000 48E9F68098728AFF9A198AE7A14A7F700 libmdmdetect.so
+08-17 19:47:07.930 F/google-breakpad(26081): M E2400000 00000000 00005000 12F24D77003A5660A06BA8690696A5C30 libconfigdb.so
+08-17 19:47:07.931 F/google-breakpad(26081): M E2405000 00000000 00085000 DB9D3DADFB06F6B1AB9CEC5443F295370 lib-imsxml.so
+08-17 19:47:07.931 F/google-breakpad(26081): M E2496000 00000000 00005000 F812502D41A460BDD2D9AA83A9564CC70 libqmi_encdec.so
+08-17 19:47:07.931 F/google-breakpad(26081): M E249C000 00000000 0001C000 A53A45C88FFCD4CB3AFF323AF8FFFBAB0 libqdi.so
+08-17 19:47:07.931 F/google-breakpad(26081): M E24B7000 00000000 0006A000 D110B55DE7DB9FD5086D2D1CE57152480 libdsi_netctrl.so
+08-17 19:47:07.931 F/google-breakpad(26081): M E2534000 00000000 00023000 E7FB6A8B99C97103F258028CF27324660 lib-imsrcscm.so
+08-17 19:47:07.931 F/google-breakpad(26081): M E255A000 00000000 0001C000 5BE35B9E5D50332052532AE119C50B930 libnetmgr.so
+08-17 19:47:07.931 F/google-breakpad(26081): M E257A000 00000000 00004000 AB354652140A356C9787104C87CB30E00 libidl.so
+08-17 19:47:07.931 F/google-breakpad(26081): M E2581000 00000000 00004000 63ED38853810ED69BA1AA57CE82E74B10 libtime_genoff.so
+08-17 19:47:07.931 F/google-breakpad(26081): M E2587000 00000000 00004000 51134658113749962ABB7BA3A3C5E9740 libqmi_client_helper.so
+08-17 19:47:07.931 F/google-breakpad(26081): M E258E000 00000000 00009000 1D288EC9F32773EBC0D380D4E238D8D60 libqmi_client_qmux.so
+08-17 19:47:07.931 F/google-breakpad(26081): M E25C9000 00000000 0006A000 60BAE0DAB14BFBC4BE1805CC4CAF8B4D0 lib-imsdpl.so
+08-17 19:47:07.931 F/google-breakpad(26081): M E263D000 00000000 00019000 0333752023452FF1E40F6BA9169471500 libdiag.so
+08-17 19:47:07.931 F/google-breakpad(26081): M E274E000 00000000 0002C000 0FC3AF7C85EA4B0DA653AEA111020A2D0 libqmi.so
+08-17 19:47:07.931 F/google-breakpad(26081): M E27B7000 00000000 000B8000 023971CEF8E022AAD4090C7D1432C3690 libCB.so
+08-17 19:47:07.931 F/google-breakpad(26081): M E7D93000 00000000 00461000 39CBB6C545073B5DB56B60665F81D4B00 libart.so
+08-17 19:47:07.931 F/google-breakpad(26081): M E8384000 00000000 00001000 7691C4BE084B030B3AA118A6F412EE260 libqmi_common_so.so
+08-17 19:47:07.932 F/google-breakpad(26081): M E8387000 00000000 0000A000 37A576E22F2B9973E1734E556E1E99990 libqmi_cci.so
+08-17 19:47:07.932 F/google-breakpad(26081): M E8395000 00000000 00003000 DCDF68ACFBFC2DEFC89FA0F5783199070 libpackagelistparser.so
+08-17 19:47:07.932 F/google-breakpad(26081): M E839A000 00000000 00056000 0C1D30C5E6EA7E82800A2B00935E4B060 libharfbuzz_ng.so
+08-17 19:47:07.932 F/google-breakpad(26081): M E83F3000 00000000 00037000 8AF00237A05209C2E429D0F70ED3EB900 libopus.so
+08-17 19:47:07.932 F/google-breakpad(26081): M E842C000 00000000 00017000 215A7F63855CB46EC59B425BEDFD847D0 libminikin.so
+08-17 19:47:07.932 F/google-breakpad(26081): M E8447000 00000000 00018000 EAB4CCC4544F5D8E2ECF256D527F4A430 libutils.so
+08-17 19:47:07.932 F/google-breakpad(26081): M E8461000 00000000 0001E000 CCAA49412B791630FD4EAD7755A3E4CD0 libvorbisidec.so
+08-17 19:47:07.932 F/google-breakpad(26081): M E8481000 00000000 00008000 F3F7CCE4ADD14C5DB852DF06407AE2FA0 libcamera_metadata.so
+08-17 19:47:07.932 F/google-breakpad(26081): M E848C000 00000000 0000E000 1F6ED3D6536346B3B20CF40C5F9799D80 liblog.so
+08-17 19:47:07.932 F/google-breakpad(26081): M E849D000 00000000 00010000 D6821B30C7A106C623EEE331974C9BF50 libGLESv2.so
+08-17 19:47:07.932 F/google-breakpad(26081): M E84AF000 00000000 00014000 22B107B0382117ED603FF6000B248B8D0 libpcre.so
+08-17 19:47:07.932 F/google-breakpad(26081): M E84C4000 00000000 00040000 9CC9AFC89D88D4C4AE6AEF2E290594B70 libinputflinger.so
+08-17 19:47:07.932 F/google-breakpad(26081): M E8508000 00000000 00005000 459EC08F2C9F91A7E6AB6F293540B4510 libstdc++.so
+08-17 19:47:07.932 F/google-breakpad(26081): M E850F000 00000000 00005000 DE5A396AAF801AF9A298A50BADE143E60 libspeexresampler.so
+08-17 19:47:07.932 F/google-breakpad(26081): M E84F0000 00000000 00B36000 F1644AA2ACE475925E0DA02A814C13DF0 libLLVM.so
+08-17 19:47:07.933 F/google-breakpad(26081): M E9081000 00000000 00008000 225E121AA129BB96606A1B3B91A2737A0 libnbaio.so
+08-17 19:47:07.933 F/google-breakpad(26081): M E908C000 00000000 00017000 9A6B379EB3F10874FC241C570801C6070 libmemunreachable.so
+08-17 19:47:07.933 F/google-breakpad(26081): M E909C000 00000000 0005F000 0FAC08487B9CD62449A19C8D161E7D820 libgui.so
+08-17 19:47:07.933 F/google-breakpad(26081): M E9109000 00000000 00004000 E9B0F0A724940363FCBE11FB96B6ADF30 libnativebridge.so
+08-17 19:47:07.933 F/google-breakpad(26081): M E910D000 00000000 0007B000 B44B5897A497DCB27C105B61AC30F1180 libhwui.so
+08-17 19:47:07.933 F/google-breakpad(26081): M E918B000 00000000 0008B000 DCAB7F6AA60C5E74587E56973C6653120 libc++.so
+08-17 19:47:07.933 F/google-breakpad(26081): M E921C000 00000000 00003000 3C7CC5BEA31C9C85C9BC25EC0891B7B10 libsync.so
+08-17 19:47:07.933 F/google-breakpad(26081): M E9221000 00000000 00009000 4334A7FB3D1CB8582D4D676DE6E5E2930 libpiex.so
+08-17 19:47:07.933 F/google-breakpad(26081): M E922A000 00000000 0000E000 EBD0DA428C58F5CBD72761DD6F1C03A10 libsoundtrigger.so
+08-17 19:47:07.933 F/google-breakpad(26081): M E923D000 00000000 00020000 27C83DAE0AB0E161280BB40C384BD4BC0 libm.so
+08-17 19:47:07.933 F/google-breakpad(26081): M E925F000 00000000 00003000 C9108BAA1E466D60D4591919420BBB6A0 libradio_metadata.so
+08-17 19:47:07.933 F/google-breakpad(26081): M E9264000 00000000 0000E000 63E3F027146D592F9FBE03A33EDC8C6D0 libimg_utils.so
+08-17 19:47:07.933 F/google-breakpad(26081): M E9275000 00000000 00015000 53AF0C4E2096697687AC0081AC7AD97C0 libunwind.so
+08-17 19:47:07.933 F/google-breakpad(26081): M E92D0000 00000000 0001F000 9F74D840029038F65C040D5492CAE7360 libinput.so
+08-17 19:47:07.933 F/google-breakpad(26081): M E92F5000 00000000 00005000 17620CAE201DC01DFD868F3276E8AA810 libpowermanager.so
+08-17 19:47:07.933 F/google-breakpad(26081): M E92FD000 00000000 00055000 5E4B1D0F4D553AA92665AE0925229AF40 libsonivox.so
+08-17 19:47:07.933 F/google-breakpad(26081): M E9359000 00000000 00006000 E727B84B0F5B3D982CAE8FB6E64B88030 libtiff_directory.so
+08-17 19:47:07.934 F/google-breakpad(26081): M E9362000 00000000 00021000 52D2F4BBC71C3EE2E161E009B0331EF80 libstagefright_foundation.so
+08-17 19:47:07.934 F/google-breakpad(26081): M E9386000 00000000 0003B000 2D4A4F8139C7842165EA73A6ACD835340 libjpeg.so
+08-17 19:47:07.934 F/google-breakpad(26081): M E93C3000 00000000 00003000 9945E8F5AE0ADE1ED46FA08B41A6C9BE0 libmemtrack.so
+08-17 19:47:07.934 F/google-breakpad(26081): M E93C6000 00000000 00019000 D2D0067E628DCC03418B99399D251A990 libEGL.so
+08-17 19:47:07.934 F/google-breakpad(26081): M E93E4000 00000000 00019000 6534179E8DC7D8EDBF1236C375D51ECD0 libdrmframework.so
+08-17 19:47:07.934 F/google-breakpad(26081): M E93FB000 00000000 00110000 994744AF5261DAC7CD0003EC5456DBDF0 libicuuc.so
+08-17 19:47:07.934 F/google-breakpad(26081): M E9519000 00000000 00015000 BDA36CE4717D8C1A324C7CA4E1CA9B860 libvulkan.so
+08-17 19:47:07.934 F/google-breakpad(26081): M E9521000 00000000 000F8000 91002184018FFAC8E26ECCB238E392440 libandroid_runtime.so
+08-17 19:47:07.934 F/google-breakpad(26081): M E962A000 00000000 00004000 644559B020FD089F8180BB62CF9420590 libprocessgroup.so
+08-17 19:47:07.934 F/google-breakpad(26081): M E9629000 00000000 00183000 035813361AA690A2E08F1E059823C9D50 libicui18n.so
+08-17 19:47:07.934 F/google-breakpad(26081): M E97B8000 00000000 00008000 9D6466250A83301B3BE4CAA85227525D0 libnativeloader.so
+08-17 19:47:07.934 F/google-breakpad(26081): M E97C0000 00000000 0000E000 031F092D2D476376D52F41FD2ADD2A3E0 libradio.so
+08-17 19:47:07.934 F/google-breakpad(26081): M E97D2000 00000000 00003000 159F2CAC750E3DB60EF444F05BACCC850 libregionalization.so
+08-17 19:47:07.934 F/google-breakpad(26081): M E97D8000 00000000 00008000 16C813B71CC34E81BCF6F5DD8648DC3B0 libGLESv1_CM.so
+08-17 19:47:07.934 F/google-breakpad(26081): M E97E2000 00000000 00003000 AA06FF77B6E4CC83470C006104304D0F0 libhardware.so
+08-17 19:47:07.934 F/google-breakpad(26081): M E97E0000 00000000 00039000 B613B07CCC9703A9AAE92861C92202BD0 libcamera_client.so
+08-17 19:47:07.935 F/google-breakpad(26081): M E980D000 00000000 003A9000 42F6682A5C7E8B66743C6087B578D6C40 libskia.so
+08-17 19:47:07.935 F/google-breakpad(26081): M E9BDC000 00000000 00007000 AD9132F0D394659639CBE5858DD1BB750 libhardware_legacy.so
+08-17 19:47:07.935 F/google-breakpad(26081): M E9BE7000 00000000 00005000 EE5BF022DE057918231B46C6EDDC38690 libstagefright_yuv.so
+08-17 19:47:07.935 F/google-breakpad(26081): M E9BEE000 00000000 00007000 9BC1C9D1E638BF1B7B32AC308B08D9DA0 libimage_type_recognition.so
+08-17 19:47:07.935 F/google-breakpad(26081): M E9BF7000 00000000 0000D000 3C492E547FA88D7E2E85BD9451F613090 libbacktrace.so
+08-17 19:47:07.935 F/google-breakpad(26081): M E9C07000 00000000 00007000 B165EC37228240E1EBEDC14160C16A3A0 libnativehelper.so
+08-17 19:47:07.935 F/google-breakpad(26081): M E9C10000 00000000 0001A000 4D1780AFB25B59BBD625608B400D70C20 libprotobuf-cpp-lite.so
+08-17 19:47:07.935 F/google-breakpad(26081): M E9C2D000 00000000 00004000 989F274AF037FE14219BE6DC42503B950 libnetd_client.so
+08-17 19:47:07.935 F/google-breakpad(26081): M E9C33000 00000000 000A0000 8E23BB4E73E86B4A2AD4C17D7BAFD8A90 libcrypto.so
+08-17 19:47:07.935 F/google-breakpad(26081): M E9CE0000 00000000 00003000 675D9BCC56AB210C8017D6625F994D250 libstagefright_enc_common.so
+08-17 19:47:07.935 F/google-breakpad(26081): M E9CE5000 00000000 00024000 CC51150390EA9EFB0315C02573CCFD000 libpng.so
+08-17 19:47:07.935 F/google-breakpad(26081): M E9D0B000 00000000 0003B000 4FBF4968372FEB1C8D593076E1B171610 libRScpp.so
+08-17 19:47:07.935 F/google-breakpad(26081): M E9D49000 00000000 0000A000 415DAD77CED2441456E20CAD35C536250 libRS.so
+08-17 19:47:07.935 F/google-breakpad(26081): M E9D55000 00000000 00004000 F168A985060F7993C937719998C96FD20 libusbhost.so
+08-17 19:47:07.935 F/google-breakpad(26081): M E9D5B000 00000000 00086000 58C592B73EA51A0AFC3287247961D0940 libdng_sdk.so
+08-17 19:47:07.935 F/google-breakpad(26081): M E9DE1000 00000000 00057000 44C1EA73F38E47E95712BF5848E8937E0 libbinder.so
+08-17 19:47:07.935 F/google-breakpad(26081): M E9E3F000 00000000 0002E000 2824A9CACA3A870AD713A3405D6249530 libwilhelm.so
+08-17 19:47:07.935 F/google-breakpad(26081): M E9E72000 00000000 00030000 E9CE28F8F628E4501925FF4D0FD6168F0 libstagefright_omx.so
+08-17 19:47:07.936 F/google-breakpad(26081): M E9EA0000 00000000 00487000 3CD6A967C46ED23F4AB4B39092B43AB70 libpdfium.so
+08-17 19:47:07.936 F/google-breakpad(26081): M EA337000 00000000 00004000 76B7583F8773D45C53E165CABC841DE70 libETC1.so
+08-17 19:47:07.936 F/google-breakpad(26081): M EA33D000 00000000 00015000 F0658EC8F5FCD09AB82C2EFC3A6834210 libui.so
+08-17 19:47:07.936 F/google-breakpad(26081): M EA355000 00000000 00038000 E4F681ED6DAD0F793516317FBE3DD55A0 libRS_internal.so
+08-17 19:47:07.936 F/google-breakpad(26081): M EA390000 00000000 00016000 0DB58A0AF796EA03A43AAD505A8723310 liblzma.so
+08-17 19:47:07.936 F/google-breakpad(26081): M EA3AE000 00000000 00011000 2618247A47A298A5C4574CC818C7F3280 libselinux.so
+08-17 19:47:07.936 F/google-breakpad(26081): M EA3C1000 00000000 00005000 961542B344C4A0F54F87B49C0F1429E80 libwpa_client.so
+08-17 19:47:07.936 F/google-breakpad(26081): M EA3C8000 00000000 00007000 5FF53AA38050A1DE3BF7A4D755DC75B70 libaudioutils.so
+08-17 19:47:07.936 F/google-breakpad(26081): M EA3D1000 00000000 00017000 31235ADAF427BE11933CD87290CCAF050 libcutils.so
+08-17 19:47:07.936 F/google-breakpad(26081): M EA3EB000 00000000 00036000 CBC6DC0C255BAB785FCD0511A7CBF0690 libbcinfo.so
+08-17 19:47:07.936 F/google-breakpad(26081): M EA423000 00000000 00003000 FDA204F888F3C0D8070BFDEC834066D20 libstagefright_http_support.so
+08-17 19:47:07.936 F/google-breakpad(26081): M EA428000 00000000 00005000 14FB257C9C6F43C8FA0B475D81C47FFC0 libbinary_parse.so
+08-17 19:47:07.936 F/google-breakpad(26081): M EA42F000 00000000 00009000 93F30055C78E1D80E40A8E717405CF500 libmediautils.so
+08-17 19:47:07.936 F/google-breakpad(26081): M EA43B000 00000000 0000A000 0F98C20EB2725367604DCE7EDA8EED9D0 libbase.so
+08-17 19:47:07.936 F/google-breakpad(26081): M EA447000 00000000 00016000 DC1FEB19B377562139F4F8AAFFA610710 libz.so
+08-17 19:47:07.936 F/google-breakpad(26081): M EA460000 00000000 00015000 68F77CDFB35DA081E510A50D11F299D70 libexpat.so
+08-17 19:47:07.937 F/google-breakpad(26081): M EA45D000 00000000 000C3000 3B22B766CDBB99263CF24B4CC2986E510 libmedia.so
+08-17 19:47:07.937 F/google-breakpad(26081): M EA541000 00000000 00031000 335A60B9AA0F00A47BD5A781CCA820740 libandroidfw.so
+08-17 19:47:07.937 F/google-breakpad(26081): M EA574000 00000000 0007A000 21086BE83826AA7DC32AB49C79D5CCE30 libsqlite.so
+08-17 19:47:07.937 F/google-breakpad(26081): M EA5F2000 00000000 0006C000 6EA54A19597F20D46626700FE9F206F50 libft2.so
+08-17 19:47:07.937 F/google-breakpad(26081): M EA64F000 00000000 0016B000 4E69F13734FEABE1CA5BA98594235DCD0 libstagefright.so
+08-17 19:47:07.937 F/google-breakpad(26081): M EA7D3000 00000000 00007000 475E29D0A243BEE93EC1A630C99503FC0 libnetutils.so
+08-17 19:47:07.937 F/google-breakpad(26081): M EA7DC000 00000000 00084000 49B02E01AEC77331A1D6D19B540265610 libc.so
+08-17 19:47:07.937 F/google-breakpad(26081): M EA86E000 00000000 00025000 8B6ECC65C09CAFF5ACAAB6C9249CD2C20 libssl.so
+08-17 19:47:07.937 F/google-breakpad(26081): M EA896000 00000000 00008000 22114C778A7ED1CC3953CCB22323EA1B0 libstagefright_avc_common.so
+08-17 19:47:07.937 F/google-breakpad(26081): M EA8A1000 00000000 00003000 7FA19C935E6148BD8002A3CA630C4E6F0 libsmemlog.so
+08-17 19:47:07.937 F/google-breakpad(26081): M EA8A1000 00000000 00017000 EEAF8ABB6827B80A458A5D483E5562400 libqmiservices.so
+08-17 19:47:07.937 F/google-breakpad(26081): M EA8C1000 00000000 00008000 090640ECFC69E16A25A3E27006AF282E0 libxml.so
+08-17 19:47:07.937 F/google-breakpad(26081): M EA8CC000 00000000 00012000 67F4D476A96F053ACB61531379FCC4810 libdsutils.so
+08-17 19:47:07.937 F/google-breakpad(26081): M EA8EF000 00000000 00014000 EFD5F0A0F81252A037F1C06B8E6809700 libsdsprpc.so
+08-17 19:47:07.937 F/google-breakpad(26081): M EA905000 00000000 0003E000 C4311189AF8DA8405EDC0701CD38FC770 libgsl.so
+08-17 19:47:07.937 F/google-breakpad(26081): M EA99F000 00000000 00014000 75BC34362D3F387A08AE8241CED8E2550 libadsprpc.so
+08-17 19:47:07.938 F/google-breakpad(26081): M EA9B2000 00000000 0001A000 840BD6EAC45DEFC59D2F1E8C681CFF1A0 lib-imsrcscmclient.so
+08-17 19:47:07.938 F/google-breakpad(26081): M EA9DA000 00000000 00011000 6034A9FBADF19CE6C259DA006E8158FC0 lib-imsrcscmservice.so
+08-17 19:47:07.938 F/google-breakpad(26081): M EAA09000 00000000 00003000 7BB31E1D28279A11B8087C3F4DF7D0BA0 libqti-at.so
+08-17 19:47:07.938 F/google-breakpad(26081): M EAA0E000 00000000 0000C000 7D5A1CA22F6A85FCC57B3D36A92461560 lib-ims-rcscmjni.so
+08-17 19:47:07.938 F/google-breakpad(26081): M EAA1C000 00000000 00012000 FAD2DBDF65F36590FFE591C62DBEFA1E0 libOpenCL.so
+08-17 19:47:07.938 F/google-breakpad(26081): M EAA38000 00000000 00003000 025B4D5BBA39265D6260B27597E321730 memtrack.msm8937.so
+08-17 19:47:07.938 F/google-breakpad(26081): M EAA3D000 00000000 00011000 F5FF7C8214A82029405A068BCDF69A580 libmediandk.so
+08-17 19:47:07.938 F/google-breakpad(26081): M EAA53000 00000000 00008000 5373A05304D5AFD8BC2BB49D6C22977D0 libopenjdkjvm.so
+08-17 19:47:07.938 F/google-breakpad(26081): M EAA5C000 00000000 0000F000 96A60B84ED1352C202B6695FD32373790 libmediadrm.so
+08-17 19:47:07.938 F/google-breakpad(26081): M EAA6E000 00000000 00010000 3D880E60A39C482BA4210DA0AD4E20490 libGLESv3.so
+08-17 19:47:07.938 F/google-breakpad(26081): M EAA97000 00000000 00003000 F4CB54FA6F9A644292CE2DCC9FA89DA80 libqti_performance.so
+08-17 19:47:07.938 F/google-breakpad(26081): M EAA9D000 00000000 00004000 B2EAC3688B9EFF0E79EA2C170AA859C50 libwebviewchromium_plat_support.so
+08-17 19:47:07.938 F/google-breakpad(26081): M EAAA5000 00000000 00004000 837BE31E60CD67A2C45BF27A1E8C10140 libOpenSLES.so
+08-17 19:47:07.938 F/google-breakpad(26081): M EAAAB000 00000000 00004000 3C4D0169CD09A3AEEC0868A7FC87CCFA0 libOpenMAXAL.so
+08-17 19:47:07.938 F/google-breakpad(26081): M EAAB0000 00000000 00016000 BAF17608D25635EFA63708C89561474D0 libcamera2ndk.so
+08-17 19:47:07.938 F/google-breakpad(26081): M EAB53000 00000000 00003000 78C8F6360CF612E4333D4EB1796927460 libqti-perfd-client.so
+08-17 19:47:07.938 F/google-breakpad(26081): M EAB57000 00000000 00014000 01EE9AC4109E06B182E77B55242AEBE20 libandroid.so
+08-17 19:47:07.939 F/google-breakpad(26081): M EABAF000 00000000 00003000 4C4B6F03AF5049885FD4A43F149D13630 libjnigraphics.so
+08-17 19:47:07.939 F/google-breakpad(26081): M EABB0000 00000000 00090000 FBA40D2822A0C6DCF7CE29FB42DC37230 libmediaplayerservice.so
+08-17 19:47:07.939 F/google-breakpad(26081): M EAC7B000 00000000 0000A000 52C41240B217BFE92F7381218169FD760 liblz4.so
+08-17 19:47:07.939 F/google-breakpad(26081): M EACF9000 00000000 00038000 FEF1DA3EC5AA99E4FF38C1DF2A9A91570 libavenhancements.so
+08-17 19:47:07.939 F/google-breakpad(26081): M EAD35000 00000000 0002F000 85E4C8F7646AA02A46215564266690BA0 libstagefright_wfd.so
+08-17 19:47:07.939 F/google-breakpad(26081): M EAD6A000 00000000 00026000 7B91D8B6A15FF171BF114D8D638785D80 libstagefright_httplive.so
+08-17 19:47:07.939 F/google-breakpad(26081): M EAD94000 00000000 00003000 6DE080E13BB1741A34C157CE97277ABD0 libsigchain.so
+08-17 19:47:07.939 F/google-breakpad(26081): M EADE7000 00000000 00003000 1390052238CBD9474F1747EA0BA53C740 libExtendedExtractor.so
+08-17 19:47:07.939 F/google-breakpad(26081): M EAE32000 00000000 00006000 3B45281FC4EB699207799FD6018FBD910 libvendorconn.so
+08-17 19:47:07.939 F/google-breakpad(26081): M EAEB2000 00000000 0005F000 7AC50A488023F3DA8182906BDFFA72C10 linker
+08-17 19:47:07.939 F/google-breakpad(26081): -----END BREAKPAD MICRODUMP-----
+08-17 19:47:35.311 F/google-breakpad(26227): -----BEGIN BREAKPAD MICRODUMP-----
+08-17 19:47:35.311 F/google-breakpad(26227): V AndroidWebView:62.0.3188.0
+08-17 19:47:35.311 F/google-breakpad(26227): O A arm 08 armv8l Nokia/TA-1025_00WW/PLE:7.1.1/NMF26F/00WW_3_32C:user/release-keys
+08-17 19:47:35.311 F/google-breakpad(26227): P webview
+08-17 19:47:35.311 F/google-breakpad(26227): R 00000005 SIGTRAP 00000000
+08-17 19:47:35.311 F/google-breakpad(26227): G
+08-17 19:47:35.323 F/google-breakpad(26227): H 12C00000 FFF73000 00F5 31E89000 9598E000 0C:16 0D:08 0E:11 0F:47 10:06 11:0A 12:08 13:13 14:09 15:0A 16:1B 17:13 18:0D 19:02 1B:01 1C:02 1D:01
+08-17 19:47:35.324 F/google-breakpad(26227): S 0 C92FFC60 C92FF000 00002000
+08-17 19:47:35.324 F/google-breakpad(26227): S C92FF000 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:47:35.325 F/google-breakpad(26227): S C92FF180 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:47:35.325 F/google-breakpad(26227): S C92FF300 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:47:35.326 F/google-breakpad(26227): S C92FF480 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:47:35.326 F/google-breakpad(26227): S C92FF600 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:47:35.327 F/google-breakpad(26227): S C92FF780 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:47:35.327 F/google-breakpad(26227): S C92FF900 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:47:35.328 F/google-breakpad(26227): S C92FFA80 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:47:35.328 F/google-breakpad(26227): S C92FFC00 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005CFD2FC94CFD2FC950FD2FC98CFC2FC9EDACEF0DEDACEF0D0100000024FE2FC9010000009D20FCD3EDACEF0DEDACEF0D00000000EDACEF0D02000000EDACEF0DEDACEF0DEDACEF0D0000000000000000BCFC2FC901000000000000007F02000000000000EDACEF0D00000000200000000000000000002CD4000000000000000000000000000000000000000000000000EDACEF0D000000000000000000000000EDACEF0D00000000EDACEF0D0000000000000000EDACEF0D0000000000000000000000000000000020000000D0FC2FC9EDACEF0D50FD2FC94CFD2FC9EDACEF0DEDACEF0DD5D92BD4EDACEF0DEDACEF0DEDACEF0D0000000003000000EDACEF0D0000000002000000EDACEF0DEDACEF0DEDACEF0DB7D72BD424000000EDACEF0D
+08-17 19:47:35.329 F/google-breakpad(26227): S C92FFD80 F8FD2FC9EDACEF0DEDACEF0D0200000000000000EDACEF0D000000000200000001000000EDACEF0D0200000000000000EDACEF0D000000000200000001000000EDACEF0D0000000002000000EDACEF0D0000000002000000010000000F0B00000000000000000000FFFFFFFF000000000000000000000000FFFFFFFF01000000EDACEF0D7CFE2FC984FE2FC988FE2FC924FE2FC9D8FE2FC978FE2FC98F0830D4EDACEF0DEDACEF0DEDACEF0DDD7755D2EDACEF0DD8FE2FC94CFE2FC948FE2FC9D8FE2FC938FF2FC974FF2FC9D8FE2FC900000000EDACEF0DEDACEF0DEDACEF0D3C0130C947733DD4D8FE2FC980FE2FC978FE2FC901000000EDACEF0DEDACEF0DEDACEF0D018D98D200000000000000000400000000000000FFFFFFFF00000000FFFFFFFF00000000FFFFFFFF00000000FFFFFFFF070000001D00000000000000FFFFFFFF00000000FFFFFFFF00CB97D20000000001B056D2000000000000000000000000F0FE2FC9A00030C9EDACEF0D38FF2FC9EDACEF0D4543A7D400000000
+08-17 19:47:35.329 F/google-breakpad(26227): S C92FFF00 080030C9EB8E3DD4A40030C9DF8697D2EDACEF0DE38598D2EDACEF0DEDACEF0DEDACEF0D31000000EDACEF0DEDACEF0DEDACEF0D31000000EDACEF0DFFFFFFFFFFFFFFFFFFFFFFFFEDACEF0D6C0000000000000001000000EDACEF0DEDACEF0D742F6874EDACEF0D14617274EDACEF0DEDACEF0D3100000024000000EDACEF0D31000000FFFFFFFFFFFFFFFF02000000FFFFFFFFFFFFFFFF01000000FFFFFFFFFFFFFFFFA40030C9A00030C9340130C9EDACEF0D4543A7D400000000080030C93C0130C911A03DD400000000000000000C0030C9EDACEF0DEDACEF0DEDACEF0D00000000EDACEF0D00000000EDACEF0D02000000B9D89CD2EDACEF0DEDACEF0D200030C9700330C90000000003000000EDACEF0D00000000780430C923D89CD200000000080000000100000095CD90D2EDACEF0D4543A7D400000000EDACEF0DEDACEF0DEDACEF0DEDACEF0D000000000100000000000000EDACEF0DEDACEF0D00000000000000004543A7D400000000EDACEF0D97C090D2EDACEF0DEDACEF0D
+08-17 19:47:35.330 F/google-breakpad(26227): S C9300080 9C0030C900000000EDACEF0D00000000EDACEF0DEDACEF0DEDACEF0DEDACEF0DEDACEF0D000030C9EDACEF0DFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000000000130C900000000000000000000000000000000000000000000000000000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF02000000FFFFFFFFFFFFFFFF01000000FFFFFFFFFFFFFFFF00000000000000000000000000000000000000002D000000310000000200000000000000EDACEF0DEDACEF0D000000000000000000000000EDACEF0DEDACEF0DEDACEF0DEDACEF0DEDACEF0D00000000380230C94543A7D4EDACEF0D380230C9700330C9280230C9EDACEF0DEDACEF0D4543A7D400000000EDACEF0D780430C92DB773D2EDACEF0DEDACEF0DD9C68DD2F1C68DD2EDACEF0D07000000EDACEF0DD9C68DD20700000065C38DD2EDACEF0D0900000009000000DCC61D727DF856D2EDACEF0D7D933DD4CF228BD2CF228BD2178076D2013B65D2EDACEF0D380230C900000000780430C98D8064D2
+08-17 19:47:35.330 F/google-breakpad(26227): S C9300200 6E70E4D48970E4D400000000000000000000000000000000EDACEF0D000000000000000000000000EDACEF0D0000000000000000A40230C90000000000000000EDACEF0DEDACEF0DEDACEF0D7B2B84EAEDACEF0DEDACEF0D780430C9B97855D2EDACEF0DA40230C9EDACEF0DEDACEF0DEDACEF0D090000000000000009000000EDACEF0DEDACEF0D0000000000000000EDACEF0DEDACEF0D0000000000000000D00530C9EDACEF0DEDACEF0D00000000EDACEF0DEDACEF0D380330C903000000EDACEF0DEDACEF0D780430C93FD49CD2EDACEF0D09000000010000006B9855D2FC0230C900000000480330C900000000EDACEF0DEDACEF0D0900000005E09CD209000000EDACEF0D0000000000000000000000000000000000000000EDACEF0D1B000000FFFFFFFF700330C94F1B59D2EDACEF0D090000000000000000000000000000000000000025B0B6D4EDACEF0D00000000A1CE9CD20E0B000000000000EDACEF0D02000000940430C905000000EDACEF0D000000000000000000000000
+08-17 19:47:35.331 F/google-breakpad(26227): S C9300380 000000000000000000000000D5B0B6D425B0B6D42C0100007D933DD4CF228BD2CF228BD2178076D2013B65D20E0B0000EDACEF0DE80330C90E0B000000000000EDACEF0DEDACEF0D0000000000000000EDACEF0D090000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000EDACEF0DEDACEF0D980430C90000000003000000D80430C900000000780430C9FBC69CD20000000000000000EDACEF0D09000000880430C9000000000000000000000000E8030000000000000000000000000000E8030000B00430C9EDACEF0D800430C900000000EDACEF0D00000000000000000000000000000000EDACEF0D09000000000000000000000000000000EDACEF0D0000000000000000EDACEF0D0900000000000000000000000000000000000000EDACEF0DEDACEF0D00000000EDACEF0DD00530C965CC73D2000000000000000000000000000000000000000000000000EDACEF0D00000000D00530C9EDACEF0D0000000000000000
+08-17 19:47:35.331 F/google-breakpad(26227): S C9300500 0000000000000000EDACEF0D280730C9C00530C9EDACEF0DEDACEF0D747D92D400000000280730C9EDACEF0D2DB773D2EDACEF0D300730C9F00530C9EDACEF0DEDACEF0D747D92D4000000006BB773D201010000DC0530C9EDACEF0DEDACEF0DB000000080000000EDACEF0D7B2B84EACF228BD2CF228BD2178076D2013B65D2479B9CD2DC0530C9EDACEF0D0000000007E29CD253E29CD2CF228BD2CF228BD200000000000000000000000000000000FC0530C9000000000000000000000000EDACEF0D00000000EDACEF0DF6FFFFFF00000000000000004000000000000000EDACEF0DEDACEF0D000000000000000000000000000000002000000000000000000000000000000000000000EDACEF0D000000000000000000000000F76985EA0000000000000000EDACEF0D000000000000000000000000400830C9EDACEF0DEDACEF0D00000000280730C9A40630C9480730C92842A7D4EDACEF0D280730C9EDACEF0D5FB473D2300730C9C40630C9500730C92842A7D400000000300730C9
+08-17 19:47:35.332 F/google-breakpad(26227): S C9300680 500730C935B573D2EDACEF0DEDACEF0DEDACEF0DEDACEF0DFFFFFFFFC00630C9020000000000000000000000000000000000000077D5BED2EDACEF0D00000000F4FFFFFFEDACEF0DE40630C9EDACEF0DB80730C9EDACEF0D00000000000000000000000000000000EDACEF0DEDACEF0D280730C9EDACEF0DB80730C9EDACEF0DC80730C9280730C9700730C92BAA73D2EDACEF0DEDACEF0D00000000EDACEF0DEDACEF0DEDACEF0DEDACEF0DEDACEF0D00000000000000000000000000000000000000007642A7D42842A7D4C9000000CF228BD2CF228BD2178076D2013B65D2479B9CD246030000010030C900000000FFFFFFFFD0A4BDD202000000F00730C900000000EDACEF0DEDACEF0DEDACEF0DAC0730C9FFFFFFFFE00730C9EDACEF0D010000006B9855D2EDACEF0DEDACEF0DEDACEF0DEDACEF0DEDACEF0DEDACEF0D00000000000000000000000000000000000000007642A7D42842A7D4C9000000CF228BD2CF228BD2178076D2013B65D2479B9CD24603000001000000D34657D2
+08-17 19:47:35.332 F/google-breakpad(26227): S C9300800 EDACEF0DEDACEF0DEDACEF0D00000000EDACEF0DEDACEF0D000000005B8173D2020000009BD47ED2CC0830C9400830C9EDACEF0D00000000CC0830C91FA773D20000000000000000EDACEF0D3100000020000000EDACEF0D00000000000000000000000000000000980830C9EDACEF0DEDACEF0DEDACEF0D940830C9EDACEF0D00000000CC0830C9000000006B9855D20000000000000000EDACEF0D214657D2000000000000000000000000B34557D2EDACEF0DEDACEF0DEDACEF0DEDACEF0D00000000498473D2EDACEF0DEDACEF0D00000000EDACEF0DEDACEF0D00000000CC0830C9EDACEF0DEDACEF0D200930C978000000EDACEF0DEDACEF0DA38173D2200930C9CD2F82EA200930C9E52F82EA280930C9EF5C7FEA7800000000000000EDACEF0DEDACEF0DEDACEF0DEDACEF0D00000000EDACEF0DEDACEF0D00100000000000000000000000000000000000005B8173D2EDACEF0D00000000EDACEF0D0100000000000000EDACEF0D00000000700930C9200930C91600000000000000
+08-17 19:47:35.333 F/google-breakpad(26227): S C9300980 00000000EDACEF0D00000000EDACEF0D0000000001000000EDACEF0D0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000EDACEF0D01000000EDACEF0D000000000000000001000000EDACEF0D01000000EDACEF0D01000000EDACEF0D01000000EDACEF0D010000000100000001000000EDACEF0D01000000EDACEF0D01000000EDACEF0D01000000EDACEF0D01000000EDACEF0D00000000000000000000000000000000000000000000000001000000EDACEF0D000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:47:35.333 F/google-breakpad(26227): S C9300B00 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:47:35.334 F/google-breakpad(26227): S C9300C80 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:47:35.334 F/google-breakpad(26227): S C9300E00 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:47:35.334 F/google-breakpad(26227): S C9300F80 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:47:35.335 F/google-breakpad(26227): C 06000040000000000000000005B88FD2020000008CFC2FC9CCFC2FC9003480C8ACFC2FC94CFD2FC95CFD2FC950FD2FC980FE2FC9D9C5F7D360FC2FC91B89B3D28684B3D2300003680000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:47:35.335 F/google-breakpad(26227): M AAAAA000 00000000 00005000 8D2477F3B51997BDCC3733B8D1F920BE0 app_process32
+08-17 19:47:35.335 F/google-breakpad(26227): M 70D29000 00000000 00806000 E9166D3ED622EE65A3A4086EBEA4A7950 boot.oat
+08-17 19:47:35.335 F/google-breakpad(26227): M 71531000 00000000 006C0000 668D96384E4368B01BC9B9F365028CA20 boot-core-libart.oat
+08-17 19:47:35.335 F/google-breakpad(26227): M 71BF3000 00000000 000AA000 0D160B642FB1639805B72AC6F4DF3F380 boot-conscrypt.oat
+08-17 19:47:35.336 F/google-breakpad(26227): M 71C9F000 00000000 000D1000 9D69BDC94BD07F2468D5B7DB0AEEF0140 boot-okhttp.oat
+08-17 19:47:35.336 F/google-breakpad(26227): M 71D72000 00000000 0000C000 566CD32860A984FD445A4852058609CB0 boot-core-junit.oat
+08-17 19:47:35.336 F/google-breakpad(26227): M 71D80000 00000000 0019F000 09C1E8B1D7FC826CB75691EC5BDBA1DB0 boot-bouncycastle.oat
+08-17 19:47:35.336 F/google-breakpad(26227): M 71F21000 00000000 0014B000 069BAE4D2D7831B857A3C236021D868A0 boot-ext.oat
+08-17 19:47:35.336 F/google-breakpad(26227): M 7206E000 00000000 0223E000 D0BEBD37E215DDC845099212203F792F0 boot-framework.oat
+08-17 19:47:35.336 F/google-breakpad(26227): M 742AE000 00000000 00502000 B41E052DBA2949CE100713743053E1E40 boot-telephony-common.oat
+08-17 19:47:35.336 F/google-breakpad(26227): M 747B2000 00000000 0003D000 65E4B1E28F33F9C51062E2D0630394830 boot-voip-common.oat
+08-17 19:47:35.336 F/google-breakpad(26227): M 747F1000 00000000 00045000 EB491A6AF6568A675D81746238ACC78B0 boot-ims-common.oat
+08-17 19:47:35.336 F/google-breakpad(26227): M 74838000 00000000 0016C000 C369D6D4F8DCF10CC0AD1800000000000 boot-apache-xml.oat
+08-17 19:47:35.337 F/google-breakpad(26227): M 749A6000 00000000 000FF000 1FAC5317B0FEBD01C31E8039D76CCAF50 boot-org.apache.http.legacy.boot.oat
+08-17 19:47:35.337 F/google-breakpad(26227): M 74AA7000 00000000 00004000 C368F8D0F8DCF10C00BE1800000000000 boot-tcmiface.oat
+08-17 19:47:35.337 F/google-breakpad(26227): M 74AAD000 00000000 00016000 C368FA40F8DCF10C3FB11800000000000 boot-WfdCommon.oat
+08-17 19:47:35.337 F/google-breakpad(26227): M 74AC5000 00000000 00004000 A2EDD62E4499B2C98D8C251F0977951B0 boot-oem-services.oat
+08-17 19:47:35.337 F/google-breakpad(26227): M 74ACB000 00000000 0001C000 3794BA12A18F802DF4E8F10D4B2662FB0 boot-qcom.fmradio.oat
+08-17 19:47:35.337 F/google-breakpad(26227): M 74AE9000 00000000 00009000 C368F9A8F8DCF10C95B41800000000000 boot-qcmediaplayer.oat
+08-17 19:47:35.337 F/google-breakpad(26227): M 74AF4000 00000000 00008000 C368E898F8DCF10CDEAD1800000000000 boot-telephony-ext.oat
+08-17 19:47:35.337 F/google-breakpad(26227): M 74AFE000 00000000 00013000 C368E46FF8DCF10CA3A11800000000000 boot-dolby_ds2.oat
+08-17 19:47:35.337 F/google-breakpad(26227): M 74B13000 00000000 0000A000 C368F9E4F8DCF10C41B01800000000000 boot-dolby_ds1.oat
+08-17 19:47:35.337 F/google-breakpad(26227): M C691B000 00000000 00005000 F841612CF1D458AB70296575A996EE5F0 QPerformance.odex
+08-17 19:47:35.337 F/google-breakpad(26227): M CB91A000 00000000 00856000 000003F10000000031270A00000000000 base.odex
+08-17 19:47:35.338 F/google-breakpad(26227): M CCAF6000 00000000 00936000 00000F700000000098480B00000000000 base.odex
+08-17 19:47:35.338 F/google-breakpad(26227): M CF4C6000 00000000 02000000 000000000000000000000000000000000 dalvik-jit-code-cache (deleted)
+08-17 19:47:35.338 F/google-breakpad(26227): M D2273000 04247000 02C94000 8A2EFA0DECC3EF7057A1C62BF1AECCA80 libmonochrome.so
+08-17 19:47:35.338 F/google-breakpad(26227): M D9155000 00000000 00004000 C1741AE46077EF13F70D0DC7D8A9DDE80 libwebviewchromium_loader.so
+08-17 19:47:35.338 F/google-breakpad(26227): M D9276000 00000000 00006000 C700FED4854EA9F553FC4EB1AC49DAD50 libqdutils.so
+08-17 19:47:35.338 F/google-breakpad(26227): M D927F000 00000000 00007000 5AF3845B7F31952390092BB2318667B00 gralloc.msm8937.so
+08-17 19:47:35.338 F/google-breakpad(26227): M D926B000 00000000 00823000 A91A29ADD65BB0AF28A4C9A6208E33C40 libllvm-glnext.so
+08-17 19:47:35.338 F/google-breakpad(26227): M D9AB7000 00000000 00316000 9F7E6C49A0A8C88C317716B031320CA30 libESXGLESv2_adreno.so
+08-17 19:47:35.338 F/google-breakpad(26227): M D9F1F000 00000000 0000C000 CEC6F7F71723450F4D1E527FA1BDDA310 libqservice.so
+08-17 19:47:35.338 F/google-breakpad(26227): M D9F30000 00000000 00007000 BB9F7CD0BF1178F273EB8B4D2D5C67C30 libmemalloc.so
+08-17 19:47:35.338 F/google-breakpad(26227): M D9F39000 00000000 00003000 B4B80A1B5D6C50F5C0DD7F1C29A9F6C10 libqdMetaData.so
+08-17 19:47:35.338 F/google-breakpad(26227): M D9F43000 00000000 00009000 0BA85EA850C07E5B86AF8281EF7641E70 libcompiler_rt.so
+08-17 19:47:35.338 F/google-breakpad(26227): M D9F4E000 00000000 0000B000 362BA72B9CF73AB8BD02283F491283E40 eglSubDriverAndroid.so
+08-17 19:47:35.338 F/google-breakpad(26227): M D9F5B000 00000000 0000B000 9BAA0F603A10810D4A6BEE7A903A762F0 libGLESv2_adreno.so
+08-17 19:47:35.338 F/google-breakpad(26227): M D9F68000 00000000 00007000 C08FDBDAB5792096DB0BEDBE3D23B48D0 libGLESv1_CM_adreno.so
+08-17 19:47:35.338 F/google-breakpad(26227): M D9F71000 00000000 00024000 C346DBBCF27F603F9321CCF737B3C0550 libESXGLESv1_CM_adreno.so
+08-17 19:47:35.338 F/google-breakpad(26227): M D9F97000 00000000 00010000 A7800610AD28E2DF469D023E70516C190 libESXEGL_adreno.so
+08-17 19:47:35.339 F/google-breakpad(26227): M D9FAB000 00000000 00006000 6CC274368542A8270BC225BE519068D80 libadreno_utils.so
+08-17 19:47:35.339 F/google-breakpad(26227): M D9FBC000 00000000 00009000 649C0C218A9C0A611E5E0DB24CDD058C0 libEGL_adreno.so
+08-17 19:47:35.339 F/google-breakpad(26227): M DA4BC000 00000000 00020000 1195E0A668F3644AC0EC8D1122457A140 libkeymaster1.so
+08-17 19:47:35.339 F/google-breakpad(26227): M DA4DF000 00000000 00018000 39E3D5620A966F5DB960EEE55CCD8BB30 libsoftkeymasterdevice.so
+08-17 19:47:35.339 F/google-breakpad(26227): M DA4F9000 00000000 0001A000 C1B07DA2D52E6EC3C54992A3A953D63B0 libjavacrypto.so
+08-17 19:47:35.339 F/google-breakpad(26227): M DA516000 00000000 00004000 B051A444B9312E4DAF242DA3A951538A0 libkeystore-engine.so
+08-17 19:47:35.339 F/google-breakpad(26227): M DA51B000 00000000 00016000 1988D915061DDC4921FF608AD3E810AD0 libkeystore_binder.so
+08-17 19:47:35.339 F/google-breakpad(26227): M DA534000 00000000 0000C000 DDF063ABB28459B09548F8329934DDEB0 libkeymaster_messages.so
+08-17 19:47:35.339 F/google-breakpad(26227): M DC57D000 00000000 00016000 A686CFCA0E870C10B425EB769017BE930 libmtp.so
+08-17 19:47:35.339 F/google-breakpad(26227): M DC593000 00000000 00052000 E9F8299757E5E543C03723101E5B1BEC0 libmedia_jni.so
+08-17 19:47:35.339 F/google-breakpad(26227): M DC5E8000 00000000 00020000 ADF61BE35FF269EC7E7B32B1DDCD31E00 libexif.so
+08-17 19:47:35.339 F/google-breakpad(26227): M DC616000 00000000 0000E000 ABA3C77DD3386AE87B586632CE1979D50 libstagefright_amrnb_common.so
+08-17 19:47:35.339 F/google-breakpad(26227): M DC634000 00000000 00007000 CD70BA801CA3E12D258565013535D7440 tcmclient.odex
+08-17 19:47:35.339 F/google-breakpad(26227): M DC645000 00000000 00004000 042B2B738C75036986EB80BC08A71F060 libextmedia_jni.so
+08-17 19:47:35.339 F/google-breakpad(26227): M E1E9B000 00000000 002B2000 FCA7431984CE2AEF979FFEEF99432D320 libart-compiler.so
+08-17 19:47:35.340 F/google-breakpad(26227): M E215E000 00000000 000B1000 1EBE7A1A3E1A3134DE689251E1ABC0380 libvixl.so
+08-17 19:47:35.340 F/google-breakpad(26227): M E2264000 00000000 0002B000 6E46C8EDE63F81CC2A4375E4F85517CD0 libopenjdk.so
+08-17 19:47:35.340 F/google-breakpad(26227): M E2291000 00000000 00029000 4F845000DEA8066D684FEAB08A91A3480 libjavacore.so
+08-17 19:47:35.340 F/google-breakpad(26227): M E22BC000 00000000 00138000 523FDEBEF6ECE577AF3716E9703AD4FF0 lib-imsqimf.so
+08-17 19:47:35.340 F/google-breakpad(26227): M E23FA000 00000000 00004000 48E9F68098728AFF9A198AE7A14A7F700 libmdmdetect.so
+08-17 19:47:35.340 F/google-breakpad(26227): M E2400000 00000000 00005000 12F24D77003A5660A06BA8690696A5C30 libconfigdb.so
+08-17 19:47:35.340 F/google-breakpad(26227): M E2405000 00000000 00085000 DB9D3DADFB06F6B1AB9CEC5443F295370 lib-imsxml.so
+08-17 19:47:35.340 F/google-breakpad(26227): M E2496000 00000000 00005000 F812502D41A460BDD2D9AA83A9564CC70 libqmi_encdec.so
+08-17 19:47:35.340 F/google-breakpad(26227): M E249C000 00000000 0001C000 A53A45C88FFCD4CB3AFF323AF8FFFBAB0 libqdi.so
+08-17 19:47:35.340 F/google-breakpad(26227): M E24B7000 00000000 0006A000 D110B55DE7DB9FD5086D2D1CE57152480 libdsi_netctrl.so
+08-17 19:47:35.340 F/google-breakpad(26227): M E2534000 00000000 00023000 E7FB6A8B99C97103F258028CF27324660 lib-imsrcscm.so
+08-17 19:47:35.340 F/google-breakpad(26227): M E255A000 00000000 0001C000 5BE35B9E5D50332052532AE119C50B930 libnetmgr.so
+08-17 19:47:35.340 F/google-breakpad(26227): M E257A000 00000000 00004000 AB354652140A356C9787104C87CB30E00 libidl.so
+08-17 19:47:35.340 F/google-breakpad(26227): M E2581000 00000000 00004000 63ED38853810ED69BA1AA57CE82E74B10 libtime_genoff.so
+08-17 19:47:35.340 F/google-breakpad(26227): M E2587000 00000000 00004000 51134658113749962ABB7BA3A3C5E9740 libqmi_client_helper.so
+08-17 19:47:35.340 F/google-breakpad(26227): M E258E000 00000000 00009000 1D288EC9F32773EBC0D380D4E238D8D60 libqmi_client_qmux.so
+08-17 19:47:35.340 F/google-breakpad(26227): M E25C9000 00000000 0006A000 60BAE0DAB14BFBC4BE1805CC4CAF8B4D0 lib-imsdpl.so
+08-17 19:47:35.340 F/google-breakpad(26227): M E263D000 00000000 00019000 0333752023452FF1E40F6BA9169471500 libdiag.so
+08-17 19:47:35.341 F/google-breakpad(26227): M E274E000 00000000 0002C000 0FC3AF7C85EA4B0DA653AEA111020A2D0 libqmi.so
+08-17 19:47:35.341 F/google-breakpad(26227): M E27B7000 00000000 000B8000 023971CEF8E022AAD4090C7D1432C3690 libCB.so
+08-17 19:47:35.341 F/google-breakpad(26227): M E7D93000 00000000 00461000 39CBB6C545073B5DB56B60665F81D4B00 libart.so
+08-17 19:47:35.341 F/google-breakpad(26227): M E8384000 00000000 00001000 7691C4BE084B030B3AA118A6F412EE260 libqmi_common_so.so
+08-17 19:47:35.341 F/google-breakpad(26227): M E8387000 00000000 0000A000 37A576E22F2B9973E1734E556E1E99990 libqmi_cci.so
+08-17 19:47:35.341 F/google-breakpad(26227): M E8395000 00000000 00003000 DCDF68ACFBFC2DEFC89FA0F5783199070 libpackagelistparser.so
+08-17 19:47:35.341 F/google-breakpad(26227): M E839A000 00000000 00056000 0C1D30C5E6EA7E82800A2B00935E4B060 libharfbuzz_ng.so
+08-17 19:47:35.341 F/google-breakpad(26227): M E83F3000 00000000 00037000 8AF00237A05209C2E429D0F70ED3EB900 libopus.so
+08-17 19:47:35.341 F/google-breakpad(26227): M E842C000 00000000 00017000 215A7F63855CB46EC59B425BEDFD847D0 libminikin.so
+08-17 19:47:35.341 F/google-breakpad(26227): M E8447000 00000000 00018000 EAB4CCC4544F5D8E2ECF256D527F4A430 libutils.so
+08-17 19:47:35.341 F/google-breakpad(26227): M E8461000 00000000 0001E000 CCAA49412B791630FD4EAD7755A3E4CD0 libvorbisidec.so
+08-17 19:47:35.341 F/google-breakpad(26227): M E8481000 00000000 00008000 F3F7CCE4ADD14C5DB852DF06407AE2FA0 libcamera_metadata.so
+08-17 19:47:35.341 F/google-breakpad(26227): M E848C000 00000000 0000E000 1F6ED3D6536346B3B20CF40C5F9799D80 liblog.so
+08-17 19:47:35.341 F/google-breakpad(26227): M E849D000 00000000 00010000 D6821B30C7A106C623EEE331974C9BF50 libGLESv2.so
+08-17 19:47:35.341 F/google-breakpad(26227): M E84AF000 00000000 00014000 22B107B0382117ED603FF6000B248B8D0 libpcre.so
+08-17 19:47:35.341 F/google-breakpad(26227): M E84C4000 00000000 00040000 9CC9AFC89D88D4C4AE6AEF2E290594B70 libinputflinger.so
+08-17 19:47:35.341 F/google-breakpad(26227): M E8508000 00000000 00005000 459EC08F2C9F91A7E6AB6F293540B4510 libstdc++.so
+08-17 19:47:35.342 F/google-breakpad(26227): M E850F000 00000000 00005000 DE5A396AAF801AF9A298A50BADE143E60 libspeexresampler.so
+08-17 19:47:35.342 F/google-breakpad(26227): M E84F0000 00000000 00B36000 F1644AA2ACE475925E0DA02A814C13DF0 libLLVM.so
+08-17 19:47:35.342 F/google-breakpad(26227): M E9081000 00000000 00008000 225E121AA129BB96606A1B3B91A2737A0 libnbaio.so
+08-17 19:47:35.342 F/google-breakpad(26227): M E908C000 00000000 00017000 9A6B379EB3F10874FC241C570801C6070 libmemunreachable.so
+08-17 19:47:35.342 F/google-breakpad(26227): M E909C000 00000000 0005F000 0FAC08487B9CD62449A19C8D161E7D820 libgui.so
+08-17 19:47:35.342 F/google-breakpad(26227): M E9109000 00000000 00004000 E9B0F0A724940363FCBE11FB96B6ADF30 libnativebridge.so
+08-17 19:47:35.342 F/google-breakpad(26227): M E910D000 00000000 0007B000 B44B5897A497DCB27C105B61AC30F1180 libhwui.so
+08-17 19:47:35.342 F/google-breakpad(26227): M E918B000 00000000 0008B000 DCAB7F6AA60C5E74587E56973C6653120 libc++.so
+08-17 19:47:35.342 F/google-breakpad(26227): M E921C000 00000000 00003000 3C7CC5BEA31C9C85C9BC25EC0891B7B10 libsync.so
+08-17 19:47:35.342 F/google-breakpad(26227): M E9221000 00000000 00009000 4334A7FB3D1CB8582D4D676DE6E5E2930 libpiex.so
+08-17 19:47:35.342 F/google-breakpad(26227): M E922A000 00000000 0000E000 EBD0DA428C58F5CBD72761DD6F1C03A10 libsoundtrigger.so
+08-17 19:47:35.342 F/google-breakpad(26227): M E923D000 00000000 00020000 27C83DAE0AB0E161280BB40C384BD4BC0 libm.so
+08-17 19:47:35.342 F/google-breakpad(26227): M E925F000 00000000 00003000 C9108BAA1E466D60D4591919420BBB6A0 libradio_metadata.so
+08-17 19:47:35.342 F/google-breakpad(26227): M E9264000 00000000 0000E000 63E3F027146D592F9FBE03A33EDC8C6D0 libimg_utils.so
+08-17 19:47:35.343 F/google-breakpad(26227): M E9275000 00000000 00015000 53AF0C4E2096697687AC0081AC7AD97C0 libunwind.so
+08-17 19:47:35.343 F/google-breakpad(26227): M E92D0000 00000000 0001F000 9F74D840029038F65C040D5492CAE7360 libinput.so
+08-17 19:47:35.343 F/google-breakpad(26227): M E92F5000 00000000 00005000 17620CAE201DC01DFD868F3276E8AA810 libpowermanager.so
+08-17 19:47:35.343 F/google-breakpad(26227): M E92FD000 00000000 00055000 5E4B1D0F4D553AA92665AE0925229AF40 libsonivox.so
+08-17 19:47:35.343 F/google-breakpad(26227): M E9359000 00000000 00006000 E727B84B0F5B3D982CAE8FB6E64B88030 libtiff_directory.so
+08-17 19:47:35.343 F/google-breakpad(26227): M E9362000 00000000 00021000 52D2F4BBC71C3EE2E161E009B0331EF80 libstagefright_foundation.so
+08-17 19:47:35.343 F/google-breakpad(26227): M E9386000 00000000 0003B000 2D4A4F8139C7842165EA73A6ACD835340 libjpeg.so
+08-17 19:47:35.343 F/google-breakpad(26227): M E93C3000 00000000 00003000 9945E8F5AE0ADE1ED46FA08B41A6C9BE0 libmemtrack.so
+08-17 19:47:35.343 F/google-breakpad(26227): M E93C6000 00000000 00019000 D2D0067E628DCC03418B99399D251A990 libEGL.so
+08-17 19:47:35.343 F/google-breakpad(26227): M E93E4000 00000000 00019000 6534179E8DC7D8EDBF1236C375D51ECD0 libdrmframework.so
+08-17 19:47:35.343 F/google-breakpad(26227): M E93FB000 00000000 00110000 994744AF5261DAC7CD0003EC5456DBDF0 libicuuc.so
+08-17 19:47:35.343 F/google-breakpad(26227): M E9519000 00000000 00015000 BDA36CE4717D8C1A324C7CA4E1CA9B860 libvulkan.so
+08-17 19:47:35.343 F/google-breakpad(26227): M E9521000 00000000 000F8000 91002184018FFAC8E26ECCB238E392440 libandroid_runtime.so
+08-17 19:47:35.343 F/google-breakpad(26227): M E962A000 00000000 00004000 644559B020FD089F8180BB62CF9420590 libprocessgroup.so
+08-17 19:47:35.343 F/google-breakpad(26227): M E9629000 00000000 00183000 035813361AA690A2E08F1E059823C9D50 libicui18n.so
+08-17 19:47:35.343 F/google-breakpad(26227): M E97B8000 00000000 00008000 9D6466250A83301B3BE4CAA85227525D0 libnativeloader.so
+08-17 19:47:35.344 F/google-breakpad(26227): M E97C0000 00000000 0000E000 031F092D2D476376D52F41FD2ADD2A3E0 libradio.so
+08-17 19:47:35.344 F/google-breakpad(26227): M E97D2000 00000000 00003000 159F2CAC750E3DB60EF444F05BACCC850 libregionalization.so
+08-17 19:47:35.344 F/google-breakpad(26227): M E97D8000 00000000 00008000 16C813B71CC34E81BCF6F5DD8648DC3B0 libGLESv1_CM.so
+08-17 19:47:35.344 F/google-breakpad(26227): M E97E2000 00000000 00003000 AA06FF77B6E4CC83470C006104304D0F0 libhardware.so
+08-17 19:47:35.344 F/google-breakpad(26227): M E97E0000 00000000 00039000 B613B07CCC9703A9AAE92861C92202BD0 libcamera_client.so
+08-17 19:47:35.344 F/google-breakpad(26227): M E980D000 00000000 003A9000 42F6682A5C7E8B66743C6087B578D6C40 libskia.so
+08-17 19:47:35.344 F/google-breakpad(26227): M E9BDC000 00000000 00007000 AD9132F0D394659639CBE5858DD1BB750 libhardware_legacy.so
+08-17 19:47:35.344 F/google-breakpad(26227): M E9BE7000 00000000 00005000 EE5BF022DE057918231B46C6EDDC38690 libstagefright_yuv.so
+08-17 19:47:35.344 F/google-breakpad(26227): M E9BEE000 00000000 00007000 9BC1C9D1E638BF1B7B32AC308B08D9DA0 libimage_type_recognition.so
+08-17 19:47:35.344 F/google-breakpad(26227): M E9BF7000 00000000 0000D000 3C492E547FA88D7E2E85BD9451F613090 libbacktrace.so
+08-17 19:47:35.344 F/google-breakpad(26227): M E9C07000 00000000 00007000 B165EC37228240E1EBEDC14160C16A3A0 libnativehelper.so
+08-17 19:47:35.344 F/google-breakpad(26227): M E9C10000 00000000 0001A000 4D1780AFB25B59BBD625608B400D70C20 libprotobuf-cpp-lite.so
+08-17 19:47:35.344 F/google-breakpad(26227): M E9C2D000 00000000 00004000 989F274AF037FE14219BE6DC42503B950 libnetd_client.so
+08-17 19:47:35.344 F/google-breakpad(26227): M E9C33000 00000000 000A0000 8E23BB4E73E86B4A2AD4C17D7BAFD8A90 libcrypto.so
+08-17 19:47:35.344 F/google-breakpad(26227): M E9CE0000 00000000 00003000 675D9BCC56AB210C8017D6625F994D250 libstagefright_enc_common.so
+08-17 19:47:35.344 F/google-breakpad(26227): M E9CE5000 00000000 00024000 CC51150390EA9EFB0315C02573CCFD000 libpng.so
+08-17 19:47:35.345 F/google-breakpad(26227): M E9D0B000 00000000 0003B000 4FBF4968372FEB1C8D593076E1B171610 libRScpp.so
+08-17 19:47:35.345 F/google-breakpad(26227): M E9D49000 00000000 0000A000 415DAD77CED2441456E20CAD35C536250 libRS.so
+08-17 19:47:35.345 F/google-breakpad(26227): M E9D55000 00000000 00004000 F168A985060F7993C937719998C96FD20 libusbhost.so
+08-17 19:47:35.345 F/google-breakpad(26227): M E9D5B000 00000000 00086000 58C592B73EA51A0AFC3287247961D0940 libdng_sdk.so
+08-17 19:47:35.345 F/google-breakpad(26227): M E9DE1000 00000000 00057000 44C1EA73F38E47E95712BF5848E8937E0 libbinder.so
+08-17 19:47:35.345 F/google-breakpad(26227): M E9E3F000 00000000 0002E000 2824A9CACA3A870AD713A3405D6249530 libwilhelm.so
+08-17 19:47:35.345 F/google-breakpad(26227): M E9E72000 00000000 00030000 E9CE28F8F628E4501925FF4D0FD6168F0 libstagefright_omx.so
+08-17 19:47:35.345 F/google-breakpad(26227): M E9EA0000 00000000 00487000 3CD6A967C46ED23F4AB4B39092B43AB70 libpdfium.so
+08-17 19:47:35.345 F/google-breakpad(26227): M EA337000 00000000 00004000 76B7583F8773D45C53E165CABC841DE70 libETC1.so
+08-17 19:47:35.345 F/google-breakpad(26227): M EA33D000 00000000 00015000 F0658EC8F5FCD09AB82C2EFC3A6834210 libui.so
+08-17 19:47:35.345 F/google-breakpad(26227): M EA355000 00000000 00038000 E4F681ED6DAD0F793516317FBE3DD55A0 libRS_internal.so
+08-17 19:47:35.345 F/google-breakpad(26227): M EA390000 00000000 00016000 0DB58A0AF796EA03A43AAD505A8723310 liblzma.so
+08-17 19:47:35.345 F/google-breakpad(26227): M EA3AE000 00000000 00011000 2618247A47A298A5C4574CC818C7F3280 libselinux.so
+08-17 19:47:35.345 F/google-breakpad(26227): M EA3C1000 00000000 00005000 961542B344C4A0F54F87B49C0F1429E80 libwpa_client.so
+08-17 19:47:35.345 F/google-breakpad(26227): M EA3C8000 00000000 00007000 5FF53AA38050A1DE3BF7A4D755DC75B70 libaudioutils.so
+08-17 19:47:35.345 F/google-breakpad(26227): M EA3D1000 00000000 00017000 31235ADAF427BE11933CD87290CCAF050 libcutils.so
+08-17 19:47:35.345 F/google-breakpad(26227): M EA3EB000 00000000 00036000 CBC6DC0C255BAB785FCD0511A7CBF0690 libbcinfo.so
+08-17 19:47:35.346 F/google-breakpad(26227): M EA423000 00000000 00003000 FDA204F888F3C0D8070BFDEC834066D20 libstagefright_http_support.so
+08-17 19:47:35.346 F/google-breakpad(26227): M EA428000 00000000 00005000 14FB257C9C6F43C8FA0B475D81C47FFC0 libbinary_parse.so
+08-17 19:47:35.346 F/google-breakpad(26227): M EA42F000 00000000 00009000 93F30055C78E1D80E40A8E717405CF500 libmediautils.so
+08-17 19:47:35.346 F/google-breakpad(26227): M EA43B000 00000000 0000A000 0F98C20EB2725367604DCE7EDA8EED9D0 libbase.so
+08-17 19:47:35.346 F/google-breakpad(26227): M EA447000 00000000 00016000 DC1FEB19B377562139F4F8AAFFA610710 libz.so
+08-17 19:47:35.346 F/google-breakpad(26227): M EA460000 00000000 00015000 68F77CDFB35DA081E510A50D11F299D70 libexpat.so
+08-17 19:47:35.346 F/google-breakpad(26227): M EA45D000 00000000 000C3000 3B22B766CDBB99263CF24B4CC2986E510 libmedia.so
+08-17 19:47:35.346 F/google-breakpad(26227): M EA541000 00000000 00031000 335A60B9AA0F00A47BD5A781CCA820740 libandroidfw.so
+08-17 19:47:35.346 F/google-breakpad(26227): M EA574000 00000000 0007A000 21086BE83826AA7DC32AB49C79D5CCE30 libsqlite.so
+08-17 19:47:35.346 F/google-breakpad(26227): M EA5F2000 00000000 0006C000 6EA54A19597F20D46626700FE9F206F50 libft2.so
+08-17 19:47:35.346 F/google-breakpad(26227): M EA64F000 00000000 0016B000 4E69F13734FEABE1CA5BA98594235DCD0 libstagefright.so
+08-17 19:47:35.346 F/google-breakpad(26227): M EA7D3000 00000000 00007000 475E29D0A243BEE93EC1A630C99503FC0 libnetutils.so
+08-17 19:47:35.346 F/google-breakpad(26227): M EA7DC000 00000000 00084000 49B02E01AEC77331A1D6D19B540265610 libc.so
+08-17 19:47:35.346 F/google-breakpad(26227): M EA86E000 00000000 00025000 8B6ECC65C09CAFF5ACAAB6C9249CD2C20 libssl.so
+08-17 19:47:35.346 F/google-breakpad(26227): M EA896000 00000000 00008000 22114C778A7ED1CC3953CCB22323EA1B0 libstagefright_avc_common.so
+08-17 19:47:35.346 F/google-breakpad(26227): M EA8A1000 00000000 00003000 7FA19C935E6148BD8002A3CA630C4E6F0 libsmemlog.so
+08-17 19:47:35.346 F/google-breakpad(26227): M EA8A1000 00000000 00017000 EEAF8ABB6827B80A458A5D483E5562400 libqmiservices.so
+08-17 19:47:35.347 F/google-breakpad(26227): M EA8C1000 00000000 00008000 090640ECFC69E16A25A3E27006AF282E0 libxml.so
+08-17 19:47:35.347 F/google-breakpad(26227): M EA8CC000 00000000 00012000 67F4D476A96F053ACB61531379FCC4810 libdsutils.so
+08-17 19:47:35.347 F/google-breakpad(26227): M EA8EF000 00000000 00014000 EFD5F0A0F81252A037F1C06B8E6809700 libsdsprpc.so
+08-17 19:47:35.347 F/google-breakpad(26227): M EA905000 00000000 0003E000 C4311189AF8DA8405EDC0701CD38FC770 libgsl.so
+08-17 19:47:35.347 F/google-breakpad(26227): M EA99F000 00000000 00014000 75BC34362D3F387A08AE8241CED8E2550 libadsprpc.so
+08-17 19:47:35.347 F/google-breakpad(26227): M EA9B2000 00000000 0001A000 840BD6EAC45DEFC59D2F1E8C681CFF1A0 lib-imsrcscmclient.so
+08-17 19:47:35.347 F/google-breakpad(26227): M EA9DA000 00000000 00011000 6034A9FBADF19CE6C259DA006E8158FC0 lib-imsrcscmservice.so
+08-17 19:47:35.347 F/google-breakpad(26227): M EAA09000 00000000 00003000 7BB31E1D28279A11B8087C3F4DF7D0BA0 libqti-at.so
+08-17 19:47:35.347 F/google-breakpad(26227): M EAA0E000 00000000 0000C000 7D5A1CA22F6A85FCC57B3D36A92461560 lib-ims-rcscmjni.so
+08-17 19:47:35.347 F/google-breakpad(26227): M EAA1C000 00000000 00012000 FAD2DBDF65F36590FFE591C62DBEFA1E0 libOpenCL.so
+08-17 19:47:35.347 F/google-breakpad(26227): M EAA38000 00000000 00003000 025B4D5BBA39265D6260B27597E321730 memtrack.msm8937.so
+08-17 19:47:35.347 F/google-breakpad(26227): M EAA3D000 00000000 00011000 F5FF7C8214A82029405A068BCDF69A580 libmediandk.so
+08-17 19:47:35.347 F/google-breakpad(26227): M EAA53000 00000000 00008000 5373A05304D5AFD8BC2BB49D6C22977D0 libopenjdkjvm.so
+08-17 19:47:35.347 F/google-breakpad(26227): M EAA5C000 00000000 0000F000 96A60B84ED1352C202B6695FD32373790 libmediadrm.so
+08-17 19:47:35.347 F/google-breakpad(26227): M EAA6E000 00000000 00010000 3D880E60A39C482BA4210DA0AD4E20490 libGLESv3.so
+08-17 19:47:35.347 F/google-breakpad(26227): M EAA97000 00000000 00003000 F4CB54FA6F9A644292CE2DCC9FA89DA80 libqti_performance.so
+08-17 19:47:35.347 F/google-breakpad(26227): M EAA9D000 00000000 00004000 B2EAC3688B9EFF0E79EA2C170AA859C50 libwebviewchromium_plat_support.so
+08-17 19:47:35.348 F/google-breakpad(26227): M EAAA5000 00000000 00004000 837BE31E60CD67A2C45BF27A1E8C10140 libOpenSLES.so
+08-17 19:47:35.348 F/google-breakpad(26227): M EAAAB000 00000000 00004000 3C4D0169CD09A3AEEC0868A7FC87CCFA0 libOpenMAXAL.so
+08-17 19:47:35.348 F/google-breakpad(26227): M EAAB0000 00000000 00016000 BAF17608D25635EFA63708C89561474D0 libcamera2ndk.so
+08-17 19:47:35.348 F/google-breakpad(26227): M EAB53000 00000000 00003000 78C8F6360CF612E4333D4EB1796927460 libqti-perfd-client.so
+08-17 19:47:35.348 F/google-breakpad(26227): M EAB57000 00000000 00014000 01EE9AC4109E06B182E77B55242AEBE20 libandroid.so
+08-17 19:47:35.348 F/google-breakpad(26227): M EABAF000 00000000 00003000 4C4B6F03AF5049885FD4A43F149D13630 libjnigraphics.so
+08-17 19:47:35.348 F/google-breakpad(26227): M EABB0000 00000000 00090000 FBA40D2822A0C6DCF7CE29FB42DC37230 libmediaplayerservice.so
+08-17 19:47:35.348 F/google-breakpad(26227): M EAC7B000 00000000 0000A000 52C41240B217BFE92F7381218169FD760 liblz4.so
+08-17 19:47:35.348 F/google-breakpad(26227): M EACF9000 00000000 00038000 FEF1DA3EC5AA99E4FF38C1DF2A9A91570 libavenhancements.so
+08-17 19:47:35.348 F/google-breakpad(26227): M EAD35000 00000000 0002F000 85E4C8F7646AA02A46215564266690BA0 libstagefright_wfd.so
+08-17 19:47:35.348 F/google-breakpad(26227): M EAD6A000 00000000 00026000 7B91D8B6A15FF171BF114D8D638785D80 libstagefright_httplive.so
+08-17 19:47:35.348 F/google-breakpad(26227): M EAD94000 00000000 00003000 6DE080E13BB1741A34C157CE97277ABD0 libsigchain.so
+08-17 19:47:35.348 F/google-breakpad(26227): M EADE7000 00000000 00003000 1390052238CBD9474F1747EA0BA53C740 libExtendedExtractor.so
+08-17 19:47:35.348 F/google-breakpad(26227): M EAE32000 00000000 00006000 3B45281FC4EB699207799FD6018FBD910 libvendorconn.so
+08-17 19:47:35.348 F/google-breakpad(26227): M EAEB2000 00000000 0005F000 7AC50A488023F3DA8182906BDFFA72C10 linker
+08-17 19:47:35.348 F/google-breakpad(26227): -----END BREAKPAD MICRODUMP-----
+08-17 19:48:17.238 F/google-breakpad(26353): -----BEGIN BREAKPAD MICRODUMP-----
+08-17 19:48:17.238 F/google-breakpad(26353): V AndroidWebView:62.0.3188.0
+08-17 19:48:17.238 F/google-breakpad(26353): O A arm 08 armv8l Nokia/TA-1025_00WW/PLE:7.1.1/NMF26F/00WW_3_32C:user/release-keys
+08-17 19:48:17.238 F/google-breakpad(26353): P webview
+08-17 19:48:17.238 F/google-breakpad(26353): R 00000005 SIGTRAP 4ED50008
+08-17 19:48:17.238 F/google-breakpad(26353): G
+08-17 19:48:17.249 F/google-breakpad(26353): H 12C00000 FFF73000 00E0 31E89000 955B2000 0C:18 0D:11 0E:0B 0F:3E 10:01 11:02 12:05 13:14 14:0C 15:07 16:0F 17:1E 18:0C 19:02 1B:01 1C:02 1D:01
+08-17 19:48:17.251 F/google-breakpad(26353): S 0 C94F5C60 C94F5000 00002000
+08-17 19:48:17.251 F/google-breakpad(26353): S C94F5000 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:48:17.252 F/google-breakpad(26353): S C94F5180 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:48:17.252 F/google-breakpad(26353): S C94F5300 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:48:17.253 F/google-breakpad(26353): S C94F5480 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:48:17.253 F/google-breakpad(26353): S C94F5600 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:48:17.254 F/google-breakpad(26353): S C94F5780 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:48:17.254 F/google-breakpad(26353): S C94F5900 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:48:17.255 F/google-breakpad(26353): S C94F5A80 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:48:17.255 F/google-breakpad(26353): S C94F5C00 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005C5D4FC94C5D4FC9505D4FC98C5C4FC9EDACEF0DEDACEF0D01000000245E4FC9010000009D20FCD3EDACEF0DEDACEF0D00000000EDACEF0D02000000EDACEF0DEDACEF0DEDACEF0D0000000000000000BC5C4FC901000000000000008602000000000000EDACEF0D00000000200000000000000000002CD4000000000000000000000000000000000000000000000000EDACEF0D000000000000000000000000EDACEF0D00000000EDACEF0D0000000000000000EDACEF0D0000000000000000000000000000000020000000D05C4FC9EDACEF0D505D4FC94C5D4FC9EDACEF0DEDACEF0DD5D92BD4EDACEF0DEDACEF0DEDACEF0D0000000003000000EDACEF0D0000000002000000EDACEF0DEDACEF0DEDACEF0DB7D72BD424000000EDACEF0D
+08-17 19:48:17.256 F/google-breakpad(26353): S C94F5D80 F85D4FC9EDACEF0DEDACEF0D0200000000000000EDACEF0D000000000200000001000000EDACEF0D0200000000000000EDACEF0D000000000200000001000000EDACEF0D0000000002000000EDACEF0D0000000002000000010000000F0B00000000000000000000FFFFFFFF000000000000000000000000FFFFFFFF01000000EDACEF0D7C5E4FC9845E4FC9885E4FC9245E4FC9D85E4FC9785E4FC98F0830D4EDACEF0DEDACEF0DEDACEF0DDD7755D2EDACEF0DD85E4FC94C5E4FC9485E4FC9D85E4FC9385F4FC9745F4FC9D85E4FC900000000EDACEF0DEDACEF0DEDACEF0D3C614FC947733DD4D85E4FC9805E4FC9785E4FC901000000EDACEF0DEDACEF0DEDACEF0D018D98D200000000000000000400000000000000FFFFFFFF00000000FFFFFFFF00000000FFFFFFFF00000000FFFFFFFF070000001D00000000000000FFFFFFFF00000000FFFFFFFF00CB97D20000000001B056D2000000000000000000000000F05E4FC9A0604FC9EDACEF0D385F4FC9EDACEF0D4543A7D400000000
+08-17 19:48:17.256 F/google-breakpad(26353): S C94F5F00 08604FC9EB8E3DD4A4604FC9DF8697D2EDACEF0DE38598D2EDACEF0DEDACEF0DEDACEF0D31000000EDACEF0DEDACEF0DEDACEF0D31000000EDACEF0DFFFFFFFFFFFFFFFFFFFFFFFFEDACEF0D6C0000000000000001000000EDACEF0DEDACEF0D742F6874EDACEF0D14617274EDACEF0DEDACEF0D3100000024000000EDACEF0D31000000FFFFFFFFFFFFFFFF02000000FFFFFFFFFFFFFFFF01000000FFFFFFFFFFFFFFFFA4604FC9A0604FC934614FC9EDACEF0D4543A7D40000000008604FC93C614FC911A03DD400000000000000000C604FC9EDACEF0DEDACEF0DEDACEF0D00000000EDACEF0D00000000EDACEF0D02000000B9D89CD2EDACEF0DEDACEF0D20604FC970634FC90000000003000000EDACEF0D0000000078644FC923D89CD200000000080000000100000095CD90D2EDACEF0D4543A7D400000000EDACEF0DEDACEF0DEDACEF0DEDACEF0D000000000100000000000000EDACEF0DEDACEF0D00000000000000004543A7D400000000EDACEF0D97C090D2EDACEF0DEDACEF0D
+08-17 19:48:17.257 F/google-breakpad(26353): S C94F6080 9C604FC900000000EDACEF0D00000000EDACEF0DEDACEF0DEDACEF0DEDACEF0DEDACEF0D00604FC9EDACEF0DFFFFFFFFFFFFFFFFFFFFFFFF00000000000000000000000000614FC900000000000000000000000000000000000000000000000000000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF02000000FFFFFFFFFFFFFFFF01000000FFFFFFFFFFFFFFFF00000000000000000000000000000000000000002D000000310000000200000000000000EDACEF0DEDACEF0D000000000000000000000000EDACEF0DEDACEF0DEDACEF0DEDACEF0DEDACEF0D0000000038624FC94543A7D4EDACEF0D38624FC970634FC928624FC9EDACEF0DEDACEF0D4543A7D400000000EDACEF0D78644FC92DB773D207000000EDACEF0DEDACEF0DD9C68DD207000000B1AF56D2EDACEF0D07000000EDACEF0D65C38DD2EDACEF0D0900000009000000EDACEF0D7DF856D2EDACEF0D7D933DD4CF228BD2CF228BD2178076D2013B65D2EDACEF0D38624FC90000000078644FC98D8064D2
+08-17 19:48:17.257 F/google-breakpad(26353): S C94F6200 6E70E4D48970E4D400000000000000000000000000000000EDACEF0D000000000000000000000000EDACEF0D0000000000000000A4624FC90000000000000000EDACEF0DEDACEF0DEDACEF0D7B2B84EAEDACEF0DEDACEF0D78644FC9B97855D2EDACEF0DA4624FC9EDACEF0DEDACEF0DEDACEF0D090000000000000009000000EDACEF0DEDACEF0D0000000000000000EDACEF0DEDACEF0D0000000000000000D0654FC9EDACEF0DEDACEF0D00000000EDACEF0DEDACEF0D38634FC903000000EDACEF0DEDACEF0D78644FC93FD49CD2EDACEF0D09000000010000006B9855D2FC624FC90000000048634FC900000000EDACEF0DEDACEF0D0900000005E09CD209000000EDACEF0D0000000000000000000000000000000000000000EDACEF0D1B000000FFFFFFFF70634FC94F1B59D2EDACEF0D090000000000000000000000000000000000000025B0B6D4EDACEF0D00000000A1CE9CD20F0B000000000000EDACEF0D0200000094644FC905000000EDACEF0D000000000000000000000000
+08-17 19:48:17.257 F/google-breakpad(26353): S C94F6380 000000000000000000000000D5B0B6D425B0B6D42C0100007D933DD4CF228BD2CF228BD2178076D2013B65D20F0B0000EDACEF0DE8634FC90F0B000000000000EDACEF0DEDACEF0D0000000000000000EDACEF0D090000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000EDACEF0DEDACEF0D98644FC90000000003000000D8644FC90000000078644FC9FBC69CD20000000000000000EDACEF0D0900000088644FC9000000000000000000000000E8030000000000000000000000000000E8030000B0644FC9EDACEF0D80644FC900000000EDACEF0D00000000000000000000000000000000EDACEF0D09000000000000000000000000000000EDACEF0D0000000000000000EDACEF0D0900000000000000000000000000000000000000EDACEF0DEDACEF0D00000000EDACEF0DD0654FC965CC73D2000000000000000000000000000000000000000000000000EDACEF0D00000000D0654FC9EDACEF0D0000000000000000
+08-17 19:48:17.258 F/google-breakpad(26353): S C94F6500 0000000000000000EDACEF0D28674FC9C0654FC9EDACEF0DEDACEF0D747D92D40000000028674FC9EDACEF0D2DB773D2EDACEF0D30674FC9F0654FC9EDACEF0DEDACEF0D747D92D4000000006BB773D201010000DC654FC9EDACEF0DEDACEF0DB000000080000000EDACEF0D7B2B84EACF228BD2CF228BD2178076D2013B65D2479B9CD2DC654FC9EDACEF0D0000000007E29CD253E29CD2CF228BD2CF228BD200000000000000000000000000000000FC654FC9000000000000000000000000EDACEF0D00000000EDACEF0DF6FFFFFF00000000000000004000000000000000EDACEF0DEDACEF0D00000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000EDACEF0DC4664FC9000000000000000040684FC9EDACEF0DEDACEF0D0000000028674FC9A4664FC948674FC92842A7D4EDACEF0D28674FC9EDACEF0D5FB473D230674FC9C4664FC950674FC92842A7D40000000030674FC9
+08-17 19:48:17.258 F/google-breakpad(26353): S C94F6680 50674FC935B573D2EDACEF0DEDACEF0DEDACEF0DEDACEF0DFFFFFFFFC0664FC9020000000000000000000000000000000000000077D5BED2EDACEF0D00000000EDACEF0DEDACEF0DE4664FC9EDACEF0DB8674FC9EDACEF0D00000000000000000000000000000000EDACEF0DEDACEF0D28674FC9EDACEF0DB8674FC9EDACEF0DC8674FC928674FC970674FC92BAA73D2EDACEF0DEDACEF0D00000000EDACEF0DEDACEF0DEDACEF0DEDACEF0DEDACEF0D00000000000000000000000000000000000000007642A7D42842A7D4C9000000CF228BD2CF228BD2178076D2013B65D2479B9CD23703000001004FC900000000FFFFFFFFD0A4BDD202000000F0674FC900000000EDACEF0DEDACEF0DEDACEF0DAC674FC9FFFFFFFFE0674FC9EDACEF0D010000006B9855D2EDACEF0DEDACEF0DEDACEF0DEDACEF0DEDACEF0DEDACEF0D00000000000000000000000000000000000000007642A7D42842A7D4C9000000CF228BD2CF228BD2178076D2013B65D2479B9CD23703000001000000D34657D2
+08-17 19:48:17.259 F/google-breakpad(26353): S C94F6800 EDACEF0DEDACEF0DEDACEF0D00000000EDACEF0DEDACEF0D000000005B8173D2020000009BD47ED2CC684FC940684FC9EDACEF0D00000000CC684FC91FA773D20000000000000000EDACEF0D3100000020000000EDACEF0D0000000000000000000000000000000098684FC9EDACEF0DEDACEF0DEDACEF0D94684FC9EDACEF0D00000000CC684FC9000000006B9855D20000000000000000EDACEF0D214657D2000000000000000000000000B34557D2EDACEF0DEDACEF0DEDACEF0DEDACEF0D00000000498473D2EDACEF0DEDACEF0D00000000EDACEF0DEDACEF0D00000000CC684FC9EDACEF0DEDACEF0D20694FC978000000EDACEF0DEDACEF0DA38173D220694FC9CD2F82EA20694FC9E52F82EA28694FC9EF5C7FEA7800000000000000EDACEF0DEDACEF0DEDACEF0DEDACEF0D00000000EDACEF0DEDACEF0D00100000000000000000000000000000000000005B8173D2EDACEF0D00000000EDACEF0D0100000000000000EDACEF0D0000000070694FC920694FC91600000000000000
+08-17 19:48:17.259 F/google-breakpad(26353): S C94F6980 00000000EDACEF0D00000000EDACEF0D0000000001000000EDACEF0D0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000EDACEF0D01000000EDACEF0D000000000000000001000000EDACEF0D01000000EDACEF0D01000000EDACEF0D01000000EDACEF0D010000000100000001000000EDACEF0D01000000EDACEF0D01000000EDACEF0D01000000EDACEF0D01000000EDACEF0D00000000000000000000000000000000000000000000000001000000EDACEF0D000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:48:17.260 F/google-breakpad(26353): S C94F6B00 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:48:17.260 F/google-breakpad(26353): S C94F6C80 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:48:17.261 F/google-breakpad(26353): S C94F6E00 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:48:17.261 F/google-breakpad(26353): S C94F6F80 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:48:17.261 F/google-breakpad(26353): C 06000040000000000000000005B88FD2020000008C5C4FC9CC5C4FC9D0C16F30AC5C4FC94C5D4FC95C5D4FC9505D4FC9805E4FC9D9C5F7D3605C4FC91B89B3D28684B3D2300001680000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 19:48:17.262 F/google-breakpad(26353): M AAAAA000 00000000 00005000 8D2477F3B51997BDCC3733B8D1F920BE0 app_process32
+08-17 19:48:17.262 F/google-breakpad(26353): M 70D29000 00000000 00806000 E9166D3ED622EE65A3A4086EBEA4A7950 boot.oat
+08-17 19:48:17.262 F/google-breakpad(26353): M 71531000 00000000 006C0000 668D96384E4368B01BC9B9F365028CA20 boot-core-libart.oat
+08-17 19:48:17.262 F/google-breakpad(26353): M 71BF3000 00000000 000AA000 0D160B642FB1639805B72AC6F4DF3F380 boot-conscrypt.oat
+08-17 19:48:17.262 F/google-breakpad(26353): M 71C9F000 00000000 000D1000 9D69BDC94BD07F2468D5B7DB0AEEF0140 boot-okhttp.oat
+08-17 19:48:17.262 F/google-breakpad(26353): M 71D72000 00000000 0000C000 566CD32860A984FD445A4852058609CB0 boot-core-junit.oat
+08-17 19:48:17.262 F/google-breakpad(26353): M 71D80000 00000000 0019F000 09C1E8B1D7FC826CB75691EC5BDBA1DB0 boot-bouncycastle.oat
+08-17 19:48:17.263 F/google-breakpad(26353): M 71F21000 00000000 0014B000 069BAE4D2D7831B857A3C236021D868A0 boot-ext.oat
+08-17 19:48:17.263 F/google-breakpad(26353): M 7206E000 00000000 0223E000 D0BEBD37E215DDC845099212203F792F0 boot-framework.oat
+08-17 19:48:17.263 F/google-breakpad(26353): M 742AE000 00000000 00502000 B41E052DBA2949CE100713743053E1E40 boot-telephony-common.oat
+08-17 19:48:17.263 F/google-breakpad(26353): M 747B2000 00000000 0003D000 65E4B1E28F33F9C51062E2D0630394830 boot-voip-common.oat
+08-17 19:48:17.263 F/google-breakpad(26353): M 747F1000 00000000 00045000 EB491A6AF6568A675D81746238ACC78B0 boot-ims-common.oat
+08-17 19:48:17.263 F/google-breakpad(26353): M 74838000 00000000 0016C000 C369D6D4F8DCF10CC0AD1800000000000 boot-apache-xml.oat
+08-17 19:48:17.263 F/google-breakpad(26353): M 749A6000 00000000 000FF000 1FAC5317B0FEBD01C31E8039D76CCAF50 boot-org.apache.http.legacy.boot.oat
+08-17 19:48:17.263 F/google-breakpad(26353): M 74AA7000 00000000 00004000 C368F8D0F8DCF10C00BE1800000000000 boot-tcmiface.oat
+08-17 19:48:17.263 F/google-breakpad(26353): M 74AAD000 00000000 00016000 C368FA40F8DCF10C3FB11800000000000 boot-WfdCommon.oat
+08-17 19:48:17.263 F/google-breakpad(26353): M 74AC5000 00000000 00004000 A2EDD62E4499B2C98D8C251F0977951B0 boot-oem-services.oat
+08-17 19:48:17.263 F/google-breakpad(26353): M 74ACB000 00000000 0001C000 3794BA12A18F802DF4E8F10D4B2662FB0 boot-qcom.fmradio.oat
+08-17 19:48:17.264 F/google-breakpad(26353): M 74AE9000 00000000 00009000 C368F9A8F8DCF10C95B41800000000000 boot-qcmediaplayer.oat
+08-17 19:48:17.264 F/google-breakpad(26353): M 74AF4000 00000000 00008000 C368E898F8DCF10CDEAD1800000000000 boot-telephony-ext.oat
+08-17 19:48:17.264 F/google-breakpad(26353): M 74AFE000 00000000 00013000 C368E46FF8DCF10CA3A11800000000000 boot-dolby_ds2.oat
+08-17 19:48:17.264 F/google-breakpad(26353): M 74B13000 00000000 0000A000 C368F9E4F8DCF10C41B01800000000000 boot-dolby_ds1.oat
+08-17 19:48:17.264 F/google-breakpad(26353): M C79F1000 00000000 00005000 F841612CF1D458AB70296575A996EE5F0 QPerformance.odex
+08-17 19:48:17.264 F/google-breakpad(26353): M CBA19000 00000000 00856000 000003F10000000031270A00000000000 base.odex
+08-17 19:48:17.264 F/google-breakpad(26353): M CCAF6000 00000000 00936000 00000F700000000098480B00000000000 base.odex
+08-17 19:48:17.264 F/google-breakpad(26353): M CF4C6000 00000000 02000000 000000000000000000000000000000000 dalvik-jit-code-cache (deleted)
+08-17 19:48:17.264 F/google-breakpad(26353): M D2273000 04247000 02C94000 8A2EFA0DECC3EF7057A1C62BF1AECCA80 libmonochrome.so
+08-17 19:48:17.264 F/google-breakpad(26353): M D9155000 00000000 00004000 C1741AE46077EF13F70D0DC7D8A9DDE80 libwebviewchromium_loader.so
+08-17 19:48:17.264 F/google-breakpad(26353): M D9276000 00000000 00006000 C700FED4854EA9F553FC4EB1AC49DAD50 libqdutils.so
+08-17 19:48:17.264 F/google-breakpad(26353): M D927F000 00000000 00007000 5AF3845B7F31952390092BB2318667B00 gralloc.msm8937.so
+08-17 19:48:17.265 F/google-breakpad(26353): M D926B000 00000000 00823000 A91A29ADD65BB0AF28A4C9A6208E33C40 libllvm-glnext.so
+08-17 19:48:17.265 F/google-breakpad(26353): M D9AB7000 00000000 00316000 9F7E6C49A0A8C88C317716B031320CA30 libESXGLESv2_adreno.so
+08-17 19:48:17.265 F/google-breakpad(26353): M D9F1F000 00000000 0000C000 CEC6F7F71723450F4D1E527FA1BDDA310 libqservice.so
+08-17 19:48:17.265 F/google-breakpad(26353): M D9F30000 00000000 00007000 BB9F7CD0BF1178F273EB8B4D2D5C67C30 libmemalloc.so
+08-17 19:48:17.265 F/google-breakpad(26353): M D9F39000 00000000 00003000 B4B80A1B5D6C50F5C0DD7F1C29A9F6C10 libqdMetaData.so
+08-17 19:48:17.265 F/google-breakpad(26353): M D9F43000 00000000 00009000 0BA85EA850C07E5B86AF8281EF7641E70 libcompiler_rt.so
+08-17 19:48:17.265 F/google-breakpad(26353): M D9F4E000 00000000 0000B000 362BA72B9CF73AB8BD02283F491283E40 eglSubDriverAndroid.so
+08-17 19:48:17.265 F/google-breakpad(26353): M D9F5B000 00000000 0000B000 9BAA0F603A10810D4A6BEE7A903A762F0 libGLESv2_adreno.so
+08-17 19:48:17.265 F/google-breakpad(26353): M D9F68000 00000000 00007000 C08FDBDAB5792096DB0BEDBE3D23B48D0 libGLESv1_CM_adreno.so
+08-17 19:48:17.265 F/google-breakpad(26353): M D9F71000 00000000 00024000 C346DBBCF27F603F9321CCF737B3C0550 libESXGLESv1_CM_adreno.so
+08-17 19:48:17.265 F/google-breakpad(26353): M D9F97000 00000000 00010000 A7800610AD28E2DF469D023E70516C190 libESXEGL_adreno.so
+08-17 19:48:17.265 F/google-breakpad(26353): M D9FAB000 00000000 00006000 6CC274368542A8270BC225BE519068D80 libadreno_utils.so
+08-17 19:48:17.265 F/google-breakpad(26353): M D9FBC000 00000000 00009000 649C0C218A9C0A611E5E0DB24CDD058C0 libEGL_adreno.so
+08-17 19:48:17.266 F/google-breakpad(26353): M DA4BC000 00000000 00020000 1195E0A668F3644AC0EC8D1122457A140 libkeymaster1.so
+08-17 19:48:17.266 F/google-breakpad(26353): M DA4DF000 00000000 00018000 39E3D5620A966F5DB960EEE55CCD8BB30 libsoftkeymasterdevice.so
+08-17 19:48:17.266 F/google-breakpad(26353): M DA4F9000 00000000 0001A000 C1B07DA2D52E6EC3C54992A3A953D63B0 libjavacrypto.so
+08-17 19:48:17.266 F/google-breakpad(26353): M DA516000 00000000 00004000 B051A444B9312E4DAF242DA3A951538A0 libkeystore-engine.so
+08-17 19:48:17.266 F/google-breakpad(26353): M DA51B000 00000000 00016000 1988D915061DDC4921FF608AD3E810AD0 libkeystore_binder.so
+08-17 19:48:17.266 F/google-breakpad(26353): M DA534000 00000000 0000C000 DDF063ABB28459B09548F8329934DDEB0 libkeymaster_messages.so
+08-17 19:48:17.266 F/google-breakpad(26353): M DC57D000 00000000 00016000 A686CFCA0E870C10B425EB769017BE930 libmtp.so
+08-17 19:48:17.266 F/google-breakpad(26353): M DC593000 00000000 00052000 E9F8299757E5E543C03723101E5B1BEC0 libmedia_jni.so
+08-17 19:48:17.266 F/google-breakpad(26353): M DC5E8000 00000000 00020000 ADF61BE35FF269EC7E7B32B1DDCD31E00 libexif.so
+08-17 19:48:17.266 F/google-breakpad(26353): M DC616000 00000000 0000E000 ABA3C77DD3386AE87B586632CE1979D50 libstagefright_amrnb_common.so
+08-17 19:48:17.266 F/google-breakpad(26353): M DC634000 00000000 00007000 CD70BA801CA3E12D258565013535D7440 tcmclient.odex
+08-17 19:48:17.266 F/google-breakpad(26353): M DC645000 00000000 00004000 042B2B738C75036986EB80BC08A71F060 libextmedia_jni.so
+08-17 19:48:17.266 F/google-breakpad(26353): M E1E9B000 00000000 002B2000 FCA7431984CE2AEF979FFEEF99432D320 libart-compiler.so
+08-17 19:48:17.266 F/google-breakpad(26353): M E215E000 00000000 000B1000 1EBE7A1A3E1A3134DE689251E1ABC0380 libvixl.so
+08-17 19:48:17.267 F/google-breakpad(26353): M E2264000 00000000 0002B000 6E46C8EDE63F81CC2A4375E4F85517CD0 libopenjdk.so
+08-17 19:48:17.267 F/google-breakpad(26353): M E2291000 00000000 00029000 4F845000DEA8066D684FEAB08A91A3480 libjavacore.so
+08-17 19:48:17.267 F/google-breakpad(26353): M E22BC000 00000000 00138000 523FDEBEF6ECE577AF3716E9703AD4FF0 lib-imsqimf.so
+08-17 19:48:17.267 F/google-breakpad(26353): M E23FA000 00000000 00004000 48E9F68098728AFF9A198AE7A14A7F700 libmdmdetect.so
+08-17 19:48:17.267 F/google-breakpad(26353): M E2400000 00000000 00005000 12F24D77003A5660A06BA8690696A5C30 libconfigdb.so
+08-17 19:48:17.267 F/google-breakpad(26353): M E2405000 00000000 00085000 DB9D3DADFB06F6B1AB9CEC5443F295370 lib-imsxml.so
+08-17 19:48:17.267 F/google-breakpad(26353): M E2496000 00000000 00005000 F812502D41A460BDD2D9AA83A9564CC70 libqmi_encdec.so
+08-17 19:48:17.267 F/google-breakpad(26353): M E249C000 00000000 0001C000 A53A45C88FFCD4CB3AFF323AF8FFFBAB0 libqdi.so
+08-17 19:48:17.267 F/google-breakpad(26353): M E24B7000 00000000 0006A000 D110B55DE7DB9FD5086D2D1CE57152480 libdsi_netctrl.so
+08-17 19:48:17.267 F/google-breakpad(26353): M E2534000 00000000 00023000 E7FB6A8B99C97103F258028CF27324660 lib-imsrcscm.so
+08-17 19:48:17.267 F/google-breakpad(26353): M E255A000 00000000 0001C000 5BE35B9E5D50332052532AE119C50B930 libnetmgr.so
+08-17 19:48:17.267 F/google-breakpad(26353): M E257A000 00000000 00004000 AB354652140A356C9787104C87CB30E00 libidl.so
+08-17 19:48:17.267 F/google-breakpad(26353): M E2581000 00000000 00004000 63ED38853810ED69BA1AA57CE82E74B10 libtime_genoff.so
+08-17 19:48:17.267 F/google-breakpad(26353): M E2587000 00000000 00004000 51134658113749962ABB7BA3A3C5E9740 libqmi_client_helper.so
+08-17 19:48:17.267 F/google-breakpad(26353): M E258E000 00000000 00009000 1D288EC9F32773EBC0D380D4E238D8D60 libqmi_client_qmux.so
+08-17 19:48:17.267 F/google-breakpad(26353): M E25C9000 00000000 0006A000 60BAE0DAB14BFBC4BE1805CC4CAF8B4D0 lib-imsdpl.so
+08-17 19:48:17.267 F/google-breakpad(26353): M E263D000 00000000 00019000 0333752023452FF1E40F6BA9169471500 libdiag.so
+08-17 19:48:17.268 F/google-breakpad(26353): M E274E000 00000000 0002C000 0FC3AF7C85EA4B0DA653AEA111020A2D0 libqmi.so
+08-17 19:48:17.268 F/google-breakpad(26353): M E27B7000 00000000 000B8000 023971CEF8E022AAD4090C7D1432C3690 libCB.so
+08-17 19:48:17.268 F/google-breakpad(26353): M E7D93000 00000000 00461000 39CBB6C545073B5DB56B60665F81D4B00 libart.so
+08-17 19:48:17.268 F/google-breakpad(26353): M E8384000 00000000 00001000 7691C4BE084B030B3AA118A6F412EE260 libqmi_common_so.so
+08-17 19:48:17.268 F/google-breakpad(26353): M E8387000 00000000 0000A000 37A576E22F2B9973E1734E556E1E99990 libqmi_cci.so
+08-17 19:48:17.268 F/google-breakpad(26353): M E8395000 00000000 00003000 DCDF68ACFBFC2DEFC89FA0F5783199070 libpackagelistparser.so
+08-17 19:48:17.268 F/google-breakpad(26353): M E839A000 00000000 00056000 0C1D30C5E6EA7E82800A2B00935E4B060 libharfbuzz_ng.so
+08-17 19:48:17.268 F/google-breakpad(26353): M E83F3000 00000000 00037000 8AF00237A05209C2E429D0F70ED3EB900 libopus.so
+08-17 19:48:17.268 F/google-breakpad(26353): M E842C000 00000000 00017000 215A7F63855CB46EC59B425BEDFD847D0 libminikin.so
+08-17 19:48:17.268 F/google-breakpad(26353): M E8447000 00000000 00018000 EAB4CCC4544F5D8E2ECF256D527F4A430 libutils.so
+08-17 19:48:17.268 F/google-breakpad(26353): M E8461000 00000000 0001E000 CCAA49412B791630FD4EAD7755A3E4CD0 libvorbisidec.so
+08-17 19:48:17.268 F/google-breakpad(26353): M E8481000 00000000 00008000 F3F7CCE4ADD14C5DB852DF06407AE2FA0 libcamera_metadata.so
+08-17 19:48:17.268 F/google-breakpad(26353): M E848C000 00000000 0000E000 1F6ED3D6536346B3B20CF40C5F9799D80 liblog.so
+08-17 19:48:17.268 F/google-breakpad(26353): M E849D000 00000000 00010000 D6821B30C7A106C623EEE331974C9BF50 libGLESv2.so
+08-17 19:48:17.268 F/google-breakpad(26353): M E84AF000 00000000 00014000 22B107B0382117ED603FF6000B248B8D0 libpcre.so
+08-17 19:48:17.268 F/google-breakpad(26353): M E84C4000 00000000 00040000 9CC9AFC89D88D4C4AE6AEF2E290594B70 libinputflinger.so
+08-17 19:48:17.268 F/google-breakpad(26353): M E8508000 00000000 00005000 459EC08F2C9F91A7E6AB6F293540B4510 libstdc++.so
+08-17 19:48:17.269 F/google-breakpad(26353): M E850F000 00000000 00005000 DE5A396AAF801AF9A298A50BADE143E60 libspeexresampler.so
+08-17 19:48:17.269 F/google-breakpad(26353): M E84F0000 00000000 00B36000 F1644AA2ACE475925E0DA02A814C13DF0 libLLVM.so
+08-17 19:48:17.269 F/google-breakpad(26353): M E9081000 00000000 00008000 225E121AA129BB96606A1B3B91A2737A0 libnbaio.so
+08-17 19:48:17.269 F/google-breakpad(26353): M E908C000 00000000 00017000 9A6B379EB3F10874FC241C570801C6070 libmemunreachable.so
+08-17 19:48:17.269 F/google-breakpad(26353): M E909C000 00000000 0005F000 0FAC08487B9CD62449A19C8D161E7D820 libgui.so
+08-17 19:48:17.269 F/google-breakpad(26353): M E9109000 00000000 00004000 E9B0F0A724940363FCBE11FB96B6ADF30 libnativebridge.so
+08-17 19:48:17.269 F/google-breakpad(26353): M E910D000 00000000 0007B000 B44B5897A497DCB27C105B61AC30F1180 libhwui.so
+08-17 19:48:17.269 F/google-breakpad(26353): M E918B000 00000000 0008B000 DCAB7F6AA60C5E74587E56973C6653120 libc++.so
+08-17 19:48:17.269 F/google-breakpad(26353): M E921C000 00000000 00003000 3C7CC5BEA31C9C85C9BC25EC0891B7B10 libsync.so
+08-17 19:48:17.269 F/google-breakpad(26353): M E9221000 00000000 00009000 4334A7FB3D1CB8582D4D676DE6E5E2930 libpiex.so
+08-17 19:48:17.269 F/google-breakpad(26353): M E922A000 00000000 0000E000 EBD0DA428C58F5CBD72761DD6F1C03A10 libsoundtrigger.so
+08-17 19:48:17.269 F/google-breakpad(26353): M E923D000 00000000 00020000 27C83DAE0AB0E161280BB40C384BD4BC0 libm.so
+08-17 19:48:17.269 F/google-breakpad(26353): M E925F000 00000000 00003000 C9108BAA1E466D60D4591919420BBB6A0 libradio_metadata.so
+08-17 19:48:17.270 F/google-breakpad(26353): M E9264000 00000000 0000E000 63E3F027146D592F9FBE03A33EDC8C6D0 libimg_utils.so
+08-17 19:48:17.270 F/google-breakpad(26353): M E9275000 00000000 00015000 53AF0C4E2096697687AC0081AC7AD97C0 libunwind.so
+08-17 19:48:17.270 F/google-breakpad(26353): M E92D0000 00000000 0001F000 9F74D840029038F65C040D5492CAE7360 libinput.so
+08-17 19:48:17.270 F/google-breakpad(26353): M E92F5000 00000000 00005000 17620CAE201DC01DFD868F3276E8AA810 libpowermanager.so
+08-17 19:48:17.270 F/google-breakpad(26353): M E92FD000 00000000 00055000 5E4B1D0F4D553AA92665AE0925229AF40 libsonivox.so
+08-17 19:48:17.270 F/google-breakpad(26353): M E9359000 00000000 00006000 E727B84B0F5B3D982CAE8FB6E64B88030 libtiff_directory.so
+08-17 19:48:17.270 F/google-breakpad(26353): M E9362000 00000000 00021000 52D2F4BBC71C3EE2E161E009B0331EF80 libstagefright_foundation.so
+08-17 19:48:17.270 F/google-breakpad(26353): M E9386000 00000000 0003B000 2D4A4F8139C7842165EA73A6ACD835340 libjpeg.so
+08-17 19:48:17.270 F/google-breakpad(26353): M E93C3000 00000000 00003000 9945E8F5AE0ADE1ED46FA08B41A6C9BE0 libmemtrack.so
+08-17 19:48:17.270 F/google-breakpad(26353): M E93C6000 00000000 00019000 D2D0067E628DCC03418B99399D251A990 libEGL.so
+08-17 19:48:17.270 F/google-breakpad(26353): M E93E4000 00000000 00019000 6534179E8DC7D8EDBF1236C375D51ECD0 libdrmframework.so
+08-17 19:48:17.270 F/google-breakpad(26353): M E93FB000 00000000 00110000 994744AF5261DAC7CD0003EC5456DBDF0 libicuuc.so
+08-17 19:48:17.270 F/google-breakpad(26353): M E9519000 00000000 00015000 BDA36CE4717D8C1A324C7CA4E1CA9B860 libvulkan.so
+08-17 19:48:17.270 F/google-breakpad(26353): M E9521000 00000000 000F8000 91002184018FFAC8E26ECCB238E392440 libandroid_runtime.so
+08-17 19:48:17.271 F/google-breakpad(26353): M E962A000 00000000 00004000 644559B020FD089F8180BB62CF9420590 libprocessgroup.so
+08-17 19:48:17.271 F/google-breakpad(26353): M E9629000 00000000 00183000 035813361AA690A2E08F1E059823C9D50 libicui18n.so
+08-17 19:48:17.271 F/google-breakpad(26353): M E97B8000 00000000 00008000 9D6466250A83301B3BE4CAA85227525D0 libnativeloader.so
+08-17 19:48:17.271 F/google-breakpad(26353): M E97C0000 00000000 0000E000 031F092D2D476376D52F41FD2ADD2A3E0 libradio.so
+08-17 19:48:17.271 F/google-breakpad(26353): M E97D2000 00000000 00003000 159F2CAC750E3DB60EF444F05BACCC850 libregionalization.so
+08-17 19:48:17.271 F/google-breakpad(26353): M E97D8000 00000000 00008000 16C813B71CC34E81BCF6F5DD8648DC3B0 libGLESv1_CM.so
+08-17 19:48:17.271 F/google-breakpad(26353): M E97E2000 00000000 00003000 AA06FF77B6E4CC83470C006104304D0F0 libhardware.so
+08-17 19:48:17.271 F/google-breakpad(26353): M E97E0000 00000000 00039000 B613B07CCC9703A9AAE92861C92202BD0 libcamera_client.so
+08-17 19:48:17.271 F/google-breakpad(26353): M E980D000 00000000 003A9000 42F6682A5C7E8B66743C6087B578D6C40 libskia.so
+08-17 19:48:17.271 F/google-breakpad(26353): M E9BDC000 00000000 00007000 AD9132F0D394659639CBE5858DD1BB750 libhardware_legacy.so
+08-17 19:48:17.271 F/google-breakpad(26353): M E9BE7000 00000000 00005000 EE5BF022DE057918231B46C6EDDC38690 libstagefright_yuv.so
+08-17 19:48:17.271 F/google-breakpad(26353): M E9BEE000 00000000 00007000 9BC1C9D1E638BF1B7B32AC308B08D9DA0 libimage_type_recognition.so
+08-17 19:48:17.271 F/google-breakpad(26353): M E9BF7000 00000000 0000D000 3C492E547FA88D7E2E85BD9451F613090 libbacktrace.so
+08-17 19:48:17.271 F/google-breakpad(26353): M E9C07000 00000000 00007000 B165EC37228240E1EBEDC14160C16A3A0 libnativehelper.so
+08-17 19:48:17.271 F/google-breakpad(26353): M E9C10000 00000000 0001A000 4D1780AFB25B59BBD625608B400D70C20 libprotobuf-cpp-lite.so
+08-17 19:48:17.271 F/google-breakpad(26353): M E9C2D000 00000000 00004000 989F274AF037FE14219BE6DC42503B950 libnetd_client.so
+08-17 19:48:17.272 F/google-breakpad(26353): M E9C33000 00000000 000A0000 8E23BB4E73E86B4A2AD4C17D7BAFD8A90 libcrypto.so
+08-17 19:48:17.272 F/google-breakpad(26353): M E9CE0000 00000000 00003000 675D9BCC56AB210C8017D6625F994D250 libstagefright_enc_common.so
+08-17 19:48:17.272 F/google-breakpad(26353): M E9CE5000 00000000 00024000 CC51150390EA9EFB0315C02573CCFD000 libpng.so
+08-17 19:48:17.272 F/google-breakpad(26353): M E9D0B000 00000000 0003B000 4FBF4968372FEB1C8D593076E1B171610 libRScpp.so
+08-17 19:48:17.272 F/google-breakpad(26353): M E9D49000 00000000 0000A000 415DAD77CED2441456E20CAD35C536250 libRS.so
+08-17 19:48:17.272 F/google-breakpad(26353): M E9D55000 00000000 00004000 F168A985060F7993C937719998C96FD20 libusbhost.so
+08-17 19:48:17.272 F/google-breakpad(26353): M E9D5B000 00000000 00086000 58C592B73EA51A0AFC3287247961D0940 libdng_sdk.so
+08-17 19:48:17.272 F/google-breakpad(26353): M E9DE1000 00000000 00057000 44C1EA73F38E47E95712BF5848E8937E0 libbinder.so
+08-17 19:48:17.272 F/google-breakpad(26353): M E9E3F000 00000000 0002E000 2824A9CACA3A870AD713A3405D6249530 libwilhelm.so
+08-17 19:48:17.272 F/google-breakpad(26353): M E9E72000 00000000 00030000 E9CE28F8F628E4501925FF4D0FD6168F0 libstagefright_omx.so
+08-17 19:48:17.272 F/google-breakpad(26353): M E9EA0000 00000000 00487000 3CD6A967C46ED23F4AB4B39092B43AB70 libpdfium.so
+08-17 19:48:17.272 F/google-breakpad(26353): M EA337000 00000000 00004000 76B7583F8773D45C53E165CABC841DE70 libETC1.so
+08-17 19:48:17.272 F/google-breakpad(26353): M EA33D000 00000000 00015000 F0658EC8F5FCD09AB82C2EFC3A6834210 libui.so
+08-17 19:48:17.272 F/google-breakpad(26353): M EA355000 00000000 00038000 E4F681ED6DAD0F793516317FBE3DD55A0 libRS_internal.so
+08-17 19:48:17.272 F/google-breakpad(26353): M EA390000 00000000 00016000 0DB58A0AF796EA03A43AAD505A8723310 liblzma.so
+08-17 19:48:17.273 F/google-breakpad(26353): M EA3AE000 00000000 00011000 2618247A47A298A5C4574CC818C7F3280 libselinux.so
+08-17 19:48:17.273 F/google-breakpad(26353): M EA3C1000 00000000 00005000 961542B344C4A0F54F87B49C0F1429E80 libwpa_client.so
+08-17 19:48:17.273 F/google-breakpad(26353): M EA3C8000 00000000 00007000 5FF53AA38050A1DE3BF7A4D755DC75B70 libaudioutils.so
+08-17 19:48:17.273 F/google-breakpad(26353): M EA3D1000 00000000 00017000 31235ADAF427BE11933CD87290CCAF050 libcutils.so
+08-17 19:48:17.273 F/google-breakpad(26353): M EA3EB000 00000000 00036000 CBC6DC0C255BAB785FCD0511A7CBF0690 libbcinfo.so
+08-17 19:48:17.273 F/google-breakpad(26353): M EA423000 00000000 00003000 FDA204F888F3C0D8070BFDEC834066D20 libstagefright_http_support.so
+08-17 19:48:17.273 F/google-breakpad(26353): M EA428000 00000000 00005000 14FB257C9C6F43C8FA0B475D81C47FFC0 libbinary_parse.so
+08-17 19:48:17.273 F/google-breakpad(26353): M EA42F000 00000000 00009000 93F30055C78E1D80E40A8E717405CF500 libmediautils.so
+08-17 19:48:17.273 F/google-breakpad(26353): M EA43B000 00000000 0000A000 0F98C20EB2725367604DCE7EDA8EED9D0 libbase.so
+08-17 19:48:17.273 F/google-breakpad(26353): M EA447000 00000000 00016000 DC1FEB19B377562139F4F8AAFFA610710 libz.so
+08-17 19:48:17.273 F/google-breakpad(26353): M EA460000 00000000 00015000 68F77CDFB35DA081E510A50D11F299D70 libexpat.so
+08-17 19:48:17.273 F/google-breakpad(26353): M EA45D000 00000000 000C3000 3B22B766CDBB99263CF24B4CC2986E510 libmedia.so
+08-17 19:48:17.273 F/google-breakpad(26353): M EA541000 00000000 00031000 335A60B9AA0F00A47BD5A781CCA820740 libandroidfw.so
+08-17 19:48:17.273 F/google-breakpad(26353): M EA574000 00000000 0007A000 21086BE83826AA7DC32AB49C79D5CCE30 libsqlite.so
+08-17 19:48:17.273 F/google-breakpad(26353): M EA5F2000 00000000 0006C000 6EA54A19597F20D46626700FE9F206F50 libft2.so
+08-17 19:48:17.273 F/google-breakpad(26353): M EA64F000 00000000 0016B000 4E69F13734FEABE1CA5BA98594235DCD0 libstagefright.so
+08-17 19:48:17.273 F/google-breakpad(26353): M EA7D3000 00000000 00007000 475E29D0A243BEE93EC1A630C99503FC0 libnetutils.so
+08-17 19:48:17.274 F/google-breakpad(26353): M EA7DC000 00000000 00084000 49B02E01AEC77331A1D6D19B540265610 libc.so
+08-17 19:48:17.274 F/google-breakpad(26353): M EA86E000 00000000 00025000 8B6ECC65C09CAFF5ACAAB6C9249CD2C20 libssl.so
+08-17 19:48:17.274 F/google-breakpad(26353): M EA896000 00000000 00008000 22114C778A7ED1CC3953CCB22323EA1B0 libstagefright_avc_common.so
+08-17 19:48:17.274 F/google-breakpad(26353): M EA8A1000 00000000 00003000 7FA19C935E6148BD8002A3CA630C4E6F0 libsmemlog.so
+08-17 19:48:17.274 F/google-breakpad(26353): M EA8A1000 00000000 00017000 EEAF8ABB6827B80A458A5D483E5562400 libqmiservices.so
+08-17 19:48:17.274 F/google-breakpad(26353): M EA8C1000 00000000 00008000 090640ECFC69E16A25A3E27006AF282E0 libxml.so
+08-17 19:48:17.274 F/google-breakpad(26353): M EA8CC000 00000000 00012000 67F4D476A96F053ACB61531379FCC4810 libdsutils.so
+08-17 19:48:17.274 F/google-breakpad(26353): M EA8EF000 00000000 00014000 EFD5F0A0F81252A037F1C06B8E6809700 libsdsprpc.so
+08-17 19:48:17.274 F/google-breakpad(26353): M EA905000 00000000 0003E000 C4311189AF8DA8405EDC0701CD38FC770 libgsl.so
+08-17 19:48:17.274 F/google-breakpad(26353): M EA99F000 00000000 00014000 75BC34362D3F387A08AE8241CED8E2550 libadsprpc.so
+08-17 19:48:17.274 F/google-breakpad(26353): M EA9B2000 00000000 0001A000 840BD6EAC45DEFC59D2F1E8C681CFF1A0 lib-imsrcscmclient.so
+08-17 19:48:17.274 F/google-breakpad(26353): M EA9DA000 00000000 00011000 6034A9FBADF19CE6C259DA006E8158FC0 lib-imsrcscmservice.so
+08-17 19:48:17.274 F/google-breakpad(26353): M EAA09000 00000000 00003000 7BB31E1D28279A11B8087C3F4DF7D0BA0 libqti-at.so
+08-17 19:48:17.274 F/google-breakpad(26353): M EAA0E000 00000000 0000C000 7D5A1CA22F6A85FCC57B3D36A92461560 lib-ims-rcscmjni.so
+08-17 19:48:17.274 F/google-breakpad(26353): M EAA1C000 00000000 00012000 FAD2DBDF65F36590FFE591C62DBEFA1E0 libOpenCL.so
+08-17 19:48:17.274 F/google-breakpad(26353): M EAA38000 00000000 00003000 025B4D5BBA39265D6260B27597E321730 memtrack.msm8937.so
+08-17 19:48:17.274 F/google-breakpad(26353): M EAA3D000 00000000 00011000 F5FF7C8214A82029405A068BCDF69A580 libmediandk.so
+08-17 19:48:17.274 F/google-breakpad(26353): M EAA53000 00000000 00008000 5373A05304D5AFD8BC2BB49D6C22977D0 libopenjdkjvm.so
+08-17 19:48:17.275 F/google-breakpad(26353): M EAA5C000 00000000 0000F000 96A60B84ED1352C202B6695FD32373790 libmediadrm.so
+08-17 19:48:17.275 F/google-breakpad(26353): M EAA6E000 00000000 00010000 3D880E60A39C482BA4210DA0AD4E20490 libGLESv3.so
+08-17 19:48:17.275 F/google-breakpad(26353): M EAA97000 00000000 00003000 F4CB54FA6F9A644292CE2DCC9FA89DA80 libqti_performance.so
+08-17 19:48:17.275 F/google-breakpad(26353): M EAA9D000 00000000 00004000 B2EAC3688B9EFF0E79EA2C170AA859C50 libwebviewchromium_plat_support.so
+08-17 19:48:17.275 F/google-breakpad(26353): M EAAA5000 00000000 00004000 837BE31E60CD67A2C45BF27A1E8C10140 libOpenSLES.so
+08-17 19:48:17.275 F/google-breakpad(26353): M EAAAB000 00000000 00004000 3C4D0169CD09A3AEEC0868A7FC87CCFA0 libOpenMAXAL.so
+08-17 19:48:17.275 F/google-breakpad(26353): M EAAB0000 00000000 00016000 BAF17608D25635EFA63708C89561474D0 libcamera2ndk.so
+08-17 19:48:17.275 F/google-breakpad(26353): M EAB53000 00000000 00003000 78C8F6360CF612E4333D4EB1796927460 libqti-perfd-client.so
+08-17 19:48:17.275 F/google-breakpad(26353): M EAB57000 00000000 00014000 01EE9AC4109E06B182E77B55242AEBE20 libandroid.so
+08-17 19:48:17.275 F/google-breakpad(26353): M EABAF000 00000000 00003000 4C4B6F03AF5049885FD4A43F149D13630 libjnigraphics.so
+08-17 19:48:17.275 F/google-breakpad(26353): M EABB0000 00000000 00090000 FBA40D2822A0C6DCF7CE29FB42DC37230 libmediaplayerservice.so
+08-17 19:48:17.275 F/google-breakpad(26353): M EAC7B000 00000000 0000A000 52C41240B217BFE92F7381218169FD760 liblz4.so
+08-17 19:48:17.275 F/google-breakpad(26353): M EACF9000 00000000 00038000 FEF1DA3EC5AA99E4FF38C1DF2A9A91570 libavenhancements.so
+08-17 19:48:17.275 F/google-breakpad(26353): M EAD35000 00000000 0002F000 85E4C8F7646AA02A46215564266690BA0 libstagefright_wfd.so
+08-17 19:48:17.275 F/google-breakpad(26353): M EAD6A000 00000000 00026000 7B91D8B6A15FF171BF114D8D638785D80 libstagefright_httplive.so
+08-17 19:48:17.275 F/google-breakpad(26353): M EAD94000 00000000 00003000 6DE080E13BB1741A34C157CE97277ABD0 libsigchain.so
+08-17 19:48:17.275 F/google-breakpad(26353): M EADE7000 00000000 00003000 1390052238CBD9474F1747EA0BA53C740 libExtendedExtractor.so
+08-17 19:48:17.276 F/google-breakpad(26353): M EAE32000 00000000 00006000 3B45281FC4EB699207799FD6018FBD910 libvendorconn.so
+08-17 19:48:17.276 F/google-breakpad(26353): M EAEB2000 00000000 0005F000 7AC50A488023F3DA8182906BDFFA72C10 linker
+08-17 19:48:17.276 F/google-breakpad(26353): -----END BREAKPAD MICRODUMP-----
+08-17 20:31:35.553 W/google-breakpad( 2783): Output crash dump file:
+08-17 20:31:35.553 W/google-breakpad( 2783): /data/user/0/com.devhd.feedly/cache/WebView/Crash Reports/43961460-fc25-4f3e-8f3e429a-43a548d8.dmp
+08-17 20:31:35.554 W/google-breakpad( 2783): ### ### ### ### ### ### ### ### ### ### ### ### ###
+08-17 20:31:35.554 W/google-breakpad( 2783): Chrome build fingerprint:
+08-17 20:31:35.554 W/google-breakpad( 2783): 37.3.0
+08-17 20:31:35.554 W/google-breakpad( 2783): 668
+08-17 20:31:35.554 W/google-breakpad( 2783): ### ### ### ### ### ### ### ### ### ### ### ### ###
+08-17 20:31:35.709 F/google-breakpad( 2913): -----BEGIN BREAKPAD MICRODUMP-----
+08-17 20:31:35.709 F/google-breakpad( 2913): V AndroidWebView:62.0.3188.0
+08-17 20:31:35.709 F/google-breakpad( 2913): O A arm 08 armv8l Nokia/TA-1025_00WW/PLE:7.1.1/NMF26F/00WW_3_32C:user/release-keys
+08-17 20:31:35.709 F/google-breakpad( 2913): P webview
+08-17 20:31:35.709 F/google-breakpad( 2913): R 00000005 SIGTRAP 00000000
+08-17 20:31:35.709 F/google-breakpad( 2913): G
+08-17 20:31:35.718 F/google-breakpad( 2913): H 12C00000 FFF73000 00B3 31E89000 9A70D000 0C:10 0D:0D 0E:06 0F:27 10:04 11:04 12:05 13:0B 14:06 15:11 16:0D 17:17 18:10 19:02 1B:01 1C:02 1D:01
+08-17 20:31:35.718 F/google-breakpad( 2913): S 0 C96F4C60 C96F4000 00002000
+08-17 20:31:35.719 F/google-breakpad( 2913): S C96F4000 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 20:31:35.719 F/google-breakpad( 2913): S C96F4180 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 20:31:35.720 F/google-breakpad( 2913): S C96F4300 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 20:31:35.720 F/google-breakpad( 2913): S C96F4480 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 20:31:35.721 F/google-breakpad( 2913): S C96F4600 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 20:31:35.721 F/google-breakpad( 2913): S C96F4780 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 20:31:35.722 F/google-breakpad( 2913): S C96F4900 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 20:31:35.722 F/google-breakpad( 2913): S C96F4A80 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 20:31:35.723 F/google-breakpad( 2913): S C96F4C00 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005C4D6FC94C4D6FC9504D6FC98C4C6FC9EDACEF0DEDACEF0D01000000244E6FC9010000009D20FCD3EDACEF0DEDACEF0D00000000EDACEF0D02000000EDACEF0DEDACEF0DEDACEF0D0000000000000000BC4C6FC90100000000000000DA01000000000000EDACEF0D00000000200000000000000000002CD4000000000000000000000000000000000000000000000000EDACEF0D000000000000000000000000EDACEF0D00000000EDACEF0D0000000000000000EDACEF0D0000000000000000000000000000000020000000D04C6FC9EDACEF0D504D6FC94C4D6FC9EDACEF0DEDACEF0DD5D92BD4EDACEF0DEDACEF0DEDACEF0D0000000003000000EDACEF0D0000000002000000EDACEF0DEDACEF0DEDACEF0DB7D72BD424000000EDACEF0D
+08-17 20:31:35.723 F/google-breakpad( 2913): S C96F4D80 F84D6FC9EDACEF0DEDACEF0D0200000000000000EDACEF0D000000000200000001000000EDACEF0D0200000000000000EDACEF0D000000000200000001000000EDACEF0D0000000002000000EDACEF0D000000000200000001000000230900000000000000000000FFFFFFFF000000000000000000000000FFFFFFFF01000000EDACEF0D7C4E6FC9844E6FC9884E6FC9244E6FC9D84E6FC9784E6FC98F0830D4EDACEF0DEDACEF0DEDACEF0DDD7755D2EDACEF0DD84E6FC94C4E6FC9484E6FC9D84E6FC9384F6FC9744F6FC9D84E6FC900000000EDACEF0DEDACEF0DEDACEF0D3C516FC947733DD4D84E6FC9804E6FC9784E6FC901000000EDACEF0DEDACEF0DEDACEF0D018D98D200000000000000000400000000000000FFFFFFFF00000000FFFFFFFF00000000FFFFFFFF00000000FFFFFFFF070000001D00000000000000FFFFFFFF00000000FFFFFFFF00CB97D20000000001B056D2000000000000000000000000F04E6FC9A0506FC9EDACEF0D384F6FC9EDACEF0D4543A7D400000000
+08-17 20:31:35.724 F/google-breakpad( 2913): S C96F4F00 08506FC9EB8E3DD4A4506FC9DF8697D2EDACEF0DE38598D2EDACEF0DEDACEF0DEDACEF0D31000000EDACEF0DEDACEF0DEDACEF0D31000000EDACEF0DFFFFFFFFFFFFFFFFFFFFFFFFEDACEF0D6C0000000000000001000000EDACEF0DEDACEF0D742F6874EDACEF0D14617274EDACEF0DEDACEF0D3100000024000000EDACEF0D31000000FFFFFFFFFFFFFFFF02000000FFFFFFFFFFFFFFFF01000000FFFFFFFFFFFFFFFFA4506FC9A0506FC934516FC9EDACEF0D4543A7D40000000008506FC93C516FC911A03DD400000000000000000C506FC9EDACEF0DEDACEF0DEDACEF0D00000000EDACEF0D00000000EDACEF0D02000000B9D89CD2EDACEF0DEDACEF0D20506FC970536FC90000000003000000EDACEF0D0000000078546FC923D89CD200000000080000000100000095CD90D2EDACEF0D4543A7D400000000EDACEF0DEDACEF0DEDACEF0DEDACEF0D000000000100000000000000EDACEF0DEDACEF0D00000000000000004543A7D400000000EDACEF0D97C090D2EDACEF0DEDACEF0D
+08-17 20:31:35.724 F/google-breakpad( 2913): S C96F5080 9C506FC900000000EDACEF0D00000000EDACEF0DEDACEF0DEDACEF0DEDACEF0DEDACEF0D00506FC9EDACEF0DFFFFFFFFFFFFFFFFFFFFFFFF00000000000000000000000000516FC900000000000000000000000000000000000000000000000000000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF02000000FFFFFFFFFFFFFFFF01000000FFFFFFFFFFFFFFFF00000000000000000000000000000000000000002D000000310000000200000000000000EDACEF0DEDACEF0D000000000000000000000000EDACEF0DEDACEF0DEDACEF0DEDACEF0DEDACEF0D0000000038526FC94543A7D4EDACEF0D38526FC970536FC928526FC9EDACEF0DEDACEF0D4543A7D400000000EDACEF0D78546FC92DB773D2EDACEF0DEDACEF0DD9C68DD2F1C68DD2EDACEF0D07000000EDACEF0DD9C68DD20700000065C38DD2EDACEF0D0900000009000000EDACEF0D7DF856D2EDACEF0D7D933DD4CF228BD2CF228BD2178076D2013B65D2EDACEF0D38526FC90000000078546FC98D8064D2
+08-17 20:31:35.725 F/google-breakpad( 2913): S C96F5200 6E70E4D48970E4D400000000000000000000000000000000EDACEF0D000000000000000000000000EDACEF0D0000000000000000A4526FC90000000000000000EDACEF0DEDACEF0DEDACEF0D7B2B84EAEDACEF0DEDACEF0D78546FC9B97855D2EDACEF0DA4526FC9EDACEF0DEDACEF0DEDACEF0D090000000000000009000000EDACEF0DEDACEF0D0000000000000000EDACEF0DEDACEF0D0000000000000000D0556FC9EDACEF0DEDACEF0D00000000EDACEF0DEDACEF0D38536FC903000000EDACEF0DEDACEF0D78546FC93FD49CD2EDACEF0D09000000EDACEF0DEDACEF0DEDACEF0DEDACEF0DEDACEF0D0100000000000000F9C973D20900000005E09CD209000000EDACEF0D0000000000000000000000000000000000000000EDACEF0D1C000000FFFFFFFF70536FC94F1B59D2EDACEF0D090000000000000000000000000000000000000025B0B6D4EDACEF0D00000000A1CE9CD22209000000000000EDACEF0D0200000094546FC905000000EDACEF0D000000000000000000000000
+08-17 20:31:35.725 F/google-breakpad( 2913): S C96F5380 000000000000000000000000D5B0B6D425B0B6D42C0100007D933DD4CF228BD2CF228BD2178076D2013B65D222090000EDACEF0DE8536FC92209000000000000EDACEF0DEDACEF0D0000000000000000EDACEF0D090000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000EDACEF0DEDACEF0D98546FC90000000003000000D8546FC90000000078546FC9FBC69CD20000000000000000EDACEF0D0900000088546FC9000000000000000000000000E8030000000000000000000000000000E8030000B0546FC9EDACEF0D80546FC900000000EDACEF0D00000000000000000000000000000000EDACEF0D09000000000000000000000000000000EDACEF0D0000000000000000EDACEF0D0900000000000000000000000000000000000000EDACEF0DEDACEF0D00000000EDACEF0DD0556FC965CC73D2000000000000000000000000000000000000000000000000EDACEF0D00000000D0556FC9EDACEF0D0000000000000000
+08-17 20:31:35.726 F/google-breakpad( 2913): S C96F5500 0000000000000000EDACEF0D28576FC9C0556FC9EDACEF0DEDACEF0D747D92D40000000028576FC9EDACEF0D2DB773D2EDACEF0D30576FC9F0556FC9EDACEF0DEDACEF0D747D92D4000000006BB773D201010000DC556FC9EDACEF0DEDACEF0DB000000080000000EDACEF0D7B2B84EACF228BD2CF228BD2178076D2013B65D2479B9CD2DC556FC9EDACEF0D0000000007E29CD207E29CD207E29CD207E29CD200000000000000000000000000000000FC556FC9000000000000000000000000EDACEF0D00000000EDACEF0DF6FFFFFF00000000000000004000000000000000EDACEF0DEDACEF0D00000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000EDACEF0DC4566FC9000000000000000040586FC9EDACEF0DEDACEF0D0000000028576FC9A4566FC948576FC92842A7D4EDACEF0D28576FC9EDACEF0D5FB473D2FFFFFFFF7B2B84EAEDACEF0DEDACEF0DFFFFFFFFC0566FC9
+08-17 20:31:35.726 F/google-breakpad( 2913): S C96F5680 EDACEF0DEDACEF0DEDACEF0DEDACEF0DEDACEF0DEDACEF0DFFFFFFFFC0566FC9020000000000000000000000000000000000000077D5BED2EDACEF0D00000000FCFFFFFFEDACEF0DE4566FC9EDACEF0DB8576FC9EDACEF0D00000000000000000000000000000000EDACEF0DEDACEF0D28576FC9EDACEF0DB8576FC9EDACEF0DC8576FC928576FC970576FC92BAA73D2EDACEF0DEDACEF0D00000000EDACEF0DEDACEF0DEDACEF0DEDACEF0D0000000000000000000000000000000000000000000000007642A7D42842A7D4C9000000CF228BD2CF228BD2178076D2013B65D2479B9CD24102000001006FC900000000FFFFFFFFD0A4BDD202000000F0576FC900000000EDACEF0DEDACEF0DEDACEF0DAC576FC9FFFFFFFFE0576FC9EDACEF0D010000006B9855D2EDACEF0DEDACEF0DEDACEF0DEDACEF0DEDACEF0D0000000000000000000000000000000000000000000000007642A7D42842A7D4C9000000CF228BD2CF228BD2178076D2013B65D2479B9CD24102000001000000D34657D2
+08-17 20:31:35.727 F/google-breakpad( 2913): S C96F5800 EDACEF0DEDACEF0DEDACEF0D00000000EDACEF0DEDACEF0D000000005B8173D2020000009BD47ED2CC586FC940586FC9EDACEF0D00000000CC586FC91FA773D20000000000000000EDACEF0D3100000020000000EDACEF0D0000000000000000000000000000000098586FC9EDACEF0DEDACEF0DEDACEF0D94586FC9EDACEF0D00000000CC586FC9000000006B9855D20000000000000000EDACEF0D214657D2000000000000000000000000B34557D2EDACEF0DEDACEF0DEDACEF0DEDACEF0D00000000498473D2EDACEF0DEDACEF0D00000000EDACEF0DEDACEF0D00000000CC586FC9EDACEF0DEDACEF0D20596FC978000000EDACEF0DEDACEF0DA38173D220596FC9CD2F82EA20596FC9E52F82EA28596FC9EF5C7FEA7800000000000000EDACEF0DEDACEF0D2F0B0000DF0A000000000000EDACEF0DEDACEF0D00100000000000000000000000000000000000005B8173D2EDACEF0D00000000EDACEF0D0100000000000000EDACEF0D0000000070596FC920596FC91600000000000000
+08-17 20:31:35.727 F/google-breakpad( 2913): S C96F5980 00000000EDACEF0D00000000EDACEF0D0000000001000000EDACEF0D0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000EDACEF0D01000000EDACEF0D0000000000000000010000002F0B000001000000EDACEF0D01000000EDACEF0D01000000EDACEF0D010000000100000001000000EDACEF0D01000000EDACEF0D01000000EDACEF0D01000000EDACEF0D01000000EDACEF0D00000000000000000000000000000000000000000000000001000000EDACEF0D01000000EDACEF0D00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 20:31:35.728 F/google-breakpad( 2913): S C96F5B00 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 20:31:35.728 F/google-breakpad( 2913): S C96F5C80 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 20:31:35.729 F/google-breakpad( 2913): S C96F5E00 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 20:31:35.729 F/google-breakpad( 2913): S C96F5F80 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 20:31:35.729 F/google-breakpad( 2913): C 06000040000000000000000005B88FD2020000008C4C6FC9CC4C6FC9C885634FAC4C6FC94C4D6FC95C4D6FC9504D6FC9804E6FC9D9C5F7D3604C6FC91B89B3D28684B3D2300001680000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+08-17 20:31:35.729 F/google-breakpad( 2913): M AAAAA000 00000000 00005000 8D2477F3B51997BDCC3733B8D1F920BE0 app_process32
+08-17 20:31:35.729 F/google-breakpad( 2913): M 70D29000 00000000 00806000 E9166D3ED622EE65A3A4086EBEA4A7950 boot.oat
+08-17 20:31:35.730 F/google-breakpad( 2913): M 71531000 00000000 006C0000 668D96384E4368B01BC9B9F365028CA20 boot-core-libart.oat
+08-17 20:31:35.730 F/google-breakpad( 2913): M 71BF3000 00000000 000AA000 0D160B642FB1639805B72AC6F4DF3F380 boot-conscrypt.oat
+08-17 20:31:35.730 F/google-breakpad( 2913): M 71C9F000 00000000 000D1000 9D69BDC94BD07F2468D5B7DB0AEEF0140 boot-okhttp.oat
+08-17 20:31:35.730 F/google-breakpad( 2913): M 71D72000 00000000 0000C000 566CD32860A984FD445A4852058609CB0 boot-core-junit.oat
+08-17 20:31:35.730 F/google-breakpad( 2913): M 71D80000 00000000 0019F000 09C1E8B1D7FC826CB75691EC5BDBA1DB0 boot-bouncycastle.oat
+08-17 20:31:35.730 F/google-breakpad( 2913): M 71F21000 00000000 0014B000 069BAE4D2D7831B857A3C236021D868A0 boot-ext.oat
+08-17 20:31:35.730 F/google-breakpad( 2913): M 7206E000 00000000 0223E000 D0BEBD37E215DDC845099212203F792F0 boot-framework.oat
+08-17 20:31:35.730 F/google-breakpad( 2913): M 742AE000 00000000 00502000 B41E052DBA2949CE100713743053E1E40 boot-telephony-common.oat
+08-17 20:31:35.730 F/google-breakpad( 2913): M 747B2000 00000000 0003D000 65E4B1E28F33F9C51062E2D0630394830 boot-voip-common.oat
+08-17 20:31:35.730 F/google-breakpad( 2913): M 747F1000 00000000 00045000 EB491A6AF6568A675D81746238ACC78B0 boot-ims-common.oat
+08-17 20:31:35.731 F/google-breakpad( 2913): M 74838000 00000000 0016C000 C369D6D4F8DCF10CC0AD1800000000000 boot-apache-xml.oat
+08-17 20:31:35.731 F/google-breakpad( 2913): M 749A6000 00000000 000FF000 1FAC5317B0FEBD01C31E8039D76CCAF50 boot-org.apache.http.legacy.boot.oat
+08-17 20:31:35.731 F/google-breakpad( 2913): M 74AA7000 00000000 00004000 C368F8D0F8DCF10C00BE1800000000000 boot-tcmiface.oat
+08-17 20:31:35.731 F/google-breakpad( 2913): M 74AAD000 00000000 00016000 C368FA40F8DCF10C3FB11800000000000 boot-WfdCommon.oat
+08-17 20:31:35.731 F/google-breakpad( 2913): M 74AC5000 00000000 00004000 A2EDD62E4499B2C98D8C251F0977951B0 boot-oem-services.oat
+08-17 20:31:35.731 F/google-breakpad( 2913): M 74ACB000 00000000 0001C000 3794BA12A18F802DF4E8F10D4B2662FB0 boot-qcom.fmradio.oat
+08-17 20:31:35.731 F/google-breakpad( 2913): M 74AE9000 00000000 00009000 C368F9A8F8DCF10C95B41800000000000 boot-qcmediaplayer.oat
+08-17 20:31:35.731 F/google-breakpad( 2913): M 74AF4000 00000000 00008000 C368E898F8DCF10CDEAD1800000000000 boot-telephony-ext.oat
+08-17 20:31:35.731 F/google-breakpad( 2913): M 74AFE000 00000000 00013000 C368E46FF8DCF10CA3A11800000000000 boot-dolby_ds2.oat
+08-17 20:31:35.731 F/google-breakpad( 2913): M 74B13000 00000000 0000A000 C368F9E4F8DCF10C41B01800000000000 boot-dolby_ds1.oat
+08-17 20:31:35.731 F/google-breakpad( 2913): M CBCC8000 00000000 00856000 000003F10000000031270A00000000000 base.odex
+08-17 20:31:35.732 F/google-breakpad( 2913): M CCAF6000 00000000 00936000 00000F700000000098480B00000000000 base.odex
+08-17 20:31:35.732 F/google-breakpad( 2913): M CF4C6000 00000000 02000000 000000000000000000000000000000000 dalvik-jit-code-cache (deleted)
+08-17 20:31:35.732 F/google-breakpad( 2913): M D2273000 04247000 02C94000 8A2EFA0DECC3EF7057A1C62BF1AECCA80 libmonochrome.so
+08-17 20:31:35.732 F/google-breakpad( 2913): M D9155000 00000000 00004000 C1741AE46077EF13F70D0DC7D8A9DDE80 libwebviewchromium_loader.so
+08-17 20:31:35.732 F/google-breakpad( 2913): M D9276000 00000000 00006000 C700FED4854EA9F553FC4EB1AC49DAD50 libqdutils.so
+08-17 20:31:35.732 F/google-breakpad( 2913): M D927F000 00000000 00007000 5AF3845B7F31952390092BB2318667B00 gralloc.msm8937.so
+08-17 20:31:35.732 F/google-breakpad( 2913): M D926B000 00000000 00823000 A91A29ADD65BB0AF28A4C9A6208E33C40 libllvm-glnext.so
+08-17 20:31:35.732 F/google-breakpad( 2913): M D9AB7000 00000000 00316000 9F7E6C49A0A8C88C317716B031320CA30 libESXGLESv2_adreno.so
+08-17 20:31:35.732 F/google-breakpad( 2913): M D9F1F000 00000000 0000C000 CEC6F7F71723450F4D1E527FA1BDDA310 libqservice.so
+08-17 20:31:35.732 F/google-breakpad( 2913): M D9F30000 00000000 00007000 BB9F7CD0BF1178F273EB8B4D2D5C67C30 libmemalloc.so
+08-17 20:31:35.732 F/google-breakpad( 2913): M D9F39000 00000000 00003000 B4B80A1B5D6C50F5C0DD7F1C29A9F6C10 libqdMetaData.so
+08-17 20:31:35.732 F/google-breakpad( 2913): M D9F43000 00000000 00009000 0BA85EA850C07E5B86AF8281EF7641E70 libcompiler_rt.so
+08-17 20:31:35.732 F/google-breakpad( 2913): M D9F4E000 00000000 0000B000 362BA72B9CF73AB8BD02283F491283E40 eglSubDriverAndroid.so
+08-17 20:31:35.732 F/google-breakpad( 2913): M D9F5B000 00000000 0000B000 9BAA0F603A10810D4A6BEE7A903A762F0 libGLESv2_adreno.so
+08-17 20:31:35.732 F/google-breakpad( 2913): M D9F68000 00000000 00007000 C08FDBDAB5792096DB0BEDBE3D23B48D0 libGLESv1_CM_adreno.so
+08-17 20:31:35.732 F/google-breakpad( 2913): M D9F71000 00000000 00024000 C346DBBCF27F603F9321CCF737B3C0550 libESXGLESv1_CM_adreno.so
+08-17 20:31:35.733 F/google-breakpad( 2913): M D9F97000 00000000 00010000 A7800610AD28E2DF469D023E70516C190 libESXEGL_adreno.so
+08-17 20:31:35.733 F/google-breakpad( 2913): M D9FAB000 00000000 00006000 6CC274368542A8270BC225BE519068D80 libadreno_utils.so
+08-17 20:31:35.733 F/google-breakpad( 2913): M D9FBC000 00000000 00009000 649C0C218A9C0A611E5E0DB24CDD058C0 libEGL_adreno.so
+08-17 20:31:35.733 F/google-breakpad( 2913): M DA4BC000 00000000 00020000 1195E0A668F3644AC0EC8D1122457A140 libkeymaster1.so
+08-17 20:31:35.733 F/google-breakpad( 2913): M DA4DF000 00000000 00018000 39E3D5620A966F5DB960EEE55CCD8BB30 libsoftkeymasterdevice.so
+08-17 20:31:35.733 F/google-breakpad( 2913): M DA4F9000 00000000 0001A000 C1B07DA2D52E6EC3C54992A3A953D63B0 libjavacrypto.so
+08-17 20:31:35.733 F/google-breakpad( 2913): M DA516000 00000000 00004000 B051A444B9312E4DAF242DA3A951538A0 libkeystore-engine.so
+08-17 20:31:35.733 F/google-breakpad( 2913): M DA51B000 00000000 00016000 1988D915061DDC4921FF608AD3E810AD0 libkeystore_binder.so
+08-17 20:31:35.733 F/google-breakpad( 2913): M DA534000 00000000 0000C000 DDF063ABB28459B09548F8329934DDEB0 libkeymaster_messages.so
+08-17 20:31:35.733 F/google-breakpad( 2913): M DC57D000 00000000 00016000 A686CFCA0E870C10B425EB769017BE930 libmtp.so
+08-17 20:31:35.733 F/google-breakpad( 2913): M DC593000 00000000 00052000 E9F8299757E5E543C03723101E5B1BEC0 libmedia_jni.so
+08-17 20:31:35.733 F/google-breakpad( 2913): M DC5E8000 00000000 00020000 ADF61BE35FF269EC7E7B32B1DDCD31E00 libexif.so
+08-17 20:31:35.733 F/google-breakpad( 2913): M DC616000 00000000 0000E000 ABA3C77DD3386AE87B586632CE1979D50 libstagefright_amrnb_common.so
+08-17 20:31:35.733 F/google-breakpad( 2913): M DC634000 00000000 00007000 CD70BA801CA3E12D258565013535D7440 tcmclient.odex
+08-17 20:31:35.733 F/google-breakpad( 2913): M DC645000 00000000 00004000 042B2B738C75036986EB80BC08A71F060 libextmedia_jni.so
+08-17 20:31:35.733 F/google-breakpad( 2913): M E1E9B000 00000000 002B2000 FCA7431984CE2AEF979FFEEF99432D320 libart-compiler.so
+08-17 20:31:35.734 F/google-breakpad( 2913): M E215E000 00000000 000B1000 1EBE7A1A3E1A3134DE689251E1ABC0380 libvixl.so
+08-17 20:31:35.734 F/google-breakpad( 2913): M E2264000 00000000 0002B000 6E46C8EDE63F81CC2A4375E4F85517CD0 libopenjdk.so
+08-17 20:31:35.734 F/google-breakpad( 2913): M E2291000 00000000 00029000 4F845000DEA8066D684FEAB08A91A3480 libjavacore.so
+08-17 20:31:35.734 F/google-breakpad( 2913): M E22BC000 00000000 00138000 523FDEBEF6ECE577AF3716E9703AD4FF0 lib-imsqimf.so
+08-17 20:31:35.734 F/google-breakpad( 2913): M E23FA000 00000000 00004000 48E9F68098728AFF9A198AE7A14A7F700 libmdmdetect.so
+08-17 20:31:35.734 F/google-breakpad( 2913): M E2400000 00000000 00005000 12F24D77003A5660A06BA8690696A5C30 libconfigdb.so
+08-17 20:31:35.734 F/google-breakpad( 2913): M E2405000 00000000 00085000 DB9D3DADFB06F6B1AB9CEC5443F295370 lib-imsxml.so
+08-17 20:31:35.734 F/google-breakpad( 2913): M E2496000 00000000 00005000 F812502D41A460BDD2D9AA83A9564CC70 libqmi_encdec.so
+08-17 20:31:35.734 F/google-breakpad( 2913): M E249C000 00000000 0001C000 A53A45C88FFCD4CB3AFF323AF8FFFBAB0 libqdi.so
+08-17 20:31:35.734 F/google-breakpad( 2913): M E24B7000 00000000 0006A000 D110B55DE7DB9FD5086D2D1CE57152480 libdsi_netctrl.so
+08-17 20:31:35.734 F/google-breakpad( 2913): M E2534000 00000000 00023000 E7FB6A8B99C97103F258028CF27324660 lib-imsrcscm.so
+08-17 20:31:35.734 F/google-breakpad( 2913): M E255A000 00000000 0001C000 5BE35B9E5D50332052532AE119C50B930 libnetmgr.so
+08-17 20:31:35.734 F/google-breakpad( 2913): M E257A000 00000000 00004000 AB354652140A356C9787104C87CB30E00 libidl.so
+08-17 20:31:35.734 F/google-breakpad( 2913): M E2581000 00000000 00004000 63ED38853810ED69BA1AA57CE82E74B10 libtime_genoff.so
+08-17 20:31:35.734 F/google-breakpad( 2913): M E2587000 00000000 00004000 51134658113749962ABB7BA3A3C5E9740 libqmi_client_helper.so
+08-17 20:31:35.734 F/google-breakpad( 2913): M E258E000 00000000 00009000 1D288EC9F32773EBC0D380D4E238D8D60 libqmi_client_qmux.so
+08-17 20:31:35.734 F/google-breakpad( 2913): M E25C9000 00000000 0006A000 60BAE0DAB14BFBC4BE1805CC4CAF8B4D0 lib-imsdpl.so
+08-17 20:31:35.734 F/google-breakpad( 2913): M E263D000 00000000 00019000 0333752023452FF1E40F6BA9169471500 libdiag.so
+08-17 20:31:35.735 F/google-breakpad( 2913): M E274E000 00000000 0002C000 0FC3AF7C85EA4B0DA653AEA111020A2D0 libqmi.so
+08-17 20:31:35.735 F/google-breakpad( 2913): M E27B7000 00000000 000B8000 023971CEF8E022AAD4090C7D1432C3690 libCB.so
+08-17 20:31:35.735 F/google-breakpad( 2913): M E6BB5000 00000000 00005000 F841612CF1D458AB70296575A996EE5F0 QPerformance.odex
+08-17 20:31:35.735 F/google-breakpad( 2913): M E7D93000 00000000 00461000 39CBB6C545073B5DB56B60665F81D4B00 libart.so
+08-17 20:31:35.735 F/google-breakpad( 2913): M E8384000 00000000 00001000 7691C4BE084B030B3AA118A6F412EE260 libqmi_common_so.so
+08-17 20:31:35.735 F/google-breakpad( 2913): M E8387000 00000000 0000A000 37A576E22F2B9973E1734E556E1E99990 libqmi_cci.so
+08-17 20:31:35.735 F/google-breakpad( 2913): M E8395000 00000000 00003000 DCDF68ACFBFC2DEFC89FA0F5783199070 libpackagelistparser.so
+08-17 20:31:35.735 F/google-breakpad( 2913): M E839A000 00000000 00056000 0C1D30C5E6EA7E82800A2B00935E4B060 libharfbuzz_ng.so
+08-17 20:31:35.735 F/google-breakpad( 2913): M E83F3000 00000000 00037000 8AF00237A05209C2E429D0F70ED3EB900 libopus.so
+08-17 20:31:35.735 F/google-breakpad( 2913): M E842C000 00000000 00017000 215A7F63855CB46EC59B425BEDFD847D0 libminikin.so
+08-17 20:31:35.735 F/google-breakpad( 2913): M E8447000 00000000 00018000 EAB4CCC4544F5D8E2ECF256D527F4A430 libutils.so
+08-17 20:31:35.735 F/google-breakpad( 2913): M E8461000 00000000 0001E000 CCAA49412B791630FD4EAD7755A3E4CD0 libvorbisidec.so
+08-17 20:31:35.735 F/google-breakpad( 2913): M E8481000 00000000 00008000 F3F7CCE4ADD14C5DB852DF06407AE2FA0 libcamera_metadata.so
+08-17 20:31:35.735 F/google-breakpad( 2913): M E848C000 00000000 0000E000 1F6ED3D6536346B3B20CF40C5F9799D80 liblog.so
+08-17 20:31:35.735 F/google-breakpad( 2913): M E849D000 00000000 00010000 D6821B30C7A106C623EEE331974C9BF50 libGLESv2.so
+08-17 20:31:35.735 F/google-breakpad( 2913): M E84AF000 00000000 00014000 22B107B0382117ED603FF6000B248B8D0 libpcre.so
+08-17 20:31:35.736 F/google-breakpad( 2913): M E84C4000 00000000 00040000 9CC9AFC89D88D4C4AE6AEF2E290594B70 libinputflinger.so
+08-17 20:31:35.736 F/google-breakpad( 2913): M E8508000 00000000 00005000 459EC08F2C9F91A7E6AB6F293540B4510 libstdc++.so
+08-17 20:31:35.736 F/google-breakpad( 2913): M E850F000 00000000 00005000 DE5A396AAF801AF9A298A50BADE143E60 libspeexresampler.so
+08-17 20:31:35.736 F/google-breakpad( 2913): M E84F0000 00000000 00B36000 F1644AA2ACE475925E0DA02A814C13DF0 libLLVM.so
+08-17 20:31:35.736 F/google-breakpad( 2913): M E9081000 00000000 00008000 225E121AA129BB96606A1B3B91A2737A0 libnbaio.so
+08-17 20:31:35.736 F/google-breakpad( 2913): M E908C000 00000000 00017000 9A6B379EB3F10874FC241C570801C6070 libmemunreachable.so
+08-17 20:31:35.736 F/google-breakpad( 2913): M E909C000 00000000 0005F000 0FAC08487B9CD62449A19C8D161E7D820 libgui.so
+08-17 20:31:35.736 F/google-breakpad( 2913): M E9109000 00000000 00004000 E9B0F0A724940363FCBE11FB96B6ADF30 libnativebridge.so
+08-17 20:31:35.736 F/google-breakpad( 2913): M E910D000 00000000 0007B000 B44B5897A497DCB27C105B61AC30F1180 libhwui.so
+08-17 20:31:35.736 F/google-breakpad( 2913): M E918B000 00000000 0008B000 DCAB7F6AA60C5E74587E56973C6653120 libc++.so
+08-17 20:31:35.736 F/google-breakpad( 2913): M E921C000 00000000 00003000 3C7CC5BEA31C9C85C9BC25EC0891B7B10 libsync.so
+08-17 20:31:35.736 F/google-breakpad( 2913): M E9221000 00000000 00009000 4334A7FB3D1CB8582D4D676DE6E5E2930 libpiex.so
+08-17 20:31:35.736 F/google-breakpad( 2913): M E922A000 00000000 0000E000 EBD0DA428C58F5CBD72761DD6F1C03A10 libsoundtrigger.so
+08-17 20:31:35.736 F/google-breakpad( 2913): M E923D000 00000000 00020000 27C83DAE0AB0E161280BB40C384BD4BC0 libm.so
+08-17 20:31:35.736 F/google-breakpad( 2913): M E925F000 00000000 00003000 C9108BAA1E466D60D4591919420BBB6A0 libradio_metadata.so
+08-17 20:31:35.736 F/google-breakpad( 2913): M E9264000 00000000 0000E000 63E3F027146D592F9FBE03A33EDC8C6D0 libimg_utils.so
+08-17 20:31:35.736 F/google-breakpad( 2913): M E9275000 00000000 00015000 53AF0C4E2096697687AC0081AC7AD97C0 libunwind.so
+08-17 20:31:35.736 F/google-breakpad( 2913): M E92D0000 00000000 0001F000 9F74D840029038F65C040D5492CAE7360 libinput.so
+08-17 20:31:35.737 F/google-breakpad( 2913): M E92F5000 00000000 00005000 17620CAE201DC01DFD868F3276E8AA810 libpowermanager.so
+08-17 20:31:35.737 F/google-breakpad( 2913): M E92FD000 00000000 00055000 5E4B1D0F4D553AA92665AE0925229AF40 libsonivox.so
+08-17 20:31:35.737 F/google-breakpad( 2913): M E9359000 00000000 00006000 E727B84B0F5B3D982CAE8FB6E64B88030 libtiff_directory.so
+08-17 20:31:35.737 F/google-breakpad( 2913): M E9362000 00000000 00021000 52D2F4BBC71C3EE2E161E009B0331EF80 libstagefright_foundation.so
+08-17 20:31:35.737 F/google-breakpad( 2913): M E9386000 00000000 0003B000 2D4A4F8139C7842165EA73A6ACD835340 libjpeg.so
+08-17 20:31:35.737 F/google-breakpad( 2913): M E93C3000 00000000 00003000 9945E8F5AE0ADE1ED46FA08B41A6C9BE0 libmemtrack.so
+08-17 20:31:35.737 F/google-breakpad( 2913): M E93C6000 00000000 00019000 D2D0067E628DCC03418B99399D251A990 libEGL.so
+08-17 20:31:35.737 F/google-breakpad( 2913): M E93E4000 00000000 00019000 6534179E8DC7D8EDBF1236C375D51ECD0 libdrmframework.so
+08-17 20:31:35.737 F/google-breakpad( 2913): M E93FB000 00000000 00110000 994744AF5261DAC7CD0003EC5456DBDF0 libicuuc.so
+08-17 20:31:35.737 F/google-breakpad( 2913): M E9519000 00000000 00015000 BDA36CE4717D8C1A324C7CA4E1CA9B860 libvulkan.so
+08-17 20:31:35.737 F/google-breakpad( 2913): M E9521000 00000000 000F8000 91002184018FFAC8E26ECCB238E392440 libandroid_runtime.so
+08-17 20:31:35.737 F/google-breakpad( 2913): M E962A000 00000000 00004000 644559B020FD089F8180BB62CF9420590 libprocessgroup.so
+08-17 20:31:35.737 F/google-breakpad( 2913): M E9629000 00000000 00183000 035813361AA690A2E08F1E059823C9D50 libicui18n.so
+08-17 20:31:35.737 F/google-breakpad( 2913): M E97B8000 00000000 00008000 9D6466250A83301B3BE4CAA85227525D0 libnativeloader.so
+08-17 20:31:35.737 F/google-breakpad( 2913): M E97C0000 00000000 0000E000 031F092D2D476376D52F41FD2ADD2A3E0 libradio.so
+08-17 20:31:35.737 F/google-breakpad( 2913): M E97D2000 00000000 00003000 159F2CAC750E3DB60EF444F05BACCC850 libregionalization.so
+08-17 20:31:35.737 F/google-breakpad( 2913): M E97D8000 00000000 00008000 16C813B71CC34E81BCF6F5DD8648DC3B0 libGLESv1_CM.so
+08-17 20:31:35.738 F/google-breakpad( 2913): M E97E2000 00000000 00003000 AA06FF77B6E4CC83470C006104304D0F0 libhardware.so
+08-17 20:31:35.738 F/google-breakpad( 2913): M E97E0000 00000000 00039000 B613B07CCC9703A9AAE92861C92202BD0 libcamera_client.so
+08-17 20:31:35.738 F/google-breakpad( 2913): M E980D000 00000000 003A9000 42F6682A5C7E8B66743C6087B578D6C40 libskia.so
+08-17 20:31:35.738 F/google-breakpad( 2913): M E9BDC000 00000000 00007000 AD9132F0D394659639CBE5858DD1BB750 libhardware_legacy.so
+08-17 20:31:35.738 F/google-breakpad( 2913): M E9BE7000 00000000 00005000 EE5BF022DE057918231B46C6EDDC38690 libstagefright_yuv.so
+08-17 20:31:35.738 F/google-breakpad( 2913): M E9BEE000 00000000 00007000 9BC1C9D1E638BF1B7B32AC308B08D9DA0 libimage_type_recognition.so
+08-17 20:31:35.738 F/google-breakpad( 2913): M E9BF7000 00000000 0000D000 3C492E547FA88D7E2E85BD9451F613090 libbacktrace.so
+08-17 20:31:35.738 F/google-breakpad( 2913): M E9C07000 00000000 00007000 B165EC37228240E1EBEDC14160C16A3A0 libnativehelper.so
+08-17 20:31:35.738 F/google-breakpad( 2913): M E9C10000 00000000 0001A000 4D1780AFB25B59BBD625608B400D70C20 libprotobuf-cpp-lite.so
+08-17 20:31:35.738 F/google-breakpad( 2913): M E9C2D000 00000000 00004000 989F274AF037FE14219BE6DC42503B950 libnetd_client.so
+08-17 20:31:35.738 F/google-breakpad( 2913): M E9C33000 00000000 000A0000 8E23BB4E73E86B4A2AD4C17D7BAFD8A90 libcrypto.so
+08-17 20:31:35.738 F/google-breakpad( 2913): M E9CE0000 00000000 00003000 675D9BCC56AB210C8017D6625F994D250 libstagefright_enc_common.so
+08-17 20:31:35.738 F/google-breakpad( 2913): M E9CE5000 00000000 00024000 CC51150390EA9EFB0315C02573CCFD000 libpng.so
+08-17 20:31:35.738 F/google-breakpad( 2913): M E9D0B000 00000000 0003B000 4FBF4968372FEB1C8D593076E1B171610 libRScpp.so
+08-17 20:31:35.738 F/google-breakpad( 2913): M E9D49000 00000000 0000A000 415DAD77CED2441456E20CAD35C536250 libRS.so
+08-17 20:31:35.738 F/google-breakpad( 2913): M E9D55000 00000000 00004000 F168A985060F7993C937719998C96FD20 libusbhost.so
+08-17 20:31:35.738 F/google-breakpad( 2913): M E9D5B000 00000000 00086000 58C592B73EA51A0AFC3287247961D0940 libdng_sdk.so
+08-17 20:31:35.739 F/google-breakpad( 2913): M E9DE1000 00000000 00057000 44C1EA73F38E47E95712BF5848E8937E0 libbinder.so
+08-17 20:31:35.739 F/google-breakpad( 2913): M E9E3F000 00000000 0002E000 2824A9CACA3A870AD713A3405D6249530 libwilhelm.so
+08-17 20:31:35.739 F/google-breakpad( 2913): M E9E72000 00000000 00030000 E9CE28F8F628E4501925FF4D0FD6168F0 libstagefright_omx.so
+08-17 20:31:35.739 F/google-breakpad( 2913): M E9EA0000 00000000 00487000 3CD6A967C46ED23F4AB4B39092B43AB70 libpdfium.so
+08-17 20:31:35.739 F/google-breakpad( 2913): M EA337000 00000000 00004000 76B7583F8773D45C53E165CABC841DE70 libETC1.so
+08-17 20:31:35.739 F/google-breakpad( 2913): M EA33D000 00000000 00015000 F0658EC8F5FCD09AB82C2EFC3A6834210 libui.so
+08-17 20:31:35.739 F/google-breakpad( 2913): M EA355000 00000000 00038000 E4F681ED6DAD0F793516317FBE3DD55A0 libRS_internal.so
+08-17 20:31:35.739 F/google-breakpad( 2913): M EA390000 00000000 00016000 0DB58A0AF796EA03A43AAD505A8723310 liblzma.so
+08-17 20:31:35.739 F/google-breakpad( 2913): M EA3AE000 00000000 00011000 2618247A47A298A5C4574CC818C7F3280 libselinux.so
+08-17 20:31:35.739 F/google-breakpad( 2913): M EA3C1000 00000000 00005000 961542B344C4A0F54F87B49C0F1429E80 libwpa_client.so
+08-17 20:31:35.739 F/google-breakpad( 2913): M EA3C8000 00000000 00007000 5FF53AA38050A1DE3BF7A4D755DC75B70 libaudioutils.so
+08-17 20:31:35.739 F/google-breakpad( 2913): M EA3D1000 00000000 00017000 31235ADAF427BE11933CD87290CCAF050 libcutils.so
+08-17 20:31:35.739 F/google-breakpad( 2913): M EA3EB000 00000000 00036000 CBC6DC0C255BAB785FCD0511A7CBF0690 libbcinfo.so
+08-17 20:31:35.739 F/google-breakpad( 2913): M EA423000 00000000 00003000 FDA204F888F3C0D8070BFDEC834066D20 libstagefright_http_support.so
+08-17 20:31:35.739 F/google-breakpad( 2913): M EA428000 00000000 00005000 14FB257C9C6F43C8FA0B475D81C47FFC0 libbinary_parse.so
+08-17 20:31:35.739 F/google-breakpad( 2913): M EA42F000 00000000 00009000 93F30055C78E1D80E40A8E717405CF500 libmediautils.so
+08-17 20:31:35.739 F/google-breakpad( 2913): M EA43B000 00000000 0000A000 0F98C20EB2725367604DCE7EDA8EED9D0 libbase.so
+08-17 20:31:35.740 F/google-breakpad( 2913): M EA447000 00000000 00016000 DC1FEB19B377562139F4F8AAFFA610710 libz.so
+08-17 20:31:35.740 F/google-breakpad( 2913): M EA460000 00000000 00015000 68F77CDFB35DA081E510A50D11F299D70 libexpat.so
+08-17 20:31:35.740 F/google-breakpad( 2913): M EA45D000 00000000 000C3000 3B22B766CDBB99263CF24B4CC2986E510 libmedia.so
+08-17 20:31:35.740 F/google-breakpad( 2913): M EA541000 00000000 00031000 335A60B9AA0F00A47BD5A781CCA820740 libandroidfw.so
+08-17 20:31:35.740 F/google-breakpad( 2913): M EA574000 00000000 0007A000 21086BE83826AA7DC32AB49C79D5CCE30 libsqlite.so
+08-17 20:31:35.740 F/google-breakpad( 2913): M EA5F2000 00000000 0006C000 6EA54A19597F20D46626700FE9F206F50 libft2.so
+08-17 20:31:35.740 F/google-breakpad( 2913): M EA64F000 00000000 0016B000 4E69F13734FEABE1CA5BA98594235DCD0 libstagefright.so
+08-17 20:31:35.740 F/google-breakpad( 2913): M EA7D3000 00000000 00007000 475E29D0A243BEE93EC1A630C99503FC0 libnetutils.so
+08-17 20:31:35.740 F/google-breakpad( 2913): M EA7DC000 00000000 00084000 49B02E01AEC77331A1D6D19B540265610 libc.so
+08-17 20:31:35.740 F/google-breakpad( 2913): M EA86E000 00000000 00025000 8B6ECC65C09CAFF5ACAAB6C9249CD2C20 libssl.so
+08-17 20:31:35.740 F/google-breakpad( 2913): M EA896000 00000000 00008000 22114C778A7ED1CC3953CCB22323EA1B0 libstagefright_avc_common.so
+08-17 20:31:35.740 F/google-breakpad( 2913): M EA8A1000 00000000 00003000 7FA19C935E6148BD8002A3CA630C4E6F0 libsmemlog.so
+08-17 20:31:35.740 F/google-breakpad( 2913): M EA8A1000 00000000 00017000 EEAF8ABB6827B80A458A5D483E5562400 libqmiservices.so
+08-17 20:31:35.740 F/google-breakpad( 2913): M EA8C1000 00000000 00008000 090640ECFC69E16A25A3E27006AF282E0 libxml.so
+08-17 20:31:35.740 F/google-breakpad( 2913): M EA8CC000 00000000 00012000 67F4D476A96F053ACB61531379FCC4810 libdsutils.so
+08-17 20:31:35.740 F/google-breakpad( 2913): M EA8EF000 00000000 00014000 EFD5F0A0F81252A037F1C06B8E6809700 libsdsprpc.so
+08-17 20:31:35.740 F/google-breakpad( 2913): M EA905000 00000000 0003E000 C4311189AF8DA8405EDC0701CD38FC770 libgsl.so
+08-17 20:31:35.740 F/google-breakpad( 2913): M EA99F000 00000000 00014000 75BC34362D3F387A08AE8241CED8E2550 libadsprpc.so
+08-17 20:31:35.741 F/google-breakpad( 2913): M EA9B2000 00000000 0001A000 840BD6EAC45DEFC59D2F1E8C681CFF1A0 lib-imsrcscmclient.so
+08-17 20:31:35.741 F/google-breakpad( 2913): M EA9DA000 00000000 00011000 6034A9FBADF19CE6C259DA006E8158FC0 lib-imsrcscmservice.so
+08-17 20:31:35.741 F/google-breakpad( 2913): M EAA09000 00000000 00003000 7BB31E1D28279A11B8087C3F4DF7D0BA0 libqti-at.so
+08-17 20:31:35.741 F/google-breakpad( 2913): M EAA0E000 00000000 0000C000 7D5A1CA22F6A85FCC57B3D36A92461560 lib-ims-rcscmjni.so
+08-17 20:31:35.741 F/google-breakpad( 2913): M EAA1C000 00000000 00012000 FAD2DBDF65F36590FFE591C62DBEFA1E0 libOpenCL.so
+08-17 20:31:35.741 F/google-breakpad( 2913): M EAA38000 00000000 00003000 025B4D5BBA39265D6260B27597E321730 memtrack.msm8937.so
+08-17 20:31:35.741 F/google-breakpad( 2913): M EAA3D000 00000000 00011000 F5FF7C8214A82029405A068BCDF69A580 libmediandk.so
+08-17 20:31:35.741 F/google-breakpad( 2913): M EAA53000 00000000 00008000 5373A05304D5AFD8BC2BB49D6C22977D0 libopenjdkjvm.so
+08-17 20:31:35.741 F/google-breakpad( 2913): M EAA5C000 00000000 0000F000 96A60B84ED1352C202B6695FD32373790 libmediadrm.so
+08-17 20:31:35.741 F/google-breakpad( 2913): M EAA6E000 00000000 00010000 3D880E60A39C482BA4210DA0AD4E20490 libGLESv3.so
+08-17 20:31:35.741 F/google-breakpad( 2913): M EAA97000 00000000 00003000 F4CB54FA6F9A644292CE2DCC9FA89DA80 libqti_performance.so
+08-17 20:31:35.741 F/google-breakpad( 2913): M EAA9D000 00000000 00004000 B2EAC3688B9EFF0E79EA2C170AA859C50 libwebviewchromium_plat_support.so
+08-17 20:31:35.741 F/google-breakpad( 2913): M EAAA5000 00000000 00004000 837BE31E60CD67A2C45BF27A1E8C10140 libOpenSLES.so
+08-17 20:31:35.741 F/google-breakpad( 2913): M EAAAB000 00000000 00004000 3C4D0169CD09A3AEEC0868A7FC87CCFA0 libOpenMAXAL.so
+08-17 20:31:35.741 F/google-breakpad( 2913): M EAAB0000 00000000 00016000 BAF17608D25635EFA63708C89561474D0 libcamera2ndk.so
+08-17 20:31:35.741 F/google-breakpad( 2913): M EAB53000 00000000 00003000 78C8F6360CF612E4333D4EB1796927460 libqti-perfd-client.so
+08-17 20:31:35.742 F/google-breakpad( 2913): M EAB57000 00000000 00014000 01EE9AC4109E06B182E77B55242AEBE20 libandroid.so
+08-17 20:31:35.742 F/google-breakpad( 2913): M EABAF000 00000000 00003000 4C4B6F03AF5049885FD4A43F149D13630 libjnigraphics.so
+08-17 20:31:35.742 F/google-breakpad( 2913): M EABB0000 00000000 00090000 FBA40D2822A0C6DCF7CE29FB42DC37230 libmediaplayerservice.so
+08-17 20:31:35.742 F/google-breakpad( 2913): M EAC7B000 00000000 0000A000 52C41240B217BFE92F7381218169FD760 liblz4.so
+08-17 20:31:35.742 F/google-breakpad( 2913): M EACF9000 00000000 00038000 FEF1DA3EC5AA99E4FF38C1DF2A9A91570 libavenhancements.so
+08-17 20:31:35.742 F/google-breakpad( 2913): M EAD35000 00000000 0002F000 85E4C8F7646AA02A46215564266690BA0 libstagefright_wfd.so
+08-17 20:31:35.742 F/google-breakpad( 2913): M EAD6A000 00000000 00026000 7B91D8B6A15FF171BF114D8D638785D80 libstagefright_httplive.so
+08-17 20:31:35.742 F/google-breakpad( 2913): M EAD94000 00000000 00003000 6DE080E13BB1741A34C157CE97277ABD0 libsigchain.so
+08-17 20:31:35.742 F/google-breakpad( 2913): M EADE7000 00000000 00003000 1390052238CBD9474F1747EA0BA53C740 libExtendedExtractor.so
+08-17 20:31:35.742 F/google-breakpad( 2913): M EAE32000 00000000 00006000 3B45281FC4EB699207799FD6018FBD910 libvendorconn.so
+08-17 20:31:35.742 F/google-breakpad( 2913): M EAEB2000 00000000 0005F000 7AC50A488023F3DA8182906BDFFA72C10 linker
+08-17 20:31:35.742 F/google-breakpad( 2913): -----END BREAKPAD MICRODUMP-----
+08-17 20:31:35.770 W/google-breakpad( 2783): ### ### ### ### ### ### ### ### ### ### ### ### ###
+08-17 20:31:35.770 W/google-breakpad( 2783): Chrome build fingerprint:
+08-17 20:31:35.770 W/google-breakpad( 2783): 37.3.0
+08-17 20:31:35.770 W/google-breakpad( 2783): 668
+08-17 20:31:35.770 W/google-breakpad( 2783): ### ### ### ### ### ### ### ### ### ### ### ### ###
diff --git a/src/processor/testdata/microdump-x86.dmp b/src/processor/testdata/microdump-x86.dmp
new file mode 100644
index 00000000..ece9ef4c
--- /dev/null
+++ b/src/processor/testdata/microdump-x86.dmp
@@ -0,0 +1,174 @@
+01-25 09:57:54.139 F/google-breakpad(23467): -----BEGIN BREAKPAD MICRODUMP-----
+01-25 09:57:54.139 F/google-breakpad(23467): V Chrome_Android:49.0.2623.15
+01-25 09:57:54.139 F/google-breakpad(23467): O A x86 04 i686 asus/WW_Z00A/Z00A:5.0/LRX21V/2.19.40.22_20150627_5104_user:user/release-keys
+01-25 09:57:54.139 F/google-breakpad(23467): G UNKNOWN
+01-25 09:57:54.140 F/google-breakpad(23467): S 0 FFB44BD0 FFB44000 00004000
+01-25 09:57:54.152 F/google-breakpad(23467): S FFB44000 A4C46FF7E429FAF30000000046BD6DF7E429FAF30000000000000000A4C40101303B3BCF88D06FF7A841B4FF160000000000000000000000000000000300000011000000000000000000000050000000A70A39F71CC740F7A841B4FF12093DF70B000080D440B4FF1E1239F7A4C46FF7A7B471F7C00973F7C0253DE780B571F704D000F4E02000F48029FAF3B8C96DF78029FAF30000000059B571F7A4C46FF7D440B4FF0001FEC1000000004D316EF70000B1E6D440B4FFA841B4FF46000000A841B4FF04000000E9083DF71CC740F7A841B4FF88D06FF7F841B4FF003031F70001FEC1460000001E1239F7A4C46FF7A841B4FFE62F31F7A4C46FF790336EF70001FEC17041B4FFD9C86DF7A4C46FF7404B01E716000000F841B4FF08336EF7A4C46FF7A841B4FF7041B4FFCC336EF7A841B4FF01000000A841B4FFB8196DF718FD20F7B6336EF718FD20F72D761DF7A841B4FF03000000A841B4FF7041B4FF01000000CC6D08F4000000000000000000000000000000000000000000000000
+01-25 09:57:54.153 F/google-breakpad(23467): S FFB44180 000000000000000000000000000000000000000001000100000000004051000000000000FFFFFFFF000000000001FEC150000000780000005000000000000000000000000000000000000000010001D4000000008082173300000000301F97F30C42B4FFB46238CF01000000A0B203E70000000018FD20F71842B4FFCE0C1DF720B803E78087C0CA590D5CF7BCAB6AF7A0B203E7BCAB6AF7D050F8F3ED2FE8F3306D08F4C00973F7D08F2DED80B571F7D08F2DED8842B4FF00000000F8B371F7D08F2DED6442B4FF6842B4FFBCAB6AF7A0B203E7FFFFFFFFEEF36674B10F5CF7B8B203E70000000000005700BA86ECF3A70A39F71CC740F70000000095D63CF70B000080FFFFFFFFD050F8F3ED2FE8F3306D08F4FFFFFFFFA0B203E73C4695F30800000008E61C71C00973F74000000040000000400104F404D000F40000000000000000000000000000000000000000040167748028CB328028CB32DAF96674904E1D717A0700006E7E7D0000000000D074E7320000000004016774902C7CF7
+01-25 09:57:54.153 F/google-breakpad(23467): S FFB44300 81000000A832FAF31CC740F7E01239F7F0000000A832FAF3810000000100000000000000A832FAF3C00973F7315972F7190000004843B4FF080000000B000000380000009057E532D050F8F3ED2FE8F3306D08F4A832FAF380F9C2CAD971AFF5A832FAF3463031F7082150F77AD447F7380000009443B4FF9843B4FF9813B9F5C06FBECF9057E532C06FBECF9354AFF58032FAF30100000000005700BA86ECF33754AFF5BCAB6AF7FFFFFFFF00000000306D08F49057E532C06FBECF804395F3FFFFFFFF56345DF7FFFFFFFF30AC537308000000306D08F4C06FBECFFFFFFFFF78521D718028CB3202000000D074E732589F1D712456B4FF010000009865E77008000000306D08F4CC7D83D43C4695F3C06FBECFFFFFFFFF9057E532502F717410F20D71C06FBECFFFFFFFFF2E717474888D0E718028CB3200000000D074E732588B0E714000DB3200000000BA5E747400890E710000000000000000FFFFFFFF3C7274744000DB3200000000F3727474D88D0E718028CB32020000005075E732
+01-25 09:57:54.154 F/google-breakpad(23467): S FFB44480 00000000306D08F4005FB0D45C2FE8F35075E73202000000000000003C4695F370D77374000000004000DB32DFD87374C0780E71FFFFFFFFFFFFFFFF0000000038040000800700000000803F0100000008000000001087448007000038040000F00000000000003F0000000000000000306D08F48054E63200824DCC804395F3FFFFFFFF8054E632FFFFFFFFC40F747308000000306D08F400824DCCFFFFFFFF0000000000000000FFFFFFFF88AE95F3007F1D712456B4FF010000009841E7700800000000000000809CE532609DE53200824DCCFFFFFFFF8054E632C0F86F74585F0D7100824DCCFFFFFFFFE45A95F3901C0E710000000078B20D71209AE4328054E63200D8DF3274236C7406066C7498AB0D710000000000000000000000000000000000D8DF3200D8DF32EF106C7468AE0D7100E0DF3200D8DF320000000000000000000000000100000074256C7478B20D7100E0DF3200D8DF32609DE532380400000600000003BBCDC5C0D7C932609DE53200E0DF32D446B4FF00000000
+01-25 09:57:54.154 F/google-breakpad(23467): S FFB44600 000000000000008000800000AC4A90C900D8DF3200D8DF320000000009226C7400B20D7140E79BC0000000000000000038040000060000000100000001000000019A01F40000000034000000380400000600000001000000010000000000000000D8DF328061E632D050F8F3ED2FE8F3306D08F4AC4A90C9010000003C4695F30100000008E61C71C00973F78DFB71F7F84F1D71B446B4FFB846B4FF0000000000000000000000000000000000000000040167748028CB328028CB32DAF96674904E1D717A0700006E7E7D0000000000A017C03200000000040167745404677498501D718028CB328028CB32F1E9667448281871306D08F46E7E7D0000000000A017C03200000000C075E032C869E670080000006E7E7D00010000009F93B0D4040167747017C0328028CB32A501677420501D717017C0326E7E7D0000000000A017C03200000000608517336E7E7D000000000000D8DF32F3B79AF3E9A2B0F340A102F43C2696DE52B8DE3D0000000074186774030000000100000074C9F7F3
+01-25 09:57:54.155 F/google-breakpad(23467): S FFB44780 000000001849B4FF1FB89AF3A43296F340A102F43C2696DE0400000000D8DF3252B8DE3DCDCC4C3DC02DDC32804395F38028CB3201000000A017C032F8D702EF3C2696DE8028CB32C02DDC32A017C03200000000000000000000000001000000080000006E7E7D00000000009CE0D4F300000000000000000000000000000000000000009848B4FF9748B4FFBCD032547E4BB4FF0B0000005048B4FF3803000000000000380300005048B4FF032E5FC74048B4FF4848B4FF000000009F93B0D45048B4FF38030000E75EC4C70B0000004E616D653A09636F6D2E6368726F6D652E6465760A53746174653A0952202872756E6E696E67290A546769643A09383233330A5069643A09383233330A505069643A093736320A5472616365725069643A09300A5569643A0931303136330931303136330931303136330931303136330A4769643A0931303136330931303136330931303136330931303136330A464453697A653A093235360A47726F7570733A093330303120333030322033303033
+01-25 09:57:54.155 F/google-breakpad(23467): S FFB44900 2039393937203530313633200A566D5065616B3A092031363034313634206B420A566D53697A653A092031343137343136206B420A566D4C636B3A092020202020202030206B420A566D50696E3A092020202020202030206B420A566D48574D3A092020323538343230206B420A566D5253533A092020323134333936206B420A566D446174613A092020333835373038206B420A566D53746B3A092020202038313932206B420A566D4578653A092020202020203532206B420A566D4C69623A092020323035373732206B420A566D5054453A092020202031313536206B420A566D537761703A092020202020202030206B420A546872656164733A0935390A536967513A09302F33313230320A536967506E643A09303030303030303030303030303030300A536864506E643A09303030303030303030303030303030300A536967426C6B3A09303030303030303030303030313230340A53696749676E3A09303030303030303030303030303030300A5369674367743A093030303030
+01-25 09:57:54.156 F/google-breakpad(23467): S FFB44A80 30303230303030393466380A436170496E683A09303030303030303030303030303030300A43617050726D3A09303030303030303030303030303030300A4361704566663A09303030303030303030303030303030300A436170426E643A09303030303030303030303030303030300A536563636F6D703A09300A437075735F616C6C6F7765643A09660A437075735F616C6C6F7765645F6C6973743A09302D330A4D656D735F616C6C6F7765643A09310A4D656D735F616C6C6F7765645F6C6973743A09300A766F6C756E746172795F637478745F73776974636865733A0934303930390A6E6F6E766F6C756E746172795F637478745F73776974636865733A0931383937370A0300000000000000E66441F70000000029200000000040F7650000000A0000001E1239F71CC740F7402C7CF7902C41F71851B4FFD20739F7902C41F7D04BB4FFD84BB4FF980739F706000000000000001CC740F79D0B39F7292000002920000006000000C6E97CF7020000000C4CB4FF590B39F71CC740F7
+01-25 09:57:54.156 F/google-breakpad(23467): S FFB44C00 4C4CB4FF504CB4FF1851B4FF463333F7402C7CF706000000E9CB37F71CC740F7273333F71CC740F74C4CB4FF56BF32F7060000004C4CB4FF0000000073E132F7E46441F701000000449500F4DFFFFFFF47E132F71CC740F7592D5FC708BF32F7AC4A90C900000000444DB4FFC92E5FC7C4F99BC90700000089D437F70000000097AB37F7962E5FC7AC4A90C9ED5560C7E04CB4FF650000000100000068F440F7306D08F45A0600005A0600000A4495F3306D08F45D001000E04CB4FF2051B4FF306D08F4010000007100000065000000D0DFEDD10020183300000000E42F50735B464154414C3A6A6E695F616E64726F69642E636328323333295D20436865636B206661696C65643A2066616C73652E20506C6561736520696E636C756465204A61766120657863657074696F6E20737461636B20696E206372617368207265706F72740A000000010000006F0E4C7300201833000000005A0600004329507378641A7100201833F88BA670001303F400B8D570C08C1733F40D1F731E8BD2F3
+01-25 09:57:54.157 F/google-breakpad(23467): S FFB44D80 60D9FE7000B8D570587B19711E8BD2F30A00000038C006752900000000101833B8C30271690064005A0600005A0600005A0600005A06000000B8D5705A060000A70A39F71CC740F70000000074C9F7F3E09A01F45D0020005D002000CE73D6F3F09A01F45D00200049000000CE73D6F334205073E8CB037500101833884FB4FF0C000000AC4A90C9E84EB4FF4765AAC7C44EB4FF404EB4FF904EB4FF95D63CF70B0000800000000000000000884FB4FF0C00000003000000010000005A06000004D000F4A82200F4010000002000000020000000400104F404D000F474C9F7F37C4EB4FF4E6C5971704FB4FF636095F3A70A39F71CC740F70000000095D63CF70B00008074C9F7F3E9083DF7CCE7CCC4AC4A90C9F86B9CC9884FB4FFFB73A9C7004FB4FF046C9CC9CE1439F74000000040000000400104F404D000F495D63CF7A70A39F71CC740F70000000095D63CF70B0000802051B4FFB84FB4FFA0ECEDC42051B4FF734FB4FF030000002000000004D000F4502000F404D000F480000000
+01-25 09:57:54.157 F/google-breakpad(23467): S FFB44F00 80000000400104F404D000F41F95A9C7A70A39F71CC740F73FA304C212093DF70B000080C84FB4FFB84FB4FFA244A8C7EC4FB4FF2051B4FFE9083DF71CC740F704D000F4802000F4884FB4FF003031F7C073F4CB1CC740F71C51B4FF12093DF70B000080E62F31F7AC4A90C915ABA9C7C073F4CB333300003ED63CF71CC740F72051B4FFAC4A90C9E9083DF71CC740F73FA304C2BF0EFEC1D84FB4FF003031F700A304C2463031F74000000000A304C220000000E62F31F7AC4A90C915ABA9C700A304C21F000000EB5BCEC4AC4A90C92051B4FFAC4A90C94051B4FFC45BCEC400A304C23F00000000000000902400F4000000000000000080000000800EFEC1802AC2CEC073F4CB3F000000000000002051B4FF3F000000EB5BCEC4AC4A90C92051B4FF3F0000004051B4FFA686CEC44051B4FF7F00000000000000D02400F400000000000000003F00000020000000B450B45B49000000DD85CEC4AC4A90C90E0000002051B4FFDC36CEC70F1CCEC42051B4FF2000000065A304C265A304C2
+01-25 09:57:54.158 F/google-breakpad(23467): S FFB45080 200EFEC1AC4A90C9330000000CA0CCC4CC50B4FFDC36CEC733000000000000001C51B4FF2051B4FF1C51B4FF5451B4FFDC36CEC70F37CEC720000000003031F70000BAC9E09A01F4F9EC38F70150B4FF1C51B4FF0000000000000000000000000000BAC900100000995160C7AC4A90C9E09A01F41851B4FF450020008F885EC71851B4FFDC36CEC733000000A158ABC73C51B4FF6F06100003000000DC4682C9884682C9886A9CC9000000000000000000000000800EFEC1E50EFEC1FF0EFEC1810000007F000000800EFEC1E50EFEC110000000F04682C902100000060000000000000000000000000000002051B4FF886A9CC90000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000001C0000006436CEC7E90000002500200029001000C9875EC7AC4A90C97C52B4FFE09A01F47052B4FFC10EA4C5E09A01F42FF9D3C46F0610002E0CA4C53052B4FF3852B4FF4052B4FF4852B4FF5052B4FF5852B4FF610000002FF9D3C4
+01-25 09:57:54.158 F/google-breakpad(23467): S FFB45200 6052B4FF18A304013D0020003900000035000000310000002D001000290010002500200021000000410010006852B4FF21000000E09A01F425002000E09A01F429001000E09A01F42D001000E09A01F431000000E09A01F435000000E09A01F439000000E09A01F43D002000E09A01F441001000E09A01F4260000000000000000000000000000000000000000000000A70A39F7AC4A90C9B30BA4C5AC4A90C9A03A45CF205CB8C001000000C0F8A3C5A03A45CF0900000004000000205CB8C001000000F85AD6C469AB66C7AC4A90C9B1847BCA1853B4FF470B9CC96161D0C4005CB8C0B1847BCA69AF66C7AC4A90C9C853B4FFF6C666C7AC4A90C99661D0C41853B4FFB1847BCA00000000ADB266C7C853B4FFE02000F4005CB8C089F8A3C5AC4A90C9C853B4FF4055B4FFEF395FC7A0847BCAC053B4FFDC53B4FF3B47D4F3A87A0B71CC68387401000000BB243BF7A7B471F7C00973F774C9F7F3F0A7D5F34C54B4FF010000000000000074C9F7F374C9F7F3A87A0B71E853B4FF447FD4F3
+01-25 09:57:54.159 F/google-breakpad(23467): S FFB45380 4C54B4FF682D2071C053B4FFB053B4FF800EFEC1B453B4FF1E1239F7B84872F700B971F7CC6D08F4009A01F40000000000000000502500F41CC740F7B2D932F76C02A4C59054B4FF0000000000000000F025FAD40000000000000000000000000B0000801001FEC120000000E00100000000000056D932F729395FC7AC4A90C9C0D00BEF400B9CC94055B4FFEDC460C764D10BEF3763C4C74055B4FF301F97F34C54B4FFB46238CF01000000F6BBD5F34C54B4FF00000000000000000000000020927BCA007A45CF6C54B4FFB87FF7F3306D08F400000000000000004056B4FFCC68387400000000000000000000000000000000A87A0B71180000009F93B0D400A304C200000000EB9564C774C9F7F3306D08F4F4010000606238CF058DC6F3606238CF306D08F4010000000000000007000000AC4A90C9202000001868DB15AC4A90C90100000059C460C7AC4A90C94055B4FFC0D00BEFC0D00BEFC4CD60C7C0D00BEF4055B4FFAC4A90C9DFA760C707DB61C7AC4A90C9CCD00BEF9DC760C7
+01-25 09:57:54.159 F/google-breakpad(23467): S FFB45500 7092B0CF706238CFB9CC60C7AC4A90C94055B4FF7092B0CFC0D00BEFBED360C7C0D00BEF4055B4FFB029FAF38A3C6EF75055B4FF5855B4FFCCD00BEF4855B4FF808D51D3000000000000000000000000A0847BCA6661D0C4D033DDC78286B4C7CA0000006C02A4C5A18400000100B0D4606238CF306D08F499D260C7AC4A90C9C071F13201000000C0D00BEF72E660C7C0D00BEF306D08F4C00973F78DFB71F700000000C455B4FFC855B4FF000000000000000000000000CE9C75EAC050F8F3080000000100000000005700BA86ECF3010000004000C032000043000200000074C9F7F32E68387449E660C7FFFFFFFFC071F132FFFFFFFFF004C032CD2696DEE09A01F42C56B4FFC0D00BEFFFFFFFFFCE9C75EA0100000001000000C869E670F8D702EF5459B4FF01000000F004C032080000002E683874C071F132DD6C3874F004C032C071F132FFFFFFFF24C296DEC0D802EFF004C032C0D00BEFFFFFFFFFCE9C75EA010000000053D2120000000000000000C071F132F004C032AD84BE73
+01-25 09:57:54.160 F/google-breakpad(23467): S FFB45680 A05F0B718029B0E6FFFFFFFF6A7E7D0000000000385ADA70320000000C07B573DA1938740053D212F004C0326F1B387458700B714000C032000000009EE2BE7329200000B3270000000000004020C032C071F1324000C03229200000B32700000000000000000000FFFFFFFF1800DC0060B6BF730053D212A8C91B71A1B7BF73A8C91B7120BCB37000000000D0E6B3703E21A574C059B4FF7360ADEB8010C0320031C0320000000000000000000000007180ADEB40000000000000007480ADEB5C57B4FF2E760F725058B4FF336295F3000000009010C0327B80ADEBCC6D08F4306D08F474C9F7F3E857B4FFD21B96F3A8C91B714C58B4FF04000000306D08F43458B4FF2B760F72306D08F401000000B07BF7F3306D08F4000000002B760F72B457B4FF3458B4FF00000000B491DEF3102301F45059B4FFA45AB4FF00000000306D08F49855DB70000000009F93B0D41C58B4FF306D08F44010CF1274C9F7F34C58B4FF1459B4FFE858B4FFCFC4D2F3A8C91B71306D08F44C58B4FF04000000
+01-25 09:57:54.160 F/google-breakpad(23467): S FFB45800 3458B4FF2B760F72E03DCD120000000034A0A4742B760F723C58B4FF2B760F7200000000003ECD123458B4FFA8C91B71F00E117100000000000000002B760F7202000000040000004C58B4FFE03DCD12306D08F4000000008D0DA5744835E8F3306D08F4B0BBCD12503CCD1200000000B0BBCD12001303F400000000045A95F34010CF12306D08F40000000000000000402D20714000000000000000FFFFFFFF8D0DA57400000000000000008810A574600D1171A011C012801ECE123C4695F30000000000000000030000009F93B0D4B0BBCD12804BCE12204BCE1274C9F7F3D0BFCD1203000000EE18A5742499CAF31459B4FF5C59B4FF000000006459B4FF01000000010000000000000003000000004BCE12306D08F4E09A01F4C010FAF3D0BFCD1203000000003ECD12755B4D73E09A01F45C59B4FF000000006459B4FFD0BFCD1203000000EE18A574127195F3E08D1A7100000000030000007000C032000000007010C032000000000543A574EE18A5747000C032030000006919A574
+01-25 09:57:54.161 F/google-breakpad(23467): S FFB45980 B00D1171D0BFCD1200000000003ECD124011C01200000000A011C0126011C0127010C032000000000000000058EBF2703E21A574E09BBA70030000004D22A574F00E1171A000C0326025C27000000000F00E1171E8BFFEEE8093FD74A000C032FFFFFFFF10C0FEEE6025C27001000000E6DE0000C801C370D60B000010F2C51238DBFDEE01000000B892FD74061087ED38DBFDEEB892FD7401000000306D08F44C5BB4FF90AAF9F3005BB4FF010000004C5AB4FFBC6C83ED305BB4FF336295F300000000A082C61240A102F4CC6D08F4306D08F474C9F7F3D85AB4FFD21B96F338DBFDEE2C5BB4FF04000000306D08F4145BB4FFB96C83EDF85BB4FF505AB4FFD0E101F4010000001B0F65F7B96C83EDA45AB4FF145BB4FF01000000C4A49DF31A0F65F7000000000000000000000000D0E101F413000000803480ED9F93B0D400000000D0E101F40700000074C9F7F3605CB4FF2C5BB4FF885BB4FFD591D2F338DBFDEE306D08F42C5BB4FF04000000145BB4FFB96C83ED04000000395B98F3
+01-25 09:57:54.161 F/google-breakpad(23467): S FFB45B00 00000000E85BB400B96C83EDB96C83ED306D08F40000000000000000B96C83ED02000000040000002C5BB4FFA082C612BA86ECF3C050F8F3D0E101F47C7F80ED1D000000EC5BB4FF885BB4FF74C9F7F310F2C512E85BB4FF000043000100000010F2C512F05BB4FFE85BB4FF0000000038DBFDEE040000001D0F65F774C9F7F3F45BB4FF38DBFDEE306D08F41147BFF3D85BB4FFF45BB4FF0000000038DBFDEE5C5CB4FF306D08F4060F65F71D0000001D0F65F7DC5BB4FF60AAF9F3045CB4FFEC5BB4FF40A102F4E45BB4FFE09A01F498F27CF7020000000000000000005700000000000000570000000000000057001D0F65F7306D08F4E09A01F4C010FAF3306D08F443000000570000000010FAF3306D08F44300000057000000BCAB6AF760AAF9F31D0000000D0020008BF357F7E09A01F41D00000038DBFDEE5C5CB4FF60AAF9F31D0000000D0020003E3258F7E09A01F41D00000038DBFDEE0D0020000000000004D00AF4010000000100000000000000905CB4FF01000000A60E65F7
+01-25 09:57:54.162 F/google-breakpad(23467): S FFB45C80 E4F57CF70100000021000000E09A01F434930DF403DFBBF3C05BBCF3BBDEBBF39CFFFFFF20F67CF70400000027CC7CF700D00AF426DD32F71CC740F79F93B0D49CFFFFFF20F67CF709F573F7503D7DF70100000020F67CF774FE7CF74EA47CF70400000074FE7CF744F67CF720F67CF7297AB4FF3090F8F3692F58F7503D7DF7010000008C5DB4FF585EB4FF88927CF7A05DB4FF98F27CF78C5DB4FF01000000C85EB4FF000000000000000000000000000000000000000000000000C85EB4FFC45DB4FF805DB4FFA05DB4FF8C037DF7000001017C5DB4FFC85DB4FF040000008C5DB4FF04000000845DB4FFC45EB4FF080000000000000000A077F73090F8F330C000F410D400F4C00901F448337DF75090F8F302000000000000000400000088337DF7E87E6AF71040FAF32C000000000000000800000001000000297AB4FF4C00000030C000F448337DF700000000000000000000000004000000000000007838362C61726D656162692D7637612C61726D65616269000000000001000000
+01-25 09:57:54.162 F/google-breakpad(23467): S FFB45E00 00000000067B33F71CC740F74A623AF700700BF40010000001000000000000000000000000000000000000000000000001000000FD000000030000009F93B0D424A377F70100000079613AF71CC740F7C45EB4FFDC5EB4FF05000000FE3231F705000000C45EB4FFDC5EB4FF000000000000000000000000993231F7503D7DF7C05EB4FF00000000BC5EB4FF08977CF7C05EB4FF00000000308E7CF7A05EB4FF00337DF708337DF71C337DF7C05EB4FFADB978F700000000E00F7CF7BC5EB4FF05000000297AB4FF417AB4FF4A7AB4FF567AB4FF5F7AB4FF00000000757AB4FFB27AB4FFC57AB4FFDA7AB4FFF57AB4FF087BB4FF217BB4FF3A7BB4FF547BB4FFFC7CB4FFD97DB4FF747FB4FF897FB4FFA77FB4FFC77FB4FF000000002000000020E4FFFF2100000000E0FFFF10000000FFFBEBBF060000000010000011000000640000000300000034507CF7040000002000000005000000090000000700000000A077F7080000000000000009000000A5967CF70B000000000000000C000000
+01-25 09:57:54.163 F/google-breakpad(23467): S FFB45F80 000000000D000000000000000E00000000000000170000000000000019000000CB5FB4FF1F000000E07FB4FF0F000000DB5FB4FF00000000000000000000000000000000000000000000009F93B0D475A5398BA918E032A02885506936383600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+01-25 09:57:54.163 F/google-breakpad(23467): S FFB46100 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+01-25 09:57:54.164 F/google-breakpad(23467): S FFB46280 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+01-25 09:57:54.164 F/google-breakpad(23467): S FFB46400 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+01-25 09:57:54.165 F/google-breakpad(23467): S FFB46580 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+01-25 09:57:54.165 F/google-breakpad(23467): S FFB46700 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+01-25 09:57:54.166 F/google-breakpad(23467): S FFB46880 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+01-25 09:57:54.166 F/google-breakpad(23467): S FFB46A00 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+01-25 09:57:54.167 F/google-breakpad(23467): S FFB46B80 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+01-25 09:57:54.167 F/google-breakpad(23467): S FFB46D00 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+01-25 09:57:54.168 F/google-breakpad(23467): S FFB46E80 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+01-25 09:57:54.168 F/google-breakpad(23467): S FFB47000 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+01-25 09:57:54.169 F/google-breakpad(23467): S FFB47180 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+01-25 09:57:54.169 F/google-breakpad(23467): S FFB47300 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+01-25 09:57:54.170 F/google-breakpad(23467): S FFB47480 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+01-25 09:57:54.170 F/google-breakpad(23467): S FFB47600 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+01-25 09:57:54.171 F/google-breakpad(23467): S FFB47780 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+01-25 09:57:54.171 F/google-breakpad(23467): S FFB47900 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000636F6D2E6368726F6D652E6465760000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000504154483D2F7362696E3A
+01-25 09:57:54.172 F/google-breakpad(23467): S FFB47A80 2F76656E646F722F62696E3A2F73797374656D2F7362696E3A2F73797374656D2F62696E3A2F73797374656D2F7862696E00414E44524F49445F424F4F544C4F474F3D3100414E44524F49445F524F4F543D2F73797374656D00414E44524F49445F4153534554533D2F73797374656D2F61707000414E44524F49445F444154413D2F6461746100414E44524F49445F53544F524147453D2F73746F726167650045585445524E414C5F53544F524147453D2F73646361726400415345435F4D4F554E54504F494E543D2F6D6E742F6173656300424F4F54434C415353504154483D2F73797374656D2F6672616D65776F726B2F636F72652D6C69626172742E6A61723A2F73797374656D2F6672616D65776F726B2F636F6E7363727970742E6A61723A2F73797374656D2F6672616D65776F726B2F6F6B687474702E6A61723A2F73797374656D2F6672616D65776F726B2F636F72652D6A756E69742E6A61723A2F73797374656D2F6672616D65776F726B2F626F756E6379636173746C65
+01-25 09:57:54.172 F/google-breakpad(23467): S FFB47C00 2E6A61723A2F73797374656D2F6672616D65776F726B2F6578742E6A61723A2F73797374656D2F6672616D65776F726B2F6672616D65776F726B2E6A61723A2F73797374656D2F6672616D65776F726B2F74656C6570686F6E792D636F6D6D6F6E2E6A61723A2F73797374656D2F6672616D65776F726B2F766F69702D636F6D6D6F6E2E6A61723A2F73797374656D2F6672616D65776F726B2F696D732D636F6D6D6F6E2E6A61723A2F73797374656D2F6672616D65776F726B2F6170616368652D786D6C2E6A61723A2F73797374656D2F6672616D65776F726B2F6F72672E6170616368652E687474702E6C65676163792E626F6F742E6A61720053595354454D534552564552434C415353504154483D2F73797374656D2F6672616D65776F726B2F6F72672E6379616E6F67656E6D6F642E706C6174666F726D2E6A61723A2F73797374656D2F6672616D65776F726B2F6F72672E6379616E6F67656E6D6F642E68617264776172652E6A61723A2F73797374656D2F6672616D65776F72
+01-25 09:57:54.173 F/google-breakpad(23467): S FFB47D80 6B2F73657276696365732E6A61723A2F73797374656D2F6672616D65776F726B2F65746865726E65742D736572766963652E6A61723A2F73797374656D2F6672616D65776F726B2F776966692D736572766963652E6A6172004C445F5348494D5F4C4942533D2F73797374656D2F62696E2F6D6D67727C6C69627368696D5F6D6D67722E736F3A2F73797374656D2F62696E2F677073647C6C69627368696D5F6770732E736F3A2F73797374656D2F6C69622F68772F6770732E6D6F66645F76312E736F7C6C69627368696D5F6770732E736F3A2F73797374656D2F6C69622F68772F73656E736F72732E6D6F66645F76312E736F7C6C69627368696D5F73656E736F72732E736F3A2F73797374656D2F6C69622F6C69627463732E736F7C6C69627368696D5F7463732E736F3A2F73797374656D2F6C69622F6C6962706172616D657465722E736F7C6C69627368696D5F617564696F2E736F3A2F73797374656D2F6C69622F706172616D657465722D6672616D65776F726B2D706C756769
+01-25 09:57:54.173 F/google-breakpad(23467): S FFB47F00 6E732F417564696F2F6C696274696E79616C73615F637573746F6D2D73756273797374656D2E736F7C6C69627368696D5F617564696F2E736F3A2F73797374656D2F6C69622F68772F63616D6572612E76656E646F722E6D6F66645F76312E736F7C6C69627368696D5F63616D6572612E736F00414E44524F49445F43414348453D2F6361636865005445524D494E464F3D2F73797374656D2F6574632F7465726D696E666F00414E44524F49445F50524F50455254595F574F524B53504143453D31302C3000414E44524F49445F534F434B45545F7A79676F74653D3132002F73797374656D2F62696E2F6170705F70726F63657373000000000000000000
+01-25 09:57:54.175 F/google-breakpad(23467): C 0F0001000000000000000000000000000000000000000000000000007F03FFFF2000FFFFFFFFFFFFA70F7473230000004445B4FF2B00FFFF0A00000000000000FFFF0000000000000000FFFF7800000000000000FFFFFADCFFFFFFFF0100FFFF2E01FFFF90B60100FFFF00309276A38FF980F23F00309276A38FF980F23F000000000000000000000000000063000000070000002B0000002B00000002000000902C7CF72920000006000000292000000000000029200000864B39F72300000002020000D04BB4FF2B0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+01-25 09:57:54.175 F/google-breakpad(23467): M F77C5000 00000000 0000D000 50D89C8096239F07B843A4C5C35923170 app_process32_xposed
+01-25 09:57:54.175 F/google-breakpad(23467): M C4A68000 00E89000 04EB7000 7AEFEEE07C050930D779F813A65B7FE60 libchrome.so
+01-25 09:57:54.175 F/google-breakpad(23467): M CF638000 00000000 00148000 1A8A2BF0604D9446617771B6897B96BA0 libblas.so
+01-25 09:57:54.175 F/google-breakpad(23467): M D06BF000 00000000 00041000 253BBF60002FDEC2B9A3005415117F280 libRSCpuRef.so
+01-25 09:57:54.176 F/google-breakpad(23467): M D1FB3000 00000000 00039000 507958F205384891BCB21E1FFB2E30620 libRSDriver.so
+01-25 09:57:54.176 F/google-breakpad(23467): M E6217000 00000000 0001D000 36ABF97FDAFFF60863FA23FC1B540D6A0 libcompiler_rt.so
+01-25 09:57:54.176 F/google-breakpad(23467): M E6243000 00000000 00018000 0DBD5467C6AB422397203A66A0E121750 libandroid.so
+01-25 09:57:54.176 F/google-breakpad(23467): M E625B000 00000000 0000D000 AE6E13458FB630763E5ED161161B739D0 libpvrANDROID_WSEGL.so
+01-25 09:57:54.176 F/google-breakpad(23467): M E6268000 00000000 000D0000 C28CF55E5E98E2B1EB84198BE1FC14190 libglslcompiler.so
+01-25 09:57:54.176 F/google-breakpad(23467): M E633B000 00000000 0012B000 E147F17CF855F17795C1DC0A9CBB843C0 libGLESv2_POWERVR_ROGUE.so
+01-25 09:57:54.176 F/google-breakpad(23467): M E6469000 00000000 0016F000 1891D5688EE312EFFF2A194AB6FF1C7A0 libusc.so
+01-25 09:57:54.176 F/google-breakpad(23467): M E65DB000 00000000 000AC000 D20CCBE31F52F5AE0144452692BC9D610 libGLESv1_CM_POWERVR_ROGUE.so
+01-25 09:57:54.176 F/google-breakpad(23467): M E668A000 00000000 0000F000 182671F227066A6551586589082D1D320 libdrm.so
+01-25 09:57:54.176 F/google-breakpad(23467): M E6699000 00000000 000EA000 F6C6DA624665611B3A75C8617A45ED000 libsrv_um.so
+01-25 09:57:54.177 F/google-breakpad(23467): M E6784000 00000000 0002D000 3D95B38C591077B213DA98AC767F766D0 libIMGegl.so
+01-25 09:57:54.177 F/google-breakpad(23467): M E6B41000 00000000 00004000 0DF18ED649E4593BA356C7F4C48CEF510 libwebviewchromium_loader.so
+01-25 09:57:54.177 F/google-breakpad(23467): M E7406000 00000000 00005000 CFD4567F004DC85AA15EFCA44B6DA69D0 libemoji.so
+01-25 09:57:54.177 F/google-breakpad(23467): M E740B000 00000000 00027000 13EA00418F2B15CED6BAB031DF0FC9E60 libswresample.so
+01-25 09:57:54.177 F/google-breakpad(23467): M E7432000 00000000 0000B000 BA492148E0772FEDECD63D3EC92D2B780 libffmpeg_utils.so
+01-25 09:57:54.177 F/google-breakpad(23467): M E743C000 00000000 00065000 F57A52849D51BE8BC164CE7D9FC008340 libavutil.so
+01-25 09:57:54.177 F/google-breakpad(23467): M E74AB000 00000000 00243000 5CE62901E1D3DDB2AE8F71866CB3837C0 libavformat.so
+01-25 09:57:54.177 F/google-breakpad(23467): M E76C5000 00000000 00DAC000 419A89DE37C5668FE3839DE6775723F90 libavcodec.so
+01-25 09:57:54.177 F/google-breakpad(23467): M E8B25000 00000000 00012000 2D3BB7901C6990F220F3ABDEFE773BFE0 libffmpeg_extractor.so
+01-25 09:57:54.177 F/google-breakpad(23467): M E8B37000 00000000 0000D000 DF11B21AABFD31A4CCA2CF3CCB7640E90 libstagefright_avc_common.so
+01-25 09:57:54.177 F/google-breakpad(23467): M E8B44000 00000000 00003000 7DEA05EC7AD8537FF4C2DD5F065D6FDB0 libstagefright_enc_common.so
+01-25 09:57:54.177 F/google-breakpad(23467): M E8B47000 00000000 00025000 8E547CC694E28C3221068AC4B2507B4F0 libvorbisidec.so
+01-25 09:57:54.177 F/google-breakpad(23467): M E8B6C000 00000000 00006000 90B62412D5756080C8DFE217016115050 libstagefright_yuv.so
+01-25 09:57:54.177 F/google-breakpad(23467): M E8B71000 00000000 00040000 6656D67F836F6F06F00CD5748A8C5CCE0 libstagefright_omx.so
+01-25 09:57:54.178 F/google-breakpad(23467): M E8BB1000 00000000 00053000 5EF9E30F4E73B3E9EF2DC1A9575E73780 libopus.so
+01-25 09:57:54.178 F/google-breakpad(23467): M E8C04000 00000000 0000A000 CA739485462BA0B2658CEA503AA286600 libmediautils.so
+01-25 09:57:54.178 F/google-breakpad(23467): M E8C0D000 00000000 0002A000 943AF1BD8889740374C861F61F851E7C0 libdrmframework.so
+01-25 09:57:54.178 F/google-breakpad(23467): M E8C37000 00000000 00016000 4361A537B8F4746F41962F90DDF2105A0 libstagefright_amrnb_common.so
+01-25 09:57:54.178 F/google-breakpad(23467): M E8C4A000 00000000 00036000 29E1806354A34338B5E3EDAD561C41E70 libexif.so
+01-25 09:57:54.178 F/google-breakpad(23467): M E8C80000 00000000 00010000 FBD7045E4FD674AF48F2638450AB98370 libjhead.so
+01-25 09:57:54.178 F/google-breakpad(23467): M E8C91000 00000000 00023000 A5F93B3BF69410560186A8A0DD92D2740 libmtp.so
+01-25 09:57:54.178 F/google-breakpad(23467): M E8CAE000 00000000 0021A000 41A51F8C4C3FC353F38448CAA10917AF0 libstagefright.so
+01-25 09:57:54.178 F/google-breakpad(23467): M E8EC6000 00000000 00084000 568DDECBE861936F6D47FF78B73C723D0 libmedia_jni.so
+01-25 09:57:54.178 F/google-breakpad(23467): M E8FB7000 00000000 00005000 CC6218E5D33D8438DCB93DD96DEA72110 libEGL_POWERVR_ROGUE.so
+01-25 09:57:54.178 F/google-breakpad(23467): M EC748000 00000000 00003000 FE3B8B5AB45DA562F7F82698A7FD70D60 libjnigraphics.so
+01-25 09:57:54.178 F/google-breakpad(23467): M EC760000 00000000 0002C000 37F37614ED1AD2703EC7C4BF663D6FBC0 libkeymaster1.so
+01-25 09:57:54.179 F/google-breakpad(23467): M EC78C000 00000000 0000F000 BA8DB5284A4BD164616442FA11CFF5920 libkeymaster_messages.so
+01-25 09:57:54.179 F/google-breakpad(23467): M EC79B000 00000000 00027000 AA80FB24AA303CC663A777C51E3818ED0 libsoftkeymasterdevice.so
+01-25 09:57:54.179 F/google-breakpad(23467): M EC7C1000 00000000 0002A000 68CC3C7DE2A9A509E0F2D37ED98245E80 libjavacrypto.so
+01-25 09:57:54.179 F/google-breakpad(23467): M ED516000 00000000 0006A000 A20830D97DB0FDF7250C5FB692BC26BC0 libPVROCL.so
+01-25 09:57:54.179 F/google-breakpad(23467): M ED5C0000 00000000 00013000 18A3369A4C4CA77CE18A05D3747670E80 libkeystore_binder.so
+01-25 09:57:54.179 F/google-breakpad(23467): M ED5D3000 00000000 00005000 A4579FE84F51DE9109C9A4DD4594BF180 libkeystore-engine.so
+01-25 09:57:54.179 F/google-breakpad(23467): M ED90D000 00000000 0000F000 8C4B5781D6EF79154ABE62B8D606324A0 libxposed_art.so
+01-25 09:57:54.179 F/google-breakpad(23467): M EEF1B000 00000000 00065000 B97DB0D98582BFAB3EA871F0D1C222C70 libjavacore.so
+01-25 09:57:54.179 F/google-breakpad(23467): M EF00B000 00000000 0001A000 18AFFB18B60EAFBF0AA29C4D2F4C070E0 gralloc.moorefield.so
+01-25 09:57:54.179 F/google-breakpad(23467): M EF04C000 00000000 0001D000 1A8ADB6F40B957D02CC0DC7682A8F9E90 libchromium_android_linker.so
+01-25 09:57:54.179 F/google-breakpad(23467): M F381B000 00000000 00763000 6F79159F51864D6FC2A36A966C3560800 libart.so
+01-25 09:57:54.179 F/google-breakpad(23467): M F40A9000 00000000 00003000 91BAE6D69B00A7052346F44956D08A800 libsigchain.so
+01-25 09:57:54.179 F/google-breakpad(23467): M F40A2000 00000000 01630000 9B531434F5F02E022A2FAC5A643057470 libLLVM.so
+01-25 09:57:54.179 F/google-breakpad(23467): M F56DA000 00000000 0005B000 26441D9EACA6885AF23F38BC6F82C8BB0 libbcinfo.so
+01-25 09:57:54.179 F/google-breakpad(23467): M F5735000 00000000 0006B000 C55576D7E6926857E160CC48CB8225CB0 libbcc.so
+01-25 09:57:54.180 F/google-breakpad(23467): M F579F000 00000000 00012000 B0FCE9881D277F89F61D053C092AE2260 libcommon_time_client.so
+01-25 09:57:54.180 F/google-breakpad(23467): M F57B1000 00000000 00005000 65A183A86D11AE7430AF32DA7C57E8710 libpowermanager.so
+01-25 09:57:54.180 F/google-breakpad(23467): M F57B6000 00000000 0002C000 4B085FDBF44B8FFC0782E729A90C3D750 libprotobuf-cpp-lite.so
+01-25 09:57:54.180 F/google-breakpad(23467): M F57E2000 00000000 00028000 EBF5D67B2D84118021978F6A898B8C980 libRScpp.so
+01-25 09:57:54.180 F/google-breakpad(23467): M F580A000 00000000 00062000 EDCFDD6BC6599F31992F99F529194AC20 libRS.so
+01-25 09:57:54.180 F/google-breakpad(23467): M F586C000 00000000 00007000 4EEBBE38940F43AFCE2D433E624449190 libspeexresampler.so
+01-25 09:57:54.180 F/google-breakpad(23467): M F5873000 00000000 0000E000 79E25E1031DD6618903A712ADDA6744C0 libnbaio.so
+01-25 09:57:54.180 F/google-breakpad(23467): M F5882000 00000000 00024000 21755D2D62F48C0EBF4C73D09C5CD53E0 libstagefright_foundation.so
+01-25 09:57:54.180 F/google-breakpad(23467): M F58A7000 00000000 00006000 ECAD531238F0812D85679F21BE758C3C0 libwpa_client.so
+01-25 09:57:54.180 F/google-breakpad(23467): M F58AD000 00000000 000F5000 7C9614194568F34D00760957437E80EC0 libGLES_trace.so
+01-25 09:57:54.180 F/google-breakpad(23467): M F59A2000 00000000 0008F000 5FCA392FDA7D0D7AC84DC750C5E113300 libft2.so
+01-25 09:57:54.180 F/google-breakpad(23467): M F5A31000 00000000 0003B000 68FA4909919B676A0FC62C8398316D960 libpng.so
+01-25 09:57:54.180 F/google-breakpad(23467): M F5A6C000 00000000 00003000 72547142E4BC3E69AA1C3BB812ED5F380 libsync.so
+01-25 09:57:54.180 F/google-breakpad(23467): M F5A6F000 00000000 00005000 B2AFDC2AE3419BBEFDB0F61CD2BF7E5D0 libstdc++.so
+01-25 09:57:54.180 F/google-breakpad(23467): M F5A74000 00000000 00020000 1BA1AF0070EA904E97616F543CA0A4250 libunwind.so
+01-25 09:57:54.180 F/google-breakpad(23467): M F5AA3000 00000000 0000B000 CE0285F7C123410DF6756F6C4C73B44E0 libbase.so
+01-25 09:57:54.181 F/google-breakpad(23467): M F5AAE000 00000000 00023000 C136291942C5971173AB64521D8DED2B0 libpcre.so
+01-25 09:57:54.181 F/google-breakpad(23467): M F5AD0000 00000000 000C3000 49D590DD4DB4918B246A4FAD58594D170 libhwui.so
+01-25 09:57:54.181 F/google-breakpad(23467): M F5B93000 00000000 00004000 85FDF7C6756D80699F02513B48446DB20 libradio_metadata.so
+01-25 09:57:54.181 F/google-breakpad(23467): M F5B97000 00000000 00005000 15ED52221AC2EC85BBC0EC8924446FDD0 libnativebridge.so
+01-25 09:57:54.181 F/google-breakpad(23467): M F5B9C000 00000000 00004000 1A369C385D95936BF1CB35CEFFC46C520 libprocessgroup.so
+01-25 09:57:54.181 F/google-breakpad(23467): M F5BA0000 00000000 00019000 F88BC9F41A7D2C66D6ABED1DAE189BC40 libminikin.so
+01-25 09:57:54.181 F/google-breakpad(23467): M F5BB8000 00000000 00010000 1A47CE702A7C2780188905377C9638680 libsoundtrigger.so
+01-25 09:57:54.181 F/google-breakpad(23467): M F5BC7000 00000000 00010000 92302D61D2269AB1F7C5FF5C908EDCAE0 libradio.so
+01-25 09:57:54.181 F/google-breakpad(23467): M F5BD7000 00000000 00004000 BEB3710C92B6DFAEFABE9626CDFC9C790 libnetd_client.so
+01-25 09:57:54.181 F/google-breakpad(23467): M F5BDB000 00000000 00017000 A9948C1B8A77CED99AAC0EF29C4CF2C20 libimg_utils.so
+01-25 09:57:54.181 F/google-breakpad(23467): M F5BEC000 00000000 004DD000 013677E0F0932D4B4D9A26CD06311BE90 libpdfium.so
+01-25 09:57:54.181 F/google-breakpad(23467): M F60CA000 00000000 0000F000 B7D024DD71ADA4E55665023B404807070 libaudioutils.so
+01-25 09:57:54.181 F/google-breakpad(23467): M F60DA000 00000000 00022000 CB4FE7BB63F1E58C8F93A21FAED1353D0 libz.so
+01-25 09:57:54.181 F/google-breakpad(23467): M F60FC000 00000000 0005C000 DBF3BE9737586981641FAF665822AFDC0 libharfbuzz_ng.so
+01-25 09:57:54.181 F/google-breakpad(23467): M F6158000 00000000 00006000 D6241B08071BE367421E5461266CDD880 libusbhost.so
+01-25 09:57:54.181 F/google-breakpad(23467): M F615E000 00000000 00047000 2CC00B9AC5953D3E3435BFFB1036240B0 libjpeg.so
+01-25 09:57:54.181 F/google-breakpad(23467): M F618F000 00000000 0012B000 15D0E646E5B33C21414E682A042C93AB0 libmedia.so
+01-25 09:57:54.182 F/google-breakpad(23467): M F62B3000 00000000 0028E000 07184F89E98C8DFC92370FCB8BD43A060 libicui18n.so
+01-25 09:57:54.182 F/google-breakpad(23467): M F653A000 00000000 001DA000 1DDE4876E097DDAA58EFDE24F6B0AF230 libicuuc.so
+01-25 09:57:54.182 F/google-breakpad(23467): M F6718000 00000000 00049000 28AA4EE3518707C5C2CB494D27D7E42E0 libssl.so
+01-25 09:57:54.182 F/google-breakpad(23467): M F6761000 00000000 00131000 BDC34E23A0ACF7FB9DA4B37B834EB9330 libcrypto.so
+01-25 09:57:54.182 F/google-breakpad(23467): M F6893000 00000000 0005E000 231B6740DAFF45EFA880C2ACCA1711120 libsonivox.so
+01-25 09:57:54.182 F/google-breakpad(23467): M F68F6000 00000000 00009000 07D3E350957BE9781AA79CFE4D1615930 libhardware_legacy.so
+01-25 09:57:54.182 F/google-breakpad(23467): M F6900000 00000000 00004000 8F7402EB008A16522221FC3BDC3805430 libhardware.so
+01-25 09:57:54.182 F/google-breakpad(23467): M F6904000 00000000 00007000 836E381CA556529A0567A7404F6168440 libETC1.so
+01-25 09:57:54.182 F/google-breakpad(23467): M F690B000 00000000 00011000 9BABF059941D73F530F6D1845A7B05830 libGLESv2.so
+01-25 09:57:54.182 F/google-breakpad(23467): M F691C000 00000000 0000B000 F95AE8B6C538A7F0C5C8D1555FF8103C0 libGLESv1_CM.so
+01-25 09:57:54.182 F/google-breakpad(23467): M F691F000 00000000 000CF000 956D0B30A7C83D397182A912892E9C2C0 libEGL.so
+01-25 09:57:54.182 F/google-breakpad(23467): M F69F0000 00000000 00106000 1E685E8DD6A14FAC43BD47187FC352D10 libsqlite.so
+01-25 09:57:54.182 F/google-breakpad(23467): M F6AE8000 00000000 005BB000 EF07C6881EBD2EB937DAE1B6E28ACD500 libskia.so
+01-25 09:57:54.182 F/google-breakpad(23467): M F70A8000 00000000 0000A000 63F744099900E2D51FFD078EACB1B86C0 libcamera_metadata.so
+01-25 09:57:54.182 F/google-breakpad(23467): M F70B0000 00000000 00046000 C827130CE4D86CAD14313C93C29C73120 libcamera_client.so
+01-25 09:57:54.182 F/google-breakpad(23467): M F70F6000 00000000 00067000 80003CA0F4A276917CF1D46DF8511B910 libinputflinger.so
+01-25 09:57:54.183 F/google-breakpad(23467): M F715C000 00000000 0002E000 588B28D23521BFE45DA0922F9B2BC0780 libinput.so
+01-25 09:57:54.183 F/google-breakpad(23467): M F7182000 00000000 00090000 3A979946F483682F902E867B4461A7B50 libgui.so
+01-25 09:57:54.183 F/google-breakpad(23467): M F7212000 00000000 00013000 F63C997D5B56627993AB03838CFAA09C0 libui.so
+01-25 09:57:54.183 F/google-breakpad(23467): M F7225000 00000000 0000A000 DAC710CBBFF628A68578077BEDEAB7750 libnetutils.so
+01-25 09:57:54.183 F/google-breakpad(23467): M F722F000 00000000 00008000 B28981AE75F117447377C79B01B4F0FF0 libnativehelper.so
+01-25 09:57:54.183 F/google-breakpad(23467): M F7237000 00000000 00031000 3234F24F029666DF5464E0E6991800540 libexpat.so
+01-25 09:57:54.183 F/google-breakpad(23467): M F7268000 00000000 00047000 F02DEB41178B1A4DE3C2EE24549A2D860 libandroidfw.so
+01-25 09:57:54.183 F/google-breakpad(23467): M F72AF000 00000000 00003000 CC7E87B840DDAA0CA6D5E9640CD163880 libmemtrack.so
+01-25 09:57:54.183 F/google-breakpad(23467): M F72B3000 00000000 0000E000 969377A0F848DAECF436F7FE45DCBD620 libbacktrace.so
+01-25 09:57:54.183 F/google-breakpad(23467): M F72C1000 00000000 0003B000 9ADB6F900638406445920C1C4895A3100 libm.so
+01-25 09:57:54.183 F/google-breakpad(23467): M F72FC000 00000000 00114000 12FA662923A8693EE010FC5D185739100 libc.so
+01-25 09:57:54.183 F/google-breakpad(23467): M F7418000 00000000 000EC000 7F716BC28C5E66FE5A89C28109356D560 libc++.so
+01-25 09:57:54.183 F/google-breakpad(23467): M F7505000 00000000 0001A000 1EDB8B98CB4D94472F14CEEE7C68F6840 libselinux.so
+01-25 09:57:54.183 F/google-breakpad(23467): M F7511000 00000000 001A5000 4726889CE3166AE9E4D7B57F4ED5D8690 libandroid_runtime.so
+01-25 09:57:54.183 F/google-breakpad(23467): M F76B4000 00000000 0004A000 E55E2313EEDBEB4399F81A47356541DE0 libbinder.so
+01-25 09:57:54.183 F/google-breakpad(23467): M F76FE000 00000000 0000C000 3D4F877618F66DDE1EC5DB3C43F1F6060 liblog.so
+01-25 09:57:54.184 F/google-breakpad(23467): M F770A000 00000000 00028000 3843F9877B109321C4AFE68E66DD1E1E0 libutils.so
+01-25 09:57:54.184 F/google-breakpad(23467): M F7732000 00000000 0001A000 F1D443198CFEFCB1FDD91940941D39CE0 libcutils.so
+01-25 09:57:54.184 F/google-breakpad(23467): M F777A000 00000000 00045000 02B4F87528C887F70529FFDBCCFBE5260 linker
+01-25 09:57:54.186 F/google-breakpad(23467): M FFFFE000 00000000 00001000 4A7B1DECECE5E80AE3E4E2E4F1F2CDAE0 linux-gate.so
+01-25 09:57:54.186 F/google-breakpad(23467): -----END BREAKPAD MICRODUMP-----
diff --git a/src/processor/testdata/microdump.stackwalk-arm.out b/src/processor/testdata/microdump.stackwalk-arm.out
index 4fbeb8f1..ae018d37 100644
--- a/src/processor/testdata/microdump.stackwalk-arm.out
+++ b/src/processor/testdata/microdump.stackwalk-arm.out
@@ -1,36 +1,57 @@
Operating system: Android
OS VERSION INFO
-CPU: armv7l
+CPU: arm
2 CPUs
+GPU: OpenGL ES 3.0 V@104.0 AU@ (GIT@Id3510ff6dc)
+ Qualcomm
+ Adreno (TM) 330
+
Crash reason:
Crash address: 0x0
Process uptime: not available
Thread 0 (crashed)
0 breakpad_unittests!MicrodumpWriterTest_Setup_Test::TestBody [gtest.h : 1481 + 0x1]
-
+ r0 = 0x00000000 r1 = 0x00000000 r2 = 0x00000000 r3 = 0x00000000
+ r4 = 0xffea6900 r5 = 0xffea68f0 r6 = 0xffea68f8 r7 = 0xffea6904
+ r8 = 0xffea68e0 r9 = 0xffea6900 r10 = 0xffea6930 r12 = 0x00000000
+ fp = 0x00000ea2 sp = 0xffea68c0 lr = 0xaaaeb307 pc = 0xaaaeb307
Found by: given as instruction pointer in context
1 breakpad_unittests!testing::Test::Run [gtest.cc : 2435 + 0x17]
-
+ r4 = 0xaab431dc r5 = 0xab20d7d0 r6 = 0xab203478 r7 = 0x00000149
+ r8 = 0xab203588 r9 = 0xab20d7d0 r10 = 0xffea6f60 fp = 0xab2034d8
+ sp = 0xffea6f28 pc = 0xaab0a741
Found by: call frame info
2 breakpad_unittests!testing::TestInfo::Run [gtest.cc : 2610 + 0x5]
-
+ r4 = 0xab205448 r5 = 0xab203478 r6 = 0xf6d21cdd r7 = 0x00000149
+ r8 = 0xab203588 r9 = 0xab20d7d0 r10 = 0xffea6f60 fp = 0xab2034d8
+ sp = 0xffea6f50 pc = 0xaab0a875
Found by: call frame info
3 breakpad_unittests!testing::TestCase::Run [gtest.cc : 2728 + 0x3]
-
+ r4 = 0xab2054c8 r5 = 0x00000000 r6 = 0xf6d21cdd r7 = 0x00000149
+ r8 = 0xab203478 r9 = 0xab203588 r10 = 0x00000001 fp = 0xab2034d8
+ sp = 0xffea6f90 pc = 0xaab0a8fd
Found by: call frame info
4 breakpad_unittests!testing::internal::UnitTestImpl::RunAllTests [gtest.cc : 4591 + 0x3]
-
+ r4 = 0xab203478 r5 = 0xab203588 r6 = 0x00000000 r7 = 0x00000001
+ r8 = 0x00000000 r9 = 0xab2047f0 r10 = 0x00000001 fp = 0xab2034d8
+ sp = 0xffea6fc0 pc = 0xaab0aafd
Found by: call frame info
5 breakpad_unittests!testing::UnitTest::Run [gtest.cc : 2418 + 0x5]
-
+ r4 = 0x00000000 r5 = 0xab203478 r6 = 0x00000002 r7 = 0xaaae2c19
+ r8 = 0x00000000 r9 = 0x00000000 r10 = 0x00000000 fp = 0xffea706c
+ sp = 0xffea7018 pc = 0xaab09a61
Found by: call frame info
6 breakpad_unittests!main [gtest.h : 2326 + 0x3]
-
+ r4 = 0xffea702c r5 = 0xffea7074 r6 = 0x00000002 r7 = 0xaaae2c19
+ r8 = 0x00000000 r9 = 0x00000000 r10 = 0x00000000 fp = 0xffea706c
+ sp = 0xffea7028 pc = 0xaaae2c3b
Found by: call frame info
7 libc.so + 0x11e9d
-
+ r4 = 0xffea7074 r5 = 0xffea7080 r6 = 0x00000002 r7 = 0xaaae2c19
+ r8 = 0x00000000 r9 = 0x00000000 r10 = 0x00000000 fp = 0xffea706c
+ sp = 0xffea7040 pc = 0xf7025e9f
Found by: call frame info
Loaded modules:
diff --git a/src/processor/testdata/microdump.stackwalk-arm64.out b/src/processor/testdata/microdump.stackwalk-arm64.out
index 4f6cd972..e6ed4243 100644
--- a/src/processor/testdata/microdump.stackwalk-arm64.out
+++ b/src/processor/testdata/microdump.stackwalk-arm64.out
@@ -1,39 +1,105 @@
Operating system: Android
OS 64 VERSION INFO
-CPU: aarch64
+CPU: arm64
2 CPUs
+GPU: UNKNOWN
+
Crash reason:
Crash address: 0x0
Process uptime: not available
Thread 0 (crashed)
0 breakpad_unittests!MicrodumpWriterTest_Setup_Test::TestBody [microdump_writer_unittest.cc : 77 + 0xc]
-
+ x0 = 0x0000000000000000 x1 = 0x0000000000000000
+ x2 = 0x0000000000000000 x3 = 0x0000000000000000
+ x4 = 0x0000000000000000 x5 = 0x0000000000000000
+ x6 = 0x0000000000000000 x7 = 0x0000000000000000
+ x8 = 0x0000000000000000 x9 = 0x0000000000000000
+ x10 = 0x0000000000000000 x11 = 0x0000000000000000
+ x12 = 0x0000000000000000 x13 = 0x0000000000000000
+ x14 = 0x0000000000000000 x15 = 0x0000000000000000
+ x16 = 0x0000000000000000 x17 = 0x0000000000000000
+ x18 = 0x0000000000000000 x19 = 0x0000007fe2ba6a50
+ x20 = 0x0000007fe2ba65e0 x21 = 0x0000007fe2ba61e0
+ x22 = 0x000000555f6b4000 x23 = 0x0000007fe2ba6280
+ x24 = 0x0000007fe2ba6250 x25 = 0x000000555f6b4c51
+ x26 = 0x0000000000000e91 x27 = 0x0000007fe2ba6220
+ x28 = 0x0000007fe2ba61f0 fp = 0x0000007fe2ba6120
+ lr = 0x000000555f636f6c sp = 0x0000007fe2ba6120
+ pc = 0x000000555f636f6c
Found by: given as instruction pointer in context
1 breakpad_unittests!testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void> [gtest.cc : 2418 + 0x4]
-
+ x19 = 0x00000055955022d0 x20 = 0x00000055954ee170
+ x21 = 0x00000055954ee170 x22 = 0x00000055954ee390
+ x23 = 0x00000149f6d1624a x24 = 0x000000555f6df000
+ x25 = 0x0000000000000001 x26 = 0x00000149f6d16249
+ x27 = 0x0000000000000001 x28 = 0x000000555f6b35c9
+ fp = 0x0000007fe2ba7a50 sp = 0x0000007fe2ba7a50
+ pc = 0x000000555f66323c
Found by: call frame info
2 breakpad_unittests!testing::Test::Run [gtest.cc : 2435 + 0x14]
-
+ x19 = 0x00000055955022d0 x20 = 0x00000055954ee170
+ x21 = 0x00000055954ee170 x22 = 0x00000055954ee390
+ x23 = 0x00000149f6d1624a x24 = 0x000000555f6df000
+ x25 = 0x0000000000000001 x26 = 0x00000149f6d16249
+ x27 = 0x0000000000000001 x28 = 0x000000555f6b35c9
+ fp = 0x0000007fe2ba7a80 sp = 0x0000007fe2ba7a80
+ pc = 0x000000555f66448c
Found by: call frame info
3 breakpad_unittests!testing::TestInfo::Run [gtest.cc : 2610 + 0x4]
-
+ x19 = 0x00000055954f3890 x20 = 0x00000055955022d0
+ x21 = 0x00000055954ee170 x22 = 0x00000055954ee390
+ x23 = 0x00000149f6d1624a x24 = 0x000000555f6df000
+ x25 = 0x0000000000000001 x26 = 0x00000149f6d16249
+ x27 = 0x0000000000000001 x28 = 0x000000555f6b35c9
+ fp = 0x0000007fe2ba7aa0 sp = 0x0000007fe2ba7aa0
+ pc = 0x000000555f6645b8
Found by: call frame info
4 breakpad_unittests!testing::TestCase::Run [gtest.cc : 2728 + 0x0]
-
+ x19 = 0x00000055954f39a0 x20 = 0x00000055954ee170
+ x21 = 0x00000055954ee390 x22 = 0x0000000000000001
+ x23 = 0x00000149f6d1624a x24 = 0x000000555f6df000
+ x25 = 0x0000000000000001 x26 = 0x00000149f6d16249
+ x27 = 0x0000000000000001 x28 = 0x000000555f6b35c9
+ fp = 0x0000007fe2ba7ae0 sp = 0x0000007fe2ba7ae0
+ pc = 0x000000555f664674
Found by: call frame info
5 breakpad_unittests!testing::internal::UnitTestImpl::RunAllTests [gtest.cc : 4591 + 0x0]
-
+ x19 = 0x00000055954ee170 x20 = 0x0000000000000000
+ x21 = 0x00000055954ee390 x22 = 0x0000000000000002
+ x23 = 0x0000000000000000 x24 = 0x000000555f6df000
+ x25 = 0x0000000000000001 x26 = 0x00000149f6d16249
+ x27 = 0x0000000000000001 x28 = 0x000000555f6b35c9
+ fp = 0x0000007fe2ba7b20 sp = 0x0000007fe2ba7b20
+ pc = 0x000000555f66494c
Found by: call frame info
6 breakpad_unittests!testing::UnitTest::Run [gtest.cc : 2418 + 0x4]
-
+ x19 = 0x0000000000000000 x20 = 0x00000055954ee170
+ x21 = 0x0000000000000002 x22 = 0x000000555f62b360
+ x23 = 0x0000000000000000 x24 = 0x0000000000000000
+ x25 = 0x0000000000000000 x26 = 0x0000000000000000
+ x27 = 0x0000000000000000 x28 = 0x0000000000000000
+ fp = 0x0000007fe2ba7bc0 sp = 0x0000007fe2ba7bc0
+ pc = 0x000000555f664b68
Found by: call frame info
7 breakpad_unittests!main [gtest.h : 2326 + 0x0]
-
+ x19 = 0x0000007fe2ba7c1c x20 = 0x0000007fe2ba7c88
+ x21 = 0x0000000000000002 x22 = 0x000000555f62b360
+ x23 = 0x0000000000000000 x24 = 0x0000000000000000
+ x25 = 0x0000000000000000 x26 = 0x0000000000000000
+ x27 = 0x0000000000000000 x28 = 0x0000000000000000
+ fp = 0x0000007fe2ba7bf0 sp = 0x0000007fe2ba7bf0
+ pc = 0x000000555f62b398
Found by: call frame info
8 libc.so + 0x17388
-
+ x19 = 0x0000007fe2ba7ca0 x20 = 0x0000007fe2ba7c88
+ x21 = 0x0000000000000002 x22 = 0x000000555f62b360
+ x23 = 0x0000000000000000 x24 = 0x0000000000000000
+ x25 = 0x0000000000000000 x26 = 0x0000000000000000
+ x27 = 0x0000000000000000 x28 = 0x0000000000000000
+ fp = 0x0000007fe2ba7c20 sp = 0x0000007fe2ba7c20
+ pc = 0x0000007f802ac38c
Found by: call frame info
Loaded modules:
diff --git a/src/processor/testdata/microdump.stackwalk.machine_readable-arm.out b/src/processor/testdata/microdump.stackwalk.machine_readable-arm.out
index 55abe0d3..869fc4d8 100644
--- a/src/processor/testdata/microdump.stackwalk.machine_readable-arm.out
+++ b/src/processor/testdata/microdump.stackwalk.machine_readable-arm.out
@@ -1,5 +1,6 @@
OS|Android|OS VERSION INFO
-CPU|armv7l||2
+CPU|arm||2
+GPU|OpenGL ES 3.0 V@104.0 AU@ (GIT@Id3510ff6dc)|Qualcomm|Adreno (TM) 330
Crash||0x0|0
Module|breakpad_unittests||breakpad_unittests|DA7778FB66018A4E9B4110ED06E730D00|0xaaacd000|0xaab48fff|0
Module|libnetd_client.so||libnetd_client.so|56B149396A4DAF176E26B4A85DA87BF30|0xf6fca000|0xf6fcdfff|0
diff --git a/src/processor/testdata/microdump.stackwalk.machine_readable-arm64.out b/src/processor/testdata/microdump.stackwalk.machine_readable-arm64.out
index eb482ee4..7734dda5 100644
--- a/src/processor/testdata/microdump.stackwalk.machine_readable-arm64.out
+++ b/src/processor/testdata/microdump.stackwalk.machine_readable-arm64.out
@@ -1,5 +1,6 @@
OS|Android|OS 64 VERSION INFO
-CPU|aarch64||2
+CPU|arm64||2
+GPU|||
Crash||0x0|0
Module|breakpad_unittests||breakpad_unittests|D6D1FEC9A15DE7F38A236898871A2E770|0x555f608000|0x555f6c7fff|0
Module|libnetd_client.so||libnetd_client.so|7735F44BA6D7C27FD5C3636A43369B7C0|0x7f801f6000|0x7f80208fff|0
diff --git a/src/processor/testdata/minidump2.stackwalk.machine_readable.out b/src/processor/testdata/minidump2.stackwalk.machine_readable.out
index 60f8af4c..c976555d 100644
--- a/src/processor/testdata/minidump2.stackwalk.machine_readable.out
+++ b/src/processor/testdata/minidump2.stackwalk.machine_readable.out
@@ -1,5 +1,6 @@
OS|Windows NT|5.1.2600 Service Pack 2
CPU|x86|GenuineIntel family 6 model 13 stepping 8|1
+GPU|||
Crash|EXCEPTION_ACCESS_VIOLATION_WRITE|0x45|0
Module|test_app.exe||test_app.pdb|5A9832E5287241C1838ED98914E9B7FF1|0x00400000|0x0042cfff|1
Module|dbghelp.dll|5.1.2600.2180|dbghelp.pdb|39559573E21B46F28E286923BE9E6A761|0x59a60000|0x59b00fff|0
diff --git a/src/processor/testdata/minidump2.stackwalk.out b/src/processor/testdata/minidump2.stackwalk.out
index 784c7e57..d04234ab 100644
--- a/src/processor/testdata/minidump2.stackwalk.out
+++ b/src/processor/testdata/minidump2.stackwalk.out
@@ -4,6 +4,8 @@ CPU: x86
GenuineIntel family 6 model 13 stepping 8
1 CPU
+GPU: UNKNOWN
+
Crash reason: EXCEPTION_ACCESS_VIOLATION_WRITE
Crash address: 0x45
Process uptime: 0 seconds
diff --git a/src/processor/testdata/minidump_32bit_crash_addr.dmp b/src/processor/testdata/minidump_32bit_crash_addr.dmp
new file mode 100644
index 00000000..78becc6f
--- /dev/null
+++ b/src/processor/testdata/minidump_32bit_crash_addr.dmp
Binary files differ
diff --git a/src/processor/testdata/symbols/microdump/crash_example/6E72E2F1A5F59AB3D51356FDFE394D490/crash_example.sym b/src/processor/testdata/symbols/microdump/crash_example/6E72E2F1A5F59AB3D51356FDFE394D490/crash_example.sym
new file mode 100644
index 00000000..a5e31a06
--- /dev/null
+++ b/src/processor/testdata/symbols/microdump/crash_example/6E72E2F1A5F59AB3D51356FDFE394D490/crash_example.sym
@@ -0,0 +1,56 @@
+MODULE Linux mips 6E72E2F1A5F59AB3D51356FDFE394D490 crash_example
+FILE 0 /s/breakpad/src/tools/linux/crash_example.cc
+FUNC 80a8 9c 0 google_breakpad::MinidumpDescriptor::MinidumpDescriptor
+80a8 20 75 8
+80c8 38 78 8
+8100 10 78 8
+8110 14 78 8
+8124 10 78 8
+8134 10 78 8
+FUNC 815c a0 0 DumpCallback
+815c 2c 13 37
+8188 1c 14 37
+81a4 14 15 37
+81b8 1c 15 37
+81d4 14 17 37
+81e8 4 18 37
+81ec 10 19 37
+FUNC 81fc 2c 0 Leaf
+81fc 10 21 37
+820c 8 22 37
+8214 8 23 37
+821c 4 25 37
+8220 8 26 37
+FUNC 8228 58 0 blaTest
+8228 1c 28 37
+8244 c 29 37
+8250 20 30 37
+8270 10 31 37
+FUNC 8280 40 0 Crash
+8280 18 33 37
+8298 4 34 37
+829c 14 35 37
+82b0 10 36 37
+FUNC 831c f4 0 main
+831c 2c 40 37
+8348 c 40 37
+8354 18 41 37
+836c 34 43 37
+83a0 10 44 37
+83b0 4 45 37
+83b4 14 43 37
+83c8 18 45 37
+83e0 30 46 37
+PUBLIC 831c 0 main
+STACK CFI INIT 8228 58 .cfa: $sp 0 + .ra: $ra
+STACK CFI 822c .cfa: $sp 32 +
+STACK CFI 8234 $gp: .cfa -16 + ^ .ra: .cfa -8 + ^
+STACK CFI 827c $gp: $gp .cfa: $sp 0 + .ra: .ra
+STACK CFI INIT 8280 40 .cfa: $sp 0 + .ra: $ra
+STACK CFI 8284 .cfa: $sp 32 +
+STACK CFI 828c $gp: .cfa -16 + ^ .ra: .cfa -8 + ^
+STACK CFI 82bc $gp: $gp .cfa: $sp 0 + .ra: .ra
+STACK CFI INIT 831c f4 .cfa: $sp 0 + .ra: $ra
+STACK CFI 8320 .cfa: $sp 352 +
+STACK CFI 832c $gp: .cfa -16 + ^ $s0: .cfa -24 + ^ .ra: .cfa -8 + ^
+STACK CFI 840c $gp: $gp $s0: $s0 .cfa: $sp 0 + .ra: .ra
diff --git a/src/processor/testdata/symbols/microdump/crash_example/8F36148CC4647A8116CAF2A25F591F570/crash_example.sym b/src/processor/testdata/symbols/microdump/crash_example/8F36148CC4647A8116CAF2A25F591F570/crash_example.sym
new file mode 100644
index 00000000..407d2305
--- /dev/null
+++ b/src/processor/testdata/symbols/microdump/crash_example/8F36148CC4647A8116CAF2A25F591F570/crash_example.sym
@@ -0,0 +1,48 @@
+MODULE Linux mips 8F36148CC4647A8116CAF2A25F591F570 crash_example
+FILE 0 /home/rtrk/chromium_mips/chromium/src/out-android-mips/Debug/../../breakpad/src/tools/linux/crash_example.cc
+FUNC 2ea4 b4 0 google_breakpad::MinidumpDescriptor::MinidumpDescriptor
+2ea4 20 75 6
+2ec4 40 78 6
+2f04 18 78 6
+2f1c 14 78 6
+2f30 18 78 6
+2f48 10 78 6
+FUNC 2f6c c4 0 DumpCallback
+2f6c 28 13 33
+2f94 28 14 33
+2fbc 1c 15 33
+2fd8 28 15 33
+3000 1c 17 33
+301c 4 18 33
+3020 10 19 33
+FUNC 3030 28 0 Leaf
+3030 4 21 33
+3034 c 22 33
+3040 c 23 33
+304c 4 25 33
+3050 8 26 33
+FUNC 3058 60 0 blaTest
+3058 1c 28 33
+3074 c 29 33
+3080 28 30 33
+30a8 10 31 33
+FUNC 30b8 48 0 Crash
+30b8 18 33 33
+30d0 4 34 33
+30d4 1c 35 33
+30f0 10 36 33
+FUNC 316c 120 0 main
+316c 24 40 33
+3190 c 40 33
+319c 20 41 33
+31bc 40 43 33
+31fc 18 44 33
+3214 4 45 33
+3218 1c 43 33
+3234 20 45 33
+3254 38 46 33
+PUBLIC 316c 0 main
+STACK CFI INIT 30b8 48 .cfa: $sp 39792944 + .ra: $ra
+STACK CFI 30c8 .cfa: $sp 40 +
+STACK CFI 30d0 .ra: .cfa -4 + ^
+STACK CFI 30f8 .cfa: $sp 0 + .ra: .ra
diff --git a/src/processor/tokenize.cc b/src/processor/tokenize.cc
index f468120c..8fce87a2 100644
--- a/src/processor/tokenize.cc
+++ b/src/processor/tokenize.cc
@@ -36,7 +36,7 @@
namespace google_breakpad {
-#ifdef _WIN32
+#ifdef _MSC_VER
#define strtok_r strtok_s
#endif
diff --git a/src/processor/windows_frame_info.h b/src/processor/windows_frame_info.h
index c92c610c..f96e0a43 100644
--- a/src/processor/windows_frame_info.h
+++ b/src/processor/windows_frame_info.h
@@ -118,7 +118,7 @@ struct WindowsFrameInfo {
uint64_t &code_size) {
// The format of a STACK WIN record is documented at:
//
- // http://code.google.com/p/google-breakpad/wiki/SymbolFiles
+ // https://chromium.googlesource.com/breakpad/breakpad/+/master/docs/symbol_files.md
std::vector<char> buffer;
StringToVector(string, buffer);
diff --git a/src/testing/CHANGES b/src/testing/CHANGES
deleted file mode 100644
index 90f88a59..00000000
--- a/src/testing/CHANGES
+++ /dev/null
@@ -1,92 +0,0 @@
-Changes for 1.6.0:
-
-* Compilation is much faster and uses much less memory, especially
- when the constructor and destructor of a mock class are moved out of
- the class body.
-* New matchers: Pointwise(), Each().
-* New actions: ReturnPointee() and ReturnRefOfCopy().
-* CMake support.
-* Project files for Visual Studio 2010.
-* AllOf() and AnyOf() can handle up-to 10 arguments now.
-* Google Mock doctor understands Clang error messages now.
-* SetArgPointee<> now accepts string literals.
-* gmock_gen.py handles storage specifier macros and template return
- types now.
-* Compatibility fixes.
-* Bug fixes and implementation clean-ups.
-* Potentially incompatible changes: disables the harmful 'make install'
- command in autotools.
-
-Potentially breaking changes:
-
-* The description string for MATCHER*() changes from Python-style
- interpolation to an ordinary C++ string expression.
-* SetArgumentPointee is deprecated in favor of SetArgPointee.
-* Some non-essential project files for Visual Studio 2005 are removed.
-
-Changes for 1.5.0:
-
- * New feature: Google Mock can be safely used in multi-threaded tests
- on platforms having pthreads.
- * New feature: function for printing a value of arbitrary type.
- * New feature: function ExplainMatchResult() for easy definition of
- composite matchers.
- * The new matcher API lets user-defined matchers generate custom
- explanations more directly and efficiently.
- * Better failure messages all around.
- * NotNull() and IsNull() now work with smart pointers.
- * Field() and Property() now work when the matcher argument is a pointer
- passed by reference.
- * Regular expression matchers on all platforms.
- * Added GCC 4.0 support for Google Mock Doctor.
- * Added gmock_all_test.cc for compiling most Google Mock tests
- in a single file.
- * Significantly cleaned up compiler warnings.
- * Bug fixes, better test coverage, and implementation clean-ups.
-
- Potentially breaking changes:
-
- * Custom matchers defined using MatcherInterface or MakePolymorphicMatcher()
- need to be updated after upgrading to Google Mock 1.5.0; matchers defined
- using MATCHER or MATCHER_P* aren't affected.
- * Dropped support for 'make install'.
-
-Changes for 1.4.0 (we skipped 1.2.* and 1.3.* to match the version of
-Google Test):
-
- * Works in more environments: Symbian and minGW, Visual C++ 7.1.
- * Lighter weight: comes with our own implementation of TR1 tuple (no
- more dependency on Boost!).
- * New feature: --gmock_catch_leaked_mocks for detecting leaked mocks.
- * New feature: ACTION_TEMPLATE for defining templatized actions.
- * New feature: the .After() clause for specifying expectation order.
- * New feature: the .With() clause for for specifying inter-argument
- constraints.
- * New feature: actions ReturnArg<k>(), ReturnNew<T>(...), and
- DeleteArg<k>().
- * New feature: matchers Key(), Pair(), Args<...>(), AllArgs(), IsNull(),
- and Contains().
- * New feature: utility class MockFunction<F>, useful for checkpoints, etc.
- * New feature: functions Value(x, m) and SafeMatcherCast<T>(m).
- * New feature: copying a mock object is rejected at compile time.
- * New feature: a script for fusing all Google Mock and Google Test
- source files for easy deployment.
- * Improved the Google Mock doctor to diagnose more diseases.
- * Improved the Google Mock generator script.
- * Compatibility fixes for Mac OS X and gcc.
- * Bug fixes and implementation clean-ups.
-
-Changes for 1.1.0:
-
- * New feature: ability to use Google Mock with any testing framework.
- * New feature: macros for easily defining new matchers
- * New feature: macros for easily defining new actions.
- * New feature: more container matchers.
- * New feature: actions for accessing function arguments and throwing
- exceptions.
- * Improved the Google Mock doctor script for diagnosing compiler errors.
- * Bug fixes and implementation clean-ups.
-
-Changes for 1.0.0:
-
- * Initial Open Source release of Google Mock
diff --git a/src/testing/CMakeLists.txt b/src/testing/CMakeLists.txt
deleted file mode 100644
index ded9ca9d..00000000
--- a/src/testing/CMakeLists.txt
+++ /dev/null
@@ -1,170 +0,0 @@
-########################################################################
-# CMake build script for Google Mock.
-#
-# To run the tests for Google Mock itself on Linux, use 'make test' or
-# ctest. You can select which tests to run using 'ctest -R regex'.
-# For more options, run 'ctest --help'.
-
-# BUILD_SHARED_LIBS is a standard CMake variable, but we declare it here to
-# make it prominent in the GUI.
-option(BUILD_SHARED_LIBS "Build shared libraries (DLLs)." OFF)
-
-option(gmock_build_tests "Build all of Google Mock's own tests." OFF)
-
-# A directory to find Google Test sources.
-if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/gtest/CMakeLists.txt")
- set(gtest_dir gtest)
-else()
- set(gtest_dir ../gtest)
-endif()
-
-# Defines pre_project_set_up_hermetic_build() and set_up_hermetic_build().
-include("${gtest_dir}/cmake/hermetic_build.cmake" OPTIONAL)
-
-if (COMMAND pre_project_set_up_hermetic_build)
- # Google Test also calls hermetic setup functions from add_subdirectory,
- # although its changes will not affect things at the current scope.
- pre_project_set_up_hermetic_build()
-endif()
-
-########################################################################
-#
-# Project-wide settings
-
-# Name of the project.
-#
-# CMake files in this project can refer to the root source directory
-# as ${gmock_SOURCE_DIR} and to the root binary directory as
-# ${gmock_BINARY_DIR}.
-# Language "C" is required for find_package(Threads).
-project(gmock CXX C)
-cmake_minimum_required(VERSION 2.6.2)
-
-if (COMMAND set_up_hermetic_build)
- set_up_hermetic_build()
-endif()
-
-# Instructs CMake to process Google Test's CMakeLists.txt and add its
-# targets to the current scope. We are placing Google Test's binary
-# directory in a subdirectory of our own as VC compilation may break
-# if they are the same (the default).
-add_subdirectory("${gtest_dir}" "${gmock_BINARY_DIR}/gtest")
-
-# Although Google Test's CMakeLists.txt calls this function, the
-# changes there don't affect the current scope. Therefore we have to
-# call it again here.
-config_compiler_and_linker() # from ${gtest_dir}/cmake/internal_utils.cmake
-
-# Adds Google Mock's and Google Test's header directories to the search path.
-include_directories("${gmock_SOURCE_DIR}/include"
- "${gmock_SOURCE_DIR}"
- "${gtest_SOURCE_DIR}/include"
- # This directory is needed to build directly from Google
- # Test sources.
- "${gtest_SOURCE_DIR}")
-
-########################################################################
-#
-# Defines the gmock & gmock_main libraries. User tests should link
-# with one of them.
-
-# Google Mock libraries. We build them using more strict warnings than what
-# are used for other targets, to ensure that Google Mock can be compiled by
-# a user aggressive about warnings.
-cxx_library(gmock
- "${cxx_strict}"
- "${gtest_dir}/src/gtest-all.cc"
- src/gmock-all.cc)
-
-cxx_library(gmock_main
- "${cxx_strict}"
- "${gtest_dir}/src/gtest-all.cc"
- src/gmock-all.cc
- src/gmock_main.cc)
-
-########################################################################
-#
-# Google Mock's own tests.
-#
-# You can skip this section if you aren't interested in testing
-# Google Mock itself.
-#
-# The tests are not built by default. To build them, set the
-# gmock_build_tests option to ON. You can do it by running ccmake
-# or specifying the -Dgmock_build_tests=ON flag when running cmake.
-
-if (gmock_build_tests)
- # This must be set in the root directory for the tests to be run by
- # 'make test' or ctest.
- enable_testing()
-
- ############################################################
- # C++ tests built with standard compiler flags.
-
- cxx_test(gmock-actions_test gmock_main)
- cxx_test(gmock-cardinalities_test gmock_main)
- cxx_test(gmock-generated-actions_test gmock_main)
- cxx_test(gmock-generated-function-mockers_test gmock_main)
- cxx_test(gmock-generated-internal-utils_test gmock_main)
- cxx_test(gmock-generated-matchers_test gmock_main)
- cxx_test(gmock-internal-utils_test gmock_main)
- cxx_test(gmock-matchers_test gmock_main)
- cxx_test(gmock-more-actions_test gmock_main)
- cxx_test(gmock-nice-strict_test gmock_main)
- cxx_test(gmock-port_test gmock_main)
- cxx_test(gmock-spec-builders_test gmock_main)
- cxx_test(gmock_link_test gmock_main test/gmock_link2_test.cc)
- cxx_test(gmock_test gmock_main)
-
- if (CMAKE_USE_PTHREADS_INIT)
- cxx_test(gmock_stress_test gmock)
- endif()
-
- # gmock_all_test is commented to save time building and running tests.
- # Uncomment if necessary.
- # cxx_test(gmock_all_test gmock_main)
-
- ############################################################
- # C++ tests built with non-standard compiler flags.
-
- cxx_library(gmock_main_no_exception "${cxx_no_exception}"
- "${gtest_dir}/src/gtest-all.cc" src/gmock-all.cc src/gmock_main.cc)
-
- cxx_library(gmock_main_no_rtti "${cxx_no_rtti}"
- "${gtest_dir}/src/gtest-all.cc" src/gmock-all.cc src/gmock_main.cc)
-
- cxx_library(gmock_main_use_own_tuple "${cxx_use_own_tuple}"
- "${gtest_dir}/src/gtest-all.cc" src/gmock-all.cc src/gmock_main.cc)
-
- cxx_test_with_flags(gmock-more-actions_no_exception_test "${cxx_no_exception}"
- gmock_main_no_exception test/gmock-more-actions_test.cc)
-
- cxx_test_with_flags(gmock_no_rtti_test "${cxx_no_rtti}"
- gmock_main_no_rtti test/gmock-spec-builders_test.cc)
-
- cxx_test_with_flags(gmock_use_own_tuple_test "${cxx_use_own_tuple}"
- gmock_main_use_own_tuple test/gmock-spec-builders_test.cc)
-
- cxx_shared_library(shared_gmock_main "${cxx_default}"
- "${gtest_dir}/src/gtest-all.cc" src/gmock-all.cc src/gmock_main.cc)
-
- # Tests that a binary can be built with Google Mock as a shared library. On
- # some system configurations, it may not possible to run the binary without
- # knowing more details about the system configurations. We do not try to run
- # this binary. To get a more robust shared library coverage, configure with
- # -DBUILD_SHARED_LIBS=ON.
- cxx_executable_with_flags(shared_gmock_test_ "${cxx_default}"
- shared_gmock_main test/gmock-spec-builders_test.cc)
- set_target_properties(shared_gmock_test_
- PROPERTIES
- COMPILE_DEFINITIONS "GTEST_LINKED_AS_SHARED_LIBRARY=1")
-
- ############################################################
- # Python tests.
-
- cxx_executable(gmock_leak_test_ test gmock_main)
- py_test(gmock_leak_test)
-
- cxx_executable(gmock_output_test_ test gmock)
- py_test(gmock_output_test)
-endif()
diff --git a/src/testing/CONTRIBUTORS b/src/testing/CONTRIBUTORS
deleted file mode 100644
index 6e9ae362..00000000
--- a/src/testing/CONTRIBUTORS
+++ /dev/null
@@ -1,40 +0,0 @@
-# This file contains a list of people who've made non-trivial
-# contribution to the Google C++ Mocking Framework project. People
-# who commit code to the project are encouraged to add their names
-# here. Please keep the list sorted by first names.
-
-Benoit Sigoure <tsuna@google.com>
-Bogdan Piloca <boo@google.com>
-Chandler Carruth <chandlerc@google.com>
-Dave MacLachlan <dmaclach@gmail.com>
-David Anderson <danderson@google.com>
-Dean Sturtevant
-Gene Volovich <gv@cite.com>
-Hal Burch <gmock@hburch.com>
-Jeffrey Yasskin <jyasskin@google.com>
-Jim Keller <jimkeller@google.com>
-Joe Walnes <joe@truemesh.com>
-Jon Wray <jwray@google.com>
-Keir Mierle <mierle@gmail.com>
-Keith Ray <keith.ray@gmail.com>
-Kostya Serebryany <kcc@google.com>
-Lev Makhlis
-Manuel Klimek <klimek@google.com>
-Mario Tanev <radix@google.com>
-Mark Paskin
-Markus Heule <markus.heule@gmail.com>
-Matthew Simmons <simmonmt@acm.org>
-Mike Bland <mbland@google.com>
-Neal Norwitz <nnorwitz@gmail.com>
-Nermin Ozkiranartli <nermin@google.com>
-Owen Carlsen <ocarlsen@google.com>
-Paneendra Ba <paneendra@google.com>
-Paul Menage <menage@google.com>
-Piotr Kaminski <piotrk@google.com>
-Russ Rufer <russ@pentad.com>
-Sverre Sundsdal <sundsdal@gmail.com>
-Takeshi Yoshino <tyoshino@google.com>
-Vadim Berman <vadimb@google.com>
-Vlad Losev <vladl@google.com>
-Wolfgang Klier <wklier@google.com>
-Zhanyong Wan <wan@google.com>
diff --git a/src/testing/LICENSE b/src/testing/LICENSE
deleted file mode 100644
index 1941a11f..00000000
--- a/src/testing/LICENSE
+++ /dev/null
@@ -1,28 +0,0 @@
-Copyright 2008, Google Inc.
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
- * Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above
-copyright notice, this list of conditions and the following disclaimer
-in the documentation and/or other materials provided with the
-distribution.
- * Neither the name of Google Inc. nor the names of its
-contributors may be used to endorse or promote products derived from
-this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/src/testing/Makefile.am b/src/testing/Makefile.am
deleted file mode 100644
index 0afce2f8..00000000
--- a/src/testing/Makefile.am
+++ /dev/null
@@ -1,213 +0,0 @@
-# Automake file
-
-# Nonstandard package files for distribution.
-EXTRA_DIST =
-
-# We may need to build our internally packaged gtest. If so, it will be
-# included in the 'subdirs' variable.
-SUBDIRS = $(subdirs)
-
-# This is generated by the configure script, so clean it for distribution.
-DISTCLEANFILES = scripts/gmock-config
-
-# We define the global AM_CPPFLAGS as everything we compile includes from these
-# directories.
-AM_CPPFLAGS = $(GTEST_CPPFLAGS) -I$(srcdir)/include
-
-# Modifies compiler and linker flags for pthreads compatibility.
-if HAVE_PTHREADS
- AM_CXXFLAGS = @PTHREAD_CFLAGS@ -DGTEST_HAS_PTHREAD=1
- AM_LIBS = @PTHREAD_LIBS@
-endif
-
-# Build rules for libraries.
-lib_LTLIBRARIES = lib/libgmock.la lib/libgmock_main.la
-
-lib_libgmock_la_SOURCES = src/gmock-all.cc
-
-pkginclude_HEADERS = \
- include/gmock/gmock-actions.h \
- include/gmock/gmock-cardinalities.h \
- include/gmock/gmock-generated-actions.h \
- include/gmock/gmock-generated-function-mockers.h \
- include/gmock/gmock-generated-matchers.h \
- include/gmock/gmock-generated-nice-strict.h \
- include/gmock/gmock-matchers.h \
- include/gmock/gmock-more-actions.h \
- include/gmock/gmock-spec-builders.h \
- include/gmock/gmock.h
-
-pkginclude_internaldir = $(pkgincludedir)/internal
-pkginclude_internal_HEADERS = \
- include/gmock/internal/gmock-generated-internal-utils.h \
- include/gmock/internal/gmock-internal-utils.h \
- include/gmock/internal/gmock-port.h
-
-lib_libgmock_main_la_SOURCES = src/gmock_main.cc
-lib_libgmock_main_la_LIBADD = lib/libgmock.la
-
-# Build rules for tests. Automake's naming for some of these variables isn't
-# terribly obvious, so this is a brief reference:
-#
-# TESTS -- Programs run automatically by "make check"
-# check_PROGRAMS -- Programs built by "make check" but not necessarily run
-
-TESTS=
-check_PROGRAMS=
-AM_LDFLAGS = $(GTEST_LDFLAGS)
-
-# This exercises all major components of Google Mock. It also
-# verifies that libgmock works.
-TESTS += test/gmock-spec-builders_test
-check_PROGRAMS += test/gmock-spec-builders_test
-test_gmock_spec_builders_test_SOURCES = test/gmock-spec-builders_test.cc
-test_gmock_spec_builders_test_LDADD = $(GTEST_LIBS) lib/libgmock.la
-
-# This tests using Google Mock in multiple translation units. It also
-# verifies that libgmock_main and libgmock work.
-TESTS += test/gmock_link_test
-check_PROGRAMS += test/gmock_link_test
-test_gmock_link_test_SOURCES = \
- test/gmock_link2_test.cc \
- test/gmock_link_test.cc \
- test/gmock_link_test.h
-test_gmock_link_test_LDADD = $(GTEST_LIBS) lib/libgmock_main.la lib/libgmock.la
-
-if HAVE_PYTHON
- # Tests that fused gmock files compile and work.
- TESTS += test/gmock_fused_test
- check_PROGRAMS += test/gmock_fused_test
- test_gmock_fused_test_SOURCES = \
- fused-src/gmock-gtest-all.cc \
- fused-src/gmock/gmock.h \
- fused-src/gmock_main.cc \
- fused-src/gtest/gtest.h \
- test/gmock_test.cc
- test_gmock_fused_test_CPPFLAGS = -I"$(srcdir)/fused-src"
-endif
-
-# Google Mock source files that we don't compile directly.
-GMOCK_SOURCE_INGLUDES = \
- src/gmock-cardinalities.cc \
- src/gmock-internal-utils.cc \
- src/gmock-matchers.cc \
- src/gmock-spec-builders.cc \
- src/gmock.cc
-
-EXTRA_DIST += $(GMOCK_SOURCE_INGLUDES)
-
-# C++ tests that we don't compile using autotools.
-EXTRA_DIST += \
- test/gmock-actions_test.cc \
- test/gmock-cardinalities_test.cc \
- test/gmock-generated-actions_test.cc \
- test/gmock-generated-function-mockers_test.cc \
- test/gmock-generated-internal-utils_test.cc \
- test/gmock-generated-matchers_test.cc \
- test/gmock-internal-utils_test.cc \
- test/gmock-matchers_test.cc \
- test/gmock-more-actions_test.cc \
- test/gmock-nice-strict_test.cc \
- test/gmock-port_test.cc \
- test/gmock_all_test.cc
-
-# Python tests, which we don't run using autotools.
-EXTRA_DIST += \
- test/gmock_leak_test.py \
- test/gmock_leak_test_.cc \
- test/gmock_output_test.py \
- test/gmock_output_test_.cc \
- test/gmock_output_test_golden.txt \
- test/gmock_test_utils.py
-
-# Nonstandard package files for distribution.
-EXTRA_DIST += \
- CHANGES \
- CONTRIBUTORS \
- make/Makefile
-
-# Pump scripts for generating Google Mock headers.
-# TODO(chandlerc@google.com): automate the generation of *.h from *.h.pump.
-EXTRA_DIST += \
- include/gmock/gmock-generated-actions.h.pump \
- include/gmock/gmock-generated-function-mockers.h.pump \
- include/gmock/gmock-generated-matchers.h.pump \
- include/gmock/gmock-generated-nice-strict.h.pump \
- include/gmock/internal/gmock-generated-internal-utils.h.pump
-
-# Script for fusing Google Mock and Google Test source files.
-EXTRA_DIST += scripts/fuse_gmock_files.py
-
-# The Google Mock Generator tool from the cppclean project.
-EXTRA_DIST += \
- scripts/generator/LICENSE \
- scripts/generator/README \
- scripts/generator/README.cppclean \
- scripts/generator/cpp/__init__.py \
- scripts/generator/cpp/ast.py \
- scripts/generator/cpp/gmock_class.py \
- scripts/generator/cpp/keywords.py \
- scripts/generator/cpp/tokenize.py \
- scripts/generator/cpp/utils.py \
- scripts/generator/gmock_gen.py
-
-# CMake scripts.
-EXTRA_DIST += \
- CMakeLists.txt
-
-# Microsoft Visual Studio 2005 projects.
-EXTRA_DIST += \
- msvc/2005/gmock.sln \
- msvc/2005/gmock.vcproj \
- msvc/2005/gmock_config.vsprops \
- msvc/2005/gmock_main.vcproj \
- msvc/2005/gmock_test.vcproj
-
-# Microsoft Visual Studio 2010 projects.
-EXTRA_DIST += \
- msvc/2010/gmock.sln \
- msvc/2010/gmock.vcxproj \
- msvc/2010/gmock_config.props \
- msvc/2010/gmock_main.vcxproj \
- msvc/2010/gmock_test.vcxproj
-
-if HAVE_PYTHON
-# gmock_test.cc does not really depend on files generated by the
-# fused-gmock-internal rule. However, gmock_test.o does, and it is
-# important to include test/gmock_test.cc as part of this rule in order to
-# prevent compiling gmock_test.o until all dependent files have been
-# generated.
-$(test_gmock_fused_test_SOURCES): fused-gmock-internal
-
-# TODO(vladl@google.com): Find a way to add Google Tests's sources here.
-fused-gmock-internal: $(pkginclude_HEADERS) $(pkginclude_internal_HEADERS) \
- $(lib_libgmock_la_SOURCES) $(GMOCK_SOURCE_INGLUDES) \
- $(lib_libgmock_main_la_SOURCES) \
- scripts/fuse_gmock_files.py
- mkdir -p "$(srcdir)/fused-src"
- chmod -R u+w "$(srcdir)/fused-src"
- rm -f "$(srcdir)/fused-src/gtest/gtest.h"
- rm -f "$(srcdir)/fused-src/gmock/gmock.h"
- rm -f "$(srcdir)/fused-src/gmock-gtest-all.cc"
- "$(srcdir)/scripts/fuse_gmock_files.py" "$(srcdir)/fused-src"
- cp -f "$(srcdir)/src/gmock_main.cc" "$(srcdir)/fused-src"
-
-maintainer-clean-local:
- rm -rf "$(srcdir)/fused-src"
-endif
-
-# Death tests may produce core dumps in the build directory. In case
-# this happens, clean them to keep distcleancheck happy.
-CLEANFILES = core
-
-# Disables 'make install' as installing a compiled version of Google
-# Mock can lead to undefined behavior due to violation of the
-# One-Definition Rule.
-
-install-exec-local:
- echo "'make install' is dangerous and not supported. Instead, see README for how to integrate Google Mock into your build system."
- false
-
-install-data-local:
- echo "'make install' is dangerous and not supported. Instead, see README for how to integrate Google Mock into your build system."
- false
diff --git a/src/testing/README b/src/testing/README
deleted file mode 100644
index e414f3a6..00000000
--- a/src/testing/README
+++ /dev/null
@@ -1,361 +0,0 @@
-Google C++ Mocking Framework
-============================
-
-http://code.google.com/p/googlemock/
-
-Overview
---------
-
-Google's framework for writing and using C++ mock classes on a variety
-of platforms (Linux, Mac OS X, Windows, Windows CE, Symbian, etc).
-Inspired by jMock, EasyMock, and Hamcrest, and designed with C++'s
-specifics in mind, it can help you derive better designs of your
-system and write better tests.
-
-Google Mock:
-
-- provides a declarative syntax for defining mocks,
-- can easily define partial (hybrid) mocks, which are a cross of real
- and mock objects,
-- handles functions of arbitrary types and overloaded functions,
-- comes with a rich set of matchers for validating function arguments,
-- uses an intuitive syntax for controlling the behavior of a mock,
-- does automatic verification of expectations (no record-and-replay
- needed),
-- allows arbitrary (partial) ordering constraints on
- function calls to be expressed,
-- lets a user extend it by defining new matchers and actions.
-- does not use exceptions, and
-- is easy to learn and use.
-
-Please see the project page above for more information as well as the
-mailing list for questions, discussions, and development. There is
-also an IRC channel on OFTC (irc.oftc.net) #gtest available. Please
-join us!
-
-Please note that code under scripts/generator/ is from the cppclean
-project (http://code.google.com/p/cppclean/) and under the Apache
-License, which is different from Google Mock's license.
-
-Requirements for End Users
---------------------------
-
-Google Mock is implemented on top of the Google Test C++ testing
-framework (http://code.google.com/p/googletest/), and includes the
-latter as part of the SVN repositary and distribution package. You
-must use the bundled version of Google Test when using Google Mock, or
-you may get compiler/linker errors.
-
-You can also easily configure Google Mock to work with another testing
-framework of your choice; although it will still need Google Test as
-an internal dependency. Please read
-http://code.google.com/p/googlemock/wiki/ForDummies#Using_Google_Mock_with_Any_Testing_Framework
-for how to do it.
-
-Google Mock depends on advanced C++ features and thus requires a more
-modern compiler. The following are needed to use Google Mock:
-
-### Linux Requirements ###
-
-These are the base requirements to build and use Google Mock from a source
-package (as described below):
-
- * GNU-compatible Make or "gmake"
- * POSIX-standard shell
- * POSIX(-2) Regular Expressions (regex.h)
- * C++98-standard-compliant compiler (e.g. GCC 3.4 or newer)
-
-### Windows Requirements ###
-
- * Microsoft Visual C++ 8.0 SP1 or newer
-
-### Mac OS X Requirements ###
-
- * Mac OS X 10.4 Tiger or newer
- * Developer Tools Installed
-
-Requirements for Contributors
------------------------------
-
-We welcome patches. If you plan to contribute a patch, you need to
-build Google Mock and its own tests from an SVN checkout (described
-below), which has further requirements:
-
- * Automake version 1.9 or newer
- * Autoconf version 2.59 or newer
- * Libtool / Libtoolize
- * Python version 2.3 or newer (for running some of the tests and
- re-generating certain source files from templates)
-
-Getting the Source
-------------------
-
-There are two primary ways of getting Google Mock's source code: you
-can download a stable source release in your preferred archive format,
-or directly check out the source from our Subversion (SVN) repositary.
-The SVN checkout requires a few extra steps and some extra software
-packages on your system, but lets you track development and make
-patches much more easily, so we highly encourage it.
-
-### Source Package ###
-
-Google Mock is released in versioned source packages which can be
-downloaded from the download page [1]. Several different archive
-formats are provided, but the only difference is the tools needed to
-extract their contents, and the size of the resulting file. Download
-whichever you are most comfortable with.
-
- [1] http://code.google.com/p/googlemock/downloads/list
-
-Once downloaded expand the archive using whichever tools you prefer
-for that type. This will always result in a new directory with the
-name "gmock-X.Y.Z" which contains all of the source code. Here are
-some examples on Linux:
-
- tar -xvzf gmock-X.Y.Z.tar.gz
- tar -xvjf gmock-X.Y.Z.tar.bz2
- unzip gmock-X.Y.Z.zip
-
-### SVN Checkout ###
-
-To check out the main branch (also known as the "trunk") of Google
-Mock, run the following Subversion command:
-
- svn checkout http://googlemock.googlecode.com/svn/trunk/ gmock-svn
-
-If you are using a *nix system and plan to use the GNU Autotools build
-system to build Google Mock (described below), you'll need to
-configure it now. Otherwise you are done with getting the source
-files.
-
-To prepare the Autotools build system, enter the target directory of
-the checkout command you used ('gmock-svn') and proceed with the
-following command:
-
- autoreconf -fvi
-
-Once you have completed this step, you are ready to build the library.
-Note that you should only need to complete this step once. The
-subsequent 'make' invocations will automatically re-generate the bits
-of the build system that need to be changed.
-
-If your system uses older versions of the autotools, the above command
-will fail. You may need to explicitly specify a version to use. For
-instance, if you have both GNU Automake 1.4 and 1.9 installed and
-'automake' would invoke the 1.4, use instead:
-
- AUTOMAKE=automake-1.9 ACLOCAL=aclocal-1.9 autoreconf -fvi
-
-Make sure you're using the same version of automake and aclocal.
-
-Setting up the Build
---------------------
-
-To build Google Mock and your tests that use it, you need to tell your
-build system where to find its headers and source files. The exact
-way to do it depends on which build system you use, and is usually
-straightforward.
-
-### Generic Build Instructions ###
-
-This section shows how you can integrate Google Mock into your
-existing build system.
-
-Suppose you put Google Mock in directory ${GMOCK_DIR} and Google Test
-in ${GTEST_DIR} (the latter is ${GMOCK_DIR}/gtest by default). To
-build Google Mock, create a library build target (or a project as
-called by Visual Studio and Xcode) to compile
-
- ${GTEST_DIR}/src/gtest-all.cc and ${GMOCK_DIR}/src/gmock-all.cc
-
-with
-
- ${GTEST_DIR}/include, ${GTEST_DIR}, ${GMOCK_DIR}/include, and ${GMOCK_DIR}
-
-in the header search path. Assuming a Linux-like system and gcc,
-something like the following will do:
-
- g++ -I${GTEST_DIR}/include -I${GTEST_DIR} -I${GMOCK_DIR}/include \
- -I${GMOCK_DIR} -c ${GTEST_DIR}/src/gtest-all.cc
- g++ -I${GTEST_DIR}/include -I${GTEST_DIR} -I${GMOCK_DIR}/include \
- -I${GMOCK_DIR} -c ${GMOCK_DIR}/src/gmock-all.cc
- ar -rv libgmock.a gtest-all.o gmock-all.o
-
-Next, you should compile your test source file with
-${GTEST_DIR}/include and ${GMOCK_DIR}/include in the header search
-path, and link it with gmock and any other necessary libraries:
-
- g++ -I${GTEST_DIR}/include -I${GMOCK_DIR}/include \
- path/to/your_test.cc libgmock.a -o your_test
-
-As an example, the make/ directory contains a Makefile that you can
-use to build Google Mock on systems where GNU make is available
-(e.g. Linux, Mac OS X, and Cygwin). It doesn't try to build Google
-Mock's own tests. Instead, it just builds the Google Mock library and
-a sample test. You can use it as a starting point for your own build
-script.
-
-If the default settings are correct for your environment, the
-following commands should succeed:
-
- cd ${GMOCK_DIR}/make
- make
- ./gmock_test
-
-If you see errors, try to tweak the contents of make/Makefile to make
-them go away. There are instructions in make/Makefile on how to do
-it.
-
-### Windows ###
-
-The msvc/2005 directory contains VC++ 2005 projects and the msvc/2010
-directory contains VC++ 2010 projects for building Google Mock and
-selected tests.
-
-Change to the appropriate directory and run "msbuild gmock.sln" to
-build the library and tests (or open the gmock.sln in the MSVC IDE).
-If you want to create your own project to use with Google Mock, you'll
-have to configure it to use the gmock_config propety sheet. For that:
-
- * Open the Property Manager window (View | Other Windows | Property Manager)
- * Right-click on your project and select "Add Existing Property Sheet..."
- * Navigate to gmock_config.vsprops or gmock_config.props and select it.
- * In Project Properties | Configuration Properties | General | Additional
- Include Directories, type <path to Google Mock>/include.
-
-Tweaking Google Mock
---------------------
-
-Google Mock can be used in diverse environments. The default
-configuration may not work (or may not work well) out of the box in
-some environments. However, you can easily tweak Google Mock by
-defining control macros on the compiler command line. Generally,
-these macros are named like GTEST_XYZ and you define them to either 1
-or 0 to enable or disable a certain feature.
-
-We list the most frequently used macros below. For a complete list,
-see file ${GTEST_DIR}/include/gtest/internal/gtest-port.h.
-
-### Choosing a TR1 Tuple Library ###
-
-Google Mock uses the C++ Technical Report 1 (TR1) tuple library
-heavily. Unfortunately TR1 tuple is not yet widely available with all
-compilers. The good news is that Google Test 1.4.0+ implements a
-subset of TR1 tuple that's enough for Google Mock's need. Google Mock
-will automatically use that implementation when the compiler doesn't
-provide TR1 tuple.
-
-Usually you don't need to care about which tuple library Google Test
-and Google Mock use. However, if your project already uses TR1 tuple,
-you need to tell Google Test and Google Mock to use the same TR1 tuple
-library the rest of your project uses, or the two tuple
-implementations will clash. To do that, add
-
- -DGTEST_USE_OWN_TR1_TUPLE=0
-
-to the compiler flags while compiling Google Test, Google Mock, and
-your tests. If you want to force Google Test and Google Mock to use
-their own tuple library, just add
-
- -DGTEST_USE_OWN_TR1_TUPLE=1
-
-to the compiler flags instead.
-
-If you want to use Boost's TR1 tuple library with Google Mock, please
-refer to the Boost website (http://www.boost.org/) for how to obtain
-it and set it up.
-
-### As a Shared Library (DLL) ###
-
-Google Mock is compact, so most users can build and link it as a static
-library for the simplicity. Google Mock can be used as a DLL, but the
-same DLL must contain Google Test as well. See Google Test's README
-file for instructions on how to set up necessary compiler settings.
-
-### Tweaking Google Mock ###
-
-Most of Google Test's control macros apply to Google Mock as well.
-Please see file ${GTEST_DIR}/README for how to tweak them.
-
-Upgrading from an Earlier Version
----------------------------------
-
-We strive to keep Google Mock releases backward compatible.
-Sometimes, though, we have to make some breaking changes for the
-users' long-term benefits. This section describes what you'll need to
-do if you are upgrading from an earlier version of Google Mock.
-
-### Upgrading from 1.1.0 or Earlier ###
-
-You may need to explicitly enable or disable Google Test's own TR1
-tuple library. See the instructions in section "Choosing a TR1 Tuple
-Library".
-
-### Upgrading from 1.4.0 or Earlier ###
-
-On platforms where the pthread library is available, Google Test and
-Google Mock use it in order to be thread-safe. For this to work, you
-may need to tweak your compiler and/or linker flags. Please see the
-"Multi-threaded Tests" section in file ${GTEST_DIR}/README for what
-you may need to do.
-
-If you have custom matchers defined using MatcherInterface or
-MakePolymorphicMatcher(), you'll need to update their definitions to
-use the new matcher API [2]. Matchers defined using MATCHER() or
-MATCHER_P*() aren't affected.
-
- [2] http://code.google.com/p/googlemock/wiki/CookBook#Writing_New_Monomorphic_Matchers,
- http://code.google.com/p/googlemock/wiki/CookBook#Writing_New_Polymorphic_Matchers
-
-Developing Google Mock
-----------------------
-
-This section discusses how to make your own changes to Google Mock.
-
-### Testing Google Mock Itself ###
-
-To make sure your changes work as intended and don't break existing
-functionality, you'll want to compile and run Google Test's own tests.
-For that you'll need Autotools. First, make sure you have followed
-the instructions in section "SVN Checkout" to configure Google Mock.
-Then, create a build output directory and enter it. Next,
-
- ${GMOCK_DIR}/configure # Standard GNU configure script, --help for more info
-
-Once you have successfully configured Google Mock, the build steps are
-standard for GNU-style OSS packages.
-
- make # Standard makefile following GNU conventions
- make check # Builds and runs all tests - all should pass.
-
-Note that when building your project against Google Mock, you are building
-against Google Test as well. There is no need to configure Google Test
-separately.
-
-### Regenerating Source Files ###
-
-Some of Google Mock's source files are generated from templates (not
-in the C++ sense) using a script. A template file is named FOO.pump,
-where FOO is the name of the file it will generate. For example, the
-file include/gmock/gmock-generated-actions.h.pump is used to generate
-gmock-generated-actions.h in the same directory.
-
-Normally you don't need to worry about regenerating the source files,
-unless you need to modify them. In that case, you should modify the
-corresponding .pump files instead and run the 'pump' script (for Pump
-is Useful for Meta Programming) to regenerate them. You can find
-pump.py in the ${GTEST_DIR}/scripts/ directory. Read the Pump manual
-[3] for how to use it.
-
- [3] http://code.google.com/p/googletest/wiki/PumpManual.
-
-### Contributing a Patch ###
-
-We welcome patches. Please read the Google Mock developer's guide [4]
-for how you can contribute. In particular, make sure you have signed
-the Contributor License Agreement, or we won't be able to accept the
-patch.
-
- [4] http://code.google.com/p/googlemock/wiki/DevGuide
-
-Happy testing!
diff --git a/src/testing/build-aux/.keep b/src/testing/build-aux/.keep
deleted file mode 100644
index e69de29b..00000000
--- a/src/testing/build-aux/.keep
+++ /dev/null
diff --git a/src/testing/configure.ac b/src/testing/configure.ac
deleted file mode 100644
index 05b90c4b..00000000
--- a/src/testing/configure.ac
+++ /dev/null
@@ -1,146 +0,0 @@
-m4_include(gtest/m4/acx_pthread.m4)
-
-AC_INIT([Google C++ Mocking Framework],
- [1.6.0],
- [googlemock@googlegroups.com],
- [gmock])
-
-# Provide various options to initialize the Autoconf and configure processes.
-AC_PREREQ([2.59])
-AC_CONFIG_SRCDIR([./LICENSE])
-AC_CONFIG_AUX_DIR([build-aux])
-AC_CONFIG_HEADERS([build-aux/config.h])
-AC_CONFIG_FILES([Makefile])
-AC_CONFIG_FILES([scripts/gmock-config], [chmod +x scripts/gmock-config])
-
-# Initialize Automake with various options. We require at least v1.9, prevent
-# pedantic complaints about package files, and enable various distribution
-# targets.
-AM_INIT_AUTOMAKE([1.9 dist-bzip2 dist-zip foreign subdir-objects])
-
-# Check for programs used in building Google Test.
-AC_PROG_CC
-AC_PROG_CXX
-AC_LANG([C++])
-AC_PROG_LIBTOOL
-
-# TODO(chandlerc@google.com): Currently we aren't running the Python tests
-# against the interpreter detected by AM_PATH_PYTHON, and so we condition
-# HAVE_PYTHON by requiring "python" to be in the PATH, and that interpreter's
-# version to be >= 2.3. This will allow the scripts to use a "/usr/bin/env"
-# hashbang.
-PYTHON= # We *do not* allow the user to specify a python interpreter
-AC_PATH_PROG([PYTHON],[python],[:])
-AS_IF([test "$PYTHON" != ":"],
- [AM_PYTHON_CHECK_VERSION([$PYTHON],[2.3],[:],[PYTHON=":"])])
-AM_CONDITIONAL([HAVE_PYTHON],[test "$PYTHON" != ":"])
-
-# TODO(chandlerc@google.com) Check for the necessary system headers.
-
-# Configure pthreads.
-AC_ARG_WITH([pthreads],
- [AS_HELP_STRING([--with-pthreads],
- [use pthreads (default is yes)])],
- [with_pthreads=$withval],
- [with_pthreads=check])
-
-have_pthreads=no
-AS_IF([test "x$with_pthreads" != "xno"],
- [ACX_PTHREAD(
- [],
- [AS_IF([test "x$with_pthreads" != "xcheck"],
- [AC_MSG_FAILURE(
- [--with-pthreads was specified, but unable to be used])])])
- have_pthreads="$acx_pthread_ok"])
-AM_CONDITIONAL([HAVE_PTHREADS],[test "x$have_pthreads" == "xyes"])
-AC_SUBST(PTHREAD_CFLAGS)
-AC_SUBST(PTHREAD_LIBS)
-
-# GoogleMock currently has hard dependencies upon GoogleTest above and beyond
-# running its own test suite, so we both provide our own version in
-# a subdirectory and provide some logic to use a custom version or a system
-# installed version.
-AC_ARG_WITH([gtest],
- [AS_HELP_STRING([--with-gtest],
- [Specifies how to find the gtest package. If no
- arguments are given, the default behavior, a
- system installed gtest will be used if present,
- and an internal version built otherwise. If a
- path is provided, the gtest built or installed at
- that prefix will be used.])],
- [],
- [with_gtest=yes])
-AC_ARG_ENABLE([external-gtest],
- [AS_HELP_STRING([--disable-external-gtest],
- [Disables any detection or use of a system
- installed or user provided gtest. Any option to
- '--with-gtest' is ignored. (Default is enabled.)])
- ], [], [enable_external_gtest=yes])
-AS_IF([test "x$with_gtest" == "xno"],
- [AC_MSG_ERROR([dnl
-Support for GoogleTest was explicitly disabled. Currently GoogleMock has a hard
-dependency upon GoogleTest to build, please provide a version, or allow
-GoogleMock to use any installed version and fall back upon its internal
-version.])])
-
-# Setup various GTEST variables. TODO(chandlerc@google.com): When these are
-# used below, they should be used such that any pre-existing values always
-# trump values we set them to, so that they can be used to selectively override
-# details of the detection process.
-AC_ARG_VAR([GTEST_CONFIG],
- [The exact path of Google Test's 'gtest-config' script.])
-AC_ARG_VAR([GTEST_CPPFLAGS],
- [C-like preprocessor flags for Google Test.])
-AC_ARG_VAR([GTEST_CXXFLAGS],
- [C++ compile flags for Google Test.])
-AC_ARG_VAR([GTEST_LDFLAGS],
- [Linker path and option flags for Google Test.])
-AC_ARG_VAR([GTEST_LIBS],
- [Library linking flags for Google Test.])
-AC_ARG_VAR([GTEST_VERSION],
- [The version of Google Test available.])
-HAVE_BUILT_GTEST="no"
-
-GTEST_MIN_VERSION="1.6.0"
-
-AS_IF([test "x${enable_external_gtest}" = "xyes"],
- [# Begin filling in variables as we are able.
- AS_IF([test "x${with_gtest}" != "xyes"],
- [AS_IF([test -x "${with_gtest}/scripts/gtest-config"],
- [GTEST_CONFIG="${with_gtest}/scripts/gtest-config"],
- [GTEST_CONFIG="${with_gtest}/bin/gtest-config"])
- AS_IF([test -x "${GTEST_CONFIG}"], [],
- [AC_MSG_ERROR([dnl
-Unable to locate either a built or installed Google Test at '${with_gtest}'.])
- ])])
-
- AS_IF([test -x "${GTEST_CONFIG}"], [],
- [AC_PATH_PROG([GTEST_CONFIG], [gtest-config])])
- AS_IF([test -x "${GTEST_CONFIG}"],
- [AC_MSG_CHECKING([for Google Test version >= ${GTEST_MIN_VERSION}])
- AS_IF([${GTEST_CONFIG} --min-version=${GTEST_MIN_VERSION}],
- [AC_MSG_RESULT([yes])
- HAVE_BUILT_GTEST="yes"],
- [AC_MSG_RESULT([no])])])])
-
-AS_IF([test "x${HAVE_BUILT_GTEST}" = "xyes"],
- [GTEST_CPPFLAGS=`${GTEST_CONFIG} --cppflags`
- GTEST_CXXFLAGS=`${GTEST_CONFIG} --cxxflags`
- GTEST_LDFLAGS=`${GTEST_CONFIG} --ldflags`
- GTEST_LIBS=`${GTEST_CONFIG} --libs`
- GTEST_VERSION=`${GTEST_CONFIG} --version`],
- [AC_CONFIG_SUBDIRS([gtest])
- # GTEST_CONFIG needs to be executable both in a Makefile environmont and
- # in a shell script environment, so resolve an absolute path for it here.
- GTEST_CONFIG="`pwd -P`/gtest/scripts/gtest-config"
- GTEST_CPPFLAGS='-I$(top_srcdir)/gtest/include'
- GTEST_CXXFLAGS='-g'
- GTEST_LDFLAGS=''
- GTEST_LIBS='$(top_builddir)/gtest/lib/libgtest.la'
- GTEST_VERSION="${GTEST_MIN_VERSION}"])
-
-# TODO(chandlerc@google.com) Check the types, structures, and other compiler
-# and architecture characteristics.
-
-# Output the generated files. No further autoconf macros may be used.
-AC_OUTPUT
diff --git a/src/testing/gtest/CHANGES b/src/testing/gtest/CHANGES
deleted file mode 100644
index 59192458..00000000
--- a/src/testing/gtest/CHANGES
+++ /dev/null
@@ -1,130 +0,0 @@
-Changes for 1.6.0:
-
-* New feature: ADD_FAILURE_AT() for reporting a test failure at the
- given source location -- useful for writing testing utilities.
-* New feature: the universal value printer is moved from Google Mock
- to Google Test.
-* New feature: type parameters and value parameters are reported in
- the XML report now.
-* A gtest_disable_pthreads CMake option.
-* Colored output works in GNU Screen sessions now.
-* Parameters of value-parameterized tests are now printed in the
- textual output.
-* Failures from ad hoc test assertions run before RUN_ALL_TESTS() are
- now correctly reported.
-* Arguments of ASSERT_XY and EXPECT_XY no longer need to support << to
- ostream.
-* More complete handling of exceptions.
-* GTEST_ASSERT_XY can be used instead of ASSERT_XY in case the latter
- name is already used by another library.
-* --gtest_catch_exceptions is now true by default, allowing a test
- program to continue after an exception is thrown.
-* Value-parameterized test fixtures can now derive from Test and
- WithParamInterface<T> separately, easing conversion of legacy tests.
-* Death test messages are clearly marked to make them more
- distinguishable from other messages.
-* Compatibility fixes for Android, Google Native Client, MinGW, HP UX,
- PowerPC, Lucid autotools, libCStd, Sun C++, Borland C++ Builder (Code Gear),
- IBM XL C++ (Visual Age C++), and C++0x.
-* Bug fixes and implementation clean-ups.
-* Potentially incompatible changes: disables the harmful 'make install'
- command in autotools.
-
-Changes for 1.5.0:
-
- * New feature: assertions can be safely called in multiple threads
- where the pthreads library is available.
- * New feature: predicates used inside EXPECT_TRUE() and friends
- can now generate custom failure messages.
- * New feature: Google Test can now be compiled as a DLL.
- * New feature: fused source files are included.
- * New feature: prints help when encountering unrecognized Google Test flags.
- * Experimental feature: CMake build script (requires CMake 2.6.4+).
- * Experimental feature: the Pump script for meta programming.
- * double values streamed to an assertion are printed with enough precision
- to differentiate any two different values.
- * Google Test now works on Solaris and AIX.
- * Build and test script improvements.
- * Bug fixes and implementation clean-ups.
-
- Potentially breaking changes:
-
- * Stopped supporting VC++ 7.1 with exceptions disabled.
- * Dropped support for 'make install'.
-
-Changes for 1.4.0:
-
- * New feature: the event listener API
- * New feature: test shuffling
- * New feature: the XML report format is closer to junitreport and can
- be parsed by Hudson now.
- * New feature: when a test runs under Visual Studio, its failures are
- integrated in the IDE.
- * New feature: /MD(d) versions of VC++ projects.
- * New feature: elapsed time for the tests is printed by default.
- * New feature: comes with a TR1 tuple implementation such that Boost
- is no longer needed for Combine().
- * New feature: EXPECT_DEATH_IF_SUPPORTED macro and friends.
- * New feature: the Xcode project can now produce static gtest
- libraries in addition to a framework.
- * Compatibility fixes for Solaris, Cygwin, minGW, Windows Mobile,
- Symbian, gcc, and C++Builder.
- * Bug fixes and implementation clean-ups.
-
-Changes for 1.3.0:
-
- * New feature: death tests on Windows, Cygwin, and Mac.
- * New feature: ability to use Google Test assertions in other testing
- frameworks.
- * New feature: ability to run disabled test via
- --gtest_also_run_disabled_tests.
- * New feature: the --help flag for printing the usage.
- * New feature: access to Google Test flag values in user code.
- * New feature: a script that packs Google Test into one .h and one
- .cc file for easy deployment.
- * New feature: support for distributing test functions to multiple
- machines (requires support from the test runner).
- * Bug fixes and implementation clean-ups.
-
-Changes for 1.2.1:
-
- * Compatibility fixes for Linux IA-64 and IBM z/OS.
- * Added support for using Boost and other TR1 implementations.
- * Changes to the build scripts to support upcoming release of Google C++
- Mocking Framework.
- * Added Makefile to the distribution package.
- * Improved build instructions in README.
-
-Changes for 1.2.0:
-
- * New feature: value-parameterized tests.
- * New feature: the ASSERT/EXPECT_(NON)FATAL_FAILURE(_ON_ALL_THREADS)
- macros.
- * Changed the XML report format to match JUnit/Ant's.
- * Added tests to the Xcode project.
- * Added scons/SConscript for building with SCons.
- * Added src/gtest-all.cc for building Google Test from a single file.
- * Fixed compatibility with Solaris and z/OS.
- * Enabled running Python tests on systems with python 2.3 installed,
- e.g. Mac OS X 10.4.
- * Bug fixes.
-
-Changes for 1.1.0:
-
- * New feature: type-parameterized tests.
- * New feature: exception assertions.
- * New feature: printing elapsed time of tests.
- * Improved the robustness of death tests.
- * Added an Xcode project and samples.
- * Adjusted the output format on Windows to be understandable by Visual Studio.
- * Minor bug fixes.
-
-Changes for 1.0.1:
-
- * Added project files for Visual Studio 7.1.
- * Fixed issues with compiling on Mac OS X.
- * Fixed issues with compiling on Cygwin.
-
-Changes for 1.0.0:
-
- * Initial Open Source release of Google Test
diff --git a/src/testing/gtest/CMakeLists.txt b/src/testing/gtest/CMakeLists.txt
deleted file mode 100644
index 64527f74..00000000
--- a/src/testing/gtest/CMakeLists.txt
+++ /dev/null
@@ -1,250 +0,0 @@
-########################################################################
-# CMake build script for Google Test.
-#
-# To run the tests for Google Test itself on Linux, use 'make test' or
-# ctest. You can select which tests to run using 'ctest -R regex'.
-# For more options, run 'ctest --help'.
-
-# BUILD_SHARED_LIBS is a standard CMake variable, but we declare it here to
-# make it prominent in the GUI.
-option(BUILD_SHARED_LIBS "Build shared libraries (DLLs)." OFF)
-
-# When other libraries are using a shared version of runtime libraries,
-# Google Test also has to use one.
-option(
- gtest_force_shared_crt
- "Use shared (DLL) run-time lib even when Google Test is built as static lib."
- OFF)
-
-option(gtest_build_tests "Build all of gtest's own tests." OFF)
-
-option(gtest_build_samples "Build gtest's sample programs." OFF)
-
-option(gtest_disable_pthreads "Disable uses of pthreads in gtest." OFF)
-
-# Defines pre_project_set_up_hermetic_build() and set_up_hermetic_build().
-include(cmake/hermetic_build.cmake OPTIONAL)
-
-if (COMMAND pre_project_set_up_hermetic_build)
- pre_project_set_up_hermetic_build()
-endif()
-
-########################################################################
-#
-# Project-wide settings
-
-# Name of the project.
-#
-# CMake files in this project can refer to the root source directory
-# as ${gtest_SOURCE_DIR} and to the root binary directory as
-# ${gtest_BINARY_DIR}.
-# Language "C" is required for find_package(Threads).
-project(gtest CXX C)
-cmake_minimum_required(VERSION 2.6.2)
-
-if (COMMAND set_up_hermetic_build)
- set_up_hermetic_build()
-endif()
-
-# Define helper functions and macros used by Google Test.
-include(cmake/internal_utils.cmake)
-
-config_compiler_and_linker() # Defined in internal_utils.cmake.
-
-# Where Google Test's .h files can be found.
-include_directories(
- ${gtest_SOURCE_DIR}/include
- ${gtest_SOURCE_DIR})
-
-# Where Google Test's libraries can be found.
-link_directories(${gtest_BINARY_DIR}/src)
-
-########################################################################
-#
-# Defines the gtest & gtest_main libraries. User tests should link
-# with one of them.
-
-# Google Test libraries. We build them using more strict warnings than what
-# are used for other targets, to ensure that gtest can be compiled by a user
-# aggressive about warnings.
-cxx_library(gtest "${cxx_strict}" src/gtest-all.cc)
-cxx_library(gtest_main "${cxx_strict}" src/gtest_main.cc)
-target_link_libraries(gtest_main gtest)
-
-########################################################################
-#
-# Samples on how to link user tests with gtest or gtest_main.
-#
-# They are not built by default. To build them, set the
-# gtest_build_samples option to ON. You can do it by running ccmake
-# or specifying the -Dbuild_gtest_samples=ON flag when running cmake.
-
-if (gtest_build_samples)
- cxx_executable(sample1_unittest samples gtest_main samples/sample1.cc)
- cxx_executable(sample2_unittest samples gtest_main samples/sample2.cc)
- cxx_executable(sample3_unittest samples gtest_main)
- cxx_executable(sample4_unittest samples gtest_main samples/sample4.cc)
- cxx_executable(sample5_unittest samples gtest_main samples/sample1.cc)
- cxx_executable(sample6_unittest samples gtest_main)
- cxx_executable(sample7_unittest samples gtest_main)
- cxx_executable(sample8_unittest samples gtest_main)
- cxx_executable(sample9_unittest samples gtest)
- cxx_executable(sample10_unittest samples gtest)
-endif()
-
-########################################################################
-#
-# Google Test's own tests.
-#
-# You can skip this section if you aren't interested in testing
-# Google Test itself.
-#
-# The tests are not built by default. To build them, set the
-# gtest_build_tests option to ON. You can do it by running ccmake
-# or specifying the -Dgtest_build_tests=ON flag when running cmake.
-
-if (gtest_build_tests)
- # This must be set in the root directory for the tests to be run by
- # 'make test' or ctest.
- enable_testing()
-
- ############################################################
- # C++ tests built with standard compiler flags.
-
- cxx_test(gtest-death-test_test gtest_main)
- cxx_test(gtest_environment_test gtest)
- cxx_test(gtest-filepath_test gtest_main)
- cxx_test(gtest-linked_ptr_test gtest_main)
- cxx_test(gtest-listener_test gtest_main)
- cxx_test(gtest_main_unittest gtest_main)
- cxx_test(gtest-message_test gtest_main)
- cxx_test(gtest_no_test_unittest gtest)
- cxx_test(gtest-options_test gtest_main)
- cxx_test(gtest-param-test_test gtest
- test/gtest-param-test2_test.cc)
- cxx_test(gtest-port_test gtest_main)
- cxx_test(gtest_pred_impl_unittest gtest_main)
- cxx_test(gtest-printers_test gtest_main)
- cxx_test(gtest_prod_test gtest_main
- test/production.cc)
- cxx_test(gtest_repeat_test gtest)
- cxx_test(gtest_sole_header_test gtest_main)
- cxx_test(gtest_stress_test gtest)
- cxx_test(gtest-test-part_test gtest_main)
- cxx_test(gtest_throw_on_failure_ex_test gtest)
- cxx_test(gtest-typed-test_test gtest_main
- test/gtest-typed-test2_test.cc)
- cxx_test(gtest_unittest gtest_main)
- cxx_test(gtest-unittest-api_test gtest)
-
- ############################################################
- # C++ tests built with non-standard compiler flags.
-
- # MSVC 7.1 does not support STL with exceptions disabled.
- if (NOT MSVC OR MSVC_VERSION GREATER 1310)
- cxx_library(gtest_no_exception "${cxx_no_exception}"
- src/gtest-all.cc)
- cxx_library(gtest_main_no_exception "${cxx_no_exception}"
- src/gtest-all.cc src/gtest_main.cc)
- endif()
- cxx_library(gtest_main_no_rtti "${cxx_no_rtti}"
- src/gtest-all.cc src/gtest_main.cc)
-
- cxx_test_with_flags(gtest-death-test_ex_nocatch_test
- "${cxx_exception} -DGTEST_ENABLE_CATCH_EXCEPTIONS_=0"
- gtest test/gtest-death-test_ex_test.cc)
- cxx_test_with_flags(gtest-death-test_ex_catch_test
- "${cxx_exception} -DGTEST_ENABLE_CATCH_EXCEPTIONS_=1"
- gtest test/gtest-death-test_ex_test.cc)
-
- cxx_test_with_flags(gtest_no_rtti_unittest "${cxx_no_rtti}"
- gtest_main_no_rtti test/gtest_unittest.cc)
-
- cxx_shared_library(gtest_dll "${cxx_default}"
- src/gtest-all.cc src/gtest_main.cc)
-
- cxx_executable_with_flags(gtest_dll_test_ "${cxx_default}"
- gtest_dll test/gtest_all_test.cc)
- set_target_properties(gtest_dll_test_
- PROPERTIES
- COMPILE_DEFINITIONS "GTEST_LINKED_AS_SHARED_LIBRARY=1")
-
- if (NOT MSVC OR NOT MSVC_VERSION EQUAL 1600)
- # The C++ Standard specifies tuple_element<int, class>.
- # Yet MSVC 10's <utility> declares tuple_element<size_t, class>.
- # That declaration conflicts with our own standard-conforming
- # tuple implementation. Therefore using our own tuple with
- # MSVC 10 doesn't compile.
- cxx_library(gtest_main_use_own_tuple "${cxx_use_own_tuple}"
- src/gtest-all.cc src/gtest_main.cc)
-
- cxx_test_with_flags(gtest-tuple_test "${cxx_use_own_tuple}"
- gtest_main_use_own_tuple test/gtest-tuple_test.cc)
-
- cxx_test_with_flags(gtest_use_own_tuple_test "${cxx_use_own_tuple}"
- gtest_main_use_own_tuple
- test/gtest-param-test_test.cc test/gtest-param-test2_test.cc)
- endif()
-
- ############################################################
- # Python tests.
-
- cxx_executable(gtest_break_on_failure_unittest_ test gtest)
- py_test(gtest_break_on_failure_unittest)
-
- # MSVC 7.1 does not support STL with exceptions disabled.
- if (NOT MSVC OR MSVC_VERSION GREATER 1310)
- cxx_executable_with_flags(
- gtest_catch_exceptions_no_ex_test_
- "${cxx_no_exception}"
- gtest_main_no_exception
- test/gtest_catch_exceptions_test_.cc)
- endif()
-
- cxx_executable_with_flags(
- gtest_catch_exceptions_ex_test_
- "${cxx_exception}"
- gtest_main
- test/gtest_catch_exceptions_test_.cc)
- py_test(gtest_catch_exceptions_test)
-
- cxx_executable(gtest_color_test_ test gtest)
- py_test(gtest_color_test)
-
- cxx_executable(gtest_env_var_test_ test gtest)
- py_test(gtest_env_var_test)
-
- cxx_executable(gtest_filter_unittest_ test gtest)
- py_test(gtest_filter_unittest)
-
- cxx_executable(gtest_help_test_ test gtest_main)
- py_test(gtest_help_test)
-
- cxx_executable(gtest_list_tests_unittest_ test gtest)
- py_test(gtest_list_tests_unittest)
-
- cxx_executable(gtest_output_test_ test gtest)
- py_test(gtest_output_test)
-
- cxx_executable(gtest_shuffle_test_ test gtest)
- py_test(gtest_shuffle_test)
-
- # MSVC 7.1 does not support STL with exceptions disabled.
- if (NOT MSVC OR MSVC_VERSION GREATER 1310)
- cxx_executable(gtest_throw_on_failure_test_ test gtest_no_exception)
- set_target_properties(gtest_throw_on_failure_test_
- PROPERTIES
- COMPILE_FLAGS "${cxx_no_exception}")
- py_test(gtest_throw_on_failure_test)
- endif()
-
- cxx_executable(gtest_uninitialized_test_ test gtest)
- py_test(gtest_uninitialized_test)
-
- cxx_executable(gtest_xml_outfile1_test_ test gtest_main)
- cxx_executable(gtest_xml_outfile2_test_ test gtest_main)
- py_test(gtest_xml_outfiles_test)
-
- cxx_executable(gtest_xml_output_unittest_ test gtest)
- py_test(gtest_xml_output_unittest)
-endif()
diff --git a/src/testing/gtest/CONTRIBUTORS b/src/testing/gtest/CONTRIBUTORS
deleted file mode 100644
index feae2fc0..00000000
--- a/src/testing/gtest/CONTRIBUTORS
+++ /dev/null
@@ -1,37 +0,0 @@
-# This file contains a list of people who've made non-trivial
-# contribution to the Google C++ Testing Framework project. People
-# who commit code to the project are encouraged to add their names
-# here. Please keep the list sorted by first names.
-
-Ajay Joshi <jaj@google.com>
-Balázs Dán <balazs.dan@gmail.com>
-Bharat Mediratta <bharat@menalto.com>
-Chandler Carruth <chandlerc@google.com>
-Chris Prince <cprince@google.com>
-Chris Taylor <taylorc@google.com>
-Dan Egnor <egnor@google.com>
-Eric Roman <eroman@chromium.org>
-Hady Zalek <hady.zalek@gmail.com>
-Jeffrey Yasskin <jyasskin@google.com>
-Jói Sigurðsson <joi@google.com>
-Keir Mierle <mierle@gmail.com>
-Keith Ray <keith.ray@gmail.com>
-Kenton Varda <kenton@google.com>
-Manuel Klimek <klimek@google.com>
-Markus Heule <markus.heule@gmail.com>
-Mika Raento <mikie@iki.fi>
-Miklós Fazekas <mfazekas@szemafor.com>
-Pasi Valminen <pasi.valminen@gmail.com>
-Patrick Hanna <phanna@google.com>
-Patrick Riley <pfr@google.com>
-Peter Kaminski <piotrk@google.com>
-Preston Jackson <preston.a.jackson@gmail.com>
-Rainer Klaffenboeck <rainer.klaffenboeck@dynatrace.com>
-Russ Cox <rsc@google.com>
-Russ Rufer <russ@pentad.com>
-Sean Mcafee <eefacm@gmail.com>
-Sigurður Ásgeirsson <siggi@google.com>
-Tracy Bialik <tracy@pentad.com>
-Vadim Berman <vadimb@google.com>
-Vlad Losev <vladl@google.com>
-Zhanyong Wan <wan@google.com>
diff --git a/src/testing/gtest/LICENSE b/src/testing/gtest/LICENSE
deleted file mode 100644
index 1941a11f..00000000
--- a/src/testing/gtest/LICENSE
+++ /dev/null
@@ -1,28 +0,0 @@
-Copyright 2008, Google Inc.
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
- * Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above
-copyright notice, this list of conditions and the following disclaimer
-in the documentation and/or other materials provided with the
-distribution.
- * Neither the name of Google Inc. nor the names of its
-contributors may be used to endorse or promote products derived from
-this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/src/testing/gtest/Makefile.am b/src/testing/gtest/Makefile.am
deleted file mode 100644
index 104c54ee..00000000
--- a/src/testing/gtest/Makefile.am
+++ /dev/null
@@ -1,304 +0,0 @@
-# Automake file
-
-ACLOCAL_AMFLAGS = -I m4
-
-# Nonstandard package files for distribution
-EXTRA_DIST = \
- CHANGES \
- CONTRIBUTORS \
- include/gtest/gtest-param-test.h.pump \
- include/gtest/internal/gtest-param-util-generated.h.pump \
- include/gtest/internal/gtest-tuple.h.pump \
- include/gtest/internal/gtest-type-util.h.pump \
- make/Makefile \
- scripts/fuse_gtest_files.py \
- scripts/gen_gtest_pred_impl.py \
- scripts/pump.py \
- scripts/test/Makefile
-
-# gtest source files that we don't compile directly. They are
-# #included by gtest-all.cc.
-GTEST_SRC = \
- src/gtest-death-test.cc \
- src/gtest-filepath.cc \
- src/gtest-internal-inl.h \
- src/gtest-port.cc \
- src/gtest-printers.cc \
- src/gtest-test-part.cc \
- src/gtest-typed-test.cc \
- src/gtest.cc
-
-EXTRA_DIST += $(GTEST_SRC)
-
-# Sample files that we don't compile.
-EXTRA_DIST += \
- samples/prime_tables.h \
- samples/sample2_unittest.cc \
- samples/sample3_unittest.cc \
- samples/sample4_unittest.cc \
- samples/sample5_unittest.cc \
- samples/sample6_unittest.cc \
- samples/sample7_unittest.cc \
- samples/sample8_unittest.cc \
- samples/sample9_unittest.cc
-
-# C++ test files that we don't compile directly.
-EXTRA_DIST += \
- test/gtest-death-test_ex_test.cc \
- test/gtest-death-test_test.cc \
- test/gtest-filepath_test.cc \
- test/gtest-linked_ptr_test.cc \
- test/gtest-listener_test.cc \
- test/gtest-message_test.cc \
- test/gtest-options_test.cc \
- test/gtest-param-test2_test.cc \
- test/gtest-param-test2_test.cc \
- test/gtest-param-test_test.cc \
- test/gtest-param-test_test.cc \
- test/gtest-param-test_test.h \
- test/gtest-port_test.cc \
- test/gtest-printers_test.cc \
- test/gtest-test-part_test.cc \
- test/gtest-tuple_test.cc \
- test/gtest-typed-test2_test.cc \
- test/gtest-typed-test_test.cc \
- test/gtest-typed-test_test.h \
- test/gtest-unittest-api_test.cc \
- test/gtest_break_on_failure_unittest_.cc \
- test/gtest_catch_exceptions_test_.cc \
- test/gtest_color_test_.cc \
- test/gtest_env_var_test_.cc \
- test/gtest_environment_test.cc \
- test/gtest_filter_unittest_.cc \
- test/gtest_help_test_.cc \
- test/gtest_list_tests_unittest_.cc \
- test/gtest_main_unittest.cc \
- test/gtest_no_test_unittest.cc \
- test/gtest_output_test_.cc \
- test/gtest_pred_impl_unittest.cc \
- test/gtest_prod_test.cc \
- test/gtest_repeat_test.cc \
- test/gtest_shuffle_test_.cc \
- test/gtest_sole_header_test.cc \
- test/gtest_stress_test.cc \
- test/gtest_throw_on_failure_ex_test.cc \
- test/gtest_throw_on_failure_test_.cc \
- test/gtest_uninitialized_test_.cc \
- test/gtest_unittest.cc \
- test/gtest_unittest.cc \
- test/gtest_xml_outfile1_test_.cc \
- test/gtest_xml_outfile2_test_.cc \
- test/gtest_xml_output_unittest_.cc \
- test/production.cc \
- test/production.h
-
-# Python tests that we don't run.
-EXTRA_DIST += \
- test/gtest_break_on_failure_unittest.py \
- test/gtest_catch_exceptions_test.py \
- test/gtest_color_test.py \
- test/gtest_env_var_test.py \
- test/gtest_filter_unittest.py \
- test/gtest_help_test.py \
- test/gtest_list_tests_unittest.py \
- test/gtest_output_test.py \
- test/gtest_output_test_golden_lin.txt \
- test/gtest_shuffle_test.py \
- test/gtest_test_utils.py \
- test/gtest_throw_on_failure_test.py \
- test/gtest_uninitialized_test.py \
- test/gtest_xml_outfiles_test.py \
- test/gtest_xml_output_unittest.py \
- test/gtest_xml_test_utils.py
-
-# CMake script
-EXTRA_DIST += \
- CMakeLists.txt \
- cmake/internal_utils.cmake
-
-# MSVC project files
-EXTRA_DIST += \
- msvc/gtest-md.sln \
- msvc/gtest-md.vcproj \
- msvc/gtest.sln \
- msvc/gtest.vcproj \
- msvc/gtest_main-md.vcproj \
- msvc/gtest_main.vcproj \
- msvc/gtest_prod_test-md.vcproj \
- msvc/gtest_prod_test.vcproj \
- msvc/gtest_unittest-md.vcproj \
- msvc/gtest_unittest.vcproj
-
-# xcode project files
-EXTRA_DIST += \
- xcode/Config/DebugProject.xcconfig \
- xcode/Config/FrameworkTarget.xcconfig \
- xcode/Config/General.xcconfig \
- xcode/Config/ReleaseProject.xcconfig \
- xcode/Config/StaticLibraryTarget.xcconfig \
- xcode/Config/TestTarget.xcconfig \
- xcode/Resources/Info.plist \
- xcode/Scripts/runtests.sh \
- xcode/Scripts/versiongenerate.py \
- xcode/gtest.xcodeproj/project.pbxproj
-
-# xcode sample files
-EXTRA_DIST += \
- xcode/Samples/FrameworkSample/Info.plist \
- xcode/Samples/FrameworkSample/WidgetFramework.xcodeproj/project.pbxproj \
- xcode/Samples/FrameworkSample/runtests.sh \
- xcode/Samples/FrameworkSample/widget.cc \
- xcode/Samples/FrameworkSample/widget.h \
- xcode/Samples/FrameworkSample/widget_test.cc
-
-# C++Builder project files
-EXTRA_DIST += \
- codegear/gtest.cbproj \
- codegear/gtest.groupproj \
- codegear/gtest_all.cc \
- codegear/gtest_link.cc \
- codegear/gtest_main.cbproj \
- codegear/gtest_unittest.cbproj
-
-# Distribute and install M4 macro
-m4datadir = $(datadir)/aclocal
-m4data_DATA = m4/gtest.m4
-EXTRA_DIST += $(m4data_DATA)
-
-# We define the global AM_CPPFLAGS as everything we compile includes from these
-# directories.
-AM_CPPFLAGS = -I$(srcdir) -I$(srcdir)/include
-
-# Modifies compiler and linker flags for pthreads compatibility.
-if HAVE_PTHREADS
- AM_CXXFLAGS = @PTHREAD_CFLAGS@ -DGTEST_HAS_PTHREAD=1
- AM_LIBS = @PTHREAD_LIBS@
-else
- AM_CXXFLAGS = -DGTEST_HAS_PTHREAD=0
-endif
-
-# Build rules for libraries.
-lib_LTLIBRARIES = lib/libgtest.la lib/libgtest_main.la
-
-lib_libgtest_la_SOURCES = src/gtest-all.cc
-
-pkginclude_HEADERS = \
- include/gtest/gtest-death-test.h \
- include/gtest/gtest-message.h \
- include/gtest/gtest-param-test.h \
- include/gtest/gtest-printers.h \
- include/gtest/gtest-spi.h \
- include/gtest/gtest-test-part.h \
- include/gtest/gtest-typed-test.h \
- include/gtest/gtest.h \
- include/gtest/gtest_pred_impl.h \
- include/gtest/gtest_prod.h
-
-pkginclude_internaldir = $(pkgincludedir)/internal
-pkginclude_internal_HEADERS = \
- include/gtest/internal/gtest-death-test-internal.h \
- include/gtest/internal/gtest-filepath.h \
- include/gtest/internal/gtest-internal.h \
- include/gtest/internal/gtest-linked_ptr.h \
- include/gtest/internal/gtest-param-util-generated.h \
- include/gtest/internal/gtest-param-util.h \
- include/gtest/internal/gtest-port.h \
- include/gtest/internal/gtest-string.h \
- include/gtest/internal/gtest-tuple.h \
- include/gtest/internal/gtest-type-util.h
-
-lib_libgtest_main_la_SOURCES = src/gtest_main.cc
-lib_libgtest_main_la_LIBADD = lib/libgtest.la
-
-# Bulid rules for samples and tests. Automake's naming for some of
-# these variables isn't terribly obvious, so this is a brief
-# reference:
-#
-# TESTS -- Programs run automatically by "make check"
-# check_PROGRAMS -- Programs built by "make check" but not necessarily run
-
-noinst_LTLIBRARIES = samples/libsamples.la
-
-samples_libsamples_la_SOURCES = \
- samples/sample1.cc \
- samples/sample1.h \
- samples/sample2.cc \
- samples/sample2.h \
- samples/sample3-inl.h \
- samples/sample4.cc \
- samples/sample4.h
-
-TESTS=
-TESTS_ENVIRONMENT = GTEST_SOURCE_DIR="$(srcdir)/test" \
- GTEST_BUILD_DIR="$(top_builddir)/test"
-check_PROGRAMS=
-
-# A simple sample on using gtest.
-TESTS += samples/sample1_unittest
-check_PROGRAMS += samples/sample1_unittest
-samples_sample1_unittest_SOURCES = samples/sample1_unittest.cc
-samples_sample1_unittest_LDADD = lib/libgtest_main.la \
- lib/libgtest.la \
- samples/libsamples.la
-
-# Another sample. It also verifies that libgtest works.
-TESTS += samples/sample10_unittest
-check_PROGRAMS += samples/sample10_unittest
-samples_sample10_unittest_SOURCES = samples/sample10_unittest.cc
-samples_sample10_unittest_LDADD = lib/libgtest.la
-
-# This tests most constructs of gtest and verifies that libgtest_main
-# and libgtest work.
-TESTS += test/gtest_all_test
-check_PROGRAMS += test/gtest_all_test
-test_gtest_all_test_SOURCES = test/gtest_all_test.cc
-test_gtest_all_test_LDADD = lib/libgtest_main.la \
- lib/libgtest.la
-
-# Tests that fused gtest files compile and work.
-FUSED_GTEST_SRC = \
- fused-src/gtest/gtest-all.cc \
- fused-src/gtest/gtest.h \
- fused-src/gtest/gtest_main.cc
-
-if HAVE_PYTHON
-TESTS += test/fused_gtest_test
-check_PROGRAMS += test/fused_gtest_test
-test_fused_gtest_test_SOURCES = $(FUSED_GTEST_SRC) \
- samples/sample1.cc samples/sample1_unittest.cc
-test_fused_gtest_test_CPPFLAGS = -I"$(srcdir)/fused-src"
-
-# Build rules for putting fused Google Test files into the distribution
-# package. The user can also create those files by manually running
-# scripts/fuse_gtest_files.py.
-$(test_fused_gtest_test_SOURCES): fused-gtest
-
-fused-gtest: $(pkginclude_HEADERS) $(pkginclude_internal_HEADERS) \
- $(GTEST_SRC) src/gtest-all.cc src/gtest_main.cc \
- scripts/fuse_gtest_files.py
- mkdir -p "$(srcdir)/fused-src"
- chmod -R u+w "$(srcdir)/fused-src"
- rm -f "$(srcdir)/fused-src/gtest/gtest-all.cc"
- rm -f "$(srcdir)/fused-src/gtest/gtest.h"
- "$(srcdir)/scripts/fuse_gtest_files.py" "$(srcdir)/fused-src"
- cp -f "$(srcdir)/src/gtest_main.cc" "$(srcdir)/fused-src/gtest/"
-
-maintainer-clean-local:
- rm -rf "$(srcdir)/fused-src"
-endif
-
-# Death tests may produce core dumps in the build directory. In case
-# this happens, clean them to keep distcleancheck happy.
-CLEANFILES = core
-
-# Disables 'make install' as installing a compiled version of Google
-# Test can lead to undefined behavior due to violation of the
-# One-Definition Rule.
-
-install-exec-local:
- echo "'make install' is dangerous and not supported. Instead, see README for how to integrate Google Test into your build system."
- false
-
-install-data-local:
- echo "'make install' is dangerous and not supported. Instead, see README for how to integrate Google Test into your build system."
- false
diff --git a/src/testing/gtest/README b/src/testing/gtest/README
deleted file mode 100644
index 17bf72f4..00000000
--- a/src/testing/gtest/README
+++ /dev/null
@@ -1,434 +0,0 @@
-Google C++ Testing Framework
-============================
-
-http://code.google.com/p/googletest/
-
-Overview
---------
-
-Google's framework for writing C++ tests on a variety of platforms
-(Linux, Mac OS X, Windows, Windows CE, Symbian, etc). Based on the
-xUnit architecture. Supports automatic test discovery, a rich set of
-assertions, user-defined assertions, death tests, fatal and non-fatal
-failures, various options for running the tests, and XML test report
-generation.
-
-Please see the project page above for more information as well as the
-mailing list for questions, discussions, and development. There is
-also an IRC channel on OFTC (irc.oftc.net) #gtest available. Please
-join us!
-
-Requirements for End Users
---------------------------
-
-Google Test is designed to have fairly minimal requirements to build
-and use with your projects, but there are some. Currently, we support
-Linux, Windows, Mac OS X, and Cygwin. We will also make our best
-effort to support other platforms (e.g. Solaris, AIX, and z/OS).
-However, since core members of the Google Test project have no access
-to these platforms, Google Test may have outstanding issues there. If
-you notice any problems on your platform, please notify
-googletestframework@googlegroups.com. Patches for fixing them are
-even more welcome!
-
-### Linux Requirements ###
-
-These are the base requirements to build and use Google Test from a source
-package (as described below):
- * GNU-compatible Make or gmake
- * POSIX-standard shell
- * POSIX(-2) Regular Expressions (regex.h)
- * A C++98-standard-compliant compiler
-
-### Windows Requirements ###
-
- * Microsoft Visual C++ 7.1 or newer
-
-### Cygwin Requirements ###
-
- * Cygwin 1.5.25-14 or newer
-
-### Mac OS X Requirements ###
-
- * Mac OS X 10.4 Tiger or newer
- * Developer Tools Installed
-
-Also, you'll need CMake 2.6.4 or higher if you want to build the
-samples using the provided CMake script, regardless of the platform.
-
-Requirements for Contributors
------------------------------
-
-We welcome patches. If you plan to contribute a patch, you need to
-build Google Test and its own tests from an SVN checkout (described
-below), which has further requirements:
-
- * Python version 2.3 or newer (for running some of the tests and
- re-generating certain source files from templates)
- * CMake 2.6.4 or newer
-
-Getting the Source
-------------------
-
-There are two primary ways of getting Google Test's source code: you
-can download a stable source release in your preferred archive format,
-or directly check out the source from our Subversion (SVN) repositary.
-The SVN checkout requires a few extra steps and some extra software
-packages on your system, but lets you track the latest development and
-make patches much more easily, so we highly encourage it.
-
-### Source Package ###
-
-Google Test is released in versioned source packages which can be
-downloaded from the download page [1]. Several different archive
-formats are provided, but the only difference is the tools used to
-manipulate them, and the size of the resulting file. Download
-whichever you are most comfortable with.
-
- [1] http://code.google.com/p/googletest/downloads/list
-
-Once the package is downloaded, expand it using whichever tools you
-prefer for that type. This will result in a new directory with the
-name "gtest-X.Y.Z" which contains all of the source code. Here are
-some examples on Linux:
-
- tar -xvzf gtest-X.Y.Z.tar.gz
- tar -xvjf gtest-X.Y.Z.tar.bz2
- unzip gtest-X.Y.Z.zip
-
-### SVN Checkout ###
-
-To check out the main branch (also known as the "trunk") of Google
-Test, run the following Subversion command:
-
- svn checkout http://googletest.googlecode.com/svn/trunk/ gtest-svn
-
-Setting up the Build
---------------------
-
-To build Google Test and your tests that use it, you need to tell your
-build system where to find its headers and source files. The exact
-way to do it depends on which build system you use, and is usually
-straightforward.
-
-### Generic Build Instructions ###
-
-Suppose you put Google Test in directory ${GTEST_DIR}. To build it,
-create a library build target (or a project as called by Visual Studio
-and Xcode) to compile
-
- ${GTEST_DIR}/src/gtest-all.cc
-
-with
-
- ${GTEST_DIR}/include and ${GTEST_DIR}
-
-in the header search path. Assuming a Linux-like system and gcc,
-something like the following will do:
-
- g++ -I${GTEST_DIR}/include -I${GTEST_DIR} -c ${GTEST_DIR}/src/gtest-all.cc
- ar -rv libgtest.a gtest-all.o
-
-Next, you should compile your test source file with
-${GTEST_DIR}/include in the header search path, and link it with gtest
-and any other necessary libraries:
-
- g++ -I${GTEST_DIR}/include path/to/your_test.cc libgtest.a -o your_test
-
-As an example, the make/ directory contains a Makefile that you can
-use to build Google Test on systems where GNU make is available
-(e.g. Linux, Mac OS X, and Cygwin). It doesn't try to build Google
-Test's own tests. Instead, it just builds the Google Test library and
-a sample test. You can use it as a starting point for your own build
-script.
-
-If the default settings are correct for your environment, the
-following commands should succeed:
-
- cd ${GTEST_DIR}/make
- make
- ./sample1_unittest
-
-If you see errors, try to tweak the contents of make/Makefile to make
-them go away. There are instructions in make/Makefile on how to do
-it.
-
-### Using CMake ###
-
-Google Test comes with a CMake build script (CMakeLists.txt) that can
-be used on a wide range of platforms ("C" stands for cross-platofrm.).
-If you don't have CMake installed already, you can download it for
-free from http://www.cmake.org/.
-
-CMake works by generating native makefiles or build projects that can
-be used in the compiler environment of your choice. The typical
-workflow starts with:
-
- mkdir mybuild # Create a directory to hold the build output.
- cd mybuild
- cmake ${GTEST_DIR} # Generate native build scripts.
-
-If you want to build Google Test's samples, you should replace the
-last command with
-
- cmake -Dgtest_build_samples=ON ${GTEST_DIR}
-
-If you are on a *nix system, you should now see a Makefile in the
-current directory. Just type 'make' to build gtest.
-
-If you use Windows and have Vistual Studio installed, a gtest.sln file
-and several .vcproj files will be created. You can then build them
-using Visual Studio.
-
-On Mac OS X with Xcode installed, a .xcodeproj file will be generated.
-
-### Legacy Build Scripts ###
-
-Before settling on CMake, we have been providing hand-maintained build
-projects/scripts for Visual Studio, Xcode, and Autotools. While we
-continue to provide them for convenience, they are not actively
-maintained any more. We highly recommend that you follow the
-instructions in the previous two sections to integrate Google Test
-with your existing build system.
-
-If you still need to use the legacy build scripts, here's how:
-
-The msvc\ folder contains two solutions with Visual C++ projects.
-Open the gtest.sln or gtest-md.sln file using Visual Studio, and you
-are ready to build Google Test the same way you build any Visual
-Studio project. Files that have names ending with -md use DLL
-versions of Microsoft runtime libraries (the /MD or the /MDd compiler
-option). Files without that suffix use static versions of the runtime
-libraries (the /MT or the /MTd option). Please note that one must use
-the same option to compile both gtest and the test code. If you use
-Visual Studio 2005 or above, we recommend the -md version as /MD is
-the default for new projects in these versions of Visual Studio.
-
-On Mac OS X, open the gtest.xcodeproj in the xcode/ folder using
-Xcode. Build the "gtest" target. The universal binary framework will
-end up in your selected build directory (selected in the Xcode
-"Preferences..." -> "Building" pane and defaults to xcode/build).
-Alternatively, at the command line, enter:
-
- xcodebuild
-
-This will build the "Release" configuration of gtest.framework in your
-default build location. See the "xcodebuild" man page for more
-information about building different configurations and building in
-different locations.
-
-If you wish to use the Google Test Xcode project with Xcode 4.x and
-above, you need to either:
- * update the SDK configuration options in xcode/Config/General.xconfig.
- Comment options SDKROOT, MACOS_DEPLOYMENT_TARGET, and GCC_VERSION. If
- you choose this route you lose the ability to target earlier versions
- of MacOS X.
- * Install an SDK for an earlier version. This doesn't appear to be
- supported by Apple, but has been reported to work
- (http://stackoverflow.com/questions/5378518).
-
-Tweaking Google Test
---------------------
-
-Google Test can be used in diverse environments. The default
-configuration may not work (or may not work well) out of the box in
-some environments. However, you can easily tweak Google Test by
-defining control macros on the compiler command line. Generally,
-these macros are named like GTEST_XYZ and you define them to either 1
-or 0 to enable or disable a certain feature.
-
-We list the most frequently used macros below. For a complete list,
-see file include/gtest/internal/gtest-port.h.
-
-### Choosing a TR1 Tuple Library ###
-
-Some Google Test features require the C++ Technical Report 1 (TR1)
-tuple library, which is not yet available with all compilers. The
-good news is that Google Test implements a subset of TR1 tuple that's
-enough for its own need, and will automatically use this when the
-compiler doesn't provide TR1 tuple.
-
-Usually you don't need to care about which tuple library Google Test
-uses. However, if your project already uses TR1 tuple, you need to
-tell Google Test to use the same TR1 tuple library the rest of your
-project uses, or the two tuple implementations will clash. To do
-that, add
-
- -DGTEST_USE_OWN_TR1_TUPLE=0
-
-to the compiler flags while compiling Google Test and your tests. If
-you want to force Google Test to use its own tuple library, just add
-
- -DGTEST_USE_OWN_TR1_TUPLE=1
-
-to the compiler flags instead.
-
-If you don't want Google Test to use tuple at all, add
-
- -DGTEST_HAS_TR1_TUPLE=0
-
-and all features using tuple will be disabled.
-
-### Multi-threaded Tests ###
-
-Google Test is thread-safe where the pthread library is available.
-After #include "gtest/gtest.h", you can check the GTEST_IS_THREADSAFE
-macro to see whether this is the case (yes if the macro is #defined to
-1, no if it's undefined.).
-
-If Google Test doesn't correctly detect whether pthread is available
-in your environment, you can force it with
-
- -DGTEST_HAS_PTHREAD=1
-
-or
-
- -DGTEST_HAS_PTHREAD=0
-
-When Google Test uses pthread, you may need to add flags to your
-compiler and/or linker to select the pthread library, or you'll get
-link errors. If you use the CMake script or the deprecated Autotools
-script, this is taken care of for you. If you use your own build
-script, you'll need to read your compiler and linker's manual to
-figure out what flags to add.
-
-### As a Shared Library (DLL) ###
-
-Google Test is compact, so most users can build and link it as a
-static library for the simplicity. You can choose to use Google Test
-as a shared library (known as a DLL on Windows) if you prefer.
-
-To compile *gtest* as a shared library, add
-
- -DGTEST_CREATE_SHARED_LIBRARY=1
-
-to the compiler flags. You'll also need to tell the linker to produce
-a shared library instead - consult your linker's manual for how to do
-it.
-
-To compile your *tests* that use the gtest shared library, add
-
- -DGTEST_LINKED_AS_SHARED_LIBRARY=1
-
-to the compiler flags.
-
-Note: while the above steps aren't technically necessary today when
-using some compilers (e.g. GCC), they may become necessary in the
-future, if we decide to improve the speed of loading the library (see
-http://gcc.gnu.org/wiki/Visibility for details). Therefore you are
-recommended to always add the above flags when using Google Test as a
-shared library. Otherwise a future release of Google Test may break
-your build script.
-
-### Avoiding Macro Name Clashes ###
-
-In C++, macros don't obey namespaces. Therefore two libraries that
-both define a macro of the same name will clash if you #include both
-definitions. In case a Google Test macro clashes with another
-library, you can force Google Test to rename its macro to avoid the
-conflict.
-
-Specifically, if both Google Test and some other code define macro
-FOO, you can add
-
- -DGTEST_DONT_DEFINE_FOO=1
-
-to the compiler flags to tell Google Test to change the macro's name
-from FOO to GTEST_FOO. Currently FOO can be FAIL, SUCCEED, or TEST.
-For example, with -DGTEST_DONT_DEFINE_TEST=1, you'll need to write
-
- GTEST_TEST(SomeTest, DoesThis) { ... }
-
-instead of
-
- TEST(SomeTest, DoesThis) { ... }
-
-in order to define a test.
-
-Upgrating from an Earlier Version
----------------------------------
-
-We strive to keep Google Test releases backward compatible.
-Sometimes, though, we have to make some breaking changes for the
-users' long-term benefits. This section describes what you'll need to
-do if you are upgrading from an earlier version of Google Test.
-
-### Upgrading from 1.3.0 or Earlier ###
-
-You may need to explicitly enable or disable Google Test's own TR1
-tuple library. See the instructions in section "Choosing a TR1 Tuple
-Library".
-
-### Upgrading from 1.4.0 or Earlier ###
-
-The Autotools build script (configure + make) is no longer officially
-supportted. You are encouraged to migrate to your own build system or
-use CMake. If you still need to use Autotools, you can find
-instructions in the README file from Google Test 1.4.0.
-
-On platforms where the pthread library is available, Google Test uses
-it in order to be thread-safe. See the "Multi-threaded Tests" section
-for what this means to your build script.
-
-If you use Microsoft Visual C++ 7.1 with exceptions disabled, Google
-Test will no longer compile. This should affect very few people, as a
-large portion of STL (including <string>) doesn't compile in this mode
-anyway. We decided to stop supporting it in order to greatly simplify
-Google Test's implementation.
-
-Developing Google Test
-----------------------
-
-This section discusses how to make your own changes to Google Test.
-
-### Testing Google Test Itself ###
-
-To make sure your changes work as intended and don't break existing
-functionality, you'll want to compile and run Google Test's own tests.
-For that you can use CMake:
-
- mkdir mybuild
- cd mybuild
- cmake -Dgtest_build_tests=ON ${GTEST_DIR}
-
-Make sure you have Python installed, as some of Google Test's tests
-are written in Python. If the cmake command complains about not being
-able to find Python ("Could NOT find PythonInterp (missing:
-PYTHON_EXECUTABLE)"), try telling it explicitly where your Python
-executable can be found:
-
- cmake -DPYTHON_EXECUTABLE=path/to/python -Dgtest_build_tests=ON ${GTEST_DIR}
-
-Next, you can build Google Test and all of its own tests. On *nix,
-this is usually done by 'make'. To run the tests, do
-
- make test
-
-All tests should pass.
-
-### Regenerating Source Files ###
-
-Some of Google Test's source files are generated from templates (not
-in the C++ sense) using a script. A template file is named FOO.pump,
-where FOO is the name of the file it will generate. For example, the
-file include/gtest/internal/gtest-type-util.h.pump is used to generate
-gtest-type-util.h in the same directory.
-
-Normally you don't need to worry about regenerating the source files,
-unless you need to modify them. In that case, you should modify the
-corresponding .pump files instead and run the pump.py Python script to
-regenerate them. You can find pump.py in the scripts/ directory.
-Read the Pump manual [2] for how to use it.
-
- [2] http://code.google.com/p/googletest/wiki/PumpManual
-
-### Contributing a Patch ###
-
-We welcome patches. Please read the Google Test developer's guide [3]
-for how you can contribute. In particular, make sure you have signed
-the Contributor License Agreement, or we won't be able to accept the
-patch.
-
- [3] http://code.google.com/p/googletest/wiki/GoogleTestDevGuide
-
-Happy testing!
diff --git a/src/testing/gtest/build-aux/.keep b/src/testing/gtest/build-aux/.keep
deleted file mode 100644
index e69de29b..00000000
--- a/src/testing/gtest/build-aux/.keep
+++ /dev/null
diff --git a/src/testing/gtest/cmake/internal_utils.cmake b/src/testing/gtest/cmake/internal_utils.cmake
deleted file mode 100644
index 8cb21894..00000000
--- a/src/testing/gtest/cmake/internal_utils.cmake
+++ /dev/null
@@ -1,227 +0,0 @@
-# Defines functions and macros useful for building Google Test and
-# Google Mock.
-#
-# Note:
-#
-# - This file will be run twice when building Google Mock (once via
-# Google Test's CMakeLists.txt, and once via Google Mock's).
-# Therefore it shouldn't have any side effects other than defining
-# the functions and macros.
-#
-# - The functions/macros defined in this file may depend on Google
-# Test and Google Mock's option() definitions, and thus must be
-# called *after* the options have been defined.
-
-# Tweaks CMake's default compiler/linker settings to suit Google Test's needs.
-#
-# This must be a macro(), as inside a function string() can only
-# update variables in the function scope.
-macro(fix_default_compiler_settings_)
- if (MSVC)
- # For MSVC, CMake sets certain flags to defaults we want to override.
- # This replacement code is taken from sample in the CMake Wiki at
- # http://www.cmake.org/Wiki/CMake_FAQ#Dynamic_Replace.
- foreach (flag_var
- CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
- CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
- if (NOT BUILD_SHARED_LIBS AND NOT gtest_force_shared_crt)
- # When Google Test is built as a shared library, it should also use
- # shared runtime libraries. Otherwise, it may end up with multiple
- # copies of runtime library data in different modules, resulting in
- # hard-to-find crashes. When it is built as a static library, it is
- # preferable to use CRT as static libraries, as we don't have to rely
- # on CRT DLLs being available. CMake always defaults to using shared
- # CRT libraries, so we override that default here.
- string(REPLACE "/MD" "-MT" ${flag_var} "${${flag_var}}")
- endif()
-
- # We prefer more strict warning checking for building Google Test.
- # Replaces /W3 with /W4 in defaults.
- string(REPLACE "/W3" "-W4" ${flag_var} "${${flag_var}}")
- endforeach()
- endif()
-endmacro()
-
-# Defines the compiler/linker flags used to build Google Test and
-# Google Mock. You can tweak these definitions to suit your need. A
-# variable's value is empty before it's explicitly assigned to.
-macro(config_compiler_and_linker)
- if (NOT gtest_disable_pthreads)
- # Defines CMAKE_USE_PTHREADS_INIT and CMAKE_THREAD_LIBS_INIT.
- find_package(Threads)
- endif()
-
- fix_default_compiler_settings_()
- if (MSVC)
- # Newlines inside flags variables break CMake's NMake generator.
- # TODO(vladl@google.com): Add -RTCs and -RTCu to debug builds.
- set(cxx_base_flags "-GS -W4 -WX -wd4127 -wd4251 -wd4275 -nologo -J -Zi")
- if (MSVC_VERSION LESS 1400)
- # Suppress spurious warnings MSVC 7.1 sometimes issues.
- # Forcing value to bool.
- set(cxx_base_flags "${cxx_base_flags} -wd4800")
- # Copy constructor and assignment operator could not be generated.
- set(cxx_base_flags "${cxx_base_flags} -wd4511 -wd4512")
- # Compatibility warnings not applicable to Google Test.
- # Resolved overload was found by argument-dependent lookup.
- set(cxx_base_flags "${cxx_base_flags} -wd4675")
- endif()
- set(cxx_base_flags "${cxx_base_flags} -D_UNICODE -DUNICODE -DWIN32 -D_WIN32")
- set(cxx_base_flags "${cxx_base_flags} -DSTRICT -DWIN32_LEAN_AND_MEAN")
- set(cxx_exception_flags "-EHsc -D_HAS_EXCEPTIONS=1")
- set(cxx_no_exception_flags "-D_HAS_EXCEPTIONS=0")
- set(cxx_no_rtti_flags "-GR-")
- elseif (CMAKE_COMPILER_IS_GNUCXX)
- set(cxx_base_flags "-Wall -Wshadow")
- set(cxx_exception_flags "-fexceptions")
- set(cxx_no_exception_flags "-fno-exceptions")
- # Until version 4.3.2, GCC doesn't define a macro to indicate
- # whether RTTI is enabled. Therefore we define GTEST_HAS_RTTI
- # explicitly.
- set(cxx_no_rtti_flags "-fno-rtti -DGTEST_HAS_RTTI=0")
- set(cxx_strict_flags
- "-Wextra -Wno-unused-parameter -Wno-missing-field-initializers")
- elseif (CMAKE_CXX_COMPILER_ID STREQUAL "SunPro")
- set(cxx_exception_flags "-features=except")
- # Sun Pro doesn't provide macros to indicate whether exceptions and
- # RTTI are enabled, so we define GTEST_HAS_* explicitly.
- set(cxx_no_exception_flags "-features=no%except -DGTEST_HAS_EXCEPTIONS=0")
- set(cxx_no_rtti_flags "-features=no%rtti -DGTEST_HAS_RTTI=0")
- elseif (CMAKE_CXX_COMPILER_ID STREQUAL "VisualAge" OR
- CMAKE_CXX_COMPILER_ID STREQUAL "XL")
- # CMake 2.8 changes Visual Age's compiler ID to "XL".
- set(cxx_exception_flags "-qeh")
- set(cxx_no_exception_flags "-qnoeh")
- # Until version 9.0, Visual Age doesn't define a macro to indicate
- # whether RTTI is enabled. Therefore we define GTEST_HAS_RTTI
- # explicitly.
- set(cxx_no_rtti_flags "-qnortti -DGTEST_HAS_RTTI=0")
- elseif (CMAKE_CXX_COMPILER_ID STREQUAL "HP")
- set(cxx_base_flags "-AA -mt")
- set(cxx_exception_flags "-DGTEST_HAS_EXCEPTIONS=1")
- set(cxx_no_exception_flags "+noeh -DGTEST_HAS_EXCEPTIONS=0")
- # RTTI can not be disabled in HP aCC compiler.
- set(cxx_no_rtti_flags "")
- endif()
-
- if (CMAKE_USE_PTHREADS_INIT) # The pthreads library is available and allowed.
- set(cxx_base_flags "${cxx_base_flags} -DGTEST_HAS_PTHREAD=1")
- else()
- set(cxx_base_flags "${cxx_base_flags} -DGTEST_HAS_PTHREAD=0")
- endif()
-
- # For building gtest's own tests and samples.
- set(cxx_exception "${CMAKE_CXX_FLAGS} ${cxx_base_flags} ${cxx_exception_flags}")
- set(cxx_no_exception
- "${CMAKE_CXX_FLAGS} ${cxx_base_flags} ${cxx_no_exception_flags}")
- set(cxx_default "${cxx_exception}")
- set(cxx_no_rtti "${cxx_default} ${cxx_no_rtti_flags}")
- set(cxx_use_own_tuple "${cxx_default} -DGTEST_USE_OWN_TR1_TUPLE=1")
-
- # For building the gtest libraries.
- set(cxx_strict "${cxx_default} ${cxx_strict_flags}")
-endmacro()
-
-# Defines the gtest & gtest_main libraries. User tests should link
-# with one of them.
-function(cxx_library_with_type name type cxx_flags)
- # type can be either STATIC or SHARED to denote a static or shared library.
- # ARGN refers to additional arguments after 'cxx_flags'.
- add_library(${name} ${type} ${ARGN})
- set_target_properties(${name}
- PROPERTIES
- COMPILE_FLAGS "${cxx_flags}")
- if (BUILD_SHARED_LIBS OR type STREQUAL "SHARED")
- set_target_properties(${name}
- PROPERTIES
- COMPILE_DEFINITIONS "GTEST_CREATE_SHARED_LIBRARY=1")
- endif()
- if (CMAKE_USE_PTHREADS_INIT)
- target_link_libraries(${name} ${CMAKE_THREAD_LIBS_INIT})
- endif()
-endfunction()
-
-########################################################################
-#
-# Helper functions for creating build targets.
-
-function(cxx_shared_library name cxx_flags)
- cxx_library_with_type(${name} SHARED "${cxx_flags}" ${ARGN})
-endfunction()
-
-function(cxx_library name cxx_flags)
- cxx_library_with_type(${name} "" "${cxx_flags}" ${ARGN})
-endfunction()
-
-# cxx_executable_with_flags(name cxx_flags libs srcs...)
-#
-# creates a named C++ executable that depends on the given libraries and
-# is built from the given source files with the given compiler flags.
-function(cxx_executable_with_flags name cxx_flags libs)
- add_executable(${name} ${ARGN})
- if (cxx_flags)
- set_target_properties(${name}
- PROPERTIES
- COMPILE_FLAGS "${cxx_flags}")
- endif()
- if (BUILD_SHARED_LIBS)
- set_target_properties(${name}
- PROPERTIES
- COMPILE_DEFINITIONS "GTEST_LINKED_AS_SHARED_LIBRARY=1")
- endif()
- # To support mixing linking in static and dynamic libraries, link each
- # library in with an extra call to target_link_libraries.
- foreach (lib "${libs}")
- target_link_libraries(${name} ${lib})
- endforeach()
-endfunction()
-
-# cxx_executable(name dir lib srcs...)
-#
-# creates a named target that depends on the given libs and is built
-# from the given source files. dir/name.cc is implicitly included in
-# the source file list.
-function(cxx_executable name dir libs)
- cxx_executable_with_flags(
- ${name} "${cxx_default}" "${libs}" "${dir}/${name}.cc" ${ARGN})
-endfunction()
-
-# Sets PYTHONINTERP_FOUND and PYTHON_EXECUTABLE.
-find_package(PythonInterp)
-
-# cxx_test_with_flags(name cxx_flags libs srcs...)
-#
-# creates a named C++ test that depends on the given libs and is built
-# from the given source files with the given compiler flags.
-function(cxx_test_with_flags name cxx_flags libs)
- cxx_executable_with_flags(${name} "${cxx_flags}" "${libs}" ${ARGN})
- add_test(${name} ${name})
-endfunction()
-
-# cxx_test(name libs srcs...)
-#
-# creates a named test target that depends on the given libs and is
-# built from the given source files. Unlike cxx_test_with_flags,
-# test/name.cc is already implicitly included in the source file list.
-function(cxx_test name libs)
- cxx_test_with_flags("${name}" "${cxx_default}" "${libs}"
- "test/${name}.cc" ${ARGN})
-endfunction()
-
-# py_test(name)
-#
-# creates a Python test with the given name whose main module is in
-# test/name.py. It does nothing if Python is not installed.
-function(py_test name)
- # We are not supporting Python tests on Linux yet as they consider
- # all Linux environments to be google3 and try to use google3 features.
- if (PYTHONINTERP_FOUND)
- # ${CMAKE_BINARY_DIR} is known at configuration time, so we can
- # directly bind it from cmake. ${CTEST_CONFIGURATION_TYPE} is known
- # only at ctest runtime (by calling ctest -c <Configuration>), so
- # we have to escape $ to delay variable substitution here.
- add_test(${name}
- ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test/${name}.py
- --build_dir=${CMAKE_CURRENT_BINARY_DIR}/\${CTEST_CONFIGURATION_TYPE})
- endif()
-endfunction()
diff --git a/src/testing/gtest/codegear/gtest.cbproj b/src/testing/gtest/codegear/gtest.cbproj
deleted file mode 100644
index 95c3054b..00000000
--- a/src/testing/gtest/codegear/gtest.cbproj
+++ /dev/null
@@ -1,138 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <ProjectGuid>{bca37a72-5b07-46cf-b44e-89f8e06451a2}</ProjectGuid>
- <Config Condition="'$(Config)'==''">Release</Config>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
- <Base>true</Base>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_1)'!=''">
- <Base>true</Base>
- <Cfg_1>true</Cfg_1>
- <CfgParent>Base</CfgParent>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_2)'!=''">
- <Base>true</Base>
- <Cfg_2>true</Cfg_2>
- <CfgParent>Base</CfgParent>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Base)'!=''">
- <BCC_OptimizeForSpeed>true</BCC_OptimizeForSpeed>
- <OutputExt>lib</OutputExt>
- <DCC_CBuilderOutput>JPHNE</DCC_CBuilderOutput>
- <Defines>NO_STRICT</Defines>
- <DynamicRTL>true</DynamicRTL>
- <UsePackages>true</UsePackages>
- <ProjectType>CppStaticLibrary</ProjectType>
- <BCC_CPPCompileAlways>true</BCC_CPPCompileAlways>
- <PackageImports>rtl.bpi;vcl.bpi;bcbie.bpi;vclx.bpi;vclactnband.bpi;xmlrtl.bpi;bcbsmp.bpi;dbrtl.bpi;vcldb.bpi;bdertl.bpi;vcldbx.bpi;dsnap.bpi;dsnapcon.bpi;vclib.bpi;ibxpress.bpi;adortl.bpi;dbxcds.bpi;dbexpress.bpi;DbxCommonDriver.bpi;websnap.bpi;vclie.bpi;webdsnap.bpi;inet.bpi;inetdbbde.bpi;inetdbxpress.bpi;soaprtl.bpi;Rave75VCL.bpi;teeUI.bpi;tee.bpi;teedb.bpi;IndyCore.bpi;IndySystem.bpi;IndyProtocols.bpi;IntrawebDB_90_100.bpi;Intraweb_90_100.bpi;dclZipForged11.bpi;vclZipForged11.bpi;GR32_BDS2006.bpi;GR32_DSGN_BDS2006.bpi;Jcl.bpi;JclVcl.bpi;JvCoreD11R.bpi;JvSystemD11R.bpi;JvStdCtrlsD11R.bpi;JvAppFrmD11R.bpi;JvBandsD11R.bpi;JvDBD11R.bpi;JvDlgsD11R.bpi;JvBDED11R.bpi;JvCmpD11R.bpi;JvCryptD11R.bpi;JvCtrlsD11R.bpi;JvCustomD11R.bpi;JvDockingD11R.bpi;JvDotNetCtrlsD11R.bpi;JvEDID11R.bpi;JvGlobusD11R.bpi;JvHMID11R.bpi;JvInterpreterD11R.bpi;JvJansD11R.bpi;JvManagedThreadsD11R.bpi;JvMMD11R.bpi;JvNetD11R.bpi;JvPageCompsD11R.bpi;JvPluginD11R.bpi;JvPrintPreviewD11R.bpi;JvRuntimeDesignD11R.bpi;JvTimeFrameworkD11R.bpi;JvValidatorsD11R.bpi;JvWizardD11R.bpi;JvXPCtrlsD11R.bpi;VclSmp.bpi;CExceptionExpert11.bpi</PackageImports>
- <BCC_wpar>false</BCC_wpar>
- <IncludePath>$(BDS)\include;$(BDS)\include\dinkumware;$(BDS)\include\vcl;..\src;..\include;..</IncludePath>
- <AllPackageLibs>rtl.lib;vcl.lib</AllPackageLibs>
- <TLIB_PageSize>32</TLIB_PageSize>
- <ILINK_LibraryPath>$(BDS)\lib;$(BDS)\lib\obj;$(BDS)\lib\psdk</ILINK_LibraryPath>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Cfg_1)'!=''">
- <BCC_OptimizeForSpeed>false</BCC_OptimizeForSpeed>
- <DCC_Optimize>false</DCC_Optimize>
- <DCC_DebugInfoInExe>true</DCC_DebugInfoInExe>
- <Defines>_DEBUG;$(Defines)</Defines>
- <ILINK_FullDebugInfo>true</ILINK_FullDebugInfo>
- <BCC_InlineFunctionExpansion>false</BCC_InlineFunctionExpansion>
- <ILINK_DisableIncrementalLinking>true</ILINK_DisableIncrementalLinking>
- <BCC_UseRegisterVariables>None</BCC_UseRegisterVariables>
- <DCC_Define>DEBUG</DCC_Define>
- <BCC_DebugLineNumbers>true</BCC_DebugLineNumbers>
- <IntermediateOutputDir>Debug</IntermediateOutputDir>
- <TASM_DisplaySourceLines>true</TASM_DisplaySourceLines>
- <BCC_StackFrames>true</BCC_StackFrames>
- <BCC_DisableOptimizations>true</BCC_DisableOptimizations>
- <ILINK_LibraryPath>$(BDS)\lib\debug;$(ILINK_LibraryPath)</ILINK_LibraryPath>
- <TASM_Debugging>Full</TASM_Debugging>
- <BCC_SourceDebuggingOn>true</BCC_SourceDebuggingOn>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Cfg_2)'!=''">
- <Defines>NDEBUG;$(Defines)</Defines>
- <IntermediateOutputDir>Release</IntermediateOutputDir>
- <ILINK_LibraryPath>$(BDS)\lib\release;$(ILINK_LibraryPath)</ILINK_LibraryPath>
- <TASM_Debugging>None</TASM_Debugging>
- </PropertyGroup>
- <ProjectExtensions>
- <Borland.Personality>CPlusPlusBuilder.Personality</Borland.Personality>
- <Borland.ProjectType>CppStaticLibrary</Borland.ProjectType>
- <BorlandProject>
-<BorlandProject><CPlusPlusBuilder.Personality><VersionInfo><VersionInfo Name="IncludeVerInfo">False</VersionInfo><VersionInfo Name="AutoIncBuild">False</VersionInfo><VersionInfo Name="MajorVer">1</VersionInfo><VersionInfo Name="MinorVer">0</VersionInfo><VersionInfo Name="Release">0</VersionInfo><VersionInfo Name="Build">0</VersionInfo><VersionInfo Name="Debug">False</VersionInfo><VersionInfo Name="PreRelease">False</VersionInfo><VersionInfo Name="Special">False</VersionInfo><VersionInfo Name="Private">False</VersionInfo><VersionInfo Name="DLL">False</VersionInfo><VersionInfo Name="Locale">1033</VersionInfo><VersionInfo Name="CodePage">1252</VersionInfo></VersionInfo><VersionInfoKeys><VersionInfoKeys Name="CompanyName"></VersionInfoKeys><VersionInfoKeys Name="FileDescription"></VersionInfoKeys><VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys><VersionInfoKeys Name="InternalName"></VersionInfoKeys><VersionInfoKeys Name="LegalCopyright"></VersionInfoKeys><VersionInfoKeys Name="LegalTrademarks"></VersionInfoKeys><VersionInfoKeys Name="OriginalFilename"></VersionInfoKeys><VersionInfoKeys Name="ProductName"></VersionInfoKeys><VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys><VersionInfoKeys Name="Comments"></VersionInfoKeys></VersionInfoKeys><Debugging><Debugging Name="DebugSourceDirs"></Debugging></Debugging><Parameters><Parameters Name="RunParams"></Parameters><Parameters Name="Launcher"></Parameters><Parameters Name="UseLauncher">False</Parameters><Parameters Name="DebugCWD"></Parameters><Parameters Name="HostApplication"></Parameters><Parameters Name="RemoteHost"></Parameters><Parameters Name="RemotePath"></Parameters><Parameters Name="RemoteParams"></Parameters><Parameters Name="RemoteLauncher"></Parameters><Parameters Name="UseRemoteLauncher">False</Parameters><Parameters Name="RemoteCWD"></Parameters><Parameters Name="RemoteDebug">False</Parameters><Parameters Name="Debug Symbols Search Path"></Parameters><Parameters Name="LoadAllSymbols">True</Parameters><Parameters Name="LoadUnspecifiedSymbols">False</Parameters></Parameters><Excluded_Packages>
-
-
- <Excluded_Packages Name="$(BDS)\bin\bcboffice2k100.bpl">CodeGear C++Builder Office 2000 Servers Package</Excluded_Packages>
- <Excluded_Packages Name="$(BDS)\bin\bcbofficexp100.bpl">CodeGear C++Builder Office XP Servers Package</Excluded_Packages>
- </Excluded_Packages><Linker><Linker Name="LibPrefix"></Linker><Linker Name="LibSuffix"></Linker><Linker Name="LibVersion"></Linker></Linker><ProjectProperties><ProjectProperties Name="AutoShowDeps">False</ProjectProperties><ProjectProperties Name="ManagePaths">True</ProjectProperties><ProjectProperties Name="VerifyPackages">True</ProjectProperties></ProjectProperties><HistoryLists_hlIncludePath><HistoryLists_hlIncludePath Name="Count">3</HistoryLists_hlIncludePath><HistoryLists_hlIncludePath Name="Item0">$(BDS)\include;$(BDS)\include\dinkumware;$(BDS)\include\vcl;..\src;..\include;..</HistoryLists_hlIncludePath><HistoryLists_hlIncludePath Name="Item1">$(BDS)\include;$(BDS)\include\dinkumware;$(BDS)\include\vcl;..\src;..\include;..</HistoryLists_hlIncludePath><HistoryLists_hlIncludePath Name="Item2">$(BDS)\include;$(BDS)\include\dinkumware;$(BDS)\include\vcl;..\src;..\src;..\include</HistoryLists_hlIncludePath></HistoryLists_hlIncludePath><HistoryLists_hlILINK_LibraryPath><HistoryLists_hlILINK_LibraryPath Name="Count">1</HistoryLists_hlILINK_LibraryPath><HistoryLists_hlILINK_LibraryPath Name="Item0">$(BDS)\lib;$(BDS)\lib\obj;$(BDS)\lib\psdk</HistoryLists_hlILINK_LibraryPath></HistoryLists_hlILINK_LibraryPath><HistoryLists_hlDefines><HistoryLists_hlDefines Name="Count">1</HistoryLists_hlDefines><HistoryLists_hlDefines Name="Item0">NO_STRICT</HistoryLists_hlDefines></HistoryLists_hlDefines><HistoryLists_hlTLIB_PageSize><HistoryLists_hlTLIB_PageSize Name="Count">1</HistoryLists_hlTLIB_PageSize><HistoryLists_hlTLIB_PageSize Name="Item0">32</HistoryLists_hlTLIB_PageSize><HistoryLists_hlTLIB_PageSize Name="Item1">16</HistoryLists_hlTLIB_PageSize></HistoryLists_hlTLIB_PageSize></CPlusPlusBuilder.Personality></BorlandProject></BorlandProject>
- </ProjectExtensions>
- <Import Project="$(MSBuildBinPath)\Borland.Cpp.Targets" />
- <ItemGroup>
- <None Include="..\include\gtest\gtest-death-test.h">
- <BuildOrder>3</BuildOrder>
- </None>
- <None Include="..\include\gtest\gtest-message.h">
- <BuildOrder>4</BuildOrder>
- </None>
- <None Include="..\include\gtest\gtest-param-test.h">
- <BuildOrder>5</BuildOrder>
- </None>
- <None Include="..\include\gtest\gtest-spi.h">
- <BuildOrder>6</BuildOrder>
- </None>
- <None Include="..\include\gtest\gtest-test-part.h">
- <BuildOrder>7</BuildOrder>
- </None>
- <None Include="..\include\gtest\gtest-typed-test.h">
- <BuildOrder>8</BuildOrder>
- </None>
- <None Include="..\include\gtest\gtest.h">
- <BuildOrder>0</BuildOrder>
- </None>
- <None Include="..\include\gtest\gtest_pred_impl.h">
- <BuildOrder>1</BuildOrder>
- </None>
- <None Include="..\include\gtest\gtest_prod.h">
- <BuildOrder>2</BuildOrder>
- </None>
- <None Include="..\include\gtest\internal\gtest-death-test-internal.h">
- <BuildOrder>9</BuildOrder>
- </None>
- <None Include="..\include\gtest\internal\gtest-filepath.h">
- <BuildOrder>10</BuildOrder>
- </None>
- <None Include="..\include\gtest\internal\gtest-internal.h">
- <BuildOrder>11</BuildOrder>
- </None>
- <None Include="..\include\gtest\internal\gtest-linked_ptr.h">
- <BuildOrder>12</BuildOrder>
- </None>
- <None Include="..\include\gtest\internal\gtest-param-util-generated.h">
- <BuildOrder>14</BuildOrder>
- </None>
- <None Include="..\include\gtest\internal\gtest-param-util.h">
- <BuildOrder>13</BuildOrder>
- </None>
- <None Include="..\include\gtest\internal\gtest-port.h">
- <BuildOrder>15</BuildOrder>
- </None>
- <None Include="..\include\gtest\internal\gtest-string.h">
- <BuildOrder>16</BuildOrder>
- </None>
- <None Include="..\include\gtest\internal\gtest-type-util.h">
- <BuildOrder>17</BuildOrder>
- </None>
- <CppCompile Include="gtest_all.cc">
- <BuildOrder>18</BuildOrder>
- </CppCompile>
- <BuildConfiguration Include="Debug">
- <Key>Cfg_1</Key>
- </BuildConfiguration>
- <BuildConfiguration Include="Release">
- <Key>Cfg_2</Key>
- </BuildConfiguration>
- </ItemGroup>
-</Project> \ No newline at end of file
diff --git a/src/testing/gtest/codegear/gtest.groupproj b/src/testing/gtest/codegear/gtest.groupproj
deleted file mode 100644
index faf31cab..00000000
--- a/src/testing/gtest/codegear/gtest.groupproj
+++ /dev/null
@@ -1,54 +0,0 @@
-<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <ProjectGuid>{c1d923e0-6cba-4332-9b6f-3420acbf5091}</ProjectGuid>
- </PropertyGroup>
- <ItemGroup />
- <ItemGroup>
- <Projects Include="gtest.cbproj" />
- <Projects Include="gtest_main.cbproj" />
- <Projects Include="gtest_unittest.cbproj" />
- </ItemGroup>
- <ProjectExtensions>
- <Borland.Personality>Default.Personality</Borland.Personality>
- <Borland.ProjectType />
- <BorlandProject>
-<BorlandProject xmlns=""><Default.Personality></Default.Personality></BorlandProject></BorlandProject>
- </ProjectExtensions>
- <Target Name="gtest">
- <MSBuild Projects="gtest.cbproj" Targets="" />
- </Target>
- <Target Name="gtest:Clean">
- <MSBuild Projects="gtest.cbproj" Targets="Clean" />
- </Target>
- <Target Name="gtest:Make">
- <MSBuild Projects="gtest.cbproj" Targets="Make" />
- </Target>
- <Target Name="gtest_main">
- <MSBuild Projects="gtest_main.cbproj" Targets="" />
- </Target>
- <Target Name="gtest_main:Clean">
- <MSBuild Projects="gtest_main.cbproj" Targets="Clean" />
- </Target>
- <Target Name="gtest_main:Make">
- <MSBuild Projects="gtest_main.cbproj" Targets="Make" />
- </Target>
- <Target Name="gtest_unittest">
- <MSBuild Projects="gtest_unittest.cbproj" Targets="" />
- </Target>
- <Target Name="gtest_unittest:Clean">
- <MSBuild Projects="gtest_unittest.cbproj" Targets="Clean" />
- </Target>
- <Target Name="gtest_unittest:Make">
- <MSBuild Projects="gtest_unittest.cbproj" Targets="Make" />
- </Target>
- <Target Name="Build">
- <CallTarget Targets="gtest;gtest_main;gtest_unittest" />
- </Target>
- <Target Name="Clean">
- <CallTarget Targets="gtest:Clean;gtest_main:Clean;gtest_unittest:Clean" />
- </Target>
- <Target Name="Make">
- <CallTarget Targets="gtest:Make;gtest_main:Make;gtest_unittest:Make" />
- </Target>
- <Import Condition="Exists('$(MSBuildBinPath)\Borland.Group.Targets')" Project="$(MSBuildBinPath)\Borland.Group.Targets" />
-</Project> \ No newline at end of file
diff --git a/src/testing/gtest/codegear/gtest_all.cc b/src/testing/gtest/codegear/gtest_all.cc
deleted file mode 100644
index 121b2d80..00000000
--- a/src/testing/gtest/codegear/gtest_all.cc
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright 2009, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: Josh Kelley (joshkel@gmail.com)
-//
-// Google C++ Testing Framework (Google Test)
-//
-// C++Builder's IDE cannot build a static library from files with hyphens
-// in their name. See http://qc.codegear.com/wc/qcmain.aspx?d=70977 .
-// This file serves as a workaround.
-
-#include "src/gtest-all.cc"
diff --git a/src/testing/gtest/codegear/gtest_link.cc b/src/testing/gtest/codegear/gtest_link.cc
deleted file mode 100644
index 918eccd1..00000000
--- a/src/testing/gtest/codegear/gtest_link.cc
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright 2009, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: Josh Kelley (joshkel@gmail.com)
-//
-// Google C++ Testing Framework (Google Test)
-//
-// Links gtest.lib and gtest_main.lib into the current project in C++Builder.
-// This means that these libraries can't be renamed, but it's the only way to
-// ensure that Debug versus Release test builds are linked against the
-// appropriate Debug or Release build of the libraries.
-
-#pragma link "gtest.lib"
-#pragma link "gtest_main.lib"
diff --git a/src/testing/gtest/codegear/gtest_main.cbproj b/src/testing/gtest/codegear/gtest_main.cbproj
deleted file mode 100644
index d76ce139..00000000
--- a/src/testing/gtest/codegear/gtest_main.cbproj
+++ /dev/null
@@ -1,82 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <ProjectGuid>{bca37a72-5b07-46cf-b44e-89f8e06451a2}</ProjectGuid>
- <Config Condition="'$(Config)'==''">Release</Config>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
- <Base>true</Base>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_1)'!=''">
- <Base>true</Base>
- <Cfg_1>true</Cfg_1>
- <CfgParent>Base</CfgParent>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_2)'!=''">
- <Base>true</Base>
- <Cfg_2>true</Cfg_2>
- <CfgParent>Base</CfgParent>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Base)'!=''">
- <BCC_OptimizeForSpeed>true</BCC_OptimizeForSpeed>
- <OutputExt>lib</OutputExt>
- <DCC_CBuilderOutput>JPHNE</DCC_CBuilderOutput>
- <Defines>NO_STRICT</Defines>
- <DynamicRTL>true</DynamicRTL>
- <UsePackages>true</UsePackages>
- <ProjectType>CppStaticLibrary</ProjectType>
- <BCC_CPPCompileAlways>true</BCC_CPPCompileAlways>
- <PackageImports>rtl.bpi;vcl.bpi;bcbie.bpi;vclx.bpi;vclactnband.bpi;xmlrtl.bpi;bcbsmp.bpi;dbrtl.bpi;vcldb.bpi;bdertl.bpi;vcldbx.bpi;dsnap.bpi;dsnapcon.bpi;vclib.bpi;ibxpress.bpi;adortl.bpi;dbxcds.bpi;dbexpress.bpi;DbxCommonDriver.bpi;websnap.bpi;vclie.bpi;webdsnap.bpi;inet.bpi;inetdbbde.bpi;inetdbxpress.bpi;soaprtl.bpi;Rave75VCL.bpi;teeUI.bpi;tee.bpi;teedb.bpi;IndyCore.bpi;IndySystem.bpi;IndyProtocols.bpi;IntrawebDB_90_100.bpi;Intraweb_90_100.bpi;dclZipForged11.bpi;vclZipForged11.bpi;GR32_BDS2006.bpi;GR32_DSGN_BDS2006.bpi;Jcl.bpi;JclVcl.bpi;JvCoreD11R.bpi;JvSystemD11R.bpi;JvStdCtrlsD11R.bpi;JvAppFrmD11R.bpi;JvBandsD11R.bpi;JvDBD11R.bpi;JvDlgsD11R.bpi;JvBDED11R.bpi;JvCmpD11R.bpi;JvCryptD11R.bpi;JvCtrlsD11R.bpi;JvCustomD11R.bpi;JvDockingD11R.bpi;JvDotNetCtrlsD11R.bpi;JvEDID11R.bpi;JvGlobusD11R.bpi;JvHMID11R.bpi;JvInterpreterD11R.bpi;JvJansD11R.bpi;JvManagedThreadsD11R.bpi;JvMMD11R.bpi;JvNetD11R.bpi;JvPageCompsD11R.bpi;JvPluginD11R.bpi;JvPrintPreviewD11R.bpi;JvRuntimeDesignD11R.bpi;JvTimeFrameworkD11R.bpi;JvValidatorsD11R.bpi;JvWizardD11R.bpi;JvXPCtrlsD11R.bpi;VclSmp.bpi;CExceptionExpert11.bpi</PackageImports>
- <BCC_wpar>false</BCC_wpar>
- <IncludePath>$(BDS)\include;$(BDS)\include\dinkumware;$(BDS)\include\vcl;..\src;..\include;..</IncludePath>
- <AllPackageLibs>rtl.lib;vcl.lib</AllPackageLibs>
- <TLIB_PageSize>32</TLIB_PageSize>
- <ILINK_LibraryPath>$(BDS)\lib;$(BDS)\lib\obj;$(BDS)\lib\psdk</ILINK_LibraryPath>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Cfg_1)'!=''">
- <BCC_OptimizeForSpeed>false</BCC_OptimizeForSpeed>
- <DCC_Optimize>false</DCC_Optimize>
- <DCC_DebugInfoInExe>true</DCC_DebugInfoInExe>
- <Defines>_DEBUG;$(Defines)</Defines>
- <ILINK_FullDebugInfo>true</ILINK_FullDebugInfo>
- <BCC_InlineFunctionExpansion>false</BCC_InlineFunctionExpansion>
- <ILINK_DisableIncrementalLinking>true</ILINK_DisableIncrementalLinking>
- <BCC_UseRegisterVariables>None</BCC_UseRegisterVariables>
- <DCC_Define>DEBUG</DCC_Define>
- <BCC_DebugLineNumbers>true</BCC_DebugLineNumbers>
- <IntermediateOutputDir>Debug</IntermediateOutputDir>
- <TASM_DisplaySourceLines>true</TASM_DisplaySourceLines>
- <BCC_StackFrames>true</BCC_StackFrames>
- <BCC_DisableOptimizations>true</BCC_DisableOptimizations>
- <ILINK_LibraryPath>$(BDS)\lib\debug;$(ILINK_LibraryPath)</ILINK_LibraryPath>
- <TASM_Debugging>Full</TASM_Debugging>
- <BCC_SourceDebuggingOn>true</BCC_SourceDebuggingOn>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Cfg_2)'!=''">
- <Defines>NDEBUG;$(Defines)</Defines>
- <IntermediateOutputDir>Release</IntermediateOutputDir>
- <ILINK_LibraryPath>$(BDS)\lib\release;$(ILINK_LibraryPath)</ILINK_LibraryPath>
- <TASM_Debugging>None</TASM_Debugging>
- </PropertyGroup>
- <ProjectExtensions>
- <Borland.Personality>CPlusPlusBuilder.Personality</Borland.Personality>
- <Borland.ProjectType>CppStaticLibrary</Borland.ProjectType>
- <BorlandProject>
-<BorlandProject><CPlusPlusBuilder.Personality><VersionInfo><VersionInfo Name="IncludeVerInfo">False</VersionInfo><VersionInfo Name="AutoIncBuild">False</VersionInfo><VersionInfo Name="MajorVer">1</VersionInfo><VersionInfo Name="MinorVer">0</VersionInfo><VersionInfo Name="Release">0</VersionInfo><VersionInfo Name="Build">0</VersionInfo><VersionInfo Name="Debug">False</VersionInfo><VersionInfo Name="PreRelease">False</VersionInfo><VersionInfo Name="Special">False</VersionInfo><VersionInfo Name="Private">False</VersionInfo><VersionInfo Name="DLL">False</VersionInfo><VersionInfo Name="Locale">1033</VersionInfo><VersionInfo Name="CodePage">1252</VersionInfo></VersionInfo><VersionInfoKeys><VersionInfoKeys Name="CompanyName"></VersionInfoKeys><VersionInfoKeys Name="FileDescription"></VersionInfoKeys><VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys><VersionInfoKeys Name="InternalName"></VersionInfoKeys><VersionInfoKeys Name="LegalCopyright"></VersionInfoKeys><VersionInfoKeys Name="LegalTrademarks"></VersionInfoKeys><VersionInfoKeys Name="OriginalFilename"></VersionInfoKeys><VersionInfoKeys Name="ProductName"></VersionInfoKeys><VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys><VersionInfoKeys Name="Comments"></VersionInfoKeys></VersionInfoKeys><Debugging><Debugging Name="DebugSourceDirs"></Debugging></Debugging><Parameters><Parameters Name="RunParams"></Parameters><Parameters Name="Launcher"></Parameters><Parameters Name="UseLauncher">False</Parameters><Parameters Name="DebugCWD"></Parameters><Parameters Name="HostApplication"></Parameters><Parameters Name="RemoteHost"></Parameters><Parameters Name="RemotePath"></Parameters><Parameters Name="RemoteParams"></Parameters><Parameters Name="RemoteLauncher"></Parameters><Parameters Name="UseRemoteLauncher">False</Parameters><Parameters Name="RemoteCWD"></Parameters><Parameters Name="RemoteDebug">False</Parameters><Parameters Name="Debug Symbols Search Path"></Parameters><Parameters Name="LoadAllSymbols">True</Parameters><Parameters Name="LoadUnspecifiedSymbols">False</Parameters></Parameters><Excluded_Packages>
- <Excluded_Packages Name="$(BDS)\bin\bcboffice2k100.bpl">CodeGear C++Builder Office 2000 Servers Package</Excluded_Packages>
- <Excluded_Packages Name="$(BDS)\bin\bcbofficexp100.bpl">CodeGear C++Builder Office XP Servers Package</Excluded_Packages>
- </Excluded_Packages><Linker><Linker Name="LibPrefix"></Linker><Linker Name="LibSuffix"></Linker><Linker Name="LibVersion"></Linker></Linker><ProjectProperties><ProjectProperties Name="AutoShowDeps">False</ProjectProperties><ProjectProperties Name="ManagePaths">True</ProjectProperties><ProjectProperties Name="VerifyPackages">True</ProjectProperties></ProjectProperties><HistoryLists_hlIncludePath><HistoryLists_hlIncludePath Name="Count">3</HistoryLists_hlIncludePath><HistoryLists_hlIncludePath Name="Item0">$(BDS)\include;$(BDS)\include\dinkumware;$(BDS)\include\vcl;..\src;..\include;..</HistoryLists_hlIncludePath><HistoryLists_hlIncludePath Name="Item1">$(BDS)\include;$(BDS)\include\dinkumware;$(BDS)\include\vcl;..\src;..\include;..</HistoryLists_hlIncludePath><HistoryLists_hlIncludePath Name="Item2">$(BDS)\include;$(BDS)\include\dinkumware;$(BDS)\include\vcl;..\src;..\src;..\include</HistoryLists_hlIncludePath></HistoryLists_hlIncludePath><HistoryLists_hlILINK_LibraryPath><HistoryLists_hlILINK_LibraryPath Name="Count">1</HistoryLists_hlILINK_LibraryPath><HistoryLists_hlILINK_LibraryPath Name="Item0">$(BDS)\lib;$(BDS)\lib\obj;$(BDS)\lib\psdk</HistoryLists_hlILINK_LibraryPath></HistoryLists_hlILINK_LibraryPath><HistoryLists_hlDefines><HistoryLists_hlDefines Name="Count">1</HistoryLists_hlDefines><HistoryLists_hlDefines Name="Item0">NO_STRICT</HistoryLists_hlDefines></HistoryLists_hlDefines><HistoryLists_hlTLIB_PageSize><HistoryLists_hlTLIB_PageSize Name="Count">1</HistoryLists_hlTLIB_PageSize><HistoryLists_hlTLIB_PageSize Name="Item0">32</HistoryLists_hlTLIB_PageSize><HistoryLists_hlTLIB_PageSize Name="Item1">16</HistoryLists_hlTLIB_PageSize></HistoryLists_hlTLIB_PageSize></CPlusPlusBuilder.Personality></BorlandProject></BorlandProject>
- </ProjectExtensions>
- <Import Project="$(MSBuildBinPath)\Borland.Cpp.Targets" />
- <ItemGroup>
- <CppCompile Include="..\src\gtest_main.cc">
- <BuildOrder>0</BuildOrder>
- </CppCompile>
- <BuildConfiguration Include="Debug">
- <Key>Cfg_1</Key>
- </BuildConfiguration>
- <BuildConfiguration Include="Release">
- <Key>Cfg_2</Key>
- </BuildConfiguration>
- </ItemGroup>
-</Project>
diff --git a/src/testing/gtest/codegear/gtest_unittest.cbproj b/src/testing/gtest/codegear/gtest_unittest.cbproj
deleted file mode 100644
index dc5db8e4..00000000
--- a/src/testing/gtest/codegear/gtest_unittest.cbproj
+++ /dev/null
@@ -1,88 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <ProjectGuid>{eea63393-5ac5-4b9c-8909-d75fef2daa41}</ProjectGuid>
- <Config Condition="'$(Config)'==''">Release</Config>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
- <Base>true</Base>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_1)'!=''">
- <Base>true</Base>
- <Cfg_1>true</Cfg_1>
- <CfgParent>Base</CfgParent>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_2)'!=''">
- <Base>true</Base>
- <Cfg_2>true</Cfg_2>
- <CfgParent>Base</CfgParent>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Base)'!=''">
- <OutputExt>exe</OutputExt>
- <BCC_OptimizeForSpeed>true</BCC_OptimizeForSpeed>
- <Defines>NO_STRICT</Defines>
- <DCC_CBuilderOutput>JPHNE</DCC_CBuilderOutput>
- <DynamicRTL>true</DynamicRTL>
- <ILINK_ObjectSearchPath>..\test</ILINK_ObjectSearchPath>
- <UsePackages>true</UsePackages>
- <ProjectType>CppConsoleApplication</ProjectType>
- <NoVCL>true</NoVCL>
- <BCC_CPPCompileAlways>true</BCC_CPPCompileAlways>
- <PackageImports>rtl.bpi;vcl.bpi;bcbie.bpi;vclx.bpi;vclactnband.bpi;xmlrtl.bpi;bcbsmp.bpi;dbrtl.bpi;vcldb.bpi;bdertl.bpi;vcldbx.bpi;dsnap.bpi;dsnapcon.bpi;vclib.bpi;ibxpress.bpi;adortl.bpi;dbxcds.bpi;dbexpress.bpi;DbxCommonDriver.bpi;websnap.bpi;vclie.bpi;webdsnap.bpi;inet.bpi;inetdbbde.bpi;inetdbxpress.bpi;soaprtl.bpi;Rave75VCL.bpi;teeUI.bpi;tee.bpi;teedb.bpi;IndyCore.bpi;IndySystem.bpi;IndyProtocols.bpi;IntrawebDB_90_100.bpi;Intraweb_90_100.bpi;Jcl.bpi;JclVcl.bpi;JvCoreD11R.bpi;JvSystemD11R.bpi;JvStdCtrlsD11R.bpi;JvAppFrmD11R.bpi;JvBandsD11R.bpi;JvDBD11R.bpi;JvDlgsD11R.bpi;JvBDED11R.bpi;JvCmpD11R.bpi;JvCryptD11R.bpi;JvCtrlsD11R.bpi;JvCustomD11R.bpi;JvDockingD11R.bpi;JvDotNetCtrlsD11R.bpi;JvEDID11R.bpi;JvGlobusD11R.bpi;JvHMID11R.bpi;JvInterpreterD11R.bpi;JvJansD11R.bpi;JvManagedThreadsD11R.bpi;JvMMD11R.bpi;JvNetD11R.bpi;JvPageCompsD11R.bpi;JvPluginD11R.bpi;JvPrintPreviewD11R.bpi;JvRuntimeDesignD11R.bpi;JvTimeFrameworkD11R.bpi;JvValidatorsD11R.bpi;JvWizardD11R.bpi;JvXPCtrlsD11R.bpi;VclSmp.bpi</PackageImports>
- <BCC_wpar>false</BCC_wpar>
- <IncludePath>$(BDS)\include;$(BDS)\include\dinkumware;$(BDS)\include\vcl;..\include;..\test;..</IncludePath>
- <ILINK_LibraryPath>$(BDS)\lib;$(BDS)\lib\obj;$(BDS)\lib\psdk;..\test</ILINK_LibraryPath>
- <Multithreaded>true</Multithreaded>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Cfg_1)'!=''">
- <BCC_OptimizeForSpeed>false</BCC_OptimizeForSpeed>
- <DCC_Optimize>false</DCC_Optimize>
- <DCC_DebugInfoInExe>true</DCC_DebugInfoInExe>
- <Defines>_DEBUG;$(Defines)</Defines>
- <ILINK_FullDebugInfo>true</ILINK_FullDebugInfo>
- <BCC_InlineFunctionExpansion>false</BCC_InlineFunctionExpansion>
- <ILINK_DisableIncrementalLinking>true</ILINK_DisableIncrementalLinking>
- <BCC_UseRegisterVariables>None</BCC_UseRegisterVariables>
- <DCC_Define>DEBUG</DCC_Define>
- <BCC_DebugLineNumbers>true</BCC_DebugLineNumbers>
- <IntermediateOutputDir>Debug</IntermediateOutputDir>
- <TASM_DisplaySourceLines>true</TASM_DisplaySourceLines>
- <BCC_StackFrames>true</BCC_StackFrames>
- <BCC_DisableOptimizations>true</BCC_DisableOptimizations>
- <ILINK_LibraryPath>$(BDS)\lib\debug;$(ILINK_LibraryPath)</ILINK_LibraryPath>
- <TASM_Debugging>Full</TASM_Debugging>
- <BCC_SourceDebuggingOn>true</BCC_SourceDebuggingOn>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Cfg_2)'!=''">
- <Defines>NDEBUG;$(Defines)</Defines>
- <IntermediateOutputDir>Release</IntermediateOutputDir>
- <ILINK_LibraryPath>$(BDS)\lib\release;$(ILINK_LibraryPath)</ILINK_LibraryPath>
- <TASM_Debugging>None</TASM_Debugging>
- </PropertyGroup>
- <ProjectExtensions>
- <Borland.Personality>CPlusPlusBuilder.Personality</Borland.Personality>
- <Borland.ProjectType>CppConsoleApplication</Borland.ProjectType>
- <BorlandProject>
-<BorlandProject><CPlusPlusBuilder.Personality><VersionInfo><VersionInfo Name="IncludeVerInfo">False</VersionInfo><VersionInfo Name="AutoIncBuild">False</VersionInfo><VersionInfo Name="MajorVer">1</VersionInfo><VersionInfo Name="MinorVer">0</VersionInfo><VersionInfo Name="Release">0</VersionInfo><VersionInfo Name="Build">0</VersionInfo><VersionInfo Name="Debug">False</VersionInfo><VersionInfo Name="PreRelease">False</VersionInfo><VersionInfo Name="Special">False</VersionInfo><VersionInfo Name="Private">False</VersionInfo><VersionInfo Name="DLL">False</VersionInfo><VersionInfo Name="Locale">1033</VersionInfo><VersionInfo Name="CodePage">1252</VersionInfo></VersionInfo><VersionInfoKeys><VersionInfoKeys Name="CompanyName"></VersionInfoKeys><VersionInfoKeys Name="FileDescription"></VersionInfoKeys><VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys><VersionInfoKeys Name="InternalName"></VersionInfoKeys><VersionInfoKeys Name="LegalCopyright"></VersionInfoKeys><VersionInfoKeys Name="LegalTrademarks"></VersionInfoKeys><VersionInfoKeys Name="OriginalFilename"></VersionInfoKeys><VersionInfoKeys Name="ProductName"></VersionInfoKeys><VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys><VersionInfoKeys Name="Comments"></VersionInfoKeys></VersionInfoKeys><Debugging><Debugging Name="DebugSourceDirs"></Debugging></Debugging><Parameters><Parameters Name="RunParams"></Parameters><Parameters Name="Launcher"></Parameters><Parameters Name="UseLauncher">False</Parameters><Parameters Name="DebugCWD"></Parameters><Parameters Name="HostApplication"></Parameters><Parameters Name="RemoteHost"></Parameters><Parameters Name="RemotePath"></Parameters><Parameters Name="RemoteParams"></Parameters><Parameters Name="RemoteLauncher"></Parameters><Parameters Name="UseRemoteLauncher">False</Parameters><Parameters Name="RemoteCWD"></Parameters><Parameters Name="RemoteDebug">False</Parameters><Parameters Name="Debug Symbols Search Path"></Parameters><Parameters Name="LoadAllSymbols">True</Parameters><Parameters Name="LoadUnspecifiedSymbols">False</Parameters></Parameters><Excluded_Packages>
-
-
- <Excluded_Packages Name="$(BDS)\bin\bcboffice2k100.bpl">CodeGear C++Builder Office 2000 Servers Package</Excluded_Packages>
- <Excluded_Packages Name="$(BDS)\bin\bcbofficexp100.bpl">CodeGear C++Builder Office XP Servers Package</Excluded_Packages>
- </Excluded_Packages><Linker><Linker Name="LibPrefix"></Linker><Linker Name="LibSuffix"></Linker><Linker Name="LibVersion"></Linker></Linker><ProjectProperties><ProjectProperties Name="AutoShowDeps">False</ProjectProperties><ProjectProperties Name="ManagePaths">True</ProjectProperties><ProjectProperties Name="VerifyPackages">True</ProjectProperties></ProjectProperties><HistoryLists_hlIncludePath><HistoryLists_hlIncludePath Name="Count">3</HistoryLists_hlIncludePath><HistoryLists_hlIncludePath Name="Item0">$(BDS)\include;$(BDS)\include\dinkumware;$(BDS)\include\vcl;..\include;..\test;..</HistoryLists_hlIncludePath><HistoryLists_hlIncludePath Name="Item1">$(BDS)\include;$(BDS)\include\dinkumware;$(BDS)\include\vcl;..\include;..\test</HistoryLists_hlIncludePath><HistoryLists_hlIncludePath Name="Item2">$(BDS)\include;$(BDS)\include\dinkumware;$(BDS)\include\vcl;..\include</HistoryLists_hlIncludePath></HistoryLists_hlIncludePath><HistoryLists_hlILINK_LibraryPath><HistoryLists_hlILINK_LibraryPath Name="Count">1</HistoryLists_hlILINK_LibraryPath><HistoryLists_hlILINK_LibraryPath Name="Item0">$(BDS)\lib;$(BDS)\lib\obj;$(BDS)\lib\psdk;..\test</HistoryLists_hlILINK_LibraryPath><HistoryLists_hlILINK_LibraryPath Name="Item1">$(BDS)\lib;$(BDS)\lib\obj;$(BDS)\lib\psdk;..\test</HistoryLists_hlILINK_LibraryPath><HistoryLists_hlILINK_LibraryPath Name="Item2">$(BDS)\lib;$(BDS)\lib\obj;$(BDS)\lib\psdk;$(OUTPUTDIR);..\test</HistoryLists_hlILINK_LibraryPath></HistoryLists_hlILINK_LibraryPath><HistoryLists_hlDefines><HistoryLists_hlDefines Name="Count">2</HistoryLists_hlDefines><HistoryLists_hlDefines Name="Item0">NO_STRICT</HistoryLists_hlDefines><HistoryLists_hlDefines Name="Item1">STRICT</HistoryLists_hlDefines></HistoryLists_hlDefines></CPlusPlusBuilder.Personality></BorlandProject></BorlandProject>
- </ProjectExtensions>
- <Import Project="$(MSBuildBinPath)\Borland.Cpp.Targets" />
- <ItemGroup>
- <CppCompile Include="..\test\gtest_unittest.cc">
- <BuildOrder>0</BuildOrder>
- </CppCompile>
- <CppCompile Include="gtest_link.cc">
- <BuildOrder>1</BuildOrder>
- </CppCompile>
- <BuildConfiguration Include="Debug">
- <Key>Cfg_1</Key>
- </BuildConfiguration>
- <BuildConfiguration Include="Release">
- <Key>Cfg_2</Key>
- </BuildConfiguration>
- </ItemGroup>
-</Project> \ No newline at end of file
diff --git a/src/testing/gtest/configure.ac b/src/testing/gtest/configure.ac
deleted file mode 100644
index 37b298e1..00000000
--- a/src/testing/gtest/configure.ac
+++ /dev/null
@@ -1,68 +0,0 @@
-m4_include(m4/acx_pthread.m4)
-
-# At this point, the Xcode project assumes the version string will be three
-# integers separated by periods and surrounded by square brackets (e.g.
-# "[1.0.1]"). It also asumes that there won't be any closing parenthesis
-# between "AC_INIT(" and the closing ")" including comments and strings.
-AC_INIT([Google C++ Testing Framework],
- [1.6.0],
- [googletestframework@googlegroups.com],
- [gtest])
-
-# Provide various options to initialize the Autoconf and configure processes.
-AC_PREREQ([2.59])
-AC_CONFIG_SRCDIR([./LICENSE])
-AC_CONFIG_MACRO_DIR([m4])
-AC_CONFIG_AUX_DIR([build-aux])
-AC_CONFIG_HEADERS([build-aux/config.h])
-AC_CONFIG_FILES([Makefile])
-AC_CONFIG_FILES([scripts/gtest-config], [chmod +x scripts/gtest-config])
-
-# Initialize Automake with various options. We require at least v1.9, prevent
-# pedantic complaints about package files, and enable various distribution
-# targets.
-AM_INIT_AUTOMAKE([1.9 dist-bzip2 dist-zip foreign subdir-objects])
-
-# Check for programs used in building Google Test.
-AC_PROG_CC
-AC_PROG_CXX
-AC_LANG([C++])
-AC_PROG_LIBTOOL
-
-# TODO(chandlerc@google.com): Currently we aren't running the Python tests
-# against the interpreter detected by AM_PATH_PYTHON, and so we condition
-# HAVE_PYTHON by requiring "python" to be in the PATH, and that interpreter's
-# version to be >= 2.3. This will allow the scripts to use a "/usr/bin/env"
-# hashbang.
-PYTHON= # We *do not* allow the user to specify a python interpreter
-AC_PATH_PROG([PYTHON],[python],[:])
-AS_IF([test "$PYTHON" != ":"],
- [AM_PYTHON_CHECK_VERSION([$PYTHON],[2.3],[:],[PYTHON=":"])])
-AM_CONDITIONAL([HAVE_PYTHON],[test "$PYTHON" != ":"])
-
-# Configure pthreads.
-AC_ARG_WITH([pthreads],
- [AS_HELP_STRING([--with-pthreads],
- [use pthreads (default is yes)])],
- [with_pthreads=$withval],
- [with_pthreads=check])
-
-have_pthreads=no
-AS_IF([test "x$with_pthreads" != "xno"],
- [ACX_PTHREAD(
- [],
- [AS_IF([test "x$with_pthreads" != "xcheck"],
- [AC_MSG_FAILURE(
- [--with-pthreads was specified, but unable to be used])])])
- have_pthreads="$acx_pthread_ok"])
-AM_CONDITIONAL([HAVE_PTHREADS],[test "x$have_pthreads" == "xyes"])
-AC_SUBST(PTHREAD_CFLAGS)
-AC_SUBST(PTHREAD_LIBS)
-
-# TODO(chandlerc@google.com) Check for the necessary system headers.
-
-# TODO(chandlerc@google.com) Check the types, structures, and other compiler
-# and architecture characteristics.
-
-# Output the generated files. No further autoconf macros may be used.
-AC_OUTPUT
diff --git a/src/testing/gtest/include/gtest/gtest-death-test.h b/src/testing/gtest/include/gtest/gtest-death-test.h
deleted file mode 100644
index 957a69c6..00000000
--- a/src/testing/gtest/include/gtest/gtest-death-test.h
+++ /dev/null
@@ -1,294 +0,0 @@
-// Copyright 2005, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-//
-// The Google C++ Testing Framework (Google Test)
-//
-// This header file defines the public API for death tests. It is
-// #included by gtest.h so a user doesn't need to include this
-// directly.
-
-#ifndef GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
-#define GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
-
-#include "gtest/internal/gtest-death-test-internal.h"
-
-namespace testing {
-
-// This flag controls the style of death tests. Valid values are "threadsafe",
-// meaning that the death test child process will re-execute the test binary
-// from the start, running only a single death test, or "fast",
-// meaning that the child process will execute the test logic immediately
-// after forking.
-GTEST_DECLARE_string_(death_test_style);
-
-#if GTEST_HAS_DEATH_TEST
-
-namespace internal {
-
-// Returns a Boolean value indicating whether the caller is currently
-// executing in the context of the death test child process. Tools such as
-// Valgrind heap checkers may need this to modify their behavior in death
-// tests. IMPORTANT: This is an internal utility. Using it may break the
-// implementation of death tests. User code MUST NOT use it.
-GTEST_API_ bool InDeathTestChild();
-
-} // namespace internal
-
-// The following macros are useful for writing death tests.
-
-// Here's what happens when an ASSERT_DEATH* or EXPECT_DEATH* is
-// executed:
-//
-// 1. It generates a warning if there is more than one active
-// thread. This is because it's safe to fork() or clone() only
-// when there is a single thread.
-//
-// 2. The parent process clone()s a sub-process and runs the death
-// test in it; the sub-process exits with code 0 at the end of the
-// death test, if it hasn't exited already.
-//
-// 3. The parent process waits for the sub-process to terminate.
-//
-// 4. The parent process checks the exit code and error message of
-// the sub-process.
-//
-// Examples:
-//
-// ASSERT_DEATH(server.SendMessage(56, "Hello"), "Invalid port number");
-// for (int i = 0; i < 5; i++) {
-// EXPECT_DEATH(server.ProcessRequest(i),
-// "Invalid request .* in ProcessRequest()")
-// << "Failed to die on request " << i;
-// }
-//
-// ASSERT_EXIT(server.ExitNow(), ::testing::ExitedWithCode(0), "Exiting");
-//
-// bool KilledBySIGHUP(int exit_code) {
-// return WIFSIGNALED(exit_code) && WTERMSIG(exit_code) == SIGHUP;
-// }
-//
-// ASSERT_EXIT(client.HangUpServer(), KilledBySIGHUP, "Hanging up!");
-//
-// On the regular expressions used in death tests:
-//
-// On POSIX-compliant systems (*nix), we use the <regex.h> library,
-// which uses the POSIX extended regex syntax.
-//
-// On other platforms (e.g. Windows), we only support a simple regex
-// syntax implemented as part of Google Test. This limited
-// implementation should be enough most of the time when writing
-// death tests; though it lacks many features you can find in PCRE
-// or POSIX extended regex syntax. For example, we don't support
-// union ("x|y"), grouping ("(xy)"), brackets ("[xy]"), and
-// repetition count ("x{5,7}"), among others.
-//
-// Below is the syntax that we do support. We chose it to be a
-// subset of both PCRE and POSIX extended regex, so it's easy to
-// learn wherever you come from. In the following: 'A' denotes a
-// literal character, period (.), or a single \\ escape sequence;
-// 'x' and 'y' denote regular expressions; 'm' and 'n' are for
-// natural numbers.
-//
-// c matches any literal character c
-// \\d matches any decimal digit
-// \\D matches any character that's not a decimal digit
-// \\f matches \f
-// \\n matches \n
-// \\r matches \r
-// \\s matches any ASCII whitespace, including \n
-// \\S matches any character that's not a whitespace
-// \\t matches \t
-// \\v matches \v
-// \\w matches any letter, _, or decimal digit
-// \\W matches any character that \\w doesn't match
-// \\c matches any literal character c, which must be a punctuation
-// . matches any single character except \n
-// A? matches 0 or 1 occurrences of A
-// A* matches 0 or many occurrences of A
-// A+ matches 1 or many occurrences of A
-// ^ matches the beginning of a string (not that of each line)
-// $ matches the end of a string (not that of each line)
-// xy matches x followed by y
-//
-// If you accidentally use PCRE or POSIX extended regex features
-// not implemented by us, you will get a run-time failure. In that
-// case, please try to rewrite your regular expression within the
-// above syntax.
-//
-// This implementation is *not* meant to be as highly tuned or robust
-// as a compiled regex library, but should perform well enough for a
-// death test, which already incurs significant overhead by launching
-// a child process.
-//
-// Known caveats:
-//
-// A "threadsafe" style death test obtains the path to the test
-// program from argv[0] and re-executes it in the sub-process. For
-// simplicity, the current implementation doesn't search the PATH
-// when launching the sub-process. This means that the user must
-// invoke the test program via a path that contains at least one
-// path separator (e.g. path/to/foo_test and
-// /absolute/path/to/bar_test are fine, but foo_test is not). This
-// is rarely a problem as people usually don't put the test binary
-// directory in PATH.
-//
-// TODO(wan@google.com): make thread-safe death tests search the PATH.
-
-// Asserts that a given statement causes the program to exit, with an
-// integer exit status that satisfies predicate, and emitting error output
-// that matches regex.
-# define ASSERT_EXIT(statement, predicate, regex) \
- GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_)
-
-// Like ASSERT_EXIT, but continues on to successive tests in the
-// test case, if any:
-# define EXPECT_EXIT(statement, predicate, regex) \
- GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_)
-
-// Asserts that a given statement causes the program to exit, either by
-// explicitly exiting with a nonzero exit code or being killed by a
-// signal, and emitting error output that matches regex.
-# define ASSERT_DEATH(statement, regex) \
- ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
-
-// Like ASSERT_DEATH, but continues on to successive tests in the
-// test case, if any:
-# define EXPECT_DEATH(statement, regex) \
- EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
-
-// Two predicate classes that can be used in {ASSERT,EXPECT}_EXIT*:
-
-// Tests that an exit code describes a normal exit with a given exit code.
-class GTEST_API_ ExitedWithCode {
- public:
- explicit ExitedWithCode(int exit_code);
- bool operator()(int exit_status) const;
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ExitedWithCode& other);
-
- const int exit_code_;
-};
-
-# if !GTEST_OS_WINDOWS
-// Tests that an exit code describes an exit due to termination by a
-// given signal.
-class GTEST_API_ KilledBySignal {
- public:
- explicit KilledBySignal(int signum);
- bool operator()(int exit_status) const;
- private:
- const int signum_;
-};
-# endif // !GTEST_OS_WINDOWS
-
-// EXPECT_DEBUG_DEATH asserts that the given statements die in debug mode.
-// The death testing framework causes this to have interesting semantics,
-// since the sideeffects of the call are only visible in opt mode, and not
-// in debug mode.
-//
-// In practice, this can be used to test functions that utilize the
-// LOG(DFATAL) macro using the following style:
-//
-// int DieInDebugOr12(int* sideeffect) {
-// if (sideeffect) {
-// *sideeffect = 12;
-// }
-// LOG(DFATAL) << "death";
-// return 12;
-// }
-//
-// TEST(TestCase, TestDieOr12WorksInDgbAndOpt) {
-// int sideeffect = 0;
-// // Only asserts in dbg.
-// EXPECT_DEBUG_DEATH(DieInDebugOr12(&sideeffect), "death");
-//
-// #ifdef NDEBUG
-// // opt-mode has sideeffect visible.
-// EXPECT_EQ(12, sideeffect);
-// #else
-// // dbg-mode no visible sideeffect.
-// EXPECT_EQ(0, sideeffect);
-// #endif
-// }
-//
-// This will assert that DieInDebugReturn12InOpt() crashes in debug
-// mode, usually due to a DCHECK or LOG(DFATAL), but returns the
-// appropriate fallback value (12 in this case) in opt mode. If you
-// need to test that a function has appropriate side-effects in opt
-// mode, include assertions against the side-effects. A general
-// pattern for this is:
-//
-// EXPECT_DEBUG_DEATH({
-// // Side-effects here will have an effect after this statement in
-// // opt mode, but none in debug mode.
-// EXPECT_EQ(12, DieInDebugOr12(&sideeffect));
-// }, "death");
-//
-# ifdef NDEBUG
-
-# define EXPECT_DEBUG_DEATH(statement, regex) \
- GTEST_EXECUTE_STATEMENT_(statement, regex)
-
-# define ASSERT_DEBUG_DEATH(statement, regex) \
- GTEST_EXECUTE_STATEMENT_(statement, regex)
-
-# else
-
-# define EXPECT_DEBUG_DEATH(statement, regex) \
- EXPECT_DEATH(statement, regex)
-
-# define ASSERT_DEBUG_DEATH(statement, regex) \
- ASSERT_DEATH(statement, regex)
-
-# endif // NDEBUG for EXPECT_DEBUG_DEATH
-#endif // GTEST_HAS_DEATH_TEST
-
-// EXPECT_DEATH_IF_SUPPORTED(statement, regex) and
-// ASSERT_DEATH_IF_SUPPORTED(statement, regex) expand to real death tests if
-// death tests are supported; otherwise they just issue a warning. This is
-// useful when you are combining death test assertions with normal test
-// assertions in one test.
-#if GTEST_HAS_DEATH_TEST
-# define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \
- EXPECT_DEATH(statement, regex)
-# define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \
- ASSERT_DEATH(statement, regex)
-#else
-# define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \
- GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, )
-# define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \
- GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, return)
-#endif
-
-} // namespace testing
-
-#endif // GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
diff --git a/src/testing/gtest/include/gtest/gtest-message.h b/src/testing/gtest/include/gtest/gtest-message.h
deleted file mode 100644
index 9b7142f3..00000000
--- a/src/testing/gtest/include/gtest/gtest-message.h
+++ /dev/null
@@ -1,230 +0,0 @@
-// Copyright 2005, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-//
-// The Google C++ Testing Framework (Google Test)
-//
-// This header file defines the Message class.
-//
-// IMPORTANT NOTE: Due to limitation of the C++ language, we have to
-// leave some internal implementation details in this header file.
-// They are clearly marked by comments like this:
-//
-// // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
-//
-// Such code is NOT meant to be used by a user directly, and is subject
-// to CHANGE WITHOUT NOTICE. Therefore DO NOT DEPEND ON IT in a user
-// program!
-
-#ifndef GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
-#define GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
-
-#include <limits>
-
-#include "gtest/internal/gtest-string.h"
-#include "gtest/internal/gtest-internal.h"
-
-namespace testing {
-
-// The Message class works like an ostream repeater.
-//
-// Typical usage:
-//
-// 1. You stream a bunch of values to a Message object.
-// It will remember the text in a stringstream.
-// 2. Then you stream the Message object to an ostream.
-// This causes the text in the Message to be streamed
-// to the ostream.
-//
-// For example;
-//
-// testing::Message foo;
-// foo << 1 << " != " << 2;
-// std::cout << foo;
-//
-// will print "1 != 2".
-//
-// Message is not intended to be inherited from. In particular, its
-// destructor is not virtual.
-//
-// Note that stringstream behaves differently in gcc and in MSVC. You
-// can stream a NULL char pointer to it in the former, but not in the
-// latter (it causes an access violation if you do). The Message
-// class hides this difference by treating a NULL char pointer as
-// "(null)".
-class GTEST_API_ Message {
- private:
- // The type of basic IO manipulators (endl, ends, and flush) for
- // narrow streams.
- typedef std::ostream& (*BasicNarrowIoManip)(std::ostream&);
-
- public:
- // Constructs an empty Message.
- // We allocate the stringstream separately because otherwise each use of
- // ASSERT/EXPECT in a procedure adds over 200 bytes to the procedure's
- // stack frame leading to huge stack frames in some cases; gcc does not reuse
- // the stack space.
- Message() : ss_(new ::std::stringstream) {
- // By default, we want there to be enough precision when printing
- // a double to a Message.
- *ss_ << std::setprecision(std::numeric_limits<double>::digits10 + 2);
- }
-
- // Copy constructor.
- Message(const Message& msg) : ss_(new ::std::stringstream) { // NOLINT
- *ss_ << msg.GetString();
- }
-
- // Constructs a Message from a C-string.
- explicit Message(const char* str) : ss_(new ::std::stringstream) {
- *ss_ << str;
- }
-
-#if GTEST_OS_SYMBIAN
- // Streams a value (either a pointer or not) to this object.
- template <typename T>
- inline Message& operator <<(const T& value) {
- StreamHelper(typename internal::is_pointer<T>::type(), value);
- return *this;
- }
-#else
- // Streams a non-pointer value to this object.
- template <typename T>
- inline Message& operator <<(const T& val) {
- ::GTestStreamToHelper(ss_.get(), val);
- return *this;
- }
-
- // Streams a pointer value to this object.
- //
- // This function is an overload of the previous one. When you
- // stream a pointer to a Message, this definition will be used as it
- // is more specialized. (The C++ Standard, section
- // [temp.func.order].) If you stream a non-pointer, then the
- // previous definition will be used.
- //
- // The reason for this overload is that streaming a NULL pointer to
- // ostream is undefined behavior. Depending on the compiler, you
- // may get "0", "(nil)", "(null)", or an access violation. To
- // ensure consistent result across compilers, we always treat NULL
- // as "(null)".
- template <typename T>
- inline Message& operator <<(T* const& pointer) { // NOLINT
- if (pointer == NULL) {
- *ss_ << "(null)";
- } else {
- ::GTestStreamToHelper(ss_.get(), pointer);
- }
- return *this;
- }
-#endif // GTEST_OS_SYMBIAN
-
- // Since the basic IO manipulators are overloaded for both narrow
- // and wide streams, we have to provide this specialized definition
- // of operator <<, even though its body is the same as the
- // templatized version above. Without this definition, streaming
- // endl or other basic IO manipulators to Message will confuse the
- // compiler.
- Message& operator <<(BasicNarrowIoManip val) {
- *ss_ << val;
- return *this;
- }
-
- // Instead of 1/0, we want to see true/false for bool values.
- Message& operator <<(bool b) {
- return *this << (b ? "true" : "false");
- }
-
- // These two overloads allow streaming a wide C string to a Message
- // using the UTF-8 encoding.
- Message& operator <<(const wchar_t* wide_c_str) {
- return *this << internal::String::ShowWideCString(wide_c_str);
- }
- Message& operator <<(wchar_t* wide_c_str) {
- return *this << internal::String::ShowWideCString(wide_c_str);
- }
-
-#if GTEST_HAS_STD_WSTRING
- // Converts the given wide string to a narrow string using the UTF-8
- // encoding, and streams the result to this Message object.
- Message& operator <<(const ::std::wstring& wstr);
-#endif // GTEST_HAS_STD_WSTRING
-
-#if GTEST_HAS_GLOBAL_WSTRING
- // Converts the given wide string to a narrow string using the UTF-8
- // encoding, and streams the result to this Message object.
- Message& operator <<(const ::wstring& wstr);
-#endif // GTEST_HAS_GLOBAL_WSTRING
-
- // Gets the text streamed to this object so far as a String.
- // Each '\0' character in the buffer is replaced with "\\0".
- //
- // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
- internal::String GetString() const {
- return internal::StringStreamToString(ss_.get());
- }
-
- private:
-
-#if GTEST_OS_SYMBIAN
- // These are needed as the Nokia Symbian Compiler cannot decide between
- // const T& and const T* in a function template. The Nokia compiler _can_
- // decide between class template specializations for T and T*, so a
- // tr1::type_traits-like is_pointer works, and we can overload on that.
- template <typename T>
- inline void StreamHelper(internal::true_type /*dummy*/, T* pointer) {
- if (pointer == NULL) {
- *ss_ << "(null)";
- } else {
- ::GTestStreamToHelper(ss_.get(), pointer);
- }
- }
- template <typename T>
- inline void StreamHelper(internal::false_type /*dummy*/, const T& value) {
- ::GTestStreamToHelper(ss_.get(), value);
- }
-#endif // GTEST_OS_SYMBIAN
-
- // We'll hold the text streamed to this object here.
- const internal::scoped_ptr< ::std::stringstream> ss_;
-
- // We declare (but don't implement) this to prevent the compiler
- // from implementing the assignment operator.
- void operator=(const Message&);
-};
-
-// Streams a Message to an ostream.
-inline std::ostream& operator <<(std::ostream& os, const Message& sb) {
- return os << sb.GetString();
-}
-
-} // namespace testing
-
-#endif // GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
diff --git a/src/testing/gtest/include/gtest/gtest-param-test.h b/src/testing/gtest/include/gtest/gtest-param-test.h
deleted file mode 100644
index d6702c8f..00000000
--- a/src/testing/gtest/include/gtest/gtest-param-test.h
+++ /dev/null
@@ -1,1421 +0,0 @@
-// This file was GENERATED by command:
-// pump.py gtest-param-test.h.pump
-// DO NOT EDIT BY HAND!!!
-
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Authors: vladl@google.com (Vlad Losev)
-//
-// Macros and functions for implementing parameterized tests
-// in Google C++ Testing Framework (Google Test)
-//
-// This file is generated by a SCRIPT. DO NOT EDIT BY HAND!
-//
-#ifndef GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
-#define GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
-
-
-// Value-parameterized tests allow you to test your code with different
-// parameters without writing multiple copies of the same test.
-//
-// Here is how you use value-parameterized tests:
-
-#if 0
-
-// To write value-parameterized tests, first you should define a fixture
-// class. It is usually derived from testing::TestWithParam<T> (see below for
-// another inheritance scheme that's sometimes useful in more complicated
-// class hierarchies), where the type of your parameter values.
-// TestWithParam<T> is itself derived from testing::Test. T can be any
-// copyable type. If it's a raw pointer, you are responsible for managing the
-// lifespan of the pointed values.
-
-class FooTest : public ::testing::TestWithParam<const char*> {
- // You can implement all the usual class fixture members here.
-};
-
-// Then, use the TEST_P macro to define as many parameterized tests
-// for this fixture as you want. The _P suffix is for "parameterized"
-// or "pattern", whichever you prefer to think.
-
-TEST_P(FooTest, DoesBlah) {
- // Inside a test, access the test parameter with the GetParam() method
- // of the TestWithParam<T> class:
- EXPECT_TRUE(foo.Blah(GetParam()));
- ...
-}
-
-TEST_P(FooTest, HasBlahBlah) {
- ...
-}
-
-// Finally, you can use INSTANTIATE_TEST_CASE_P to instantiate the test
-// case with any set of parameters you want. Google Test defines a number
-// of functions for generating test parameters. They return what we call
-// (surprise!) parameter generators. Here is a summary of them, which
-// are all in the testing namespace:
-//
-//
-// Range(begin, end [, step]) - Yields values {begin, begin+step,
-// begin+step+step, ...}. The values do not
-// include end. step defaults to 1.
-// Values(v1, v2, ..., vN) - Yields values {v1, v2, ..., vN}.
-// ValuesIn(container) - Yields values from a C-style array, an STL
-// ValuesIn(begin,end) container, or an iterator range [begin, end).
-// Bool() - Yields sequence {false, true}.
-// Combine(g1, g2, ..., gN) - Yields all combinations (the Cartesian product
-// for the math savvy) of the values generated
-// by the N generators.
-//
-// For more details, see comments at the definitions of these functions below
-// in this file.
-//
-// The following statement will instantiate tests from the FooTest test case
-// each with parameter values "meeny", "miny", and "moe".
-
-INSTANTIATE_TEST_CASE_P(InstantiationName,
- FooTest,
- Values("meeny", "miny", "moe"));
-
-// To distinguish different instances of the pattern, (yes, you
-// can instantiate it more then once) the first argument to the
-// INSTANTIATE_TEST_CASE_P macro is a prefix that will be added to the
-// actual test case name. Remember to pick unique prefixes for different
-// instantiations. The tests from the instantiation above will have
-// these names:
-//
-// * InstantiationName/FooTest.DoesBlah/0 for "meeny"
-// * InstantiationName/FooTest.DoesBlah/1 for "miny"
-// * InstantiationName/FooTest.DoesBlah/2 for "moe"
-// * InstantiationName/FooTest.HasBlahBlah/0 for "meeny"
-// * InstantiationName/FooTest.HasBlahBlah/1 for "miny"
-// * InstantiationName/FooTest.HasBlahBlah/2 for "moe"
-//
-// You can use these names in --gtest_filter.
-//
-// This statement will instantiate all tests from FooTest again, each
-// with parameter values "cat" and "dog":
-
-const char* pets[] = {"cat", "dog"};
-INSTANTIATE_TEST_CASE_P(AnotherInstantiationName, FooTest, ValuesIn(pets));
-
-// The tests from the instantiation above will have these names:
-//
-// * AnotherInstantiationName/FooTest.DoesBlah/0 for "cat"
-// * AnotherInstantiationName/FooTest.DoesBlah/1 for "dog"
-// * AnotherInstantiationName/FooTest.HasBlahBlah/0 for "cat"
-// * AnotherInstantiationName/FooTest.HasBlahBlah/1 for "dog"
-//
-// Please note that INSTANTIATE_TEST_CASE_P will instantiate all tests
-// in the given test case, whether their definitions come before or
-// AFTER the INSTANTIATE_TEST_CASE_P statement.
-//
-// Please also note that generator expressions (including parameters to the
-// generators) are evaluated in InitGoogleTest(), after main() has started.
-// This allows the user on one hand, to adjust generator parameters in order
-// to dynamically determine a set of tests to run and on the other hand,
-// give the user a chance to inspect the generated tests with Google Test
-// reflection API before RUN_ALL_TESTS() is executed.
-//
-// You can see samples/sample7_unittest.cc and samples/sample8_unittest.cc
-// for more examples.
-//
-// In the future, we plan to publish the API for defining new parameter
-// generators. But for now this interface remains part of the internal
-// implementation and is subject to change.
-//
-//
-// A parameterized test fixture must be derived from testing::Test and from
-// testing::WithParamInterface<T>, where T is the type of the parameter
-// values. Inheriting from TestWithParam<T> satisfies that requirement because
-// TestWithParam<T> inherits from both Test and WithParamInterface. In more
-// complicated hierarchies, however, it is occasionally useful to inherit
-// separately from Test and WithParamInterface. For example:
-
-class BaseTest : public ::testing::Test {
- // You can inherit all the usual members for a non-parameterized test
- // fixture here.
-};
-
-class DerivedTest : public BaseTest, public ::testing::WithParamInterface<int> {
- // The usual test fixture members go here too.
-};
-
-TEST_F(BaseTest, HasFoo) {
- // This is an ordinary non-parameterized test.
-}
-
-TEST_P(DerivedTest, DoesBlah) {
- // GetParam works just the same here as if you inherit from TestWithParam.
- EXPECT_TRUE(foo.Blah(GetParam()));
-}
-
-#endif // 0
-
-#include "gtest/internal/gtest-port.h"
-
-#if !GTEST_OS_SYMBIAN
-# include <utility>
-#endif
-
-// scripts/fuse_gtest.py depends on gtest's own header being #included
-// *unconditionally*. Therefore these #includes cannot be moved
-// inside #if GTEST_HAS_PARAM_TEST.
-#include "gtest/internal/gtest-internal.h"
-#include "gtest/internal/gtest-param-util.h"
-#include "gtest/internal/gtest-param-util-generated.h"
-
-#if GTEST_HAS_PARAM_TEST
-
-namespace testing {
-
-// Functions producing parameter generators.
-//
-// Google Test uses these generators to produce parameters for value-
-// parameterized tests. When a parameterized test case is instantiated
-// with a particular generator, Google Test creates and runs tests
-// for each element in the sequence produced by the generator.
-//
-// In the following sample, tests from test case FooTest are instantiated
-// each three times with parameter values 3, 5, and 8:
-//
-// class FooTest : public TestWithParam<int> { ... };
-//
-// TEST_P(FooTest, TestThis) {
-// }
-// TEST_P(FooTest, TestThat) {
-// }
-// INSTANTIATE_TEST_CASE_P(TestSequence, FooTest, Values(3, 5, 8));
-//
-
-// Range() returns generators providing sequences of values in a range.
-//
-// Synopsis:
-// Range(start, end)
-// - returns a generator producing a sequence of values {start, start+1,
-// start+2, ..., }.
-// Range(start, end, step)
-// - returns a generator producing a sequence of values {start, start+step,
-// start+step+step, ..., }.
-// Notes:
-// * The generated sequences never include end. For example, Range(1, 5)
-// returns a generator producing a sequence {1, 2, 3, 4}. Range(1, 9, 2)
-// returns a generator producing {1, 3, 5, 7}.
-// * start and end must have the same type. That type may be any integral or
-// floating-point type or a user defined type satisfying these conditions:
-// * It must be assignable (have operator=() defined).
-// * It must have operator+() (operator+(int-compatible type) for
-// two-operand version).
-// * It must have operator<() defined.
-// Elements in the resulting sequences will also have that type.
-// * Condition start < end must be satisfied in order for resulting sequences
-// to contain any elements.
-//
-template <typename T, typename IncrementT>
-internal::ParamGenerator<T> Range(T start, T end, IncrementT step) {
- return internal::ParamGenerator<T>(
- new internal::RangeGenerator<T, IncrementT>(start, end, step));
-}
-
-template <typename T>
-internal::ParamGenerator<T> Range(T start, T end) {
- return Range(start, end, 1);
-}
-
-// ValuesIn() function allows generation of tests with parameters coming from
-// a container.
-//
-// Synopsis:
-// ValuesIn(const T (&array)[N])
-// - returns a generator producing sequences with elements from
-// a C-style array.
-// ValuesIn(const Container& container)
-// - returns a generator producing sequences with elements from
-// an STL-style container.
-// ValuesIn(Iterator begin, Iterator end)
-// - returns a generator producing sequences with elements from
-// a range [begin, end) defined by a pair of STL-style iterators. These
-// iterators can also be plain C pointers.
-//
-// Please note that ValuesIn copies the values from the containers
-// passed in and keeps them to generate tests in RUN_ALL_TESTS().
-//
-// Examples:
-//
-// This instantiates tests from test case StringTest
-// each with C-string values of "foo", "bar", and "baz":
-//
-// const char* strings[] = {"foo", "bar", "baz"};
-// INSTANTIATE_TEST_CASE_P(StringSequence, SrtingTest, ValuesIn(strings));
-//
-// This instantiates tests from test case StlStringTest
-// each with STL strings with values "a" and "b":
-//
-// ::std::vector< ::std::string> GetParameterStrings() {
-// ::std::vector< ::std::string> v;
-// v.push_back("a");
-// v.push_back("b");
-// return v;
-// }
-//
-// INSTANTIATE_TEST_CASE_P(CharSequence,
-// StlStringTest,
-// ValuesIn(GetParameterStrings()));
-//
-//
-// This will also instantiate tests from CharTest
-// each with parameter values 'a' and 'b':
-//
-// ::std::list<char> GetParameterChars() {
-// ::std::list<char> list;
-// list.push_back('a');
-// list.push_back('b');
-// return list;
-// }
-// ::std::list<char> l = GetParameterChars();
-// INSTANTIATE_TEST_CASE_P(CharSequence2,
-// CharTest,
-// ValuesIn(l.begin(), l.end()));
-//
-template <typename ForwardIterator>
-internal::ParamGenerator<
- typename ::testing::internal::IteratorTraits<ForwardIterator>::value_type>
-ValuesIn(ForwardIterator begin, ForwardIterator end) {
- typedef typename ::testing::internal::IteratorTraits<ForwardIterator>
- ::value_type ParamType;
- return internal::ParamGenerator<ParamType>(
- new internal::ValuesInIteratorRangeGenerator<ParamType>(begin, end));
-}
-
-template <typename T, size_t N>
-internal::ParamGenerator<T> ValuesIn(const T (&array)[N]) {
- return ValuesIn(array, array + N);
-}
-
-template <class Container>
-internal::ParamGenerator<typename Container::value_type> ValuesIn(
- const Container& container) {
- return ValuesIn(container.begin(), container.end());
-}
-
-// Values() allows generating tests from explicitly specified list of
-// parameters.
-//
-// Synopsis:
-// Values(T v1, T v2, ..., T vN)
-// - returns a generator producing sequences with elements v1, v2, ..., vN.
-//
-// For example, this instantiates tests from test case BarTest each
-// with values "one", "two", and "three":
-//
-// INSTANTIATE_TEST_CASE_P(NumSequence, BarTest, Values("one", "two", "three"));
-//
-// This instantiates tests from test case BazTest each with values 1, 2, 3.5.
-// The exact type of values will depend on the type of parameter in BazTest.
-//
-// INSTANTIATE_TEST_CASE_P(FloatingNumbers, BazTest, Values(1, 2, 3.5));
-//
-// Currently, Values() supports from 1 to 50 parameters.
-//
-template <typename T1>
-internal::ValueArray1<T1> Values(T1 v1) {
- return internal::ValueArray1<T1>(v1);
-}
-
-template <typename T1, typename T2>
-internal::ValueArray2<T1, T2> Values(T1 v1, T2 v2) {
- return internal::ValueArray2<T1, T2>(v1, v2);
-}
-
-template <typename T1, typename T2, typename T3>
-internal::ValueArray3<T1, T2, T3> Values(T1 v1, T2 v2, T3 v3) {
- return internal::ValueArray3<T1, T2, T3>(v1, v2, v3);
-}
-
-template <typename T1, typename T2, typename T3, typename T4>
-internal::ValueArray4<T1, T2, T3, T4> Values(T1 v1, T2 v2, T3 v3, T4 v4) {
- return internal::ValueArray4<T1, T2, T3, T4>(v1, v2, v3, v4);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5>
-internal::ValueArray5<T1, T2, T3, T4, T5> Values(T1 v1, T2 v2, T3 v3, T4 v4,
- T5 v5) {
- return internal::ValueArray5<T1, T2, T3, T4, T5>(v1, v2, v3, v4, v5);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6>
-internal::ValueArray6<T1, T2, T3, T4, T5, T6> Values(T1 v1, T2 v2, T3 v3,
- T4 v4, T5 v5, T6 v6) {
- return internal::ValueArray6<T1, T2, T3, T4, T5, T6>(v1, v2, v3, v4, v5, v6);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7>
-internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7> Values(T1 v1, T2 v2, T3 v3,
- T4 v4, T5 v5, T6 v6, T7 v7) {
- return internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7>(v1, v2, v3, v4, v5,
- v6, v7);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8>
-internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8> Values(T1 v1, T2 v2,
- T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8) {
- return internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8>(v1, v2, v3, v4,
- v5, v6, v7, v8);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9>
-internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9> Values(T1 v1, T2 v2,
- T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9) {
- return internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(v1, v2, v3,
- v4, v5, v6, v7, v8, v9);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10>
-internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> Values(T1 v1,
- T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10) {
- return internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(v1,
- v2, v3, v4, v5, v6, v7, v8, v9, v10);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11>
-internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10,
- T11> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11) {
- return internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10,
- T11>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12>
-internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12) {
- return internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13>
-internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13) {
- return internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14>
-internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) {
- return internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
- v14);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15>
-internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
- T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) {
- return internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
- v13, v14, v15);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16>
-internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
- T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
- T16 v16) {
- return internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
- v12, v13, v14, v15, v16);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17>
-internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
- T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
- T16 v16, T17 v17) {
- return internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16, T17>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
- v11, v12, v13, v14, v15, v16, v17);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18>
-internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
- T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
- T16 v16, T17 v17, T18 v18) {
- return internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16, T17, T18>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
- v10, v11, v12, v13, v14, v15, v16, v17, v18);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19>
-internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
- T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
- T15 v15, T16 v16, T17 v17, T18 v18, T19 v19) {
- return internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16, T17, T18, T19>(v1, v2, v3, v4, v5, v6, v7, v8,
- v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20>
-internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20> Values(T1 v1, T2 v2, T3 v3, T4 v4,
- T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
- T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20) {
- return internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16, T17, T18, T19, T20>(v1, v2, v3, v4, v5, v6, v7,
- v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21>
-internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21> Values(T1 v1, T2 v2, T3 v3, T4 v4,
- T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
- T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21) {
- return internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16, T17, T18, T19, T20, T21>(v1, v2, v3, v4, v5, v6,
- v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22>
-internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22> Values(T1 v1, T2 v2, T3 v3,
- T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
- T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
- T21 v21, T22 v22) {
- return internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22>(v1, v2, v3, v4,
- v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
- v20, v21, v22);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23>
-internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> Values(T1 v1, T2 v2,
- T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
- T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
- T21 v21, T22 v22, T23 v23) {
- return internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23>(v1, v2, v3,
- v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
- v20, v21, v22, v23);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24>
-internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> Values(T1 v1, T2 v2,
- T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
- T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
- T21 v21, T22 v22, T23 v23, T24 v24) {
- return internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24>(v1, v2,
- v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18,
- v19, v20, v21, v22, v23, v24);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25>
-internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Values(T1 v1,
- T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11,
- T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19,
- T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25) {
- return internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25>(v1,
- v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17,
- v18, v19, v20, v21, v22, v23, v24, v25);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26>
-internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
- T26> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
- T26 v26) {
- return internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
- T26>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15,
- v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27>
-internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
- T27> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
- T26 v26, T27 v27) {
- return internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
- T26, T27>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14,
- v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28>
-internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
- T28> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
- T26 v26, T27 v27, T28 v28) {
- return internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
- T26, T27, T28>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
- v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27,
- v28);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29>
-internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
- T26 v26, T27 v27, T28 v28, T29 v29) {
- return internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
- T26, T27, T28, T29>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
- v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26,
- v27, v28, v29);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30>
-internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
- T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,
- T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,
- T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) {
- return internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
- T26, T27, T28, T29, T30>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
- v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25,
- v26, v27, v28, v29, v30);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31>
-internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
- T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
- T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
- T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) {
- return internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
- T26, T27, T28, T29, T30, T31>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
- v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24,
- v25, v26, v27, v28, v29, v30, v31);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32>
-internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
- T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
- T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
- T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
- T32 v32) {
- return internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
- T26, T27, T28, T29, T30, T31, T32>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
- v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
- v24, v25, v26, v27, v28, v29, v30, v31, v32);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33>
-internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
- T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
- T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
- T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
- T32 v32, T33 v33) {
- return internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
- T26, T27, T28, T29, T30, T31, T32, T33>(v1, v2, v3, v4, v5, v6, v7, v8,
- v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
- v24, v25, v26, v27, v28, v29, v30, v31, v32, v33);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34>
-internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
- T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
- T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22,
- T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30,
- T31 v31, T32 v32, T33 v33, T34 v34) {
- return internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
- T26, T27, T28, T29, T30, T31, T32, T33, T34>(v1, v2, v3, v4, v5, v6, v7,
- v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22,
- v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35>
-internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34, T35> Values(T1 v1, T2 v2, T3 v3, T4 v4,
- T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
- T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
- T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
- T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35) {
- return internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
- T26, T27, T28, T29, T30, T31, T32, T33, T34, T35>(v1, v2, v3, v4, v5, v6,
- v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21,
- v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36>
-internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34, T35, T36> Values(T1 v1, T2 v2, T3 v3, T4 v4,
- T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
- T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
- T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
- T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36) {
- return internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
- T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36>(v1, v2, v3, v4,
- v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
- v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
- v34, v35, v36);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37>
-internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34, T35, T36, T37> Values(T1 v1, T2 v2, T3 v3,
- T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
- T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
- T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
- T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
- T37 v37) {
- return internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
- T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37>(v1, v2, v3,
- v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
- v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
- v34, v35, v36, v37);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38>
-internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> Values(T1 v1, T2 v2,
- T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
- T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
- T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
- T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
- T37 v37, T38 v38) {
- return internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
- T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38>(v1, v2,
- v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18,
- v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32,
- v33, v34, v35, v36, v37, v38);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39>
-internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Values(T1 v1, T2 v2,
- T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
- T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
- T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
- T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
- T37 v37, T38 v38, T39 v39) {
- return internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
- T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39>(v1,
- v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17,
- v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31,
- v32, v33, v34, v35, v36, v37, v38, v39);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40>
-internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Values(T1 v1,
- T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11,
- T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19,
- T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27,
- T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35,
- T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) {
- return internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
- T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
- T40>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15,
- v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29,
- v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41>
-internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
- T41> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
- T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
- T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41) {
- return internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
- T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
- T40, T41>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14,
- v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28,
- v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42>
-internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
- T42> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
- T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
- T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
- T42 v42) {
- return internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
- T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
- T40, T41, T42>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
- v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27,
- v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41,
- v42);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42, typename T43>
-internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
- T43> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
- T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
- T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
- T42 v42, T43 v43) {
- return internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
- T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
- T40, T41, T42, T43>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
- v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26,
- v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40,
- v41, v42, v43);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42, typename T43, typename T44>
-internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
- T44> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
- T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
- T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
- T42 v42, T43 v43, T44 v44) {
- return internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
- T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
- T40, T41, T42, T43, T44>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
- v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25,
- v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39,
- v40, v41, v42, v43, v44);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42, typename T43, typename T44, typename T45>
-internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
- T44, T45> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
- T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,
- T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,
- T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32,
- T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40,
- T41 v41, T42 v42, T43 v43, T44 v44, T45 v45) {
- return internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
- T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
- T40, T41, T42, T43, T44, T45>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
- v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24,
- v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38,
- v39, v40, v41, v42, v43, v44, v45);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42, typename T43, typename T44, typename T45,
- typename T46>
-internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
- T44, T45, T46> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
- T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
- T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
- T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
- T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
- T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) {
- return internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
- T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
- T40, T41, T42, T43, T44, T45, T46>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
- v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
- v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37,
- v38, v39, v40, v41, v42, v43, v44, v45, v46);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42, typename T43, typename T44, typename T45,
- typename T46, typename T47>
-internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
- T44, T45, T46, T47> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
- T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
- T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
- T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
- T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
- T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) {
- return internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
- T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
- T40, T41, T42, T43, T44, T45, T46, T47>(v1, v2, v3, v4, v5, v6, v7, v8,
- v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
- v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37,
- v38, v39, v40, v41, v42, v43, v44, v45, v46, v47);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42, typename T43, typename T44, typename T45,
- typename T46, typename T47, typename T48>
-internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
- T44, T45, T46, T47, T48> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
- T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
- T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
- T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
- T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
- T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47,
- T48 v48) {
- return internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
- T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
- T40, T41, T42, T43, T44, T45, T46, T47, T48>(v1, v2, v3, v4, v5, v6, v7,
- v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22,
- v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36,
- v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42, typename T43, typename T44, typename T45,
- typename T46, typename T47, typename T48, typename T49>
-internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
- T44, T45, T46, T47, T48, T49> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
- T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
- T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22,
- T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30,
- T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38,
- T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46,
- T47 v47, T48 v48, T49 v49) {
- return internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
- T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
- T40, T41, T42, T43, T44, T45, T46, T47, T48, T49>(v1, v2, v3, v4, v5, v6,
- v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21,
- v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35,
- v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42, typename T43, typename T44, typename T45,
- typename T46, typename T47, typename T48, typename T49, typename T50>
-internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
- T44, T45, T46, T47, T48, T49, T50> Values(T1 v1, T2 v2, T3 v3, T4 v4,
- T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
- T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
- T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
- T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37,
- T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45,
- T46 v46, T47 v47, T48 v48, T49 v49, T50 v50) {
- return internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
- T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
- T40, T41, T42, T43, T44, T45, T46, T47, T48, T49, T50>(v1, v2, v3, v4,
- v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
- v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
- v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47,
- v48, v49, v50);
-}
-
-// Bool() allows generating tests with parameters in a set of (false, true).
-//
-// Synopsis:
-// Bool()
-// - returns a generator producing sequences with elements {false, true}.
-//
-// It is useful when testing code that depends on Boolean flags. Combinations
-// of multiple flags can be tested when several Bool()'s are combined using
-// Combine() function.
-//
-// In the following example all tests in the test case FlagDependentTest
-// will be instantiated twice with parameters false and true.
-//
-// class FlagDependentTest : public testing::TestWithParam<bool> {
-// virtual void SetUp() {
-// external_flag = GetParam();
-// }
-// }
-// INSTANTIATE_TEST_CASE_P(BoolSequence, FlagDependentTest, Bool());
-//
-inline internal::ParamGenerator<bool> Bool() {
- return Values(false, true);
-}
-
-# if GTEST_HAS_COMBINE
-// Combine() allows the user to combine two or more sequences to produce
-// values of a Cartesian product of those sequences' elements.
-//
-// Synopsis:
-// Combine(gen1, gen2, ..., genN)
-// - returns a generator producing sequences with elements coming from
-// the Cartesian product of elements from the sequences generated by
-// gen1, gen2, ..., genN. The sequence elements will have a type of
-// tuple<T1, T2, ..., TN> where T1, T2, ..., TN are the types
-// of elements from sequences produces by gen1, gen2, ..., genN.
-//
-// Combine can have up to 10 arguments. This number is currently limited
-// by the maximum number of elements in the tuple implementation used by Google
-// Test.
-//
-// Example:
-//
-// This will instantiate tests in test case AnimalTest each one with
-// the parameter values tuple("cat", BLACK), tuple("cat", WHITE),
-// tuple("dog", BLACK), and tuple("dog", WHITE):
-//
-// enum Color { BLACK, GRAY, WHITE };
-// class AnimalTest
-// : public testing::TestWithParam<tuple<const char*, Color> > {...};
-//
-// TEST_P(AnimalTest, AnimalLooksNice) {...}
-//
-// INSTANTIATE_TEST_CASE_P(AnimalVariations, AnimalTest,
-// Combine(Values("cat", "dog"),
-// Values(BLACK, WHITE)));
-//
-// This will instantiate tests in FlagDependentTest with all variations of two
-// Boolean flags:
-//
-// class FlagDependentTest
-// : public testing::TestWithParam<tuple<bool, bool> > {
-// virtual void SetUp() {
-// // Assigns external_flag_1 and external_flag_2 values from the tuple.
-// tie(external_flag_1, external_flag_2) = GetParam();
-// }
-// };
-//
-// TEST_P(FlagDependentTest, TestFeature1) {
-// // Test your code using external_flag_1 and external_flag_2 here.
-// }
-// INSTANTIATE_TEST_CASE_P(TwoBoolSequence, FlagDependentTest,
-// Combine(Bool(), Bool()));
-//
-template <typename Generator1, typename Generator2>
-internal::CartesianProductHolder2<Generator1, Generator2> Combine(
- const Generator1& g1, const Generator2& g2) {
- return internal::CartesianProductHolder2<Generator1, Generator2>(
- g1, g2);
-}
-
-template <typename Generator1, typename Generator2, typename Generator3>
-internal::CartesianProductHolder3<Generator1, Generator2, Generator3> Combine(
- const Generator1& g1, const Generator2& g2, const Generator3& g3) {
- return internal::CartesianProductHolder3<Generator1, Generator2, Generator3>(
- g1, g2, g3);
-}
-
-template <typename Generator1, typename Generator2, typename Generator3,
- typename Generator4>
-internal::CartesianProductHolder4<Generator1, Generator2, Generator3,
- Generator4> Combine(
- const Generator1& g1, const Generator2& g2, const Generator3& g3,
- const Generator4& g4) {
- return internal::CartesianProductHolder4<Generator1, Generator2, Generator3,
- Generator4>(
- g1, g2, g3, g4);
-}
-
-template <typename Generator1, typename Generator2, typename Generator3,
- typename Generator4, typename Generator5>
-internal::CartesianProductHolder5<Generator1, Generator2, Generator3,
- Generator4, Generator5> Combine(
- const Generator1& g1, const Generator2& g2, const Generator3& g3,
- const Generator4& g4, const Generator5& g5) {
- return internal::CartesianProductHolder5<Generator1, Generator2, Generator3,
- Generator4, Generator5>(
- g1, g2, g3, g4, g5);
-}
-
-template <typename Generator1, typename Generator2, typename Generator3,
- typename Generator4, typename Generator5, typename Generator6>
-internal::CartesianProductHolder6<Generator1, Generator2, Generator3,
- Generator4, Generator5, Generator6> Combine(
- const Generator1& g1, const Generator2& g2, const Generator3& g3,
- const Generator4& g4, const Generator5& g5, const Generator6& g6) {
- return internal::CartesianProductHolder6<Generator1, Generator2, Generator3,
- Generator4, Generator5, Generator6>(
- g1, g2, g3, g4, g5, g6);
-}
-
-template <typename Generator1, typename Generator2, typename Generator3,
- typename Generator4, typename Generator5, typename Generator6,
- typename Generator7>
-internal::CartesianProductHolder7<Generator1, Generator2, Generator3,
- Generator4, Generator5, Generator6, Generator7> Combine(
- const Generator1& g1, const Generator2& g2, const Generator3& g3,
- const Generator4& g4, const Generator5& g5, const Generator6& g6,
- const Generator7& g7) {
- return internal::CartesianProductHolder7<Generator1, Generator2, Generator3,
- Generator4, Generator5, Generator6, Generator7>(
- g1, g2, g3, g4, g5, g6, g7);
-}
-
-template <typename Generator1, typename Generator2, typename Generator3,
- typename Generator4, typename Generator5, typename Generator6,
- typename Generator7, typename Generator8>
-internal::CartesianProductHolder8<Generator1, Generator2, Generator3,
- Generator4, Generator5, Generator6, Generator7, Generator8> Combine(
- const Generator1& g1, const Generator2& g2, const Generator3& g3,
- const Generator4& g4, const Generator5& g5, const Generator6& g6,
- const Generator7& g7, const Generator8& g8) {
- return internal::CartesianProductHolder8<Generator1, Generator2, Generator3,
- Generator4, Generator5, Generator6, Generator7, Generator8>(
- g1, g2, g3, g4, g5, g6, g7, g8);
-}
-
-template <typename Generator1, typename Generator2, typename Generator3,
- typename Generator4, typename Generator5, typename Generator6,
- typename Generator7, typename Generator8, typename Generator9>
-internal::CartesianProductHolder9<Generator1, Generator2, Generator3,
- Generator4, Generator5, Generator6, Generator7, Generator8,
- Generator9> Combine(
- const Generator1& g1, const Generator2& g2, const Generator3& g3,
- const Generator4& g4, const Generator5& g5, const Generator6& g6,
- const Generator7& g7, const Generator8& g8, const Generator9& g9) {
- return internal::CartesianProductHolder9<Generator1, Generator2, Generator3,
- Generator4, Generator5, Generator6, Generator7, Generator8, Generator9>(
- g1, g2, g3, g4, g5, g6, g7, g8, g9);
-}
-
-template <typename Generator1, typename Generator2, typename Generator3,
- typename Generator4, typename Generator5, typename Generator6,
- typename Generator7, typename Generator8, typename Generator9,
- typename Generator10>
-internal::CartesianProductHolder10<Generator1, Generator2, Generator3,
- Generator4, Generator5, Generator6, Generator7, Generator8, Generator9,
- Generator10> Combine(
- const Generator1& g1, const Generator2& g2, const Generator3& g3,
- const Generator4& g4, const Generator5& g5, const Generator6& g6,
- const Generator7& g7, const Generator8& g8, const Generator9& g9,
- const Generator10& g10) {
- return internal::CartesianProductHolder10<Generator1, Generator2, Generator3,
- Generator4, Generator5, Generator6, Generator7, Generator8, Generator9,
- Generator10>(
- g1, g2, g3, g4, g5, g6, g7, g8, g9, g10);
-}
-# endif // GTEST_HAS_COMBINE
-
-
-
-# define TEST_P(test_case_name, test_name) \
- class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \
- : public test_case_name { \
- public: \
- GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {} \
- virtual void TestBody(); \
- private: \
- static int AddToRegistry() { \
- ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \
- GetTestCasePatternHolder<test_case_name>(\
- #test_case_name, __FILE__, __LINE__)->AddTestPattern(\
- #test_case_name, \
- #test_name, \
- new ::testing::internal::TestMetaFactory< \
- GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>()); \
- return 0; \
- } \
- static int gtest_registering_dummy_; \
- GTEST_DISALLOW_COPY_AND_ASSIGN_(\
- GTEST_TEST_CLASS_NAME_(test_case_name, test_name)); \
- }; \
- int GTEST_TEST_CLASS_NAME_(test_case_name, \
- test_name)::gtest_registering_dummy_ = \
- GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::AddToRegistry(); \
- void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()
-
-# define INSTANTIATE_TEST_CASE_P(prefix, test_case_name, generator) \
- ::testing::internal::ParamGenerator<test_case_name::ParamType> \
- gtest_##prefix##test_case_name##_EvalGenerator_() { return generator; } \
- int gtest_##prefix##test_case_name##_dummy_ = \
- ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \
- GetTestCasePatternHolder<test_case_name>(\
- #test_case_name, __FILE__, __LINE__)->AddTestCaseInstantiation(\
- #prefix, \
- &gtest_##prefix##test_case_name##_EvalGenerator_, \
- __FILE__, __LINE__)
-
-} // namespace testing
-
-#endif // GTEST_HAS_PARAM_TEST
-
-#endif // GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
diff --git a/src/testing/gtest/include/gtest/gtest-param-test.h.pump b/src/testing/gtest/include/gtest/gtest-param-test.h.pump
deleted file mode 100644
index 2dc9303b..00000000
--- a/src/testing/gtest/include/gtest/gtest-param-test.h.pump
+++ /dev/null
@@ -1,487 +0,0 @@
-$$ -*- mode: c++; -*-
-$var n = 50 $$ Maximum length of Values arguments we want to support.
-$var maxtuple = 10 $$ Maximum number of Combine arguments we want to support.
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Authors: vladl@google.com (Vlad Losev)
-//
-// Macros and functions for implementing parameterized tests
-// in Google C++ Testing Framework (Google Test)
-//
-// This file is generated by a SCRIPT. DO NOT EDIT BY HAND!
-//
-#ifndef GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
-#define GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
-
-
-// Value-parameterized tests allow you to test your code with different
-// parameters without writing multiple copies of the same test.
-//
-// Here is how you use value-parameterized tests:
-
-#if 0
-
-// To write value-parameterized tests, first you should define a fixture
-// class. It is usually derived from testing::TestWithParam<T> (see below for
-// another inheritance scheme that's sometimes useful in more complicated
-// class hierarchies), where the type of your parameter values.
-// TestWithParam<T> is itself derived from testing::Test. T can be any
-// copyable type. If it's a raw pointer, you are responsible for managing the
-// lifespan of the pointed values.
-
-class FooTest : public ::testing::TestWithParam<const char*> {
- // You can implement all the usual class fixture members here.
-};
-
-// Then, use the TEST_P macro to define as many parameterized tests
-// for this fixture as you want. The _P suffix is for "parameterized"
-// or "pattern", whichever you prefer to think.
-
-TEST_P(FooTest, DoesBlah) {
- // Inside a test, access the test parameter with the GetParam() method
- // of the TestWithParam<T> class:
- EXPECT_TRUE(foo.Blah(GetParam()));
- ...
-}
-
-TEST_P(FooTest, HasBlahBlah) {
- ...
-}
-
-// Finally, you can use INSTANTIATE_TEST_CASE_P to instantiate the test
-// case with any set of parameters you want. Google Test defines a number
-// of functions for generating test parameters. They return what we call
-// (surprise!) parameter generators. Here is a summary of them, which
-// are all in the testing namespace:
-//
-//
-// Range(begin, end [, step]) - Yields values {begin, begin+step,
-// begin+step+step, ...}. The values do not
-// include end. step defaults to 1.
-// Values(v1, v2, ..., vN) - Yields values {v1, v2, ..., vN}.
-// ValuesIn(container) - Yields values from a C-style array, an STL
-// ValuesIn(begin,end) container, or an iterator range [begin, end).
-// Bool() - Yields sequence {false, true}.
-// Combine(g1, g2, ..., gN) - Yields all combinations (the Cartesian product
-// for the math savvy) of the values generated
-// by the N generators.
-//
-// For more details, see comments at the definitions of these functions below
-// in this file.
-//
-// The following statement will instantiate tests from the FooTest test case
-// each with parameter values "meeny", "miny", and "moe".
-
-INSTANTIATE_TEST_CASE_P(InstantiationName,
- FooTest,
- Values("meeny", "miny", "moe"));
-
-// To distinguish different instances of the pattern, (yes, you
-// can instantiate it more then once) the first argument to the
-// INSTANTIATE_TEST_CASE_P macro is a prefix that will be added to the
-// actual test case name. Remember to pick unique prefixes for different
-// instantiations. The tests from the instantiation above will have
-// these names:
-//
-// * InstantiationName/FooTest.DoesBlah/0 for "meeny"
-// * InstantiationName/FooTest.DoesBlah/1 for "miny"
-// * InstantiationName/FooTest.DoesBlah/2 for "moe"
-// * InstantiationName/FooTest.HasBlahBlah/0 for "meeny"
-// * InstantiationName/FooTest.HasBlahBlah/1 for "miny"
-// * InstantiationName/FooTest.HasBlahBlah/2 for "moe"
-//
-// You can use these names in --gtest_filter.
-//
-// This statement will instantiate all tests from FooTest again, each
-// with parameter values "cat" and "dog":
-
-const char* pets[] = {"cat", "dog"};
-INSTANTIATE_TEST_CASE_P(AnotherInstantiationName, FooTest, ValuesIn(pets));
-
-// The tests from the instantiation above will have these names:
-//
-// * AnotherInstantiationName/FooTest.DoesBlah/0 for "cat"
-// * AnotherInstantiationName/FooTest.DoesBlah/1 for "dog"
-// * AnotherInstantiationName/FooTest.HasBlahBlah/0 for "cat"
-// * AnotherInstantiationName/FooTest.HasBlahBlah/1 for "dog"
-//
-// Please note that INSTANTIATE_TEST_CASE_P will instantiate all tests
-// in the given test case, whether their definitions come before or
-// AFTER the INSTANTIATE_TEST_CASE_P statement.
-//
-// Please also note that generator expressions (including parameters to the
-// generators) are evaluated in InitGoogleTest(), after main() has started.
-// This allows the user on one hand, to adjust generator parameters in order
-// to dynamically determine a set of tests to run and on the other hand,
-// give the user a chance to inspect the generated tests with Google Test
-// reflection API before RUN_ALL_TESTS() is executed.
-//
-// You can see samples/sample7_unittest.cc and samples/sample8_unittest.cc
-// for more examples.
-//
-// In the future, we plan to publish the API for defining new parameter
-// generators. But for now this interface remains part of the internal
-// implementation and is subject to change.
-//
-//
-// A parameterized test fixture must be derived from testing::Test and from
-// testing::WithParamInterface<T>, where T is the type of the parameter
-// values. Inheriting from TestWithParam<T> satisfies that requirement because
-// TestWithParam<T> inherits from both Test and WithParamInterface. In more
-// complicated hierarchies, however, it is occasionally useful to inherit
-// separately from Test and WithParamInterface. For example:
-
-class BaseTest : public ::testing::Test {
- // You can inherit all the usual members for a non-parameterized test
- // fixture here.
-};
-
-class DerivedTest : public BaseTest, public ::testing::WithParamInterface<int> {
- // The usual test fixture members go here too.
-};
-
-TEST_F(BaseTest, HasFoo) {
- // This is an ordinary non-parameterized test.
-}
-
-TEST_P(DerivedTest, DoesBlah) {
- // GetParam works just the same here as if you inherit from TestWithParam.
- EXPECT_TRUE(foo.Blah(GetParam()));
-}
-
-#endif // 0
-
-#include "gtest/internal/gtest-port.h"
-
-#if !GTEST_OS_SYMBIAN
-# include <utility>
-#endif
-
-// scripts/fuse_gtest.py depends on gtest's own header being #included
-// *unconditionally*. Therefore these #includes cannot be moved
-// inside #if GTEST_HAS_PARAM_TEST.
-#include "gtest/internal/gtest-internal.h"
-#include "gtest/internal/gtest-param-util.h"
-#include "gtest/internal/gtest-param-util-generated.h"
-
-#if GTEST_HAS_PARAM_TEST
-
-namespace testing {
-
-// Functions producing parameter generators.
-//
-// Google Test uses these generators to produce parameters for value-
-// parameterized tests. When a parameterized test case is instantiated
-// with a particular generator, Google Test creates and runs tests
-// for each element in the sequence produced by the generator.
-//
-// In the following sample, tests from test case FooTest are instantiated
-// each three times with parameter values 3, 5, and 8:
-//
-// class FooTest : public TestWithParam<int> { ... };
-//
-// TEST_P(FooTest, TestThis) {
-// }
-// TEST_P(FooTest, TestThat) {
-// }
-// INSTANTIATE_TEST_CASE_P(TestSequence, FooTest, Values(3, 5, 8));
-//
-
-// Range() returns generators providing sequences of values in a range.
-//
-// Synopsis:
-// Range(start, end)
-// - returns a generator producing a sequence of values {start, start+1,
-// start+2, ..., }.
-// Range(start, end, step)
-// - returns a generator producing a sequence of values {start, start+step,
-// start+step+step, ..., }.
-// Notes:
-// * The generated sequences never include end. For example, Range(1, 5)
-// returns a generator producing a sequence {1, 2, 3, 4}. Range(1, 9, 2)
-// returns a generator producing {1, 3, 5, 7}.
-// * start and end must have the same type. That type may be any integral or
-// floating-point type or a user defined type satisfying these conditions:
-// * It must be assignable (have operator=() defined).
-// * It must have operator+() (operator+(int-compatible type) for
-// two-operand version).
-// * It must have operator<() defined.
-// Elements in the resulting sequences will also have that type.
-// * Condition start < end must be satisfied in order for resulting sequences
-// to contain any elements.
-//
-template <typename T, typename IncrementT>
-internal::ParamGenerator<T> Range(T start, T end, IncrementT step) {
- return internal::ParamGenerator<T>(
- new internal::RangeGenerator<T, IncrementT>(start, end, step));
-}
-
-template <typename T>
-internal::ParamGenerator<T> Range(T start, T end) {
- return Range(start, end, 1);
-}
-
-// ValuesIn() function allows generation of tests with parameters coming from
-// a container.
-//
-// Synopsis:
-// ValuesIn(const T (&array)[N])
-// - returns a generator producing sequences with elements from
-// a C-style array.
-// ValuesIn(const Container& container)
-// - returns a generator producing sequences with elements from
-// an STL-style container.
-// ValuesIn(Iterator begin, Iterator end)
-// - returns a generator producing sequences with elements from
-// a range [begin, end) defined by a pair of STL-style iterators. These
-// iterators can also be plain C pointers.
-//
-// Please note that ValuesIn copies the values from the containers
-// passed in and keeps them to generate tests in RUN_ALL_TESTS().
-//
-// Examples:
-//
-// This instantiates tests from test case StringTest
-// each with C-string values of "foo", "bar", and "baz":
-//
-// const char* strings[] = {"foo", "bar", "baz"};
-// INSTANTIATE_TEST_CASE_P(StringSequence, SrtingTest, ValuesIn(strings));
-//
-// This instantiates tests from test case StlStringTest
-// each with STL strings with values "a" and "b":
-//
-// ::std::vector< ::std::string> GetParameterStrings() {
-// ::std::vector< ::std::string> v;
-// v.push_back("a");
-// v.push_back("b");
-// return v;
-// }
-//
-// INSTANTIATE_TEST_CASE_P(CharSequence,
-// StlStringTest,
-// ValuesIn(GetParameterStrings()));
-//
-//
-// This will also instantiate tests from CharTest
-// each with parameter values 'a' and 'b':
-//
-// ::std::list<char> GetParameterChars() {
-// ::std::list<char> list;
-// list.push_back('a');
-// list.push_back('b');
-// return list;
-// }
-// ::std::list<char> l = GetParameterChars();
-// INSTANTIATE_TEST_CASE_P(CharSequence2,
-// CharTest,
-// ValuesIn(l.begin(), l.end()));
-//
-template <typename ForwardIterator>
-internal::ParamGenerator<
- typename ::testing::internal::IteratorTraits<ForwardIterator>::value_type>
-ValuesIn(ForwardIterator begin, ForwardIterator end) {
- typedef typename ::testing::internal::IteratorTraits<ForwardIterator>
- ::value_type ParamType;
- return internal::ParamGenerator<ParamType>(
- new internal::ValuesInIteratorRangeGenerator<ParamType>(begin, end));
-}
-
-template <typename T, size_t N>
-internal::ParamGenerator<T> ValuesIn(const T (&array)[N]) {
- return ValuesIn(array, array + N);
-}
-
-template <class Container>
-internal::ParamGenerator<typename Container::value_type> ValuesIn(
- const Container& container) {
- return ValuesIn(container.begin(), container.end());
-}
-
-// Values() allows generating tests from explicitly specified list of
-// parameters.
-//
-// Synopsis:
-// Values(T v1, T v2, ..., T vN)
-// - returns a generator producing sequences with elements v1, v2, ..., vN.
-//
-// For example, this instantiates tests from test case BarTest each
-// with values "one", "two", and "three":
-//
-// INSTANTIATE_TEST_CASE_P(NumSequence, BarTest, Values("one", "two", "three"));
-//
-// This instantiates tests from test case BazTest each with values 1, 2, 3.5.
-// The exact type of values will depend on the type of parameter in BazTest.
-//
-// INSTANTIATE_TEST_CASE_P(FloatingNumbers, BazTest, Values(1, 2, 3.5));
-//
-// Currently, Values() supports from 1 to $n parameters.
-//
-$range i 1..n
-$for i [[
-$range j 1..i
-
-template <$for j, [[typename T$j]]>
-internal::ValueArray$i<$for j, [[T$j]]> Values($for j, [[T$j v$j]]) {
- return internal::ValueArray$i<$for j, [[T$j]]>($for j, [[v$j]]);
-}
-
-]]
-
-// Bool() allows generating tests with parameters in a set of (false, true).
-//
-// Synopsis:
-// Bool()
-// - returns a generator producing sequences with elements {false, true}.
-//
-// It is useful when testing code that depends on Boolean flags. Combinations
-// of multiple flags can be tested when several Bool()'s are combined using
-// Combine() function.
-//
-// In the following example all tests in the test case FlagDependentTest
-// will be instantiated twice with parameters false and true.
-//
-// class FlagDependentTest : public testing::TestWithParam<bool> {
-// virtual void SetUp() {
-// external_flag = GetParam();
-// }
-// }
-// INSTANTIATE_TEST_CASE_P(BoolSequence, FlagDependentTest, Bool());
-//
-inline internal::ParamGenerator<bool> Bool() {
- return Values(false, true);
-}
-
-# if GTEST_HAS_COMBINE
-// Combine() allows the user to combine two or more sequences to produce
-// values of a Cartesian product of those sequences' elements.
-//
-// Synopsis:
-// Combine(gen1, gen2, ..., genN)
-// - returns a generator producing sequences with elements coming from
-// the Cartesian product of elements from the sequences generated by
-// gen1, gen2, ..., genN. The sequence elements will have a type of
-// tuple<T1, T2, ..., TN> where T1, T2, ..., TN are the types
-// of elements from sequences produces by gen1, gen2, ..., genN.
-//
-// Combine can have up to $maxtuple arguments. This number is currently limited
-// by the maximum number of elements in the tuple implementation used by Google
-// Test.
-//
-// Example:
-//
-// This will instantiate tests in test case AnimalTest each one with
-// the parameter values tuple("cat", BLACK), tuple("cat", WHITE),
-// tuple("dog", BLACK), and tuple("dog", WHITE):
-//
-// enum Color { BLACK, GRAY, WHITE };
-// class AnimalTest
-// : public testing::TestWithParam<tuple<const char*, Color> > {...};
-//
-// TEST_P(AnimalTest, AnimalLooksNice) {...}
-//
-// INSTANTIATE_TEST_CASE_P(AnimalVariations, AnimalTest,
-// Combine(Values("cat", "dog"),
-// Values(BLACK, WHITE)));
-//
-// This will instantiate tests in FlagDependentTest with all variations of two
-// Boolean flags:
-//
-// class FlagDependentTest
-// : public testing::TestWithParam<tuple<bool, bool> > {
-// virtual void SetUp() {
-// // Assigns external_flag_1 and external_flag_2 values from the tuple.
-// tie(external_flag_1, external_flag_2) = GetParam();
-// }
-// };
-//
-// TEST_P(FlagDependentTest, TestFeature1) {
-// // Test your code using external_flag_1 and external_flag_2 here.
-// }
-// INSTANTIATE_TEST_CASE_P(TwoBoolSequence, FlagDependentTest,
-// Combine(Bool(), Bool()));
-//
-$range i 2..maxtuple
-$for i [[
-$range j 1..i
-
-template <$for j, [[typename Generator$j]]>
-internal::CartesianProductHolder$i<$for j, [[Generator$j]]> Combine(
- $for j, [[const Generator$j& g$j]]) {
- return internal::CartesianProductHolder$i<$for j, [[Generator$j]]>(
- $for j, [[g$j]]);
-}
-
-]]
-# endif // GTEST_HAS_COMBINE
-
-
-
-# define TEST_P(test_case_name, test_name) \
- class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \
- : public test_case_name { \
- public: \
- GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {} \
- virtual void TestBody(); \
- private: \
- static int AddToRegistry() { \
- ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \
- GetTestCasePatternHolder<test_case_name>(\
- #test_case_name, __FILE__, __LINE__)->AddTestPattern(\
- #test_case_name, \
- #test_name, \
- new ::testing::internal::TestMetaFactory< \
- GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>()); \
- return 0; \
- } \
- static int gtest_registering_dummy_; \
- GTEST_DISALLOW_COPY_AND_ASSIGN_(\
- GTEST_TEST_CLASS_NAME_(test_case_name, test_name)); \
- }; \
- int GTEST_TEST_CLASS_NAME_(test_case_name, \
- test_name)::gtest_registering_dummy_ = \
- GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::AddToRegistry(); \
- void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()
-
-# define INSTANTIATE_TEST_CASE_P(prefix, test_case_name, generator) \
- ::testing::internal::ParamGenerator<test_case_name::ParamType> \
- gtest_##prefix##test_case_name##_EvalGenerator_() { return generator; } \
- int gtest_##prefix##test_case_name##_dummy_ = \
- ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \
- GetTestCasePatternHolder<test_case_name>(\
- #test_case_name, __FILE__, __LINE__)->AddTestCaseInstantiation(\
- #prefix, \
- &gtest_##prefix##test_case_name##_EvalGenerator_, \
- __FILE__, __LINE__)
-
-} // namespace testing
-
-#endif // GTEST_HAS_PARAM_TEST
-
-#endif // GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
diff --git a/src/testing/gtest/include/gtest/gtest-printers.h b/src/testing/gtest/include/gtest/gtest-printers.h
deleted file mode 100644
index 55d44fa1..00000000
--- a/src/testing/gtest/include/gtest/gtest-printers.h
+++ /dev/null
@@ -1,799 +0,0 @@
-// Copyright 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-// Google Test - The Google C++ Testing Framework
-//
-// This file implements a universal value printer that can print a
-// value of any type T:
-//
-// void ::testing::internal::UniversalPrinter<T>::Print(value, ostream_ptr);
-//
-// A user can teach this function how to print a class type T by
-// defining either operator<<() or PrintTo() in the namespace that
-// defines T. More specifically, the FIRST defined function in the
-// following list will be used (assuming T is defined in namespace
-// foo):
-//
-// 1. foo::PrintTo(const T&, ostream*)
-// 2. operator<<(ostream&, const T&) defined in either foo or the
-// global namespace.
-//
-// If none of the above is defined, it will print the debug string of
-// the value if it is a protocol buffer, or print the raw bytes in the
-// value otherwise.
-//
-// To aid debugging: when T is a reference type, the address of the
-// value is also printed; when T is a (const) char pointer, both the
-// pointer value and the NUL-terminated string it points to are
-// printed.
-//
-// We also provide some convenient wrappers:
-//
-// // Prints a value to a string. For a (const or not) char
-// // pointer, the NUL-terminated string (but not the pointer) is
-// // printed.
-// std::string ::testing::PrintToString(const T& value);
-//
-// // Prints a value tersely: for a reference type, the referenced
-// // value (but not the address) is printed; for a (const or not) char
-// // pointer, the NUL-terminated string (but not the pointer) is
-// // printed.
-// void ::testing::internal::UniversalTersePrint(const T& value, ostream*);
-//
-// // Prints value using the type inferred by the compiler. The difference
-// // from UniversalTersePrint() is that this function prints both the
-// // pointer and the NUL-terminated string for a (const or not) char pointer.
-// void ::testing::internal::UniversalPrint(const T& value, ostream*);
-//
-// // Prints the fields of a tuple tersely to a string vector, one
-// // element for each field. Tuple support must be enabled in
-// // gtest-port.h.
-// std::vector<string> UniversalTersePrintTupleFieldsToStrings(
-// const Tuple& value);
-//
-// Known limitation:
-//
-// The print primitives print the elements of an STL-style container
-// using the compiler-inferred type of *iter where iter is a
-// const_iterator of the container. When const_iterator is an input
-// iterator but not a forward iterator, this inferred type may not
-// match value_type, and the print output may be incorrect. In
-// practice, this is rarely a problem as for most containers
-// const_iterator is a forward iterator. We'll fix this if there's an
-// actual need for it. Note that this fix cannot rely on value_type
-// being defined as many user-defined container types don't have
-// value_type.
-
-#ifndef GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
-#define GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
-
-#include <ostream> // NOLINT
-#include <sstream>
-#include <string>
-#include <utility>
-#include <vector>
-#include "gtest/internal/gtest-port.h"
-#include "gtest/internal/gtest-internal.h"
-
-namespace testing {
-
-// Definitions in the 'internal' and 'internal2' name spaces are
-// subject to change without notice. DO NOT USE THEM IN USER CODE!
-namespace internal2 {
-
-// Prints the given number of bytes in the given object to the given
-// ostream.
-GTEST_API_ void PrintBytesInObjectTo(const unsigned char* obj_bytes,
- size_t count,
- ::std::ostream* os);
-
-// For selecting which printer to use when a given type has neither <<
-// nor PrintTo().
-enum TypeKind {
- kProtobuf, // a protobuf type
- kConvertibleToInteger, // a type implicitly convertible to BiggestInt
- // (e.g. a named or unnamed enum type)
- kOtherType // anything else
-};
-
-// TypeWithoutFormatter<T, kTypeKind>::PrintValue(value, os) is called
-// by the universal printer to print a value of type T when neither
-// operator<< nor PrintTo() is defined for T, where kTypeKind is the
-// "kind" of T as defined by enum TypeKind.
-template <typename T, TypeKind kTypeKind>
-class TypeWithoutFormatter {
- public:
- // This default version is called when kTypeKind is kOtherType.
- static void PrintValue(const T& value, ::std::ostream* os) {
- PrintBytesInObjectTo(reinterpret_cast<const unsigned char*>(&value),
- sizeof(value), os);
- }
-};
-
-// We print a protobuf using its ShortDebugString() when the string
-// doesn't exceed this many characters; otherwise we print it using
-// DebugString() for better readability.
-const size_t kProtobufOneLinerMaxLength = 50;
-
-template <typename T>
-class TypeWithoutFormatter<T, kProtobuf> {
- public:
- static void PrintValue(const T& value, ::std::ostream* os) {
- const ::testing::internal::string short_str = value.ShortDebugString();
- const ::testing::internal::string pretty_str =
- short_str.length() <= kProtobufOneLinerMaxLength ?
- short_str : ("\n" + value.DebugString());
- *os << ("<" + pretty_str + ">");
- }
-};
-
-template <typename T>
-class TypeWithoutFormatter<T, kConvertibleToInteger> {
- public:
- // Since T has no << operator or PrintTo() but can be implicitly
- // converted to BiggestInt, we print it as a BiggestInt.
- //
- // Most likely T is an enum type (either named or unnamed), in which
- // case printing it as an integer is the desired behavior. In case
- // T is not an enum, printing it as an integer is the best we can do
- // given that it has no user-defined printer.
- static void PrintValue(const T& value, ::std::ostream* os) {
- const internal::BiggestInt kBigInt = value;
- *os << kBigInt;
- }
-};
-
-// Prints the given value to the given ostream. If the value is a
-// protocol message, its debug string is printed; if it's an enum or
-// of a type implicitly convertible to BiggestInt, it's printed as an
-// integer; otherwise the bytes in the value are printed. This is
-// what UniversalPrinter<T>::Print() does when it knows nothing about
-// type T and T has neither << operator nor PrintTo().
-//
-// A user can override this behavior for a class type Foo by defining
-// a << operator in the namespace where Foo is defined.
-//
-// We put this operator in namespace 'internal2' instead of 'internal'
-// to simplify the implementation, as much code in 'internal' needs to
-// use << in STL, which would conflict with our own << were it defined
-// in 'internal'.
-//
-// Note that this operator<< takes a generic std::basic_ostream<Char,
-// CharTraits> type instead of the more restricted std::ostream. If
-// we define it to take an std::ostream instead, we'll get an
-// "ambiguous overloads" compiler error when trying to print a type
-// Foo that supports streaming to std::basic_ostream<Char,
-// CharTraits>, as the compiler cannot tell whether
-// operator<<(std::ostream&, const T&) or
-// operator<<(std::basic_stream<Char, CharTraits>, const Foo&) is more
-// specific.
-template <typename Char, typename CharTraits, typename T>
-::std::basic_ostream<Char, CharTraits>& operator<<(
- ::std::basic_ostream<Char, CharTraits>& os, const T& x) {
- TypeWithoutFormatter<T,
- (internal::IsAProtocolMessage<T>::value ? kProtobuf :
- internal::ImplicitlyConvertible<const T&, internal::BiggestInt>::value ?
- kConvertibleToInteger : kOtherType)>::PrintValue(x, &os);
- return os;
-}
-
-} // namespace internal2
-} // namespace testing
-
-// This namespace MUST NOT BE NESTED IN ::testing, or the name look-up
-// magic needed for implementing UniversalPrinter won't work.
-namespace testing_internal {
-
-// Used to print a value that is not an STL-style container when the
-// user doesn't define PrintTo() for it.
-template <typename T>
-void DefaultPrintNonContainerTo(const T& value, ::std::ostream* os) {
- // With the following statement, during unqualified name lookup,
- // testing::internal2::operator<< appears as if it was declared in
- // the nearest enclosing namespace that contains both
- // ::testing_internal and ::testing::internal2, i.e. the global
- // namespace. For more details, refer to the C++ Standard section
- // 7.3.4-1 [namespace.udir]. This allows us to fall back onto
- // testing::internal2::operator<< in case T doesn't come with a <<
- // operator.
- //
- // We cannot write 'using ::testing::internal2::operator<<;', which
- // gcc 3.3 fails to compile due to a compiler bug.
- using namespace ::testing::internal2; // NOLINT
-
- // Assuming T is defined in namespace foo, in the next statement,
- // the compiler will consider all of:
- //
- // 1. foo::operator<< (thanks to Koenig look-up),
- // 2. ::operator<< (as the current namespace is enclosed in ::),
- // 3. testing::internal2::operator<< (thanks to the using statement above).
- //
- // The operator<< whose type matches T best will be picked.
- //
- // We deliberately allow #2 to be a candidate, as sometimes it's
- // impossible to define #1 (e.g. when foo is ::std, defining
- // anything in it is undefined behavior unless you are a compiler
- // vendor.).
- *os << value;
-}
-
-} // namespace testing_internal
-
-namespace testing {
-namespace internal {
-
-// UniversalPrinter<T>::Print(value, ostream_ptr) prints the given
-// value to the given ostream. The caller must ensure that
-// 'ostream_ptr' is not NULL, or the behavior is undefined.
-//
-// We define UniversalPrinter as a class template (as opposed to a
-// function template), as we need to partially specialize it for
-// reference types, which cannot be done with function templates.
-template <typename T>
-class UniversalPrinter;
-
-template <typename T>
-void UniversalPrint(const T& value, ::std::ostream* os);
-
-// Used to print an STL-style container when the user doesn't define
-// a PrintTo() for it.
-template <typename C>
-void DefaultPrintTo(IsContainer /* dummy */,
- false_type /* is not a pointer */,
- const C& container, ::std::ostream* os) {
- const size_t kMaxCount = 32; // The maximum number of elements to print.
- *os << '{';
- size_t count = 0;
- for (typename C::const_iterator it = container.begin();
- it != container.end(); ++it, ++count) {
- if (count > 0) {
- *os << ',';
- if (count == kMaxCount) { // Enough has been printed.
- *os << " ...";
- break;
- }
- }
- *os << ' ';
- // We cannot call PrintTo(*it, os) here as PrintTo() doesn't
- // handle *it being a native array.
- internal::UniversalPrint(*it, os);
- }
-
- if (count > 0) {
- *os << ' ';
- }
- *os << '}';
-}
-
-// Used to print a pointer that is neither a char pointer nor a member
-// pointer, when the user doesn't define PrintTo() for it. (A member
-// variable pointer or member function pointer doesn't really point to
-// a location in the address space. Their representation is
-// implementation-defined. Therefore they will be printed as raw
-// bytes.)
-template <typename T>
-void DefaultPrintTo(IsNotContainer /* dummy */,
- true_type /* is a pointer */,
- T* p, ::std::ostream* os) {
- if (p == NULL) {
- *os << "NULL";
- } else {
- // C++ doesn't allow casting from a function pointer to any object
- // pointer.
- //
- // IsTrue() silences warnings: "Condition is always true",
- // "unreachable code".
- if (IsTrue(ImplicitlyConvertible<T*, const void*>::value)) {
- // T is not a function type. We just call << to print p,
- // relying on ADL to pick up user-defined << for their pointer
- // types, if any.
- *os << p;
- } else {
- // T is a function type, so '*os << p' doesn't do what we want
- // (it just prints p as bool). We want to print p as a const
- // void*. However, we cannot cast it to const void* directly,
- // even using reinterpret_cast, as earlier versions of gcc
- // (e.g. 3.4.5) cannot compile the cast when p is a function
- // pointer. Casting to UInt64 first solves the problem.
- *os << reinterpret_cast<const void*>(
- reinterpret_cast<internal::UInt64>(p));
- }
- }
-}
-
-// Used to print a non-container, non-pointer value when the user
-// doesn't define PrintTo() for it.
-template <typename T>
-void DefaultPrintTo(IsNotContainer /* dummy */,
- false_type /* is not a pointer */,
- const T& value, ::std::ostream* os) {
- ::testing_internal::DefaultPrintNonContainerTo(value, os);
-}
-
-// Prints the given value using the << operator if it has one;
-// otherwise prints the bytes in it. This is what
-// UniversalPrinter<T>::Print() does when PrintTo() is not specialized
-// or overloaded for type T.
-//
-// A user can override this behavior for a class type Foo by defining
-// an overload of PrintTo() in the namespace where Foo is defined. We
-// give the user this option as sometimes defining a << operator for
-// Foo is not desirable (e.g. the coding style may prevent doing it,
-// or there is already a << operator but it doesn't do what the user
-// wants).
-template <typename T>
-void PrintTo(const T& value, ::std::ostream* os) {
- // DefaultPrintTo() is overloaded. The type of its first two
- // arguments determine which version will be picked. If T is an
- // STL-style container, the version for container will be called; if
- // T is a pointer, the pointer version will be called; otherwise the
- // generic version will be called.
- //
- // Note that we check for container types here, prior to we check
- // for protocol message types in our operator<<. The rationale is:
- //
- // For protocol messages, we want to give people a chance to
- // override Google Mock's format by defining a PrintTo() or
- // operator<<. For STL containers, other formats can be
- // incompatible with Google Mock's format for the container
- // elements; therefore we check for container types here to ensure
- // that our format is used.
- //
- // The second argument of DefaultPrintTo() is needed to bypass a bug
- // in Symbian's C++ compiler that prevents it from picking the right
- // overload between:
- //
- // PrintTo(const T& x, ...);
- // PrintTo(T* x, ...);
- DefaultPrintTo(IsContainerTest<T>(0), is_pointer<T>(), value, os);
-}
-
-// The following list of PrintTo() overloads tells
-// UniversalPrinter<T>::Print() how to print standard types (built-in
-// types, strings, plain arrays, and pointers).
-
-// Overloads for various char types.
-GTEST_API_ void PrintTo(unsigned char c, ::std::ostream* os);
-GTEST_API_ void PrintTo(signed char c, ::std::ostream* os);
-inline void PrintTo(char c, ::std::ostream* os) {
- // When printing a plain char, we always treat it as unsigned. This
- // way, the output won't be affected by whether the compiler thinks
- // char is signed or not.
- PrintTo(static_cast<unsigned char>(c), os);
-}
-
-// Overloads for other simple built-in types.
-inline void PrintTo(bool x, ::std::ostream* os) {
- *os << (x ? "true" : "false");
-}
-
-// Overload for wchar_t type.
-// Prints a wchar_t as a symbol if it is printable or as its internal
-// code otherwise and also as its decimal code (except for L'\0').
-// The L'\0' char is printed as "L'\\0'". The decimal code is printed
-// as signed integer when wchar_t is implemented by the compiler
-// as a signed type and is printed as an unsigned integer when wchar_t
-// is implemented as an unsigned type.
-GTEST_API_ void PrintTo(wchar_t wc, ::std::ostream* os);
-
-// Overloads for C strings.
-GTEST_API_ void PrintTo(const char* s, ::std::ostream* os);
-inline void PrintTo(char* s, ::std::ostream* os) {
- PrintTo(ImplicitCast_<const char*>(s), os);
-}
-
-// signed/unsigned char is often used for representing binary data, so
-// we print pointers to it as void* to be safe.
-inline void PrintTo(const signed char* s, ::std::ostream* os) {
- PrintTo(ImplicitCast_<const void*>(s), os);
-}
-inline void PrintTo(signed char* s, ::std::ostream* os) {
- PrintTo(ImplicitCast_<const void*>(s), os);
-}
-inline void PrintTo(const unsigned char* s, ::std::ostream* os) {
- PrintTo(ImplicitCast_<const void*>(s), os);
-}
-inline void PrintTo(unsigned char* s, ::std::ostream* os) {
- PrintTo(ImplicitCast_<const void*>(s), os);
-}
-
-// MSVC can be configured to define wchar_t as a typedef of unsigned
-// short. It defines _NATIVE_WCHAR_T_DEFINED when wchar_t is a native
-// type. When wchar_t is a typedef, defining an overload for const
-// wchar_t* would cause unsigned short* be printed as a wide string,
-// possibly causing invalid memory accesses.
-#if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED)
-// Overloads for wide C strings
-GTEST_API_ void PrintTo(const wchar_t* s, ::std::ostream* os);
-inline void PrintTo(wchar_t* s, ::std::ostream* os) {
- PrintTo(ImplicitCast_<const wchar_t*>(s), os);
-}
-#endif
-
-// Overload for C arrays. Multi-dimensional arrays are printed
-// properly.
-
-// Prints the given number of elements in an array, without printing
-// the curly braces.
-template <typename T>
-void PrintRawArrayTo(const T a[], size_t count, ::std::ostream* os) {
- UniversalPrint(a[0], os);
- for (size_t i = 1; i != count; i++) {
- *os << ", ";
- UniversalPrint(a[i], os);
- }
-}
-
-// Overloads for ::string and ::std::string.
-#if GTEST_HAS_GLOBAL_STRING
-GTEST_API_ void PrintStringTo(const ::string&s, ::std::ostream* os);
-inline void PrintTo(const ::string& s, ::std::ostream* os) {
- PrintStringTo(s, os);
-}
-#endif // GTEST_HAS_GLOBAL_STRING
-
-GTEST_API_ void PrintStringTo(const ::std::string&s, ::std::ostream* os);
-inline void PrintTo(const ::std::string& s, ::std::ostream* os) {
- PrintStringTo(s, os);
-}
-
-// Overloads for ::wstring and ::std::wstring.
-#if GTEST_HAS_GLOBAL_WSTRING
-GTEST_API_ void PrintWideStringTo(const ::wstring&s, ::std::ostream* os);
-inline void PrintTo(const ::wstring& s, ::std::ostream* os) {
- PrintWideStringTo(s, os);
-}
-#endif // GTEST_HAS_GLOBAL_WSTRING
-
-#if GTEST_HAS_STD_WSTRING
-GTEST_API_ void PrintWideStringTo(const ::std::wstring&s, ::std::ostream* os);
-inline void PrintTo(const ::std::wstring& s, ::std::ostream* os) {
- PrintWideStringTo(s, os);
-}
-#endif // GTEST_HAS_STD_WSTRING
-
-#if GTEST_HAS_TR1_TUPLE
-// Overload for ::std::tr1::tuple. Needed for printing function arguments,
-// which are packed as tuples.
-
-// Helper function for printing a tuple. T must be instantiated with
-// a tuple type.
-template <typename T>
-void PrintTupleTo(const T& t, ::std::ostream* os);
-
-// Overloaded PrintTo() for tuples of various arities. We support
-// tuples of up-to 10 fields. The following implementation works
-// regardless of whether tr1::tuple is implemented using the
-// non-standard variadic template feature or not.
-
-inline void PrintTo(const ::std::tr1::tuple<>& t, ::std::ostream* os) {
- PrintTupleTo(t, os);
-}
-
-template <typename T1>
-void PrintTo(const ::std::tr1::tuple<T1>& t, ::std::ostream* os) {
- PrintTupleTo(t, os);
-}
-
-template <typename T1, typename T2>
-void PrintTo(const ::std::tr1::tuple<T1, T2>& t, ::std::ostream* os) {
- PrintTupleTo(t, os);
-}
-
-template <typename T1, typename T2, typename T3>
-void PrintTo(const ::std::tr1::tuple<T1, T2, T3>& t, ::std::ostream* os) {
- PrintTupleTo(t, os);
-}
-
-template <typename T1, typename T2, typename T3, typename T4>
-void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4>& t, ::std::ostream* os) {
- PrintTupleTo(t, os);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5>
-void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5>& t,
- ::std::ostream* os) {
- PrintTupleTo(t, os);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6>
-void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6>& t,
- ::std::ostream* os) {
- PrintTupleTo(t, os);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7>
-void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7>& t,
- ::std::ostream* os) {
- PrintTupleTo(t, os);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8>
-void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8>& t,
- ::std::ostream* os) {
- PrintTupleTo(t, os);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9>
-void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>& t,
- ::std::ostream* os) {
- PrintTupleTo(t, os);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10>
-void PrintTo(
- const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>& t,
- ::std::ostream* os) {
- PrintTupleTo(t, os);
-}
-#endif // GTEST_HAS_TR1_TUPLE
-
-// Overload for std::pair.
-template <typename T1, typename T2>
-void PrintTo(const ::std::pair<T1, T2>& value, ::std::ostream* os) {
- *os << '(';
- // We cannot use UniversalPrint(value.first, os) here, as T1 may be
- // a reference type. The same for printing value.second.
- UniversalPrinter<T1>::Print(value.first, os);
- *os << ", ";
- UniversalPrinter<T2>::Print(value.second, os);
- *os << ')';
-}
-
-// Implements printing a non-reference type T by letting the compiler
-// pick the right overload of PrintTo() for T.
-template <typename T>
-class UniversalPrinter {
- public:
- // MSVC warns about adding const to a function type, so we want to
- // disable the warning.
-#ifdef _MSC_VER
-# pragma warning(push) // Saves the current warning state.
-# pragma warning(disable:4180) // Temporarily disables warning 4180.
-#endif // _MSC_VER
-
- // Note: we deliberately don't call this PrintTo(), as that name
- // conflicts with ::testing::internal::PrintTo in the body of the
- // function.
- static void Print(const T& value, ::std::ostream* os) {
- // By default, ::testing::internal::PrintTo() is used for printing
- // the value.
- //
- // Thanks to Koenig look-up, if T is a class and has its own
- // PrintTo() function defined in its namespace, that function will
- // be visible here. Since it is more specific than the generic ones
- // in ::testing::internal, it will be picked by the compiler in the
- // following statement - exactly what we want.
- PrintTo(value, os);
- }
-
-#ifdef _MSC_VER
-# pragma warning(pop) // Restores the warning state.
-#endif // _MSC_VER
-};
-
-// UniversalPrintArray(begin, len, os) prints an array of 'len'
-// elements, starting at address 'begin'.
-template <typename T>
-void UniversalPrintArray(const T* begin, size_t len, ::std::ostream* os) {
- if (len == 0) {
- *os << "{}";
- } else {
- *os << "{ ";
- const size_t kThreshold = 18;
- const size_t kChunkSize = 8;
- // If the array has more than kThreshold elements, we'll have to
- // omit some details by printing only the first and the last
- // kChunkSize elements.
- // TODO(wan@google.com): let the user control the threshold using a flag.
- if (len <= kThreshold) {
- PrintRawArrayTo(begin, len, os);
- } else {
- PrintRawArrayTo(begin, kChunkSize, os);
- *os << ", ..., ";
- PrintRawArrayTo(begin + len - kChunkSize, kChunkSize, os);
- }
- *os << " }";
- }
-}
-// This overload prints a (const) char array compactly.
-GTEST_API_ void UniversalPrintArray(const char* begin,
- size_t len,
- ::std::ostream* os);
-
-// Implements printing an array type T[N].
-template <typename T, size_t N>
-class UniversalPrinter<T[N]> {
- public:
- // Prints the given array, omitting some elements when there are too
- // many.
- static void Print(const T (&a)[N], ::std::ostream* os) {
- UniversalPrintArray(a, N, os);
- }
-};
-
-// Implements printing a reference type T&.
-template <typename T>
-class UniversalPrinter<T&> {
- public:
- // MSVC warns about adding const to a function type, so we want to
- // disable the warning.
-#ifdef _MSC_VER
-# pragma warning(push) // Saves the current warning state.
-# pragma warning(disable:4180) // Temporarily disables warning 4180.
-#endif // _MSC_VER
-
- static void Print(const T& value, ::std::ostream* os) {
- // Prints the address of the value. We use reinterpret_cast here
- // as static_cast doesn't compile when T is a function type.
- *os << "@" << reinterpret_cast<const void*>(&value) << " ";
-
- // Then prints the value itself.
- UniversalPrint(value, os);
- }
-
-#ifdef _MSC_VER
-# pragma warning(pop) // Restores the warning state.
-#endif // _MSC_VER
-};
-
-// Prints a value tersely: for a reference type, the referenced value
-// (but not the address) is printed; for a (const) char pointer, the
-// NUL-terminated string (but not the pointer) is printed.
-template <typename T>
-void UniversalTersePrint(const T& value, ::std::ostream* os) {
- UniversalPrint(value, os);
-}
-inline void UniversalTersePrint(const char* str, ::std::ostream* os) {
- if (str == NULL) {
- *os << "NULL";
- } else {
- UniversalPrint(string(str), os);
- }
-}
-inline void UniversalTersePrint(char* str, ::std::ostream* os) {
- UniversalTersePrint(static_cast<const char*>(str), os);
-}
-
-// Prints a value using the type inferred by the compiler. The
-// difference between this and UniversalTersePrint() is that for a
-// (const) char pointer, this prints both the pointer and the
-// NUL-terminated string.
-template <typename T>
-void UniversalPrint(const T& value, ::std::ostream* os) {
- // A workarond for the bug in VC++ 7.1 that prevents us from instantiating
- // UniversalPrinter with T directly.
- typedef T T1;
- UniversalPrinter<T1>::Print(value, os);
-}
-
-#if GTEST_HAS_TR1_TUPLE
-typedef ::std::vector<string> Strings;
-
-// This helper template allows PrintTo() for tuples and
-// UniversalTersePrintTupleFieldsToStrings() to be defined by
-// induction on the number of tuple fields. The idea is that
-// TuplePrefixPrinter<N>::PrintPrefixTo(t, os) prints the first N
-// fields in tuple t, and can be defined in terms of
-// TuplePrefixPrinter<N - 1>.
-
-// The inductive case.
-template <size_t N>
-struct TuplePrefixPrinter {
- // Prints the first N fields of a tuple.
- template <typename Tuple>
- static void PrintPrefixTo(const Tuple& t, ::std::ostream* os) {
- TuplePrefixPrinter<N - 1>::PrintPrefixTo(t, os);
- *os << ", ";
- UniversalPrinter<typename ::std::tr1::tuple_element<N - 1, Tuple>::type>
- ::Print(::std::tr1::get<N - 1>(t), os);
- }
-
- // Tersely prints the first N fields of a tuple to a string vector,
- // one element for each field.
- template <typename Tuple>
- static void TersePrintPrefixToStrings(const Tuple& t, Strings* strings) {
- TuplePrefixPrinter<N - 1>::TersePrintPrefixToStrings(t, strings);
- ::std::stringstream ss;
- UniversalTersePrint(::std::tr1::get<N - 1>(t), &ss);
- strings->push_back(ss.str());
- }
-};
-
-// Base cases.
-template <>
-struct TuplePrefixPrinter<0> {
- template <typename Tuple>
- static void PrintPrefixTo(const Tuple&, ::std::ostream*) {}
-
- template <typename Tuple>
- static void TersePrintPrefixToStrings(const Tuple&, Strings*) {}
-};
-// We have to specialize the entire TuplePrefixPrinter<> class
-// template here, even though the definition of
-// TersePrintPrefixToStrings() is the same as the generic version, as
-// Embarcadero (formerly CodeGear, formerly Borland) C++ doesn't
-// support specializing a method template of a class template.
-template <>
-struct TuplePrefixPrinter<1> {
- template <typename Tuple>
- static void PrintPrefixTo(const Tuple& t, ::std::ostream* os) {
- UniversalPrinter<typename ::std::tr1::tuple_element<0, Tuple>::type>::
- Print(::std::tr1::get<0>(t), os);
- }
-
- template <typename Tuple>
- static void TersePrintPrefixToStrings(const Tuple& t, Strings* strings) {
- ::std::stringstream ss;
- UniversalTersePrint(::std::tr1::get<0>(t), &ss);
- strings->push_back(ss.str());
- }
-};
-
-// Helper function for printing a tuple. T must be instantiated with
-// a tuple type.
-template <typename T>
-void PrintTupleTo(const T& t, ::std::ostream* os) {
- *os << "(";
- TuplePrefixPrinter< ::std::tr1::tuple_size<T>::value>::
- PrintPrefixTo(t, os);
- *os << ")";
-}
-
-// Prints the fields of a tuple tersely to a string vector, one
-// element for each field. See the comment before
-// UniversalTersePrint() for how we define "tersely".
-template <typename Tuple>
-Strings UniversalTersePrintTupleFieldsToStrings(const Tuple& value) {
- Strings result;
- TuplePrefixPrinter< ::std::tr1::tuple_size<Tuple>::value>::
- TersePrintPrefixToStrings(value, &result);
- return result;
-}
-#endif // GTEST_HAS_TR1_TUPLE
-
-} // namespace internal
-
-template <typename T>
-::std::string PrintToString(const T& value) {
- ::std::stringstream ss;
- internal::UniversalTersePrint(value, &ss);
- return ss.str();
-}
-
-} // namespace testing
-
-#endif // GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
diff --git a/src/testing/gtest/include/gtest/gtest-spi.h b/src/testing/gtest/include/gtest/gtest-spi.h
deleted file mode 100644
index f63fa9a1..00000000
--- a/src/testing/gtest/include/gtest/gtest-spi.h
+++ /dev/null
@@ -1,232 +0,0 @@
-// Copyright 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-//
-// Utilities for testing Google Test itself and code that uses Google Test
-// (e.g. frameworks built on top of Google Test).
-
-#ifndef GTEST_INCLUDE_GTEST_GTEST_SPI_H_
-#define GTEST_INCLUDE_GTEST_GTEST_SPI_H_
-
-#include "gtest/gtest.h"
-
-namespace testing {
-
-// This helper class can be used to mock out Google Test failure reporting
-// so that we can test Google Test or code that builds on Google Test.
-//
-// An object of this class appends a TestPartResult object to the
-// TestPartResultArray object given in the constructor whenever a Google Test
-// failure is reported. It can either intercept only failures that are
-// generated in the same thread that created this object or it can intercept
-// all generated failures. The scope of this mock object can be controlled with
-// the second argument to the two arguments constructor.
-class GTEST_API_ ScopedFakeTestPartResultReporter
- : public TestPartResultReporterInterface {
- public:
- // The two possible mocking modes of this object.
- enum InterceptMode {
- INTERCEPT_ONLY_CURRENT_THREAD, // Intercepts only thread local failures.
- INTERCEPT_ALL_THREADS // Intercepts all failures.
- };
-
- // The c'tor sets this object as the test part result reporter used
- // by Google Test. The 'result' parameter specifies where to report the
- // results. This reporter will only catch failures generated in the current
- // thread. DEPRECATED
- explicit ScopedFakeTestPartResultReporter(TestPartResultArray* result);
-
- // Same as above, but you can choose the interception scope of this object.
- ScopedFakeTestPartResultReporter(InterceptMode intercept_mode,
- TestPartResultArray* result);
-
- // The d'tor restores the previous test part result reporter.
- virtual ~ScopedFakeTestPartResultReporter();
-
- // Appends the TestPartResult object to the TestPartResultArray
- // received in the constructor.
- //
- // This method is from the TestPartResultReporterInterface
- // interface.
- virtual void ReportTestPartResult(const TestPartResult& result);
- private:
- void Init();
-
- const InterceptMode intercept_mode_;
- TestPartResultReporterInterface* old_reporter_;
- TestPartResultArray* const result_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(ScopedFakeTestPartResultReporter);
-};
-
-namespace internal {
-
-// A helper class for implementing EXPECT_FATAL_FAILURE() and
-// EXPECT_NONFATAL_FAILURE(). Its destructor verifies that the given
-// TestPartResultArray contains exactly one failure that has the given
-// type and contains the given substring. If that's not the case, a
-// non-fatal failure will be generated.
-class GTEST_API_ SingleFailureChecker {
- public:
- // The constructor remembers the arguments.
- SingleFailureChecker(const TestPartResultArray* results,
- TestPartResult::Type type,
- const string& substr);
- ~SingleFailureChecker();
- private:
- const TestPartResultArray* const results_;
- const TestPartResult::Type type_;
- const string substr_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(SingleFailureChecker);
-};
-
-} // namespace internal
-
-} // namespace testing
-
-// A set of macros for testing Google Test assertions or code that's expected
-// to generate Google Test fatal failures. It verifies that the given
-// statement will cause exactly one fatal Google Test failure with 'substr'
-// being part of the failure message.
-//
-// There are two different versions of this macro. EXPECT_FATAL_FAILURE only
-// affects and considers failures generated in the current thread and
-// EXPECT_FATAL_FAILURE_ON_ALL_THREADS does the same but for all threads.
-//
-// The verification of the assertion is done correctly even when the statement
-// throws an exception or aborts the current function.
-//
-// Known restrictions:
-// - 'statement' cannot reference local non-static variables or
-// non-static members of the current object.
-// - 'statement' cannot return a value.
-// - You cannot stream a failure message to this macro.
-//
-// Note that even though the implementations of the following two
-// macros are much alike, we cannot refactor them to use a common
-// helper macro, due to some peculiarity in how the preprocessor
-// works. The AcceptsMacroThatExpandsToUnprotectedComma test in
-// gtest_unittest.cc will fail to compile if we do that.
-#define EXPECT_FATAL_FAILURE(statement, substr) \
- do { \
- class GTestExpectFatalFailureHelper {\
- public:\
- static void Execute() { statement; }\
- };\
- ::testing::TestPartResultArray gtest_failures;\
- ::testing::internal::SingleFailureChecker gtest_checker(\
- &gtest_failures, ::testing::TestPartResult::kFatalFailure, (substr));\
- {\
- ::testing::ScopedFakeTestPartResultReporter gtest_reporter(\
- ::testing::ScopedFakeTestPartResultReporter:: \
- INTERCEPT_ONLY_CURRENT_THREAD, &gtest_failures);\
- GTestExpectFatalFailureHelper::Execute();\
- }\
- } while (::testing::internal::AlwaysFalse())
-
-#define EXPECT_FATAL_FAILURE_ON_ALL_THREADS(statement, substr) \
- do { \
- class GTestExpectFatalFailureHelper {\
- public:\
- static void Execute() { statement; }\
- };\
- ::testing::TestPartResultArray gtest_failures;\
- ::testing::internal::SingleFailureChecker gtest_checker(\
- &gtest_failures, ::testing::TestPartResult::kFatalFailure, (substr));\
- {\
- ::testing::ScopedFakeTestPartResultReporter gtest_reporter(\
- ::testing::ScopedFakeTestPartResultReporter:: \
- INTERCEPT_ALL_THREADS, &gtest_failures);\
- GTestExpectFatalFailureHelper::Execute();\
- }\
- } while (::testing::internal::AlwaysFalse())
-
-// A macro for testing Google Test assertions or code that's expected to
-// generate Google Test non-fatal failures. It asserts that the given
-// statement will cause exactly one non-fatal Google Test failure with 'substr'
-// being part of the failure message.
-//
-// There are two different versions of this macro. EXPECT_NONFATAL_FAILURE only
-// affects and considers failures generated in the current thread and
-// EXPECT_NONFATAL_FAILURE_ON_ALL_THREADS does the same but for all threads.
-//
-// 'statement' is allowed to reference local variables and members of
-// the current object.
-//
-// The verification of the assertion is done correctly even when the statement
-// throws an exception or aborts the current function.
-//
-// Known restrictions:
-// - You cannot stream a failure message to this macro.
-//
-// Note that even though the implementations of the following two
-// macros are much alike, we cannot refactor them to use a common
-// helper macro, due to some peculiarity in how the preprocessor
-// works. If we do that, the code won't compile when the user gives
-// EXPECT_NONFATAL_FAILURE() a statement that contains a macro that
-// expands to code containing an unprotected comma. The
-// AcceptsMacroThatExpandsToUnprotectedComma test in gtest_unittest.cc
-// catches that.
-//
-// For the same reason, we have to write
-// if (::testing::internal::AlwaysTrue()) { statement; }
-// instead of
-// GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement)
-// to avoid an MSVC warning on unreachable code.
-#define EXPECT_NONFATAL_FAILURE(statement, substr) \
- do {\
- ::testing::TestPartResultArray gtest_failures;\
- ::testing::internal::SingleFailureChecker gtest_checker(\
- &gtest_failures, ::testing::TestPartResult::kNonFatalFailure, \
- (substr));\
- {\
- ::testing::ScopedFakeTestPartResultReporter gtest_reporter(\
- ::testing::ScopedFakeTestPartResultReporter:: \
- INTERCEPT_ONLY_CURRENT_THREAD, &gtest_failures);\
- if (::testing::internal::AlwaysTrue()) { statement; }\
- }\
- } while (::testing::internal::AlwaysFalse())
-
-#define EXPECT_NONFATAL_FAILURE_ON_ALL_THREADS(statement, substr) \
- do {\
- ::testing::TestPartResultArray gtest_failures;\
- ::testing::internal::SingleFailureChecker gtest_checker(\
- &gtest_failures, ::testing::TestPartResult::kNonFatalFailure, \
- (substr));\
- {\
- ::testing::ScopedFakeTestPartResultReporter gtest_reporter(\
- ::testing::ScopedFakeTestPartResultReporter::INTERCEPT_ALL_THREADS, \
- &gtest_failures);\
- if (::testing::internal::AlwaysTrue()) { statement; }\
- }\
- } while (::testing::internal::AlwaysFalse())
-
-#endif // GTEST_INCLUDE_GTEST_GTEST_SPI_H_
diff --git a/src/testing/gtest/include/gtest/gtest-test-part.h b/src/testing/gtest/include/gtest/gtest-test-part.h
deleted file mode 100644
index 46151475..00000000
--- a/src/testing/gtest/include/gtest/gtest-test-part.h
+++ /dev/null
@@ -1,177 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: mheule@google.com (Markus Heule)
-//
-
-#ifndef GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
-#define GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
-
-#include <iosfwd>
-#include <vector>
-#include "gtest/internal/gtest-internal.h"
-#include "gtest/internal/gtest-string.h"
-
-namespace testing {
-
-// A copyable object representing the result of a test part (i.e. an
-// assertion or an explicit FAIL(), ADD_FAILURE(), or SUCCESS()).
-//
-// Don't inherit from TestPartResult as its destructor is not virtual.
-class GTEST_API_ TestPartResult {
- public:
- // The possible outcomes of a test part (i.e. an assertion or an
- // explicit SUCCEED(), FAIL(), or ADD_FAILURE()).
- enum Type {
- kSuccess, // Succeeded.
- kNonFatalFailure, // Failed but the test can continue.
- kFatalFailure // Failed and the test should be terminated.
- };
-
- // C'tor. TestPartResult does NOT have a default constructor.
- // Always use this constructor (with parameters) to create a
- // TestPartResult object.
- TestPartResult(Type a_type,
- const char* a_file_name,
- int a_line_number,
- const char* a_message)
- : type_(a_type),
- file_name_(a_file_name),
- line_number_(a_line_number),
- summary_(ExtractSummary(a_message)),
- message_(a_message) {
- }
-
- // Gets the outcome of the test part.
- Type type() const { return type_; }
-
- // Gets the name of the source file where the test part took place, or
- // NULL if it's unknown.
- const char* file_name() const { return file_name_.c_str(); }
-
- // Gets the line in the source file where the test part took place,
- // or -1 if it's unknown.
- int line_number() const { return line_number_; }
-
- // Gets the summary of the failure message.
- const char* summary() const { return summary_.c_str(); }
-
- // Gets the message associated with the test part.
- const char* message() const { return message_.c_str(); }
-
- // Returns true iff the test part passed.
- bool passed() const { return type_ == kSuccess; }
-
- // Returns true iff the test part failed.
- bool failed() const { return type_ != kSuccess; }
-
- // Returns true iff the test part non-fatally failed.
- bool nonfatally_failed() const { return type_ == kNonFatalFailure; }
-
- // Returns true iff the test part fatally failed.
- bool fatally_failed() const { return type_ == kFatalFailure; }
-
- private:
- Type type_;
-
- // Gets the summary of the failure message by omitting the stack
- // trace in it.
- static internal::String ExtractSummary(const char* message);
-
- // The name of the source file where the test part took place, or
- // NULL if the source file is unknown.
- internal::String file_name_;
- // The line in the source file where the test part took place, or -1
- // if the line number is unknown.
- int line_number_;
- internal::String summary_; // The test failure summary.
- internal::String message_; // The test failure message.
-};
-
-// Prints a TestPartResult object.
-std::ostream& operator<<(std::ostream& os, const TestPartResult& result);
-
-// An array of TestPartResult objects.
-//
-// Don't inherit from TestPartResultArray as its destructor is not
-// virtual.
-class GTEST_API_ TestPartResultArray {
- public:
- TestPartResultArray() {}
-
- // Appends the given TestPartResult to the array.
- void Append(const TestPartResult& result);
-
- // Returns the TestPartResult at the given index (0-based).
- const TestPartResult& GetTestPartResult(int index) const;
-
- // Returns the number of TestPartResult objects in the array.
- int size() const;
-
- private:
- std::vector<TestPartResult> array_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(TestPartResultArray);
-};
-
-// This interface knows how to report a test part result.
-class TestPartResultReporterInterface {
- public:
- virtual ~TestPartResultReporterInterface() {}
-
- virtual void ReportTestPartResult(const TestPartResult& result) = 0;
-};
-
-namespace internal {
-
-// This helper class is used by {ASSERT|EXPECT}_NO_FATAL_FAILURE to check if a
-// statement generates new fatal failures. To do so it registers itself as the
-// current test part result reporter. Besides checking if fatal failures were
-// reported, it only delegates the reporting to the former result reporter.
-// The original result reporter is restored in the destructor.
-// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
-class GTEST_API_ HasNewFatalFailureHelper
- : public TestPartResultReporterInterface {
- public:
- HasNewFatalFailureHelper();
- virtual ~HasNewFatalFailureHelper();
- virtual void ReportTestPartResult(const TestPartResult& result);
- bool has_new_fatal_failure() const { return has_new_fatal_failure_; }
- private:
- bool has_new_fatal_failure_;
- TestPartResultReporterInterface* original_reporter_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(HasNewFatalFailureHelper);
-};
-
-} // namespace internal
-
-} // namespace testing
-
-#endif // GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
diff --git a/src/testing/gtest/include/gtest/gtest-typed-test.h b/src/testing/gtest/include/gtest/gtest-typed-test.h
deleted file mode 100644
index fe1e83b2..00000000
--- a/src/testing/gtest/include/gtest/gtest-typed-test.h
+++ /dev/null
@@ -1,259 +0,0 @@
-// Copyright 2008 Google Inc.
-// All Rights Reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-#ifndef GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
-#define GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
-
-// This header implements typed tests and type-parameterized tests.
-
-// Typed (aka type-driven) tests repeat the same test for types in a
-// list. You must know which types you want to test with when writing
-// typed tests. Here's how you do it:
-
-#if 0
-
-// First, define a fixture class template. It should be parameterized
-// by a type. Remember to derive it from testing::Test.
-template <typename T>
-class FooTest : public testing::Test {
- public:
- ...
- typedef std::list<T> List;
- static T shared_;
- T value_;
-};
-
-// Next, associate a list of types with the test case, which will be
-// repeated for each type in the list. The typedef is necessary for
-// the macro to parse correctly.
-typedef testing::Types<char, int, unsigned int> MyTypes;
-TYPED_TEST_CASE(FooTest, MyTypes);
-
-// If the type list contains only one type, you can write that type
-// directly without Types<...>:
-// TYPED_TEST_CASE(FooTest, int);
-
-// Then, use TYPED_TEST() instead of TEST_F() to define as many typed
-// tests for this test case as you want.
-TYPED_TEST(FooTest, DoesBlah) {
- // Inside a test, refer to TypeParam to get the type parameter.
- // Since we are inside a derived class template, C++ requires use to
- // visit the members of FooTest via 'this'.
- TypeParam n = this->value_;
-
- // To visit static members of the fixture, add the TestFixture::
- // prefix.
- n += TestFixture::shared_;
-
- // To refer to typedefs in the fixture, add the "typename
- // TestFixture::" prefix.
- typename TestFixture::List values;
- values.push_back(n);
- ...
-}
-
-TYPED_TEST(FooTest, HasPropertyA) { ... }
-
-#endif // 0
-
-// Type-parameterized tests are abstract test patterns parameterized
-// by a type. Compared with typed tests, type-parameterized tests
-// allow you to define the test pattern without knowing what the type
-// parameters are. The defined pattern can be instantiated with
-// different types any number of times, in any number of translation
-// units.
-//
-// If you are designing an interface or concept, you can define a
-// suite of type-parameterized tests to verify properties that any
-// valid implementation of the interface/concept should have. Then,
-// each implementation can easily instantiate the test suite to verify
-// that it conforms to the requirements, without having to write
-// similar tests repeatedly. Here's an example:
-
-#if 0
-
-// First, define a fixture class template. It should be parameterized
-// by a type. Remember to derive it from testing::Test.
-template <typename T>
-class FooTest : public testing::Test {
- ...
-};
-
-// Next, declare that you will define a type-parameterized test case
-// (the _P suffix is for "parameterized" or "pattern", whichever you
-// prefer):
-TYPED_TEST_CASE_P(FooTest);
-
-// Then, use TYPED_TEST_P() to define as many type-parameterized tests
-// for this type-parameterized test case as you want.
-TYPED_TEST_P(FooTest, DoesBlah) {
- // Inside a test, refer to TypeParam to get the type parameter.
- TypeParam n = 0;
- ...
-}
-
-TYPED_TEST_P(FooTest, HasPropertyA) { ... }
-
-// Now the tricky part: you need to register all test patterns before
-// you can instantiate them. The first argument of the macro is the
-// test case name; the rest are the names of the tests in this test
-// case.
-REGISTER_TYPED_TEST_CASE_P(FooTest,
- DoesBlah, HasPropertyA);
-
-// Finally, you are free to instantiate the pattern with the types you
-// want. If you put the above code in a header file, you can #include
-// it in multiple C++ source files and instantiate it multiple times.
-//
-// To distinguish different instances of the pattern, the first
-// argument to the INSTANTIATE_* macro is a prefix that will be added
-// to the actual test case name. Remember to pick unique prefixes for
-// different instances.
-typedef testing::Types<char, int, unsigned int> MyTypes;
-INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, MyTypes);
-
-// If the type list contains only one type, you can write that type
-// directly without Types<...>:
-// INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, int);
-
-#endif // 0
-
-#include "gtest/internal/gtest-port.h"
-#include "gtest/internal/gtest-type-util.h"
-
-// Implements typed tests.
-
-#if GTEST_HAS_TYPED_TEST
-
-// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
-//
-// Expands to the name of the typedef for the type parameters of the
-// given test case.
-# define GTEST_TYPE_PARAMS_(TestCaseName) gtest_type_params_##TestCaseName##_
-
-// The 'Types' template argument below must have spaces around it
-// since some compilers may choke on '>>' when passing a template
-// instance (e.g. Types<int>)
-# define TYPED_TEST_CASE(CaseName, Types) \
- typedef ::testing::internal::TypeList< Types >::type \
- GTEST_TYPE_PARAMS_(CaseName)
-
-# define TYPED_TEST(CaseName, TestName) \
- template <typename gtest_TypeParam_> \
- class GTEST_TEST_CLASS_NAME_(CaseName, TestName) \
- : public CaseName<gtest_TypeParam_> { \
- private: \
- typedef CaseName<gtest_TypeParam_> TestFixture; \
- typedef gtest_TypeParam_ TypeParam; \
- virtual void TestBody(); \
- }; \
- bool gtest_##CaseName##_##TestName##_registered_ GTEST_ATTRIBUTE_UNUSED_ = \
- ::testing::internal::TypeParameterizedTest< \
- CaseName, \
- ::testing::internal::TemplateSel< \
- GTEST_TEST_CLASS_NAME_(CaseName, TestName)>, \
- GTEST_TYPE_PARAMS_(CaseName)>::Register(\
- "", #CaseName, #TestName, 0); \
- template <typename gtest_TypeParam_> \
- void GTEST_TEST_CLASS_NAME_(CaseName, TestName)<gtest_TypeParam_>::TestBody()
-
-#endif // GTEST_HAS_TYPED_TEST
-
-// Implements type-parameterized tests.
-
-#if GTEST_HAS_TYPED_TEST_P
-
-// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
-//
-// Expands to the namespace name that the type-parameterized tests for
-// the given type-parameterized test case are defined in. The exact
-// name of the namespace is subject to change without notice.
-# define GTEST_CASE_NAMESPACE_(TestCaseName) \
- gtest_case_##TestCaseName##_
-
-// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
-//
-// Expands to the name of the variable used to remember the names of
-// the defined tests in the given test case.
-# define GTEST_TYPED_TEST_CASE_P_STATE_(TestCaseName) \
- gtest_typed_test_case_p_state_##TestCaseName##_
-
-// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE DIRECTLY.
-//
-// Expands to the name of the variable used to remember the names of
-// the registered tests in the given test case.
-# define GTEST_REGISTERED_TEST_NAMES_(TestCaseName) \
- gtest_registered_test_names_##TestCaseName##_
-
-// The variables defined in the type-parameterized test macros are
-// static as typically these macros are used in a .h file that can be
-// #included in multiple translation units linked together.
-# define TYPED_TEST_CASE_P(CaseName) \
- static ::testing::internal::TypedTestCasePState \
- GTEST_TYPED_TEST_CASE_P_STATE_(CaseName)
-
-# define TYPED_TEST_P(CaseName, TestName) \
- namespace GTEST_CASE_NAMESPACE_(CaseName) { \
- template <typename gtest_TypeParam_> \
- class TestName : public CaseName<gtest_TypeParam_> { \
- private: \
- typedef CaseName<gtest_TypeParam_> TestFixture; \
- typedef gtest_TypeParam_ TypeParam; \
- virtual void TestBody(); \
- }; \
- static bool gtest_##TestName##_defined_ GTEST_ATTRIBUTE_UNUSED_ = \
- GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).AddTestName(\
- __FILE__, __LINE__, #CaseName, #TestName); \
- } \
- template <typename gtest_TypeParam_> \
- void GTEST_CASE_NAMESPACE_(CaseName)::TestName<gtest_TypeParam_>::TestBody()
-
-# define REGISTER_TYPED_TEST_CASE_P(CaseName, ...) \
- namespace GTEST_CASE_NAMESPACE_(CaseName) { \
- typedef ::testing::internal::Templates<__VA_ARGS__>::type gtest_AllTests_; \
- } \
- static const char* const GTEST_REGISTERED_TEST_NAMES_(CaseName) = \
- GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).VerifyRegisteredTestNames(\
- __FILE__, __LINE__, #__VA_ARGS__)
-
-// The 'Types' template argument below must have spaces around it
-// since some compilers may choke on '>>' when passing a template
-// instance (e.g. Types<int>)
-# define INSTANTIATE_TYPED_TEST_CASE_P(Prefix, CaseName, Types) \
- bool gtest_##Prefix##_##CaseName GTEST_ATTRIBUTE_UNUSED_ = \
- ::testing::internal::TypeParameterizedTestCase<CaseName, \
- GTEST_CASE_NAMESPACE_(CaseName)::gtest_AllTests_, \
- ::testing::internal::TypeList< Types >::type>::Register(\
- #Prefix, #CaseName, GTEST_REGISTERED_TEST_NAMES_(CaseName))
-
-#endif // GTEST_HAS_TYPED_TEST_P
-
-#endif // GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
diff --git a/src/testing/gtest/include/gtest/gtest.h b/src/testing/gtest/include/gtest/gtest.h
deleted file mode 100644
index 226307ec..00000000
--- a/src/testing/gtest/include/gtest/gtest.h
+++ /dev/null
@@ -1,2159 +0,0 @@
-// Copyright 2005, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-//
-// The Google C++ Testing Framework (Google Test)
-//
-// This header file defines the public API for Google Test. It should be
-// included by any test program that uses Google Test.
-//
-// IMPORTANT NOTE: Due to limitation of the C++ language, we have to
-// leave some internal implementation details in this header file.
-// They are clearly marked by comments like this:
-//
-// // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
-//
-// Such code is NOT meant to be used by a user directly, and is subject
-// to CHANGE WITHOUT NOTICE. Therefore DO NOT DEPEND ON IT in a user
-// program!
-//
-// Acknowledgment: Google Test borrowed the idea of automatic test
-// registration from Barthelemy Dagenais' (barthelemy@prologique.com)
-// easyUnit framework.
-
-#ifndef GTEST_INCLUDE_GTEST_GTEST_H_
-#define GTEST_INCLUDE_GTEST_GTEST_H_
-
-#include <limits>
-#include <ostream>
-#include <vector>
-
-#include "gtest/internal/gtest-internal.h"
-#include "gtest/internal/gtest-string.h"
-#include "gtest/gtest-death-test.h"
-#include "gtest/gtest-message.h"
-#include "gtest/gtest-param-test.h"
-#include "gtest/gtest-printers.h"
-#include "gtest/gtest_prod.h"
-#include "gtest/gtest-test-part.h"
-#include "gtest/gtest-typed-test.h"
-
-// Depending on the platform, different string classes are available.
-// On Linux, in addition to ::std::string, Google also makes use of
-// class ::string, which has the same interface as ::std::string, but
-// has a different implementation.
-//
-// The user can define GTEST_HAS_GLOBAL_STRING to 1 to indicate that
-// ::string is available AND is a distinct type to ::std::string, or
-// define it to 0 to indicate otherwise.
-//
-// If the user's ::std::string and ::string are the same class due to
-// aliasing, he should define GTEST_HAS_GLOBAL_STRING to 0.
-//
-// If the user doesn't define GTEST_HAS_GLOBAL_STRING, it is defined
-// heuristically.
-
-namespace testing {
-
-// Declares the flags.
-
-// This flag temporary enables the disabled tests.
-GTEST_DECLARE_bool_(also_run_disabled_tests);
-
-// This flag brings the debugger on an assertion failure.
-GTEST_DECLARE_bool_(break_on_failure);
-
-// This flag controls whether Google Test catches all test-thrown exceptions
-// and logs them as failures.
-GTEST_DECLARE_bool_(catch_exceptions);
-
-// This flag enables using colors in terminal output. Available values are
-// "yes" to enable colors, "no" (disable colors), or "auto" (the default)
-// to let Google Test decide.
-GTEST_DECLARE_string_(color);
-
-// This flag sets up the filter to select by name using a glob pattern
-// the tests to run. If the filter is not given all tests are executed.
-GTEST_DECLARE_string_(filter);
-
-// This flag causes the Google Test to list tests. None of the tests listed
-// are actually run if the flag is provided.
-GTEST_DECLARE_bool_(list_tests);
-
-// This flag controls whether Google Test emits a detailed XML report to a file
-// in addition to its normal textual output.
-GTEST_DECLARE_string_(output);
-
-// This flags control whether Google Test prints the elapsed time for each
-// test.
-GTEST_DECLARE_bool_(print_time);
-
-// This flag specifies the random number seed.
-GTEST_DECLARE_int32_(random_seed);
-
-// This flag sets how many times the tests are repeated. The default value
-// is 1. If the value is -1 the tests are repeating forever.
-GTEST_DECLARE_int32_(repeat);
-
-// This flag controls whether Google Test includes Google Test internal
-// stack frames in failure stack traces.
-GTEST_DECLARE_bool_(show_internal_stack_frames);
-
-// When this flag is specified, tests' order is randomized on every iteration.
-GTEST_DECLARE_bool_(shuffle);
-
-// This flag specifies the maximum number of stack frames to be
-// printed in a failure message.
-GTEST_DECLARE_int32_(stack_trace_depth);
-
-// When this flag is specified, a failed assertion will throw an
-// exception if exceptions are enabled, or exit the program with a
-// non-zero code otherwise.
-GTEST_DECLARE_bool_(throw_on_failure);
-
-// When this flag is set with a "host:port" string, on supported
-// platforms test results are streamed to the specified port on
-// the specified host machine.
-GTEST_DECLARE_string_(stream_result_to);
-
-// The upper limit for valid stack trace depths.
-const int kMaxStackTraceDepth = 100;
-
-namespace internal {
-
-class AssertHelper;
-class DefaultGlobalTestPartResultReporter;
-class ExecDeathTest;
-class NoExecDeathTest;
-class FinalSuccessChecker;
-class GTestFlagSaver;
-class TestResultAccessor;
-class TestEventListenersAccessor;
-class TestEventRepeater;
-class WindowsDeathTest;
-class UnitTestImpl* GetUnitTestImpl();
-void ReportFailureInUnknownLocation(TestPartResult::Type result_type,
- const String& message);
-
-// Converts a streamable value to a String. A NULL pointer is
-// converted to "(null)". When the input value is a ::string,
-// ::std::string, ::wstring, or ::std::wstring object, each NUL
-// character in it is replaced with "\\0".
-// Declared in gtest-internal.h but defined here, so that it has access
-// to the definition of the Message class, required by the ARM
-// compiler.
-template <typename T>
-String StreamableToString(const T& streamable) {
- return (Message() << streamable).GetString();
-}
-
-} // namespace internal
-
-// The friend relationship of some of these classes is cyclic.
-// If we don't forward declare them the compiler might confuse the classes
-// in friendship clauses with same named classes on the scope.
-class Test;
-class TestCase;
-class TestInfo;
-class UnitTest;
-
-// A class for indicating whether an assertion was successful. When
-// the assertion wasn't successful, the AssertionResult object
-// remembers a non-empty message that describes how it failed.
-//
-// To create an instance of this class, use one of the factory functions
-// (AssertionSuccess() and AssertionFailure()).
-//
-// This class is useful for two purposes:
-// 1. Defining predicate functions to be used with Boolean test assertions
-// EXPECT_TRUE/EXPECT_FALSE and their ASSERT_ counterparts
-// 2. Defining predicate-format functions to be
-// used with predicate assertions (ASSERT_PRED_FORMAT*, etc).
-//
-// For example, if you define IsEven predicate:
-//
-// testing::AssertionResult IsEven(int n) {
-// if ((n % 2) == 0)
-// return testing::AssertionSuccess();
-// else
-// return testing::AssertionFailure() << n << " is odd";
-// }
-//
-// Then the failed expectation EXPECT_TRUE(IsEven(Fib(5)))
-// will print the message
-//
-// Value of: IsEven(Fib(5))
-// Actual: false (5 is odd)
-// Expected: true
-//
-// instead of a more opaque
-//
-// Value of: IsEven(Fib(5))
-// Actual: false
-// Expected: true
-//
-// in case IsEven is a simple Boolean predicate.
-//
-// If you expect your predicate to be reused and want to support informative
-// messages in EXPECT_FALSE and ASSERT_FALSE (negative assertions show up
-// about half as often as positive ones in our tests), supply messages for
-// both success and failure cases:
-//
-// testing::AssertionResult IsEven(int n) {
-// if ((n % 2) == 0)
-// return testing::AssertionSuccess() << n << " is even";
-// else
-// return testing::AssertionFailure() << n << " is odd";
-// }
-//
-// Then a statement EXPECT_FALSE(IsEven(Fib(6))) will print
-//
-// Value of: IsEven(Fib(6))
-// Actual: true (8 is even)
-// Expected: false
-//
-// NB: Predicates that support negative Boolean assertions have reduced
-// performance in positive ones so be careful not to use them in tests
-// that have lots (tens of thousands) of positive Boolean assertions.
-//
-// To use this class with EXPECT_PRED_FORMAT assertions such as:
-//
-// // Verifies that Foo() returns an even number.
-// EXPECT_PRED_FORMAT1(IsEven, Foo());
-//
-// you need to define:
-//
-// testing::AssertionResult IsEven(const char* expr, int n) {
-// if ((n % 2) == 0)
-// return testing::AssertionSuccess();
-// else
-// return testing::AssertionFailure()
-// << "Expected: " << expr << " is even\n Actual: it's " << n;
-// }
-//
-// If Foo() returns 5, you will see the following message:
-//
-// Expected: Foo() is even
-// Actual: it's 5
-//
-class GTEST_API_ AssertionResult {
- public:
- // Copy constructor.
- // Used in EXPECT_TRUE/FALSE(assertion_result).
- AssertionResult(const AssertionResult& other);
- // Used in the EXPECT_TRUE/FALSE(bool_expression).
- explicit AssertionResult(bool success) : success_(success) {}
-
- // Returns true iff the assertion succeeded.
- operator bool() const { return success_; } // NOLINT
-
- // Returns the assertion's negation. Used with EXPECT/ASSERT_FALSE.
- AssertionResult operator!() const;
-
- // Returns the text streamed into this AssertionResult. Test assertions
- // use it when they fail (i.e., the predicate's outcome doesn't match the
- // assertion's expectation). When nothing has been streamed into the
- // object, returns an empty string.
- const char* message() const {
- return message_.get() != NULL ? message_->c_str() : "";
- }
- // TODO(vladl@google.com): Remove this after making sure no clients use it.
- // Deprecated; please use message() instead.
- const char* failure_message() const { return message(); }
-
- // Streams a custom failure message into this object.
- template <typename T> AssertionResult& operator<<(const T& value) {
- AppendMessage(Message() << value);
- return *this;
- }
-
- // Allows streaming basic output manipulators such as endl or flush into
- // this object.
- AssertionResult& operator<<(
- ::std::ostream& (*basic_manipulator)(::std::ostream& stream)) {
- AppendMessage(Message() << basic_manipulator);
- return *this;
- }
-
- private:
- // Appends the contents of message to message_.
- void AppendMessage(const Message& a_message) {
- if (message_.get() == NULL)
- message_.reset(new ::std::string);
- message_->append(a_message.GetString().c_str());
- }
-
- // Stores result of the assertion predicate.
- bool success_;
- // Stores the message describing the condition in case the expectation
- // construct is not satisfied with the predicate's outcome.
- // Referenced via a pointer to avoid taking too much stack frame space
- // with test assertions.
- internal::scoped_ptr< ::std::string> message_;
-
- GTEST_DISALLOW_ASSIGN_(AssertionResult);
-};
-
-// Makes a successful assertion result.
-GTEST_API_ AssertionResult AssertionSuccess();
-
-// Makes a failed assertion result.
-GTEST_API_ AssertionResult AssertionFailure();
-
-// Makes a failed assertion result with the given failure message.
-// Deprecated; use AssertionFailure() << msg.
-GTEST_API_ AssertionResult AssertionFailure(const Message& msg);
-
-// The abstract class that all tests inherit from.
-//
-// In Google Test, a unit test program contains one or many TestCases, and
-// each TestCase contains one or many Tests.
-//
-// When you define a test using the TEST macro, you don't need to
-// explicitly derive from Test - the TEST macro automatically does
-// this for you.
-//
-// The only time you derive from Test is when defining a test fixture
-// to be used a TEST_F. For example:
-//
-// class FooTest : public testing::Test {
-// protected:
-// virtual void SetUp() { ... }
-// virtual void TearDown() { ... }
-// ...
-// };
-//
-// TEST_F(FooTest, Bar) { ... }
-// TEST_F(FooTest, Baz) { ... }
-//
-// Test is not copyable.
-class GTEST_API_ Test {
- public:
- friend class TestInfo;
-
- // Defines types for pointers to functions that set up and tear down
- // a test case.
- typedef internal::SetUpTestCaseFunc SetUpTestCaseFunc;
- typedef internal::TearDownTestCaseFunc TearDownTestCaseFunc;
-
- // The d'tor is virtual as we intend to inherit from Test.
- virtual ~Test();
-
- // Sets up the stuff shared by all tests in this test case.
- //
- // Google Test will call Foo::SetUpTestCase() before running the first
- // test in test case Foo. Hence a sub-class can define its own
- // SetUpTestCase() method to shadow the one defined in the super
- // class.
- static void SetUpTestCase() {}
-
- // Tears down the stuff shared by all tests in this test case.
- //
- // Google Test will call Foo::TearDownTestCase() after running the last
- // test in test case Foo. Hence a sub-class can define its own
- // TearDownTestCase() method to shadow the one defined in the super
- // class.
- static void TearDownTestCase() {}
-
- // Returns true iff the current test has a fatal failure.
- static bool HasFatalFailure();
-
- // Returns true iff the current test has a non-fatal failure.
- static bool HasNonfatalFailure();
-
- // Returns true iff the current test has a (either fatal or
- // non-fatal) failure.
- static bool HasFailure() { return HasFatalFailure() || HasNonfatalFailure(); }
-
- // Logs a property for the current test. Only the last value for a given
- // key is remembered.
- // These are public static so they can be called from utility functions
- // that are not members of the test fixture.
- // The arguments are const char* instead strings, as Google Test is used
- // on platforms where string doesn't compile.
- //
- // Note that a driving consideration for these RecordProperty methods
- // was to produce xml output suited to the Greenspan charting utility,
- // which at present will only chart values that fit in a 32-bit int. It
- // is the user's responsibility to restrict their values to 32-bit ints
- // if they intend them to be used with Greenspan.
- static void RecordProperty(const char* key, const char* value);
- static void RecordProperty(const char* key, int value);
-
- protected:
- // Creates a Test object.
- Test();
-
- // Sets up the test fixture.
- virtual void SetUp();
-
- // Tears down the test fixture.
- virtual void TearDown();
-
- private:
- // Returns true iff the current test has the same fixture class as
- // the first test in the current test case.
- static bool HasSameFixtureClass();
-
- // Runs the test after the test fixture has been set up.
- //
- // A sub-class must implement this to define the test logic.
- //
- // DO NOT OVERRIDE THIS FUNCTION DIRECTLY IN A USER PROGRAM.
- // Instead, use the TEST or TEST_F macro.
- virtual void TestBody() = 0;
-
- // Sets up, executes, and tears down the test.
- void Run();
-
- // Deletes self. We deliberately pick an unusual name for this
- // internal method to avoid clashing with names used in user TESTs.
- void DeleteSelf_() { delete this; }
-
- // Uses a GTestFlagSaver to save and restore all Google Test flags.
- const internal::GTestFlagSaver* const gtest_flag_saver_;
-
- // Often a user mis-spells SetUp() as Setup() and spends a long time
- // wondering why it is never called by Google Test. The declaration of
- // the following method is solely for catching such an error at
- // compile time:
- //
- // - The return type is deliberately chosen to be not void, so it
- // will be a conflict if a user declares void Setup() in his test
- // fixture.
- //
- // - This method is private, so it will be another compiler error
- // if a user calls it from his test fixture.
- //
- // DO NOT OVERRIDE THIS FUNCTION.
- //
- // If you see an error about overriding the following function or
- // about it being private, you have mis-spelled SetUp() as Setup().
- struct Setup_should_be_spelled_SetUp {};
- virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; }
-
- // We disallow copying Tests.
- GTEST_DISALLOW_COPY_AND_ASSIGN_(Test);
-};
-
-typedef internal::TimeInMillis TimeInMillis;
-
-// A copyable object representing a user specified test property which can be
-// output as a key/value string pair.
-//
-// Don't inherit from TestProperty as its destructor is not virtual.
-class TestProperty {
- public:
- // C'tor. TestProperty does NOT have a default constructor.
- // Always use this constructor (with parameters) to create a
- // TestProperty object.
- TestProperty(const char* a_key, const char* a_value) :
- key_(a_key), value_(a_value) {
- }
-
- // Gets the user supplied key.
- const char* key() const {
- return key_.c_str();
- }
-
- // Gets the user supplied value.
- const char* value() const {
- return value_.c_str();
- }
-
- // Sets a new value, overriding the one supplied in the constructor.
- void SetValue(const char* new_value) {
- value_ = new_value;
- }
-
- private:
- // The key supplied by the user.
- internal::String key_;
- // The value supplied by the user.
- internal::String value_;
-};
-
-// The result of a single Test. This includes a list of
-// TestPartResults, a list of TestProperties, a count of how many
-// death tests there are in the Test, and how much time it took to run
-// the Test.
-//
-// TestResult is not copyable.
-class GTEST_API_ TestResult {
- public:
- // Creates an empty TestResult.
- TestResult();
-
- // D'tor. Do not inherit from TestResult.
- ~TestResult();
-
- // Gets the number of all test parts. This is the sum of the number
- // of successful test parts and the number of failed test parts.
- int total_part_count() const;
-
- // Returns the number of the test properties.
- int test_property_count() const;
-
- // Returns true iff the test passed (i.e. no test part failed).
- bool Passed() const { return !Failed(); }
-
- // Returns true iff the test failed.
- bool Failed() const;
-
- // Returns true iff the test fatally failed.
- bool HasFatalFailure() const;
-
- // Returns true iff the test has a non-fatal failure.
- bool HasNonfatalFailure() const;
-
- // Returns the elapsed time, in milliseconds.
- TimeInMillis elapsed_time() const { return elapsed_time_; }
-
- // Returns the i-th test part result among all the results. i can range
- // from 0 to test_property_count() - 1. If i is not in that range, aborts
- // the program.
- const TestPartResult& GetTestPartResult(int i) const;
-
- // Returns the i-th test property. i can range from 0 to
- // test_property_count() - 1. If i is not in that range, aborts the
- // program.
- const TestProperty& GetTestProperty(int i) const;
-
- private:
- friend class TestInfo;
- friend class UnitTest;
- friend class internal::DefaultGlobalTestPartResultReporter;
- friend class internal::ExecDeathTest;
- friend class internal::TestResultAccessor;
- friend class internal::UnitTestImpl;
- friend class internal::WindowsDeathTest;
-
- // Gets the vector of TestPartResults.
- const std::vector<TestPartResult>& test_part_results() const {
- return test_part_results_;
- }
-
- // Gets the vector of TestProperties.
- const std::vector<TestProperty>& test_properties() const {
- return test_properties_;
- }
-
- // Sets the elapsed time.
- void set_elapsed_time(TimeInMillis elapsed) { elapsed_time_ = elapsed; }
-
- // Adds a test property to the list. The property is validated and may add
- // a non-fatal failure if invalid (e.g., if it conflicts with reserved
- // key names). If a property is already recorded for the same key, the
- // value will be updated, rather than storing multiple values for the same
- // key.
- void RecordProperty(const TestProperty& test_property);
-
- // Adds a failure if the key is a reserved attribute of Google Test
- // testcase tags. Returns true if the property is valid.
- // TODO(russr): Validate attribute names are legal and human readable.
- static bool ValidateTestProperty(const TestProperty& test_property);
-
- // Adds a test part result to the list.
- void AddTestPartResult(const TestPartResult& test_part_result);
-
- // Returns the death test count.
- int death_test_count() const { return death_test_count_; }
-
- // Increments the death test count, returning the new count.
- int increment_death_test_count() { return ++death_test_count_; }
-
- // Clears the test part results.
- void ClearTestPartResults();
-
- // Clears the object.
- void Clear();
-
- // Protects mutable state of the property vector and of owned
- // properties, whose values may be updated.
- internal::Mutex test_properites_mutex_;
-
- // The vector of TestPartResults
- std::vector<TestPartResult> test_part_results_;
- // The vector of TestProperties
- std::vector<TestProperty> test_properties_;
- // Running count of death tests.
- int death_test_count_;
- // The elapsed time, in milliseconds.
- TimeInMillis elapsed_time_;
-
- // We disallow copying TestResult.
- GTEST_DISALLOW_COPY_AND_ASSIGN_(TestResult);
-}; // class TestResult
-
-// A TestInfo object stores the following information about a test:
-//
-// Test case name
-// Test name
-// Whether the test should be run
-// A function pointer that creates the test object when invoked
-// Test result
-//
-// The constructor of TestInfo registers itself with the UnitTest
-// singleton such that the RUN_ALL_TESTS() macro knows which tests to
-// run.
-class GTEST_API_ TestInfo {
- public:
- // Destructs a TestInfo object. This function is not virtual, so
- // don't inherit from TestInfo.
- ~TestInfo();
-
- // Returns the test case name.
- const char* test_case_name() const { return test_case_name_.c_str(); }
-
- // Returns the test name.
- const char* name() const { return name_.c_str(); }
-
- // Returns the name of the parameter type, or NULL if this is not a typed
- // or a type-parameterized test.
- const char* type_param() const {
- if (type_param_.get() != NULL)
- return type_param_->c_str();
- return NULL;
- }
-
- // Returns the text representation of the value parameter, or NULL if this
- // is not a value-parameterized test.
- const char* value_param() const {
- if (value_param_.get() != NULL)
- return value_param_->c_str();
- return NULL;
- }
-
- // Returns true if this test should run, that is if the test is not disabled
- // (or it is disabled but the also_run_disabled_tests flag has been specified)
- // and its full name matches the user-specified filter.
- //
- // Google Test allows the user to filter the tests by their full names.
- // The full name of a test Bar in test case Foo is defined as
- // "Foo.Bar". Only the tests that match the filter will run.
- //
- // A filter is a colon-separated list of glob (not regex) patterns,
- // optionally followed by a '-' and a colon-separated list of
- // negative patterns (tests to exclude). A test is run if it
- // matches one of the positive patterns and does not match any of
- // the negative patterns.
- //
- // For example, *A*:Foo.* is a filter that matches any string that
- // contains the character 'A' or starts with "Foo.".
- bool should_run() const { return should_run_; }
-
- // Returns the result of the test.
- const TestResult* result() const { return &result_; }
-
- private:
-#if GTEST_HAS_DEATH_TEST
- friend class internal::DefaultDeathTestFactory;
-#endif // GTEST_HAS_DEATH_TEST
- friend class Test;
- friend class TestCase;
- friend class internal::UnitTestImpl;
- friend TestInfo* internal::MakeAndRegisterTestInfo(
- const char* test_case_name, const char* name,
- const char* type_param,
- const char* value_param,
- internal::TypeId fixture_class_id,
- Test::SetUpTestCaseFunc set_up_tc,
- Test::TearDownTestCaseFunc tear_down_tc,
- internal::TestFactoryBase* factory);
-
- // Constructs a TestInfo object. The newly constructed instance assumes
- // ownership of the factory object.
- TestInfo(const char* test_case_name, const char* name,
- const char* a_type_param,
- const char* a_value_param,
- internal::TypeId fixture_class_id,
- internal::TestFactoryBase* factory);
-
- // Increments the number of death tests encountered in this test so
- // far.
- int increment_death_test_count() {
- return result_.increment_death_test_count();
- }
-
- // Creates the test object, runs it, records its result, and then
- // deletes it.
- void Run();
-
- static void ClearTestResult(TestInfo* test_info) {
- test_info->result_.Clear();
- }
-
- // These fields are immutable properties of the test.
- const std::string test_case_name_; // Test case name
- const std::string name_; // Test name
- // Name of the parameter type, or NULL if this is not a typed or a
- // type-parameterized test.
- const internal::scoped_ptr<const ::std::string> type_param_;
- // Text representation of the value parameter, or NULL if this is not a
- // value-parameterized test.
- const internal::scoped_ptr<const ::std::string> value_param_;
- const internal::TypeId fixture_class_id_; // ID of the test fixture class
- bool should_run_; // True iff this test should run
- bool is_disabled_; // True iff this test is disabled
- bool matches_filter_; // True if this test matches the
- // user-specified filter.
- internal::TestFactoryBase* const factory_; // The factory that creates
- // the test object
-
- // This field is mutable and needs to be reset before running the
- // test for the second time.
- TestResult result_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(TestInfo);
-};
-
-// A test case, which consists of a vector of TestInfos.
-//
-// TestCase is not copyable.
-class GTEST_API_ TestCase {
- public:
- // Creates a TestCase with the given name.
- //
- // TestCase does NOT have a default constructor. Always use this
- // constructor to create a TestCase object.
- //
- // Arguments:
- //
- // name: name of the test case
- // a_type_param: the name of the test's type parameter, or NULL if
- // this is not a type-parameterized test.
- // set_up_tc: pointer to the function that sets up the test case
- // tear_down_tc: pointer to the function that tears down the test case
- TestCase(const char* name, const char* a_type_param,
- Test::SetUpTestCaseFunc set_up_tc,
- Test::TearDownTestCaseFunc tear_down_tc);
-
- // Destructor of TestCase.
- virtual ~TestCase();
-
- // Gets the name of the TestCase.
- const char* name() const { return name_.c_str(); }
-
- // Returns the name of the parameter type, or NULL if this is not a
- // type-parameterized test case.
- const char* type_param() const {
- if (type_param_.get() != NULL)
- return type_param_->c_str();
- return NULL;
- }
-
- // Returns true if any test in this test case should run.
- bool should_run() const { return should_run_; }
-
- // Gets the number of successful tests in this test case.
- int successful_test_count() const;
-
- // Gets the number of failed tests in this test case.
- int failed_test_count() const;
-
- // Gets the number of disabled tests in this test case.
- int disabled_test_count() const;
-
- // Get the number of tests in this test case that should run.
- int test_to_run_count() const;
-
- // Gets the number of all tests in this test case.
- int total_test_count() const;
-
- // Returns true iff the test case passed.
- bool Passed() const { return !Failed(); }
-
- // Returns true iff the test case failed.
- bool Failed() const { return failed_test_count() > 0; }
-
- // Returns the elapsed time, in milliseconds.
- TimeInMillis elapsed_time() const { return elapsed_time_; }
-
- // Returns the i-th test among all the tests. i can range from 0 to
- // total_test_count() - 1. If i is not in that range, returns NULL.
- const TestInfo* GetTestInfo(int i) const;
-
- private:
- friend class Test;
- friend class internal::UnitTestImpl;
-
- // Gets the (mutable) vector of TestInfos in this TestCase.
- std::vector<TestInfo*>& test_info_list() { return test_info_list_; }
-
- // Gets the (immutable) vector of TestInfos in this TestCase.
- const std::vector<TestInfo*>& test_info_list() const {
- return test_info_list_;
- }
-
- // Returns the i-th test among all the tests. i can range from 0 to
- // total_test_count() - 1. If i is not in that range, returns NULL.
- TestInfo* GetMutableTestInfo(int i);
-
- // Sets the should_run member.
- void set_should_run(bool should) { should_run_ = should; }
-
- // Adds a TestInfo to this test case. Will delete the TestInfo upon
- // destruction of the TestCase object.
- void AddTestInfo(TestInfo * test_info);
-
- // Clears the results of all tests in this test case.
- void ClearResult();
-
- // Clears the results of all tests in the given test case.
- static void ClearTestCaseResult(TestCase* test_case) {
- test_case->ClearResult();
- }
-
- // Runs every test in this TestCase.
- void Run();
-
- // Runs SetUpTestCase() for this TestCase. This wrapper is needed
- // for catching exceptions thrown from SetUpTestCase().
- void RunSetUpTestCase() { (*set_up_tc_)(); }
-
- // Runs TearDownTestCase() for this TestCase. This wrapper is
- // needed for catching exceptions thrown from TearDownTestCase().
- void RunTearDownTestCase() { (*tear_down_tc_)(); }
-
- // Returns true iff test passed.
- static bool TestPassed(const TestInfo* test_info) {
- return test_info->should_run() && test_info->result()->Passed();
- }
-
- // Returns true iff test failed.
- static bool TestFailed(const TestInfo* test_info) {
- return test_info->should_run() && test_info->result()->Failed();
- }
-
- // Returns true iff test is disabled.
- static bool TestDisabled(const TestInfo* test_info) {
- return test_info->is_disabled_;
- }
-
- // Returns true if the given test should run.
- static bool ShouldRunTest(const TestInfo* test_info) {
- return test_info->should_run();
- }
-
- // Shuffles the tests in this test case.
- void ShuffleTests(internal::Random* random);
-
- // Restores the test order to before the first shuffle.
- void UnshuffleTests();
-
- // Name of the test case.
- internal::String name_;
- // Name of the parameter type, or NULL if this is not a typed or a
- // type-parameterized test.
- const internal::scoped_ptr<const ::std::string> type_param_;
- // The vector of TestInfos in their original order. It owns the
- // elements in the vector.
- std::vector<TestInfo*> test_info_list_;
- // Provides a level of indirection for the test list to allow easy
- // shuffling and restoring the test order. The i-th element in this
- // vector is the index of the i-th test in the shuffled test list.
- std::vector<int> test_indices_;
- // Pointer to the function that sets up the test case.
- Test::SetUpTestCaseFunc set_up_tc_;
- // Pointer to the function that tears down the test case.
- Test::TearDownTestCaseFunc tear_down_tc_;
- // True iff any test in this test case should run.
- bool should_run_;
- // Elapsed time, in milliseconds.
- TimeInMillis elapsed_time_;
-
- // We disallow copying TestCases.
- GTEST_DISALLOW_COPY_AND_ASSIGN_(TestCase);
-};
-
-// An Environment object is capable of setting up and tearing down an
-// environment. The user should subclass this to define his own
-// environment(s).
-//
-// An Environment object does the set-up and tear-down in virtual
-// methods SetUp() and TearDown() instead of the constructor and the
-// destructor, as:
-//
-// 1. You cannot safely throw from a destructor. This is a problem
-// as in some cases Google Test is used where exceptions are enabled, and
-// we may want to implement ASSERT_* using exceptions where they are
-// available.
-// 2. You cannot use ASSERT_* directly in a constructor or
-// destructor.
-class Environment {
- public:
- // The d'tor is virtual as we need to subclass Environment.
- virtual ~Environment() {}
-
- // Override this to define how to set up the environment.
- virtual void SetUp() {}
-
- // Override this to define how to tear down the environment.
- virtual void TearDown() {}
- private:
- // If you see an error about overriding the following function or
- // about it being private, you have mis-spelled SetUp() as Setup().
- struct Setup_should_be_spelled_SetUp {};
- virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; }
-};
-
-// The interface for tracing execution of tests. The methods are organized in
-// the order the corresponding events are fired.
-class TestEventListener {
- public:
- virtual ~TestEventListener() {}
-
- // Fired before any test activity starts.
- virtual void OnTestProgramStart(const UnitTest& unit_test) = 0;
-
- // Fired before each iteration of tests starts. There may be more than
- // one iteration if GTEST_FLAG(repeat) is set. iteration is the iteration
- // index, starting from 0.
- virtual void OnTestIterationStart(const UnitTest& unit_test,
- int iteration) = 0;
-
- // Fired before environment set-up for each iteration of tests starts.
- virtual void OnEnvironmentsSetUpStart(const UnitTest& unit_test) = 0;
-
- // Fired after environment set-up for each iteration of tests ends.
- virtual void OnEnvironmentsSetUpEnd(const UnitTest& unit_test) = 0;
-
- // Fired before the test case starts.
- virtual void OnTestCaseStart(const TestCase& test_case) = 0;
-
- // Fired before the test starts.
- virtual void OnTestStart(const TestInfo& test_info) = 0;
-
- // Fired after a failed assertion or a SUCCEED() invocation.
- virtual void OnTestPartResult(const TestPartResult& test_part_result) = 0;
-
- // Fired after the test ends.
- virtual void OnTestEnd(const TestInfo& test_info) = 0;
-
- // Fired after the test case ends.
- virtual void OnTestCaseEnd(const TestCase& test_case) = 0;
-
- // Fired before environment tear-down for each iteration of tests starts.
- virtual void OnEnvironmentsTearDownStart(const UnitTest& unit_test) = 0;
-
- // Fired after environment tear-down for each iteration of tests ends.
- virtual void OnEnvironmentsTearDownEnd(const UnitTest& unit_test) = 0;
-
- // Fired after each iteration of tests finishes.
- virtual void OnTestIterationEnd(const UnitTest& unit_test,
- int iteration) = 0;
-
- // Fired after all test activities have ended.
- virtual void OnTestProgramEnd(const UnitTest& unit_test) = 0;
-};
-
-// The convenience class for users who need to override just one or two
-// methods and are not concerned that a possible change to a signature of
-// the methods they override will not be caught during the build. For
-// comments about each method please see the definition of TestEventListener
-// above.
-class EmptyTestEventListener : public TestEventListener {
- public:
- virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {}
- virtual void OnTestIterationStart(const UnitTest& /*unit_test*/,
- int /*iteration*/) {}
- virtual void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) {}
- virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {}
- virtual void OnTestCaseStart(const TestCase& /*test_case*/) {}
- virtual void OnTestStart(const TestInfo& /*test_info*/) {}
- virtual void OnTestPartResult(const TestPartResult& /*test_part_result*/) {}
- virtual void OnTestEnd(const TestInfo& /*test_info*/) {}
- virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {}
- virtual void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) {}
- virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {}
- virtual void OnTestIterationEnd(const UnitTest& /*unit_test*/,
- int /*iteration*/) {}
- virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {}
-};
-
-// TestEventListeners lets users add listeners to track events in Google Test.
-class GTEST_API_ TestEventListeners {
- public:
- TestEventListeners();
- ~TestEventListeners();
-
- // Appends an event listener to the end of the list. Google Test assumes
- // the ownership of the listener (i.e. it will delete the listener when
- // the test program finishes).
- void Append(TestEventListener* listener);
-
- // Removes the given event listener from the list and returns it. It then
- // becomes the caller's responsibility to delete the listener. Returns
- // NULL if the listener is not found in the list.
- TestEventListener* Release(TestEventListener* listener);
-
- // Returns the standard listener responsible for the default console
- // output. Can be removed from the listeners list to shut down default
- // console output. Note that removing this object from the listener list
- // with Release transfers its ownership to the caller and makes this
- // function return NULL the next time.
- TestEventListener* default_result_printer() const {
- return default_result_printer_;
- }
-
- // Returns the standard listener responsible for the default XML output
- // controlled by the --gtest_output=xml flag. Can be removed from the
- // listeners list by users who want to shut down the default XML output
- // controlled by this flag and substitute it with custom one. Note that
- // removing this object from the listener list with Release transfers its
- // ownership to the caller and makes this function return NULL the next
- // time.
- TestEventListener* default_xml_generator() const {
- return default_xml_generator_;
- }
-
- private:
- friend class TestCase;
- friend class TestInfo;
- friend class internal::DefaultGlobalTestPartResultReporter;
- friend class internal::NoExecDeathTest;
- friend class internal::TestEventListenersAccessor;
- friend class internal::UnitTestImpl;
-
- // Returns repeater that broadcasts the TestEventListener events to all
- // subscribers.
- TestEventListener* repeater();
-
- // Sets the default_result_printer attribute to the provided listener.
- // The listener is also added to the listener list and previous
- // default_result_printer is removed from it and deleted. The listener can
- // also be NULL in which case it will not be added to the list. Does
- // nothing if the previous and the current listener objects are the same.
- void SetDefaultResultPrinter(TestEventListener* listener);
-
- // Sets the default_xml_generator attribute to the provided listener. The
- // listener is also added to the listener list and previous
- // default_xml_generator is removed from it and deleted. The listener can
- // also be NULL in which case it will not be added to the list. Does
- // nothing if the previous and the current listener objects are the same.
- void SetDefaultXmlGenerator(TestEventListener* listener);
-
- // Controls whether events will be forwarded by the repeater to the
- // listeners in the list.
- bool EventForwardingEnabled() const;
- void SuppressEventForwarding();
-
- // The actual list of listeners.
- internal::TestEventRepeater* repeater_;
- // Listener responsible for the standard result output.
- TestEventListener* default_result_printer_;
- // Listener responsible for the creation of the XML output file.
- TestEventListener* default_xml_generator_;
-
- // We disallow copying TestEventListeners.
- GTEST_DISALLOW_COPY_AND_ASSIGN_(TestEventListeners);
-};
-
-// A UnitTest consists of a vector of TestCases.
-//
-// This is a singleton class. The only instance of UnitTest is
-// created when UnitTest::GetInstance() is first called. This
-// instance is never deleted.
-//
-// UnitTest is not copyable.
-//
-// This class is thread-safe as long as the methods are called
-// according to their specification.
-class GTEST_API_ UnitTest {
- public:
- // Gets the singleton UnitTest object. The first time this method
- // is called, a UnitTest object is constructed and returned.
- // Consecutive calls will return the same object.
- static UnitTest* GetInstance();
-
- // Runs all tests in this UnitTest object and prints the result.
- // Returns 0 if successful, or 1 otherwise.
- //
- // This method can only be called from the main thread.
- //
- // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
- int Run() GTEST_MUST_USE_RESULT_;
-
- // Returns the working directory when the first TEST() or TEST_F()
- // was executed. The UnitTest object owns the string.
- const char* original_working_dir() const;
-
- // Returns the TestCase object for the test that's currently running,
- // or NULL if no test is running.
- const TestCase* current_test_case() const
- GTEST_LOCK_EXCLUDED_(mutex_);
-
- // Returns the TestInfo object for the test that's currently running,
- // or NULL if no test is running.
- const TestInfo* current_test_info() const
- GTEST_LOCK_EXCLUDED_(mutex_);
-
- // Returns the random seed used at the start of the current test run.
- int random_seed() const;
-
-#if GTEST_HAS_PARAM_TEST
- // Returns the ParameterizedTestCaseRegistry object used to keep track of
- // value-parameterized tests and instantiate and register them.
- //
- // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
- internal::ParameterizedTestCaseRegistry& parameterized_test_registry()
- GTEST_LOCK_EXCLUDED_(mutex_);
-#endif // GTEST_HAS_PARAM_TEST
-
- // Gets the number of successful test cases.
- int successful_test_case_count() const;
-
- // Gets the number of failed test cases.
- int failed_test_case_count() const;
-
- // Gets the number of all test cases.
- int total_test_case_count() const;
-
- // Gets the number of all test cases that contain at least one test
- // that should run.
- int test_case_to_run_count() const;
-
- // Gets the number of successful tests.
- int successful_test_count() const;
-
- // Gets the number of failed tests.
- int failed_test_count() const;
-
- // Gets the number of disabled tests.
- int disabled_test_count() const;
-
- // Gets the number of all tests.
- int total_test_count() const;
-
- // Gets the number of tests that should run.
- int test_to_run_count() const;
-
- // Gets the time of the test program start, in ms from the start of the
- // UNIX epoch.
- TimeInMillis start_timestamp() const;
-
- // Gets the elapsed time, in milliseconds.
- TimeInMillis elapsed_time() const;
-
- // Returns true iff the unit test passed (i.e. all test cases passed).
- bool Passed() const;
-
- // Returns true iff the unit test failed (i.e. some test case failed
- // or something outside of all tests failed).
- bool Failed() const;
-
- // Gets the i-th test case among all the test cases. i can range from 0 to
- // total_test_case_count() - 1. If i is not in that range, returns NULL.
- const TestCase* GetTestCase(int i) const;
-
- // Returns the list of event listeners that can be used to track events
- // inside Google Test.
- TestEventListeners& listeners();
-
- private:
- // Registers and returns a global test environment. When a test
- // program is run, all global test environments will be set-up in
- // the order they were registered. After all tests in the program
- // have finished, all global test environments will be torn-down in
- // the *reverse* order they were registered.
- //
- // The UnitTest object takes ownership of the given environment.
- //
- // This method can only be called from the main thread.
- Environment* AddEnvironment(Environment* env);
-
- // Adds a TestPartResult to the current TestResult object. All
- // Google Test assertion macros (e.g. ASSERT_TRUE, EXPECT_EQ, etc)
- // eventually call this to report their results. The user code
- // should use the assertion macros instead of calling this directly.
- void AddTestPartResult(TestPartResult::Type result_type,
- const char* file_name,
- int line_number,
- const internal::String& message,
- const internal::String& os_stack_trace)
- GTEST_LOCK_EXCLUDED_(mutex_);
-
- // Adds a TestProperty to the current TestResult object. If the result already
- // contains a property with the same key, the value will be updated.
- void RecordPropertyForCurrentTest(const char* key, const char* value);
-
- // Gets the i-th test case among all the test cases. i can range from 0 to
- // total_test_case_count() - 1. If i is not in that range, returns NULL.
- TestCase* GetMutableTestCase(int i);
-
- // Accessors for the implementation object.
- internal::UnitTestImpl* impl() { return impl_; }
- const internal::UnitTestImpl* impl() const { return impl_; }
-
- // These classes and funcions are friends as they need to access private
- // members of UnitTest.
- friend class Test;
- friend class internal::AssertHelper;
- friend class internal::ScopedTrace;
- friend Environment* AddGlobalTestEnvironment(Environment* env);
- friend internal::UnitTestImpl* internal::GetUnitTestImpl();
- friend void internal::ReportFailureInUnknownLocation(
- TestPartResult::Type result_type,
- const internal::String& message);
-
- // Creates an empty UnitTest.
- UnitTest();
-
- // D'tor
- virtual ~UnitTest();
-
- // Pushes a trace defined by SCOPED_TRACE() on to the per-thread
- // Google Test trace stack.
- void PushGTestTrace(const internal::TraceInfo& trace)
- GTEST_LOCK_EXCLUDED_(mutex_);
-
- // Pops a trace from the per-thread Google Test trace stack.
- void PopGTestTrace()
- GTEST_LOCK_EXCLUDED_(mutex_);
-
- // Protects mutable state in *impl_. This is mutable as some const
- // methods need to lock it too.
- mutable internal::Mutex mutex_;
-
- // Opaque implementation object. This field is never changed once
- // the object is constructed. We don't mark it as const here, as
- // doing so will cause a warning in the constructor of UnitTest.
- // Mutable state in *impl_ is protected by mutex_.
- internal::UnitTestImpl* impl_;
-
- // We disallow copying UnitTest.
- GTEST_DISALLOW_COPY_AND_ASSIGN_(UnitTest);
-};
-
-// A convenient wrapper for adding an environment for the test
-// program.
-//
-// You should call this before RUN_ALL_TESTS() is called, probably in
-// main(). If you use gtest_main, you need to call this before main()
-// starts for it to take effect. For example, you can define a global
-// variable like this:
-//
-// testing::Environment* const foo_env =
-// testing::AddGlobalTestEnvironment(new FooEnvironment);
-//
-// However, we strongly recommend you to write your own main() and
-// call AddGlobalTestEnvironment() there, as relying on initialization
-// of global variables makes the code harder to read and may cause
-// problems when you register multiple environments from different
-// translation units and the environments have dependencies among them
-// (remember that the compiler doesn't guarantee the order in which
-// global variables from different translation units are initialized).
-inline Environment* AddGlobalTestEnvironment(Environment* env) {
- return UnitTest::GetInstance()->AddEnvironment(env);
-}
-
-// Initializes Google Test. This must be called before calling
-// RUN_ALL_TESTS(). In particular, it parses a command line for the
-// flags that Google Test recognizes. Whenever a Google Test flag is
-// seen, it is removed from argv, and *argc is decremented.
-//
-// No value is returned. Instead, the Google Test flag variables are
-// updated.
-//
-// Calling the function for the second time has no user-visible effect.
-GTEST_API_ void InitGoogleTest(int* argc, char** argv);
-
-// This overloaded version can be used in Windows programs compiled in
-// UNICODE mode.
-GTEST_API_ void InitGoogleTest(int* argc, wchar_t** argv);
-
-namespace internal {
-
-// Formats a comparison assertion (e.g. ASSERT_EQ, EXPECT_LT, and etc)
-// operand to be used in a failure message. The type (but not value)
-// of the other operand may affect the format. This allows us to
-// print a char* as a raw pointer when it is compared against another
-// char*, and print it as a C string when it is compared against an
-// std::string object, for example.
-//
-// The default implementation ignores the type of the other operand.
-// Some specialized versions are used to handle formatting wide or
-// narrow C strings.
-//
-// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
-template <typename T1, typename T2>
-String FormatForComparisonFailureMessage(const T1& value,
- const T2& /* other_operand */) {
- // C++Builder compiles this incorrectly if the namespace isn't explicitly
- // given.
- return ::testing::PrintToString(value);
-}
-
-// The helper function for {ASSERT|EXPECT}_EQ.
-template <typename T1, typename T2>
-AssertionResult CmpHelperEQ(const char* expected_expression,
- const char* actual_expression,
- const T1& expected,
- const T2& actual) {
-#ifdef _MSC_VER
-# pragma warning(push) // Saves the current warning state.
-# pragma warning(disable:4389) // Temporarily disables warning on
- // signed/unsigned mismatch.
-#endif
-
- if (expected == actual) {
- return AssertionSuccess();
- }
-
-#ifdef _MSC_VER
-# pragma warning(pop) // Restores the warning state.
-#endif
-
- return EqFailure(expected_expression,
- actual_expression,
- FormatForComparisonFailureMessage(expected, actual),
- FormatForComparisonFailureMessage(actual, expected),
- false);
-}
-
-// With this overloaded version, we allow anonymous enums to be used
-// in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous enums
-// can be implicitly cast to BiggestInt.
-GTEST_API_ AssertionResult CmpHelperEQ(const char* expected_expression,
- const char* actual_expression,
- BiggestInt expected,
- BiggestInt actual);
-
-// The helper class for {ASSERT|EXPECT}_EQ. The template argument
-// lhs_is_null_literal is true iff the first argument to ASSERT_EQ()
-// is a null pointer literal. The following default implementation is
-// for lhs_is_null_literal being false.
-template <bool lhs_is_null_literal>
-class EqHelper {
- public:
- // This templatized version is for the general case.
- template <typename T1, typename T2>
- static AssertionResult Compare(const char* expected_expression,
- const char* actual_expression,
- const T1& expected,
- const T2& actual) {
- return CmpHelperEQ(expected_expression, actual_expression, expected,
- actual);
- }
-
- // With this overloaded version, we allow anonymous enums to be used
- // in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous
- // enums can be implicitly cast to BiggestInt.
- //
- // Even though its body looks the same as the above version, we
- // cannot merge the two, as it will make anonymous enums unhappy.
- static AssertionResult Compare(const char* expected_expression,
- const char* actual_expression,
- BiggestInt expected,
- BiggestInt actual) {
- return CmpHelperEQ(expected_expression, actual_expression, expected,
- actual);
- }
-};
-
-// This specialization is used when the first argument to ASSERT_EQ()
-// is a null pointer literal, like NULL, false, or 0.
-template <>
-class EqHelper<true> {
- public:
- // We define two overloaded versions of Compare(). The first
- // version will be picked when the second argument to ASSERT_EQ() is
- // NOT a pointer, e.g. ASSERT_EQ(0, AnIntFunction()) or
- // EXPECT_EQ(false, a_bool).
- template <typename T1, typename T2>
- static AssertionResult Compare(
- const char* expected_expression,
- const char* actual_expression,
- const T1& expected,
- const T2& actual,
- // The following line prevents this overload from being considered if T2
- // is not a pointer type. We need this because ASSERT_EQ(NULL, my_ptr)
- // expands to Compare("", "", NULL, my_ptr), which requires a conversion
- // to match the Secret* in the other overload, which would otherwise make
- // this template match better.
- typename EnableIf<!is_pointer<T2>::value>::type* = 0) {
- return CmpHelperEQ(expected_expression, actual_expression, expected,
- actual);
- }
-
- // This version will be picked when the second argument to ASSERT_EQ() is a
- // pointer, e.g. ASSERT_EQ(NULL, a_pointer).
- template <typename T>
- static AssertionResult Compare(
- const char* expected_expression,
- const char* actual_expression,
- // We used to have a second template parameter instead of Secret*. That
- // template parameter would deduce to 'long', making this a better match
- // than the first overload even without the first overload's EnableIf.
- // Unfortunately, gcc with -Wconversion-null warns when "passing NULL to
- // non-pointer argument" (even a deduced integral argument), so the old
- // implementation caused warnings in user code.
- Secret* /* expected (NULL) */,
- T* actual) {
- // We already know that 'expected' is a null pointer.
- return CmpHelperEQ(expected_expression, actual_expression,
- static_cast<T*>(NULL), actual);
- }
-};
-
-// A macro for implementing the helper functions needed to implement
-// ASSERT_?? and EXPECT_??. It is here just to avoid copy-and-paste
-// of similar code.
-//
-// For each templatized helper function, we also define an overloaded
-// version for BiggestInt in order to reduce code bloat and allow
-// anonymous enums to be used with {ASSERT|EXPECT}_?? when compiled
-// with gcc 4.
-//
-// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
-#define GTEST_IMPL_CMP_HELPER_(op_name, op)\
-template <typename T1, typename T2>\
-AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \
- const T1& val1, const T2& val2) {\
- if (val1 op val2) {\
- return AssertionSuccess();\
- } else {\
- return AssertionFailure() \
- << "Expected: (" << expr1 << ") " #op " (" << expr2\
- << "), actual: " << FormatForComparisonFailureMessage(val1, val2)\
- << " vs " << FormatForComparisonFailureMessage(val2, val1);\
- }\
-}\
-GTEST_API_ AssertionResult CmpHelper##op_name(\
- const char* expr1, const char* expr2, BiggestInt val1, BiggestInt val2)
-
-// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
-
-// Implements the helper function for {ASSERT|EXPECT}_NE
-GTEST_IMPL_CMP_HELPER_(NE, !=);
-// Implements the helper function for {ASSERT|EXPECT}_LE
-GTEST_IMPL_CMP_HELPER_(LE, <=);
-// Implements the helper function for {ASSERT|EXPECT}_LT
-GTEST_IMPL_CMP_HELPER_(LT, <);
-// Implements the helper function for {ASSERT|EXPECT}_GE
-GTEST_IMPL_CMP_HELPER_(GE, >=);
-// Implements the helper function for {ASSERT|EXPECT}_GT
-GTEST_IMPL_CMP_HELPER_(GT, >);
-
-#undef GTEST_IMPL_CMP_HELPER_
-
-// The helper function for {ASSERT|EXPECT}_STREQ.
-//
-// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
-GTEST_API_ AssertionResult CmpHelperSTREQ(const char* expected_expression,
- const char* actual_expression,
- const char* expected,
- const char* actual);
-
-// The helper function for {ASSERT|EXPECT}_STRCASEEQ.
-//
-// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
-GTEST_API_ AssertionResult CmpHelperSTRCASEEQ(const char* expected_expression,
- const char* actual_expression,
- const char* expected,
- const char* actual);
-
-// The helper function for {ASSERT|EXPECT}_STRNE.
-//
-// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
-GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression,
- const char* s2_expression,
- const char* s1,
- const char* s2);
-
-// The helper function for {ASSERT|EXPECT}_STRCASENE.
-//
-// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
-GTEST_API_ AssertionResult CmpHelperSTRCASENE(const char* s1_expression,
- const char* s2_expression,
- const char* s1,
- const char* s2);
-
-
-// Helper function for *_STREQ on wide strings.
-//
-// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
-GTEST_API_ AssertionResult CmpHelperSTREQ(const char* expected_expression,
- const char* actual_expression,
- const wchar_t* expected,
- const wchar_t* actual);
-
-// Helper function for *_STRNE on wide strings.
-//
-// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
-GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression,
- const char* s2_expression,
- const wchar_t* s1,
- const wchar_t* s2);
-
-} // namespace internal
-
-// IsSubstring() and IsNotSubstring() are intended to be used as the
-// first argument to {EXPECT,ASSERT}_PRED_FORMAT2(), not by
-// themselves. They check whether needle is a substring of haystack
-// (NULL is considered a substring of itself only), and return an
-// appropriate error message when they fail.
-//
-// The {needle,haystack}_expr arguments are the stringified
-// expressions that generated the two real arguments.
-GTEST_API_ AssertionResult IsSubstring(
- const char* needle_expr, const char* haystack_expr,
- const char* needle, const char* haystack);
-GTEST_API_ AssertionResult IsSubstring(
- const char* needle_expr, const char* haystack_expr,
- const wchar_t* needle, const wchar_t* haystack);
-GTEST_API_ AssertionResult IsNotSubstring(
- const char* needle_expr, const char* haystack_expr,
- const char* needle, const char* haystack);
-GTEST_API_ AssertionResult IsNotSubstring(
- const char* needle_expr, const char* haystack_expr,
- const wchar_t* needle, const wchar_t* haystack);
-GTEST_API_ AssertionResult IsSubstring(
- const char* needle_expr, const char* haystack_expr,
- const ::std::string& needle, const ::std::string& haystack);
-GTEST_API_ AssertionResult IsNotSubstring(
- const char* needle_expr, const char* haystack_expr,
- const ::std::string& needle, const ::std::string& haystack);
-
-#if GTEST_HAS_STD_WSTRING
-GTEST_API_ AssertionResult IsSubstring(
- const char* needle_expr, const char* haystack_expr,
- const ::std::wstring& needle, const ::std::wstring& haystack);
-GTEST_API_ AssertionResult IsNotSubstring(
- const char* needle_expr, const char* haystack_expr,
- const ::std::wstring& needle, const ::std::wstring& haystack);
-#endif // GTEST_HAS_STD_WSTRING
-
-namespace internal {
-
-// Helper template function for comparing floating-points.
-//
-// Template parameter:
-//
-// RawType: the raw floating-point type (either float or double)
-//
-// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
-template <typename RawType>
-AssertionResult CmpHelperFloatingPointEQ(const char* expected_expression,
- const char* actual_expression,
- RawType expected,
- RawType actual) {
- const FloatingPoint<RawType> lhs(expected), rhs(actual);
-
- if (lhs.AlmostEquals(rhs)) {
- return AssertionSuccess();
- }
-
- ::std::stringstream expected_ss;
- expected_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
- << expected;
-
- ::std::stringstream actual_ss;
- actual_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
- << actual;
-
- return EqFailure(expected_expression,
- actual_expression,
- StringStreamToString(&expected_ss),
- StringStreamToString(&actual_ss),
- false);
-}
-
-// Helper function for implementing ASSERT_NEAR.
-//
-// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
-GTEST_API_ AssertionResult DoubleNearPredFormat(const char* expr1,
- const char* expr2,
- const char* abs_error_expr,
- double val1,
- double val2,
- double abs_error);
-
-// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
-// A class that enables one to stream messages to assertion macros
-class GTEST_API_ AssertHelper {
- public:
- // Constructor.
- AssertHelper(TestPartResult::Type type,
- const char* file,
- int line,
- const char* message);
- ~AssertHelper();
-
- // Message assignment is a semantic trick to enable assertion
- // streaming; see the GTEST_MESSAGE_ macro below.
- void operator=(const Message& message) const;
-
- private:
- // We put our data in a struct so that the size of the AssertHelper class can
- // be as small as possible. This is important because gcc is incapable of
- // re-using stack space even for temporary variables, so every EXPECT_EQ
- // reserves stack space for another AssertHelper.
- struct AssertHelperData {
- AssertHelperData(TestPartResult::Type t,
- const char* srcfile,
- int line_num,
- const char* msg)
- : type(t), file(srcfile), line(line_num), message(msg) { }
-
- TestPartResult::Type const type;
- const char* const file;
- int const line;
- String const message;
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelperData);
- };
-
- AssertHelperData* const data_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelper);
-};
-
-} // namespace internal
-
-#if GTEST_HAS_PARAM_TEST
-// The pure interface class that all value-parameterized tests inherit from.
-// A value-parameterized class must inherit from both ::testing::Test and
-// ::testing::WithParamInterface. In most cases that just means inheriting
-// from ::testing::TestWithParam, but more complicated test hierarchies
-// may need to inherit from Test and WithParamInterface at different levels.
-//
-// This interface has support for accessing the test parameter value via
-// the GetParam() method.
-//
-// Use it with one of the parameter generator defining functions, like Range(),
-// Values(), ValuesIn(), Bool(), and Combine().
-//
-// class FooTest : public ::testing::TestWithParam<int> {
-// protected:
-// FooTest() {
-// // Can use GetParam() here.
-// }
-// virtual ~FooTest() {
-// // Can use GetParam() here.
-// }
-// virtual void SetUp() {
-// // Can use GetParam() here.
-// }
-// virtual void TearDown {
-// // Can use GetParam() here.
-// }
-// };
-// TEST_P(FooTest, DoesBar) {
-// // Can use GetParam() method here.
-// Foo foo;
-// ASSERT_TRUE(foo.DoesBar(GetParam()));
-// }
-// INSTANTIATE_TEST_CASE_P(OneToTenRange, FooTest, ::testing::Range(1, 10));
-
-template <typename T>
-class WithParamInterface {
- public:
- typedef T ParamType;
- virtual ~WithParamInterface() {}
-
- // The current parameter value. Is also available in the test fixture's
- // constructor. This member function is non-static, even though it only
- // references static data, to reduce the opportunity for incorrect uses
- // like writing 'WithParamInterface<bool>::GetParam()' for a test that
- // uses a fixture whose parameter type is int.
- const ParamType& GetParam() const { return *parameter_; }
-
- private:
- // Sets parameter value. The caller is responsible for making sure the value
- // remains alive and unchanged throughout the current test.
- static void SetParam(const ParamType* parameter) {
- parameter_ = parameter;
- }
-
- // Static value used for accessing parameter during a test lifetime.
- static const ParamType* parameter_;
-
- // TestClass must be a subclass of WithParamInterface<T> and Test.
- template <class TestClass> friend class internal::ParameterizedTestFactory;
-};
-
-template <typename T>
-const T* WithParamInterface<T>::parameter_ = NULL;
-
-// Most value-parameterized classes can ignore the existence of
-// WithParamInterface, and can just inherit from ::testing::TestWithParam.
-
-template <typename T>
-class TestWithParam : public Test, public WithParamInterface<T> {
-};
-
-#endif // GTEST_HAS_PARAM_TEST
-
-// Macros for indicating success/failure in test code.
-
-// ADD_FAILURE unconditionally adds a failure to the current test.
-// SUCCEED generates a success - it doesn't automatically make the
-// current test successful, as a test is only successful when it has
-// no failure.
-//
-// EXPECT_* verifies that a certain condition is satisfied. If not,
-// it behaves like ADD_FAILURE. In particular:
-//
-// EXPECT_TRUE verifies that a Boolean condition is true.
-// EXPECT_FALSE verifies that a Boolean condition is false.
-//
-// FAIL and ASSERT_* are similar to ADD_FAILURE and EXPECT_*, except
-// that they will also abort the current function on failure. People
-// usually want the fail-fast behavior of FAIL and ASSERT_*, but those
-// writing data-driven tests often find themselves using ADD_FAILURE
-// and EXPECT_* more.
-
-// Generates a nonfatal failure with a generic message.
-#define ADD_FAILURE() GTEST_NONFATAL_FAILURE_("Failed")
-
-// Generates a nonfatal failure at the given source file location with
-// a generic message.
-#define ADD_FAILURE_AT(file, line) \
- GTEST_MESSAGE_AT_(file, line, "Failed", \
- ::testing::TestPartResult::kNonFatalFailure)
-
-// Generates a fatal failure with a generic message.
-#define GTEST_FAIL() GTEST_FATAL_FAILURE_("Failed")
-
-// Define this macro to 1 to omit the definition of FAIL(), which is a
-// generic name and clashes with some other libraries.
-#if !GTEST_DONT_DEFINE_FAIL
-# define FAIL() GTEST_FAIL()
-#endif
-
-// Generates a success with a generic message.
-#define GTEST_SUCCEED() GTEST_SUCCESS_("Succeeded")
-
-// Define this macro to 1 to omit the definition of SUCCEED(), which
-// is a generic name and clashes with some other libraries.
-#if !GTEST_DONT_DEFINE_SUCCEED
-# define SUCCEED() GTEST_SUCCEED()
-#endif
-
-// Macros for testing exceptions.
-//
-// * {ASSERT|EXPECT}_THROW(statement, expected_exception):
-// Tests that the statement throws the expected exception.
-// * {ASSERT|EXPECT}_NO_THROW(statement):
-// Tests that the statement doesn't throw any exception.
-// * {ASSERT|EXPECT}_ANY_THROW(statement):
-// Tests that the statement throws an exception.
-
-#define EXPECT_THROW(statement, expected_exception) \
- GTEST_TEST_THROW_(statement, expected_exception, GTEST_NONFATAL_FAILURE_)
-#define EXPECT_NO_THROW(statement) \
- GTEST_TEST_NO_THROW_(statement, GTEST_NONFATAL_FAILURE_)
-#define EXPECT_ANY_THROW(statement) \
- GTEST_TEST_ANY_THROW_(statement, GTEST_NONFATAL_FAILURE_)
-#define ASSERT_THROW(statement, expected_exception) \
- GTEST_TEST_THROW_(statement, expected_exception, GTEST_FATAL_FAILURE_)
-#define ASSERT_NO_THROW(statement) \
- GTEST_TEST_NO_THROW_(statement, GTEST_FATAL_FAILURE_)
-#define ASSERT_ANY_THROW(statement) \
- GTEST_TEST_ANY_THROW_(statement, GTEST_FATAL_FAILURE_)
-
-// Boolean assertions. Condition can be either a Boolean expression or an
-// AssertionResult. For more information on how to use AssertionResult with
-// these macros see comments on that class.
-#define EXPECT_TRUE(condition) \
- GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \
- GTEST_NONFATAL_FAILURE_)
-#define EXPECT_FALSE(condition) \
- GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
- GTEST_NONFATAL_FAILURE_)
-#define ASSERT_TRUE(condition) \
- GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \
- GTEST_FATAL_FAILURE_)
-#define ASSERT_FALSE(condition) \
- GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
- GTEST_FATAL_FAILURE_)
-
-// Includes the auto-generated header that implements a family of
-// generic predicate assertion macros.
-#include "gtest/gtest_pred_impl.h"
-
-// Macros for testing equalities and inequalities.
-//
-// * {ASSERT|EXPECT}_EQ(expected, actual): Tests that expected == actual
-// * {ASSERT|EXPECT}_NE(v1, v2): Tests that v1 != v2
-// * {ASSERT|EXPECT}_LT(v1, v2): Tests that v1 < v2
-// * {ASSERT|EXPECT}_LE(v1, v2): Tests that v1 <= v2
-// * {ASSERT|EXPECT}_GT(v1, v2): Tests that v1 > v2
-// * {ASSERT|EXPECT}_GE(v1, v2): Tests that v1 >= v2
-//
-// When they are not, Google Test prints both the tested expressions and
-// their actual values. The values must be compatible built-in types,
-// or you will get a compiler error. By "compatible" we mean that the
-// values can be compared by the respective operator.
-//
-// Note:
-//
-// 1. It is possible to make a user-defined type work with
-// {ASSERT|EXPECT}_??(), but that requires overloading the
-// comparison operators and is thus discouraged by the Google C++
-// Usage Guide. Therefore, you are advised to use the
-// {ASSERT|EXPECT}_TRUE() macro to assert that two objects are
-// equal.
-//
-// 2. The {ASSERT|EXPECT}_??() macros do pointer comparisons on
-// pointers (in particular, C strings). Therefore, if you use it
-// with two C strings, you are testing how their locations in memory
-// are related, not how their content is related. To compare two C
-// strings by content, use {ASSERT|EXPECT}_STR*().
-//
-// 3. {ASSERT|EXPECT}_EQ(expected, actual) is preferred to
-// {ASSERT|EXPECT}_TRUE(expected == actual), as the former tells you
-// what the actual value is when it fails, and similarly for the
-// other comparisons.
-//
-// 4. Do not depend on the order in which {ASSERT|EXPECT}_??()
-// evaluate their arguments, which is undefined.
-//
-// 5. These macros evaluate their arguments exactly once.
-//
-// Examples:
-//
-// EXPECT_NE(5, Foo());
-// EXPECT_EQ(NULL, a_pointer);
-// ASSERT_LT(i, array_size);
-// ASSERT_GT(records.size(), 0) << "There is no record left.";
-
-#define EXPECT_EQ(expected, actual) \
- EXPECT_PRED_FORMAT2(::testing::internal:: \
- EqHelper<GTEST_IS_NULL_LITERAL_(expected)>::Compare, \
- expected, actual)
-#define EXPECT_NE(expected, actual) \
- EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperNE, expected, actual)
-#define EXPECT_LE(val1, val2) \
- EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)
-#define EXPECT_LT(val1, val2) \
- EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)
-#define EXPECT_GE(val1, val2) \
- EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)
-#define EXPECT_GT(val1, val2) \
- EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)
-
-#define GTEST_ASSERT_EQ(expected, actual) \
- ASSERT_PRED_FORMAT2(::testing::internal:: \
- EqHelper<GTEST_IS_NULL_LITERAL_(expected)>::Compare, \
- expected, actual)
-#define GTEST_ASSERT_NE(val1, val2) \
- ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2)
-#define GTEST_ASSERT_LE(val1, val2) \
- ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)
-#define GTEST_ASSERT_LT(val1, val2) \
- ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)
-#define GTEST_ASSERT_GE(val1, val2) \
- ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)
-#define GTEST_ASSERT_GT(val1, val2) \
- ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)
-
-// Define macro GTEST_DONT_DEFINE_ASSERT_XY to 1 to omit the definition of
-// ASSERT_XY(), which clashes with some users' own code.
-
-#if !GTEST_DONT_DEFINE_ASSERT_EQ
-# define ASSERT_EQ(val1, val2) GTEST_ASSERT_EQ(val1, val2)
-#endif
-
-#if !GTEST_DONT_DEFINE_ASSERT_NE
-# define ASSERT_NE(val1, val2) GTEST_ASSERT_NE(val1, val2)
-#endif
-
-#if !GTEST_DONT_DEFINE_ASSERT_LE
-# define ASSERT_LE(val1, val2) GTEST_ASSERT_LE(val1, val2)
-#endif
-
-#if !GTEST_DONT_DEFINE_ASSERT_LT
-# define ASSERT_LT(val1, val2) GTEST_ASSERT_LT(val1, val2)
-#endif
-
-#if !GTEST_DONT_DEFINE_ASSERT_GE
-# define ASSERT_GE(val1, val2) GTEST_ASSERT_GE(val1, val2)
-#endif
-
-#if !GTEST_DONT_DEFINE_ASSERT_GT
-# define ASSERT_GT(val1, val2) GTEST_ASSERT_GT(val1, val2)
-#endif
-
-// C String Comparisons. All tests treat NULL and any non-NULL string
-// as different. Two NULLs are equal.
-//
-// * {ASSERT|EXPECT}_STREQ(s1, s2): Tests that s1 == s2
-// * {ASSERT|EXPECT}_STRNE(s1, s2): Tests that s1 != s2
-// * {ASSERT|EXPECT}_STRCASEEQ(s1, s2): Tests that s1 == s2, ignoring case
-// * {ASSERT|EXPECT}_STRCASENE(s1, s2): Tests that s1 != s2, ignoring case
-//
-// For wide or narrow string objects, you can use the
-// {ASSERT|EXPECT}_??() macros.
-//
-// Don't depend on the order in which the arguments are evaluated,
-// which is undefined.
-//
-// These macros evaluate their arguments exactly once.
-
-#define EXPECT_STREQ(expected, actual) \
- EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, expected, actual)
-#define EXPECT_STRNE(s1, s2) \
- EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)
-#define EXPECT_STRCASEEQ(expected, actual) \
- EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, expected, actual)
-#define EXPECT_STRCASENE(s1, s2)\
- EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)
-
-#define ASSERT_STREQ(expected, actual) \
- ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, expected, actual)
-#define ASSERT_STRNE(s1, s2) \
- ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)
-#define ASSERT_STRCASEEQ(expected, actual) \
- ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, expected, actual)
-#define ASSERT_STRCASENE(s1, s2)\
- ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)
-
-// Macros for comparing floating-point numbers.
-//
-// * {ASSERT|EXPECT}_FLOAT_EQ(expected, actual):
-// Tests that two float values are almost equal.
-// * {ASSERT|EXPECT}_DOUBLE_EQ(expected, actual):
-// Tests that two double values are almost equal.
-// * {ASSERT|EXPECT}_NEAR(v1, v2, abs_error):
-// Tests that v1 and v2 are within the given distance to each other.
-//
-// Google Test uses ULP-based comparison to automatically pick a default
-// error bound that is appropriate for the operands. See the
-// FloatingPoint template class in gtest-internal.h if you are
-// interested in the implementation details.
-
-#define EXPECT_FLOAT_EQ(expected, actual)\
- EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \
- expected, actual)
-
-#define EXPECT_DOUBLE_EQ(expected, actual)\
- EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \
- expected, actual)
-
-#define ASSERT_FLOAT_EQ(expected, actual)\
- ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \
- expected, actual)
-
-#define ASSERT_DOUBLE_EQ(expected, actual)\
- ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \
- expected, actual)
-
-#define EXPECT_NEAR(val1, val2, abs_error)\
- EXPECT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \
- val1, val2, abs_error)
-
-#define ASSERT_NEAR(val1, val2, abs_error)\
- ASSERT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \
- val1, val2, abs_error)
-
-// These predicate format functions work on floating-point values, and
-// can be used in {ASSERT|EXPECT}_PRED_FORMAT2*(), e.g.
-//
-// EXPECT_PRED_FORMAT2(testing::DoubleLE, Foo(), 5.0);
-
-// Asserts that val1 is less than, or almost equal to, val2. Fails
-// otherwise. In particular, it fails if either val1 or val2 is NaN.
-GTEST_API_ AssertionResult FloatLE(const char* expr1, const char* expr2,
- float val1, float val2);
-GTEST_API_ AssertionResult DoubleLE(const char* expr1, const char* expr2,
- double val1, double val2);
-
-
-#if GTEST_OS_WINDOWS
-
-// Macros that test for HRESULT failure and success, these are only useful
-// on Windows, and rely on Windows SDK macros and APIs to compile.
-//
-// * {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}(expr)
-//
-// When expr unexpectedly fails or succeeds, Google Test prints the
-// expected result and the actual result with both a human-readable
-// string representation of the error, if available, as well as the
-// hex result code.
-# define EXPECT_HRESULT_SUCCEEDED(expr) \
- EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr))
-
-# define ASSERT_HRESULT_SUCCEEDED(expr) \
- ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr))
-
-# define EXPECT_HRESULT_FAILED(expr) \
- EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
-
-# define ASSERT_HRESULT_FAILED(expr) \
- ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
-
-#endif // GTEST_OS_WINDOWS
-
-// Macros that execute statement and check that it doesn't generate new fatal
-// failures in the current thread.
-//
-// * {ASSERT|EXPECT}_NO_FATAL_FAILURE(statement);
-//
-// Examples:
-//
-// EXPECT_NO_FATAL_FAILURE(Process());
-// ASSERT_NO_FATAL_FAILURE(Process()) << "Process() failed";
-//
-#define ASSERT_NO_FATAL_FAILURE(statement) \
- GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_FATAL_FAILURE_)
-#define EXPECT_NO_FATAL_FAILURE(statement) \
- GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_NONFATAL_FAILURE_)
-
-// Causes a trace (including the source file path, the current line
-// number, and the given message) to be included in every test failure
-// message generated by code in the current scope. The effect is
-// undone when the control leaves the current scope.
-//
-// The message argument can be anything streamable to std::ostream.
-//
-// In the implementation, we include the current line number as part
-// of the dummy variable name, thus allowing multiple SCOPED_TRACE()s
-// to appear in the same block - as long as they are on different
-// lines.
-#define SCOPED_TRACE(message) \
- ::testing::internal::ScopedTrace GTEST_CONCAT_TOKEN_(gtest_trace_, __LINE__)(\
- __FILE__, __LINE__, ::testing::Message() << (message))
-
-// Compile-time assertion for type equality.
-// StaticAssertTypeEq<type1, type2>() compiles iff type1 and type2 are
-// the same type. The value it returns is not interesting.
-//
-// Instead of making StaticAssertTypeEq a class template, we make it a
-// function template that invokes a helper class template. This
-// prevents a user from misusing StaticAssertTypeEq<T1, T2> by
-// defining objects of that type.
-//
-// CAVEAT:
-//
-// When used inside a method of a class template,
-// StaticAssertTypeEq<T1, T2>() is effective ONLY IF the method is
-// instantiated. For example, given:
-//
-// template <typename T> class Foo {
-// public:
-// void Bar() { testing::StaticAssertTypeEq<int, T>(); }
-// };
-//
-// the code:
-//
-// void Test1() { Foo<bool> foo; }
-//
-// will NOT generate a compiler error, as Foo<bool>::Bar() is never
-// actually instantiated. Instead, you need:
-//
-// void Test2() { Foo<bool> foo; foo.Bar(); }
-//
-// to cause a compiler error.
-template <typename T1, typename T2>
-bool StaticAssertTypeEq() {
- (void)internal::StaticAssertTypeEqHelper<T1, T2>();
- return true;
-}
-
-// Defines a test.
-//
-// The first parameter is the name of the test case, and the second
-// parameter is the name of the test within the test case.
-//
-// The convention is to end the test case name with "Test". For
-// example, a test case for the Foo class can be named FooTest.
-//
-// The user should put his test code between braces after using this
-// macro. Example:
-//
-// TEST(FooTest, InitializesCorrectly) {
-// Foo foo;
-// EXPECT_TRUE(foo.StatusIsOK());
-// }
-
-// Note that we call GetTestTypeId() instead of GetTypeId<
-// ::testing::Test>() here to get the type ID of testing::Test. This
-// is to work around a suspected linker bug when using Google Test as
-// a framework on Mac OS X. The bug causes GetTypeId<
-// ::testing::Test>() to return different values depending on whether
-// the call is from the Google Test framework itself or from user test
-// code. GetTestTypeId() is guaranteed to always return the same
-// value, as it always calls GetTypeId<>() from the Google Test
-// framework.
-#define GTEST_TEST(test_case_name, test_name)\
- GTEST_TEST_(test_case_name, test_name, \
- ::testing::Test, ::testing::internal::GetTestTypeId())
-
-// Define this macro to 1 to omit the definition of TEST(), which
-// is a generic name and clashes with some other libraries.
-#if !GTEST_DONT_DEFINE_TEST
-# define TEST(test_case_name, test_name) GTEST_TEST(test_case_name, test_name)
-#endif
-
-// Defines a test that uses a test fixture.
-//
-// The first parameter is the name of the test fixture class, which
-// also doubles as the test case name. The second parameter is the
-// name of the test within the test case.
-//
-// A test fixture class must be declared earlier. The user should put
-// his test code between braces after using this macro. Example:
-//
-// class FooTest : public testing::Test {
-// protected:
-// virtual void SetUp() { b_.AddElement(3); }
-//
-// Foo a_;
-// Foo b_;
-// };
-//
-// TEST_F(FooTest, InitializesCorrectly) {
-// EXPECT_TRUE(a_.StatusIsOK());
-// }
-//
-// TEST_F(FooTest, ReturnsElementCountCorrectly) {
-// EXPECT_EQ(0, a_.size());
-// EXPECT_EQ(1, b_.size());
-// }
-
-#define TEST_F(test_fixture, test_name)\
- GTEST_TEST_(test_fixture, test_name, test_fixture, \
- ::testing::internal::GetTypeId<test_fixture>())
-
-// Use this macro in main() to run all tests. It returns 0 if all
-// tests are successful, or 1 otherwise.
-//
-// RUN_ALL_TESTS() should be invoked after the command line has been
-// parsed by InitGoogleTest().
-
-#define RUN_ALL_TESTS()\
- (::testing::UnitTest::GetInstance()->Run())
-
-} // namespace testing
-
-#endif // GTEST_INCLUDE_GTEST_GTEST_H_
diff --git a/src/testing/gtest/include/gtest/gtest_pred_impl.h b/src/testing/gtest/include/gtest/gtest_pred_impl.h
deleted file mode 100644
index 30ae712f..00000000
--- a/src/testing/gtest/include/gtest/gtest_pred_impl.h
+++ /dev/null
@@ -1,358 +0,0 @@
-// Copyright 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// This file is AUTOMATICALLY GENERATED on 10/31/2011 by command
-// 'gen_gtest_pred_impl.py 5'. DO NOT EDIT BY HAND!
-//
-// Implements a family of generic predicate assertion macros.
-
-#ifndef GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
-#define GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
-
-// Makes sure this header is not included before gtest.h.
-#ifndef GTEST_INCLUDE_GTEST_GTEST_H_
-# error Do not include gtest_pred_impl.h directly. Include gtest.h instead.
-#endif // GTEST_INCLUDE_GTEST_GTEST_H_
-
-// This header implements a family of generic predicate assertion
-// macros:
-//
-// ASSERT_PRED_FORMAT1(pred_format, v1)
-// ASSERT_PRED_FORMAT2(pred_format, v1, v2)
-// ...
-//
-// where pred_format is a function or functor that takes n (in the
-// case of ASSERT_PRED_FORMATn) values and their source expression
-// text, and returns a testing::AssertionResult. See the definition
-// of ASSERT_EQ in gtest.h for an example.
-//
-// If you don't care about formatting, you can use the more
-// restrictive version:
-//
-// ASSERT_PRED1(pred, v1)
-// ASSERT_PRED2(pred, v1, v2)
-// ...
-//
-// where pred is an n-ary function or functor that returns bool,
-// and the values v1, v2, ..., must support the << operator for
-// streaming to std::ostream.
-//
-// We also define the EXPECT_* variations.
-//
-// For now we only support predicates whose arity is at most 5.
-// Please email googletestframework@googlegroups.com if you need
-// support for higher arities.
-
-// GTEST_ASSERT_ is the basic statement to which all of the assertions
-// in this file reduce. Don't use this in your code.
-
-#define GTEST_ASSERT_(expression, on_failure) \
- GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
- if (const ::testing::AssertionResult gtest_ar = (expression)) \
- ; \
- else \
- on_failure(gtest_ar.failure_message())
-
-
-// Helper function for implementing {EXPECT|ASSERT}_PRED1. Don't use
-// this in your code.
-template <typename Pred,
- typename T1>
-AssertionResult AssertPred1Helper(const char* pred_text,
- const char* e1,
- Pred pred,
- const T1& v1) {
- if (pred(v1)) return AssertionSuccess();
-
- return AssertionFailure() << pred_text << "("
- << e1 << ") evaluates to false, where"
- << "\n" << e1 << " evaluates to " << v1;
-}
-
-// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT1.
-// Don't use this in your code.
-#define GTEST_PRED_FORMAT1_(pred_format, v1, on_failure)\
- GTEST_ASSERT_(pred_format(#v1, v1), \
- on_failure)
-
-// Internal macro for implementing {EXPECT|ASSERT}_PRED1. Don't use
-// this in your code.
-#define GTEST_PRED1_(pred, v1, on_failure)\
- GTEST_ASSERT_(::testing::AssertPred1Helper(#pred, \
- #v1, \
- pred, \
- v1), on_failure)
-
-// Unary predicate assertion macros.
-#define EXPECT_PRED_FORMAT1(pred_format, v1) \
- GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_NONFATAL_FAILURE_)
-#define EXPECT_PRED1(pred, v1) \
- GTEST_PRED1_(pred, v1, GTEST_NONFATAL_FAILURE_)
-#define ASSERT_PRED_FORMAT1(pred_format, v1) \
- GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_FATAL_FAILURE_)
-#define ASSERT_PRED1(pred, v1) \
- GTEST_PRED1_(pred, v1, GTEST_FATAL_FAILURE_)
-
-
-
-// Helper function for implementing {EXPECT|ASSERT}_PRED2. Don't use
-// this in your code.
-template <typename Pred,
- typename T1,
- typename T2>
-AssertionResult AssertPred2Helper(const char* pred_text,
- const char* e1,
- const char* e2,
- Pred pred,
- const T1& v1,
- const T2& v2) {
- if (pred(v1, v2)) return AssertionSuccess();
-
- return AssertionFailure() << pred_text << "("
- << e1 << ", "
- << e2 << ") evaluates to false, where"
- << "\n" << e1 << " evaluates to " << v1
- << "\n" << e2 << " evaluates to " << v2;
-}
-
-// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT2.
-// Don't use this in your code.
-#define GTEST_PRED_FORMAT2_(pred_format, v1, v2, on_failure)\
- GTEST_ASSERT_(pred_format(#v1, #v2, v1, v2), \
- on_failure)
-
-// Internal macro for implementing {EXPECT|ASSERT}_PRED2. Don't use
-// this in your code.
-#define GTEST_PRED2_(pred, v1, v2, on_failure)\
- GTEST_ASSERT_(::testing::AssertPred2Helper(#pred, \
- #v1, \
- #v2, \
- pred, \
- v1, \
- v2), on_failure)
-
-// Binary predicate assertion macros.
-#define EXPECT_PRED_FORMAT2(pred_format, v1, v2) \
- GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_NONFATAL_FAILURE_)
-#define EXPECT_PRED2(pred, v1, v2) \
- GTEST_PRED2_(pred, v1, v2, GTEST_NONFATAL_FAILURE_)
-#define ASSERT_PRED_FORMAT2(pred_format, v1, v2) \
- GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_FATAL_FAILURE_)
-#define ASSERT_PRED2(pred, v1, v2) \
- GTEST_PRED2_(pred, v1, v2, GTEST_FATAL_FAILURE_)
-
-
-
-// Helper function for implementing {EXPECT|ASSERT}_PRED3. Don't use
-// this in your code.
-template <typename Pred,
- typename T1,
- typename T2,
- typename T3>
-AssertionResult AssertPred3Helper(const char* pred_text,
- const char* e1,
- const char* e2,
- const char* e3,
- Pred pred,
- const T1& v1,
- const T2& v2,
- const T3& v3) {
- if (pred(v1, v2, v3)) return AssertionSuccess();
-
- return AssertionFailure() << pred_text << "("
- << e1 << ", "
- << e2 << ", "
- << e3 << ") evaluates to false, where"
- << "\n" << e1 << " evaluates to " << v1
- << "\n" << e2 << " evaluates to " << v2
- << "\n" << e3 << " evaluates to " << v3;
-}
-
-// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT3.
-// Don't use this in your code.
-#define GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, on_failure)\
- GTEST_ASSERT_(pred_format(#v1, #v2, #v3, v1, v2, v3), \
- on_failure)
-
-// Internal macro for implementing {EXPECT|ASSERT}_PRED3. Don't use
-// this in your code.
-#define GTEST_PRED3_(pred, v1, v2, v3, on_failure)\
- GTEST_ASSERT_(::testing::AssertPred3Helper(#pred, \
- #v1, \
- #v2, \
- #v3, \
- pred, \
- v1, \
- v2, \
- v3), on_failure)
-
-// Ternary predicate assertion macros.
-#define EXPECT_PRED_FORMAT3(pred_format, v1, v2, v3) \
- GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_NONFATAL_FAILURE_)
-#define EXPECT_PRED3(pred, v1, v2, v3) \
- GTEST_PRED3_(pred, v1, v2, v3, GTEST_NONFATAL_FAILURE_)
-#define ASSERT_PRED_FORMAT3(pred_format, v1, v2, v3) \
- GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_FATAL_FAILURE_)
-#define ASSERT_PRED3(pred, v1, v2, v3) \
- GTEST_PRED3_(pred, v1, v2, v3, GTEST_FATAL_FAILURE_)
-
-
-
-// Helper function for implementing {EXPECT|ASSERT}_PRED4. Don't use
-// this in your code.
-template <typename Pred,
- typename T1,
- typename T2,
- typename T3,
- typename T4>
-AssertionResult AssertPred4Helper(const char* pred_text,
- const char* e1,
- const char* e2,
- const char* e3,
- const char* e4,
- Pred pred,
- const T1& v1,
- const T2& v2,
- const T3& v3,
- const T4& v4) {
- if (pred(v1, v2, v3, v4)) return AssertionSuccess();
-
- return AssertionFailure() << pred_text << "("
- << e1 << ", "
- << e2 << ", "
- << e3 << ", "
- << e4 << ") evaluates to false, where"
- << "\n" << e1 << " evaluates to " << v1
- << "\n" << e2 << " evaluates to " << v2
- << "\n" << e3 << " evaluates to " << v3
- << "\n" << e4 << " evaluates to " << v4;
-}
-
-// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT4.
-// Don't use this in your code.
-#define GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, on_failure)\
- GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, v1, v2, v3, v4), \
- on_failure)
-
-// Internal macro for implementing {EXPECT|ASSERT}_PRED4. Don't use
-// this in your code.
-#define GTEST_PRED4_(pred, v1, v2, v3, v4, on_failure)\
- GTEST_ASSERT_(::testing::AssertPred4Helper(#pred, \
- #v1, \
- #v2, \
- #v3, \
- #v4, \
- pred, \
- v1, \
- v2, \
- v3, \
- v4), on_failure)
-
-// 4-ary predicate assertion macros.
-#define EXPECT_PRED_FORMAT4(pred_format, v1, v2, v3, v4) \
- GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, GTEST_NONFATAL_FAILURE_)
-#define EXPECT_PRED4(pred, v1, v2, v3, v4) \
- GTEST_PRED4_(pred, v1, v2, v3, v4, GTEST_NONFATAL_FAILURE_)
-#define ASSERT_PRED_FORMAT4(pred_format, v1, v2, v3, v4) \
- GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, GTEST_FATAL_FAILURE_)
-#define ASSERT_PRED4(pred, v1, v2, v3, v4) \
- GTEST_PRED4_(pred, v1, v2, v3, v4, GTEST_FATAL_FAILURE_)
-
-
-
-// Helper function for implementing {EXPECT|ASSERT}_PRED5. Don't use
-// this in your code.
-template <typename Pred,
- typename T1,
- typename T2,
- typename T3,
- typename T4,
- typename T5>
-AssertionResult AssertPred5Helper(const char* pred_text,
- const char* e1,
- const char* e2,
- const char* e3,
- const char* e4,
- const char* e5,
- Pred pred,
- const T1& v1,
- const T2& v2,
- const T3& v3,
- const T4& v4,
- const T5& v5) {
- if (pred(v1, v2, v3, v4, v5)) return AssertionSuccess();
-
- return AssertionFailure() << pred_text << "("
- << e1 << ", "
- << e2 << ", "
- << e3 << ", "
- << e4 << ", "
- << e5 << ") evaluates to false, where"
- << "\n" << e1 << " evaluates to " << v1
- << "\n" << e2 << " evaluates to " << v2
- << "\n" << e3 << " evaluates to " << v3
- << "\n" << e4 << " evaluates to " << v4
- << "\n" << e5 << " evaluates to " << v5;
-}
-
-// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT5.
-// Don't use this in your code.
-#define GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, on_failure)\
- GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, #v5, v1, v2, v3, v4, v5), \
- on_failure)
-
-// Internal macro for implementing {EXPECT|ASSERT}_PRED5. Don't use
-// this in your code.
-#define GTEST_PRED5_(pred, v1, v2, v3, v4, v5, on_failure)\
- GTEST_ASSERT_(::testing::AssertPred5Helper(#pred, \
- #v1, \
- #v2, \
- #v3, \
- #v4, \
- #v5, \
- pred, \
- v1, \
- v2, \
- v3, \
- v4, \
- v5), on_failure)
-
-// 5-ary predicate assertion macros.
-#define EXPECT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5) \
- GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, GTEST_NONFATAL_FAILURE_)
-#define EXPECT_PRED5(pred, v1, v2, v3, v4, v5) \
- GTEST_PRED5_(pred, v1, v2, v3, v4, v5, GTEST_NONFATAL_FAILURE_)
-#define ASSERT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5) \
- GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, GTEST_FATAL_FAILURE_)
-#define ASSERT_PRED5(pred, v1, v2, v3, v4, v5) \
- GTEST_PRED5_(pred, v1, v2, v3, v4, v5, GTEST_FATAL_FAILURE_)
-
-
-
-#endif // GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
diff --git a/src/testing/gtest/include/gtest/gtest_prod.h b/src/testing/gtest/include/gtest/gtest_prod.h
deleted file mode 100644
index da80ddc6..00000000
--- a/src/testing/gtest/include/gtest/gtest_prod.h
+++ /dev/null
@@ -1,58 +0,0 @@
-// Copyright 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-//
-// Google C++ Testing Framework definitions useful in production code.
-
-#ifndef GTEST_INCLUDE_GTEST_GTEST_PROD_H_
-#define GTEST_INCLUDE_GTEST_GTEST_PROD_H_
-
-// When you need to test the private or protected members of a class,
-// use the FRIEND_TEST macro to declare your tests as friends of the
-// class. For example:
-//
-// class MyClass {
-// private:
-// void MyMethod();
-// FRIEND_TEST(MyClassTest, MyMethod);
-// };
-//
-// class MyClassTest : public testing::Test {
-// // ...
-// };
-//
-// TEST_F(MyClassTest, MyMethod) {
-// // Can call MyClass::MyMethod() here.
-// }
-
-#define FRIEND_TEST(test_case_name, test_name)\
-friend class test_case_name##_##test_name##_Test
-
-#endif // GTEST_INCLUDE_GTEST_GTEST_PROD_H_
diff --git a/src/testing/gtest/include/gtest/internal/gtest-death-test-internal.h b/src/testing/gtest/include/gtest/internal/gtest-death-test-internal.h
deleted file mode 100644
index 22bb97f5..00000000
--- a/src/testing/gtest/include/gtest/internal/gtest-death-test-internal.h
+++ /dev/null
@@ -1,319 +0,0 @@
-// Copyright 2005, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee)
-//
-// The Google C++ Testing Framework (Google Test)
-//
-// This header file defines internal utilities needed for implementing
-// death tests. They are subject to change without notice.
-
-#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
-#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
-
-#include "gtest/internal/gtest-internal.h"
-
-#include <stdio.h>
-
-namespace testing {
-namespace internal {
-
-GTEST_DECLARE_string_(internal_run_death_test);
-
-// Names of the flags (needed for parsing Google Test flags).
-const char kDeathTestStyleFlag[] = "death_test_style";
-const char kDeathTestUseFork[] = "death_test_use_fork";
-const char kInternalRunDeathTestFlag[] = "internal_run_death_test";
-
-#if GTEST_HAS_DEATH_TEST
-
-// DeathTest is a class that hides much of the complexity of the
-// GTEST_DEATH_TEST_ macro. It is abstract; its static Create method
-// returns a concrete class that depends on the prevailing death test
-// style, as defined by the --gtest_death_test_style and/or
-// --gtest_internal_run_death_test flags.
-
-// In describing the results of death tests, these terms are used with
-// the corresponding definitions:
-//
-// exit status: The integer exit information in the format specified
-// by wait(2)
-// exit code: The integer code passed to exit(3), _exit(2), or
-// returned from main()
-class GTEST_API_ DeathTest {
- public:
- // Create returns false if there was an error determining the
- // appropriate action to take for the current death test; for example,
- // if the gtest_death_test_style flag is set to an invalid value.
- // The LastMessage method will return a more detailed message in that
- // case. Otherwise, the DeathTest pointer pointed to by the "test"
- // argument is set. If the death test should be skipped, the pointer
- // is set to NULL; otherwise, it is set to the address of a new concrete
- // DeathTest object that controls the execution of the current test.
- static bool Create(const char* statement, const RE* regex,
- const char* file, int line, DeathTest** test);
- DeathTest();
- virtual ~DeathTest() { }
-
- // A helper class that aborts a death test when it's deleted.
- class ReturnSentinel {
- public:
- explicit ReturnSentinel(DeathTest* test) : test_(test) { }
- ~ReturnSentinel() { test_->Abort(TEST_ENCOUNTERED_RETURN_STATEMENT); }
- private:
- DeathTest* const test_;
- GTEST_DISALLOW_COPY_AND_ASSIGN_(ReturnSentinel);
- } GTEST_ATTRIBUTE_UNUSED_;
-
- // An enumeration of possible roles that may be taken when a death
- // test is encountered. EXECUTE means that the death test logic should
- // be executed immediately. OVERSEE means that the program should prepare
- // the appropriate environment for a child process to execute the death
- // test, then wait for it to complete.
- enum TestRole { OVERSEE_TEST, EXECUTE_TEST };
-
- // An enumeration of the three reasons that a test might be aborted.
- enum AbortReason {
- TEST_ENCOUNTERED_RETURN_STATEMENT,
- TEST_THREW_EXCEPTION,
- TEST_DID_NOT_DIE
- };
-
- // Assumes one of the above roles.
- virtual TestRole AssumeRole() = 0;
-
- // Waits for the death test to finish and returns its status.
- virtual int Wait() = 0;
-
- // Returns true if the death test passed; that is, the test process
- // exited during the test, its exit status matches a user-supplied
- // predicate, and its stderr output matches a user-supplied regular
- // expression.
- // The user-supplied predicate may be a macro expression rather
- // than a function pointer or functor, or else Wait and Passed could
- // be combined.
- virtual bool Passed(bool exit_status_ok) = 0;
-
- // Signals that the death test did not die as expected.
- virtual void Abort(AbortReason reason) = 0;
-
- // Returns a human-readable outcome message regarding the outcome of
- // the last death test.
- static const char* LastMessage();
-
- static void set_last_death_test_message(const String& message);
-
- private:
- // A string containing a description of the outcome of the last death test.
- static String last_death_test_message_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(DeathTest);
-};
-
-// Factory interface for death tests. May be mocked out for testing.
-class DeathTestFactory {
- public:
- virtual ~DeathTestFactory() { }
- virtual bool Create(const char* statement, const RE* regex,
- const char* file, int line, DeathTest** test) = 0;
-};
-
-// A concrete DeathTestFactory implementation for normal use.
-class DefaultDeathTestFactory : public DeathTestFactory {
- public:
- virtual bool Create(const char* statement, const RE* regex,
- const char* file, int line, DeathTest** test);
-};
-
-// Returns true if exit_status describes a process that was terminated
-// by a signal, or exited normally with a nonzero exit code.
-GTEST_API_ bool ExitedUnsuccessfully(int exit_status);
-
-// Traps C++ exceptions escaping statement and reports them as test
-// failures. Note that trapping SEH exceptions is not implemented here.
-# if GTEST_HAS_EXCEPTIONS
-# define GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, death_test) \
- try { \
- GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
- } catch (const ::std::exception& gtest_exception) { \
- fprintf(\
- stderr, \
- "\n%s: Caught std::exception-derived exception escaping the " \
- "death test statement. Exception message: %s\n", \
- ::testing::internal::FormatFileLocation(__FILE__, __LINE__).c_str(), \
- gtest_exception.what()); \
- fflush(stderr); \
- death_test->Abort(::testing::internal::DeathTest::TEST_THREW_EXCEPTION); \
- } catch (...) { \
- death_test->Abort(::testing::internal::DeathTest::TEST_THREW_EXCEPTION); \
- }
-
-# else
-# define GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, death_test) \
- GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement)
-
-# endif
-
-// This macro is for implementing ASSERT_DEATH*, EXPECT_DEATH*,
-// ASSERT_EXIT*, and EXPECT_EXIT*.
-# define GTEST_DEATH_TEST_(statement, predicate, regex, fail) \
- GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
- if (::testing::internal::AlwaysTrue()) { \
- const ::testing::internal::RE& gtest_regex = (regex); \
- ::testing::internal::DeathTest* gtest_dt; \
- if (!::testing::internal::DeathTest::Create(#statement, &gtest_regex, \
- __FILE__, __LINE__, &gtest_dt)) { \
- goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \
- } \
- if (gtest_dt != NULL) { \
- ::testing::internal::scoped_ptr< ::testing::internal::DeathTest> \
- gtest_dt_ptr(gtest_dt); \
- switch (gtest_dt->AssumeRole()) { \
- case ::testing::internal::DeathTest::OVERSEE_TEST: \
- if (!gtest_dt->Passed(predicate(gtest_dt->Wait()))) { \
- goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \
- } \
- break; \
- case ::testing::internal::DeathTest::EXECUTE_TEST: { \
- ::testing::internal::DeathTest::ReturnSentinel \
- gtest_sentinel(gtest_dt); \
- GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, gtest_dt); \
- gtest_dt->Abort(::testing::internal::DeathTest::TEST_DID_NOT_DIE); \
- break; \
- } \
- default: \
- break; \
- } \
- } \
- } else \
- GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__): \
- fail(::testing::internal::DeathTest::LastMessage())
-// The symbol "fail" here expands to something into which a message
-// can be streamed.
-
-// This macro is for implementing ASSERT/EXPECT_DEBUG_DEATH when compiled in
-// NDEBUG mode. In this case we need the statements to be executed, the regex is
-// ignored, and the macro must accept a streamed message even though the message
-// is never printed.
-# define GTEST_EXECUTE_STATEMENT_(statement, regex) \
- GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
- if (::testing::internal::AlwaysTrue()) { \
- GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
- } else \
- ::testing::Message()
-
-// A class representing the parsed contents of the
-// --gtest_internal_run_death_test flag, as it existed when
-// RUN_ALL_TESTS was called.
-class InternalRunDeathTestFlag {
- public:
- InternalRunDeathTestFlag(const String& a_file,
- int a_line,
- int an_index,
- int a_write_fd)
- : file_(a_file), line_(a_line), index_(an_index),
- write_fd_(a_write_fd) {}
-
- ~InternalRunDeathTestFlag() {
- if (write_fd_ >= 0)
- posix::Close(write_fd_);
- }
-
- String file() const { return file_; }
- int line() const { return line_; }
- int index() const { return index_; }
- int write_fd() const { return write_fd_; }
-
- private:
- String file_;
- int line_;
- int index_;
- int write_fd_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(InternalRunDeathTestFlag);
-};
-
-// Returns a newly created InternalRunDeathTestFlag object with fields
-// initialized from the GTEST_FLAG(internal_run_death_test) flag if
-// the flag is specified; otherwise returns NULL.
-InternalRunDeathTestFlag* ParseInternalRunDeathTestFlag();
-
-#else // GTEST_HAS_DEATH_TEST
-
-// This macro is used for implementing macros such as
-// EXPECT_DEATH_IF_SUPPORTED and ASSERT_DEATH_IF_SUPPORTED on systems where
-// death tests are not supported. Those macros must compile on such systems
-// iff EXPECT_DEATH and ASSERT_DEATH compile with the same parameters on
-// systems that support death tests. This allows one to write such a macro
-// on a system that does not support death tests and be sure that it will
-// compile on a death-test supporting system.
-//
-// Parameters:
-// statement - A statement that a macro such as EXPECT_DEATH would test
-// for program termination. This macro has to make sure this
-// statement is compiled but not executed, to ensure that
-// EXPECT_DEATH_IF_SUPPORTED compiles with a certain
-// parameter iff EXPECT_DEATH compiles with it.
-// regex - A regex that a macro such as EXPECT_DEATH would use to test
-// the output of statement. This parameter has to be
-// compiled but not evaluated by this macro, to ensure that
-// this macro only accepts expressions that a macro such as
-// EXPECT_DEATH would accept.
-// terminator - Must be an empty statement for EXPECT_DEATH_IF_SUPPORTED
-// and a return statement for ASSERT_DEATH_IF_SUPPORTED.
-// This ensures that ASSERT_DEATH_IF_SUPPORTED will not
-// compile inside functions where ASSERT_DEATH doesn't
-// compile.
-//
-// The branch that has an always false condition is used to ensure that
-// statement and regex are compiled (and thus syntactically correct) but
-// never executed. The unreachable code macro protects the terminator
-// statement from generating an 'unreachable code' warning in case
-// statement unconditionally returns or throws. The Message constructor at
-// the end allows the syntax of streaming additional messages into the
-// macro, for compilational compatibility with EXPECT_DEATH/ASSERT_DEATH.
-# define GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, terminator) \
- GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
- if (::testing::internal::AlwaysTrue()) { \
- GTEST_LOG_(WARNING) \
- << "Death tests are not supported on this platform.\n" \
- << "Statement '" #statement "' cannot be verified."; \
- } else if (::testing::internal::AlwaysFalse()) { \
- ::testing::internal::RE::PartialMatch(".*", (regex)); \
- GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
- terminator; \
- } else \
- ::testing::Message()
-
-#endif // GTEST_HAS_DEATH_TEST
-
-} // namespace internal
-} // namespace testing
-
-#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
diff --git a/src/testing/gtest/include/gtest/internal/gtest-filepath.h b/src/testing/gtest/include/gtest/internal/gtest-filepath.h
deleted file mode 100644
index b36b3cf2..00000000
--- a/src/testing/gtest/include/gtest/internal/gtest-filepath.h
+++ /dev/null
@@ -1,210 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: keith.ray@gmail.com (Keith Ray)
-//
-// Google Test filepath utilities
-//
-// This header file declares classes and functions used internally by
-// Google Test. They are subject to change without notice.
-//
-// This file is #included in <gtest/internal/gtest-internal.h>.
-// Do not include this header file separately!
-
-#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
-#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
-
-#include "gtest/internal/gtest-string.h"
-
-namespace testing {
-namespace internal {
-
-// FilePath - a class for file and directory pathname manipulation which
-// handles platform-specific conventions (like the pathname separator).
-// Used for helper functions for naming files in a directory for xml output.
-// Except for Set methods, all methods are const or static, which provides an
-// "immutable value object" -- useful for peace of mind.
-// A FilePath with a value ending in a path separator ("like/this/") represents
-// a directory, otherwise it is assumed to represent a file. In either case,
-// it may or may not represent an actual file or directory in the file system.
-// Names are NOT checked for syntax correctness -- no checking for illegal
-// characters, malformed paths, etc.
-
-class GTEST_API_ FilePath {
- public:
- FilePath() : pathname_("") { }
- FilePath(const FilePath& rhs) : pathname_(rhs.pathname_) { }
-
- explicit FilePath(const char* pathname) : pathname_(pathname) {
- Normalize();
- }
-
- explicit FilePath(const String& pathname) : pathname_(pathname) {
- Normalize();
- }
-
- FilePath& operator=(const FilePath& rhs) {
- Set(rhs);
- return *this;
- }
-
- void Set(const FilePath& rhs) {
- pathname_ = rhs.pathname_;
- }
-
- String ToString() const { return pathname_; }
- const char* c_str() const { return pathname_.c_str(); }
-
- // Returns the current working directory, or "" if unsuccessful.
- static FilePath GetCurrentDir();
-
- // Given directory = "dir", base_name = "test", number = 0,
- // extension = "xml", returns "dir/test.xml". If number is greater
- // than zero (e.g., 12), returns "dir/test_12.xml".
- // On Windows platform, uses \ as the separator rather than /.
- static FilePath MakeFileName(const FilePath& directory,
- const FilePath& base_name,
- int number,
- const char* extension);
-
- // Given directory = "dir", relative_path = "test.xml",
- // returns "dir/test.xml".
- // On Windows, uses \ as the separator rather than /.
- static FilePath ConcatPaths(const FilePath& directory,
- const FilePath& relative_path);
-
- // Returns a pathname for a file that does not currently exist. The pathname
- // will be directory/base_name.extension or
- // directory/base_name_<number>.extension if directory/base_name.extension
- // already exists. The number will be incremented until a pathname is found
- // that does not already exist.
- // Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'.
- // There could be a race condition if two or more processes are calling this
- // function at the same time -- they could both pick the same filename.
- static FilePath GenerateUniqueFileName(const FilePath& directory,
- const FilePath& base_name,
- const char* extension);
-
- // Returns true iff the path is NULL or "".
- bool IsEmpty() const { return c_str() == NULL || *c_str() == '\0'; }
-
- // If input name has a trailing separator character, removes it and returns
- // the name, otherwise return the name string unmodified.
- // On Windows platform, uses \ as the separator, other platforms use /.
- FilePath RemoveTrailingPathSeparator() const;
-
- // Returns a copy of the FilePath with the directory part removed.
- // Example: FilePath("path/to/file").RemoveDirectoryName() returns
- // FilePath("file"). If there is no directory part ("just_a_file"), it returns
- // the FilePath unmodified. If there is no file part ("just_a_dir/") it
- // returns an empty FilePath ("").
- // On Windows platform, '\' is the path separator, otherwise it is '/'.
- FilePath RemoveDirectoryName() const;
-
- // RemoveFileName returns the directory path with the filename removed.
- // Example: FilePath("path/to/file").RemoveFileName() returns "path/to/".
- // If the FilePath is "a_file" or "/a_file", RemoveFileName returns
- // FilePath("./") or, on Windows, FilePath(".\\"). If the filepath does
- // not have a file, like "just/a/dir/", it returns the FilePath unmodified.
- // On Windows platform, '\' is the path separator, otherwise it is '/'.
- FilePath RemoveFileName() const;
-
- // Returns a copy of the FilePath with the case-insensitive extension removed.
- // Example: FilePath("dir/file.exe").RemoveExtension("EXE") returns
- // FilePath("dir/file"). If a case-insensitive extension is not
- // found, returns a copy of the original FilePath.
- FilePath RemoveExtension(const char* extension) const;
-
- // Creates directories so that path exists. Returns true if successful or if
- // the directories already exist; returns false if unable to create
- // directories for any reason. Will also return false if the FilePath does
- // not represent a directory (that is, it doesn't end with a path separator).
- bool CreateDirectoriesRecursively() const;
-
- // Create the directory so that path exists. Returns true if successful or
- // if the directory already exists; returns false if unable to create the
- // directory for any reason, including if the parent directory does not
- // exist. Not named "CreateDirectory" because that's a macro on Windows.
- bool CreateFolder() const;
-
- // Returns true if FilePath describes something in the file-system,
- // either a file, directory, or whatever, and that something exists.
- bool FileOrDirectoryExists() const;
-
- // Returns true if pathname describes a directory in the file-system
- // that exists.
- bool DirectoryExists() const;
-
- // Returns true if FilePath ends with a path separator, which indicates that
- // it is intended to represent a directory. Returns false otherwise.
- // This does NOT check that a directory (or file) actually exists.
- bool IsDirectory() const;
-
- // Returns true if pathname describes a root directory. (Windows has one
- // root directory per disk drive.)
- bool IsRootDirectory() const;
-
- // Returns true if pathname describes an absolute path.
- bool IsAbsolutePath() const;
-
- private:
- // Replaces multiple consecutive separators with a single separator.
- // For example, "bar///foo" becomes "bar/foo". Does not eliminate other
- // redundancies that might be in a pathname involving "." or "..".
- //
- // A pathname with multiple consecutive separators may occur either through
- // user error or as a result of some scripts or APIs that generate a pathname
- // with a trailing separator. On other platforms the same API or script
- // may NOT generate a pathname with a trailing "/". Then elsewhere that
- // pathname may have another "/" and pathname components added to it,
- // without checking for the separator already being there.
- // The script language and operating system may allow paths like "foo//bar"
- // but some of the functions in FilePath will not handle that correctly. In
- // particular, RemoveTrailingPathSeparator() only removes one separator, and
- // it is called in CreateDirectoriesRecursively() assuming that it will change
- // a pathname from directory syntax (trailing separator) to filename syntax.
- //
- // On Windows this method also replaces the alternate path separator '/' with
- // the primary path separator '\\', so that for example "bar\\/\\foo" becomes
- // "bar\\foo".
-
- void Normalize();
-
- // Returns a pointer to the last occurence of a valid path separator in
- // the FilePath. On Windows, for example, both '/' and '\' are valid path
- // separators. Returns NULL if no path separator was found.
- const char* FindLastPathSeparator() const;
-
- String pathname_;
-}; // class FilePath
-
-} // namespace internal
-} // namespace testing
-
-#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
diff --git a/src/testing/gtest/include/gtest/internal/gtest-internal.h b/src/testing/gtest/include/gtest/internal/gtest-internal.h
deleted file mode 100644
index d8834500..00000000
--- a/src/testing/gtest/include/gtest/internal/gtest-internal.h
+++ /dev/null
@@ -1,1232 +0,0 @@
-// Copyright 2005, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee)
-//
-// The Google C++ Testing Framework (Google Test)
-//
-// This header file declares functions and macros used internally by
-// Google Test. They are subject to change without notice.
-
-#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
-#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
-
-#include "gtest/internal/gtest-port.h"
-
-#if GTEST_OS_LINUX
-# include <stdlib.h>
-# include <sys/types.h>
-# include <sys/wait.h>
-# include <unistd.h>
-#endif // GTEST_OS_LINUX
-
-#include <ctype.h>
-#include <string.h>
-#include <iomanip>
-#include <limits>
-#include <set>
-
-#include "gtest/internal/gtest-string.h"
-#include "gtest/internal/gtest-filepath.h"
-#include "gtest/internal/gtest-type-util.h"
-
-// Due to C++ preprocessor weirdness, we need double indirection to
-// concatenate two tokens when one of them is __LINE__. Writing
-//
-// foo ## __LINE__
-//
-// will result in the token foo__LINE__, instead of foo followed by
-// the current line number. For more details, see
-// http://www.parashift.com/c++-faq-lite/misc-technical-issues.html#faq-39.6
-#define GTEST_CONCAT_TOKEN_(foo, bar) GTEST_CONCAT_TOKEN_IMPL_(foo, bar)
-#define GTEST_CONCAT_TOKEN_IMPL_(foo, bar) foo ## bar
-
-// Google Test defines the testing::Message class to allow construction of
-// test messages via the << operator. The idea is that anything
-// streamable to std::ostream can be streamed to a testing::Message.
-// This allows a user to use his own types in Google Test assertions by
-// overloading the << operator.
-//
-// util/gtl/stl_logging-inl.h overloads << for STL containers. These
-// overloads cannot be defined in the std namespace, as that will be
-// undefined behavior. Therefore, they are defined in the global
-// namespace instead.
-//
-// C++'s symbol lookup rule (i.e. Koenig lookup) says that these
-// overloads are visible in either the std namespace or the global
-// namespace, but not other namespaces, including the testing
-// namespace which Google Test's Message class is in.
-//
-// To allow STL containers (and other types that has a << operator
-// defined in the global namespace) to be used in Google Test assertions,
-// testing::Message must access the custom << operator from the global
-// namespace. Hence this helper function.
-//
-// Note: Jeffrey Yasskin suggested an alternative fix by "using
-// ::operator<<;" in the definition of Message's operator<<. That fix
-// doesn't require a helper function, but unfortunately doesn't
-// compile with MSVC.
-template <typename T>
-inline void GTestStreamToHelper(std::ostream* os, const T& val) {
- *os << val;
-}
-
-class ProtocolMessage;
-namespace proto2 { class Message; }
-
-namespace testing {
-
-// Forward declarations.
-
-class AssertionResult; // Result of an assertion.
-class Message; // Represents a failure message.
-class Test; // Represents a test.
-class TestInfo; // Information about a test.
-class TestPartResult; // Result of a test part.
-class UnitTest; // A collection of test cases.
-
-template <typename T>
-::std::string PrintToString(const T& value);
-
-namespace internal {
-
-struct TraceInfo; // Information about a trace point.
-class ScopedTrace; // Implements scoped trace.
-class TestInfoImpl; // Opaque implementation of TestInfo
-class UnitTestImpl; // Opaque implementation of UnitTest
-
-// How many times InitGoogleTest() has been called.
-GTEST_API_ extern int g_init_gtest_count;
-
-// The text used in failure messages to indicate the start of the
-// stack trace.
-GTEST_API_ extern const char kStackTraceMarker[];
-
-// A secret type that Google Test users don't know about. It has no
-// definition on purpose. Therefore it's impossible to create a
-// Secret object, which is what we want.
-class Secret;
-
-// Two overloaded helpers for checking at compile time whether an
-// expression is a null pointer literal (i.e. NULL or any 0-valued
-// compile-time integral constant). Their return values have
-// different sizes, so we can use sizeof() to test which version is
-// picked by the compiler. These helpers have no implementations, as
-// we only need their signatures.
-//
-// Given IsNullLiteralHelper(x), the compiler will pick the first
-// version if x can be implicitly converted to Secret*, and pick the
-// second version otherwise. Since Secret is a secret and incomplete
-// type, the only expression a user can write that has type Secret* is
-// a null pointer literal. Therefore, we know that x is a null
-// pointer literal if and only if the first version is picked by the
-// compiler.
-char IsNullLiteralHelper(Secret* p);
-char (&IsNullLiteralHelper(...))[2]; // NOLINT
-
-// A compile-time bool constant that is true if and only if x is a
-// null pointer literal (i.e. NULL or any 0-valued compile-time
-// integral constant).
-#ifdef GTEST_ELLIPSIS_NEEDS_POD_
-// We lose support for NULL detection where the compiler doesn't like
-// passing non-POD classes through ellipsis (...).
-# define GTEST_IS_NULL_LITERAL_(x) false
-#else
-# define GTEST_IS_NULL_LITERAL_(x) \
- (sizeof(::testing::internal::IsNullLiteralHelper(x)) == 1)
-#endif // GTEST_ELLIPSIS_NEEDS_POD_
-
-// Appends the user-supplied message to the Google-Test-generated message.
-GTEST_API_ String AppendUserMessage(const String& gtest_msg,
- const Message& user_msg);
-
-// A helper class for creating scoped traces in user programs.
-class GTEST_API_ ScopedTrace {
- public:
- // The c'tor pushes the given source file location and message onto
- // a trace stack maintained by Google Test.
- ScopedTrace(const char* file, int line, const Message& message);
-
- // The d'tor pops the info pushed by the c'tor.
- //
- // Note that the d'tor is not virtual in order to be efficient.
- // Don't inherit from ScopedTrace!
- ~ScopedTrace();
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(ScopedTrace);
-} GTEST_ATTRIBUTE_UNUSED_; // A ScopedTrace object does its job in its
- // c'tor and d'tor. Therefore it doesn't
- // need to be used otherwise.
-
-// Converts a streamable value to a String. A NULL pointer is
-// converted to "(null)". When the input value is a ::string,
-// ::std::string, ::wstring, or ::std::wstring object, each NUL
-// character in it is replaced with "\\0".
-// Declared here but defined in gtest.h, so that it has access
-// to the definition of the Message class, required by the ARM
-// compiler.
-template <typename T>
-String StreamableToString(const T& streamable);
-
-// The Symbian compiler has a bug that prevents it from selecting the
-// correct overload of FormatForComparisonFailureMessage (see below)
-// unless we pass the first argument by reference. If we do that,
-// however, Visual Age C++ 10.1 generates a compiler error. Therefore
-// we only apply the work-around for Symbian.
-#if defined(__SYMBIAN32__)
-# define GTEST_CREF_WORKAROUND_ const&
-#else
-# define GTEST_CREF_WORKAROUND_
-#endif
-
-// When this operand is a const char* or char*, if the other operand
-// is a ::std::string or ::string, we print this operand as a C string
-// rather than a pointer (we do the same for wide strings); otherwise
-// we print it as a pointer to be safe.
-
-// This internal macro is used to avoid duplicated code.
-#define GTEST_FORMAT_IMPL_(operand2_type, operand1_printer)\
-inline String FormatForComparisonFailureMessage(\
- operand2_type::value_type* GTEST_CREF_WORKAROUND_ str, \
- const operand2_type& /*operand2*/) {\
- return operand1_printer(str);\
-}\
-inline String FormatForComparisonFailureMessage(\
- const operand2_type::value_type* GTEST_CREF_WORKAROUND_ str, \
- const operand2_type& /*operand2*/) {\
- return operand1_printer(str);\
-}
-
-GTEST_FORMAT_IMPL_(::std::string, String::ShowCStringQuoted)
-#if GTEST_HAS_STD_WSTRING
-GTEST_FORMAT_IMPL_(::std::wstring, String::ShowWideCStringQuoted)
-#endif // GTEST_HAS_STD_WSTRING
-
-#if GTEST_HAS_GLOBAL_STRING
-GTEST_FORMAT_IMPL_(::string, String::ShowCStringQuoted)
-#endif // GTEST_HAS_GLOBAL_STRING
-#if GTEST_HAS_GLOBAL_WSTRING
-GTEST_FORMAT_IMPL_(::wstring, String::ShowWideCStringQuoted)
-#endif // GTEST_HAS_GLOBAL_WSTRING
-
-#undef GTEST_FORMAT_IMPL_
-
-// The next four overloads handle the case where the operand being
-// printed is a char/wchar_t pointer and the other operand is not a
-// string/wstring object. In such cases, we just print the operand as
-// a pointer to be safe.
-#define GTEST_FORMAT_CHAR_PTR_IMPL_(CharType) \
- template <typename T> \
- String FormatForComparisonFailureMessage(CharType* GTEST_CREF_WORKAROUND_ p, \
- const T&) { \
- return PrintToString(static_cast<const void*>(p)); \
- }
-
-GTEST_FORMAT_CHAR_PTR_IMPL_(char)
-GTEST_FORMAT_CHAR_PTR_IMPL_(const char)
-GTEST_FORMAT_CHAR_PTR_IMPL_(wchar_t)
-GTEST_FORMAT_CHAR_PTR_IMPL_(const wchar_t)
-
-#undef GTEST_FORMAT_CHAR_PTR_IMPL_
-
-// Constructs and returns the message for an equality assertion
-// (e.g. ASSERT_EQ, EXPECT_STREQ, etc) failure.
-//
-// The first four parameters are the expressions used in the assertion
-// and their values, as strings. For example, for ASSERT_EQ(foo, bar)
-// where foo is 5 and bar is 6, we have:
-//
-// expected_expression: "foo"
-// actual_expression: "bar"
-// expected_value: "5"
-// actual_value: "6"
-//
-// The ignoring_case parameter is true iff the assertion is a
-// *_STRCASEEQ*. When it's true, the string " (ignoring case)" will
-// be inserted into the message.
-GTEST_API_ AssertionResult EqFailure(const char* expected_expression,
- const char* actual_expression,
- const String& expected_value,
- const String& actual_value,
- bool ignoring_case);
-
-// Constructs a failure message for Boolean assertions such as EXPECT_TRUE.
-GTEST_API_ String GetBoolAssertionFailureMessage(
- const AssertionResult& assertion_result,
- const char* expression_text,
- const char* actual_predicate_value,
- const char* expected_predicate_value);
-
-// This template class represents an IEEE floating-point number
-// (either single-precision or double-precision, depending on the
-// template parameters).
-//
-// The purpose of this class is to do more sophisticated number
-// comparison. (Due to round-off error, etc, it's very unlikely that
-// two floating-points will be equal exactly. Hence a naive
-// comparison by the == operation often doesn't work.)
-//
-// Format of IEEE floating-point:
-//
-// The most-significant bit being the leftmost, an IEEE
-// floating-point looks like
-//
-// sign_bit exponent_bits fraction_bits
-//
-// Here, sign_bit is a single bit that designates the sign of the
-// number.
-//
-// For float, there are 8 exponent bits and 23 fraction bits.
-//
-// For double, there are 11 exponent bits and 52 fraction bits.
-//
-// More details can be found at
-// http://en.wikipedia.org/wiki/IEEE_floating-point_standard.
-//
-// Template parameter:
-//
-// RawType: the raw floating-point type (either float or double)
-template <typename RawType>
-class FloatingPoint {
- public:
- // Defines the unsigned integer type that has the same size as the
- // floating point number.
- typedef typename TypeWithSize<sizeof(RawType)>::UInt Bits;
-
- // Constants.
-
- // # of bits in a number.
- static const size_t kBitCount = 8*sizeof(RawType);
-
- // # of fraction bits in a number.
- static const size_t kFractionBitCount =
- std::numeric_limits<RawType>::digits - 1;
-
- // # of exponent bits in a number.
- static const size_t kExponentBitCount = kBitCount - 1 - kFractionBitCount;
-
- // The mask for the sign bit.
- static const Bits kSignBitMask = static_cast<Bits>(1) << (kBitCount - 1);
-
- // The mask for the fraction bits.
- static const Bits kFractionBitMask =
- ~static_cast<Bits>(0) >> (kExponentBitCount + 1);
-
- // The mask for the exponent bits.
- static const Bits kExponentBitMask = ~(kSignBitMask | kFractionBitMask);
-
- // How many ULP's (Units in the Last Place) we want to tolerate when
- // comparing two numbers. The larger the value, the more error we
- // allow. A 0 value means that two numbers must be exactly the same
- // to be considered equal.
- //
- // The maximum error of a single floating-point operation is 0.5
- // units in the last place. On Intel CPU's, all floating-point
- // calculations are done with 80-bit precision, while double has 64
- // bits. Therefore, 4 should be enough for ordinary use.
- //
- // See the following article for more details on ULP:
- // http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm.
- static const size_t kMaxUlps = 4;
-
- // Constructs a FloatingPoint from a raw floating-point number.
- //
- // On an Intel CPU, passing a non-normalized NAN (Not a Number)
- // around may change its bits, although the new value is guaranteed
- // to be also a NAN. Therefore, don't expect this constructor to
- // preserve the bits in x when x is a NAN.
- explicit FloatingPoint(const RawType& x) { u_.value_ = x; }
-
- // Static methods
-
- // Reinterprets a bit pattern as a floating-point number.
- //
- // This function is needed to test the AlmostEquals() method.
- static RawType ReinterpretBits(const Bits bits) {
- FloatingPoint fp(0);
- fp.u_.bits_ = bits;
- return fp.u_.value_;
- }
-
- // Returns the floating-point number that represent positive infinity.
- static RawType Infinity() {
- return ReinterpretBits(kExponentBitMask);
- }
-
- // Non-static methods
-
- // Returns the bits that represents this number.
- const Bits &bits() const { return u_.bits_; }
-
- // Returns the exponent bits of this number.
- Bits exponent_bits() const { return kExponentBitMask & u_.bits_; }
-
- // Returns the fraction bits of this number.
- Bits fraction_bits() const { return kFractionBitMask & u_.bits_; }
-
- // Returns the sign bit of this number.
- Bits sign_bit() const { return kSignBitMask & u_.bits_; }
-
- // Returns true iff this is NAN (not a number).
- bool is_nan() const {
- // It's a NAN if the exponent bits are all ones and the fraction
- // bits are not entirely zeros.
- return (exponent_bits() == kExponentBitMask) && (fraction_bits() != 0);
- }
-
- // Returns true iff this number is at most kMaxUlps ULP's away from
- // rhs. In particular, this function:
- //
- // - returns false if either number is (or both are) NAN.
- // - treats really large numbers as almost equal to infinity.
- // - thinks +0.0 and -0.0 are 0 DLP's apart.
- bool AlmostEquals(const FloatingPoint& rhs) const {
- // The IEEE standard says that any comparison operation involving
- // a NAN must return false.
- if (is_nan() || rhs.is_nan()) return false;
-
- return DistanceBetweenSignAndMagnitudeNumbers(u_.bits_, rhs.u_.bits_)
- <= kMaxUlps;
- }
-
- private:
- // The data type used to store the actual floating-point number.
- union FloatingPointUnion {
- RawType value_; // The raw floating-point number.
- Bits bits_; // The bits that represent the number.
- };
-
- // Converts an integer from the sign-and-magnitude representation to
- // the biased representation. More precisely, let N be 2 to the
- // power of (kBitCount - 1), an integer x is represented by the
- // unsigned number x + N.
- //
- // For instance,
- //
- // -N + 1 (the most negative number representable using
- // sign-and-magnitude) is represented by 1;
- // 0 is represented by N; and
- // N - 1 (the biggest number representable using
- // sign-and-magnitude) is represented by 2N - 1.
- //
- // Read http://en.wikipedia.org/wiki/Signed_number_representations
- // for more details on signed number representations.
- static Bits SignAndMagnitudeToBiased(const Bits &sam) {
- if (kSignBitMask & sam) {
- // sam represents a negative number.
- return ~sam + 1;
- } else {
- // sam represents a positive number.
- return kSignBitMask | sam;
- }
- }
-
- // Given two numbers in the sign-and-magnitude representation,
- // returns the distance between them as an unsigned number.
- static Bits DistanceBetweenSignAndMagnitudeNumbers(const Bits &sam1,
- const Bits &sam2) {
- const Bits biased1 = SignAndMagnitudeToBiased(sam1);
- const Bits biased2 = SignAndMagnitudeToBiased(sam2);
- return (biased1 >= biased2) ? (biased1 - biased2) : (biased2 - biased1);
- }
-
- FloatingPointUnion u_;
-};
-
-// Typedefs the instances of the FloatingPoint template class that we
-// care to use.
-typedef FloatingPoint<float> Float;
-typedef FloatingPoint<double> Double;
-
-// In order to catch the mistake of putting tests that use different
-// test fixture classes in the same test case, we need to assign
-// unique IDs to fixture classes and compare them. The TypeId type is
-// used to hold such IDs. The user should treat TypeId as an opaque
-// type: the only operation allowed on TypeId values is to compare
-// them for equality using the == operator.
-typedef const void* TypeId;
-
-template <typename T>
-class TypeIdHelper {
- public:
- // dummy_ must not have a const type. Otherwise an overly eager
- // compiler (e.g. MSVC 7.1 & 8.0) may try to merge
- // TypeIdHelper<T>::dummy_ for different Ts as an "optimization".
- static bool dummy_;
-};
-
-template <typename T>
-bool TypeIdHelper<T>::dummy_ = false;
-
-// GetTypeId<T>() returns the ID of type T. Different values will be
-// returned for different types. Calling the function twice with the
-// same type argument is guaranteed to return the same ID.
-template <typename T>
-TypeId GetTypeId() {
- // The compiler is required to allocate a different
- // TypeIdHelper<T>::dummy_ variable for each T used to instantiate
- // the template. Therefore, the address of dummy_ is guaranteed to
- // be unique.
- return &(TypeIdHelper<T>::dummy_);
-}
-
-// Returns the type ID of ::testing::Test. Always call this instead
-// of GetTypeId< ::testing::Test>() to get the type ID of
-// ::testing::Test, as the latter may give the wrong result due to a
-// suspected linker bug when compiling Google Test as a Mac OS X
-// framework.
-GTEST_API_ TypeId GetTestTypeId();
-
-// Defines the abstract factory interface that creates instances
-// of a Test object.
-class TestFactoryBase {
- public:
- virtual ~TestFactoryBase() {}
-
- // Creates a test instance to run. The instance is both created and destroyed
- // within TestInfoImpl::Run()
- virtual Test* CreateTest() = 0;
-
- protected:
- TestFactoryBase() {}
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(TestFactoryBase);
-};
-
-// This class provides implementation of TeastFactoryBase interface.
-// It is used in TEST and TEST_F macros.
-template <class TestClass>
-class TestFactoryImpl : public TestFactoryBase {
- public:
- virtual Test* CreateTest() { return new TestClass; }
-};
-
-#if GTEST_OS_WINDOWS
-
-// Predicate-formatters for implementing the HRESULT checking macros
-// {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}
-// We pass a long instead of HRESULT to avoid causing an
-// include dependency for the HRESULT type.
-GTEST_API_ AssertionResult IsHRESULTSuccess(const char* expr,
- long hr); // NOLINT
-GTEST_API_ AssertionResult IsHRESULTFailure(const char* expr,
- long hr); // NOLINT
-
-#endif // GTEST_OS_WINDOWS
-
-// Types of SetUpTestCase() and TearDownTestCase() functions.
-typedef void (*SetUpTestCaseFunc)();
-typedef void (*TearDownTestCaseFunc)();
-
-// Creates a new TestInfo object and registers it with Google Test;
-// returns the created object.
-//
-// Arguments:
-//
-// test_case_name: name of the test case
-// name: name of the test
-// type_param the name of the test's type parameter, or NULL if
-// this is not a typed or a type-parameterized test.
-// value_param text representation of the test's value parameter,
-// or NULL if this is not a type-parameterized test.
-// fixture_class_id: ID of the test fixture class
-// set_up_tc: pointer to the function that sets up the test case
-// tear_down_tc: pointer to the function that tears down the test case
-// factory: pointer to the factory that creates a test object.
-// The newly created TestInfo instance will assume
-// ownership of the factory object.
-GTEST_API_ TestInfo* MakeAndRegisterTestInfo(
- const char* test_case_name, const char* name,
- const char* type_param,
- const char* value_param,
- TypeId fixture_class_id,
- SetUpTestCaseFunc set_up_tc,
- TearDownTestCaseFunc tear_down_tc,
- TestFactoryBase* factory);
-
-// If *pstr starts with the given prefix, modifies *pstr to be right
-// past the prefix and returns true; otherwise leaves *pstr unchanged
-// and returns false. None of pstr, *pstr, and prefix can be NULL.
-GTEST_API_ bool SkipPrefix(const char* prefix, const char** pstr);
-
-#if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
-
-// State of the definition of a type-parameterized test case.
-class GTEST_API_ TypedTestCasePState {
- public:
- TypedTestCasePState() : registered_(false) {}
-
- // Adds the given test name to defined_test_names_ and return true
- // if the test case hasn't been registered; otherwise aborts the
- // program.
- bool AddTestName(const char* file, int line, const char* case_name,
- const char* test_name) {
- if (registered_) {
- fprintf(stderr, "%s Test %s must be defined before "
- "REGISTER_TYPED_TEST_CASE_P(%s, ...).\n",
- FormatFileLocation(file, line).c_str(), test_name, case_name);
- fflush(stderr);
- posix::Abort();
- }
- defined_test_names_.insert(test_name);
- return true;
- }
-
- // Verifies that registered_tests match the test names in
- // defined_test_names_; returns registered_tests if successful, or
- // aborts the program otherwise.
- const char* VerifyRegisteredTestNames(
- const char* file, int line, const char* registered_tests);
-
- private:
- bool registered_;
- ::std::set<const char*> defined_test_names_;
-};
-
-// Skips to the first non-space char after the first comma in 'str';
-// returns NULL if no comma is found in 'str'.
-inline const char* SkipComma(const char* str) {
- const char* comma = strchr(str, ',');
- if (comma == NULL) {
- return NULL;
- }
- while (IsSpace(*(++comma))) {}
- return comma;
-}
-
-// Returns the prefix of 'str' before the first comma in it; returns
-// the entire string if it contains no comma.
-inline String GetPrefixUntilComma(const char* str) {
- const char* comma = strchr(str, ',');
- return comma == NULL ? String(str) : String(str, comma - str);
-}
-
-// TypeParameterizedTest<Fixture, TestSel, Types>::Register()
-// registers a list of type-parameterized tests with Google Test. The
-// return value is insignificant - we just need to return something
-// such that we can call this function in a namespace scope.
-//
-// Implementation note: The GTEST_TEMPLATE_ macro declares a template
-// template parameter. It's defined in gtest-type-util.h.
-template <GTEST_TEMPLATE_ Fixture, class TestSel, typename Types>
-class TypeParameterizedTest {
- public:
- // 'index' is the index of the test in the type list 'Types'
- // specified in INSTANTIATE_TYPED_TEST_CASE_P(Prefix, TestCase,
- // Types). Valid values for 'index' are [0, N - 1] where N is the
- // length of Types.
- static bool Register(const char* prefix, const char* case_name,
- const char* test_names, int index) {
- typedef typename Types::Head Type;
- typedef Fixture<Type> FixtureClass;
- typedef typename GTEST_BIND_(TestSel, Type) TestClass;
-
- // First, registers the first type-parameterized test in the type
- // list.
- MakeAndRegisterTestInfo(
- String::Format("%s%s%s/%d", prefix, prefix[0] == '\0' ? "" : "/",
- case_name, index).c_str(),
- GetPrefixUntilComma(test_names).c_str(),
- GetTypeName<Type>().c_str(),
- NULL, // No value parameter.
- GetTypeId<FixtureClass>(),
- TestClass::SetUpTestCase,
- TestClass::TearDownTestCase,
- new TestFactoryImpl<TestClass>);
-
- // Next, recurses (at compile time) with the tail of the type list.
- return TypeParameterizedTest<Fixture, TestSel, typename Types::Tail>
- ::Register(prefix, case_name, test_names, index + 1);
- }
-};
-
-// The base case for the compile time recursion.
-template <GTEST_TEMPLATE_ Fixture, class TestSel>
-class TypeParameterizedTest<Fixture, TestSel, Types0> {
- public:
- static bool Register(const char* /*prefix*/, const char* /*case_name*/,
- const char* /*test_names*/, int /*index*/) {
- return true;
- }
-};
-
-// TypeParameterizedTestCase<Fixture, Tests, Types>::Register()
-// registers *all combinations* of 'Tests' and 'Types' with Google
-// Test. The return value is insignificant - we just need to return
-// something such that we can call this function in a namespace scope.
-template <GTEST_TEMPLATE_ Fixture, typename Tests, typename Types>
-class TypeParameterizedTestCase {
- public:
- static bool Register(const char* prefix, const char* case_name,
- const char* test_names) {
- typedef typename Tests::Head Head;
-
- // First, register the first test in 'Test' for each type in 'Types'.
- TypeParameterizedTest<Fixture, Head, Types>::Register(
- prefix, case_name, test_names, 0);
-
- // Next, recurses (at compile time) with the tail of the test list.
- return TypeParameterizedTestCase<Fixture, typename Tests::Tail, Types>
- ::Register(prefix, case_name, SkipComma(test_names));
- }
-};
-
-// The base case for the compile time recursion.
-template <GTEST_TEMPLATE_ Fixture, typename Types>
-class TypeParameterizedTestCase<Fixture, Templates0, Types> {
- public:
- static bool Register(const char* /*prefix*/, const char* /*case_name*/,
- const char* /*test_names*/) {
- return true;
- }
-};
-
-#endif // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
-
-// Returns the current OS stack trace as a String.
-//
-// The maximum number of stack frames to be included is specified by
-// the gtest_stack_trace_depth flag. The skip_count parameter
-// specifies the number of top frames to be skipped, which doesn't
-// count against the number of frames to be included.
-//
-// For example, if Foo() calls Bar(), which in turn calls
-// GetCurrentOsStackTraceExceptTop(..., 1), Foo() will be included in
-// the trace but Bar() and GetCurrentOsStackTraceExceptTop() won't.
-GTEST_API_ String GetCurrentOsStackTraceExceptTop(UnitTest* unit_test,
- int skip_count);
-
-// Helpers for suppressing warnings on unreachable code or constant
-// condition.
-
-// Always returns true.
-GTEST_API_ bool AlwaysTrue();
-
-// Always returns false.
-inline bool AlwaysFalse() { return !AlwaysTrue(); }
-
-// Helper for suppressing false warning from Clang on a const char*
-// variable declared in a conditional expression always being NULL in
-// the else branch.
-struct GTEST_API_ ConstCharPtr {
- ConstCharPtr(const char* str) : value(str) {}
- operator bool() const { return true; }
- const char* value;
-};
-
-// A simple Linear Congruential Generator for generating random
-// numbers with a uniform distribution. Unlike rand() and srand(), it
-// doesn't use global state (and therefore can't interfere with user
-// code). Unlike rand_r(), it's portable. An LCG isn't very random,
-// but it's good enough for our purposes.
-class GTEST_API_ Random {
- public:
- static const UInt32 kMaxRange = 1u << 31;
-
- explicit Random(UInt32 seed) : state_(seed) {}
-
- void Reseed(UInt32 seed) { state_ = seed; }
-
- // Generates a random number from [0, range). Crashes if 'range' is
- // 0 or greater than kMaxRange.
- UInt32 Generate(UInt32 range);
-
- private:
- UInt32 state_;
- GTEST_DISALLOW_COPY_AND_ASSIGN_(Random);
-};
-
-// Defining a variable of type CompileAssertTypesEqual<T1, T2> will cause a
-// compiler error iff T1 and T2 are different types.
-template <typename T1, typename T2>
-struct CompileAssertTypesEqual;
-
-template <typename T>
-struct CompileAssertTypesEqual<T, T> {
-};
-
-// Removes the reference from a type if it is a reference type,
-// otherwise leaves it unchanged. This is the same as
-// tr1::remove_reference, which is not widely available yet.
-template <typename T>
-struct RemoveReference { typedef T type; }; // NOLINT
-template <typename T>
-struct RemoveReference<T&> { typedef T type; }; // NOLINT
-
-// A handy wrapper around RemoveReference that works when the argument
-// T depends on template parameters.
-#define GTEST_REMOVE_REFERENCE_(T) \
- typename ::testing::internal::RemoveReference<T>::type
-
-// Removes const from a type if it is a const type, otherwise leaves
-// it unchanged. This is the same as tr1::remove_const, which is not
-// widely available yet.
-template <typename T>
-struct RemoveConst { typedef T type; }; // NOLINT
-template <typename T>
-struct RemoveConst<const T> { typedef T type; }; // NOLINT
-
-// MSVC 8.0, Sun C++, and IBM XL C++ have a bug which causes the above
-// definition to fail to remove the const in 'const int[3]' and 'const
-// char[3][4]'. The following specialization works around the bug.
-template <typename T, size_t N>
-struct RemoveConst<const T[N]> {
- typedef typename RemoveConst<T>::type type[N];
-};
-
-#if defined(_MSC_VER) && _MSC_VER < 1400
-// This is the only specialization that allows VC++ 7.1 to remove const in
-// 'const int[3] and 'const int[3][4]'. However, it causes trouble with GCC
-// and thus needs to be conditionally compiled.
-template <typename T, size_t N>
-struct RemoveConst<T[N]> {
- typedef typename RemoveConst<T>::type type[N];
-};
-#endif
-
-// A handy wrapper around RemoveConst that works when the argument
-// T depends on template parameters.
-#define GTEST_REMOVE_CONST_(T) \
- typename ::testing::internal::RemoveConst<T>::type
-
-// Turns const U&, U&, const U, and U all into U.
-#define GTEST_REMOVE_REFERENCE_AND_CONST_(T) \
- GTEST_REMOVE_CONST_(GTEST_REMOVE_REFERENCE_(T))
-
-// Adds reference to a type if it is not a reference type,
-// otherwise leaves it unchanged. This is the same as
-// tr1::add_reference, which is not widely available yet.
-template <typename T>
-struct AddReference { typedef T& type; }; // NOLINT
-template <typename T>
-struct AddReference<T&> { typedef T& type; }; // NOLINT
-
-// A handy wrapper around AddReference that works when the argument T
-// depends on template parameters.
-#define GTEST_ADD_REFERENCE_(T) \
- typename ::testing::internal::AddReference<T>::type
-
-// Adds a reference to const on top of T as necessary. For example,
-// it transforms
-//
-// char ==> const char&
-// const char ==> const char&
-// char& ==> const char&
-// const char& ==> const char&
-//
-// The argument T must depend on some template parameters.
-#define GTEST_REFERENCE_TO_CONST_(T) \
- GTEST_ADD_REFERENCE_(const GTEST_REMOVE_REFERENCE_(T))
-
-// ImplicitlyConvertible<From, To>::value is a compile-time bool
-// constant that's true iff type From can be implicitly converted to
-// type To.
-template <typename From, typename To>
-class ImplicitlyConvertible {
- private:
- // We need the following helper functions only for their types.
- // They have no implementations.
-
- // MakeFrom() is an expression whose type is From. We cannot simply
- // use From(), as the type From may not have a public default
- // constructor.
- static From MakeFrom();
-
- // These two functions are overloaded. Given an expression
- // Helper(x), the compiler will pick the first version if x can be
- // implicitly converted to type To; otherwise it will pick the
- // second version.
- //
- // The first version returns a value of size 1, and the second
- // version returns a value of size 2. Therefore, by checking the
- // size of Helper(x), which can be done at compile time, we can tell
- // which version of Helper() is used, and hence whether x can be
- // implicitly converted to type To.
- static char Helper(To);
- static char (&Helper(...))[2]; // NOLINT
-
- // We have to put the 'public' section after the 'private' section,
- // or MSVC refuses to compile the code.
- public:
- // MSVC warns about implicitly converting from double to int for
- // possible loss of data, so we need to temporarily disable the
- // warning.
-#ifdef _MSC_VER
-# pragma warning(push) // Saves the current warning state.
-# pragma warning(disable:4244) // Temporarily disables warning 4244.
-
- static const bool value =
- sizeof(Helper(ImplicitlyConvertible::MakeFrom())) == 1;
-# pragma warning(pop) // Restores the warning state.
-#elif defined(__BORLANDC__)
- // C++Builder cannot use member overload resolution during template
- // instantiation. The simplest workaround is to use its C++0x type traits
- // functions (C++Builder 2009 and above only).
- static const bool value = __is_convertible(From, To);
-#else
- static const bool value =
- sizeof(Helper(ImplicitlyConvertible::MakeFrom())) == 1;
-#endif // _MSV_VER
-};
-template <typename From, typename To>
-const bool ImplicitlyConvertible<From, To>::value;
-
-// IsAProtocolMessage<T>::value is a compile-time bool constant that's
-// true iff T is type ProtocolMessage, proto2::Message, or a subclass
-// of those.
-template <typename T>
-struct IsAProtocolMessage
- : public bool_constant<
- ImplicitlyConvertible<const T*, const ::ProtocolMessage*>::value ||
- ImplicitlyConvertible<const T*, const ::proto2::Message*>::value> {
-};
-
-// When the compiler sees expression IsContainerTest<C>(0), if C is an
-// STL-style container class, the first overload of IsContainerTest
-// will be viable (since both C::iterator* and C::const_iterator* are
-// valid types and NULL can be implicitly converted to them). It will
-// be picked over the second overload as 'int' is a perfect match for
-// the type of argument 0. If C::iterator or C::const_iterator is not
-// a valid type, the first overload is not viable, and the second
-// overload will be picked. Therefore, we can determine whether C is
-// a container class by checking the type of IsContainerTest<C>(0).
-// The value of the expression is insignificant.
-//
-// Note that we look for both C::iterator and C::const_iterator. The
-// reason is that C++ injects the name of a class as a member of the
-// class itself (e.g. you can refer to class iterator as either
-// 'iterator' or 'iterator::iterator'). If we look for C::iterator
-// only, for example, we would mistakenly think that a class named
-// iterator is an STL container.
-//
-// Also note that the simpler approach of overloading
-// IsContainerTest(typename C::const_iterator*) and
-// IsContainerTest(...) doesn't work with Visual Age C++ and Sun C++.
-typedef int IsContainer;
-template <class C>
-IsContainer IsContainerTest(int /* dummy */,
- typename C::iterator* /* it */ = NULL,
- typename C::const_iterator* /* const_it */ = NULL) {
- return 0;
-}
-
-typedef char IsNotContainer;
-template <class C>
-IsNotContainer IsContainerTest(long /* dummy */) { return '\0'; }
-
-// EnableIf<condition>::type is void when 'Cond' is true, and
-// undefined when 'Cond' is false. To use SFINAE to make a function
-// overload only apply when a particular expression is true, add
-// "typename EnableIf<expression>::type* = 0" as the last parameter.
-template<bool> struct EnableIf;
-template<> struct EnableIf<true> { typedef void type; }; // NOLINT
-
-// Utilities for native arrays.
-
-// ArrayEq() compares two k-dimensional native arrays using the
-// elements' operator==, where k can be any integer >= 0. When k is
-// 0, ArrayEq() degenerates into comparing a single pair of values.
-
-template <typename T, typename U>
-bool ArrayEq(const T* lhs, size_t size, const U* rhs);
-
-// This generic version is used when k is 0.
-template <typename T, typename U>
-inline bool ArrayEq(const T& lhs, const U& rhs) { return lhs == rhs; }
-
-// This overload is used when k >= 1.
-template <typename T, typename U, size_t N>
-inline bool ArrayEq(const T(&lhs)[N], const U(&rhs)[N]) {
- return internal::ArrayEq(lhs, N, rhs);
-}
-
-// This helper reduces code bloat. If we instead put its logic inside
-// the previous ArrayEq() function, arrays with different sizes would
-// lead to different copies of the template code.
-template <typename T, typename U>
-bool ArrayEq(const T* lhs, size_t size, const U* rhs) {
- for (size_t i = 0; i != size; i++) {
- if (!internal::ArrayEq(lhs[i], rhs[i]))
- return false;
- }
- return true;
-}
-
-// Finds the first element in the iterator range [begin, end) that
-// equals elem. Element may be a native array type itself.
-template <typename Iter, typename Element>
-Iter ArrayAwareFind(Iter begin, Iter end, const Element& elem) {
- for (Iter it = begin; it != end; ++it) {
- if (internal::ArrayEq(*it, elem))
- return it;
- }
- return end;
-}
-
-// CopyArray() copies a k-dimensional native array using the elements'
-// operator=, where k can be any integer >= 0. When k is 0,
-// CopyArray() degenerates into copying a single value.
-
-template <typename T, typename U>
-void CopyArray(const T* from, size_t size, U* to);
-
-// This generic version is used when k is 0.
-template <typename T, typename U>
-inline void CopyArray(const T& from, U* to) { *to = from; }
-
-// This overload is used when k >= 1.
-template <typename T, typename U, size_t N>
-inline void CopyArray(const T(&from)[N], U(*to)[N]) {
- internal::CopyArray(from, N, *to);
-}
-
-// This helper reduces code bloat. If we instead put its logic inside
-// the previous CopyArray() function, arrays with different sizes
-// would lead to different copies of the template code.
-template <typename T, typename U>
-void CopyArray(const T* from, size_t size, U* to) {
- for (size_t i = 0; i != size; i++) {
- internal::CopyArray(from[i], to + i);
- }
-}
-
-// The relation between an NativeArray object (see below) and the
-// native array it represents.
-enum RelationToSource {
- kReference, // The NativeArray references the native array.
- kCopy // The NativeArray makes a copy of the native array and
- // owns the copy.
-};
-
-// Adapts a native array to a read-only STL-style container. Instead
-// of the complete STL container concept, this adaptor only implements
-// members useful for Google Mock's container matchers. New members
-// should be added as needed. To simplify the implementation, we only
-// support Element being a raw type (i.e. having no top-level const or
-// reference modifier). It's the client's responsibility to satisfy
-// this requirement. Element can be an array type itself (hence
-// multi-dimensional arrays are supported).
-template <typename Element>
-class NativeArray {
- public:
- // STL-style container typedefs.
- typedef Element value_type;
- typedef Element* iterator;
- typedef const Element* const_iterator;
-
- // Constructs from a native array.
- NativeArray(const Element* array, size_t count, RelationToSource relation) {
- Init(array, count, relation);
- }
-
- // Copy constructor.
- NativeArray(const NativeArray& rhs) {
- Init(rhs.array_, rhs.size_, rhs.relation_to_source_);
- }
-
- ~NativeArray() {
- // Ensures that the user doesn't instantiate NativeArray with a
- // const or reference type.
- static_cast<void>(StaticAssertTypeEqHelper<Element,
- GTEST_REMOVE_REFERENCE_AND_CONST_(Element)>());
- if (relation_to_source_ == kCopy)
- delete[] array_;
- }
-
- // STL-style container methods.
- size_t size() const { return size_; }
- const_iterator begin() const { return array_; }
- const_iterator end() const { return array_ + size_; }
- bool operator==(const NativeArray& rhs) const {
- return size() == rhs.size() &&
- ArrayEq(begin(), size(), rhs.begin());
- }
-
- private:
- // Initializes this object; makes a copy of the input array if
- // 'relation' is kCopy.
- void Init(const Element* array, size_t a_size, RelationToSource relation) {
- if (relation == kReference) {
- array_ = array;
- } else {
- Element* const copy = new Element[a_size];
- CopyArray(array, a_size, copy);
- array_ = copy;
- }
- size_ = a_size;
- relation_to_source_ = relation;
- }
-
- const Element* array_;
- size_t size_;
- RelationToSource relation_to_source_;
-
- GTEST_DISALLOW_ASSIGN_(NativeArray);
-};
-
-} // namespace internal
-} // namespace testing
-
-#define GTEST_MESSAGE_AT_(file, line, message, result_type) \
- ::testing::internal::AssertHelper(result_type, file, line, message) \
- = ::testing::Message()
-
-#define GTEST_MESSAGE_(message, result_type) \
- GTEST_MESSAGE_AT_(__FILE__, __LINE__, message, result_type)
-
-#define GTEST_FATAL_FAILURE_(message) \
- return GTEST_MESSAGE_(message, ::testing::TestPartResult::kFatalFailure)
-
-#define GTEST_NONFATAL_FAILURE_(message) \
- GTEST_MESSAGE_(message, ::testing::TestPartResult::kNonFatalFailure)
-
-#define GTEST_SUCCESS_(message) \
- GTEST_MESSAGE_(message, ::testing::TestPartResult::kSuccess)
-
-// Suppresses MSVC warnings 4072 (unreachable code) for the code following
-// statement if it returns or throws (or doesn't return or throw in some
-// situations).
-#define GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement) \
- if (::testing::internal::AlwaysTrue()) { statement; }
-
-#define GTEST_TEST_THROW_(statement, expected_exception, fail) \
- GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
- if (::testing::internal::ConstCharPtr gtest_msg = "") { \
- bool gtest_caught_expected = false; \
- try { \
- GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
- } \
- catch (expected_exception const&) { \
- gtest_caught_expected = true; \
- } \
- catch (...) { \
- gtest_msg.value = \
- "Expected: " #statement " throws an exception of type " \
- #expected_exception ".\n Actual: it throws a different type."; \
- goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \
- } \
- if (!gtest_caught_expected) { \
- gtest_msg.value = \
- "Expected: " #statement " throws an exception of type " \
- #expected_exception ".\n Actual: it throws nothing."; \
- goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \
- } \
- } else \
- GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__): \
- fail(gtest_msg.value)
-
-#define GTEST_TEST_NO_THROW_(statement, fail) \
- GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
- if (::testing::internal::AlwaysTrue()) { \
- try { \
- GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
- } \
- catch (...) { \
- goto GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__); \
- } \
- } else \
- GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__): \
- fail("Expected: " #statement " doesn't throw an exception.\n" \
- " Actual: it throws.")
-
-#define GTEST_TEST_ANY_THROW_(statement, fail) \
- GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
- if (::testing::internal::AlwaysTrue()) { \
- bool gtest_caught_any = false; \
- try { \
- GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
- } \
- catch (...) { \
- gtest_caught_any = true; \
- } \
- if (!gtest_caught_any) { \
- goto GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__); \
- } \
- } else \
- GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__): \
- fail("Expected: " #statement " throws an exception.\n" \
- " Actual: it doesn't.")
-
-
-// Implements Boolean test assertions such as EXPECT_TRUE. expression can be
-// either a boolean expression or an AssertionResult. text is a textual
-// represenation of expression as it was passed into the EXPECT_TRUE.
-#define GTEST_TEST_BOOLEAN_(expression, text, actual, expected, fail) \
- GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
- if (const ::testing::AssertionResult gtest_ar_ = \
- ::testing::AssertionResult(expression)) \
- ; \
- else \
- fail(::testing::internal::GetBoolAssertionFailureMessage(\
- gtest_ar_, text, #actual, #expected).c_str())
-
-#define GTEST_TEST_NO_FATAL_FAILURE_(statement, fail) \
- GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
- if (::testing::internal::AlwaysTrue()) { \
- ::testing::internal::HasNewFatalFailureHelper gtest_fatal_failure_checker; \
- GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
- if (gtest_fatal_failure_checker.has_new_fatal_failure()) { \
- goto GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__); \
- } \
- } else \
- GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__): \
- fail("Expected: " #statement " doesn't generate new fatal " \
- "failures in the current thread.\n" \
- " Actual: it does.")
-
-// Expands to the name of the class that implements the given test.
-#define GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \
- test_case_name##_##test_name##_Test
-
-// Helper macro for defining tests.
-#define GTEST_TEST_(test_case_name, test_name, parent_class, parent_id)\
-class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) : public parent_class {\
- public:\
- GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {}\
- private:\
- virtual void TestBody();\
- static ::testing::TestInfo* const test_info_ GTEST_ATTRIBUTE_UNUSED_;\
- GTEST_DISALLOW_COPY_AND_ASSIGN_(\
- GTEST_TEST_CLASS_NAME_(test_case_name, test_name));\
-};\
-\
-::testing::TestInfo* const GTEST_TEST_CLASS_NAME_(test_case_name, test_name)\
- ::test_info_ =\
- ::testing::internal::MakeAndRegisterTestInfo(\
- #test_case_name, #test_name, NULL, NULL, \
- (parent_id), \
- parent_class::SetUpTestCase, \
- parent_class::TearDownTestCase, \
- new ::testing::internal::TestFactoryImpl<\
- GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>);\
-void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()
-
-#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
diff --git a/src/testing/gtest/include/gtest/internal/gtest-linked_ptr.h b/src/testing/gtest/include/gtest/internal/gtest-linked_ptr.h
deleted file mode 100644
index b1362cd0..00000000
--- a/src/testing/gtest/include/gtest/internal/gtest-linked_ptr.h
+++ /dev/null
@@ -1,233 +0,0 @@
-// Copyright 2003 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Authors: Dan Egnor (egnor@google.com)
-//
-// A "smart" pointer type with reference tracking. Every pointer to a
-// particular object is kept on a circular linked list. When the last pointer
-// to an object is destroyed or reassigned, the object is deleted.
-//
-// Used properly, this deletes the object when the last reference goes away.
-// There are several caveats:
-// - Like all reference counting schemes, cycles lead to leaks.
-// - Each smart pointer is actually two pointers (8 bytes instead of 4).
-// - Every time a pointer is assigned, the entire list of pointers to that
-// object is traversed. This class is therefore NOT SUITABLE when there
-// will often be more than two or three pointers to a particular object.
-// - References are only tracked as long as linked_ptr<> objects are copied.
-// If a linked_ptr<> is converted to a raw pointer and back, BAD THINGS
-// will happen (double deletion).
-//
-// A good use of this class is storing object references in STL containers.
-// You can safely put linked_ptr<> in a vector<>.
-// Other uses may not be as good.
-//
-// Note: If you use an incomplete type with linked_ptr<>, the class
-// *containing* linked_ptr<> must have a constructor and destructor (even
-// if they do nothing!).
-//
-// Bill Gibbons suggested we use something like this.
-//
-// Thread Safety:
-// Unlike other linked_ptr implementations, in this implementation
-// a linked_ptr object is thread-safe in the sense that:
-// - it's safe to copy linked_ptr objects concurrently,
-// - it's safe to copy *from* a linked_ptr and read its underlying
-// raw pointer (e.g. via get()) concurrently, and
-// - it's safe to write to two linked_ptrs that point to the same
-// shared object concurrently.
-// TODO(wan@google.com): rename this to safe_linked_ptr to avoid
-// confusion with normal linked_ptr.
-
-#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
-#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
-
-#include <stdlib.h>
-#include <assert.h>
-
-#include "gtest/internal/gtest-port.h"
-
-namespace testing {
-namespace internal {
-
-// Protects copying of all linked_ptr objects.
-GTEST_API_ GTEST_DECLARE_STATIC_MUTEX_(g_linked_ptr_mutex);
-
-// This is used internally by all instances of linked_ptr<>. It needs to be
-// a non-template class because different types of linked_ptr<> can refer to
-// the same object (linked_ptr<Superclass>(obj) vs linked_ptr<Subclass>(obj)).
-// So, it needs to be possible for different types of linked_ptr to participate
-// in the same circular linked list, so we need a single class type here.
-//
-// DO NOT USE THIS CLASS DIRECTLY YOURSELF. Use linked_ptr<T>.
-class linked_ptr_internal {
- public:
- // Create a new circle that includes only this instance.
- void join_new() {
- next_ = this;
- }
-
- // Many linked_ptr operations may change p.link_ for some linked_ptr
- // variable p in the same circle as this object. Therefore we need
- // to prevent two such operations from occurring concurrently.
- //
- // Note that different types of linked_ptr objects can coexist in a
- // circle (e.g. linked_ptr<Base>, linked_ptr<Derived1>, and
- // linked_ptr<Derived2>). Therefore we must use a single mutex to
- // protect all linked_ptr objects. This can create serious
- // contention in production code, but is acceptable in a testing
- // framework.
-
- // Join an existing circle.
- void join(linked_ptr_internal const* ptr)
- GTEST_LOCK_EXCLUDED_(g_linked_ptr_mutex) {
- MutexLock lock(&g_linked_ptr_mutex);
-
- linked_ptr_internal const* p = ptr;
- while (p->next_ != ptr) p = p->next_;
- p->next_ = this;
- next_ = ptr;
- }
-
- // Leave whatever circle we're part of. Returns true if we were the
- // last member of the circle. Once this is done, you can join() another.
- bool depart()
- GTEST_LOCK_EXCLUDED_(g_linked_ptr_mutex) {
- MutexLock lock(&g_linked_ptr_mutex);
-
- if (next_ == this) return true;
- linked_ptr_internal const* p = next_;
- while (p->next_ != this) p = p->next_;
- p->next_ = next_;
- return false;
- }
-
- private:
- mutable linked_ptr_internal const* next_;
-};
-
-template <typename T>
-class linked_ptr {
- public:
- typedef T element_type;
-
- // Take over ownership of a raw pointer. This should happen as soon as
- // possible after the object is created.
- explicit linked_ptr(T* ptr = NULL) { capture(ptr); }
- ~linked_ptr() { depart(); }
-
- // Copy an existing linked_ptr<>, adding ourselves to the list of references.
- template <typename U> linked_ptr(linked_ptr<U> const& ptr) { copy(&ptr); }
- linked_ptr(linked_ptr const& ptr) { // NOLINT
- assert(&ptr != this);
- copy(&ptr);
- }
-
- // Assignment releases the old value and acquires the new.
- template <typename U> linked_ptr& operator=(linked_ptr<U> const& ptr) {
- depart();
- copy(&ptr);
- return *this;
- }
-
- linked_ptr& operator=(linked_ptr const& ptr) {
- if (&ptr != this) {
- depart();
- copy(&ptr);
- }
- return *this;
- }
-
- // Smart pointer members.
- void reset(T* ptr = NULL) {
- depart();
- capture(ptr);
- }
- T* get() const { return value_; }
- T* operator->() const { return value_; }
- T& operator*() const { return *value_; }
-
- bool operator==(T* p) const { return value_ == p; }
- bool operator!=(T* p) const { return value_ != p; }
- template <typename U>
- bool operator==(linked_ptr<U> const& ptr) const {
- return value_ == ptr.get();
- }
- template <typename U>
- bool operator!=(linked_ptr<U> const& ptr) const {
- return value_ != ptr.get();
- }
-
- private:
- template <typename U>
- friend class linked_ptr;
-
- T* value_;
- linked_ptr_internal link_;
-
- void depart() {
- if (link_.depart()) delete value_;
- }
-
- void capture(T* ptr) {
- value_ = ptr;
- link_.join_new();
- }
-
- template <typename U> void copy(linked_ptr<U> const* ptr) {
- value_ = ptr->get();
- if (value_)
- link_.join(&ptr->link_);
- else
- link_.join_new();
- }
-};
-
-template<typename T> inline
-bool operator==(T* ptr, const linked_ptr<T>& x) {
- return ptr == x.get();
-}
-
-template<typename T> inline
-bool operator!=(T* ptr, const linked_ptr<T>& x) {
- return ptr != x.get();
-}
-
-// A function to convert T* into linked_ptr<T>
-// Doing e.g. make_linked_ptr(new FooBarBaz<type>(arg)) is a shorter notation
-// for linked_ptr<FooBarBaz<type> >(new FooBarBaz<type>(arg))
-template <typename T>
-linked_ptr<T> make_linked_ptr(T* ptr) {
- return linked_ptr<T>(ptr);
-}
-
-} // namespace internal
-} // namespace testing
-
-#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
diff --git a/src/testing/gtest/include/gtest/internal/gtest-param-util-generated.h b/src/testing/gtest/include/gtest/internal/gtest-param-util-generated.h
deleted file mode 100644
index e8054859..00000000
--- a/src/testing/gtest/include/gtest/internal/gtest-param-util-generated.h
+++ /dev/null
@@ -1,5143 +0,0 @@
-// This file was GENERATED by command:
-// pump.py gtest-param-util-generated.h.pump
-// DO NOT EDIT BY HAND!!!
-
-// Copyright 2008 Google Inc.
-// All Rights Reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: vladl@google.com (Vlad Losev)
-
-// Type and function utilities for implementing parameterized tests.
-// This file is generated by a SCRIPT. DO NOT EDIT BY HAND!
-//
-// Currently Google Test supports at most 50 arguments in Values,
-// and at most 10 arguments in Combine. Please contact
-// googletestframework@googlegroups.com if you need more.
-// Please note that the number of arguments to Combine is limited
-// by the maximum arity of the implementation of tr1::tuple which is
-// currently set at 10.
-
-#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
-#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
-
-// scripts/fuse_gtest.py depends on gtest's own header being #included
-// *unconditionally*. Therefore these #includes cannot be moved
-// inside #if GTEST_HAS_PARAM_TEST.
-#include "gtest/internal/gtest-param-util.h"
-#include "gtest/internal/gtest-port.h"
-
-#if GTEST_HAS_PARAM_TEST
-
-namespace testing {
-
-// Forward declarations of ValuesIn(), which is implemented in
-// include/gtest/gtest-param-test.h.
-template <typename ForwardIterator>
-internal::ParamGenerator<
- typename ::testing::internal::IteratorTraits<ForwardIterator>::value_type>
-ValuesIn(ForwardIterator begin, ForwardIterator end);
-
-template <typename T, size_t N>
-internal::ParamGenerator<T> ValuesIn(const T (&array)[N]);
-
-template <class Container>
-internal::ParamGenerator<typename Container::value_type> ValuesIn(
- const Container& container);
-
-namespace internal {
-
-// Used in the Values() function to provide polymorphic capabilities.
-template <typename T1>
-class ValueArray1 {
- public:
- explicit ValueArray1(T1 v1) : v1_(v1) {}
-
- template <typename T>
- operator ParamGenerator<T>() const { return ValuesIn(&v1_, &v1_ + 1); }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray1& other);
-
- const T1 v1_;
-};
-
-template <typename T1, typename T2>
-class ValueArray2 {
- public:
- ValueArray2(T1 v1, T2 v2) : v1_(v1), v2_(v2) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_)};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray2& other);
-
- const T1 v1_;
- const T2 v2_;
-};
-
-template <typename T1, typename T2, typename T3>
-class ValueArray3 {
- public:
- ValueArray3(T1 v1, T2 v2, T3 v3) : v1_(v1), v2_(v2), v3_(v3) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
- static_cast<T>(v3_)};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray3& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4>
-class ValueArray4 {
- public:
- ValueArray4(T1 v1, T2 v2, T3 v3, T4 v4) : v1_(v1), v2_(v2), v3_(v3),
- v4_(v4) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
- static_cast<T>(v3_), static_cast<T>(v4_)};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray4& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5>
-class ValueArray5 {
- public:
- ValueArray5(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5) : v1_(v1), v2_(v2), v3_(v3),
- v4_(v4), v5_(v5) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
- static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_)};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray5& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6>
-class ValueArray6 {
- public:
- ValueArray6(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6) : v1_(v1), v2_(v2),
- v3_(v3), v4_(v4), v5_(v5), v6_(v6) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
- static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
- static_cast<T>(v6_)};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray6& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7>
-class ValueArray7 {
- public:
- ValueArray7(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7) : v1_(v1),
- v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
- static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
- static_cast<T>(v6_), static_cast<T>(v7_)};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray7& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8>
-class ValueArray8 {
- public:
- ValueArray8(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
- T8 v8) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
- v8_(v8) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
- static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
- static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_)};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray8& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9>
-class ValueArray9 {
- public:
- ValueArray9(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
- T9 v9) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
- v8_(v8), v9_(v9) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
- static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
- static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
- static_cast<T>(v9_)};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray9& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10>
-class ValueArray10 {
- public:
- ValueArray10(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
- v8_(v8), v9_(v9), v10_(v10) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
- static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
- static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
- static_cast<T>(v9_), static_cast<T>(v10_)};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray10& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11>
-class ValueArray11 {
- public:
- ValueArray11(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
- v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
- static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
- static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
- static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_)};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray11& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12>
-class ValueArray12 {
- public:
- ValueArray12(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
- v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
- static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
- static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
- static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
- static_cast<T>(v12_)};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray12& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13>
-class ValueArray13 {
- public:
- ValueArray13(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
- v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
- v12_(v12), v13_(v13) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
- static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
- static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
- static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
- static_cast<T>(v12_), static_cast<T>(v13_)};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray13& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14>
-class ValueArray14 {
- public:
- ValueArray14(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) : v1_(v1), v2_(v2), v3_(v3),
- v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
- v11_(v11), v12_(v12), v13_(v13), v14_(v14) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
- static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
- static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
- static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
- static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_)};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray14& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15>
-class ValueArray15 {
- public:
- ValueArray15(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) : v1_(v1), v2_(v2),
- v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
- v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
- static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
- static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
- static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
- static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
- static_cast<T>(v15_)};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray15& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16>
-class ValueArray16 {
- public:
- ValueArray16(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16) : v1_(v1),
- v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
- v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
- v16_(v16) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
- static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
- static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
- static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
- static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
- static_cast<T>(v15_), static_cast<T>(v16_)};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray16& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17>
-class ValueArray17 {
- public:
- ValueArray17(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,
- T17 v17) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
- v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
- v15_(v15), v16_(v16), v17_(v17) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
- static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
- static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
- static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
- static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
- static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_)};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray17& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
- const T17 v17_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18>
-class ValueArray18 {
- public:
- ValueArray18(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
- v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
- v15_(v15), v16_(v16), v17_(v17), v18_(v18) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
- static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
- static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
- static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
- static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
- static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
- static_cast<T>(v18_)};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray18& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
- const T17 v17_;
- const T18 v18_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19>
-class ValueArray19 {
- public:
- ValueArray19(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
- v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
- v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
- static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
- static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
- static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
- static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
- static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
- static_cast<T>(v18_), static_cast<T>(v19_)};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray19& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
- const T17 v17_;
- const T18 v18_;
- const T19 v19_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20>
-class ValueArray20 {
- public:
- ValueArray20(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
- v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
- v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
- v19_(v19), v20_(v20) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
- static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
- static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
- static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
- static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
- static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
- static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_)};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray20& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
- const T17 v17_;
- const T18 v18_;
- const T19 v19_;
- const T20 v20_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21>
-class ValueArray21 {
- public:
- ValueArray21(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
- v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
- v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
- v18_(v18), v19_(v19), v20_(v20), v21_(v21) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
- static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
- static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
- static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
- static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
- static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
- static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
- static_cast<T>(v21_)};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray21& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
- const T17 v17_;
- const T18 v18_;
- const T19 v19_;
- const T20 v20_;
- const T21 v21_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22>
-class ValueArray22 {
- public:
- ValueArray22(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22) : v1_(v1), v2_(v2), v3_(v3),
- v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
- v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
- v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
- static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
- static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
- static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
- static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
- static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
- static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
- static_cast<T>(v21_), static_cast<T>(v22_)};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray22& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
- const T17 v17_;
- const T18 v18_;
- const T19 v19_;
- const T20 v20_;
- const T21 v21_;
- const T22 v22_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23>
-class ValueArray23 {
- public:
- ValueArray23(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23) : v1_(v1), v2_(v2),
- v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
- v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
- v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
- v23_(v23) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
- static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
- static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
- static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
- static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
- static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
- static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
- static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_)};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray23& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
- const T17 v17_;
- const T18 v18_;
- const T19 v19_;
- const T20 v20_;
- const T21 v21_;
- const T22 v22_;
- const T23 v23_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24>
-class ValueArray24 {
- public:
- ValueArray24(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24) : v1_(v1),
- v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
- v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
- v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
- v22_(v22), v23_(v23), v24_(v24) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
- static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
- static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
- static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
- static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
- static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
- static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
- static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
- static_cast<T>(v24_)};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray24& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
- const T17 v17_;
- const T18 v18_;
- const T19 v19_;
- const T20 v20_;
- const T21 v21_;
- const T22 v22_;
- const T23 v23_;
- const T24 v24_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25>
-class ValueArray25 {
- public:
- ValueArray25(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,
- T25 v25) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
- v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
- v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
- v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
- static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
- static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
- static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
- static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
- static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
- static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
- static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
- static_cast<T>(v24_), static_cast<T>(v25_)};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray25& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
- const T17 v17_;
- const T18 v18_;
- const T19 v19_;
- const T20 v20_;
- const T21 v21_;
- const T22 v22_;
- const T23 v23_;
- const T24 v24_;
- const T25 v25_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26>
-class ValueArray26 {
- public:
- ValueArray26(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
- T26 v26) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
- v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
- v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
- v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
- static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
- static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
- static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
- static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
- static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
- static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
- static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
- static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_)};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray26& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
- const T17 v17_;
- const T18 v18_;
- const T19 v19_;
- const T20 v20_;
- const T21 v21_;
- const T22 v22_;
- const T23 v23_;
- const T24 v24_;
- const T25 v25_;
- const T26 v26_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27>
-class ValueArray27 {
- public:
- ValueArray27(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
- T26 v26, T27 v27) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
- v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
- v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),
- v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),
- v26_(v26), v27_(v27) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
- static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
- static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
- static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
- static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
- static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
- static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
- static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
- static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
- static_cast<T>(v27_)};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray27& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
- const T17 v17_;
- const T18 v18_;
- const T19 v19_;
- const T20 v20_;
- const T21 v21_;
- const T22 v22_;
- const T23 v23_;
- const T24 v24_;
- const T25 v25_;
- const T26 v26_;
- const T27 v27_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28>
-class ValueArray28 {
- public:
- ValueArray28(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
- T26 v26, T27 v27, T28 v28) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
- v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
- v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
- v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),
- v25_(v25), v26_(v26), v27_(v27), v28_(v28) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
- static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
- static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
- static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
- static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
- static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
- static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
- static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
- static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
- static_cast<T>(v27_), static_cast<T>(v28_)};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray28& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
- const T17 v17_;
- const T18 v18_;
- const T19 v19_;
- const T20 v20_;
- const T21 v21_;
- const T22 v22_;
- const T23 v23_;
- const T24 v24_;
- const T25 v25_;
- const T26 v26_;
- const T27 v27_;
- const T28 v28_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29>
-class ValueArray29 {
- public:
- ValueArray29(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
- T26 v26, T27 v27, T28 v28, T29 v29) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
- v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
- v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
- v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),
- v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
- static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
- static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
- static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
- static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
- static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
- static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
- static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
- static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
- static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_)};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray29& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
- const T17 v17_;
- const T18 v18_;
- const T19 v19_;
- const T20 v20_;
- const T21 v21_;
- const T22 v22_;
- const T23 v23_;
- const T24 v24_;
- const T25 v25_;
- const T26 v26_;
- const T27 v27_;
- const T28 v28_;
- const T29 v29_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30>
-class ValueArray30 {
- public:
- ValueArray30(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
- T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) : v1_(v1), v2_(v2), v3_(v3),
- v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
- v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
- v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
- v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
- v29_(v29), v30_(v30) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
- static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
- static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
- static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
- static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
- static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
- static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
- static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
- static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
- static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
- static_cast<T>(v30_)};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray30& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
- const T17 v17_;
- const T18 v18_;
- const T19 v19_;
- const T20 v20_;
- const T21 v21_;
- const T22 v22_;
- const T23 v23_;
- const T24 v24_;
- const T25 v25_;
- const T26 v26_;
- const T27 v27_;
- const T28 v28_;
- const T29 v29_;
- const T30 v30_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31>
-class ValueArray31 {
- public:
- ValueArray31(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
- T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) : v1_(v1), v2_(v2),
- v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
- v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
- v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
- v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
- v29_(v29), v30_(v30), v31_(v31) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
- static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
- static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
- static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
- static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
- static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
- static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
- static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
- static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
- static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
- static_cast<T>(v30_), static_cast<T>(v31_)};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray31& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
- const T17 v17_;
- const T18 v18_;
- const T19 v19_;
- const T20 v20_;
- const T21 v21_;
- const T22 v22_;
- const T23 v23_;
- const T24 v24_;
- const T25 v25_;
- const T26 v26_;
- const T27 v27_;
- const T28 v28_;
- const T29 v29_;
- const T30 v30_;
- const T31 v31_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32>
-class ValueArray32 {
- public:
- ValueArray32(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
- T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32) : v1_(v1),
- v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
- v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
- v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
- v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),
- v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
- static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
- static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
- static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
- static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
- static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
- static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
- static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
- static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
- static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
- static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_)};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray32& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
- const T17 v17_;
- const T18 v18_;
- const T19 v19_;
- const T20 v20_;
- const T21 v21_;
- const T22 v22_;
- const T23 v23_;
- const T24 v24_;
- const T25 v25_;
- const T26 v26_;
- const T27 v27_;
- const T28 v28_;
- const T29 v29_;
- const T30 v30_;
- const T31 v31_;
- const T32 v32_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33>
-class ValueArray33 {
- public:
- ValueArray33(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
- T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32,
- T33 v33) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
- v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
- v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
- v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
- v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
- v33_(v33) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
- static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
- static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
- static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
- static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
- static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
- static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
- static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
- static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
- static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
- static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
- static_cast<T>(v33_)};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray33& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
- const T17 v17_;
- const T18 v18_;
- const T19 v19_;
- const T20 v20_;
- const T21 v21_;
- const T22 v22_;
- const T23 v23_;
- const T24 v24_;
- const T25 v25_;
- const T26 v26_;
- const T27 v27_;
- const T28 v28_;
- const T29 v29_;
- const T30 v30_;
- const T31 v31_;
- const T32 v32_;
- const T33 v33_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34>
-class ValueArray34 {
- public:
- ValueArray34(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
- T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
- T34 v34) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
- v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
- v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
- v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
- v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
- v33_(v33), v34_(v34) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
- static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
- static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
- static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
- static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
- static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
- static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
- static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
- static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
- static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
- static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
- static_cast<T>(v33_), static_cast<T>(v34_)};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray34& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
- const T17 v17_;
- const T18 v18_;
- const T19 v19_;
- const T20 v20_;
- const T21 v21_;
- const T22 v22_;
- const T23 v23_;
- const T24 v24_;
- const T25 v25_;
- const T26 v26_;
- const T27 v27_;
- const T28 v28_;
- const T29 v29_;
- const T30 v30_;
- const T31 v31_;
- const T32 v32_;
- const T33 v33_;
- const T34 v34_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35>
-class ValueArray35 {
- public:
- ValueArray35(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
- T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
- T34 v34, T35 v35) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
- v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
- v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),
- v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),
- v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31),
- v32_(v32), v33_(v33), v34_(v34), v35_(v35) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
- static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
- static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
- static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
- static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
- static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
- static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
- static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
- static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
- static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
- static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
- static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_)};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray35& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
- const T17 v17_;
- const T18 v18_;
- const T19 v19_;
- const T20 v20_;
- const T21 v21_;
- const T22 v22_;
- const T23 v23_;
- const T24 v24_;
- const T25 v25_;
- const T26 v26_;
- const T27 v27_;
- const T28 v28_;
- const T29 v29_;
- const T30 v30_;
- const T31 v31_;
- const T32 v32_;
- const T33 v33_;
- const T34 v34_;
- const T35 v35_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36>
-class ValueArray36 {
- public:
- ValueArray36(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
- T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
- T34 v34, T35 v35, T36 v36) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
- v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
- v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
- v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),
- v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30),
- v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
- static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
- static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
- static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
- static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
- static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
- static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
- static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
- static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
- static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
- static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
- static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
- static_cast<T>(v36_)};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray36& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
- const T17 v17_;
- const T18 v18_;
- const T19 v19_;
- const T20 v20_;
- const T21 v21_;
- const T22 v22_;
- const T23 v23_;
- const T24 v24_;
- const T25 v25_;
- const T26 v26_;
- const T27 v27_;
- const T28 v28_;
- const T29 v29_;
- const T30 v30_;
- const T31 v31_;
- const T32 v32_;
- const T33 v33_;
- const T34 v34_;
- const T35 v35_;
- const T36 v36_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37>
-class ValueArray37 {
- public:
- ValueArray37(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
- T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
- T34 v34, T35 v35, T36 v36, T37 v37) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
- v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
- v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
- v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),
- v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29),
- v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35),
- v36_(v36), v37_(v37) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
- static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
- static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
- static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
- static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
- static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
- static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
- static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
- static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
- static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
- static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
- static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
- static_cast<T>(v36_), static_cast<T>(v37_)};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray37& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
- const T17 v17_;
- const T18 v18_;
- const T19 v19_;
- const T20 v20_;
- const T21 v21_;
- const T22 v22_;
- const T23 v23_;
- const T24 v24_;
- const T25 v25_;
- const T26 v26_;
- const T27 v27_;
- const T28 v28_;
- const T29 v29_;
- const T30 v30_;
- const T31 v31_;
- const T32 v32_;
- const T33 v33_;
- const T34 v34_;
- const T35 v35_;
- const T36 v36_;
- const T37 v37_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38>
-class ValueArray38 {
- public:
- ValueArray38(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
- T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
- T34 v34, T35 v35, T36 v36, T37 v37, T38 v38) : v1_(v1), v2_(v2), v3_(v3),
- v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
- v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
- v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
- v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
- v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
- v35_(v35), v36_(v36), v37_(v37), v38_(v38) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
- static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
- static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
- static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
- static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
- static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
- static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
- static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
- static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
- static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
- static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
- static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
- static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_)};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray38& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
- const T17 v17_;
- const T18 v18_;
- const T19 v19_;
- const T20 v20_;
- const T21 v21_;
- const T22 v22_;
- const T23 v23_;
- const T24 v24_;
- const T25 v25_;
- const T26 v26_;
- const T27 v27_;
- const T28 v28_;
- const T29 v29_;
- const T30 v30_;
- const T31 v31_;
- const T32 v32_;
- const T33 v33_;
- const T34 v34_;
- const T35 v35_;
- const T36 v36_;
- const T37 v37_;
- const T38 v38_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39>
-class ValueArray39 {
- public:
- ValueArray39(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
- T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
- T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39) : v1_(v1), v2_(v2),
- v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
- v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
- v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
- v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
- v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
- v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
- static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
- static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
- static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
- static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
- static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
- static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
- static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
- static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
- static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
- static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
- static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
- static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
- static_cast<T>(v39_)};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray39& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
- const T17 v17_;
- const T18 v18_;
- const T19 v19_;
- const T20 v20_;
- const T21 v21_;
- const T22 v22_;
- const T23 v23_;
- const T24 v24_;
- const T25 v25_;
- const T26 v26_;
- const T27 v27_;
- const T28 v28_;
- const T29 v29_;
- const T30 v30_;
- const T31 v31_;
- const T32 v32_;
- const T33 v33_;
- const T34 v34_;
- const T35 v35_;
- const T36 v36_;
- const T37 v37_;
- const T38 v38_;
- const T39 v39_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40>
-class ValueArray40 {
- public:
- ValueArray40(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
- T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
- T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) : v1_(v1),
- v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
- v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
- v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
- v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),
- v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33),
- v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39),
- v40_(v40) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
- static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
- static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
- static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
- static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
- static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
- static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
- static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
- static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
- static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
- static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
- static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
- static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
- static_cast<T>(v39_), static_cast<T>(v40_)};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray40& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
- const T17 v17_;
- const T18 v18_;
- const T19 v19_;
- const T20 v20_;
- const T21 v21_;
- const T22 v22_;
- const T23 v23_;
- const T24 v24_;
- const T25 v25_;
- const T26 v26_;
- const T27 v27_;
- const T28 v28_;
- const T29 v29_;
- const T30 v30_;
- const T31 v31_;
- const T32 v32_;
- const T33 v33_;
- const T34 v34_;
- const T35 v35_;
- const T36 v36_;
- const T37 v37_;
- const T38 v38_;
- const T39 v39_;
- const T40 v40_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41>
-class ValueArray41 {
- public:
- ValueArray41(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
- T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
- T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40,
- T41 v41) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
- v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
- v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
- v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
- v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
- v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
- v39_(v39), v40_(v40), v41_(v41) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
- static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
- static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
- static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
- static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
- static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
- static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
- static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
- static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
- static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
- static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
- static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
- static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
- static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_)};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray41& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
- const T17 v17_;
- const T18 v18_;
- const T19 v19_;
- const T20 v20_;
- const T21 v21_;
- const T22 v22_;
- const T23 v23_;
- const T24 v24_;
- const T25 v25_;
- const T26 v26_;
- const T27 v27_;
- const T28 v28_;
- const T29 v29_;
- const T30 v30_;
- const T31 v31_;
- const T32 v32_;
- const T33 v33_;
- const T34 v34_;
- const T35 v35_;
- const T36 v36_;
- const T37 v37_;
- const T38 v38_;
- const T39 v39_;
- const T40 v40_;
- const T41 v41_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42>
-class ValueArray42 {
- public:
- ValueArray42(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
- T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
- T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
- T42 v42) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
- v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
- v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
- v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
- v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
- v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
- v39_(v39), v40_(v40), v41_(v41), v42_(v42) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
- static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
- static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
- static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
- static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
- static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
- static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
- static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
- static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
- static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
- static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
- static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
- static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
- static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
- static_cast<T>(v42_)};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray42& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
- const T17 v17_;
- const T18 v18_;
- const T19 v19_;
- const T20 v20_;
- const T21 v21_;
- const T22 v22_;
- const T23 v23_;
- const T24 v24_;
- const T25 v25_;
- const T26 v26_;
- const T27 v27_;
- const T28 v28_;
- const T29 v29_;
- const T30 v30_;
- const T31 v31_;
- const T32 v32_;
- const T33 v33_;
- const T34 v34_;
- const T35 v35_;
- const T36 v36_;
- const T37 v37_;
- const T38 v38_;
- const T39 v39_;
- const T40 v40_;
- const T41 v41_;
- const T42 v42_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42, typename T43>
-class ValueArray43 {
- public:
- ValueArray43(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
- T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
- T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
- T42 v42, T43 v43) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
- v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
- v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),
- v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),
- v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31),
- v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37),
- v38_(v38), v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
- static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
- static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
- static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
- static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
- static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
- static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
- static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
- static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
- static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
- static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
- static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
- static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
- static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
- static_cast<T>(v42_), static_cast<T>(v43_)};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray43& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
- const T17 v17_;
- const T18 v18_;
- const T19 v19_;
- const T20 v20_;
- const T21 v21_;
- const T22 v22_;
- const T23 v23_;
- const T24 v24_;
- const T25 v25_;
- const T26 v26_;
- const T27 v27_;
- const T28 v28_;
- const T29 v29_;
- const T30 v30_;
- const T31 v31_;
- const T32 v32_;
- const T33 v33_;
- const T34 v34_;
- const T35 v35_;
- const T36 v36_;
- const T37 v37_;
- const T38 v38_;
- const T39 v39_;
- const T40 v40_;
- const T41 v41_;
- const T42 v42_;
- const T43 v43_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42, typename T43, typename T44>
-class ValueArray44 {
- public:
- ValueArray44(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
- T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
- T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
- T42 v42, T43 v43, T44 v44) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
- v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
- v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
- v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),
- v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30),
- v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36),
- v37_(v37), v38_(v38), v39_(v39), v40_(v40), v41_(v41), v42_(v42),
- v43_(v43), v44_(v44) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
- static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
- static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
- static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
- static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
- static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
- static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
- static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
- static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
- static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
- static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
- static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
- static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
- static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
- static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_)};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray44& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
- const T17 v17_;
- const T18 v18_;
- const T19 v19_;
- const T20 v20_;
- const T21 v21_;
- const T22 v22_;
- const T23 v23_;
- const T24 v24_;
- const T25 v25_;
- const T26 v26_;
- const T27 v27_;
- const T28 v28_;
- const T29 v29_;
- const T30 v30_;
- const T31 v31_;
- const T32 v32_;
- const T33 v33_;
- const T34 v34_;
- const T35 v35_;
- const T36 v36_;
- const T37 v37_;
- const T38 v38_;
- const T39 v39_;
- const T40 v40_;
- const T41 v41_;
- const T42 v42_;
- const T43 v43_;
- const T44 v44_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42, typename T43, typename T44, typename T45>
-class ValueArray45 {
- public:
- ValueArray45(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
- T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
- T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
- T42 v42, T43 v43, T44 v44, T45 v45) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
- v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
- v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
- v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),
- v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29),
- v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35),
- v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40), v41_(v41),
- v42_(v42), v43_(v43), v44_(v44), v45_(v45) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
- static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
- static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
- static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
- static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
- static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
- static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
- static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
- static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
- static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
- static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
- static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
- static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
- static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
- static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
- static_cast<T>(v45_)};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray45& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
- const T17 v17_;
- const T18 v18_;
- const T19 v19_;
- const T20 v20_;
- const T21 v21_;
- const T22 v22_;
- const T23 v23_;
- const T24 v24_;
- const T25 v25_;
- const T26 v26_;
- const T27 v27_;
- const T28 v28_;
- const T29 v29_;
- const T30 v30_;
- const T31 v31_;
- const T32 v32_;
- const T33 v33_;
- const T34 v34_;
- const T35 v35_;
- const T36 v36_;
- const T37 v37_;
- const T38 v38_;
- const T39 v39_;
- const T40 v40_;
- const T41 v41_;
- const T42 v42_;
- const T43 v43_;
- const T44 v44_;
- const T45 v45_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42, typename T43, typename T44, typename T45,
- typename T46>
-class ValueArray46 {
- public:
- ValueArray46(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
- T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
- T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
- T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) : v1_(v1), v2_(v2), v3_(v3),
- v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
- v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
- v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
- v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
- v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
- v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40),
- v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), v46_(v46) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
- static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
- static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
- static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
- static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
- static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
- static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
- static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
- static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
- static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
- static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
- static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
- static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
- static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
- static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
- static_cast<T>(v45_), static_cast<T>(v46_)};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray46& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
- const T17 v17_;
- const T18 v18_;
- const T19 v19_;
- const T20 v20_;
- const T21 v21_;
- const T22 v22_;
- const T23 v23_;
- const T24 v24_;
- const T25 v25_;
- const T26 v26_;
- const T27 v27_;
- const T28 v28_;
- const T29 v29_;
- const T30 v30_;
- const T31 v31_;
- const T32 v32_;
- const T33 v33_;
- const T34 v34_;
- const T35 v35_;
- const T36 v36_;
- const T37 v37_;
- const T38 v38_;
- const T39 v39_;
- const T40 v40_;
- const T41 v41_;
- const T42 v42_;
- const T43 v43_;
- const T44 v44_;
- const T45 v45_;
- const T46 v46_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42, typename T43, typename T44, typename T45,
- typename T46, typename T47>
-class ValueArray47 {
- public:
- ValueArray47(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
- T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
- T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
- T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) : v1_(v1), v2_(v2),
- v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
- v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
- v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
- v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
- v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
- v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40),
- v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), v46_(v46),
- v47_(v47) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
- static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
- static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
- static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
- static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
- static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
- static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
- static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
- static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
- static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
- static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
- static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
- static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
- static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
- static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
- static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_)};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray47& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
- const T17 v17_;
- const T18 v18_;
- const T19 v19_;
- const T20 v20_;
- const T21 v21_;
- const T22 v22_;
- const T23 v23_;
- const T24 v24_;
- const T25 v25_;
- const T26 v26_;
- const T27 v27_;
- const T28 v28_;
- const T29 v29_;
- const T30 v30_;
- const T31 v31_;
- const T32 v32_;
- const T33 v33_;
- const T34 v34_;
- const T35 v35_;
- const T36 v36_;
- const T37 v37_;
- const T38 v38_;
- const T39 v39_;
- const T40 v40_;
- const T41 v41_;
- const T42 v42_;
- const T43 v43_;
- const T44 v44_;
- const T45 v45_;
- const T46 v46_;
- const T47 v47_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42, typename T43, typename T44, typename T45,
- typename T46, typename T47, typename T48>
-class ValueArray48 {
- public:
- ValueArray48(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
- T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
- T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
- T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48) : v1_(v1),
- v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
- v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
- v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
- v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),
- v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33),
- v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39),
- v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45),
- v46_(v46), v47_(v47), v48_(v48) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
- static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
- static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
- static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
- static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
- static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
- static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
- static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
- static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
- static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
- static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
- static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
- static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
- static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
- static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
- static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_),
- static_cast<T>(v48_)};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray48& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
- const T17 v17_;
- const T18 v18_;
- const T19 v19_;
- const T20 v20_;
- const T21 v21_;
- const T22 v22_;
- const T23 v23_;
- const T24 v24_;
- const T25 v25_;
- const T26 v26_;
- const T27 v27_;
- const T28 v28_;
- const T29 v29_;
- const T30 v30_;
- const T31 v31_;
- const T32 v32_;
- const T33 v33_;
- const T34 v34_;
- const T35 v35_;
- const T36 v36_;
- const T37 v37_;
- const T38 v38_;
- const T39 v39_;
- const T40 v40_;
- const T41 v41_;
- const T42 v42_;
- const T43 v43_;
- const T44 v44_;
- const T45 v45_;
- const T46 v46_;
- const T47 v47_;
- const T48 v48_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42, typename T43, typename T44, typename T45,
- typename T46, typename T47, typename T48, typename T49>
-class ValueArray49 {
- public:
- ValueArray49(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
- T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
- T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
- T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48,
- T49 v49) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
- v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
- v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
- v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
- v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
- v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
- v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44),
- v45_(v45), v46_(v46), v47_(v47), v48_(v48), v49_(v49) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
- static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
- static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
- static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
- static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
- static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
- static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
- static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
- static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
- static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
- static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
- static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
- static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
- static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
- static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
- static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_),
- static_cast<T>(v48_), static_cast<T>(v49_)};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray49& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
- const T17 v17_;
- const T18 v18_;
- const T19 v19_;
- const T20 v20_;
- const T21 v21_;
- const T22 v22_;
- const T23 v23_;
- const T24 v24_;
- const T25 v25_;
- const T26 v26_;
- const T27 v27_;
- const T28 v28_;
- const T29 v29_;
- const T30 v30_;
- const T31 v31_;
- const T32 v32_;
- const T33 v33_;
- const T34 v34_;
- const T35 v35_;
- const T36 v36_;
- const T37 v37_;
- const T38 v38_;
- const T39 v39_;
- const T40 v40_;
- const T41 v41_;
- const T42 v42_;
- const T43 v43_;
- const T44 v44_;
- const T45 v45_;
- const T46 v46_;
- const T47 v47_;
- const T48 v48_;
- const T49 v49_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42, typename T43, typename T44, typename T45,
- typename T46, typename T47, typename T48, typename T49, typename T50>
-class ValueArray50 {
- public:
- ValueArray50(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
- T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
- T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
- T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48, T49 v49,
- T50 v50) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
- v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
- v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
- v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
- v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
- v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
- v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44),
- v45_(v45), v46_(v46), v47_(v47), v48_(v48), v49_(v49), v50_(v50) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
- static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
- static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
- static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
- static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
- static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
- static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
- static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
- static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
- static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
- static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
- static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
- static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
- static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
- static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
- static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_),
- static_cast<T>(v48_), static_cast<T>(v49_), static_cast<T>(v50_)};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray50& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
- const T17 v17_;
- const T18 v18_;
- const T19 v19_;
- const T20 v20_;
- const T21 v21_;
- const T22 v22_;
- const T23 v23_;
- const T24 v24_;
- const T25 v25_;
- const T26 v26_;
- const T27 v27_;
- const T28 v28_;
- const T29 v29_;
- const T30 v30_;
- const T31 v31_;
- const T32 v32_;
- const T33 v33_;
- const T34 v34_;
- const T35 v35_;
- const T36 v36_;
- const T37 v37_;
- const T38 v38_;
- const T39 v39_;
- const T40 v40_;
- const T41 v41_;
- const T42 v42_;
- const T43 v43_;
- const T44 v44_;
- const T45 v45_;
- const T46 v46_;
- const T47 v47_;
- const T48 v48_;
- const T49 v49_;
- const T50 v50_;
-};
-
-# if GTEST_HAS_COMBINE
-// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
-//
-// Generates values from the Cartesian product of values produced
-// by the argument generators.
-//
-template <typename T1, typename T2>
-class CartesianProductGenerator2
- : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2> > {
- public:
- typedef ::std::tr1::tuple<T1, T2> ParamType;
-
- CartesianProductGenerator2(const ParamGenerator<T1>& g1,
- const ParamGenerator<T2>& g2)
- : g1_(g1), g2_(g2) {}
- virtual ~CartesianProductGenerator2() {}
-
- virtual ParamIteratorInterface<ParamType>* Begin() const {
- return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin());
- }
- virtual ParamIteratorInterface<ParamType>* End() const {
- return new Iterator(this, g1_, g1_.end(), g2_, g2_.end());
- }
-
- private:
- class Iterator : public ParamIteratorInterface<ParamType> {
- public:
- Iterator(const ParamGeneratorInterface<ParamType>* base,
- const ParamGenerator<T1>& g1,
- const typename ParamGenerator<T1>::iterator& current1,
- const ParamGenerator<T2>& g2,
- const typename ParamGenerator<T2>::iterator& current2)
- : base_(base),
- begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
- begin2_(g2.begin()), end2_(g2.end()), current2_(current2) {
- ComputeCurrentValue();
- }
- virtual ~Iterator() {}
-
- virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
- return base_;
- }
- // Advance should not be called on beyond-of-range iterators
- // so no component iterators must be beyond end of range, either.
- virtual void Advance() {
- assert(!AtEnd());
- ++current2_;
- if (current2_ == end2_) {
- current2_ = begin2_;
- ++current1_;
- }
- ComputeCurrentValue();
- }
- virtual ParamIteratorInterface<ParamType>* Clone() const {
- return new Iterator(*this);
- }
- virtual const ParamType* Current() const { return &current_value_; }
- virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
- // Having the same base generator guarantees that the other
- // iterator is of the same type and we can downcast.
- GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
- << "The program attempted to compare iterators "
- << "from different generators." << std::endl;
- const Iterator* typed_other =
- CheckedDowncastToActualType<const Iterator>(&other);
- // We must report iterators equal if they both point beyond their
- // respective ranges. That can happen in a variety of fashions,
- // so we have to consult AtEnd().
- return (AtEnd() && typed_other->AtEnd()) ||
- (
- current1_ == typed_other->current1_ &&
- current2_ == typed_other->current2_);
- }
-
- private:
- Iterator(const Iterator& other)
- : base_(other.base_),
- begin1_(other.begin1_),
- end1_(other.end1_),
- current1_(other.current1_),
- begin2_(other.begin2_),
- end2_(other.end2_),
- current2_(other.current2_) {
- ComputeCurrentValue();
- }
-
- void ComputeCurrentValue() {
- if (!AtEnd())
- current_value_ = ParamType(*current1_, *current2_);
- }
- bool AtEnd() const {
- // We must report iterator past the end of the range when either of the
- // component iterators has reached the end of its range.
- return
- current1_ == end1_ ||
- current2_ == end2_;
- }
-
- // No implementation - assignment is unsupported.
- void operator=(const Iterator& other);
-
- const ParamGeneratorInterface<ParamType>* const base_;
- // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
- // current[i]_ is the actual traversing iterator.
- const typename ParamGenerator<T1>::iterator begin1_;
- const typename ParamGenerator<T1>::iterator end1_;
- typename ParamGenerator<T1>::iterator current1_;
- const typename ParamGenerator<T2>::iterator begin2_;
- const typename ParamGenerator<T2>::iterator end2_;
- typename ParamGenerator<T2>::iterator current2_;
- ParamType current_value_;
- }; // class CartesianProductGenerator2::Iterator
-
- // No implementation - assignment is unsupported.
- void operator=(const CartesianProductGenerator2& other);
-
- const ParamGenerator<T1> g1_;
- const ParamGenerator<T2> g2_;
-}; // class CartesianProductGenerator2
-
-
-template <typename T1, typename T2, typename T3>
-class CartesianProductGenerator3
- : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3> > {
- public:
- typedef ::std::tr1::tuple<T1, T2, T3> ParamType;
-
- CartesianProductGenerator3(const ParamGenerator<T1>& g1,
- const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3)
- : g1_(g1), g2_(g2), g3_(g3) {}
- virtual ~CartesianProductGenerator3() {}
-
- virtual ParamIteratorInterface<ParamType>* Begin() const {
- return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
- g3_.begin());
- }
- virtual ParamIteratorInterface<ParamType>* End() const {
- return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end());
- }
-
- private:
- class Iterator : public ParamIteratorInterface<ParamType> {
- public:
- Iterator(const ParamGeneratorInterface<ParamType>* base,
- const ParamGenerator<T1>& g1,
- const typename ParamGenerator<T1>::iterator& current1,
- const ParamGenerator<T2>& g2,
- const typename ParamGenerator<T2>::iterator& current2,
- const ParamGenerator<T3>& g3,
- const typename ParamGenerator<T3>::iterator& current3)
- : base_(base),
- begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
- begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
- begin3_(g3.begin()), end3_(g3.end()), current3_(current3) {
- ComputeCurrentValue();
- }
- virtual ~Iterator() {}
-
- virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
- return base_;
- }
- // Advance should not be called on beyond-of-range iterators
- // so no component iterators must be beyond end of range, either.
- virtual void Advance() {
- assert(!AtEnd());
- ++current3_;
- if (current3_ == end3_) {
- current3_ = begin3_;
- ++current2_;
- }
- if (current2_ == end2_) {
- current2_ = begin2_;
- ++current1_;
- }
- ComputeCurrentValue();
- }
- virtual ParamIteratorInterface<ParamType>* Clone() const {
- return new Iterator(*this);
- }
- virtual const ParamType* Current() const { return &current_value_; }
- virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
- // Having the same base generator guarantees that the other
- // iterator is of the same type and we can downcast.
- GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
- << "The program attempted to compare iterators "
- << "from different generators." << std::endl;
- const Iterator* typed_other =
- CheckedDowncastToActualType<const Iterator>(&other);
- // We must report iterators equal if they both point beyond their
- // respective ranges. That can happen in a variety of fashions,
- // so we have to consult AtEnd().
- return (AtEnd() && typed_other->AtEnd()) ||
- (
- current1_ == typed_other->current1_ &&
- current2_ == typed_other->current2_ &&
- current3_ == typed_other->current3_);
- }
-
- private:
- Iterator(const Iterator& other)
- : base_(other.base_),
- begin1_(other.begin1_),
- end1_(other.end1_),
- current1_(other.current1_),
- begin2_(other.begin2_),
- end2_(other.end2_),
- current2_(other.current2_),
- begin3_(other.begin3_),
- end3_(other.end3_),
- current3_(other.current3_) {
- ComputeCurrentValue();
- }
-
- void ComputeCurrentValue() {
- if (!AtEnd())
- current_value_ = ParamType(*current1_, *current2_, *current3_);
- }
- bool AtEnd() const {
- // We must report iterator past the end of the range when either of the
- // component iterators has reached the end of its range.
- return
- current1_ == end1_ ||
- current2_ == end2_ ||
- current3_ == end3_;
- }
-
- // No implementation - assignment is unsupported.
- void operator=(const Iterator& other);
-
- const ParamGeneratorInterface<ParamType>* const base_;
- // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
- // current[i]_ is the actual traversing iterator.
- const typename ParamGenerator<T1>::iterator begin1_;
- const typename ParamGenerator<T1>::iterator end1_;
- typename ParamGenerator<T1>::iterator current1_;
- const typename ParamGenerator<T2>::iterator begin2_;
- const typename ParamGenerator<T2>::iterator end2_;
- typename ParamGenerator<T2>::iterator current2_;
- const typename ParamGenerator<T3>::iterator begin3_;
- const typename ParamGenerator<T3>::iterator end3_;
- typename ParamGenerator<T3>::iterator current3_;
- ParamType current_value_;
- }; // class CartesianProductGenerator3::Iterator
-
- // No implementation - assignment is unsupported.
- void operator=(const CartesianProductGenerator3& other);
-
- const ParamGenerator<T1> g1_;
- const ParamGenerator<T2> g2_;
- const ParamGenerator<T3> g3_;
-}; // class CartesianProductGenerator3
-
-
-template <typename T1, typename T2, typename T3, typename T4>
-class CartesianProductGenerator4
- : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4> > {
- public:
- typedef ::std::tr1::tuple<T1, T2, T3, T4> ParamType;
-
- CartesianProductGenerator4(const ParamGenerator<T1>& g1,
- const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
- const ParamGenerator<T4>& g4)
- : g1_(g1), g2_(g2), g3_(g3), g4_(g4) {}
- virtual ~CartesianProductGenerator4() {}
-
- virtual ParamIteratorInterface<ParamType>* Begin() const {
- return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
- g3_.begin(), g4_, g4_.begin());
- }
- virtual ParamIteratorInterface<ParamType>* End() const {
- return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
- g4_, g4_.end());
- }
-
- private:
- class Iterator : public ParamIteratorInterface<ParamType> {
- public:
- Iterator(const ParamGeneratorInterface<ParamType>* base,
- const ParamGenerator<T1>& g1,
- const typename ParamGenerator<T1>::iterator& current1,
- const ParamGenerator<T2>& g2,
- const typename ParamGenerator<T2>::iterator& current2,
- const ParamGenerator<T3>& g3,
- const typename ParamGenerator<T3>::iterator& current3,
- const ParamGenerator<T4>& g4,
- const typename ParamGenerator<T4>::iterator& current4)
- : base_(base),
- begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
- begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
- begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
- begin4_(g4.begin()), end4_(g4.end()), current4_(current4) {
- ComputeCurrentValue();
- }
- virtual ~Iterator() {}
-
- virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
- return base_;
- }
- // Advance should not be called on beyond-of-range iterators
- // so no component iterators must be beyond end of range, either.
- virtual void Advance() {
- assert(!AtEnd());
- ++current4_;
- if (current4_ == end4_) {
- current4_ = begin4_;
- ++current3_;
- }
- if (current3_ == end3_) {
- current3_ = begin3_;
- ++current2_;
- }
- if (current2_ == end2_) {
- current2_ = begin2_;
- ++current1_;
- }
- ComputeCurrentValue();
- }
- virtual ParamIteratorInterface<ParamType>* Clone() const {
- return new Iterator(*this);
- }
- virtual const ParamType* Current() const { return &current_value_; }
- virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
- // Having the same base generator guarantees that the other
- // iterator is of the same type and we can downcast.
- GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
- << "The program attempted to compare iterators "
- << "from different generators." << std::endl;
- const Iterator* typed_other =
- CheckedDowncastToActualType<const Iterator>(&other);
- // We must report iterators equal if they both point beyond their
- // respective ranges. That can happen in a variety of fashions,
- // so we have to consult AtEnd().
- return (AtEnd() && typed_other->AtEnd()) ||
- (
- current1_ == typed_other->current1_ &&
- current2_ == typed_other->current2_ &&
- current3_ == typed_other->current3_ &&
- current4_ == typed_other->current4_);
- }
-
- private:
- Iterator(const Iterator& other)
- : base_(other.base_),
- begin1_(other.begin1_),
- end1_(other.end1_),
- current1_(other.current1_),
- begin2_(other.begin2_),
- end2_(other.end2_),
- current2_(other.current2_),
- begin3_(other.begin3_),
- end3_(other.end3_),
- current3_(other.current3_),
- begin4_(other.begin4_),
- end4_(other.end4_),
- current4_(other.current4_) {
- ComputeCurrentValue();
- }
-
- void ComputeCurrentValue() {
- if (!AtEnd())
- current_value_ = ParamType(*current1_, *current2_, *current3_,
- *current4_);
- }
- bool AtEnd() const {
- // We must report iterator past the end of the range when either of the
- // component iterators has reached the end of its range.
- return
- current1_ == end1_ ||
- current2_ == end2_ ||
- current3_ == end3_ ||
- current4_ == end4_;
- }
-
- // No implementation - assignment is unsupported.
- void operator=(const Iterator& other);
-
- const ParamGeneratorInterface<ParamType>* const base_;
- // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
- // current[i]_ is the actual traversing iterator.
- const typename ParamGenerator<T1>::iterator begin1_;
- const typename ParamGenerator<T1>::iterator end1_;
- typename ParamGenerator<T1>::iterator current1_;
- const typename ParamGenerator<T2>::iterator begin2_;
- const typename ParamGenerator<T2>::iterator end2_;
- typename ParamGenerator<T2>::iterator current2_;
- const typename ParamGenerator<T3>::iterator begin3_;
- const typename ParamGenerator<T3>::iterator end3_;
- typename ParamGenerator<T3>::iterator current3_;
- const typename ParamGenerator<T4>::iterator begin4_;
- const typename ParamGenerator<T4>::iterator end4_;
- typename ParamGenerator<T4>::iterator current4_;
- ParamType current_value_;
- }; // class CartesianProductGenerator4::Iterator
-
- // No implementation - assignment is unsupported.
- void operator=(const CartesianProductGenerator4& other);
-
- const ParamGenerator<T1> g1_;
- const ParamGenerator<T2> g2_;
- const ParamGenerator<T3> g3_;
- const ParamGenerator<T4> g4_;
-}; // class CartesianProductGenerator4
-
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5>
-class CartesianProductGenerator5
- : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5> > {
- public:
- typedef ::std::tr1::tuple<T1, T2, T3, T4, T5> ParamType;
-
- CartesianProductGenerator5(const ParamGenerator<T1>& g1,
- const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
- const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5)
- : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {}
- virtual ~CartesianProductGenerator5() {}
-
- virtual ParamIteratorInterface<ParamType>* Begin() const {
- return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
- g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin());
- }
- virtual ParamIteratorInterface<ParamType>* End() const {
- return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
- g4_, g4_.end(), g5_, g5_.end());
- }
-
- private:
- class Iterator : public ParamIteratorInterface<ParamType> {
- public:
- Iterator(const ParamGeneratorInterface<ParamType>* base,
- const ParamGenerator<T1>& g1,
- const typename ParamGenerator<T1>::iterator& current1,
- const ParamGenerator<T2>& g2,
- const typename ParamGenerator<T2>::iterator& current2,
- const ParamGenerator<T3>& g3,
- const typename ParamGenerator<T3>::iterator& current3,
- const ParamGenerator<T4>& g4,
- const typename ParamGenerator<T4>::iterator& current4,
- const ParamGenerator<T5>& g5,
- const typename ParamGenerator<T5>::iterator& current5)
- : base_(base),
- begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
- begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
- begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
- begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
- begin5_(g5.begin()), end5_(g5.end()), current5_(current5) {
- ComputeCurrentValue();
- }
- virtual ~Iterator() {}
-
- virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
- return base_;
- }
- // Advance should not be called on beyond-of-range iterators
- // so no component iterators must be beyond end of range, either.
- virtual void Advance() {
- assert(!AtEnd());
- ++current5_;
- if (current5_ == end5_) {
- current5_ = begin5_;
- ++current4_;
- }
- if (current4_ == end4_) {
- current4_ = begin4_;
- ++current3_;
- }
- if (current3_ == end3_) {
- current3_ = begin3_;
- ++current2_;
- }
- if (current2_ == end2_) {
- current2_ = begin2_;
- ++current1_;
- }
- ComputeCurrentValue();
- }
- virtual ParamIteratorInterface<ParamType>* Clone() const {
- return new Iterator(*this);
- }
- virtual const ParamType* Current() const { return &current_value_; }
- virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
- // Having the same base generator guarantees that the other
- // iterator is of the same type and we can downcast.
- GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
- << "The program attempted to compare iterators "
- << "from different generators." << std::endl;
- const Iterator* typed_other =
- CheckedDowncastToActualType<const Iterator>(&other);
- // We must report iterators equal if they both point beyond their
- // respective ranges. That can happen in a variety of fashions,
- // so we have to consult AtEnd().
- return (AtEnd() && typed_other->AtEnd()) ||
- (
- current1_ == typed_other->current1_ &&
- current2_ == typed_other->current2_ &&
- current3_ == typed_other->current3_ &&
- current4_ == typed_other->current4_ &&
- current5_ == typed_other->current5_);
- }
-
- private:
- Iterator(const Iterator& other)
- : base_(other.base_),
- begin1_(other.begin1_),
- end1_(other.end1_),
- current1_(other.current1_),
- begin2_(other.begin2_),
- end2_(other.end2_),
- current2_(other.current2_),
- begin3_(other.begin3_),
- end3_(other.end3_),
- current3_(other.current3_),
- begin4_(other.begin4_),
- end4_(other.end4_),
- current4_(other.current4_),
- begin5_(other.begin5_),
- end5_(other.end5_),
- current5_(other.current5_) {
- ComputeCurrentValue();
- }
-
- void ComputeCurrentValue() {
- if (!AtEnd())
- current_value_ = ParamType(*current1_, *current2_, *current3_,
- *current4_, *current5_);
- }
- bool AtEnd() const {
- // We must report iterator past the end of the range when either of the
- // component iterators has reached the end of its range.
- return
- current1_ == end1_ ||
- current2_ == end2_ ||
- current3_ == end3_ ||
- current4_ == end4_ ||
- current5_ == end5_;
- }
-
- // No implementation - assignment is unsupported.
- void operator=(const Iterator& other);
-
- const ParamGeneratorInterface<ParamType>* const base_;
- // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
- // current[i]_ is the actual traversing iterator.
- const typename ParamGenerator<T1>::iterator begin1_;
- const typename ParamGenerator<T1>::iterator end1_;
- typename ParamGenerator<T1>::iterator current1_;
- const typename ParamGenerator<T2>::iterator begin2_;
- const typename ParamGenerator<T2>::iterator end2_;
- typename ParamGenerator<T2>::iterator current2_;
- const typename ParamGenerator<T3>::iterator begin3_;
- const typename ParamGenerator<T3>::iterator end3_;
- typename ParamGenerator<T3>::iterator current3_;
- const typename ParamGenerator<T4>::iterator begin4_;
- const typename ParamGenerator<T4>::iterator end4_;
- typename ParamGenerator<T4>::iterator current4_;
- const typename ParamGenerator<T5>::iterator begin5_;
- const typename ParamGenerator<T5>::iterator end5_;
- typename ParamGenerator<T5>::iterator current5_;
- ParamType current_value_;
- }; // class CartesianProductGenerator5::Iterator
-
- // No implementation - assignment is unsupported.
- void operator=(const CartesianProductGenerator5& other);
-
- const ParamGenerator<T1> g1_;
- const ParamGenerator<T2> g2_;
- const ParamGenerator<T3> g3_;
- const ParamGenerator<T4> g4_;
- const ParamGenerator<T5> g5_;
-}; // class CartesianProductGenerator5
-
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6>
-class CartesianProductGenerator6
- : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5,
- T6> > {
- public:
- typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> ParamType;
-
- CartesianProductGenerator6(const ParamGenerator<T1>& g1,
- const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
- const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
- const ParamGenerator<T6>& g6)
- : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {}
- virtual ~CartesianProductGenerator6() {}
-
- virtual ParamIteratorInterface<ParamType>* Begin() const {
- return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
- g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin());
- }
- virtual ParamIteratorInterface<ParamType>* End() const {
- return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
- g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end());
- }
-
- private:
- class Iterator : public ParamIteratorInterface<ParamType> {
- public:
- Iterator(const ParamGeneratorInterface<ParamType>* base,
- const ParamGenerator<T1>& g1,
- const typename ParamGenerator<T1>::iterator& current1,
- const ParamGenerator<T2>& g2,
- const typename ParamGenerator<T2>::iterator& current2,
- const ParamGenerator<T3>& g3,
- const typename ParamGenerator<T3>::iterator& current3,
- const ParamGenerator<T4>& g4,
- const typename ParamGenerator<T4>::iterator& current4,
- const ParamGenerator<T5>& g5,
- const typename ParamGenerator<T5>::iterator& current5,
- const ParamGenerator<T6>& g6,
- const typename ParamGenerator<T6>::iterator& current6)
- : base_(base),
- begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
- begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
- begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
- begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
- begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
- begin6_(g6.begin()), end6_(g6.end()), current6_(current6) {
- ComputeCurrentValue();
- }
- virtual ~Iterator() {}
-
- virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
- return base_;
- }
- // Advance should not be called on beyond-of-range iterators
- // so no component iterators must be beyond end of range, either.
- virtual void Advance() {
- assert(!AtEnd());
- ++current6_;
- if (current6_ == end6_) {
- current6_ = begin6_;
- ++current5_;
- }
- if (current5_ == end5_) {
- current5_ = begin5_;
- ++current4_;
- }
- if (current4_ == end4_) {
- current4_ = begin4_;
- ++current3_;
- }
- if (current3_ == end3_) {
- current3_ = begin3_;
- ++current2_;
- }
- if (current2_ == end2_) {
- current2_ = begin2_;
- ++current1_;
- }
- ComputeCurrentValue();
- }
- virtual ParamIteratorInterface<ParamType>* Clone() const {
- return new Iterator(*this);
- }
- virtual const ParamType* Current() const { return &current_value_; }
- virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
- // Having the same base generator guarantees that the other
- // iterator is of the same type and we can downcast.
- GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
- << "The program attempted to compare iterators "
- << "from different generators." << std::endl;
- const Iterator* typed_other =
- CheckedDowncastToActualType<const Iterator>(&other);
- // We must report iterators equal if they both point beyond their
- // respective ranges. That can happen in a variety of fashions,
- // so we have to consult AtEnd().
- return (AtEnd() && typed_other->AtEnd()) ||
- (
- current1_ == typed_other->current1_ &&
- current2_ == typed_other->current2_ &&
- current3_ == typed_other->current3_ &&
- current4_ == typed_other->current4_ &&
- current5_ == typed_other->current5_ &&
- current6_ == typed_other->current6_);
- }
-
- private:
- Iterator(const Iterator& other)
- : base_(other.base_),
- begin1_(other.begin1_),
- end1_(other.end1_),
- current1_(other.current1_),
- begin2_(other.begin2_),
- end2_(other.end2_),
- current2_(other.current2_),
- begin3_(other.begin3_),
- end3_(other.end3_),
- current3_(other.current3_),
- begin4_(other.begin4_),
- end4_(other.end4_),
- current4_(other.current4_),
- begin5_(other.begin5_),
- end5_(other.end5_),
- current5_(other.current5_),
- begin6_(other.begin6_),
- end6_(other.end6_),
- current6_(other.current6_) {
- ComputeCurrentValue();
- }
-
- void ComputeCurrentValue() {
- if (!AtEnd())
- current_value_ = ParamType(*current1_, *current2_, *current3_,
- *current4_, *current5_, *current6_);
- }
- bool AtEnd() const {
- // We must report iterator past the end of the range when either of the
- // component iterators has reached the end of its range.
- return
- current1_ == end1_ ||
- current2_ == end2_ ||
- current3_ == end3_ ||
- current4_ == end4_ ||
- current5_ == end5_ ||
- current6_ == end6_;
- }
-
- // No implementation - assignment is unsupported.
- void operator=(const Iterator& other);
-
- const ParamGeneratorInterface<ParamType>* const base_;
- // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
- // current[i]_ is the actual traversing iterator.
- const typename ParamGenerator<T1>::iterator begin1_;
- const typename ParamGenerator<T1>::iterator end1_;
- typename ParamGenerator<T1>::iterator current1_;
- const typename ParamGenerator<T2>::iterator begin2_;
- const typename ParamGenerator<T2>::iterator end2_;
- typename ParamGenerator<T2>::iterator current2_;
- const typename ParamGenerator<T3>::iterator begin3_;
- const typename ParamGenerator<T3>::iterator end3_;
- typename ParamGenerator<T3>::iterator current3_;
- const typename ParamGenerator<T4>::iterator begin4_;
- const typename ParamGenerator<T4>::iterator end4_;
- typename ParamGenerator<T4>::iterator current4_;
- const typename ParamGenerator<T5>::iterator begin5_;
- const typename ParamGenerator<T5>::iterator end5_;
- typename ParamGenerator<T5>::iterator current5_;
- const typename ParamGenerator<T6>::iterator begin6_;
- const typename ParamGenerator<T6>::iterator end6_;
- typename ParamGenerator<T6>::iterator current6_;
- ParamType current_value_;
- }; // class CartesianProductGenerator6::Iterator
-
- // No implementation - assignment is unsupported.
- void operator=(const CartesianProductGenerator6& other);
-
- const ParamGenerator<T1> g1_;
- const ParamGenerator<T2> g2_;
- const ParamGenerator<T3> g3_;
- const ParamGenerator<T4> g4_;
- const ParamGenerator<T5> g5_;
- const ParamGenerator<T6> g6_;
-}; // class CartesianProductGenerator6
-
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7>
-class CartesianProductGenerator7
- : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
- T7> > {
- public:
- typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7> ParamType;
-
- CartesianProductGenerator7(const ParamGenerator<T1>& g1,
- const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
- const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
- const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7)
- : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {}
- virtual ~CartesianProductGenerator7() {}
-
- virtual ParamIteratorInterface<ParamType>* Begin() const {
- return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
- g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
- g7_.begin());
- }
- virtual ParamIteratorInterface<ParamType>* End() const {
- return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
- g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end());
- }
-
- private:
- class Iterator : public ParamIteratorInterface<ParamType> {
- public:
- Iterator(const ParamGeneratorInterface<ParamType>* base,
- const ParamGenerator<T1>& g1,
- const typename ParamGenerator<T1>::iterator& current1,
- const ParamGenerator<T2>& g2,
- const typename ParamGenerator<T2>::iterator& current2,
- const ParamGenerator<T3>& g3,
- const typename ParamGenerator<T3>::iterator& current3,
- const ParamGenerator<T4>& g4,
- const typename ParamGenerator<T4>::iterator& current4,
- const ParamGenerator<T5>& g5,
- const typename ParamGenerator<T5>::iterator& current5,
- const ParamGenerator<T6>& g6,
- const typename ParamGenerator<T6>::iterator& current6,
- const ParamGenerator<T7>& g7,
- const typename ParamGenerator<T7>::iterator& current7)
- : base_(base),
- begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
- begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
- begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
- begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
- begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
- begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
- begin7_(g7.begin()), end7_(g7.end()), current7_(current7) {
- ComputeCurrentValue();
- }
- virtual ~Iterator() {}
-
- virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
- return base_;
- }
- // Advance should not be called on beyond-of-range iterators
- // so no component iterators must be beyond end of range, either.
- virtual void Advance() {
- assert(!AtEnd());
- ++current7_;
- if (current7_ == end7_) {
- current7_ = begin7_;
- ++current6_;
- }
- if (current6_ == end6_) {
- current6_ = begin6_;
- ++current5_;
- }
- if (current5_ == end5_) {
- current5_ = begin5_;
- ++current4_;
- }
- if (current4_ == end4_) {
- current4_ = begin4_;
- ++current3_;
- }
- if (current3_ == end3_) {
- current3_ = begin3_;
- ++current2_;
- }
- if (current2_ == end2_) {
- current2_ = begin2_;
- ++current1_;
- }
- ComputeCurrentValue();
- }
- virtual ParamIteratorInterface<ParamType>* Clone() const {
- return new Iterator(*this);
- }
- virtual const ParamType* Current() const { return &current_value_; }
- virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
- // Having the same base generator guarantees that the other
- // iterator is of the same type and we can downcast.
- GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
- << "The program attempted to compare iterators "
- << "from different generators." << std::endl;
- const Iterator* typed_other =
- CheckedDowncastToActualType<const Iterator>(&other);
- // We must report iterators equal if they both point beyond their
- // respective ranges. That can happen in a variety of fashions,
- // so we have to consult AtEnd().
- return (AtEnd() && typed_other->AtEnd()) ||
- (
- current1_ == typed_other->current1_ &&
- current2_ == typed_other->current2_ &&
- current3_ == typed_other->current3_ &&
- current4_ == typed_other->current4_ &&
- current5_ == typed_other->current5_ &&
- current6_ == typed_other->current6_ &&
- current7_ == typed_other->current7_);
- }
-
- private:
- Iterator(const Iterator& other)
- : base_(other.base_),
- begin1_(other.begin1_),
- end1_(other.end1_),
- current1_(other.current1_),
- begin2_(other.begin2_),
- end2_(other.end2_),
- current2_(other.current2_),
- begin3_(other.begin3_),
- end3_(other.end3_),
- current3_(other.current3_),
- begin4_(other.begin4_),
- end4_(other.end4_),
- current4_(other.current4_),
- begin5_(other.begin5_),
- end5_(other.end5_),
- current5_(other.current5_),
- begin6_(other.begin6_),
- end6_(other.end6_),
- current6_(other.current6_),
- begin7_(other.begin7_),
- end7_(other.end7_),
- current7_(other.current7_) {
- ComputeCurrentValue();
- }
-
- void ComputeCurrentValue() {
- if (!AtEnd())
- current_value_ = ParamType(*current1_, *current2_, *current3_,
- *current4_, *current5_, *current6_, *current7_);
- }
- bool AtEnd() const {
- // We must report iterator past the end of the range when either of the
- // component iterators has reached the end of its range.
- return
- current1_ == end1_ ||
- current2_ == end2_ ||
- current3_ == end3_ ||
- current4_ == end4_ ||
- current5_ == end5_ ||
- current6_ == end6_ ||
- current7_ == end7_;
- }
-
- // No implementation - assignment is unsupported.
- void operator=(const Iterator& other);
-
- const ParamGeneratorInterface<ParamType>* const base_;
- // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
- // current[i]_ is the actual traversing iterator.
- const typename ParamGenerator<T1>::iterator begin1_;
- const typename ParamGenerator<T1>::iterator end1_;
- typename ParamGenerator<T1>::iterator current1_;
- const typename ParamGenerator<T2>::iterator begin2_;
- const typename ParamGenerator<T2>::iterator end2_;
- typename ParamGenerator<T2>::iterator current2_;
- const typename ParamGenerator<T3>::iterator begin3_;
- const typename ParamGenerator<T3>::iterator end3_;
- typename ParamGenerator<T3>::iterator current3_;
- const typename ParamGenerator<T4>::iterator begin4_;
- const typename ParamGenerator<T4>::iterator end4_;
- typename ParamGenerator<T4>::iterator current4_;
- const typename ParamGenerator<T5>::iterator begin5_;
- const typename ParamGenerator<T5>::iterator end5_;
- typename ParamGenerator<T5>::iterator current5_;
- const typename ParamGenerator<T6>::iterator begin6_;
- const typename ParamGenerator<T6>::iterator end6_;
- typename ParamGenerator<T6>::iterator current6_;
- const typename ParamGenerator<T7>::iterator begin7_;
- const typename ParamGenerator<T7>::iterator end7_;
- typename ParamGenerator<T7>::iterator current7_;
- ParamType current_value_;
- }; // class CartesianProductGenerator7::Iterator
-
- // No implementation - assignment is unsupported.
- void operator=(const CartesianProductGenerator7& other);
-
- const ParamGenerator<T1> g1_;
- const ParamGenerator<T2> g2_;
- const ParamGenerator<T3> g3_;
- const ParamGenerator<T4> g4_;
- const ParamGenerator<T5> g5_;
- const ParamGenerator<T6> g6_;
- const ParamGenerator<T7> g7_;
-}; // class CartesianProductGenerator7
-
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8>
-class CartesianProductGenerator8
- : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
- T7, T8> > {
- public:
- typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8> ParamType;
-
- CartesianProductGenerator8(const ParamGenerator<T1>& g1,
- const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
- const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
- const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,
- const ParamGenerator<T8>& g8)
- : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7),
- g8_(g8) {}
- virtual ~CartesianProductGenerator8() {}
-
- virtual ParamIteratorInterface<ParamType>* Begin() const {
- return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
- g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
- g7_.begin(), g8_, g8_.begin());
- }
- virtual ParamIteratorInterface<ParamType>* End() const {
- return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
- g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
- g8_.end());
- }
-
- private:
- class Iterator : public ParamIteratorInterface<ParamType> {
- public:
- Iterator(const ParamGeneratorInterface<ParamType>* base,
- const ParamGenerator<T1>& g1,
- const typename ParamGenerator<T1>::iterator& current1,
- const ParamGenerator<T2>& g2,
- const typename ParamGenerator<T2>::iterator& current2,
- const ParamGenerator<T3>& g3,
- const typename ParamGenerator<T3>::iterator& current3,
- const ParamGenerator<T4>& g4,
- const typename ParamGenerator<T4>::iterator& current4,
- const ParamGenerator<T5>& g5,
- const typename ParamGenerator<T5>::iterator& current5,
- const ParamGenerator<T6>& g6,
- const typename ParamGenerator<T6>::iterator& current6,
- const ParamGenerator<T7>& g7,
- const typename ParamGenerator<T7>::iterator& current7,
- const ParamGenerator<T8>& g8,
- const typename ParamGenerator<T8>::iterator& current8)
- : base_(base),
- begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
- begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
- begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
- begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
- begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
- begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
- begin7_(g7.begin()), end7_(g7.end()), current7_(current7),
- begin8_(g8.begin()), end8_(g8.end()), current8_(current8) {
- ComputeCurrentValue();
- }
- virtual ~Iterator() {}
-
- virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
- return base_;
- }
- // Advance should not be called on beyond-of-range iterators
- // so no component iterators must be beyond end of range, either.
- virtual void Advance() {
- assert(!AtEnd());
- ++current8_;
- if (current8_ == end8_) {
- current8_ = begin8_;
- ++current7_;
- }
- if (current7_ == end7_) {
- current7_ = begin7_;
- ++current6_;
- }
- if (current6_ == end6_) {
- current6_ = begin6_;
- ++current5_;
- }
- if (current5_ == end5_) {
- current5_ = begin5_;
- ++current4_;
- }
- if (current4_ == end4_) {
- current4_ = begin4_;
- ++current3_;
- }
- if (current3_ == end3_) {
- current3_ = begin3_;
- ++current2_;
- }
- if (current2_ == end2_) {
- current2_ = begin2_;
- ++current1_;
- }
- ComputeCurrentValue();
- }
- virtual ParamIteratorInterface<ParamType>* Clone() const {
- return new Iterator(*this);
- }
- virtual const ParamType* Current() const { return &current_value_; }
- virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
- // Having the same base generator guarantees that the other
- // iterator is of the same type and we can downcast.
- GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
- << "The program attempted to compare iterators "
- << "from different generators." << std::endl;
- const Iterator* typed_other =
- CheckedDowncastToActualType<const Iterator>(&other);
- // We must report iterators equal if they both point beyond their
- // respective ranges. That can happen in a variety of fashions,
- // so we have to consult AtEnd().
- return (AtEnd() && typed_other->AtEnd()) ||
- (
- current1_ == typed_other->current1_ &&
- current2_ == typed_other->current2_ &&
- current3_ == typed_other->current3_ &&
- current4_ == typed_other->current4_ &&
- current5_ == typed_other->current5_ &&
- current6_ == typed_other->current6_ &&
- current7_ == typed_other->current7_ &&
- current8_ == typed_other->current8_);
- }
-
- private:
- Iterator(const Iterator& other)
- : base_(other.base_),
- begin1_(other.begin1_),
- end1_(other.end1_),
- current1_(other.current1_),
- begin2_(other.begin2_),
- end2_(other.end2_),
- current2_(other.current2_),
- begin3_(other.begin3_),
- end3_(other.end3_),
- current3_(other.current3_),
- begin4_(other.begin4_),
- end4_(other.end4_),
- current4_(other.current4_),
- begin5_(other.begin5_),
- end5_(other.end5_),
- current5_(other.current5_),
- begin6_(other.begin6_),
- end6_(other.end6_),
- current6_(other.current6_),
- begin7_(other.begin7_),
- end7_(other.end7_),
- current7_(other.current7_),
- begin8_(other.begin8_),
- end8_(other.end8_),
- current8_(other.current8_) {
- ComputeCurrentValue();
- }
-
- void ComputeCurrentValue() {
- if (!AtEnd())
- current_value_ = ParamType(*current1_, *current2_, *current3_,
- *current4_, *current5_, *current6_, *current7_, *current8_);
- }
- bool AtEnd() const {
- // We must report iterator past the end of the range when either of the
- // component iterators has reached the end of its range.
- return
- current1_ == end1_ ||
- current2_ == end2_ ||
- current3_ == end3_ ||
- current4_ == end4_ ||
- current5_ == end5_ ||
- current6_ == end6_ ||
- current7_ == end7_ ||
- current8_ == end8_;
- }
-
- // No implementation - assignment is unsupported.
- void operator=(const Iterator& other);
-
- const ParamGeneratorInterface<ParamType>* const base_;
- // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
- // current[i]_ is the actual traversing iterator.
- const typename ParamGenerator<T1>::iterator begin1_;
- const typename ParamGenerator<T1>::iterator end1_;
- typename ParamGenerator<T1>::iterator current1_;
- const typename ParamGenerator<T2>::iterator begin2_;
- const typename ParamGenerator<T2>::iterator end2_;
- typename ParamGenerator<T2>::iterator current2_;
- const typename ParamGenerator<T3>::iterator begin3_;
- const typename ParamGenerator<T3>::iterator end3_;
- typename ParamGenerator<T3>::iterator current3_;
- const typename ParamGenerator<T4>::iterator begin4_;
- const typename ParamGenerator<T4>::iterator end4_;
- typename ParamGenerator<T4>::iterator current4_;
- const typename ParamGenerator<T5>::iterator begin5_;
- const typename ParamGenerator<T5>::iterator end5_;
- typename ParamGenerator<T5>::iterator current5_;
- const typename ParamGenerator<T6>::iterator begin6_;
- const typename ParamGenerator<T6>::iterator end6_;
- typename ParamGenerator<T6>::iterator current6_;
- const typename ParamGenerator<T7>::iterator begin7_;
- const typename ParamGenerator<T7>::iterator end7_;
- typename ParamGenerator<T7>::iterator current7_;
- const typename ParamGenerator<T8>::iterator begin8_;
- const typename ParamGenerator<T8>::iterator end8_;
- typename ParamGenerator<T8>::iterator current8_;
- ParamType current_value_;
- }; // class CartesianProductGenerator8::Iterator
-
- // No implementation - assignment is unsupported.
- void operator=(const CartesianProductGenerator8& other);
-
- const ParamGenerator<T1> g1_;
- const ParamGenerator<T2> g2_;
- const ParamGenerator<T3> g3_;
- const ParamGenerator<T4> g4_;
- const ParamGenerator<T5> g5_;
- const ParamGenerator<T6> g6_;
- const ParamGenerator<T7> g7_;
- const ParamGenerator<T8> g8_;
-}; // class CartesianProductGenerator8
-
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9>
-class CartesianProductGenerator9
- : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
- T7, T8, T9> > {
- public:
- typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9> ParamType;
-
- CartesianProductGenerator9(const ParamGenerator<T1>& g1,
- const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
- const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
- const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,
- const ParamGenerator<T8>& g8, const ParamGenerator<T9>& g9)
- : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
- g9_(g9) {}
- virtual ~CartesianProductGenerator9() {}
-
- virtual ParamIteratorInterface<ParamType>* Begin() const {
- return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
- g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
- g7_.begin(), g8_, g8_.begin(), g9_, g9_.begin());
- }
- virtual ParamIteratorInterface<ParamType>* End() const {
- return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
- g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
- g8_.end(), g9_, g9_.end());
- }
-
- private:
- class Iterator : public ParamIteratorInterface<ParamType> {
- public:
- Iterator(const ParamGeneratorInterface<ParamType>* base,
- const ParamGenerator<T1>& g1,
- const typename ParamGenerator<T1>::iterator& current1,
- const ParamGenerator<T2>& g2,
- const typename ParamGenerator<T2>::iterator& current2,
- const ParamGenerator<T3>& g3,
- const typename ParamGenerator<T3>::iterator& current3,
- const ParamGenerator<T4>& g4,
- const typename ParamGenerator<T4>::iterator& current4,
- const ParamGenerator<T5>& g5,
- const typename ParamGenerator<T5>::iterator& current5,
- const ParamGenerator<T6>& g6,
- const typename ParamGenerator<T6>::iterator& current6,
- const ParamGenerator<T7>& g7,
- const typename ParamGenerator<T7>::iterator& current7,
- const ParamGenerator<T8>& g8,
- const typename ParamGenerator<T8>::iterator& current8,
- const ParamGenerator<T9>& g9,
- const typename ParamGenerator<T9>::iterator& current9)
- : base_(base),
- begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
- begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
- begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
- begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
- begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
- begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
- begin7_(g7.begin()), end7_(g7.end()), current7_(current7),
- begin8_(g8.begin()), end8_(g8.end()), current8_(current8),
- begin9_(g9.begin()), end9_(g9.end()), current9_(current9) {
- ComputeCurrentValue();
- }
- virtual ~Iterator() {}
-
- virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
- return base_;
- }
- // Advance should not be called on beyond-of-range iterators
- // so no component iterators must be beyond end of range, either.
- virtual void Advance() {
- assert(!AtEnd());
- ++current9_;
- if (current9_ == end9_) {
- current9_ = begin9_;
- ++current8_;
- }
- if (current8_ == end8_) {
- current8_ = begin8_;
- ++current7_;
- }
- if (current7_ == end7_) {
- current7_ = begin7_;
- ++current6_;
- }
- if (current6_ == end6_) {
- current6_ = begin6_;
- ++current5_;
- }
- if (current5_ == end5_) {
- current5_ = begin5_;
- ++current4_;
- }
- if (current4_ == end4_) {
- current4_ = begin4_;
- ++current3_;
- }
- if (current3_ == end3_) {
- current3_ = begin3_;
- ++current2_;
- }
- if (current2_ == end2_) {
- current2_ = begin2_;
- ++current1_;
- }
- ComputeCurrentValue();
- }
- virtual ParamIteratorInterface<ParamType>* Clone() const {
- return new Iterator(*this);
- }
- virtual const ParamType* Current() const { return &current_value_; }
- virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
- // Having the same base generator guarantees that the other
- // iterator is of the same type and we can downcast.
- GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
- << "The program attempted to compare iterators "
- << "from different generators." << std::endl;
- const Iterator* typed_other =
- CheckedDowncastToActualType<const Iterator>(&other);
- // We must report iterators equal if they both point beyond their
- // respective ranges. That can happen in a variety of fashions,
- // so we have to consult AtEnd().
- return (AtEnd() && typed_other->AtEnd()) ||
- (
- current1_ == typed_other->current1_ &&
- current2_ == typed_other->current2_ &&
- current3_ == typed_other->current3_ &&
- current4_ == typed_other->current4_ &&
- current5_ == typed_other->current5_ &&
- current6_ == typed_other->current6_ &&
- current7_ == typed_other->current7_ &&
- current8_ == typed_other->current8_ &&
- current9_ == typed_other->current9_);
- }
-
- private:
- Iterator(const Iterator& other)
- : base_(other.base_),
- begin1_(other.begin1_),
- end1_(other.end1_),
- current1_(other.current1_),
- begin2_(other.begin2_),
- end2_(other.end2_),
- current2_(other.current2_),
- begin3_(other.begin3_),
- end3_(other.end3_),
- current3_(other.current3_),
- begin4_(other.begin4_),
- end4_(other.end4_),
- current4_(other.current4_),
- begin5_(other.begin5_),
- end5_(other.end5_),
- current5_(other.current5_),
- begin6_(other.begin6_),
- end6_(other.end6_),
- current6_(other.current6_),
- begin7_(other.begin7_),
- end7_(other.end7_),
- current7_(other.current7_),
- begin8_(other.begin8_),
- end8_(other.end8_),
- current8_(other.current8_),
- begin9_(other.begin9_),
- end9_(other.end9_),
- current9_(other.current9_) {
- ComputeCurrentValue();
- }
-
- void ComputeCurrentValue() {
- if (!AtEnd())
- current_value_ = ParamType(*current1_, *current2_, *current3_,
- *current4_, *current5_, *current6_, *current7_, *current8_,
- *current9_);
- }
- bool AtEnd() const {
- // We must report iterator past the end of the range when either of the
- // component iterators has reached the end of its range.
- return
- current1_ == end1_ ||
- current2_ == end2_ ||
- current3_ == end3_ ||
- current4_ == end4_ ||
- current5_ == end5_ ||
- current6_ == end6_ ||
- current7_ == end7_ ||
- current8_ == end8_ ||
- current9_ == end9_;
- }
-
- // No implementation - assignment is unsupported.
- void operator=(const Iterator& other);
-
- const ParamGeneratorInterface<ParamType>* const base_;
- // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
- // current[i]_ is the actual traversing iterator.
- const typename ParamGenerator<T1>::iterator begin1_;
- const typename ParamGenerator<T1>::iterator end1_;
- typename ParamGenerator<T1>::iterator current1_;
- const typename ParamGenerator<T2>::iterator begin2_;
- const typename ParamGenerator<T2>::iterator end2_;
- typename ParamGenerator<T2>::iterator current2_;
- const typename ParamGenerator<T3>::iterator begin3_;
- const typename ParamGenerator<T3>::iterator end3_;
- typename ParamGenerator<T3>::iterator current3_;
- const typename ParamGenerator<T4>::iterator begin4_;
- const typename ParamGenerator<T4>::iterator end4_;
- typename ParamGenerator<T4>::iterator current4_;
- const typename ParamGenerator<T5>::iterator begin5_;
- const typename ParamGenerator<T5>::iterator end5_;
- typename ParamGenerator<T5>::iterator current5_;
- const typename ParamGenerator<T6>::iterator begin6_;
- const typename ParamGenerator<T6>::iterator end6_;
- typename ParamGenerator<T6>::iterator current6_;
- const typename ParamGenerator<T7>::iterator begin7_;
- const typename ParamGenerator<T7>::iterator end7_;
- typename ParamGenerator<T7>::iterator current7_;
- const typename ParamGenerator<T8>::iterator begin8_;
- const typename ParamGenerator<T8>::iterator end8_;
- typename ParamGenerator<T8>::iterator current8_;
- const typename ParamGenerator<T9>::iterator begin9_;
- const typename ParamGenerator<T9>::iterator end9_;
- typename ParamGenerator<T9>::iterator current9_;
- ParamType current_value_;
- }; // class CartesianProductGenerator9::Iterator
-
- // No implementation - assignment is unsupported.
- void operator=(const CartesianProductGenerator9& other);
-
- const ParamGenerator<T1> g1_;
- const ParamGenerator<T2> g2_;
- const ParamGenerator<T3> g3_;
- const ParamGenerator<T4> g4_;
- const ParamGenerator<T5> g5_;
- const ParamGenerator<T6> g6_;
- const ParamGenerator<T7> g7_;
- const ParamGenerator<T8> g8_;
- const ParamGenerator<T9> g9_;
-}; // class CartesianProductGenerator9
-
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10>
-class CartesianProductGenerator10
- : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
- T7, T8, T9, T10> > {
- public:
- typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> ParamType;
-
- CartesianProductGenerator10(const ParamGenerator<T1>& g1,
- const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
- const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
- const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,
- const ParamGenerator<T8>& g8, const ParamGenerator<T9>& g9,
- const ParamGenerator<T10>& g10)
- : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
- g9_(g9), g10_(g10) {}
- virtual ~CartesianProductGenerator10() {}
-
- virtual ParamIteratorInterface<ParamType>* Begin() const {
- return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
- g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
- g7_.begin(), g8_, g8_.begin(), g9_, g9_.begin(), g10_, g10_.begin());
- }
- virtual ParamIteratorInterface<ParamType>* End() const {
- return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
- g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
- g8_.end(), g9_, g9_.end(), g10_, g10_.end());
- }
-
- private:
- class Iterator : public ParamIteratorInterface<ParamType> {
- public:
- Iterator(const ParamGeneratorInterface<ParamType>* base,
- const ParamGenerator<T1>& g1,
- const typename ParamGenerator<T1>::iterator& current1,
- const ParamGenerator<T2>& g2,
- const typename ParamGenerator<T2>::iterator& current2,
- const ParamGenerator<T3>& g3,
- const typename ParamGenerator<T3>::iterator& current3,
- const ParamGenerator<T4>& g4,
- const typename ParamGenerator<T4>::iterator& current4,
- const ParamGenerator<T5>& g5,
- const typename ParamGenerator<T5>::iterator& current5,
- const ParamGenerator<T6>& g6,
- const typename ParamGenerator<T6>::iterator& current6,
- const ParamGenerator<T7>& g7,
- const typename ParamGenerator<T7>::iterator& current7,
- const ParamGenerator<T8>& g8,
- const typename ParamGenerator<T8>::iterator& current8,
- const ParamGenerator<T9>& g9,
- const typename ParamGenerator<T9>::iterator& current9,
- const ParamGenerator<T10>& g10,
- const typename ParamGenerator<T10>::iterator& current10)
- : base_(base),
- begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
- begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
- begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
- begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
- begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
- begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
- begin7_(g7.begin()), end7_(g7.end()), current7_(current7),
- begin8_(g8.begin()), end8_(g8.end()), current8_(current8),
- begin9_(g9.begin()), end9_(g9.end()), current9_(current9),
- begin10_(g10.begin()), end10_(g10.end()), current10_(current10) {
- ComputeCurrentValue();
- }
- virtual ~Iterator() {}
-
- virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
- return base_;
- }
- // Advance should not be called on beyond-of-range iterators
- // so no component iterators must be beyond end of range, either.
- virtual void Advance() {
- assert(!AtEnd());
- ++current10_;
- if (current10_ == end10_) {
- current10_ = begin10_;
- ++current9_;
- }
- if (current9_ == end9_) {
- current9_ = begin9_;
- ++current8_;
- }
- if (current8_ == end8_) {
- current8_ = begin8_;
- ++current7_;
- }
- if (current7_ == end7_) {
- current7_ = begin7_;
- ++current6_;
- }
- if (current6_ == end6_) {
- current6_ = begin6_;
- ++current5_;
- }
- if (current5_ == end5_) {
- current5_ = begin5_;
- ++current4_;
- }
- if (current4_ == end4_) {
- current4_ = begin4_;
- ++current3_;
- }
- if (current3_ == end3_) {
- current3_ = begin3_;
- ++current2_;
- }
- if (current2_ == end2_) {
- current2_ = begin2_;
- ++current1_;
- }
- ComputeCurrentValue();
- }
- virtual ParamIteratorInterface<ParamType>* Clone() const {
- return new Iterator(*this);
- }
- virtual const ParamType* Current() const { return &current_value_; }
- virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
- // Having the same base generator guarantees that the other
- // iterator is of the same type and we can downcast.
- GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
- << "The program attempted to compare iterators "
- << "from different generators." << std::endl;
- const Iterator* typed_other =
- CheckedDowncastToActualType<const Iterator>(&other);
- // We must report iterators equal if they both point beyond their
- // respective ranges. That can happen in a variety of fashions,
- // so we have to consult AtEnd().
- return (AtEnd() && typed_other->AtEnd()) ||
- (
- current1_ == typed_other->current1_ &&
- current2_ == typed_other->current2_ &&
- current3_ == typed_other->current3_ &&
- current4_ == typed_other->current4_ &&
- current5_ == typed_other->current5_ &&
- current6_ == typed_other->current6_ &&
- current7_ == typed_other->current7_ &&
- current8_ == typed_other->current8_ &&
- current9_ == typed_other->current9_ &&
- current10_ == typed_other->current10_);
- }
-
- private:
- Iterator(const Iterator& other)
- : base_(other.base_),
- begin1_(other.begin1_),
- end1_(other.end1_),
- current1_(other.current1_),
- begin2_(other.begin2_),
- end2_(other.end2_),
- current2_(other.current2_),
- begin3_(other.begin3_),
- end3_(other.end3_),
- current3_(other.current3_),
- begin4_(other.begin4_),
- end4_(other.end4_),
- current4_(other.current4_),
- begin5_(other.begin5_),
- end5_(other.end5_),
- current5_(other.current5_),
- begin6_(other.begin6_),
- end6_(other.end6_),
- current6_(other.current6_),
- begin7_(other.begin7_),
- end7_(other.end7_),
- current7_(other.current7_),
- begin8_(other.begin8_),
- end8_(other.end8_),
- current8_(other.current8_),
- begin9_(other.begin9_),
- end9_(other.end9_),
- current9_(other.current9_),
- begin10_(other.begin10_),
- end10_(other.end10_),
- current10_(other.current10_) {
- ComputeCurrentValue();
- }
-
- void ComputeCurrentValue() {
- if (!AtEnd())
- current_value_ = ParamType(*current1_, *current2_, *current3_,
- *current4_, *current5_, *current6_, *current7_, *current8_,
- *current9_, *current10_);
- }
- bool AtEnd() const {
- // We must report iterator past the end of the range when either of the
- // component iterators has reached the end of its range.
- return
- current1_ == end1_ ||
- current2_ == end2_ ||
- current3_ == end3_ ||
- current4_ == end4_ ||
- current5_ == end5_ ||
- current6_ == end6_ ||
- current7_ == end7_ ||
- current8_ == end8_ ||
- current9_ == end9_ ||
- current10_ == end10_;
- }
-
- // No implementation - assignment is unsupported.
- void operator=(const Iterator& other);
-
- const ParamGeneratorInterface<ParamType>* const base_;
- // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
- // current[i]_ is the actual traversing iterator.
- const typename ParamGenerator<T1>::iterator begin1_;
- const typename ParamGenerator<T1>::iterator end1_;
- typename ParamGenerator<T1>::iterator current1_;
- const typename ParamGenerator<T2>::iterator begin2_;
- const typename ParamGenerator<T2>::iterator end2_;
- typename ParamGenerator<T2>::iterator current2_;
- const typename ParamGenerator<T3>::iterator begin3_;
- const typename ParamGenerator<T3>::iterator end3_;
- typename ParamGenerator<T3>::iterator current3_;
- const typename ParamGenerator<T4>::iterator begin4_;
- const typename ParamGenerator<T4>::iterator end4_;
- typename ParamGenerator<T4>::iterator current4_;
- const typename ParamGenerator<T5>::iterator begin5_;
- const typename ParamGenerator<T5>::iterator end5_;
- typename ParamGenerator<T5>::iterator current5_;
- const typename ParamGenerator<T6>::iterator begin6_;
- const typename ParamGenerator<T6>::iterator end6_;
- typename ParamGenerator<T6>::iterator current6_;
- const typename ParamGenerator<T7>::iterator begin7_;
- const typename ParamGenerator<T7>::iterator end7_;
- typename ParamGenerator<T7>::iterator current7_;
- const typename ParamGenerator<T8>::iterator begin8_;
- const typename ParamGenerator<T8>::iterator end8_;
- typename ParamGenerator<T8>::iterator current8_;
- const typename ParamGenerator<T9>::iterator begin9_;
- const typename ParamGenerator<T9>::iterator end9_;
- typename ParamGenerator<T9>::iterator current9_;
- const typename ParamGenerator<T10>::iterator begin10_;
- const typename ParamGenerator<T10>::iterator end10_;
- typename ParamGenerator<T10>::iterator current10_;
- ParamType current_value_;
- }; // class CartesianProductGenerator10::Iterator
-
- // No implementation - assignment is unsupported.
- void operator=(const CartesianProductGenerator10& other);
-
- const ParamGenerator<T1> g1_;
- const ParamGenerator<T2> g2_;
- const ParamGenerator<T3> g3_;
- const ParamGenerator<T4> g4_;
- const ParamGenerator<T5> g5_;
- const ParamGenerator<T6> g6_;
- const ParamGenerator<T7> g7_;
- const ParamGenerator<T8> g8_;
- const ParamGenerator<T9> g9_;
- const ParamGenerator<T10> g10_;
-}; // class CartesianProductGenerator10
-
-
-// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
-//
-// Helper classes providing Combine() with polymorphic features. They allow
-// casting CartesianProductGeneratorN<T> to ParamGenerator<U> if T is
-// convertible to U.
-//
-template <class Generator1, class Generator2>
-class CartesianProductHolder2 {
- public:
-CartesianProductHolder2(const Generator1& g1, const Generator2& g2)
- : g1_(g1), g2_(g2) {}
- template <typename T1, typename T2>
- operator ParamGenerator< ::std::tr1::tuple<T1, T2> >() const {
- return ParamGenerator< ::std::tr1::tuple<T1, T2> >(
- new CartesianProductGenerator2<T1, T2>(
- static_cast<ParamGenerator<T1> >(g1_),
- static_cast<ParamGenerator<T2> >(g2_)));
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const CartesianProductHolder2& other);
-
- const Generator1 g1_;
- const Generator2 g2_;
-}; // class CartesianProductHolder2
-
-template <class Generator1, class Generator2, class Generator3>
-class CartesianProductHolder3 {
- public:
-CartesianProductHolder3(const Generator1& g1, const Generator2& g2,
- const Generator3& g3)
- : g1_(g1), g2_(g2), g3_(g3) {}
- template <typename T1, typename T2, typename T3>
- operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3> >() const {
- return ParamGenerator< ::std::tr1::tuple<T1, T2, T3> >(
- new CartesianProductGenerator3<T1, T2, T3>(
- static_cast<ParamGenerator<T1> >(g1_),
- static_cast<ParamGenerator<T2> >(g2_),
- static_cast<ParamGenerator<T3> >(g3_)));
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const CartesianProductHolder3& other);
-
- const Generator1 g1_;
- const Generator2 g2_;
- const Generator3 g3_;
-}; // class CartesianProductHolder3
-
-template <class Generator1, class Generator2, class Generator3,
- class Generator4>
-class CartesianProductHolder4 {
- public:
-CartesianProductHolder4(const Generator1& g1, const Generator2& g2,
- const Generator3& g3, const Generator4& g4)
- : g1_(g1), g2_(g2), g3_(g3), g4_(g4) {}
- template <typename T1, typename T2, typename T3, typename T4>
- operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4> >() const {
- return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4> >(
- new CartesianProductGenerator4<T1, T2, T3, T4>(
- static_cast<ParamGenerator<T1> >(g1_),
- static_cast<ParamGenerator<T2> >(g2_),
- static_cast<ParamGenerator<T3> >(g3_),
- static_cast<ParamGenerator<T4> >(g4_)));
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const CartesianProductHolder4& other);
-
- const Generator1 g1_;
- const Generator2 g2_;
- const Generator3 g3_;
- const Generator4 g4_;
-}; // class CartesianProductHolder4
-
-template <class Generator1, class Generator2, class Generator3,
- class Generator4, class Generator5>
-class CartesianProductHolder5 {
- public:
-CartesianProductHolder5(const Generator1& g1, const Generator2& g2,
- const Generator3& g3, const Generator4& g4, const Generator5& g5)
- : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {}
- template <typename T1, typename T2, typename T3, typename T4, typename T5>
- operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5> >() const {
- return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5> >(
- new CartesianProductGenerator5<T1, T2, T3, T4, T5>(
- static_cast<ParamGenerator<T1> >(g1_),
- static_cast<ParamGenerator<T2> >(g2_),
- static_cast<ParamGenerator<T3> >(g3_),
- static_cast<ParamGenerator<T4> >(g4_),
- static_cast<ParamGenerator<T5> >(g5_)));
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const CartesianProductHolder5& other);
-
- const Generator1 g1_;
- const Generator2 g2_;
- const Generator3 g3_;
- const Generator4 g4_;
- const Generator5 g5_;
-}; // class CartesianProductHolder5
-
-template <class Generator1, class Generator2, class Generator3,
- class Generator4, class Generator5, class Generator6>
-class CartesianProductHolder6 {
- public:
-CartesianProductHolder6(const Generator1& g1, const Generator2& g2,
- const Generator3& g3, const Generator4& g4, const Generator5& g5,
- const Generator6& g6)
- : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {}
- template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6>
- operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> >() const {
- return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> >(
- new CartesianProductGenerator6<T1, T2, T3, T4, T5, T6>(
- static_cast<ParamGenerator<T1> >(g1_),
- static_cast<ParamGenerator<T2> >(g2_),
- static_cast<ParamGenerator<T3> >(g3_),
- static_cast<ParamGenerator<T4> >(g4_),
- static_cast<ParamGenerator<T5> >(g5_),
- static_cast<ParamGenerator<T6> >(g6_)));
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const CartesianProductHolder6& other);
-
- const Generator1 g1_;
- const Generator2 g2_;
- const Generator3 g3_;
- const Generator4 g4_;
- const Generator5 g5_;
- const Generator6 g6_;
-}; // class CartesianProductHolder6
-
-template <class Generator1, class Generator2, class Generator3,
- class Generator4, class Generator5, class Generator6, class Generator7>
-class CartesianProductHolder7 {
- public:
-CartesianProductHolder7(const Generator1& g1, const Generator2& g2,
- const Generator3& g3, const Generator4& g4, const Generator5& g5,
- const Generator6& g6, const Generator7& g7)
- : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {}
- template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7>
- operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
- T7> >() const {
- return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7> >(
- new CartesianProductGenerator7<T1, T2, T3, T4, T5, T6, T7>(
- static_cast<ParamGenerator<T1> >(g1_),
- static_cast<ParamGenerator<T2> >(g2_),
- static_cast<ParamGenerator<T3> >(g3_),
- static_cast<ParamGenerator<T4> >(g4_),
- static_cast<ParamGenerator<T5> >(g5_),
- static_cast<ParamGenerator<T6> >(g6_),
- static_cast<ParamGenerator<T7> >(g7_)));
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const CartesianProductHolder7& other);
-
- const Generator1 g1_;
- const Generator2 g2_;
- const Generator3 g3_;
- const Generator4 g4_;
- const Generator5 g5_;
- const Generator6 g6_;
- const Generator7 g7_;
-}; // class CartesianProductHolder7
-
-template <class Generator1, class Generator2, class Generator3,
- class Generator4, class Generator5, class Generator6, class Generator7,
- class Generator8>
-class CartesianProductHolder8 {
- public:
-CartesianProductHolder8(const Generator1& g1, const Generator2& g2,
- const Generator3& g3, const Generator4& g4, const Generator5& g5,
- const Generator6& g6, const Generator7& g7, const Generator8& g8)
- : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7),
- g8_(g8) {}
- template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8>
- operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7,
- T8> >() const {
- return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8> >(
- new CartesianProductGenerator8<T1, T2, T3, T4, T5, T6, T7, T8>(
- static_cast<ParamGenerator<T1> >(g1_),
- static_cast<ParamGenerator<T2> >(g2_),
- static_cast<ParamGenerator<T3> >(g3_),
- static_cast<ParamGenerator<T4> >(g4_),
- static_cast<ParamGenerator<T5> >(g5_),
- static_cast<ParamGenerator<T6> >(g6_),
- static_cast<ParamGenerator<T7> >(g7_),
- static_cast<ParamGenerator<T8> >(g8_)));
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const CartesianProductHolder8& other);
-
- const Generator1 g1_;
- const Generator2 g2_;
- const Generator3 g3_;
- const Generator4 g4_;
- const Generator5 g5_;
- const Generator6 g6_;
- const Generator7 g7_;
- const Generator8 g8_;
-}; // class CartesianProductHolder8
-
-template <class Generator1, class Generator2, class Generator3,
- class Generator4, class Generator5, class Generator6, class Generator7,
- class Generator8, class Generator9>
-class CartesianProductHolder9 {
- public:
-CartesianProductHolder9(const Generator1& g1, const Generator2& g2,
- const Generator3& g3, const Generator4& g4, const Generator5& g5,
- const Generator6& g6, const Generator7& g7, const Generator8& g8,
- const Generator9& g9)
- : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
- g9_(g9) {}
- template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9>
- operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
- T9> >() const {
- return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
- T9> >(
- new CartesianProductGenerator9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(
- static_cast<ParamGenerator<T1> >(g1_),
- static_cast<ParamGenerator<T2> >(g2_),
- static_cast<ParamGenerator<T3> >(g3_),
- static_cast<ParamGenerator<T4> >(g4_),
- static_cast<ParamGenerator<T5> >(g5_),
- static_cast<ParamGenerator<T6> >(g6_),
- static_cast<ParamGenerator<T7> >(g7_),
- static_cast<ParamGenerator<T8> >(g8_),
- static_cast<ParamGenerator<T9> >(g9_)));
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const CartesianProductHolder9& other);
-
- const Generator1 g1_;
- const Generator2 g2_;
- const Generator3 g3_;
- const Generator4 g4_;
- const Generator5 g5_;
- const Generator6 g6_;
- const Generator7 g7_;
- const Generator8 g8_;
- const Generator9 g9_;
-}; // class CartesianProductHolder9
-
-template <class Generator1, class Generator2, class Generator3,
- class Generator4, class Generator5, class Generator6, class Generator7,
- class Generator8, class Generator9, class Generator10>
-class CartesianProductHolder10 {
- public:
-CartesianProductHolder10(const Generator1& g1, const Generator2& g2,
- const Generator3& g3, const Generator4& g4, const Generator5& g5,
- const Generator6& g6, const Generator7& g7, const Generator8& g8,
- const Generator9& g9, const Generator10& g10)
- : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
- g9_(g9), g10_(g10) {}
- template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10>
- operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
- T9, T10> >() const {
- return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
- T9, T10> >(
- new CartesianProductGenerator10<T1, T2, T3, T4, T5, T6, T7, T8, T9,
- T10>(
- static_cast<ParamGenerator<T1> >(g1_),
- static_cast<ParamGenerator<T2> >(g2_),
- static_cast<ParamGenerator<T3> >(g3_),
- static_cast<ParamGenerator<T4> >(g4_),
- static_cast<ParamGenerator<T5> >(g5_),
- static_cast<ParamGenerator<T6> >(g6_),
- static_cast<ParamGenerator<T7> >(g7_),
- static_cast<ParamGenerator<T8> >(g8_),
- static_cast<ParamGenerator<T9> >(g9_),
- static_cast<ParamGenerator<T10> >(g10_)));
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const CartesianProductHolder10& other);
-
- const Generator1 g1_;
- const Generator2 g2_;
- const Generator3 g3_;
- const Generator4 g4_;
- const Generator5 g5_;
- const Generator6 g6_;
- const Generator7 g7_;
- const Generator8 g8_;
- const Generator9 g9_;
- const Generator10 g10_;
-}; // class CartesianProductHolder10
-
-# endif // GTEST_HAS_COMBINE
-
-} // namespace internal
-} // namespace testing
-
-#endif // GTEST_HAS_PARAM_TEST
-
-#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
diff --git a/src/testing/gtest/include/gtest/internal/gtest-param-util-generated.h.pump b/src/testing/gtest/include/gtest/internal/gtest-param-util-generated.h.pump
deleted file mode 100644
index 009206fd..00000000
--- a/src/testing/gtest/include/gtest/internal/gtest-param-util-generated.h.pump
+++ /dev/null
@@ -1,301 +0,0 @@
-$$ -*- mode: c++; -*-
-$var n = 50 $$ Maximum length of Values arguments we want to support.
-$var maxtuple = 10 $$ Maximum number of Combine arguments we want to support.
-// Copyright 2008 Google Inc.
-// All Rights Reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: vladl@google.com (Vlad Losev)
-
-// Type and function utilities for implementing parameterized tests.
-// This file is generated by a SCRIPT. DO NOT EDIT BY HAND!
-//
-// Currently Google Test supports at most $n arguments in Values,
-// and at most $maxtuple arguments in Combine. Please contact
-// googletestframework@googlegroups.com if you need more.
-// Please note that the number of arguments to Combine is limited
-// by the maximum arity of the implementation of tr1::tuple which is
-// currently set at $maxtuple.
-
-#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
-#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
-
-// scripts/fuse_gtest.py depends on gtest's own header being #included
-// *unconditionally*. Therefore these #includes cannot be moved
-// inside #if GTEST_HAS_PARAM_TEST.
-#include "gtest/internal/gtest-param-util.h"
-#include "gtest/internal/gtest-port.h"
-
-#if GTEST_HAS_PARAM_TEST
-
-namespace testing {
-
-// Forward declarations of ValuesIn(), which is implemented in
-// include/gtest/gtest-param-test.h.
-template <typename ForwardIterator>
-internal::ParamGenerator<
- typename ::testing::internal::IteratorTraits<ForwardIterator>::value_type>
-ValuesIn(ForwardIterator begin, ForwardIterator end);
-
-template <typename T, size_t N>
-internal::ParamGenerator<T> ValuesIn(const T (&array)[N]);
-
-template <class Container>
-internal::ParamGenerator<typename Container::value_type> ValuesIn(
- const Container& container);
-
-namespace internal {
-
-// Used in the Values() function to provide polymorphic capabilities.
-template <typename T1>
-class ValueArray1 {
- public:
- explicit ValueArray1(T1 v1) : v1_(v1) {}
-
- template <typename T>
- operator ParamGenerator<T>() const { return ValuesIn(&v1_, &v1_ + 1); }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray1& other);
-
- const T1 v1_;
-};
-
-$range i 2..n
-$for i [[
-$range j 1..i
-
-template <$for j, [[typename T$j]]>
-class ValueArray$i {
- public:
- ValueArray$i($for j, [[T$j v$j]]) : $for j, [[v$(j)_(v$j)]] {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {$for j, [[static_cast<T>(v$(j)_)]]};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray$i& other);
-
-$for j [[
-
- const T$j v$(j)_;
-]]
-
-};
-
-]]
-
-# if GTEST_HAS_COMBINE
-// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
-//
-// Generates values from the Cartesian product of values produced
-// by the argument generators.
-//
-$range i 2..maxtuple
-$for i [[
-$range j 1..i
-$range k 2..i
-
-template <$for j, [[typename T$j]]>
-class CartesianProductGenerator$i
- : public ParamGeneratorInterface< ::std::tr1::tuple<$for j, [[T$j]]> > {
- public:
- typedef ::std::tr1::tuple<$for j, [[T$j]]> ParamType;
-
- CartesianProductGenerator$i($for j, [[const ParamGenerator<T$j>& g$j]])
- : $for j, [[g$(j)_(g$j)]] {}
- virtual ~CartesianProductGenerator$i() {}
-
- virtual ParamIteratorInterface<ParamType>* Begin() const {
- return new Iterator(this, $for j, [[g$(j)_, g$(j)_.begin()]]);
- }
- virtual ParamIteratorInterface<ParamType>* End() const {
- return new Iterator(this, $for j, [[g$(j)_, g$(j)_.end()]]);
- }
-
- private:
- class Iterator : public ParamIteratorInterface<ParamType> {
- public:
- Iterator(const ParamGeneratorInterface<ParamType>* base, $for j, [[
-
- const ParamGenerator<T$j>& g$j,
- const typename ParamGenerator<T$j>::iterator& current$(j)]])
- : base_(base),
-$for j, [[
-
- begin$(j)_(g$j.begin()), end$(j)_(g$j.end()), current$(j)_(current$j)
-]] {
- ComputeCurrentValue();
- }
- virtual ~Iterator() {}
-
- virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
- return base_;
- }
- // Advance should not be called on beyond-of-range iterators
- // so no component iterators must be beyond end of range, either.
- virtual void Advance() {
- assert(!AtEnd());
- ++current$(i)_;
-
-$for k [[
- if (current$(i+2-k)_ == end$(i+2-k)_) {
- current$(i+2-k)_ = begin$(i+2-k)_;
- ++current$(i+2-k-1)_;
- }
-
-]]
- ComputeCurrentValue();
- }
- virtual ParamIteratorInterface<ParamType>* Clone() const {
- return new Iterator(*this);
- }
- virtual const ParamType* Current() const { return &current_value_; }
- virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
- // Having the same base generator guarantees that the other
- // iterator is of the same type and we can downcast.
- GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
- << "The program attempted to compare iterators "
- << "from different generators." << std::endl;
- const Iterator* typed_other =
- CheckedDowncastToActualType<const Iterator>(&other);
- // We must report iterators equal if they both point beyond their
- // respective ranges. That can happen in a variety of fashions,
- // so we have to consult AtEnd().
- return (AtEnd() && typed_other->AtEnd()) ||
- ($for j && [[
-
- current$(j)_ == typed_other->current$(j)_
-]]);
- }
-
- private:
- Iterator(const Iterator& other)
- : base_(other.base_), $for j, [[
-
- begin$(j)_(other.begin$(j)_),
- end$(j)_(other.end$(j)_),
- current$(j)_(other.current$(j)_)
-]] {
- ComputeCurrentValue();
- }
-
- void ComputeCurrentValue() {
- if (!AtEnd())
- current_value_ = ParamType($for j, [[*current$(j)_]]);
- }
- bool AtEnd() const {
- // We must report iterator past the end of the range when either of the
- // component iterators has reached the end of its range.
- return
-$for j || [[
-
- current$(j)_ == end$(j)_
-]];
- }
-
- // No implementation - assignment is unsupported.
- void operator=(const Iterator& other);
-
- const ParamGeneratorInterface<ParamType>* const base_;
- // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
- // current[i]_ is the actual traversing iterator.
-$for j [[
-
- const typename ParamGenerator<T$j>::iterator begin$(j)_;
- const typename ParamGenerator<T$j>::iterator end$(j)_;
- typename ParamGenerator<T$j>::iterator current$(j)_;
-]]
-
- ParamType current_value_;
- }; // class CartesianProductGenerator$i::Iterator
-
- // No implementation - assignment is unsupported.
- void operator=(const CartesianProductGenerator$i& other);
-
-
-$for j [[
- const ParamGenerator<T$j> g$(j)_;
-
-]]
-}; // class CartesianProductGenerator$i
-
-
-]]
-
-// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
-//
-// Helper classes providing Combine() with polymorphic features. They allow
-// casting CartesianProductGeneratorN<T> to ParamGenerator<U> if T is
-// convertible to U.
-//
-$range i 2..maxtuple
-$for i [[
-$range j 1..i
-
-template <$for j, [[class Generator$j]]>
-class CartesianProductHolder$i {
- public:
-CartesianProductHolder$i($for j, [[const Generator$j& g$j]])
- : $for j, [[g$(j)_(g$j)]] {}
- template <$for j, [[typename T$j]]>
- operator ParamGenerator< ::std::tr1::tuple<$for j, [[T$j]]> >() const {
- return ParamGenerator< ::std::tr1::tuple<$for j, [[T$j]]> >(
- new CartesianProductGenerator$i<$for j, [[T$j]]>(
-$for j,[[
-
- static_cast<ParamGenerator<T$j> >(g$(j)_)
-]]));
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const CartesianProductHolder$i& other);
-
-
-$for j [[
- const Generator$j g$(j)_;
-
-]]
-}; // class CartesianProductHolder$i
-
-]]
-
-# endif // GTEST_HAS_COMBINE
-
-} // namespace internal
-} // namespace testing
-
-#endif // GTEST_HAS_PARAM_TEST
-
-#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
diff --git a/src/testing/gtest/include/gtest/internal/gtest-param-util.h b/src/testing/gtest/include/gtest/internal/gtest-param-util.h
deleted file mode 100644
index 0ef9718c..00000000
--- a/src/testing/gtest/include/gtest/internal/gtest-param-util.h
+++ /dev/null
@@ -1,619 +0,0 @@
-// Copyright 2008 Google Inc.
-// All Rights Reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: vladl@google.com (Vlad Losev)
-
-// Type and function utilities for implementing parameterized tests.
-
-#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
-#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
-
-#include <iterator>
-#include <utility>
-#include <vector>
-
-// scripts/fuse_gtest.py depends on gtest's own header being #included
-// *unconditionally*. Therefore these #includes cannot be moved
-// inside #if GTEST_HAS_PARAM_TEST.
-#include "gtest/internal/gtest-internal.h"
-#include "gtest/internal/gtest-linked_ptr.h"
-#include "gtest/internal/gtest-port.h"
-#include "gtest/gtest-printers.h"
-
-#if GTEST_HAS_PARAM_TEST
-
-namespace testing {
-namespace internal {
-
-// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
-//
-// Outputs a message explaining invalid registration of different
-// fixture class for the same test case. This may happen when
-// TEST_P macro is used to define two tests with the same name
-// but in different namespaces.
-GTEST_API_ void ReportInvalidTestCaseType(const char* test_case_name,
- const char* file, int line);
-
-template <typename> class ParamGeneratorInterface;
-template <typename> class ParamGenerator;
-
-// Interface for iterating over elements provided by an implementation
-// of ParamGeneratorInterface<T>.
-template <typename T>
-class ParamIteratorInterface {
- public:
- virtual ~ParamIteratorInterface() {}
- // A pointer to the base generator instance.
- // Used only for the purposes of iterator comparison
- // to make sure that two iterators belong to the same generator.
- virtual const ParamGeneratorInterface<T>* BaseGenerator() const = 0;
- // Advances iterator to point to the next element
- // provided by the generator. The caller is responsible
- // for not calling Advance() on an iterator equal to
- // BaseGenerator()->End().
- virtual void Advance() = 0;
- // Clones the iterator object. Used for implementing copy semantics
- // of ParamIterator<T>.
- virtual ParamIteratorInterface* Clone() const = 0;
- // Dereferences the current iterator and provides (read-only) access
- // to the pointed value. It is the caller's responsibility not to call
- // Current() on an iterator equal to BaseGenerator()->End().
- // Used for implementing ParamGenerator<T>::operator*().
- virtual const T* Current() const = 0;
- // Determines whether the given iterator and other point to the same
- // element in the sequence generated by the generator.
- // Used for implementing ParamGenerator<T>::operator==().
- virtual bool Equals(const ParamIteratorInterface& other) const = 0;
-};
-
-// Class iterating over elements provided by an implementation of
-// ParamGeneratorInterface<T>. It wraps ParamIteratorInterface<T>
-// and implements the const forward iterator concept.
-template <typename T>
-class ParamIterator {
- public:
- typedef T value_type;
- typedef const T& reference;
- typedef ptrdiff_t difference_type;
-
- // ParamIterator assumes ownership of the impl_ pointer.
- ParamIterator(const ParamIterator& other) : impl_(other.impl_->Clone()) {}
- ParamIterator& operator=(const ParamIterator& other) {
- if (this != &other)
- impl_.reset(other.impl_->Clone());
- return *this;
- }
-
- const T& operator*() const { return *impl_->Current(); }
- const T* operator->() const { return impl_->Current(); }
- // Prefix version of operator++.
- ParamIterator& operator++() {
- impl_->Advance();
- return *this;
- }
- // Postfix version of operator++.
- ParamIterator operator++(int /*unused*/) {
- ParamIteratorInterface<T>* clone = impl_->Clone();
- impl_->Advance();
- return ParamIterator(clone);
- }
- bool operator==(const ParamIterator& other) const {
- return impl_.get() == other.impl_.get() || impl_->Equals(*other.impl_);
- }
- bool operator!=(const ParamIterator& other) const {
- return !(*this == other);
- }
-
- private:
- friend class ParamGenerator<T>;
- explicit ParamIterator(ParamIteratorInterface<T>* impl) : impl_(impl) {}
- scoped_ptr<ParamIteratorInterface<T> > impl_;
-};
-
-// ParamGeneratorInterface<T> is the binary interface to access generators
-// defined in other translation units.
-template <typename T>
-class ParamGeneratorInterface {
- public:
- typedef T ParamType;
-
- virtual ~ParamGeneratorInterface() {}
-
- // Generator interface definition
- virtual ParamIteratorInterface<T>* Begin() const = 0;
- virtual ParamIteratorInterface<T>* End() const = 0;
-};
-
-// Wraps ParamGeneratorInterface<T> and provides general generator syntax
-// compatible with the STL Container concept.
-// This class implements copy initialization semantics and the contained
-// ParamGeneratorInterface<T> instance is shared among all copies
-// of the original object. This is possible because that instance is immutable.
-template<typename T>
-class ParamGenerator {
- public:
- typedef ParamIterator<T> iterator;
-
- explicit ParamGenerator(ParamGeneratorInterface<T>* impl) : impl_(impl) {}
- ParamGenerator(const ParamGenerator& other) : impl_(other.impl_) {}
-
- ParamGenerator& operator=(const ParamGenerator& other) {
- impl_ = other.impl_;
- return *this;
- }
-
- iterator begin() const { return iterator(impl_->Begin()); }
- iterator end() const { return iterator(impl_->End()); }
-
- private:
- linked_ptr<const ParamGeneratorInterface<T> > impl_;
-};
-
-// Generates values from a range of two comparable values. Can be used to
-// generate sequences of user-defined types that implement operator+() and
-// operator<().
-// This class is used in the Range() function.
-template <typename T, typename IncrementT>
-class RangeGenerator : public ParamGeneratorInterface<T> {
- public:
- RangeGenerator(T begin, T end, IncrementT step)
- : begin_(begin), end_(end),
- step_(step), end_index_(CalculateEndIndex(begin, end, step)) {}
- virtual ~RangeGenerator() {}
-
- virtual ParamIteratorInterface<T>* Begin() const {
- return new Iterator(this, begin_, 0, step_);
- }
- virtual ParamIteratorInterface<T>* End() const {
- return new Iterator(this, end_, end_index_, step_);
- }
-
- private:
- class Iterator : public ParamIteratorInterface<T> {
- public:
- Iterator(const ParamGeneratorInterface<T>* base, T value, int index,
- IncrementT step)
- : base_(base), value_(value), index_(index), step_(step) {}
- virtual ~Iterator() {}
-
- virtual const ParamGeneratorInterface<T>* BaseGenerator() const {
- return base_;
- }
- virtual void Advance() {
- value_ = value_ + step_;
- index_++;
- }
- virtual ParamIteratorInterface<T>* Clone() const {
- return new Iterator(*this);
- }
- virtual const T* Current() const { return &value_; }
- virtual bool Equals(const ParamIteratorInterface<T>& other) const {
- // Having the same base generator guarantees that the other
- // iterator is of the same type and we can downcast.
- GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
- << "The program attempted to compare iterators "
- << "from different generators." << std::endl;
- const int other_index =
- CheckedDowncastToActualType<const Iterator>(&other)->index_;
- return index_ == other_index;
- }
-
- private:
- Iterator(const Iterator& other)
- : ParamIteratorInterface<T>(),
- base_(other.base_), value_(other.value_), index_(other.index_),
- step_(other.step_) {}
-
- // No implementation - assignment is unsupported.
- void operator=(const Iterator& other);
-
- const ParamGeneratorInterface<T>* const base_;
- T value_;
- int index_;
- const IncrementT step_;
- }; // class RangeGenerator::Iterator
-
- static int CalculateEndIndex(const T& begin,
- const T& end,
- const IncrementT& step) {
- int end_index = 0;
- for (T i = begin; i < end; i = i + step)
- end_index++;
- return end_index;
- }
-
- // No implementation - assignment is unsupported.
- void operator=(const RangeGenerator& other);
-
- const T begin_;
- const T end_;
- const IncrementT step_;
- // The index for the end() iterator. All the elements in the generated
- // sequence are indexed (0-based) to aid iterator comparison.
- const int end_index_;
-}; // class RangeGenerator
-
-
-// Generates values from a pair of STL-style iterators. Used in the
-// ValuesIn() function. The elements are copied from the source range
-// since the source can be located on the stack, and the generator
-// is likely to persist beyond that stack frame.
-template <typename T>
-class ValuesInIteratorRangeGenerator : public ParamGeneratorInterface<T> {
- public:
- template <typename ForwardIterator>
- ValuesInIteratorRangeGenerator(ForwardIterator begin, ForwardIterator end)
- : container_(begin, end) {}
- virtual ~ValuesInIteratorRangeGenerator() {}
-
- virtual ParamIteratorInterface<T>* Begin() const {
- return new Iterator(this, container_.begin());
- }
- virtual ParamIteratorInterface<T>* End() const {
- return new Iterator(this, container_.end());
- }
-
- private:
- typedef typename ::std::vector<T> ContainerType;
-
- class Iterator : public ParamIteratorInterface<T> {
- public:
- Iterator(const ParamGeneratorInterface<T>* base,
- typename ContainerType::const_iterator iterator)
- : base_(base), iterator_(iterator) {}
- virtual ~Iterator() {}
-
- virtual const ParamGeneratorInterface<T>* BaseGenerator() const {
- return base_;
- }
- virtual void Advance() {
- ++iterator_;
- value_.reset();
- }
- virtual ParamIteratorInterface<T>* Clone() const {
- return new Iterator(*this);
- }
- // We need to use cached value referenced by iterator_ because *iterator_
- // can return a temporary object (and of type other then T), so just
- // having "return &*iterator_;" doesn't work.
- // value_ is updated here and not in Advance() because Advance()
- // can advance iterator_ beyond the end of the range, and we cannot
- // detect that fact. The client code, on the other hand, is
- // responsible for not calling Current() on an out-of-range iterator.
- virtual const T* Current() const {
- if (value_.get() == NULL)
- value_.reset(new T(*iterator_));
- return value_.get();
- }
- virtual bool Equals(const ParamIteratorInterface<T>& other) const {
- // Having the same base generator guarantees that the other
- // iterator is of the same type and we can downcast.
- GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
- << "The program attempted to compare iterators "
- << "from different generators." << std::endl;
- return iterator_ ==
- CheckedDowncastToActualType<const Iterator>(&other)->iterator_;
- }
-
- private:
- Iterator(const Iterator& other)
- // The explicit constructor call suppresses a false warning
- // emitted by gcc when supplied with the -Wextra option.
- : ParamIteratorInterface<T>(),
- base_(other.base_),
- iterator_(other.iterator_) {}
-
- const ParamGeneratorInterface<T>* const base_;
- typename ContainerType::const_iterator iterator_;
- // A cached value of *iterator_. We keep it here to allow access by
- // pointer in the wrapping iterator's operator->().
- // value_ needs to be mutable to be accessed in Current().
- // Use of scoped_ptr helps manage cached value's lifetime,
- // which is bound by the lifespan of the iterator itself.
- mutable scoped_ptr<const T> value_;
- }; // class ValuesInIteratorRangeGenerator::Iterator
-
- // No implementation - assignment is unsupported.
- void operator=(const ValuesInIteratorRangeGenerator& other);
-
- const ContainerType container_;
-}; // class ValuesInIteratorRangeGenerator
-
-// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
-//
-// Stores a parameter value and later creates tests parameterized with that
-// value.
-template <class TestClass>
-class ParameterizedTestFactory : public TestFactoryBase {
- public:
- typedef typename TestClass::ParamType ParamType;
- explicit ParameterizedTestFactory(ParamType parameter) :
- parameter_(parameter) {}
- virtual Test* CreateTest() {
- TestClass::SetParam(&parameter_);
- return new TestClass();
- }
-
- private:
- const ParamType parameter_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestFactory);
-};
-
-// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
-//
-// TestMetaFactoryBase is a base class for meta-factories that create
-// test factories for passing into MakeAndRegisterTestInfo function.
-template <class ParamType>
-class TestMetaFactoryBase {
- public:
- virtual ~TestMetaFactoryBase() {}
-
- virtual TestFactoryBase* CreateTestFactory(ParamType parameter) = 0;
-};
-
-// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
-//
-// TestMetaFactory creates test factories for passing into
-// MakeAndRegisterTestInfo function. Since MakeAndRegisterTestInfo receives
-// ownership of test factory pointer, same factory object cannot be passed
-// into that method twice. But ParameterizedTestCaseInfo is going to call
-// it for each Test/Parameter value combination. Thus it needs meta factory
-// creator class.
-template <class TestCase>
-class TestMetaFactory
- : public TestMetaFactoryBase<typename TestCase::ParamType> {
- public:
- typedef typename TestCase::ParamType ParamType;
-
- TestMetaFactory() {}
-
- virtual TestFactoryBase* CreateTestFactory(ParamType parameter) {
- return new ParameterizedTestFactory<TestCase>(parameter);
- }
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(TestMetaFactory);
-};
-
-// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
-//
-// ParameterizedTestCaseInfoBase is a generic interface
-// to ParameterizedTestCaseInfo classes. ParameterizedTestCaseInfoBase
-// accumulates test information provided by TEST_P macro invocations
-// and generators provided by INSTANTIATE_TEST_CASE_P macro invocations
-// and uses that information to register all resulting test instances
-// in RegisterTests method. The ParameterizeTestCaseRegistry class holds
-// a collection of pointers to the ParameterizedTestCaseInfo objects
-// and calls RegisterTests() on each of them when asked.
-class ParameterizedTestCaseInfoBase {
- public:
- virtual ~ParameterizedTestCaseInfoBase() {}
-
- // Base part of test case name for display purposes.
- virtual const string& GetTestCaseName() const = 0;
- // Test case id to verify identity.
- virtual TypeId GetTestCaseTypeId() const = 0;
- // UnitTest class invokes this method to register tests in this
- // test case right before running them in RUN_ALL_TESTS macro.
- // This method should not be called more then once on any single
- // instance of a ParameterizedTestCaseInfoBase derived class.
- virtual void RegisterTests() = 0;
-
- protected:
- ParameterizedTestCaseInfoBase() {}
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseInfoBase);
-};
-
-// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
-//
-// ParameterizedTestCaseInfo accumulates tests obtained from TEST_P
-// macro invocations for a particular test case and generators
-// obtained from INSTANTIATE_TEST_CASE_P macro invocations for that
-// test case. It registers tests with all values generated by all
-// generators when asked.
-template <class TestCase>
-class ParameterizedTestCaseInfo : public ParameterizedTestCaseInfoBase {
- public:
- // ParamType and GeneratorCreationFunc are private types but are required
- // for declarations of public methods AddTestPattern() and
- // AddTestCaseInstantiation().
- typedef typename TestCase::ParamType ParamType;
- // A function that returns an instance of appropriate generator type.
- typedef ParamGenerator<ParamType>(GeneratorCreationFunc)();
-
- explicit ParameterizedTestCaseInfo(const char* name)
- : test_case_name_(name) {}
-
- // Test case base name for display purposes.
- virtual const string& GetTestCaseName() const { return test_case_name_; }
- // Test case id to verify identity.
- virtual TypeId GetTestCaseTypeId() const { return GetTypeId<TestCase>(); }
- // TEST_P macro uses AddTestPattern() to record information
- // about a single test in a LocalTestInfo structure.
- // test_case_name is the base name of the test case (without invocation
- // prefix). test_base_name is the name of an individual test without
- // parameter index. For the test SequenceA/FooTest.DoBar/1 FooTest is
- // test case base name and DoBar is test base name.
- void AddTestPattern(const char* test_case_name,
- const char* test_base_name,
- TestMetaFactoryBase<ParamType>* meta_factory) {
- tests_.push_back(linked_ptr<TestInfo>(new TestInfo(test_case_name,
- test_base_name,
- meta_factory)));
- }
- // INSTANTIATE_TEST_CASE_P macro uses AddGenerator() to record information
- // about a generator.
- int AddTestCaseInstantiation(const string& instantiation_name,
- GeneratorCreationFunc* func,
- const char* /* file */,
- int /* line */) {
- instantiations_.push_back(::std::make_pair(instantiation_name, func));
- return 0; // Return value used only to run this method in namespace scope.
- }
- // UnitTest class invokes this method to register tests in this test case
- // test cases right before running tests in RUN_ALL_TESTS macro.
- // This method should not be called more then once on any single
- // instance of a ParameterizedTestCaseInfoBase derived class.
- // UnitTest has a guard to prevent from calling this method more then once.
- virtual void RegisterTests() {
- for (typename TestInfoContainer::iterator test_it = tests_.begin();
- test_it != tests_.end(); ++test_it) {
- linked_ptr<TestInfo> test_info = *test_it;
- for (typename InstantiationContainer::iterator gen_it =
- instantiations_.begin(); gen_it != instantiations_.end();
- ++gen_it) {
- const string& instantiation_name = gen_it->first;
- ParamGenerator<ParamType> generator((*gen_it->second)());
-
- Message test_case_name_stream;
- if ( !instantiation_name.empty() )
- test_case_name_stream << instantiation_name << "/";
- test_case_name_stream << test_info->test_case_base_name;
-
- int i = 0;
- for (typename ParamGenerator<ParamType>::iterator param_it =
- generator.begin();
- param_it != generator.end(); ++param_it, ++i) {
- Message test_name_stream;
- test_name_stream << test_info->test_base_name << "/" << i;
- MakeAndRegisterTestInfo(
- test_case_name_stream.GetString().c_str(),
- test_name_stream.GetString().c_str(),
- NULL, // No type parameter.
- PrintToString(*param_it).c_str(),
- GetTestCaseTypeId(),
- TestCase::SetUpTestCase,
- TestCase::TearDownTestCase,
- test_info->test_meta_factory->CreateTestFactory(*param_it));
- } // for param_it
- } // for gen_it
- } // for test_it
- } // RegisterTests
-
- private:
- // LocalTestInfo structure keeps information about a single test registered
- // with TEST_P macro.
- struct TestInfo {
- TestInfo(const char* a_test_case_base_name,
- const char* a_test_base_name,
- TestMetaFactoryBase<ParamType>* a_test_meta_factory) :
- test_case_base_name(a_test_case_base_name),
- test_base_name(a_test_base_name),
- test_meta_factory(a_test_meta_factory) {}
-
- const string test_case_base_name;
- const string test_base_name;
- const scoped_ptr<TestMetaFactoryBase<ParamType> > test_meta_factory;
- };
- typedef ::std::vector<linked_ptr<TestInfo> > TestInfoContainer;
- // Keeps pairs of <Instantiation name, Sequence generator creation function>
- // received from INSTANTIATE_TEST_CASE_P macros.
- typedef ::std::vector<std::pair<string, GeneratorCreationFunc*> >
- InstantiationContainer;
-
- const string test_case_name_;
- TestInfoContainer tests_;
- InstantiationContainer instantiations_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseInfo);
-}; // class ParameterizedTestCaseInfo
-
-// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
-//
-// ParameterizedTestCaseRegistry contains a map of ParameterizedTestCaseInfoBase
-// classes accessed by test case names. TEST_P and INSTANTIATE_TEST_CASE_P
-// macros use it to locate their corresponding ParameterizedTestCaseInfo
-// descriptors.
-class ParameterizedTestCaseRegistry {
- public:
- ParameterizedTestCaseRegistry() {}
- ~ParameterizedTestCaseRegistry() {
- for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
- it != test_case_infos_.end(); ++it) {
- delete *it;
- }
- }
-
- // Looks up or creates and returns a structure containing information about
- // tests and instantiations of a particular test case.
- template <class TestCase>
- ParameterizedTestCaseInfo<TestCase>* GetTestCasePatternHolder(
- const char* test_case_name,
- const char* file,
- int line) {
- ParameterizedTestCaseInfo<TestCase>* typed_test_info = NULL;
- for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
- it != test_case_infos_.end(); ++it) {
- if ((*it)->GetTestCaseName() == test_case_name) {
- if ((*it)->GetTestCaseTypeId() != GetTypeId<TestCase>()) {
- // Complain about incorrect usage of Google Test facilities
- // and terminate the program since we cannot guaranty correct
- // test case setup and tear-down in this case.
- ReportInvalidTestCaseType(test_case_name, file, line);
- posix::Abort();
- } else {
- // At this point we are sure that the object we found is of the same
- // type we are looking for, so we downcast it to that type
- // without further checks.
- typed_test_info = CheckedDowncastToActualType<
- ParameterizedTestCaseInfo<TestCase> >(*it);
- }
- break;
- }
- }
- if (typed_test_info == NULL) {
- typed_test_info = new ParameterizedTestCaseInfo<TestCase>(test_case_name);
- test_case_infos_.push_back(typed_test_info);
- }
- return typed_test_info;
- }
- void RegisterTests() {
- for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
- it != test_case_infos_.end(); ++it) {
- (*it)->RegisterTests();
- }
- }
-
- private:
- typedef ::std::vector<ParameterizedTestCaseInfoBase*> TestCaseInfoContainer;
-
- TestCaseInfoContainer test_case_infos_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseRegistry);
-};
-
-} // namespace internal
-} // namespace testing
-
-#endif // GTEST_HAS_PARAM_TEST
-
-#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
diff --git a/src/testing/gtest/include/gtest/internal/gtest-port.h b/src/testing/gtest/include/gtest/internal/gtest-port.h
deleted file mode 100644
index 08703e31..00000000
--- a/src/testing/gtest/include/gtest/internal/gtest-port.h
+++ /dev/null
@@ -1,1851 +0,0 @@
-// Copyright 2005, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Authors: wan@google.com (Zhanyong Wan)
-//
-// Low-level types and utilities for porting Google Test to various
-// platforms. They are subject to change without notice. DO NOT USE
-// THEM IN USER CODE.
-
-#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
-#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
-
-// The user can define the following macros in the build script to
-// control Google Test's behavior. If the user doesn't define a macro
-// in this list, Google Test will define it.
-//
-// GTEST_HAS_CLONE - Define it to 1/0 to indicate that clone(2)
-// is/isn't available.
-// GTEST_HAS_EXCEPTIONS - Define it to 1/0 to indicate that exceptions
-// are enabled.
-// GTEST_HAS_GLOBAL_STRING - Define it to 1/0 to indicate that ::string
-// is/isn't available (some systems define
-// ::string, which is different to std::string).
-// GTEST_HAS_GLOBAL_WSTRING - Define it to 1/0 to indicate that ::string
-// is/isn't available (some systems define
-// ::wstring, which is different to std::wstring).
-// GTEST_HAS_POSIX_RE - Define it to 1/0 to indicate that POSIX regular
-// expressions are/aren't available.
-// GTEST_HAS_PTHREAD - Define it to 1/0 to indicate that <pthread.h>
-// is/isn't available.
-// GTEST_HAS_RTTI - Define it to 1/0 to indicate that RTTI is/isn't
-// enabled.
-// GTEST_HAS_STD_WSTRING - Define it to 1/0 to indicate that
-// std::wstring does/doesn't work (Google Test can
-// be used where std::wstring is unavailable).
-// GTEST_HAS_TR1_TUPLE - Define it to 1/0 to indicate tr1::tuple
-// is/isn't available.
-// GTEST_HAS_SEH - Define it to 1/0 to indicate whether the
-// compiler supports Microsoft's "Structured
-// Exception Handling".
-// GTEST_HAS_STREAM_REDIRECTION
-// - Define it to 1/0 to indicate whether the
-// platform supports I/O stream redirection using
-// dup() and dup2().
-// GTEST_USE_OWN_TR1_TUPLE - Define it to 1/0 to indicate whether Google
-// Test's own tr1 tuple implementation should be
-// used. Unused when the user sets
-// GTEST_HAS_TR1_TUPLE to 0.
-// GTEST_LINKED_AS_SHARED_LIBRARY
-// - Define to 1 when compiling tests that use
-// Google Test as a shared library (known as
-// DLL on Windows).
-// GTEST_CREATE_SHARED_LIBRARY
-// - Define to 1 when compiling Google Test itself
-// as a shared library.
-
-// This header defines the following utilities:
-//
-// Macros indicating the current platform (defined to 1 if compiled on
-// the given platform; otherwise undefined):
-// GTEST_OS_AIX - IBM AIX
-// GTEST_OS_CYGWIN - Cygwin
-// GTEST_OS_HPUX - HP-UX
-// GTEST_OS_LINUX - Linux
-// GTEST_OS_LINUX_ANDROID - Google Android
-// GTEST_OS_MAC - Mac OS X
-// GTEST_OS_NACL - Google Native Client (NaCl)
-// GTEST_OS_OPENBSD - OpenBSD
-// GTEST_OS_QNX - QNX
-// GTEST_OS_SOLARIS - Sun Solaris
-// GTEST_OS_SYMBIAN - Symbian
-// GTEST_OS_WINDOWS - Windows (Desktop, MinGW, or Mobile)
-// GTEST_OS_WINDOWS_DESKTOP - Windows Desktop
-// GTEST_OS_WINDOWS_MINGW - MinGW
-// GTEST_OS_WINDOWS_MOBILE - Windows Mobile
-// GTEST_OS_ZOS - z/OS
-//
-// Among the platforms, Cygwin, Linux, Max OS X, and Windows have the
-// most stable support. Since core members of the Google Test project
-// don't have access to other platforms, support for them may be less
-// stable. If you notice any problems on your platform, please notify
-// googletestframework@googlegroups.com (patches for fixing them are
-// even more welcome!).
-//
-// Note that it is possible that none of the GTEST_OS_* macros are defined.
-//
-// Macros indicating available Google Test features (defined to 1 if
-// the corresponding feature is supported; otherwise undefined):
-// GTEST_HAS_COMBINE - the Combine() function (for value-parameterized
-// tests)
-// GTEST_HAS_DEATH_TEST - death tests
-// GTEST_HAS_PARAM_TEST - value-parameterized tests
-// GTEST_HAS_TYPED_TEST - typed tests
-// GTEST_HAS_TYPED_TEST_P - type-parameterized tests
-// GTEST_USES_POSIX_RE - enhanced POSIX regex is used. Do not confuse with
-// GTEST_HAS_POSIX_RE (see above) which users can
-// define themselves.
-// GTEST_USES_SIMPLE_RE - our own simple regex is used;
-// the above two are mutually exclusive.
-// GTEST_CAN_COMPARE_NULL - accepts untyped NULL in EXPECT_EQ().
-//
-// Macros for basic C++ coding:
-// GTEST_AMBIGUOUS_ELSE_BLOCKER_ - for disabling a gcc warning.
-// GTEST_ATTRIBUTE_UNUSED_ - declares that a class' instances or a
-// variable don't have to be used.
-// GTEST_DISALLOW_ASSIGN_ - disables operator=.
-// GTEST_DISALLOW_COPY_AND_ASSIGN_ - disables copy ctor and operator=.
-// GTEST_MUST_USE_RESULT_ - declares that a function's result must be used.
-//
-// Synchronization:
-// Mutex, MutexLock, ThreadLocal, GetThreadCount()
-// - synchronization primitives.
-// GTEST_IS_THREADSAFE - defined to 1 to indicate that the above
-// synchronization primitives have real implementations
-// and Google Test is thread-safe; or 0 otherwise.
-//
-// Template meta programming:
-// is_pointer - as in TR1; needed on Symbian and IBM XL C/C++ only.
-// IteratorTraits - partial implementation of std::iterator_traits, which
-// is not available in libCstd when compiled with Sun C++.
-//
-// Smart pointers:
-// scoped_ptr - as in TR2.
-//
-// Regular expressions:
-// RE - a simple regular expression class using the POSIX
-// Extended Regular Expression syntax on UNIX-like
-// platforms, or a reduced regular exception syntax on
-// other platforms, including Windows.
-//
-// Logging:
-// GTEST_LOG_() - logs messages at the specified severity level.
-// LogToStderr() - directs all log messages to stderr.
-// FlushInfoLog() - flushes informational log messages.
-//
-// Stdout and stderr capturing:
-// CaptureStdout() - starts capturing stdout.
-// GetCapturedStdout() - stops capturing stdout and returns the captured
-// string.
-// CaptureStderr() - starts capturing stderr.
-// GetCapturedStderr() - stops capturing stderr and returns the captured
-// string.
-//
-// Integer types:
-// TypeWithSize - maps an integer to a int type.
-// Int32, UInt32, Int64, UInt64, TimeInMillis
-// - integers of known sizes.
-// BiggestInt - the biggest signed integer type.
-//
-// Command-line utilities:
-// GTEST_FLAG() - references a flag.
-// GTEST_DECLARE_*() - declares a flag.
-// GTEST_DEFINE_*() - defines a flag.
-// GetInjectableArgvs() - returns the command line as a vector of strings.
-//
-// Environment variable utilities:
-// GetEnv() - gets the value of an environment variable.
-// BoolFromGTestEnv() - parses a bool environment variable.
-// Int32FromGTestEnv() - parses an Int32 environment variable.
-// StringFromGTestEnv() - parses a string environment variable.
-
-#include <ctype.h> // for isspace, etc
-#include <stddef.h> // for ptrdiff_t
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#ifndef _WIN32_WCE
-# include <sys/types.h>
-# include <sys/stat.h>
-#endif // !_WIN32_WCE
-
-#include <iostream> // NOLINT
-#include <sstream> // NOLINT
-#include <string> // NOLINT
-
-#define GTEST_DEV_EMAIL_ "googletestframework@@googlegroups.com"
-#define GTEST_FLAG_PREFIX_ "gtest_"
-#define GTEST_FLAG_PREFIX_DASH_ "gtest-"
-#define GTEST_FLAG_PREFIX_UPPER_ "GTEST_"
-#define GTEST_NAME_ "Google Test"
-#define GTEST_PROJECT_URL_ "http://code.google.com/p/googletest/"
-
-// Determines the version of gcc that is used to compile this.
-#ifdef __GNUC__
-// 40302 means version 4.3.2.
-# define GTEST_GCC_VER_ \
- (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__)
-#endif // __GNUC__
-
-// Determines the platform on which Google Test is compiled.
-#ifdef __CYGWIN__
-# define GTEST_OS_CYGWIN 1
-#elif defined __SYMBIAN32__
-# define GTEST_OS_SYMBIAN 1
-#elif defined _WIN32
-# define GTEST_OS_WINDOWS 1
-# ifdef _WIN32_WCE
-# define GTEST_OS_WINDOWS_MOBILE 1
-# elif defined(__MINGW__) || defined(__MINGW32__)
-# define GTEST_OS_WINDOWS_MINGW 1
-# else
-# define GTEST_OS_WINDOWS_DESKTOP 1
-# endif // _WIN32_WCE
-#elif defined __APPLE__
-# define GTEST_OS_MAC 1
-#elif defined __linux__
-# define GTEST_OS_LINUX 1
-# ifdef ANDROID
-# define GTEST_OS_LINUX_ANDROID 1
-# endif // ANDROID
-#elif defined __MVS__
-# define GTEST_OS_ZOS 1
-#elif defined(__sun) && defined(__SVR4)
-# define GTEST_OS_SOLARIS 1
-#elif defined(_AIX)
-# define GTEST_OS_AIX 1
-#elif defined(__hpux)
-# define GTEST_OS_HPUX 1
-#elif defined __native_client__
-# define GTEST_OS_NACL 1
-#elif defined __OpenBSD__
-# define GTEST_OS_OPENBSD 1
-#elif defined __QNX__
-# define GTEST_OS_QNX 1
-#endif // __CYGWIN__
-
-// Brings in definitions for functions used in the testing::internal::posix
-// namespace (read, write, close, chdir, isatty, stat). We do not currently
-// use them on Windows Mobile.
-#if !GTEST_OS_WINDOWS
-// This assumes that non-Windows OSes provide unistd.h. For OSes where this
-// is not the case, we need to include headers that provide the functions
-// mentioned above.
-# include <unistd.h>
-# if !GTEST_OS_NACL
-// TODO(vladl@google.com): Remove this condition when Native Client SDK adds
-// strings.h (tracked in
-// http://code.google.com/p/nativeclient/issues/detail?id=1175).
-# include <strings.h> // Native Client doesn't provide strings.h.
-# endif
-#elif !GTEST_OS_WINDOWS_MOBILE
-# include <direct.h>
-# include <io.h>
-#endif
-
-// Defines this to true iff Google Test can use POSIX regular expressions.
-#ifndef GTEST_HAS_POSIX_RE
-# define GTEST_HAS_POSIX_RE (!GTEST_OS_WINDOWS)
-#endif
-
-#if GTEST_HAS_POSIX_RE
-
-// On some platforms, <regex.h> needs someone to define size_t, and
-// won't compile otherwise. We can #include it here as we already
-// included <stdlib.h>, which is guaranteed to define size_t through
-// <stddef.h>.
-# include <regex.h> // NOLINT
-
-# define GTEST_USES_POSIX_RE 1
-
-#elif GTEST_OS_WINDOWS
-
-// <regex.h> is not available on Windows. Use our own simple regex
-// implementation instead.
-# define GTEST_USES_SIMPLE_RE 1
-
-#else
-
-// <regex.h> may not be available on this platform. Use our own
-// simple regex implementation instead.
-# define GTEST_USES_SIMPLE_RE 1
-
-#endif // GTEST_HAS_POSIX_RE
-
-#ifndef GTEST_HAS_EXCEPTIONS
-// The user didn't tell us whether exceptions are enabled, so we need
-// to figure it out.
-# if defined(_MSC_VER) || defined(__BORLANDC__)
-// MSVC's and C++Builder's implementations of the STL use the _HAS_EXCEPTIONS
-// macro to enable exceptions, so we'll do the same.
-// Assumes that exceptions are enabled by default.
-# ifndef _HAS_EXCEPTIONS
-# define _HAS_EXCEPTIONS 1
-# endif // _HAS_EXCEPTIONS
-# define GTEST_HAS_EXCEPTIONS _HAS_EXCEPTIONS
-# elif defined(__GNUC__) && __EXCEPTIONS
-// gcc defines __EXCEPTIONS to 1 iff exceptions are enabled.
-# define GTEST_HAS_EXCEPTIONS 1
-# elif defined(__SUNPRO_CC)
-// Sun Pro CC supports exceptions. However, there is no compile-time way of
-// detecting whether they are enabled or not. Therefore, we assume that
-// they are enabled unless the user tells us otherwise.
-# define GTEST_HAS_EXCEPTIONS 1
-# elif defined(__IBMCPP__) && __EXCEPTIONS
-// xlC defines __EXCEPTIONS to 1 iff exceptions are enabled.
-# define GTEST_HAS_EXCEPTIONS 1
-# elif defined(__HP_aCC)
-// Exception handling is in effect by default in HP aCC compiler. It has to
-// be turned of by +noeh compiler option if desired.
-# define GTEST_HAS_EXCEPTIONS 1
-# else
-// For other compilers, we assume exceptions are disabled to be
-// conservative.
-# define GTEST_HAS_EXCEPTIONS 0
-# endif // defined(_MSC_VER) || defined(__BORLANDC__)
-#endif // GTEST_HAS_EXCEPTIONS
-
-#if !defined(GTEST_HAS_STD_STRING)
-// Even though we don't use this macro any longer, we keep it in case
-// some clients still depend on it.
-# define GTEST_HAS_STD_STRING 1
-#elif !GTEST_HAS_STD_STRING
-// The user told us that ::std::string isn't available.
-# error "Google Test cannot be used where ::std::string isn't available."
-#endif // !defined(GTEST_HAS_STD_STRING)
-
-#ifndef GTEST_HAS_GLOBAL_STRING
-// The user didn't tell us whether ::string is available, so we need
-// to figure it out.
-
-# define GTEST_HAS_GLOBAL_STRING 0
-
-#endif // GTEST_HAS_GLOBAL_STRING
-
-#ifndef GTEST_HAS_STD_WSTRING
-// The user didn't tell us whether ::std::wstring is available, so we need
-// to figure it out.
-// TODO(wan@google.com): uses autoconf to detect whether ::std::wstring
-// is available.
-
-// Cygwin 1.7 and below doesn't support ::std::wstring.
-// Solaris' libc++ doesn't support it either. Android has
-// no support for it at least as recent as Froyo (2.2).
-# define GTEST_HAS_STD_WSTRING \
- (!(GTEST_OS_LINUX_ANDROID || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS))
-
-#endif // GTEST_HAS_STD_WSTRING
-
-#ifndef GTEST_HAS_GLOBAL_WSTRING
-// The user didn't tell us whether ::wstring is available, so we need
-// to figure it out.
-# define GTEST_HAS_GLOBAL_WSTRING \
- (GTEST_HAS_STD_WSTRING && GTEST_HAS_GLOBAL_STRING)
-#endif // GTEST_HAS_GLOBAL_WSTRING
-
-// Determines whether RTTI is available.
-#ifndef GTEST_HAS_RTTI
-// The user didn't tell us whether RTTI is enabled, so we need to
-// figure it out.
-
-# ifdef _MSC_VER
-
-# ifdef _CPPRTTI // MSVC defines this macro iff RTTI is enabled.
-# define GTEST_HAS_RTTI 1
-# else
-# define GTEST_HAS_RTTI 0
-# endif
-
-// Starting with version 4.3.2, gcc defines __GXX_RTTI iff RTTI is enabled.
-# elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40302)
-
-# ifdef __GXX_RTTI
-# define GTEST_HAS_RTTI 1
-# else
-# define GTEST_HAS_RTTI 0
-# endif // __GXX_RTTI
-
-// Clang defines __GXX_RTTI starting with version 3.0, but its manual recommends
-// using has_feature instead. has_feature(cxx_rtti) is supported since 2.7, the
-// first version with C++ support.
-# elif defined(__clang__)
-
-# define GTEST_HAS_RTTI __has_feature(cxx_rtti)
-
-// Starting with version 9.0 IBM Visual Age defines __RTTI_ALL__ to 1 if
-// both the typeid and dynamic_cast features are present.
-# elif defined(__IBMCPP__) && (__IBMCPP__ >= 900)
-
-# ifdef __RTTI_ALL__
-# define GTEST_HAS_RTTI 1
-# else
-# define GTEST_HAS_RTTI 0
-# endif
-
-# else
-
-// For all other compilers, we assume RTTI is enabled.
-# define GTEST_HAS_RTTI 1
-
-# endif // _MSC_VER
-
-#endif // GTEST_HAS_RTTI
-
-// It's this header's responsibility to #include <typeinfo> when RTTI
-// is enabled.
-#if GTEST_HAS_RTTI
-# include <typeinfo>
-#endif
-
-// Determines whether Google Test can use the pthreads library.
-#ifndef GTEST_HAS_PTHREAD
-// The user didn't tell us explicitly, so we assume pthreads support is
-// available on Linux and Mac.
-//
-// To disable threading support in Google Test, add -DGTEST_HAS_PTHREAD=0
-// to your compiler flags.
-# define GTEST_HAS_PTHREAD (GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_HPUX \
- || GTEST_OS_QNX)
-#endif // GTEST_HAS_PTHREAD
-
-#if GTEST_HAS_PTHREAD
-// gtest-port.h guarantees to #include <pthread.h> when GTEST_HAS_PTHREAD is
-// true.
-# include <pthread.h> // NOLINT
-
-// For timespec and nanosleep, used below.
-# include <time.h> // NOLINT
-#endif
-
-// Determines whether Google Test can use tr1/tuple. You can define
-// this macro to 0 to prevent Google Test from using tuple (any
-// feature depending on tuple with be disabled in this mode).
-#ifndef GTEST_HAS_TR1_TUPLE
-// The user didn't tell us not to do it, so we assume it's OK.
-# define GTEST_HAS_TR1_TUPLE 1
-#endif // GTEST_HAS_TR1_TUPLE
-
-// Determines whether Google Test's own tr1 tuple implementation
-// should be used.
-#ifndef GTEST_USE_OWN_TR1_TUPLE
-// The user didn't tell us, so we need to figure it out.
-
-// We use our own TR1 tuple if we aren't sure the user has an
-// implementation of it already. At this time, GCC 4.0.0+ and MSVC
-// 2010 are the only mainstream compilers that come with a TR1 tuple
-// implementation. NVIDIA's CUDA NVCC compiler pretends to be GCC by
-// defining __GNUC__ and friends, but cannot compile GCC's tuple
-// implementation. MSVC 2008 (9.0) provides TR1 tuple in a 323 MB
-// Feature Pack download, which we cannot assume the user has.
-// QNX's QCC compiler is a modified GCC but it doesn't support TR1 tuple.
-# if (defined(__GNUC__) && !defined(__CUDACC__) && (GTEST_GCC_VER_ >= 40000) \
- && !GTEST_OS_QNX) || _MSC_VER >= 1600
-# define GTEST_USE_OWN_TR1_TUPLE 0
-# else
-# define GTEST_USE_OWN_TR1_TUPLE 1
-# endif
-
-#endif // GTEST_USE_OWN_TR1_TUPLE
-
-// To avoid conditional compilation everywhere, we make it
-// gtest-port.h's responsibility to #include the header implementing
-// tr1/tuple.
-#if GTEST_HAS_TR1_TUPLE
-
-# if GTEST_USE_OWN_TR1_TUPLE
-# include "gtest/internal/gtest-tuple.h"
-# elif GTEST_OS_SYMBIAN
-
-// On Symbian, BOOST_HAS_TR1_TUPLE causes Boost's TR1 tuple library to
-// use STLport's tuple implementation, which unfortunately doesn't
-// work as the copy of STLport distributed with Symbian is incomplete.
-// By making sure BOOST_HAS_TR1_TUPLE is undefined, we force Boost to
-// use its own tuple implementation.
-# ifdef BOOST_HAS_TR1_TUPLE
-# undef BOOST_HAS_TR1_TUPLE
-# endif // BOOST_HAS_TR1_TUPLE
-
-// This prevents <boost/tr1/detail/config.hpp>, which defines
-// BOOST_HAS_TR1_TUPLE, from being #included by Boost's <tuple>.
-# define BOOST_TR1_DETAIL_CONFIG_HPP_INCLUDED
-# include <tuple>
-
-# elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40000)
-// GCC 4.0+ implements tr1/tuple in the <tr1/tuple> header. This does
-// not conform to the TR1 spec, which requires the header to be <tuple>.
-
-# if !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302
-// Until version 4.3.2, gcc has a bug that causes <tr1/functional>,
-// which is #included by <tr1/tuple>, to not compile when RTTI is
-// disabled. _TR1_FUNCTIONAL is the header guard for
-// <tr1/functional>. Hence the following #define is a hack to prevent
-// <tr1/functional> from being included.
-# define _TR1_FUNCTIONAL 1
-# include <tr1/tuple>
-# undef _TR1_FUNCTIONAL // Allows the user to #include
- // <tr1/functional> if he chooses to.
-# else
-# include <tr1/tuple> // NOLINT
-# endif // !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302
-
-# else
-// If the compiler is not GCC 4.0+, we assume the user is using a
-// spec-conforming TR1 implementation.
-# include <tuple> // NOLINT
-# endif // GTEST_USE_OWN_TR1_TUPLE
-
-#endif // GTEST_HAS_TR1_TUPLE
-
-// Determines whether clone(2) is supported.
-// Usually it will only be available on Linux, excluding
-// Linux on the Itanium architecture.
-// Also see http://linux.die.net/man/2/clone.
-#ifndef GTEST_HAS_CLONE
-// The user didn't tell us, so we need to figure it out.
-
-# if GTEST_OS_LINUX && !defined(__ia64__)
-# define GTEST_HAS_CLONE 1
-# else
-# define GTEST_HAS_CLONE 0
-# endif // GTEST_OS_LINUX && !defined(__ia64__)
-
-#endif // GTEST_HAS_CLONE
-
-// Determines whether to support stream redirection. This is used to test
-// output correctness and to implement death tests.
-#ifndef GTEST_HAS_STREAM_REDIRECTION
-// By default, we assume that stream redirection is supported on all
-// platforms except known mobile ones.
-# if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN
-# define GTEST_HAS_STREAM_REDIRECTION 0
-# else
-# define GTEST_HAS_STREAM_REDIRECTION 1
-# endif // !GTEST_OS_WINDOWS_MOBILE && !GTEST_OS_SYMBIAN
-#endif // GTEST_HAS_STREAM_REDIRECTION
-
-// Determines whether to support death tests.
-// Google Test does not support death tests for VC 7.1 and earlier as
-// abort() in a VC 7.1 application compiled as GUI in debug config
-// pops up a dialog window that cannot be suppressed programmatically.
-#if (GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS || \
- (GTEST_OS_WINDOWS_DESKTOP && _MSC_VER >= 1400) || \
- GTEST_OS_WINDOWS_MINGW || GTEST_OS_AIX || GTEST_OS_HPUX || \
- GTEST_OS_OPENBSD || GTEST_OS_QNX)
-# define GTEST_HAS_DEATH_TEST 1
-# include <vector> // NOLINT
-#endif
-
-// We don't support MSVC 7.1 with exceptions disabled now. Therefore
-// all the compilers we care about are adequate for supporting
-// value-parameterized tests.
-#define GTEST_HAS_PARAM_TEST 1
-
-// Determines whether to support type-driven tests.
-
-// Typed tests need <typeinfo> and variadic macros, which GCC, VC++ 8.0,
-// Sun Pro CC, IBM Visual Age, and HP aCC support.
-#if defined(__GNUC__) || (_MSC_VER >= 1400) || defined(__SUNPRO_CC) || \
- defined(__IBMCPP__) || defined(__HP_aCC)
-# define GTEST_HAS_TYPED_TEST 1
-# define GTEST_HAS_TYPED_TEST_P 1
-#endif
-
-// Determines whether to support Combine(). This only makes sense when
-// value-parameterized tests are enabled. The implementation doesn't
-// work on Sun Studio since it doesn't understand templated conversion
-// operators.
-#if GTEST_HAS_PARAM_TEST && GTEST_HAS_TR1_TUPLE && !defined(__SUNPRO_CC)
-# define GTEST_HAS_COMBINE 1
-#endif
-
-// Determines whether the system compiler uses UTF-16 for encoding wide strings.
-#define GTEST_WIDE_STRING_USES_UTF16_ \
- (GTEST_OS_WINDOWS || GTEST_OS_CYGWIN || GTEST_OS_SYMBIAN || GTEST_OS_AIX)
-
-// Determines whether test results can be streamed to a socket.
-#if GTEST_OS_LINUX
-# define GTEST_CAN_STREAM_RESULTS_ 1
-#endif
-
-// Defines some utility macros.
-
-// The GNU compiler emits a warning if nested "if" statements are followed by
-// an "else" statement and braces are not used to explicitly disambiguate the
-// "else" binding. This leads to problems with code like:
-//
-// if (gate)
-// ASSERT_*(condition) << "Some message";
-//
-// The "switch (0) case 0:" idiom is used to suppress this.
-#ifdef __INTEL_COMPILER
-# define GTEST_AMBIGUOUS_ELSE_BLOCKER_
-#else
-# define GTEST_AMBIGUOUS_ELSE_BLOCKER_ switch (0) case 0: default: // NOLINT
-#endif
-
-// Use this annotation at the end of a struct/class definition to
-// prevent the compiler from optimizing away instances that are never
-// used. This is useful when all interesting logic happens inside the
-// c'tor and / or d'tor. Example:
-//
-// struct Foo {
-// Foo() { ... }
-// } GTEST_ATTRIBUTE_UNUSED_;
-//
-// Also use it after a variable or parameter declaration to tell the
-// compiler the variable/parameter does not have to be used.
-#if defined(__GNUC__) && !defined(COMPILER_ICC)
-# define GTEST_ATTRIBUTE_UNUSED_ __attribute__ ((unused))
-#else
-# define GTEST_ATTRIBUTE_UNUSED_
-#endif
-
-// A macro to disallow operator=
-// This should be used in the private: declarations for a class.
-#define GTEST_DISALLOW_ASSIGN_(type)\
- void operator=(type const &)
-
-// A macro to disallow copy constructor and operator=
-// This should be used in the private: declarations for a class.
-#define GTEST_DISALLOW_COPY_AND_ASSIGN_(type)\
- type(type const &);\
- GTEST_DISALLOW_ASSIGN_(type)
-
-// Tell the compiler to warn about unused return values for functions declared
-// with this macro. The macro should be used on function declarations
-// following the argument list:
-//
-// Sprocket* AllocateSprocket() GTEST_MUST_USE_RESULT_;
-#if defined(__GNUC__) && (GTEST_GCC_VER_ >= 30400) && !defined(COMPILER_ICC)
-# define GTEST_MUST_USE_RESULT_ __attribute__ ((warn_unused_result))
-#else
-# define GTEST_MUST_USE_RESULT_
-#endif // __GNUC__ && (GTEST_GCC_VER_ >= 30400) && !COMPILER_ICC
-
-// Determine whether the compiler supports Microsoft's Structured Exception
-// Handling. This is supported by several Windows compilers but generally
-// does not exist on any other system.
-#ifndef GTEST_HAS_SEH
-// The user didn't tell us, so we need to figure it out.
-
-# if defined(_MSC_VER) || defined(__BORLANDC__)
-// These two compilers are known to support SEH.
-# define GTEST_HAS_SEH 1
-# else
-// Assume no SEH.
-# define GTEST_HAS_SEH 0
-# endif
-
-#endif // GTEST_HAS_SEH
-
-#ifdef _MSC_VER
-
-# if GTEST_LINKED_AS_SHARED_LIBRARY
-# define GTEST_API_ __declspec(dllimport)
-# elif GTEST_CREATE_SHARED_LIBRARY
-# define GTEST_API_ __declspec(dllexport)
-# endif
-
-#endif // _MSC_VER
-
-#ifndef GTEST_API_
-# define GTEST_API_
-#endif
-
-#ifdef __GNUC__
-// Ask the compiler to never inline a given function.
-# define GTEST_NO_INLINE_ __attribute__((noinline))
-#else
-# define GTEST_NO_INLINE_
-#endif
-
-// _LIBCPP_VERSION is defined by the libc++ library from the LLVM project.
-#if defined(__GLIBCXX__) || defined(_LIBCPP_VERSION)
-# define GTEST_HAS_CXXABI_H_ 1
-#else
-# define GTEST_HAS_CXXABI_H_ 0
-#endif
-
-namespace testing {
-
-class Message;
-
-namespace internal {
-
-class String;
-
-// The GTEST_COMPILE_ASSERT_ macro can be used to verify that a compile time
-// expression is true. For example, you could use it to verify the
-// size of a static array:
-//
-// GTEST_COMPILE_ASSERT_(ARRAYSIZE(content_type_names) == CONTENT_NUM_TYPES,
-// content_type_names_incorrect_size);
-//
-// or to make sure a struct is smaller than a certain size:
-//
-// GTEST_COMPILE_ASSERT_(sizeof(foo) < 128, foo_too_large);
-//
-// The second argument to the macro is the name of the variable. If
-// the expression is false, most compilers will issue a warning/error
-// containing the name of the variable.
-
-template <bool>
-struct CompileAssert {
-};
-
-#define GTEST_COMPILE_ASSERT_(expr, msg) \
- typedef ::testing::internal::CompileAssert<(bool(expr))> \
- msg[bool(expr) ? 1 : -1]
-
-// Implementation details of GTEST_COMPILE_ASSERT_:
-//
-// - GTEST_COMPILE_ASSERT_ works by defining an array type that has -1
-// elements (and thus is invalid) when the expression is false.
-//
-// - The simpler definition
-//
-// #define GTEST_COMPILE_ASSERT_(expr, msg) typedef char msg[(expr) ? 1 : -1]
-//
-// does not work, as gcc supports variable-length arrays whose sizes
-// are determined at run-time (this is gcc's extension and not part
-// of the C++ standard). As a result, gcc fails to reject the
-// following code with the simple definition:
-//
-// int foo;
-// GTEST_COMPILE_ASSERT_(foo, msg); // not supposed to compile as foo is
-// // not a compile-time constant.
-//
-// - By using the type CompileAssert<(bool(expr))>, we ensures that
-// expr is a compile-time constant. (Template arguments must be
-// determined at compile-time.)
-//
-// - The outter parentheses in CompileAssert<(bool(expr))> are necessary
-// to work around a bug in gcc 3.4.4 and 4.0.1. If we had written
-//
-// CompileAssert<bool(expr)>
-//
-// instead, these compilers will refuse to compile
-//
-// GTEST_COMPILE_ASSERT_(5 > 0, some_message);
-//
-// (They seem to think the ">" in "5 > 0" marks the end of the
-// template argument list.)
-//
-// - The array size is (bool(expr) ? 1 : -1), instead of simply
-//
-// ((expr) ? 1 : -1).
-//
-// This is to avoid running into a bug in MS VC 7.1, which
-// causes ((0.0) ? 1 : -1) to incorrectly evaluate to 1.
-
-// StaticAssertTypeEqHelper is used by StaticAssertTypeEq defined in gtest.h.
-//
-// This template is declared, but intentionally undefined.
-template <typename T1, typename T2>
-struct StaticAssertTypeEqHelper;
-
-template <typename T>
-struct StaticAssertTypeEqHelper<T, T> {};
-
-#if GTEST_HAS_GLOBAL_STRING
-typedef ::string string;
-#else
-typedef ::std::string string;
-#endif // GTEST_HAS_GLOBAL_STRING
-
-#if GTEST_HAS_GLOBAL_WSTRING
-typedef ::wstring wstring;
-#elif GTEST_HAS_STD_WSTRING
-typedef ::std::wstring wstring;
-#endif // GTEST_HAS_GLOBAL_WSTRING
-
-// A helper for suppressing warnings on constant condition. It just
-// returns 'condition'.
-GTEST_API_ bool IsTrue(bool condition);
-
-// Defines scoped_ptr.
-
-// This implementation of scoped_ptr is PARTIAL - it only contains
-// enough stuff to satisfy Google Test's need.
-template <typename T>
-class scoped_ptr {
- public:
- typedef T element_type;
-
- explicit scoped_ptr(T* p = NULL) : ptr_(p) {}
- ~scoped_ptr() { reset(); }
-
- T& operator*() const { return *ptr_; }
- T* operator->() const { return ptr_; }
- T* get() const { return ptr_; }
-
- T* release() {
- T* const ptr = ptr_;
- ptr_ = NULL;
- return ptr;
- }
-
- void reset(T* p = NULL) {
- if (p != ptr_) {
- if (IsTrue(sizeof(T) > 0)) { // Makes sure T is a complete type.
- delete ptr_;
- }
- ptr_ = p;
- }
- }
-
- private:
- T* ptr_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(scoped_ptr);
-};
-
-// Defines RE.
-
-// A simple C++ wrapper for <regex.h>. It uses the POSIX Extended
-// Regular Expression syntax.
-class GTEST_API_ RE {
- public:
- // A copy constructor is required by the Standard to initialize object
- // references from r-values.
- RE(const RE& other) { Init(other.pattern()); }
-
- // Constructs an RE from a string.
- RE(const ::std::string& regex) { Init(regex.c_str()); } // NOLINT
-
-#if GTEST_HAS_GLOBAL_STRING
-
- RE(const ::string& regex) { Init(regex.c_str()); } // NOLINT
-
-#endif // GTEST_HAS_GLOBAL_STRING
-
- RE(const char* regex) { Init(regex); } // NOLINT
- ~RE();
-
- // Returns the string representation of the regex.
- const char* pattern() const { return pattern_; }
-
- // FullMatch(str, re) returns true iff regular expression re matches
- // the entire str.
- // PartialMatch(str, re) returns true iff regular expression re
- // matches a substring of str (including str itself).
- //
- // TODO(wan@google.com): make FullMatch() and PartialMatch() work
- // when str contains NUL characters.
- static bool FullMatch(const ::std::string& str, const RE& re) {
- return FullMatch(str.c_str(), re);
- }
- static bool PartialMatch(const ::std::string& str, const RE& re) {
- return PartialMatch(str.c_str(), re);
- }
-
-#if GTEST_HAS_GLOBAL_STRING
-
- static bool FullMatch(const ::string& str, const RE& re) {
- return FullMatch(str.c_str(), re);
- }
- static bool PartialMatch(const ::string& str, const RE& re) {
- return PartialMatch(str.c_str(), re);
- }
-
-#endif // GTEST_HAS_GLOBAL_STRING
-
- static bool FullMatch(const char* str, const RE& re);
- static bool PartialMatch(const char* str, const RE& re);
-
- private:
- void Init(const char* regex);
-
- // We use a const char* instead of a string, as Google Test may be used
- // where string is not available. We also do not use Google Test's own
- // String type here, in order to simplify dependencies between the
- // files.
- const char* pattern_;
- bool is_valid_;
-
-#if GTEST_USES_POSIX_RE
-
- regex_t full_regex_; // For FullMatch().
- regex_t partial_regex_; // For PartialMatch().
-
-#else // GTEST_USES_SIMPLE_RE
-
- const char* full_pattern_; // For FullMatch();
-
-#endif
-
- GTEST_DISALLOW_ASSIGN_(RE);
-};
-
-// Formats a source file path and a line number as they would appear
-// in an error message from the compiler used to compile this code.
-GTEST_API_ ::std::string FormatFileLocation(const char* file, int line);
-
-// Formats a file location for compiler-independent XML output.
-// Although this function is not platform dependent, we put it next to
-// FormatFileLocation in order to contrast the two functions.
-GTEST_API_ ::std::string FormatCompilerIndependentFileLocation(const char* file,
- int line);
-
-// Defines logging utilities:
-// GTEST_LOG_(severity) - logs messages at the specified severity level. The
-// message itself is streamed into the macro.
-// LogToStderr() - directs all log messages to stderr.
-// FlushInfoLog() - flushes informational log messages.
-
-enum GTestLogSeverity {
- GTEST_INFO,
- GTEST_WARNING,
- GTEST_ERROR,
- GTEST_FATAL
-};
-
-// Formats log entry severity, provides a stream object for streaming the
-// log message, and terminates the message with a newline when going out of
-// scope.
-class GTEST_API_ GTestLog {
- public:
- GTestLog(GTestLogSeverity severity, const char* file, int line);
-
- // Flushes the buffers and, if severity is GTEST_FATAL, aborts the program.
- ~GTestLog();
-
- ::std::ostream& GetStream() { return ::std::cerr; }
-
- private:
- const GTestLogSeverity severity_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestLog);
-};
-
-#define GTEST_LOG_(severity) \
- ::testing::internal::GTestLog(::testing::internal::GTEST_##severity, \
- __FILE__, __LINE__).GetStream()
-
-inline void LogToStderr() {}
-inline void FlushInfoLog() { fflush(NULL); }
-
-// INTERNAL IMPLEMENTATION - DO NOT USE.
-//
-// GTEST_CHECK_ is an all-mode assert. It aborts the program if the condition
-// is not satisfied.
-// Synopsys:
-// GTEST_CHECK_(boolean_condition);
-// or
-// GTEST_CHECK_(boolean_condition) << "Additional message";
-//
-// This checks the condition and if the condition is not satisfied
-// it prints message about the condition violation, including the
-// condition itself, plus additional message streamed into it, if any,
-// and then it aborts the program. It aborts the program irrespective of
-// whether it is built in the debug mode or not.
-#define GTEST_CHECK_(condition) \
- GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
- if (::testing::internal::IsTrue(condition)) \
- ; \
- else \
- GTEST_LOG_(FATAL) << "Condition " #condition " failed. "
-
-// An all-mode assert to verify that the given POSIX-style function
-// call returns 0 (indicating success). Known limitation: this
-// doesn't expand to a balanced 'if' statement, so enclose the macro
-// in {} if you need to use it as the only statement in an 'if'
-// branch.
-#define GTEST_CHECK_POSIX_SUCCESS_(posix_call) \
- if (const int gtest_error = (posix_call)) \
- GTEST_LOG_(FATAL) << #posix_call << "failed with error " \
- << gtest_error
-
-// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
-//
-// Use ImplicitCast_ as a safe version of static_cast for upcasting in
-// the type hierarchy (e.g. casting a Foo* to a SuperclassOfFoo* or a
-// const Foo*). When you use ImplicitCast_, the compiler checks that
-// the cast is safe. Such explicit ImplicitCast_s are necessary in
-// surprisingly many situations where C++ demands an exact type match
-// instead of an argument type convertable to a target type.
-//
-// The syntax for using ImplicitCast_ is the same as for static_cast:
-//
-// ImplicitCast_<ToType>(expr)
-//
-// ImplicitCast_ would have been part of the C++ standard library,
-// but the proposal was submitted too late. It will probably make
-// its way into the language in the future.
-//
-// This relatively ugly name is intentional. It prevents clashes with
-// similar functions users may have (e.g., implicit_cast). The internal
-// namespace alone is not enough because the function can be found by ADL.
-template<typename To>
-inline To ImplicitCast_(To x) { return x; }
-
-// When you upcast (that is, cast a pointer from type Foo to type
-// SuperclassOfFoo), it's fine to use ImplicitCast_<>, since upcasts
-// always succeed. When you downcast (that is, cast a pointer from
-// type Foo to type SubclassOfFoo), static_cast<> isn't safe, because
-// how do you know the pointer is really of type SubclassOfFoo? It
-// could be a bare Foo, or of type DifferentSubclassOfFoo. Thus,
-// when you downcast, you should use this macro. In debug mode, we
-// use dynamic_cast<> to double-check the downcast is legal (we die
-// if it's not). In normal mode, we do the efficient static_cast<>
-// instead. Thus, it's important to test in debug mode to make sure
-// the cast is legal!
-// This is the only place in the code we should use dynamic_cast<>.
-// In particular, you SHOULDN'T be using dynamic_cast<> in order to
-// do RTTI (eg code like this:
-// if (dynamic_cast<Subclass1>(foo)) HandleASubclass1Object(foo);
-// if (dynamic_cast<Subclass2>(foo)) HandleASubclass2Object(foo);
-// You should design the code some other way not to need this.
-//
-// This relatively ugly name is intentional. It prevents clashes with
-// similar functions users may have (e.g., down_cast). The internal
-// namespace alone is not enough because the function can be found by ADL.
-template<typename To, typename From> // use like this: DownCast_<T*>(foo);
-inline To DownCast_(From* f) { // so we only accept pointers
- // Ensures that To is a sub-type of From *. This test is here only
- // for compile-time type checking, and has no overhead in an
- // optimized build at run-time, as it will be optimized away
- // completely.
- if (false) {
- const To to = NULL;
- ::testing::internal::ImplicitCast_<From*>(to);
- }
-
-#if GTEST_HAS_RTTI
- // RTTI: debug mode only!
- GTEST_CHECK_(f == NULL || dynamic_cast<To>(f) != NULL);
-#endif
- return static_cast<To>(f);
-}
-
-// Downcasts the pointer of type Base to Derived.
-// Derived must be a subclass of Base. The parameter MUST
-// point to a class of type Derived, not any subclass of it.
-// When RTTI is available, the function performs a runtime
-// check to enforce this.
-template <class Derived, class Base>
-Derived* CheckedDowncastToActualType(Base* base) {
-#if GTEST_HAS_RTTI
- GTEST_CHECK_(typeid(*base) == typeid(Derived));
- return dynamic_cast<Derived*>(base); // NOLINT
-#else
- return static_cast<Derived*>(base); // Poor man's downcast.
-#endif
-}
-
-#if GTEST_HAS_STREAM_REDIRECTION
-
-// Defines the stderr capturer:
-// CaptureStdout - starts capturing stdout.
-// GetCapturedStdout - stops capturing stdout and returns the captured string.
-// CaptureStderr - starts capturing stderr.
-// GetCapturedStderr - stops capturing stderr and returns the captured string.
-//
-GTEST_API_ void CaptureStdout();
-GTEST_API_ String GetCapturedStdout();
-GTEST_API_ void CaptureStderr();
-GTEST_API_ String GetCapturedStderr();
-
-#endif // GTEST_HAS_STREAM_REDIRECTION
-
-
-#if GTEST_HAS_DEATH_TEST
-
-const ::std::vector<testing::internal::string>& GetInjectableArgvs();
-void SetInjectableArgvs(const ::std::vector<testing::internal::string>*
- new_argvs);
-
-// A copy of all command line arguments. Set by InitGoogleTest().
-extern ::std::vector<testing::internal::string> g_argvs;
-
-#endif // GTEST_HAS_DEATH_TEST
-
-// Defines synchronization primitives.
-
-#if GTEST_HAS_PTHREAD
-
-// Sleeps for (roughly) n milli-seconds. This function is only for
-// testing Google Test's own constructs. Don't use it in user tests,
-// either directly or indirectly.
-inline void SleepMilliseconds(int n) {
- const timespec time = {
- 0, // 0 seconds.
- n * 1000L * 1000L, // And n ms.
- };
- nanosleep(&time, NULL);
-}
-
-// Allows a controller thread to pause execution of newly created
-// threads until notified. Instances of this class must be created
-// and destroyed in the controller thread.
-//
-// This class is only for testing Google Test's own constructs. Do not
-// use it in user tests, either directly or indirectly.
-class Notification {
- public:
- Notification() : notified_(false) {
- GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL));
- }
- ~Notification() {
- pthread_mutex_destroy(&mutex_);
- }
-
- // Notifies all threads created with this notification to start. Must
- // be called from the controller thread.
- void Notify() {
- pthread_mutex_lock(&mutex_);
- notified_ = true;
- pthread_mutex_unlock(&mutex_);
- }
-
- // Blocks until the controller thread notifies. Must be called from a test
- // thread.
- void WaitForNotification() {
- for (;;) {
- pthread_mutex_lock(&mutex_);
- const bool notified = notified_;
- pthread_mutex_unlock(&mutex_);
- if (notified)
- break;
- SleepMilliseconds(10);
- }
- }
-
- private:
- pthread_mutex_t mutex_;
- bool notified_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(Notification);
-};
-
-// As a C-function, ThreadFuncWithCLinkage cannot be templated itself.
-// Consequently, it cannot select a correct instantiation of ThreadWithParam
-// in order to call its Run(). Introducing ThreadWithParamBase as a
-// non-templated base class for ThreadWithParam allows us to bypass this
-// problem.
-class ThreadWithParamBase {
- public:
- virtual ~ThreadWithParamBase() {}
- virtual void Run() = 0;
-};
-
-// pthread_create() accepts a pointer to a function type with the C linkage.
-// According to the Standard (7.5/1), function types with different linkages
-// are different even if they are otherwise identical. Some compilers (for
-// example, SunStudio) treat them as different types. Since class methods
-// cannot be defined with C-linkage we need to define a free C-function to
-// pass into pthread_create().
-extern "C" inline void* ThreadFuncWithCLinkage(void* thread) {
- static_cast<ThreadWithParamBase*>(thread)->Run();
- return NULL;
-}
-
-// Helper class for testing Google Test's multi-threading constructs.
-// To use it, write:
-//
-// void ThreadFunc(int param) { /* Do things with param */ }
-// Notification thread_can_start;
-// ...
-// // The thread_can_start parameter is optional; you can supply NULL.
-// ThreadWithParam<int> thread(&ThreadFunc, 5, &thread_can_start);
-// thread_can_start.Notify();
-//
-// These classes are only for testing Google Test's own constructs. Do
-// not use them in user tests, either directly or indirectly.
-template <typename T>
-class ThreadWithParam : public ThreadWithParamBase {
- public:
- typedef void (*UserThreadFunc)(T);
-
- ThreadWithParam(
- UserThreadFunc func, T param, Notification* thread_can_start)
- : func_(func),
- param_(param),
- thread_can_start_(thread_can_start),
- finished_(false) {
- ThreadWithParamBase* const base = this;
- // The thread can be created only after all fields except thread_
- // have been initialized.
- GTEST_CHECK_POSIX_SUCCESS_(
- pthread_create(&thread_, 0, &ThreadFuncWithCLinkage, base));
- }
- ~ThreadWithParam() { Join(); }
-
- void Join() {
- if (!finished_) {
- GTEST_CHECK_POSIX_SUCCESS_(pthread_join(thread_, 0));
- finished_ = true;
- }
- }
-
- virtual void Run() {
- if (thread_can_start_ != NULL)
- thread_can_start_->WaitForNotification();
- func_(param_);
- }
-
- private:
- const UserThreadFunc func_; // User-supplied thread function.
- const T param_; // User-supplied parameter to the thread function.
- // When non-NULL, used to block execution until the controller thread
- // notifies.
- Notification* const thread_can_start_;
- bool finished_; // true iff we know that the thread function has finished.
- pthread_t thread_; // The native thread object.
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParam);
-};
-
-// MutexBase and Mutex implement mutex on pthreads-based platforms. They
-// are used in conjunction with class MutexLock:
-//
-// Mutex mutex;
-// ...
-// MutexLock lock(&mutex); // Acquires the mutex and releases it at the end
-// // of the current scope.
-//
-// MutexBase implements behavior for both statically and dynamically
-// allocated mutexes. Do not use MutexBase directly. Instead, write
-// the following to define a static mutex:
-//
-// GTEST_DEFINE_STATIC_MUTEX_(g_some_mutex);
-//
-// You can forward declare a static mutex like this:
-//
-// GTEST_DECLARE_STATIC_MUTEX_(g_some_mutex);
-//
-// To create a dynamic mutex, just define an object of type Mutex.
-class MutexBase {
- public:
- // Acquires this mutex.
- void Lock() {
- GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_lock(&mutex_));
- owner_ = pthread_self();
- has_owner_ = true;
- }
-
- // Releases this mutex.
- void Unlock() {
- // Since the lock is being released the owner_ field should no longer be
- // considered valid. We don't protect writing to has_owner_ here, as it's
- // the caller's responsibility to ensure that the current thread holds the
- // mutex when this is called.
- has_owner_ = false;
- GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_unlock(&mutex_));
- }
-
- // Does nothing if the current thread holds the mutex. Otherwise, crashes
- // with high probability.
- void AssertHeld() const {
- GTEST_CHECK_(has_owner_ && pthread_equal(owner_, pthread_self()))
- << "The current thread is not holding the mutex @" << this;
- }
-
- // A static mutex may be used before main() is entered. It may even
- // be used before the dynamic initialization stage. Therefore we
- // must be able to initialize a static mutex object at link time.
- // This means MutexBase has to be a POD and its member variables
- // have to be public.
- public:
- pthread_mutex_t mutex_; // The underlying pthread mutex.
- // has_owner_ indicates whether the owner_ field below contains a valid thread
- // ID and is therefore safe to inspect (e.g., to use in pthread_equal()). All
- // accesses to the owner_ field should be protected by a check of this field.
- // An alternative might be to memset() owner_ to all zeros, but there's no
- // guarantee that a zero'd pthread_t is necessarily invalid or even different
- // from pthread_self().
- bool has_owner_;
- pthread_t owner_; // The thread holding the mutex.
-};
-
-// Forward-declares a static mutex.
-# define GTEST_DECLARE_STATIC_MUTEX_(mutex) \
- extern ::testing::internal::MutexBase mutex
-
-// Defines and statically (i.e. at link time) initializes a static mutex.
-// The initialization list here does not explicitly initialize each field,
-// instead relying on default initialization for the unspecified fields. In
-// particular, the owner_ field (a pthread_t) is not explicitly initialized.
-// This allows initialization to work whether pthread_t is a scalar or struct.
-// The flag -Wmissing-field-initializers must not be specified for this to work.
-# define GTEST_DEFINE_STATIC_MUTEX_(mutex) \
- ::testing::internal::MutexBase mutex = { PTHREAD_MUTEX_INITIALIZER, false }
-
-// The Mutex class can only be used for mutexes created at runtime. It
-// shares its API with MutexBase otherwise.
-class Mutex : public MutexBase {
- public:
- Mutex() {
- GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL));
- has_owner_ = false;
- }
- ~Mutex() {
- GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_destroy(&mutex_));
- }
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(Mutex);
-};
-
-// We cannot name this class MutexLock as the ctor declaration would
-// conflict with a macro named MutexLock, which is defined on some
-// platforms. Hence the typedef trick below.
-class GTestMutexLock {
- public:
- explicit GTestMutexLock(MutexBase* mutex)
- : mutex_(mutex) { mutex_->Lock(); }
-
- ~GTestMutexLock() { mutex_->Unlock(); }
-
- private:
- MutexBase* const mutex_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestMutexLock);
-};
-
-typedef GTestMutexLock MutexLock;
-
-// Helpers for ThreadLocal.
-
-// pthread_key_create() requires DeleteThreadLocalValue() to have
-// C-linkage. Therefore it cannot be templatized to access
-// ThreadLocal<T>. Hence the need for class
-// ThreadLocalValueHolderBase.
-class ThreadLocalValueHolderBase {
- public:
- virtual ~ThreadLocalValueHolderBase() {}
-};
-
-// Called by pthread to delete thread-local data stored by
-// pthread_setspecific().
-extern "C" inline void DeleteThreadLocalValue(void* value_holder) {
- delete static_cast<ThreadLocalValueHolderBase*>(value_holder);
-}
-
-// Implements thread-local storage on pthreads-based systems.
-//
-// // Thread 1
-// ThreadLocal<int> tl(100); // 100 is the default value for each thread.
-//
-// // Thread 2
-// tl.set(150); // Changes the value for thread 2 only.
-// EXPECT_EQ(150, tl.get());
-//
-// // Thread 1
-// EXPECT_EQ(100, tl.get()); // In thread 1, tl has the original value.
-// tl.set(200);
-// EXPECT_EQ(200, tl.get());
-//
-// The template type argument T must have a public copy constructor.
-// In addition, the default ThreadLocal constructor requires T to have
-// a public default constructor.
-//
-// An object managed for a thread by a ThreadLocal instance is deleted
-// when the thread exits. Or, if the ThreadLocal instance dies in
-// that thread, when the ThreadLocal dies. It's the user's
-// responsibility to ensure that all other threads using a ThreadLocal
-// have exited when it dies, or the per-thread objects for those
-// threads will not be deleted.
-//
-// Google Test only uses global ThreadLocal objects. That means they
-// will die after main() has returned. Therefore, no per-thread
-// object managed by Google Test will be leaked as long as all threads
-// using Google Test have exited when main() returns.
-template <typename T>
-class ThreadLocal {
- public:
- ThreadLocal() : key_(CreateKey()),
- default_() {}
- explicit ThreadLocal(const T& value) : key_(CreateKey()),
- default_(value) {}
-
- ~ThreadLocal() {
- // Destroys the managed object for the current thread, if any.
- DeleteThreadLocalValue(pthread_getspecific(key_));
-
- // Releases resources associated with the key. This will *not*
- // delete managed objects for other threads.
- GTEST_CHECK_POSIX_SUCCESS_(pthread_key_delete(key_));
- }
-
- T* pointer() { return GetOrCreateValue(); }
- const T* pointer() const { return GetOrCreateValue(); }
- const T& get() const { return *pointer(); }
- void set(const T& value) { *pointer() = value; }
-
- private:
- // Holds a value of type T.
- class ValueHolder : public ThreadLocalValueHolderBase {
- public:
- explicit ValueHolder(const T& value) : value_(value) {}
-
- T* pointer() { return &value_; }
-
- private:
- T value_;
- GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolder);
- };
-
- static pthread_key_t CreateKey() {
- pthread_key_t key;
- // When a thread exits, DeleteThreadLocalValue() will be called on
- // the object managed for that thread.
- GTEST_CHECK_POSIX_SUCCESS_(
- pthread_key_create(&key, &DeleteThreadLocalValue));
- return key;
- }
-
- T* GetOrCreateValue() const {
- ThreadLocalValueHolderBase* const holder =
- static_cast<ThreadLocalValueHolderBase*>(pthread_getspecific(key_));
- if (holder != NULL) {
- return CheckedDowncastToActualType<ValueHolder>(holder)->pointer();
- }
-
- ValueHolder* const new_holder = new ValueHolder(default_);
- ThreadLocalValueHolderBase* const holder_base = new_holder;
- GTEST_CHECK_POSIX_SUCCESS_(pthread_setspecific(key_, holder_base));
- return new_holder->pointer();
- }
-
- // A key pthreads uses for looking up per-thread values.
- const pthread_key_t key_;
- const T default_; // The default value for each thread.
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadLocal);
-};
-
-# define GTEST_IS_THREADSAFE 1
-
-#else // GTEST_HAS_PTHREAD
-
-// A dummy implementation of synchronization primitives (mutex, lock,
-// and thread-local variable). Necessary for compiling Google Test where
-// mutex is not supported - using Google Test in multiple threads is not
-// supported on such platforms.
-
-class Mutex {
- public:
- Mutex() {}
- void Lock() {}
- void Unlock() {}
- void AssertHeld() const {}
-};
-
-# define GTEST_DECLARE_STATIC_MUTEX_(mutex) \
- extern ::testing::internal::Mutex mutex
-
-# define GTEST_DEFINE_STATIC_MUTEX_(mutex) ::testing::internal::Mutex mutex
-
-class GTestMutexLock {
- public:
- explicit GTestMutexLock(Mutex*) {} // NOLINT
-};
-
-typedef GTestMutexLock MutexLock;
-
-template <typename T>
-class ThreadLocal {
- public:
- ThreadLocal() : value_() {}
- explicit ThreadLocal(const T& value) : value_(value) {}
- T* pointer() { return &value_; }
- const T* pointer() const { return &value_; }
- const T& get() const { return value_; }
- void set(const T& value) { value_ = value; }
- private:
- T value_;
-};
-
-// The above synchronization primitives have dummy implementations.
-// Therefore Google Test is not thread-safe.
-# define GTEST_IS_THREADSAFE 0
-
-#endif // GTEST_HAS_PTHREAD
-
-// Returns the number of threads running in the process, or 0 to indicate that
-// we cannot detect it.
-GTEST_API_ size_t GetThreadCount();
-
-// Passing non-POD classes through ellipsis (...) crashes the ARM
-// compiler and generates a warning in Sun Studio. The Nokia Symbian
-// and the IBM XL C/C++ compiler try to instantiate a copy constructor
-// for objects passed through ellipsis (...), failing for uncopyable
-// objects. We define this to ensure that only POD is passed through
-// ellipsis on these systems.
-#if defined(__SYMBIAN32__) || defined(__IBMCPP__) || defined(__SUNPRO_CC)
-// We lose support for NULL detection where the compiler doesn't like
-// passing non-POD classes through ellipsis (...).
-# define GTEST_ELLIPSIS_NEEDS_POD_ 1
-#else
-# define GTEST_CAN_COMPARE_NULL 1
-#endif
-
-// The Nokia Symbian and IBM XL C/C++ compilers cannot decide between
-// const T& and const T* in a function template. These compilers
-// _can_ decide between class template specializations for T and T*,
-// so a tr1::type_traits-like is_pointer works.
-#if defined(__SYMBIAN32__) || defined(__IBMCPP__)
-# define GTEST_NEEDS_IS_POINTER_ 1
-#endif
-
-template <bool bool_value>
-struct bool_constant {
- typedef bool_constant<bool_value> type;
- static const bool value = bool_value;
-};
-template <bool bool_value> const bool bool_constant<bool_value>::value;
-
-typedef bool_constant<false> false_type;
-typedef bool_constant<true> true_type;
-
-template <typename T>
-struct is_pointer : public false_type {};
-
-template <typename T>
-struct is_pointer<T*> : public true_type {};
-
-template <typename Iterator>
-struct IteratorTraits {
- typedef typename Iterator::value_type value_type;
-};
-
-template <typename T>
-struct IteratorTraits<T*> {
- typedef T value_type;
-};
-
-template <typename T>
-struct IteratorTraits<const T*> {
- typedef T value_type;
-};
-
-#if GTEST_OS_WINDOWS
-# define GTEST_PATH_SEP_ "\\"
-# define GTEST_HAS_ALT_PATH_SEP_ 1
-// The biggest signed integer type the compiler supports.
-typedef __int64 BiggestInt;
-#else
-# define GTEST_PATH_SEP_ "/"
-# define GTEST_HAS_ALT_PATH_SEP_ 0
-typedef long long BiggestInt; // NOLINT
-#endif // GTEST_OS_WINDOWS
-
-// Utilities for char.
-
-// isspace(int ch) and friends accept an unsigned char or EOF. char
-// may be signed, depending on the compiler (or compiler flags).
-// Therefore we need to cast a char to unsigned char before calling
-// isspace(), etc.
-
-inline bool IsAlpha(char ch) {
- return isalpha(static_cast<unsigned char>(ch)) != 0;
-}
-inline bool IsAlNum(char ch) {
- return isalnum(static_cast<unsigned char>(ch)) != 0;
-}
-inline bool IsDigit(char ch) {
- return isdigit(static_cast<unsigned char>(ch)) != 0;
-}
-inline bool IsLower(char ch) {
- return islower(static_cast<unsigned char>(ch)) != 0;
-}
-inline bool IsSpace(char ch) {
- return isspace(static_cast<unsigned char>(ch)) != 0;
-}
-inline bool IsUpper(char ch) {
- return isupper(static_cast<unsigned char>(ch)) != 0;
-}
-inline bool IsXDigit(char ch) {
- return isxdigit(static_cast<unsigned char>(ch)) != 0;
-}
-
-inline char ToLower(char ch) {
- return static_cast<char>(tolower(static_cast<unsigned char>(ch)));
-}
-inline char ToUpper(char ch) {
- return static_cast<char>(toupper(static_cast<unsigned char>(ch)));
-}
-
-// The testing::internal::posix namespace holds wrappers for common
-// POSIX functions. These wrappers hide the differences between
-// Windows/MSVC and POSIX systems. Since some compilers define these
-// standard functions as macros, the wrapper cannot have the same name
-// as the wrapped function.
-
-namespace posix {
-
-// Functions with a different name on Windows.
-
-#if GTEST_OS_WINDOWS
-
-typedef struct _stat StatStruct;
-
-# ifdef __BORLANDC__
-inline int IsATTY(int fd) { return isatty(fd); }
-inline int StrCaseCmp(const char* s1, const char* s2) {
- return stricmp(s1, s2);
-}
-inline char* StrDup(const char* src) { return strdup(src); }
-# else // !__BORLANDC__
-# if GTEST_OS_WINDOWS_MOBILE
-inline int IsATTY(int /* fd */) { return 0; }
-# else
-inline int IsATTY(int fd) { return _isatty(fd); }
-# endif // GTEST_OS_WINDOWS_MOBILE
-inline int StrCaseCmp(const char* s1, const char* s2) {
- return _stricmp(s1, s2);
-}
-inline char* StrDup(const char* src) { return _strdup(src); }
-# endif // __BORLANDC__
-
-# if GTEST_OS_WINDOWS_MOBILE
-inline int FileNo(FILE* file) { return reinterpret_cast<int>(_fileno(file)); }
-// Stat(), RmDir(), and IsDir() are not needed on Windows CE at this
-// time and thus not defined there.
-# else
-inline int FileNo(FILE* file) { return _fileno(file); }
-inline int Stat(const char* path, StatStruct* buf) { return _stat(path, buf); }
-inline int RmDir(const char* dir) { return _rmdir(dir); }
-inline bool IsDir(const StatStruct& st) {
- return (_S_IFDIR & st.st_mode) != 0;
-}
-# endif // GTEST_OS_WINDOWS_MOBILE
-
-#else
-
-typedef struct stat StatStruct;
-
-inline int FileNo(FILE* file) { return fileno(file); }
-inline int IsATTY(int fd) { return isatty(fd); }
-inline int Stat(const char* path, StatStruct* buf) { return stat(path, buf); }
-inline int StrCaseCmp(const char* s1, const char* s2) {
- return strcasecmp(s1, s2);
-}
-inline char* StrDup(const char* src) { return strdup(src); }
-inline int RmDir(const char* dir) { return rmdir(dir); }
-inline bool IsDir(const StatStruct& st) { return S_ISDIR(st.st_mode); }
-
-#endif // GTEST_OS_WINDOWS
-
-// Functions deprecated by MSVC 8.0.
-
-#ifdef _MSC_VER
-// Temporarily disable warning 4996 (deprecated function).
-# pragma warning(push)
-# pragma warning(disable:4996)
-#endif
-
-inline const char* StrNCpy(char* dest, const char* src, size_t n) {
- return strncpy(dest, src, n);
-}
-
-// ChDir(), FReopen(), FDOpen(), Read(), Write(), Close(), and
-// StrError() aren't needed on Windows CE at this time and thus not
-// defined there.
-
-#if !GTEST_OS_WINDOWS_MOBILE
-inline int ChDir(const char* dir) { return chdir(dir); }
-#endif
-inline FILE* FOpen(const char* path, const char* mode) {
- return fopen(path, mode);
-}
-#if !GTEST_OS_WINDOWS_MOBILE
-inline FILE *FReopen(const char* path, const char* mode, FILE* stream) {
- return freopen(path, mode, stream);
-}
-inline FILE* FDOpen(int fd, const char* mode) { return fdopen(fd, mode); }
-#endif
-inline int FClose(FILE* fp) { return fclose(fp); }
-#if !GTEST_OS_WINDOWS_MOBILE
-inline int Read(int fd, void* buf, unsigned int count) {
- return static_cast<int>(read(fd, buf, count));
-}
-inline int Write(int fd, const void* buf, unsigned int count) {
- return static_cast<int>(write(fd, buf, count));
-}
-inline int Close(int fd) { return close(fd); }
-inline const char* StrError(int errnum) { return strerror(errnum); }
-#endif
-inline const char* GetEnv(const char* name) {
-#if GTEST_OS_WINDOWS_MOBILE
- // We are on Windows CE, which has no environment variables.
- return NULL;
-#elif defined(__BORLANDC__) || defined(__SunOS_5_8) || defined(__SunOS_5_9)
- // Environment variables which we programmatically clear will be set to the
- // empty string rather than unset (NULL). Handle that case.
- const char* const env = getenv(name);
- return (env != NULL && env[0] != '\0') ? env : NULL;
-#else
- return getenv(name);
-#endif
-}
-
-#ifdef _MSC_VER
-# pragma warning(pop) // Restores the warning state.
-#endif
-
-#if GTEST_OS_WINDOWS_MOBILE
-// Windows CE has no C library. The abort() function is used in
-// several places in Google Test. This implementation provides a reasonable
-// imitation of standard behaviour.
-void Abort();
-#else
-inline void Abort() { abort(); }
-#endif // GTEST_OS_WINDOWS_MOBILE
-
-} // namespace posix
-
-// MSVC "deprecates" snprintf and issues warnings wherever it is used. In
-// order to avoid these warnings, we need to use _snprintf or _snprintf_s on
-// MSVC-based platforms. We map the GTEST_SNPRINTF_ macro to the appropriate
-// function in order to achieve that. We use macro definition here because
-// snprintf is a variadic function.
-#if _MSC_VER >= 1400 && !GTEST_OS_WINDOWS_MOBILE
-// MSVC 2005 and above support variadic macros.
-# define GTEST_SNPRINTF_(buffer, size, format, ...) \
- _snprintf_s(buffer, size, size, format, __VA_ARGS__)
-#elif defined(_MSC_VER)
-// Windows CE does not define _snprintf_s and MSVC prior to 2005 doesn't
-// complain about _snprintf.
-# define GTEST_SNPRINTF_ _snprintf
-#else
-# define GTEST_SNPRINTF_ snprintf
-#endif
-
-// The maximum number a BiggestInt can represent. This definition
-// works no matter BiggestInt is represented in one's complement or
-// two's complement.
-//
-// We cannot rely on numeric_limits in STL, as __int64 and long long
-// are not part of standard C++ and numeric_limits doesn't need to be
-// defined for them.
-const BiggestInt kMaxBiggestInt =
- ~(static_cast<BiggestInt>(1) << (8*sizeof(BiggestInt) - 1));
-
-// This template class serves as a compile-time function from size to
-// type. It maps a size in bytes to a primitive type with that
-// size. e.g.
-//
-// TypeWithSize<4>::UInt
-//
-// is typedef-ed to be unsigned int (unsigned integer made up of 4
-// bytes).
-//
-// Such functionality should belong to STL, but I cannot find it
-// there.
-//
-// Google Test uses this class in the implementation of floating-point
-// comparison.
-//
-// For now it only handles UInt (unsigned int) as that's all Google Test
-// needs. Other types can be easily added in the future if need
-// arises.
-template <size_t size>
-class TypeWithSize {
- public:
- // This prevents the user from using TypeWithSize<N> with incorrect
- // values of N.
- typedef void UInt;
-};
-
-// The specialization for size 4.
-template <>
-class TypeWithSize<4> {
- public:
- // unsigned int has size 4 in both gcc and MSVC.
- //
- // As base/basictypes.h doesn't compile on Windows, we cannot use
- // uint32, uint64, and etc here.
- typedef int Int;
- typedef unsigned int UInt;
-};
-
-// The specialization for size 8.
-template <>
-class TypeWithSize<8> {
- public:
-#if GTEST_OS_WINDOWS
- typedef __int64 Int;
- typedef unsigned __int64 UInt;
-#else
- typedef long long Int; // NOLINT
- typedef unsigned long long UInt; // NOLINT
-#endif // GTEST_OS_WINDOWS
-};
-
-// Integer types of known sizes.
-typedef TypeWithSize<4>::Int Int32;
-typedef TypeWithSize<4>::UInt UInt32;
-typedef TypeWithSize<8>::Int Int64;
-typedef TypeWithSize<8>::UInt UInt64;
-typedef TypeWithSize<8>::Int TimeInMillis; // Represents time in milliseconds.
-
-// Utilities for command line flags and environment variables.
-
-// Macro for referencing flags.
-#define GTEST_FLAG(name) FLAGS_gtest_##name
-
-// Macros for declaring flags.
-#define GTEST_DECLARE_bool_(name) GTEST_API_ extern bool GTEST_FLAG(name)
-#define GTEST_DECLARE_int32_(name) \
- GTEST_API_ extern ::testing::internal::Int32 GTEST_FLAG(name)
-#define GTEST_DECLARE_string_(name) \
- GTEST_API_ extern ::testing::internal::String GTEST_FLAG(name)
-
-// Macros for defining flags.
-#define GTEST_DEFINE_bool_(name, default_val, doc) \
- GTEST_API_ bool GTEST_FLAG(name) = (default_val)
-#define GTEST_DEFINE_int32_(name, default_val, doc) \
- GTEST_API_ ::testing::internal::Int32 GTEST_FLAG(name) = (default_val)
-#define GTEST_DEFINE_string_(name, default_val, doc) \
- GTEST_API_ ::testing::internal::String GTEST_FLAG(name) = (default_val)
-
-// Thread annotations
-#define GTEST_EXCLUSIVE_LOCK_REQUIRED_(locks)
-#define GTEST_LOCK_EXCLUDED_(locks)
-
-// Parses 'str' for a 32-bit signed integer. If successful, writes the result
-// to *value and returns true; otherwise leaves *value unchanged and returns
-// false.
-// TODO(chandlerc): Find a better way to refactor flag and environment parsing
-// out of both gtest-port.cc and gtest.cc to avoid exporting this utility
-// function.
-bool ParseInt32(const Message& src_text, const char* str, Int32* value);
-
-// Parses a bool/Int32/string from the environment variable
-// corresponding to the given Google Test flag.
-bool BoolFromGTestEnv(const char* flag, bool default_val);
-GTEST_API_ Int32 Int32FromGTestEnv(const char* flag, Int32 default_val);
-const char* StringFromGTestEnv(const char* flag, const char* default_val);
-
-} // namespace internal
-} // namespace testing
-
-#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
diff --git a/src/testing/gtest/include/gtest/internal/gtest-string.h b/src/testing/gtest/include/gtest/internal/gtest-string.h
deleted file mode 100644
index a9024508..00000000
--- a/src/testing/gtest/include/gtest/internal/gtest-string.h
+++ /dev/null
@@ -1,350 +0,0 @@
-// Copyright 2005, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee)
-//
-// The Google C++ Testing Framework (Google Test)
-//
-// This header file declares the String class and functions used internally by
-// Google Test. They are subject to change without notice. They should not used
-// by code external to Google Test.
-//
-// This header file is #included by <gtest/internal/gtest-internal.h>.
-// It should not be #included by other files.
-
-#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
-#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
-
-#ifdef __BORLANDC__
-// string.h is not guaranteed to provide strcpy on C++ Builder.
-# include <mem.h>
-#endif
-
-#include <string.h>
-#include <string>
-
-#include "gtest/internal/gtest-port.h"
-
-namespace testing {
-namespace internal {
-
-// String - a UTF-8 string class.
-//
-// For historic reasons, we don't use std::string.
-//
-// TODO(wan@google.com): replace this class with std::string or
-// implement it in terms of the latter.
-//
-// Note that String can represent both NULL and the empty string,
-// while std::string cannot represent NULL.
-//
-// NULL and the empty string are considered different. NULL is less
-// than anything (including the empty string) except itself.
-//
-// This class only provides minimum functionality necessary for
-// implementing Google Test. We do not intend to implement a full-fledged
-// string class here.
-//
-// Since the purpose of this class is to provide a substitute for
-// std::string on platforms where it cannot be used, we define a copy
-// constructor and assignment operators such that we don't need
-// conditional compilation in a lot of places.
-//
-// In order to make the representation efficient, the d'tor of String
-// is not virtual. Therefore DO NOT INHERIT FROM String.
-class GTEST_API_ String {
- public:
- // Static utility methods
-
- // Returns the input enclosed in double quotes if it's not NULL;
- // otherwise returns "(null)". For example, "\"Hello\"" is returned
- // for input "Hello".
- //
- // This is useful for printing a C string in the syntax of a literal.
- //
- // Known issue: escape sequences are not handled yet.
- static String ShowCStringQuoted(const char* c_str);
-
- // Clones a 0-terminated C string, allocating memory using new. The
- // caller is responsible for deleting the return value using
- // delete[]. Returns the cloned string, or NULL if the input is
- // NULL.
- //
- // This is different from strdup() in string.h, which allocates
- // memory using malloc().
- static const char* CloneCString(const char* c_str);
-
-#if GTEST_OS_WINDOWS_MOBILE
- // Windows CE does not have the 'ANSI' versions of Win32 APIs. To be
- // able to pass strings to Win32 APIs on CE we need to convert them
- // to 'Unicode', UTF-16.
-
- // Creates a UTF-16 wide string from the given ANSI string, allocating
- // memory using new. The caller is responsible for deleting the return
- // value using delete[]. Returns the wide string, or NULL if the
- // input is NULL.
- //
- // The wide string is created using the ANSI codepage (CP_ACP) to
- // match the behaviour of the ANSI versions of Win32 calls and the
- // C runtime.
- static LPCWSTR AnsiToUtf16(const char* c_str);
-
- // Creates an ANSI string from the given wide string, allocating
- // memory using new. The caller is responsible for deleting the return
- // value using delete[]. Returns the ANSI string, or NULL if the
- // input is NULL.
- //
- // The returned string is created using the ANSI codepage (CP_ACP) to
- // match the behaviour of the ANSI versions of Win32 calls and the
- // C runtime.
- static const char* Utf16ToAnsi(LPCWSTR utf16_str);
-#endif
-
- // Compares two C strings. Returns true iff they have the same content.
- //
- // Unlike strcmp(), this function can handle NULL argument(s). A
- // NULL C string is considered different to any non-NULL C string,
- // including the empty string.
- static bool CStringEquals(const char* lhs, const char* rhs);
-
- // Converts a wide C string to a String using the UTF-8 encoding.
- // NULL will be converted to "(null)". If an error occurred during
- // the conversion, "(failed to convert from wide string)" is
- // returned.
- static String ShowWideCString(const wchar_t* wide_c_str);
-
- // Similar to ShowWideCString(), except that this function encloses
- // the converted string in double quotes.
- static String ShowWideCStringQuoted(const wchar_t* wide_c_str);
-
- // Compares two wide C strings. Returns true iff they have the same
- // content.
- //
- // Unlike wcscmp(), this function can handle NULL argument(s). A
- // NULL C string is considered different to any non-NULL C string,
- // including the empty string.
- static bool WideCStringEquals(const wchar_t* lhs, const wchar_t* rhs);
-
- // Compares two C strings, ignoring case. Returns true iff they
- // have the same content.
- //
- // Unlike strcasecmp(), this function can handle NULL argument(s).
- // A NULL C string is considered different to any non-NULL C string,
- // including the empty string.
- static bool CaseInsensitiveCStringEquals(const char* lhs,
- const char* rhs);
-
- // Compares two wide C strings, ignoring case. Returns true iff they
- // have the same content.
- //
- // Unlike wcscasecmp(), this function can handle NULL argument(s).
- // A NULL C string is considered different to any non-NULL wide C string,
- // including the empty string.
- // NB: The implementations on different platforms slightly differ.
- // On windows, this method uses _wcsicmp which compares according to LC_CTYPE
- // environment variable. On GNU platform this method uses wcscasecmp
- // which compares according to LC_CTYPE category of the current locale.
- // On MacOS X, it uses towlower, which also uses LC_CTYPE category of the
- // current locale.
- static bool CaseInsensitiveWideCStringEquals(const wchar_t* lhs,
- const wchar_t* rhs);
-
- // Formats a list of arguments to a String, using the same format
- // spec string as for printf.
- //
- // We do not use the StringPrintf class as it is not universally
- // available.
- //
- // The result is limited to 4096 characters (including the tailing
- // 0). If 4096 characters are not enough to format the input,
- // "<buffer exceeded>" is returned.
- static String Format(const char* format, ...);
-
- // C'tors
-
- // The default c'tor constructs a NULL string.
- String() : c_str_(NULL), length_(0) {}
-
- // Constructs a String by cloning a 0-terminated C string.
- String(const char* a_c_str) { // NOLINT
- if (a_c_str == NULL) {
- c_str_ = NULL;
- length_ = 0;
- } else {
- ConstructNonNull(a_c_str, strlen(a_c_str));
- }
- }
-
- // Constructs a String by copying a given number of chars from a
- // buffer. E.g. String("hello", 3) creates the string "hel",
- // String("a\0bcd", 4) creates "a\0bc", String(NULL, 0) creates "",
- // and String(NULL, 1) results in access violation.
- String(const char* buffer, size_t a_length) {
- ConstructNonNull(buffer, a_length);
- }
-
- // The copy c'tor creates a new copy of the string. The two
- // String objects do not share content.
- String(const String& str) : c_str_(NULL), length_(0) { *this = str; }
-
- // D'tor. String is intended to be a final class, so the d'tor
- // doesn't need to be virtual.
- ~String() { delete[] c_str_; }
-
- // Allows a String to be implicitly converted to an ::std::string or
- // ::string, and vice versa. Converting a String containing a NULL
- // pointer to ::std::string or ::string is undefined behavior.
- // Converting a ::std::string or ::string containing an embedded NUL
- // character to a String will result in the prefix up to the first
- // NUL character.
- String(const ::std::string& str) { // NOLINT
- ConstructNonNull(str.c_str(), str.length());
- }
-
- operator ::std::string() const { return ::std::string(c_str(), length()); }
-
-#if GTEST_HAS_GLOBAL_STRING
- String(const ::string& str) { // NOLINT
- ConstructNonNull(str.c_str(), str.length());
- }
-
- operator ::string() const { return ::string(c_str(), length()); }
-#endif // GTEST_HAS_GLOBAL_STRING
-
- // Returns true iff this is an empty string (i.e. "").
- bool empty() const { return (c_str() != NULL) && (length() == 0); }
-
- // Compares this with another String.
- // Returns < 0 if this is less than rhs, 0 if this is equal to rhs, or > 0
- // if this is greater than rhs.
- int Compare(const String& rhs) const;
-
- // Returns true iff this String equals the given C string. A NULL
- // string and a non-NULL string are considered not equal.
- bool operator==(const char* a_c_str) const { return Compare(a_c_str) == 0; }
-
- // Returns true iff this String is less than the given String. A
- // NULL string is considered less than "".
- bool operator<(const String& rhs) const { return Compare(rhs) < 0; }
-
- // Returns true iff this String doesn't equal the given C string. A NULL
- // string and a non-NULL string are considered not equal.
- bool operator!=(const char* a_c_str) const { return !(*this == a_c_str); }
-
- // Returns true iff this String ends with the given suffix. *Any*
- // String is considered to end with a NULL or empty suffix.
- bool EndsWith(const char* suffix) const;
-
- // Returns true iff this String ends with the given suffix, not considering
- // case. Any String is considered to end with a NULL or empty suffix.
- bool EndsWithCaseInsensitive(const char* suffix) const;
-
- // Returns the length of the encapsulated string, or 0 if the
- // string is NULL.
- size_t length() const { return length_; }
-
- // Gets the 0-terminated C string this String object represents.
- // The String object still owns the string. Therefore the caller
- // should NOT delete the return value.
- const char* c_str() const { return c_str_; }
-
- // Assigns a C string to this object. Self-assignment works.
- const String& operator=(const char* a_c_str) {
- return *this = String(a_c_str);
- }
-
- // Assigns a String object to this object. Self-assignment works.
- const String& operator=(const String& rhs) {
- if (this != &rhs) {
- delete[] c_str_;
- if (rhs.c_str() == NULL) {
- c_str_ = NULL;
- length_ = 0;
- } else {
- ConstructNonNull(rhs.c_str(), rhs.length());
- }
- }
-
- return *this;
- }
-
- private:
- // Constructs a non-NULL String from the given content. This
- // function can only be called when c_str_ has not been allocated.
- // ConstructNonNull(NULL, 0) results in an empty string ("").
- // ConstructNonNull(NULL, non_zero) is undefined behavior.
- void ConstructNonNull(const char* buffer, size_t a_length) {
- char* const str = new char[a_length + 1];
- memcpy(str, buffer, a_length);
- str[a_length] = '\0';
- c_str_ = str;
- length_ = a_length;
- }
-
- const char* c_str_;
- size_t length_;
-}; // class String
-
-// Streams a String to an ostream. Each '\0' character in the String
-// is replaced with "\\0".
-inline ::std::ostream& operator<<(::std::ostream& os, const String& str) {
- if (str.c_str() == NULL) {
- os << "(null)";
- } else {
- const char* const c_str = str.c_str();
- for (size_t i = 0; i != str.length(); i++) {
- if (c_str[i] == '\0') {
- os << "\\0";
- } else {
- os << c_str[i];
- }
- }
- }
- return os;
-}
-
-// Gets the content of the stringstream's buffer as a String. Each '\0'
-// character in the buffer is replaced with "\\0".
-GTEST_API_ String StringStreamToString(::std::stringstream* stream);
-
-// Converts a streamable value to a String. A NULL pointer is
-// converted to "(null)". When the input value is a ::string,
-// ::std::string, ::wstring, or ::std::wstring object, each NUL
-// character in it is replaced with "\\0".
-
-// Declared here but defined in gtest.h, so that it has access
-// to the definition of the Message class, required by the ARM
-// compiler.
-template <typename T>
-String StreamableToString(const T& streamable);
-
-} // namespace internal
-} // namespace testing
-
-#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
diff --git a/src/testing/gtest/include/gtest/internal/gtest-tuple.h b/src/testing/gtest/include/gtest/internal/gtest-tuple.h
deleted file mode 100644
index 399e84d7..00000000
--- a/src/testing/gtest/include/gtest/internal/gtest-tuple.h
+++ /dev/null
@@ -1,1012 +0,0 @@
-// This file was GENERATED by command:
-// pump.py gtest-tuple.h.pump
-// DO NOT EDIT BY HAND!!!
-
-// Copyright 2009 Google Inc.
-// All Rights Reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-// Implements a subset of TR1 tuple needed by Google Test and Google Mock.
-
-#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
-#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
-
-#include <utility> // For ::std::pair.
-
-// The compiler used in Symbian has a bug that prevents us from declaring the
-// tuple template as a friend (it complains that tuple is redefined). This
-// hack bypasses the bug by declaring the members that should otherwise be
-// private as public.
-// Sun Studio versions < 12 also have the above bug.
-#if defined(__SYMBIAN32__) || (defined(__SUNPRO_CC) && __SUNPRO_CC < 0x590)
-# define GTEST_DECLARE_TUPLE_AS_FRIEND_ public:
-#else
-# define GTEST_DECLARE_TUPLE_AS_FRIEND_ \
- template <GTEST_10_TYPENAMES_(U)> friend class tuple; \
- private:
-#endif
-
-// GTEST_n_TUPLE_(T) is the type of an n-tuple.
-#define GTEST_0_TUPLE_(T) tuple<>
-#define GTEST_1_TUPLE_(T) tuple<T##0, void, void, void, void, void, void, \
- void, void, void>
-#define GTEST_2_TUPLE_(T) tuple<T##0, T##1, void, void, void, void, void, \
- void, void, void>
-#define GTEST_3_TUPLE_(T) tuple<T##0, T##1, T##2, void, void, void, void, \
- void, void, void>
-#define GTEST_4_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, void, void, void, \
- void, void, void>
-#define GTEST_5_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, void, void, \
- void, void, void>
-#define GTEST_6_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, void, \
- void, void, void>
-#define GTEST_7_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
- void, void, void>
-#define GTEST_8_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
- T##7, void, void>
-#define GTEST_9_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
- T##7, T##8, void>
-#define GTEST_10_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
- T##7, T##8, T##9>
-
-// GTEST_n_TYPENAMES_(T) declares a list of n typenames.
-#define GTEST_0_TYPENAMES_(T)
-#define GTEST_1_TYPENAMES_(T) typename T##0
-#define GTEST_2_TYPENAMES_(T) typename T##0, typename T##1
-#define GTEST_3_TYPENAMES_(T) typename T##0, typename T##1, typename T##2
-#define GTEST_4_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
- typename T##3
-#define GTEST_5_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
- typename T##3, typename T##4
-#define GTEST_6_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
- typename T##3, typename T##4, typename T##5
-#define GTEST_7_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
- typename T##3, typename T##4, typename T##5, typename T##6
-#define GTEST_8_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
- typename T##3, typename T##4, typename T##5, typename T##6, typename T##7
-#define GTEST_9_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
- typename T##3, typename T##4, typename T##5, typename T##6, \
- typename T##7, typename T##8
-#define GTEST_10_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
- typename T##3, typename T##4, typename T##5, typename T##6, \
- typename T##7, typename T##8, typename T##9
-
-// In theory, defining stuff in the ::std namespace is undefined
-// behavior. We can do this as we are playing the role of a standard
-// library vendor.
-namespace std {
-namespace tr1 {
-
-template <typename T0 = void, typename T1 = void, typename T2 = void,
- typename T3 = void, typename T4 = void, typename T5 = void,
- typename T6 = void, typename T7 = void, typename T8 = void,
- typename T9 = void>
-class tuple;
-
-// Anything in namespace gtest_internal is Google Test's INTERNAL
-// IMPLEMENTATION DETAIL and MUST NOT BE USED DIRECTLY in user code.
-namespace gtest_internal {
-
-// ByRef<T>::type is T if T is a reference; otherwise it's const T&.
-template <typename T>
-struct ByRef { typedef const T& type; }; // NOLINT
-template <typename T>
-struct ByRef<T&> { typedef T& type; }; // NOLINT
-
-// A handy wrapper for ByRef.
-#define GTEST_BY_REF_(T) typename ::std::tr1::gtest_internal::ByRef<T>::type
-
-// AddRef<T>::type is T if T is a reference; otherwise it's T&. This
-// is the same as tr1::add_reference<T>::type.
-template <typename T>
-struct AddRef { typedef T& type; }; // NOLINT
-template <typename T>
-struct AddRef<T&> { typedef T& type; }; // NOLINT
-
-// A handy wrapper for AddRef.
-#define GTEST_ADD_REF_(T) typename ::std::tr1::gtest_internal::AddRef<T>::type
-
-// A helper for implementing get<k>().
-template <int k> class Get;
-
-// A helper for implementing tuple_element<k, T>. kIndexValid is true
-// iff k < the number of fields in tuple type T.
-template <bool kIndexValid, int kIndex, class Tuple>
-struct TupleElement;
-
-template <GTEST_10_TYPENAMES_(T)>
-struct TupleElement<true, 0, GTEST_10_TUPLE_(T)> {
- typedef T0 type;
-};
-
-template <GTEST_10_TYPENAMES_(T)>
-struct TupleElement<true, 1, GTEST_10_TUPLE_(T)> {
- typedef T1 type;
-};
-
-template <GTEST_10_TYPENAMES_(T)>
-struct TupleElement<true, 2, GTEST_10_TUPLE_(T)> {
- typedef T2 type;
-};
-
-template <GTEST_10_TYPENAMES_(T)>
-struct TupleElement<true, 3, GTEST_10_TUPLE_(T)> {
- typedef T3 type;
-};
-
-template <GTEST_10_TYPENAMES_(T)>
-struct TupleElement<true, 4, GTEST_10_TUPLE_(T)> {
- typedef T4 type;
-};
-
-template <GTEST_10_TYPENAMES_(T)>
-struct TupleElement<true, 5, GTEST_10_TUPLE_(T)> {
- typedef T5 type;
-};
-
-template <GTEST_10_TYPENAMES_(T)>
-struct TupleElement<true, 6, GTEST_10_TUPLE_(T)> {
- typedef T6 type;
-};
-
-template <GTEST_10_TYPENAMES_(T)>
-struct TupleElement<true, 7, GTEST_10_TUPLE_(T)> {
- typedef T7 type;
-};
-
-template <GTEST_10_TYPENAMES_(T)>
-struct TupleElement<true, 8, GTEST_10_TUPLE_(T)> {
- typedef T8 type;
-};
-
-template <GTEST_10_TYPENAMES_(T)>
-struct TupleElement<true, 9, GTEST_10_TUPLE_(T)> {
- typedef T9 type;
-};
-
-} // namespace gtest_internal
-
-template <>
-class tuple<> {
- public:
- tuple() {}
- tuple(const tuple& /* t */) {}
- tuple& operator=(const tuple& /* t */) { return *this; }
-};
-
-template <GTEST_1_TYPENAMES_(T)>
-class GTEST_1_TUPLE_(T) {
- public:
- template <int k> friend class gtest_internal::Get;
-
- tuple() : f0_() {}
-
- explicit tuple(GTEST_BY_REF_(T0) f0) : f0_(f0) {}
-
- tuple(const tuple& t) : f0_(t.f0_) {}
-
- template <GTEST_1_TYPENAMES_(U)>
- tuple(const GTEST_1_TUPLE_(U)& t) : f0_(t.f0_) {}
-
- tuple& operator=(const tuple& t) { return CopyFrom(t); }
-
- template <GTEST_1_TYPENAMES_(U)>
- tuple& operator=(const GTEST_1_TUPLE_(U)& t) {
- return CopyFrom(t);
- }
-
- GTEST_DECLARE_TUPLE_AS_FRIEND_
-
- template <GTEST_1_TYPENAMES_(U)>
- tuple& CopyFrom(const GTEST_1_TUPLE_(U)& t) {
- f0_ = t.f0_;
- return *this;
- }
-
- T0 f0_;
-};
-
-template <GTEST_2_TYPENAMES_(T)>
-class GTEST_2_TUPLE_(T) {
- public:
- template <int k> friend class gtest_internal::Get;
-
- tuple() : f0_(), f1_() {}
-
- explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1) : f0_(f0),
- f1_(f1) {}
-
- tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_) {}
-
- template <GTEST_2_TYPENAMES_(U)>
- tuple(const GTEST_2_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_) {}
- template <typename U0, typename U1>
- tuple(const ::std::pair<U0, U1>& p) : f0_(p.first), f1_(p.second) {}
-
- tuple& operator=(const tuple& t) { return CopyFrom(t); }
-
- template <GTEST_2_TYPENAMES_(U)>
- tuple& operator=(const GTEST_2_TUPLE_(U)& t) {
- return CopyFrom(t);
- }
- template <typename U0, typename U1>
- tuple& operator=(const ::std::pair<U0, U1>& p) {
- f0_ = p.first;
- f1_ = p.second;
- return *this;
- }
-
- GTEST_DECLARE_TUPLE_AS_FRIEND_
-
- template <GTEST_2_TYPENAMES_(U)>
- tuple& CopyFrom(const GTEST_2_TUPLE_(U)& t) {
- f0_ = t.f0_;
- f1_ = t.f1_;
- return *this;
- }
-
- T0 f0_;
- T1 f1_;
-};
-
-template <GTEST_3_TYPENAMES_(T)>
-class GTEST_3_TUPLE_(T) {
- public:
- template <int k> friend class gtest_internal::Get;
-
- tuple() : f0_(), f1_(), f2_() {}
-
- explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
- GTEST_BY_REF_(T2) f2) : f0_(f0), f1_(f1), f2_(f2) {}
-
- tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_) {}
-
- template <GTEST_3_TYPENAMES_(U)>
- tuple(const GTEST_3_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_) {}
-
- tuple& operator=(const tuple& t) { return CopyFrom(t); }
-
- template <GTEST_3_TYPENAMES_(U)>
- tuple& operator=(const GTEST_3_TUPLE_(U)& t) {
- return CopyFrom(t);
- }
-
- GTEST_DECLARE_TUPLE_AS_FRIEND_
-
- template <GTEST_3_TYPENAMES_(U)>
- tuple& CopyFrom(const GTEST_3_TUPLE_(U)& t) {
- f0_ = t.f0_;
- f1_ = t.f1_;
- f2_ = t.f2_;
- return *this;
- }
-
- T0 f0_;
- T1 f1_;
- T2 f2_;
-};
-
-template <GTEST_4_TYPENAMES_(T)>
-class GTEST_4_TUPLE_(T) {
- public:
- template <int k> friend class gtest_internal::Get;
-
- tuple() : f0_(), f1_(), f2_(), f3_() {}
-
- explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
- GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3) : f0_(f0), f1_(f1), f2_(f2),
- f3_(f3) {}
-
- tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_) {}
-
- template <GTEST_4_TYPENAMES_(U)>
- tuple(const GTEST_4_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
- f3_(t.f3_) {}
-
- tuple& operator=(const tuple& t) { return CopyFrom(t); }
-
- template <GTEST_4_TYPENAMES_(U)>
- tuple& operator=(const GTEST_4_TUPLE_(U)& t) {
- return CopyFrom(t);
- }
-
- GTEST_DECLARE_TUPLE_AS_FRIEND_
-
- template <GTEST_4_TYPENAMES_(U)>
- tuple& CopyFrom(const GTEST_4_TUPLE_(U)& t) {
- f0_ = t.f0_;
- f1_ = t.f1_;
- f2_ = t.f2_;
- f3_ = t.f3_;
- return *this;
- }
-
- T0 f0_;
- T1 f1_;
- T2 f2_;
- T3 f3_;
-};
-
-template <GTEST_5_TYPENAMES_(T)>
-class GTEST_5_TUPLE_(T) {
- public:
- template <int k> friend class gtest_internal::Get;
-
- tuple() : f0_(), f1_(), f2_(), f3_(), f4_() {}
-
- explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
- GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3,
- GTEST_BY_REF_(T4) f4) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4) {}
-
- tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
- f4_(t.f4_) {}
-
- template <GTEST_5_TYPENAMES_(U)>
- tuple(const GTEST_5_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
- f3_(t.f3_), f4_(t.f4_) {}
-
- tuple& operator=(const tuple& t) { return CopyFrom(t); }
-
- template <GTEST_5_TYPENAMES_(U)>
- tuple& operator=(const GTEST_5_TUPLE_(U)& t) {
- return CopyFrom(t);
- }
-
- GTEST_DECLARE_TUPLE_AS_FRIEND_
-
- template <GTEST_5_TYPENAMES_(U)>
- tuple& CopyFrom(const GTEST_5_TUPLE_(U)& t) {
- f0_ = t.f0_;
- f1_ = t.f1_;
- f2_ = t.f2_;
- f3_ = t.f3_;
- f4_ = t.f4_;
- return *this;
- }
-
- T0 f0_;
- T1 f1_;
- T2 f2_;
- T3 f3_;
- T4 f4_;
-};
-
-template <GTEST_6_TYPENAMES_(T)>
-class GTEST_6_TUPLE_(T) {
- public:
- template <int k> friend class gtest_internal::Get;
-
- tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_() {}
-
- explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
- GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
- GTEST_BY_REF_(T5) f5) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
- f5_(f5) {}
-
- tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
- f4_(t.f4_), f5_(t.f5_) {}
-
- template <GTEST_6_TYPENAMES_(U)>
- tuple(const GTEST_6_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
- f3_(t.f3_), f4_(t.f4_), f5_(t.f5_) {}
-
- tuple& operator=(const tuple& t) { return CopyFrom(t); }
-
- template <GTEST_6_TYPENAMES_(U)>
- tuple& operator=(const GTEST_6_TUPLE_(U)& t) {
- return CopyFrom(t);
- }
-
- GTEST_DECLARE_TUPLE_AS_FRIEND_
-
- template <GTEST_6_TYPENAMES_(U)>
- tuple& CopyFrom(const GTEST_6_TUPLE_(U)& t) {
- f0_ = t.f0_;
- f1_ = t.f1_;
- f2_ = t.f2_;
- f3_ = t.f3_;
- f4_ = t.f4_;
- f5_ = t.f5_;
- return *this;
- }
-
- T0 f0_;
- T1 f1_;
- T2 f2_;
- T3 f3_;
- T4 f4_;
- T5 f5_;
-};
-
-template <GTEST_7_TYPENAMES_(T)>
-class GTEST_7_TUPLE_(T) {
- public:
- template <int k> friend class gtest_internal::Get;
-
- tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_() {}
-
- explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
- GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
- GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6) : f0_(f0), f1_(f1), f2_(f2),
- f3_(f3), f4_(f4), f5_(f5), f6_(f6) {}
-
- tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
- f4_(t.f4_), f5_(t.f5_), f6_(t.f6_) {}
-
- template <GTEST_7_TYPENAMES_(U)>
- tuple(const GTEST_7_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
- f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_) {}
-
- tuple& operator=(const tuple& t) { return CopyFrom(t); }
-
- template <GTEST_7_TYPENAMES_(U)>
- tuple& operator=(const GTEST_7_TUPLE_(U)& t) {
- return CopyFrom(t);
- }
-
- GTEST_DECLARE_TUPLE_AS_FRIEND_
-
- template <GTEST_7_TYPENAMES_(U)>
- tuple& CopyFrom(const GTEST_7_TUPLE_(U)& t) {
- f0_ = t.f0_;
- f1_ = t.f1_;
- f2_ = t.f2_;
- f3_ = t.f3_;
- f4_ = t.f4_;
- f5_ = t.f5_;
- f6_ = t.f6_;
- return *this;
- }
-
- T0 f0_;
- T1 f1_;
- T2 f2_;
- T3 f3_;
- T4 f4_;
- T5 f5_;
- T6 f6_;
-};
-
-template <GTEST_8_TYPENAMES_(T)>
-class GTEST_8_TUPLE_(T) {
- public:
- template <int k> friend class gtest_internal::Get;
-
- tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_() {}
-
- explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
- GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
- GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6,
- GTEST_BY_REF_(T7) f7) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
- f5_(f5), f6_(f6), f7_(f7) {}
-
- tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
- f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_) {}
-
- template <GTEST_8_TYPENAMES_(U)>
- tuple(const GTEST_8_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
- f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_) {}
-
- tuple& operator=(const tuple& t) { return CopyFrom(t); }
-
- template <GTEST_8_TYPENAMES_(U)>
- tuple& operator=(const GTEST_8_TUPLE_(U)& t) {
- return CopyFrom(t);
- }
-
- GTEST_DECLARE_TUPLE_AS_FRIEND_
-
- template <GTEST_8_TYPENAMES_(U)>
- tuple& CopyFrom(const GTEST_8_TUPLE_(U)& t) {
- f0_ = t.f0_;
- f1_ = t.f1_;
- f2_ = t.f2_;
- f3_ = t.f3_;
- f4_ = t.f4_;
- f5_ = t.f5_;
- f6_ = t.f6_;
- f7_ = t.f7_;
- return *this;
- }
-
- T0 f0_;
- T1 f1_;
- T2 f2_;
- T3 f3_;
- T4 f4_;
- T5 f5_;
- T6 f6_;
- T7 f7_;
-};
-
-template <GTEST_9_TYPENAMES_(T)>
-class GTEST_9_TUPLE_(T) {
- public:
- template <int k> friend class gtest_internal::Get;
-
- tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_(), f8_() {}
-
- explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
- GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
- GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, GTEST_BY_REF_(T7) f7,
- GTEST_BY_REF_(T8) f8) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
- f5_(f5), f6_(f6), f7_(f7), f8_(f8) {}
-
- tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
- f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_) {}
-
- template <GTEST_9_TYPENAMES_(U)>
- tuple(const GTEST_9_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
- f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_) {}
-
- tuple& operator=(const tuple& t) { return CopyFrom(t); }
-
- template <GTEST_9_TYPENAMES_(U)>
- tuple& operator=(const GTEST_9_TUPLE_(U)& t) {
- return CopyFrom(t);
- }
-
- GTEST_DECLARE_TUPLE_AS_FRIEND_
-
- template <GTEST_9_TYPENAMES_(U)>
- tuple& CopyFrom(const GTEST_9_TUPLE_(U)& t) {
- f0_ = t.f0_;
- f1_ = t.f1_;
- f2_ = t.f2_;
- f3_ = t.f3_;
- f4_ = t.f4_;
- f5_ = t.f5_;
- f6_ = t.f6_;
- f7_ = t.f7_;
- f8_ = t.f8_;
- return *this;
- }
-
- T0 f0_;
- T1 f1_;
- T2 f2_;
- T3 f3_;
- T4 f4_;
- T5 f5_;
- T6 f6_;
- T7 f7_;
- T8 f8_;
-};
-
-template <GTEST_10_TYPENAMES_(T)>
-class tuple {
- public:
- template <int k> friend class gtest_internal::Get;
-
- tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_(), f8_(),
- f9_() {}
-
- explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
- GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
- GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, GTEST_BY_REF_(T7) f7,
- GTEST_BY_REF_(T8) f8, GTEST_BY_REF_(T9) f9) : f0_(f0), f1_(f1), f2_(f2),
- f3_(f3), f4_(f4), f5_(f5), f6_(f6), f7_(f7), f8_(f8), f9_(f9) {}
-
- tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
- f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_), f9_(t.f9_) {}
-
- template <GTEST_10_TYPENAMES_(U)>
- tuple(const GTEST_10_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
- f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_),
- f9_(t.f9_) {}
-
- tuple& operator=(const tuple& t) { return CopyFrom(t); }
-
- template <GTEST_10_TYPENAMES_(U)>
- tuple& operator=(const GTEST_10_TUPLE_(U)& t) {
- return CopyFrom(t);
- }
-
- GTEST_DECLARE_TUPLE_AS_FRIEND_
-
- template <GTEST_10_TYPENAMES_(U)>
- tuple& CopyFrom(const GTEST_10_TUPLE_(U)& t) {
- f0_ = t.f0_;
- f1_ = t.f1_;
- f2_ = t.f2_;
- f3_ = t.f3_;
- f4_ = t.f4_;
- f5_ = t.f5_;
- f6_ = t.f6_;
- f7_ = t.f7_;
- f8_ = t.f8_;
- f9_ = t.f9_;
- return *this;
- }
-
- T0 f0_;
- T1 f1_;
- T2 f2_;
- T3 f3_;
- T4 f4_;
- T5 f5_;
- T6 f6_;
- T7 f7_;
- T8 f8_;
- T9 f9_;
-};
-
-// 6.1.3.2 Tuple creation functions.
-
-// Known limitations: we don't support passing an
-// std::tr1::reference_wrapper<T> to make_tuple(). And we don't
-// implement tie().
-
-inline tuple<> make_tuple() { return tuple<>(); }
-
-template <GTEST_1_TYPENAMES_(T)>
-inline GTEST_1_TUPLE_(T) make_tuple(const T0& f0) {
- return GTEST_1_TUPLE_(T)(f0);
-}
-
-template <GTEST_2_TYPENAMES_(T)>
-inline GTEST_2_TUPLE_(T) make_tuple(const T0& f0, const T1& f1) {
- return GTEST_2_TUPLE_(T)(f0, f1);
-}
-
-template <GTEST_3_TYPENAMES_(T)>
-inline GTEST_3_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2) {
- return GTEST_3_TUPLE_(T)(f0, f1, f2);
-}
-
-template <GTEST_4_TYPENAMES_(T)>
-inline GTEST_4_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
- const T3& f3) {
- return GTEST_4_TUPLE_(T)(f0, f1, f2, f3);
-}
-
-template <GTEST_5_TYPENAMES_(T)>
-inline GTEST_5_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
- const T3& f3, const T4& f4) {
- return GTEST_5_TUPLE_(T)(f0, f1, f2, f3, f4);
-}
-
-template <GTEST_6_TYPENAMES_(T)>
-inline GTEST_6_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
- const T3& f3, const T4& f4, const T5& f5) {
- return GTEST_6_TUPLE_(T)(f0, f1, f2, f3, f4, f5);
-}
-
-template <GTEST_7_TYPENAMES_(T)>
-inline GTEST_7_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
- const T3& f3, const T4& f4, const T5& f5, const T6& f6) {
- return GTEST_7_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6);
-}
-
-template <GTEST_8_TYPENAMES_(T)>
-inline GTEST_8_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
- const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7) {
- return GTEST_8_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7);
-}
-
-template <GTEST_9_TYPENAMES_(T)>
-inline GTEST_9_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
- const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7,
- const T8& f8) {
- return GTEST_9_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7, f8);
-}
-
-template <GTEST_10_TYPENAMES_(T)>
-inline GTEST_10_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
- const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7,
- const T8& f8, const T9& f9) {
- return GTEST_10_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7, f8, f9);
-}
-
-// 6.1.3.3 Tuple helper classes.
-
-template <typename Tuple> struct tuple_size;
-
-template <GTEST_0_TYPENAMES_(T)>
-struct tuple_size<GTEST_0_TUPLE_(T)> {
- static const int value = 0;
-};
-
-template <GTEST_1_TYPENAMES_(T)>
-struct tuple_size<GTEST_1_TUPLE_(T)> {
- static const int value = 1;
-};
-
-template <GTEST_2_TYPENAMES_(T)>
-struct tuple_size<GTEST_2_TUPLE_(T)> {
- static const int value = 2;
-};
-
-template <GTEST_3_TYPENAMES_(T)>
-struct tuple_size<GTEST_3_TUPLE_(T)> {
- static const int value = 3;
-};
-
-template <GTEST_4_TYPENAMES_(T)>
-struct tuple_size<GTEST_4_TUPLE_(T)> {
- static const int value = 4;
-};
-
-template <GTEST_5_TYPENAMES_(T)>
-struct tuple_size<GTEST_5_TUPLE_(T)> {
- static const int value = 5;
-};
-
-template <GTEST_6_TYPENAMES_(T)>
-struct tuple_size<GTEST_6_TUPLE_(T)> {
- static const int value = 6;
-};
-
-template <GTEST_7_TYPENAMES_(T)>
-struct tuple_size<GTEST_7_TUPLE_(T)> {
- static const int value = 7;
-};
-
-template <GTEST_8_TYPENAMES_(T)>
-struct tuple_size<GTEST_8_TUPLE_(T)> {
- static const int value = 8;
-};
-
-template <GTEST_9_TYPENAMES_(T)>
-struct tuple_size<GTEST_9_TUPLE_(T)> {
- static const int value = 9;
-};
-
-template <GTEST_10_TYPENAMES_(T)>
-struct tuple_size<GTEST_10_TUPLE_(T)> {
- static const int value = 10;
-};
-
-template <int k, class Tuple>
-struct tuple_element {
- typedef typename gtest_internal::TupleElement<
- k < (tuple_size<Tuple>::value), k, Tuple>::type type;
-};
-
-#define GTEST_TUPLE_ELEMENT_(k, Tuple) typename tuple_element<k, Tuple >::type
-
-// 6.1.3.4 Element access.
-
-namespace gtest_internal {
-
-template <>
-class Get<0> {
- public:
- template <class Tuple>
- static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(0, Tuple))
- Field(Tuple& t) { return t.f0_; } // NOLINT
-
- template <class Tuple>
- static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(0, Tuple))
- ConstField(const Tuple& t) { return t.f0_; }
-};
-
-template <>
-class Get<1> {
- public:
- template <class Tuple>
- static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(1, Tuple))
- Field(Tuple& t) { return t.f1_; } // NOLINT
-
- template <class Tuple>
- static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(1, Tuple))
- ConstField(const Tuple& t) { return t.f1_; }
-};
-
-template <>
-class Get<2> {
- public:
- template <class Tuple>
- static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(2, Tuple))
- Field(Tuple& t) { return t.f2_; } // NOLINT
-
- template <class Tuple>
- static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(2, Tuple))
- ConstField(const Tuple& t) { return t.f2_; }
-};
-
-template <>
-class Get<3> {
- public:
- template <class Tuple>
- static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(3, Tuple))
- Field(Tuple& t) { return t.f3_; } // NOLINT
-
- template <class Tuple>
- static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(3, Tuple))
- ConstField(const Tuple& t) { return t.f3_; }
-};
-
-template <>
-class Get<4> {
- public:
- template <class Tuple>
- static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(4, Tuple))
- Field(Tuple& t) { return t.f4_; } // NOLINT
-
- template <class Tuple>
- static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(4, Tuple))
- ConstField(const Tuple& t) { return t.f4_; }
-};
-
-template <>
-class Get<5> {
- public:
- template <class Tuple>
- static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(5, Tuple))
- Field(Tuple& t) { return t.f5_; } // NOLINT
-
- template <class Tuple>
- static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(5, Tuple))
- ConstField(const Tuple& t) { return t.f5_; }
-};
-
-template <>
-class Get<6> {
- public:
- template <class Tuple>
- static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(6, Tuple))
- Field(Tuple& t) { return t.f6_; } // NOLINT
-
- template <class Tuple>
- static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(6, Tuple))
- ConstField(const Tuple& t) { return t.f6_; }
-};
-
-template <>
-class Get<7> {
- public:
- template <class Tuple>
- static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(7, Tuple))
- Field(Tuple& t) { return t.f7_; } // NOLINT
-
- template <class Tuple>
- static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(7, Tuple))
- ConstField(const Tuple& t) { return t.f7_; }
-};
-
-template <>
-class Get<8> {
- public:
- template <class Tuple>
- static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(8, Tuple))
- Field(Tuple& t) { return t.f8_; } // NOLINT
-
- template <class Tuple>
- static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(8, Tuple))
- ConstField(const Tuple& t) { return t.f8_; }
-};
-
-template <>
-class Get<9> {
- public:
- template <class Tuple>
- static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(9, Tuple))
- Field(Tuple& t) { return t.f9_; } // NOLINT
-
- template <class Tuple>
- static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(9, Tuple))
- ConstField(const Tuple& t) { return t.f9_; }
-};
-
-} // namespace gtest_internal
-
-template <int k, GTEST_10_TYPENAMES_(T)>
-GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(k, GTEST_10_TUPLE_(T)))
-get(GTEST_10_TUPLE_(T)& t) {
- return gtest_internal::Get<k>::Field(t);
-}
-
-template <int k, GTEST_10_TYPENAMES_(T)>
-GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(k, GTEST_10_TUPLE_(T)))
-get(const GTEST_10_TUPLE_(T)& t) {
- return gtest_internal::Get<k>::ConstField(t);
-}
-
-// 6.1.3.5 Relational operators
-
-// We only implement == and !=, as we don't have a need for the rest yet.
-
-namespace gtest_internal {
-
-// SameSizeTuplePrefixComparator<k, k>::Eq(t1, t2) returns true if the
-// first k fields of t1 equals the first k fields of t2.
-// SameSizeTuplePrefixComparator(k1, k2) would be a compiler error if
-// k1 != k2.
-template <int kSize1, int kSize2>
-struct SameSizeTuplePrefixComparator;
-
-template <>
-struct SameSizeTuplePrefixComparator<0, 0> {
- template <class Tuple1, class Tuple2>
- static bool Eq(const Tuple1& /* t1 */, const Tuple2& /* t2 */) {
- return true;
- }
-};
-
-template <int k>
-struct SameSizeTuplePrefixComparator<k, k> {
- template <class Tuple1, class Tuple2>
- static bool Eq(const Tuple1& t1, const Tuple2& t2) {
- return SameSizeTuplePrefixComparator<k - 1, k - 1>::Eq(t1, t2) &&
- ::std::tr1::get<k - 1>(t1) == ::std::tr1::get<k - 1>(t2);
- }
-};
-
-} // namespace gtest_internal
-
-template <GTEST_10_TYPENAMES_(T), GTEST_10_TYPENAMES_(U)>
-inline bool operator==(const GTEST_10_TUPLE_(T)& t,
- const GTEST_10_TUPLE_(U)& u) {
- return gtest_internal::SameSizeTuplePrefixComparator<
- tuple_size<GTEST_10_TUPLE_(T)>::value,
- tuple_size<GTEST_10_TUPLE_(U)>::value>::Eq(t, u);
-}
-
-template <GTEST_10_TYPENAMES_(T), GTEST_10_TYPENAMES_(U)>
-inline bool operator!=(const GTEST_10_TUPLE_(T)& t,
- const GTEST_10_TUPLE_(U)& u) { return !(t == u); }
-
-// 6.1.4 Pairs.
-// Unimplemented.
-
-} // namespace tr1
-} // namespace std
-
-#undef GTEST_0_TUPLE_
-#undef GTEST_1_TUPLE_
-#undef GTEST_2_TUPLE_
-#undef GTEST_3_TUPLE_
-#undef GTEST_4_TUPLE_
-#undef GTEST_5_TUPLE_
-#undef GTEST_6_TUPLE_
-#undef GTEST_7_TUPLE_
-#undef GTEST_8_TUPLE_
-#undef GTEST_9_TUPLE_
-#undef GTEST_10_TUPLE_
-
-#undef GTEST_0_TYPENAMES_
-#undef GTEST_1_TYPENAMES_
-#undef GTEST_2_TYPENAMES_
-#undef GTEST_3_TYPENAMES_
-#undef GTEST_4_TYPENAMES_
-#undef GTEST_5_TYPENAMES_
-#undef GTEST_6_TYPENAMES_
-#undef GTEST_7_TYPENAMES_
-#undef GTEST_8_TYPENAMES_
-#undef GTEST_9_TYPENAMES_
-#undef GTEST_10_TYPENAMES_
-
-#undef GTEST_DECLARE_TUPLE_AS_FRIEND_
-#undef GTEST_BY_REF_
-#undef GTEST_ADD_REF_
-#undef GTEST_TUPLE_ELEMENT_
-
-#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
diff --git a/src/testing/gtest/include/gtest/internal/gtest-tuple.h.pump b/src/testing/gtest/include/gtest/internal/gtest-tuple.h.pump
deleted file mode 100644
index 238e8fcc..00000000
--- a/src/testing/gtest/include/gtest/internal/gtest-tuple.h.pump
+++ /dev/null
@@ -1,339 +0,0 @@
-$$ -*- mode: c++; -*-
-$var n = 10 $$ Maximum number of tuple fields we want to support.
-$$ This meta comment fixes auto-indentation in Emacs. }}
-// Copyright 2009 Google Inc.
-// All Rights Reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-// Implements a subset of TR1 tuple needed by Google Test and Google Mock.
-
-#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
-#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
-
-#include <utility> // For ::std::pair.
-
-// The compiler used in Symbian has a bug that prevents us from declaring the
-// tuple template as a friend (it complains that tuple is redefined). This
-// hack bypasses the bug by declaring the members that should otherwise be
-// private as public.
-// Sun Studio versions < 12 also have the above bug.
-#if defined(__SYMBIAN32__) || (defined(__SUNPRO_CC) && __SUNPRO_CC < 0x590)
-# define GTEST_DECLARE_TUPLE_AS_FRIEND_ public:
-#else
-# define GTEST_DECLARE_TUPLE_AS_FRIEND_ \
- template <GTEST_$(n)_TYPENAMES_(U)> friend class tuple; \
- private:
-#endif
-
-
-$range i 0..n-1
-$range j 0..n
-$range k 1..n
-// GTEST_n_TUPLE_(T) is the type of an n-tuple.
-#define GTEST_0_TUPLE_(T) tuple<>
-
-$for k [[
-$range m 0..k-1
-$range m2 k..n-1
-#define GTEST_$(k)_TUPLE_(T) tuple<$for m, [[T##$m]]$for m2 [[, void]]>
-
-]]
-
-// GTEST_n_TYPENAMES_(T) declares a list of n typenames.
-
-$for j [[
-$range m 0..j-1
-#define GTEST_$(j)_TYPENAMES_(T) $for m, [[typename T##$m]]
-
-
-]]
-
-// In theory, defining stuff in the ::std namespace is undefined
-// behavior. We can do this as we are playing the role of a standard
-// library vendor.
-namespace std {
-namespace tr1 {
-
-template <$for i, [[typename T$i = void]]>
-class tuple;
-
-// Anything in namespace gtest_internal is Google Test's INTERNAL
-// IMPLEMENTATION DETAIL and MUST NOT BE USED DIRECTLY in user code.
-namespace gtest_internal {
-
-// ByRef<T>::type is T if T is a reference; otherwise it's const T&.
-template <typename T>
-struct ByRef { typedef const T& type; }; // NOLINT
-template <typename T>
-struct ByRef<T&> { typedef T& type; }; // NOLINT
-
-// A handy wrapper for ByRef.
-#define GTEST_BY_REF_(T) typename ::std::tr1::gtest_internal::ByRef<T>::type
-
-// AddRef<T>::type is T if T is a reference; otherwise it's T&. This
-// is the same as tr1::add_reference<T>::type.
-template <typename T>
-struct AddRef { typedef T& type; }; // NOLINT
-template <typename T>
-struct AddRef<T&> { typedef T& type; }; // NOLINT
-
-// A handy wrapper for AddRef.
-#define GTEST_ADD_REF_(T) typename ::std::tr1::gtest_internal::AddRef<T>::type
-
-// A helper for implementing get<k>().
-template <int k> class Get;
-
-// A helper for implementing tuple_element<k, T>. kIndexValid is true
-// iff k < the number of fields in tuple type T.
-template <bool kIndexValid, int kIndex, class Tuple>
-struct TupleElement;
-
-
-$for i [[
-template <GTEST_$(n)_TYPENAMES_(T)>
-struct TupleElement<true, $i, GTEST_$(n)_TUPLE_(T)> {
- typedef T$i type;
-};
-
-
-]]
-} // namespace gtest_internal
-
-template <>
-class tuple<> {
- public:
- tuple() {}
- tuple(const tuple& /* t */) {}
- tuple& operator=(const tuple& /* t */) { return *this; }
-};
-
-
-$for k [[
-$range m 0..k-1
-template <GTEST_$(k)_TYPENAMES_(T)>
-class $if k < n [[GTEST_$(k)_TUPLE_(T)]] $else [[tuple]] {
- public:
- template <int k> friend class gtest_internal::Get;
-
- tuple() : $for m, [[f$(m)_()]] {}
-
- explicit tuple($for m, [[GTEST_BY_REF_(T$m) f$m]]) : [[]]
-$for m, [[f$(m)_(f$m)]] {}
-
- tuple(const tuple& t) : $for m, [[f$(m)_(t.f$(m)_)]] {}
-
- template <GTEST_$(k)_TYPENAMES_(U)>
- tuple(const GTEST_$(k)_TUPLE_(U)& t) : $for m, [[f$(m)_(t.f$(m)_)]] {}
-
-$if k == 2 [[
- template <typename U0, typename U1>
- tuple(const ::std::pair<U0, U1>& p) : f0_(p.first), f1_(p.second) {}
-
-]]
-
- tuple& operator=(const tuple& t) { return CopyFrom(t); }
-
- template <GTEST_$(k)_TYPENAMES_(U)>
- tuple& operator=(const GTEST_$(k)_TUPLE_(U)& t) {
- return CopyFrom(t);
- }
-
-$if k == 2 [[
- template <typename U0, typename U1>
- tuple& operator=(const ::std::pair<U0, U1>& p) {
- f0_ = p.first;
- f1_ = p.second;
- return *this;
- }
-
-]]
-
- GTEST_DECLARE_TUPLE_AS_FRIEND_
-
- template <GTEST_$(k)_TYPENAMES_(U)>
- tuple& CopyFrom(const GTEST_$(k)_TUPLE_(U)& t) {
-
-$for m [[
- f$(m)_ = t.f$(m)_;
-
-]]
- return *this;
- }
-
-
-$for m [[
- T$m f$(m)_;
-
-]]
-};
-
-
-]]
-// 6.1.3.2 Tuple creation functions.
-
-// Known limitations: we don't support passing an
-// std::tr1::reference_wrapper<T> to make_tuple(). And we don't
-// implement tie().
-
-inline tuple<> make_tuple() { return tuple<>(); }
-
-$for k [[
-$range m 0..k-1
-
-template <GTEST_$(k)_TYPENAMES_(T)>
-inline GTEST_$(k)_TUPLE_(T) make_tuple($for m, [[const T$m& f$m]]) {
- return GTEST_$(k)_TUPLE_(T)($for m, [[f$m]]);
-}
-
-]]
-
-// 6.1.3.3 Tuple helper classes.
-
-template <typename Tuple> struct tuple_size;
-
-
-$for j [[
-template <GTEST_$(j)_TYPENAMES_(T)>
-struct tuple_size<GTEST_$(j)_TUPLE_(T)> {
- static const int value = $j;
-};
-
-
-]]
-template <int k, class Tuple>
-struct tuple_element {
- typedef typename gtest_internal::TupleElement<
- k < (tuple_size<Tuple>::value), k, Tuple>::type type;
-};
-
-#define GTEST_TUPLE_ELEMENT_(k, Tuple) typename tuple_element<k, Tuple >::type
-
-// 6.1.3.4 Element access.
-
-namespace gtest_internal {
-
-
-$for i [[
-template <>
-class Get<$i> {
- public:
- template <class Tuple>
- static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_($i, Tuple))
- Field(Tuple& t) { return t.f$(i)_; } // NOLINT
-
- template <class Tuple>
- static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_($i, Tuple))
- ConstField(const Tuple& t) { return t.f$(i)_; }
-};
-
-
-]]
-} // namespace gtest_internal
-
-template <int k, GTEST_$(n)_TYPENAMES_(T)>
-GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(k, GTEST_$(n)_TUPLE_(T)))
-get(GTEST_$(n)_TUPLE_(T)& t) {
- return gtest_internal::Get<k>::Field(t);
-}
-
-template <int k, GTEST_$(n)_TYPENAMES_(T)>
-GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(k, GTEST_$(n)_TUPLE_(T)))
-get(const GTEST_$(n)_TUPLE_(T)& t) {
- return gtest_internal::Get<k>::ConstField(t);
-}
-
-// 6.1.3.5 Relational operators
-
-// We only implement == and !=, as we don't have a need for the rest yet.
-
-namespace gtest_internal {
-
-// SameSizeTuplePrefixComparator<k, k>::Eq(t1, t2) returns true if the
-// first k fields of t1 equals the first k fields of t2.
-// SameSizeTuplePrefixComparator(k1, k2) would be a compiler error if
-// k1 != k2.
-template <int kSize1, int kSize2>
-struct SameSizeTuplePrefixComparator;
-
-template <>
-struct SameSizeTuplePrefixComparator<0, 0> {
- template <class Tuple1, class Tuple2>
- static bool Eq(const Tuple1& /* t1 */, const Tuple2& /* t2 */) {
- return true;
- }
-};
-
-template <int k>
-struct SameSizeTuplePrefixComparator<k, k> {
- template <class Tuple1, class Tuple2>
- static bool Eq(const Tuple1& t1, const Tuple2& t2) {
- return SameSizeTuplePrefixComparator<k - 1, k - 1>::Eq(t1, t2) &&
- ::std::tr1::get<k - 1>(t1) == ::std::tr1::get<k - 1>(t2);
- }
-};
-
-} // namespace gtest_internal
-
-template <GTEST_$(n)_TYPENAMES_(T), GTEST_$(n)_TYPENAMES_(U)>
-inline bool operator==(const GTEST_$(n)_TUPLE_(T)& t,
- const GTEST_$(n)_TUPLE_(U)& u) {
- return gtest_internal::SameSizeTuplePrefixComparator<
- tuple_size<GTEST_$(n)_TUPLE_(T)>::value,
- tuple_size<GTEST_$(n)_TUPLE_(U)>::value>::Eq(t, u);
-}
-
-template <GTEST_$(n)_TYPENAMES_(T), GTEST_$(n)_TYPENAMES_(U)>
-inline bool operator!=(const GTEST_$(n)_TUPLE_(T)& t,
- const GTEST_$(n)_TUPLE_(U)& u) { return !(t == u); }
-
-// 6.1.4 Pairs.
-// Unimplemented.
-
-} // namespace tr1
-} // namespace std
-
-
-$for j [[
-#undef GTEST_$(j)_TUPLE_
-
-]]
-
-
-$for j [[
-#undef GTEST_$(j)_TYPENAMES_
-
-]]
-
-#undef GTEST_DECLARE_TUPLE_AS_FRIEND_
-#undef GTEST_BY_REF_
-#undef GTEST_ADD_REF_
-#undef GTEST_TUPLE_ELEMENT_
-
-#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
diff --git a/src/testing/gtest/include/gtest/internal/gtest-type-util.h b/src/testing/gtest/include/gtest/internal/gtest-type-util.h
deleted file mode 100644
index ed58fce6..00000000
--- a/src/testing/gtest/include/gtest/internal/gtest-type-util.h
+++ /dev/null
@@ -1,3332 +0,0 @@
-// This file was GENERATED by command:
-// pump.py gtest-type-util.h.pump
-// DO NOT EDIT BY HAND!!!
-
-// Copyright 2008 Google Inc.
-// All Rights Reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-// Type utilities needed for implementing typed and type-parameterized
-// tests. This file is generated by a SCRIPT. DO NOT EDIT BY HAND!
-//
-// Currently we support at most 50 types in a list, and at most 50
-// type-parameterized tests in one type-parameterized test case.
-// Please contact googletestframework@googlegroups.com if you need
-// more.
-
-#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
-#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
-
-#include "gtest/internal/gtest-port.h"
-#include "gtest/internal/gtest-string.h"
-
-// #ifdef __GNUC__ is too general here. It is possible to use gcc without using
-// libstdc++ (which is where cxxabi.h comes from).
-# if GTEST_HAS_CXXABI_H_
-# include <cxxabi.h>
-# elif defined(__HP_aCC)
-# include <acxx_demangle.h>
-# endif // GTEST_HASH_CXXABI_H_
-
-namespace testing {
-namespace internal {
-
-// GetTypeName<T>() returns a human-readable name of type T.
-// NB: This function is also used in Google Mock, so don't move it inside of
-// the typed-test-only section below.
-template <typename T>
-String GetTypeName() {
-# if GTEST_HAS_RTTI
-
- const char* const name = typeid(T).name();
-# if GTEST_HAS_CXXABI_H_ || defined(__HP_aCC)
- int status = 0;
- // gcc's implementation of typeid(T).name() mangles the type name,
- // so we have to demangle it.
-# if GTEST_HAS_CXXABI_H_
- using abi::__cxa_demangle;
-# endif // GTEST_HAS_CXXABI_H_
- char* const readable_name = __cxa_demangle(name, 0, 0, &status);
- const String name_str(status == 0 ? readable_name : name);
- free(readable_name);
- return name_str;
-# else
- return name;
-# endif // GTEST_HAS_CXXABI_H_ || __HP_aCC
-
-# else
-
- return "<type>";
-
-# endif // GTEST_HAS_RTTI
-}
-
-#if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
-
-// AssertyTypeEq<T1, T2>::type is defined iff T1 and T2 are the same
-// type. This can be used as a compile-time assertion to ensure that
-// two types are equal.
-
-template <typename T1, typename T2>
-struct AssertTypeEq;
-
-template <typename T>
-struct AssertTypeEq<T, T> {
- typedef bool type;
-};
-
-// A unique type used as the default value for the arguments of class
-// template Types. This allows us to simulate variadic templates
-// (e.g. Types<int>, Type<int, double>, and etc), which C++ doesn't
-// support directly.
-struct None {};
-
-// The following family of struct and struct templates are used to
-// represent type lists. In particular, TypesN<T1, T2, ..., TN>
-// represents a type list with N types (T1, T2, ..., and TN) in it.
-// Except for Types0, every struct in the family has two member types:
-// Head for the first type in the list, and Tail for the rest of the
-// list.
-
-// The empty type list.
-struct Types0 {};
-
-// Type lists of length 1, 2, 3, and so on.
-
-template <typename T1>
-struct Types1 {
- typedef T1 Head;
- typedef Types0 Tail;
-};
-template <typename T1, typename T2>
-struct Types2 {
- typedef T1 Head;
- typedef Types1<T2> Tail;
-};
-
-template <typename T1, typename T2, typename T3>
-struct Types3 {
- typedef T1 Head;
- typedef Types2<T2, T3> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4>
-struct Types4 {
- typedef T1 Head;
- typedef Types3<T2, T3, T4> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5>
-struct Types5 {
- typedef T1 Head;
- typedef Types4<T2, T3, T4, T5> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6>
-struct Types6 {
- typedef T1 Head;
- typedef Types5<T2, T3, T4, T5, T6> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7>
-struct Types7 {
- typedef T1 Head;
- typedef Types6<T2, T3, T4, T5, T6, T7> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8>
-struct Types8 {
- typedef T1 Head;
- typedef Types7<T2, T3, T4, T5, T6, T7, T8> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9>
-struct Types9 {
- typedef T1 Head;
- typedef Types8<T2, T3, T4, T5, T6, T7, T8, T9> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10>
-struct Types10 {
- typedef T1 Head;
- typedef Types9<T2, T3, T4, T5, T6, T7, T8, T9, T10> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11>
-struct Types11 {
- typedef T1 Head;
- typedef Types10<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12>
-struct Types12 {
- typedef T1 Head;
- typedef Types11<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13>
-struct Types13 {
- typedef T1 Head;
- typedef Types12<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14>
-struct Types14 {
- typedef T1 Head;
- typedef Types13<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15>
-struct Types15 {
- typedef T1 Head;
- typedef Types14<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16>
-struct Types16 {
- typedef T1 Head;
- typedef Types15<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17>
-struct Types17 {
- typedef T1 Head;
- typedef Types16<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18>
-struct Types18 {
- typedef T1 Head;
- typedef Types17<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19>
-struct Types19 {
- typedef T1 Head;
- typedef Types18<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20>
-struct Types20 {
- typedef T1 Head;
- typedef Types19<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21>
-struct Types21 {
- typedef T1 Head;
- typedef Types20<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22>
-struct Types22 {
- typedef T1 Head;
- typedef Types21<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23>
-struct Types23 {
- typedef T1 Head;
- typedef Types22<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24>
-struct Types24 {
- typedef T1 Head;
- typedef Types23<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25>
-struct Types25 {
- typedef T1 Head;
- typedef Types24<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26>
-struct Types26 {
- typedef T1 Head;
- typedef Types25<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27>
-struct Types27 {
- typedef T1 Head;
- typedef Types26<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28>
-struct Types28 {
- typedef T1 Head;
- typedef Types27<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29>
-struct Types29 {
- typedef T1 Head;
- typedef Types28<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30>
-struct Types30 {
- typedef T1 Head;
- typedef Types29<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31>
-struct Types31 {
- typedef T1 Head;
- typedef Types30<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32>
-struct Types32 {
- typedef T1 Head;
- typedef Types31<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33>
-struct Types33 {
- typedef T1 Head;
- typedef Types32<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34>
-struct Types34 {
- typedef T1 Head;
- typedef Types33<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33, T34> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35>
-struct Types35 {
- typedef T1 Head;
- typedef Types34<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33, T34, T35> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36>
-struct Types36 {
- typedef T1 Head;
- typedef Types35<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33, T34, T35, T36> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37>
-struct Types37 {
- typedef T1 Head;
- typedef Types36<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33, T34, T35, T36, T37> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38>
-struct Types38 {
- typedef T1 Head;
- typedef Types37<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33, T34, T35, T36, T37, T38> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39>
-struct Types39 {
- typedef T1 Head;
- typedef Types38<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40>
-struct Types40 {
- typedef T1 Head;
- typedef Types39<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41>
-struct Types41 {
- typedef T1 Head;
- typedef Types40<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42>
-struct Types42 {
- typedef T1 Head;
- typedef Types41<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42, typename T43>
-struct Types43 {
- typedef T1 Head;
- typedef Types42<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
- T43> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42, typename T43, typename T44>
-struct Types44 {
- typedef T1 Head;
- typedef Types43<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
- T44> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42, typename T43, typename T44, typename T45>
-struct Types45 {
- typedef T1 Head;
- typedef Types44<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
- T44, T45> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42, typename T43, typename T44, typename T45,
- typename T46>
-struct Types46 {
- typedef T1 Head;
- typedef Types45<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
- T44, T45, T46> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42, typename T43, typename T44, typename T45,
- typename T46, typename T47>
-struct Types47 {
- typedef T1 Head;
- typedef Types46<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
- T44, T45, T46, T47> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42, typename T43, typename T44, typename T45,
- typename T46, typename T47, typename T48>
-struct Types48 {
- typedef T1 Head;
- typedef Types47<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
- T44, T45, T46, T47, T48> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42, typename T43, typename T44, typename T45,
- typename T46, typename T47, typename T48, typename T49>
-struct Types49 {
- typedef T1 Head;
- typedef Types48<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
- T44, T45, T46, T47, T48, T49> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42, typename T43, typename T44, typename T45,
- typename T46, typename T47, typename T48, typename T49, typename T50>
-struct Types50 {
- typedef T1 Head;
- typedef Types49<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
- T44, T45, T46, T47, T48, T49, T50> Tail;
-};
-
-
-} // namespace internal
-
-// We don't want to require the users to write TypesN<...> directly,
-// as that would require them to count the length. Types<...> is much
-// easier to write, but generates horrible messages when there is a
-// compiler error, as gcc insists on printing out each template
-// argument, even if it has the default value (this means Types<int>
-// will appear as Types<int, None, None, ..., None> in the compiler
-// errors).
-//
-// Our solution is to combine the best part of the two approaches: a
-// user would write Types<T1, ..., TN>, and Google Test will translate
-// that to TypesN<T1, ..., TN> internally to make error messages
-// readable. The translation is done by the 'type' member of the
-// Types template.
-template <typename T1 = internal::None, typename T2 = internal::None,
- typename T3 = internal::None, typename T4 = internal::None,
- typename T5 = internal::None, typename T6 = internal::None,
- typename T7 = internal::None, typename T8 = internal::None,
- typename T9 = internal::None, typename T10 = internal::None,
- typename T11 = internal::None, typename T12 = internal::None,
- typename T13 = internal::None, typename T14 = internal::None,
- typename T15 = internal::None, typename T16 = internal::None,
- typename T17 = internal::None, typename T18 = internal::None,
- typename T19 = internal::None, typename T20 = internal::None,
- typename T21 = internal::None, typename T22 = internal::None,
- typename T23 = internal::None, typename T24 = internal::None,
- typename T25 = internal::None, typename T26 = internal::None,
- typename T27 = internal::None, typename T28 = internal::None,
- typename T29 = internal::None, typename T30 = internal::None,
- typename T31 = internal::None, typename T32 = internal::None,
- typename T33 = internal::None, typename T34 = internal::None,
- typename T35 = internal::None, typename T36 = internal::None,
- typename T37 = internal::None, typename T38 = internal::None,
- typename T39 = internal::None, typename T40 = internal::None,
- typename T41 = internal::None, typename T42 = internal::None,
- typename T43 = internal::None, typename T44 = internal::None,
- typename T45 = internal::None, typename T46 = internal::None,
- typename T47 = internal::None, typename T48 = internal::None,
- typename T49 = internal::None, typename T50 = internal::None>
-struct Types {
- typedef internal::Types50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
- T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
- T41, T42, T43, T44, T45, T46, T47, T48, T49, T50> type;
-};
-
-template <>
-struct Types<internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None> {
- typedef internal::Types0 type;
-};
-template <typename T1>
-struct Types<T1, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None> {
- typedef internal::Types1<T1> type;
-};
-template <typename T1, typename T2>
-struct Types<T1, T2, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None> {
- typedef internal::Types2<T1, T2> type;
-};
-template <typename T1, typename T2, typename T3>
-struct Types<T1, T2, T3, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None> {
- typedef internal::Types3<T1, T2, T3> type;
-};
-template <typename T1, typename T2, typename T3, typename T4>
-struct Types<T1, T2, T3, T4, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None> {
- typedef internal::Types4<T1, T2, T3, T4> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5>
-struct Types<T1, T2, T3, T4, T5, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None> {
- typedef internal::Types5<T1, T2, T3, T4, T5> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6>
-struct Types<T1, T2, T3, T4, T5, T6, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None> {
- typedef internal::Types6<T1, T2, T3, T4, T5, T6> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7>
-struct Types<T1, T2, T3, T4, T5, T6, T7, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None> {
- typedef internal::Types7<T1, T2, T3, T4, T5, T6, T7> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None> {
- typedef internal::Types8<T1, T2, T3, T4, T5, T6, T7, T8> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None> {
- typedef internal::Types9<T1, T2, T3, T4, T5, T6, T7, T8, T9> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None> {
- typedef internal::Types10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None> {
- typedef internal::Types11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None> {
- typedef internal::Types12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None> {
- typedef internal::Types13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None> {
- typedef internal::Types14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None> {
- typedef internal::Types15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None> {
- typedef internal::Types16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None> {
- typedef internal::Types17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None> {
- typedef internal::Types18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17, T18> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None> {
- typedef internal::Types19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17, T18, T19> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None> {
- typedef internal::Types20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17, T18, T19, T20> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None> {
- typedef internal::Types21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17, T18, T19, T20, T21> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None> {
- typedef internal::Types22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17, T18, T19, T20, T21, T22> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None> {
- typedef internal::Types23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None> {
- typedef internal::Types24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None> {
- typedef internal::Types25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None> {
- typedef internal::Types26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
- T26> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None> {
- typedef internal::Types27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
- T27> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None> {
- typedef internal::Types28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
- T27, T28> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None> {
- typedef internal::Types29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
- T27, T28, T29> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None> {
- typedef internal::Types30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
- T27, T28, T29, T30> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
- T31, internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None> {
- typedef internal::Types31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
- T27, T28, T29, T30, T31> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
- T31, T32, internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None> {
- typedef internal::Types32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
- T27, T28, T29, T30, T31, T32> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
- T31, T32, T33, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None> {
- typedef internal::Types33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
- T27, T28, T29, T30, T31, T32, T33> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
- T31, T32, T33, T34, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None> {
- typedef internal::Types34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
- T27, T28, T29, T30, T31, T32, T33, T34> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
- T31, T32, T33, T34, T35, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None> {
- typedef internal::Types35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
- T27, T28, T29, T30, T31, T32, T33, T34, T35> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
- T31, T32, T33, T34, T35, T36, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None> {
- typedef internal::Types36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
- T27, T28, T29, T30, T31, T32, T33, T34, T35, T36> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
- T31, T32, T33, T34, T35, T36, T37, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None> {
- typedef internal::Types37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
- T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
- T31, T32, T33, T34, T35, T36, T37, T38, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None> {
- typedef internal::Types38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
- T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
- T31, T32, T33, T34, T35, T36, T37, T38, T39, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None> {
- typedef internal::Types39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
- T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
- T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None> {
- typedef internal::Types40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
- T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
- T40> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
- T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None> {
- typedef internal::Types41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
- T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
- T41> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
- T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None> {
- typedef internal::Types42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
- T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
- T41, T42> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42, typename T43>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
- T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None> {
- typedef internal::Types43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
- T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
- T41, T42, T43> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42, typename T43, typename T44>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
- T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None> {
- typedef internal::Types44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
- T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
- T41, T42, T43, T44> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42, typename T43, typename T44, typename T45>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
- T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
- internal::None, internal::None, internal::None, internal::None,
- internal::None> {
- typedef internal::Types45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
- T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
- T41, T42, T43, T44, T45> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42, typename T43, typename T44, typename T45,
- typename T46>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
- T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
- T46, internal::None, internal::None, internal::None, internal::None> {
- typedef internal::Types46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
- T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
- T41, T42, T43, T44, T45, T46> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42, typename T43, typename T44, typename T45,
- typename T46, typename T47>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
- T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
- T46, T47, internal::None, internal::None, internal::None> {
- typedef internal::Types47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
- T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
- T41, T42, T43, T44, T45, T46, T47> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42, typename T43, typename T44, typename T45,
- typename T46, typename T47, typename T48>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
- T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
- T46, T47, T48, internal::None, internal::None> {
- typedef internal::Types48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
- T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
- T41, T42, T43, T44, T45, T46, T47, T48> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42, typename T43, typename T44, typename T45,
- typename T46, typename T47, typename T48, typename T49>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
- T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
- T46, T47, T48, T49, internal::None> {
- typedef internal::Types49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
- T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
- T41, T42, T43, T44, T45, T46, T47, T48, T49> type;
-};
-
-namespace internal {
-
-# define GTEST_TEMPLATE_ template <typename T> class
-
-// The template "selector" struct TemplateSel<Tmpl> is used to
-// represent Tmpl, which must be a class template with one type
-// parameter, as a type. TemplateSel<Tmpl>::Bind<T>::type is defined
-// as the type Tmpl<T>. This allows us to actually instantiate the
-// template "selected" by TemplateSel<Tmpl>.
-//
-// This trick is necessary for simulating typedef for class templates,
-// which C++ doesn't support directly.
-template <GTEST_TEMPLATE_ Tmpl>
-struct TemplateSel {
- template <typename T>
- struct Bind {
- typedef Tmpl<T> type;
- };
-};
-
-# define GTEST_BIND_(TmplSel, T) \
- TmplSel::template Bind<T>::type
-
-// A unique struct template used as the default value for the
-// arguments of class template Templates. This allows us to simulate
-// variadic templates (e.g. Templates<int>, Templates<int, double>,
-// and etc), which C++ doesn't support directly.
-template <typename T>
-struct NoneT {};
-
-// The following family of struct and struct templates are used to
-// represent template lists. In particular, TemplatesN<T1, T2, ...,
-// TN> represents a list of N templates (T1, T2, ..., and TN). Except
-// for Templates0, every struct in the family has two member types:
-// Head for the selector of the first template in the list, and Tail
-// for the rest of the list.
-
-// The empty template list.
-struct Templates0 {};
-
-// Template lists of length 1, 2, 3, and so on.
-
-template <GTEST_TEMPLATE_ T1>
-struct Templates1 {
- typedef TemplateSel<T1> Head;
- typedef Templates0 Tail;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2>
-struct Templates2 {
- typedef TemplateSel<T1> Head;
- typedef Templates1<T2> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3>
-struct Templates3 {
- typedef TemplateSel<T1> Head;
- typedef Templates2<T2, T3> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4>
-struct Templates4 {
- typedef TemplateSel<T1> Head;
- typedef Templates3<T2, T3, T4> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5>
-struct Templates5 {
- typedef TemplateSel<T1> Head;
- typedef Templates4<T2, T3, T4, T5> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6>
-struct Templates6 {
- typedef TemplateSel<T1> Head;
- typedef Templates5<T2, T3, T4, T5, T6> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7>
-struct Templates7 {
- typedef TemplateSel<T1> Head;
- typedef Templates6<T2, T3, T4, T5, T6, T7> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8>
-struct Templates8 {
- typedef TemplateSel<T1> Head;
- typedef Templates7<T2, T3, T4, T5, T6, T7, T8> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9>
-struct Templates9 {
- typedef TemplateSel<T1> Head;
- typedef Templates8<T2, T3, T4, T5, T6, T7, T8, T9> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10>
-struct Templates10 {
- typedef TemplateSel<T1> Head;
- typedef Templates9<T2, T3, T4, T5, T6, T7, T8, T9, T10> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11>
-struct Templates11 {
- typedef TemplateSel<T1> Head;
- typedef Templates10<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12>
-struct Templates12 {
- typedef TemplateSel<T1> Head;
- typedef Templates11<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13>
-struct Templates13 {
- typedef TemplateSel<T1> Head;
- typedef Templates12<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14>
-struct Templates14 {
- typedef TemplateSel<T1> Head;
- typedef Templates13<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15>
-struct Templates15 {
- typedef TemplateSel<T1> Head;
- typedef Templates14<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16>
-struct Templates16 {
- typedef TemplateSel<T1> Head;
- typedef Templates15<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17>
-struct Templates17 {
- typedef TemplateSel<T1> Head;
- typedef Templates16<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18>
-struct Templates18 {
- typedef TemplateSel<T1> Head;
- typedef Templates17<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19>
-struct Templates19 {
- typedef TemplateSel<T1> Head;
- typedef Templates18<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20>
-struct Templates20 {
- typedef TemplateSel<T1> Head;
- typedef Templates19<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21>
-struct Templates21 {
- typedef TemplateSel<T1> Head;
- typedef Templates20<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22>
-struct Templates22 {
- typedef TemplateSel<T1> Head;
- typedef Templates21<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23>
-struct Templates23 {
- typedef TemplateSel<T1> Head;
- typedef Templates22<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24>
-struct Templates24 {
- typedef TemplateSel<T1> Head;
- typedef Templates23<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25>
-struct Templates25 {
- typedef TemplateSel<T1> Head;
- typedef Templates24<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26>
-struct Templates26 {
- typedef TemplateSel<T1> Head;
- typedef Templates25<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27>
-struct Templates27 {
- typedef TemplateSel<T1> Head;
- typedef Templates26<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28>
-struct Templates28 {
- typedef TemplateSel<T1> Head;
- typedef Templates27<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
- T28> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29>
-struct Templates29 {
- typedef TemplateSel<T1> Head;
- typedef Templates28<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30>
-struct Templates30 {
- typedef TemplateSel<T1> Head;
- typedef Templates29<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31>
-struct Templates31 {
- typedef TemplateSel<T1> Head;
- typedef Templates30<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32>
-struct Templates32 {
- typedef TemplateSel<T1> Head;
- typedef Templates31<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33>
-struct Templates33 {
- typedef TemplateSel<T1> Head;
- typedef Templates32<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
- GTEST_TEMPLATE_ T34>
-struct Templates34 {
- typedef TemplateSel<T1> Head;
- typedef Templates33<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
- GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35>
-struct Templates35 {
- typedef TemplateSel<T1> Head;
- typedef Templates34<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34, T35> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
- GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36>
-struct Templates36 {
- typedef TemplateSel<T1> Head;
- typedef Templates35<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34, T35, T36> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
- GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
- GTEST_TEMPLATE_ T37>
-struct Templates37 {
- typedef TemplateSel<T1> Head;
- typedef Templates36<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34, T35, T36, T37> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
- GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
- GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38>
-struct Templates38 {
- typedef TemplateSel<T1> Head;
- typedef Templates37<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
- GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
- GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39>
-struct Templates39 {
- typedef TemplateSel<T1> Head;
- typedef Templates38<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
- GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
- GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
- GTEST_TEMPLATE_ T40>
-struct Templates40 {
- typedef TemplateSel<T1> Head;
- typedef Templates39<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
- GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
- GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
- GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41>
-struct Templates41 {
- typedef TemplateSel<T1> Head;
- typedef Templates40<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
- GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
- GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
- GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42>
-struct Templates42 {
- typedef TemplateSel<T1> Head;
- typedef Templates41<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
- T42> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
- GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
- GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
- GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
- GTEST_TEMPLATE_ T43>
-struct Templates43 {
- typedef TemplateSel<T1> Head;
- typedef Templates42<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
- T43> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
- GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
- GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
- GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
- GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44>
-struct Templates44 {
- typedef TemplateSel<T1> Head;
- typedef Templates43<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
- T43, T44> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
- GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
- GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
- GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
- GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45>
-struct Templates45 {
- typedef TemplateSel<T1> Head;
- typedef Templates44<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
- T43, T44, T45> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
- GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
- GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
- GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
- GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
- GTEST_TEMPLATE_ T46>
-struct Templates46 {
- typedef TemplateSel<T1> Head;
- typedef Templates45<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
- T43, T44, T45, T46> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
- GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
- GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
- GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
- GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
- GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47>
-struct Templates47 {
- typedef TemplateSel<T1> Head;
- typedef Templates46<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
- T43, T44, T45, T46, T47> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
- GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
- GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
- GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
- GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
- GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48>
-struct Templates48 {
- typedef TemplateSel<T1> Head;
- typedef Templates47<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
- T43, T44, T45, T46, T47, T48> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
- GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
- GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
- GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
- GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
- GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
- GTEST_TEMPLATE_ T49>
-struct Templates49 {
- typedef TemplateSel<T1> Head;
- typedef Templates48<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
- T43, T44, T45, T46, T47, T48, T49> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
- GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
- GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
- GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
- GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
- GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
- GTEST_TEMPLATE_ T49, GTEST_TEMPLATE_ T50>
-struct Templates50 {
- typedef TemplateSel<T1> Head;
- typedef Templates49<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
- T43, T44, T45, T46, T47, T48, T49, T50> Tail;
-};
-
-
-// We don't want to require the users to write TemplatesN<...> directly,
-// as that would require them to count the length. Templates<...> is much
-// easier to write, but generates horrible messages when there is a
-// compiler error, as gcc insists on printing out each template
-// argument, even if it has the default value (this means Templates<list>
-// will appear as Templates<list, NoneT, NoneT, ..., NoneT> in the compiler
-// errors).
-//
-// Our solution is to combine the best part of the two approaches: a
-// user would write Templates<T1, ..., TN>, and Google Test will translate
-// that to TemplatesN<T1, ..., TN> internally to make error messages
-// readable. The translation is done by the 'type' member of the
-// Templates template.
-template <GTEST_TEMPLATE_ T1 = NoneT, GTEST_TEMPLATE_ T2 = NoneT,
- GTEST_TEMPLATE_ T3 = NoneT, GTEST_TEMPLATE_ T4 = NoneT,
- GTEST_TEMPLATE_ T5 = NoneT, GTEST_TEMPLATE_ T6 = NoneT,
- GTEST_TEMPLATE_ T7 = NoneT, GTEST_TEMPLATE_ T8 = NoneT,
- GTEST_TEMPLATE_ T9 = NoneT, GTEST_TEMPLATE_ T10 = NoneT,
- GTEST_TEMPLATE_ T11 = NoneT, GTEST_TEMPLATE_ T12 = NoneT,
- GTEST_TEMPLATE_ T13 = NoneT, GTEST_TEMPLATE_ T14 = NoneT,
- GTEST_TEMPLATE_ T15 = NoneT, GTEST_TEMPLATE_ T16 = NoneT,
- GTEST_TEMPLATE_ T17 = NoneT, GTEST_TEMPLATE_ T18 = NoneT,
- GTEST_TEMPLATE_ T19 = NoneT, GTEST_TEMPLATE_ T20 = NoneT,
- GTEST_TEMPLATE_ T21 = NoneT, GTEST_TEMPLATE_ T22 = NoneT,
- GTEST_TEMPLATE_ T23 = NoneT, GTEST_TEMPLATE_ T24 = NoneT,
- GTEST_TEMPLATE_ T25 = NoneT, GTEST_TEMPLATE_ T26 = NoneT,
- GTEST_TEMPLATE_ T27 = NoneT, GTEST_TEMPLATE_ T28 = NoneT,
- GTEST_TEMPLATE_ T29 = NoneT, GTEST_TEMPLATE_ T30 = NoneT,
- GTEST_TEMPLATE_ T31 = NoneT, GTEST_TEMPLATE_ T32 = NoneT,
- GTEST_TEMPLATE_ T33 = NoneT, GTEST_TEMPLATE_ T34 = NoneT,
- GTEST_TEMPLATE_ T35 = NoneT, GTEST_TEMPLATE_ T36 = NoneT,
- GTEST_TEMPLATE_ T37 = NoneT, GTEST_TEMPLATE_ T38 = NoneT,
- GTEST_TEMPLATE_ T39 = NoneT, GTEST_TEMPLATE_ T40 = NoneT,
- GTEST_TEMPLATE_ T41 = NoneT, GTEST_TEMPLATE_ T42 = NoneT,
- GTEST_TEMPLATE_ T43 = NoneT, GTEST_TEMPLATE_ T44 = NoneT,
- GTEST_TEMPLATE_ T45 = NoneT, GTEST_TEMPLATE_ T46 = NoneT,
- GTEST_TEMPLATE_ T47 = NoneT, GTEST_TEMPLATE_ T48 = NoneT,
- GTEST_TEMPLATE_ T49 = NoneT, GTEST_TEMPLATE_ T50 = NoneT>
-struct Templates {
- typedef Templates50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
- T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
- T42, T43, T44, T45, T46, T47, T48, T49, T50> type;
-};
-
-template <>
-struct Templates<NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT> {
- typedef Templates0 type;
-};
-template <GTEST_TEMPLATE_ T1>
-struct Templates<T1, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT> {
- typedef Templates1<T1> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2>
-struct Templates<T1, T2, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT> {
- typedef Templates2<T1, T2> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3>
-struct Templates<T1, T2, T3, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
- typedef Templates3<T1, T2, T3> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4>
-struct Templates<T1, T2, T3, T4, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
- typedef Templates4<T1, T2, T3, T4> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5>
-struct Templates<T1, T2, T3, T4, T5, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
- typedef Templates5<T1, T2, T3, T4, T5> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6>
-struct Templates<T1, T2, T3, T4, T5, T6, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
- typedef Templates6<T1, T2, T3, T4, T5, T6> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
- typedef Templates7<T1, T2, T3, T4, T5, T6, T7> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
- typedef Templates8<T1, T2, T3, T4, T5, T6, T7, T8> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
- typedef Templates9<T1, T2, T3, T4, T5, T6, T7, T8, T9> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
- typedef Templates10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
- typedef Templates11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
- typedef Templates12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
- typedef Templates13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
- typedef Templates14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT> {
- typedef Templates15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT> {
- typedef Templates16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT> {
- typedef Templates17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT> {
- typedef Templates18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT> {
- typedef Templates19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT> {
- typedef Templates20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT> {
- typedef Templates21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT> {
- typedef Templates22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT> {
- typedef Templates23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT> {
- typedef Templates24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT> {
- typedef Templates25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT> {
- typedef Templates26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT> {
- typedef Templates27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
- T27> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT> {
- typedef Templates28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
- T28> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT> {
- typedef Templates29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
- T28, T29> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
- typedef Templates30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
- T28, T29, T30> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
- typedef Templates31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
- T28, T29, T30, T31> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
- typedef Templates32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
- T28, T29, T30, T31, T32> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
- typedef Templates33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
- T28, T29, T30, T31, T32, T33> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
- GTEST_TEMPLATE_ T34>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33, T34, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
- typedef Templates34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
- T28, T29, T30, T31, T32, T33, T34> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
- GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33, T34, T35, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
- typedef Templates35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
- T28, T29, T30, T31, T32, T33, T34, T35> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
- GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33, T34, T35, T36, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
- typedef Templates36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
- T28, T29, T30, T31, T32, T33, T34, T35, T36> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
- GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
- GTEST_TEMPLATE_ T37>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33, T34, T35, T36, T37, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
- typedef Templates37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
- T28, T29, T30, T31, T32, T33, T34, T35, T36, T37> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
- GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
- GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33, T34, T35, T36, T37, T38, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
- typedef Templates38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
- T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
- GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
- GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
- typedef Templates39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
- T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
- GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
- GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
- GTEST_TEMPLATE_ T40>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
- typedef Templates40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
- T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
- GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
- GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
- GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
- typedef Templates41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
- T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
- T41> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
- GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
- GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
- GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
- typedef Templates42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
- T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
- T42> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
- GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
- GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
- GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
- GTEST_TEMPLATE_ T43>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
- typedef Templates43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
- T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
- T42, T43> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
- GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
- GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
- GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
- GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
- typedef Templates44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
- T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
- T42, T43, T44> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
- GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
- GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
- GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
- GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
- T45, NoneT, NoneT, NoneT, NoneT, NoneT> {
- typedef Templates45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
- T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
- T42, T43, T44, T45> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
- GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
- GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
- GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
- GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
- GTEST_TEMPLATE_ T46>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
- T45, T46, NoneT, NoneT, NoneT, NoneT> {
- typedef Templates46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
- T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
- T42, T43, T44, T45, T46> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
- GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
- GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
- GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
- GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
- GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
- T45, T46, T47, NoneT, NoneT, NoneT> {
- typedef Templates47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
- T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
- T42, T43, T44, T45, T46, T47> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
- GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
- GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
- GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
- GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
- GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
- T45, T46, T47, T48, NoneT, NoneT> {
- typedef Templates48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
- T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
- T42, T43, T44, T45, T46, T47, T48> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
- GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
- GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
- GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
- GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
- GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
- GTEST_TEMPLATE_ T49>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
- T45, T46, T47, T48, T49, NoneT> {
- typedef Templates49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
- T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
- T42, T43, T44, T45, T46, T47, T48, T49> type;
-};
-
-// The TypeList template makes it possible to use either a single type
-// or a Types<...> list in TYPED_TEST_CASE() and
-// INSTANTIATE_TYPED_TEST_CASE_P().
-
-template <typename T>
-struct TypeList {
- typedef Types1<T> type;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42, typename T43, typename T44, typename T45,
- typename T46, typename T47, typename T48, typename T49, typename T50>
-struct TypeList<Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
- T44, T45, T46, T47, T48, T49, T50> > {
- typedef typename Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
- T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
- T41, T42, T43, T44, T45, T46, T47, T48, T49, T50>::type type;
-};
-
-#endif // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
-
-} // namespace internal
-} // namespace testing
-
-#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
diff --git a/src/testing/gtest/include/gtest/internal/gtest-type-util.h.pump b/src/testing/gtest/include/gtest/internal/gtest-type-util.h.pump
deleted file mode 100644
index cdeb7a4c..00000000
--- a/src/testing/gtest/include/gtest/internal/gtest-type-util.h.pump
+++ /dev/null
@@ -1,298 +0,0 @@
-$$ -*- mode: c++; -*-
-$var n = 50 $$ Maximum length of type lists we want to support.
-// Copyright 2008 Google Inc.
-// All Rights Reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-// Type utilities needed for implementing typed and type-parameterized
-// tests. This file is generated by a SCRIPT. DO NOT EDIT BY HAND!
-//
-// Currently we support at most $n types in a list, and at most $n
-// type-parameterized tests in one type-parameterized test case.
-// Please contact googletestframework@googlegroups.com if you need
-// more.
-
-#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
-#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
-
-#include "gtest/internal/gtest-port.h"
-#include "gtest/internal/gtest-string.h"
-
-// #ifdef __GNUC__ is too general here. It is possible to use gcc without using
-// libstdc++ (which is where cxxabi.h comes from).
-# if GTEST_HAS_CXXABI_H_
-# include <cxxabi.h>
-# elif defined(__HP_aCC)
-# include <acxx_demangle.h>
-# endif // GTEST_HASH_CXXABI_H_
-
-namespace testing {
-namespace internal {
-
-// GetTypeName<T>() returns a human-readable name of type T.
-// NB: This function is also used in Google Mock, so don't move it inside of
-// the typed-test-only section below.
-template <typename T>
-String GetTypeName() {
-# if GTEST_HAS_RTTI
-
- const char* const name = typeid(T).name();
-# if GTEST_HAS_CXXABI_H_ || defined(__HP_aCC)
- int status = 0;
- // gcc's implementation of typeid(T).name() mangles the type name,
- // so we have to demangle it.
-# if GTEST_HAS_CXXABI_H_
- using abi::__cxa_demangle;
-# endif // GTEST_HAS_CXXABI_H_
- char* const readable_name = __cxa_demangle(name, 0, 0, &status);
- const String name_str(status == 0 ? readable_name : name);
- free(readable_name);
- return name_str;
-# else
- return name;
-# endif // GTEST_HAS_CXXABI_H_ || __HP_aCC
-
-# else
-
- return "<type>";
-
-# endif // GTEST_HAS_RTTI
-}
-
-#if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
-
-// AssertyTypeEq<T1, T2>::type is defined iff T1 and T2 are the same
-// type. This can be used as a compile-time assertion to ensure that
-// two types are equal.
-
-template <typename T1, typename T2>
-struct AssertTypeEq;
-
-template <typename T>
-struct AssertTypeEq<T, T> {
- typedef bool type;
-};
-
-// A unique type used as the default value for the arguments of class
-// template Types. This allows us to simulate variadic templates
-// (e.g. Types<int>, Type<int, double>, and etc), which C++ doesn't
-// support directly.
-struct None {};
-
-// The following family of struct and struct templates are used to
-// represent type lists. In particular, TypesN<T1, T2, ..., TN>
-// represents a type list with N types (T1, T2, ..., and TN) in it.
-// Except for Types0, every struct in the family has two member types:
-// Head for the first type in the list, and Tail for the rest of the
-// list.
-
-// The empty type list.
-struct Types0 {};
-
-// Type lists of length 1, 2, 3, and so on.
-
-template <typename T1>
-struct Types1 {
- typedef T1 Head;
- typedef Types0 Tail;
-};
-
-$range i 2..n
-
-$for i [[
-$range j 1..i
-$range k 2..i
-template <$for j, [[typename T$j]]>
-struct Types$i {
- typedef T1 Head;
- typedef Types$(i-1)<$for k, [[T$k]]> Tail;
-};
-
-
-]]
-
-} // namespace internal
-
-// We don't want to require the users to write TypesN<...> directly,
-// as that would require them to count the length. Types<...> is much
-// easier to write, but generates horrible messages when there is a
-// compiler error, as gcc insists on printing out each template
-// argument, even if it has the default value (this means Types<int>
-// will appear as Types<int, None, None, ..., None> in the compiler
-// errors).
-//
-// Our solution is to combine the best part of the two approaches: a
-// user would write Types<T1, ..., TN>, and Google Test will translate
-// that to TypesN<T1, ..., TN> internally to make error messages
-// readable. The translation is done by the 'type' member of the
-// Types template.
-
-$range i 1..n
-template <$for i, [[typename T$i = internal::None]]>
-struct Types {
- typedef internal::Types$n<$for i, [[T$i]]> type;
-};
-
-template <>
-struct Types<$for i, [[internal::None]]> {
- typedef internal::Types0 type;
-};
-
-$range i 1..n-1
-$for i [[
-$range j 1..i
-$range k i+1..n
-template <$for j, [[typename T$j]]>
-struct Types<$for j, [[T$j]]$for k[[, internal::None]]> {
- typedef internal::Types$i<$for j, [[T$j]]> type;
-};
-
-]]
-
-namespace internal {
-
-# define GTEST_TEMPLATE_ template <typename T> class
-
-// The template "selector" struct TemplateSel<Tmpl> is used to
-// represent Tmpl, which must be a class template with one type
-// parameter, as a type. TemplateSel<Tmpl>::Bind<T>::type is defined
-// as the type Tmpl<T>. This allows us to actually instantiate the
-// template "selected" by TemplateSel<Tmpl>.
-//
-// This trick is necessary for simulating typedef for class templates,
-// which C++ doesn't support directly.
-template <GTEST_TEMPLATE_ Tmpl>
-struct TemplateSel {
- template <typename T>
- struct Bind {
- typedef Tmpl<T> type;
- };
-};
-
-# define GTEST_BIND_(TmplSel, T) \
- TmplSel::template Bind<T>::type
-
-// A unique struct template used as the default value for the
-// arguments of class template Templates. This allows us to simulate
-// variadic templates (e.g. Templates<int>, Templates<int, double>,
-// and etc), which C++ doesn't support directly.
-template <typename T>
-struct NoneT {};
-
-// The following family of struct and struct templates are used to
-// represent template lists. In particular, TemplatesN<T1, T2, ...,
-// TN> represents a list of N templates (T1, T2, ..., and TN). Except
-// for Templates0, every struct in the family has two member types:
-// Head for the selector of the first template in the list, and Tail
-// for the rest of the list.
-
-// The empty template list.
-struct Templates0 {};
-
-// Template lists of length 1, 2, 3, and so on.
-
-template <GTEST_TEMPLATE_ T1>
-struct Templates1 {
- typedef TemplateSel<T1> Head;
- typedef Templates0 Tail;
-};
-
-$range i 2..n
-
-$for i [[
-$range j 1..i
-$range k 2..i
-template <$for j, [[GTEST_TEMPLATE_ T$j]]>
-struct Templates$i {
- typedef TemplateSel<T1> Head;
- typedef Templates$(i-1)<$for k, [[T$k]]> Tail;
-};
-
-
-]]
-
-// We don't want to require the users to write TemplatesN<...> directly,
-// as that would require them to count the length. Templates<...> is much
-// easier to write, but generates horrible messages when there is a
-// compiler error, as gcc insists on printing out each template
-// argument, even if it has the default value (this means Templates<list>
-// will appear as Templates<list, NoneT, NoneT, ..., NoneT> in the compiler
-// errors).
-//
-// Our solution is to combine the best part of the two approaches: a
-// user would write Templates<T1, ..., TN>, and Google Test will translate
-// that to TemplatesN<T1, ..., TN> internally to make error messages
-// readable. The translation is done by the 'type' member of the
-// Templates template.
-
-$range i 1..n
-template <$for i, [[GTEST_TEMPLATE_ T$i = NoneT]]>
-struct Templates {
- typedef Templates$n<$for i, [[T$i]]> type;
-};
-
-template <>
-struct Templates<$for i, [[NoneT]]> {
- typedef Templates0 type;
-};
-
-$range i 1..n-1
-$for i [[
-$range j 1..i
-$range k i+1..n
-template <$for j, [[GTEST_TEMPLATE_ T$j]]>
-struct Templates<$for j, [[T$j]]$for k[[, NoneT]]> {
- typedef Templates$i<$for j, [[T$j]]> type;
-};
-
-]]
-
-// The TypeList template makes it possible to use either a single type
-// or a Types<...> list in TYPED_TEST_CASE() and
-// INSTANTIATE_TYPED_TEST_CASE_P().
-
-template <typename T>
-struct TypeList {
- typedef Types1<T> type;
-};
-
-
-$range i 1..n
-template <$for i, [[typename T$i]]>
-struct TypeList<Types<$for i, [[T$i]]> > {
- typedef typename Types<$for i, [[T$i]]>::type type;
-};
-
-#endif // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
-
-} // namespace internal
-} // namespace testing
-
-#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
diff --git a/src/testing/gtest/m4/acx_pthread.m4 b/src/testing/gtest/m4/acx_pthread.m4
deleted file mode 100644
index 2cf20de1..00000000
--- a/src/testing/gtest/m4/acx_pthread.m4
+++ /dev/null
@@ -1,363 +0,0 @@
-# This was retrieved from
-# http://svn.0pointer.de/viewvc/trunk/common/acx_pthread.m4?revision=1277&root=avahi
-# See also (perhaps for new versions?)
-# http://svn.0pointer.de/viewvc/trunk/common/acx_pthread.m4?root=avahi
-#
-# We've rewritten the inconsistency check code (from avahi), to work
-# more broadly. In particular, it no longer assumes ld accepts -zdefs.
-# This caused a restructing of the code, but the functionality has only
-# changed a little.
-
-dnl @synopsis ACX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
-dnl
-dnl @summary figure out how to build C programs using POSIX threads
-dnl
-dnl This macro figures out how to build C programs using POSIX threads.
-dnl It sets the PTHREAD_LIBS output variable to the threads library and
-dnl linker flags, and the PTHREAD_CFLAGS output variable to any special
-dnl C compiler flags that are needed. (The user can also force certain
-dnl compiler flags/libs to be tested by setting these environment
-dnl variables.)
-dnl
-dnl Also sets PTHREAD_CC to any special C compiler that is needed for
-dnl multi-threaded programs (defaults to the value of CC otherwise).
-dnl (This is necessary on AIX to use the special cc_r compiler alias.)
-dnl
-dnl NOTE: You are assumed to not only compile your program with these
-dnl flags, but also link it with them as well. e.g. you should link
-dnl with $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS
-dnl $LIBS
-dnl
-dnl If you are only building threads programs, you may wish to use
-dnl these variables in your default LIBS, CFLAGS, and CC:
-dnl
-dnl LIBS="$PTHREAD_LIBS $LIBS"
-dnl CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
-dnl CC="$PTHREAD_CC"
-dnl
-dnl In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute
-dnl constant has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to
-dnl that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
-dnl
-dnl ACTION-IF-FOUND is a list of shell commands to run if a threads
-dnl library is found, and ACTION-IF-NOT-FOUND is a list of commands to
-dnl run it if it is not found. If ACTION-IF-FOUND is not specified, the
-dnl default action will define HAVE_PTHREAD.
-dnl
-dnl Please let the authors know if this macro fails on any platform, or
-dnl if you have any other suggestions or comments. This macro was based
-dnl on work by SGJ on autoconf scripts for FFTW (www.fftw.org) (with
-dnl help from M. Frigo), as well as ac_pthread and hb_pthread macros
-dnl posted by Alejandro Forero Cuervo to the autoconf macro repository.
-dnl We are also grateful for the helpful feedback of numerous users.
-dnl
-dnl @category InstalledPackages
-dnl @author Steven G. Johnson <stevenj@alum.mit.edu>
-dnl @version 2006-05-29
-dnl @license GPLWithACException
-dnl
-dnl Checks for GCC shared/pthread inconsistency based on work by
-dnl Marcin Owsiany <marcin@owsiany.pl>
-
-
-AC_DEFUN([ACX_PTHREAD], [
-AC_REQUIRE([AC_CANONICAL_HOST])
-AC_LANG_SAVE
-AC_LANG_C
-acx_pthread_ok=no
-
-# We used to check for pthread.h first, but this fails if pthread.h
-# requires special compiler flags (e.g. on True64 or Sequent).
-# It gets checked for in the link test anyway.
-
-# First of all, check if the user has set any of the PTHREAD_LIBS,
-# etcetera environment variables, and if threads linking works using
-# them:
-if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
- save_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
- save_LIBS="$LIBS"
- LIBS="$PTHREAD_LIBS $LIBS"
- AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS])
- AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes)
- AC_MSG_RESULT($acx_pthread_ok)
- if test x"$acx_pthread_ok" = xno; then
- PTHREAD_LIBS=""
- PTHREAD_CFLAGS=""
- fi
- LIBS="$save_LIBS"
- CFLAGS="$save_CFLAGS"
-fi
-
-# We must check for the threads library under a number of different
-# names; the ordering is very important because some systems
-# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
-# libraries is broken (non-POSIX).
-
-# Create a list of thread flags to try. Items starting with a "-" are
-# C compiler flags, and other items are library names, except for "none"
-# which indicates that we try without any flags at all, and "pthread-config"
-# which is a program returning the flags for the Pth emulation library.
-
-acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
-
-# The ordering *is* (sometimes) important. Some notes on the
-# individual items follow:
-
-# pthreads: AIX (must check this before -lpthread)
-# none: in case threads are in libc; should be tried before -Kthread and
-# other compiler flags to prevent continual compiler warnings
-# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
-# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
-# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
-# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
-# -pthreads: Solaris/gcc
-# -mthreads: Mingw32/gcc, Lynx/gcc
-# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
-# doesn't hurt to check since this sometimes defines pthreads too;
-# also defines -D_REENTRANT)
-# ... -mt is also the pthreads flag for HP/aCC
-# pthread: Linux, etcetera
-# --thread-safe: KAI C++
-# pthread-config: use pthread-config program (for GNU Pth library)
-
-case "${host_cpu}-${host_os}" in
- *solaris*)
-
- # On Solaris (at least, for some versions), libc contains stubbed
- # (non-functional) versions of the pthreads routines, so link-based
- # tests will erroneously succeed. (We need to link with -pthreads/-mt/
- # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather
- # a function called by this macro, so we could check for that, but
- # who knows whether they'll stub that too in a future libc.) So,
- # we'll just look for -pthreads and -lpthread first:
-
- acx_pthread_flags="-pthreads pthread -mt -pthread $acx_pthread_flags"
- ;;
-esac
-
-if test x"$acx_pthread_ok" = xno; then
-for flag in $acx_pthread_flags; do
-
- case $flag in
- none)
- AC_MSG_CHECKING([whether pthreads work without any flags])
- ;;
-
- -*)
- AC_MSG_CHECKING([whether pthreads work with $flag])
- PTHREAD_CFLAGS="$flag"
- ;;
-
- pthread-config)
- AC_CHECK_PROG(acx_pthread_config, pthread-config, yes, no)
- if test x"$acx_pthread_config" = xno; then continue; fi
- PTHREAD_CFLAGS="`pthread-config --cflags`"
- PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
- ;;
-
- *)
- AC_MSG_CHECKING([for the pthreads library -l$flag])
- PTHREAD_LIBS="-l$flag"
- ;;
- esac
-
- save_LIBS="$LIBS"
- save_CFLAGS="$CFLAGS"
- LIBS="$PTHREAD_LIBS $LIBS"
- CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
-
- # Check for various functions. We must include pthread.h,
- # since some functions may be macros. (On the Sequent, we
- # need a special flag -Kthread to make this header compile.)
- # We check for pthread_join because it is in -lpthread on IRIX
- # while pthread_create is in libc. We check for pthread_attr_init
- # due to DEC craziness with -lpthreads. We check for
- # pthread_cleanup_push because it is one of the few pthread
- # functions on Solaris that doesn't have a non-functional libc stub.
- # We try pthread_create on general principles.
- AC_TRY_LINK([#include <pthread.h>],
- [pthread_t th; pthread_join(th, 0);
- pthread_attr_init(0); pthread_cleanup_push(0, 0);
- pthread_create(0,0,0,0); pthread_cleanup_pop(0); ],
- [acx_pthread_ok=yes])
-
- LIBS="$save_LIBS"
- CFLAGS="$save_CFLAGS"
-
- AC_MSG_RESULT($acx_pthread_ok)
- if test "x$acx_pthread_ok" = xyes; then
- break;
- fi
-
- PTHREAD_LIBS=""
- PTHREAD_CFLAGS=""
-done
-fi
-
-# Various other checks:
-if test "x$acx_pthread_ok" = xyes; then
- save_LIBS="$LIBS"
- LIBS="$PTHREAD_LIBS $LIBS"
- save_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
-
- # Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
- AC_MSG_CHECKING([for joinable pthread attribute])
- attr_name=unknown
- for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
- AC_TRY_LINK([#include <pthread.h>], [int attr=$attr; return attr;],
- [attr_name=$attr; break])
- done
- AC_MSG_RESULT($attr_name)
- if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
- AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name,
- [Define to necessary symbol if this constant
- uses a non-standard name on your system.])
- fi
-
- AC_MSG_CHECKING([if more special flags are required for pthreads])
- flag=no
- case "${host_cpu}-${host_os}" in
- *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";;
- *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
- esac
- AC_MSG_RESULT(${flag})
- if test "x$flag" != xno; then
- PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
- fi
-
- LIBS="$save_LIBS"
- CFLAGS="$save_CFLAGS"
- # More AIX lossage: must compile with xlc_r or cc_r
- if test x"$GCC" != xyes; then
- AC_CHECK_PROGS(PTHREAD_CC, xlc_r cc_r, ${CC})
- else
- PTHREAD_CC=$CC
- fi
-
- # The next part tries to detect GCC inconsistency with -shared on some
- # architectures and systems. The problem is that in certain
- # configurations, when -shared is specified, GCC "forgets" to
- # internally use various flags which are still necessary.
-
- #
- # Prepare the flags
- #
- save_CFLAGS="$CFLAGS"
- save_LIBS="$LIBS"
- save_CC="$CC"
-
- # Try with the flags determined by the earlier checks.
- #
- # -Wl,-z,defs forces link-time symbol resolution, so that the
- # linking checks with -shared actually have any value
- #
- # FIXME: -fPIC is required for -shared on many architectures,
- # so we specify it here, but the right way would probably be to
- # properly detect whether it is actually required.
- CFLAGS="-shared -fPIC -Wl,-z,defs $CFLAGS $PTHREAD_CFLAGS"
- LIBS="$PTHREAD_LIBS $LIBS"
- CC="$PTHREAD_CC"
-
- # In order not to create several levels of indentation, we test
- # the value of "$done" until we find the cure or run out of ideas.
- done="no"
-
- # First, make sure the CFLAGS we added are actually accepted by our
- # compiler. If not (and OS X's ld, for instance, does not accept -z),
- # then we can't do this test.
- if test x"$done" = xno; then
- AC_MSG_CHECKING([whether to check for GCC pthread/shared inconsistencies])
- AC_TRY_LINK(,, , [done=yes])
-
- if test "x$done" = xyes ; then
- AC_MSG_RESULT([no])
- else
- AC_MSG_RESULT([yes])
- fi
- fi
-
- if test x"$done" = xno; then
- AC_MSG_CHECKING([whether -pthread is sufficient with -shared])
- AC_TRY_LINK([#include <pthread.h>],
- [pthread_t th; pthread_join(th, 0);
- pthread_attr_init(0); pthread_cleanup_push(0, 0);
- pthread_create(0,0,0,0); pthread_cleanup_pop(0); ],
- [done=yes])
-
- if test "x$done" = xyes; then
- AC_MSG_RESULT([yes])
- else
- AC_MSG_RESULT([no])
- fi
- fi
-
- #
- # Linux gcc on some architectures such as mips/mipsel forgets
- # about -lpthread
- #
- if test x"$done" = xno; then
- AC_MSG_CHECKING([whether -lpthread fixes that])
- LIBS="-lpthread $PTHREAD_LIBS $save_LIBS"
- AC_TRY_LINK([#include <pthread.h>],
- [pthread_t th; pthread_join(th, 0);
- pthread_attr_init(0); pthread_cleanup_push(0, 0);
- pthread_create(0,0,0,0); pthread_cleanup_pop(0); ],
- [done=yes])
-
- if test "x$done" = xyes; then
- AC_MSG_RESULT([yes])
- PTHREAD_LIBS="-lpthread $PTHREAD_LIBS"
- else
- AC_MSG_RESULT([no])
- fi
- fi
- #
- # FreeBSD 4.10 gcc forgets to use -lc_r instead of -lc
- #
- if test x"$done" = xno; then
- AC_MSG_CHECKING([whether -lc_r fixes that])
- LIBS="-lc_r $PTHREAD_LIBS $save_LIBS"
- AC_TRY_LINK([#include <pthread.h>],
- [pthread_t th; pthread_join(th, 0);
- pthread_attr_init(0); pthread_cleanup_push(0, 0);
- pthread_create(0,0,0,0); pthread_cleanup_pop(0); ],
- [done=yes])
-
- if test "x$done" = xyes; then
- AC_MSG_RESULT([yes])
- PTHREAD_LIBS="-lc_r $PTHREAD_LIBS"
- else
- AC_MSG_RESULT([no])
- fi
- fi
- if test x"$done" = xno; then
- # OK, we have run out of ideas
- AC_MSG_WARN([Impossible to determine how to use pthreads with shared libraries])
-
- # so it's not safe to assume that we may use pthreads
- acx_pthread_ok=no
- fi
-
- CFLAGS="$save_CFLAGS"
- LIBS="$save_LIBS"
- CC="$save_CC"
-else
- PTHREAD_CC="$CC"
-fi
-
-AC_SUBST(PTHREAD_LIBS)
-AC_SUBST(PTHREAD_CFLAGS)
-AC_SUBST(PTHREAD_CC)
-
-# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
-if test x"$acx_pthread_ok" = xyes; then
- ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1])
- :
-else
- acx_pthread_ok=no
- $2
-fi
-AC_LANG_RESTORE
-])dnl ACX_PTHREAD
diff --git a/src/testing/gtest/m4/gtest.m4 b/src/testing/gtest/m4/gtest.m4
deleted file mode 100644
index 6598ba75..00000000
--- a/src/testing/gtest/m4/gtest.m4
+++ /dev/null
@@ -1,74 +0,0 @@
-dnl GTEST_LIB_CHECK([minimum version [,
-dnl action if found [,action if not found]]])
-dnl
-dnl Check for the presence of the Google Test library, optionally at a minimum
-dnl version, and indicate a viable version with the HAVE_GTEST flag. It defines
-dnl standard variables for substitution including GTEST_CPPFLAGS,
-dnl GTEST_CXXFLAGS, GTEST_LDFLAGS, and GTEST_LIBS. It also defines
-dnl GTEST_VERSION as the version of Google Test found. Finally, it provides
-dnl optional custom action slots in the event GTEST is found or not.
-AC_DEFUN([GTEST_LIB_CHECK],
-[
-dnl Provide a flag to enable or disable Google Test usage.
-AC_ARG_ENABLE([gtest],
- [AS_HELP_STRING([--enable-gtest],
- [Enable tests using the Google C++ Testing Framework.
- (Default is enabled.)])],
- [],
- [enable_gtest=])
-AC_ARG_VAR([GTEST_CONFIG],
- [The exact path of Google Test's 'gtest-config' script.])
-AC_ARG_VAR([GTEST_CPPFLAGS],
- [C-like preprocessor flags for Google Test.])
-AC_ARG_VAR([GTEST_CXXFLAGS],
- [C++ compile flags for Google Test.])
-AC_ARG_VAR([GTEST_LDFLAGS],
- [Linker path and option flags for Google Test.])
-AC_ARG_VAR([GTEST_LIBS],
- [Library linking flags for Google Test.])
-AC_ARG_VAR([GTEST_VERSION],
- [The version of Google Test available.])
-HAVE_GTEST="no"
-AS_IF([test "x${enable_gtest}" != "xno"],
- [AC_MSG_CHECKING([for 'gtest-config'])
- AS_IF([test "x${enable_gtest}" != "xyes"],
- [AS_IF([test -x "${enable_gtest}/scripts/gtest-config"],
- [GTEST_CONFIG="${enable_gtest}/scripts/gtest-config"],
- [GTEST_CONFIG="${enable_gtest}/bin/gtest-config"])
- AS_IF([test -x "${GTEST_CONFIG}"], [],
- [AC_MSG_RESULT([no])
- AC_MSG_ERROR([dnl
-Unable to locate either a built or installed Google Test.
-The specific location '${enable_gtest}' was provided for a built or installed
-Google Test, but no 'gtest-config' script could be found at this location.])
- ])],
- [AC_PATH_PROG([GTEST_CONFIG], [gtest-config])])
- AS_IF([test -x "${GTEST_CONFIG}"],
- [AC_MSG_RESULT([${GTEST_CONFIG}])
- m4_ifval([$1],
- [_gtest_min_version="--min-version=$1"
- AC_MSG_CHECKING([for Google Test at least version >= $1])],
- [_gtest_min_version="--min-version=0"
- AC_MSG_CHECKING([for Google Test])])
- AS_IF([${GTEST_CONFIG} ${_gtest_min_version}],
- [AC_MSG_RESULT([yes])
- HAVE_GTEST='yes'],
- [AC_MSG_RESULT([no])])],
- [AC_MSG_RESULT([no])])
- AS_IF([test "x${HAVE_GTEST}" = "xyes"],
- [GTEST_CPPFLAGS=`${GTEST_CONFIG} --cppflags`
- GTEST_CXXFLAGS=`${GTEST_CONFIG} --cxxflags`
- GTEST_LDFLAGS=`${GTEST_CONFIG} --ldflags`
- GTEST_LIBS=`${GTEST_CONFIG} --libs`
- GTEST_VERSION=`${GTEST_CONFIG} --version`
- AC_DEFINE([HAVE_GTEST],[1],[Defined when Google Test is available.])],
- [AS_IF([test "x${enable_gtest}" = "xyes"],
- [AC_MSG_ERROR([dnl
-Google Test was enabled, but no viable version could be found.])
- ])])])
-AC_SUBST([HAVE_GTEST])
-AM_CONDITIONAL([HAVE_GTEST],[test "x$HAVE_GTEST" = "xyes"])
-AS_IF([test "x$HAVE_GTEST" = "xyes"],
- [m4_ifval([$2], [$2])],
- [m4_ifval([$3], [$3])])
-])
diff --git a/src/testing/gtest/make/Makefile b/src/testing/gtest/make/Makefile
deleted file mode 100644
index 5b27b6a2..00000000
--- a/src/testing/gtest/make/Makefile
+++ /dev/null
@@ -1,80 +0,0 @@
-# A sample Makefile for building Google Test and using it in user
-# tests. Please tweak it to suit your environment and project. You
-# may want to move it to your project's root directory.
-#
-# SYNOPSIS:
-#
-# make [all] - makes everything.
-# make TARGET - makes the given target.
-# make clean - removes all files generated by make.
-
-# Please tweak the following variable definitions as needed by your
-# project, except GTEST_HEADERS, which you can use in your own targets
-# but shouldn't modify.
-
-# Points to the root of Google Test, relative to where this file is.
-# Remember to tweak this if you move this file.
-GTEST_DIR = ..
-
-# Where to find user code.
-USER_DIR = ../samples
-
-# Flags passed to the preprocessor.
-CPPFLAGS += -I$(GTEST_DIR)/include
-
-# Flags passed to the C++ compiler.
-CXXFLAGS += -g -Wall -Wextra
-
-# All tests produced by this Makefile. Remember to add new tests you
-# created to the list.
-TESTS = sample1_unittest
-
-# All Google Test headers. Usually you shouldn't change this
-# definition.
-GTEST_HEADERS = $(GTEST_DIR)/include/gtest/*.h \
- $(GTEST_DIR)/include/gtest/internal/*.h
-
-# House-keeping build targets.
-
-all : $(TESTS)
-
-clean :
- rm -f $(TESTS) gtest.a gtest_main.a *.o
-
-# Builds gtest.a and gtest_main.a.
-
-# Usually you shouldn't tweak such internal variables, indicated by a
-# trailing _.
-GTEST_SRCS_ = $(GTEST_DIR)/src/*.cc $(GTEST_DIR)/src/*.h $(GTEST_HEADERS)
-
-# For simplicity and to avoid depending on Google Test's
-# implementation details, the dependencies specified below are
-# conservative and not optimized. This is fine as Google Test
-# compiles fast and for ordinary users its source rarely changes.
-gtest-all.o : $(GTEST_SRCS_)
- $(CXX) $(CPPFLAGS) -I$(GTEST_DIR) $(CXXFLAGS) -c \
- $(GTEST_DIR)/src/gtest-all.cc
-
-gtest_main.o : $(GTEST_SRCS_)
- $(CXX) $(CPPFLAGS) -I$(GTEST_DIR) $(CXXFLAGS) -c \
- $(GTEST_DIR)/src/gtest_main.cc
-
-gtest.a : gtest-all.o
- $(AR) $(ARFLAGS) $@ $^
-
-gtest_main.a : gtest-all.o gtest_main.o
- $(AR) $(ARFLAGS) $@ $^
-
-# Builds a sample test. A test should link with either gtest.a or
-# gtest_main.a, depending on whether it defines its own main()
-# function.
-
-sample1.o : $(USER_DIR)/sample1.cc $(USER_DIR)/sample1.h $(GTEST_HEADERS)
- $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(USER_DIR)/sample1.cc
-
-sample1_unittest.o : $(USER_DIR)/sample1_unittest.cc \
- $(USER_DIR)/sample1.h $(GTEST_HEADERS)
- $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(USER_DIR)/sample1_unittest.cc
-
-sample1_unittest : sample1.o sample1_unittest.o gtest_main.a
- $(CXX) $(CPPFLAGS) $(CXXFLAGS) -lpthread $^ -o $@
diff --git a/src/testing/gtest/msvc/gtest-md.sln b/src/testing/gtest/msvc/gtest-md.sln
deleted file mode 100644
index f7908da1..00000000
--- a/src/testing/gtest/msvc/gtest-md.sln
+++ /dev/null
@@ -1,45 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 8.00
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtest-md", "gtest-md.vcproj", "{C8F6C172-56F2-4E76-B5FA-C3B423B31BE8}"
- ProjectSection(ProjectDependencies) = postProject
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtest_main-md", "gtest_main-md.vcproj", "{3AF54C8A-10BF-4332-9147-F68ED9862033}"
- ProjectSection(ProjectDependencies) = postProject
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtest_prod_test-md", "gtest_prod_test-md.vcproj", "{24848551-EF4F-47E8-9A9D-EA4D49BC3ECB}"
- ProjectSection(ProjectDependencies) = postProject
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtest_unittest-md", "gtest_unittest-md.vcproj", "{4D9FDFB5-986A-4139-823C-F4EE0ED481A2}"
- ProjectSection(ProjectDependencies) = postProject
- EndProjectSection
-EndProject
-Global
- GlobalSection(SolutionConfiguration) = preSolution
- Debug = Debug
- Release = Release
- EndGlobalSection
- GlobalSection(ProjectConfiguration) = postSolution
- {C8F6C172-56F2-4E76-B5FA-C3B423B31BE8}.Debug.ActiveCfg = Debug|Win32
- {C8F6C172-56F2-4E76-B5FA-C3B423B31BE8}.Debug.Build.0 = Debug|Win32
- {C8F6C172-56F2-4E76-B5FA-C3B423B31BE8}.Release.ActiveCfg = Release|Win32
- {C8F6C172-56F2-4E76-B5FA-C3B423B31BE8}.Release.Build.0 = Release|Win32
- {3AF54C8A-10BF-4332-9147-F68ED9862033}.Debug.ActiveCfg = Debug|Win32
- {3AF54C8A-10BF-4332-9147-F68ED9862033}.Debug.Build.0 = Debug|Win32
- {3AF54C8A-10BF-4332-9147-F68ED9862033}.Release.ActiveCfg = Release|Win32
- {3AF54C8A-10BF-4332-9147-F68ED9862033}.Release.Build.0 = Release|Win32
- {24848551-EF4F-47E8-9A9D-EA4D49BC3ECB}.Debug.ActiveCfg = Debug|Win32
- {24848551-EF4F-47E8-9A9D-EA4D49BC3ECB}.Debug.Build.0 = Debug|Win32
- {24848551-EF4F-47E8-9A9D-EA4D49BC3ECB}.Release.ActiveCfg = Release|Win32
- {24848551-EF4F-47E8-9A9D-EA4D49BC3ECB}.Release.Build.0 = Release|Win32
- {4D9FDFB5-986A-4139-823C-F4EE0ED481A2}.Debug.ActiveCfg = Debug|Win32
- {4D9FDFB5-986A-4139-823C-F4EE0ED481A2}.Debug.Build.0 = Debug|Win32
- {4D9FDFB5-986A-4139-823C-F4EE0ED481A2}.Release.ActiveCfg = Release|Win32
- {4D9FDFB5-986A-4139-823C-F4EE0ED481A2}.Release.Build.0 = Release|Win32
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- EndGlobalSection
- GlobalSection(ExtensibilityAddIns) = postSolution
- EndGlobalSection
-EndGlobal
diff --git a/src/testing/gtest/msvc/gtest-md.vcproj b/src/testing/gtest/msvc/gtest-md.vcproj
deleted file mode 100644
index 1c35c3a5..00000000
--- a/src/testing/gtest/msvc/gtest-md.vcproj
+++ /dev/null
@@ -1,126 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="7.10"
- Name="gtest-md"
- ProjectGUID="{C8F6C172-56F2-4E76-B5FA-C3B423B31BE8}"
- Keyword="Win32Proj">
- <Platforms>
- <Platform
- Name="Win32"/>
- </Platforms>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionName)/$(ConfigurationName)"
- IntermediateDirectory="$(OutDir)/$(ProjectName)"
- ConfigurationType="4"
- CharacterSet="2"
- ReferencesPath="">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
- MinimalRebuild="TRUE"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="FALSE"
- DebugInformationFormat="4"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/gtestd.lib"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionName)/$(ConfigurationName)"
- IntermediateDirectory="$(OutDir)/$(ProjectName)"
- ConfigurationType="4"
- CharacterSet="2"
- ReferencesPath="&quot;..\include&quot;;&quot;..&quot;">
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
- RuntimeLibrary="2"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="FALSE"
- DebugInformationFormat="3"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/gtest.lib"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
- <File
- RelativePath="..\src\gtest-all.cc">
- <FileConfiguration
- Name="Debug|Win32">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"/>
- </FileConfiguration>
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/src/testing/gtest/msvc/gtest.sln b/src/testing/gtest/msvc/gtest.sln
deleted file mode 100644
index ef4b057f..00000000
--- a/src/testing/gtest/msvc/gtest.sln
+++ /dev/null
@@ -1,45 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 8.00
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtest", "gtest.vcproj", "{C8F6C172-56F2-4E76-B5FA-C3B423B31BE7}"
- ProjectSection(ProjectDependencies) = postProject
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtest_main", "gtest_main.vcproj", "{3AF54C8A-10BF-4332-9147-F68ED9862032}"
- ProjectSection(ProjectDependencies) = postProject
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtest_unittest", "gtest_unittest.vcproj", "{4D9FDFB5-986A-4139-823C-F4EE0ED481A1}"
- ProjectSection(ProjectDependencies) = postProject
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtest_prod_test", "gtest_prod_test.vcproj", "{24848551-EF4F-47E8-9A9D-EA4D49BC3ECA}"
- ProjectSection(ProjectDependencies) = postProject
- EndProjectSection
-EndProject
-Global
- GlobalSection(SolutionConfiguration) = preSolution
- Debug = Debug
- Release = Release
- EndGlobalSection
- GlobalSection(ProjectConfiguration) = postSolution
- {C8F6C172-56F2-4E76-B5FA-C3B423B31BE7}.Debug.ActiveCfg = Debug|Win32
- {C8F6C172-56F2-4E76-B5FA-C3B423B31BE7}.Debug.Build.0 = Debug|Win32
- {C8F6C172-56F2-4E76-B5FA-C3B423B31BE7}.Release.ActiveCfg = Release|Win32
- {C8F6C172-56F2-4E76-B5FA-C3B423B31BE7}.Release.Build.0 = Release|Win32
- {3AF54C8A-10BF-4332-9147-F68ED9862032}.Debug.ActiveCfg = Debug|Win32
- {3AF54C8A-10BF-4332-9147-F68ED9862032}.Debug.Build.0 = Debug|Win32
- {3AF54C8A-10BF-4332-9147-F68ED9862032}.Release.ActiveCfg = Release|Win32
- {3AF54C8A-10BF-4332-9147-F68ED9862032}.Release.Build.0 = Release|Win32
- {4D9FDFB5-986A-4139-823C-F4EE0ED481A1}.Debug.ActiveCfg = Debug|Win32
- {4D9FDFB5-986A-4139-823C-F4EE0ED481A1}.Debug.Build.0 = Debug|Win32
- {4D9FDFB5-986A-4139-823C-F4EE0ED481A1}.Release.ActiveCfg = Release|Win32
- {4D9FDFB5-986A-4139-823C-F4EE0ED481A1}.Release.Build.0 = Release|Win32
- {24848551-EF4F-47E8-9A9D-EA4D49BC3ECA}.Debug.ActiveCfg = Debug|Win32
- {24848551-EF4F-47E8-9A9D-EA4D49BC3ECA}.Debug.Build.0 = Debug|Win32
- {24848551-EF4F-47E8-9A9D-EA4D49BC3ECA}.Release.ActiveCfg = Release|Win32
- {24848551-EF4F-47E8-9A9D-EA4D49BC3ECA}.Release.Build.0 = Release|Win32
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- EndGlobalSection
- GlobalSection(ExtensibilityAddIns) = postSolution
- EndGlobalSection
-EndGlobal
diff --git a/src/testing/gtest/msvc/gtest.vcproj b/src/testing/gtest/msvc/gtest.vcproj
deleted file mode 100644
index a8373ce9..00000000
--- a/src/testing/gtest/msvc/gtest.vcproj
+++ /dev/null
@@ -1,126 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="7.10"
- Name="gtest"
- ProjectGUID="{C8F6C172-56F2-4E76-B5FA-C3B423B31BE7}"
- Keyword="Win32Proj">
- <Platforms>
- <Platform
- Name="Win32"/>
- </Platforms>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionName)/$(ConfigurationName)"
- IntermediateDirectory="$(OutDir)/$(ProjectName)"
- ConfigurationType="4"
- CharacterSet="2"
- ReferencesPath="">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
- MinimalRebuild="TRUE"
- BasicRuntimeChecks="3"
- RuntimeLibrary="5"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="FALSE"
- DebugInformationFormat="4"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/gtestd.lib"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionName)/$(ConfigurationName)"
- IntermediateDirectory="$(OutDir)/$(ProjectName)"
- ConfigurationType="4"
- CharacterSet="2"
- ReferencesPath="&quot;..\include&quot;;&quot;..&quot;">
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
- RuntimeLibrary="4"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="FALSE"
- DebugInformationFormat="3"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/gtest.lib"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
- <File
- RelativePath="..\src\gtest-all.cc">
- <FileConfiguration
- Name="Debug|Win32">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"/>
- </FileConfiguration>
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/src/testing/gtest/msvc/gtest_main-md.vcproj b/src/testing/gtest/msvc/gtest_main-md.vcproj
deleted file mode 100644
index b5379fe6..00000000
--- a/src/testing/gtest/msvc/gtest_main-md.vcproj
+++ /dev/null
@@ -1,129 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="7.10"
- Name="gtest_main-md"
- ProjectGUID="{3AF54C8A-10BF-4332-9147-F68ED9862033}"
- Keyword="Win32Proj">
- <Platforms>
- <Platform
- Name="Win32"/>
- </Platforms>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionName)/$(ConfigurationName)"
- IntermediateDirectory="$(OutDir)/$(ProjectName)"
- ConfigurationType="4"
- CharacterSet="2"
- ReferencesPath="">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
- MinimalRebuild="TRUE"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="FALSE"
- DebugInformationFormat="4"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/$(ProjectName)d.lib"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionName)/$(ConfigurationName)"
- IntermediateDirectory="$(OutDir)/$(ProjectName)"
- ConfigurationType="4"
- CharacterSet="2"
- ReferencesPath="&quot;..\include&quot;;&quot;..&quot;">
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
- RuntimeLibrary="2"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="FALSE"
- DebugInformationFormat="3"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/$(ProjectName).lib"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- </Configurations>
- <References>
- <ProjectReference
- ReferencedProjectIdentifier="{C8F6C172-56F2-4E76-B5FA-C3B423B31BE8}"
- Name="gtest-md"/>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
- <File
- RelativePath="..\src\gtest_main.cc">
- <FileConfiguration
- Name="Debug|Win32">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"/>
- </FileConfiguration>
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/src/testing/gtest/msvc/gtest_main.vcproj b/src/testing/gtest/msvc/gtest_main.vcproj
deleted file mode 100644
index e8b763c5..00000000
--- a/src/testing/gtest/msvc/gtest_main.vcproj
+++ /dev/null
@@ -1,129 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="7.10"
- Name="gtest_main"
- ProjectGUID="{3AF54C8A-10BF-4332-9147-F68ED9862032}"
- Keyword="Win32Proj">
- <Platforms>
- <Platform
- Name="Win32"/>
- </Platforms>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionName)/$(ConfigurationName)"
- IntermediateDirectory="$(OutDir)/$(ProjectName)"
- ConfigurationType="4"
- CharacterSet="2"
- ReferencesPath="">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
- MinimalRebuild="TRUE"
- BasicRuntimeChecks="3"
- RuntimeLibrary="5"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="FALSE"
- DebugInformationFormat="4"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/$(ProjectName)d.lib"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionName)/$(ConfigurationName)"
- IntermediateDirectory="$(OutDir)/$(ProjectName)"
- ConfigurationType="4"
- CharacterSet="2"
- ReferencesPath="&quot;..\include&quot;;&quot;..&quot;">
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
- RuntimeLibrary="4"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="FALSE"
- DebugInformationFormat="3"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/$(ProjectName).lib"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- </Configurations>
- <References>
- <ProjectReference
- ReferencedProjectIdentifier="{C8F6C172-56F2-4E76-B5FA-C3B423B31BE7}"
- Name="gtest"/>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
- <File
- RelativePath="..\src\gtest_main.cc">
- <FileConfiguration
- Name="Debug|Win32">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"/>
- </FileConfiguration>
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/src/testing/gtest/msvc/gtest_prod_test-md.vcproj b/src/testing/gtest/msvc/gtest_prod_test-md.vcproj
deleted file mode 100644
index 05b05d9e..00000000
--- a/src/testing/gtest/msvc/gtest_prod_test-md.vcproj
+++ /dev/null
@@ -1,164 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="7.10"
- Name="gtest_prod_test-md"
- ProjectGUID="{24848551-EF4F-47E8-9A9D-EA4D49BC3ECB}"
- Keyword="Win32Proj">
- <Platforms>
- <Platform
- Name="Win32"/>
- </Platforms>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionName)/$(ConfigurationName)"
- IntermediateDirectory="$(OutDir)/$(ProjectName)"
- ConfigurationType="1"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
- MinimalRebuild="TRUE"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- UsePrecompiledHeader="3"
- WarningLevel="3"
- Detect64BitPortabilityProblems="FALSE"
- DebugInformationFormat="4"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)/gtest_prod_test.exe"
- LinkIncremental="2"
- GenerateDebugInformation="TRUE"
- ProgramDatabaseFile="$(OutDir)/gtest_prod_test.pdb"
- SubSystem="1"
- TargetMachine="1"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionName)/$(ConfigurationName)"
- IntermediateDirectory="$(OutDir)/$(ProjectName)"
- ConfigurationType="1"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
- RuntimeLibrary="2"
- UsePrecompiledHeader="3"
- WarningLevel="3"
- Detect64BitPortabilityProblems="FALSE"
- DebugInformationFormat="3"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)/gtest_prod_test.exe"
- LinkIncremental="1"
- GenerateDebugInformation="TRUE"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- </Configurations>
- <References>
- <ProjectReference
- ReferencedProjectIdentifier="{3AF54C8A-10BF-4332-9147-F68ED9862033}"
- Name="gtest_main-md"/>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
- <File
- RelativePath="..\test\gtest_prod_test.cc">
- <FileConfiguration
- Name="Debug|Win32">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"
- UsePrecompiledHeader="0"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"
- UsePrecompiledHeader="0"/>
- </FileConfiguration>
- </File>
- <File
- RelativePath="..\test\production.cc">
- <FileConfiguration
- Name="Debug|Win32">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"
- UsePrecompiledHeader="0"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"
- UsePrecompiledHeader="0"/>
- </FileConfiguration>
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
- <File
- RelativePath="..\test\production.h">
- </File>
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/src/testing/gtest/msvc/gtest_prod_test.vcproj b/src/testing/gtest/msvc/gtest_prod_test.vcproj
deleted file mode 100644
index 6d7a2f02..00000000
--- a/src/testing/gtest/msvc/gtest_prod_test.vcproj
+++ /dev/null
@@ -1,164 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="7.10"
- Name="gtest_prod_test"
- ProjectGUID="{24848551-EF4F-47E8-9A9D-EA4D49BC3ECA}"
- Keyword="Win32Proj">
- <Platforms>
- <Platform
- Name="Win32"/>
- </Platforms>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionName)/$(ConfigurationName)"
- IntermediateDirectory="$(OutDir)/$(ProjectName)"
- ConfigurationType="1"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
- MinimalRebuild="TRUE"
- BasicRuntimeChecks="3"
- RuntimeLibrary="5"
- UsePrecompiledHeader="3"
- WarningLevel="3"
- Detect64BitPortabilityProblems="FALSE"
- DebugInformationFormat="4"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)/gtest_prod_test.exe"
- LinkIncremental="2"
- GenerateDebugInformation="TRUE"
- ProgramDatabaseFile="$(OutDir)/gtest_prod_test.pdb"
- SubSystem="1"
- TargetMachine="1"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionName)/$(ConfigurationName)"
- IntermediateDirectory="$(OutDir)/$(ProjectName)"
- ConfigurationType="1"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
- RuntimeLibrary="4"
- UsePrecompiledHeader="3"
- WarningLevel="3"
- Detect64BitPortabilityProblems="FALSE"
- DebugInformationFormat="3"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)/gtest_prod_test.exe"
- LinkIncremental="1"
- GenerateDebugInformation="TRUE"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- </Configurations>
- <References>
- <ProjectReference
- ReferencedProjectIdentifier="{3AF54C8A-10BF-4332-9147-F68ED9862032}"
- Name="gtest_main"/>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
- <File
- RelativePath="..\test\gtest_prod_test.cc">
- <FileConfiguration
- Name="Debug|Win32">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"
- UsePrecompiledHeader="0"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"
- UsePrecompiledHeader="0"/>
- </FileConfiguration>
- </File>
- <File
- RelativePath="..\test\production.cc">
- <FileConfiguration
- Name="Debug|Win32">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"
- UsePrecompiledHeader="0"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"
- UsePrecompiledHeader="0"/>
- </FileConfiguration>
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
- <File
- RelativePath="..\test\production.h">
- </File>
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/src/testing/gtest/msvc/gtest_unittest-md.vcproj b/src/testing/gtest/msvc/gtest_unittest-md.vcproj
deleted file mode 100644
index 38a5e566..00000000
--- a/src/testing/gtest/msvc/gtest_unittest-md.vcproj
+++ /dev/null
@@ -1,147 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="7.10"
- Name="gtest_unittest-md"
- ProjectGUID="{4D9FDFB5-986A-4139-823C-F4EE0ED481A2}"
- Keyword="Win32Proj">
- <Platforms>
- <Platform
- Name="Win32"/>
- </Platforms>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionName)/$(ConfigurationName)"
- IntermediateDirectory="$(OutDir)/$(ProjectName)"
- ConfigurationType="1"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
- MinimalRebuild="TRUE"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- UsePrecompiledHeader="3"
- WarningLevel="3"
- Detect64BitPortabilityProblems="FALSE"
- DebugInformationFormat="4"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)/gtest_unittest.exe"
- LinkIncremental="2"
- GenerateDebugInformation="TRUE"
- ProgramDatabaseFile="$(OutDir)/gtest_unittest.pdb"
- SubSystem="1"
- TargetMachine="1"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionName)/$(ConfigurationName)"
- IntermediateDirectory="$(OutDir)/$(ProjectName)"
- ConfigurationType="1"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
- RuntimeLibrary="2"
- UsePrecompiledHeader="3"
- WarningLevel="3"
- Detect64BitPortabilityProblems="FALSE"
- DebugInformationFormat="3"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)/gtest_unittest.exe"
- LinkIncremental="1"
- GenerateDebugInformation="TRUE"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- </Configurations>
- <References>
- <ProjectReference
- ReferencedProjectIdentifier="{3AF54C8A-10BF-4332-9147-F68ED9862033}"
- Name="gtest_main-md"/>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
- <File
- RelativePath="..\test\gtest_unittest.cc">
- <FileConfiguration
- Name="Debug|Win32">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="1"
- AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"
- BasicRuntimeChecks="0"
- UsePrecompiledHeader="0"
- DebugInformationFormat="3"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"
- UsePrecompiledHeader="0"/>
- </FileConfiguration>
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/src/testing/gtest/msvc/gtest_unittest.vcproj b/src/testing/gtest/msvc/gtest_unittest.vcproj
deleted file mode 100644
index cb1f52b1..00000000
--- a/src/testing/gtest/msvc/gtest_unittest.vcproj
+++ /dev/null
@@ -1,147 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="7.10"
- Name="gtest_unittest"
- ProjectGUID="{4D9FDFB5-986A-4139-823C-F4EE0ED481A1}"
- Keyword="Win32Proj">
- <Platforms>
- <Platform
- Name="Win32"/>
- </Platforms>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionName)/$(ConfigurationName)"
- IntermediateDirectory="$(OutDir)/$(ProjectName)"
- ConfigurationType="1"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
- MinimalRebuild="TRUE"
- BasicRuntimeChecks="3"
- RuntimeLibrary="5"
- UsePrecompiledHeader="3"
- WarningLevel="3"
- Detect64BitPortabilityProblems="FALSE"
- DebugInformationFormat="4"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)/gtest_unittest.exe"
- LinkIncremental="2"
- GenerateDebugInformation="TRUE"
- ProgramDatabaseFile="$(OutDir)/gtest_unittest.pdb"
- SubSystem="1"
- TargetMachine="1"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionName)/$(ConfigurationName)"
- IntermediateDirectory="$(OutDir)/$(ProjectName)"
- ConfigurationType="1"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
- RuntimeLibrary="4"
- UsePrecompiledHeader="3"
- WarningLevel="3"
- Detect64BitPortabilityProblems="FALSE"
- DebugInformationFormat="3"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)/gtest_unittest.exe"
- LinkIncremental="1"
- GenerateDebugInformation="TRUE"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- </Configurations>
- <References>
- <ProjectReference
- ReferencedProjectIdentifier="{3AF54C8A-10BF-4332-9147-F68ED9862032}"
- Name="gtest_main"/>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
- <File
- RelativePath="..\test\gtest_unittest.cc">
- <FileConfiguration
- Name="Debug|Win32">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="1"
- AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"
- BasicRuntimeChecks="0"
- UsePrecompiledHeader="0"
- DebugInformationFormat="3"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"
- UsePrecompiledHeader="0"/>
- </FileConfiguration>
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/src/testing/gtest/samples/prime_tables.h b/src/testing/gtest/samples/prime_tables.h
deleted file mode 100644
index 92ce16a0..00000000
--- a/src/testing/gtest/samples/prime_tables.h
+++ /dev/null
@@ -1,123 +0,0 @@
-// Copyright 2008 Google Inc.
-// All Rights Reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-// Author: vladl@google.com (Vlad Losev)
-
-// This provides interface PrimeTable that determines whether a number is a
-// prime and determines a next prime number. This interface is used
-// in Google Test samples demonstrating use of parameterized tests.
-
-#ifndef GTEST_SAMPLES_PRIME_TABLES_H_
-#define GTEST_SAMPLES_PRIME_TABLES_H_
-
-#include <algorithm>
-
-// The prime table interface.
-class PrimeTable {
- public:
- virtual ~PrimeTable() {}
-
- // Returns true iff n is a prime number.
- virtual bool IsPrime(int n) const = 0;
-
- // Returns the smallest prime number greater than p; or returns -1
- // if the next prime is beyond the capacity of the table.
- virtual int GetNextPrime(int p) const = 0;
-};
-
-// Implementation #1 calculates the primes on-the-fly.
-class OnTheFlyPrimeTable : public PrimeTable {
- public:
- virtual bool IsPrime(int n) const {
- if (n <= 1) return false;
-
- for (int i = 2; i*i <= n; i++) {
- // n is divisible by an integer other than 1 and itself.
- if ((n % i) == 0) return false;
- }
-
- return true;
- }
-
- virtual int GetNextPrime(int p) const {
- for (int n = p + 1; n > 0; n++) {
- if (IsPrime(n)) return n;
- }
-
- return -1;
- }
-};
-
-// Implementation #2 pre-calculates the primes and stores the result
-// in an array.
-class PreCalculatedPrimeTable : public PrimeTable {
- public:
- // 'max' specifies the maximum number the prime table holds.
- explicit PreCalculatedPrimeTable(int max)
- : is_prime_size_(max + 1), is_prime_(new bool[max + 1]) {
- CalculatePrimesUpTo(max);
- }
- virtual ~PreCalculatedPrimeTable() { delete[] is_prime_; }
-
- virtual bool IsPrime(int n) const {
- return 0 <= n && n < is_prime_size_ && is_prime_[n];
- }
-
- virtual int GetNextPrime(int p) const {
- for (int n = p + 1; n < is_prime_size_; n++) {
- if (is_prime_[n]) return n;
- }
-
- return -1;
- }
-
- private:
- void CalculatePrimesUpTo(int max) {
- ::std::fill(is_prime_, is_prime_ + is_prime_size_, true);
- is_prime_[0] = is_prime_[1] = false;
-
- for (int i = 2; i <= max; i++) {
- if (!is_prime_[i]) continue;
-
- // Marks all multiples of i (except i itself) as non-prime.
- for (int j = 2*i; j <= max; j += i) {
- is_prime_[j] = false;
- }
- }
- }
-
- const int is_prime_size_;
- bool* const is_prime_;
-
- // Disables compiler warning "assignment operator could not be generated."
- void operator=(const PreCalculatedPrimeTable& rhs);
-};
-
-#endif // GTEST_SAMPLES_PRIME_TABLES_H_
diff --git a/src/testing/gtest/samples/sample10_unittest.cc b/src/testing/gtest/samples/sample10_unittest.cc
deleted file mode 100644
index 0051cd5d..00000000
--- a/src/testing/gtest/samples/sample10_unittest.cc
+++ /dev/null
@@ -1,144 +0,0 @@
-// Copyright 2009 Google Inc. All Rights Reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: vladl@google.com (Vlad Losev)
-
-// This sample shows how to use Google Test listener API to implement
-// a primitive leak checker.
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "gtest/gtest.h"
-
-using ::testing::EmptyTestEventListener;
-using ::testing::InitGoogleTest;
-using ::testing::Test;
-using ::testing::TestCase;
-using ::testing::TestEventListeners;
-using ::testing::TestInfo;
-using ::testing::TestPartResult;
-using ::testing::UnitTest;
-
-namespace {
-
-// We will track memory used by this class.
-class Water {
- public:
- // Normal Water declarations go here.
-
- // operator new and operator delete help us control water allocation.
- void* operator new(size_t allocation_size) {
- allocated_++;
- return malloc(allocation_size);
- }
-
- void operator delete(void* block, size_t /* allocation_size */) {
- allocated_--;
- free(block);
- }
-
- static int allocated() { return allocated_; }
-
- private:
- static int allocated_;
-};
-
-int Water::allocated_ = 0;
-
-// This event listener monitors how many Water objects are created and
-// destroyed by each test, and reports a failure if a test leaks some Water
-// objects. It does this by comparing the number of live Water objects at
-// the beginning of a test and at the end of a test.
-class LeakChecker : public EmptyTestEventListener {
- private:
- // Called before a test starts.
- virtual void OnTestStart(const TestInfo& /* test_info */) {
- initially_allocated_ = Water::allocated();
- }
-
- // Called after a test ends.
- virtual void OnTestEnd(const TestInfo& /* test_info */) {
- int difference = Water::allocated() - initially_allocated_;
-
- // You can generate a failure in any event handler except
- // OnTestPartResult. Just use an appropriate Google Test assertion to do
- // it.
- EXPECT_LE(difference, 0) << "Leaked " << difference << " unit(s) of Water!";
- }
-
- int initially_allocated_;
-};
-
-TEST(ListenersTest, DoesNotLeak) {
- Water* water = new Water;
- delete water;
-}
-
-// This should fail when the --check_for_leaks command line flag is
-// specified.
-TEST(ListenersTest, LeaksWater) {
- Water* water = new Water;
- EXPECT_TRUE(water != NULL);
-}
-
-} // namespace
-
-int main(int argc, char **argv) {
- InitGoogleTest(&argc, argv);
-
- bool check_for_leaks = false;
- if (argc > 1 && strcmp(argv[1], "--check_for_leaks") == 0 )
- check_for_leaks = true;
- else
- printf("%s\n", "Run this program with --check_for_leaks to enable "
- "custom leak checking in the tests.");
-
- // If we are given the --check_for_leaks command line flag, installs the
- // leak checker.
- if (check_for_leaks) {
- TestEventListeners& listeners = UnitTest::GetInstance()->listeners();
-
- // Adds the leak checker to the end of the test event listener list,
- // after the default text output printer and the default XML report
- // generator.
- //
- // The order is important - it ensures that failures generated in the
- // leak checker's OnTestEnd() method are processed by the text and XML
- // printers *before* their OnTestEnd() methods are called, such that
- // they are attributed to the right test. Remember that a listener
- // receives an OnXyzStart event *after* listeners preceding it in the
- // list received that event, and receives an OnXyzEnd event *before*
- // listeners preceding it.
- //
- // We don't need to worry about deleting the new listener later, as
- // Google Test will do it.
- listeners.Append(new LeakChecker);
- }
- return RUN_ALL_TESTS();
-}
diff --git a/src/testing/gtest/samples/sample1_unittest.cc b/src/testing/gtest/samples/sample1_unittest.cc
deleted file mode 100644
index aefc4f1d..00000000
--- a/src/testing/gtest/samples/sample1_unittest.cc
+++ /dev/null
@@ -1,153 +0,0 @@
-// Copyright 2005, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// A sample program demonstrating using Google C++ testing framework.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-
-// This sample shows how to write a simple unit test for a function,
-// using Google C++ testing framework.
-//
-// Writing a unit test using Google C++ testing framework is easy as 1-2-3:
-
-
-// Step 1. Include necessary header files such that the stuff your
-// test logic needs is declared.
-//
-// Don't forget gtest.h, which declares the testing framework.
-
-#include <limits.h>
-#include "sample1.h"
-#include "gtest/gtest.h"
-
-
-// Step 2. Use the TEST macro to define your tests.
-//
-// TEST has two parameters: the test case name and the test name.
-// After using the macro, you should define your test logic between a
-// pair of braces. You can use a bunch of macros to indicate the
-// success or failure of a test. EXPECT_TRUE and EXPECT_EQ are
-// examples of such macros. For a complete list, see gtest.h.
-//
-// <TechnicalDetails>
-//
-// In Google Test, tests are grouped into test cases. This is how we
-// keep test code organized. You should put logically related tests
-// into the same test case.
-//
-// The test case name and the test name should both be valid C++
-// identifiers. And you should not use underscore (_) in the names.
-//
-// Google Test guarantees that each test you define is run exactly
-// once, but it makes no guarantee on the order the tests are
-// executed. Therefore, you should write your tests in such a way
-// that their results don't depend on their order.
-//
-// </TechnicalDetails>
-
-
-// Tests Factorial().
-
-// Tests factorial of negative numbers.
-TEST(FactorialTest, Negative) {
- // This test is named "Negative", and belongs to the "FactorialTest"
- // test case.
- EXPECT_EQ(1, Factorial(-5));
- EXPECT_EQ(1, Factorial(-1));
- EXPECT_GT(Factorial(-10), 0);
-
- // <TechnicalDetails>
- //
- // EXPECT_EQ(expected, actual) is the same as
- //
- // EXPECT_TRUE((expected) == (actual))
- //
- // except that it will print both the expected value and the actual
- // value when the assertion fails. This is very helpful for
- // debugging. Therefore in this case EXPECT_EQ is preferred.
- //
- // On the other hand, EXPECT_TRUE accepts any Boolean expression,
- // and is thus more general.
- //
- // </TechnicalDetails>
-}
-
-// Tests factorial of 0.
-TEST(FactorialTest, Zero) {
- EXPECT_EQ(1, Factorial(0));
-}
-
-// Tests factorial of positive numbers.
-TEST(FactorialTest, Positive) {
- EXPECT_EQ(1, Factorial(1));
- EXPECT_EQ(2, Factorial(2));
- EXPECT_EQ(6, Factorial(3));
- EXPECT_EQ(40320, Factorial(8));
-}
-
-
-// Tests IsPrime()
-
-// Tests negative input.
-TEST(IsPrimeTest, Negative) {
- // This test belongs to the IsPrimeTest test case.
-
- EXPECT_FALSE(IsPrime(-1));
- EXPECT_FALSE(IsPrime(-2));
- EXPECT_FALSE(IsPrime(INT_MIN));
-}
-
-// Tests some trivial cases.
-TEST(IsPrimeTest, Trivial) {
- EXPECT_FALSE(IsPrime(0));
- EXPECT_FALSE(IsPrime(1));
- EXPECT_TRUE(IsPrime(2));
- EXPECT_TRUE(IsPrime(3));
-}
-
-// Tests positive input.
-TEST(IsPrimeTest, Positive) {
- EXPECT_FALSE(IsPrime(4));
- EXPECT_TRUE(IsPrime(5));
- EXPECT_FALSE(IsPrime(6));
- EXPECT_TRUE(IsPrime(23));
-}
-
-// Step 3. Call RUN_ALL_TESTS() in main().
-//
-// We do this by linking in src/gtest_main.cc file, which consists of
-// a main() function which calls RUN_ALL_TESTS() for us.
-//
-// This runs all the tests you've defined, prints the result, and
-// returns 0 if successful, or 1 otherwise.
-//
-// Did you notice that we didn't register the tests? The
-// RUN_ALL_TESTS() macro magically knows about all the tests we
-// defined. Isn't this convenient?
diff --git a/src/testing/gtest/samples/sample2_unittest.cc b/src/testing/gtest/samples/sample2_unittest.cc
deleted file mode 100644
index 4fa19b71..00000000
--- a/src/testing/gtest/samples/sample2_unittest.cc
+++ /dev/null
@@ -1,109 +0,0 @@
-// Copyright 2005, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// A sample program demonstrating using Google C++ testing framework.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-
-// This sample shows how to write a more complex unit test for a class
-// that has multiple member functions.
-//
-// Usually, it's a good idea to have one test for each method in your
-// class. You don't have to do that exactly, but it helps to keep
-// your tests organized. You may also throw in additional tests as
-// needed.
-
-#include "sample2.h"
-#include "gtest/gtest.h"
-
-// In this example, we test the MyString class (a simple string).
-
-// Tests the default c'tor.
-TEST(MyString, DefaultConstructor) {
- const MyString s;
-
- // Asserts that s.c_string() returns NULL.
- //
- // <TechnicalDetails>
- //
- // If we write NULL instead of
- //
- // static_cast<const char *>(NULL)
- //
- // in this assertion, it will generate a warning on gcc 3.4. The
- // reason is that EXPECT_EQ needs to know the types of its
- // arguments in order to print them when it fails. Since NULL is
- // #defined as 0, the compiler will use the formatter function for
- // int to print it. However, gcc thinks that NULL should be used as
- // a pointer, not an int, and therefore complains.
- //
- // The root of the problem is C++'s lack of distinction between the
- // integer number 0 and the null pointer constant. Unfortunately,
- // we have to live with this fact.
- //
- // </TechnicalDetails>
- EXPECT_STREQ(NULL, s.c_string());
-
- EXPECT_EQ(0u, s.Length());
-}
-
-const char kHelloString[] = "Hello, world!";
-
-// Tests the c'tor that accepts a C string.
-TEST(MyString, ConstructorFromCString) {
- const MyString s(kHelloString);
- EXPECT_EQ(0, strcmp(s.c_string(), kHelloString));
- EXPECT_EQ(sizeof(kHelloString)/sizeof(kHelloString[0]) - 1,
- s.Length());
-}
-
-// Tests the copy c'tor.
-TEST(MyString, CopyConstructor) {
- const MyString s1(kHelloString);
- const MyString s2 = s1;
- EXPECT_EQ(0, strcmp(s2.c_string(), kHelloString));
-}
-
-// Tests the Set method.
-TEST(MyString, Set) {
- MyString s;
-
- s.Set(kHelloString);
- EXPECT_EQ(0, strcmp(s.c_string(), kHelloString));
-
- // Set should work when the input pointer is the same as the one
- // already in the MyString object.
- s.Set(s.c_string());
- EXPECT_EQ(0, strcmp(s.c_string(), kHelloString));
-
- // Can we set the MyString to NULL?
- s.Set(NULL);
- EXPECT_STREQ(NULL, s.c_string());
-}
diff --git a/src/testing/gtest/samples/sample3-inl.h b/src/testing/gtest/samples/sample3-inl.h
deleted file mode 100644
index 7e3084d6..00000000
--- a/src/testing/gtest/samples/sample3-inl.h
+++ /dev/null
@@ -1,172 +0,0 @@
-// Copyright 2005, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// A sample program demonstrating using Google C++ testing framework.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-#ifndef GTEST_SAMPLES_SAMPLE3_INL_H_
-#define GTEST_SAMPLES_SAMPLE3_INL_H_
-
-#include <stddef.h>
-
-
-// Queue is a simple queue implemented as a singled-linked list.
-//
-// The element type must support copy constructor.
-template <typename E> // E is the element type
-class Queue;
-
-// QueueNode is a node in a Queue, which consists of an element of
-// type E and a pointer to the next node.
-template <typename E> // E is the element type
-class QueueNode {
- friend class Queue<E>;
-
- public:
- // Gets the element in this node.
- const E& element() const { return element_; }
-
- // Gets the next node in the queue.
- QueueNode* next() { return next_; }
- const QueueNode* next() const { return next_; }
-
- private:
- // Creates a node with a given element value. The next pointer is
- // set to NULL.
- explicit QueueNode(const E& an_element) : element_(an_element), next_(NULL) {}
-
- // We disable the default assignment operator and copy c'tor.
- const QueueNode& operator = (const QueueNode&);
- QueueNode(const QueueNode&);
-
- E element_;
- QueueNode* next_;
-};
-
-template <typename E> // E is the element type.
-class Queue {
- public:
- // Creates an empty queue.
- Queue() : head_(NULL), last_(NULL), size_(0) {}
-
- // D'tor. Clears the queue.
- ~Queue() { Clear(); }
-
- // Clears the queue.
- void Clear() {
- if (size_ > 0) {
- // 1. Deletes every node.
- QueueNode<E>* node = head_;
- QueueNode<E>* next = node->next();
- for (; ;) {
- delete node;
- node = next;
- if (node == NULL) break;
- next = node->next();
- }
-
- // 2. Resets the member variables.
- head_ = last_ = NULL;
- size_ = 0;
- }
- }
-
- // Gets the number of elements.
- size_t Size() const { return size_; }
-
- // Gets the first element of the queue, or NULL if the queue is empty.
- QueueNode<E>* Head() { return head_; }
- const QueueNode<E>* Head() const { return head_; }
-
- // Gets the last element of the queue, or NULL if the queue is empty.
- QueueNode<E>* Last() { return last_; }
- const QueueNode<E>* Last() const { return last_; }
-
- // Adds an element to the end of the queue. A copy of the element is
- // created using the copy constructor, and then stored in the queue.
- // Changes made to the element in the queue doesn't affect the source
- // object, and vice versa.
- void Enqueue(const E& element) {
- QueueNode<E>* new_node = new QueueNode<E>(element);
-
- if (size_ == 0) {
- head_ = last_ = new_node;
- size_ = 1;
- } else {
- last_->next_ = new_node;
- last_ = new_node;
- size_++;
- }
- }
-
- // Removes the head of the queue and returns it. Returns NULL if
- // the queue is empty.
- E* Dequeue() {
- if (size_ == 0) {
- return NULL;
- }
-
- const QueueNode<E>* const old_head = head_;
- head_ = head_->next_;
- size_--;
- if (size_ == 0) {
- last_ = NULL;
- }
-
- E* element = new E(old_head->element());
- delete old_head;
-
- return element;
- }
-
- // Applies a function/functor on each element of the queue, and
- // returns the result in a new queue. The original queue is not
- // affected.
- template <typename F>
- Queue* Map(F function) const {
- Queue* new_queue = new Queue();
- for (const QueueNode<E>* node = head_; node != NULL; node = node->next_) {
- new_queue->Enqueue(function(node->element()));
- }
-
- return new_queue;
- }
-
- private:
- QueueNode<E>* head_; // The first node of the queue.
- QueueNode<E>* last_; // The last node of the queue.
- size_t size_; // The number of elements in the queue.
-
- // We disallow copying a queue.
- Queue(const Queue&);
- const Queue& operator = (const Queue&);
-};
-
-#endif // GTEST_SAMPLES_SAMPLE3_INL_H_
diff --git a/src/testing/gtest/samples/sample3_unittest.cc b/src/testing/gtest/samples/sample3_unittest.cc
deleted file mode 100644
index bf3877d0..00000000
--- a/src/testing/gtest/samples/sample3_unittest.cc
+++ /dev/null
@@ -1,151 +0,0 @@
-// Copyright 2005, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// A sample program demonstrating using Google C++ testing framework.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-
-// In this example, we use a more advanced feature of Google Test called
-// test fixture.
-//
-// A test fixture is a place to hold objects and functions shared by
-// all tests in a test case. Using a test fixture avoids duplicating
-// the test code necessary to initialize and cleanup those common
-// objects for each test. It is also useful for defining sub-routines
-// that your tests need to invoke a lot.
-//
-// <TechnicalDetails>
-//
-// The tests share the test fixture in the sense of code sharing, not
-// data sharing. Each test is given its own fresh copy of the
-// fixture. You cannot expect the data modified by one test to be
-// passed on to another test, which is a bad idea.
-//
-// The reason for this design is that tests should be independent and
-// repeatable. In particular, a test should not fail as the result of
-// another test's failure. If one test depends on info produced by
-// another test, then the two tests should really be one big test.
-//
-// The macros for indicating the success/failure of a test
-// (EXPECT_TRUE, FAIL, etc) need to know what the current test is
-// (when Google Test prints the test result, it tells you which test
-// each failure belongs to). Technically, these macros invoke a
-// member function of the Test class. Therefore, you cannot use them
-// in a global function. That's why you should put test sub-routines
-// in a test fixture.
-//
-// </TechnicalDetails>
-
-#include "sample3-inl.h"
-#include "gtest/gtest.h"
-
-// To use a test fixture, derive a class from testing::Test.
-class QueueTest : public testing::Test {
- protected: // You should make the members protected s.t. they can be
- // accessed from sub-classes.
-
- // virtual void SetUp() will be called before each test is run. You
- // should define it if you need to initialize the varaibles.
- // Otherwise, this can be skipped.
- virtual void SetUp() {
- q1_.Enqueue(1);
- q2_.Enqueue(2);
- q2_.Enqueue(3);
- }
-
- // virtual void TearDown() will be called after each test is run.
- // You should define it if there is cleanup work to do. Otherwise,
- // you don't have to provide it.
- //
- // virtual void TearDown() {
- // }
-
- // A helper function that some test uses.
- static int Double(int n) {
- return 2*n;
- }
-
- // A helper function for testing Queue::Map().
- void MapTester(const Queue<int> * q) {
- // Creates a new queue, where each element is twice as big as the
- // corresponding one in q.
- const Queue<int> * const new_q = q->Map(Double);
-
- // Verifies that the new queue has the same size as q.
- ASSERT_EQ(q->Size(), new_q->Size());
-
- // Verifies the relationship between the elements of the two queues.
- for ( const QueueNode<int> * n1 = q->Head(), * n2 = new_q->Head();
- n1 != NULL; n1 = n1->next(), n2 = n2->next() ) {
- EXPECT_EQ(2 * n1->element(), n2->element());
- }
-
- delete new_q;
- }
-
- // Declares the variables your tests want to use.
- Queue<int> q0_;
- Queue<int> q1_;
- Queue<int> q2_;
-};
-
-// When you have a test fixture, you define a test using TEST_F
-// instead of TEST.
-
-// Tests the default c'tor.
-TEST_F(QueueTest, DefaultConstructor) {
- // You can access data in the test fixture here.
- EXPECT_EQ(0u, q0_.Size());
-}
-
-// Tests Dequeue().
-TEST_F(QueueTest, Dequeue) {
- int * n = q0_.Dequeue();
- EXPECT_TRUE(n == NULL);
-
- n = q1_.Dequeue();
- ASSERT_TRUE(n != NULL);
- EXPECT_EQ(1, *n);
- EXPECT_EQ(0u, q1_.Size());
- delete n;
-
- n = q2_.Dequeue();
- ASSERT_TRUE(n != NULL);
- EXPECT_EQ(2, *n);
- EXPECT_EQ(1u, q2_.Size());
- delete n;
-}
-
-// Tests the Queue::Map() function.
-TEST_F(QueueTest, Map) {
- MapTester(&q0_);
- MapTester(&q1_);
- MapTester(&q2_);
-}
diff --git a/src/testing/gtest/samples/sample4_unittest.cc b/src/testing/gtest/samples/sample4_unittest.cc
deleted file mode 100644
index fa5afc7d..00000000
--- a/src/testing/gtest/samples/sample4_unittest.cc
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright 2005, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-#include "gtest/gtest.h"
-#include "sample4.h"
-
-// Tests the Increment() method.
-TEST(Counter, Increment) {
- Counter c;
-
- // EXPECT_EQ() evaluates its arguments exactly once, so they
- // can have side effects.
-
- EXPECT_EQ(0, c.Increment());
- EXPECT_EQ(1, c.Increment());
- EXPECT_EQ(2, c.Increment());
-}
diff --git a/src/testing/gtest/samples/sample5_unittest.cc b/src/testing/gtest/samples/sample5_unittest.cc
deleted file mode 100644
index 43d8e577..00000000
--- a/src/testing/gtest/samples/sample5_unittest.cc
+++ /dev/null
@@ -1,199 +0,0 @@
-// Copyright 2005, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-// This sample teaches how to reuse a test fixture in multiple test
-// cases by deriving sub-fixtures from it.
-//
-// When you define a test fixture, you specify the name of the test
-// case that will use this fixture. Therefore, a test fixture can
-// be used by only one test case.
-//
-// Sometimes, more than one test cases may want to use the same or
-// slightly different test fixtures. For example, you may want to
-// make sure that all tests for a GUI library don't leak important
-// system resources like fonts and brushes. In Google Test, you do
-// this by putting the shared logic in a super (as in "super class")
-// test fixture, and then have each test case use a fixture derived
-// from this super fixture.
-
-#include <limits.h>
-#include <time.h>
-#include "sample3-inl.h"
-#include "gtest/gtest.h"
-#include "sample1.h"
-
-// In this sample, we want to ensure that every test finishes within
-// ~5 seconds. If a test takes longer to run, we consider it a
-// failure.
-//
-// We put the code for timing a test in a test fixture called
-// "QuickTest". QuickTest is intended to be the super fixture that
-// other fixtures derive from, therefore there is no test case with
-// the name "QuickTest". This is OK.
-//
-// Later, we will derive multiple test fixtures from QuickTest.
-class QuickTest : public testing::Test {
- protected:
- // Remember that SetUp() is run immediately before a test starts.
- // This is a good place to record the start time.
- virtual void SetUp() {
- start_time_ = time(NULL);
- }
-
- // TearDown() is invoked immediately after a test finishes. Here we
- // check if the test was too slow.
- virtual void TearDown() {
- // Gets the time when the test finishes
- const time_t end_time = time(NULL);
-
- // Asserts that the test took no more than ~5 seconds. Did you
- // know that you can use assertions in SetUp() and TearDown() as
- // well?
- EXPECT_TRUE(end_time - start_time_ <= 5) << "The test took too long.";
- }
-
- // The UTC time (in seconds) when the test starts
- time_t start_time_;
-};
-
-
-// We derive a fixture named IntegerFunctionTest from the QuickTest
-// fixture. All tests using this fixture will be automatically
-// required to be quick.
-class IntegerFunctionTest : public QuickTest {
- // We don't need any more logic than already in the QuickTest fixture.
- // Therefore the body is empty.
-};
-
-
-// Now we can write tests in the IntegerFunctionTest test case.
-
-// Tests Factorial()
-TEST_F(IntegerFunctionTest, Factorial) {
- // Tests factorial of negative numbers.
- EXPECT_EQ(1, Factorial(-5));
- EXPECT_EQ(1, Factorial(-1));
- EXPECT_GT(Factorial(-10), 0);
-
- // Tests factorial of 0.
- EXPECT_EQ(1, Factorial(0));
-
- // Tests factorial of positive numbers.
- EXPECT_EQ(1, Factorial(1));
- EXPECT_EQ(2, Factorial(2));
- EXPECT_EQ(6, Factorial(3));
- EXPECT_EQ(40320, Factorial(8));
-}
-
-
-// Tests IsPrime()
-TEST_F(IntegerFunctionTest, IsPrime) {
- // Tests negative input.
- EXPECT_FALSE(IsPrime(-1));
- EXPECT_FALSE(IsPrime(-2));
- EXPECT_FALSE(IsPrime(INT_MIN));
-
- // Tests some trivial cases.
- EXPECT_FALSE(IsPrime(0));
- EXPECT_FALSE(IsPrime(1));
- EXPECT_TRUE(IsPrime(2));
- EXPECT_TRUE(IsPrime(3));
-
- // Tests positive input.
- EXPECT_FALSE(IsPrime(4));
- EXPECT_TRUE(IsPrime(5));
- EXPECT_FALSE(IsPrime(6));
- EXPECT_TRUE(IsPrime(23));
-}
-
-
-// The next test case (named "QueueTest") also needs to be quick, so
-// we derive another fixture from QuickTest.
-//
-// The QueueTest test fixture has some logic and shared objects in
-// addition to what's in QuickTest already. We define the additional
-// stuff inside the body of the test fixture, as usual.
-class QueueTest : public QuickTest {
- protected:
- virtual void SetUp() {
- // First, we need to set up the super fixture (QuickTest).
- QuickTest::SetUp();
-
- // Second, some additional setup for this fixture.
- q1_.Enqueue(1);
- q2_.Enqueue(2);
- q2_.Enqueue(3);
- }
-
- // By default, TearDown() inherits the behavior of
- // QuickTest::TearDown(). As we have no additional cleaning work
- // for QueueTest, we omit it here.
- //
- // virtual void TearDown() {
- // QuickTest::TearDown();
- // }
-
- Queue<int> q0_;
- Queue<int> q1_;
- Queue<int> q2_;
-};
-
-
-// Now, let's write tests using the QueueTest fixture.
-
-// Tests the default constructor.
-TEST_F(QueueTest, DefaultConstructor) {
- EXPECT_EQ(0u, q0_.Size());
-}
-
-// Tests Dequeue().
-TEST_F(QueueTest, Dequeue) {
- int* n = q0_.Dequeue();
- EXPECT_TRUE(n == NULL);
-
- n = q1_.Dequeue();
- EXPECT_TRUE(n != NULL);
- EXPECT_EQ(1, *n);
- EXPECT_EQ(0u, q1_.Size());
- delete n;
-
- n = q2_.Dequeue();
- EXPECT_TRUE(n != NULL);
- EXPECT_EQ(2, *n);
- EXPECT_EQ(1u, q2_.Size());
- delete n;
-}
-
-// If necessary, you can derive further test fixtures from a derived
-// fixture itself. For example, you can derive another fixture from
-// QueueTest. Google Test imposes no limit on how deep the hierarchy
-// can be. In practice, however, you probably don't want it to be too
-// deep as to be confusing.
diff --git a/src/testing/gtest/samples/sample6_unittest.cc b/src/testing/gtest/samples/sample6_unittest.cc
deleted file mode 100644
index 8f2036a5..00000000
--- a/src/testing/gtest/samples/sample6_unittest.cc
+++ /dev/null
@@ -1,224 +0,0 @@
-// Copyright 2008 Google Inc.
-// All Rights Reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-// This sample shows how to test common properties of multiple
-// implementations of the same interface (aka interface tests).
-
-// The interface and its implementations are in this header.
-#include "prime_tables.h"
-
-#include "gtest/gtest.h"
-
-// First, we define some factory functions for creating instances of
-// the implementations. You may be able to skip this step if all your
-// implementations can be constructed the same way.
-
-template <class T>
-PrimeTable* CreatePrimeTable();
-
-template <>
-PrimeTable* CreatePrimeTable<OnTheFlyPrimeTable>() {
- return new OnTheFlyPrimeTable;
-}
-
-template <>
-PrimeTable* CreatePrimeTable<PreCalculatedPrimeTable>() {
- return new PreCalculatedPrimeTable(10000);
-}
-
-// Then we define a test fixture class template.
-template <class T>
-class PrimeTableTest : public testing::Test {
- protected:
- // The ctor calls the factory function to create a prime table
- // implemented by T.
- PrimeTableTest() : table_(CreatePrimeTable<T>()) {}
-
- virtual ~PrimeTableTest() { delete table_; }
-
- // Note that we test an implementation via the base interface
- // instead of the actual implementation class. This is important
- // for keeping the tests close to the real world scenario, where the
- // implementation is invoked via the base interface. It avoids
- // got-yas where the implementation class has a method that shadows
- // a method with the same name (but slightly different argument
- // types) in the base interface, for example.
- PrimeTable* const table_;
-};
-
-#if GTEST_HAS_TYPED_TEST
-
-using testing::Types;
-
-// Google Test offers two ways for reusing tests for different types.
-// The first is called "typed tests". You should use it if you
-// already know *all* the types you are gonna exercise when you write
-// the tests.
-
-// To write a typed test case, first use
-//
-// TYPED_TEST_CASE(TestCaseName, TypeList);
-//
-// to declare it and specify the type parameters. As with TEST_F,
-// TestCaseName must match the test fixture name.
-
-// The list of types we want to test.
-typedef Types<OnTheFlyPrimeTable, PreCalculatedPrimeTable> Implementations;
-
-TYPED_TEST_CASE(PrimeTableTest, Implementations);
-
-// Then use TYPED_TEST(TestCaseName, TestName) to define a typed test,
-// similar to TEST_F.
-TYPED_TEST(PrimeTableTest, ReturnsFalseForNonPrimes) {
- // Inside the test body, you can refer to the type parameter by
- // TypeParam, and refer to the fixture class by TestFixture. We
- // don't need them in this example.
-
- // Since we are in the template world, C++ requires explicitly
- // writing 'this->' when referring to members of the fixture class.
- // This is something you have to learn to live with.
- EXPECT_FALSE(this->table_->IsPrime(-5));
- EXPECT_FALSE(this->table_->IsPrime(0));
- EXPECT_FALSE(this->table_->IsPrime(1));
- EXPECT_FALSE(this->table_->IsPrime(4));
- EXPECT_FALSE(this->table_->IsPrime(6));
- EXPECT_FALSE(this->table_->IsPrime(100));
-}
-
-TYPED_TEST(PrimeTableTest, ReturnsTrueForPrimes) {
- EXPECT_TRUE(this->table_->IsPrime(2));
- EXPECT_TRUE(this->table_->IsPrime(3));
- EXPECT_TRUE(this->table_->IsPrime(5));
- EXPECT_TRUE(this->table_->IsPrime(7));
- EXPECT_TRUE(this->table_->IsPrime(11));
- EXPECT_TRUE(this->table_->IsPrime(131));
-}
-
-TYPED_TEST(PrimeTableTest, CanGetNextPrime) {
- EXPECT_EQ(2, this->table_->GetNextPrime(0));
- EXPECT_EQ(3, this->table_->GetNextPrime(2));
- EXPECT_EQ(5, this->table_->GetNextPrime(3));
- EXPECT_EQ(7, this->table_->GetNextPrime(5));
- EXPECT_EQ(11, this->table_->GetNextPrime(7));
- EXPECT_EQ(131, this->table_->GetNextPrime(128));
-}
-
-// That's it! Google Test will repeat each TYPED_TEST for each type
-// in the type list specified in TYPED_TEST_CASE. Sit back and be
-// happy that you don't have to define them multiple times.
-
-#endif // GTEST_HAS_TYPED_TEST
-
-#if GTEST_HAS_TYPED_TEST_P
-
-using testing::Types;
-
-// Sometimes, however, you don't yet know all the types that you want
-// to test when you write the tests. For example, if you are the
-// author of an interface and expect other people to implement it, you
-// might want to write a set of tests to make sure each implementation
-// conforms to some basic requirements, but you don't know what
-// implementations will be written in the future.
-//
-// How can you write the tests without committing to the type
-// parameters? That's what "type-parameterized tests" can do for you.
-// It is a bit more involved than typed tests, but in return you get a
-// test pattern that can be reused in many contexts, which is a big
-// win. Here's how you do it:
-
-// First, define a test fixture class template. Here we just reuse
-// the PrimeTableTest fixture defined earlier:
-
-template <class T>
-class PrimeTableTest2 : public PrimeTableTest<T> {
-};
-
-// Then, declare the test case. The argument is the name of the test
-// fixture, and also the name of the test case (as usual). The _P
-// suffix is for "parameterized" or "pattern".
-TYPED_TEST_CASE_P(PrimeTableTest2);
-
-// Next, use TYPED_TEST_P(TestCaseName, TestName) to define a test,
-// similar to what you do with TEST_F.
-TYPED_TEST_P(PrimeTableTest2, ReturnsFalseForNonPrimes) {
- EXPECT_FALSE(this->table_->IsPrime(-5));
- EXPECT_FALSE(this->table_->IsPrime(0));
- EXPECT_FALSE(this->table_->IsPrime(1));
- EXPECT_FALSE(this->table_->IsPrime(4));
- EXPECT_FALSE(this->table_->IsPrime(6));
- EXPECT_FALSE(this->table_->IsPrime(100));
-}
-
-TYPED_TEST_P(PrimeTableTest2, ReturnsTrueForPrimes) {
- EXPECT_TRUE(this->table_->IsPrime(2));
- EXPECT_TRUE(this->table_->IsPrime(3));
- EXPECT_TRUE(this->table_->IsPrime(5));
- EXPECT_TRUE(this->table_->IsPrime(7));
- EXPECT_TRUE(this->table_->IsPrime(11));
- EXPECT_TRUE(this->table_->IsPrime(131));
-}
-
-TYPED_TEST_P(PrimeTableTest2, CanGetNextPrime) {
- EXPECT_EQ(2, this->table_->GetNextPrime(0));
- EXPECT_EQ(3, this->table_->GetNextPrime(2));
- EXPECT_EQ(5, this->table_->GetNextPrime(3));
- EXPECT_EQ(7, this->table_->GetNextPrime(5));
- EXPECT_EQ(11, this->table_->GetNextPrime(7));
- EXPECT_EQ(131, this->table_->GetNextPrime(128));
-}
-
-// Type-parameterized tests involve one extra step: you have to
-// enumerate the tests you defined:
-REGISTER_TYPED_TEST_CASE_P(
- PrimeTableTest2, // The first argument is the test case name.
- // The rest of the arguments are the test names.
- ReturnsFalseForNonPrimes, ReturnsTrueForPrimes, CanGetNextPrime);
-
-// At this point the test pattern is done. However, you don't have
-// any real test yet as you haven't said which types you want to run
-// the tests with.
-
-// To turn the abstract test pattern into real tests, you instantiate
-// it with a list of types. Usually the test pattern will be defined
-// in a .h file, and anyone can #include and instantiate it. You can
-// even instantiate it more than once in the same program. To tell
-// different instances apart, you give each of them a name, which will
-// become part of the test case name and can be used in test filters.
-
-// The list of types we want to test. Note that it doesn't have to be
-// defined at the time we write the TYPED_TEST_P()s.
-typedef Types<OnTheFlyPrimeTable, PreCalculatedPrimeTable>
- PrimeTableImplementations;
-INSTANTIATE_TYPED_TEST_CASE_P(OnTheFlyAndPreCalculated, // Instance name
- PrimeTableTest2, // Test case name
- PrimeTableImplementations); // Type list
-
-#endif // GTEST_HAS_TYPED_TEST_P
diff --git a/src/testing/gtest/samples/sample7_unittest.cc b/src/testing/gtest/samples/sample7_unittest.cc
deleted file mode 100644
index 1b651a21..00000000
--- a/src/testing/gtest/samples/sample7_unittest.cc
+++ /dev/null
@@ -1,130 +0,0 @@
-// Copyright 2008 Google Inc.
-// All Rights Reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: vladl@google.com (Vlad Losev)
-
-// This sample shows how to test common properties of multiple
-// implementations of an interface (aka interface tests) using
-// value-parameterized tests. Each test in the test case has
-// a parameter that is an interface pointer to an implementation
-// tested.
-
-// The interface and its implementations are in this header.
-#include "prime_tables.h"
-
-#include "gtest/gtest.h"
-
-#if GTEST_HAS_PARAM_TEST
-
-using ::testing::TestWithParam;
-using ::testing::Values;
-
-// As a general rule, to prevent a test from affecting the tests that come
-// after it, you should create and destroy the tested objects for each test
-// instead of reusing them. In this sample we will define a simple factory
-// function for PrimeTable objects. We will instantiate objects in test's
-// SetUp() method and delete them in TearDown() method.
-typedef PrimeTable* CreatePrimeTableFunc();
-
-PrimeTable* CreateOnTheFlyPrimeTable() {
- return new OnTheFlyPrimeTable();
-}
-
-template <size_t max_precalculated>
-PrimeTable* CreatePreCalculatedPrimeTable() {
- return new PreCalculatedPrimeTable(max_precalculated);
-}
-
-// Inside the test body, fixture constructor, SetUp(), and TearDown() you
-// can refer to the test parameter by GetParam(). In this case, the test
-// parameter is a factory function which we call in fixture's SetUp() to
-// create and store an instance of PrimeTable.
-class PrimeTableTest : public TestWithParam<CreatePrimeTableFunc*> {
- public:
- virtual ~PrimeTableTest() { delete table_; }
- virtual void SetUp() { table_ = (*GetParam())(); }
- virtual void TearDown() {
- delete table_;
- table_ = NULL;
- }
-
- protected:
- PrimeTable* table_;
-};
-
-TEST_P(PrimeTableTest, ReturnsFalseForNonPrimes) {
- EXPECT_FALSE(table_->IsPrime(-5));
- EXPECT_FALSE(table_->IsPrime(0));
- EXPECT_FALSE(table_->IsPrime(1));
- EXPECT_FALSE(table_->IsPrime(4));
- EXPECT_FALSE(table_->IsPrime(6));
- EXPECT_FALSE(table_->IsPrime(100));
-}
-
-TEST_P(PrimeTableTest, ReturnsTrueForPrimes) {
- EXPECT_TRUE(table_->IsPrime(2));
- EXPECT_TRUE(table_->IsPrime(3));
- EXPECT_TRUE(table_->IsPrime(5));
- EXPECT_TRUE(table_->IsPrime(7));
- EXPECT_TRUE(table_->IsPrime(11));
- EXPECT_TRUE(table_->IsPrime(131));
-}
-
-TEST_P(PrimeTableTest, CanGetNextPrime) {
- EXPECT_EQ(2, table_->GetNextPrime(0));
- EXPECT_EQ(3, table_->GetNextPrime(2));
- EXPECT_EQ(5, table_->GetNextPrime(3));
- EXPECT_EQ(7, table_->GetNextPrime(5));
- EXPECT_EQ(11, table_->GetNextPrime(7));
- EXPECT_EQ(131, table_->GetNextPrime(128));
-}
-
-// In order to run value-parameterized tests, you need to instantiate them,
-// or bind them to a list of values which will be used as test parameters.
-// You can instantiate them in a different translation module, or even
-// instantiate them several times.
-//
-// Here, we instantiate our tests with a list of two PrimeTable object
-// factory functions:
-INSTANTIATE_TEST_CASE_P(
- OnTheFlyAndPreCalculated,
- PrimeTableTest,
- Values(&CreateOnTheFlyPrimeTable, &CreatePreCalculatedPrimeTable<1000>));
-
-#else
-
-// Google Test may not support value-parameterized tests with some
-// compilers. If we use conditional compilation to compile out all
-// code referring to the gtest_main library, MSVC linker will not link
-// that library at all and consequently complain about missing entry
-// point defined in that library (fatal error LNK1561: entry point
-// must be defined). This dummy test keeps gtest_main linked in.
-TEST(DummyTest, ValueParameterizedTestsAreNotSupportedOnThisPlatform) {}
-
-#endif // GTEST_HAS_PARAM_TEST
diff --git a/src/testing/gtest/samples/sample8_unittest.cc b/src/testing/gtest/samples/sample8_unittest.cc
deleted file mode 100644
index 5ad2e2c9..00000000
--- a/src/testing/gtest/samples/sample8_unittest.cc
+++ /dev/null
@@ -1,173 +0,0 @@
-// Copyright 2008 Google Inc.
-// All Rights Reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: vladl@google.com (Vlad Losev)
-
-// This sample shows how to test code relying on some global flag variables.
-// Combine() helps with generating all possible combinations of such flags,
-// and each test is given one combination as a parameter.
-
-// Use class definitions to test from this header.
-#include "prime_tables.h"
-
-#include "gtest/gtest.h"
-
-#if GTEST_HAS_COMBINE
-
-// Suppose we want to introduce a new, improved implementation of PrimeTable
-// which combines speed of PrecalcPrimeTable and versatility of
-// OnTheFlyPrimeTable (see prime_tables.h). Inside it instantiates both
-// PrecalcPrimeTable and OnTheFlyPrimeTable and uses the one that is more
-// appropriate under the circumstances. But in low memory conditions, it can be
-// told to instantiate without PrecalcPrimeTable instance at all and use only
-// OnTheFlyPrimeTable.
-class HybridPrimeTable : public PrimeTable {
- public:
- HybridPrimeTable(bool force_on_the_fly, int max_precalculated)
- : on_the_fly_impl_(new OnTheFlyPrimeTable),
- precalc_impl_(force_on_the_fly ? NULL :
- new PreCalculatedPrimeTable(max_precalculated)),
- max_precalculated_(max_precalculated) {}
- virtual ~HybridPrimeTable() {
- delete on_the_fly_impl_;
- delete precalc_impl_;
- }
-
- virtual bool IsPrime(int n) const {
- if (precalc_impl_ != NULL && n < max_precalculated_)
- return precalc_impl_->IsPrime(n);
- else
- return on_the_fly_impl_->IsPrime(n);
- }
-
- virtual int GetNextPrime(int p) const {
- int next_prime = -1;
- if (precalc_impl_ != NULL && p < max_precalculated_)
- next_prime = precalc_impl_->GetNextPrime(p);
-
- return next_prime != -1 ? next_prime : on_the_fly_impl_->GetNextPrime(p);
- }
-
- private:
- OnTheFlyPrimeTable* on_the_fly_impl_;
- PreCalculatedPrimeTable* precalc_impl_;
- int max_precalculated_;
-};
-
-using ::testing::TestWithParam;
-using ::testing::Bool;
-using ::testing::Values;
-using ::testing::Combine;
-
-// To test all code paths for HybridPrimeTable we must test it with numbers
-// both within and outside PreCalculatedPrimeTable's capacity and also with
-// PreCalculatedPrimeTable disabled. We do this by defining fixture which will
-// accept different combinations of parameters for instantiating a
-// HybridPrimeTable instance.
-class PrimeTableTest : public TestWithParam< ::std::tr1::tuple<bool, int> > {
- protected:
- virtual void SetUp() {
- // This can be written as
- //
- // bool force_on_the_fly;
- // int max_precalculated;
- // tie(force_on_the_fly, max_precalculated) = GetParam();
- //
- // once the Google C++ Style Guide allows use of ::std::tr1::tie.
- //
- bool force_on_the_fly = ::std::tr1::get<0>(GetParam());
- int max_precalculated = ::std::tr1::get<1>(GetParam());
- table_ = new HybridPrimeTable(force_on_the_fly, max_precalculated);
- }
- virtual void TearDown() {
- delete table_;
- table_ = NULL;
- }
- HybridPrimeTable* table_;
-};
-
-TEST_P(PrimeTableTest, ReturnsFalseForNonPrimes) {
- // Inside the test body, you can refer to the test parameter by GetParam().
- // In this case, the test parameter is a PrimeTable interface pointer which
- // we can use directly.
- // Please note that you can also save it in the fixture's SetUp() method
- // or constructor and use saved copy in the tests.
-
- EXPECT_FALSE(table_->IsPrime(-5));
- EXPECT_FALSE(table_->IsPrime(0));
- EXPECT_FALSE(table_->IsPrime(1));
- EXPECT_FALSE(table_->IsPrime(4));
- EXPECT_FALSE(table_->IsPrime(6));
- EXPECT_FALSE(table_->IsPrime(100));
-}
-
-TEST_P(PrimeTableTest, ReturnsTrueForPrimes) {
- EXPECT_TRUE(table_->IsPrime(2));
- EXPECT_TRUE(table_->IsPrime(3));
- EXPECT_TRUE(table_->IsPrime(5));
- EXPECT_TRUE(table_->IsPrime(7));
- EXPECT_TRUE(table_->IsPrime(11));
- EXPECT_TRUE(table_->IsPrime(131));
-}
-
-TEST_P(PrimeTableTest, CanGetNextPrime) {
- EXPECT_EQ(2, table_->GetNextPrime(0));
- EXPECT_EQ(3, table_->GetNextPrime(2));
- EXPECT_EQ(5, table_->GetNextPrime(3));
- EXPECT_EQ(7, table_->GetNextPrime(5));
- EXPECT_EQ(11, table_->GetNextPrime(7));
- EXPECT_EQ(131, table_->GetNextPrime(128));
-}
-
-// In order to run value-parameterized tests, you need to instantiate them,
-// or bind them to a list of values which will be used as test parameters.
-// You can instantiate them in a different translation module, or even
-// instantiate them several times.
-//
-// Here, we instantiate our tests with a list of parameters. We must combine
-// all variations of the boolean flag suppressing PrecalcPrimeTable and some
-// meaningful values for tests. We choose a small value (1), and a value that
-// will put some of the tested numbers beyond the capability of the
-// PrecalcPrimeTable instance and some inside it (10). Combine will produce all
-// possible combinations.
-INSTANTIATE_TEST_CASE_P(MeaningfulTestParameters,
- PrimeTableTest,
- Combine(Bool(), Values(1, 10)));
-
-#else
-
-// Google Test may not support Combine() with some compilers. If we
-// use conditional compilation to compile out all code referring to
-// the gtest_main library, MSVC linker will not link that library at
-// all and consequently complain about missing entry point defined in
-// that library (fatal error LNK1561: entry point must be
-// defined). This dummy test keeps gtest_main linked in.
-TEST(DummyTest, CombineIsNotSupportedOnThisPlatform) {}
-
-#endif // GTEST_HAS_COMBINE
diff --git a/src/testing/gtest/samples/sample9_unittest.cc b/src/testing/gtest/samples/sample9_unittest.cc
deleted file mode 100644
index b2e2079b..00000000
--- a/src/testing/gtest/samples/sample9_unittest.cc
+++ /dev/null
@@ -1,160 +0,0 @@
-// Copyright 2009 Google Inc. All Rights Reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: vladl@google.com (Vlad Losev)
-
-// This sample shows how to use Google Test listener API to implement
-// an alternative console output and how to use the UnitTest reflection API
-// to enumerate test cases and tests and to inspect their results.
-
-#include <stdio.h>
-
-#include "gtest/gtest.h"
-
-using ::testing::EmptyTestEventListener;
-using ::testing::InitGoogleTest;
-using ::testing::Test;
-using ::testing::TestCase;
-using ::testing::TestEventListeners;
-using ::testing::TestInfo;
-using ::testing::TestPartResult;
-using ::testing::UnitTest;
-
-namespace {
-
-// Provides alternative output mode which produces minimal amount of
-// information about tests.
-class TersePrinter : public EmptyTestEventListener {
- private:
- // Called before any test activity starts.
- virtual void OnTestProgramStart(const UnitTest& /* unit_test */) {}
-
- // Called after all test activities have ended.
- virtual void OnTestProgramEnd(const UnitTest& unit_test) {
- fprintf(stdout, "TEST %s\n", unit_test.Passed() ? "PASSED" : "FAILED");
- fflush(stdout);
- }
-
- // Called before a test starts.
- virtual void OnTestStart(const TestInfo& test_info) {
- fprintf(stdout,
- "*** Test %s.%s starting.\n",
- test_info.test_case_name(),
- test_info.name());
- fflush(stdout);
- }
-
- // Called after a failed assertion or a SUCCEED() invocation.
- virtual void OnTestPartResult(const TestPartResult& test_part_result) {
- fprintf(stdout,
- "%s in %s:%d\n%s\n",
- test_part_result.failed() ? "*** Failure" : "Success",
- test_part_result.file_name(),
- test_part_result.line_number(),
- test_part_result.summary());
- fflush(stdout);
- }
-
- // Called after a test ends.
- virtual void OnTestEnd(const TestInfo& test_info) {
- fprintf(stdout,
- "*** Test %s.%s ending.\n",
- test_info.test_case_name(),
- test_info.name());
- fflush(stdout);
- }
-}; // class TersePrinter
-
-TEST(CustomOutputTest, PrintsMessage) {
- printf("Printing something from the test body...\n");
-}
-
-TEST(CustomOutputTest, Succeeds) {
- SUCCEED() << "SUCCEED() has been invoked from here";
-}
-
-TEST(CustomOutputTest, Fails) {
- EXPECT_EQ(1, 2)
- << "This test fails in order to demonstrate alternative failure messages";
-}
-
-} // namespace
-
-int main(int argc, char **argv) {
- InitGoogleTest(&argc, argv);
-
- bool terse_output = false;
- if (argc > 1 && strcmp(argv[1], "--terse_output") == 0 )
- terse_output = true;
- else
- printf("%s\n", "Run this program with --terse_output to change the way "
- "it prints its output.");
-
- UnitTest& unit_test = *UnitTest::GetInstance();
-
- // If we are given the --terse_output command line flag, suppresses the
- // standard output and attaches own result printer.
- if (terse_output) {
- TestEventListeners& listeners = unit_test.listeners();
-
- // Removes the default console output listener from the list so it will
- // not receive events from Google Test and won't print any output. Since
- // this operation transfers ownership of the listener to the caller we
- // have to delete it as well.
- delete listeners.Release(listeners.default_result_printer());
-
- // Adds the custom output listener to the list. It will now receive
- // events from Google Test and print the alternative output. We don't
- // have to worry about deleting it since Google Test assumes ownership
- // over it after adding it to the list.
- listeners.Append(new TersePrinter);
- }
- int ret_val = RUN_ALL_TESTS();
-
- // This is an example of using the UnitTest reflection API to inspect test
- // results. Here we discount failures from the tests we expected to fail.
- int unexpectedly_failed_tests = 0;
- for (int i = 0; i < unit_test.total_test_case_count(); ++i) {
- const TestCase& test_case = *unit_test.GetTestCase(i);
- for (int j = 0; j < test_case.total_test_count(); ++j) {
- const TestInfo& test_info = *test_case.GetTestInfo(j);
- // Counts failed tests that were not meant to fail (those without
- // 'Fails' in the name).
- if (test_info.result()->Failed() &&
- strcmp(test_info.name(), "Fails") != 0) {
- unexpectedly_failed_tests++;
- }
- }
- }
-
- // Test that were meant to fail should not affect the test program outcome.
- if (unexpectedly_failed_tests == 0)
- ret_val = 0;
-
- return ret_val;
-}
diff --git a/src/testing/gtest/scripts/fuse_gtest_files.py b/src/testing/gtest/scripts/fuse_gtest_files.py
deleted file mode 100755
index 57ef72f0..00000000
--- a/src/testing/gtest/scripts/fuse_gtest_files.py
+++ /dev/null
@@ -1,250 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2009, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-"""fuse_gtest_files.py v0.2.0
-Fuses Google Test source code into a .h file and a .cc file.
-
-SYNOPSIS
- fuse_gtest_files.py [GTEST_ROOT_DIR] OUTPUT_DIR
-
- Scans GTEST_ROOT_DIR for Google Test source code, and generates
- two files: OUTPUT_DIR/gtest/gtest.h and OUTPUT_DIR/gtest/gtest-all.cc.
- Then you can build your tests by adding OUTPUT_DIR to the include
- search path and linking with OUTPUT_DIR/gtest/gtest-all.cc. These
- two files contain everything you need to use Google Test. Hence
- you can "install" Google Test by copying them to wherever you want.
-
- GTEST_ROOT_DIR can be omitted and defaults to the parent
- directory of the directory holding this script.
-
-EXAMPLES
- ./fuse_gtest_files.py fused_gtest
- ./fuse_gtest_files.py path/to/unpacked/gtest fused_gtest
-
-This tool is experimental. In particular, it assumes that there is no
-conditional inclusion of Google Test headers. Please report any
-problems to googletestframework@googlegroups.com. You can read
-http://code.google.com/p/googletest/wiki/GoogleTestAdvancedGuide for
-more information.
-"""
-
-__author__ = 'wan@google.com (Zhanyong Wan)'
-
-import os
-import re
-import sets
-import sys
-
-# We assume that this file is in the scripts/ directory in the Google
-# Test root directory.
-DEFAULT_GTEST_ROOT_DIR = os.path.join(os.path.dirname(__file__), '..')
-
-# Regex for matching '#include "gtest/..."'.
-INCLUDE_GTEST_FILE_REGEX = re.compile(r'^\s*#\s*include\s*"(gtest/.+)"')
-
-# Regex for matching '#include "src/..."'.
-INCLUDE_SRC_FILE_REGEX = re.compile(r'^\s*#\s*include\s*"(src/.+)"')
-
-# Where to find the source seed files.
-GTEST_H_SEED = 'include/gtest/gtest.h'
-GTEST_SPI_H_SEED = 'include/gtest/gtest-spi.h'
-GTEST_ALL_CC_SEED = 'src/gtest-all.cc'
-
-# Where to put the generated files.
-GTEST_H_OUTPUT = 'gtest/gtest.h'
-GTEST_ALL_CC_OUTPUT = 'gtest/gtest-all.cc'
-
-
-def VerifyFileExists(directory, relative_path):
- """Verifies that the given file exists; aborts on failure.
-
- relative_path is the file path relative to the given directory.
- """
-
- if not os.path.isfile(os.path.join(directory, relative_path)):
- print 'ERROR: Cannot find %s in directory %s.' % (relative_path,
- directory)
- print ('Please either specify a valid project root directory '
- 'or omit it on the command line.')
- sys.exit(1)
-
-
-def ValidateGTestRootDir(gtest_root):
- """Makes sure gtest_root points to a valid gtest root directory.
-
- The function aborts the program on failure.
- """
-
- VerifyFileExists(gtest_root, GTEST_H_SEED)
- VerifyFileExists(gtest_root, GTEST_ALL_CC_SEED)
-
-
-def VerifyOutputFile(output_dir, relative_path):
- """Verifies that the given output file path is valid.
-
- relative_path is relative to the output_dir directory.
- """
-
- # Makes sure the output file either doesn't exist or can be overwritten.
- output_file = os.path.join(output_dir, relative_path)
- if os.path.exists(output_file):
- # TODO(wan@google.com): The following user-interaction doesn't
- # work with automated processes. We should provide a way for the
- # Makefile to force overwriting the files.
- print ('%s already exists in directory %s - overwrite it? (y/N) ' %
- (relative_path, output_dir))
- answer = sys.stdin.readline().strip()
- if answer not in ['y', 'Y']:
- print 'ABORTED.'
- sys.exit(1)
-
- # Makes sure the directory holding the output file exists; creates
- # it and all its ancestors if necessary.
- parent_directory = os.path.dirname(output_file)
- if not os.path.isdir(parent_directory):
- os.makedirs(parent_directory)
-
-
-def ValidateOutputDir(output_dir):
- """Makes sure output_dir points to a valid output directory.
-
- The function aborts the program on failure.
- """
-
- VerifyOutputFile(output_dir, GTEST_H_OUTPUT)
- VerifyOutputFile(output_dir, GTEST_ALL_CC_OUTPUT)
-
-
-def FuseGTestH(gtest_root, output_dir):
- """Scans folder gtest_root to generate gtest/gtest.h in output_dir."""
-
- output_file = file(os.path.join(output_dir, GTEST_H_OUTPUT), 'w')
- processed_files = sets.Set() # Holds all gtest headers we've processed.
-
- def ProcessFile(gtest_header_path):
- """Processes the given gtest header file."""
-
- # We don't process the same header twice.
- if gtest_header_path in processed_files:
- return
-
- processed_files.add(gtest_header_path)
-
- # Reads each line in the given gtest header.
- for line in file(os.path.join(gtest_root, gtest_header_path), 'r'):
- m = INCLUDE_GTEST_FILE_REGEX.match(line)
- if m:
- # It's '#include "gtest/..."' - let's process it recursively.
- ProcessFile('include/' + m.group(1))
- else:
- # Otherwise we copy the line unchanged to the output file.
- output_file.write(line)
-
- ProcessFile(GTEST_H_SEED)
- output_file.close()
-
-
-def FuseGTestAllCcToFile(gtest_root, output_file):
- """Scans folder gtest_root to generate gtest/gtest-all.cc in output_file."""
-
- processed_files = sets.Set()
-
- def ProcessFile(gtest_source_file):
- """Processes the given gtest source file."""
-
- # We don't process the same #included file twice.
- if gtest_source_file in processed_files:
- return
-
- processed_files.add(gtest_source_file)
-
- # Reads each line in the given gtest source file.
- for line in file(os.path.join(gtest_root, gtest_source_file), 'r'):
- m = INCLUDE_GTEST_FILE_REGEX.match(line)
- if m:
- if 'include/' + m.group(1) == GTEST_SPI_H_SEED:
- # It's '#include "gtest/gtest-spi.h"'. This file is not
- # #included by "gtest/gtest.h", so we need to process it.
- ProcessFile(GTEST_SPI_H_SEED)
- else:
- # It's '#include "gtest/foo.h"' where foo is not gtest-spi.
- # We treat it as '#include "gtest/gtest.h"', as all other
- # gtest headers are being fused into gtest.h and cannot be
- # #included directly.
-
- # There is no need to #include "gtest/gtest.h" more than once.
- if not GTEST_H_SEED in processed_files:
- processed_files.add(GTEST_H_SEED)
- output_file.write('#include "%s"\n' % (GTEST_H_OUTPUT,))
- else:
- m = INCLUDE_SRC_FILE_REGEX.match(line)
- if m:
- # It's '#include "src/foo"' - let's process it recursively.
- ProcessFile(m.group(1))
- else:
- output_file.write(line)
-
- ProcessFile(GTEST_ALL_CC_SEED)
-
-
-def FuseGTestAllCc(gtest_root, output_dir):
- """Scans folder gtest_root to generate gtest/gtest-all.cc in output_dir."""
-
- output_file = file(os.path.join(output_dir, GTEST_ALL_CC_OUTPUT), 'w')
- FuseGTestAllCcToFile(gtest_root, output_file)
- output_file.close()
-
-
-def FuseGTest(gtest_root, output_dir):
- """Fuses gtest.h and gtest-all.cc."""
-
- ValidateGTestRootDir(gtest_root)
- ValidateOutputDir(output_dir)
-
- FuseGTestH(gtest_root, output_dir)
- FuseGTestAllCc(gtest_root, output_dir)
-
-
-def main():
- argc = len(sys.argv)
- if argc == 2:
- # fuse_gtest_files.py OUTPUT_DIR
- FuseGTest(DEFAULT_GTEST_ROOT_DIR, sys.argv[1])
- elif argc == 3:
- # fuse_gtest_files.py GTEST_ROOT_DIR OUTPUT_DIR
- FuseGTest(sys.argv[1], sys.argv[2])
- else:
- print __doc__
- sys.exit(1)
-
-
-if __name__ == '__main__':
- main()
diff --git a/src/testing/gtest/scripts/gen_gtest_pred_impl.py b/src/testing/gtest/scripts/gen_gtest_pred_impl.py
deleted file mode 100755
index 3e7ab042..00000000
--- a/src/testing/gtest/scripts/gen_gtest_pred_impl.py
+++ /dev/null
@@ -1,730 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2006, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-"""gen_gtest_pred_impl.py v0.1
-
-Generates the implementation of Google Test predicate assertions and
-accompanying tests.
-
-Usage:
-
- gen_gtest_pred_impl.py MAX_ARITY
-
-where MAX_ARITY is a positive integer.
-
-The command generates the implementation of up-to MAX_ARITY-ary
-predicate assertions, and writes it to file gtest_pred_impl.h in the
-directory where the script is. It also generates the accompanying
-unit test in file gtest_pred_impl_unittest.cc.
-"""
-
-__author__ = 'wan@google.com (Zhanyong Wan)'
-
-import os
-import sys
-import time
-
-# Where this script is.
-SCRIPT_DIR = os.path.dirname(sys.argv[0])
-
-# Where to store the generated header.
-HEADER = os.path.join(SCRIPT_DIR, '../include/gtest/gtest_pred_impl.h')
-
-# Where to store the generated unit test.
-UNIT_TEST = os.path.join(SCRIPT_DIR, '../test/gtest_pred_impl_unittest.cc')
-
-
-def HeaderPreamble(n):
- """Returns the preamble for the header file.
-
- Args:
- n: the maximum arity of the predicate macros to be generated.
- """
-
- # A map that defines the values used in the preamble template.
- DEFS = {
- 'today' : time.strftime('%m/%d/%Y'),
- 'year' : time.strftime('%Y'),
- 'command' : '%s %s' % (os.path.basename(sys.argv[0]), n),
- 'n' : n
- }
-
- return (
-"""// Copyright 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// This file is AUTOMATICALLY GENERATED on %(today)s by command
-// '%(command)s'. DO NOT EDIT BY HAND!
-//
-// Implements a family of generic predicate assertion macros.
-
-#ifndef GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
-#define GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
-
-// Makes sure this header is not included before gtest.h.
-#ifndef GTEST_INCLUDE_GTEST_GTEST_H_
-# error Do not include gtest_pred_impl.h directly. Include gtest.h instead.
-#endif // GTEST_INCLUDE_GTEST_GTEST_H_
-
-// This header implements a family of generic predicate assertion
-// macros:
-//
-// ASSERT_PRED_FORMAT1(pred_format, v1)
-// ASSERT_PRED_FORMAT2(pred_format, v1, v2)
-// ...
-//
-// where pred_format is a function or functor that takes n (in the
-// case of ASSERT_PRED_FORMATn) values and their source expression
-// text, and returns a testing::AssertionResult. See the definition
-// of ASSERT_EQ in gtest.h for an example.
-//
-// If you don't care about formatting, you can use the more
-// restrictive version:
-//
-// ASSERT_PRED1(pred, v1)
-// ASSERT_PRED2(pred, v1, v2)
-// ...
-//
-// where pred is an n-ary function or functor that returns bool,
-// and the values v1, v2, ..., must support the << operator for
-// streaming to std::ostream.
-//
-// We also define the EXPECT_* variations.
-//
-// For now we only support predicates whose arity is at most %(n)s.
-// Please email googletestframework@googlegroups.com if you need
-// support for higher arities.
-
-// GTEST_ASSERT_ is the basic statement to which all of the assertions
-// in this file reduce. Don't use this in your code.
-
-#define GTEST_ASSERT_(expression, on_failure) \\
- GTEST_AMBIGUOUS_ELSE_BLOCKER_ \\
- if (const ::testing::AssertionResult gtest_ar = (expression)) \\
- ; \\
- else \\
- on_failure(gtest_ar.failure_message())
-""" % DEFS)
-
-
-def Arity(n):
- """Returns the English name of the given arity."""
-
- if n < 0:
- return None
- elif n <= 3:
- return ['nullary', 'unary', 'binary', 'ternary'][n]
- else:
- return '%s-ary' % n
-
-
-def Title(word):
- """Returns the given word in title case. The difference between
- this and string's title() method is that Title('4-ary') is '4-ary'
- while '4-ary'.title() is '4-Ary'."""
-
- return word[0].upper() + word[1:]
-
-
-def OneTo(n):
- """Returns the list [1, 2, 3, ..., n]."""
-
- return range(1, n + 1)
-
-
-def Iter(n, format, sep=''):
- """Given a positive integer n, a format string that contains 0 or
- more '%s' format specs, and optionally a separator string, returns
- the join of n strings, each formatted with the format string on an
- iterator ranged from 1 to n.
-
- Example:
-
- Iter(3, 'v%s', sep=', ') returns 'v1, v2, v3'.
- """
-
- # How many '%s' specs are in format?
- spec_count = len(format.split('%s')) - 1
- return sep.join([format % (spec_count * (i,)) for i in OneTo(n)])
-
-
-def ImplementationForArity(n):
- """Returns the implementation of n-ary predicate assertions."""
-
- # A map the defines the values used in the implementation template.
- DEFS = {
- 'n' : str(n),
- 'vs' : Iter(n, 'v%s', sep=', '),
- 'vts' : Iter(n, '#v%s', sep=', '),
- 'arity' : Arity(n),
- 'Arity' : Title(Arity(n))
- }
-
- impl = """
-
-// Helper function for implementing {EXPECT|ASSERT}_PRED%(n)s. Don't use
-// this in your code.
-template <typename Pred""" % DEFS
-
- impl += Iter(n, """,
- typename T%s""")
-
- impl += """>
-AssertionResult AssertPred%(n)sHelper(const char* pred_text""" % DEFS
-
- impl += Iter(n, """,
- const char* e%s""")
-
- impl += """,
- Pred pred"""
-
- impl += Iter(n, """,
- const T%s& v%s""")
-
- impl += """) {
- if (pred(%(vs)s)) return AssertionSuccess();
-
-""" % DEFS
-
- impl += ' return AssertionFailure() << pred_text << "("'
-
- impl += Iter(n, """
- << e%s""", sep=' << ", "')
-
- impl += ' << ") evaluates to false, where"'
-
- impl += Iter(n, """
- << "\\n" << e%s << " evaluates to " << v%s""")
-
- impl += """;
-}
-
-// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT%(n)s.
-// Don't use this in your code.
-#define GTEST_PRED_FORMAT%(n)s_(pred_format, %(vs)s, on_failure)\\
- GTEST_ASSERT_(pred_format(%(vts)s, %(vs)s), \\
- on_failure)
-
-// Internal macro for implementing {EXPECT|ASSERT}_PRED%(n)s. Don't use
-// this in your code.
-#define GTEST_PRED%(n)s_(pred, %(vs)s, on_failure)\\
- GTEST_ASSERT_(::testing::AssertPred%(n)sHelper(#pred""" % DEFS
-
- impl += Iter(n, """, \\
- #v%s""")
-
- impl += """, \\
- pred"""
-
- impl += Iter(n, """, \\
- v%s""")
-
- impl += """), on_failure)
-
-// %(Arity)s predicate assertion macros.
-#define EXPECT_PRED_FORMAT%(n)s(pred_format, %(vs)s) \\
- GTEST_PRED_FORMAT%(n)s_(pred_format, %(vs)s, GTEST_NONFATAL_FAILURE_)
-#define EXPECT_PRED%(n)s(pred, %(vs)s) \\
- GTEST_PRED%(n)s_(pred, %(vs)s, GTEST_NONFATAL_FAILURE_)
-#define ASSERT_PRED_FORMAT%(n)s(pred_format, %(vs)s) \\
- GTEST_PRED_FORMAT%(n)s_(pred_format, %(vs)s, GTEST_FATAL_FAILURE_)
-#define ASSERT_PRED%(n)s(pred, %(vs)s) \\
- GTEST_PRED%(n)s_(pred, %(vs)s, GTEST_FATAL_FAILURE_)
-
-""" % DEFS
-
- return impl
-
-
-def HeaderPostamble():
- """Returns the postamble for the header file."""
-
- return """
-
-#endif // GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
-"""
-
-
-def GenerateFile(path, content):
- """Given a file path and a content string, overwrites it with the
- given content."""
-
- print 'Updating file %s . . .' % path
-
- f = file(path, 'w+')
- print >>f, content,
- f.close()
-
- print 'File %s has been updated.' % path
-
-
-def GenerateHeader(n):
- """Given the maximum arity n, updates the header file that implements
- the predicate assertions."""
-
- GenerateFile(HEADER,
- HeaderPreamble(n)
- + ''.join([ImplementationForArity(i) for i in OneTo(n)])
- + HeaderPostamble())
-
-
-def UnitTestPreamble():
- """Returns the preamble for the unit test file."""
-
- # A map that defines the values used in the preamble template.
- DEFS = {
- 'today' : time.strftime('%m/%d/%Y'),
- 'year' : time.strftime('%Y'),
- 'command' : '%s %s' % (os.path.basename(sys.argv[0]), sys.argv[1]),
- }
-
- return (
-"""// Copyright 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// This file is AUTOMATICALLY GENERATED on %(today)s by command
-// '%(command)s'. DO NOT EDIT BY HAND!
-
-// Regression test for gtest_pred_impl.h
-//
-// This file is generated by a script and quite long. If you intend to
-// learn how Google Test works by reading its unit tests, read
-// gtest_unittest.cc instead.
-//
-// This is intended as a regression test for the Google Test predicate
-// assertions. We compile it as part of the gtest_unittest target
-// only to keep the implementation tidy and compact, as it is quite
-// involved to set up the stage for testing Google Test using Google
-// Test itself.
-//
-// Currently, gtest_unittest takes ~11 seconds to run in the testing
-// daemon. In the future, if it grows too large and needs much more
-// time to finish, we should consider separating this file into a
-// stand-alone regression test.
-
-#include <iostream>
-
-#include "gtest/gtest.h"
-#include "gtest/gtest-spi.h"
-
-// A user-defined data type.
-struct Bool {
- explicit Bool(int val) : value(val != 0) {}
-
- bool operator>(int n) const { return value > Bool(n).value; }
-
- Bool operator+(const Bool& rhs) const { return Bool(value + rhs.value); }
-
- bool operator==(const Bool& rhs) const { return value == rhs.value; }
-
- bool value;
-};
-
-// Enables Bool to be used in assertions.
-std::ostream& operator<<(std::ostream& os, const Bool& x) {
- return os << (x.value ? "true" : "false");
-}
-
-""" % DEFS)
-
-
-def TestsForArity(n):
- """Returns the tests for n-ary predicate assertions."""
-
- # A map that defines the values used in the template for the tests.
- DEFS = {
- 'n' : n,
- 'es' : Iter(n, 'e%s', sep=', '),
- 'vs' : Iter(n, 'v%s', sep=', '),
- 'vts' : Iter(n, '#v%s', sep=', '),
- 'tvs' : Iter(n, 'T%s v%s', sep=', '),
- 'int_vs' : Iter(n, 'int v%s', sep=', '),
- 'Bool_vs' : Iter(n, 'Bool v%s', sep=', '),
- 'types' : Iter(n, 'typename T%s', sep=', '),
- 'v_sum' : Iter(n, 'v%s', sep=' + '),
- 'arity' : Arity(n),
- 'Arity' : Title(Arity(n)),
- }
-
- tests = (
-"""// Sample functions/functors for testing %(arity)s predicate assertions.
-
-// A %(arity)s predicate function.
-template <%(types)s>
-bool PredFunction%(n)s(%(tvs)s) {
- return %(v_sum)s > 0;
-}
-
-// The following two functions are needed to circumvent a bug in
-// gcc 2.95.3, which sometimes has problem with the above template
-// function.
-bool PredFunction%(n)sInt(%(int_vs)s) {
- return %(v_sum)s > 0;
-}
-bool PredFunction%(n)sBool(%(Bool_vs)s) {
- return %(v_sum)s > 0;
-}
-""" % DEFS)
-
- tests += """
-// A %(arity)s predicate functor.
-struct PredFunctor%(n)s {
- template <%(types)s>
- bool operator()(""" % DEFS
-
- tests += Iter(n, 'const T%s& v%s', sep=""",
- """)
-
- tests += """) {
- return %(v_sum)s > 0;
- }
-};
-""" % DEFS
-
- tests += """
-// A %(arity)s predicate-formatter function.
-template <%(types)s>
-testing::AssertionResult PredFormatFunction%(n)s(""" % DEFS
-
- tests += Iter(n, 'const char* e%s', sep=""",
- """)
-
- tests += Iter(n, """,
- const T%s& v%s""")
-
- tests += """) {
- if (PredFunction%(n)s(%(vs)s))
- return testing::AssertionSuccess();
-
- return testing::AssertionFailure()
- << """ % DEFS
-
- tests += Iter(n, 'e%s', sep=' << " + " << ')
-
- tests += """
- << " is expected to be positive, but evaluates to "
- << %(v_sum)s << ".";
-}
-""" % DEFS
-
- tests += """
-// A %(arity)s predicate-formatter functor.
-struct PredFormatFunctor%(n)s {
- template <%(types)s>
- testing::AssertionResult operator()(""" % DEFS
-
- tests += Iter(n, 'const char* e%s', sep=""",
- """)
-
- tests += Iter(n, """,
- const T%s& v%s""")
-
- tests += """) const {
- return PredFormatFunction%(n)s(%(es)s, %(vs)s);
- }
-};
-""" % DEFS
-
- tests += """
-// Tests for {EXPECT|ASSERT}_PRED_FORMAT%(n)s.
-
-class Predicate%(n)sTest : public testing::Test {
- protected:
- virtual void SetUp() {
- expected_to_finish_ = true;
- finished_ = false;""" % DEFS
-
- tests += """
- """ + Iter(n, 'n%s_ = ') + """0;
- }
-"""
-
- tests += """
- virtual void TearDown() {
- // Verifies that each of the predicate's arguments was evaluated
- // exactly once."""
-
- tests += ''.join(["""
- EXPECT_EQ(1, n%s_) <<
- "The predicate assertion didn't evaluate argument %s "
- "exactly once.";""" % (i, i + 1) for i in OneTo(n)])
-
- tests += """
-
- // Verifies that the control flow in the test function is expected.
- if (expected_to_finish_ && !finished_) {
- FAIL() << "The predicate assertion unexpactedly aborted the test.";
- } else if (!expected_to_finish_ && finished_) {
- FAIL() << "The failed predicate assertion didn't abort the test "
- "as expected.";
- }
- }
-
- // true iff the test function is expected to run to finish.
- static bool expected_to_finish_;
-
- // true iff the test function did run to finish.
- static bool finished_;
-""" % DEFS
-
- tests += Iter(n, """
- static int n%s_;""")
-
- tests += """
-};
-
-bool Predicate%(n)sTest::expected_to_finish_;
-bool Predicate%(n)sTest::finished_;
-""" % DEFS
-
- tests += Iter(n, """int Predicate%%(n)sTest::n%s_;
-""") % DEFS
-
- tests += """
-typedef Predicate%(n)sTest EXPECT_PRED_FORMAT%(n)sTest;
-typedef Predicate%(n)sTest ASSERT_PRED_FORMAT%(n)sTest;
-typedef Predicate%(n)sTest EXPECT_PRED%(n)sTest;
-typedef Predicate%(n)sTest ASSERT_PRED%(n)sTest;
-""" % DEFS
-
- def GenTest(use_format, use_assert, expect_failure,
- use_functor, use_user_type):
- """Returns the test for a predicate assertion macro.
-
- Args:
- use_format: true iff the assertion is a *_PRED_FORMAT*.
- use_assert: true iff the assertion is a ASSERT_*.
- expect_failure: true iff the assertion is expected to fail.
- use_functor: true iff the first argument of the assertion is
- a functor (as opposed to a function)
- use_user_type: true iff the predicate functor/function takes
- argument(s) of a user-defined type.
-
- Example:
-
- GenTest(1, 0, 0, 1, 0) returns a test that tests the behavior
- of a successful EXPECT_PRED_FORMATn() that takes a functor
- whose arguments have built-in types."""
-
- if use_assert:
- assrt = 'ASSERT' # 'assert' is reserved, so we cannot use
- # that identifier here.
- else:
- assrt = 'EXPECT'
-
- assertion = assrt + '_PRED'
-
- if use_format:
- pred_format = 'PredFormat'
- assertion += '_FORMAT'
- else:
- pred_format = 'Pred'
-
- assertion += '%(n)s' % DEFS
-
- if use_functor:
- pred_format_type = 'functor'
- pred_format += 'Functor%(n)s()'
- else:
- pred_format_type = 'function'
- pred_format += 'Function%(n)s'
- if not use_format:
- if use_user_type:
- pred_format += 'Bool'
- else:
- pred_format += 'Int'
-
- test_name = pred_format_type.title()
-
- if use_user_type:
- arg_type = 'user-defined type (Bool)'
- test_name += 'OnUserType'
- if expect_failure:
- arg = 'Bool(n%s_++)'
- else:
- arg = 'Bool(++n%s_)'
- else:
- arg_type = 'built-in type (int)'
- test_name += 'OnBuiltInType'
- if expect_failure:
- arg = 'n%s_++'
- else:
- arg = '++n%s_'
-
- if expect_failure:
- successful_or_failed = 'failed'
- expected_or_not = 'expected.'
- test_name += 'Failure'
- else:
- successful_or_failed = 'successful'
- expected_or_not = 'UNEXPECTED!'
- test_name += 'Success'
-
- # A map that defines the values used in the test template.
- defs = DEFS.copy()
- defs.update({
- 'assert' : assrt,
- 'assertion' : assertion,
- 'test_name' : test_name,
- 'pf_type' : pred_format_type,
- 'pf' : pred_format,
- 'arg_type' : arg_type,
- 'arg' : arg,
- 'successful' : successful_or_failed,
- 'expected' : expected_or_not,
- })
-
- test = """
-// Tests a %(successful)s %(assertion)s where the
-// predicate-formatter is a %(pf_type)s on a %(arg_type)s.
-TEST_F(%(assertion)sTest, %(test_name)s) {""" % defs
-
- indent = (len(assertion) + 3)*' '
- extra_indent = ''
-
- if expect_failure:
- extra_indent = ' '
- if use_assert:
- test += """
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT"""
- else:
- test += """
- EXPECT_NONFATAL_FAILURE({ // NOLINT"""
-
- test += '\n' + extra_indent + """ %(assertion)s(%(pf)s""" % defs
-
- test = test % defs
- test += Iter(n, ',\n' + indent + extra_indent + '%(arg)s' % defs)
- test += ');\n' + extra_indent + ' finished_ = true;\n'
-
- if expect_failure:
- test += ' }, "");\n'
-
- test += '}\n'
- return test
-
- # Generates tests for all 2**6 = 64 combinations.
- tests += ''.join([GenTest(use_format, use_assert, expect_failure,
- use_functor, use_user_type)
- for use_format in [0, 1]
- for use_assert in [0, 1]
- for expect_failure in [0, 1]
- for use_functor in [0, 1]
- for use_user_type in [0, 1]
- ])
-
- return tests
-
-
-def UnitTestPostamble():
- """Returns the postamble for the tests."""
-
- return ''
-
-
-def GenerateUnitTest(n):
- """Returns the tests for up-to n-ary predicate assertions."""
-
- GenerateFile(UNIT_TEST,
- UnitTestPreamble()
- + ''.join([TestsForArity(i) for i in OneTo(n)])
- + UnitTestPostamble())
-
-
-def _Main():
- """The entry point of the script. Generates the header file and its
- unit test."""
-
- if len(sys.argv) != 2:
- print __doc__
- print 'Author: ' + __author__
- sys.exit(1)
-
- n = int(sys.argv[1])
- GenerateHeader(n)
- GenerateUnitTest(n)
-
-
-if __name__ == '__main__':
- _Main()
diff --git a/src/testing/gtest/scripts/gtest-config.in b/src/testing/gtest/scripts/gtest-config.in
deleted file mode 100755
index 9c726385..00000000
--- a/src/testing/gtest/scripts/gtest-config.in
+++ /dev/null
@@ -1,274 +0,0 @@
-#!/bin/sh
-
-# These variables are automatically filled in by the configure script.
-name="@PACKAGE_TARNAME@"
-version="@PACKAGE_VERSION@"
-
-show_usage()
-{
- echo "Usage: gtest-config [OPTIONS...]"
-}
-
-show_help()
-{
- show_usage
- cat <<\EOF
-
-The `gtest-config' script provides access to the necessary compile and linking
-flags to connect with Google C++ Testing Framework, both in a build prior to
-installation, and on the system proper after installation. The installation
-overrides may be issued in combination with any other queries, but will only
-affect installation queries if called on a built but not installed gtest. The
-installation queries may not be issued with any other types of queries, and
-only one installation query may be made at a time. The version queries and
-compiler flag queries may be combined as desired but not mixed. Different
-version queries are always combined with logical "and" semantics, and only the
-last of any particular query is used while all previous ones ignored. All
-versions must be specified as a sequence of numbers separated by periods.
-Compiler flag queries output the union of the sets of flags when combined.
-
- Examples:
- gtest-config --min-version=1.0 || echo "Insufficient Google Test version."
-
- g++ $(gtest-config --cppflags --cxxflags) -o foo.o -c foo.cpp
- g++ $(gtest-config --ldflags --libs) -o foo foo.o
-
- # When using a built but not installed Google Test:
- g++ $(../../my_gtest_build/scripts/gtest-config ...) ...
-
- # When using an installed Google Test, but with installation overrides:
- export GTEST_PREFIX="/opt"
- g++ $(gtest-config --libdir="/opt/lib64" ...) ...
-
- Help:
- --usage brief usage information
- --help display this help message
-
- Installation Overrides:
- --prefix=<dir> overrides the installation prefix
- --exec-prefix=<dir> overrides the executable installation prefix
- --libdir=<dir> overrides the library installation prefix
- --includedir=<dir> overrides the header file installation prefix
-
- Installation Queries:
- --prefix installation prefix
- --exec-prefix executable installation prefix
- --libdir library installation directory
- --includedir header file installation directory
- --version the version of the Google Test installation
-
- Version Queries:
- --min-version=VERSION return 0 if the version is at least VERSION
- --exact-version=VERSION return 0 if the version is exactly VERSION
- --max-version=VERSION return 0 if the version is at most VERSION
-
- Compilation Flag Queries:
- --cppflags compile flags specific to the C-like preprocessors
- --cxxflags compile flags appropriate for C++ programs
- --ldflags linker flags
- --libs libraries for linking
-
-EOF
-}
-
-# This function bounds our version with a min and a max. It uses some clever
-# POSIX-compliant variable expansion to portably do all the work in the shell
-# and avoid any dependency on a particular "sed" or "awk" implementation.
-# Notable is that it will only ever compare the first 3 components of versions.
-# Further components will be cleanly stripped off. All versions must be
-# unadorned, so "v1.0" will *not* work. The minimum version must be in $1, and
-# the max in $2. TODO(chandlerc@google.com): If this ever breaks, we should
-# investigate expanding this via autom4te from AS_VERSION_COMPARE rather than
-# continuing to maintain our own shell version.
-check_versions()
-{
- major_version=${version%%.*}
- minor_version="0"
- point_version="0"
- if test "${version#*.}" != "${version}"; then
- minor_version=${version#*.}
- minor_version=${minor_version%%.*}
- fi
- if test "${version#*.*.}" != "${version}"; then
- point_version=${version#*.*.}
- point_version=${point_version%%.*}
- fi
-
- min_version="$1"
- min_major_version=${min_version%%.*}
- min_minor_version="0"
- min_point_version="0"
- if test "${min_version#*.}" != "${min_version}"; then
- min_minor_version=${min_version#*.}
- min_minor_version=${min_minor_version%%.*}
- fi
- if test "${min_version#*.*.}" != "${min_version}"; then
- min_point_version=${min_version#*.*.}
- min_point_version=${min_point_version%%.*}
- fi
-
- max_version="$2"
- max_major_version=${max_version%%.*}
- max_minor_version="0"
- max_point_version="0"
- if test "${max_version#*.}" != "${max_version}"; then
- max_minor_version=${max_version#*.}
- max_minor_version=${max_minor_version%%.*}
- fi
- if test "${max_version#*.*.}" != "${max_version}"; then
- max_point_version=${max_version#*.*.}
- max_point_version=${max_point_version%%.*}
- fi
-
- test $(($major_version)) -lt $(($min_major_version)) && exit 1
- if test $(($major_version)) -eq $(($min_major_version)); then
- test $(($minor_version)) -lt $(($min_minor_version)) && exit 1
- if test $(($minor_version)) -eq $(($min_minor_version)); then
- test $(($point_version)) -lt $(($min_point_version)) && exit 1
- fi
- fi
-
- test $(($major_version)) -gt $(($max_major_version)) && exit 1
- if test $(($major_version)) -eq $(($max_major_version)); then
- test $(($minor_version)) -gt $(($max_minor_version)) && exit 1
- if test $(($minor_version)) -eq $(($max_minor_version)); then
- test $(($point_version)) -gt $(($max_point_version)) && exit 1
- fi
- fi
-
- exit 0
-}
-
-# Show the usage line when no arguments are specified.
-if test $# -eq 0; then
- show_usage
- exit 1
-fi
-
-while test $# -gt 0; do
- case $1 in
- --usage) show_usage; exit 0;;
- --help) show_help; exit 0;;
-
- # Installation overrides
- --prefix=*) GTEST_PREFIX=${1#--prefix=};;
- --exec-prefix=*) GTEST_EXEC_PREFIX=${1#--exec-prefix=};;
- --libdir=*) GTEST_LIBDIR=${1#--libdir=};;
- --includedir=*) GTEST_INCLUDEDIR=${1#--includedir=};;
-
- # Installation queries
- --prefix|--exec-prefix|--libdir|--includedir|--version)
- if test -n "${do_query}"; then
- show_usage
- exit 1
- fi
- do_query=${1#--}
- ;;
-
- # Version checking
- --min-version=*)
- do_check_versions=yes
- min_version=${1#--min-version=}
- ;;
- --max-version=*)
- do_check_versions=yes
- max_version=${1#--max-version=}
- ;;
- --exact-version=*)
- do_check_versions=yes
- exact_version=${1#--exact-version=}
- ;;
-
- # Compiler flag output
- --cppflags) echo_cppflags=yes;;
- --cxxflags) echo_cxxflags=yes;;
- --ldflags) echo_ldflags=yes;;
- --libs) echo_libs=yes;;
-
- # Everything else is an error
- *) show_usage; exit 1;;
- esac
- shift
-done
-
-# These have defaults filled in by the configure script but can also be
-# overridden by environment variables or command line parameters.
-prefix="${GTEST_PREFIX:-@prefix@}"
-exec_prefix="${GTEST_EXEC_PREFIX:-@exec_prefix@}"
-libdir="${GTEST_LIBDIR:-@libdir@}"
-includedir="${GTEST_INCLUDEDIR:-@includedir@}"
-
-# We try and detect if our binary is not located at its installed location. If
-# it's not, we provide variables pointing to the source and build tree rather
-# than to the install tree. This allows building against a just-built gtest
-# rather than an installed gtest.
-bindir="@bindir@"
-this_relative_bindir=`dirname $0`
-this_bindir=`cd ${this_relative_bindir}; pwd -P`
-if test "${this_bindir}" = "${this_bindir%${bindir}}"; then
- # The path to the script doesn't end in the bindir sequence from Autoconf,
- # assume that we are in a build tree.
- build_dir=`dirname ${this_bindir}`
- src_dir=`cd ${this_bindir}/@top_srcdir@; pwd -P`
-
- # TODO(chandlerc@google.com): This is a dangerous dependency on libtool, we
- # should work to remove it, and/or remove libtool altogether, replacing it
- # with direct references to the library and a link path.
- gtest_libs="${build_dir}/lib/libgtest.la @PTHREAD_CFLAGS@ @PTHREAD_LIBS@"
- gtest_ldflags=""
-
- # We provide hooks to include from either the source or build dir, where the
- # build dir is always preferred. This will potentially allow us to write
- # build rules for generated headers and have them automatically be preferred
- # over provided versions.
- gtest_cppflags="-I${build_dir}/include -I${src_dir}/include"
- gtest_cxxflags="@PTHREAD_CFLAGS@"
-else
- # We're using an installed gtest, although it may be staged under some
- # prefix. Assume (as our own libraries do) that we can resolve the prefix,
- # and are present in the dynamic link paths.
- gtest_ldflags="-L${libdir}"
- gtest_libs="-l${name} @PTHREAD_CFLAGS@ @PTHREAD_LIBS@"
- gtest_cppflags="-I${includedir}"
- gtest_cxxflags="@PTHREAD_CFLAGS@"
-fi
-
-# Do an installation query if requested.
-if test -n "$do_query"; then
- case $do_query in
- prefix) echo $prefix; exit 0;;
- exec-prefix) echo $exec_prefix; exit 0;;
- libdir) echo $libdir; exit 0;;
- includedir) echo $includedir; exit 0;;
- version) echo $version; exit 0;;
- *) show_usage; exit 1;;
- esac
-fi
-
-# Do a version check if requested.
-if test "$do_check_versions" = "yes"; then
- # Make sure we didn't receive a bad combination of parameters.
- test "$echo_cppflags" = "yes" && show_usage && exit 1
- test "$echo_cxxflags" = "yes" && show_usage && exit 1
- test "$echo_ldflags" = "yes" && show_usage && exit 1
- test "$echo_libs" = "yes" && show_usage && exit 1
-
- if test "$exact_version" != ""; then
- check_versions $exact_version $exact_version
- # unreachable
- else
- check_versions ${min_version:-0.0.0} ${max_version:-9999.9999.9999}
- # unreachable
- fi
-fi
-
-# Do the output in the correct order so that these can be used in-line of
-# a compiler invocation.
-output=""
-test "$echo_cppflags" = "yes" && output="$output $gtest_cppflags"
-test "$echo_cxxflags" = "yes" && output="$output $gtest_cxxflags"
-test "$echo_ldflags" = "yes" && output="$output $gtest_ldflags"
-test "$echo_libs" = "yes" && output="$output $gtest_libs"
-echo $output
-
-exit 0
diff --git a/src/testing/gtest/scripts/pump.py b/src/testing/gtest/scripts/pump.py
deleted file mode 100755
index 8afe8081..00000000
--- a/src/testing/gtest/scripts/pump.py
+++ /dev/null
@@ -1,847 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2008, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-"""pump v0.2.0 - Pretty Useful for Meta Programming.
-
-A tool for preprocessor meta programming. Useful for generating
-repetitive boilerplate code. Especially useful for writing C++
-classes, functions, macros, and templates that need to work with
-various number of arguments.
-
-USAGE:
- pump.py SOURCE_FILE
-
-EXAMPLES:
- pump.py foo.cc.pump
- Converts foo.cc.pump to foo.cc.
-
-GRAMMAR:
- CODE ::= ATOMIC_CODE*
- ATOMIC_CODE ::= $var ID = EXPRESSION
- | $var ID = [[ CODE ]]
- | $range ID EXPRESSION..EXPRESSION
- | $for ID SEPARATOR [[ CODE ]]
- | $($)
- | $ID
- | $(EXPRESSION)
- | $if EXPRESSION [[ CODE ]] ELSE_BRANCH
- | [[ CODE ]]
- | RAW_CODE
- SEPARATOR ::= RAW_CODE | EMPTY
- ELSE_BRANCH ::= $else [[ CODE ]]
- | $elif EXPRESSION [[ CODE ]] ELSE_BRANCH
- | EMPTY
- EXPRESSION has Python syntax.
-"""
-
-__author__ = 'wan@google.com (Zhanyong Wan)'
-
-import os
-import re
-import sys
-
-
-TOKEN_TABLE = [
- (re.compile(r'\$var\s+'), '$var'),
- (re.compile(r'\$elif\s+'), '$elif'),
- (re.compile(r'\$else\s+'), '$else'),
- (re.compile(r'\$for\s+'), '$for'),
- (re.compile(r'\$if\s+'), '$if'),
- (re.compile(r'\$range\s+'), '$range'),
- (re.compile(r'\$[_A-Za-z]\w*'), '$id'),
- (re.compile(r'\$\(\$\)'), '$($)'),
- (re.compile(r'\$'), '$'),
- (re.compile(r'\[\[\n?'), '[['),
- (re.compile(r'\]\]\n?'), ']]'),
- ]
-
-
-class Cursor:
- """Represents a position (line and column) in a text file."""
-
- def __init__(self, line=-1, column=-1):
- self.line = line
- self.column = column
-
- def __eq__(self, rhs):
- return self.line == rhs.line and self.column == rhs.column
-
- def __ne__(self, rhs):
- return not self == rhs
-
- def __lt__(self, rhs):
- return self.line < rhs.line or (
- self.line == rhs.line and self.column < rhs.column)
-
- def __le__(self, rhs):
- return self < rhs or self == rhs
-
- def __gt__(self, rhs):
- return rhs < self
-
- def __ge__(self, rhs):
- return rhs <= self
-
- def __str__(self):
- if self == Eof():
- return 'EOF'
- else:
- return '%s(%s)' % (self.line + 1, self.column)
-
- def __add__(self, offset):
- return Cursor(self.line, self.column + offset)
-
- def __sub__(self, offset):
- return Cursor(self.line, self.column - offset)
-
- def Clone(self):
- """Returns a copy of self."""
-
- return Cursor(self.line, self.column)
-
-
-# Special cursor to indicate the end-of-file.
-def Eof():
- """Returns the special cursor to denote the end-of-file."""
- return Cursor(-1, -1)
-
-
-class Token:
- """Represents a token in a Pump source file."""
-
- def __init__(self, start=None, end=None, value=None, token_type=None):
- if start is None:
- self.start = Eof()
- else:
- self.start = start
- if end is None:
- self.end = Eof()
- else:
- self.end = end
- self.value = value
- self.token_type = token_type
-
- def __str__(self):
- return 'Token @%s: \'%s\' type=%s' % (
- self.start, self.value, self.token_type)
-
- def Clone(self):
- """Returns a copy of self."""
-
- return Token(self.start.Clone(), self.end.Clone(), self.value,
- self.token_type)
-
-
-def StartsWith(lines, pos, string):
- """Returns True iff the given position in lines starts with 'string'."""
-
- return lines[pos.line][pos.column:].startswith(string)
-
-
-def FindFirstInLine(line, token_table):
- best_match_start = -1
- for (regex, token_type) in token_table:
- m = regex.search(line)
- if m:
- # We found regex in lines
- if best_match_start < 0 or m.start() < best_match_start:
- best_match_start = m.start()
- best_match_length = m.end() - m.start()
- best_match_token_type = token_type
-
- if best_match_start < 0:
- return None
-
- return (best_match_start, best_match_length, best_match_token_type)
-
-
-def FindFirst(lines, token_table, cursor):
- """Finds the first occurrence of any string in strings in lines."""
-
- start = cursor.Clone()
- cur_line_number = cursor.line
- for line in lines[start.line:]:
- if cur_line_number == start.line:
- line = line[start.column:]
- m = FindFirstInLine(line, token_table)
- if m:
- # We found a regex in line.
- (start_column, length, token_type) = m
- if cur_line_number == start.line:
- start_column += start.column
- found_start = Cursor(cur_line_number, start_column)
- found_end = found_start + length
- return MakeToken(lines, found_start, found_end, token_type)
- cur_line_number += 1
- # We failed to find str in lines
- return None
-
-
-def SubString(lines, start, end):
- """Returns a substring in lines."""
-
- if end == Eof():
- end = Cursor(len(lines) - 1, len(lines[-1]))
-
- if start >= end:
- return ''
-
- if start.line == end.line:
- return lines[start.line][start.column:end.column]
-
- result_lines = ([lines[start.line][start.column:]] +
- lines[start.line + 1:end.line] +
- [lines[end.line][:end.column]])
- return ''.join(result_lines)
-
-
-def StripMetaComments(str):
- """Strip meta comments from each line in the given string."""
-
- # First, completely remove lines containing nothing but a meta
- # comment, including the trailing \n.
- str = re.sub(r'^\s*\$\$.*\n', '', str)
-
- # Then, remove meta comments from contentful lines.
- return re.sub(r'\s*\$\$.*', '', str)
-
-
-def MakeToken(lines, start, end, token_type):
- """Creates a new instance of Token."""
-
- return Token(start, end, SubString(lines, start, end), token_type)
-
-
-def ParseToken(lines, pos, regex, token_type):
- line = lines[pos.line][pos.column:]
- m = regex.search(line)
- if m and not m.start():
- return MakeToken(lines, pos, pos + m.end(), token_type)
- else:
- print 'ERROR: %s expected at %s.' % (token_type, pos)
- sys.exit(1)
-
-
-ID_REGEX = re.compile(r'[_A-Za-z]\w*')
-EQ_REGEX = re.compile(r'=')
-REST_OF_LINE_REGEX = re.compile(r'.*?(?=$|\$\$)')
-OPTIONAL_WHITE_SPACES_REGEX = re.compile(r'\s*')
-WHITE_SPACE_REGEX = re.compile(r'\s')
-DOT_DOT_REGEX = re.compile(r'\.\.')
-
-
-def Skip(lines, pos, regex):
- line = lines[pos.line][pos.column:]
- m = re.search(regex, line)
- if m and not m.start():
- return pos + m.end()
- else:
- return pos
-
-
-def SkipUntil(lines, pos, regex, token_type):
- line = lines[pos.line][pos.column:]
- m = re.search(regex, line)
- if m:
- return pos + m.start()
- else:
- print ('ERROR: %s expected on line %s after column %s.' %
- (token_type, pos.line + 1, pos.column))
- sys.exit(1)
-
-
-def ParseExpTokenInParens(lines, pos):
- def ParseInParens(pos):
- pos = Skip(lines, pos, OPTIONAL_WHITE_SPACES_REGEX)
- pos = Skip(lines, pos, r'\(')
- pos = Parse(pos)
- pos = Skip(lines, pos, r'\)')
- return pos
-
- def Parse(pos):
- pos = SkipUntil(lines, pos, r'\(|\)', ')')
- if SubString(lines, pos, pos + 1) == '(':
- pos = Parse(pos + 1)
- pos = Skip(lines, pos, r'\)')
- return Parse(pos)
- else:
- return pos
-
- start = pos.Clone()
- pos = ParseInParens(pos)
- return MakeToken(lines, start, pos, 'exp')
-
-
-def RStripNewLineFromToken(token):
- if token.value.endswith('\n'):
- return Token(token.start, token.end, token.value[:-1], token.token_type)
- else:
- return token
-
-
-def TokenizeLines(lines, pos):
- while True:
- found = FindFirst(lines, TOKEN_TABLE, pos)
- if not found:
- yield MakeToken(lines, pos, Eof(), 'code')
- return
-
- if found.start == pos:
- prev_token = None
- prev_token_rstripped = None
- else:
- prev_token = MakeToken(lines, pos, found.start, 'code')
- prev_token_rstripped = RStripNewLineFromToken(prev_token)
-
- if found.token_type == '$var':
- if prev_token_rstripped:
- yield prev_token_rstripped
- yield found
- id_token = ParseToken(lines, found.end, ID_REGEX, 'id')
- yield id_token
- pos = Skip(lines, id_token.end, OPTIONAL_WHITE_SPACES_REGEX)
-
- eq_token = ParseToken(lines, pos, EQ_REGEX, '=')
- yield eq_token
- pos = Skip(lines, eq_token.end, r'\s*')
-
- if SubString(lines, pos, pos + 2) != '[[':
- exp_token = ParseToken(lines, pos, REST_OF_LINE_REGEX, 'exp')
- yield exp_token
- pos = Cursor(exp_token.end.line + 1, 0)
- elif found.token_type == '$for':
- if prev_token_rstripped:
- yield prev_token_rstripped
- yield found
- id_token = ParseToken(lines, found.end, ID_REGEX, 'id')
- yield id_token
- pos = Skip(lines, id_token.end, WHITE_SPACE_REGEX)
- elif found.token_type == '$range':
- if prev_token_rstripped:
- yield prev_token_rstripped
- yield found
- id_token = ParseToken(lines, found.end, ID_REGEX, 'id')
- yield id_token
- pos = Skip(lines, id_token.end, OPTIONAL_WHITE_SPACES_REGEX)
-
- dots_pos = SkipUntil(lines, pos, DOT_DOT_REGEX, '..')
- yield MakeToken(lines, pos, dots_pos, 'exp')
- yield MakeToken(lines, dots_pos, dots_pos + 2, '..')
- pos = dots_pos + 2
- new_pos = Cursor(pos.line + 1, 0)
- yield MakeToken(lines, pos, new_pos, 'exp')
- pos = new_pos
- elif found.token_type == '$':
- if prev_token:
- yield prev_token
- yield found
- exp_token = ParseExpTokenInParens(lines, found.end)
- yield exp_token
- pos = exp_token.end
- elif (found.token_type == ']]' or found.token_type == '$if' or
- found.token_type == '$elif' or found.token_type == '$else'):
- if prev_token_rstripped:
- yield prev_token_rstripped
- yield found
- pos = found.end
- else:
- if prev_token:
- yield prev_token
- yield found
- pos = found.end
-
-
-def Tokenize(s):
- """A generator that yields the tokens in the given string."""
- if s != '':
- lines = s.splitlines(True)
- for token in TokenizeLines(lines, Cursor(0, 0)):
- yield token
-
-
-class CodeNode:
- def __init__(self, atomic_code_list=None):
- self.atomic_code = atomic_code_list
-
-
-class VarNode:
- def __init__(self, identifier=None, atomic_code=None):
- self.identifier = identifier
- self.atomic_code = atomic_code
-
-
-class RangeNode:
- def __init__(self, identifier=None, exp1=None, exp2=None):
- self.identifier = identifier
- self.exp1 = exp1
- self.exp2 = exp2
-
-
-class ForNode:
- def __init__(self, identifier=None, sep=None, code=None):
- self.identifier = identifier
- self.sep = sep
- self.code = code
-
-
-class ElseNode:
- def __init__(self, else_branch=None):
- self.else_branch = else_branch
-
-
-class IfNode:
- def __init__(self, exp=None, then_branch=None, else_branch=None):
- self.exp = exp
- self.then_branch = then_branch
- self.else_branch = else_branch
-
-
-class RawCodeNode:
- def __init__(self, token=None):
- self.raw_code = token
-
-
-class LiteralDollarNode:
- def __init__(self, token):
- self.token = token
-
-
-class ExpNode:
- def __init__(self, token, python_exp):
- self.token = token
- self.python_exp = python_exp
-
-
-def PopFront(a_list):
- head = a_list[0]
- a_list[:1] = []
- return head
-
-
-def PushFront(a_list, elem):
- a_list[:0] = [elem]
-
-
-def PopToken(a_list, token_type=None):
- token = PopFront(a_list)
- if token_type is not None and token.token_type != token_type:
- print 'ERROR: %s expected at %s' % (token_type, token.start)
- print 'ERROR: %s found instead' % (token,)
- sys.exit(1)
-
- return token
-
-
-def PeekToken(a_list):
- if not a_list:
- return None
-
- return a_list[0]
-
-
-def ParseExpNode(token):
- python_exp = re.sub(r'([_A-Za-z]\w*)', r'self.GetValue("\1")', token.value)
- return ExpNode(token, python_exp)
-
-
-def ParseElseNode(tokens):
- def Pop(token_type=None):
- return PopToken(tokens, token_type)
-
- next = PeekToken(tokens)
- if not next:
- return None
- if next.token_type == '$else':
- Pop('$else')
- Pop('[[')
- code_node = ParseCodeNode(tokens)
- Pop(']]')
- return code_node
- elif next.token_type == '$elif':
- Pop('$elif')
- exp = Pop('code')
- Pop('[[')
- code_node = ParseCodeNode(tokens)
- Pop(']]')
- inner_else_node = ParseElseNode(tokens)
- return CodeNode([IfNode(ParseExpNode(exp), code_node, inner_else_node)])
- elif not next.value.strip():
- Pop('code')
- return ParseElseNode(tokens)
- else:
- return None
-
-
-def ParseAtomicCodeNode(tokens):
- def Pop(token_type=None):
- return PopToken(tokens, token_type)
-
- head = PopFront(tokens)
- t = head.token_type
- if t == 'code':
- return RawCodeNode(head)
- elif t == '$var':
- id_token = Pop('id')
- Pop('=')
- next = PeekToken(tokens)
- if next.token_type == 'exp':
- exp_token = Pop()
- return VarNode(id_token, ParseExpNode(exp_token))
- Pop('[[')
- code_node = ParseCodeNode(tokens)
- Pop(']]')
- return VarNode(id_token, code_node)
- elif t == '$for':
- id_token = Pop('id')
- next_token = PeekToken(tokens)
- if next_token.token_type == 'code':
- sep_token = next_token
- Pop('code')
- else:
- sep_token = None
- Pop('[[')
- code_node = ParseCodeNode(tokens)
- Pop(']]')
- return ForNode(id_token, sep_token, code_node)
- elif t == '$if':
- exp_token = Pop('code')
- Pop('[[')
- code_node = ParseCodeNode(tokens)
- Pop(']]')
- else_node = ParseElseNode(tokens)
- return IfNode(ParseExpNode(exp_token), code_node, else_node)
- elif t == '$range':
- id_token = Pop('id')
- exp1_token = Pop('exp')
- Pop('..')
- exp2_token = Pop('exp')
- return RangeNode(id_token, ParseExpNode(exp1_token),
- ParseExpNode(exp2_token))
- elif t == '$id':
- return ParseExpNode(Token(head.start + 1, head.end, head.value[1:], 'id'))
- elif t == '$($)':
- return LiteralDollarNode(head)
- elif t == '$':
- exp_token = Pop('exp')
- return ParseExpNode(exp_token)
- elif t == '[[':
- code_node = ParseCodeNode(tokens)
- Pop(']]')
- return code_node
- else:
- PushFront(tokens, head)
- return None
-
-
-def ParseCodeNode(tokens):
- atomic_code_list = []
- while True:
- if not tokens:
- break
- atomic_code_node = ParseAtomicCodeNode(tokens)
- if atomic_code_node:
- atomic_code_list.append(atomic_code_node)
- else:
- break
- return CodeNode(atomic_code_list)
-
-
-def ParseToAST(pump_src_text):
- """Convert the given Pump source text into an AST."""
- tokens = list(Tokenize(pump_src_text))
- code_node = ParseCodeNode(tokens)
- return code_node
-
-
-class Env:
- def __init__(self):
- self.variables = []
- self.ranges = []
-
- def Clone(self):
- clone = Env()
- clone.variables = self.variables[:]
- clone.ranges = self.ranges[:]
- return clone
-
- def PushVariable(self, var, value):
- # If value looks like an int, store it as an int.
- try:
- int_value = int(value)
- if ('%s' % int_value) == value:
- value = int_value
- except Exception:
- pass
- self.variables[:0] = [(var, value)]
-
- def PopVariable(self):
- self.variables[:1] = []
-
- def PushRange(self, var, lower, upper):
- self.ranges[:0] = [(var, lower, upper)]
-
- def PopRange(self):
- self.ranges[:1] = []
-
- def GetValue(self, identifier):
- for (var, value) in self.variables:
- if identifier == var:
- return value
-
- print 'ERROR: meta variable %s is undefined.' % (identifier,)
- sys.exit(1)
-
- def EvalExp(self, exp):
- try:
- result = eval(exp.python_exp)
- except Exception, e:
- print 'ERROR: caught exception %s: %s' % (e.__class__.__name__, e)
- print ('ERROR: failed to evaluate meta expression %s at %s' %
- (exp.python_exp, exp.token.start))
- sys.exit(1)
- return result
-
- def GetRange(self, identifier):
- for (var, lower, upper) in self.ranges:
- if identifier == var:
- return (lower, upper)
-
- print 'ERROR: range %s is undefined.' % (identifier,)
- sys.exit(1)
-
-
-class Output:
- def __init__(self):
- self.string = ''
-
- def GetLastLine(self):
- index = self.string.rfind('\n')
- if index < 0:
- return ''
-
- return self.string[index + 1:]
-
- def Append(self, s):
- self.string += s
-
-
-def RunAtomicCode(env, node, output):
- if isinstance(node, VarNode):
- identifier = node.identifier.value.strip()
- result = Output()
- RunAtomicCode(env.Clone(), node.atomic_code, result)
- value = result.string
- env.PushVariable(identifier, value)
- elif isinstance(node, RangeNode):
- identifier = node.identifier.value.strip()
- lower = int(env.EvalExp(node.exp1))
- upper = int(env.EvalExp(node.exp2))
- env.PushRange(identifier, lower, upper)
- elif isinstance(node, ForNode):
- identifier = node.identifier.value.strip()
- if node.sep is None:
- sep = ''
- else:
- sep = node.sep.value
- (lower, upper) = env.GetRange(identifier)
- for i in range(lower, upper + 1):
- new_env = env.Clone()
- new_env.PushVariable(identifier, i)
- RunCode(new_env, node.code, output)
- if i != upper:
- output.Append(sep)
- elif isinstance(node, RawCodeNode):
- output.Append(node.raw_code.value)
- elif isinstance(node, IfNode):
- cond = env.EvalExp(node.exp)
- if cond:
- RunCode(env.Clone(), node.then_branch, output)
- elif node.else_branch is not None:
- RunCode(env.Clone(), node.else_branch, output)
- elif isinstance(node, ExpNode):
- value = env.EvalExp(node)
- output.Append('%s' % (value,))
- elif isinstance(node, LiteralDollarNode):
- output.Append('$')
- elif isinstance(node, CodeNode):
- RunCode(env.Clone(), node, output)
- else:
- print 'BAD'
- print node
- sys.exit(1)
-
-
-def RunCode(env, code_node, output):
- for atomic_code in code_node.atomic_code:
- RunAtomicCode(env, atomic_code, output)
-
-
-def IsComment(cur_line):
- return '//' in cur_line
-
-
-def IsInPreprocessorDirevative(prev_lines, cur_line):
- if cur_line.lstrip().startswith('#'):
- return True
- return prev_lines != [] and prev_lines[-1].endswith('\\')
-
-
-def WrapComment(line, output):
- loc = line.find('//')
- before_comment = line[:loc].rstrip()
- if before_comment == '':
- indent = loc
- else:
- output.append(before_comment)
- indent = len(before_comment) - len(before_comment.lstrip())
- prefix = indent*' ' + '// '
- max_len = 80 - len(prefix)
- comment = line[loc + 2:].strip()
- segs = [seg for seg in re.split(r'(\w+\W*)', comment) if seg != '']
- cur_line = ''
- for seg in segs:
- if len((cur_line + seg).rstrip()) < max_len:
- cur_line += seg
- else:
- if cur_line.strip() != '':
- output.append(prefix + cur_line.rstrip())
- cur_line = seg.lstrip()
- if cur_line.strip() != '':
- output.append(prefix + cur_line.strip())
-
-
-def WrapCode(line, line_concat, output):
- indent = len(line) - len(line.lstrip())
- prefix = indent*' ' # Prefix of the current line
- max_len = 80 - indent - len(line_concat) # Maximum length of the current line
- new_prefix = prefix + 4*' ' # Prefix of a continuation line
- new_max_len = max_len - 4 # Maximum length of a continuation line
- # Prefers to wrap a line after a ',' or ';'.
- segs = [seg for seg in re.split(r'([^,;]+[,;]?)', line.strip()) if seg != '']
- cur_line = '' # The current line without leading spaces.
- for seg in segs:
- # If the line is still too long, wrap at a space.
- while cur_line == '' and len(seg.strip()) > max_len:
- seg = seg.lstrip()
- split_at = seg.rfind(' ', 0, max_len)
- output.append(prefix + seg[:split_at].strip() + line_concat)
- seg = seg[split_at + 1:]
- prefix = new_prefix
- max_len = new_max_len
-
- if len((cur_line + seg).rstrip()) < max_len:
- cur_line = (cur_line + seg).lstrip()
- else:
- output.append(prefix + cur_line.rstrip() + line_concat)
- prefix = new_prefix
- max_len = new_max_len
- cur_line = seg.lstrip()
- if cur_line.strip() != '':
- output.append(prefix + cur_line.strip())
-
-
-def WrapPreprocessorDirevative(line, output):
- WrapCode(line, ' \\', output)
-
-
-def WrapPlainCode(line, output):
- WrapCode(line, '', output)
-
-
-def IsHeaderGuardOrInclude(line):
- return (re.match(r'^#(ifndef|define|endif\s*//)\s*[\w_]+\s*$', line) or
- re.match(r'^#include\s', line))
-
-
-def WrapLongLine(line, output):
- line = line.rstrip()
- if len(line) <= 80:
- output.append(line)
- elif IsComment(line):
- if IsHeaderGuardOrInclude(line):
- # The style guide made an exception to allow long header guard lines
- # and includes.
- output.append(line)
- else:
- WrapComment(line, output)
- elif IsInPreprocessorDirevative(output, line):
- if IsHeaderGuardOrInclude(line):
- # The style guide made an exception to allow long header guard lines
- # and includes.
- output.append(line)
- else:
- WrapPreprocessorDirevative(line, output)
- else:
- WrapPlainCode(line, output)
-
-
-def BeautifyCode(string):
- lines = string.splitlines()
- output = []
- for line in lines:
- WrapLongLine(line, output)
- output2 = [line.rstrip() for line in output]
- return '\n'.join(output2) + '\n'
-
-
-def ConvertFromPumpSource(src_text):
- """Return the text generated from the given Pump source text."""
- ast = ParseToAST(StripMetaComments(src_text))
- output = Output()
- RunCode(Env(), ast, output)
- return BeautifyCode(output.string)
-
-
-def main(argv):
- if len(argv) == 1:
- print __doc__
- sys.exit(1)
-
- file_path = argv[-1]
- output_str = ConvertFromPumpSource(file(file_path, 'r').read())
- if file_path.endswith('.pump'):
- output_file_path = file_path[:-5]
- else:
- output_file_path = '-'
- if output_file_path == '-':
- print output_str,
- else:
- output_file = file(output_file_path, 'w')
- output_file.write('// This file was GENERATED by command:\n')
- output_file.write('// %s %s\n' %
- (os.path.basename(__file__), os.path.basename(file_path)))
- output_file.write('// DO NOT EDIT BY HAND!!!\n\n')
- output_file.write(output_str)
- output_file.close()
-
-
-if __name__ == '__main__':
- main(sys.argv)
diff --git a/src/testing/gtest/scripts/test/Makefile b/src/testing/gtest/scripts/test/Makefile
deleted file mode 100644
index cdff5846..00000000
--- a/src/testing/gtest/scripts/test/Makefile
+++ /dev/null
@@ -1,59 +0,0 @@
-# A Makefile for fusing Google Test and building a sample test against it.
-#
-# SYNOPSIS:
-#
-# make [all] - makes everything.
-# make TARGET - makes the given target.
-# make check - makes everything and runs the built sample test.
-# make clean - removes all files generated by make.
-
-# Points to the root of fused Google Test, relative to where this file is.
-FUSED_GTEST_DIR = output
-
-# Paths to the fused gtest files.
-FUSED_GTEST_H = $(FUSED_GTEST_DIR)/gtest/gtest.h
-FUSED_GTEST_ALL_CC = $(FUSED_GTEST_DIR)/gtest/gtest-all.cc
-
-# Where to find the sample test.
-SAMPLE_DIR = ../../samples
-
-# Where to find gtest_main.cc.
-GTEST_MAIN_CC = ../../src/gtest_main.cc
-
-# Flags passed to the preprocessor.
-# We have no idea here whether pthreads is available in the system, so
-# disable its use.
-CPPFLAGS += -I$(FUSED_GTEST_DIR) -DGTEST_HAS_PTHREAD=0
-
-# Flags passed to the C++ compiler.
-CXXFLAGS += -g
-
-all : sample1_unittest
-
-check : all
- ./sample1_unittest
-
-clean :
- rm -rf $(FUSED_GTEST_DIR) sample1_unittest *.o
-
-$(FUSED_GTEST_H) :
- ../fuse_gtest_files.py $(FUSED_GTEST_DIR)
-
-$(FUSED_GTEST_ALL_CC) :
- ../fuse_gtest_files.py $(FUSED_GTEST_DIR)
-
-gtest-all.o : $(FUSED_GTEST_H) $(FUSED_GTEST_ALL_CC)
- $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(FUSED_GTEST_DIR)/gtest/gtest-all.cc
-
-gtest_main.o : $(FUSED_GTEST_H) $(GTEST_MAIN_CC)
- $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(GTEST_MAIN_CC)
-
-sample1.o : $(SAMPLE_DIR)/sample1.cc $(SAMPLE_DIR)/sample1.h
- $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(SAMPLE_DIR)/sample1.cc
-
-sample1_unittest.o : $(SAMPLE_DIR)/sample1_unittest.cc \
- $(SAMPLE_DIR)/sample1.h $(FUSED_GTEST_H)
- $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(SAMPLE_DIR)/sample1_unittest.cc
-
-sample1_unittest : sample1.o sample1_unittest.o gtest-all.o gtest_main.o
- $(CXX) $(CPPFLAGS) $(CXXFLAGS) $^ -o $@
diff --git a/src/testing/gtest/scripts/upload.py b/src/testing/gtest/scripts/upload.py
deleted file mode 100755
index 6e6f9a14..00000000
--- a/src/testing/gtest/scripts/upload.py
+++ /dev/null
@@ -1,1387 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2007 Google Inc.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-"""Tool for uploading diffs from a version control system to the codereview app.
-
-Usage summary: upload.py [options] [-- diff_options]
-
-Diff options are passed to the diff command of the underlying system.
-
-Supported version control systems:
- Git
- Mercurial
- Subversion
-
-It is important for Git/Mercurial users to specify a tree/node/branch to diff
-against by using the '--rev' option.
-"""
-# This code is derived from appcfg.py in the App Engine SDK (open source),
-# and from ASPN recipe #146306.
-
-import cookielib
-import getpass
-import logging
-import md5
-import mimetypes
-import optparse
-import os
-import re
-import socket
-import subprocess
-import sys
-import urllib
-import urllib2
-import urlparse
-
-try:
- import readline
-except ImportError:
- pass
-
-# The logging verbosity:
-# 0: Errors only.
-# 1: Status messages.
-# 2: Info logs.
-# 3: Debug logs.
-verbosity = 1
-
-# Max size of patch or base file.
-MAX_UPLOAD_SIZE = 900 * 1024
-
-
-def GetEmail(prompt):
- """Prompts the user for their email address and returns it.
-
- The last used email address is saved to a file and offered up as a suggestion
- to the user. If the user presses enter without typing in anything the last
- used email address is used. If the user enters a new address, it is saved
- for next time we prompt.
-
- """
- last_email_file_name = os.path.expanduser("~/.last_codereview_email_address")
- last_email = ""
- if os.path.exists(last_email_file_name):
- try:
- last_email_file = open(last_email_file_name, "r")
- last_email = last_email_file.readline().strip("\n")
- last_email_file.close()
- prompt += " [%s]" % last_email
- except IOError, e:
- pass
- email = raw_input(prompt + ": ").strip()
- if email:
- try:
- last_email_file = open(last_email_file_name, "w")
- last_email_file.write(email)
- last_email_file.close()
- except IOError, e:
- pass
- else:
- email = last_email
- return email
-
-
-def StatusUpdate(msg):
- """Print a status message to stdout.
-
- If 'verbosity' is greater than 0, print the message.
-
- Args:
- msg: The string to print.
- """
- if verbosity > 0:
- print msg
-
-
-def ErrorExit(msg):
- """Print an error message to stderr and exit."""
- print >>sys.stderr, msg
- sys.exit(1)
-
-
-class ClientLoginError(urllib2.HTTPError):
- """Raised to indicate there was an error authenticating with ClientLogin."""
-
- def __init__(self, url, code, msg, headers, args):
- urllib2.HTTPError.__init__(self, url, code, msg, headers, None)
- self.args = args
- self.reason = args["Error"]
-
-
-class AbstractRpcServer(object):
- """Provides a common interface for a simple RPC server."""
-
- def __init__(self, host, auth_function, host_override=None, extra_headers={},
- save_cookies=False):
- """Creates a new HttpRpcServer.
-
- Args:
- host: The host to send requests to.
- auth_function: A function that takes no arguments and returns an
- (email, password) tuple when called. Will be called if authentication
- is required.
- host_override: The host header to send to the server (defaults to host).
- extra_headers: A dict of extra headers to append to every request.
- save_cookies: If True, save the authentication cookies to local disk.
- If False, use an in-memory cookiejar instead. Subclasses must
- implement this functionality. Defaults to False.
- """
- self.host = host
- self.host_override = host_override
- self.auth_function = auth_function
- self.authenticated = False
- self.extra_headers = extra_headers
- self.save_cookies = save_cookies
- self.opener = self._GetOpener()
- if self.host_override:
- logging.info("Server: %s; Host: %s", self.host, self.host_override)
- else:
- logging.info("Server: %s", self.host)
-
- def _GetOpener(self):
- """Returns an OpenerDirector for making HTTP requests.
-
- Returns:
- A urllib2.OpenerDirector object.
- """
- raise NotImplementedError()
-
- def _CreateRequest(self, url, data=None):
- """Creates a new urllib request."""
- logging.debug("Creating request for: '%s' with payload:\n%s", url, data)
- req = urllib2.Request(url, data=data)
- if self.host_override:
- req.add_header("Host", self.host_override)
- for key, value in self.extra_headers.iteritems():
- req.add_header(key, value)
- return req
-
- def _GetAuthToken(self, email, password):
- """Uses ClientLogin to authenticate the user, returning an auth token.
-
- Args:
- email: The user's email address
- password: The user's password
-
- Raises:
- ClientLoginError: If there was an error authenticating with ClientLogin.
- HTTPError: If there was some other form of HTTP error.
-
- Returns:
- The authentication token returned by ClientLogin.
- """
- account_type = "GOOGLE"
- if self.host.endswith(".google.com"):
- # Needed for use inside Google.
- account_type = "HOSTED"
- req = self._CreateRequest(
- url="https://www.google.com/accounts/ClientLogin",
- data=urllib.urlencode({
- "Email": email,
- "Passwd": password,
- "service": "ah",
- "source": "rietveld-codereview-upload",
- "accountType": account_type,
- }),
- )
- try:
- response = self.opener.open(req)
- response_body = response.read()
- response_dict = dict(x.split("=")
- for x in response_body.split("\n") if x)
- return response_dict["Auth"]
- except urllib2.HTTPError, e:
- if e.code == 403:
- body = e.read()
- response_dict = dict(x.split("=", 1) for x in body.split("\n") if x)
- raise ClientLoginError(req.get_full_url(), e.code, e.msg,
- e.headers, response_dict)
- else:
- raise
-
- def _GetAuthCookie(self, auth_token):
- """Fetches authentication cookies for an authentication token.
-
- Args:
- auth_token: The authentication token returned by ClientLogin.
-
- Raises:
- HTTPError: If there was an error fetching the authentication cookies.
- """
- # This is a dummy value to allow us to identify when we're successful.
- continue_location = "http://localhost/"
- args = {"continue": continue_location, "auth": auth_token}
- req = self._CreateRequest("http://%s/_ah/login?%s" %
- (self.host, urllib.urlencode(args)))
- try:
- response = self.opener.open(req)
- except urllib2.HTTPError, e:
- response = e
- if (response.code != 302 or
- response.info()["location"] != continue_location):
- raise urllib2.HTTPError(req.get_full_url(), response.code, response.msg,
- response.headers, response.fp)
- self.authenticated = True
-
- def _Authenticate(self):
- """Authenticates the user.
-
- The authentication process works as follows:
- 1) We get a username and password from the user
- 2) We use ClientLogin to obtain an AUTH token for the user
- (see http://code.google.com/apis/accounts/AuthForInstalledApps.html).
- 3) We pass the auth token to /_ah/login on the server to obtain an
- authentication cookie. If login was successful, it tries to redirect
- us to the URL we provided.
-
- If we attempt to access the upload API without first obtaining an
- authentication cookie, it returns a 401 response and directs us to
- authenticate ourselves with ClientLogin.
- """
- for i in range(3):
- credentials = self.auth_function()
- try:
- auth_token = self._GetAuthToken(credentials[0], credentials[1])
- except ClientLoginError, e:
- if e.reason == "BadAuthentication":
- print >>sys.stderr, "Invalid username or password."
- continue
- if e.reason == "CaptchaRequired":
- print >>sys.stderr, (
- "Please go to\n"
- "https://www.google.com/accounts/DisplayUnlockCaptcha\n"
- "and verify you are a human. Then try again.")
- break
- if e.reason == "NotVerified":
- print >>sys.stderr, "Account not verified."
- break
- if e.reason == "TermsNotAgreed":
- print >>sys.stderr, "User has not agreed to TOS."
- break
- if e.reason == "AccountDeleted":
- print >>sys.stderr, "The user account has been deleted."
- break
- if e.reason == "AccountDisabled":
- print >>sys.stderr, "The user account has been disabled."
- break
- if e.reason == "ServiceDisabled":
- print >>sys.stderr, ("The user's access to the service has been "
- "disabled.")
- break
- if e.reason == "ServiceUnavailable":
- print >>sys.stderr, "The service is not available; try again later."
- break
- raise
- self._GetAuthCookie(auth_token)
- return
-
- def Send(self, request_path, payload=None,
- content_type="application/octet-stream",
- timeout=None,
- **kwargs):
- """Sends an RPC and returns the response.
-
- Args:
- request_path: The path to send the request to, eg /api/appversion/create.
- payload: The body of the request, or None to send an empty request.
- content_type: The Content-Type header to use.
- timeout: timeout in seconds; default None i.e. no timeout.
- (Note: for large requests on OS X, the timeout doesn't work right.)
- kwargs: Any keyword arguments are converted into query string parameters.
-
- Returns:
- The response body, as a string.
- """
- # TODO: Don't require authentication. Let the server say
- # whether it is necessary.
- if not self.authenticated:
- self._Authenticate()
-
- old_timeout = socket.getdefaulttimeout()
- socket.setdefaulttimeout(timeout)
- try:
- tries = 0
- while True:
- tries += 1
- args = dict(kwargs)
- url = "http://%s%s" % (self.host, request_path)
- if args:
- url += "?" + urllib.urlencode(args)
- req = self._CreateRequest(url=url, data=payload)
- req.add_header("Content-Type", content_type)
- try:
- f = self.opener.open(req)
- response = f.read()
- f.close()
- return response
- except urllib2.HTTPError, e:
- if tries > 3:
- raise
- elif e.code == 401:
- self._Authenticate()
-## elif e.code >= 500 and e.code < 600:
-## # Server Error - try again.
-## continue
- else:
- raise
- finally:
- socket.setdefaulttimeout(old_timeout)
-
-
-class HttpRpcServer(AbstractRpcServer):
- """Provides a simplified RPC-style interface for HTTP requests."""
-
- def _Authenticate(self):
- """Save the cookie jar after authentication."""
- super(HttpRpcServer, self)._Authenticate()
- if self.save_cookies:
- StatusUpdate("Saving authentication cookies to %s" % self.cookie_file)
- self.cookie_jar.save()
-
- def _GetOpener(self):
- """Returns an OpenerDirector that supports cookies and ignores redirects.
-
- Returns:
- A urllib2.OpenerDirector object.
- """
- opener = urllib2.OpenerDirector()
- opener.add_handler(urllib2.ProxyHandler())
- opener.add_handler(urllib2.UnknownHandler())
- opener.add_handler(urllib2.HTTPHandler())
- opener.add_handler(urllib2.HTTPDefaultErrorHandler())
- opener.add_handler(urllib2.HTTPSHandler())
- opener.add_handler(urllib2.HTTPErrorProcessor())
- if self.save_cookies:
- self.cookie_file = os.path.expanduser("~/.codereview_upload_cookies")
- self.cookie_jar = cookielib.MozillaCookieJar(self.cookie_file)
- if os.path.exists(self.cookie_file):
- try:
- self.cookie_jar.load()
- self.authenticated = True
- StatusUpdate("Loaded authentication cookies from %s" %
- self.cookie_file)
- except (cookielib.LoadError, IOError):
- # Failed to load cookies - just ignore them.
- pass
- else:
- # Create an empty cookie file with mode 600
- fd = os.open(self.cookie_file, os.O_CREAT, 0600)
- os.close(fd)
- # Always chmod the cookie file
- os.chmod(self.cookie_file, 0600)
- else:
- # Don't save cookies across runs of update.py.
- self.cookie_jar = cookielib.CookieJar()
- opener.add_handler(urllib2.HTTPCookieProcessor(self.cookie_jar))
- return opener
-
-
-parser = optparse.OptionParser(usage="%prog [options] [-- diff_options]")
-parser.add_option("-y", "--assume_yes", action="store_true",
- dest="assume_yes", default=False,
- help="Assume that the answer to yes/no questions is 'yes'.")
-# Logging
-group = parser.add_option_group("Logging options")
-group.add_option("-q", "--quiet", action="store_const", const=0,
- dest="verbose", help="Print errors only.")
-group.add_option("-v", "--verbose", action="store_const", const=2,
- dest="verbose", default=1,
- help="Print info level logs (default).")
-group.add_option("--noisy", action="store_const", const=3,
- dest="verbose", help="Print all logs.")
-# Review server
-group = parser.add_option_group("Review server options")
-group.add_option("-s", "--server", action="store", dest="server",
- default="codereview.appspot.com",
- metavar="SERVER",
- help=("The server to upload to. The format is host[:port]. "
- "Defaults to 'codereview.appspot.com'."))
-group.add_option("-e", "--email", action="store", dest="email",
- metavar="EMAIL", default=None,
- help="The username to use. Will prompt if omitted.")
-group.add_option("-H", "--host", action="store", dest="host",
- metavar="HOST", default=None,
- help="Overrides the Host header sent with all RPCs.")
-group.add_option("--no_cookies", action="store_false",
- dest="save_cookies", default=True,
- help="Do not save authentication cookies to local disk.")
-# Issue
-group = parser.add_option_group("Issue options")
-group.add_option("-d", "--description", action="store", dest="description",
- metavar="DESCRIPTION", default=None,
- help="Optional description when creating an issue.")
-group.add_option("-f", "--description_file", action="store",
- dest="description_file", metavar="DESCRIPTION_FILE",
- default=None,
- help="Optional path of a file that contains "
- "the description when creating an issue.")
-group.add_option("-r", "--reviewers", action="store", dest="reviewers",
- metavar="REVIEWERS", default=None,
- help="Add reviewers (comma separated email addresses).")
-group.add_option("--cc", action="store", dest="cc",
- metavar="CC", default=None,
- help="Add CC (comma separated email addresses).")
-# Upload options
-group = parser.add_option_group("Patch options")
-group.add_option("-m", "--message", action="store", dest="message",
- metavar="MESSAGE", default=None,
- help="A message to identify the patch. "
- "Will prompt if omitted.")
-group.add_option("-i", "--issue", type="int", action="store",
- metavar="ISSUE", default=None,
- help="Issue number to which to add. Defaults to new issue.")
-group.add_option("--download_base", action="store_true",
- dest="download_base", default=False,
- help="Base files will be downloaded by the server "
- "(side-by-side diffs may not work on files with CRs).")
-group.add_option("--rev", action="store", dest="revision",
- metavar="REV", default=None,
- help="Branch/tree/revision to diff against (used by DVCS).")
-group.add_option("--send_mail", action="store_true",
- dest="send_mail", default=False,
- help="Send notification email to reviewers.")
-
-
-def GetRpcServer(options):
- """Returns an instance of an AbstractRpcServer.
-
- Returns:
- A new AbstractRpcServer, on which RPC calls can be made.
- """
-
- rpc_server_class = HttpRpcServer
-
- def GetUserCredentials():
- """Prompts the user for a username and password."""
- email = options.email
- if email is None:
- email = GetEmail("Email (login for uploading to %s)" % options.server)
- password = getpass.getpass("Password for %s: " % email)
- return (email, password)
-
- # If this is the dev_appserver, use fake authentication.
- host = (options.host or options.server).lower()
- if host == "localhost" or host.startswith("localhost:"):
- email = options.email
- if email is None:
- email = "test@example.com"
- logging.info("Using debug user %s. Override with --email" % email)
- server = rpc_server_class(
- options.server,
- lambda: (email, "password"),
- host_override=options.host,
- extra_headers={"Cookie":
- 'dev_appserver_login="%s:False"' % email},
- save_cookies=options.save_cookies)
- # Don't try to talk to ClientLogin.
- server.authenticated = True
- return server
-
- return rpc_server_class(options.server, GetUserCredentials,
- host_override=options.host,
- save_cookies=options.save_cookies)
-
-
-def EncodeMultipartFormData(fields, files):
- """Encode form fields for multipart/form-data.
-
- Args:
- fields: A sequence of (name, value) elements for regular form fields.
- files: A sequence of (name, filename, value) elements for data to be
- uploaded as files.
- Returns:
- (content_type, body) ready for httplib.HTTP instance.
-
- Source:
- http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/146306
- """
- BOUNDARY = '-M-A-G-I-C---B-O-U-N-D-A-R-Y-'
- CRLF = '\r\n'
- lines = []
- for (key, value) in fields:
- lines.append('--' + BOUNDARY)
- lines.append('Content-Disposition: form-data; name="%s"' % key)
- lines.append('')
- lines.append(value)
- for (key, filename, value) in files:
- lines.append('--' + BOUNDARY)
- lines.append('Content-Disposition: form-data; name="%s"; filename="%s"' %
- (key, filename))
- lines.append('Content-Type: %s' % GetContentType(filename))
- lines.append('')
- lines.append(value)
- lines.append('--' + BOUNDARY + '--')
- lines.append('')
- body = CRLF.join(lines)
- content_type = 'multipart/form-data; boundary=%s' % BOUNDARY
- return content_type, body
-
-
-def GetContentType(filename):
- """Helper to guess the content-type from the filename."""
- return mimetypes.guess_type(filename)[0] or 'application/octet-stream'
-
-
-# Use a shell for subcommands on Windows to get a PATH search.
-use_shell = sys.platform.startswith("win")
-
-def RunShellWithReturnCode(command, print_output=False,
- universal_newlines=True):
- """Executes a command and returns the output from stdout and the return code.
-
- Args:
- command: Command to execute.
- print_output: If True, the output is printed to stdout.
- If False, both stdout and stderr are ignored.
- universal_newlines: Use universal_newlines flag (default: True).
-
- Returns:
- Tuple (output, return code)
- """
- logging.info("Running %s", command)
- p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
- shell=use_shell, universal_newlines=universal_newlines)
- if print_output:
- output_array = []
- while True:
- line = p.stdout.readline()
- if not line:
- break
- print line.strip("\n")
- output_array.append(line)
- output = "".join(output_array)
- else:
- output = p.stdout.read()
- p.wait()
- errout = p.stderr.read()
- if print_output and errout:
- print >>sys.stderr, errout
- p.stdout.close()
- p.stderr.close()
- return output, p.returncode
-
-
-def RunShell(command, silent_ok=False, universal_newlines=True,
- print_output=False):
- data, retcode = RunShellWithReturnCode(command, print_output,
- universal_newlines)
- if retcode:
- ErrorExit("Got error status from %s:\n%s" % (command, data))
- if not silent_ok and not data:
- ErrorExit("No output from %s" % command)
- return data
-
-
-class VersionControlSystem(object):
- """Abstract base class providing an interface to the VCS."""
-
- def __init__(self, options):
- """Constructor.
-
- Args:
- options: Command line options.
- """
- self.options = options
-
- def GenerateDiff(self, args):
- """Return the current diff as a string.
-
- Args:
- args: Extra arguments to pass to the diff command.
- """
- raise NotImplementedError(
- "abstract method -- subclass %s must override" % self.__class__)
-
- def GetUnknownFiles(self):
- """Return a list of files unknown to the VCS."""
- raise NotImplementedError(
- "abstract method -- subclass %s must override" % self.__class__)
-
- def CheckForUnknownFiles(self):
- """Show an "are you sure?" prompt if there are unknown files."""
- unknown_files = self.GetUnknownFiles()
- if unknown_files:
- print "The following files are not added to version control:"
- for line in unknown_files:
- print line
- prompt = "Are you sure to continue?(y/N) "
- answer = raw_input(prompt).strip()
- if answer != "y":
- ErrorExit("User aborted")
-
- def GetBaseFile(self, filename):
- """Get the content of the upstream version of a file.
-
- Returns:
- A tuple (base_content, new_content, is_binary, status)
- base_content: The contents of the base file.
- new_content: For text files, this is empty. For binary files, this is
- the contents of the new file, since the diff output won't contain
- information to reconstruct the current file.
- is_binary: True iff the file is binary.
- status: The status of the file.
- """
-
- raise NotImplementedError(
- "abstract method -- subclass %s must override" % self.__class__)
-
-
- def GetBaseFiles(self, diff):
- """Helper that calls GetBase file for each file in the patch.
-
- Returns:
- A dictionary that maps from filename to GetBaseFile's tuple. Filenames
- are retrieved based on lines that start with "Index:" or
- "Property changes on:".
- """
- files = {}
- for line in diff.splitlines(True):
- if line.startswith('Index:') or line.startswith('Property changes on:'):
- unused, filename = line.split(':', 1)
- # On Windows if a file has property changes its filename uses '\'
- # instead of '/'.
- filename = filename.strip().replace('\\', '/')
- files[filename] = self.GetBaseFile(filename)
- return files
-
-
- def UploadBaseFiles(self, issue, rpc_server, patch_list, patchset, options,
- files):
- """Uploads the base files (and if necessary, the current ones as well)."""
-
- def UploadFile(filename, file_id, content, is_binary, status, is_base):
- """Uploads a file to the server."""
- file_too_large = False
- if is_base:
- type = "base"
- else:
- type = "current"
- if len(content) > MAX_UPLOAD_SIZE:
- print ("Not uploading the %s file for %s because it's too large." %
- (type, filename))
- file_too_large = True
- content = ""
- checksum = md5.new(content).hexdigest()
- if options.verbose > 0 and not file_too_large:
- print "Uploading %s file for %s" % (type, filename)
- url = "/%d/upload_content/%d/%d" % (int(issue), int(patchset), file_id)
- form_fields = [("filename", filename),
- ("status", status),
- ("checksum", checksum),
- ("is_binary", str(is_binary)),
- ("is_current", str(not is_base)),
- ]
- if file_too_large:
- form_fields.append(("file_too_large", "1"))
- if options.email:
- form_fields.append(("user", options.email))
- ctype, body = EncodeMultipartFormData(form_fields,
- [("data", filename, content)])
- response_body = rpc_server.Send(url, body,
- content_type=ctype)
- if not response_body.startswith("OK"):
- StatusUpdate(" --> %s" % response_body)
- sys.exit(1)
-
- patches = dict()
- [patches.setdefault(v, k) for k, v in patch_list]
- for filename in patches.keys():
- base_content, new_content, is_binary, status = files[filename]
- file_id_str = patches.get(filename)
- if file_id_str.find("nobase") != -1:
- base_content = None
- file_id_str = file_id_str[file_id_str.rfind("_") + 1:]
- file_id = int(file_id_str)
- if base_content != None:
- UploadFile(filename, file_id, base_content, is_binary, status, True)
- if new_content != None:
- UploadFile(filename, file_id, new_content, is_binary, status, False)
-
- def IsImage(self, filename):
- """Returns true if the filename has an image extension."""
- mimetype = mimetypes.guess_type(filename)[0]
- if not mimetype:
- return False
- return mimetype.startswith("image/")
-
-
-class SubversionVCS(VersionControlSystem):
- """Implementation of the VersionControlSystem interface for Subversion."""
-
- def __init__(self, options):
- super(SubversionVCS, self).__init__(options)
- if self.options.revision:
- match = re.match(r"(\d+)(:(\d+))?", self.options.revision)
- if not match:
- ErrorExit("Invalid Subversion revision %s." % self.options.revision)
- self.rev_start = match.group(1)
- self.rev_end = match.group(3)
- else:
- self.rev_start = self.rev_end = None
- # Cache output from "svn list -r REVNO dirname".
- # Keys: dirname, Values: 2-tuple (ouput for start rev and end rev).
- self.svnls_cache = {}
- # SVN base URL is required to fetch files deleted in an older revision.
- # Result is cached to not guess it over and over again in GetBaseFile().
- required = self.options.download_base or self.options.revision is not None
- self.svn_base = self._GuessBase(required)
-
- def GuessBase(self, required):
- """Wrapper for _GuessBase."""
- return self.svn_base
-
- def _GuessBase(self, required):
- """Returns the SVN base URL.
-
- Args:
- required: If true, exits if the url can't be guessed, otherwise None is
- returned.
- """
- info = RunShell(["svn", "info"])
- for line in info.splitlines():
- words = line.split()
- if len(words) == 2 and words[0] == "URL:":
- url = words[1]
- scheme, netloc, path, params, query, fragment = urlparse.urlparse(url)
- username, netloc = urllib.splituser(netloc)
- if username:
- logging.info("Removed username from base URL")
- if netloc.endswith("svn.python.org"):
- if netloc == "svn.python.org":
- if path.startswith("/projects/"):
- path = path[9:]
- elif netloc != "pythondev@svn.python.org":
- ErrorExit("Unrecognized Python URL: %s" % url)
- base = "http://svn.python.org/view/*checkout*%s/" % path
- logging.info("Guessed Python base = %s", base)
- elif netloc.endswith("svn.collab.net"):
- if path.startswith("/repos/"):
- path = path[6:]
- base = "http://svn.collab.net/viewvc/*checkout*%s/" % path
- logging.info("Guessed CollabNet base = %s", base)
- elif netloc.endswith(".googlecode.com"):
- path = path + "/"
- base = urlparse.urlunparse(("http", netloc, path, params,
- query, fragment))
- logging.info("Guessed Google Code base = %s", base)
- else:
- path = path + "/"
- base = urlparse.urlunparse((scheme, netloc, path, params,
- query, fragment))
- logging.info("Guessed base = %s", base)
- return base
- if required:
- ErrorExit("Can't find URL in output from svn info")
- return None
-
- def GenerateDiff(self, args):
- cmd = ["svn", "diff"]
- if self.options.revision:
- cmd += ["-r", self.options.revision]
- cmd.extend(args)
- data = RunShell(cmd)
- count = 0
- for line in data.splitlines():
- if line.startswith("Index:") or line.startswith("Property changes on:"):
- count += 1
- logging.info(line)
- if not count:
- ErrorExit("No valid patches found in output from svn diff")
- return data
-
- def _CollapseKeywords(self, content, keyword_str):
- """Collapses SVN keywords."""
- # svn cat translates keywords but svn diff doesn't. As a result of this
- # behavior patching.PatchChunks() fails with a chunk mismatch error.
- # This part was originally written by the Review Board development team
- # who had the same problem (http://reviews.review-board.org/r/276/).
- # Mapping of keywords to known aliases
- svn_keywords = {
- # Standard keywords
- 'Date': ['Date', 'LastChangedDate'],
- 'Revision': ['Revision', 'LastChangedRevision', 'Rev'],
- 'Author': ['Author', 'LastChangedBy'],
- 'HeadURL': ['HeadURL', 'URL'],
- 'Id': ['Id'],
-
- # Aliases
- 'LastChangedDate': ['LastChangedDate', 'Date'],
- 'LastChangedRevision': ['LastChangedRevision', 'Rev', 'Revision'],
- 'LastChangedBy': ['LastChangedBy', 'Author'],
- 'URL': ['URL', 'HeadURL'],
- }
-
- def repl(m):
- if m.group(2):
- return "$%s::%s$" % (m.group(1), " " * len(m.group(3)))
- return "$%s$" % m.group(1)
- keywords = [keyword
- for name in keyword_str.split(" ")
- for keyword in svn_keywords.get(name, [])]
- return re.sub(r"\$(%s):(:?)([^\$]+)\$" % '|'.join(keywords), repl, content)
-
- def GetUnknownFiles(self):
- status = RunShell(["svn", "status", "--ignore-externals"], silent_ok=True)
- unknown_files = []
- for line in status.split("\n"):
- if line and line[0] == "?":
- unknown_files.append(line)
- return unknown_files
-
- def ReadFile(self, filename):
- """Returns the contents of a file."""
- file = open(filename, 'rb')
- result = ""
- try:
- result = file.read()
- finally:
- file.close()
- return result
-
- def GetStatus(self, filename):
- """Returns the status of a file."""
- if not self.options.revision:
- status = RunShell(["svn", "status", "--ignore-externals", filename])
- if not status:
- ErrorExit("svn status returned no output for %s" % filename)
- status_lines = status.splitlines()
- # If file is in a cl, the output will begin with
- # "\n--- Changelist 'cl_name':\n". See
- # http://svn.collab.net/repos/svn/trunk/notes/changelist-design.txt
- if (len(status_lines) == 3 and
- not status_lines[0] and
- status_lines[1].startswith("--- Changelist")):
- status = status_lines[2]
- else:
- status = status_lines[0]
- # If we have a revision to diff against we need to run "svn list"
- # for the old and the new revision and compare the results to get
- # the correct status for a file.
- else:
- dirname, relfilename = os.path.split(filename)
- if dirname not in self.svnls_cache:
- cmd = ["svn", "list", "-r", self.rev_start, dirname or "."]
- out, returncode = RunShellWithReturnCode(cmd)
- if returncode:
- ErrorExit("Failed to get status for %s." % filename)
- old_files = out.splitlines()
- args = ["svn", "list"]
- if self.rev_end:
- args += ["-r", self.rev_end]
- cmd = args + [dirname or "."]
- out, returncode = RunShellWithReturnCode(cmd)
- if returncode:
- ErrorExit("Failed to run command %s" % cmd)
- self.svnls_cache[dirname] = (old_files, out.splitlines())
- old_files, new_files = self.svnls_cache[dirname]
- if relfilename in old_files and relfilename not in new_files:
- status = "D "
- elif relfilename in old_files and relfilename in new_files:
- status = "M "
- else:
- status = "A "
- return status
-
- def GetBaseFile(self, filename):
- status = self.GetStatus(filename)
- base_content = None
- new_content = None
-
- # If a file is copied its status will be "A +", which signifies
- # "addition-with-history". See "svn st" for more information. We need to
- # upload the original file or else diff parsing will fail if the file was
- # edited.
- if status[0] == "A" and status[3] != "+":
- # We'll need to upload the new content if we're adding a binary file
- # since diff's output won't contain it.
- mimetype = RunShell(["svn", "propget", "svn:mime-type", filename],
- silent_ok=True)
- base_content = ""
- is_binary = mimetype and not mimetype.startswith("text/")
- if is_binary and self.IsImage(filename):
- new_content = self.ReadFile(filename)
- elif (status[0] in ("M", "D", "R") or
- (status[0] == "A" and status[3] == "+") or # Copied file.
- (status[0] == " " and status[1] == "M")): # Property change.
- args = []
- if self.options.revision:
- url = "%s/%s@%s" % (self.svn_base, filename, self.rev_start)
- else:
- # Don't change filename, it's needed later.
- url = filename
- args += ["-r", "BASE"]
- cmd = ["svn"] + args + ["propget", "svn:mime-type", url]
- mimetype, returncode = RunShellWithReturnCode(cmd)
- if returncode:
- # File does not exist in the requested revision.
- # Reset mimetype, it contains an error message.
- mimetype = ""
- get_base = False
- is_binary = mimetype and not mimetype.startswith("text/")
- if status[0] == " ":
- # Empty base content just to force an upload.
- base_content = ""
- elif is_binary:
- if self.IsImage(filename):
- get_base = True
- if status[0] == "M":
- if not self.rev_end:
- new_content = self.ReadFile(filename)
- else:
- url = "%s/%s@%s" % (self.svn_base, filename, self.rev_end)
- new_content = RunShell(["svn", "cat", url],
- universal_newlines=True, silent_ok=True)
- else:
- base_content = ""
- else:
- get_base = True
-
- if get_base:
- if is_binary:
- universal_newlines = False
- else:
- universal_newlines = True
- if self.rev_start:
- # "svn cat -r REV delete_file.txt" doesn't work. cat requires
- # the full URL with "@REV" appended instead of using "-r" option.
- url = "%s/%s@%s" % (self.svn_base, filename, self.rev_start)
- base_content = RunShell(["svn", "cat", url],
- universal_newlines=universal_newlines,
- silent_ok=True)
- else:
- base_content = RunShell(["svn", "cat", filename],
- universal_newlines=universal_newlines,
- silent_ok=True)
- if not is_binary:
- args = []
- if self.rev_start:
- url = "%s/%s@%s" % (self.svn_base, filename, self.rev_start)
- else:
- url = filename
- args += ["-r", "BASE"]
- cmd = ["svn"] + args + ["propget", "svn:keywords", url]
- keywords, returncode = RunShellWithReturnCode(cmd)
- if keywords and not returncode:
- base_content = self._CollapseKeywords(base_content, keywords)
- else:
- StatusUpdate("svn status returned unexpected output: %s" % status)
- sys.exit(1)
- return base_content, new_content, is_binary, status[0:5]
-
-
-class GitVCS(VersionControlSystem):
- """Implementation of the VersionControlSystem interface for Git."""
-
- def __init__(self, options):
- super(GitVCS, self).__init__(options)
- # Map of filename -> hash of base file.
- self.base_hashes = {}
-
- def GenerateDiff(self, extra_args):
- # This is more complicated than svn's GenerateDiff because we must convert
- # the diff output to include an svn-style "Index:" line as well as record
- # the hashes of the base files, so we can upload them along with our diff.
- if self.options.revision:
- extra_args = [self.options.revision] + extra_args
- gitdiff = RunShell(["git", "diff", "--full-index"] + extra_args)
- svndiff = []
- filecount = 0
- filename = None
- for line in gitdiff.splitlines():
- match = re.match(r"diff --git a/(.*) b/.*$", line)
- if match:
- filecount += 1
- filename = match.group(1)
- svndiff.append("Index: %s\n" % filename)
- else:
- # The "index" line in a git diff looks like this (long hashes elided):
- # index 82c0d44..b2cee3f 100755
- # We want to save the left hash, as that identifies the base file.
- match = re.match(r"index (\w+)\.\.", line)
- if match:
- self.base_hashes[filename] = match.group(1)
- svndiff.append(line + "\n")
- if not filecount:
- ErrorExit("No valid patches found in output from git diff")
- return "".join(svndiff)
-
- def GetUnknownFiles(self):
- status = RunShell(["git", "ls-files", "--exclude-standard", "--others"],
- silent_ok=True)
- return status.splitlines()
-
- def GetBaseFile(self, filename):
- hash = self.base_hashes[filename]
- base_content = None
- new_content = None
- is_binary = False
- if hash == "0" * 40: # All-zero hash indicates no base file.
- status = "A"
- base_content = ""
- else:
- status = "M"
- base_content, returncode = RunShellWithReturnCode(["git", "show", hash])
- if returncode:
- ErrorExit("Got error status from 'git show %s'" % hash)
- return (base_content, new_content, is_binary, status)
-
-
-class MercurialVCS(VersionControlSystem):
- """Implementation of the VersionControlSystem interface for Mercurial."""
-
- def __init__(self, options, repo_dir):
- super(MercurialVCS, self).__init__(options)
- # Absolute path to repository (we can be in a subdir)
- self.repo_dir = os.path.normpath(repo_dir)
- # Compute the subdir
- cwd = os.path.normpath(os.getcwd())
- assert cwd.startswith(self.repo_dir)
- self.subdir = cwd[len(self.repo_dir):].lstrip(r"\/")
- if self.options.revision:
- self.base_rev = self.options.revision
- else:
- self.base_rev = RunShell(["hg", "parent", "-q"]).split(':')[1].strip()
-
- def _GetRelPath(self, filename):
- """Get relative path of a file according to the current directory,
- given its logical path in the repo."""
- assert filename.startswith(self.subdir), filename
- return filename[len(self.subdir):].lstrip(r"\/")
-
- def GenerateDiff(self, extra_args):
- # If no file specified, restrict to the current subdir
- extra_args = extra_args or ["."]
- cmd = ["hg", "diff", "--git", "-r", self.base_rev] + extra_args
- data = RunShell(cmd, silent_ok=True)
- svndiff = []
- filecount = 0
- for line in data.splitlines():
- m = re.match("diff --git a/(\S+) b/(\S+)", line)
- if m:
- # Modify line to make it look like as it comes from svn diff.
- # With this modification no changes on the server side are required
- # to make upload.py work with Mercurial repos.
- # NOTE: for proper handling of moved/copied files, we have to use
- # the second filename.
- filename = m.group(2)
- svndiff.append("Index: %s" % filename)
- svndiff.append("=" * 67)
- filecount += 1
- logging.info(line)
- else:
- svndiff.append(line)
- if not filecount:
- ErrorExit("No valid patches found in output from hg diff")
- return "\n".join(svndiff) + "\n"
-
- def GetUnknownFiles(self):
- """Return a list of files unknown to the VCS."""
- args = []
- status = RunShell(["hg", "status", "--rev", self.base_rev, "-u", "."],
- silent_ok=True)
- unknown_files = []
- for line in status.splitlines():
- st, fn = line.split(" ", 1)
- if st == "?":
- unknown_files.append(fn)
- return unknown_files
-
- def GetBaseFile(self, filename):
- # "hg status" and "hg cat" both take a path relative to the current subdir
- # rather than to the repo root, but "hg diff" has given us the full path
- # to the repo root.
- base_content = ""
- new_content = None
- is_binary = False
- oldrelpath = relpath = self._GetRelPath(filename)
- # "hg status -C" returns two lines for moved/copied files, one otherwise
- out = RunShell(["hg", "status", "-C", "--rev", self.base_rev, relpath])
- out = out.splitlines()
- # HACK: strip error message about missing file/directory if it isn't in
- # the working copy
- if out[0].startswith('%s: ' % relpath):
- out = out[1:]
- if len(out) > 1:
- # Moved/copied => considered as modified, use old filename to
- # retrieve base contents
- oldrelpath = out[1].strip()
- status = "M"
- else:
- status, _ = out[0].split(' ', 1)
- if status != "A":
- base_content = RunShell(["hg", "cat", "-r", self.base_rev, oldrelpath],
- silent_ok=True)
- is_binary = "\0" in base_content # Mercurial's heuristic
- if status != "R":
- new_content = open(relpath, "rb").read()
- is_binary = is_binary or "\0" in new_content
- if is_binary and base_content:
- # Fetch again without converting newlines
- base_content = RunShell(["hg", "cat", "-r", self.base_rev, oldrelpath],
- silent_ok=True, universal_newlines=False)
- if not is_binary or not self.IsImage(relpath):
- new_content = None
- return base_content, new_content, is_binary, status
-
-
-# NOTE: The SplitPatch function is duplicated in engine.py, keep them in sync.
-def SplitPatch(data):
- """Splits a patch into separate pieces for each file.
-
- Args:
- data: A string containing the output of svn diff.
-
- Returns:
- A list of 2-tuple (filename, text) where text is the svn diff output
- pertaining to filename.
- """
- patches = []
- filename = None
- diff = []
- for line in data.splitlines(True):
- new_filename = None
- if line.startswith('Index:'):
- unused, new_filename = line.split(':', 1)
- new_filename = new_filename.strip()
- elif line.startswith('Property changes on:'):
- unused, temp_filename = line.split(':', 1)
- # When a file is modified, paths use '/' between directories, however
- # when a property is modified '\' is used on Windows. Make them the same
- # otherwise the file shows up twice.
- temp_filename = temp_filename.strip().replace('\\', '/')
- if temp_filename != filename:
- # File has property changes but no modifications, create a new diff.
- new_filename = temp_filename
- if new_filename:
- if filename and diff:
- patches.append((filename, ''.join(diff)))
- filename = new_filename
- diff = [line]
- continue
- if diff is not None:
- diff.append(line)
- if filename and diff:
- patches.append((filename, ''.join(diff)))
- return patches
-
-
-def UploadSeparatePatches(issue, rpc_server, patchset, data, options):
- """Uploads a separate patch for each file in the diff output.
-
- Returns a list of [patch_key, filename] for each file.
- """
- patches = SplitPatch(data)
- rv = []
- for patch in patches:
- if len(patch[1]) > MAX_UPLOAD_SIZE:
- print ("Not uploading the patch for " + patch[0] +
- " because the file is too large.")
- continue
- form_fields = [("filename", patch[0])]
- if not options.download_base:
- form_fields.append(("content_upload", "1"))
- files = [("data", "data.diff", patch[1])]
- ctype, body = EncodeMultipartFormData(form_fields, files)
- url = "/%d/upload_patch/%d" % (int(issue), int(patchset))
- print "Uploading patch for " + patch[0]
- response_body = rpc_server.Send(url, body, content_type=ctype)
- lines = response_body.splitlines()
- if not lines or lines[0] != "OK":
- StatusUpdate(" --> %s" % response_body)
- sys.exit(1)
- rv.append([lines[1], patch[0]])
- return rv
-
-
-def GuessVCS(options):
- """Helper to guess the version control system.
-
- This examines the current directory, guesses which VersionControlSystem
- we're using, and returns an instance of the appropriate class. Exit with an
- error if we can't figure it out.
-
- Returns:
- A VersionControlSystem instance. Exits if the VCS can't be guessed.
- """
- # Mercurial has a command to get the base directory of a repository
- # Try running it, but don't die if we don't have hg installed.
- # NOTE: we try Mercurial first as it can sit on top of an SVN working copy.
- try:
- out, returncode = RunShellWithReturnCode(["hg", "root"])
- if returncode == 0:
- return MercurialVCS(options, out.strip())
- except OSError, (errno, message):
- if errno != 2: # ENOENT -- they don't have hg installed.
- raise
-
- # Subversion has a .svn in all working directories.
- if os.path.isdir('.svn'):
- logging.info("Guessed VCS = Subversion")
- return SubversionVCS(options)
-
- # Git has a command to test if you're in a git tree.
- # Try running it, but don't die if we don't have git installed.
- try:
- out, returncode = RunShellWithReturnCode(["git", "rev-parse",
- "--is-inside-work-tree"])
- if returncode == 0:
- return GitVCS(options)
- except OSError, (errno, message):
- if errno != 2: # ENOENT -- they don't have git installed.
- raise
-
- ErrorExit(("Could not guess version control system. "
- "Are you in a working copy directory?"))
-
-
-def RealMain(argv, data=None):
- """The real main function.
-
- Args:
- argv: Command line arguments.
- data: Diff contents. If None (default) the diff is generated by
- the VersionControlSystem implementation returned by GuessVCS().
-
- Returns:
- A 2-tuple (issue id, patchset id).
- The patchset id is None if the base files are not uploaded by this
- script (applies only to SVN checkouts).
- """
- logging.basicConfig(format=("%(asctime).19s %(levelname)s %(filename)s:"
- "%(lineno)s %(message)s "))
- os.environ['LC_ALL'] = 'C'
- options, args = parser.parse_args(argv[1:])
- global verbosity
- verbosity = options.verbose
- if verbosity >= 3:
- logging.getLogger().setLevel(logging.DEBUG)
- elif verbosity >= 2:
- logging.getLogger().setLevel(logging.INFO)
- vcs = GuessVCS(options)
- if isinstance(vcs, SubversionVCS):
- # base field is only allowed for Subversion.
- # Note: Fetching base files may become deprecated in future releases.
- base = vcs.GuessBase(options.download_base)
- else:
- base = None
- if not base and options.download_base:
- options.download_base = True
- logging.info("Enabled upload of base file")
- if not options.assume_yes:
- vcs.CheckForUnknownFiles()
- if data is None:
- data = vcs.GenerateDiff(args)
- files = vcs.GetBaseFiles(data)
- if verbosity >= 1:
- print "Upload server:", options.server, "(change with -s/--server)"
- if options.issue:
- prompt = "Message describing this patch set: "
- else:
- prompt = "New issue subject: "
- message = options.message or raw_input(prompt).strip()
- if not message:
- ErrorExit("A non-empty message is required")
- rpc_server = GetRpcServer(options)
- form_fields = [("subject", message)]
- if base:
- form_fields.append(("base", base))
- if options.issue:
- form_fields.append(("issue", str(options.issue)))
- if options.email:
- form_fields.append(("user", options.email))
- if options.reviewers:
- for reviewer in options.reviewers.split(','):
- if "@" in reviewer and not reviewer.split("@")[1].count(".") == 1:
- ErrorExit("Invalid email address: %s" % reviewer)
- form_fields.append(("reviewers", options.reviewers))
- if options.cc:
- for cc in options.cc.split(','):
- if "@" in cc and not cc.split("@")[1].count(".") == 1:
- ErrorExit("Invalid email address: %s" % cc)
- form_fields.append(("cc", options.cc))
- description = options.description
- if options.description_file:
- if options.description:
- ErrorExit("Can't specify description and description_file")
- file = open(options.description_file, 'r')
- description = file.read()
- file.close()
- if description:
- form_fields.append(("description", description))
- # Send a hash of all the base file so the server can determine if a copy
- # already exists in an earlier patchset.
- base_hashes = ""
- for file, info in files.iteritems():
- if not info[0] is None:
- checksum = md5.new(info[0]).hexdigest()
- if base_hashes:
- base_hashes += "|"
- base_hashes += checksum + ":" + file
- form_fields.append(("base_hashes", base_hashes))
- # If we're uploading base files, don't send the email before the uploads, so
- # that it contains the file status.
- if options.send_mail and options.download_base:
- form_fields.append(("send_mail", "1"))
- if not options.download_base:
- form_fields.append(("content_upload", "1"))
- if len(data) > MAX_UPLOAD_SIZE:
- print "Patch is large, so uploading file patches separately."
- uploaded_diff_file = []
- form_fields.append(("separate_patches", "1"))
- else:
- uploaded_diff_file = [("data", "data.diff", data)]
- ctype, body = EncodeMultipartFormData(form_fields, uploaded_diff_file)
- response_body = rpc_server.Send("/upload", body, content_type=ctype)
- patchset = None
- if not options.download_base or not uploaded_diff_file:
- lines = response_body.splitlines()
- if len(lines) >= 2:
- msg = lines[0]
- patchset = lines[1].strip()
- patches = [x.split(" ", 1) for x in lines[2:]]
- else:
- msg = response_body
- else:
- msg = response_body
- StatusUpdate(msg)
- if not response_body.startswith("Issue created.") and \
- not response_body.startswith("Issue updated."):
- sys.exit(0)
- issue = msg[msg.rfind("/")+1:]
-
- if not uploaded_diff_file:
- result = UploadSeparatePatches(issue, rpc_server, patchset, data, options)
- if not options.download_base:
- patches = result
-
- if not options.download_base:
- vcs.UploadBaseFiles(issue, rpc_server, patches, patchset, options, files)
- if options.send_mail:
- rpc_server.Send("/" + issue + "/mail", payload="")
- return issue, patchset
-
-
-def main():
- try:
- RealMain(sys.argv)
- except KeyboardInterrupt:
- print
- StatusUpdate("Interrupted.")
- sys.exit(1)
-
-
-if __name__ == "__main__":
- main()
diff --git a/src/testing/gtest/scripts/upload_gtest.py b/src/testing/gtest/scripts/upload_gtest.py
deleted file mode 100755
index be19ae80..00000000
--- a/src/testing/gtest/scripts/upload_gtest.py
+++ /dev/null
@@ -1,78 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2009, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-"""upload_gtest.py v0.1.0 -- uploads a Google Test patch for review.
-
-This simple wrapper passes all command line flags and
---cc=googletestframework@googlegroups.com to upload.py.
-
-USAGE: upload_gtest.py [options for upload.py]
-"""
-
-__author__ = 'wan@google.com (Zhanyong Wan)'
-
-import os
-import sys
-
-CC_FLAG = '--cc='
-GTEST_GROUP = 'googletestframework@googlegroups.com'
-
-
-def main():
- # Finds the path to upload.py, assuming it is in the same directory
- # as this file.
- my_dir = os.path.dirname(os.path.abspath(__file__))
- upload_py_path = os.path.join(my_dir, 'upload.py')
-
- # Adds Google Test discussion group to the cc line if it's not there
- # already.
- upload_py_argv = [upload_py_path]
- found_cc_flag = False
- for arg in sys.argv[1:]:
- if arg.startswith(CC_FLAG):
- found_cc_flag = True
- cc_line = arg[len(CC_FLAG):]
- cc_list = [addr for addr in cc_line.split(',') if addr]
- if GTEST_GROUP not in cc_list:
- cc_list.append(GTEST_GROUP)
- upload_py_argv.append(CC_FLAG + ','.join(cc_list))
- else:
- upload_py_argv.append(arg)
-
- if not found_cc_flag:
- upload_py_argv.append(CC_FLAG + GTEST_GROUP)
-
- # Invokes upload.py with the modified command line flags.
- os.execv(upload_py_path, upload_py_argv)
-
-
-if __name__ == '__main__':
- main()
diff --git a/src/testing/gtest/src/gtest-all.cc b/src/testing/gtest/src/gtest-all.cc
deleted file mode 100644
index 0a9cee52..00000000
--- a/src/testing/gtest/src/gtest-all.cc
+++ /dev/null
@@ -1,48 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: mheule@google.com (Markus Heule)
-//
-// Google C++ Testing Framework (Google Test)
-//
-// Sometimes it's desirable to build Google Test by compiling a single file.
-// This file serves this purpose.
-
-// This line ensures that gtest.h can be compiled on its own, even
-// when it's fused.
-#include "gtest/gtest.h"
-
-// The following lines pull in the real gtest *.cc files.
-#include "src/gtest.cc"
-#include "src/gtest-death-test.cc"
-#include "src/gtest-filepath.cc"
-#include "src/gtest-port.cc"
-#include "src/gtest-printers.cc"
-#include "src/gtest-test-part.cc"
-#include "src/gtest-typed-test.cc"
diff --git a/src/testing/gtest/src/gtest-death-test.cc b/src/testing/gtest/src/gtest-death-test.cc
deleted file mode 100644
index 36a2e3a7..00000000
--- a/src/testing/gtest/src/gtest-death-test.cc
+++ /dev/null
@@ -1,1337 +0,0 @@
-// Copyright 2005, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan), vladl@google.com (Vlad Losev)
-//
-// This file implements death tests.
-
-#include "gtest/gtest-death-test.h"
-#include "gtest/internal/gtest-port.h"
-
-#if GTEST_HAS_DEATH_TEST
-
-# if GTEST_OS_MAC
-# include <crt_externs.h>
-# endif // GTEST_OS_MAC
-
-# include <errno.h>
-# include <fcntl.h>
-# include <limits.h>
-
-# if GTEST_OS_LINUX
-# include <signal.h>
-# endif // GTEST_OS_LINUX
-
-# include <stdarg.h>
-
-# if GTEST_OS_WINDOWS
-# include <windows.h>
-# else
-# include <sys/mman.h>
-# include <sys/wait.h>
-# endif // GTEST_OS_WINDOWS
-
-# if GTEST_OS_QNX
-# include <spawn.h>
-# endif // GTEST_OS_QNX
-
-#endif // GTEST_HAS_DEATH_TEST
-
-#include "gtest/gtest-message.h"
-#include "gtest/internal/gtest-string.h"
-
-// Indicates that this translation unit is part of Google Test's
-// implementation. It must come before gtest-internal-inl.h is
-// included, or there will be a compiler error. This trick is to
-// prevent a user from accidentally including gtest-internal-inl.h in
-// his code.
-#define GTEST_IMPLEMENTATION_ 1
-#include "src/gtest-internal-inl.h"
-#undef GTEST_IMPLEMENTATION_
-
-namespace testing {
-
-// Constants.
-
-// The default death test style.
-static const char kDefaultDeathTestStyle[] = "fast";
-
-GTEST_DEFINE_string_(
- death_test_style,
- internal::StringFromGTestEnv("death_test_style", kDefaultDeathTestStyle),
- "Indicates how to run a death test in a forked child process: "
- "\"threadsafe\" (child process re-executes the test binary "
- "from the beginning, running only the specific death test) or "
- "\"fast\" (child process runs the death test immediately "
- "after forking).");
-
-GTEST_DEFINE_bool_(
- death_test_use_fork,
- internal::BoolFromGTestEnv("death_test_use_fork", false),
- "Instructs to use fork()/_exit() instead of clone() in death tests. "
- "Ignored and always uses fork() on POSIX systems where clone() is not "
- "implemented. Useful when running under valgrind or similar tools if "
- "those do not support clone(). Valgrind 3.3.1 will just fail if "
- "it sees an unsupported combination of clone() flags. "
- "It is not recommended to use this flag w/o valgrind though it will "
- "work in 99% of the cases. Once valgrind is fixed, this flag will "
- "most likely be removed.");
-
-namespace internal {
-GTEST_DEFINE_string_(
- internal_run_death_test, "",
- "Indicates the file, line number, temporal index of "
- "the single death test to run, and a file descriptor to "
- "which a success code may be sent, all separated by "
- "the '|' characters. This flag is specified if and only if the current "
- "process is a sub-process launched for running a thread-safe "
- "death test. FOR INTERNAL USE ONLY.");
-} // namespace internal
-
-#if GTEST_HAS_DEATH_TEST
-
-namespace internal {
-
-// Valid only for fast death tests. Indicates the code is running in the
-// child process of a fast style death test.
-static bool g_in_fast_death_test_child = false;
-
-// Returns a Boolean value indicating whether the caller is currently
-// executing in the context of the death test child process. Tools such as
-// Valgrind heap checkers may need this to modify their behavior in death
-// tests. IMPORTANT: This is an internal utility. Using it may break the
-// implementation of death tests. User code MUST NOT use it.
-bool InDeathTestChild() {
-# if GTEST_OS_WINDOWS
-
- // On Windows, death tests are thread-safe regardless of the value of the
- // death_test_style flag.
- return !GTEST_FLAG(internal_run_death_test).empty();
-
-# else
-
- if (GTEST_FLAG(death_test_style) == "threadsafe")
- return !GTEST_FLAG(internal_run_death_test).empty();
- else
- return g_in_fast_death_test_child;
-#endif
-}
-
-} // namespace internal
-
-// ExitedWithCode constructor.
-ExitedWithCode::ExitedWithCode(int exit_code) : exit_code_(exit_code) {
-}
-
-// ExitedWithCode function-call operator.
-bool ExitedWithCode::operator()(int exit_status) const {
-# if GTEST_OS_WINDOWS
-
- return exit_status == exit_code_;
-
-# else
-
- return WIFEXITED(exit_status) && WEXITSTATUS(exit_status) == exit_code_;
-
-# endif // GTEST_OS_WINDOWS
-}
-
-# if !GTEST_OS_WINDOWS
-// KilledBySignal constructor.
-KilledBySignal::KilledBySignal(int signum) : signum_(signum) {
-}
-
-// KilledBySignal function-call operator.
-bool KilledBySignal::operator()(int exit_status) const {
- return WIFSIGNALED(exit_status) && WTERMSIG(exit_status) == signum_;
-}
-# endif // !GTEST_OS_WINDOWS
-
-namespace internal {
-
-// Utilities needed for death tests.
-
-// Generates a textual description of a given exit code, in the format
-// specified by wait(2).
-static String ExitSummary(int exit_code) {
- Message m;
-
-# if GTEST_OS_WINDOWS
-
- m << "Exited with exit status " << exit_code;
-
-# else
-
- if (WIFEXITED(exit_code)) {
- m << "Exited with exit status " << WEXITSTATUS(exit_code);
- } else if (WIFSIGNALED(exit_code)) {
- m << "Terminated by signal " << WTERMSIG(exit_code);
- }
-# ifdef WCOREDUMP
- if (WCOREDUMP(exit_code)) {
- m << " (core dumped)";
- }
-# endif
-# endif // GTEST_OS_WINDOWS
-
- return m.GetString();
-}
-
-// Returns true if exit_status describes a process that was terminated
-// by a signal, or exited normally with a nonzero exit code.
-bool ExitedUnsuccessfully(int exit_status) {
- return !ExitedWithCode(0)(exit_status);
-}
-
-# if !GTEST_OS_WINDOWS
-// Generates a textual failure message when a death test finds more than
-// one thread running, or cannot determine the number of threads, prior
-// to executing the given statement. It is the responsibility of the
-// caller not to pass a thread_count of 1.
-static String DeathTestThreadWarning(size_t thread_count) {
- Message msg;
- msg << "Death tests use fork(), which is unsafe particularly"
- << " in a threaded context. For this test, " << GTEST_NAME_ << " ";
- if (thread_count == 0)
- msg << "couldn't detect the number of threads.";
- else
- msg << "detected " << thread_count << " threads.";
- return msg.GetString();
-}
-# endif // !GTEST_OS_WINDOWS
-
-// Flag characters for reporting a death test that did not die.
-static const char kDeathTestLived = 'L';
-static const char kDeathTestReturned = 'R';
-static const char kDeathTestThrew = 'T';
-static const char kDeathTestInternalError = 'I';
-
-// An enumeration describing all of the possible ways that a death test can
-// conclude. DIED means that the process died while executing the test
-// code; LIVED means that process lived beyond the end of the test code;
-// RETURNED means that the test statement attempted to execute a return
-// statement, which is not allowed; THREW means that the test statement
-// returned control by throwing an exception. IN_PROGRESS means the test
-// has not yet concluded.
-// TODO(vladl@google.com): Unify names and possibly values for
-// AbortReason, DeathTestOutcome, and flag characters above.
-enum DeathTestOutcome { IN_PROGRESS, DIED, LIVED, RETURNED, THREW };
-
-// Routine for aborting the program which is safe to call from an
-// exec-style death test child process, in which case the error
-// message is propagated back to the parent process. Otherwise, the
-// message is simply printed to stderr. In either case, the program
-// then exits with status 1.
-void DeathTestAbort(const String& message) {
- // On a POSIX system, this function may be called from a threadsafe-style
- // death test child process, which operates on a very small stack. Use
- // the heap for any additional non-minuscule memory requirements.
- const InternalRunDeathTestFlag* const flag =
- GetUnitTestImpl()->internal_run_death_test_flag();
- if (flag != NULL) {
- FILE* parent = posix::FDOpen(flag->write_fd(), "w");
- fputc(kDeathTestInternalError, parent);
- fprintf(parent, "%s", message.c_str());
- fflush(parent);
- _exit(1);
- } else {
- fprintf(stderr, "%s", message.c_str());
- fflush(stderr);
- posix::Abort();
- }
-}
-
-// A replacement for CHECK that calls DeathTestAbort if the assertion
-// fails.
-# define GTEST_DEATH_TEST_CHECK_(expression) \
- do { \
- if (!::testing::internal::IsTrue(expression)) { \
- DeathTestAbort(::testing::internal::String::Format( \
- "CHECK failed: File %s, line %d: %s", \
- __FILE__, __LINE__, #expression)); \
- } \
- } while (::testing::internal::AlwaysFalse())
-
-// This macro is similar to GTEST_DEATH_TEST_CHECK_, but it is meant for
-// evaluating any system call that fulfills two conditions: it must return
-// -1 on failure, and set errno to EINTR when it is interrupted and
-// should be tried again. The macro expands to a loop that repeatedly
-// evaluates the expression as long as it evaluates to -1 and sets
-// errno to EINTR. If the expression evaluates to -1 but errno is
-// something other than EINTR, DeathTestAbort is called.
-# define GTEST_DEATH_TEST_CHECK_SYSCALL_(expression) \
- do { \
- int gtest_retval; \
- do { \
- gtest_retval = (expression); \
- } while (gtest_retval == -1 && errno == EINTR); \
- if (gtest_retval == -1) { \
- DeathTestAbort(::testing::internal::String::Format( \
- "CHECK failed: File %s, line %d: %s != -1", \
- __FILE__, __LINE__, #expression)); \
- } \
- } while (::testing::internal::AlwaysFalse())
-
-// Returns the message describing the last system error in errno.
-String GetLastErrnoDescription() {
- return String(errno == 0 ? "" : posix::StrError(errno));
-}
-
-// This is called from a death test parent process to read a failure
-// message from the death test child process and log it with the FATAL
-// severity. On Windows, the message is read from a pipe handle. On other
-// platforms, it is read from a file descriptor.
-static void FailFromInternalError(int fd) {
- Message error;
- char buffer[256];
- int num_read;
-
- do {
- while ((num_read = posix::Read(fd, buffer, 255)) > 0) {
- buffer[num_read] = '\0';
- error << buffer;
- }
- } while (num_read == -1 && errno == EINTR);
-
- if (num_read == 0) {
- GTEST_LOG_(FATAL) << error.GetString();
- } else {
- const int last_error = errno;
- GTEST_LOG_(FATAL) << "Error while reading death test internal: "
- << GetLastErrnoDescription() << " [" << last_error << "]";
- }
-}
-
-// Death test constructor. Increments the running death test count
-// for the current test.
-DeathTest::DeathTest() {
- TestInfo* const info = GetUnitTestImpl()->current_test_info();
- if (info == NULL) {
- DeathTestAbort("Cannot run a death test outside of a TEST or "
- "TEST_F construct");
- }
-}
-
-// Creates and returns a death test by dispatching to the current
-// death test factory.
-bool DeathTest::Create(const char* statement, const RE* regex,
- const char* file, int line, DeathTest** test) {
- return GetUnitTestImpl()->death_test_factory()->Create(
- statement, regex, file, line, test);
-}
-
-const char* DeathTest::LastMessage() {
- return last_death_test_message_.c_str();
-}
-
-void DeathTest::set_last_death_test_message(const String& message) {
- last_death_test_message_ = message;
-}
-
-String DeathTest::last_death_test_message_;
-
-// Provides cross platform implementation for some death functionality.
-class DeathTestImpl : public DeathTest {
- protected:
- DeathTestImpl(const char* a_statement, const RE* a_regex)
- : statement_(a_statement),
- regex_(a_regex),
- spawned_(false),
- status_(-1),
- outcome_(IN_PROGRESS),
- read_fd_(-1),
- write_fd_(-1) {}
-
- // read_fd_ is expected to be closed and cleared by a derived class.
- ~DeathTestImpl() { GTEST_DEATH_TEST_CHECK_(read_fd_ == -1); }
-
- void Abort(AbortReason reason);
- virtual bool Passed(bool status_ok);
-
- const char* statement() const { return statement_; }
- const RE* regex() const { return regex_; }
- bool spawned() const { return spawned_; }
- void set_spawned(bool is_spawned) { spawned_ = is_spawned; }
- int status() const { return status_; }
- void set_status(int a_status) { status_ = a_status; }
- DeathTestOutcome outcome() const { return outcome_; }
- void set_outcome(DeathTestOutcome an_outcome) { outcome_ = an_outcome; }
- int read_fd() const { return read_fd_; }
- void set_read_fd(int fd) { read_fd_ = fd; }
- int write_fd() const { return write_fd_; }
- void set_write_fd(int fd) { write_fd_ = fd; }
-
- // Called in the parent process only. Reads the result code of the death
- // test child process via a pipe, interprets it to set the outcome_
- // member, and closes read_fd_. Outputs diagnostics and terminates in
- // case of unexpected codes.
- void ReadAndInterpretStatusByte();
-
- private:
- // The textual content of the code this object is testing. This class
- // doesn't own this string and should not attempt to delete it.
- const char* const statement_;
- // The regular expression which test output must match. DeathTestImpl
- // doesn't own this object and should not attempt to delete it.
- const RE* const regex_;
- // True if the death test child process has been successfully spawned.
- bool spawned_;
- // The exit status of the child process.
- int status_;
- // How the death test concluded.
- DeathTestOutcome outcome_;
- // Descriptor to the read end of the pipe to the child process. It is
- // always -1 in the child process. The child keeps its write end of the
- // pipe in write_fd_.
- int read_fd_;
- // Descriptor to the child's write end of the pipe to the parent process.
- // It is always -1 in the parent process. The parent keeps its end of the
- // pipe in read_fd_.
- int write_fd_;
-};
-
-// Called in the parent process only. Reads the result code of the death
-// test child process via a pipe, interprets it to set the outcome_
-// member, and closes read_fd_. Outputs diagnostics and terminates in
-// case of unexpected codes.
-void DeathTestImpl::ReadAndInterpretStatusByte() {
- char flag;
- int bytes_read;
-
- // The read() here blocks until data is available (signifying the
- // failure of the death test) or until the pipe is closed (signifying
- // its success), so it's okay to call this in the parent before
- // the child process has exited.
- do {
- bytes_read = posix::Read(read_fd(), &flag, 1);
- } while (bytes_read == -1 && errno == EINTR);
-
- if (bytes_read == 0) {
- set_outcome(DIED);
- } else if (bytes_read == 1) {
- switch (flag) {
- case kDeathTestReturned:
- set_outcome(RETURNED);
- break;
- case kDeathTestThrew:
- set_outcome(THREW);
- break;
- case kDeathTestLived:
- set_outcome(LIVED);
- break;
- case kDeathTestInternalError:
- FailFromInternalError(read_fd()); // Does not return.
- break;
- default:
- GTEST_LOG_(FATAL) << "Death test child process reported "
- << "unexpected status byte ("
- << static_cast<unsigned int>(flag) << ")";
- }
- } else {
- GTEST_LOG_(FATAL) << "Read from death test child process failed: "
- << GetLastErrnoDescription();
- }
- GTEST_DEATH_TEST_CHECK_SYSCALL_(posix::Close(read_fd()));
- set_read_fd(-1);
-}
-
-// Signals that the death test code which should have exited, didn't.
-// Should be called only in a death test child process.
-// Writes a status byte to the child's status file descriptor, then
-// calls _exit(1).
-void DeathTestImpl::Abort(AbortReason reason) {
- // The parent process considers the death test to be a failure if
- // it finds any data in our pipe. So, here we write a single flag byte
- // to the pipe, then exit.
- const char status_ch =
- reason == TEST_DID_NOT_DIE ? kDeathTestLived :
- reason == TEST_THREW_EXCEPTION ? kDeathTestThrew : kDeathTestReturned;
-
- GTEST_DEATH_TEST_CHECK_SYSCALL_(posix::Write(write_fd(), &status_ch, 1));
- // We are leaking the descriptor here because on some platforms (i.e.,
- // when built as Windows DLL), destructors of global objects will still
- // run after calling _exit(). On such systems, write_fd_ will be
- // indirectly closed from the destructor of UnitTestImpl, causing double
- // close if it is also closed here. On debug configurations, double close
- // may assert. As there are no in-process buffers to flush here, we are
- // relying on the OS to close the descriptor after the process terminates
- // when the destructors are not run.
- _exit(1); // Exits w/o any normal exit hooks (we were supposed to crash)
-}
-
-// Returns an indented copy of stderr output for a death test.
-// This makes distinguishing death test output lines from regular log lines
-// much easier.
-static ::std::string FormatDeathTestOutput(const ::std::string& output) {
- ::std::string ret;
- for (size_t at = 0; ; ) {
- const size_t line_end = output.find('\n', at);
- ret += "[ DEATH ] ";
- if (line_end == ::std::string::npos) {
- ret += output.substr(at);
- break;
- }
- ret += output.substr(at, line_end + 1 - at);
- at = line_end + 1;
- }
- return ret;
-}
-
-// Assesses the success or failure of a death test, using both private
-// members which have previously been set, and one argument:
-//
-// Private data members:
-// outcome: An enumeration describing how the death test
-// concluded: DIED, LIVED, THREW, or RETURNED. The death test
-// fails in the latter three cases.
-// status: The exit status of the child process. On *nix, it is in the
-// in the format specified by wait(2). On Windows, this is the
-// value supplied to the ExitProcess() API or a numeric code
-// of the exception that terminated the program.
-// regex: A regular expression object to be applied to
-// the test's captured standard error output; the death test
-// fails if it does not match.
-//
-// Argument:
-// status_ok: true if exit_status is acceptable in the context of
-// this particular death test, which fails if it is false
-//
-// Returns true iff all of the above conditions are met. Otherwise, the
-// first failing condition, in the order given above, is the one that is
-// reported. Also sets the last death test message string.
-bool DeathTestImpl::Passed(bool status_ok) {
- if (!spawned())
- return false;
-
- const String error_message = GetCapturedStderr();
-
- bool success = false;
- Message buffer;
-
- buffer << "Death test: " << statement() << "\n";
- switch (outcome()) {
- case LIVED:
- buffer << " Result: failed to die.\n"
- << " Error msg:\n" << FormatDeathTestOutput(error_message);
- break;
- case THREW:
- buffer << " Result: threw an exception.\n"
- << " Error msg:\n" << FormatDeathTestOutput(error_message);
- break;
- case RETURNED:
- buffer << " Result: illegal return in test statement.\n"
- << " Error msg:\n" << FormatDeathTestOutput(error_message);
- break;
- case DIED:
- if (status_ok) {
- const bool matched = RE::PartialMatch(error_message.c_str(), *regex());
- if (matched) {
- success = true;
- } else {
- buffer << " Result: died but not with expected error.\n"
- << " Expected: " << regex()->pattern() << "\n"
- << "Actual msg:\n" << FormatDeathTestOutput(error_message);
- }
- } else {
- buffer << " Result: died but not with expected exit code:\n"
- << " " << ExitSummary(status()) << "\n"
- << "Actual msg:\n" << FormatDeathTestOutput(error_message);
- }
- break;
- case IN_PROGRESS:
- default:
- GTEST_LOG_(FATAL)
- << "DeathTest::Passed somehow called before conclusion of test";
- }
-
- DeathTest::set_last_death_test_message(buffer.GetString());
- return success;
-}
-
-# if GTEST_OS_WINDOWS
-// WindowsDeathTest implements death tests on Windows. Due to the
-// specifics of starting new processes on Windows, death tests there are
-// always threadsafe, and Google Test considers the
-// --gtest_death_test_style=fast setting to be equivalent to
-// --gtest_death_test_style=threadsafe there.
-//
-// A few implementation notes: Like the Linux version, the Windows
-// implementation uses pipes for child-to-parent communication. But due to
-// the specifics of pipes on Windows, some extra steps are required:
-//
-// 1. The parent creates a communication pipe and stores handles to both
-// ends of it.
-// 2. The parent starts the child and provides it with the information
-// necessary to acquire the handle to the write end of the pipe.
-// 3. The child acquires the write end of the pipe and signals the parent
-// using a Windows event.
-// 4. Now the parent can release the write end of the pipe on its side. If
-// this is done before step 3, the object's reference count goes down to
-// 0 and it is destroyed, preventing the child from acquiring it. The
-// parent now has to release it, or read operations on the read end of
-// the pipe will not return when the child terminates.
-// 5. The parent reads child's output through the pipe (outcome code and
-// any possible error messages) from the pipe, and its stderr and then
-// determines whether to fail the test.
-//
-// Note: to distinguish Win32 API calls from the local method and function
-// calls, the former are explicitly resolved in the global namespace.
-//
-class WindowsDeathTest : public DeathTestImpl {
- public:
- WindowsDeathTest(const char* a_statement,
- const RE* a_regex,
- const char* file,
- int line)
- : DeathTestImpl(a_statement, a_regex), file_(file), line_(line) {}
-
- // All of these virtual functions are inherited from DeathTest.
- virtual int Wait();
- virtual TestRole AssumeRole();
-
- private:
- // The name of the file in which the death test is located.
- const char* const file_;
- // The line number on which the death test is located.
- const int line_;
- // Handle to the write end of the pipe to the child process.
- AutoHandle write_handle_;
- // Child process handle.
- AutoHandle child_handle_;
- // Event the child process uses to signal the parent that it has
- // acquired the handle to the write end of the pipe. After seeing this
- // event the parent can release its own handles to make sure its
- // ReadFile() calls return when the child terminates.
- AutoHandle event_handle_;
-};
-
-// Waits for the child in a death test to exit, returning its exit
-// status, or 0 if no child process exists. As a side effect, sets the
-// outcome data member.
-int WindowsDeathTest::Wait() {
- if (!spawned())
- return 0;
-
- // Wait until the child either signals that it has acquired the write end
- // of the pipe or it dies.
- const HANDLE wait_handles[2] = { child_handle_.Get(), event_handle_.Get() };
- switch (::WaitForMultipleObjects(2,
- wait_handles,
- FALSE, // Waits for any of the handles.
- INFINITE)) {
- case WAIT_OBJECT_0:
- case WAIT_OBJECT_0 + 1:
- break;
- default:
- GTEST_DEATH_TEST_CHECK_(false); // Should not get here.
- }
-
- // The child has acquired the write end of the pipe or exited.
- // We release the handle on our side and continue.
- write_handle_.Reset();
- event_handle_.Reset();
-
- ReadAndInterpretStatusByte();
-
- // Waits for the child process to exit if it haven't already. This
- // returns immediately if the child has already exited, regardless of
- // whether previous calls to WaitForMultipleObjects synchronized on this
- // handle or not.
- GTEST_DEATH_TEST_CHECK_(
- WAIT_OBJECT_0 == ::WaitForSingleObject(child_handle_.Get(),
- INFINITE));
- DWORD status_code;
- GTEST_DEATH_TEST_CHECK_(
- ::GetExitCodeProcess(child_handle_.Get(), &status_code) != FALSE);
- child_handle_.Reset();
- set_status(static_cast<int>(status_code));
- return status();
-}
-
-// The AssumeRole process for a Windows death test. It creates a child
-// process with the same executable as the current process to run the
-// death test. The child process is given the --gtest_filter and
-// --gtest_internal_run_death_test flags such that it knows to run the
-// current death test only.
-DeathTest::TestRole WindowsDeathTest::AssumeRole() {
- const UnitTestImpl* const impl = GetUnitTestImpl();
- const InternalRunDeathTestFlag* const flag =
- impl->internal_run_death_test_flag();
- const TestInfo* const info = impl->current_test_info();
- const int death_test_index = info->result()->death_test_count();
-
- if (flag != NULL) {
- // ParseInternalRunDeathTestFlag() has performed all the necessary
- // processing.
- set_write_fd(flag->write_fd());
- return EXECUTE_TEST;
- }
-
- // WindowsDeathTest uses an anonymous pipe to communicate results of
- // a death test.
- SECURITY_ATTRIBUTES handles_are_inheritable = {
- sizeof(SECURITY_ATTRIBUTES), NULL, TRUE };
- HANDLE read_handle, write_handle;
- GTEST_DEATH_TEST_CHECK_(
- ::CreatePipe(&read_handle, &write_handle, &handles_are_inheritable,
- 0) // Default buffer size.
- != FALSE);
- set_read_fd(::_open_osfhandle(reinterpret_cast<intptr_t>(read_handle),
- O_RDONLY));
- write_handle_.Reset(write_handle);
- event_handle_.Reset(::CreateEvent(
- &handles_are_inheritable,
- TRUE, // The event will automatically reset to non-signaled state.
- FALSE, // The initial state is non-signalled.
- NULL)); // The even is unnamed.
- GTEST_DEATH_TEST_CHECK_(event_handle_.Get() != NULL);
- const String filter_flag = String::Format("--%s%s=%s.%s",
- GTEST_FLAG_PREFIX_, kFilterFlag,
- info->test_case_name(),
- info->name());
- const String internal_flag = String::Format(
- "--%s%s=%s|%d|%d|%u|%Iu|%Iu",
- GTEST_FLAG_PREFIX_,
- kInternalRunDeathTestFlag,
- file_, line_,
- death_test_index,
- static_cast<unsigned int>(::GetCurrentProcessId()),
- // size_t has the same with as pointers on both 32-bit and 64-bit
- // Windows platforms.
- // See http://msdn.microsoft.com/en-us/library/tcxf1dw6.aspx.
- reinterpret_cast<size_t>(write_handle),
- reinterpret_cast<size_t>(event_handle_.Get()));
-
- char executable_path[_MAX_PATH + 1]; // NOLINT
- GTEST_DEATH_TEST_CHECK_(
- _MAX_PATH + 1 != ::GetModuleFileNameA(NULL,
- executable_path,
- _MAX_PATH));
-
- String command_line = String::Format("%s %s \"%s\"",
- ::GetCommandLineA(),
- filter_flag.c_str(),
- internal_flag.c_str());
-
- DeathTest::set_last_death_test_message("");
-
- CaptureStderr();
- // Flush the log buffers since the log streams are shared with the child.
- FlushInfoLog();
-
- // The child process will share the standard handles with the parent.
- STARTUPINFOA startup_info;
- memset(&startup_info, 0, sizeof(STARTUPINFO));
- startup_info.dwFlags = STARTF_USESTDHANDLES;
- startup_info.hStdInput = ::GetStdHandle(STD_INPUT_HANDLE);
- startup_info.hStdOutput = ::GetStdHandle(STD_OUTPUT_HANDLE);
- startup_info.hStdError = ::GetStdHandle(STD_ERROR_HANDLE);
-
- PROCESS_INFORMATION process_info;
- GTEST_DEATH_TEST_CHECK_(::CreateProcessA(
- executable_path,
- const_cast<char*>(command_line.c_str()),
- NULL, // Retuned process handle is not inheritable.
- NULL, // Retuned thread handle is not inheritable.
- TRUE, // Child inherits all inheritable handles (for write_handle_).
- 0x0, // Default creation flags.
- NULL, // Inherit the parent's environment.
- UnitTest::GetInstance()->original_working_dir(),
- &startup_info,
- &process_info) != FALSE);
- child_handle_.Reset(process_info.hProcess);
- ::CloseHandle(process_info.hThread);
- set_spawned(true);
- return OVERSEE_TEST;
-}
-# else // We are not on Windows.
-
-// ForkingDeathTest provides implementations for most of the abstract
-// methods of the DeathTest interface. Only the AssumeRole method is
-// left undefined.
-class ForkingDeathTest : public DeathTestImpl {
- public:
- ForkingDeathTest(const char* statement, const RE* regex);
-
- // All of these virtual functions are inherited from DeathTest.
- virtual int Wait();
-
- protected:
- void set_child_pid(pid_t child_pid) { child_pid_ = child_pid; }
-
- private:
- // PID of child process during death test; 0 in the child process itself.
- pid_t child_pid_;
-};
-
-// Constructs a ForkingDeathTest.
-ForkingDeathTest::ForkingDeathTest(const char* a_statement, const RE* a_regex)
- : DeathTestImpl(a_statement, a_regex),
- child_pid_(-1) {}
-
-// Waits for the child in a death test to exit, returning its exit
-// status, or 0 if no child process exists. As a side effect, sets the
-// outcome data member.
-int ForkingDeathTest::Wait() {
- if (!spawned())
- return 0;
-
- ReadAndInterpretStatusByte();
-
- int status_value;
- GTEST_DEATH_TEST_CHECK_SYSCALL_(waitpid(child_pid_, &status_value, 0));
- set_status(status_value);
- return status_value;
-}
-
-// A concrete death test class that forks, then immediately runs the test
-// in the child process.
-class NoExecDeathTest : public ForkingDeathTest {
- public:
- NoExecDeathTest(const char* a_statement, const RE* a_regex) :
- ForkingDeathTest(a_statement, a_regex) { }
- virtual TestRole AssumeRole();
-};
-
-// The AssumeRole process for a fork-and-run death test. It implements a
-// straightforward fork, with a simple pipe to transmit the status byte.
-DeathTest::TestRole NoExecDeathTest::AssumeRole() {
- const size_t thread_count = GetThreadCount();
- if (thread_count != 1) {
- GTEST_LOG_(WARNING) << DeathTestThreadWarning(thread_count);
- }
-
- int pipe_fd[2];
- GTEST_DEATH_TEST_CHECK_(pipe(pipe_fd) != -1);
-
- DeathTest::set_last_death_test_message("");
- CaptureStderr();
- // When we fork the process below, the log file buffers are copied, but the
- // file descriptors are shared. We flush all log files here so that closing
- // the file descriptors in the child process doesn't throw off the
- // synchronization between descriptors and buffers in the parent process.
- // This is as close to the fork as possible to avoid a race condition in case
- // there are multiple threads running before the death test, and another
- // thread writes to the log file.
- FlushInfoLog();
-
- const pid_t child_pid = fork();
- GTEST_DEATH_TEST_CHECK_(child_pid != -1);
- set_child_pid(child_pid);
- if (child_pid == 0) {
- GTEST_DEATH_TEST_CHECK_SYSCALL_(close(pipe_fd[0]));
- set_write_fd(pipe_fd[1]);
- // Redirects all logging to stderr in the child process to prevent
- // concurrent writes to the log files. We capture stderr in the parent
- // process and append the child process' output to a log.
- LogToStderr();
- // Event forwarding to the listeners of event listener API mush be shut
- // down in death test subprocesses.
- GetUnitTestImpl()->listeners()->SuppressEventForwarding();
- g_in_fast_death_test_child = true;
- return EXECUTE_TEST;
- } else {
- GTEST_DEATH_TEST_CHECK_SYSCALL_(close(pipe_fd[1]));
- set_read_fd(pipe_fd[0]);
- set_spawned(true);
- return OVERSEE_TEST;
- }
-}
-
-// A concrete death test class that forks and re-executes the main
-// program from the beginning, with command-line flags set that cause
-// only this specific death test to be run.
-class ExecDeathTest : public ForkingDeathTest {
- public:
- ExecDeathTest(const char* a_statement, const RE* a_regex,
- const char* file, int line) :
- ForkingDeathTest(a_statement, a_regex), file_(file), line_(line) { }
- virtual TestRole AssumeRole();
- private:
- static ::std::vector<testing::internal::string>
- GetArgvsForDeathTestChildProcess() {
- ::std::vector<testing::internal::string> args = GetInjectableArgvs();
- return args;
- }
- // The name of the file in which the death test is located.
- const char* const file_;
- // The line number on which the death test is located.
- const int line_;
-};
-
-// Utility class for accumulating command-line arguments.
-class Arguments {
- public:
- Arguments() {
- args_.push_back(NULL);
- }
-
- ~Arguments() {
- for (std::vector<char*>::iterator i = args_.begin(); i != args_.end();
- ++i) {
- free(*i);
- }
- }
- void AddArgument(const char* argument) {
- args_.insert(args_.end() - 1, posix::StrDup(argument));
- }
-
- template <typename Str>
- void AddArguments(const ::std::vector<Str>& arguments) {
- for (typename ::std::vector<Str>::const_iterator i = arguments.begin();
- i != arguments.end();
- ++i) {
- args_.insert(args_.end() - 1, posix::StrDup(i->c_str()));
- }
- }
- char* const* Argv() {
- return &args_[0];
- }
-
- private:
- std::vector<char*> args_;
-};
-
-// A struct that encompasses the arguments to the child process of a
-// threadsafe-style death test process.
-struct ExecDeathTestArgs {
- char* const* argv; // Command-line arguments for the child's call to exec
- int close_fd; // File descriptor to close; the read end of a pipe
-};
-
-# if GTEST_OS_MAC
-inline char** GetEnviron() {
- // When Google Test is built as a framework on MacOS X, the environ variable
- // is unavailable. Apple's documentation (man environ) recommends using
- // _NSGetEnviron() instead.
- return *_NSGetEnviron();
-}
-# else
-// Some POSIX platforms expect you to declare environ. extern "C" makes
-// it reside in the global namespace.
-extern "C" char** environ;
-inline char** GetEnviron() { return environ; }
-# endif // GTEST_OS_MAC
-
-# if !GTEST_OS_QNX
-// The main function for a threadsafe-style death test child process.
-// This function is called in a clone()-ed process and thus must avoid
-// any potentially unsafe operations like malloc or libc functions.
-static int ExecDeathTestChildMain(void* child_arg) {
- ExecDeathTestArgs* const args = static_cast<ExecDeathTestArgs*>(child_arg);
- GTEST_DEATH_TEST_CHECK_SYSCALL_(close(args->close_fd));
-
- // We need to execute the test program in the same environment where
- // it was originally invoked. Therefore we change to the original
- // working directory first.
- const char* const original_dir =
- UnitTest::GetInstance()->original_working_dir();
- // We can safely call chdir() as it's a direct system call.
- if (chdir(original_dir) != 0) {
- DeathTestAbort(String::Format("chdir(\"%s\") failed: %s",
- original_dir,
- GetLastErrnoDescription().c_str()));
- return EXIT_FAILURE;
- }
-
- // We can safely call execve() as it's a direct system call. We
- // cannot use execvp() as it's a libc function and thus potentially
- // unsafe. Since execve() doesn't search the PATH, the user must
- // invoke the test program via a valid path that contains at least
- // one path separator.
- execve(args->argv[0], args->argv, GetEnviron());
- DeathTestAbort(String::Format("execve(%s, ...) in %s failed: %s",
- args->argv[0],
- original_dir,
- GetLastErrnoDescription().c_str()));
- return EXIT_FAILURE;
-}
-# endif // !GTEST_OS_QNX
-
-// Two utility routines that together determine the direction the stack
-// grows.
-// This could be accomplished more elegantly by a single recursive
-// function, but we want to guard against the unlikely possibility of
-// a smart compiler optimizing the recursion away.
-//
-// GTEST_NO_INLINE_ is required to prevent GCC 4.6 from inlining
-// StackLowerThanAddress into StackGrowsDown, which then doesn't give
-// correct answer.
-void StackLowerThanAddress(const void* ptr, bool* result) GTEST_NO_INLINE_;
-void StackLowerThanAddress(const void* ptr, bool* result) {
- int dummy;
- *result = (&dummy < ptr);
-}
-
-bool StackGrowsDown() {
- int dummy;
- bool result;
- StackLowerThanAddress(&dummy, &result);
- return result;
-}
-
-// Spawns a child process with the same executable as the current process in
-// a thread-safe manner and instructs it to run the death test. The
-// implementation uses fork(2) + exec. On systems where clone(2) is
-// available, it is used instead, being slightly more thread-safe. On QNX,
-// fork supports only single-threaded environments, so this function uses
-// spawn(2) there instead. The function dies with an error message if
-// anything goes wrong.
-static pid_t ExecDeathTestSpawnChild(char* const* argv, int close_fd) {
- ExecDeathTestArgs args = { argv, close_fd };
- pid_t child_pid = -1;
-
-# if GTEST_OS_QNX
- // Obtains the current directory and sets it to be closed in the child
- // process.
- const int cwd_fd = open(".", O_RDONLY);
- GTEST_DEATH_TEST_CHECK_(cwd_fd != -1);
- GTEST_DEATH_TEST_CHECK_SYSCALL_(fcntl(cwd_fd, F_SETFD, FD_CLOEXEC));
- // We need to execute the test program in the same environment where
- // it was originally invoked. Therefore we change to the original
- // working directory first.
- const char* const original_dir =
- UnitTest::GetInstance()->original_working_dir();
- // We can safely call chdir() as it's a direct system call.
- if (chdir(original_dir) != 0) {
- DeathTestAbort(String::Format("chdir(\"%s\") failed: %s",
- original_dir,
- GetLastErrnoDescription().c_str()));
- return EXIT_FAILURE;
- }
-
- int fd_flags;
- // Set close_fd to be closed after spawn.
- GTEST_DEATH_TEST_CHECK_SYSCALL_(fd_flags = fcntl(close_fd, F_GETFD));
- GTEST_DEATH_TEST_CHECK_SYSCALL_(fcntl(close_fd, F_SETFD,
- fd_flags | FD_CLOEXEC));
- struct inheritance inherit = {0};
- // spawn is a system call.
- child_pid = spawn(args.argv[0], 0, NULL, &inherit, args.argv, GetEnviron());
- // Restores the current working directory.
- GTEST_DEATH_TEST_CHECK_(fchdir(cwd_fd) != -1);
- GTEST_DEATH_TEST_CHECK_SYSCALL_(close(cwd_fd));
-
-# else // GTEST_OS_QNX
-# if GTEST_OS_LINUX
- // When a SIGPROF signal is received while fork() or clone() are executing,
- // the process may hang. To avoid this, we ignore SIGPROF here and re-enable
- // it after the call to fork()/clone() is complete.
- struct sigaction saved_sigprof_action;
- struct sigaction ignore_sigprof_action;
- memset(&ignore_sigprof_action, 0, sizeof(ignore_sigprof_action));
- sigemptyset(&ignore_sigprof_action.sa_mask);
- ignore_sigprof_action.sa_handler = SIG_IGN;
- GTEST_DEATH_TEST_CHECK_SYSCALL_(sigaction(
- SIGPROF, &ignore_sigprof_action, &saved_sigprof_action));
-# endif // GTEST_OS_LINUX
-
-# if GTEST_HAS_CLONE
- const bool use_fork = GTEST_FLAG(death_test_use_fork);
-
- if (!use_fork) {
- static const bool stack_grows_down = StackGrowsDown();
- const size_t stack_size = getpagesize();
- // MMAP_ANONYMOUS is not defined on Mac, so we use MAP_ANON instead.
- void* const stack = mmap(NULL, stack_size, PROT_READ | PROT_WRITE,
- MAP_ANON | MAP_PRIVATE, -1, 0);
- GTEST_DEATH_TEST_CHECK_(stack != MAP_FAILED);
- void* const stack_top =
- static_cast<char*>(stack) + (stack_grows_down ? stack_size : 0);
-
- child_pid = clone(&ExecDeathTestChildMain, stack_top, SIGCHLD, &args);
-
- GTEST_DEATH_TEST_CHECK_(munmap(stack, stack_size) != -1);
- }
-# else
- const bool use_fork = true;
-# endif // GTEST_HAS_CLONE
-
- if (use_fork && (child_pid = fork()) == 0) {
- ExecDeathTestChildMain(&args);
- _exit(0);
- }
-# endif // GTEST_OS_QNX
-# if GTEST_OS_LINUX
- GTEST_DEATH_TEST_CHECK_SYSCALL_(
- sigaction(SIGPROF, &saved_sigprof_action, NULL));
-# endif // GTEST_OS_LINUX
-
- GTEST_DEATH_TEST_CHECK_(child_pid != -1);
- return child_pid;
-}
-
-// The AssumeRole process for a fork-and-exec death test. It re-executes the
-// main program from the beginning, setting the --gtest_filter
-// and --gtest_internal_run_death_test flags to cause only the current
-// death test to be re-run.
-DeathTest::TestRole ExecDeathTest::AssumeRole() {
- const UnitTestImpl* const impl = GetUnitTestImpl();
- const InternalRunDeathTestFlag* const flag =
- impl->internal_run_death_test_flag();
- const TestInfo* const info = impl->current_test_info();
- const int death_test_index = info->result()->death_test_count();
-
- if (flag != NULL) {
- set_write_fd(flag->write_fd());
- return EXECUTE_TEST;
- }
-
- int pipe_fd[2];
- GTEST_DEATH_TEST_CHECK_(pipe(pipe_fd) != -1);
- // Clear the close-on-exec flag on the write end of the pipe, lest
- // it be closed when the child process does an exec:
- GTEST_DEATH_TEST_CHECK_(fcntl(pipe_fd[1], F_SETFD, 0) != -1);
-
- const String filter_flag =
- String::Format("--%s%s=%s.%s",
- GTEST_FLAG_PREFIX_, kFilterFlag,
- info->test_case_name(), info->name());
- const String internal_flag =
- String::Format("--%s%s=%s|%d|%d|%d",
- GTEST_FLAG_PREFIX_, kInternalRunDeathTestFlag,
- file_, line_, death_test_index, pipe_fd[1]);
- Arguments args;
- args.AddArguments(GetArgvsForDeathTestChildProcess());
- args.AddArgument(filter_flag.c_str());
- args.AddArgument(internal_flag.c_str());
-
- DeathTest::set_last_death_test_message("");
-
- CaptureStderr();
- // See the comment in NoExecDeathTest::AssumeRole for why the next line
- // is necessary.
- FlushInfoLog();
-
- const pid_t child_pid = ExecDeathTestSpawnChild(args.Argv(), pipe_fd[0]);
- GTEST_DEATH_TEST_CHECK_SYSCALL_(close(pipe_fd[1]));
- set_child_pid(child_pid);
- set_read_fd(pipe_fd[0]);
- set_spawned(true);
- return OVERSEE_TEST;
-}
-
-# endif // !GTEST_OS_WINDOWS
-
-// Creates a concrete DeathTest-derived class that depends on the
-// --gtest_death_test_style flag, and sets the pointer pointed to
-// by the "test" argument to its address. If the test should be
-// skipped, sets that pointer to NULL. Returns true, unless the
-// flag is set to an invalid value.
-bool DefaultDeathTestFactory::Create(const char* statement, const RE* regex,
- const char* file, int line,
- DeathTest** test) {
- UnitTestImpl* const impl = GetUnitTestImpl();
- const InternalRunDeathTestFlag* const flag =
- impl->internal_run_death_test_flag();
- const int death_test_index = impl->current_test_info()
- ->increment_death_test_count();
-
- if (flag != NULL) {
- if (death_test_index > flag->index()) {
- DeathTest::set_last_death_test_message(String::Format(
- "Death test count (%d) somehow exceeded expected maximum (%d)",
- death_test_index, flag->index()));
- return false;
- }
-
- if (!(flag->file() == file && flag->line() == line &&
- flag->index() == death_test_index)) {
- *test = NULL;
- return true;
- }
- }
-
-# if GTEST_OS_WINDOWS
-
- if (GTEST_FLAG(death_test_style) == "threadsafe" ||
- GTEST_FLAG(death_test_style) == "fast") {
- *test = new WindowsDeathTest(statement, regex, file, line);
- }
-
-# else
-
- if (GTEST_FLAG(death_test_style) == "threadsafe") {
- *test = new ExecDeathTest(statement, regex, file, line);
- } else if (GTEST_FLAG(death_test_style) == "fast") {
- *test = new NoExecDeathTest(statement, regex);
- }
-
-# endif // GTEST_OS_WINDOWS
-
- else { // NOLINT - this is more readable than unbalanced brackets inside #if.
- DeathTest::set_last_death_test_message(String::Format(
- "Unknown death test style \"%s\" encountered",
- GTEST_FLAG(death_test_style).c_str()));
- return false;
- }
-
- return true;
-}
-
-// Splits a given string on a given delimiter, populating a given
-// vector with the fields. GTEST_HAS_DEATH_TEST implies that we have
-// ::std::string, so we can use it here.
-static void SplitString(const ::std::string& str, char delimiter,
- ::std::vector< ::std::string>* dest) {
- ::std::vector< ::std::string> parsed;
- ::std::string::size_type pos = 0;
- while (::testing::internal::AlwaysTrue()) {
- const ::std::string::size_type colon = str.find(delimiter, pos);
- if (colon == ::std::string::npos) {
- parsed.push_back(str.substr(pos));
- break;
- } else {
- parsed.push_back(str.substr(pos, colon - pos));
- pos = colon + 1;
- }
- }
- dest->swap(parsed);
-}
-
-# if GTEST_OS_WINDOWS
-// Recreates the pipe and event handles from the provided parameters,
-// signals the event, and returns a file descriptor wrapped around the pipe
-// handle. This function is called in the child process only.
-int GetStatusFileDescriptor(unsigned int parent_process_id,
- size_t write_handle_as_size_t,
- size_t event_handle_as_size_t) {
- AutoHandle parent_process_handle(::OpenProcess(PROCESS_DUP_HANDLE,
- FALSE, // Non-inheritable.
- parent_process_id));
- if (parent_process_handle.Get() == INVALID_HANDLE_VALUE) {
- DeathTestAbort(String::Format("Unable to open parent process %u",
- parent_process_id));
- }
-
- // TODO(vladl@google.com): Replace the following check with a
- // compile-time assertion when available.
- GTEST_CHECK_(sizeof(HANDLE) <= sizeof(size_t));
-
- const HANDLE write_handle =
- reinterpret_cast<HANDLE>(write_handle_as_size_t);
- HANDLE dup_write_handle;
-
- // The newly initialized handle is accessible only in in the parent
- // process. To obtain one accessible within the child, we need to use
- // DuplicateHandle.
- if (!::DuplicateHandle(parent_process_handle.Get(), write_handle,
- ::GetCurrentProcess(), &dup_write_handle,
- 0x0, // Requested privileges ignored since
- // DUPLICATE_SAME_ACCESS is used.
- FALSE, // Request non-inheritable handler.
- DUPLICATE_SAME_ACCESS)) {
- DeathTestAbort(String::Format(
- "Unable to duplicate the pipe handle %Iu from the parent process %u",
- write_handle_as_size_t, parent_process_id));
- }
-
- const HANDLE event_handle = reinterpret_cast<HANDLE>(event_handle_as_size_t);
- HANDLE dup_event_handle;
-
- if (!::DuplicateHandle(parent_process_handle.Get(), event_handle,
- ::GetCurrentProcess(), &dup_event_handle,
- 0x0,
- FALSE,
- DUPLICATE_SAME_ACCESS)) {
- DeathTestAbort(String::Format(
- "Unable to duplicate the event handle %Iu from the parent process %u",
- event_handle_as_size_t, parent_process_id));
- }
-
- const int write_fd =
- ::_open_osfhandle(reinterpret_cast<intptr_t>(dup_write_handle), O_APPEND);
- if (write_fd == -1) {
- DeathTestAbort(String::Format(
- "Unable to convert pipe handle %Iu to a file descriptor",
- write_handle_as_size_t));
- }
-
- // Signals the parent that the write end of the pipe has been acquired
- // so the parent can release its own write end.
- ::SetEvent(dup_event_handle);
-
- return write_fd;
-}
-# endif // GTEST_OS_WINDOWS
-
-// Returns a newly created InternalRunDeathTestFlag object with fields
-// initialized from the GTEST_FLAG(internal_run_death_test) flag if
-// the flag is specified; otherwise returns NULL.
-InternalRunDeathTestFlag* ParseInternalRunDeathTestFlag() {
- if (GTEST_FLAG(internal_run_death_test) == "") return NULL;
-
- // GTEST_HAS_DEATH_TEST implies that we have ::std::string, so we
- // can use it here.
- int line = -1;
- int index = -1;
- ::std::vector< ::std::string> fields;
- SplitString(GTEST_FLAG(internal_run_death_test).c_str(), '|', &fields);
- int write_fd = -1;
-
-# if GTEST_OS_WINDOWS
-
- unsigned int parent_process_id = 0;
- size_t write_handle_as_size_t = 0;
- size_t event_handle_as_size_t = 0;
-
- if (fields.size() != 6
- || !ParseNaturalNumber(fields[1], &line)
- || !ParseNaturalNumber(fields[2], &index)
- || !ParseNaturalNumber(fields[3], &parent_process_id)
- || !ParseNaturalNumber(fields[4], &write_handle_as_size_t)
- || !ParseNaturalNumber(fields[5], &event_handle_as_size_t)) {
- DeathTestAbort(String::Format(
- "Bad --gtest_internal_run_death_test flag: %s",
- GTEST_FLAG(internal_run_death_test).c_str()));
- }
- write_fd = GetStatusFileDescriptor(parent_process_id,
- write_handle_as_size_t,
- event_handle_as_size_t);
-# else
-
- if (fields.size() != 4
- || !ParseNaturalNumber(fields[1], &line)
- || !ParseNaturalNumber(fields[2], &index)
- || !ParseNaturalNumber(fields[3], &write_fd)) {
- DeathTestAbort(String::Format(
- "Bad --gtest_internal_run_death_test flag: %s",
- GTEST_FLAG(internal_run_death_test).c_str()));
- }
-
-# endif // GTEST_OS_WINDOWS
-
- return new InternalRunDeathTestFlag(fields[0], line, index, write_fd);
-}
-
-} // namespace internal
-
-#endif // GTEST_HAS_DEATH_TEST
-
-} // namespace testing
diff --git a/src/testing/gtest/src/gtest-filepath.cc b/src/testing/gtest/src/gtest-filepath.cc
deleted file mode 100644
index 91b25713..00000000
--- a/src/testing/gtest/src/gtest-filepath.cc
+++ /dev/null
@@ -1,380 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Authors: keith.ray@gmail.com (Keith Ray)
-
-#include "gtest/internal/gtest-filepath.h"
-#include "gtest/internal/gtest-port.h"
-
-#include <stdlib.h>
-
-#if GTEST_OS_WINDOWS_MOBILE
-# include <windows.h>
-#elif GTEST_OS_WINDOWS
-# include <direct.h>
-# include <io.h>
-#elif GTEST_OS_SYMBIAN || GTEST_OS_NACL
-// Symbian OpenC and NaCl have PATH_MAX in sys/syslimits.h
-# include <sys/syslimits.h>
-#else
-# include <limits.h>
-# include <climits> // Some Linux distributions define PATH_MAX here.
-#endif // GTEST_OS_WINDOWS_MOBILE
-
-#if GTEST_OS_WINDOWS
-# define GTEST_PATH_MAX_ _MAX_PATH
-#elif defined(PATH_MAX)
-# define GTEST_PATH_MAX_ PATH_MAX
-#elif defined(_XOPEN_PATH_MAX)
-# define GTEST_PATH_MAX_ _XOPEN_PATH_MAX
-#else
-# define GTEST_PATH_MAX_ _POSIX_PATH_MAX
-#endif // GTEST_OS_WINDOWS
-
-#include "gtest/internal/gtest-string.h"
-
-namespace testing {
-namespace internal {
-
-#if GTEST_OS_WINDOWS
-// On Windows, '\\' is the standard path separator, but many tools and the
-// Windows API also accept '/' as an alternate path separator. Unless otherwise
-// noted, a file path can contain either kind of path separators, or a mixture
-// of them.
-const char kPathSeparator = '\\';
-const char kAlternatePathSeparator = '/';
-const char kPathSeparatorString[] = "\\";
-const char kAlternatePathSeparatorString[] = "/";
-# if GTEST_OS_WINDOWS_MOBILE
-// Windows CE doesn't have a current directory. You should not use
-// the current directory in tests on Windows CE, but this at least
-// provides a reasonable fallback.
-const char kCurrentDirectoryString[] = "\\";
-// Windows CE doesn't define INVALID_FILE_ATTRIBUTES
-const DWORD kInvalidFileAttributes = 0xffffffff;
-# else
-const char kCurrentDirectoryString[] = ".\\";
-# endif // GTEST_OS_WINDOWS_MOBILE
-#else
-const char kPathSeparator = '/';
-const char kPathSeparatorString[] = "/";
-const char kCurrentDirectoryString[] = "./";
-#endif // GTEST_OS_WINDOWS
-
-// Returns whether the given character is a valid path separator.
-static bool IsPathSeparator(char c) {
-#if GTEST_HAS_ALT_PATH_SEP_
- return (c == kPathSeparator) || (c == kAlternatePathSeparator);
-#else
- return c == kPathSeparator;
-#endif
-}
-
-// Returns the current working directory, or "" if unsuccessful.
-FilePath FilePath::GetCurrentDir() {
-#if GTEST_OS_WINDOWS_MOBILE
- // Windows CE doesn't have a current directory, so we just return
- // something reasonable.
- return FilePath(kCurrentDirectoryString);
-#elif GTEST_OS_WINDOWS
- char cwd[GTEST_PATH_MAX_ + 1] = { '\0' };
- return FilePath(_getcwd(cwd, sizeof(cwd)) == NULL ? "" : cwd);
-#else
- char cwd[GTEST_PATH_MAX_ + 1] = { '\0' };
- return FilePath(getcwd(cwd, sizeof(cwd)) == NULL ? "" : cwd);
-#endif // GTEST_OS_WINDOWS_MOBILE
-}
-
-// Returns a copy of the FilePath with the case-insensitive extension removed.
-// Example: FilePath("dir/file.exe").RemoveExtension("EXE") returns
-// FilePath("dir/file"). If a case-insensitive extension is not
-// found, returns a copy of the original FilePath.
-FilePath FilePath::RemoveExtension(const char* extension) const {
- String dot_extension(String::Format(".%s", extension));
- if (pathname_.EndsWithCaseInsensitive(dot_extension.c_str())) {
- return FilePath(String(pathname_.c_str(), pathname_.length() - 4));
- }
- return *this;
-}
-
-// Returns a pointer to the last occurence of a valid path separator in
-// the FilePath. On Windows, for example, both '/' and '\' are valid path
-// separators. Returns NULL if no path separator was found.
-const char* FilePath::FindLastPathSeparator() const {
- const char* const last_sep = strrchr(c_str(), kPathSeparator);
-#if GTEST_HAS_ALT_PATH_SEP_
- const char* const last_alt_sep = strrchr(c_str(), kAlternatePathSeparator);
- // Comparing two pointers of which only one is NULL is undefined.
- if (last_alt_sep != NULL &&
- (last_sep == NULL || last_alt_sep > last_sep)) {
- return last_alt_sep;
- }
-#endif
- return last_sep;
-}
-
-// Returns a copy of the FilePath with the directory part removed.
-// Example: FilePath("path/to/file").RemoveDirectoryName() returns
-// FilePath("file"). If there is no directory part ("just_a_file"), it returns
-// the FilePath unmodified. If there is no file part ("just_a_dir/") it
-// returns an empty FilePath ("").
-// On Windows platform, '\' is the path separator, otherwise it is '/'.
-FilePath FilePath::RemoveDirectoryName() const {
- const char* const last_sep = FindLastPathSeparator();
- return last_sep ? FilePath(String(last_sep + 1)) : *this;
-}
-
-// RemoveFileName returns the directory path with the filename removed.
-// Example: FilePath("path/to/file").RemoveFileName() returns "path/to/".
-// If the FilePath is "a_file" or "/a_file", RemoveFileName returns
-// FilePath("./") or, on Windows, FilePath(".\\"). If the filepath does
-// not have a file, like "just/a/dir/", it returns the FilePath unmodified.
-// On Windows platform, '\' is the path separator, otherwise it is '/'.
-FilePath FilePath::RemoveFileName() const {
- const char* const last_sep = FindLastPathSeparator();
- String dir;
- if (last_sep) {
- dir = String(c_str(), last_sep + 1 - c_str());
- } else {
- dir = kCurrentDirectoryString;
- }
- return FilePath(dir);
-}
-
-// Helper functions for naming files in a directory for xml output.
-
-// Given directory = "dir", base_name = "test", number = 0,
-// extension = "xml", returns "dir/test.xml". If number is greater
-// than zero (e.g., 12), returns "dir/test_12.xml".
-// On Windows platform, uses \ as the separator rather than /.
-FilePath FilePath::MakeFileName(const FilePath& directory,
- const FilePath& base_name,
- int number,
- const char* extension) {
- String file;
- if (number == 0) {
- file = String::Format("%s.%s", base_name.c_str(), extension);
- } else {
- file = String::Format("%s_%d.%s", base_name.c_str(), number, extension);
- }
- return ConcatPaths(directory, FilePath(file));
-}
-
-// Given directory = "dir", relative_path = "test.xml", returns "dir/test.xml".
-// On Windows, uses \ as the separator rather than /.
-FilePath FilePath::ConcatPaths(const FilePath& directory,
- const FilePath& relative_path) {
- if (directory.IsEmpty())
- return relative_path;
- const FilePath dir(directory.RemoveTrailingPathSeparator());
- return FilePath(String::Format("%s%c%s", dir.c_str(), kPathSeparator,
- relative_path.c_str()));
-}
-
-// Returns true if pathname describes something findable in the file-system,
-// either a file, directory, or whatever.
-bool FilePath::FileOrDirectoryExists() const {
-#if GTEST_OS_WINDOWS_MOBILE
- LPCWSTR unicode = String::AnsiToUtf16(pathname_.c_str());
- const DWORD attributes = GetFileAttributes(unicode);
- delete [] unicode;
- return attributes != kInvalidFileAttributes;
-#else
- posix::StatStruct file_stat;
- return posix::Stat(pathname_.c_str(), &file_stat) == 0;
-#endif // GTEST_OS_WINDOWS_MOBILE
-}
-
-// Returns true if pathname describes a directory in the file-system
-// that exists.
-bool FilePath::DirectoryExists() const {
- bool result = false;
-#if GTEST_OS_WINDOWS
- // Don't strip off trailing separator if path is a root directory on
- // Windows (like "C:\\").
- const FilePath& path(IsRootDirectory() ? *this :
- RemoveTrailingPathSeparator());
-#else
- const FilePath& path(*this);
-#endif
-
-#if GTEST_OS_WINDOWS_MOBILE
- LPCWSTR unicode = String::AnsiToUtf16(path.c_str());
- const DWORD attributes = GetFileAttributes(unicode);
- delete [] unicode;
- if ((attributes != kInvalidFileAttributes) &&
- (attributes & FILE_ATTRIBUTE_DIRECTORY)) {
- result = true;
- }
-#else
- posix::StatStruct file_stat;
- result = posix::Stat(path.c_str(), &file_stat) == 0 &&
- posix::IsDir(file_stat);
-#endif // GTEST_OS_WINDOWS_MOBILE
-
- return result;
-}
-
-// Returns true if pathname describes a root directory. (Windows has one
-// root directory per disk drive.)
-bool FilePath::IsRootDirectory() const {
-#if GTEST_OS_WINDOWS
- // TODO(wan@google.com): on Windows a network share like
- // \\server\share can be a root directory, although it cannot be the
- // current directory. Handle this properly.
- return pathname_.length() == 3 && IsAbsolutePath();
-#else
- return pathname_.length() == 1 && IsPathSeparator(pathname_.c_str()[0]);
-#endif
-}
-
-// Returns true if pathname describes an absolute path.
-bool FilePath::IsAbsolutePath() const {
- const char* const name = pathname_.c_str();
-#if GTEST_OS_WINDOWS
- return pathname_.length() >= 3 &&
- ((name[0] >= 'a' && name[0] <= 'z') ||
- (name[0] >= 'A' && name[0] <= 'Z')) &&
- name[1] == ':' &&
- IsPathSeparator(name[2]);
-#else
- return IsPathSeparator(name[0]);
-#endif
-}
-
-// Returns a pathname for a file that does not currently exist. The pathname
-// will be directory/base_name.extension or
-// directory/base_name_<number>.extension if directory/base_name.extension
-// already exists. The number will be incremented until a pathname is found
-// that does not already exist.
-// Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'.
-// There could be a race condition if two or more processes are calling this
-// function at the same time -- they could both pick the same filename.
-FilePath FilePath::GenerateUniqueFileName(const FilePath& directory,
- const FilePath& base_name,
- const char* extension) {
- FilePath full_pathname;
- int number = 0;
- do {
- full_pathname.Set(MakeFileName(directory, base_name, number++, extension));
- } while (full_pathname.FileOrDirectoryExists());
- return full_pathname;
-}
-
-// Returns true if FilePath ends with a path separator, which indicates that
-// it is intended to represent a directory. Returns false otherwise.
-// This does NOT check that a directory (or file) actually exists.
-bool FilePath::IsDirectory() const {
- return !pathname_.empty() &&
- IsPathSeparator(pathname_.c_str()[pathname_.length() - 1]);
-}
-
-// Create directories so that path exists. Returns true if successful or if
-// the directories already exist; returns false if unable to create directories
-// for any reason.
-bool FilePath::CreateDirectoriesRecursively() const {
- if (!this->IsDirectory()) {
- return false;
- }
-
- if (pathname_.length() == 0 || this->DirectoryExists()) {
- return true;
- }
-
- const FilePath parent(this->RemoveTrailingPathSeparator().RemoveFileName());
- return parent.CreateDirectoriesRecursively() && this->CreateFolder();
-}
-
-// Create the directory so that path exists. Returns true if successful or
-// if the directory already exists; returns false if unable to create the
-// directory for any reason, including if the parent directory does not
-// exist. Not named "CreateDirectory" because that's a macro on Windows.
-bool FilePath::CreateFolder() const {
-#if GTEST_OS_WINDOWS_MOBILE
- FilePath removed_sep(this->RemoveTrailingPathSeparator());
- LPCWSTR unicode = String::AnsiToUtf16(removed_sep.c_str());
- int result = CreateDirectory(unicode, NULL) ? 0 : -1;
- delete [] unicode;
-#elif GTEST_OS_WINDOWS
- int result = _mkdir(pathname_.c_str());
-#else
- int result = mkdir(pathname_.c_str(), 0777);
-#endif // GTEST_OS_WINDOWS_MOBILE
-
- if (result == -1) {
- return this->DirectoryExists(); // An error is OK if the directory exists.
- }
- return true; // No error.
-}
-
-// If input name has a trailing separator character, remove it and return the
-// name, otherwise return the name string unmodified.
-// On Windows platform, uses \ as the separator, other platforms use /.
-FilePath FilePath::RemoveTrailingPathSeparator() const {
- return IsDirectory()
- ? FilePath(String(pathname_.c_str(), pathname_.length() - 1))
- : *this;
-}
-
-// Removes any redundant separators that might be in the pathname.
-// For example, "bar///foo" becomes "bar/foo". Does not eliminate other
-// redundancies that might be in a pathname involving "." or "..".
-// TODO(wan@google.com): handle Windows network shares (e.g. \\server\share).
-void FilePath::Normalize() {
- if (pathname_.c_str() == NULL) {
- pathname_ = "";
- return;
- }
- const char* src = pathname_.c_str();
- char* const dest = new char[pathname_.length() + 1];
- char* dest_ptr = dest;
- memset(dest_ptr, 0, pathname_.length() + 1);
-
- while (*src != '\0') {
- *dest_ptr = *src;
- if (!IsPathSeparator(*src)) {
- src++;
- } else {
-#if GTEST_HAS_ALT_PATH_SEP_
- if (*dest_ptr == kAlternatePathSeparator) {
- *dest_ptr = kPathSeparator;
- }
-#endif
- while (IsPathSeparator(*src))
- src++;
- }
- dest_ptr++;
- }
- *dest_ptr = '\0';
- pathname_ = dest;
- delete[] dest;
-}
-
-} // namespace internal
-} // namespace testing
diff --git a/src/testing/gtest/src/gtest-internal-inl.h b/src/testing/gtest/src/gtest-internal-inl.h
deleted file mode 100644
index 350ade07..00000000
--- a/src/testing/gtest/src/gtest-internal-inl.h
+++ /dev/null
@@ -1,1056 +0,0 @@
-// Copyright 2005, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Utility functions and classes used by the Google C++ testing framework.
-//
-// Author: wan@google.com (Zhanyong Wan)
-//
-// This file contains purely Google Test's internal implementation. Please
-// DO NOT #INCLUDE IT IN A USER PROGRAM.
-
-#ifndef GTEST_SRC_GTEST_INTERNAL_INL_H_
-#define GTEST_SRC_GTEST_INTERNAL_INL_H_
-
-// GTEST_IMPLEMENTATION_ is defined to 1 iff the current translation unit is
-// part of Google Test's implementation; otherwise it's undefined.
-#if !GTEST_IMPLEMENTATION_
-// A user is trying to include this from his code - just say no.
-# error "gtest-internal-inl.h is part of Google Test's internal implementation."
-# error "It must not be included except by Google Test itself."
-#endif // GTEST_IMPLEMENTATION_
-
-#ifndef _WIN32_WCE
-# include <errno.h>
-#endif // !_WIN32_WCE
-#include <stddef.h>
-#include <stdlib.h> // For strtoll/_strtoul64/malloc/free.
-#include <string.h> // For memmove.
-
-#include <algorithm>
-#include <string>
-#include <vector>
-
-#include "gtest/internal/gtest-port.h"
-
-#if GTEST_OS_WINDOWS
-# include <windows.h> // NOLINT
-#endif // GTEST_OS_WINDOWS
-
-#include "gtest/gtest.h" // NOLINT
-#include "gtest/gtest-spi.h"
-
-namespace testing {
-
-// Declares the flags.
-//
-// We don't want the users to modify this flag in the code, but want
-// Google Test's own unit tests to be able to access it. Therefore we
-// declare it here as opposed to in gtest.h.
-GTEST_DECLARE_bool_(death_test_use_fork);
-
-namespace internal {
-
-// The value of GetTestTypeId() as seen from within the Google Test
-// library. This is solely for testing GetTestTypeId().
-GTEST_API_ extern const TypeId kTestTypeIdInGoogleTest;
-
-// Names of the flags (needed for parsing Google Test flags).
-const char kAlsoRunDisabledTestsFlag[] = "also_run_disabled_tests";
-const char kBreakOnFailureFlag[] = "break_on_failure";
-const char kCatchExceptionsFlag[] = "catch_exceptions";
-const char kColorFlag[] = "color";
-const char kFilterFlag[] = "filter";
-const char kListTestsFlag[] = "list_tests";
-const char kOutputFlag[] = "output";
-const char kPrintTimeFlag[] = "print_time";
-const char kRandomSeedFlag[] = "random_seed";
-const char kRepeatFlag[] = "repeat";
-const char kShuffleFlag[] = "shuffle";
-const char kStackTraceDepthFlag[] = "stack_trace_depth";
-const char kStreamResultToFlag[] = "stream_result_to";
-const char kThrowOnFailureFlag[] = "throw_on_failure";
-
-// A valid random seed must be in [1, kMaxRandomSeed].
-const int kMaxRandomSeed = 99999;
-
-// g_help_flag is true iff the --help flag or an equivalent form is
-// specified on the command line.
-GTEST_API_ extern bool g_help_flag;
-
-// Returns the current time in milliseconds.
-GTEST_API_ TimeInMillis GetTimeInMillis();
-
-// Returns true iff Google Test should use colors in the output.
-GTEST_API_ bool ShouldUseColor(bool stdout_is_tty);
-
-// Formats the given time in milliseconds as seconds.
-GTEST_API_ std::string FormatTimeInMillisAsSeconds(TimeInMillis ms);
-
-// Converts the given time in milliseconds to a date string in the ISO 8601
-// format, without the timezone information. N.B.: due to the use the
-// non-reentrant localtime() function, this function is not thread safe. Do
-// not use it in any code that can be called from multiple threads.
-GTEST_API_ std::string FormatEpochTimeInMillisAsIso8601(TimeInMillis ms);
-
-// Parses a string for an Int32 flag, in the form of "--flag=value".
-//
-// On success, stores the value of the flag in *value, and returns
-// true. On failure, returns false without changing *value.
-GTEST_API_ bool ParseInt32Flag(
- const char* str, const char* flag, Int32* value);
-
-// Returns a random seed in range [1, kMaxRandomSeed] based on the
-// given --gtest_random_seed flag value.
-inline int GetRandomSeedFromFlag(Int32 random_seed_flag) {
- const unsigned int raw_seed = (random_seed_flag == 0) ?
- static_cast<unsigned int>(GetTimeInMillis()) :
- static_cast<unsigned int>(random_seed_flag);
-
- // Normalizes the actual seed to range [1, kMaxRandomSeed] such that
- // it's easy to type.
- const int normalized_seed =
- static_cast<int>((raw_seed - 1U) %
- static_cast<unsigned int>(kMaxRandomSeed)) + 1;
- return normalized_seed;
-}
-
-// Returns the first valid random seed after 'seed'. The behavior is
-// undefined if 'seed' is invalid. The seed after kMaxRandomSeed is
-// considered to be 1.
-inline int GetNextRandomSeed(int seed) {
- GTEST_CHECK_(1 <= seed && seed <= kMaxRandomSeed)
- << "Invalid random seed " << seed << " - must be in [1, "
- << kMaxRandomSeed << "].";
- const int next_seed = seed + 1;
- return (next_seed > kMaxRandomSeed) ? 1 : next_seed;
-}
-
-// This class saves the values of all Google Test flags in its c'tor, and
-// restores them in its d'tor.
-class GTestFlagSaver {
- public:
- // The c'tor.
- GTestFlagSaver() {
- also_run_disabled_tests_ = GTEST_FLAG(also_run_disabled_tests);
- break_on_failure_ = GTEST_FLAG(break_on_failure);
- catch_exceptions_ = GTEST_FLAG(catch_exceptions);
- color_ = GTEST_FLAG(color);
- death_test_style_ = GTEST_FLAG(death_test_style);
- death_test_use_fork_ = GTEST_FLAG(death_test_use_fork);
- filter_ = GTEST_FLAG(filter);
- internal_run_death_test_ = GTEST_FLAG(internal_run_death_test);
- list_tests_ = GTEST_FLAG(list_tests);
- output_ = GTEST_FLAG(output);
- print_time_ = GTEST_FLAG(print_time);
- random_seed_ = GTEST_FLAG(random_seed);
- repeat_ = GTEST_FLAG(repeat);
- shuffle_ = GTEST_FLAG(shuffle);
- stack_trace_depth_ = GTEST_FLAG(stack_trace_depth);
- stream_result_to_ = GTEST_FLAG(stream_result_to);
- throw_on_failure_ = GTEST_FLAG(throw_on_failure);
- }
-
- // The d'tor is not virtual. DO NOT INHERIT FROM THIS CLASS.
- ~GTestFlagSaver() {
- GTEST_FLAG(also_run_disabled_tests) = also_run_disabled_tests_;
- GTEST_FLAG(break_on_failure) = break_on_failure_;
- GTEST_FLAG(catch_exceptions) = catch_exceptions_;
- GTEST_FLAG(color) = color_;
- GTEST_FLAG(death_test_style) = death_test_style_;
- GTEST_FLAG(death_test_use_fork) = death_test_use_fork_;
- GTEST_FLAG(filter) = filter_;
- GTEST_FLAG(internal_run_death_test) = internal_run_death_test_;
- GTEST_FLAG(list_tests) = list_tests_;
- GTEST_FLAG(output) = output_;
- GTEST_FLAG(print_time) = print_time_;
- GTEST_FLAG(random_seed) = random_seed_;
- GTEST_FLAG(repeat) = repeat_;
- GTEST_FLAG(shuffle) = shuffle_;
- GTEST_FLAG(stack_trace_depth) = stack_trace_depth_;
- GTEST_FLAG(stream_result_to) = stream_result_to_;
- GTEST_FLAG(throw_on_failure) = throw_on_failure_;
- }
-
- private:
- // Fields for saving the original values of flags.
- bool also_run_disabled_tests_;
- bool break_on_failure_;
- bool catch_exceptions_;
- String color_;
- String death_test_style_;
- bool death_test_use_fork_;
- String filter_;
- String internal_run_death_test_;
- bool list_tests_;
- String output_;
- bool print_time_;
- bool pretty_;
- internal::Int32 random_seed_;
- internal::Int32 repeat_;
- bool shuffle_;
- internal::Int32 stack_trace_depth_;
- String stream_result_to_;
- bool throw_on_failure_;
-} GTEST_ATTRIBUTE_UNUSED_;
-
-// Converts a Unicode code point to a narrow string in UTF-8 encoding.
-// code_point parameter is of type UInt32 because wchar_t may not be
-// wide enough to contain a code point.
-// The output buffer str must containt at least 32 characters.
-// The function returns the address of the output buffer.
-// If the code_point is not a valid Unicode code point
-// (i.e. outside of Unicode range U+0 to U+10FFFF) it will be output
-// as '(Invalid Unicode 0xXXXXXXXX)'.
-GTEST_API_ char* CodePointToUtf8(UInt32 code_point, char* str);
-
-// Converts a wide string to a narrow string in UTF-8 encoding.
-// The wide string is assumed to have the following encoding:
-// UTF-16 if sizeof(wchar_t) == 2 (on Windows, Cygwin, Symbian OS)
-// UTF-32 if sizeof(wchar_t) == 4 (on Linux)
-// Parameter str points to a null-terminated wide string.
-// Parameter num_chars may additionally limit the number
-// of wchar_t characters processed. -1 is used when the entire string
-// should be processed.
-// If the string contains code points that are not valid Unicode code points
-// (i.e. outside of Unicode range U+0 to U+10FFFF) they will be output
-// as '(Invalid Unicode 0xXXXXXXXX)'. If the string is in UTF16 encoding
-// and contains invalid UTF-16 surrogate pairs, values in those pairs
-// will be encoded as individual Unicode characters from Basic Normal Plane.
-GTEST_API_ String WideStringToUtf8(const wchar_t* str, int num_chars);
-
-// Reads the GTEST_SHARD_STATUS_FILE environment variable, and creates the file
-// if the variable is present. If a file already exists at this location, this
-// function will write over it. If the variable is present, but the file cannot
-// be created, prints an error and exits.
-void WriteToShardStatusFileIfNeeded();
-
-// Checks whether sharding is enabled by examining the relevant
-// environment variable values. If the variables are present,
-// but inconsistent (e.g., shard_index >= total_shards), prints
-// an error and exits. If in_subprocess_for_death_test, sharding is
-// disabled because it must only be applied to the original test
-// process. Otherwise, we could filter out death tests we intended to execute.
-GTEST_API_ bool ShouldShard(const char* total_shards_str,
- const char* shard_index_str,
- bool in_subprocess_for_death_test);
-
-// Parses the environment variable var as an Int32. If it is unset,
-// returns default_val. If it is not an Int32, prints an error and
-// and aborts.
-GTEST_API_ Int32 Int32FromEnvOrDie(const char* env_var, Int32 default_val);
-
-// Given the total number of shards, the shard index, and the test id,
-// returns true iff the test should be run on this shard. The test id is
-// some arbitrary but unique non-negative integer assigned to each test
-// method. Assumes that 0 <= shard_index < total_shards.
-GTEST_API_ bool ShouldRunTestOnShard(
- int total_shards, int shard_index, int test_id);
-
-// STL container utilities.
-
-// Returns the number of elements in the given container that satisfy
-// the given predicate.
-template <class Container, typename Predicate>
-inline int CountIf(const Container& c, Predicate predicate) {
- // Implemented as an explicit loop since std::count_if() in libCstd on
- // Solaris has a non-standard signature.
- int count = 0;
- for (typename Container::const_iterator it = c.begin(); it != c.end(); ++it) {
- if (predicate(*it))
- ++count;
- }
- return count;
-}
-
-// Applies a function/functor to each element in the container.
-template <class Container, typename Functor>
-void ForEach(const Container& c, Functor functor) {
- std::for_each(c.begin(), c.end(), functor);
-}
-
-// Returns the i-th element of the vector, or default_value if i is not
-// in range [0, v.size()).
-template <typename E>
-inline E GetElementOr(const std::vector<E>& v, int i, E default_value) {
- return (i < 0 || i >= static_cast<int>(v.size())) ? default_value : v[i];
-}
-
-// Performs an in-place shuffle of a range of the vector's elements.
-// 'begin' and 'end' are element indices as an STL-style range;
-// i.e. [begin, end) are shuffled, where 'end' == size() means to
-// shuffle to the end of the vector.
-template <typename E>
-void ShuffleRange(internal::Random* random, int begin, int end,
- std::vector<E>* v) {
- const int size = static_cast<int>(v->size());
- GTEST_CHECK_(0 <= begin && begin <= size)
- << "Invalid shuffle range start " << begin << ": must be in range [0, "
- << size << "].";
- GTEST_CHECK_(begin <= end && end <= size)
- << "Invalid shuffle range finish " << end << ": must be in range ["
- << begin << ", " << size << "].";
-
- // Fisher-Yates shuffle, from
- // http://en.wikipedia.org/wiki/Fisher-Yates_shuffle
- for (int range_width = end - begin; range_width >= 2; range_width--) {
- const int last_in_range = begin + range_width - 1;
- const int selected = begin + random->Generate(range_width);
- std::swap((*v)[selected], (*v)[last_in_range]);
- }
-}
-
-// Performs an in-place shuffle of the vector's elements.
-template <typename E>
-inline void Shuffle(internal::Random* random, std::vector<E>* v) {
- ShuffleRange(random, 0, static_cast<int>(v->size()), v);
-}
-
-// A function for deleting an object. Handy for being used as a
-// functor.
-template <typename T>
-static void Delete(T* x) {
- delete x;
-}
-
-// A predicate that checks the key of a TestProperty against a known key.
-//
-// TestPropertyKeyIs is copyable.
-class TestPropertyKeyIs {
- public:
- // Constructor.
- //
- // TestPropertyKeyIs has NO default constructor.
- explicit TestPropertyKeyIs(const char* key)
- : key_(key) {}
-
- // Returns true iff the test name of test property matches on key_.
- bool operator()(const TestProperty& test_property) const {
- return String(test_property.key()).Compare(key_) == 0;
- }
-
- private:
- String key_;
-};
-
-// Class UnitTestOptions.
-//
-// This class contains functions for processing options the user
-// specifies when running the tests. It has only static members.
-//
-// In most cases, the user can specify an option using either an
-// environment variable or a command line flag. E.g. you can set the
-// test filter using either GTEST_FILTER or --gtest_filter. If both
-// the variable and the flag are present, the latter overrides the
-// former.
-class GTEST_API_ UnitTestOptions {
- public:
- // Functions for processing the gtest_output flag.
-
- // Returns the output format, or "" for normal printed output.
- static String GetOutputFormat();
-
- // Returns the absolute path of the requested output file, or the
- // default (test_detail.xml in the original working directory) if
- // none was explicitly specified.
- static String GetAbsolutePathToOutputFile();
-
- // Functions for processing the gtest_filter flag.
-
- // Returns true iff the wildcard pattern matches the string. The
- // first ':' or '\0' character in pattern marks the end of it.
- //
- // This recursive algorithm isn't very efficient, but is clear and
- // works well enough for matching test names, which are short.
- static bool PatternMatchesString(const char *pattern, const char *str);
-
- // Returns true iff the user-specified filter matches the test case
- // name and the test name.
- static bool FilterMatchesTest(const String &test_case_name,
- const String &test_name);
-
-#if GTEST_OS_WINDOWS
- // Function for supporting the gtest_catch_exception flag.
-
- // Returns EXCEPTION_EXECUTE_HANDLER if Google Test should handle the
- // given SEH exception, or EXCEPTION_CONTINUE_SEARCH otherwise.
- // This function is useful as an __except condition.
- static int GTestShouldProcessSEH(DWORD exception_code);
-#endif // GTEST_OS_WINDOWS
-
- // Returns true if "name" matches the ':' separated list of glob-style
- // filters in "filter".
- static bool MatchesFilter(const String& name, const char* filter);
-};
-
-// Returns the current application's name, removing directory path if that
-// is present. Used by UnitTestOptions::GetOutputFile.
-GTEST_API_ FilePath GetCurrentExecutableName();
-
-// The role interface for getting the OS stack trace as a string.
-class OsStackTraceGetterInterface {
- public:
- OsStackTraceGetterInterface() {}
- virtual ~OsStackTraceGetterInterface() {}
-
- // Returns the current OS stack trace as a String. Parameters:
- //
- // max_depth - the maximum number of stack frames to be included
- // in the trace.
- // skip_count - the number of top frames to be skipped; doesn't count
- // against max_depth.
- virtual String CurrentStackTrace(int max_depth, int skip_count) = 0;
-
- // UponLeavingGTest() should be called immediately before Google Test calls
- // user code. It saves some information about the current stack that
- // CurrentStackTrace() will use to find and hide Google Test stack frames.
- virtual void UponLeavingGTest() = 0;
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(OsStackTraceGetterInterface);
-};
-
-// A working implementation of the OsStackTraceGetterInterface interface.
-class OsStackTraceGetter : public OsStackTraceGetterInterface {
- public:
- OsStackTraceGetter() : caller_frame_(NULL) {}
-
- virtual String CurrentStackTrace(int max_depth, int skip_count)
- GTEST_LOCK_EXCLUDED_(mutex_);
-
- virtual void UponLeavingGTest() GTEST_LOCK_EXCLUDED_(mutex_);
-
- // This string is inserted in place of stack frames that are part of
- // Google Test's implementation.
- static const char* const kElidedFramesMarker;
-
- private:
- Mutex mutex_; // protects all internal state
-
- // We save the stack frame below the frame that calls user code.
- // We do this because the address of the frame immediately below
- // the user code changes between the call to UponLeavingGTest()
- // and any calls to CurrentStackTrace() from within the user code.
- void* caller_frame_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(OsStackTraceGetter);
-};
-
-// Information about a Google Test trace point.
-struct TraceInfo {
- const char* file;
- int line;
- String message;
-};
-
-// This is the default global test part result reporter used in UnitTestImpl.
-// This class should only be used by UnitTestImpl.
-class DefaultGlobalTestPartResultReporter
- : public TestPartResultReporterInterface {
- public:
- explicit DefaultGlobalTestPartResultReporter(UnitTestImpl* unit_test);
- // Implements the TestPartResultReporterInterface. Reports the test part
- // result in the current test.
- virtual void ReportTestPartResult(const TestPartResult& result);
-
- private:
- UnitTestImpl* const unit_test_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(DefaultGlobalTestPartResultReporter);
-};
-
-// This is the default per thread test part result reporter used in
-// UnitTestImpl. This class should only be used by UnitTestImpl.
-class DefaultPerThreadTestPartResultReporter
- : public TestPartResultReporterInterface {
- public:
- explicit DefaultPerThreadTestPartResultReporter(UnitTestImpl* unit_test);
- // Implements the TestPartResultReporterInterface. The implementation just
- // delegates to the current global test part result reporter of *unit_test_.
- virtual void ReportTestPartResult(const TestPartResult& result);
-
- private:
- UnitTestImpl* const unit_test_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(DefaultPerThreadTestPartResultReporter);
-};
-
-// The private implementation of the UnitTest class. We don't protect
-// the methods under a mutex, as this class is not accessible by a
-// user and the UnitTest class that delegates work to this class does
-// proper locking.
-class GTEST_API_ UnitTestImpl {
- public:
- explicit UnitTestImpl(UnitTest* parent);
- virtual ~UnitTestImpl();
-
- // There are two different ways to register your own TestPartResultReporter.
- // You can register your own repoter to listen either only for test results
- // from the current thread or for results from all threads.
- // By default, each per-thread test result repoter just passes a new
- // TestPartResult to the global test result reporter, which registers the
- // test part result for the currently running test.
-
- // Returns the global test part result reporter.
- TestPartResultReporterInterface* GetGlobalTestPartResultReporter();
-
- // Sets the global test part result reporter.
- void SetGlobalTestPartResultReporter(
- TestPartResultReporterInterface* reporter);
-
- // Returns the test part result reporter for the current thread.
- TestPartResultReporterInterface* GetTestPartResultReporterForCurrentThread();
-
- // Sets the test part result reporter for the current thread.
- void SetTestPartResultReporterForCurrentThread(
- TestPartResultReporterInterface* reporter);
-
- // Gets the number of successful test cases.
- int successful_test_case_count() const;
-
- // Gets the number of failed test cases.
- int failed_test_case_count() const;
-
- // Gets the number of all test cases.
- int total_test_case_count() const;
-
- // Gets the number of all test cases that contain at least one test
- // that should run.
- int test_case_to_run_count() const;
-
- // Gets the number of successful tests.
- int successful_test_count() const;
-
- // Gets the number of failed tests.
- int failed_test_count() const;
-
- // Gets the number of disabled tests.
- int disabled_test_count() const;
-
- // Gets the number of all tests.
- int total_test_count() const;
-
- // Gets the number of tests that should run.
- int test_to_run_count() const;
-
- // Gets the time of the test program start, in ms from the start of the
- // UNIX epoch.
- TimeInMillis start_timestamp() const { return start_timestamp_; }
-
- // Gets the elapsed time, in milliseconds.
- TimeInMillis elapsed_time() const { return elapsed_time_; }
-
- // Returns true iff the unit test passed (i.e. all test cases passed).
- bool Passed() const { return !Failed(); }
-
- // Returns true iff the unit test failed (i.e. some test case failed
- // or something outside of all tests failed).
- bool Failed() const {
- return failed_test_case_count() > 0 || ad_hoc_test_result()->Failed();
- }
-
- // Gets the i-th test case among all the test cases. i can range from 0 to
- // total_test_case_count() - 1. If i is not in that range, returns NULL.
- const TestCase* GetTestCase(int i) const {
- const int index = GetElementOr(test_case_indices_, i, -1);
- return index < 0 ? NULL : test_cases_[i];
- }
-
- // Gets the i-th test case among all the test cases. i can range from 0 to
- // total_test_case_count() - 1. If i is not in that range, returns NULL.
- TestCase* GetMutableTestCase(int i) {
- const int index = GetElementOr(test_case_indices_, i, -1);
- return index < 0 ? NULL : test_cases_[index];
- }
-
- // Provides access to the event listener list.
- TestEventListeners* listeners() { return &listeners_; }
-
- // Returns the TestResult for the test that's currently running, or
- // the TestResult for the ad hoc test if no test is running.
- TestResult* current_test_result();
-
- // Returns the TestResult for the ad hoc test.
- const TestResult* ad_hoc_test_result() const { return &ad_hoc_test_result_; }
-
- // Sets the OS stack trace getter.
- //
- // Does nothing if the input and the current OS stack trace getter
- // are the same; otherwise, deletes the old getter and makes the
- // input the current getter.
- void set_os_stack_trace_getter(OsStackTraceGetterInterface* getter);
-
- // Returns the current OS stack trace getter if it is not NULL;
- // otherwise, creates an OsStackTraceGetter, makes it the current
- // getter, and returns it.
- OsStackTraceGetterInterface* os_stack_trace_getter();
-
- // Returns the current OS stack trace as a String.
- //
- // The maximum number of stack frames to be included is specified by
- // the gtest_stack_trace_depth flag. The skip_count parameter
- // specifies the number of top frames to be skipped, which doesn't
- // count against the number of frames to be included.
- //
- // For example, if Foo() calls Bar(), which in turn calls
- // CurrentOsStackTraceExceptTop(1), Foo() will be included in the
- // trace but Bar() and CurrentOsStackTraceExceptTop() won't.
- String CurrentOsStackTraceExceptTop(int skip_count) GTEST_NO_INLINE_;
-
- // Finds and returns a TestCase with the given name. If one doesn't
- // exist, creates one and returns it.
- //
- // Arguments:
- //
- // test_case_name: name of the test case
- // type_param: the name of the test's type parameter, or NULL if
- // this is not a typed or a type-parameterized test.
- // set_up_tc: pointer to the function that sets up the test case
- // tear_down_tc: pointer to the function that tears down the test case
- TestCase* GetTestCase(const char* test_case_name,
- const char* type_param,
- Test::SetUpTestCaseFunc set_up_tc,
- Test::TearDownTestCaseFunc tear_down_tc);
-
- // Adds a TestInfo to the unit test.
- //
- // Arguments:
- //
- // set_up_tc: pointer to the function that sets up the test case
- // tear_down_tc: pointer to the function that tears down the test case
- // test_info: the TestInfo object
- void AddTestInfo(Test::SetUpTestCaseFunc set_up_tc,
- Test::TearDownTestCaseFunc tear_down_tc,
- TestInfo* test_info) {
- // In order to support thread-safe death tests, we need to
- // remember the original working directory when the test program
- // was first invoked. We cannot do this in RUN_ALL_TESTS(), as
- // the user may have changed the current directory before calling
- // RUN_ALL_TESTS(). Therefore we capture the current directory in
- // AddTestInfo(), which is called to register a TEST or TEST_F
- // before main() is reached.
- if (original_working_dir_.IsEmpty()) {
- original_working_dir_.Set(FilePath::GetCurrentDir());
- GTEST_CHECK_(!original_working_dir_.IsEmpty())
- << "Failed to get the current working directory.";
- }
-
- GetTestCase(test_info->test_case_name(),
- test_info->type_param(),
- set_up_tc,
- tear_down_tc)->AddTestInfo(test_info);
- }
-
-#if GTEST_HAS_PARAM_TEST
- // Returns ParameterizedTestCaseRegistry object used to keep track of
- // value-parameterized tests and instantiate and register them.
- internal::ParameterizedTestCaseRegistry& parameterized_test_registry() {
- return parameterized_test_registry_;
- }
-#endif // GTEST_HAS_PARAM_TEST
-
- // Sets the TestCase object for the test that's currently running.
- void set_current_test_case(TestCase* a_current_test_case) {
- current_test_case_ = a_current_test_case;
- }
-
- // Sets the TestInfo object for the test that's currently running. If
- // current_test_info is NULL, the assertion results will be stored in
- // ad_hoc_test_result_.
- void set_current_test_info(TestInfo* a_current_test_info) {
- current_test_info_ = a_current_test_info;
- }
-
- // Registers all parameterized tests defined using TEST_P and
- // INSTANTIATE_TEST_CASE_P, creating regular tests for each test/parameter
- // combination. This method can be called more then once; it has guards
- // protecting from registering the tests more then once. If
- // value-parameterized tests are disabled, RegisterParameterizedTests is
- // present but does nothing.
- void RegisterParameterizedTests();
-
- // Runs all tests in this UnitTest object, prints the result, and
- // returns true if all tests are successful. If any exception is
- // thrown during a test, this test is considered to be failed, but
- // the rest of the tests will still be run.
- bool RunAllTests();
-
- // Clears the results of all tests, except the ad hoc tests.
- void ClearNonAdHocTestResult() {
- ForEach(test_cases_, TestCase::ClearTestCaseResult);
- }
-
- // Clears the results of ad-hoc test assertions.
- void ClearAdHocTestResult() {
- ad_hoc_test_result_.Clear();
- }
-
- enum ReactionToSharding {
- HONOR_SHARDING_PROTOCOL,
- IGNORE_SHARDING_PROTOCOL
- };
-
- // Matches the full name of each test against the user-specified
- // filter to decide whether the test should run, then records the
- // result in each TestCase and TestInfo object.
- // If shard_tests == HONOR_SHARDING_PROTOCOL, further filters tests
- // based on sharding variables in the environment.
- // Returns the number of tests that should run.
- int FilterTests(ReactionToSharding shard_tests);
-
- // Prints the names of the tests matching the user-specified filter flag.
- void ListTestsMatchingFilter();
-
- const TestCase* current_test_case() const { return current_test_case_; }
- TestInfo* current_test_info() { return current_test_info_; }
- const TestInfo* current_test_info() const { return current_test_info_; }
-
- // Returns the vector of environments that need to be set-up/torn-down
- // before/after the tests are run.
- std::vector<Environment*>& environments() { return environments_; }
-
- // Getters for the per-thread Google Test trace stack.
- std::vector<TraceInfo>& gtest_trace_stack() {
- return *(gtest_trace_stack_.pointer());
- }
- const std::vector<TraceInfo>& gtest_trace_stack() const {
- return gtest_trace_stack_.get();
- }
-
-#if GTEST_HAS_DEATH_TEST
- void InitDeathTestSubprocessControlInfo() {
- internal_run_death_test_flag_.reset(ParseInternalRunDeathTestFlag());
- }
- // Returns a pointer to the parsed --gtest_internal_run_death_test
- // flag, or NULL if that flag was not specified.
- // This information is useful only in a death test child process.
- // Must not be called before a call to InitGoogleTest.
- const InternalRunDeathTestFlag* internal_run_death_test_flag() const {
- return internal_run_death_test_flag_.get();
- }
-
- // Returns a pointer to the current death test factory.
- internal::DeathTestFactory* death_test_factory() {
- return death_test_factory_.get();
- }
-
- void SuppressTestEventsIfInSubprocess();
-
- friend class ReplaceDeathTestFactory;
-#endif // GTEST_HAS_DEATH_TEST
-
- // Initializes the event listener performing XML output as specified by
- // UnitTestOptions. Must not be called before InitGoogleTest.
- void ConfigureXmlOutput();
-
-#if GTEST_CAN_STREAM_RESULTS_
- // Initializes the event listener for streaming test results to a socket.
- // Must not be called before InitGoogleTest.
- void ConfigureStreamingOutput();
-#endif
-
- // Performs initialization dependent upon flag values obtained in
- // ParseGoogleTestFlagsOnly. Is called from InitGoogleTest after the call to
- // ParseGoogleTestFlagsOnly. In case a user neglects to call InitGoogleTest
- // this function is also called from RunAllTests. Since this function can be
- // called more than once, it has to be idempotent.
- void PostFlagParsingInit();
-
- // Gets the random seed used at the start of the current test iteration.
- int random_seed() const { return random_seed_; }
-
- // Gets the random number generator.
- internal::Random* random() { return &random_; }
-
- // Shuffles all test cases, and the tests within each test case,
- // making sure that death tests are still run first.
- void ShuffleTests();
-
- // Restores the test cases and tests to their order before the first shuffle.
- void UnshuffleTests();
-
- // Returns the value of GTEST_FLAG(catch_exceptions) at the moment
- // UnitTest::Run() starts.
- bool catch_exceptions() const { return catch_exceptions_; }
-
- private:
- friend class ::testing::UnitTest;
-
- // Used by UnitTest::Run() to capture the state of
- // GTEST_FLAG(catch_exceptions) at the moment it starts.
- void set_catch_exceptions(bool value) { catch_exceptions_ = value; }
-
- // The UnitTest object that owns this implementation object.
- UnitTest* const parent_;
-
- // The working directory when the first TEST() or TEST_F() was
- // executed.
- internal::FilePath original_working_dir_;
-
- // The default test part result reporters.
- DefaultGlobalTestPartResultReporter default_global_test_part_result_reporter_;
- DefaultPerThreadTestPartResultReporter
- default_per_thread_test_part_result_reporter_;
-
- // Points to (but doesn't own) the global test part result reporter.
- TestPartResultReporterInterface* global_test_part_result_repoter_;
-
- // Protects read and write access to global_test_part_result_reporter_.
- internal::Mutex global_test_part_result_reporter_mutex_;
-
- // Points to (but doesn't own) the per-thread test part result reporter.
- internal::ThreadLocal<TestPartResultReporterInterface*>
- per_thread_test_part_result_reporter_;
-
- // The vector of environments that need to be set-up/torn-down
- // before/after the tests are run.
- std::vector<Environment*> environments_;
-
- // The vector of TestCases in their original order. It owns the
- // elements in the vector.
- std::vector<TestCase*> test_cases_;
-
- // Provides a level of indirection for the test case list to allow
- // easy shuffling and restoring the test case order. The i-th
- // element of this vector is the index of the i-th test case in the
- // shuffled order.
- std::vector<int> test_case_indices_;
-
-#if GTEST_HAS_PARAM_TEST
- // ParameterizedTestRegistry object used to register value-parameterized
- // tests.
- internal::ParameterizedTestCaseRegistry parameterized_test_registry_;
-
- // Indicates whether RegisterParameterizedTests() has been called already.
- bool parameterized_tests_registered_;
-#endif // GTEST_HAS_PARAM_TEST
-
- // Index of the last death test case registered. Initially -1.
- int last_death_test_case_;
-
- // This points to the TestCase for the currently running test. It
- // changes as Google Test goes through one test case after another.
- // When no test is running, this is set to NULL and Google Test
- // stores assertion results in ad_hoc_test_result_. Initially NULL.
- TestCase* current_test_case_;
-
- // This points to the TestInfo for the currently running test. It
- // changes as Google Test goes through one test after another. When
- // no test is running, this is set to NULL and Google Test stores
- // assertion results in ad_hoc_test_result_. Initially NULL.
- TestInfo* current_test_info_;
-
- // Normally, a user only writes assertions inside a TEST or TEST_F,
- // or inside a function called by a TEST or TEST_F. Since Google
- // Test keeps track of which test is current running, it can
- // associate such an assertion with the test it belongs to.
- //
- // If an assertion is encountered when no TEST or TEST_F is running,
- // Google Test attributes the assertion result to an imaginary "ad hoc"
- // test, and records the result in ad_hoc_test_result_.
- TestResult ad_hoc_test_result_;
-
- // The list of event listeners that can be used to track events inside
- // Google Test.
- TestEventListeners listeners_;
-
- // The OS stack trace getter. Will be deleted when the UnitTest
- // object is destructed. By default, an OsStackTraceGetter is used,
- // but the user can set this field to use a custom getter if that is
- // desired.
- OsStackTraceGetterInterface* os_stack_trace_getter_;
-
- // True iff PostFlagParsingInit() has been called.
- bool post_flag_parse_init_performed_;
-
- // The random number seed used at the beginning of the test run.
- int random_seed_;
-
- // Our random number generator.
- internal::Random random_;
-
- // The time of the test program start, in ms from the start of the
- // UNIX epoch.
- TimeInMillis start_timestamp_;
-
- // How long the test took to run, in milliseconds.
- TimeInMillis elapsed_time_;
-
-#if GTEST_HAS_DEATH_TEST
- // The decomposed components of the gtest_internal_run_death_test flag,
- // parsed when RUN_ALL_TESTS is called.
- internal::scoped_ptr<InternalRunDeathTestFlag> internal_run_death_test_flag_;
- internal::scoped_ptr<internal::DeathTestFactory> death_test_factory_;
-#endif // GTEST_HAS_DEATH_TEST
-
- // A per-thread stack of traces created by the SCOPED_TRACE() macro.
- internal::ThreadLocal<std::vector<TraceInfo> > gtest_trace_stack_;
-
- // The value of GTEST_FLAG(catch_exceptions) at the moment RunAllTests()
- // starts.
- bool catch_exceptions_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(UnitTestImpl);
-}; // class UnitTestImpl
-
-// Convenience function for accessing the global UnitTest
-// implementation object.
-inline UnitTestImpl* GetUnitTestImpl() {
- return UnitTest::GetInstance()->impl();
-}
-
-#if GTEST_USES_SIMPLE_RE
-
-// Internal helper functions for implementing the simple regular
-// expression matcher.
-GTEST_API_ bool IsInSet(char ch, const char* str);
-GTEST_API_ bool IsAsciiDigit(char ch);
-GTEST_API_ bool IsAsciiPunct(char ch);
-GTEST_API_ bool IsRepeat(char ch);
-GTEST_API_ bool IsAsciiWhiteSpace(char ch);
-GTEST_API_ bool IsAsciiWordChar(char ch);
-GTEST_API_ bool IsValidEscape(char ch);
-GTEST_API_ bool AtomMatchesChar(bool escaped, char pattern, char ch);
-GTEST_API_ bool ValidateRegex(const char* regex);
-GTEST_API_ bool MatchRegexAtHead(const char* regex, const char* str);
-GTEST_API_ bool MatchRepetitionAndRegexAtHead(
- bool escaped, char ch, char repeat, const char* regex, const char* str);
-GTEST_API_ bool MatchRegexAnywhere(const char* regex, const char* str);
-
-#endif // GTEST_USES_SIMPLE_RE
-
-// Parses the command line for Google Test flags, without initializing
-// other parts of Google Test.
-GTEST_API_ void ParseGoogleTestFlagsOnly(int* argc, char** argv);
-GTEST_API_ void ParseGoogleTestFlagsOnly(int* argc, wchar_t** argv);
-
-#if GTEST_HAS_DEATH_TEST
-
-// Returns the message describing the last system error, regardless of the
-// platform.
-GTEST_API_ String GetLastErrnoDescription();
-
-# if GTEST_OS_WINDOWS
-// Provides leak-safe Windows kernel handle ownership.
-class AutoHandle {
- public:
- AutoHandle() : handle_(INVALID_HANDLE_VALUE) {}
- explicit AutoHandle(HANDLE handle) : handle_(handle) {}
-
- ~AutoHandle() { Reset(); }
-
- HANDLE Get() const { return handle_; }
- void Reset() { Reset(INVALID_HANDLE_VALUE); }
- void Reset(HANDLE handle) {
- if (handle != handle_) {
- if (handle_ != INVALID_HANDLE_VALUE)
- ::CloseHandle(handle_);
- handle_ = handle;
- }
- }
-
- private:
- HANDLE handle_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(AutoHandle);
-};
-# endif // GTEST_OS_WINDOWS
-
-// Attempts to parse a string into a positive integer pointed to by the
-// number parameter. Returns true if that is possible.
-// GTEST_HAS_DEATH_TEST implies that we have ::std::string, so we can use
-// it here.
-template <typename Integer>
-bool ParseNaturalNumber(const ::std::string& str, Integer* number) {
- // Fail fast if the given string does not begin with a digit;
- // this bypasses strtoXXX's "optional leading whitespace and plus
- // or minus sign" semantics, which are undesirable here.
- if (str.empty() || !IsDigit(str[0])) {
- return false;
- }
- errno = 0;
-
- char* end;
- // BiggestConvertible is the largest integer type that system-provided
- // string-to-number conversion routines can return.
-
-# if GTEST_OS_WINDOWS && !defined(__GNUC__)
-
- // MSVC and C++ Builder define __int64 instead of the standard long long.
- typedef unsigned __int64 BiggestConvertible;
- const BiggestConvertible parsed = _strtoui64(str.c_str(), &end, 10);
-
-# else
-
- typedef unsigned long long BiggestConvertible; // NOLINT
- const BiggestConvertible parsed = strtoull(str.c_str(), &end, 10);
-
-# endif // GTEST_OS_WINDOWS && !defined(__GNUC__)
-
- const bool parse_success = *end == '\0' && errno == 0;
-
- // TODO(vladl@google.com): Convert this to compile time assertion when it is
- // available.
- GTEST_CHECK_(sizeof(Integer) <= sizeof(parsed));
-
- const Integer result = static_cast<Integer>(parsed);
- if (parse_success && static_cast<BiggestConvertible>(result) == parsed) {
- *number = result;
- return true;
- }
- return false;
-}
-#endif // GTEST_HAS_DEATH_TEST
-
-// TestResult contains some private methods that should be hidden from
-// Google Test user but are required for testing. This class allow our tests
-// to access them.
-//
-// This class is supplied only for the purpose of testing Google Test's own
-// constructs. Do not use it in user tests, either directly or indirectly.
-class TestResultAccessor {
- public:
- static void RecordProperty(TestResult* test_result,
- const TestProperty& property) {
- test_result->RecordProperty(property);
- }
-
- static void ClearTestPartResults(TestResult* test_result) {
- test_result->ClearTestPartResults();
- }
-
- static const std::vector<testing::TestPartResult>& test_part_results(
- const TestResult& test_result) {
- return test_result.test_part_results();
- }
-};
-
-} // namespace internal
-} // namespace testing
-
-#endif // GTEST_SRC_GTEST_INTERNAL_INL_H_
diff --git a/src/testing/gtest/src/gtest-port.cc b/src/testing/gtest/src/gtest-port.cc
deleted file mode 100644
index a0e2d7c7..00000000
--- a/src/testing/gtest/src/gtest-port.cc
+++ /dev/null
@@ -1,787 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-#include "gtest/internal/gtest-port.h"
-
-#include <limits.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#if GTEST_OS_WINDOWS_MOBILE
-# include <windows.h> // For TerminateProcess()
-#elif GTEST_OS_WINDOWS
-# include <io.h>
-# include <sys/stat.h>
-#else
-# include <unistd.h>
-#endif // GTEST_OS_WINDOWS_MOBILE
-
-#if GTEST_OS_MAC
-# include <mach/mach_init.h>
-# include <mach/task.h>
-# include <mach/vm_map.h>
-#endif // GTEST_OS_MAC
-
-#if GTEST_OS_QNX
-# include <devctl.h>
-# include <sys/procfs.h>
-#endif // GTEST_OS_QNX
-
-#include "gtest/gtest-spi.h"
-#include "gtest/gtest-message.h"
-#include "gtest/internal/gtest-internal.h"
-#include "gtest/internal/gtest-string.h"
-
-// Indicates that this translation unit is part of Google Test's
-// implementation. It must come before gtest-internal-inl.h is
-// included, or there will be a compiler error. This trick is to
-// prevent a user from accidentally including gtest-internal-inl.h in
-// his code.
-#define GTEST_IMPLEMENTATION_ 1
-#include "src/gtest-internal-inl.h"
-#undef GTEST_IMPLEMENTATION_
-
-namespace testing {
-namespace internal {
-
-#if defined(_MSC_VER) || defined(__BORLANDC__)
-// MSVC and C++Builder do not provide a definition of STDERR_FILENO.
-const int kStdOutFileno = 1;
-const int kStdErrFileno = 2;
-#else
-const int kStdOutFileno = STDOUT_FILENO;
-const int kStdErrFileno = STDERR_FILENO;
-#endif // _MSC_VER
-
-#if GTEST_OS_MAC
-
-// Returns the number of threads running in the process, or 0 to indicate that
-// we cannot detect it.
-size_t GetThreadCount() {
- const task_t task = mach_task_self();
- mach_msg_type_number_t thread_count;
- thread_act_array_t thread_list;
- const kern_return_t status = task_threads(task, &thread_list, &thread_count);
- if (status == KERN_SUCCESS) {
- // task_threads allocates resources in thread_list and we need to free them
- // to avoid leaks.
- vm_deallocate(task,
- reinterpret_cast<vm_address_t>(thread_list),
- sizeof(thread_t) * thread_count);
- return static_cast<size_t>(thread_count);
- } else {
- return 0;
- }
-}
-
-#elif GTEST_OS_QNX
-
-// Returns the number of threads running in the process, or 0 to indicate that
-// we cannot detect it.
-size_t GetThreadCount() {
- const int fd = open("/proc/self/as", O_RDONLY);
- if (fd < 0) {
- return 0;
- }
- procfs_info process_info;
- const int status =
- devctl(fd, DCMD_PROC_INFO, &process_info, sizeof(process_info), NULL);
- close(fd);
- if (status == EOK) {
- return static_cast<size_t>(process_info.num_threads);
- } else {
- return 0;
- }
-}
-
-#else
-
-size_t GetThreadCount() {
- // There's no portable way to detect the number of threads, so we just
- // return 0 to indicate that we cannot detect it.
- return 0;
-}
-
-#endif // GTEST_OS_MAC
-
-#if GTEST_USES_POSIX_RE
-
-// Implements RE. Currently only needed for death tests.
-
-RE::~RE() {
- if (is_valid_) {
- // regfree'ing an invalid regex might crash because the content
- // of the regex is undefined. Since the regex's are essentially
- // the same, one cannot be valid (or invalid) without the other
- // being so too.
- regfree(&partial_regex_);
- regfree(&full_regex_);
- }
- free(const_cast<char*>(pattern_));
-}
-
-// Returns true iff regular expression re matches the entire str.
-bool RE::FullMatch(const char* str, const RE& re) {
- if (!re.is_valid_) return false;
-
- regmatch_t match;
- return regexec(&re.full_regex_, str, 1, &match, 0) == 0;
-}
-
-// Returns true iff regular expression re matches a substring of str
-// (including str itself).
-bool RE::PartialMatch(const char* str, const RE& re) {
- if (!re.is_valid_) return false;
-
- regmatch_t match;
- return regexec(&re.partial_regex_, str, 1, &match, 0) == 0;
-}
-
-// Initializes an RE from its string representation.
-void RE::Init(const char* regex) {
- pattern_ = posix::StrDup(regex);
-
- // Reserves enough bytes to hold the regular expression used for a
- // full match.
- const size_t full_regex_len = strlen(regex) + 10;
- char* const full_pattern = new char[full_regex_len];
-
- snprintf(full_pattern, full_regex_len, "^(%s)$", regex);
- is_valid_ = regcomp(&full_regex_, full_pattern, REG_EXTENDED) == 0;
- // We want to call regcomp(&partial_regex_, ...) even if the
- // previous expression returns false. Otherwise partial_regex_ may
- // not be properly initialized can may cause trouble when it's
- // freed.
- //
- // Some implementation of POSIX regex (e.g. on at least some
- // versions of Cygwin) doesn't accept the empty string as a valid
- // regex. We change it to an equivalent form "()" to be safe.
- if (is_valid_) {
- const char* const partial_regex = (*regex == '\0') ? "()" : regex;
- is_valid_ = regcomp(&partial_regex_, partial_regex, REG_EXTENDED) == 0;
- }
- EXPECT_TRUE(is_valid_)
- << "Regular expression \"" << regex
- << "\" is not a valid POSIX Extended regular expression.";
-
- delete[] full_pattern;
-}
-
-#elif GTEST_USES_SIMPLE_RE
-
-// Returns true iff ch appears anywhere in str (excluding the
-// terminating '\0' character).
-bool IsInSet(char ch, const char* str) {
- return ch != '\0' && strchr(str, ch) != NULL;
-}
-
-// Returns true iff ch belongs to the given classification. Unlike
-// similar functions in <ctype.h>, these aren't affected by the
-// current locale.
-bool IsAsciiDigit(char ch) { return '0' <= ch && ch <= '9'; }
-bool IsAsciiPunct(char ch) {
- return IsInSet(ch, "^-!\"#$%&'()*+,./:;<=>?@[\\]_`{|}~");
-}
-bool IsRepeat(char ch) { return IsInSet(ch, "?*+"); }
-bool IsAsciiWhiteSpace(char ch) { return IsInSet(ch, " \f\n\r\t\v"); }
-bool IsAsciiWordChar(char ch) {
- return ('a' <= ch && ch <= 'z') || ('A' <= ch && ch <= 'Z') ||
- ('0' <= ch && ch <= '9') || ch == '_';
-}
-
-// Returns true iff "\\c" is a supported escape sequence.
-bool IsValidEscape(char c) {
- return (IsAsciiPunct(c) || IsInSet(c, "dDfnrsStvwW"));
-}
-
-// Returns true iff the given atom (specified by escaped and pattern)
-// matches ch. The result is undefined if the atom is invalid.
-bool AtomMatchesChar(bool escaped, char pattern_char, char ch) {
- if (escaped) { // "\\p" where p is pattern_char.
- switch (pattern_char) {
- case 'd': return IsAsciiDigit(ch);
- case 'D': return !IsAsciiDigit(ch);
- case 'f': return ch == '\f';
- case 'n': return ch == '\n';
- case 'r': return ch == '\r';
- case 's': return IsAsciiWhiteSpace(ch);
- case 'S': return !IsAsciiWhiteSpace(ch);
- case 't': return ch == '\t';
- case 'v': return ch == '\v';
- case 'w': return IsAsciiWordChar(ch);
- case 'W': return !IsAsciiWordChar(ch);
- }
- return IsAsciiPunct(pattern_char) && pattern_char == ch;
- }
-
- return (pattern_char == '.' && ch != '\n') || pattern_char == ch;
-}
-
-// Helper function used by ValidateRegex() to format error messages.
-String FormatRegexSyntaxError(const char* regex, int index) {
- return (Message() << "Syntax error at index " << index
- << " in simple regular expression \"" << regex << "\": ").GetString();
-}
-
-// Generates non-fatal failures and returns false if regex is invalid;
-// otherwise returns true.
-bool ValidateRegex(const char* regex) {
- if (regex == NULL) {
- // TODO(wan@google.com): fix the source file location in the
- // assertion failures to match where the regex is used in user
- // code.
- ADD_FAILURE() << "NULL is not a valid simple regular expression.";
- return false;
- }
-
- bool is_valid = true;
-
- // True iff ?, *, or + can follow the previous atom.
- bool prev_repeatable = false;
- for (int i = 0; regex[i]; i++) {
- if (regex[i] == '\\') { // An escape sequence
- i++;
- if (regex[i] == '\0') {
- ADD_FAILURE() << FormatRegexSyntaxError(regex, i - 1)
- << "'\\' cannot appear at the end.";
- return false;
- }
-
- if (!IsValidEscape(regex[i])) {
- ADD_FAILURE() << FormatRegexSyntaxError(regex, i - 1)
- << "invalid escape sequence \"\\" << regex[i] << "\".";
- is_valid = false;
- }
- prev_repeatable = true;
- } else { // Not an escape sequence.
- const char ch = regex[i];
-
- if (ch == '^' && i > 0) {
- ADD_FAILURE() << FormatRegexSyntaxError(regex, i)
- << "'^' can only appear at the beginning.";
- is_valid = false;
- } else if (ch == '$' && regex[i + 1] != '\0') {
- ADD_FAILURE() << FormatRegexSyntaxError(regex, i)
- << "'$' can only appear at the end.";
- is_valid = false;
- } else if (IsInSet(ch, "()[]{}|")) {
- ADD_FAILURE() << FormatRegexSyntaxError(regex, i)
- << "'" << ch << "' is unsupported.";
- is_valid = false;
- } else if (IsRepeat(ch) && !prev_repeatable) {
- ADD_FAILURE() << FormatRegexSyntaxError(regex, i)
- << "'" << ch << "' can only follow a repeatable token.";
- is_valid = false;
- }
-
- prev_repeatable = !IsInSet(ch, "^$?*+");
- }
- }
-
- return is_valid;
-}
-
-// Matches a repeated regex atom followed by a valid simple regular
-// expression. The regex atom is defined as c if escaped is false,
-// or \c otherwise. repeat is the repetition meta character (?, *,
-// or +). The behavior is undefined if str contains too many
-// characters to be indexable by size_t, in which case the test will
-// probably time out anyway. We are fine with this limitation as
-// std::string has it too.
-bool MatchRepetitionAndRegexAtHead(
- bool escaped, char c, char repeat, const char* regex,
- const char* str) {
- const size_t min_count = (repeat == '+') ? 1 : 0;
- const size_t max_count = (repeat == '?') ? 1 :
- static_cast<size_t>(-1) - 1;
- // We cannot call numeric_limits::max() as it conflicts with the
- // max() macro on Windows.
-
- for (size_t i = 0; i <= max_count; ++i) {
- // We know that the atom matches each of the first i characters in str.
- if (i >= min_count && MatchRegexAtHead(regex, str + i)) {
- // We have enough matches at the head, and the tail matches too.
- // Since we only care about *whether* the pattern matches str
- // (as opposed to *how* it matches), there is no need to find a
- // greedy match.
- return true;
- }
- if (str[i] == '\0' || !AtomMatchesChar(escaped, c, str[i]))
- return false;
- }
- return false;
-}
-
-// Returns true iff regex matches a prefix of str. regex must be a
-// valid simple regular expression and not start with "^", or the
-// result is undefined.
-bool MatchRegexAtHead(const char* regex, const char* str) {
- if (*regex == '\0') // An empty regex matches a prefix of anything.
- return true;
-
- // "$" only matches the end of a string. Note that regex being
- // valid guarantees that there's nothing after "$" in it.
- if (*regex == '$')
- return *str == '\0';
-
- // Is the first thing in regex an escape sequence?
- const bool escaped = *regex == '\\';
- if (escaped)
- ++regex;
- if (IsRepeat(regex[1])) {
- // MatchRepetitionAndRegexAtHead() calls MatchRegexAtHead(), so
- // here's an indirect recursion. It terminates as the regex gets
- // shorter in each recursion.
- return MatchRepetitionAndRegexAtHead(
- escaped, regex[0], regex[1], regex + 2, str);
- } else {
- // regex isn't empty, isn't "$", and doesn't start with a
- // repetition. We match the first atom of regex with the first
- // character of str and recurse.
- return (*str != '\0') && AtomMatchesChar(escaped, *regex, *str) &&
- MatchRegexAtHead(regex + 1, str + 1);
- }
-}
-
-// Returns true iff regex matches any substring of str. regex must be
-// a valid simple regular expression, or the result is undefined.
-//
-// The algorithm is recursive, but the recursion depth doesn't exceed
-// the regex length, so we won't need to worry about running out of
-// stack space normally. In rare cases the time complexity can be
-// exponential with respect to the regex length + the string length,
-// but usually it's must faster (often close to linear).
-bool MatchRegexAnywhere(const char* regex, const char* str) {
- if (regex == NULL || str == NULL)
- return false;
-
- if (*regex == '^')
- return MatchRegexAtHead(regex + 1, str);
-
- // A successful match can be anywhere in str.
- do {
- if (MatchRegexAtHead(regex, str))
- return true;
- } while (*str++ != '\0');
- return false;
-}
-
-// Implements the RE class.
-
-RE::~RE() {
- free(const_cast<char*>(pattern_));
- free(const_cast<char*>(full_pattern_));
-}
-
-// Returns true iff regular expression re matches the entire str.
-bool RE::FullMatch(const char* str, const RE& re) {
- return re.is_valid_ && MatchRegexAnywhere(re.full_pattern_, str);
-}
-
-// Returns true iff regular expression re matches a substring of str
-// (including str itself).
-bool RE::PartialMatch(const char* str, const RE& re) {
- return re.is_valid_ && MatchRegexAnywhere(re.pattern_, str);
-}
-
-// Initializes an RE from its string representation.
-void RE::Init(const char* regex) {
- pattern_ = full_pattern_ = NULL;
- if (regex != NULL) {
- pattern_ = posix::StrDup(regex);
- }
-
- is_valid_ = ValidateRegex(regex);
- if (!is_valid_) {
- // No need to calculate the full pattern when the regex is invalid.
- return;
- }
-
- const size_t len = strlen(regex);
- // Reserves enough bytes to hold the regular expression used for a
- // full match: we need space to prepend a '^', append a '$', and
- // terminate the string with '\0'.
- char* buffer = static_cast<char*>(malloc(len + 3));
- full_pattern_ = buffer;
-
- if (*regex != '^')
- *buffer++ = '^'; // Makes sure full_pattern_ starts with '^'.
-
- // We don't use snprintf or strncpy, as they trigger a warning when
- // compiled with VC++ 8.0.
- memcpy(buffer, regex, len);
- buffer += len;
-
- if (len == 0 || regex[len - 1] != '$')
- *buffer++ = '$'; // Makes sure full_pattern_ ends with '$'.
-
- *buffer = '\0';
-}
-
-#endif // GTEST_USES_POSIX_RE
-
-const char kUnknownFile[] = "unknown file";
-
-// Formats a source file path and a line number as they would appear
-// in an error message from the compiler used to compile this code.
-GTEST_API_ ::std::string FormatFileLocation(const char* file, int line) {
- const char* const file_name = file == NULL ? kUnknownFile : file;
-
- if (line < 0) {
- return String::Format("%s:", file_name).c_str();
- }
-#ifdef _MSC_VER
- return String::Format("%s(%d):", file_name, line).c_str();
-#else
- return String::Format("%s:%d:", file_name, line).c_str();
-#endif // _MSC_VER
-}
-
-// Formats a file location for compiler-independent XML output.
-// Although this function is not platform dependent, we put it next to
-// FormatFileLocation in order to contrast the two functions.
-// Note that FormatCompilerIndependentFileLocation() does NOT append colon
-// to the file location it produces, unlike FormatFileLocation().
-GTEST_API_ ::std::string FormatCompilerIndependentFileLocation(
- const char* file, int line) {
- const char* const file_name = file == NULL ? kUnknownFile : file;
-
- if (line < 0)
- return file_name;
- else
- return String::Format("%s:%d", file_name, line).c_str();
-}
-
-
-GTestLog::GTestLog(GTestLogSeverity severity, const char* file, int line)
- : severity_(severity) {
- const char* const marker =
- severity == GTEST_INFO ? "[ INFO ]" :
- severity == GTEST_WARNING ? "[WARNING]" :
- severity == GTEST_ERROR ? "[ ERROR ]" : "[ FATAL ]";
- GetStream() << ::std::endl << marker << " "
- << FormatFileLocation(file, line).c_str() << ": ";
-}
-
-// Flushes the buffers and, if severity is GTEST_FATAL, aborts the program.
-GTestLog::~GTestLog() {
- GetStream() << ::std::endl;
- if (severity_ == GTEST_FATAL) {
- fflush(stderr);
- posix::Abort();
- }
-}
-// Disable Microsoft deprecation warnings for POSIX functions called from
-// this class (creat, dup, dup2, and close)
-#ifdef _MSC_VER
-# pragma warning(push)
-# pragma warning(disable: 4996)
-#endif // _MSC_VER
-
-#if GTEST_HAS_STREAM_REDIRECTION
-
-// Object that captures an output stream (stdout/stderr).
-class CapturedStream {
- public:
- // The ctor redirects the stream to a temporary file.
- CapturedStream(int fd) : fd_(fd), uncaptured_fd_(dup(fd)) {
-# if GTEST_OS_WINDOWS
- char temp_dir_path[MAX_PATH + 1] = { '\0' }; // NOLINT
- char temp_file_path[MAX_PATH + 1] = { '\0' }; // NOLINT
-
- ::GetTempPathA(sizeof(temp_dir_path), temp_dir_path);
- const UINT success = ::GetTempFileNameA(temp_dir_path,
- "gtest_redir",
- 0, // Generate unique file name.
- temp_file_path);
- GTEST_CHECK_(success != 0)
- << "Unable to create a temporary file in " << temp_dir_path;
- const int captured_fd = creat(temp_file_path, _S_IREAD | _S_IWRITE);
- GTEST_CHECK_(captured_fd != -1) << "Unable to open temporary file "
- << temp_file_path;
- filename_ = temp_file_path;
-# else
- // There's no guarantee that a test has write access to the current
- // directory, so we create the temporary file in the /tmp directory instead.
- // We use /tmp on most systems, and /mnt/sdcard on Android. That's because
- // Android doesn't have /tmp.
-# if GTEST_OS_LINUX_ANDROID
- char name_template[] = "/mnt/sdcard/gtest_captured_stream.XXXXXX";
-# else
- char name_template[] = "/tmp/captured_stream.XXXXXX";
-# endif // GTEST_OS_LINUX_ANDROID
- const int captured_fd = mkstemp(name_template);
- filename_ = name_template;
-# endif // GTEST_OS_WINDOWS
- fflush(NULL);
- dup2(captured_fd, fd_);
- close(captured_fd);
- }
-
- ~CapturedStream() {
- remove(filename_.c_str());
- }
-
- String GetCapturedString() {
- if (uncaptured_fd_ != -1) {
- // Restores the original stream.
- fflush(NULL);
- dup2(uncaptured_fd_, fd_);
- close(uncaptured_fd_);
- uncaptured_fd_ = -1;
- }
-
- FILE* const file = posix::FOpen(filename_.c_str(), "r");
- const String content = ReadEntireFile(file);
- posix::FClose(file);
- return content;
- }
-
- private:
- // Reads the entire content of a file as a String.
- static String ReadEntireFile(FILE* file);
-
- // Returns the size (in bytes) of a file.
- static size_t GetFileSize(FILE* file);
-
- const int fd_; // A stream to capture.
- int uncaptured_fd_;
- // Name of the temporary file holding the stderr output.
- ::std::string filename_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(CapturedStream);
-};
-
-// Returns the size (in bytes) of a file.
-size_t CapturedStream::GetFileSize(FILE* file) {
- fseek(file, 0, SEEK_END);
- return static_cast<size_t>(ftell(file));
-}
-
-// Reads the entire content of a file as a string.
-String CapturedStream::ReadEntireFile(FILE* file) {
- const size_t file_size = GetFileSize(file);
- char* const buffer = new char[file_size];
-
- size_t bytes_last_read = 0; // # of bytes read in the last fread()
- size_t bytes_read = 0; // # of bytes read so far
-
- fseek(file, 0, SEEK_SET);
-
- // Keeps reading the file until we cannot read further or the
- // pre-determined file size is reached.
- do {
- bytes_last_read = fread(buffer+bytes_read, 1, file_size-bytes_read, file);
- bytes_read += bytes_last_read;
- } while (bytes_last_read > 0 && bytes_read < file_size);
-
- const String content(buffer, bytes_read);
- delete[] buffer;
-
- return content;
-}
-
-# ifdef _MSC_VER
-# pragma warning(pop)
-# endif // _MSC_VER
-
-static CapturedStream* g_captured_stderr = NULL;
-static CapturedStream* g_captured_stdout = NULL;
-
-// Starts capturing an output stream (stdout/stderr).
-void CaptureStream(int fd, const char* stream_name, CapturedStream** stream) {
- if (*stream != NULL) {
- GTEST_LOG_(FATAL) << "Only one " << stream_name
- << " capturer can exist at a time.";
- }
- *stream = new CapturedStream(fd);
-}
-
-// Stops capturing the output stream and returns the captured string.
-String GetCapturedStream(CapturedStream** captured_stream) {
- const String content = (*captured_stream)->GetCapturedString();
-
- delete *captured_stream;
- *captured_stream = NULL;
-
- return content;
-}
-
-// Starts capturing stdout.
-void CaptureStdout() {
- CaptureStream(kStdOutFileno, "stdout", &g_captured_stdout);
-}
-
-// Starts capturing stderr.
-void CaptureStderr() {
- CaptureStream(kStdErrFileno, "stderr", &g_captured_stderr);
-}
-
-// Stops capturing stdout and returns the captured string.
-String GetCapturedStdout() { return GetCapturedStream(&g_captured_stdout); }
-
-// Stops capturing stderr and returns the captured string.
-String GetCapturedStderr() { return GetCapturedStream(&g_captured_stderr); }
-
-#endif // GTEST_HAS_STREAM_REDIRECTION
-
-#if GTEST_HAS_DEATH_TEST
-
-// A copy of all command line arguments. Set by InitGoogleTest().
-::std::vector<testing::internal::string> g_argvs;
-
-static const ::std::vector<testing::internal::string>* g_injected_test_argvs =
- NULL; // Owned.
-
-void SetInjectableArgvs(const ::std::vector<testing::internal::string>* argvs) {
- if (g_injected_test_argvs != argvs)
- delete g_injected_test_argvs;
- g_injected_test_argvs = argvs;
-}
-
-const ::std::vector<testing::internal::string>& GetInjectableArgvs() {
- if (g_injected_test_argvs != NULL) {
- return *g_injected_test_argvs;
- }
- return g_argvs;
-}
-#endif // GTEST_HAS_DEATH_TEST
-
-#if GTEST_OS_WINDOWS_MOBILE
-namespace posix {
-void Abort() {
- DebugBreak();
- TerminateProcess(GetCurrentProcess(), 1);
-}
-} // namespace posix
-#endif // GTEST_OS_WINDOWS_MOBILE
-
-// Returns the name of the environment variable corresponding to the
-// given flag. For example, FlagToEnvVar("foo") will return
-// "GTEST_FOO" in the open-source version.
-static String FlagToEnvVar(const char* flag) {
- const String full_flag =
- (Message() << GTEST_FLAG_PREFIX_ << flag).GetString();
-
- Message env_var;
- for (size_t i = 0; i != full_flag.length(); i++) {
- env_var << ToUpper(full_flag.c_str()[i]);
- }
-
- return env_var.GetString();
-}
-
-// Parses 'str' for a 32-bit signed integer. If successful, writes
-// the result to *value and returns true; otherwise leaves *value
-// unchanged and returns false.
-bool ParseInt32(const Message& src_text, const char* str, Int32* value) {
- // Parses the environment variable as a decimal integer.
- char* end = NULL;
- const long long_value = strtol(str, &end, 10); // NOLINT
-
- // Has strtol() consumed all characters in the string?
- if (*end != '\0') {
- // No - an invalid character was encountered.
- Message msg;
- msg << "WARNING: " << src_text
- << " is expected to be a 32-bit integer, but actually"
- << " has value \"" << str << "\".\n";
- printf("%s", msg.GetString().c_str());
- fflush(stdout);
- return false;
- }
-
- // Is the parsed value in the range of an Int32?
- const Int32 result = static_cast<Int32>(long_value);
- if (long_value == LONG_MAX || long_value == LONG_MIN ||
- // The parsed value overflows as a long. (strtol() returns
- // LONG_MAX or LONG_MIN when the input overflows.)
- result != long_value
- // The parsed value overflows as an Int32.
- ) {
- Message msg;
- msg << "WARNING: " << src_text
- << " is expected to be a 32-bit integer, but actually"
- << " has value " << str << ", which overflows.\n";
- printf("%s", msg.GetString().c_str());
- fflush(stdout);
- return false;
- }
-
- *value = result;
- return true;
-}
-
-// Reads and returns the Boolean environment variable corresponding to
-// the given flag; if it's not set, returns default_value.
-//
-// The value is considered true iff it's not "0".
-bool BoolFromGTestEnv(const char* flag, bool default_value) {
- const String env_var = FlagToEnvVar(flag);
- const char* const string_value = posix::GetEnv(env_var.c_str());
- return string_value == NULL ?
- default_value : strcmp(string_value, "0") != 0;
-}
-
-// Reads and returns a 32-bit integer stored in the environment
-// variable corresponding to the given flag; if it isn't set or
-// doesn't represent a valid 32-bit integer, returns default_value.
-Int32 Int32FromGTestEnv(const char* flag, Int32 default_value) {
- const String env_var = FlagToEnvVar(flag);
- const char* const string_value = posix::GetEnv(env_var.c_str());
- if (string_value == NULL) {
- // The environment variable is not set.
- return default_value;
- }
-
- Int32 result = default_value;
- if (!ParseInt32(Message() << "Environment variable " << env_var,
- string_value, &result)) {
- printf("The default value %s is used.\n",
- (Message() << default_value).GetString().c_str());
- fflush(stdout);
- return default_value;
- }
-
- return result;
-}
-
-// Reads and returns the string environment variable corresponding to
-// the given flag; if it's not set, returns default_value.
-const char* StringFromGTestEnv(const char* flag, const char* default_value) {
- const String env_var = FlagToEnvVar(flag);
- const char* const value = posix::GetEnv(env_var.c_str());
- return value == NULL ? default_value : value;
-}
-
-} // namespace internal
-} // namespace testing
diff --git a/src/testing/gtest/src/gtest-printers.cc b/src/testing/gtest/src/gtest-printers.cc
deleted file mode 100644
index cfe9eed3..00000000
--- a/src/testing/gtest/src/gtest-printers.cc
+++ /dev/null
@@ -1,348 +0,0 @@
-// Copyright 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-// Google Test - The Google C++ Testing Framework
-//
-// This file implements a universal value printer that can print a
-// value of any type T:
-//
-// void ::testing::internal::UniversalPrinter<T>::Print(value, ostream_ptr);
-//
-// It uses the << operator when possible, and prints the bytes in the
-// object otherwise. A user can override its behavior for a class
-// type Foo by defining either operator<<(::std::ostream&, const Foo&)
-// or void PrintTo(const Foo&, ::std::ostream*) in the namespace that
-// defines Foo.
-
-#include "gtest/gtest-printers.h"
-#include <ctype.h>
-#include <stdio.h>
-#include <ostream> // NOLINT
-#include <string>
-#include "gtest/internal/gtest-port.h"
-
-namespace testing {
-
-namespace {
-
-using ::std::ostream;
-
-// Prints a segment of bytes in the given object.
-void PrintByteSegmentInObjectTo(const unsigned char* obj_bytes, size_t start,
- size_t count, ostream* os) {
- char text[5] = "";
- for (size_t i = 0; i != count; i++) {
- const size_t j = start + i;
- if (i != 0) {
- // Organizes the bytes into groups of 2 for easy parsing by
- // human.
- if ((j % 2) == 0)
- *os << ' ';
- else
- *os << '-';
- }
- GTEST_SNPRINTF_(text, sizeof(text), "%02X", obj_bytes[j]);
- *os << text;
- }
-}
-
-// Prints the bytes in the given value to the given ostream.
-void PrintBytesInObjectToImpl(const unsigned char* obj_bytes, size_t count,
- ostream* os) {
- // Tells the user how big the object is.
- *os << count << "-byte object <";
-
- const size_t kThreshold = 132;
- const size_t kChunkSize = 64;
- // If the object size is bigger than kThreshold, we'll have to omit
- // some details by printing only the first and the last kChunkSize
- // bytes.
- // TODO(wan): let the user control the threshold using a flag.
- if (count < kThreshold) {
- PrintByteSegmentInObjectTo(obj_bytes, 0, count, os);
- } else {
- PrintByteSegmentInObjectTo(obj_bytes, 0, kChunkSize, os);
- *os << " ... ";
- // Rounds up to 2-byte boundary.
- const size_t resume_pos = (count - kChunkSize + 1)/2*2;
- PrintByteSegmentInObjectTo(obj_bytes, resume_pos, count - resume_pos, os);
- }
- *os << ">";
-}
-
-} // namespace
-
-namespace internal2 {
-
-// Delegates to PrintBytesInObjectToImpl() to print the bytes in the
-// given object. The delegation simplifies the implementation, which
-// uses the << operator and thus is easier done outside of the
-// ::testing::internal namespace, which contains a << operator that
-// sometimes conflicts with the one in STL.
-void PrintBytesInObjectTo(const unsigned char* obj_bytes, size_t count,
- ostream* os) {
- PrintBytesInObjectToImpl(obj_bytes, count, os);
-}
-
-} // namespace internal2
-
-namespace internal {
-
-// Depending on the value of a char (or wchar_t), we print it in one
-// of three formats:
-// - as is if it's a printable ASCII (e.g. 'a', '2', ' '),
-// - as a hexidecimal escape sequence (e.g. '\x7F'), or
-// - as a special escape sequence (e.g. '\r', '\n').
-enum CharFormat {
- kAsIs,
- kHexEscape,
- kSpecialEscape
-};
-
-// Returns true if c is a printable ASCII character. We test the
-// value of c directly instead of calling isprint(), which is buggy on
-// Windows Mobile.
-inline bool IsPrintableAscii(wchar_t c) {
- return 0x20 <= c && c <= 0x7E;
-}
-
-// Prints a wide or narrow char c as a character literal without the
-// quotes, escaping it when necessary; returns how c was formatted.
-// The template argument UnsignedChar is the unsigned version of Char,
-// which is the type of c.
-template <typename UnsignedChar, typename Char>
-static CharFormat PrintAsCharLiteralTo(Char c, ostream* os) {
- switch (static_cast<wchar_t>(c)) {
- case L'\0':
- *os << "\\0";
- break;
- case L'\'':
- *os << "\\'";
- break;
- case L'\\':
- *os << "\\\\";
- break;
- case L'\a':
- *os << "\\a";
- break;
- case L'\b':
- *os << "\\b";
- break;
- case L'\f':
- *os << "\\f";
- break;
- case L'\n':
- *os << "\\n";
- break;
- case L'\r':
- *os << "\\r";
- break;
- case L'\t':
- *os << "\\t";
- break;
- case L'\v':
- *os << "\\v";
- break;
- default:
- if (IsPrintableAscii(c)) {
- *os << static_cast<char>(c);
- return kAsIs;
- } else {
- *os << String::Format("\\x%X", static_cast<UnsignedChar>(c));
- return kHexEscape;
- }
- }
- return kSpecialEscape;
-}
-
-// Prints a char c as if it's part of a string literal, escaping it when
-// necessary; returns how c was formatted.
-static CharFormat PrintAsWideStringLiteralTo(wchar_t c, ostream* os) {
- switch (c) {
- case L'\'':
- *os << "'";
- return kAsIs;
- case L'"':
- *os << "\\\"";
- return kSpecialEscape;
- default:
- return PrintAsCharLiteralTo<wchar_t>(c, os);
- }
-}
-
-// Prints a char c as if it's part of a string literal, escaping it when
-// necessary; returns how c was formatted.
-static CharFormat PrintAsNarrowStringLiteralTo(char c, ostream* os) {
- return PrintAsWideStringLiteralTo(static_cast<unsigned char>(c), os);
-}
-
-// Prints a wide or narrow character c and its code. '\0' is printed
-// as "'\\0'", other unprintable characters are also properly escaped
-// using the standard C++ escape sequence. The template argument
-// UnsignedChar is the unsigned version of Char, which is the type of c.
-template <typename UnsignedChar, typename Char>
-void PrintCharAndCodeTo(Char c, ostream* os) {
- // First, print c as a literal in the most readable form we can find.
- *os << ((sizeof(c) > 1) ? "L'" : "'");
- const CharFormat format = PrintAsCharLiteralTo<UnsignedChar>(c, os);
- *os << "'";
-
- // To aid user debugging, we also print c's code in decimal, unless
- // it's 0 (in which case c was printed as '\\0', making the code
- // obvious).
- if (c == 0)
- return;
- *os << " (" << String::Format("%d", c).c_str();
-
- // For more convenience, we print c's code again in hexidecimal,
- // unless c was already printed in the form '\x##' or the code is in
- // [1, 9].
- if (format == kHexEscape || (1 <= c && c <= 9)) {
- // Do nothing.
- } else {
- *os << String::Format(", 0x%X",
- static_cast<UnsignedChar>(c)).c_str();
- }
- *os << ")";
-}
-
-void PrintTo(unsigned char c, ::std::ostream* os) {
- PrintCharAndCodeTo<unsigned char>(c, os);
-}
-void PrintTo(signed char c, ::std::ostream* os) {
- PrintCharAndCodeTo<unsigned char>(c, os);
-}
-
-// Prints a wchar_t as a symbol if it is printable or as its internal
-// code otherwise and also as its code. L'\0' is printed as "L'\\0'".
-void PrintTo(wchar_t wc, ostream* os) {
- PrintCharAndCodeTo<wchar_t>(wc, os);
-}
-
-// Prints the given array of characters to the ostream.
-// The array starts at *begin, the length is len, it may include '\0' characters
-// and may not be null-terminated.
-static void PrintCharsAsStringTo(const char* begin, size_t len, ostream* os) {
- *os << "\"";
- bool is_previous_hex = false;
- for (size_t index = 0; index < len; ++index) {
- const char cur = begin[index];
- if (is_previous_hex && IsXDigit(cur)) {
- // Previous character is of '\x..' form and this character can be
- // interpreted as another hexadecimal digit in its number. Break string to
- // disambiguate.
- *os << "\" \"";
- }
- is_previous_hex = PrintAsNarrowStringLiteralTo(cur, os) == kHexEscape;
- }
- *os << "\"";
-}
-
-// Prints a (const) char array of 'len' elements, starting at address 'begin'.
-void UniversalPrintArray(const char* begin, size_t len, ostream* os) {
- PrintCharsAsStringTo(begin, len, os);
-}
-
-// Prints the given array of wide characters to the ostream.
-// The array starts at *begin, the length is len, it may include L'\0'
-// characters and may not be null-terminated.
-static void PrintWideCharsAsStringTo(const wchar_t* begin, size_t len,
- ostream* os) {
- *os << "L\"";
- bool is_previous_hex = false;
- for (size_t index = 0; index < len; ++index) {
- const wchar_t cur = begin[index];
- if (is_previous_hex && isascii(cur) && IsXDigit(static_cast<char>(cur))) {
- // Previous character is of '\x..' form and this character can be
- // interpreted as another hexadecimal digit in its number. Break string to
- // disambiguate.
- *os << "\" L\"";
- }
- is_previous_hex = PrintAsWideStringLiteralTo(cur, os) == kHexEscape;
- }
- *os << "\"";
-}
-
-// Prints the given C string to the ostream.
-void PrintTo(const char* s, ostream* os) {
- if (s == NULL) {
- *os << "NULL";
- } else {
- *os << ImplicitCast_<const void*>(s) << " pointing to ";
- PrintCharsAsStringTo(s, strlen(s), os);
- }
-}
-
-// MSVC compiler can be configured to define whar_t as a typedef
-// of unsigned short. Defining an overload for const wchar_t* in that case
-// would cause pointers to unsigned shorts be printed as wide strings,
-// possibly accessing more memory than intended and causing invalid
-// memory accesses. MSVC defines _NATIVE_WCHAR_T_DEFINED symbol when
-// wchar_t is implemented as a native type.
-#if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED)
-// Prints the given wide C string to the ostream.
-void PrintTo(const wchar_t* s, ostream* os) {
- if (s == NULL) {
- *os << "NULL";
- } else {
- *os << ImplicitCast_<const void*>(s) << " pointing to ";
- PrintWideCharsAsStringTo(s, wcslen(s), os);
- }
-}
-#endif // wchar_t is native
-
-// Prints a ::string object.
-#if GTEST_HAS_GLOBAL_STRING
-void PrintStringTo(const ::string& s, ostream* os) {
- PrintCharsAsStringTo(s.data(), s.size(), os);
-}
-#endif // GTEST_HAS_GLOBAL_STRING
-
-void PrintStringTo(const ::std::string& s, ostream* os) {
- PrintCharsAsStringTo(s.data(), s.size(), os);
-}
-
-// Prints a ::wstring object.
-#if GTEST_HAS_GLOBAL_WSTRING
-void PrintWideStringTo(const ::wstring& s, ostream* os) {
- PrintWideCharsAsStringTo(s.data(), s.size(), os);
-}
-#endif // GTEST_HAS_GLOBAL_WSTRING
-
-#if GTEST_HAS_STD_WSTRING
-void PrintWideStringTo(const ::std::wstring& s, ostream* os) {
- PrintWideCharsAsStringTo(s.data(), s.size(), os);
-}
-#endif // GTEST_HAS_STD_WSTRING
-
-} // namespace internal
-
-} // namespace testing
diff --git a/src/testing/gtest/src/gtest-test-part.cc b/src/testing/gtest/src/gtest-test-part.cc
deleted file mode 100644
index 5ddc67c1..00000000
--- a/src/testing/gtest/src/gtest-test-part.cc
+++ /dev/null
@@ -1,110 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: mheule@google.com (Markus Heule)
-//
-// The Google C++ Testing Framework (Google Test)
-
-#include "gtest/gtest-test-part.h"
-
-// Indicates that this translation unit is part of Google Test's
-// implementation. It must come before gtest-internal-inl.h is
-// included, or there will be a compiler error. This trick is to
-// prevent a user from accidentally including gtest-internal-inl.h in
-// his code.
-#define GTEST_IMPLEMENTATION_ 1
-#include "src/gtest-internal-inl.h"
-#undef GTEST_IMPLEMENTATION_
-
-namespace testing {
-
-using internal::GetUnitTestImpl;
-
-// Gets the summary of the failure message by omitting the stack trace
-// in it.
-internal::String TestPartResult::ExtractSummary(const char* message) {
- const char* const stack_trace = strstr(message, internal::kStackTraceMarker);
- return stack_trace == NULL ? internal::String(message) :
- internal::String(message, stack_trace - message);
-}
-
-// Prints a TestPartResult object.
-std::ostream& operator<<(std::ostream& os, const TestPartResult& result) {
- return os
- << result.file_name() << ":" << result.line_number() << ": "
- << (result.type() == TestPartResult::kSuccess ? "Success" :
- result.type() == TestPartResult::kFatalFailure ? "Fatal failure" :
- "Non-fatal failure") << ":\n"
- << result.message() << std::endl;
-}
-
-// Appends a TestPartResult to the array.
-void TestPartResultArray::Append(const TestPartResult& result) {
- array_.push_back(result);
-}
-
-// Returns the TestPartResult at the given index (0-based).
-const TestPartResult& TestPartResultArray::GetTestPartResult(int index) const {
- if (index < 0 || index >= size()) {
- printf("\nInvalid index (%d) into TestPartResultArray.\n", index);
- internal::posix::Abort();
- }
-
- return array_[index];
-}
-
-// Returns the number of TestPartResult objects in the array.
-int TestPartResultArray::size() const {
- return static_cast<int>(array_.size());
-}
-
-namespace internal {
-
-HasNewFatalFailureHelper::HasNewFatalFailureHelper()
- : has_new_fatal_failure_(false),
- original_reporter_(GetUnitTestImpl()->
- GetTestPartResultReporterForCurrentThread()) {
- GetUnitTestImpl()->SetTestPartResultReporterForCurrentThread(this);
-}
-
-HasNewFatalFailureHelper::~HasNewFatalFailureHelper() {
- GetUnitTestImpl()->SetTestPartResultReporterForCurrentThread(
- original_reporter_);
-}
-
-void HasNewFatalFailureHelper::ReportTestPartResult(
- const TestPartResult& result) {
- if (result.fatally_failed())
- has_new_fatal_failure_ = true;
- original_reporter_->ReportTestPartResult(result);
-}
-
-} // namespace internal
-
-} // namespace testing
diff --git a/src/testing/gtest/src/gtest-typed-test.cc b/src/testing/gtest/src/gtest-typed-test.cc
deleted file mode 100644
index a5cc88f9..00000000
--- a/src/testing/gtest/src/gtest-typed-test.cc
+++ /dev/null
@@ -1,110 +0,0 @@
-// Copyright 2008 Google Inc.
-// All Rights Reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-#include "gtest/gtest-typed-test.h"
-#include "gtest/gtest.h"
-
-namespace testing {
-namespace internal {
-
-#if GTEST_HAS_TYPED_TEST_P
-
-// Skips to the first non-space char in str. Returns an empty string if str
-// contains only whitespace characters.
-static const char* SkipSpaces(const char* str) {
- while (IsSpace(*str))
- str++;
- return str;
-}
-
-// Verifies that registered_tests match the test names in
-// defined_test_names_; returns registered_tests if successful, or
-// aborts the program otherwise.
-const char* TypedTestCasePState::VerifyRegisteredTestNames(
- const char* file, int line, const char* registered_tests) {
- typedef ::std::set<const char*>::const_iterator DefinedTestIter;
- registered_ = true;
-
- // Skip initial whitespace in registered_tests since some
- // preprocessors prefix stringizied literals with whitespace.
- registered_tests = SkipSpaces(registered_tests);
-
- Message errors;
- ::std::set<String> tests;
- for (const char* names = registered_tests; names != NULL;
- names = SkipComma(names)) {
- const String name = GetPrefixUntilComma(names);
- if (tests.count(name) != 0) {
- errors << "Test " << name << " is listed more than once.\n";
- continue;
- }
-
- bool found = false;
- for (DefinedTestIter it = defined_test_names_.begin();
- it != defined_test_names_.end();
- ++it) {
- if (name == *it) {
- found = true;
- break;
- }
- }
-
- if (found) {
- tests.insert(name);
- } else {
- errors << "No test named " << name
- << " can be found in this test case.\n";
- }
- }
-
- for (DefinedTestIter it = defined_test_names_.begin();
- it != defined_test_names_.end();
- ++it) {
- if (tests.count(*it) == 0) {
- errors << "You forgot to list test " << *it << ".\n";
- }
- }
-
- const String& errors_str = errors.GetString();
- if (errors_str != "") {
- fprintf(stderr, "%s %s", FormatFileLocation(file, line).c_str(),
- errors_str.c_str());
- fflush(stderr);
- posix::Abort();
- }
-
- return registered_tests;
-}
-
-#endif // GTEST_HAS_TYPED_TEST_P
-
-} // namespace internal
-} // namespace testing
diff --git a/src/testing/gtest/src/gtest.cc b/src/testing/gtest/src/gtest.cc
deleted file mode 100644
index 78f113e2..00000000
--- a/src/testing/gtest/src/gtest.cc
+++ /dev/null
@@ -1,4930 +0,0 @@
-// Copyright 2005, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-//
-// The Google C++ Testing Framework (Google Test)
-
-#include "gtest/gtest.h"
-#include "gtest/gtest-spi.h"
-
-#include <ctype.h>
-#include <math.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <time.h>
-#include <wchar.h>
-#include <wctype.h>
-
-#include <algorithm>
-#include <ostream> // NOLINT
-#include <sstream>
-#include <vector>
-
-#if GTEST_OS_LINUX
-
-// TODO(kenton@google.com): Use autoconf to detect availability of
-// gettimeofday().
-# define GTEST_HAS_GETTIMEOFDAY_ 1
-
-# include <fcntl.h> // NOLINT
-# include <limits.h> // NOLINT
-# include <sched.h> // NOLINT
-// Declares vsnprintf(). This header is not available on Windows.
-# include <strings.h> // NOLINT
-# include <sys/mman.h> // NOLINT
-# include <sys/time.h> // NOLINT
-# include <unistd.h> // NOLINT
-# include <string>
-
-#elif GTEST_OS_SYMBIAN
-# define GTEST_HAS_GETTIMEOFDAY_ 1
-# include <sys/time.h> // NOLINT
-
-#elif GTEST_OS_ZOS
-# define GTEST_HAS_GETTIMEOFDAY_ 1
-# include <sys/time.h> // NOLINT
-
-// On z/OS we additionally need strings.h for strcasecmp.
-# include <strings.h> // NOLINT
-
-#elif GTEST_OS_WINDOWS_MOBILE // We are on Windows CE.
-
-# include <windows.h> // NOLINT
-
-#elif GTEST_OS_WINDOWS // We are on Windows proper.
-
-# include <io.h> // NOLINT
-# include <sys/timeb.h> // NOLINT
-# include <sys/types.h> // NOLINT
-# include <sys/stat.h> // NOLINT
-
-# if GTEST_OS_WINDOWS_MINGW
-// MinGW has gettimeofday() but not _ftime64().
-// TODO(kenton@google.com): Use autoconf to detect availability of
-// gettimeofday().
-// TODO(kenton@google.com): There are other ways to get the time on
-// Windows, like GetTickCount() or GetSystemTimeAsFileTime(). MinGW
-// supports these. consider using them instead.
-# define GTEST_HAS_GETTIMEOFDAY_ 1
-# include <sys/time.h> // NOLINT
-# endif // GTEST_OS_WINDOWS_MINGW
-
-// cpplint thinks that the header is already included, so we want to
-// silence it.
-# include <windows.h> // NOLINT
-
-#else
-
-// Assume other platforms have gettimeofday().
-// TODO(kenton@google.com): Use autoconf to detect availability of
-// gettimeofday().
-# define GTEST_HAS_GETTIMEOFDAY_ 1
-
-// cpplint thinks that the header is already included, so we want to
-// silence it.
-# include <sys/time.h> // NOLINT
-# include <unistd.h> // NOLINT
-
-#endif // GTEST_OS_LINUX
-
-#if GTEST_HAS_EXCEPTIONS
-# include <stdexcept>
-#endif
-
-#if GTEST_CAN_STREAM_RESULTS_
-# include <arpa/inet.h> // NOLINT
-# include <netdb.h> // NOLINT
-#endif
-
-// Indicates that this translation unit is part of Google Test's
-// implementation. It must come before gtest-internal-inl.h is
-// included, or there will be a compiler error. This trick is to
-// prevent a user from accidentally including gtest-internal-inl.h in
-// his code.
-#define GTEST_IMPLEMENTATION_ 1
-#include "src/gtest-internal-inl.h"
-#undef GTEST_IMPLEMENTATION_
-
-#if GTEST_OS_WINDOWS
-# define vsnprintf _vsnprintf
-#endif // GTEST_OS_WINDOWS
-
-namespace testing {
-
-using internal::CountIf;
-using internal::ForEach;
-using internal::GetElementOr;
-using internal::Shuffle;
-
-// Constants.
-
-// A test whose test case name or test name matches this filter is
-// disabled and not run.
-static const char kDisableTestFilter[] = "DISABLED_*:*/DISABLED_*";
-
-// A test case whose name matches this filter is considered a death
-// test case and will be run before test cases whose name doesn't
-// match this filter.
-static const char kDeathTestCaseFilter[] = "*DeathTest:*DeathTest/*";
-
-// A test filter that matches everything.
-static const char kUniversalFilter[] = "*";
-
-// The default output file for XML output.
-static const char kDefaultOutputFile[] = "test_detail.xml";
-
-// The environment variable name for the test shard index.
-static const char kTestShardIndex[] = "GTEST_SHARD_INDEX";
-// The environment variable name for the total number of test shards.
-static const char kTestTotalShards[] = "GTEST_TOTAL_SHARDS";
-// The environment variable name for the test shard status file.
-static const char kTestShardStatusFile[] = "GTEST_SHARD_STATUS_FILE";
-
-namespace internal {
-
-// The text used in failure messages to indicate the start of the
-// stack trace.
-const char kStackTraceMarker[] = "\nStack trace:\n";
-
-// g_help_flag is true iff the --help flag or an equivalent form is
-// specified on the command line.
-bool g_help_flag = false;
-
-} // namespace internal
-
-GTEST_DEFINE_bool_(
- also_run_disabled_tests,
- internal::BoolFromGTestEnv("also_run_disabled_tests", false),
- "Run disabled tests too, in addition to the tests normally being run.");
-
-GTEST_DEFINE_bool_(
- break_on_failure,
- internal::BoolFromGTestEnv("break_on_failure", false),
- "True iff a failed assertion should be a debugger break-point.");
-
-GTEST_DEFINE_bool_(
- catch_exceptions,
- internal::BoolFromGTestEnv("catch_exceptions", true),
- "True iff " GTEST_NAME_
- " should catch exceptions and treat them as test failures.");
-
-GTEST_DEFINE_string_(
- color,
- internal::StringFromGTestEnv("color", "auto"),
- "Whether to use colors in the output. Valid values: yes, no, "
- "and auto. 'auto' means to use colors if the output is "
- "being sent to a terminal and the TERM environment variable "
- "is set to xterm, xterm-color, xterm-256color, linux or cygwin.");
-
-GTEST_DEFINE_string_(
- filter,
- internal::StringFromGTestEnv("filter", kUniversalFilter),
- "A colon-separated list of glob (not regex) patterns "
- "for filtering the tests to run, optionally followed by a "
- "'-' and a : separated list of negative patterns (tests to "
- "exclude). A test is run if it matches one of the positive "
- "patterns and does not match any of the negative patterns.");
-
-GTEST_DEFINE_bool_(list_tests, false,
- "List all tests without running them.");
-
-GTEST_DEFINE_string_(
- output,
- internal::StringFromGTestEnv("output", ""),
- "A format (currently must be \"xml\"), optionally followed "
- "by a colon and an output file name or directory. A directory "
- "is indicated by a trailing pathname separator. "
- "Examples: \"xml:filename.xml\", \"xml::directoryname/\". "
- "If a directory is specified, output files will be created "
- "within that directory, with file-names based on the test "
- "executable's name and, if necessary, made unique by adding "
- "digits.");
-
-GTEST_DEFINE_bool_(
- print_time,
- internal::BoolFromGTestEnv("print_time", true),
- "True iff " GTEST_NAME_
- " should display elapsed time in text output.");
-
-GTEST_DEFINE_int32_(
- random_seed,
- internal::Int32FromGTestEnv("random_seed", 0),
- "Random number seed to use when shuffling test orders. Must be in range "
- "[1, 99999], or 0 to use a seed based on the current time.");
-
-GTEST_DEFINE_int32_(
- repeat,
- internal::Int32FromGTestEnv("repeat", 1),
- "How many times to repeat each test. Specify a negative number "
- "for repeating forever. Useful for shaking out flaky tests.");
-
-GTEST_DEFINE_bool_(
- show_internal_stack_frames, false,
- "True iff " GTEST_NAME_ " should include internal stack frames when "
- "printing test failure stack traces.");
-
-GTEST_DEFINE_bool_(
- shuffle,
- internal::BoolFromGTestEnv("shuffle", false),
- "True iff " GTEST_NAME_
- " should randomize tests' order on every run.");
-
-GTEST_DEFINE_int32_(
- stack_trace_depth,
- internal::Int32FromGTestEnv("stack_trace_depth", kMaxStackTraceDepth),
- "The maximum number of stack frames to print when an "
- "assertion fails. The valid range is 0 through 100, inclusive.");
-
-GTEST_DEFINE_string_(
- stream_result_to,
- internal::StringFromGTestEnv("stream_result_to", ""),
- "This flag specifies the host name and the port number on which to stream "
- "test results. Example: \"localhost:555\". The flag is effective only on "
- "Linux.");
-
-GTEST_DEFINE_bool_(
- throw_on_failure,
- internal::BoolFromGTestEnv("throw_on_failure", false),
- "When this flag is specified, a failed assertion will throw an exception "
- "if exceptions are enabled or exit the program with a non-zero code "
- "otherwise.");
-
-namespace internal {
-
-// Generates a random number from [0, range), using a Linear
-// Congruential Generator (LCG). Crashes if 'range' is 0 or greater
-// than kMaxRange.
-UInt32 Random::Generate(UInt32 range) {
- // These constants are the same as are used in glibc's rand(3).
- state_ = (1103515245U*state_ + 12345U) % kMaxRange;
-
- GTEST_CHECK_(range > 0)
- << "Cannot generate a number in the range [0, 0).";
- GTEST_CHECK_(range <= kMaxRange)
- << "Generation of a number in [0, " << range << ") was requested, "
- << "but this can only generate numbers in [0, " << kMaxRange << ").";
-
- // Converting via modulus introduces a bit of downward bias, but
- // it's simple, and a linear congruential generator isn't too good
- // to begin with.
- return state_ % range;
-}
-
-// GTestIsInitialized() returns true iff the user has initialized
-// Google Test. Useful for catching the user mistake of not initializing
-// Google Test before calling RUN_ALL_TESTS().
-//
-// A user must call testing::InitGoogleTest() to initialize Google
-// Test. g_init_gtest_count is set to the number of times
-// InitGoogleTest() has been called. We don't protect this variable
-// under a mutex as it is only accessed in the main thread.
-GTEST_API_ int g_init_gtest_count = 0;
-static bool GTestIsInitialized() { return g_init_gtest_count != 0; }
-
-// Iterates over a vector of TestCases, keeping a running sum of the
-// results of calling a given int-returning method on each.
-// Returns the sum.
-static int SumOverTestCaseList(const std::vector<TestCase*>& case_list,
- int (TestCase::*method)() const) {
- int sum = 0;
- for (size_t i = 0; i < case_list.size(); i++) {
- sum += (case_list[i]->*method)();
- }
- return sum;
-}
-
-// Returns true iff the test case passed.
-static bool TestCasePassed(const TestCase* test_case) {
- return test_case->should_run() && test_case->Passed();
-}
-
-// Returns true iff the test case failed.
-static bool TestCaseFailed(const TestCase* test_case) {
- return test_case->should_run() && test_case->Failed();
-}
-
-// Returns true iff test_case contains at least one test that should
-// run.
-static bool ShouldRunTestCase(const TestCase* test_case) {
- return test_case->should_run();
-}
-
-// AssertHelper constructor.
-AssertHelper::AssertHelper(TestPartResult::Type type,
- const char* file,
- int line,
- const char* message)
- : data_(new AssertHelperData(type, file, line, message)) {
-}
-
-AssertHelper::~AssertHelper() {
- delete data_;
-}
-
-// Message assignment, for assertion streaming support.
-void AssertHelper::operator=(const Message& message) const {
- UnitTest::GetInstance()->
- AddTestPartResult(data_->type, data_->file, data_->line,
- AppendUserMessage(data_->message, message),
- UnitTest::GetInstance()->impl()
- ->CurrentOsStackTraceExceptTop(1)
- // Skips the stack frame for this function itself.
- ); // NOLINT
-}
-
-// Mutex for linked pointers.
-GTEST_API_ GTEST_DEFINE_STATIC_MUTEX_(g_linked_ptr_mutex);
-
-// Application pathname gotten in InitGoogleTest.
-String g_executable_path;
-
-// Returns the current application's name, removing directory path if that
-// is present.
-FilePath GetCurrentExecutableName() {
- FilePath result;
-
-#if GTEST_OS_WINDOWS
- result.Set(FilePath(g_executable_path).RemoveExtension("exe"));
-#else
- result.Set(FilePath(g_executable_path));
-#endif // GTEST_OS_WINDOWS
-
- return result.RemoveDirectoryName();
-}
-
-// Functions for processing the gtest_output flag.
-
-// Returns the output format, or "" for normal printed output.
-String UnitTestOptions::GetOutputFormat() {
- const char* const gtest_output_flag = GTEST_FLAG(output).c_str();
- if (gtest_output_flag == NULL) return String("");
-
- const char* const colon = strchr(gtest_output_flag, ':');
- return (colon == NULL) ?
- String(gtest_output_flag) :
- String(gtest_output_flag, colon - gtest_output_flag);
-}
-
-// Returns the name of the requested output file, or the default if none
-// was explicitly specified.
-String UnitTestOptions::GetAbsolutePathToOutputFile() {
- const char* const gtest_output_flag = GTEST_FLAG(output).c_str();
- if (gtest_output_flag == NULL)
- return String("");
-
- const char* const colon = strchr(gtest_output_flag, ':');
- if (colon == NULL)
- return String(internal::FilePath::ConcatPaths(
- internal::FilePath(
- UnitTest::GetInstance()->original_working_dir()),
- internal::FilePath(kDefaultOutputFile)).ToString() );
-
- internal::FilePath output_name(colon + 1);
- if (!output_name.IsAbsolutePath())
- // TODO(wan@google.com): on Windows \some\path is not an absolute
- // path (as its meaning depends on the current drive), yet the
- // following logic for turning it into an absolute path is wrong.
- // Fix it.
- output_name = internal::FilePath::ConcatPaths(
- internal::FilePath(UnitTest::GetInstance()->original_working_dir()),
- internal::FilePath(colon + 1));
-
- if (!output_name.IsDirectory())
- return output_name.ToString();
-
- internal::FilePath result(internal::FilePath::GenerateUniqueFileName(
- output_name, internal::GetCurrentExecutableName(),
- GetOutputFormat().c_str()));
- return result.ToString();
-}
-
-// Returns true iff the wildcard pattern matches the string. The
-// first ':' or '\0' character in pattern marks the end of it.
-//
-// This recursive algorithm isn't very efficient, but is clear and
-// works well enough for matching test names, which are short.
-bool UnitTestOptions::PatternMatchesString(const char *pattern,
- const char *str) {
- switch (*pattern) {
- case '\0':
- case ':': // Either ':' or '\0' marks the end of the pattern.
- return *str == '\0';
- case '?': // Matches any single character.
- return *str != '\0' && PatternMatchesString(pattern + 1, str + 1);
- case '*': // Matches any string (possibly empty) of characters.
- return (*str != '\0' && PatternMatchesString(pattern, str + 1)) ||
- PatternMatchesString(pattern + 1, str);
- default: // Non-special character. Matches itself.
- return *pattern == *str &&
- PatternMatchesString(pattern + 1, str + 1);
- }
-}
-
-bool UnitTestOptions::MatchesFilter(const String& name, const char* filter) {
- const char *cur_pattern = filter;
- for (;;) {
- if (PatternMatchesString(cur_pattern, name.c_str())) {
- return true;
- }
-
- // Finds the next pattern in the filter.
- cur_pattern = strchr(cur_pattern, ':');
-
- // Returns if no more pattern can be found.
- if (cur_pattern == NULL) {
- return false;
- }
-
- // Skips the pattern separater (the ':' character).
- cur_pattern++;
- }
-}
-
-// TODO(keithray): move String function implementations to gtest-string.cc.
-
-// Returns true iff the user-specified filter matches the test case
-// name and the test name.
-bool UnitTestOptions::FilterMatchesTest(const String &test_case_name,
- const String &test_name) {
- const String& full_name = String::Format("%s.%s",
- test_case_name.c_str(),
- test_name.c_str());
-
- // Split --gtest_filter at '-', if there is one, to separate into
- // positive filter and negative filter portions
- const char* const p = GTEST_FLAG(filter).c_str();
- const char* const dash = strchr(p, '-');
- String positive;
- String negative;
- if (dash == NULL) {
- positive = GTEST_FLAG(filter).c_str(); // Whole string is a positive filter
- negative = String("");
- } else {
- positive = String(p, dash - p); // Everything up to the dash
- negative = String(dash+1); // Everything after the dash
- if (positive.empty()) {
- // Treat '-test1' as the same as '*-test1'
- positive = kUniversalFilter;
- }
- }
-
- // A filter is a colon-separated list of patterns. It matches a
- // test if any pattern in it matches the test.
- return (MatchesFilter(full_name, positive.c_str()) &&
- !MatchesFilter(full_name, negative.c_str()));
-}
-
-#if GTEST_HAS_SEH
-// Returns EXCEPTION_EXECUTE_HANDLER if Google Test should handle the
-// given SEH exception, or EXCEPTION_CONTINUE_SEARCH otherwise.
-// This function is useful as an __except condition.
-int UnitTestOptions::GTestShouldProcessSEH(DWORD exception_code) {
- // Google Test should handle a SEH exception if:
- // 1. the user wants it to, AND
- // 2. this is not a breakpoint exception, AND
- // 3. this is not a C++ exception (VC++ implements them via SEH,
- // apparently).
- //
- // SEH exception code for C++ exceptions.
- // (see http://support.microsoft.com/kb/185294 for more information).
- const DWORD kCxxExceptionCode = 0xe06d7363;
-
- bool should_handle = true;
-
- if (!GTEST_FLAG(catch_exceptions))
- should_handle = false;
- else if (exception_code == EXCEPTION_BREAKPOINT)
- should_handle = false;
- else if (exception_code == kCxxExceptionCode)
- should_handle = false;
-
- return should_handle ? EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH;
-}
-#endif // GTEST_HAS_SEH
-
-} // namespace internal
-
-// The c'tor sets this object as the test part result reporter used by
-// Google Test. The 'result' parameter specifies where to report the
-// results. Intercepts only failures from the current thread.
-ScopedFakeTestPartResultReporter::ScopedFakeTestPartResultReporter(
- TestPartResultArray* result)
- : intercept_mode_(INTERCEPT_ONLY_CURRENT_THREAD),
- result_(result) {
- Init();
-}
-
-// The c'tor sets this object as the test part result reporter used by
-// Google Test. The 'result' parameter specifies where to report the
-// results.
-ScopedFakeTestPartResultReporter::ScopedFakeTestPartResultReporter(
- InterceptMode intercept_mode, TestPartResultArray* result)
- : intercept_mode_(intercept_mode),
- result_(result) {
- Init();
-}
-
-void ScopedFakeTestPartResultReporter::Init() {
- internal::UnitTestImpl* const impl = internal::GetUnitTestImpl();
- if (intercept_mode_ == INTERCEPT_ALL_THREADS) {
- old_reporter_ = impl->GetGlobalTestPartResultReporter();
- impl->SetGlobalTestPartResultReporter(this);
- } else {
- old_reporter_ = impl->GetTestPartResultReporterForCurrentThread();
- impl->SetTestPartResultReporterForCurrentThread(this);
- }
-}
-
-// The d'tor restores the test part result reporter used by Google Test
-// before.
-ScopedFakeTestPartResultReporter::~ScopedFakeTestPartResultReporter() {
- internal::UnitTestImpl* const impl = internal::GetUnitTestImpl();
- if (intercept_mode_ == INTERCEPT_ALL_THREADS) {
- impl->SetGlobalTestPartResultReporter(old_reporter_);
- } else {
- impl->SetTestPartResultReporterForCurrentThread(old_reporter_);
- }
-}
-
-// Increments the test part result count and remembers the result.
-// This method is from the TestPartResultReporterInterface interface.
-void ScopedFakeTestPartResultReporter::ReportTestPartResult(
- const TestPartResult& result) {
- result_->Append(result);
-}
-
-namespace internal {
-
-// Returns the type ID of ::testing::Test. We should always call this
-// instead of GetTypeId< ::testing::Test>() to get the type ID of
-// testing::Test. This is to work around a suspected linker bug when
-// using Google Test as a framework on Mac OS X. The bug causes
-// GetTypeId< ::testing::Test>() to return different values depending
-// on whether the call is from the Google Test framework itself or
-// from user test code. GetTestTypeId() is guaranteed to always
-// return the same value, as it always calls GetTypeId<>() from the
-// gtest.cc, which is within the Google Test framework.
-TypeId GetTestTypeId() {
- return GetTypeId<Test>();
-}
-
-// The value of GetTestTypeId() as seen from within the Google Test
-// library. This is solely for testing GetTestTypeId().
-extern const TypeId kTestTypeIdInGoogleTest = GetTestTypeId();
-
-// This predicate-formatter checks that 'results' contains a test part
-// failure of the given type and that the failure message contains the
-// given substring.
-AssertionResult HasOneFailure(const char* /* results_expr */,
- const char* /* type_expr */,
- const char* /* substr_expr */,
- const TestPartResultArray& results,
- TestPartResult::Type type,
- const string& substr) {
- const String expected(type == TestPartResult::kFatalFailure ?
- "1 fatal failure" :
- "1 non-fatal failure");
- Message msg;
- if (results.size() != 1) {
- msg << "Expected: " << expected << "\n"
- << " Actual: " << results.size() << " failures";
- for (int i = 0; i < results.size(); i++) {
- msg << "\n" << results.GetTestPartResult(i);
- }
- return AssertionFailure() << msg;
- }
-
- const TestPartResult& r = results.GetTestPartResult(0);
- if (r.type() != type) {
- return AssertionFailure() << "Expected: " << expected << "\n"
- << " Actual:\n"
- << r;
- }
-
- if (strstr(r.message(), substr.c_str()) == NULL) {
- return AssertionFailure() << "Expected: " << expected << " containing \""
- << substr << "\"\n"
- << " Actual:\n"
- << r;
- }
-
- return AssertionSuccess();
-}
-
-// The constructor of SingleFailureChecker remembers where to look up
-// test part results, what type of failure we expect, and what
-// substring the failure message should contain.
-SingleFailureChecker:: SingleFailureChecker(
- const TestPartResultArray* results,
- TestPartResult::Type type,
- const string& substr)
- : results_(results),
- type_(type),
- substr_(substr) {}
-
-// The destructor of SingleFailureChecker verifies that the given
-// TestPartResultArray contains exactly one failure that has the given
-// type and contains the given substring. If that's not the case, a
-// non-fatal failure will be generated.
-SingleFailureChecker::~SingleFailureChecker() {
- EXPECT_PRED_FORMAT3(HasOneFailure, *results_, type_, substr_);
-}
-
-DefaultGlobalTestPartResultReporter::DefaultGlobalTestPartResultReporter(
- UnitTestImpl* unit_test) : unit_test_(unit_test) {}
-
-void DefaultGlobalTestPartResultReporter::ReportTestPartResult(
- const TestPartResult& result) {
- unit_test_->current_test_result()->AddTestPartResult(result);
- unit_test_->listeners()->repeater()->OnTestPartResult(result);
-}
-
-DefaultPerThreadTestPartResultReporter::DefaultPerThreadTestPartResultReporter(
- UnitTestImpl* unit_test) : unit_test_(unit_test) {}
-
-void DefaultPerThreadTestPartResultReporter::ReportTestPartResult(
- const TestPartResult& result) {
- unit_test_->GetGlobalTestPartResultReporter()->ReportTestPartResult(result);
-}
-
-// Returns the global test part result reporter.
-TestPartResultReporterInterface*
-UnitTestImpl::GetGlobalTestPartResultReporter() {
- internal::MutexLock lock(&global_test_part_result_reporter_mutex_);
- return global_test_part_result_repoter_;
-}
-
-// Sets the global test part result reporter.
-void UnitTestImpl::SetGlobalTestPartResultReporter(
- TestPartResultReporterInterface* reporter) {
- internal::MutexLock lock(&global_test_part_result_reporter_mutex_);
- global_test_part_result_repoter_ = reporter;
-}
-
-// Returns the test part result reporter for the current thread.
-TestPartResultReporterInterface*
-UnitTestImpl::GetTestPartResultReporterForCurrentThread() {
- return per_thread_test_part_result_reporter_.get();
-}
-
-// Sets the test part result reporter for the current thread.
-void UnitTestImpl::SetTestPartResultReporterForCurrentThread(
- TestPartResultReporterInterface* reporter) {
- per_thread_test_part_result_reporter_.set(reporter);
-}
-
-// Gets the number of successful test cases.
-int UnitTestImpl::successful_test_case_count() const {
- return CountIf(test_cases_, TestCasePassed);
-}
-
-// Gets the number of failed test cases.
-int UnitTestImpl::failed_test_case_count() const {
- return CountIf(test_cases_, TestCaseFailed);
-}
-
-// Gets the number of all test cases.
-int UnitTestImpl::total_test_case_count() const {
- return static_cast<int>(test_cases_.size());
-}
-
-// Gets the number of all test cases that contain at least one test
-// that should run.
-int UnitTestImpl::test_case_to_run_count() const {
- return CountIf(test_cases_, ShouldRunTestCase);
-}
-
-// Gets the number of successful tests.
-int UnitTestImpl::successful_test_count() const {
- return SumOverTestCaseList(test_cases_, &TestCase::successful_test_count);
-}
-
-// Gets the number of failed tests.
-int UnitTestImpl::failed_test_count() const {
- return SumOverTestCaseList(test_cases_, &TestCase::failed_test_count);
-}
-
-// Gets the number of disabled tests.
-int UnitTestImpl::disabled_test_count() const {
- return SumOverTestCaseList(test_cases_, &TestCase::disabled_test_count);
-}
-
-// Gets the number of all tests.
-int UnitTestImpl::total_test_count() const {
- return SumOverTestCaseList(test_cases_, &TestCase::total_test_count);
-}
-
-// Gets the number of tests that should run.
-int UnitTestImpl::test_to_run_count() const {
- return SumOverTestCaseList(test_cases_, &TestCase::test_to_run_count);
-}
-
-// Returns the current OS stack trace as a String.
-//
-// The maximum number of stack frames to be included is specified by
-// the gtest_stack_trace_depth flag. The skip_count parameter
-// specifies the number of top frames to be skipped, which doesn't
-// count against the number of frames to be included.
-//
-// For example, if Foo() calls Bar(), which in turn calls
-// CurrentOsStackTraceExceptTop(1), Foo() will be included in the
-// trace but Bar() and CurrentOsStackTraceExceptTop() won't.
-String UnitTestImpl::CurrentOsStackTraceExceptTop(int skip_count) {
- (void)skip_count;
- return String("");
-}
-
-// Returns the current time in milliseconds.
-TimeInMillis GetTimeInMillis() {
-#if GTEST_OS_WINDOWS_MOBILE || defined(__BORLANDC__)
- // Difference between 1970-01-01 and 1601-01-01 in milliseconds.
- // http://analogous.blogspot.com/2005/04/epoch.html
- const TimeInMillis kJavaEpochToWinFileTimeDelta =
- static_cast<TimeInMillis>(116444736UL) * 100000UL;
- const DWORD kTenthMicrosInMilliSecond = 10000;
-
- SYSTEMTIME now_systime;
- FILETIME now_filetime;
- ULARGE_INTEGER now_int64;
- // TODO(kenton@google.com): Shouldn't this just use
- // GetSystemTimeAsFileTime()?
- GetSystemTime(&now_systime);
- if (SystemTimeToFileTime(&now_systime, &now_filetime)) {
- now_int64.LowPart = now_filetime.dwLowDateTime;
- now_int64.HighPart = now_filetime.dwHighDateTime;
- now_int64.QuadPart = (now_int64.QuadPart / kTenthMicrosInMilliSecond) -
- kJavaEpochToWinFileTimeDelta;
- return now_int64.QuadPart;
- }
- return 0;
-#elif GTEST_OS_WINDOWS && !GTEST_HAS_GETTIMEOFDAY_
- __timeb64 now;
-
-# ifdef _MSC_VER
-
- // MSVC 8 deprecates _ftime64(), so we want to suppress warning 4996
- // (deprecated function) there.
- // TODO(kenton@google.com): Use GetTickCount()? Or use
- // SystemTimeToFileTime()
-# pragma warning(push) // Saves the current warning state.
-# pragma warning(disable:4996) // Temporarily disables warning 4996.
- _ftime64(&now);
-# pragma warning(pop) // Restores the warning state.
-# else
-
- _ftime64(&now);
-
-# endif // _MSC_VER
-
- return static_cast<TimeInMillis>(now.time) * 1000 + now.millitm;
-#elif GTEST_HAS_GETTIMEOFDAY_
- struct timeval now;
- gettimeofday(&now, NULL);
- return static_cast<TimeInMillis>(now.tv_sec) * 1000 + now.tv_usec / 1000;
-#else
-# error "Don't know how to get the current time on your system."
-#endif
-}
-
-// Utilities
-
-// class String
-
-// Returns the input enclosed in double quotes if it's not NULL;
-// otherwise returns "(null)". For example, "\"Hello\"" is returned
-// for input "Hello".
-//
-// This is useful for printing a C string in the syntax of a literal.
-//
-// Known issue: escape sequences are not handled yet.
-String String::ShowCStringQuoted(const char* c_str) {
- return c_str ? String::Format("\"%s\"", c_str) : String("(null)");
-}
-
-// Copies at most length characters from str into a newly-allocated
-// piece of memory of size length+1. The memory is allocated with new[].
-// A terminating null byte is written to the memory, and a pointer to it
-// is returned. If str is NULL, NULL is returned.
-static char* CloneString(const char* str, size_t length) {
- if (str == NULL) {
- return NULL;
- } else {
- char* const clone = new char[length + 1];
- posix::StrNCpy(clone, str, length);
- clone[length] = '\0';
- return clone;
- }
-}
-
-// Clones a 0-terminated C string, allocating memory using new. The
-// caller is responsible for deleting[] the return value. Returns the
-// cloned string, or NULL if the input is NULL.
-const char * String::CloneCString(const char* c_str) {
- return (c_str == NULL) ?
- NULL : CloneString(c_str, strlen(c_str));
-}
-
-#if GTEST_OS_WINDOWS_MOBILE
-// Creates a UTF-16 wide string from the given ANSI string, allocating
-// memory using new. The caller is responsible for deleting the return
-// value using delete[]. Returns the wide string, or NULL if the
-// input is NULL.
-LPCWSTR String::AnsiToUtf16(const char* ansi) {
- if (!ansi) return NULL;
- const int length = strlen(ansi);
- const int unicode_length =
- MultiByteToWideChar(CP_ACP, 0, ansi, length,
- NULL, 0);
- WCHAR* unicode = new WCHAR[unicode_length + 1];
- MultiByteToWideChar(CP_ACP, 0, ansi, length,
- unicode, unicode_length);
- unicode[unicode_length] = 0;
- return unicode;
-}
-
-// Creates an ANSI string from the given wide string, allocating
-// memory using new. The caller is responsible for deleting the return
-// value using delete[]. Returns the ANSI string, or NULL if the
-// input is NULL.
-const char* String::Utf16ToAnsi(LPCWSTR utf16_str) {
- if (!utf16_str) return NULL;
- const int ansi_length =
- WideCharToMultiByte(CP_ACP, 0, utf16_str, -1,
- NULL, 0, NULL, NULL);
- char* ansi = new char[ansi_length + 1];
- WideCharToMultiByte(CP_ACP, 0, utf16_str, -1,
- ansi, ansi_length, NULL, NULL);
- ansi[ansi_length] = 0;
- return ansi;
-}
-
-#endif // GTEST_OS_WINDOWS_MOBILE
-
-// Compares two C strings. Returns true iff they have the same content.
-//
-// Unlike strcmp(), this function can handle NULL argument(s). A NULL
-// C string is considered different to any non-NULL C string,
-// including the empty string.
-bool String::CStringEquals(const char * lhs, const char * rhs) {
- if ( lhs == NULL ) return rhs == NULL;
-
- if ( rhs == NULL ) return false;
-
- return strcmp(lhs, rhs) == 0;
-}
-
-#if GTEST_HAS_STD_WSTRING || GTEST_HAS_GLOBAL_WSTRING
-
-// Converts an array of wide chars to a narrow string using the UTF-8
-// encoding, and streams the result to the given Message object.
-static void StreamWideCharsToMessage(const wchar_t* wstr, size_t length,
- Message* msg) {
- // TODO(wan): consider allowing a testing::String object to
- // contain '\0'. This will make it behave more like std::string,
- // and will allow ToUtf8String() to return the correct encoding
- // for '\0' s.t. we can get rid of the conditional here (and in
- // several other places).
- for (size_t i = 0; i != length; ) { // NOLINT
- if (wstr[i] != L'\0') {
- *msg << WideStringToUtf8(wstr + i, static_cast<int>(length - i));
- while (i != length && wstr[i] != L'\0')
- i++;
- } else {
- *msg << '\0';
- i++;
- }
- }
-}
-
-#endif // GTEST_HAS_STD_WSTRING || GTEST_HAS_GLOBAL_WSTRING
-
-} // namespace internal
-
-#if GTEST_HAS_STD_WSTRING
-// Converts the given wide string to a narrow string using the UTF-8
-// encoding, and streams the result to this Message object.
-Message& Message::operator <<(const ::std::wstring& wstr) {
- internal::StreamWideCharsToMessage(wstr.c_str(), wstr.length(), this);
- return *this;
-}
-#endif // GTEST_HAS_STD_WSTRING
-
-#if GTEST_HAS_GLOBAL_WSTRING
-// Converts the given wide string to a narrow string using the UTF-8
-// encoding, and streams the result to this Message object.
-Message& Message::operator <<(const ::wstring& wstr) {
- internal::StreamWideCharsToMessage(wstr.c_str(), wstr.length(), this);
- return *this;
-}
-#endif // GTEST_HAS_GLOBAL_WSTRING
-
-// AssertionResult constructors.
-// Used in EXPECT_TRUE/FALSE(assertion_result).
-AssertionResult::AssertionResult(const AssertionResult& other)
- : success_(other.success_),
- message_(other.message_.get() != NULL ?
- new ::std::string(*other.message_) :
- static_cast< ::std::string*>(NULL)) {
-}
-
-// Returns the assertion's negation. Used with EXPECT/ASSERT_FALSE.
-AssertionResult AssertionResult::operator!() const {
- AssertionResult negation(!success_);
- if (message_.get() != NULL)
- negation << *message_;
- return negation;
-}
-
-// Makes a successful assertion result.
-AssertionResult AssertionSuccess() {
- return AssertionResult(true);
-}
-
-// Makes a failed assertion result.
-AssertionResult AssertionFailure() {
- return AssertionResult(false);
-}
-
-// Makes a failed assertion result with the given failure message.
-// Deprecated; use AssertionFailure() << message.
-AssertionResult AssertionFailure(const Message& message) {
- return AssertionFailure() << message;
-}
-
-namespace internal {
-
-// Constructs and returns the message for an equality assertion
-// (e.g. ASSERT_EQ, EXPECT_STREQ, etc) failure.
-//
-// The first four parameters are the expressions used in the assertion
-// and their values, as strings. For example, for ASSERT_EQ(foo, bar)
-// where foo is 5 and bar is 6, we have:
-//
-// expected_expression: "foo"
-// actual_expression: "bar"
-// expected_value: "5"
-// actual_value: "6"
-//
-// The ignoring_case parameter is true iff the assertion is a
-// *_STRCASEEQ*. When it's true, the string " (ignoring case)" will
-// be inserted into the message.
-AssertionResult EqFailure(const char* expected_expression,
- const char* actual_expression,
- const String& expected_value,
- const String& actual_value,
- bool ignoring_case) {
- Message msg;
- msg << "Value of: " << actual_expression;
- if (actual_value != actual_expression) {
- msg << "\n Actual: " << actual_value;
- }
-
- msg << "\nExpected: " << expected_expression;
- if (ignoring_case) {
- msg << " (ignoring case)";
- }
- if (expected_value != expected_expression) {
- msg << "\nWhich is: " << expected_value;
- }
-
- return AssertionFailure() << msg;
-}
-
-// Constructs a failure message for Boolean assertions such as EXPECT_TRUE.
-String GetBoolAssertionFailureMessage(const AssertionResult& assertion_result,
- const char* expression_text,
- const char* actual_predicate_value,
- const char* expected_predicate_value) {
- const char* actual_message = assertion_result.message();
- Message msg;
- msg << "Value of: " << expression_text
- << "\n Actual: " << actual_predicate_value;
- if (actual_message[0] != '\0')
- msg << " (" << actual_message << ")";
- msg << "\nExpected: " << expected_predicate_value;
- return msg.GetString();
-}
-
-// Helper function for implementing ASSERT_NEAR.
-AssertionResult DoubleNearPredFormat(const char* expr1,
- const char* expr2,
- const char* abs_error_expr,
- double val1,
- double val2,
- double abs_error) {
- const double diff = fabs(val1 - val2);
- if (diff <= abs_error) return AssertionSuccess();
-
- // TODO(wan): do not print the value of an expression if it's
- // already a literal.
- return AssertionFailure()
- << "The difference between " << expr1 << " and " << expr2
- << " is " << diff << ", which exceeds " << abs_error_expr << ", where\n"
- << expr1 << " evaluates to " << val1 << ",\n"
- << expr2 << " evaluates to " << val2 << ", and\n"
- << abs_error_expr << " evaluates to " << abs_error << ".";
-}
-
-
-// Helper template for implementing FloatLE() and DoubleLE().
-template <typename RawType>
-AssertionResult FloatingPointLE(const char* expr1,
- const char* expr2,
- RawType val1,
- RawType val2) {
- // Returns success if val1 is less than val2,
- if (val1 < val2) {
- return AssertionSuccess();
- }
-
- // or if val1 is almost equal to val2.
- const FloatingPoint<RawType> lhs(val1), rhs(val2);
- if (lhs.AlmostEquals(rhs)) {
- return AssertionSuccess();
- }
-
- // Note that the above two checks will both fail if either val1 or
- // val2 is NaN, as the IEEE floating-point standard requires that
- // any predicate involving a NaN must return false.
-
- ::std::stringstream val1_ss;
- val1_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
- << val1;
-
- ::std::stringstream val2_ss;
- val2_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
- << val2;
-
- return AssertionFailure()
- << "Expected: (" << expr1 << ") <= (" << expr2 << ")\n"
- << " Actual: " << StringStreamToString(&val1_ss) << " vs "
- << StringStreamToString(&val2_ss);
-}
-
-} // namespace internal
-
-// Asserts that val1 is less than, or almost equal to, val2. Fails
-// otherwise. In particular, it fails if either val1 or val2 is NaN.
-AssertionResult FloatLE(const char* expr1, const char* expr2,
- float val1, float val2) {
- return internal::FloatingPointLE<float>(expr1, expr2, val1, val2);
-}
-
-// Asserts that val1 is less than, or almost equal to, val2. Fails
-// otherwise. In particular, it fails if either val1 or val2 is NaN.
-AssertionResult DoubleLE(const char* expr1, const char* expr2,
- double val1, double val2) {
- return internal::FloatingPointLE<double>(expr1, expr2, val1, val2);
-}
-
-namespace internal {
-
-// The helper function for {ASSERT|EXPECT}_EQ with int or enum
-// arguments.
-AssertionResult CmpHelperEQ(const char* expected_expression,
- const char* actual_expression,
- BiggestInt expected,
- BiggestInt actual) {
- if (expected == actual) {
- return AssertionSuccess();
- }
-
- return EqFailure(expected_expression,
- actual_expression,
- FormatForComparisonFailureMessage(expected, actual),
- FormatForComparisonFailureMessage(actual, expected),
- false);
-}
-
-// A macro for implementing the helper functions needed to implement
-// ASSERT_?? and EXPECT_?? with integer or enum arguments. It is here
-// just to avoid copy-and-paste of similar code.
-#define GTEST_IMPL_CMP_HELPER_(op_name, op)\
-AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \
- BiggestInt val1, BiggestInt val2) {\
- if (val1 op val2) {\
- return AssertionSuccess();\
- } else {\
- return AssertionFailure() \
- << "Expected: (" << expr1 << ") " #op " (" << expr2\
- << "), actual: " << FormatForComparisonFailureMessage(val1, val2)\
- << " vs " << FormatForComparisonFailureMessage(val2, val1);\
- }\
-}
-
-// Implements the helper function for {ASSERT|EXPECT}_NE with int or
-// enum arguments.
-GTEST_IMPL_CMP_HELPER_(NE, !=)
-// Implements the helper function for {ASSERT|EXPECT}_LE with int or
-// enum arguments.
-GTEST_IMPL_CMP_HELPER_(LE, <=)
-// Implements the helper function for {ASSERT|EXPECT}_LT with int or
-// enum arguments.
-GTEST_IMPL_CMP_HELPER_(LT, < )
-// Implements the helper function for {ASSERT|EXPECT}_GE with int or
-// enum arguments.
-GTEST_IMPL_CMP_HELPER_(GE, >=)
-// Implements the helper function for {ASSERT|EXPECT}_GT with int or
-// enum arguments.
-GTEST_IMPL_CMP_HELPER_(GT, > )
-
-#undef GTEST_IMPL_CMP_HELPER_
-
-// The helper function for {ASSERT|EXPECT}_STREQ.
-AssertionResult CmpHelperSTREQ(const char* expected_expression,
- const char* actual_expression,
- const char* expected,
- const char* actual) {
- if (String::CStringEquals(expected, actual)) {
- return AssertionSuccess();
- }
-
- return EqFailure(expected_expression,
- actual_expression,
- String::ShowCStringQuoted(expected),
- String::ShowCStringQuoted(actual),
- false);
-}
-
-// The helper function for {ASSERT|EXPECT}_STRCASEEQ.
-AssertionResult CmpHelperSTRCASEEQ(const char* expected_expression,
- const char* actual_expression,
- const char* expected,
- const char* actual) {
- if (String::CaseInsensitiveCStringEquals(expected, actual)) {
- return AssertionSuccess();
- }
-
- return EqFailure(expected_expression,
- actual_expression,
- String::ShowCStringQuoted(expected),
- String::ShowCStringQuoted(actual),
- true);
-}
-
-// The helper function for {ASSERT|EXPECT}_STRNE.
-AssertionResult CmpHelperSTRNE(const char* s1_expression,
- const char* s2_expression,
- const char* s1,
- const char* s2) {
- if (!String::CStringEquals(s1, s2)) {
- return AssertionSuccess();
- } else {
- return AssertionFailure() << "Expected: (" << s1_expression << ") != ("
- << s2_expression << "), actual: \""
- << s1 << "\" vs \"" << s2 << "\"";
- }
-}
-
-// The helper function for {ASSERT|EXPECT}_STRCASENE.
-AssertionResult CmpHelperSTRCASENE(const char* s1_expression,
- const char* s2_expression,
- const char* s1,
- const char* s2) {
- if (!String::CaseInsensitiveCStringEquals(s1, s2)) {
- return AssertionSuccess();
- } else {
- return AssertionFailure()
- << "Expected: (" << s1_expression << ") != ("
- << s2_expression << ") (ignoring case), actual: \""
- << s1 << "\" vs \"" << s2 << "\"";
- }
-}
-
-} // namespace internal
-
-namespace {
-
-// Helper functions for implementing IsSubString() and IsNotSubstring().
-
-// This group of overloaded functions return true iff needle is a
-// substring of haystack. NULL is considered a substring of itself
-// only.
-
-bool IsSubstringPred(const char* needle, const char* haystack) {
- if (needle == NULL || haystack == NULL)
- return needle == haystack;
-
- return strstr(haystack, needle) != NULL;
-}
-
-bool IsSubstringPred(const wchar_t* needle, const wchar_t* haystack) {
- if (needle == NULL || haystack == NULL)
- return needle == haystack;
-
- return wcsstr(haystack, needle) != NULL;
-}
-
-// StringType here can be either ::std::string or ::std::wstring.
-template <typename StringType>
-bool IsSubstringPred(const StringType& needle,
- const StringType& haystack) {
- return haystack.find(needle) != StringType::npos;
-}
-
-// This function implements either IsSubstring() or IsNotSubstring(),
-// depending on the value of the expected_to_be_substring parameter.
-// StringType here can be const char*, const wchar_t*, ::std::string,
-// or ::std::wstring.
-template <typename StringType>
-AssertionResult IsSubstringImpl(
- bool expected_to_be_substring,
- const char* needle_expr, const char* haystack_expr,
- const StringType& needle, const StringType& haystack) {
- if (IsSubstringPred(needle, haystack) == expected_to_be_substring)
- return AssertionSuccess();
-
- const bool is_wide_string = sizeof(needle[0]) > 1;
- const char* const begin_string_quote = is_wide_string ? "L\"" : "\"";
- return AssertionFailure()
- << "Value of: " << needle_expr << "\n"
- << " Actual: " << begin_string_quote << needle << "\"\n"
- << "Expected: " << (expected_to_be_substring ? "" : "not ")
- << "a substring of " << haystack_expr << "\n"
- << "Which is: " << begin_string_quote << haystack << "\"";
-}
-
-} // namespace
-
-// IsSubstring() and IsNotSubstring() check whether needle is a
-// substring of haystack (NULL is considered a substring of itself
-// only), and return an appropriate error message when they fail.
-
-AssertionResult IsSubstring(
- const char* needle_expr, const char* haystack_expr,
- const char* needle, const char* haystack) {
- return IsSubstringImpl(true, needle_expr, haystack_expr, needle, haystack);
-}
-
-AssertionResult IsSubstring(
- const char* needle_expr, const char* haystack_expr,
- const wchar_t* needle, const wchar_t* haystack) {
- return IsSubstringImpl(true, needle_expr, haystack_expr, needle, haystack);
-}
-
-AssertionResult IsNotSubstring(
- const char* needle_expr, const char* haystack_expr,
- const char* needle, const char* haystack) {
- return IsSubstringImpl(false, needle_expr, haystack_expr, needle, haystack);
-}
-
-AssertionResult IsNotSubstring(
- const char* needle_expr, const char* haystack_expr,
- const wchar_t* needle, const wchar_t* haystack) {
- return IsSubstringImpl(false, needle_expr, haystack_expr, needle, haystack);
-}
-
-AssertionResult IsSubstring(
- const char* needle_expr, const char* haystack_expr,
- const ::std::string& needle, const ::std::string& haystack) {
- return IsSubstringImpl(true, needle_expr, haystack_expr, needle, haystack);
-}
-
-AssertionResult IsNotSubstring(
- const char* needle_expr, const char* haystack_expr,
- const ::std::string& needle, const ::std::string& haystack) {
- return IsSubstringImpl(false, needle_expr, haystack_expr, needle, haystack);
-}
-
-#if GTEST_HAS_STD_WSTRING
-AssertionResult IsSubstring(
- const char* needle_expr, const char* haystack_expr,
- const ::std::wstring& needle, const ::std::wstring& haystack) {
- return IsSubstringImpl(true, needle_expr, haystack_expr, needle, haystack);
-}
-
-AssertionResult IsNotSubstring(
- const char* needle_expr, const char* haystack_expr,
- const ::std::wstring& needle, const ::std::wstring& haystack) {
- return IsSubstringImpl(false, needle_expr, haystack_expr, needle, haystack);
-}
-#endif // GTEST_HAS_STD_WSTRING
-
-namespace internal {
-
-#if GTEST_OS_WINDOWS
-
-namespace {
-
-// Helper function for IsHRESULT{SuccessFailure} predicates
-AssertionResult HRESULTFailureHelper(const char* expr,
- const char* expected,
- long hr) { // NOLINT
-# if GTEST_OS_WINDOWS_MOBILE
-
- // Windows CE doesn't support FormatMessage.
- const char error_text[] = "";
-
-# else
-
- // Looks up the human-readable system message for the HRESULT code
- // and since we're not passing any params to FormatMessage, we don't
- // want inserts expanded.
- const DWORD kFlags = FORMAT_MESSAGE_FROM_SYSTEM |
- FORMAT_MESSAGE_IGNORE_INSERTS;
- const DWORD kBufSize = 4096; // String::Format can't exceed this length.
- // Gets the system's human readable message string for this HRESULT.
- char error_text[kBufSize] = { '\0' };
- DWORD message_length = ::FormatMessageA(kFlags,
- 0, // no source, we're asking system
- hr, // the error
- 0, // no line width restrictions
- error_text, // output buffer
- kBufSize, // buf size
- NULL); // no arguments for inserts
- // Trims tailing white space (FormatMessage leaves a trailing cr-lf)
- for (; message_length && IsSpace(error_text[message_length - 1]);
- --message_length) {
- error_text[message_length - 1] = '\0';
- }
-
-# endif // GTEST_OS_WINDOWS_MOBILE
-
- const String error_hex(String::Format("0x%08X ", hr));
- return ::testing::AssertionFailure()
- << "Expected: " << expr << " " << expected << ".\n"
- << " Actual: " << error_hex << error_text << "\n";
-}
-
-} // namespace
-
-AssertionResult IsHRESULTSuccess(const char* expr, long hr) { // NOLINT
- if (SUCCEEDED(hr)) {
- return AssertionSuccess();
- }
- return HRESULTFailureHelper(expr, "succeeds", hr);
-}
-
-AssertionResult IsHRESULTFailure(const char* expr, long hr) { // NOLINT
- if (FAILED(hr)) {
- return AssertionSuccess();
- }
- return HRESULTFailureHelper(expr, "fails", hr);
-}
-
-#endif // GTEST_OS_WINDOWS
-
-// Utility functions for encoding Unicode text (wide strings) in
-// UTF-8.
-
-// A Unicode code-point can have upto 21 bits, and is encoded in UTF-8
-// like this:
-//
-// Code-point length Encoding
-// 0 - 7 bits 0xxxxxxx
-// 8 - 11 bits 110xxxxx 10xxxxxx
-// 12 - 16 bits 1110xxxx 10xxxxxx 10xxxxxx
-// 17 - 21 bits 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
-
-// The maximum code-point a one-byte UTF-8 sequence can represent.
-const UInt32 kMaxCodePoint1 = (static_cast<UInt32>(1) << 7) - 1;
-
-// The maximum code-point a two-byte UTF-8 sequence can represent.
-const UInt32 kMaxCodePoint2 = (static_cast<UInt32>(1) << (5 + 6)) - 1;
-
-// The maximum code-point a three-byte UTF-8 sequence can represent.
-const UInt32 kMaxCodePoint3 = (static_cast<UInt32>(1) << (4 + 2*6)) - 1;
-
-// The maximum code-point a four-byte UTF-8 sequence can represent.
-const UInt32 kMaxCodePoint4 = (static_cast<UInt32>(1) << (3 + 3*6)) - 1;
-
-// Chops off the n lowest bits from a bit pattern. Returns the n
-// lowest bits. As a side effect, the original bit pattern will be
-// shifted to the right by n bits.
-inline UInt32 ChopLowBits(UInt32* bits, int n) {
- const UInt32 low_bits = *bits & ((static_cast<UInt32>(1) << n) - 1);
- *bits >>= n;
- return low_bits;
-}
-
-// Converts a Unicode code point to a narrow string in UTF-8 encoding.
-// code_point parameter is of type UInt32 because wchar_t may not be
-// wide enough to contain a code point.
-// The output buffer str must containt at least 32 characters.
-// The function returns the address of the output buffer.
-// If the code_point is not a valid Unicode code point
-// (i.e. outside of Unicode range U+0 to U+10FFFF) it will be output
-// as '(Invalid Unicode 0xXXXXXXXX)'.
-char* CodePointToUtf8(UInt32 code_point, char* str) {
- if (code_point <= kMaxCodePoint1) {
- str[1] = '\0';
- str[0] = static_cast<char>(code_point); // 0xxxxxxx
- } else if (code_point <= kMaxCodePoint2) {
- str[2] = '\0';
- str[1] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6)); // 10xxxxxx
- str[0] = static_cast<char>(0xC0 | code_point); // 110xxxxx
- } else if (code_point <= kMaxCodePoint3) {
- str[3] = '\0';
- str[2] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6)); // 10xxxxxx
- str[1] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6)); // 10xxxxxx
- str[0] = static_cast<char>(0xE0 | code_point); // 1110xxxx
- } else if (code_point <= kMaxCodePoint4) {
- str[4] = '\0';
- str[3] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6)); // 10xxxxxx
- str[2] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6)); // 10xxxxxx
- str[1] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6)); // 10xxxxxx
- str[0] = static_cast<char>(0xF0 | code_point); // 11110xxx
- } else {
- // The longest string String::Format can produce when invoked
- // with these parameters is 28 character long (not including
- // the terminating nul character). We are asking for 32 character
- // buffer just in case. This is also enough for strncpy to
- // null-terminate the destination string.
- posix::StrNCpy(
- str, String::Format("(Invalid Unicode 0x%X)", code_point).c_str(), 32);
- str[31] = '\0'; // Makes sure no change in the format to strncpy leaves
- // the result unterminated.
- }
- return str;
-}
-
-// The following two functions only make sense if the the system
-// uses UTF-16 for wide string encoding. All supported systems
-// with 16 bit wchar_t (Windows, Cygwin, Symbian OS) do use UTF-16.
-
-// Determines if the arguments constitute UTF-16 surrogate pair
-// and thus should be combined into a single Unicode code point
-// using CreateCodePointFromUtf16SurrogatePair.
-inline bool IsUtf16SurrogatePair(wchar_t first, wchar_t second) {
- return sizeof(wchar_t) == 2 &&
- (first & 0xFC00) == 0xD800 && (second & 0xFC00) == 0xDC00;
-}
-
-// Creates a Unicode code point from UTF16 surrogate pair.
-inline UInt32 CreateCodePointFromUtf16SurrogatePair(wchar_t first,
- wchar_t second) {
- const UInt32 mask = (1 << 10) - 1;
- return (sizeof(wchar_t) == 2) ?
- (((first & mask) << 10) | (second & mask)) + 0x10000 :
- // This function should not be called when the condition is
- // false, but we provide a sensible default in case it is.
- static_cast<UInt32>(first);
-}
-
-// Converts a wide string to a narrow string in UTF-8 encoding.
-// The wide string is assumed to have the following encoding:
-// UTF-16 if sizeof(wchar_t) == 2 (on Windows, Cygwin, Symbian OS)
-// UTF-32 if sizeof(wchar_t) == 4 (on Linux)
-// Parameter str points to a null-terminated wide string.
-// Parameter num_chars may additionally limit the number
-// of wchar_t characters processed. -1 is used when the entire string
-// should be processed.
-// If the string contains code points that are not valid Unicode code points
-// (i.e. outside of Unicode range U+0 to U+10FFFF) they will be output
-// as '(Invalid Unicode 0xXXXXXXXX)'. If the string is in UTF16 encoding
-// and contains invalid UTF-16 surrogate pairs, values in those pairs
-// will be encoded as individual Unicode characters from Basic Normal Plane.
-String WideStringToUtf8(const wchar_t* str, int num_chars) {
- if (num_chars == -1)
- num_chars = static_cast<int>(wcslen(str));
-
- ::std::stringstream stream;
- for (int i = 0; i < num_chars; ++i) {
- UInt32 unicode_code_point;
-
- if (str[i] == L'\0') {
- break;
- } else if (i + 1 < num_chars && IsUtf16SurrogatePair(str[i], str[i + 1])) {
- unicode_code_point = CreateCodePointFromUtf16SurrogatePair(str[i],
- str[i + 1]);
- i++;
- } else {
- unicode_code_point = static_cast<UInt32>(str[i]);
- }
-
- char buffer[32]; // CodePointToUtf8 requires a buffer this big.
- stream << CodePointToUtf8(unicode_code_point, buffer);
- }
- return StringStreamToString(&stream);
-}
-
-// Converts a wide C string to a String using the UTF-8 encoding.
-// NULL will be converted to "(null)".
-String String::ShowWideCString(const wchar_t * wide_c_str) {
- if (wide_c_str == NULL) return String("(null)");
-
- return String(internal::WideStringToUtf8(wide_c_str, -1).c_str());
-}
-
-// Similar to ShowWideCString(), except that this function encloses
-// the converted string in double quotes.
-String String::ShowWideCStringQuoted(const wchar_t* wide_c_str) {
- if (wide_c_str == NULL) return String("(null)");
-
- return String::Format("L\"%s\"",
- String::ShowWideCString(wide_c_str).c_str());
-}
-
-// Compares two wide C strings. Returns true iff they have the same
-// content.
-//
-// Unlike wcscmp(), this function can handle NULL argument(s). A NULL
-// C string is considered different to any non-NULL C string,
-// including the empty string.
-bool String::WideCStringEquals(const wchar_t * lhs, const wchar_t * rhs) {
- if (lhs == NULL) return rhs == NULL;
-
- if (rhs == NULL) return false;
-
- return wcscmp(lhs, rhs) == 0;
-}
-
-// Helper function for *_STREQ on wide strings.
-AssertionResult CmpHelperSTREQ(const char* expected_expression,
- const char* actual_expression,
- const wchar_t* expected,
- const wchar_t* actual) {
- if (String::WideCStringEquals(expected, actual)) {
- return AssertionSuccess();
- }
-
- return EqFailure(expected_expression,
- actual_expression,
- String::ShowWideCStringQuoted(expected),
- String::ShowWideCStringQuoted(actual),
- false);
-}
-
-// Helper function for *_STRNE on wide strings.
-AssertionResult CmpHelperSTRNE(const char* s1_expression,
- const char* s2_expression,
- const wchar_t* s1,
- const wchar_t* s2) {
- if (!String::WideCStringEquals(s1, s2)) {
- return AssertionSuccess();
- }
-
- return AssertionFailure() << "Expected: (" << s1_expression << ") != ("
- << s2_expression << "), actual: "
- << String::ShowWideCStringQuoted(s1)
- << " vs " << String::ShowWideCStringQuoted(s2);
-}
-
-// Compares two C strings, ignoring case. Returns true iff they have
-// the same content.
-//
-// Unlike strcasecmp(), this function can handle NULL argument(s). A
-// NULL C string is considered different to any non-NULL C string,
-// including the empty string.
-bool String::CaseInsensitiveCStringEquals(const char * lhs, const char * rhs) {
- if (lhs == NULL)
- return rhs == NULL;
- if (rhs == NULL)
- return false;
- return posix::StrCaseCmp(lhs, rhs) == 0;
-}
-
- // Compares two wide C strings, ignoring case. Returns true iff they
- // have the same content.
- //
- // Unlike wcscasecmp(), this function can handle NULL argument(s).
- // A NULL C string is considered different to any non-NULL wide C string,
- // including the empty string.
- // NB: The implementations on different platforms slightly differ.
- // On windows, this method uses _wcsicmp which compares according to LC_CTYPE
- // environment variable. On GNU platform this method uses wcscasecmp
- // which compares according to LC_CTYPE category of the current locale.
- // On MacOS X, it uses towlower, which also uses LC_CTYPE category of the
- // current locale.
-bool String::CaseInsensitiveWideCStringEquals(const wchar_t* lhs,
- const wchar_t* rhs) {
- if (lhs == NULL) return rhs == NULL;
-
- if (rhs == NULL) return false;
-
-#if GTEST_OS_WINDOWS
- return _wcsicmp(lhs, rhs) == 0;
-#elif GTEST_OS_LINUX && !GTEST_OS_LINUX_ANDROID
- return wcscasecmp(lhs, rhs) == 0;
-#else
- // Android, Mac OS X and Cygwin don't define wcscasecmp.
- // Other unknown OSes may not define it either.
- wint_t left, right;
- do {
- left = towlower(*lhs++);
- right = towlower(*rhs++);
- } while (left && left == right);
- return left == right;
-#endif // OS selector
-}
-
-// Compares this with another String.
-// Returns < 0 if this is less than rhs, 0 if this is equal to rhs, or > 0
-// if this is greater than rhs.
-int String::Compare(const String & rhs) const {
- const char* const lhs_c_str = c_str();
- const char* const rhs_c_str = rhs.c_str();
-
- if (lhs_c_str == NULL) {
- return rhs_c_str == NULL ? 0 : -1; // NULL < anything except NULL
- } else if (rhs_c_str == NULL) {
- return 1;
- }
-
- const size_t shorter_str_len =
- length() <= rhs.length() ? length() : rhs.length();
- for (size_t i = 0; i != shorter_str_len; i++) {
- if (lhs_c_str[i] < rhs_c_str[i]) {
- return -1;
- } else if (lhs_c_str[i] > rhs_c_str[i]) {
- return 1;
- }
- }
- return (length() < rhs.length()) ? -1 :
- (length() > rhs.length()) ? 1 : 0;
-}
-
-// Returns true iff this String ends with the given suffix. *Any*
-// String is considered to end with a NULL or empty suffix.
-bool String::EndsWith(const char* suffix) const {
- if (suffix == NULL || CStringEquals(suffix, "")) return true;
-
- if (c_str() == NULL) return false;
-
- const size_t this_len = strlen(c_str());
- const size_t suffix_len = strlen(suffix);
- return (this_len >= suffix_len) &&
- CStringEquals(c_str() + this_len - suffix_len, suffix);
-}
-
-// Returns true iff this String ends with the given suffix, ignoring case.
-// Any String is considered to end with a NULL or empty suffix.
-bool String::EndsWithCaseInsensitive(const char* suffix) const {
- if (suffix == NULL || CStringEquals(suffix, "")) return true;
-
- if (c_str() == NULL) return false;
-
- const size_t this_len = strlen(c_str());
- const size_t suffix_len = strlen(suffix);
- return (this_len >= suffix_len) &&
- CaseInsensitiveCStringEquals(c_str() + this_len - suffix_len, suffix);
-}
-
-// Formats a list of arguments to a String, using the same format
-// spec string as for printf.
-//
-// We do not use the StringPrintf class as it is not universally
-// available.
-//
-// The result is limited to 4096 characters (including the tailing 0).
-// If 4096 characters are not enough to format the input, or if
-// there's an error, "<formatting error or buffer exceeded>" is
-// returned.
-String String::Format(const char * format, ...) {
- va_list args;
- va_start(args, format);
-
- char buffer[4096];
- const int kBufferSize = sizeof(buffer)/sizeof(buffer[0]);
-
- // MSVC 8 deprecates vsnprintf(), so we want to suppress warning
- // 4996 (deprecated function) there.
-#ifdef _MSC_VER // We are using MSVC.
-# pragma warning(push) // Saves the current warning state.
-# pragma warning(disable:4996) // Temporarily disables warning 4996.
-
- const int size = vsnprintf(buffer, kBufferSize, format, args);
-
-# pragma warning(pop) // Restores the warning state.
-#else // We are not using MSVC.
- const int size = vsnprintf(buffer, kBufferSize, format, args);
-#endif // _MSC_VER
- va_end(args);
-
- // vsnprintf()'s behavior is not portable. When the buffer is not
- // big enough, it returns a negative value in MSVC, and returns the
- // needed buffer size on Linux. When there is an output error, it
- // always returns a negative value. For simplicity, we lump the two
- // error cases together.
- if (size < 0 || size >= kBufferSize) {
- return String("<formatting error or buffer exceeded>");
- } else {
- return String(buffer, size);
- }
-}
-
-// Converts the buffer in a stringstream to a String, converting NUL
-// bytes to "\\0" along the way.
-String StringStreamToString(::std::stringstream* ss) {
- const ::std::string& str = ss->str();
- const char* const start = str.c_str();
- const char* const end = start + str.length();
-
- // We need to use a helper stringstream to do this transformation
- // because String doesn't support push_back().
- ::std::stringstream helper;
- for (const char* ch = start; ch != end; ++ch) {
- if (*ch == '\0') {
- helper << "\\0"; // Replaces NUL with "\\0";
- } else {
- helper.put(*ch);
- }
- }
-
- return String(helper.str().c_str());
-}
-
-// Appends the user-supplied message to the Google-Test-generated message.
-String AppendUserMessage(const String& gtest_msg,
- const Message& user_msg) {
- // Appends the user message if it's non-empty.
- const String user_msg_string = user_msg.GetString();
- if (user_msg_string.empty()) {
- return gtest_msg;
- }
-
- Message msg;
- msg << gtest_msg << "\n" << user_msg_string;
-
- return msg.GetString();
-}
-
-} // namespace internal
-
-// class TestResult
-
-// Creates an empty TestResult.
-TestResult::TestResult()
- : death_test_count_(0),
- elapsed_time_(0) {
-}
-
-// D'tor.
-TestResult::~TestResult() {
-}
-
-// Returns the i-th test part result among all the results. i can
-// range from 0 to total_part_count() - 1. If i is not in that range,
-// aborts the program.
-const TestPartResult& TestResult::GetTestPartResult(int i) const {
- if (i < 0 || i >= total_part_count())
- internal::posix::Abort();
- return test_part_results_.at(i);
-}
-
-// Returns the i-th test property. i can range from 0 to
-// test_property_count() - 1. If i is not in that range, aborts the
-// program.
-const TestProperty& TestResult::GetTestProperty(int i) const {
- if (i < 0 || i >= test_property_count())
- internal::posix::Abort();
- return test_properties_.at(i);
-}
-
-// Clears the test part results.
-void TestResult::ClearTestPartResults() {
- test_part_results_.clear();
-}
-
-// Adds a test part result to the list.
-void TestResult::AddTestPartResult(const TestPartResult& test_part_result) {
- test_part_results_.push_back(test_part_result);
-}
-
-// Adds a test property to the list. If a property with the same key as the
-// supplied property is already represented, the value of this test_property
-// replaces the old value for that key.
-void TestResult::RecordProperty(const TestProperty& test_property) {
- if (!ValidateTestProperty(test_property)) {
- return;
- }
- internal::MutexLock lock(&test_properites_mutex_);
- const std::vector<TestProperty>::iterator property_with_matching_key =
- std::find_if(test_properties_.begin(), test_properties_.end(),
- internal::TestPropertyKeyIs(test_property.key()));
- if (property_with_matching_key == test_properties_.end()) {
- test_properties_.push_back(test_property);
- return;
- }
- property_with_matching_key->SetValue(test_property.value());
-}
-
-// Adds a failure if the key is a reserved attribute of Google Test
-// testcase tags. Returns true if the property is valid.
-bool TestResult::ValidateTestProperty(const TestProperty& test_property) {
- internal::String key(test_property.key());
- if (key == "name" || key == "status" || key == "time" || key == "classname") {
- ADD_FAILURE()
- << "Reserved key used in RecordProperty(): "
- << key
- << " ('name', 'status', 'time', and 'classname' are reserved by "
- << GTEST_NAME_ << ")";
- return false;
- }
- return true;
-}
-
-// Clears the object.
-void TestResult::Clear() {
- test_part_results_.clear();
- test_properties_.clear();
- death_test_count_ = 0;
- elapsed_time_ = 0;
-}
-
-// Returns true iff the test failed.
-bool TestResult::Failed() const {
- for (int i = 0; i < total_part_count(); ++i) {
- if (GetTestPartResult(i).failed())
- return true;
- }
- return false;
-}
-
-// Returns true iff the test part fatally failed.
-static bool TestPartFatallyFailed(const TestPartResult& result) {
- return result.fatally_failed();
-}
-
-// Returns true iff the test fatally failed.
-bool TestResult::HasFatalFailure() const {
- return CountIf(test_part_results_, TestPartFatallyFailed) > 0;
-}
-
-// Returns true iff the test part non-fatally failed.
-static bool TestPartNonfatallyFailed(const TestPartResult& result) {
- return result.nonfatally_failed();
-}
-
-// Returns true iff the test has a non-fatal failure.
-bool TestResult::HasNonfatalFailure() const {
- return CountIf(test_part_results_, TestPartNonfatallyFailed) > 0;
-}
-
-// Gets the number of all test parts. This is the sum of the number
-// of successful test parts and the number of failed test parts.
-int TestResult::total_part_count() const {
- return static_cast<int>(test_part_results_.size());
-}
-
-// Returns the number of the test properties.
-int TestResult::test_property_count() const {
- return static_cast<int>(test_properties_.size());
-}
-
-// class Test
-
-// Creates a Test object.
-
-// The c'tor saves the values of all Google Test flags.
-Test::Test()
- : gtest_flag_saver_(new internal::GTestFlagSaver) {
-}
-
-// The d'tor restores the values of all Google Test flags.
-Test::~Test() {
- delete gtest_flag_saver_;
-}
-
-// Sets up the test fixture.
-//
-// A sub-class may override this.
-void Test::SetUp() {
-}
-
-// Tears down the test fixture.
-//
-// A sub-class may override this.
-void Test::TearDown() {
-}
-
-// Allows user supplied key value pairs to be recorded for later output.
-void Test::RecordProperty(const char* key, const char* value) {
- UnitTest::GetInstance()->RecordPropertyForCurrentTest(key, value);
-}
-
-// Allows user supplied key value pairs to be recorded for later output.
-void Test::RecordProperty(const char* key, int value) {
- Message value_message;
- value_message << value;
- RecordProperty(key, value_message.GetString().c_str());
-}
-
-namespace internal {
-
-void ReportFailureInUnknownLocation(TestPartResult::Type result_type,
- const String& message) {
- // This function is a friend of UnitTest and as such has access to
- // AddTestPartResult.
- UnitTest::GetInstance()->AddTestPartResult(
- result_type,
- NULL, // No info about the source file where the exception occurred.
- -1, // We have no info on which line caused the exception.
- message,
- String()); // No stack trace, either.
-}
-
-} // namespace internal
-
-// Google Test requires all tests in the same test case to use the same test
-// fixture class. This function checks if the current test has the
-// same fixture class as the first test in the current test case. If
-// yes, it returns true; otherwise it generates a Google Test failure and
-// returns false.
-bool Test::HasSameFixtureClass() {
- internal::UnitTestImpl* const impl = internal::GetUnitTestImpl();
- const TestCase* const test_case = impl->current_test_case();
-
- // Info about the first test in the current test case.
- const TestInfo* const first_test_info = test_case->test_info_list()[0];
- const internal::TypeId first_fixture_id = first_test_info->fixture_class_id_;
- const char* const first_test_name = first_test_info->name();
-
- // Info about the current test.
- const TestInfo* const this_test_info = impl->current_test_info();
- const internal::TypeId this_fixture_id = this_test_info->fixture_class_id_;
- const char* const this_test_name = this_test_info->name();
-
- if (this_fixture_id != first_fixture_id) {
- // Is the first test defined using TEST?
- const bool first_is_TEST = first_fixture_id == internal::GetTestTypeId();
- // Is this test defined using TEST?
- const bool this_is_TEST = this_fixture_id == internal::GetTestTypeId();
-
- if (first_is_TEST || this_is_TEST) {
- // The user mixed TEST and TEST_F in this test case - we'll tell
- // him/her how to fix it.
-
- // Gets the name of the TEST and the name of the TEST_F. Note
- // that first_is_TEST and this_is_TEST cannot both be true, as
- // the fixture IDs are different for the two tests.
- const char* const TEST_name =
- first_is_TEST ? first_test_name : this_test_name;
- const char* const TEST_F_name =
- first_is_TEST ? this_test_name : first_test_name;
-
- ADD_FAILURE()
- << "All tests in the same test case must use the same test fixture\n"
- << "class, so mixing TEST_F and TEST in the same test case is\n"
- << "illegal. In test case " << this_test_info->test_case_name()
- << ",\n"
- << "test " << TEST_F_name << " is defined using TEST_F but\n"
- << "test " << TEST_name << " is defined using TEST. You probably\n"
- << "want to change the TEST to TEST_F or move it to another test\n"
- << "case.";
- } else {
- // The user defined two fixture classes with the same name in
- // two namespaces - we'll tell him/her how to fix it.
- ADD_FAILURE()
- << "All tests in the same test case must use the same test fixture\n"
- << "class. However, in test case "
- << this_test_info->test_case_name() << ",\n"
- << "you defined test " << first_test_name
- << " and test " << this_test_name << "\n"
- << "using two different test fixture classes. This can happen if\n"
- << "the two classes are from different namespaces or translation\n"
- << "units and have the same name. You should probably rename one\n"
- << "of the classes to put the tests into different test cases.";
- }
- return false;
- }
-
- return true;
-}
-
-#if GTEST_HAS_SEH
-
-// Adds an "exception thrown" fatal failure to the current test. This
-// function returns its result via an output parameter pointer because VC++
-// prohibits creation of objects with destructors on stack in functions
-// using __try (see error C2712).
-static internal::String* FormatSehExceptionMessage(DWORD exception_code,
- const char* location) {
- Message message;
- message << "SEH exception with code 0x" << std::setbase(16) <<
- exception_code << std::setbase(10) << " thrown in " << location << ".";
-
- return new internal::String(message.GetString());
-}
-
-#endif // GTEST_HAS_SEH
-
-#if GTEST_HAS_EXCEPTIONS
-
-// Adds an "exception thrown" fatal failure to the current test.
-static internal::String FormatCxxExceptionMessage(const char* description,
- const char* location) {
- Message message;
- if (description != NULL) {
- message << "C++ exception with description \"" << description << "\"";
- } else {
- message << "Unknown C++ exception";
- }
- message << " thrown in " << location << ".";
-
- return message.GetString();
-}
-
-static internal::String PrintTestPartResultToString(
- const TestPartResult& test_part_result);
-
-// A failed Google Test assertion will throw an exception of this type when
-// GTEST_FLAG(throw_on_failure) is true (if exceptions are enabled). We
-// derive it from std::runtime_error, which is for errors presumably
-// detectable only at run time. Since std::runtime_error inherits from
-// std::exception, many testing frameworks know how to extract and print the
-// message inside it.
-class GoogleTestFailureException : public ::std::runtime_error {
- public:
- explicit GoogleTestFailureException(const TestPartResult& failure)
- : ::std::runtime_error(PrintTestPartResultToString(failure).c_str()) {}
-};
-#endif // GTEST_HAS_EXCEPTIONS
-
-namespace internal {
-// We put these helper functions in the internal namespace as IBM's xlC
-// compiler rejects the code if they were declared static.
-
-// Runs the given method and handles SEH exceptions it throws, when
-// SEH is supported; returns the 0-value for type Result in case of an
-// SEH exception. (Microsoft compilers cannot handle SEH and C++
-// exceptions in the same function. Therefore, we provide a separate
-// wrapper function for handling SEH exceptions.)
-template <class T, typename Result>
-Result HandleSehExceptionsInMethodIfSupported(
- T* object, Result (T::*method)(), const char* location) {
-#if GTEST_HAS_SEH
- __try {
- return (object->*method)();
- } __except (internal::UnitTestOptions::GTestShouldProcessSEH( // NOLINT
- GetExceptionCode())) {
- // We create the exception message on the heap because VC++ prohibits
- // creation of objects with destructors on stack in functions using __try
- // (see error C2712).
- internal::String* exception_message = FormatSehExceptionMessage(
- GetExceptionCode(), location);
- internal::ReportFailureInUnknownLocation(TestPartResult::kFatalFailure,
- *exception_message);
- delete exception_message;
- return static_cast<Result>(0);
- }
-#else
- (void)location;
- return (object->*method)();
-#endif // GTEST_HAS_SEH
-}
-
-// Runs the given method and catches and reports C++ and/or SEH-style
-// exceptions, if they are supported; returns the 0-value for type
-// Result in case of an SEH exception.
-template <class T, typename Result>
-Result HandleExceptionsInMethodIfSupported(
- T* object, Result (T::*method)(), const char* location) {
- // NOTE: The user code can affect the way in which Google Test handles
- // exceptions by setting GTEST_FLAG(catch_exceptions), but only before
- // RUN_ALL_TESTS() starts. It is technically possible to check the flag
- // after the exception is caught and either report or re-throw the
- // exception based on the flag's value:
- //
- // try {
- // // Perform the test method.
- // } catch (...) {
- // if (GTEST_FLAG(catch_exceptions))
- // // Report the exception as failure.
- // else
- // throw; // Re-throws the original exception.
- // }
- //
- // However, the purpose of this flag is to allow the program to drop into
- // the debugger when the exception is thrown. On most platforms, once the
- // control enters the catch block, the exception origin information is
- // lost and the debugger will stop the program at the point of the
- // re-throw in this function -- instead of at the point of the original
- // throw statement in the code under test. For this reason, we perform
- // the check early, sacrificing the ability to affect Google Test's
- // exception handling in the method where the exception is thrown.
- if (internal::GetUnitTestImpl()->catch_exceptions()) {
-#if GTEST_HAS_EXCEPTIONS
- try {
- return HandleSehExceptionsInMethodIfSupported(object, method, location);
- } catch (const GoogleTestFailureException&) { // NOLINT
- // This exception doesn't originate in code under test. It makes no
- // sense to report it as a test failure.
- throw;
- } catch (const std::exception& e) { // NOLINT
- internal::ReportFailureInUnknownLocation(
- TestPartResult::kFatalFailure,
- FormatCxxExceptionMessage(e.what(), location));
- } catch (...) { // NOLINT
- internal::ReportFailureInUnknownLocation(
- TestPartResult::kFatalFailure,
- FormatCxxExceptionMessage(NULL, location));
- }
- return static_cast<Result>(0);
-#else
- return HandleSehExceptionsInMethodIfSupported(object, method, location);
-#endif // GTEST_HAS_EXCEPTIONS
- } else {
- return (object->*method)();
- }
-}
-
-} // namespace internal
-
-// Runs the test and updates the test result.
-void Test::Run() {
- if (!HasSameFixtureClass()) return;
-
- internal::UnitTestImpl* const impl = internal::GetUnitTestImpl();
- impl->os_stack_trace_getter()->UponLeavingGTest();
- internal::HandleExceptionsInMethodIfSupported(this, &Test::SetUp, "SetUp()");
- // We will run the test only if SetUp() was successful.
- if (!HasFatalFailure()) {
- impl->os_stack_trace_getter()->UponLeavingGTest();
- internal::HandleExceptionsInMethodIfSupported(
- this, &Test::TestBody, "the test body");
- }
-
- // However, we want to clean up as much as possible. Hence we will
- // always call TearDown(), even if SetUp() or the test body has
- // failed.
- impl->os_stack_trace_getter()->UponLeavingGTest();
- internal::HandleExceptionsInMethodIfSupported(
- this, &Test::TearDown, "TearDown()");
-}
-
-// Returns true iff the current test has a fatal failure.
-bool Test::HasFatalFailure() {
- return internal::GetUnitTestImpl()->current_test_result()->HasFatalFailure();
-}
-
-// Returns true iff the current test has a non-fatal failure.
-bool Test::HasNonfatalFailure() {
- return internal::GetUnitTestImpl()->current_test_result()->
- HasNonfatalFailure();
-}
-
-// class TestInfo
-
-// Constructs a TestInfo object. It assumes ownership of the test factory
-// object.
-// TODO(vladl@google.com): Make a_test_case_name and a_name const string&'s
-// to signify they cannot be NULLs.
-TestInfo::TestInfo(const char* a_test_case_name,
- const char* a_name,
- const char* a_type_param,
- const char* a_value_param,
- internal::TypeId fixture_class_id,
- internal::TestFactoryBase* factory)
- : test_case_name_(a_test_case_name),
- name_(a_name),
- type_param_(a_type_param ? new std::string(a_type_param) : NULL),
- value_param_(a_value_param ? new std::string(a_value_param) : NULL),
- fixture_class_id_(fixture_class_id),
- should_run_(false),
- is_disabled_(false),
- matches_filter_(false),
- factory_(factory),
- result_() {}
-
-// Destructs a TestInfo object.
-TestInfo::~TestInfo() { delete factory_; }
-
-namespace internal {
-
-// Creates a new TestInfo object and registers it with Google Test;
-// returns the created object.
-//
-// Arguments:
-//
-// test_case_name: name of the test case
-// name: name of the test
-// type_param: the name of the test's type parameter, or NULL if
-// this is not a typed or a type-parameterized test.
-// value_param: text representation of the test's value parameter,
-// or NULL if this is not a value-parameterized test.
-// fixture_class_id: ID of the test fixture class
-// set_up_tc: pointer to the function that sets up the test case
-// tear_down_tc: pointer to the function that tears down the test case
-// factory: pointer to the factory that creates a test object.
-// The newly created TestInfo instance will assume
-// ownership of the factory object.
-TestInfo* MakeAndRegisterTestInfo(
- const char* test_case_name, const char* name,
- const char* type_param,
- const char* value_param,
- TypeId fixture_class_id,
- SetUpTestCaseFunc set_up_tc,
- TearDownTestCaseFunc tear_down_tc,
- TestFactoryBase* factory) {
- TestInfo* const test_info =
- new TestInfo(test_case_name, name, type_param, value_param,
- fixture_class_id, factory);
- GetUnitTestImpl()->AddTestInfo(set_up_tc, tear_down_tc, test_info);
- return test_info;
-}
-
-#if GTEST_HAS_PARAM_TEST
-void ReportInvalidTestCaseType(const char* test_case_name,
- const char* file, int line) {
- Message errors;
- errors
- << "Attempted redefinition of test case " << test_case_name << ".\n"
- << "All tests in the same test case must use the same test fixture\n"
- << "class. However, in test case " << test_case_name << ", you tried\n"
- << "to define a test using a fixture class different from the one\n"
- << "used earlier. This can happen if the two fixture classes are\n"
- << "from different namespaces and have the same name. You should\n"
- << "probably rename one of the classes to put the tests into different\n"
- << "test cases.";
-
- fprintf(stderr, "%s %s", FormatFileLocation(file, line).c_str(),
- errors.GetString().c_str());
-}
-#endif // GTEST_HAS_PARAM_TEST
-
-} // namespace internal
-
-namespace {
-
-// A predicate that checks the test name of a TestInfo against a known
-// value.
-//
-// This is used for implementation of the TestCase class only. We put
-// it in the anonymous namespace to prevent polluting the outer
-// namespace.
-//
-// TestNameIs is copyable.
-class TestNameIs {
- public:
- // Constructor.
- //
- // TestNameIs has NO default constructor.
- explicit TestNameIs(const char* name)
- : name_(name) {}
-
- // Returns true iff the test name of test_info matches name_.
- bool operator()(const TestInfo * test_info) const {
- return test_info && internal::String(test_info->name()).Compare(name_) == 0;
- }
-
- private:
- internal::String name_;
-};
-
-} // namespace
-
-namespace internal {
-
-// This method expands all parameterized tests registered with macros TEST_P
-// and INSTANTIATE_TEST_CASE_P into regular tests and registers those.
-// This will be done just once during the program runtime.
-void UnitTestImpl::RegisterParameterizedTests() {
-#if GTEST_HAS_PARAM_TEST
- if (!parameterized_tests_registered_) {
- parameterized_test_registry_.RegisterTests();
- parameterized_tests_registered_ = true;
- }
-#endif
-}
-
-} // namespace internal
-
-// Creates the test object, runs it, records its result, and then
-// deletes it.
-void TestInfo::Run() {
- if (!should_run_) return;
-
- // Tells UnitTest where to store test result.
- internal::UnitTestImpl* const impl = internal::GetUnitTestImpl();
- impl->set_current_test_info(this);
-
- TestEventListener* repeater = UnitTest::GetInstance()->listeners().repeater();
-
- // Notifies the unit test event listeners that a test is about to start.
- repeater->OnTestStart(*this);
-
- const TimeInMillis start = internal::GetTimeInMillis();
-
- impl->os_stack_trace_getter()->UponLeavingGTest();
-
- // Creates the test object.
- Test* const test = internal::HandleExceptionsInMethodIfSupported(
- factory_, &internal::TestFactoryBase::CreateTest,
- "the test fixture's constructor");
-
- // Runs the test only if the test object was created and its
- // constructor didn't generate a fatal failure.
- if ((test != NULL) && !Test::HasFatalFailure()) {
- // This doesn't throw as all user code that can throw are wrapped into
- // exception handling code.
- test->Run();
- }
-
- // Deletes the test object.
- impl->os_stack_trace_getter()->UponLeavingGTest();
- internal::HandleExceptionsInMethodIfSupported(
- test, &Test::DeleteSelf_, "the test fixture's destructor");
-
- result_.set_elapsed_time(internal::GetTimeInMillis() - start);
-
- // Notifies the unit test event listener that a test has just finished.
- repeater->OnTestEnd(*this);
-
- // Tells UnitTest to stop associating assertion results to this
- // test.
- impl->set_current_test_info(NULL);
-}
-
-// class TestCase
-
-// Gets the number of successful tests in this test case.
-int TestCase::successful_test_count() const {
- return CountIf(test_info_list_, TestPassed);
-}
-
-// Gets the number of failed tests in this test case.
-int TestCase::failed_test_count() const {
- return CountIf(test_info_list_, TestFailed);
-}
-
-int TestCase::disabled_test_count() const {
- return CountIf(test_info_list_, TestDisabled);
-}
-
-// Get the number of tests in this test case that should run.
-int TestCase::test_to_run_count() const {
- return CountIf(test_info_list_, ShouldRunTest);
-}
-
-// Gets the number of all tests.
-int TestCase::total_test_count() const {
- return static_cast<int>(test_info_list_.size());
-}
-
-// Creates a TestCase with the given name.
-//
-// Arguments:
-//
-// name: name of the test case
-// a_type_param: the name of the test case's type parameter, or NULL if
-// this is not a typed or a type-parameterized test case.
-// set_up_tc: pointer to the function that sets up the test case
-// tear_down_tc: pointer to the function that tears down the test case
-TestCase::TestCase(const char* a_name, const char* a_type_param,
- Test::SetUpTestCaseFunc set_up_tc,
- Test::TearDownTestCaseFunc tear_down_tc)
- : name_(a_name),
- type_param_(a_type_param ? new std::string(a_type_param) : NULL),
- set_up_tc_(set_up_tc),
- tear_down_tc_(tear_down_tc),
- should_run_(false),
- elapsed_time_(0) {
-}
-
-// Destructor of TestCase.
-TestCase::~TestCase() {
- // Deletes every Test in the collection.
- ForEach(test_info_list_, internal::Delete<TestInfo>);
-}
-
-// Returns the i-th test among all the tests. i can range from 0 to
-// total_test_count() - 1. If i is not in that range, returns NULL.
-const TestInfo* TestCase::GetTestInfo(int i) const {
- const int index = GetElementOr(test_indices_, i, -1);
- return index < 0 ? NULL : test_info_list_[index];
-}
-
-// Returns the i-th test among all the tests. i can range from 0 to
-// total_test_count() - 1. If i is not in that range, returns NULL.
-TestInfo* TestCase::GetMutableTestInfo(int i) {
- const int index = GetElementOr(test_indices_, i, -1);
- return index < 0 ? NULL : test_info_list_[index];
-}
-
-// Adds a test to this test case. Will delete the test upon
-// destruction of the TestCase object.
-void TestCase::AddTestInfo(TestInfo * test_info) {
- test_info_list_.push_back(test_info);
- test_indices_.push_back(static_cast<int>(test_indices_.size()));
-}
-
-// Runs every test in this TestCase.
-void TestCase::Run() {
- if (!should_run_) return;
-
- internal::UnitTestImpl* const impl = internal::GetUnitTestImpl();
- impl->set_current_test_case(this);
-
- TestEventListener* repeater = UnitTest::GetInstance()->listeners().repeater();
-
- repeater->OnTestCaseStart(*this);
- impl->os_stack_trace_getter()->UponLeavingGTest();
- internal::HandleExceptionsInMethodIfSupported(
- this, &TestCase::RunSetUpTestCase, "SetUpTestCase()");
-
- const internal::TimeInMillis start = internal::GetTimeInMillis();
- for (int i = 0; i < total_test_count(); i++) {
- GetMutableTestInfo(i)->Run();
- }
- elapsed_time_ = internal::GetTimeInMillis() - start;
-
- impl->os_stack_trace_getter()->UponLeavingGTest();
- internal::HandleExceptionsInMethodIfSupported(
- this, &TestCase::RunTearDownTestCase, "TearDownTestCase()");
-
- repeater->OnTestCaseEnd(*this);
- impl->set_current_test_case(NULL);
-}
-
-// Clears the results of all tests in this test case.
-void TestCase::ClearResult() {
- ForEach(test_info_list_, TestInfo::ClearTestResult);
-}
-
-// Shuffles the tests in this test case.
-void TestCase::ShuffleTests(internal::Random* random) {
- Shuffle(random, &test_indices_);
-}
-
-// Restores the test order to before the first shuffle.
-void TestCase::UnshuffleTests() {
- for (size_t i = 0; i < test_indices_.size(); i++) {
- test_indices_[i] = static_cast<int>(i);
- }
-}
-
-// Formats a countable noun. Depending on its quantity, either the
-// singular form or the plural form is used. e.g.
-//
-// FormatCountableNoun(1, "formula", "formuli") returns "1 formula".
-// FormatCountableNoun(5, "book", "books") returns "5 books".
-static internal::String FormatCountableNoun(int count,
- const char * singular_form,
- const char * plural_form) {
- return internal::String::Format("%d %s", count,
- count == 1 ? singular_form : plural_form);
-}
-
-// Formats the count of tests.
-static internal::String FormatTestCount(int test_count) {
- return FormatCountableNoun(test_count, "test", "tests");
-}
-
-// Formats the count of test cases.
-static internal::String FormatTestCaseCount(int test_case_count) {
- return FormatCountableNoun(test_case_count, "test case", "test cases");
-}
-
-// Converts a TestPartResult::Type enum to human-friendly string
-// representation. Both kNonFatalFailure and kFatalFailure are translated
-// to "Failure", as the user usually doesn't care about the difference
-// between the two when viewing the test result.
-static const char * TestPartResultTypeToString(TestPartResult::Type type) {
- switch (type) {
- case TestPartResult::kSuccess:
- return "Success";
-
- case TestPartResult::kNonFatalFailure:
- case TestPartResult::kFatalFailure:
-#ifdef _MSC_VER
- return "error: ";
-#else
- return "Failure\n";
-#endif
- default:
- return "Unknown result type";
- }
-}
-
-// Prints a TestPartResult to a String.
-static internal::String PrintTestPartResultToString(
- const TestPartResult& test_part_result) {
- return (Message()
- << internal::FormatFileLocation(test_part_result.file_name(),
- test_part_result.line_number())
- << " " << TestPartResultTypeToString(test_part_result.type())
- << test_part_result.message()).GetString();
-}
-
-// Prints a TestPartResult.
-static void PrintTestPartResult(const TestPartResult& test_part_result) {
- const internal::String& result =
- PrintTestPartResultToString(test_part_result);
- printf("%s\n", result.c_str());
- fflush(stdout);
- // If the test program runs in Visual Studio or a debugger, the
- // following statements add the test part result message to the Output
- // window such that the user can double-click on it to jump to the
- // corresponding source code location; otherwise they do nothing.
-#if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE
- // We don't call OutputDebugString*() on Windows Mobile, as printing
- // to stdout is done by OutputDebugString() there already - we don't
- // want the same message printed twice.
- ::OutputDebugStringA(result.c_str());
- ::OutputDebugStringA("\n");
-#endif
-}
-
-// class PrettyUnitTestResultPrinter
-
-namespace internal {
-
-enum GTestColor {
- COLOR_DEFAULT,
- COLOR_RED,
- COLOR_GREEN,
- COLOR_YELLOW
-};
-
-#if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE
-
-// Returns the character attribute for the given color.
-WORD GetColorAttribute(GTestColor color) {
- switch (color) {
- case COLOR_RED: return FOREGROUND_RED;
- case COLOR_GREEN: return FOREGROUND_GREEN;
- case COLOR_YELLOW: return FOREGROUND_RED | FOREGROUND_GREEN;
- default: return 0;
- }
-}
-
-#else
-
-// Returns the ANSI color code for the given color. COLOR_DEFAULT is
-// an invalid input.
-const char* GetAnsiColorCode(GTestColor color) {
- switch (color) {
- case COLOR_RED: return "1";
- case COLOR_GREEN: return "2";
- case COLOR_YELLOW: return "3";
- default: return NULL;
- };
-}
-
-#endif // GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE
-
-// Returns true iff Google Test should use colors in the output.
-bool ShouldUseColor(bool stdout_is_tty) {
- const char* const gtest_color = GTEST_FLAG(color).c_str();
-
- if (String::CaseInsensitiveCStringEquals(gtest_color, "auto")) {
-#if GTEST_OS_WINDOWS
- // On Windows the TERM variable is usually not set, but the
- // console there does support colors.
- return stdout_is_tty;
-#else
- // On non-Windows platforms, we rely on the TERM variable.
- const char* const term = posix::GetEnv("TERM");
- const bool term_supports_color =
- String::CStringEquals(term, "xterm") ||
- String::CStringEquals(term, "xterm-color") ||
- String::CStringEquals(term, "xterm-256color") ||
- String::CStringEquals(term, "screen") ||
- String::CStringEquals(term, "linux") ||
- String::CStringEquals(term, "cygwin");
- return stdout_is_tty && term_supports_color;
-#endif // GTEST_OS_WINDOWS
- }
-
- return String::CaseInsensitiveCStringEquals(gtest_color, "yes") ||
- String::CaseInsensitiveCStringEquals(gtest_color, "true") ||
- String::CaseInsensitiveCStringEquals(gtest_color, "t") ||
- String::CStringEquals(gtest_color, "1");
- // We take "yes", "true", "t", and "1" as meaning "yes". If the
- // value is neither one of these nor "auto", we treat it as "no" to
- // be conservative.
-}
-
-// Helpers for printing colored strings to stdout. Note that on Windows, we
-// cannot simply emit special characters and have the terminal change colors.
-// This routine must actually emit the characters rather than return a string
-// that would be colored when printed, as can be done on Linux.
-void ColoredPrintf(GTestColor color, const char* fmt, ...) {
- va_list args;
- va_start(args, fmt);
-
-#if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN || GTEST_OS_ZOS
- const bool use_color = false;
-#else
- static const bool in_color_mode =
- ShouldUseColor(posix::IsATTY(posix::FileNo(stdout)) != 0);
- const bool use_color = in_color_mode && (color != COLOR_DEFAULT);
-#endif // GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN || GTEST_OS_ZOS
- // The '!= 0' comparison is necessary to satisfy MSVC 7.1.
-
- if (!use_color) {
- vprintf(fmt, args);
- va_end(args);
- return;
- }
-
-#if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE
- const HANDLE stdout_handle = GetStdHandle(STD_OUTPUT_HANDLE);
-
- // Gets the current text color.
- CONSOLE_SCREEN_BUFFER_INFO buffer_info;
- GetConsoleScreenBufferInfo(stdout_handle, &buffer_info);
- const WORD old_color_attrs = buffer_info.wAttributes;
-
- // We need to flush the stream buffers into the console before each
- // SetConsoleTextAttribute call lest it affect the text that is already
- // printed but has not yet reached the console.
- fflush(stdout);
- SetConsoleTextAttribute(stdout_handle,
- GetColorAttribute(color) | FOREGROUND_INTENSITY);
- vprintf(fmt, args);
-
- fflush(stdout);
- // Restores the text color.
- SetConsoleTextAttribute(stdout_handle, old_color_attrs);
-#else
- printf("\033[0;3%sm", GetAnsiColorCode(color));
- vprintf(fmt, args);
- printf("\033[m"); // Resets the terminal to default.
-#endif // GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE
- va_end(args);
-}
-
-void PrintFullTestCommentIfPresent(const TestInfo& test_info) {
- const char* const type_param = test_info.type_param();
- const char* const value_param = test_info.value_param();
-
- if (type_param != NULL || value_param != NULL) {
- printf(", where ");
- if (type_param != NULL) {
- printf("TypeParam = %s", type_param);
- if (value_param != NULL)
- printf(" and ");
- }
- if (value_param != NULL) {
- printf("GetParam() = %s", value_param);
- }
- }
-}
-
-// This class implements the TestEventListener interface.
-//
-// Class PrettyUnitTestResultPrinter is copyable.
-class PrettyUnitTestResultPrinter : public TestEventListener {
- public:
- PrettyUnitTestResultPrinter() {}
- static void PrintTestName(const char * test_case, const char * test) {
- printf("%s.%s", test_case, test);
- }
-
- // The following methods override what's in the TestEventListener class.
- virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {}
- virtual void OnTestIterationStart(const UnitTest& unit_test, int iteration);
- virtual void OnEnvironmentsSetUpStart(const UnitTest& unit_test);
- virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {}
- virtual void OnTestCaseStart(const TestCase& test_case);
- virtual void OnTestStart(const TestInfo& test_info);
- virtual void OnTestPartResult(const TestPartResult& result);
- virtual void OnTestEnd(const TestInfo& test_info);
- virtual void OnTestCaseEnd(const TestCase& test_case);
- virtual void OnEnvironmentsTearDownStart(const UnitTest& unit_test);
- virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {}
- virtual void OnTestIterationEnd(const UnitTest& unit_test, int iteration);
- virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {}
-
- private:
- static void PrintFailedTests(const UnitTest& unit_test);
-};
-
- // Fired before each iteration of tests starts.
-void PrettyUnitTestResultPrinter::OnTestIterationStart(
- const UnitTest& unit_test, int iteration) {
- if (GTEST_FLAG(repeat) != 1)
- printf("\nRepeating all tests (iteration %d) . . .\n\n", iteration + 1);
-
- const char* const filter = GTEST_FLAG(filter).c_str();
-
- // Prints the filter if it's not *. This reminds the user that some
- // tests may be skipped.
- if (!internal::String::CStringEquals(filter, kUniversalFilter)) {
- ColoredPrintf(COLOR_YELLOW,
- "Note: %s filter = %s\n", GTEST_NAME_, filter);
- }
-
- if (internal::ShouldShard(kTestTotalShards, kTestShardIndex, false)) {
- const Int32 shard_index = Int32FromEnvOrDie(kTestShardIndex, -1);
- ColoredPrintf(COLOR_YELLOW,
- "Note: This is test shard %d of %s.\n",
- static_cast<int>(shard_index) + 1,
- internal::posix::GetEnv(kTestTotalShards));
- }
-
- if (GTEST_FLAG(shuffle)) {
- ColoredPrintf(COLOR_YELLOW,
- "Note: Randomizing tests' orders with a seed of %d .\n",
- unit_test.random_seed());
- }
-
- ColoredPrintf(COLOR_GREEN, "[==========] ");
- printf("Running %s from %s.\n",
- FormatTestCount(unit_test.test_to_run_count()).c_str(),
- FormatTestCaseCount(unit_test.test_case_to_run_count()).c_str());
- fflush(stdout);
-}
-
-void PrettyUnitTestResultPrinter::OnEnvironmentsSetUpStart(
- const UnitTest& /*unit_test*/) {
- ColoredPrintf(COLOR_GREEN, "[----------] ");
- printf("Global test environment set-up.\n");
- fflush(stdout);
-}
-
-void PrettyUnitTestResultPrinter::OnTestCaseStart(const TestCase& test_case) {
- const internal::String counts =
- FormatCountableNoun(test_case.test_to_run_count(), "test", "tests");
- ColoredPrintf(COLOR_GREEN, "[----------] ");
- printf("%s from %s", counts.c_str(), test_case.name());
- if (test_case.type_param() == NULL) {
- printf("\n");
- } else {
- printf(", where TypeParam = %s\n", test_case.type_param());
- }
- fflush(stdout);
-}
-
-void PrettyUnitTestResultPrinter::OnTestStart(const TestInfo& test_info) {
- ColoredPrintf(COLOR_GREEN, "[ RUN ] ");
- PrintTestName(test_info.test_case_name(), test_info.name());
- printf("\n");
- fflush(stdout);
-}
-
-// Called after an assertion failure.
-void PrettyUnitTestResultPrinter::OnTestPartResult(
- const TestPartResult& result) {
- // If the test part succeeded, we don't need to do anything.
- if (result.type() == TestPartResult::kSuccess)
- return;
-
- // Print failure message from the assertion (e.g. expected this and got that).
- PrintTestPartResult(result);
- fflush(stdout);
-}
-
-void PrettyUnitTestResultPrinter::OnTestEnd(const TestInfo& test_info) {
- if (test_info.result()->Passed()) {
- ColoredPrintf(COLOR_GREEN, "[ OK ] ");
- } else {
- ColoredPrintf(COLOR_RED, "[ FAILED ] ");
- }
- PrintTestName(test_info.test_case_name(), test_info.name());
- if (test_info.result()->Failed())
- PrintFullTestCommentIfPresent(test_info);
-
- if (GTEST_FLAG(print_time)) {
- printf(" (%s ms)\n", internal::StreamableToString(
- test_info.result()->elapsed_time()).c_str());
- } else {
- printf("\n");
- }
- fflush(stdout);
-}
-
-void PrettyUnitTestResultPrinter::OnTestCaseEnd(const TestCase& test_case) {
- if (!GTEST_FLAG(print_time)) return;
-
- const internal::String counts =
- FormatCountableNoun(test_case.test_to_run_count(), "test", "tests");
- ColoredPrintf(COLOR_GREEN, "[----------] ");
- printf("%s from %s (%s ms total)\n\n",
- counts.c_str(), test_case.name(),
- internal::StreamableToString(test_case.elapsed_time()).c_str());
- fflush(stdout);
-}
-
-void PrettyUnitTestResultPrinter::OnEnvironmentsTearDownStart(
- const UnitTest& /*unit_test*/) {
- ColoredPrintf(COLOR_GREEN, "[----------] ");
- printf("Global test environment tear-down\n");
- fflush(stdout);
-}
-
-// Internal helper for printing the list of failed tests.
-void PrettyUnitTestResultPrinter::PrintFailedTests(const UnitTest& unit_test) {
- const int failed_test_count = unit_test.failed_test_count();
- if (failed_test_count == 0) {
- return;
- }
-
- for (int i = 0; i < unit_test.total_test_case_count(); ++i) {
- const TestCase& test_case = *unit_test.GetTestCase(i);
- if (!test_case.should_run() || (test_case.failed_test_count() == 0)) {
- continue;
- }
- for (int j = 0; j < test_case.total_test_count(); ++j) {
- const TestInfo& test_info = *test_case.GetTestInfo(j);
- if (!test_info.should_run() || test_info.result()->Passed()) {
- continue;
- }
- ColoredPrintf(COLOR_RED, "[ FAILED ] ");
- printf("%s.%s", test_case.name(), test_info.name());
- PrintFullTestCommentIfPresent(test_info);
- printf("\n");
- }
- }
-}
-
-void PrettyUnitTestResultPrinter::OnTestIterationEnd(const UnitTest& unit_test,
- int /*iteration*/) {
- ColoredPrintf(COLOR_GREEN, "[==========] ");
- printf("%s from %s ran.",
- FormatTestCount(unit_test.test_to_run_count()).c_str(),
- FormatTestCaseCount(unit_test.test_case_to_run_count()).c_str());
- if (GTEST_FLAG(print_time)) {
- printf(" (%s ms total)",
- internal::StreamableToString(unit_test.elapsed_time()).c_str());
- }
- printf("\n");
- ColoredPrintf(COLOR_GREEN, "[ PASSED ] ");
- printf("%s.\n", FormatTestCount(unit_test.successful_test_count()).c_str());
-
- int num_failures = unit_test.failed_test_count();
- if (!unit_test.Passed()) {
- const int failed_test_count = unit_test.failed_test_count();
- ColoredPrintf(COLOR_RED, "[ FAILED ] ");
- printf("%s, listed below:\n", FormatTestCount(failed_test_count).c_str());
- PrintFailedTests(unit_test);
- printf("\n%2d FAILED %s\n", num_failures,
- num_failures == 1 ? "TEST" : "TESTS");
- }
-
- int num_disabled = unit_test.disabled_test_count();
- if (num_disabled && !GTEST_FLAG(also_run_disabled_tests)) {
- if (!num_failures) {
- printf("\n"); // Add a spacer if no FAILURE banner is displayed.
- }
- ColoredPrintf(COLOR_YELLOW,
- " YOU HAVE %d DISABLED %s\n\n",
- num_disabled,
- num_disabled == 1 ? "TEST" : "TESTS");
- }
- // Ensure that Google Test output is printed before, e.g., heapchecker output.
- fflush(stdout);
-}
-
-// End PrettyUnitTestResultPrinter
-
-// class TestEventRepeater
-//
-// This class forwards events to other event listeners.
-class TestEventRepeater : public TestEventListener {
- public:
- TestEventRepeater() : forwarding_enabled_(true) {}
- virtual ~TestEventRepeater();
- void Append(TestEventListener *listener);
- TestEventListener* Release(TestEventListener* listener);
-
- // Controls whether events will be forwarded to listeners_. Set to false
- // in death test child processes.
- bool forwarding_enabled() const { return forwarding_enabled_; }
- void set_forwarding_enabled(bool enable) { forwarding_enabled_ = enable; }
-
- virtual void OnTestProgramStart(const UnitTest& unit_test);
- virtual void OnTestIterationStart(const UnitTest& unit_test, int iteration);
- virtual void OnEnvironmentsSetUpStart(const UnitTest& unit_test);
- virtual void OnEnvironmentsSetUpEnd(const UnitTest& unit_test);
- virtual void OnTestCaseStart(const TestCase& test_case);
- virtual void OnTestStart(const TestInfo& test_info);
- virtual void OnTestPartResult(const TestPartResult& result);
- virtual void OnTestEnd(const TestInfo& test_info);
- virtual void OnTestCaseEnd(const TestCase& test_case);
- virtual void OnEnvironmentsTearDownStart(const UnitTest& unit_test);
- virtual void OnEnvironmentsTearDownEnd(const UnitTest& unit_test);
- virtual void OnTestIterationEnd(const UnitTest& unit_test, int iteration);
- virtual void OnTestProgramEnd(const UnitTest& unit_test);
-
- private:
- // Controls whether events will be forwarded to listeners_. Set to false
- // in death test child processes.
- bool forwarding_enabled_;
- // The list of listeners that receive events.
- std::vector<TestEventListener*> listeners_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(TestEventRepeater);
-};
-
-TestEventRepeater::~TestEventRepeater() {
- ForEach(listeners_, Delete<TestEventListener>);
-}
-
-void TestEventRepeater::Append(TestEventListener *listener) {
- listeners_.push_back(listener);
-}
-
-// TODO(vladl@google.com): Factor the search functionality into Vector::Find.
-TestEventListener* TestEventRepeater::Release(TestEventListener *listener) {
- for (size_t i = 0; i < listeners_.size(); ++i) {
- if (listeners_[i] == listener) {
- listeners_.erase(listeners_.begin() + i);
- return listener;
- }
- }
-
- return NULL;
-}
-
-// Since most methods are very similar, use macros to reduce boilerplate.
-// This defines a member that forwards the call to all listeners.
-#define GTEST_REPEATER_METHOD_(Name, Type) \
-void TestEventRepeater::Name(const Type& parameter) { \
- if (forwarding_enabled_) { \
- for (size_t i = 0; i < listeners_.size(); i++) { \
- listeners_[i]->Name(parameter); \
- } \
- } \
-}
-// This defines a member that forwards the call to all listeners in reverse
-// order.
-#define GTEST_REVERSE_REPEATER_METHOD_(Name, Type) \
-void TestEventRepeater::Name(const Type& parameter) { \
- if (forwarding_enabled_) { \
- for (int i = static_cast<int>(listeners_.size()) - 1; i >= 0; i--) { \
- listeners_[i]->Name(parameter); \
- } \
- } \
-}
-
-GTEST_REPEATER_METHOD_(OnTestProgramStart, UnitTest)
-GTEST_REPEATER_METHOD_(OnEnvironmentsSetUpStart, UnitTest)
-GTEST_REPEATER_METHOD_(OnTestCaseStart, TestCase)
-GTEST_REPEATER_METHOD_(OnTestStart, TestInfo)
-GTEST_REPEATER_METHOD_(OnTestPartResult, TestPartResult)
-GTEST_REPEATER_METHOD_(OnEnvironmentsTearDownStart, UnitTest)
-GTEST_REVERSE_REPEATER_METHOD_(OnEnvironmentsSetUpEnd, UnitTest)
-GTEST_REVERSE_REPEATER_METHOD_(OnEnvironmentsTearDownEnd, UnitTest)
-GTEST_REVERSE_REPEATER_METHOD_(OnTestEnd, TestInfo)
-GTEST_REVERSE_REPEATER_METHOD_(OnTestCaseEnd, TestCase)
-GTEST_REVERSE_REPEATER_METHOD_(OnTestProgramEnd, UnitTest)
-
-#undef GTEST_REPEATER_METHOD_
-#undef GTEST_REVERSE_REPEATER_METHOD_
-
-void TestEventRepeater::OnTestIterationStart(const UnitTest& unit_test,
- int iteration) {
- if (forwarding_enabled_) {
- for (size_t i = 0; i < listeners_.size(); i++) {
- listeners_[i]->OnTestIterationStart(unit_test, iteration);
- }
- }
-}
-
-void TestEventRepeater::OnTestIterationEnd(const UnitTest& unit_test,
- int iteration) {
- if (forwarding_enabled_) {
- for (int i = static_cast<int>(listeners_.size()) - 1; i >= 0; i--) {
- listeners_[i]->OnTestIterationEnd(unit_test, iteration);
- }
- }
-}
-
-// End TestEventRepeater
-
-// This class generates an XML output file.
-class XmlUnitTestResultPrinter : public EmptyTestEventListener {
- public:
- explicit XmlUnitTestResultPrinter(const char* output_file);
-
- virtual void OnTestIterationEnd(const UnitTest& unit_test, int iteration);
-
- private:
- // Is c a whitespace character that is normalized to a space character
- // when it appears in an XML attribute value?
- static bool IsNormalizableWhitespace(char c) {
- return c == 0x9 || c == 0xA || c == 0xD;
- }
-
- // May c appear in a well-formed XML document?
- static bool IsValidXmlCharacter(char c) {
- return IsNormalizableWhitespace(c) || c >= 0x20;
- }
-
- // Returns an XML-escaped copy of the input string str. If
- // is_attribute is true, the text is meant to appear as an attribute
- // value, and normalizable whitespace is preserved by replacing it
- // with character references.
- static String EscapeXml(const char* str, bool is_attribute);
-
- // Returns the given string with all characters invalid in XML removed.
- static string RemoveInvalidXmlCharacters(const string& str);
-
- // Convenience wrapper around EscapeXml when str is an attribute value.
- static String EscapeXmlAttribute(const char* str) {
- return EscapeXml(str, true);
- }
-
- // Convenience wrapper around EscapeXml when str is not an attribute value.
- static String EscapeXmlText(const char* str) { return EscapeXml(str, false); }
-
- // Streams an XML CDATA section, escaping invalid CDATA sequences as needed.
- static void OutputXmlCDataSection(::std::ostream* stream, const char* data);
-
- // Streams an XML representation of a TestInfo object.
- static void OutputXmlTestInfo(::std::ostream* stream,
- const char* test_case_name,
- const TestInfo& test_info);
-
- // Prints an XML representation of a TestCase object
- static void PrintXmlTestCase(FILE* out, const TestCase& test_case);
-
- // Prints an XML summary of unit_test to output stream out.
- static void PrintXmlUnitTest(FILE* out, const UnitTest& unit_test);
-
- // Produces a string representing the test properties in a result as space
- // delimited XML attributes based on the property key="value" pairs.
- // When the String is not empty, it includes a space at the beginning,
- // to delimit this attribute from prior attributes.
- static String TestPropertiesAsXmlAttributes(const TestResult& result);
-
- // The output file.
- const String output_file_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(XmlUnitTestResultPrinter);
-};
-
-// Creates a new XmlUnitTestResultPrinter.
-XmlUnitTestResultPrinter::XmlUnitTestResultPrinter(const char* output_file)
- : output_file_(output_file) {
- if (output_file_.c_str() == NULL || output_file_.empty()) {
- fprintf(stderr, "XML output file may not be null\n");
- fflush(stderr);
- exit(EXIT_FAILURE);
- }
-}
-
-// Called after the unit test ends.
-void XmlUnitTestResultPrinter::OnTestIterationEnd(const UnitTest& unit_test,
- int /*iteration*/) {
- FILE* xmlout = NULL;
- FilePath output_file(output_file_);
- FilePath output_dir(output_file.RemoveFileName());
-
- if (output_dir.CreateDirectoriesRecursively()) {
- xmlout = posix::FOpen(output_file_.c_str(), "w");
- }
- if (xmlout == NULL) {
- // TODO(wan): report the reason of the failure.
- //
- // We don't do it for now as:
- //
- // 1. There is no urgent need for it.
- // 2. It's a bit involved to make the errno variable thread-safe on
- // all three operating systems (Linux, Windows, and Mac OS).
- // 3. To interpret the meaning of errno in a thread-safe way,
- // we need the strerror_r() function, which is not available on
- // Windows.
- fprintf(stderr,
- "Unable to open file \"%s\"\n",
- output_file_.c_str());
- fflush(stderr);
- exit(EXIT_FAILURE);
- }
- PrintXmlUnitTest(xmlout, unit_test);
- fclose(xmlout);
-}
-
-// Returns an XML-escaped copy of the input string str. If is_attribute
-// is true, the text is meant to appear as an attribute value, and
-// normalizable whitespace is preserved by replacing it with character
-// references.
-//
-// Invalid XML characters in str, if any, are stripped from the output.
-// It is expected that most, if not all, of the text processed by this
-// module will consist of ordinary English text.
-// If this module is ever modified to produce version 1.1 XML output,
-// most invalid characters can be retained using character references.
-// TODO(wan): It might be nice to have a minimally invasive, human-readable
-// escaping scheme for invalid characters, rather than dropping them.
-String XmlUnitTestResultPrinter::EscapeXml(const char* str, bool is_attribute) {
- Message m;
-
- if (str != NULL) {
- for (const char* src = str; *src; ++src) {
- switch (*src) {
- case '<':
- m << "&lt;";
- break;
- case '>':
- m << "&gt;";
- break;
- case '&':
- m << "&amp;";
- break;
- case '\'':
- if (is_attribute)
- m << "&apos;";
- else
- m << '\'';
- break;
- case '"':
- if (is_attribute)
- m << "&quot;";
- else
- m << '"';
- break;
- default:
- if (IsValidXmlCharacter(*src)) {
- if (is_attribute && IsNormalizableWhitespace(*src))
- m << String::Format("&#x%02X;", unsigned(*src));
- else
- m << *src;
- }
- break;
- }
- }
- }
-
- return m.GetString();
-}
-
-// Returns the given string with all characters invalid in XML removed.
-// Currently invalid characters are dropped from the string. An
-// alternative is to replace them with certain characters such as . or ?.
-string XmlUnitTestResultPrinter::RemoveInvalidXmlCharacters(const string& str) {
- string output;
- output.reserve(str.size());
- for (string::const_iterator it = str.begin(); it != str.end(); ++it)
- if (IsValidXmlCharacter(*it))
- output.push_back(*it);
-
- return output;
-}
-
-// The following routines generate an XML representation of a UnitTest
-// object.
-//
-// This is how Google Test concepts map to the DTD:
-//
-// <testsuites name="AllTests"> <-- corresponds to a UnitTest object
-// <testsuite name="testcase-name"> <-- corresponds to a TestCase object
-// <testcase name="test-name"> <-- corresponds to a TestInfo object
-// <failure message="...">...</failure>
-// <failure message="...">...</failure>
-// <failure message="...">...</failure>
-// <-- individual assertion failures
-// </testcase>
-// </testsuite>
-// </testsuites>
-
-// Formats the given time in milliseconds as seconds.
-std::string FormatTimeInMillisAsSeconds(TimeInMillis ms) {
- ::std::stringstream ss;
- ss << ms/1000.0;
- return ss.str();
-}
-
-// Converts the given epoch time in milliseconds to a date string in the ISO
-// 8601 format, without the timezone information.
-std::string FormatEpochTimeInMillisAsIso8601(TimeInMillis ms) {
- // Using non-reentrant version as localtime_r is not portable.
- time_t seconds = static_cast<time_t>(ms / 1000);
-#ifdef _MSC_VER
-# pragma warning(push) // Saves the current warning state.
-# pragma warning(disable:4996) // Temporarily disables warning 4996
- // (function or variable may be unsafe).
- const struct tm* const time_struct = localtime(&seconds); // NOLINT
-# pragma warning(pop) // Restores the warning state again.
-#else
- const struct tm* const time_struct = localtime(&seconds); // NOLINT
-#endif
- if (time_struct == NULL)
- return ""; // Invalid ms value
-
- return String::Format("%d-%02d-%02dT%02d:%02d:%02d", // YYYY-MM-DDThh:mm:ss
- time_struct->tm_year + 1900,
- time_struct->tm_mon + 1,
- time_struct->tm_mday,
- time_struct->tm_hour,
- time_struct->tm_min,
- time_struct->tm_sec);
-}
-
-// Streams an XML CDATA section, escaping invalid CDATA sequences as needed.
-void XmlUnitTestResultPrinter::OutputXmlCDataSection(::std::ostream* stream,
- const char* data) {
- const char* segment = data;
- *stream << "<![CDATA[";
- for (;;) {
- const char* const next_segment = strstr(segment, "]]>");
- if (next_segment != NULL) {
- stream->write(
- segment, static_cast<std::streamsize>(next_segment - segment));
- *stream << "]]>]]&gt;<![CDATA[";
- segment = next_segment + strlen("]]>");
- } else {
- *stream << segment;
- break;
- }
- }
- *stream << "]]>";
-}
-
-// Prints an XML representation of a TestInfo object.
-// TODO(wan): There is also value in printing properties with the plain printer.
-void XmlUnitTestResultPrinter::OutputXmlTestInfo(::std::ostream* stream,
- const char* test_case_name,
- const TestInfo& test_info) {
- const TestResult& result = *test_info.result();
- *stream << " <testcase name=\""
- << EscapeXmlAttribute(test_info.name()).c_str() << "\"";
-
- if (test_info.value_param() != NULL) {
- *stream << " value_param=\"" << EscapeXmlAttribute(test_info.value_param())
- << "\"";
- }
- if (test_info.type_param() != NULL) {
- *stream << " type_param=\"" << EscapeXmlAttribute(test_info.type_param())
- << "\"";
- }
-
- *stream << " status=\""
- << (test_info.should_run() ? "run" : "notrun")
- << "\" time=\""
- << FormatTimeInMillisAsSeconds(result.elapsed_time())
- << "\" classname=\"" << EscapeXmlAttribute(test_case_name).c_str()
- << "\"" << TestPropertiesAsXmlAttributes(result).c_str();
-
- int failures = 0;
- for (int i = 0; i < result.total_part_count(); ++i) {
- const TestPartResult& part = result.GetTestPartResult(i);
- if (part.failed()) {
- if (++failures == 1) {
- *stream << ">\n";
- }
- const string location = internal::FormatCompilerIndependentFileLocation(
- part.file_name(), part.line_number());
- const string summary = location + "\n" + part.summary();
- *stream << " <failure message=\""
- << EscapeXmlAttribute(summary.c_str())
- << "\" type=\"\">";
- const string detail = location + "\n" + part.message();
- OutputXmlCDataSection(stream, RemoveInvalidXmlCharacters(detail).c_str());
- *stream << "</failure>\n";
- }
- }
-
- if (failures == 0)
- *stream << " />\n";
- else
- *stream << " </testcase>\n";
-}
-
-// Prints an XML representation of a TestCase object
-void XmlUnitTestResultPrinter::PrintXmlTestCase(FILE* out,
- const TestCase& test_case) {
- fprintf(out,
- " <testsuite name=\"%s\" tests=\"%d\" failures=\"%d\" "
- "disabled=\"%d\" ",
- EscapeXmlAttribute(test_case.name()).c_str(),
- test_case.total_test_count(),
- test_case.failed_test_count(),
- test_case.disabled_test_count());
- fprintf(out,
- "errors=\"0\" time=\"%s\">\n",
- FormatTimeInMillisAsSeconds(test_case.elapsed_time()).c_str());
- for (int i = 0; i < test_case.total_test_count(); ++i) {
- ::std::stringstream stream;
- OutputXmlTestInfo(&stream, test_case.name(), *test_case.GetTestInfo(i));
- fprintf(out, "%s", StringStreamToString(&stream).c_str());
- }
- fprintf(out, " </testsuite>\n");
-}
-
-// Prints an XML summary of unit_test to output stream out.
-void XmlUnitTestResultPrinter::PrintXmlUnitTest(FILE* out,
- const UnitTest& unit_test) {
- fprintf(out, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
- fprintf(out,
- "<testsuites tests=\"%d\" failures=\"%d\" disabled=\"%d\" "
- "errors=\"0\" timestamp=\"%s\" time=\"%s\" ",
- unit_test.total_test_count(),
- unit_test.failed_test_count(),
- unit_test.disabled_test_count(),
- FormatEpochTimeInMillisAsIso8601(unit_test.start_timestamp()).c_str(),
- FormatTimeInMillisAsSeconds(unit_test.elapsed_time()).c_str());
- if (GTEST_FLAG(shuffle)) {
- fprintf(out, "random_seed=\"%d\" ", unit_test.random_seed());
- }
- fprintf(out, "name=\"AllTests\">\n");
- for (int i = 0; i < unit_test.total_test_case_count(); ++i)
- PrintXmlTestCase(out, *unit_test.GetTestCase(i));
- fprintf(out, "</testsuites>\n");
-}
-
-// Produces a string representing the test properties in a result as space
-// delimited XML attributes based on the property key="value" pairs.
-String XmlUnitTestResultPrinter::TestPropertiesAsXmlAttributes(
- const TestResult& result) {
- Message attributes;
- for (int i = 0; i < result.test_property_count(); ++i) {
- const TestProperty& property = result.GetTestProperty(i);
- attributes << " " << property.key() << "="
- << "\"" << EscapeXmlAttribute(property.value()) << "\"";
- }
- return attributes.GetString();
-}
-
-// End XmlUnitTestResultPrinter
-
-#if GTEST_CAN_STREAM_RESULTS_
-
-// Streams test results to the given port on the given host machine.
-class StreamingListener : public EmptyTestEventListener {
- public:
- // Escapes '=', '&', '%', and '\n' characters in str as "%xx".
- static string UrlEncode(const char* str);
-
- StreamingListener(const string& host, const string& port)
- : sockfd_(-1), host_name_(host), port_num_(port) {
- MakeConnection();
- Send("gtest_streaming_protocol_version=1.0\n");
- }
-
- virtual ~StreamingListener() {
- if (sockfd_ != -1)
- CloseConnection();
- }
-
- void OnTestProgramStart(const UnitTest& /* unit_test */) {
- Send("event=TestProgramStart\n");
- }
-
- void OnTestProgramEnd(const UnitTest& unit_test) {
- // Note that Google Test current only report elapsed time for each
- // test iteration, not for the entire test program.
- Send(String::Format("event=TestProgramEnd&passed=%d\n",
- unit_test.Passed()));
-
- // Notify the streaming server to stop.
- CloseConnection();
- }
-
- void OnTestIterationStart(const UnitTest& /* unit_test */, int iteration) {
- Send(String::Format("event=TestIterationStart&iteration=%d\n",
- iteration));
- }
-
- void OnTestIterationEnd(const UnitTest& unit_test, int /* iteration */) {
- Send(String::Format("event=TestIterationEnd&passed=%d&elapsed_time=%sms\n",
- unit_test.Passed(),
- StreamableToString(unit_test.elapsed_time()).c_str()));
- }
-
- void OnTestCaseStart(const TestCase& test_case) {
- Send(String::Format("event=TestCaseStart&name=%s\n", test_case.name()));
- }
-
- void OnTestCaseEnd(const TestCase& test_case) {
- Send(String::Format("event=TestCaseEnd&passed=%d&elapsed_time=%sms\n",
- test_case.Passed(),
- StreamableToString(test_case.elapsed_time()).c_str()));
- }
-
- void OnTestStart(const TestInfo& test_info) {
- Send(String::Format("event=TestStart&name=%s\n", test_info.name()));
- }
-
- void OnTestEnd(const TestInfo& test_info) {
- Send(String::Format(
- "event=TestEnd&passed=%d&elapsed_time=%sms\n",
- (test_info.result())->Passed(),
- StreamableToString((test_info.result())->elapsed_time()).c_str()));
- }
-
- void OnTestPartResult(const TestPartResult& test_part_result) {
- const char* file_name = test_part_result.file_name();
- if (file_name == NULL)
- file_name = "";
- Send(String::Format("event=TestPartResult&file=%s&line=%d&message=",
- UrlEncode(file_name).c_str(),
- test_part_result.line_number()));
- Send(UrlEncode(test_part_result.message()) + "\n");
- }
-
- private:
- // Creates a client socket and connects to the server.
- void MakeConnection();
-
- // Closes the socket.
- void CloseConnection() {
- GTEST_CHECK_(sockfd_ != -1)
- << "CloseConnection() can be called only when there is a connection.";
-
- close(sockfd_);
- sockfd_ = -1;
- }
-
- // Sends a string to the socket.
- void Send(const string& message) {
- GTEST_CHECK_(sockfd_ != -1)
- << "Send() can be called only when there is a connection.";
-
- const int len = static_cast<int>(message.length());
- if (write(sockfd_, message.c_str(), len) != len) {
- GTEST_LOG_(WARNING)
- << "stream_result_to: failed to stream to "
- << host_name_ << ":" << port_num_;
- }
- }
-
- int sockfd_; // socket file descriptor
- const string host_name_;
- const string port_num_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(StreamingListener);
-}; // class StreamingListener
-
-// Checks if str contains '=', '&', '%' or '\n' characters. If yes,
-// replaces them by "%xx" where xx is their hexadecimal value. For
-// example, replaces "=" with "%3D". This algorithm is O(strlen(str))
-// in both time and space -- important as the input str may contain an
-// arbitrarily long test failure message and stack trace.
-string StreamingListener::UrlEncode(const char* str) {
- string result;
- result.reserve(strlen(str) + 1);
- for (char ch = *str; ch != '\0'; ch = *++str) {
- switch (ch) {
- case '%':
- case '=':
- case '&':
- case '\n':
- result.append(String::Format("%%%02x", static_cast<unsigned char>(ch)));
- break;
- default:
- result.push_back(ch);
- break;
- }
- }
- return result;
-}
-
-void StreamingListener::MakeConnection() {
- GTEST_CHECK_(sockfd_ == -1)
- << "MakeConnection() can't be called when there is already a connection.";
-
- addrinfo hints;
- memset(&hints, 0, sizeof(hints));
- hints.ai_family = AF_UNSPEC; // To allow both IPv4 and IPv6 addresses.
- hints.ai_socktype = SOCK_STREAM;
- addrinfo* servinfo = NULL;
-
- // Use the getaddrinfo() to get a linked list of IP addresses for
- // the given host name.
- const int error_num = getaddrinfo(
- host_name_.c_str(), port_num_.c_str(), &hints, &servinfo);
- if (error_num != 0) {
- GTEST_LOG_(WARNING) << "stream_result_to: getaddrinfo() failed: "
- << gai_strerror(error_num);
- }
-
- // Loop through all the results and connect to the first we can.
- for (addrinfo* cur_addr = servinfo; sockfd_ == -1 && cur_addr != NULL;
- cur_addr = cur_addr->ai_next) {
- sockfd_ = socket(
- cur_addr->ai_family, cur_addr->ai_socktype, cur_addr->ai_protocol);
- if (sockfd_ != -1) {
- // Connect the client socket to the server socket.
- if (connect(sockfd_, cur_addr->ai_addr, cur_addr->ai_addrlen) == -1) {
- close(sockfd_);
- sockfd_ = -1;
- }
- }
- }
-
- freeaddrinfo(servinfo); // all done with this structure
-
- if (sockfd_ == -1) {
- GTEST_LOG_(WARNING) << "stream_result_to: failed to connect to "
- << host_name_ << ":" << port_num_;
- }
-}
-
-// End of class Streaming Listener
-#endif // GTEST_CAN_STREAM_RESULTS__
-
-// Class ScopedTrace
-
-// Pushes the given source file location and message onto a per-thread
-// trace stack maintained by Google Test.
-ScopedTrace::ScopedTrace(const char* file, int line, const Message& message)
- GTEST_LOCK_EXCLUDED_(&UnitTest::mutex_) {
- TraceInfo trace;
- trace.file = file;
- trace.line = line;
- trace.message = message.GetString();
-
- UnitTest::GetInstance()->PushGTestTrace(trace);
-}
-
-// Pops the info pushed by the c'tor.
-ScopedTrace::~ScopedTrace()
- GTEST_LOCK_EXCLUDED_(&UnitTest::mutex_) {
- UnitTest::GetInstance()->PopGTestTrace();
-}
-
-
-// class OsStackTraceGetter
-
-// Returns the current OS stack trace as a String. Parameters:
-//
-// max_depth - the maximum number of stack frames to be included
-// in the trace.
-// skip_count - the number of top frames to be skipped; doesn't count
-// against max_depth.
-//
-String OsStackTraceGetter::CurrentStackTrace(int /* max_depth */,
- int /* skip_count */)
- GTEST_LOCK_EXCLUDED_(mutex_) {
- return String("");
-}
-
-void OsStackTraceGetter::UponLeavingGTest()
- GTEST_LOCK_EXCLUDED_(mutex_) {
-}
-
-const char* const
-OsStackTraceGetter::kElidedFramesMarker =
- "... " GTEST_NAME_ " internal frames ...";
-
-} // namespace internal
-
-// class TestEventListeners
-
-TestEventListeners::TestEventListeners()
- : repeater_(new internal::TestEventRepeater()),
- default_result_printer_(NULL),
- default_xml_generator_(NULL) {
-}
-
-TestEventListeners::~TestEventListeners() { delete repeater_; }
-
-// Returns the standard listener responsible for the default console
-// output. Can be removed from the listeners list to shut down default
-// console output. Note that removing this object from the listener list
-// with Release transfers its ownership to the user.
-void TestEventListeners::Append(TestEventListener* listener) {
- repeater_->Append(listener);
-}
-
-// Removes the given event listener from the list and returns it. It then
-// becomes the caller's responsibility to delete the listener. Returns
-// NULL if the listener is not found in the list.
-TestEventListener* TestEventListeners::Release(TestEventListener* listener) {
- if (listener == default_result_printer_)
- default_result_printer_ = NULL;
- else if (listener == default_xml_generator_)
- default_xml_generator_ = NULL;
- return repeater_->Release(listener);
-}
-
-// Returns repeater that broadcasts the TestEventListener events to all
-// subscribers.
-TestEventListener* TestEventListeners::repeater() { return repeater_; }
-
-// Sets the default_result_printer attribute to the provided listener.
-// The listener is also added to the listener list and previous
-// default_result_printer is removed from it and deleted. The listener can
-// also be NULL in which case it will not be added to the list. Does
-// nothing if the previous and the current listener objects are the same.
-void TestEventListeners::SetDefaultResultPrinter(TestEventListener* listener) {
- if (default_result_printer_ != listener) {
- // It is an error to pass this method a listener that is already in the
- // list.
- delete Release(default_result_printer_);
- default_result_printer_ = listener;
- if (listener != NULL)
- Append(listener);
- }
-}
-
-// Sets the default_xml_generator attribute to the provided listener. The
-// listener is also added to the listener list and previous
-// default_xml_generator is removed from it and deleted. The listener can
-// also be NULL in which case it will not be added to the list. Does
-// nothing if the previous and the current listener objects are the same.
-void TestEventListeners::SetDefaultXmlGenerator(TestEventListener* listener) {
- if (default_xml_generator_ != listener) {
- // It is an error to pass this method a listener that is already in the
- // list.
- delete Release(default_xml_generator_);
- default_xml_generator_ = listener;
- if (listener != NULL)
- Append(listener);
- }
-}
-
-// Controls whether events will be forwarded by the repeater to the
-// listeners in the list.
-bool TestEventListeners::EventForwardingEnabled() const {
- return repeater_->forwarding_enabled();
-}
-
-void TestEventListeners::SuppressEventForwarding() {
- repeater_->set_forwarding_enabled(false);
-}
-
-// class UnitTest
-
-// Gets the singleton UnitTest object. The first time this method is
-// called, a UnitTest object is constructed and returned. Consecutive
-// calls will return the same object.
-//
-// We don't protect this under mutex_ as a user is not supposed to
-// call this before main() starts, from which point on the return
-// value will never change.
-UnitTest * UnitTest::GetInstance() {
- // When compiled with MSVC 7.1 in optimized mode, destroying the
- // UnitTest object upon exiting the program messes up the exit code,
- // causing successful tests to appear failed. We have to use a
- // different implementation in this case to bypass the compiler bug.
- // This implementation makes the compiler happy, at the cost of
- // leaking the UnitTest object.
-
- // CodeGear C++Builder insists on a public destructor for the
- // default implementation. Use this implementation to keep good OO
- // design with private destructor.
-
-#if (_MSC_VER == 1310 && !defined(_DEBUG)) || defined(__BORLANDC__)
- static UnitTest* const instance = new UnitTest;
- return instance;
-#else
- static UnitTest instance;
- return &instance;
-#endif // (_MSC_VER == 1310 && !defined(_DEBUG)) || defined(__BORLANDC__)
-}
-
-// Gets the number of successful test cases.
-int UnitTest::successful_test_case_count() const {
- return impl()->successful_test_case_count();
-}
-
-// Gets the number of failed test cases.
-int UnitTest::failed_test_case_count() const {
- return impl()->failed_test_case_count();
-}
-
-// Gets the number of all test cases.
-int UnitTest::total_test_case_count() const {
- return impl()->total_test_case_count();
-}
-
-// Gets the number of all test cases that contain at least one test
-// that should run.
-int UnitTest::test_case_to_run_count() const {
- return impl()->test_case_to_run_count();
-}
-
-// Gets the number of successful tests.
-int UnitTest::successful_test_count() const {
- return impl()->successful_test_count();
-}
-
-// Gets the number of failed tests.
-int UnitTest::failed_test_count() const { return impl()->failed_test_count(); }
-
-// Gets the number of disabled tests.
-int UnitTest::disabled_test_count() const {
- return impl()->disabled_test_count();
-}
-
-// Gets the number of all tests.
-int UnitTest::total_test_count() const { return impl()->total_test_count(); }
-
-// Gets the number of tests that should run.
-int UnitTest::test_to_run_count() const { return impl()->test_to_run_count(); }
-
-// Gets the time of the test program start, in ms from the start of the
-// UNIX epoch.
-internal::TimeInMillis UnitTest::start_timestamp() const {
- return impl()->start_timestamp();
-}
-
-// Gets the elapsed time, in milliseconds.
-internal::TimeInMillis UnitTest::elapsed_time() const {
- return impl()->elapsed_time();
-}
-
-// Returns true iff the unit test passed (i.e. all test cases passed).
-bool UnitTest::Passed() const { return impl()->Passed(); }
-
-// Returns true iff the unit test failed (i.e. some test case failed
-// or something outside of all tests failed).
-bool UnitTest::Failed() const { return impl()->Failed(); }
-
-// Gets the i-th test case among all the test cases. i can range from 0 to
-// total_test_case_count() - 1. If i is not in that range, returns NULL.
-const TestCase* UnitTest::GetTestCase(int i) const {
- return impl()->GetTestCase(i);
-}
-
-// Gets the i-th test case among all the test cases. i can range from 0 to
-// total_test_case_count() - 1. If i is not in that range, returns NULL.
-TestCase* UnitTest::GetMutableTestCase(int i) {
- return impl()->GetMutableTestCase(i);
-}
-
-// Returns the list of event listeners that can be used to track events
-// inside Google Test.
-TestEventListeners& UnitTest::listeners() {
- return *impl()->listeners();
-}
-
-// Registers and returns a global test environment. When a test
-// program is run, all global test environments will be set-up in the
-// order they were registered. After all tests in the program have
-// finished, all global test environments will be torn-down in the
-// *reverse* order they were registered.
-//
-// The UnitTest object takes ownership of the given environment.
-//
-// We don't protect this under mutex_, as we only support calling it
-// from the main thread.
-Environment* UnitTest::AddEnvironment(Environment* env) {
- if (env == NULL) {
- return NULL;
- }
-
- impl_->environments().push_back(env);
- return env;
-}
-
-// Adds a TestPartResult to the current TestResult object. All Google Test
-// assertion macros (e.g. ASSERT_TRUE, EXPECT_EQ, etc) eventually call
-// this to report their results. The user code should use the
-// assertion macros instead of calling this directly.
-void UnitTest::AddTestPartResult(
- TestPartResult::Type result_type,
- const char* file_name,
- int line_number,
- const internal::String& message,
- const internal::String& os_stack_trace)
- GTEST_LOCK_EXCLUDED_(mutex_) {
- Message msg;
- msg << message;
-
- internal::MutexLock lock(&mutex_);
- if (impl_->gtest_trace_stack().size() > 0) {
- msg << "\n" << GTEST_NAME_ << " trace:";
-
- for (int i = static_cast<int>(impl_->gtest_trace_stack().size());
- i > 0; --i) {
- const internal::TraceInfo& trace = impl_->gtest_trace_stack()[i - 1];
- msg << "\n" << internal::FormatFileLocation(trace.file, trace.line)
- << " " << trace.message;
- }
- }
-
- if (os_stack_trace.c_str() != NULL && !os_stack_trace.empty()) {
- msg << internal::kStackTraceMarker << os_stack_trace;
- }
-
- const TestPartResult result =
- TestPartResult(result_type, file_name, line_number,
- msg.GetString().c_str());
- impl_->GetTestPartResultReporterForCurrentThread()->
- ReportTestPartResult(result);
-
- if (result_type != TestPartResult::kSuccess) {
- // gtest_break_on_failure takes precedence over
- // gtest_throw_on_failure. This allows a user to set the latter
- // in the code (perhaps in order to use Google Test assertions
- // with another testing framework) and specify the former on the
- // command line for debugging.
- if (GTEST_FLAG(break_on_failure)) {
-#if GTEST_OS_WINDOWS
- // Using DebugBreak on Windows allows gtest to still break into a debugger
- // when a failure happens and both the --gtest_break_on_failure and
- // the --gtest_catch_exceptions flags are specified.
- DebugBreak();
-#else
- // Dereference NULL through a volatile pointer to prevent the compiler
- // from removing. We use this rather than abort() or __builtin_trap() for
- // portability: Symbian doesn't implement abort() well, and some debuggers
- // don't correctly trap abort().
- *static_cast<volatile int*>(NULL) = 1;
-#endif // GTEST_OS_WINDOWS
- } else if (GTEST_FLAG(throw_on_failure)) {
-#if GTEST_HAS_EXCEPTIONS
- throw GoogleTestFailureException(result);
-#else
- // We cannot call abort() as it generates a pop-up in debug mode
- // that cannot be suppressed in VC 7.1 or below.
- exit(1);
-#endif
- }
- }
-}
-
-// Creates and adds a property to the current TestResult. If a property matching
-// the supplied value already exists, updates its value instead.
-void UnitTest::RecordPropertyForCurrentTest(const char* key,
- const char* value) {
- const TestProperty test_property(key, value);
- impl_->current_test_result()->RecordProperty(test_property);
-}
-
-// Runs all tests in this UnitTest object and prints the result.
-// Returns 0 if successful, or 1 otherwise.
-//
-// We don't protect this under mutex_, as we only support calling it
-// from the main thread.
-int UnitTest::Run() {
- // Captures the value of GTEST_FLAG(catch_exceptions). This value will be
- // used for the duration of the program.
- impl()->set_catch_exceptions(GTEST_FLAG(catch_exceptions));
-
-#if GTEST_HAS_SEH
- const bool in_death_test_child_process =
- internal::GTEST_FLAG(internal_run_death_test).length() > 0;
-
- // Either the user wants Google Test to catch exceptions thrown by the
- // tests or this is executing in the context of death test child
- // process. In either case the user does not want to see pop-up dialogs
- // about crashes - they are expected.
- if (impl()->catch_exceptions() || in_death_test_child_process) {
-# if !GTEST_OS_WINDOWS_MOBILE
- // SetErrorMode doesn't exist on CE.
- SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOALIGNMENTFAULTEXCEPT |
- SEM_NOGPFAULTERRORBOX | SEM_NOOPENFILEERRORBOX);
-# endif // !GTEST_OS_WINDOWS_MOBILE
-
-# if (defined(_MSC_VER) || GTEST_OS_WINDOWS_MINGW) && !GTEST_OS_WINDOWS_MOBILE
- // Death test children can be terminated with _abort(). On Windows,
- // _abort() can show a dialog with a warning message. This forces the
- // abort message to go to stderr instead.
- _set_error_mode(_OUT_TO_STDERR);
-# endif
-
-# if _MSC_VER >= 1400 && !GTEST_OS_WINDOWS_MOBILE
- // In the debug version, Visual Studio pops up a separate dialog
- // offering a choice to debug the aborted program. We need to suppress
- // this dialog or it will pop up for every EXPECT/ASSERT_DEATH statement
- // executed. Google Test will notify the user of any unexpected
- // failure via stderr.
- //
- // VC++ doesn't define _set_abort_behavior() prior to the version 8.0.
- // Users of prior VC versions shall suffer the agony and pain of
- // clicking through the countless debug dialogs.
- // TODO(vladl@google.com): find a way to suppress the abort dialog() in the
- // debug mode when compiled with VC 7.1 or lower.
- if (!GTEST_FLAG(break_on_failure))
- _set_abort_behavior(
- 0x0, // Clear the following flags:
- _WRITE_ABORT_MSG | _CALL_REPORTFAULT); // pop-up window, core dump.
-# endif
- }
-#endif // GTEST_HAS_SEH
-
- return internal::HandleExceptionsInMethodIfSupported(
- impl(),
- &internal::UnitTestImpl::RunAllTests,
- "auxiliary test code (environments or event listeners)") ? 0 : 1;
-}
-
-// Returns the working directory when the first TEST() or TEST_F() was
-// executed.
-const char* UnitTest::original_working_dir() const {
- return impl_->original_working_dir_.c_str();
-}
-
-// Returns the TestCase object for the test that's currently running,
-// or NULL if no test is running.
-const TestCase* UnitTest::current_test_case() const
- GTEST_LOCK_EXCLUDED_(mutex_) {
- internal::MutexLock lock(&mutex_);
- return impl_->current_test_case();
-}
-
-// Returns the TestInfo object for the test that's currently running,
-// or NULL if no test is running.
-const TestInfo* UnitTest::current_test_info() const
- GTEST_LOCK_EXCLUDED_(mutex_) {
- internal::MutexLock lock(&mutex_);
- return impl_->current_test_info();
-}
-
-// Returns the random seed used at the start of the current test run.
-int UnitTest::random_seed() const { return impl_->random_seed(); }
-
-#if GTEST_HAS_PARAM_TEST
-// Returns ParameterizedTestCaseRegistry object used to keep track of
-// value-parameterized tests and instantiate and register them.
-internal::ParameterizedTestCaseRegistry&
- UnitTest::parameterized_test_registry()
- GTEST_LOCK_EXCLUDED_(mutex_) {
- return impl_->parameterized_test_registry();
-}
-#endif // GTEST_HAS_PARAM_TEST
-
-// Creates an empty UnitTest.
-UnitTest::UnitTest() {
- impl_ = new internal::UnitTestImpl(this);
-}
-
-// Destructor of UnitTest.
-UnitTest::~UnitTest() {
- delete impl_;
-}
-
-// Pushes a trace defined by SCOPED_TRACE() on to the per-thread
-// Google Test trace stack.
-void UnitTest::PushGTestTrace(const internal::TraceInfo& trace)
- GTEST_LOCK_EXCLUDED_(mutex_) {
- internal::MutexLock lock(&mutex_);
- impl_->gtest_trace_stack().push_back(trace);
-}
-
-// Pops a trace from the per-thread Google Test trace stack.
-void UnitTest::PopGTestTrace()
- GTEST_LOCK_EXCLUDED_(mutex_) {
- internal::MutexLock lock(&mutex_);
- impl_->gtest_trace_stack().pop_back();
-}
-
-namespace internal {
-
-UnitTestImpl::UnitTestImpl(UnitTest* parent)
- : parent_(parent),
-#ifdef _MSC_VER
-# pragma warning(push) // Saves the current warning state.
-# pragma warning(disable:4355) // Temporarily disables warning 4355
- // (using this in initializer).
- default_global_test_part_result_reporter_(this),
- default_per_thread_test_part_result_reporter_(this),
-# pragma warning(pop) // Restores the warning state again.
-#else
- default_global_test_part_result_reporter_(this),
- default_per_thread_test_part_result_reporter_(this),
-#endif // _MSC_VER
- global_test_part_result_repoter_(
- &default_global_test_part_result_reporter_),
- per_thread_test_part_result_reporter_(
- &default_per_thread_test_part_result_reporter_),
-#if GTEST_HAS_PARAM_TEST
- parameterized_test_registry_(),
- parameterized_tests_registered_(false),
-#endif // GTEST_HAS_PARAM_TEST
- last_death_test_case_(-1),
- current_test_case_(NULL),
- current_test_info_(NULL),
- ad_hoc_test_result_(),
- os_stack_trace_getter_(NULL),
- post_flag_parse_init_performed_(false),
- random_seed_(0), // Will be overridden by the flag before first use.
- random_(0), // Will be reseeded before first use.
- start_timestamp_(0),
- elapsed_time_(0),
-#if GTEST_HAS_DEATH_TEST
- internal_run_death_test_flag_(NULL),
- death_test_factory_(new DefaultDeathTestFactory),
-#endif
- // Will be overridden by the flag before first use.
- catch_exceptions_(false) {
- listeners()->SetDefaultResultPrinter(new PrettyUnitTestResultPrinter);
-}
-
-UnitTestImpl::~UnitTestImpl() {
- // Deletes every TestCase.
- ForEach(test_cases_, internal::Delete<TestCase>);
-
- // Deletes every Environment.
- ForEach(environments_, internal::Delete<Environment>);
-
- delete os_stack_trace_getter_;
-}
-
-#if GTEST_HAS_DEATH_TEST
-// Disables event forwarding if the control is currently in a death test
-// subprocess. Must not be called before InitGoogleTest.
-void UnitTestImpl::SuppressTestEventsIfInSubprocess() {
- if (internal_run_death_test_flag_.get() != NULL)
- listeners()->SuppressEventForwarding();
-}
-#endif // GTEST_HAS_DEATH_TEST
-
-// Initializes event listeners performing XML output as specified by
-// UnitTestOptions. Must not be called before InitGoogleTest.
-void UnitTestImpl::ConfigureXmlOutput() {
- const String& output_format = UnitTestOptions::GetOutputFormat();
- if (output_format == "xml") {
- listeners()->SetDefaultXmlGenerator(new XmlUnitTestResultPrinter(
- UnitTestOptions::GetAbsolutePathToOutputFile().c_str()));
- } else if (output_format != "") {
- printf("WARNING: unrecognized output format \"%s\" ignored.\n",
- output_format.c_str());
- fflush(stdout);
- }
-}
-
-#if GTEST_CAN_STREAM_RESULTS_
-// Initializes event listeners for streaming test results in String form.
-// Must not be called before InitGoogleTest.
-void UnitTestImpl::ConfigureStreamingOutput() {
- const string& target = GTEST_FLAG(stream_result_to);
- if (!target.empty()) {
- const size_t pos = target.find(':');
- if (pos != string::npos) {
- listeners()->Append(new StreamingListener(target.substr(0, pos),
- target.substr(pos+1)));
- } else {
- printf("WARNING: unrecognized streaming target \"%s\" ignored.\n",
- target.c_str());
- fflush(stdout);
- }
- }
-}
-#endif // GTEST_CAN_STREAM_RESULTS_
-
-// Performs initialization dependent upon flag values obtained in
-// ParseGoogleTestFlagsOnly. Is called from InitGoogleTest after the call to
-// ParseGoogleTestFlagsOnly. In case a user neglects to call InitGoogleTest
-// this function is also called from RunAllTests. Since this function can be
-// called more than once, it has to be idempotent.
-void UnitTestImpl::PostFlagParsingInit() {
- // Ensures that this function does not execute more than once.
- if (!post_flag_parse_init_performed_) {
- post_flag_parse_init_performed_ = true;
-
-#if GTEST_HAS_DEATH_TEST
- InitDeathTestSubprocessControlInfo();
- SuppressTestEventsIfInSubprocess();
-#endif // GTEST_HAS_DEATH_TEST
-
- // Registers parameterized tests. This makes parameterized tests
- // available to the UnitTest reflection API without running
- // RUN_ALL_TESTS.
- RegisterParameterizedTests();
-
- // Configures listeners for XML output. This makes it possible for users
- // to shut down the default XML output before invoking RUN_ALL_TESTS.
- ConfigureXmlOutput();
-
-#if GTEST_CAN_STREAM_RESULTS_
- // Configures listeners for streaming test results to the specified server.
- ConfigureStreamingOutput();
-#endif // GTEST_CAN_STREAM_RESULTS_
- }
-}
-
-// A predicate that checks the name of a TestCase against a known
-// value.
-//
-// This is used for implementation of the UnitTest class only. We put
-// it in the anonymous namespace to prevent polluting the outer
-// namespace.
-//
-// TestCaseNameIs is copyable.
-class TestCaseNameIs {
- public:
- // Constructor.
- explicit TestCaseNameIs(const String& name)
- : name_(name) {}
-
- // Returns true iff the name of test_case matches name_.
- bool operator()(const TestCase* test_case) const {
- return test_case != NULL && strcmp(test_case->name(), name_.c_str()) == 0;
- }
-
- private:
- String name_;
-};
-
-// Finds and returns a TestCase with the given name. If one doesn't
-// exist, creates one and returns it. It's the CALLER'S
-// RESPONSIBILITY to ensure that this function is only called WHEN THE
-// TESTS ARE NOT SHUFFLED.
-//
-// Arguments:
-//
-// test_case_name: name of the test case
-// type_param: the name of the test case's type parameter, or NULL if
-// this is not a typed or a type-parameterized test case.
-// set_up_tc: pointer to the function that sets up the test case
-// tear_down_tc: pointer to the function that tears down the test case
-TestCase* UnitTestImpl::GetTestCase(const char* test_case_name,
- const char* type_param,
- Test::SetUpTestCaseFunc set_up_tc,
- Test::TearDownTestCaseFunc tear_down_tc) {
- // Can we find a TestCase with the given name?
- const std::vector<TestCase*>::const_iterator test_case =
- std::find_if(test_cases_.begin(), test_cases_.end(),
- TestCaseNameIs(test_case_name));
-
- if (test_case != test_cases_.end())
- return *test_case;
-
- // No. Let's create one.
- TestCase* const new_test_case =
- new TestCase(test_case_name, type_param, set_up_tc, tear_down_tc);
-
- // Is this a death test case?
- if (internal::UnitTestOptions::MatchesFilter(String(test_case_name),
- kDeathTestCaseFilter)) {
- // Yes. Inserts the test case after the last death test case
- // defined so far. This only works when the test cases haven't
- // been shuffled. Otherwise we may end up running a death test
- // after a non-death test.
- ++last_death_test_case_;
- test_cases_.insert(test_cases_.begin() + last_death_test_case_,
- new_test_case);
- } else {
- // No. Appends to the end of the list.
- test_cases_.push_back(new_test_case);
- }
-
- test_case_indices_.push_back(static_cast<int>(test_case_indices_.size()));
- return new_test_case;
-}
-
-// Helpers for setting up / tearing down the given environment. They
-// are for use in the ForEach() function.
-static void SetUpEnvironment(Environment* env) { env->SetUp(); }
-static void TearDownEnvironment(Environment* env) { env->TearDown(); }
-
-// Runs all tests in this UnitTest object, prints the result, and
-// returns true if all tests are successful. If any exception is
-// thrown during a test, the test is considered to be failed, but the
-// rest of the tests will still be run.
-//
-// When parameterized tests are enabled, it expands and registers
-// parameterized tests first in RegisterParameterizedTests().
-// All other functions called from RunAllTests() may safely assume that
-// parameterized tests are ready to be counted and run.
-bool UnitTestImpl::RunAllTests() {
- // Makes sure InitGoogleTest() was called.
- if (!GTestIsInitialized()) {
- printf("%s",
- "\nThis test program did NOT call ::testing::InitGoogleTest "
- "before calling RUN_ALL_TESTS(). Please fix it.\n");
- return false;
- }
-
- // Do not run any test if the --help flag was specified.
- if (g_help_flag)
- return true;
-
- // Repeats the call to the post-flag parsing initialization in case the
- // user didn't call InitGoogleTest.
- PostFlagParsingInit();
-
- // Even if sharding is not on, test runners may want to use the
- // GTEST_SHARD_STATUS_FILE to query whether the test supports the sharding
- // protocol.
- internal::WriteToShardStatusFileIfNeeded();
-
- // True iff we are in a subprocess for running a thread-safe-style
- // death test.
- bool in_subprocess_for_death_test = false;
-
-#if GTEST_HAS_DEATH_TEST
- in_subprocess_for_death_test = (internal_run_death_test_flag_.get() != NULL);
-#endif // GTEST_HAS_DEATH_TEST
-
- const bool should_shard = ShouldShard(kTestTotalShards, kTestShardIndex,
- in_subprocess_for_death_test);
-
- // Compares the full test names with the filter to decide which
- // tests to run.
- const bool has_tests_to_run = FilterTests(should_shard
- ? HONOR_SHARDING_PROTOCOL
- : IGNORE_SHARDING_PROTOCOL) > 0;
-
- // Lists the tests and exits if the --gtest_list_tests flag was specified.
- if (GTEST_FLAG(list_tests)) {
- // This must be called *after* FilterTests() has been called.
- ListTestsMatchingFilter();
- return true;
- }
-
- random_seed_ = GTEST_FLAG(shuffle) ?
- GetRandomSeedFromFlag(GTEST_FLAG(random_seed)) : 0;
-
- // True iff at least one test has failed.
- bool failed = false;
-
- TestEventListener* repeater = listeners()->repeater();
-
- start_timestamp_ = GetTimeInMillis();
- repeater->OnTestProgramStart(*parent_);
-
- // How many times to repeat the tests? We don't want to repeat them
- // when we are inside the subprocess of a death test.
- const int repeat = in_subprocess_for_death_test ? 1 : GTEST_FLAG(repeat);
- // Repeats forever if the repeat count is negative.
- const bool forever = repeat < 0;
- for (int i = 0; forever || i != repeat; i++) {
- // We want to preserve failures generated by ad-hoc test
- // assertions executed before RUN_ALL_TESTS().
- ClearNonAdHocTestResult();
-
- const TimeInMillis start = GetTimeInMillis();
-
- // Shuffles test cases and tests if requested.
- if (has_tests_to_run && GTEST_FLAG(shuffle)) {
- random()->Reseed(random_seed_);
- // This should be done before calling OnTestIterationStart(),
- // such that a test event listener can see the actual test order
- // in the event.
- ShuffleTests();
- }
-
- // Tells the unit test event listeners that the tests are about to start.
- repeater->OnTestIterationStart(*parent_, i);
-
- // Runs each test case if there is at least one test to run.
- if (has_tests_to_run) {
- // Sets up all environments beforehand.
- repeater->OnEnvironmentsSetUpStart(*parent_);
- ForEach(environments_, SetUpEnvironment);
- repeater->OnEnvironmentsSetUpEnd(*parent_);
-
- // Runs the tests only if there was no fatal failure during global
- // set-up.
- if (!Test::HasFatalFailure()) {
- for (int test_index = 0; test_index < total_test_case_count();
- test_index++) {
- GetMutableTestCase(test_index)->Run();
- }
- }
-
- // Tears down all environments in reverse order afterwards.
- repeater->OnEnvironmentsTearDownStart(*parent_);
- std::for_each(environments_.rbegin(), environments_.rend(),
- TearDownEnvironment);
- repeater->OnEnvironmentsTearDownEnd(*parent_);
- }
-
- elapsed_time_ = GetTimeInMillis() - start;
-
- // Tells the unit test event listener that the tests have just finished.
- repeater->OnTestIterationEnd(*parent_, i);
-
- // Gets the result and clears it.
- if (!Passed()) {
- failed = true;
- }
-
- // Restores the original test order after the iteration. This
- // allows the user to quickly repro a failure that happens in the
- // N-th iteration without repeating the first (N - 1) iterations.
- // This is not enclosed in "if (GTEST_FLAG(shuffle)) { ... }", in
- // case the user somehow changes the value of the flag somewhere
- // (it's always safe to unshuffle the tests).
- UnshuffleTests();
-
- if (GTEST_FLAG(shuffle)) {
- // Picks a new random seed for each iteration.
- random_seed_ = GetNextRandomSeed(random_seed_);
- }
- }
-
- repeater->OnTestProgramEnd(*parent_);
-
- return !failed;
-}
-
-// Reads the GTEST_SHARD_STATUS_FILE environment variable, and creates the file
-// if the variable is present. If a file already exists at this location, this
-// function will write over it. If the variable is present, but the file cannot
-// be created, prints an error and exits.
-void WriteToShardStatusFileIfNeeded() {
- const char* const test_shard_file = posix::GetEnv(kTestShardStatusFile);
- if (test_shard_file != NULL) {
- FILE* const file = posix::FOpen(test_shard_file, "w");
- if (file == NULL) {
- ColoredPrintf(COLOR_RED,
- "Could not write to the test shard status file \"%s\" "
- "specified by the %s environment variable.\n",
- test_shard_file, kTestShardStatusFile);
- fflush(stdout);
- exit(EXIT_FAILURE);
- }
- fclose(file);
- }
-}
-
-// Checks whether sharding is enabled by examining the relevant
-// environment variable values. If the variables are present,
-// but inconsistent (i.e., shard_index >= total_shards), prints
-// an error and exits. If in_subprocess_for_death_test, sharding is
-// disabled because it must only be applied to the original test
-// process. Otherwise, we could filter out death tests we intended to execute.
-bool ShouldShard(const char* total_shards_env,
- const char* shard_index_env,
- bool in_subprocess_for_death_test) {
- if (in_subprocess_for_death_test) {
- return false;
- }
-
- const Int32 total_shards = Int32FromEnvOrDie(total_shards_env, -1);
- const Int32 shard_index = Int32FromEnvOrDie(shard_index_env, -1);
-
- if (total_shards == -1 && shard_index == -1) {
- return false;
- } else if (total_shards == -1 && shard_index != -1) {
- const Message msg = Message()
- << "Invalid environment variables: you have "
- << kTestShardIndex << " = " << shard_index
- << ", but have left " << kTestTotalShards << " unset.\n";
- ColoredPrintf(COLOR_RED, msg.GetString().c_str());
- fflush(stdout);
- exit(EXIT_FAILURE);
- } else if (total_shards != -1 && shard_index == -1) {
- const Message msg = Message()
- << "Invalid environment variables: you have "
- << kTestTotalShards << " = " << total_shards
- << ", but have left " << kTestShardIndex << " unset.\n";
- ColoredPrintf(COLOR_RED, msg.GetString().c_str());
- fflush(stdout);
- exit(EXIT_FAILURE);
- } else if (shard_index < 0 || shard_index >= total_shards) {
- const Message msg = Message()
- << "Invalid environment variables: we require 0 <= "
- << kTestShardIndex << " < " << kTestTotalShards
- << ", but you have " << kTestShardIndex << "=" << shard_index
- << ", " << kTestTotalShards << "=" << total_shards << ".\n";
- ColoredPrintf(COLOR_RED, msg.GetString().c_str());
- fflush(stdout);
- exit(EXIT_FAILURE);
- }
-
- return total_shards > 1;
-}
-
-// Parses the environment variable var as an Int32. If it is unset,
-// returns default_val. If it is not an Int32, prints an error
-// and aborts.
-Int32 Int32FromEnvOrDie(const char* var, Int32 default_val) {
- const char* str_val = posix::GetEnv(var);
- if (str_val == NULL) {
- return default_val;
- }
-
- Int32 result;
- if (!ParseInt32(Message() << "The value of environment variable " << var,
- str_val, &result)) {
- exit(EXIT_FAILURE);
- }
- return result;
-}
-
-// Given the total number of shards, the shard index, and the test id,
-// returns true iff the test should be run on this shard. The test id is
-// some arbitrary but unique non-negative integer assigned to each test
-// method. Assumes that 0 <= shard_index < total_shards.
-bool ShouldRunTestOnShard(int total_shards, int shard_index, int test_id) {
- return (test_id % total_shards) == shard_index;
-}
-
-// Compares the name of each test with the user-specified filter to
-// decide whether the test should be run, then records the result in
-// each TestCase and TestInfo object.
-// If shard_tests == true, further filters tests based on sharding
-// variables in the environment - see
-// http://code.google.com/p/googletest/wiki/GoogleTestAdvancedGuide.
-// Returns the number of tests that should run.
-int UnitTestImpl::FilterTests(ReactionToSharding shard_tests) {
- const Int32 total_shards = shard_tests == HONOR_SHARDING_PROTOCOL ?
- Int32FromEnvOrDie(kTestTotalShards, -1) : -1;
- const Int32 shard_index = shard_tests == HONOR_SHARDING_PROTOCOL ?
- Int32FromEnvOrDie(kTestShardIndex, -1) : -1;
-
- // num_runnable_tests are the number of tests that will
- // run across all shards (i.e., match filter and are not disabled).
- // num_selected_tests are the number of tests to be run on
- // this shard.
- int num_runnable_tests = 0;
- int num_selected_tests = 0;
- for (size_t i = 0; i < test_cases_.size(); i++) {
- TestCase* const test_case = test_cases_[i];
- const String &test_case_name = test_case->name();
- test_case->set_should_run(false);
-
- for (size_t j = 0; j < test_case->test_info_list().size(); j++) {
- TestInfo* const test_info = test_case->test_info_list()[j];
- const String test_name(test_info->name());
- // A test is disabled if test case name or test name matches
- // kDisableTestFilter.
- const bool is_disabled =
- internal::UnitTestOptions::MatchesFilter(test_case_name,
- kDisableTestFilter) ||
- internal::UnitTestOptions::MatchesFilter(test_name,
- kDisableTestFilter);
- test_info->is_disabled_ = is_disabled;
-
- const bool matches_filter =
- internal::UnitTestOptions::FilterMatchesTest(test_case_name,
- test_name);
- test_info->matches_filter_ = matches_filter;
-
- const bool is_runnable =
- (GTEST_FLAG(also_run_disabled_tests) || !is_disabled) &&
- matches_filter;
-
- const bool is_selected = is_runnable &&
- (shard_tests == IGNORE_SHARDING_PROTOCOL ||
- ShouldRunTestOnShard(total_shards, shard_index,
- num_runnable_tests));
-
- num_runnable_tests += is_runnable;
- num_selected_tests += is_selected;
-
- test_info->should_run_ = is_selected;
- test_case->set_should_run(test_case->should_run() || is_selected);
- }
- }
- return num_selected_tests;
-}
-
-// Prints the names of the tests matching the user-specified filter flag.
-void UnitTestImpl::ListTestsMatchingFilter() {
- for (size_t i = 0; i < test_cases_.size(); i++) {
- const TestCase* const test_case = test_cases_[i];
- bool printed_test_case_name = false;
-
- for (size_t j = 0; j < test_case->test_info_list().size(); j++) {
- const TestInfo* const test_info =
- test_case->test_info_list()[j];
- if (test_info->matches_filter_) {
- if (!printed_test_case_name) {
- printed_test_case_name = true;
- printf("%s.\n", test_case->name());
- }
- printf(" %s\n", test_info->name());
- }
- }
- }
- fflush(stdout);
-}
-
-// Sets the OS stack trace getter.
-//
-// Does nothing if the input and the current OS stack trace getter are
-// the same; otherwise, deletes the old getter and makes the input the
-// current getter.
-void UnitTestImpl::set_os_stack_trace_getter(
- OsStackTraceGetterInterface* getter) {
- if (os_stack_trace_getter_ != getter) {
- delete os_stack_trace_getter_;
- os_stack_trace_getter_ = getter;
- }
-}
-
-// Returns the current OS stack trace getter if it is not NULL;
-// otherwise, creates an OsStackTraceGetter, makes it the current
-// getter, and returns it.
-OsStackTraceGetterInterface* UnitTestImpl::os_stack_trace_getter() {
- if (os_stack_trace_getter_ == NULL) {
- os_stack_trace_getter_ = new OsStackTraceGetter;
- }
-
- return os_stack_trace_getter_;
-}
-
-// Returns the TestResult for the test that's currently running, or
-// the TestResult for the ad hoc test if no test is running.
-TestResult* UnitTestImpl::current_test_result() {
- return current_test_info_ ?
- &(current_test_info_->result_) : &ad_hoc_test_result_;
-}
-
-// Shuffles all test cases, and the tests within each test case,
-// making sure that death tests are still run first.
-void UnitTestImpl::ShuffleTests() {
- // Shuffles the death test cases.
- ShuffleRange(random(), 0, last_death_test_case_ + 1, &test_case_indices_);
-
- // Shuffles the non-death test cases.
- ShuffleRange(random(), last_death_test_case_ + 1,
- static_cast<int>(test_cases_.size()), &test_case_indices_);
-
- // Shuffles the tests inside each test case.
- for (size_t i = 0; i < test_cases_.size(); i++) {
- test_cases_[i]->ShuffleTests(random());
- }
-}
-
-// Restores the test cases and tests to their order before the first shuffle.
-void UnitTestImpl::UnshuffleTests() {
- for (size_t i = 0; i < test_cases_.size(); i++) {
- // Unshuffles the tests in each test case.
- test_cases_[i]->UnshuffleTests();
- // Resets the index of each test case.
- test_case_indices_[i] = static_cast<int>(i);
- }
-}
-
-// Returns the current OS stack trace as a String.
-//
-// The maximum number of stack frames to be included is specified by
-// the gtest_stack_trace_depth flag. The skip_count parameter
-// specifies the number of top frames to be skipped, which doesn't
-// count against the number of frames to be included.
-//
-// For example, if Foo() calls Bar(), which in turn calls
-// GetCurrentOsStackTraceExceptTop(..., 1), Foo() will be included in
-// the trace but Bar() and GetCurrentOsStackTraceExceptTop() won't.
-String GetCurrentOsStackTraceExceptTop(UnitTest* /*unit_test*/,
- int skip_count) {
- // We pass skip_count + 1 to skip this wrapper function in addition
- // to what the user really wants to skip.
- return GetUnitTestImpl()->CurrentOsStackTraceExceptTop(skip_count + 1);
-}
-
-// Used by the GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_ macro to
-// suppress unreachable code warnings.
-namespace {
-class ClassUniqueToAlwaysTrue {};
-}
-
-bool IsTrue(bool condition) { return condition; }
-
-bool AlwaysTrue() {
-#if GTEST_HAS_EXCEPTIONS
- // This condition is always false so AlwaysTrue() never actually throws,
- // but it makes the compiler think that it may throw.
- if (IsTrue(false))
- throw ClassUniqueToAlwaysTrue();
-#endif // GTEST_HAS_EXCEPTIONS
- return true;
-}
-
-// If *pstr starts with the given prefix, modifies *pstr to be right
-// past the prefix and returns true; otherwise leaves *pstr unchanged
-// and returns false. None of pstr, *pstr, and prefix can be NULL.
-bool SkipPrefix(const char* prefix, const char** pstr) {
- const size_t prefix_len = strlen(prefix);
- if (strncmp(*pstr, prefix, prefix_len) == 0) {
- *pstr += prefix_len;
- return true;
- }
- return false;
-}
-
-// Parses a string as a command line flag. The string should have
-// the format "--flag=value". When def_optional is true, the "=value"
-// part can be omitted.
-//
-// Returns the value of the flag, or NULL if the parsing failed.
-const char* ParseFlagValue(const char* str,
- const char* flag,
- bool def_optional) {
- // str and flag must not be NULL.
- if (str == NULL || flag == NULL) return NULL;
-
- // The flag must start with "--" followed by GTEST_FLAG_PREFIX_.
- const String flag_str = String::Format("--%s%s", GTEST_FLAG_PREFIX_, flag);
- const size_t flag_len = flag_str.length();
- if (strncmp(str, flag_str.c_str(), flag_len) != 0) return NULL;
-
- // Skips the flag name.
- const char* flag_end = str + flag_len;
-
- // When def_optional is true, it's OK to not have a "=value" part.
- if (def_optional && (flag_end[0] == '\0')) {
- return flag_end;
- }
-
- // If def_optional is true and there are more characters after the
- // flag name, or if def_optional is false, there must be a '=' after
- // the flag name.
- if (flag_end[0] != '=') return NULL;
-
- // Returns the string after "=".
- return flag_end + 1;
-}
-
-// Parses a string for a bool flag, in the form of either
-// "--flag=value" or "--flag".
-//
-// In the former case, the value is taken as true as long as it does
-// not start with '0', 'f', or 'F'.
-//
-// In the latter case, the value is taken as true.
-//
-// On success, stores the value of the flag in *value, and returns
-// true. On failure, returns false without changing *value.
-bool ParseBoolFlag(const char* str, const char* flag, bool* value) {
- // Gets the value of the flag as a string.
- const char* const value_str = ParseFlagValue(str, flag, true);
-
- // Aborts if the parsing failed.
- if (value_str == NULL) return false;
-
- // Converts the string value to a bool.
- *value = !(*value_str == '0' || *value_str == 'f' || *value_str == 'F');
- return true;
-}
-
-// Parses a string for an Int32 flag, in the form of
-// "--flag=value".
-//
-// On success, stores the value of the flag in *value, and returns
-// true. On failure, returns false without changing *value.
-bool ParseInt32Flag(const char* str, const char* flag, Int32* value) {
- // Gets the value of the flag as a string.
- const char* const value_str = ParseFlagValue(str, flag, false);
-
- // Aborts if the parsing failed.
- if (value_str == NULL) return false;
-
- // Sets *value to the value of the flag.
- return ParseInt32(Message() << "The value of flag --" << flag,
- value_str, value);
-}
-
-// Parses a string for a string flag, in the form of
-// "--flag=value".
-//
-// On success, stores the value of the flag in *value, and returns
-// true. On failure, returns false without changing *value.
-bool ParseStringFlag(const char* str, const char* flag, String* value) {
- // Gets the value of the flag as a string.
- const char* const value_str = ParseFlagValue(str, flag, false);
-
- // Aborts if the parsing failed.
- if (value_str == NULL) return false;
-
- // Sets *value to the value of the flag.
- *value = value_str;
- return true;
-}
-
-// Determines whether a string has a prefix that Google Test uses for its
-// flags, i.e., starts with GTEST_FLAG_PREFIX_ or GTEST_FLAG_PREFIX_DASH_.
-// If Google Test detects that a command line flag has its prefix but is not
-// recognized, it will print its help message. Flags starting with
-// GTEST_INTERNAL_PREFIX_ followed by "internal_" are considered Google Test
-// internal flags and do not trigger the help message.
-static bool HasGoogleTestFlagPrefix(const char* str) {
- return (SkipPrefix("--", &str) ||
- SkipPrefix("-", &str) ||
- SkipPrefix("/", &str)) &&
- !SkipPrefix(GTEST_FLAG_PREFIX_ "internal_", &str) &&
- (SkipPrefix(GTEST_FLAG_PREFIX_, &str) ||
- SkipPrefix(GTEST_FLAG_PREFIX_DASH_, &str));
-}
-
-// Prints a string containing code-encoded text. The following escape
-// sequences can be used in the string to control the text color:
-//
-// @@ prints a single '@' character.
-// @R changes the color to red.
-// @G changes the color to green.
-// @Y changes the color to yellow.
-// @D changes to the default terminal text color.
-//
-// TODO(wan@google.com): Write tests for this once we add stdout
-// capturing to Google Test.
-static void PrintColorEncoded(const char* str) {
- GTestColor color = COLOR_DEFAULT; // The current color.
-
- // Conceptually, we split the string into segments divided by escape
- // sequences. Then we print one segment at a time. At the end of
- // each iteration, the str pointer advances to the beginning of the
- // next segment.
- for (;;) {
- const char* p = strchr(str, '@');
- if (p == NULL) {
- ColoredPrintf(color, "%s", str);
- return;
- }
-
- ColoredPrintf(color, "%s", String(str, p - str).c_str());
-
- const char ch = p[1];
- str = p + 2;
- if (ch == '@') {
- ColoredPrintf(color, "@");
- } else if (ch == 'D') {
- color = COLOR_DEFAULT;
- } else if (ch == 'R') {
- color = COLOR_RED;
- } else if (ch == 'G') {
- color = COLOR_GREEN;
- } else if (ch == 'Y') {
- color = COLOR_YELLOW;
- } else {
- --str;
- }
- }
-}
-
-static const char kColorEncodedHelpMessage[] =
-"This program contains tests written using " GTEST_NAME_ ". You can use the\n"
-"following command line flags to control its behavior:\n"
-"\n"
-"Test Selection:\n"
-" @G--" GTEST_FLAG_PREFIX_ "list_tests@D\n"
-" List the names of all tests instead of running them. The name of\n"
-" TEST(Foo, Bar) is \"Foo.Bar\".\n"
-" @G--" GTEST_FLAG_PREFIX_ "filter=@YPOSTIVE_PATTERNS"
- "[@G-@YNEGATIVE_PATTERNS]@D\n"
-" Run only the tests whose name matches one of the positive patterns but\n"
-" none of the negative patterns. '?' matches any single character; '*'\n"
-" matches any substring; ':' separates two patterns.\n"
-" @G--" GTEST_FLAG_PREFIX_ "also_run_disabled_tests@D\n"
-" Run all disabled tests too.\n"
-"\n"
-"Test Execution:\n"
-" @G--" GTEST_FLAG_PREFIX_ "repeat=@Y[COUNT]@D\n"
-" Run the tests repeatedly; use a negative count to repeat forever.\n"
-" @G--" GTEST_FLAG_PREFIX_ "shuffle@D\n"
-" Randomize tests' orders on every iteration.\n"
-" @G--" GTEST_FLAG_PREFIX_ "random_seed=@Y[NUMBER]@D\n"
-" Random number seed to use for shuffling test orders (between 1 and\n"
-" 99999, or 0 to use a seed based on the current time).\n"
-"\n"
-"Test Output:\n"
-" @G--" GTEST_FLAG_PREFIX_ "color=@Y(@Gyes@Y|@Gno@Y|@Gauto@Y)@D\n"
-" Enable/disable colored output. The default is @Gauto@D.\n"
-" -@G-" GTEST_FLAG_PREFIX_ "print_time=0@D\n"
-" Don't print the elapsed time of each test.\n"
-" @G--" GTEST_FLAG_PREFIX_ "output=xml@Y[@G:@YDIRECTORY_PATH@G"
- GTEST_PATH_SEP_ "@Y|@G:@YFILE_PATH]@D\n"
-" Generate an XML report in the given directory or with the given file\n"
-" name. @YFILE_PATH@D defaults to @Gtest_details.xml@D.\n"
-#if GTEST_CAN_STREAM_RESULTS_
-" @G--" GTEST_FLAG_PREFIX_ "stream_result_to=@YHOST@G:@YPORT@D\n"
-" Stream test results to the given server.\n"
-#endif // GTEST_CAN_STREAM_RESULTS_
-"\n"
-"Assertion Behavior:\n"
-#if GTEST_HAS_DEATH_TEST && !GTEST_OS_WINDOWS
-" @G--" GTEST_FLAG_PREFIX_ "death_test_style=@Y(@Gfast@Y|@Gthreadsafe@Y)@D\n"
-" Set the default death test style.\n"
-#endif // GTEST_HAS_DEATH_TEST && !GTEST_OS_WINDOWS
-" @G--" GTEST_FLAG_PREFIX_ "break_on_failure@D\n"
-" Turn assertion failures into debugger break-points.\n"
-" @G--" GTEST_FLAG_PREFIX_ "throw_on_failure@D\n"
-" Turn assertion failures into C++ exceptions.\n"
-" @G--" GTEST_FLAG_PREFIX_ "catch_exceptions=0@D\n"
-" Do not report exceptions as test failures. Instead, allow them\n"
-" to crash the program or throw a pop-up (on Windows).\n"
-"\n"
-"Except for @G--" GTEST_FLAG_PREFIX_ "list_tests@D, you can alternatively set "
- "the corresponding\n"
-"environment variable of a flag (all letters in upper-case). For example, to\n"
-"disable colored text output, you can either specify @G--" GTEST_FLAG_PREFIX_
- "color=no@D or set\n"
-"the @G" GTEST_FLAG_PREFIX_UPPER_ "COLOR@D environment variable to @Gno@D.\n"
-"\n"
-"For more information, please read the " GTEST_NAME_ " documentation at\n"
-"@G" GTEST_PROJECT_URL_ "@D. If you find a bug in " GTEST_NAME_ "\n"
-"(not one in your own code or tests), please report it to\n"
-"@G<" GTEST_DEV_EMAIL_ ">@D.\n";
-
-// Parses the command line for Google Test flags, without initializing
-// other parts of Google Test. The type parameter CharType can be
-// instantiated to either char or wchar_t.
-template <typename CharType>
-void ParseGoogleTestFlagsOnlyImpl(int* argc, CharType** argv) {
- for (int i = 1; i < *argc; i++) {
- const String arg_string = StreamableToString(argv[i]);
- const char* const arg = arg_string.c_str();
-
- using internal::ParseBoolFlag;
- using internal::ParseInt32Flag;
- using internal::ParseStringFlag;
-
- // Do we see a Google Test flag?
- if (ParseBoolFlag(arg, kAlsoRunDisabledTestsFlag,
- &GTEST_FLAG(also_run_disabled_tests)) ||
- ParseBoolFlag(arg, kBreakOnFailureFlag,
- &GTEST_FLAG(break_on_failure)) ||
- ParseBoolFlag(arg, kCatchExceptionsFlag,
- &GTEST_FLAG(catch_exceptions)) ||
- ParseStringFlag(arg, kColorFlag, &GTEST_FLAG(color)) ||
- ParseStringFlag(arg, kDeathTestStyleFlag,
- &GTEST_FLAG(death_test_style)) ||
- ParseBoolFlag(arg, kDeathTestUseFork,
- &GTEST_FLAG(death_test_use_fork)) ||
- ParseStringFlag(arg, kFilterFlag, &GTEST_FLAG(filter)) ||
- ParseStringFlag(arg, kInternalRunDeathTestFlag,
- &GTEST_FLAG(internal_run_death_test)) ||
- ParseBoolFlag(arg, kListTestsFlag, &GTEST_FLAG(list_tests)) ||
- ParseStringFlag(arg, kOutputFlag, &GTEST_FLAG(output)) ||
- ParseBoolFlag(arg, kPrintTimeFlag, &GTEST_FLAG(print_time)) ||
- ParseInt32Flag(arg, kRandomSeedFlag, &GTEST_FLAG(random_seed)) ||
- ParseInt32Flag(arg, kRepeatFlag, &GTEST_FLAG(repeat)) ||
- ParseBoolFlag(arg, kShuffleFlag, &GTEST_FLAG(shuffle)) ||
- ParseInt32Flag(arg, kStackTraceDepthFlag,
- &GTEST_FLAG(stack_trace_depth)) ||
- ParseStringFlag(arg, kStreamResultToFlag,
- &GTEST_FLAG(stream_result_to)) ||
- ParseBoolFlag(arg, kThrowOnFailureFlag,
- &GTEST_FLAG(throw_on_failure))
- ) {
- // Yes. Shift the remainder of the argv list left by one. Note
- // that argv has (*argc + 1) elements, the last one always being
- // NULL. The following loop moves the trailing NULL element as
- // well.
- for (int j = i; j != *argc; j++) {
- argv[j] = argv[j + 1];
- }
-
- // Decrements the argument count.
- (*argc)--;
-
- // We also need to decrement the iterator as we just removed
- // an element.
- i--;
- } else if (arg_string == "--help" || arg_string == "-h" ||
- arg_string == "-?" || arg_string == "/?" ||
- HasGoogleTestFlagPrefix(arg)) {
- // Both help flag and unrecognized Google Test flags (excluding
- // internal ones) trigger help display.
- g_help_flag = true;
- }
- }
-
- if (g_help_flag) {
- // We print the help here instead of in RUN_ALL_TESTS(), as the
- // latter may not be called at all if the user is using Google
- // Test with another testing framework.
- PrintColorEncoded(kColorEncodedHelpMessage);
- }
-}
-
-// Parses the command line for Google Test flags, without initializing
-// other parts of Google Test.
-void ParseGoogleTestFlagsOnly(int* argc, char** argv) {
- ParseGoogleTestFlagsOnlyImpl(argc, argv);
-}
-void ParseGoogleTestFlagsOnly(int* argc, wchar_t** argv) {
- ParseGoogleTestFlagsOnlyImpl(argc, argv);
-}
-
-// The internal implementation of InitGoogleTest().
-//
-// The type parameter CharType can be instantiated to either char or
-// wchar_t.
-template <typename CharType>
-void InitGoogleTestImpl(int* argc, CharType** argv) {
- g_init_gtest_count++;
-
- // We don't want to run the initialization code twice.
- if (g_init_gtest_count != 1) return;
-
- if (*argc <= 0) return;
-
- internal::g_executable_path = internal::StreamableToString(argv[0]);
-
-#if GTEST_HAS_DEATH_TEST
-
- g_argvs.clear();
- for (int i = 0; i != *argc; i++) {
- g_argvs.push_back(StreamableToString(argv[i]));
- }
-
-#endif // GTEST_HAS_DEATH_TEST
-
- ParseGoogleTestFlagsOnly(argc, argv);
- GetUnitTestImpl()->PostFlagParsingInit();
-}
-
-} // namespace internal
-
-// Initializes Google Test. This must be called before calling
-// RUN_ALL_TESTS(). In particular, it parses a command line for the
-// flags that Google Test recognizes. Whenever a Google Test flag is
-// seen, it is removed from argv, and *argc is decremented.
-//
-// No value is returned. Instead, the Google Test flag variables are
-// updated.
-//
-// Calling the function for the second time has no user-visible effect.
-void InitGoogleTest(int* argc, char** argv) {
- internal::InitGoogleTestImpl(argc, argv);
-}
-
-// This overloaded version can be used in Windows programs compiled in
-// UNICODE mode.
-void InitGoogleTest(int* argc, wchar_t** argv) {
- internal::InitGoogleTestImpl(argc, argv);
-}
-
-} // namespace testing
diff --git a/src/testing/gtest/test/gtest-death-test_ex_test.cc b/src/testing/gtest/test/gtest-death-test_ex_test.cc
deleted file mode 100644
index b50a13d5..00000000
--- a/src/testing/gtest/test/gtest-death-test_ex_test.cc
+++ /dev/null
@@ -1,93 +0,0 @@
-// Copyright 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: vladl@google.com (Vlad Losev)
-//
-// Tests that verify interaction of exceptions and death tests.
-
-#include "gtest/gtest-death-test.h"
-#include "gtest/gtest.h"
-
-#if GTEST_HAS_DEATH_TEST
-
-# if GTEST_HAS_SEH
-# include <windows.h> // For RaiseException().
-# endif
-
-# include "gtest/gtest-spi.h"
-
-# if GTEST_HAS_EXCEPTIONS
-
-# include <exception> // For std::exception.
-
-// Tests that death tests report thrown exceptions as failures and that the
-// exceptions do not escape death test macros.
-TEST(CxxExceptionDeathTest, ExceptionIsFailure) {
- try {
- EXPECT_NONFATAL_FAILURE(EXPECT_DEATH(throw 1, ""), "threw an exception");
- } catch (...) { // NOLINT
- FAIL() << "An exception escaped a death test macro invocation "
- << "with catch_exceptions "
- << (testing::GTEST_FLAG(catch_exceptions) ? "enabled" : "disabled");
- }
-}
-
-class TestException : public std::exception {
- public:
- virtual const char* what() const throw() { return "exceptional message"; }
-};
-
-TEST(CxxExceptionDeathTest, PrintsMessageForStdExceptions) {
- // Verifies that the exception message is quoted in the failure text.
- EXPECT_NONFATAL_FAILURE(EXPECT_DEATH(throw TestException(), ""),
- "exceptional message");
- // Verifies that the location is mentioned in the failure text.
- EXPECT_NONFATAL_FAILURE(EXPECT_DEATH(throw TestException(), ""),
- "gtest-death-test_ex_test.cc");
-}
-# endif // GTEST_HAS_EXCEPTIONS
-
-# if GTEST_HAS_SEH
-// Tests that enabling interception of SEH exceptions with the
-// catch_exceptions flag does not interfere with SEH exceptions being
-// treated as death by death tests.
-TEST(SehExceptionDeasTest, CatchExceptionsDoesNotInterfere) {
- EXPECT_DEATH(RaiseException(42, 0x0, 0, NULL), "")
- << "with catch_exceptions "
- << (testing::GTEST_FLAG(catch_exceptions) ? "enabled" : "disabled");
-}
-# endif
-
-#endif // GTEST_HAS_DEATH_TEST
-
-int main(int argc, char** argv) {
- testing::InitGoogleTest(&argc, argv);
- testing::GTEST_FLAG(catch_exceptions) = GTEST_ENABLE_CATCH_EXCEPTIONS_ != 0;
- return RUN_ALL_TESTS();
-}
diff --git a/src/testing/gtest/test/gtest-death-test_test.cc b/src/testing/gtest/test/gtest-death-test_test.cc
deleted file mode 100644
index b389e73b..00000000
--- a/src/testing/gtest/test/gtest-death-test_test.cc
+++ /dev/null
@@ -1,1370 +0,0 @@
-// Copyright 2005, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-//
-// Tests for death tests.
-
-#include "gtest/gtest-death-test.h"
-#include "gtest/gtest.h"
-#include "gtest/internal/gtest-filepath.h"
-
-using testing::internal::AlwaysFalse;
-using testing::internal::AlwaysTrue;
-
-#if GTEST_HAS_DEATH_TEST
-
-# if GTEST_OS_WINDOWS
-# include <direct.h> // For chdir().
-# else
-# include <unistd.h>
-# include <sys/wait.h> // For waitpid.
-# include <limits> // For std::numeric_limits.
-# endif // GTEST_OS_WINDOWS
-
-# include <limits.h>
-# include <signal.h>
-# include <stdio.h>
-
-# if GTEST_OS_LINUX
-# include <sys/time.h>
-# endif // GTEST_OS_LINUX
-
-# include "gtest/gtest-spi.h"
-
-// Indicates that this translation unit is part of Google Test's
-// implementation. It must come before gtest-internal-inl.h is
-// included, or there will be a compiler error. This trick is to
-// prevent a user from accidentally including gtest-internal-inl.h in
-// his code.
-# define GTEST_IMPLEMENTATION_ 1
-# include "src/gtest-internal-inl.h"
-# undef GTEST_IMPLEMENTATION_
-
-namespace posix = ::testing::internal::posix;
-
-using testing::Message;
-using testing::internal::DeathTest;
-using testing::internal::DeathTestFactory;
-using testing::internal::FilePath;
-using testing::internal::GetLastErrnoDescription;
-using testing::internal::GetUnitTestImpl;
-using testing::internal::InDeathTestChild;
-using testing::internal::ParseNaturalNumber;
-using testing::internal::String;
-
-namespace testing {
-namespace internal {
-
-// A helper class whose objects replace the death test factory for a
-// single UnitTest object during their lifetimes.
-class ReplaceDeathTestFactory {
- public:
- explicit ReplaceDeathTestFactory(DeathTestFactory* new_factory)
- : unit_test_impl_(GetUnitTestImpl()) {
- old_factory_ = unit_test_impl_->death_test_factory_.release();
- unit_test_impl_->death_test_factory_.reset(new_factory);
- }
-
- ~ReplaceDeathTestFactory() {
- unit_test_impl_->death_test_factory_.release();
- unit_test_impl_->death_test_factory_.reset(old_factory_);
- }
- private:
- // Prevents copying ReplaceDeathTestFactory objects.
- ReplaceDeathTestFactory(const ReplaceDeathTestFactory&);
- void operator=(const ReplaceDeathTestFactory&);
-
- UnitTestImpl* unit_test_impl_;
- DeathTestFactory* old_factory_;
-};
-
-} // namespace internal
-} // namespace testing
-
-void DieWithMessage(const ::std::string& message) {
- fprintf(stderr, "%s", message.c_str());
- fflush(stderr); // Make sure the text is printed before the process exits.
-
- // We call _exit() instead of exit(), as the former is a direct
- // system call and thus safer in the presence of threads. exit()
- // will invoke user-defined exit-hooks, which may do dangerous
- // things that conflict with death tests.
- //
- // Some compilers can recognize that _exit() never returns and issue the
- // 'unreachable code' warning for code following this function, unless
- // fooled by a fake condition.
- if (AlwaysTrue())
- _exit(1);
-}
-
-void DieInside(const ::std::string& function) {
- DieWithMessage("death inside " + function + "().");
-}
-
-// Tests that death tests work.
-
-class TestForDeathTest : public testing::Test {
- protected:
- TestForDeathTest() : original_dir_(FilePath::GetCurrentDir()) {}
-
- virtual ~TestForDeathTest() {
- posix::ChDir(original_dir_.c_str());
- }
-
- // A static member function that's expected to die.
- static void StaticMemberFunction() { DieInside("StaticMemberFunction"); }
-
- // A method of the test fixture that may die.
- void MemberFunction() {
- if (should_die_)
- DieInside("MemberFunction");
- }
-
- // True iff MemberFunction() should die.
- bool should_die_;
- const FilePath original_dir_;
-};
-
-// A class with a member function that may die.
-class MayDie {
- public:
- explicit MayDie(bool should_die) : should_die_(should_die) {}
-
- // A member function that may die.
- void MemberFunction() const {
- if (should_die_)
- DieInside("MayDie::MemberFunction");
- }
-
- private:
- // True iff MemberFunction() should die.
- bool should_die_;
-};
-
-// A global function that's expected to die.
-void GlobalFunction() { DieInside("GlobalFunction"); }
-
-// A non-void function that's expected to die.
-int NonVoidFunction() {
- DieInside("NonVoidFunction");
- return 1;
-}
-
-// A unary function that may die.
-void DieIf(bool should_die) {
- if (should_die)
- DieInside("DieIf");
-}
-
-// A binary function that may die.
-bool DieIfLessThan(int x, int y) {
- if (x < y) {
- DieInside("DieIfLessThan");
- }
- return true;
-}
-
-// Tests that ASSERT_DEATH can be used outside a TEST, TEST_F, or test fixture.
-void DeathTestSubroutine() {
- EXPECT_DEATH(GlobalFunction(), "death.*GlobalFunction");
- ASSERT_DEATH(GlobalFunction(), "death.*GlobalFunction");
-}
-
-// Death in dbg, not opt.
-int DieInDebugElse12(int* sideeffect) {
- if (sideeffect) *sideeffect = 12;
-
-# ifndef NDEBUG
-
- DieInside("DieInDebugElse12");
-
-# endif // NDEBUG
-
- return 12;
-}
-
-# if GTEST_OS_WINDOWS
-
-// Tests the ExitedWithCode predicate.
-TEST(ExitStatusPredicateTest, ExitedWithCode) {
- // On Windows, the process's exit code is the same as its exit status,
- // so the predicate just compares the its input with its parameter.
- EXPECT_TRUE(testing::ExitedWithCode(0)(0));
- EXPECT_TRUE(testing::ExitedWithCode(1)(1));
- EXPECT_TRUE(testing::ExitedWithCode(42)(42));
- EXPECT_FALSE(testing::ExitedWithCode(0)(1));
- EXPECT_FALSE(testing::ExitedWithCode(1)(0));
-}
-
-# else
-
-// Returns the exit status of a process that calls _exit(2) with a
-// given exit code. This is a helper function for the
-// ExitStatusPredicateTest test suite.
-static int NormalExitStatus(int exit_code) {
- pid_t child_pid = fork();
- if (child_pid == 0) {
- _exit(exit_code);
- }
- int status;
- waitpid(child_pid, &status, 0);
- return status;
-}
-
-// Returns the exit status of a process that raises a given signal.
-// If the signal does not cause the process to die, then it returns
-// instead the exit status of a process that exits normally with exit
-// code 1. This is a helper function for the ExitStatusPredicateTest
-// test suite.
-static int KilledExitStatus(int signum) {
- pid_t child_pid = fork();
- if (child_pid == 0) {
- raise(signum);
- _exit(1);
- }
- int status;
- waitpid(child_pid, &status, 0);
- return status;
-}
-
-// Tests the ExitedWithCode predicate.
-TEST(ExitStatusPredicateTest, ExitedWithCode) {
- const int status0 = NormalExitStatus(0);
- const int status1 = NormalExitStatus(1);
- const int status42 = NormalExitStatus(42);
- const testing::ExitedWithCode pred0(0);
- const testing::ExitedWithCode pred1(1);
- const testing::ExitedWithCode pred42(42);
- EXPECT_PRED1(pred0, status0);
- EXPECT_PRED1(pred1, status1);
- EXPECT_PRED1(pred42, status42);
- EXPECT_FALSE(pred0(status1));
- EXPECT_FALSE(pred42(status0));
- EXPECT_FALSE(pred1(status42));
-}
-
-// Tests the KilledBySignal predicate.
-TEST(ExitStatusPredicateTest, KilledBySignal) {
- const int status_segv = KilledExitStatus(SIGSEGV);
- const int status_kill = KilledExitStatus(SIGKILL);
- const testing::KilledBySignal pred_segv(SIGSEGV);
- const testing::KilledBySignal pred_kill(SIGKILL);
- EXPECT_PRED1(pred_segv, status_segv);
- EXPECT_PRED1(pred_kill, status_kill);
- EXPECT_FALSE(pred_segv(status_kill));
- EXPECT_FALSE(pred_kill(status_segv));
-}
-
-# endif // GTEST_OS_WINDOWS
-
-// Tests that the death test macros expand to code which may or may not
-// be followed by operator<<, and that in either case the complete text
-// comprises only a single C++ statement.
-TEST_F(TestForDeathTest, SingleStatement) {
- if (AlwaysFalse())
- // This would fail if executed; this is a compilation test only
- ASSERT_DEATH(return, "");
-
- if (AlwaysTrue())
- EXPECT_DEATH(_exit(1), "");
- else
- // This empty "else" branch is meant to ensure that EXPECT_DEATH
- // doesn't expand into an "if" statement without an "else"
- ;
-
- if (AlwaysFalse())
- ASSERT_DEATH(return, "") << "did not die";
-
- if (AlwaysFalse())
- ;
- else
- EXPECT_DEATH(_exit(1), "") << 1 << 2 << 3;
-}
-
-void DieWithEmbeddedNul() {
- fprintf(stderr, "Hello%cmy null world.\n", '\0');
- fflush(stderr);
- _exit(1);
-}
-
-# if GTEST_USES_PCRE
-// Tests that EXPECT_DEATH and ASSERT_DEATH work when the error
-// message has a NUL character in it.
-TEST_F(TestForDeathTest, EmbeddedNulInMessage) {
- // TODO(wan@google.com): <regex.h> doesn't support matching strings
- // with embedded NUL characters - find a way to workaround it.
- EXPECT_DEATH(DieWithEmbeddedNul(), "my null world");
- ASSERT_DEATH(DieWithEmbeddedNul(), "my null world");
-}
-# endif // GTEST_USES_PCRE
-
-// Tests that death test macros expand to code which interacts well with switch
-// statements.
-TEST_F(TestForDeathTest, SwitchStatement) {
-// Microsoft compiler usually complains about switch statements without
-// case labels. We suppress that warning for this test.
-# ifdef _MSC_VER
-# pragma warning(push)
-# pragma warning(disable: 4065)
-# endif // _MSC_VER
-
- switch (0)
- default:
- ASSERT_DEATH(_exit(1), "") << "exit in default switch handler";
-
- switch (0)
- case 0:
- EXPECT_DEATH(_exit(1), "") << "exit in switch case";
-
-# ifdef _MSC_VER
-# pragma warning(pop)
-# endif // _MSC_VER
-}
-
-// Tests that a static member function can be used in a "fast" style
-// death test.
-TEST_F(TestForDeathTest, StaticMemberFunctionFastStyle) {
- testing::GTEST_FLAG(death_test_style) = "fast";
- ASSERT_DEATH(StaticMemberFunction(), "death.*StaticMember");
-}
-
-// Tests that a method of the test fixture can be used in a "fast"
-// style death test.
-TEST_F(TestForDeathTest, MemberFunctionFastStyle) {
- testing::GTEST_FLAG(death_test_style) = "fast";
- should_die_ = true;
- EXPECT_DEATH(MemberFunction(), "inside.*MemberFunction");
-}
-
-void ChangeToRootDir() { posix::ChDir(GTEST_PATH_SEP_); }
-
-// Tests that death tests work even if the current directory has been
-// changed.
-TEST_F(TestForDeathTest, FastDeathTestInChangedDir) {
- testing::GTEST_FLAG(death_test_style) = "fast";
-
- ChangeToRootDir();
- EXPECT_EXIT(_exit(1), testing::ExitedWithCode(1), "");
-
- ChangeToRootDir();
- ASSERT_DEATH(_exit(1), "");
-}
-
-# if GTEST_OS_LINUX
-void SigprofAction(int, siginfo_t*, void*) { /* no op */ }
-
-// Sets SIGPROF action and ITIMER_PROF timer (interval: 1ms).
-void SetSigprofActionAndTimer() {
- struct itimerval timer;
- timer.it_interval.tv_sec = 0;
- timer.it_interval.tv_usec = 1;
- timer.it_value = timer.it_interval;
- ASSERT_EQ(0, setitimer(ITIMER_PROF, &timer, NULL));
- struct sigaction signal_action;
- memset(&signal_action, 0, sizeof(signal_action));
- sigemptyset(&signal_action.sa_mask);
- signal_action.sa_sigaction = SigprofAction;
- signal_action.sa_flags = SA_RESTART | SA_SIGINFO;
- ASSERT_EQ(0, sigaction(SIGPROF, &signal_action, NULL));
-}
-
-// Disables ITIMER_PROF timer and ignores SIGPROF signal.
-void DisableSigprofActionAndTimer(struct sigaction* old_signal_action) {
- struct itimerval timer;
- timer.it_interval.tv_sec = 0;
- timer.it_interval.tv_usec = 0;
- timer.it_value = timer.it_interval;
- ASSERT_EQ(0, setitimer(ITIMER_PROF, &timer, NULL));
- struct sigaction signal_action;
- memset(&signal_action, 0, sizeof(signal_action));
- sigemptyset(&signal_action.sa_mask);
- signal_action.sa_handler = SIG_IGN;
- ASSERT_EQ(0, sigaction(SIGPROF, &signal_action, old_signal_action));
-}
-
-// Tests that death tests work when SIGPROF handler and timer are set.
-TEST_F(TestForDeathTest, FastSigprofActionSet) {
- testing::GTEST_FLAG(death_test_style) = "fast";
- SetSigprofActionAndTimer();
- EXPECT_DEATH(_exit(1), "");
- struct sigaction old_signal_action;
- DisableSigprofActionAndTimer(&old_signal_action);
- EXPECT_TRUE(old_signal_action.sa_sigaction == SigprofAction);
-}
-
-TEST_F(TestForDeathTest, ThreadSafeSigprofActionSet) {
- testing::GTEST_FLAG(death_test_style) = "threadsafe";
- SetSigprofActionAndTimer();
- EXPECT_DEATH(_exit(1), "");
- struct sigaction old_signal_action;
- DisableSigprofActionAndTimer(&old_signal_action);
- EXPECT_TRUE(old_signal_action.sa_sigaction == SigprofAction);
-}
-# endif // GTEST_OS_LINUX
-
-// Repeats a representative sample of death tests in the "threadsafe" style:
-
-TEST_F(TestForDeathTest, StaticMemberFunctionThreadsafeStyle) {
- testing::GTEST_FLAG(death_test_style) = "threadsafe";
- ASSERT_DEATH(StaticMemberFunction(), "death.*StaticMember");
-}
-
-TEST_F(TestForDeathTest, MemberFunctionThreadsafeStyle) {
- testing::GTEST_FLAG(death_test_style) = "threadsafe";
- should_die_ = true;
- EXPECT_DEATH(MemberFunction(), "inside.*MemberFunction");
-}
-
-TEST_F(TestForDeathTest, ThreadsafeDeathTestInLoop) {
- testing::GTEST_FLAG(death_test_style) = "threadsafe";
-
- for (int i = 0; i < 3; ++i)
- EXPECT_EXIT(_exit(i), testing::ExitedWithCode(i), "") << ": i = " << i;
-}
-
-TEST_F(TestForDeathTest, ThreadsafeDeathTestInChangedDir) {
- testing::GTEST_FLAG(death_test_style) = "threadsafe";
-
- ChangeToRootDir();
- EXPECT_EXIT(_exit(1), testing::ExitedWithCode(1), "");
-
- ChangeToRootDir();
- ASSERT_DEATH(_exit(1), "");
-}
-
-TEST_F(TestForDeathTest, MixedStyles) {
- testing::GTEST_FLAG(death_test_style) = "threadsafe";
- EXPECT_DEATH(_exit(1), "");
- testing::GTEST_FLAG(death_test_style) = "fast";
- EXPECT_DEATH(_exit(1), "");
-}
-
-namespace {
-
-bool pthread_flag;
-
-void SetPthreadFlag() {
- pthread_flag = true;
-}
-
-} // namespace
-
-# if GTEST_HAS_CLONE && GTEST_HAS_PTHREAD
-
-TEST_F(TestForDeathTest, DoesNotExecuteAtforkHooks) {
- if (!testing::GTEST_FLAG(death_test_use_fork)) {
- testing::GTEST_FLAG(death_test_style) = "threadsafe";
- pthread_flag = false;
- ASSERT_EQ(0, pthread_atfork(&SetPthreadFlag, NULL, NULL));
- ASSERT_DEATH(_exit(1), "");
- ASSERT_FALSE(pthread_flag);
- }
-}
-
-# endif // GTEST_HAS_CLONE && GTEST_HAS_PTHREAD
-
-// Tests that a method of another class can be used in a death test.
-TEST_F(TestForDeathTest, MethodOfAnotherClass) {
- const MayDie x(true);
- ASSERT_DEATH(x.MemberFunction(), "MayDie\\:\\:MemberFunction");
-}
-
-// Tests that a global function can be used in a death test.
-TEST_F(TestForDeathTest, GlobalFunction) {
- EXPECT_DEATH(GlobalFunction(), "GlobalFunction");
-}
-
-// Tests that any value convertible to an RE works as a second
-// argument to EXPECT_DEATH.
-TEST_F(TestForDeathTest, AcceptsAnythingConvertibleToRE) {
- static const char regex_c_str[] = "GlobalFunction";
- EXPECT_DEATH(GlobalFunction(), regex_c_str);
-
- const testing::internal::RE regex(regex_c_str);
- EXPECT_DEATH(GlobalFunction(), regex);
-
-# if GTEST_HAS_GLOBAL_STRING
-
- const string regex_str(regex_c_str);
- EXPECT_DEATH(GlobalFunction(), regex_str);
-
-# endif // GTEST_HAS_GLOBAL_STRING
-
- const ::std::string regex_std_str(regex_c_str);
- EXPECT_DEATH(GlobalFunction(), regex_std_str);
-}
-
-// Tests that a non-void function can be used in a death test.
-TEST_F(TestForDeathTest, NonVoidFunction) {
- ASSERT_DEATH(NonVoidFunction(), "NonVoidFunction");
-}
-
-// Tests that functions that take parameter(s) can be used in a death test.
-TEST_F(TestForDeathTest, FunctionWithParameter) {
- EXPECT_DEATH(DieIf(true), "DieIf\\(\\)");
- EXPECT_DEATH(DieIfLessThan(2, 3), "DieIfLessThan");
-}
-
-// Tests that ASSERT_DEATH can be used outside a TEST, TEST_F, or test fixture.
-TEST_F(TestForDeathTest, OutsideFixture) {
- DeathTestSubroutine();
-}
-
-// Tests that death tests can be done inside a loop.
-TEST_F(TestForDeathTest, InsideLoop) {
- for (int i = 0; i < 5; i++) {
- EXPECT_DEATH(DieIfLessThan(-1, i), "DieIfLessThan") << "where i == " << i;
- }
-}
-
-// Tests that a compound statement can be used in a death test.
-TEST_F(TestForDeathTest, CompoundStatement) {
- EXPECT_DEATH({ // NOLINT
- const int x = 2;
- const int y = x + 1;
- DieIfLessThan(x, y);
- },
- "DieIfLessThan");
-}
-
-// Tests that code that doesn't die causes a death test to fail.
-TEST_F(TestForDeathTest, DoesNotDie) {
- EXPECT_NONFATAL_FAILURE(EXPECT_DEATH(DieIf(false), "DieIf"),
- "failed to die");
-}
-
-// Tests that a death test fails when the error message isn't expected.
-TEST_F(TestForDeathTest, ErrorMessageMismatch) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_DEATH(DieIf(true), "DieIfLessThan") << "End of death test message.";
- }, "died but not with expected error");
-}
-
-// On exit, *aborted will be true iff the EXPECT_DEATH() statement
-// aborted the function.
-void ExpectDeathTestHelper(bool* aborted) {
- *aborted = true;
- EXPECT_DEATH(DieIf(false), "DieIf"); // This assertion should fail.
- *aborted = false;
-}
-
-// Tests that EXPECT_DEATH doesn't abort the test on failure.
-TEST_F(TestForDeathTest, EXPECT_DEATH) {
- bool aborted = true;
- EXPECT_NONFATAL_FAILURE(ExpectDeathTestHelper(&aborted),
- "failed to die");
- EXPECT_FALSE(aborted);
-}
-
-// Tests that ASSERT_DEATH does abort the test on failure.
-TEST_F(TestForDeathTest, ASSERT_DEATH) {
- static bool aborted;
- EXPECT_FATAL_FAILURE({ // NOLINT
- aborted = true;
- ASSERT_DEATH(DieIf(false), "DieIf"); // This assertion should fail.
- aborted = false;
- }, "failed to die");
- EXPECT_TRUE(aborted);
-}
-
-// Tests that EXPECT_DEATH evaluates the arguments exactly once.
-TEST_F(TestForDeathTest, SingleEvaluation) {
- int x = 3;
- EXPECT_DEATH(DieIf((++x) == 4), "DieIf");
-
- const char* regex = "DieIf";
- const char* regex_save = regex;
- EXPECT_DEATH(DieIfLessThan(3, 4), regex++);
- EXPECT_EQ(regex_save + 1, regex);
-}
-
-// Tests that run-away death tests are reported as failures.
-TEST_F(TestForDeathTest, RunawayIsFailure) {
- EXPECT_NONFATAL_FAILURE(EXPECT_DEATH(static_cast<void>(0), "Foo"),
- "failed to die.");
-}
-
-// Tests that death tests report executing 'return' in the statement as
-// failure.
-TEST_F(TestForDeathTest, ReturnIsFailure) {
- EXPECT_FATAL_FAILURE(ASSERT_DEATH(return, "Bar"),
- "illegal return in test statement.");
-}
-
-// Tests that EXPECT_DEBUG_DEATH works as expected, that is, you can stream a
-// message to it, and in debug mode it:
-// 1. Asserts on death.
-// 2. Has no side effect.
-//
-// And in opt mode, it:
-// 1. Has side effects but does not assert.
-TEST_F(TestForDeathTest, TestExpectDebugDeath) {
- int sideeffect = 0;
-
- EXPECT_DEBUG_DEATH(DieInDebugElse12(&sideeffect), "death.*DieInDebugElse12")
- << "Must accept a streamed message";
-
-# ifdef NDEBUG
-
- // Checks that the assignment occurs in opt mode (sideeffect).
- EXPECT_EQ(12, sideeffect);
-
-# else
-
- // Checks that the assignment does not occur in dbg mode (no sideeffect).
- EXPECT_EQ(0, sideeffect);
-
-# endif
-}
-
-// Tests that ASSERT_DEBUG_DEATH works as expected, that is, you can stream a
-// message to it, and in debug mode it:
-// 1. Asserts on death.
-// 2. Has no side effect.
-//
-// And in opt mode, it:
-// 1. Has side effects but does not assert.
-TEST_F(TestForDeathTest, TestAssertDebugDeath) {
- int sideeffect = 0;
-
- ASSERT_DEBUG_DEATH(DieInDebugElse12(&sideeffect), "death.*DieInDebugElse12")
- << "Must accept a streamed message";
-
-# ifdef NDEBUG
-
- // Checks that the assignment occurs in opt mode (sideeffect).
- EXPECT_EQ(12, sideeffect);
-
-# else
-
- // Checks that the assignment does not occur in dbg mode (no sideeffect).
- EXPECT_EQ(0, sideeffect);
-
-# endif
-}
-
-# ifndef NDEBUG
-
-void ExpectDebugDeathHelper(bool* aborted) {
- *aborted = true;
- EXPECT_DEBUG_DEATH(return, "") << "This is expected to fail.";
- *aborted = false;
-}
-
-# if GTEST_OS_WINDOWS
-TEST(PopUpDeathTest, DoesNotShowPopUpOnAbort) {
- printf("This test should be considered failing if it shows "
- "any pop-up dialogs.\n");
- fflush(stdout);
-
- EXPECT_DEATH({
- testing::GTEST_FLAG(catch_exceptions) = false;
- abort();
- }, "");
-}
-# endif // GTEST_OS_WINDOWS
-
-// Tests that EXPECT_DEBUG_DEATH in debug mode does not abort
-// the function.
-TEST_F(TestForDeathTest, ExpectDebugDeathDoesNotAbort) {
- bool aborted = true;
- EXPECT_NONFATAL_FAILURE(ExpectDebugDeathHelper(&aborted), "");
- EXPECT_FALSE(aborted);
-}
-
-void AssertDebugDeathHelper(bool* aborted) {
- *aborted = true;
- ASSERT_DEBUG_DEATH(return, "") << "This is expected to fail.";
- *aborted = false;
-}
-
-// Tests that ASSERT_DEBUG_DEATH in debug mode aborts the function on
-// failure.
-TEST_F(TestForDeathTest, AssertDebugDeathAborts) {
- static bool aborted;
- aborted = false;
- EXPECT_FATAL_FAILURE(AssertDebugDeathHelper(&aborted), "");
- EXPECT_TRUE(aborted);
-}
-
-# endif // _NDEBUG
-
-// Tests the *_EXIT family of macros, using a variety of predicates.
-static void TestExitMacros() {
- EXPECT_EXIT(_exit(1), testing::ExitedWithCode(1), "");
- ASSERT_EXIT(_exit(42), testing::ExitedWithCode(42), "");
-
-# if GTEST_OS_WINDOWS
-
- // Of all signals effects on the process exit code, only those of SIGABRT
- // are documented on Windows.
- // See http://msdn.microsoft.com/en-us/library/dwwzkt4c(VS.71).aspx.
- EXPECT_EXIT(raise(SIGABRT), testing::ExitedWithCode(3), "") << "b_ar";
-
-# else
-
- EXPECT_EXIT(raise(SIGKILL), testing::KilledBySignal(SIGKILL), "") << "foo";
- ASSERT_EXIT(raise(SIGUSR2), testing::KilledBySignal(SIGUSR2), "") << "bar";
-
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_EXIT(_exit(0), testing::KilledBySignal(SIGSEGV), "")
- << "This failure is expected, too.";
- }, "This failure is expected, too.");
-
-# endif // GTEST_OS_WINDOWS
-
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_EXIT(raise(SIGSEGV), testing::ExitedWithCode(0), "")
- << "This failure is expected.";
- }, "This failure is expected.");
-}
-
-TEST_F(TestForDeathTest, ExitMacros) {
- TestExitMacros();
-}
-
-TEST_F(TestForDeathTest, ExitMacrosUsingFork) {
- testing::GTEST_FLAG(death_test_use_fork) = true;
- TestExitMacros();
-}
-
-TEST_F(TestForDeathTest, InvalidStyle) {
- testing::GTEST_FLAG(death_test_style) = "rococo";
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_DEATH(_exit(0), "") << "This failure is expected.";
- }, "This failure is expected.");
-}
-
-TEST_F(TestForDeathTest, DeathTestFailedOutput) {
- testing::GTEST_FLAG(death_test_style) = "fast";
- EXPECT_NONFATAL_FAILURE(
- EXPECT_DEATH(DieWithMessage("death\n"),
- "expected message"),
- "Actual msg:\n"
- "[ DEATH ] death\n");
-}
-
-TEST_F(TestForDeathTest, DeathTestUnexpectedReturnOutput) {
- testing::GTEST_FLAG(death_test_style) = "fast";
- EXPECT_NONFATAL_FAILURE(
- EXPECT_DEATH({
- fprintf(stderr, "returning\n");
- fflush(stderr);
- return;
- }, ""),
- " Result: illegal return in test statement.\n"
- " Error msg:\n"
- "[ DEATH ] returning\n");
-}
-
-TEST_F(TestForDeathTest, DeathTestBadExitCodeOutput) {
- testing::GTEST_FLAG(death_test_style) = "fast";
- EXPECT_NONFATAL_FAILURE(
- EXPECT_EXIT(DieWithMessage("exiting with rc 1\n"),
- testing::ExitedWithCode(3),
- "expected message"),
- " Result: died but not with expected exit code:\n"
- " Exited with exit status 1\n"
- "Actual msg:\n"
- "[ DEATH ] exiting with rc 1\n");
-}
-
-TEST_F(TestForDeathTest, DeathTestMultiLineMatchFail) {
- testing::GTEST_FLAG(death_test_style) = "fast";
- EXPECT_NONFATAL_FAILURE(
- EXPECT_DEATH(DieWithMessage("line 1\nline 2\nline 3\n"),
- "line 1\nxyz\nline 3\n"),
- "Actual msg:\n"
- "[ DEATH ] line 1\n"
- "[ DEATH ] line 2\n"
- "[ DEATH ] line 3\n");
-}
-
-TEST_F(TestForDeathTest, DeathTestMultiLineMatchPass) {
- testing::GTEST_FLAG(death_test_style) = "fast";
- EXPECT_DEATH(DieWithMessage("line 1\nline 2\nline 3\n"),
- "line 1\nline 2\nline 3\n");
-}
-
-// A DeathTestFactory that returns MockDeathTests.
-class MockDeathTestFactory : public DeathTestFactory {
- public:
- MockDeathTestFactory();
- virtual bool Create(const char* statement,
- const ::testing::internal::RE* regex,
- const char* file, int line, DeathTest** test);
-
- // Sets the parameters for subsequent calls to Create.
- void SetParameters(bool create, DeathTest::TestRole role,
- int status, bool passed);
-
- // Accessors.
- int AssumeRoleCalls() const { return assume_role_calls_; }
- int WaitCalls() const { return wait_calls_; }
- int PassedCalls() const { return passed_args_.size(); }
- bool PassedArgument(int n) const { return passed_args_[n]; }
- int AbortCalls() const { return abort_args_.size(); }
- DeathTest::AbortReason AbortArgument(int n) const {
- return abort_args_[n];
- }
- bool TestDeleted() const { return test_deleted_; }
-
- private:
- friend class MockDeathTest;
- // If true, Create will return a MockDeathTest; otherwise it returns
- // NULL.
- bool create_;
- // The value a MockDeathTest will return from its AssumeRole method.
- DeathTest::TestRole role_;
- // The value a MockDeathTest will return from its Wait method.
- int status_;
- // The value a MockDeathTest will return from its Passed method.
- bool passed_;
-
- // Number of times AssumeRole was called.
- int assume_role_calls_;
- // Number of times Wait was called.
- int wait_calls_;
- // The arguments to the calls to Passed since the last call to
- // SetParameters.
- std::vector<bool> passed_args_;
- // The arguments to the calls to Abort since the last call to
- // SetParameters.
- std::vector<DeathTest::AbortReason> abort_args_;
- // True if the last MockDeathTest returned by Create has been
- // deleted.
- bool test_deleted_;
-};
-
-
-// A DeathTest implementation useful in testing. It returns values set
-// at its creation from its various inherited DeathTest methods, and
-// reports calls to those methods to its parent MockDeathTestFactory
-// object.
-class MockDeathTest : public DeathTest {
- public:
- MockDeathTest(MockDeathTestFactory *parent,
- TestRole role, int status, bool passed) :
- parent_(parent), role_(role), status_(status), passed_(passed) {
- }
- virtual ~MockDeathTest() {
- parent_->test_deleted_ = true;
- }
- virtual TestRole AssumeRole() {
- ++parent_->assume_role_calls_;
- return role_;
- }
- virtual int Wait() {
- ++parent_->wait_calls_;
- return status_;
- }
- virtual bool Passed(bool exit_status_ok) {
- parent_->passed_args_.push_back(exit_status_ok);
- return passed_;
- }
- virtual void Abort(AbortReason reason) {
- parent_->abort_args_.push_back(reason);
- }
-
- private:
- MockDeathTestFactory* const parent_;
- const TestRole role_;
- const int status_;
- const bool passed_;
-};
-
-
-// MockDeathTestFactory constructor.
-MockDeathTestFactory::MockDeathTestFactory()
- : create_(true),
- role_(DeathTest::OVERSEE_TEST),
- status_(0),
- passed_(true),
- assume_role_calls_(0),
- wait_calls_(0),
- passed_args_(),
- abort_args_() {
-}
-
-
-// Sets the parameters for subsequent calls to Create.
-void MockDeathTestFactory::SetParameters(bool create,
- DeathTest::TestRole role,
- int status, bool passed) {
- create_ = create;
- role_ = role;
- status_ = status;
- passed_ = passed;
-
- assume_role_calls_ = 0;
- wait_calls_ = 0;
- passed_args_.clear();
- abort_args_.clear();
-}
-
-
-// Sets test to NULL (if create_ is false) or to the address of a new
-// MockDeathTest object with parameters taken from the last call
-// to SetParameters (if create_ is true). Always returns true.
-bool MockDeathTestFactory::Create(const char* /*statement*/,
- const ::testing::internal::RE* /*regex*/,
- const char* /*file*/,
- int /*line*/,
- DeathTest** test) {
- test_deleted_ = false;
- if (create_) {
- *test = new MockDeathTest(this, role_, status_, passed_);
- } else {
- *test = NULL;
- }
- return true;
-}
-
-// A test fixture for testing the logic of the GTEST_DEATH_TEST_ macro.
-// It installs a MockDeathTestFactory that is used for the duration
-// of the test case.
-class MacroLogicDeathTest : public testing::Test {
- protected:
- static testing::internal::ReplaceDeathTestFactory* replacer_;
- static MockDeathTestFactory* factory_;
-
- static void SetUpTestCase() {
- factory_ = new MockDeathTestFactory;
- replacer_ = new testing::internal::ReplaceDeathTestFactory(factory_);
- }
-
- static void TearDownTestCase() {
- delete replacer_;
- replacer_ = NULL;
- delete factory_;
- factory_ = NULL;
- }
-
- // Runs a death test that breaks the rules by returning. Such a death
- // test cannot be run directly from a test routine that uses a
- // MockDeathTest, or the remainder of the routine will not be executed.
- static void RunReturningDeathTest(bool* flag) {
- ASSERT_DEATH({ // NOLINT
- *flag = true;
- return;
- }, "");
- }
-};
-
-testing::internal::ReplaceDeathTestFactory* MacroLogicDeathTest::replacer_
- = NULL;
-MockDeathTestFactory* MacroLogicDeathTest::factory_ = NULL;
-
-
-// Test that nothing happens when the factory doesn't return a DeathTest:
-TEST_F(MacroLogicDeathTest, NothingHappens) {
- bool flag = false;
- factory_->SetParameters(false, DeathTest::OVERSEE_TEST, 0, true);
- EXPECT_DEATH(flag = true, "");
- EXPECT_FALSE(flag);
- EXPECT_EQ(0, factory_->AssumeRoleCalls());
- EXPECT_EQ(0, factory_->WaitCalls());
- EXPECT_EQ(0, factory_->PassedCalls());
- EXPECT_EQ(0, factory_->AbortCalls());
- EXPECT_FALSE(factory_->TestDeleted());
-}
-
-// Test that the parent process doesn't run the death test code,
-// and that the Passed method returns false when the (simulated)
-// child process exits with status 0:
-TEST_F(MacroLogicDeathTest, ChildExitsSuccessfully) {
- bool flag = false;
- factory_->SetParameters(true, DeathTest::OVERSEE_TEST, 0, true);
- EXPECT_DEATH(flag = true, "");
- EXPECT_FALSE(flag);
- EXPECT_EQ(1, factory_->AssumeRoleCalls());
- EXPECT_EQ(1, factory_->WaitCalls());
- ASSERT_EQ(1, factory_->PassedCalls());
- EXPECT_FALSE(factory_->PassedArgument(0));
- EXPECT_EQ(0, factory_->AbortCalls());
- EXPECT_TRUE(factory_->TestDeleted());
-}
-
-// Tests that the Passed method was given the argument "true" when
-// the (simulated) child process exits with status 1:
-TEST_F(MacroLogicDeathTest, ChildExitsUnsuccessfully) {
- bool flag = false;
- factory_->SetParameters(true, DeathTest::OVERSEE_TEST, 1, true);
- EXPECT_DEATH(flag = true, "");
- EXPECT_FALSE(flag);
- EXPECT_EQ(1, factory_->AssumeRoleCalls());
- EXPECT_EQ(1, factory_->WaitCalls());
- ASSERT_EQ(1, factory_->PassedCalls());
- EXPECT_TRUE(factory_->PassedArgument(0));
- EXPECT_EQ(0, factory_->AbortCalls());
- EXPECT_TRUE(factory_->TestDeleted());
-}
-
-// Tests that the (simulated) child process executes the death test
-// code, and is aborted with the correct AbortReason if it
-// executes a return statement.
-TEST_F(MacroLogicDeathTest, ChildPerformsReturn) {
- bool flag = false;
- factory_->SetParameters(true, DeathTest::EXECUTE_TEST, 0, true);
- RunReturningDeathTest(&flag);
- EXPECT_TRUE(flag);
- EXPECT_EQ(1, factory_->AssumeRoleCalls());
- EXPECT_EQ(0, factory_->WaitCalls());
- EXPECT_EQ(0, factory_->PassedCalls());
- EXPECT_EQ(1, factory_->AbortCalls());
- EXPECT_EQ(DeathTest::TEST_ENCOUNTERED_RETURN_STATEMENT,
- factory_->AbortArgument(0));
- EXPECT_TRUE(factory_->TestDeleted());
-}
-
-// Tests that the (simulated) child process is aborted with the
-// correct AbortReason if it does not die.
-TEST_F(MacroLogicDeathTest, ChildDoesNotDie) {
- bool flag = false;
- factory_->SetParameters(true, DeathTest::EXECUTE_TEST, 0, true);
- EXPECT_DEATH(flag = true, "");
- EXPECT_TRUE(flag);
- EXPECT_EQ(1, factory_->AssumeRoleCalls());
- EXPECT_EQ(0, factory_->WaitCalls());
- EXPECT_EQ(0, factory_->PassedCalls());
- // This time there are two calls to Abort: one since the test didn't
- // die, and another from the ReturnSentinel when it's destroyed. The
- // sentinel normally isn't destroyed if a test doesn't die, since
- // _exit(2) is called in that case by ForkingDeathTest, but not by
- // our MockDeathTest.
- ASSERT_EQ(2, factory_->AbortCalls());
- EXPECT_EQ(DeathTest::TEST_DID_NOT_DIE,
- factory_->AbortArgument(0));
- EXPECT_EQ(DeathTest::TEST_ENCOUNTERED_RETURN_STATEMENT,
- factory_->AbortArgument(1));
- EXPECT_TRUE(factory_->TestDeleted());
-}
-
-// Tests that a successful death test does not register a successful
-// test part.
-TEST(SuccessRegistrationDeathTest, NoSuccessPart) {
- EXPECT_DEATH(_exit(1), "");
- EXPECT_EQ(0, GetUnitTestImpl()->current_test_result()->total_part_count());
-}
-
-TEST(StreamingAssertionsDeathTest, DeathTest) {
- EXPECT_DEATH(_exit(1), "") << "unexpected failure";
- ASSERT_DEATH(_exit(1), "") << "unexpected failure";
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_DEATH(_exit(0), "") << "expected failure";
- }, "expected failure");
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_DEATH(_exit(0), "") << "expected failure";
- }, "expected failure");
-}
-
-// Tests that GetLastErrnoDescription returns an empty string when the
-// last error is 0 and non-empty string when it is non-zero.
-TEST(GetLastErrnoDescription, GetLastErrnoDescriptionWorks) {
- errno = ENOENT;
- EXPECT_STRNE("", GetLastErrnoDescription().c_str());
- errno = 0;
- EXPECT_STREQ("", GetLastErrnoDescription().c_str());
-}
-
-# if GTEST_OS_WINDOWS
-TEST(AutoHandleTest, AutoHandleWorks) {
- HANDLE handle = ::CreateEvent(NULL, FALSE, FALSE, NULL);
- ASSERT_NE(INVALID_HANDLE_VALUE, handle);
-
- // Tests that the AutoHandle is correctly initialized with a handle.
- testing::internal::AutoHandle auto_handle(handle);
- EXPECT_EQ(handle, auto_handle.Get());
-
- // Tests that Reset assigns INVALID_HANDLE_VALUE.
- // Note that this cannot verify whether the original handle is closed.
- auto_handle.Reset();
- EXPECT_EQ(INVALID_HANDLE_VALUE, auto_handle.Get());
-
- // Tests that Reset assigns the new handle.
- // Note that this cannot verify whether the original handle is closed.
- handle = ::CreateEvent(NULL, FALSE, FALSE, NULL);
- ASSERT_NE(INVALID_HANDLE_VALUE, handle);
- auto_handle.Reset(handle);
- EXPECT_EQ(handle, auto_handle.Get());
-
- // Tests that AutoHandle contains INVALID_HANDLE_VALUE by default.
- testing::internal::AutoHandle auto_handle2;
- EXPECT_EQ(INVALID_HANDLE_VALUE, auto_handle2.Get());
-}
-# endif // GTEST_OS_WINDOWS
-
-# if GTEST_OS_WINDOWS
-typedef unsigned __int64 BiggestParsable;
-typedef signed __int64 BiggestSignedParsable;
-const BiggestParsable kBiggestParsableMax = ULLONG_MAX;
-const BiggestSignedParsable kBiggestSignedParsableMax = LLONG_MAX;
-# else
-typedef unsigned long long BiggestParsable;
-typedef signed long long BiggestSignedParsable;
-const BiggestParsable kBiggestParsableMax =
- ::std::numeric_limits<BiggestParsable>::max();
-const BiggestSignedParsable kBiggestSignedParsableMax =
- ::std::numeric_limits<BiggestSignedParsable>::max();
-# endif // GTEST_OS_WINDOWS
-
-TEST(ParseNaturalNumberTest, RejectsInvalidFormat) {
- BiggestParsable result = 0;
-
- // Rejects non-numbers.
- EXPECT_FALSE(ParseNaturalNumber(String("non-number string"), &result));
-
- // Rejects numbers with whitespace prefix.
- EXPECT_FALSE(ParseNaturalNumber(String(" 123"), &result));
-
- // Rejects negative numbers.
- EXPECT_FALSE(ParseNaturalNumber(String("-123"), &result));
-
- // Rejects numbers starting with a plus sign.
- EXPECT_FALSE(ParseNaturalNumber(String("+123"), &result));
- errno = 0;
-}
-
-TEST(ParseNaturalNumberTest, RejectsOverflownNumbers) {
- BiggestParsable result = 0;
-
- EXPECT_FALSE(ParseNaturalNumber(String("99999999999999999999999"), &result));
-
- signed char char_result = 0;
- EXPECT_FALSE(ParseNaturalNumber(String("200"), &char_result));
- errno = 0;
-}
-
-TEST(ParseNaturalNumberTest, AcceptsValidNumbers) {
- BiggestParsable result = 0;
-
- result = 0;
- ASSERT_TRUE(ParseNaturalNumber(String("123"), &result));
- EXPECT_EQ(123U, result);
-
- // Check 0 as an edge case.
- result = 1;
- ASSERT_TRUE(ParseNaturalNumber(String("0"), &result));
- EXPECT_EQ(0U, result);
-
- result = 1;
- ASSERT_TRUE(ParseNaturalNumber(String("00000"), &result));
- EXPECT_EQ(0U, result);
-}
-
-TEST(ParseNaturalNumberTest, AcceptsTypeLimits) {
- Message msg;
- msg << kBiggestParsableMax;
-
- BiggestParsable result = 0;
- EXPECT_TRUE(ParseNaturalNumber(msg.GetString(), &result));
- EXPECT_EQ(kBiggestParsableMax, result);
-
- Message msg2;
- msg2 << kBiggestSignedParsableMax;
-
- BiggestSignedParsable signed_result = 0;
- EXPECT_TRUE(ParseNaturalNumber(msg2.GetString(), &signed_result));
- EXPECT_EQ(kBiggestSignedParsableMax, signed_result);
-
- Message msg3;
- msg3 << INT_MAX;
-
- int int_result = 0;
- EXPECT_TRUE(ParseNaturalNumber(msg3.GetString(), &int_result));
- EXPECT_EQ(INT_MAX, int_result);
-
- Message msg4;
- msg4 << UINT_MAX;
-
- unsigned int uint_result = 0;
- EXPECT_TRUE(ParseNaturalNumber(msg4.GetString(), &uint_result));
- EXPECT_EQ(UINT_MAX, uint_result);
-}
-
-TEST(ParseNaturalNumberTest, WorksForShorterIntegers) {
- short short_result = 0;
- ASSERT_TRUE(ParseNaturalNumber(String("123"), &short_result));
- EXPECT_EQ(123, short_result);
-
- signed char char_result = 0;
- ASSERT_TRUE(ParseNaturalNumber(String("123"), &char_result));
- EXPECT_EQ(123, char_result);
-}
-
-# if GTEST_OS_WINDOWS
-TEST(EnvironmentTest, HandleFitsIntoSizeT) {
- // TODO(vladl@google.com): Remove this test after this condition is verified
- // in a static assertion in gtest-death-test.cc in the function
- // GetStatusFileDescriptor.
- ASSERT_TRUE(sizeof(HANDLE) <= sizeof(size_t));
-}
-# endif // GTEST_OS_WINDOWS
-
-// Tests that EXPECT_DEATH_IF_SUPPORTED/ASSERT_DEATH_IF_SUPPORTED trigger
-// failures when death tests are available on the system.
-TEST(ConditionalDeathMacrosDeathTest, ExpectsDeathWhenDeathTestsAvailable) {
- EXPECT_DEATH_IF_SUPPORTED(DieInside("CondDeathTestExpectMacro"),
- "death inside CondDeathTestExpectMacro");
- ASSERT_DEATH_IF_SUPPORTED(DieInside("CondDeathTestAssertMacro"),
- "death inside CondDeathTestAssertMacro");
-
- // Empty statement will not crash, which must trigger a failure.
- EXPECT_NONFATAL_FAILURE(EXPECT_DEATH_IF_SUPPORTED(;, ""), "");
- EXPECT_FATAL_FAILURE(ASSERT_DEATH_IF_SUPPORTED(;, ""), "");
-}
-
-#else
-
-using testing::internal::CaptureStderr;
-using testing::internal::GetCapturedStderr;
-using testing::internal::String;
-
-// Tests that EXPECT_DEATH_IF_SUPPORTED/ASSERT_DEATH_IF_SUPPORTED are still
-// defined but do not trigger failures when death tests are not available on
-// the system.
-TEST(ConditionalDeathMacrosTest, WarnsWhenDeathTestsNotAvailable) {
- // Empty statement will not crash, but that should not trigger a failure
- // when death tests are not supported.
- CaptureStderr();
- EXPECT_DEATH_IF_SUPPORTED(;, "");
- String output = GetCapturedStderr();
- ASSERT_TRUE(NULL != strstr(output.c_str(),
- "Death tests are not supported on this platform"));
- ASSERT_TRUE(NULL != strstr(output.c_str(), ";"));
-
- // The streamed message should not be printed as there is no test failure.
- CaptureStderr();
- EXPECT_DEATH_IF_SUPPORTED(;, "") << "streamed message";
- output = GetCapturedStderr();
- ASSERT_TRUE(NULL == strstr(output.c_str(), "streamed message"));
-
- CaptureStderr();
- ASSERT_DEATH_IF_SUPPORTED(;, ""); // NOLINT
- output = GetCapturedStderr();
- ASSERT_TRUE(NULL != strstr(output.c_str(),
- "Death tests are not supported on this platform"));
- ASSERT_TRUE(NULL != strstr(output.c_str(), ";"));
-
- CaptureStderr();
- ASSERT_DEATH_IF_SUPPORTED(;, "") << "streamed message"; // NOLINT
- output = GetCapturedStderr();
- ASSERT_TRUE(NULL == strstr(output.c_str(), "streamed message"));
-}
-
-void FuncWithAssert(int* n) {
- ASSERT_DEATH_IF_SUPPORTED(return;, "");
- (*n)++;
-}
-
-// Tests that ASSERT_DEATH_IF_SUPPORTED does not return from the current
-// function (as ASSERT_DEATH does) if death tests are not supported.
-TEST(ConditionalDeathMacrosTest, AssertDeatDoesNotReturnhIfUnsupported) {
- int n = 0;
- FuncWithAssert(&n);
- EXPECT_EQ(1, n);
-}
-#endif // GTEST_HAS_DEATH_TEST
-
-// Tests that the death test macros expand to code which may or may not
-// be followed by operator<<, and that in either case the complete text
-// comprises only a single C++ statement.
-//
-// The syntax should work whether death tests are available or not.
-TEST(ConditionalDeathMacrosSyntaxDeathTest, SingleStatement) {
- if (AlwaysFalse())
- // This would fail if executed; this is a compilation test only
- ASSERT_DEATH_IF_SUPPORTED(return, "");
-
- if (AlwaysTrue())
- EXPECT_DEATH_IF_SUPPORTED(_exit(1), "");
- else
- // This empty "else" branch is meant to ensure that EXPECT_DEATH
- // doesn't expand into an "if" statement without an "else"
- ; // NOLINT
-
- if (AlwaysFalse())
- ASSERT_DEATH_IF_SUPPORTED(return, "") << "did not die";
-
- if (AlwaysFalse())
- ; // NOLINT
- else
- EXPECT_DEATH_IF_SUPPORTED(_exit(1), "") << 1 << 2 << 3;
-}
-
-// Tests that conditional death test macros expand to code which interacts
-// well with switch statements.
-TEST(ConditionalDeathMacrosSyntaxDeathTest, SwitchStatement) {
-// Microsoft compiler usually complains about switch statements without
-// case labels. We suppress that warning for this test.
-#ifdef _MSC_VER
-# pragma warning(push)
-# pragma warning(disable: 4065)
-#endif // _MSC_VER
-
- switch (0)
- default:
- ASSERT_DEATH_IF_SUPPORTED(_exit(1), "")
- << "exit in default switch handler";
-
- switch (0)
- case 0:
- EXPECT_DEATH_IF_SUPPORTED(_exit(1), "") << "exit in switch case";
-
-#ifdef _MSC_VER
-# pragma warning(pop)
-#endif // _MSC_VER
-}
-
-TEST(InDeathTestChildDeathTest, ReportsDeathTestCorrectlyInFastStyle) {
- testing::GTEST_FLAG(death_test_style) = "fast";
- EXPECT_FALSE(InDeathTestChild());
- EXPECT_DEATH({
- fprintf(stderr, InDeathTestChild() ? "Inside" : "Outside");
- fflush(stderr);
- _exit(1);
- }, "Inside");
-}
-
-TEST(InDeathTestChildDeathTest, ReportsDeathTestCorrectlyInThreadSafeStyle) {
- testing::GTEST_FLAG(death_test_style) = "threadsafe";
- EXPECT_FALSE(InDeathTestChild());
- EXPECT_DEATH({
- fprintf(stderr, InDeathTestChild() ? "Inside" : "Outside");
- fflush(stderr);
- _exit(1);
- }, "Inside");
-}
-
-// Tests that a test case whose name ends with "DeathTest" works fine
-// on Windows.
-TEST(NotADeathTest, Test) {
- SUCCEED();
-}
diff --git a/src/testing/gtest/test/gtest-filepath_test.cc b/src/testing/gtest/test/gtest-filepath_test.cc
deleted file mode 100644
index 66d41184..00000000
--- a/src/testing/gtest/test/gtest-filepath_test.cc
+++ /dev/null
@@ -1,696 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Authors: keith.ray@gmail.com (Keith Ray)
-//
-// Google Test filepath utilities
-//
-// This file tests classes and functions used internally by
-// Google Test. They are subject to change without notice.
-//
-// This file is #included from gtest_unittest.cc, to avoid changing
-// build or make-files for some existing Google Test clients. Do not
-// #include this file anywhere else!
-
-#include "gtest/internal/gtest-filepath.h"
-#include "gtest/gtest.h"
-
-// Indicates that this translation unit is part of Google Test's
-// implementation. It must come before gtest-internal-inl.h is
-// included, or there will be a compiler error. This trick is to
-// prevent a user from accidentally including gtest-internal-inl.h in
-// his code.
-#define GTEST_IMPLEMENTATION_ 1
-#include "src/gtest-internal-inl.h"
-#undef GTEST_IMPLEMENTATION_
-
-#if GTEST_OS_WINDOWS_MOBILE
-# include <windows.h> // NOLINT
-#elif GTEST_OS_WINDOWS
-# include <direct.h> // NOLINT
-#endif // GTEST_OS_WINDOWS_MOBILE
-
-namespace testing {
-namespace internal {
-namespace {
-
-#if GTEST_OS_WINDOWS_MOBILE
-// TODO(wan@google.com): Move these to the POSIX adapter section in
-// gtest-port.h.
-
-// Windows CE doesn't have the remove C function.
-int remove(const char* path) {
- LPCWSTR wpath = String::AnsiToUtf16(path);
- int ret = DeleteFile(wpath) ? 0 : -1;
- delete [] wpath;
- return ret;
-}
-// Windows CE doesn't have the _rmdir C function.
-int _rmdir(const char* path) {
- FilePath filepath(path);
- LPCWSTR wpath = String::AnsiToUtf16(
- filepath.RemoveTrailingPathSeparator().c_str());
- int ret = RemoveDirectory(wpath) ? 0 : -1;
- delete [] wpath;
- return ret;
-}
-
-#else
-
-TEST(GetCurrentDirTest, ReturnsCurrentDir) {
- const FilePath original_dir = FilePath::GetCurrentDir();
- EXPECT_FALSE(original_dir.IsEmpty());
-
- posix::ChDir(GTEST_PATH_SEP_);
- const FilePath cwd = FilePath::GetCurrentDir();
- posix::ChDir(original_dir.c_str());
-
-# if GTEST_OS_WINDOWS
-
- // Skips the ":".
- const char* const cwd_without_drive = strchr(cwd.c_str(), ':');
- ASSERT_TRUE(cwd_without_drive != NULL);
- EXPECT_STREQ(GTEST_PATH_SEP_, cwd_without_drive + 1);
-
-# else
-
- EXPECT_STREQ(GTEST_PATH_SEP_, cwd.c_str());
-
-# endif
-}
-
-#endif // GTEST_OS_WINDOWS_MOBILE
-
-TEST(IsEmptyTest, ReturnsTrueForEmptyPath) {
- EXPECT_TRUE(FilePath("").IsEmpty());
- EXPECT_TRUE(FilePath(NULL).IsEmpty());
-}
-
-TEST(IsEmptyTest, ReturnsFalseForNonEmptyPath) {
- EXPECT_FALSE(FilePath("a").IsEmpty());
- EXPECT_FALSE(FilePath(".").IsEmpty());
- EXPECT_FALSE(FilePath("a/b").IsEmpty());
- EXPECT_FALSE(FilePath("a\\b\\").IsEmpty());
-}
-
-// RemoveDirectoryName "" -> ""
-TEST(RemoveDirectoryNameTest, WhenEmptyName) {
- EXPECT_STREQ("", FilePath("").RemoveDirectoryName().c_str());
-}
-
-// RemoveDirectoryName "afile" -> "afile"
-TEST(RemoveDirectoryNameTest, ButNoDirectory) {
- EXPECT_STREQ("afile",
- FilePath("afile").RemoveDirectoryName().c_str());
-}
-
-// RemoveDirectoryName "/afile" -> "afile"
-TEST(RemoveDirectoryNameTest, RootFileShouldGiveFileName) {
- EXPECT_STREQ("afile",
- FilePath(GTEST_PATH_SEP_ "afile").RemoveDirectoryName().c_str());
-}
-
-// RemoveDirectoryName "adir/" -> ""
-TEST(RemoveDirectoryNameTest, WhereThereIsNoFileName) {
- EXPECT_STREQ("",
- FilePath("adir" GTEST_PATH_SEP_).RemoveDirectoryName().c_str());
-}
-
-// RemoveDirectoryName "adir/afile" -> "afile"
-TEST(RemoveDirectoryNameTest, ShouldGiveFileName) {
- EXPECT_STREQ("afile",
- FilePath("adir" GTEST_PATH_SEP_ "afile").RemoveDirectoryName().c_str());
-}
-
-// RemoveDirectoryName "adir/subdir/afile" -> "afile"
-TEST(RemoveDirectoryNameTest, ShouldAlsoGiveFileName) {
- EXPECT_STREQ("afile",
- FilePath("adir" GTEST_PATH_SEP_ "subdir" GTEST_PATH_SEP_ "afile")
- .RemoveDirectoryName().c_str());
-}
-
-#if GTEST_HAS_ALT_PATH_SEP_
-
-// Tests that RemoveDirectoryName() works with the alternate separator
-// on Windows.
-
-// RemoveDirectoryName("/afile") -> "afile"
-TEST(RemoveDirectoryNameTest, RootFileShouldGiveFileNameForAlternateSeparator) {
- EXPECT_STREQ("afile",
- FilePath("/afile").RemoveDirectoryName().c_str());
-}
-
-// RemoveDirectoryName("adir/") -> ""
-TEST(RemoveDirectoryNameTest, WhereThereIsNoFileNameForAlternateSeparator) {
- EXPECT_STREQ("",
- FilePath("adir/").RemoveDirectoryName().c_str());
-}
-
-// RemoveDirectoryName("adir/afile") -> "afile"
-TEST(RemoveDirectoryNameTest, ShouldGiveFileNameForAlternateSeparator) {
- EXPECT_STREQ("afile",
- FilePath("adir/afile").RemoveDirectoryName().c_str());
-}
-
-// RemoveDirectoryName("adir/subdir/afile") -> "afile"
-TEST(RemoveDirectoryNameTest, ShouldAlsoGiveFileNameForAlternateSeparator) {
- EXPECT_STREQ("afile",
- FilePath("adir/subdir/afile").RemoveDirectoryName().c_str());
-}
-
-#endif
-
-// RemoveFileName "" -> "./"
-TEST(RemoveFileNameTest, EmptyName) {
-#if GTEST_OS_WINDOWS_MOBILE
- // On Windows CE, we use the root as the current directory.
- EXPECT_STREQ(GTEST_PATH_SEP_,
- FilePath("").RemoveFileName().c_str());
-#else
- EXPECT_STREQ("." GTEST_PATH_SEP_,
- FilePath("").RemoveFileName().c_str());
-#endif
-}
-
-// RemoveFileName "adir/" -> "adir/"
-TEST(RemoveFileNameTest, ButNoFile) {
- EXPECT_STREQ("adir" GTEST_PATH_SEP_,
- FilePath("adir" GTEST_PATH_SEP_).RemoveFileName().c_str());
-}
-
-// RemoveFileName "adir/afile" -> "adir/"
-TEST(RemoveFileNameTest, GivesDirName) {
- EXPECT_STREQ("adir" GTEST_PATH_SEP_,
- FilePath("adir" GTEST_PATH_SEP_ "afile")
- .RemoveFileName().c_str());
-}
-
-// RemoveFileName "adir/subdir/afile" -> "adir/subdir/"
-TEST(RemoveFileNameTest, GivesDirAndSubDirName) {
- EXPECT_STREQ("adir" GTEST_PATH_SEP_ "subdir" GTEST_PATH_SEP_,
- FilePath("adir" GTEST_PATH_SEP_ "subdir" GTEST_PATH_SEP_ "afile")
- .RemoveFileName().c_str());
-}
-
-// RemoveFileName "/afile" -> "/"
-TEST(RemoveFileNameTest, GivesRootDir) {
- EXPECT_STREQ(GTEST_PATH_SEP_,
- FilePath(GTEST_PATH_SEP_ "afile").RemoveFileName().c_str());
-}
-
-#if GTEST_HAS_ALT_PATH_SEP_
-
-// Tests that RemoveFileName() works with the alternate separator on
-// Windows.
-
-// RemoveFileName("adir/") -> "adir/"
-TEST(RemoveFileNameTest, ButNoFileForAlternateSeparator) {
- EXPECT_STREQ("adir" GTEST_PATH_SEP_,
- FilePath("adir/").RemoveFileName().c_str());
-}
-
-// RemoveFileName("adir/afile") -> "adir/"
-TEST(RemoveFileNameTest, GivesDirNameForAlternateSeparator) {
- EXPECT_STREQ("adir" GTEST_PATH_SEP_,
- FilePath("adir/afile").RemoveFileName().c_str());
-}
-
-// RemoveFileName("adir/subdir/afile") -> "adir/subdir/"
-TEST(RemoveFileNameTest, GivesDirAndSubDirNameForAlternateSeparator) {
- EXPECT_STREQ("adir" GTEST_PATH_SEP_ "subdir" GTEST_PATH_SEP_,
- FilePath("adir/subdir/afile").RemoveFileName().c_str());
-}
-
-// RemoveFileName("/afile") -> "\"
-TEST(RemoveFileNameTest, GivesRootDirForAlternateSeparator) {
- EXPECT_STREQ(GTEST_PATH_SEP_,
- FilePath("/afile").RemoveFileName().c_str());
-}
-
-#endif
-
-TEST(MakeFileNameTest, GenerateWhenNumberIsZero) {
- FilePath actual = FilePath::MakeFileName(FilePath("foo"), FilePath("bar"),
- 0, "xml");
- EXPECT_STREQ("foo" GTEST_PATH_SEP_ "bar.xml", actual.c_str());
-}
-
-TEST(MakeFileNameTest, GenerateFileNameNumberGtZero) {
- FilePath actual = FilePath::MakeFileName(FilePath("foo"), FilePath("bar"),
- 12, "xml");
- EXPECT_STREQ("foo" GTEST_PATH_SEP_ "bar_12.xml", actual.c_str());
-}
-
-TEST(MakeFileNameTest, GenerateFileNameWithSlashNumberIsZero) {
- FilePath actual = FilePath::MakeFileName(FilePath("foo" GTEST_PATH_SEP_),
- FilePath("bar"), 0, "xml");
- EXPECT_STREQ("foo" GTEST_PATH_SEP_ "bar.xml", actual.c_str());
-}
-
-TEST(MakeFileNameTest, GenerateFileNameWithSlashNumberGtZero) {
- FilePath actual = FilePath::MakeFileName(FilePath("foo" GTEST_PATH_SEP_),
- FilePath("bar"), 12, "xml");
- EXPECT_STREQ("foo" GTEST_PATH_SEP_ "bar_12.xml", actual.c_str());
-}
-
-TEST(MakeFileNameTest, GenerateWhenNumberIsZeroAndDirIsEmpty) {
- FilePath actual = FilePath::MakeFileName(FilePath(""), FilePath("bar"),
- 0, "xml");
- EXPECT_STREQ("bar.xml", actual.c_str());
-}
-
-TEST(MakeFileNameTest, GenerateWhenNumberIsNotZeroAndDirIsEmpty) {
- FilePath actual = FilePath::MakeFileName(FilePath(""), FilePath("bar"),
- 14, "xml");
- EXPECT_STREQ("bar_14.xml", actual.c_str());
-}
-
-TEST(ConcatPathsTest, WorksWhenDirDoesNotEndWithPathSep) {
- FilePath actual = FilePath::ConcatPaths(FilePath("foo"),
- FilePath("bar.xml"));
- EXPECT_STREQ("foo" GTEST_PATH_SEP_ "bar.xml", actual.c_str());
-}
-
-TEST(ConcatPathsTest, WorksWhenPath1EndsWithPathSep) {
- FilePath actual = FilePath::ConcatPaths(FilePath("foo" GTEST_PATH_SEP_),
- FilePath("bar.xml"));
- EXPECT_STREQ("foo" GTEST_PATH_SEP_ "bar.xml", actual.c_str());
-}
-
-TEST(ConcatPathsTest, Path1BeingEmpty) {
- FilePath actual = FilePath::ConcatPaths(FilePath(""),
- FilePath("bar.xml"));
- EXPECT_STREQ("bar.xml", actual.c_str());
-}
-
-TEST(ConcatPathsTest, Path2BeingEmpty) {
- FilePath actual = FilePath::ConcatPaths(FilePath("foo"),
- FilePath(""));
- EXPECT_STREQ("foo" GTEST_PATH_SEP_, actual.c_str());
-}
-
-TEST(ConcatPathsTest, BothPathBeingEmpty) {
- FilePath actual = FilePath::ConcatPaths(FilePath(""),
- FilePath(""));
- EXPECT_STREQ("", actual.c_str());
-}
-
-TEST(ConcatPathsTest, Path1ContainsPathSep) {
- FilePath actual = FilePath::ConcatPaths(FilePath("foo" GTEST_PATH_SEP_ "bar"),
- FilePath("foobar.xml"));
- EXPECT_STREQ("foo" GTEST_PATH_SEP_ "bar" GTEST_PATH_SEP_ "foobar.xml",
- actual.c_str());
-}
-
-TEST(ConcatPathsTest, Path2ContainsPathSep) {
- FilePath actual = FilePath::ConcatPaths(
- FilePath("foo" GTEST_PATH_SEP_),
- FilePath("bar" GTEST_PATH_SEP_ "bar.xml"));
- EXPECT_STREQ("foo" GTEST_PATH_SEP_ "bar" GTEST_PATH_SEP_ "bar.xml",
- actual.c_str());
-}
-
-TEST(ConcatPathsTest, Path2EndsWithPathSep) {
- FilePath actual = FilePath::ConcatPaths(FilePath("foo"),
- FilePath("bar" GTEST_PATH_SEP_));
- EXPECT_STREQ("foo" GTEST_PATH_SEP_ "bar" GTEST_PATH_SEP_, actual.c_str());
-}
-
-// RemoveTrailingPathSeparator "" -> ""
-TEST(RemoveTrailingPathSeparatorTest, EmptyString) {
- EXPECT_STREQ("",
- FilePath("").RemoveTrailingPathSeparator().c_str());
-}
-
-// RemoveTrailingPathSeparator "foo" -> "foo"
-TEST(RemoveTrailingPathSeparatorTest, FileNoSlashString) {
- EXPECT_STREQ("foo",
- FilePath("foo").RemoveTrailingPathSeparator().c_str());
-}
-
-// RemoveTrailingPathSeparator "foo/" -> "foo"
-TEST(RemoveTrailingPathSeparatorTest, ShouldRemoveTrailingSeparator) {
- EXPECT_STREQ(
- "foo",
- FilePath("foo" GTEST_PATH_SEP_).RemoveTrailingPathSeparator().c_str());
-#if GTEST_HAS_ALT_PATH_SEP_
- EXPECT_STREQ("foo",
- FilePath("foo/").RemoveTrailingPathSeparator().c_str());
-#endif
-}
-
-// RemoveTrailingPathSeparator "foo/bar/" -> "foo/bar/"
-TEST(RemoveTrailingPathSeparatorTest, ShouldRemoveLastSeparator) {
- EXPECT_STREQ("foo" GTEST_PATH_SEP_ "bar",
- FilePath("foo" GTEST_PATH_SEP_ "bar" GTEST_PATH_SEP_)
- .RemoveTrailingPathSeparator().c_str());
-}
-
-// RemoveTrailingPathSeparator "foo/bar" -> "foo/bar"
-TEST(RemoveTrailingPathSeparatorTest, ShouldReturnUnmodified) {
- EXPECT_STREQ("foo" GTEST_PATH_SEP_ "bar",
- FilePath("foo" GTEST_PATH_SEP_ "bar")
- .RemoveTrailingPathSeparator().c_str());
-}
-
-TEST(DirectoryTest, RootDirectoryExists) {
-#if GTEST_OS_WINDOWS // We are on Windows.
- char current_drive[_MAX_PATH]; // NOLINT
- current_drive[0] = static_cast<char>(_getdrive() + 'A' - 1);
- current_drive[1] = ':';
- current_drive[2] = '\\';
- current_drive[3] = '\0';
- EXPECT_TRUE(FilePath(current_drive).DirectoryExists());
-#else
- EXPECT_TRUE(FilePath("/").DirectoryExists());
-#endif // GTEST_OS_WINDOWS
-}
-
-#if GTEST_OS_WINDOWS
-TEST(DirectoryTest, RootOfWrongDriveDoesNotExists) {
- const int saved_drive_ = _getdrive();
- // Find a drive that doesn't exist. Start with 'Z' to avoid common ones.
- for (char drive = 'Z'; drive >= 'A'; drive--)
- if (_chdrive(drive - 'A' + 1) == -1) {
- char non_drive[_MAX_PATH]; // NOLINT
- non_drive[0] = drive;
- non_drive[1] = ':';
- non_drive[2] = '\\';
- non_drive[3] = '\0';
- EXPECT_FALSE(FilePath(non_drive).DirectoryExists());
- break;
- }
- _chdrive(saved_drive_);
-}
-#endif // GTEST_OS_WINDOWS
-
-#if !GTEST_OS_WINDOWS_MOBILE
-// Windows CE _does_ consider an empty directory to exist.
-TEST(DirectoryTest, EmptyPathDirectoryDoesNotExist) {
- EXPECT_FALSE(FilePath("").DirectoryExists());
-}
-#endif // !GTEST_OS_WINDOWS_MOBILE
-
-TEST(DirectoryTest, CurrentDirectoryExists) {
-#if GTEST_OS_WINDOWS // We are on Windows.
-# ifndef _WIN32_CE // Windows CE doesn't have a current directory.
-
- EXPECT_TRUE(FilePath(".").DirectoryExists());
- EXPECT_TRUE(FilePath(".\\").DirectoryExists());
-
-# endif // _WIN32_CE
-#else
- EXPECT_TRUE(FilePath(".").DirectoryExists());
- EXPECT_TRUE(FilePath("./").DirectoryExists());
-#endif // GTEST_OS_WINDOWS
-}
-
-TEST(NormalizeTest, NullStringsEqualEmptyDirectory) {
- EXPECT_STREQ("", FilePath(NULL).c_str());
- EXPECT_STREQ("", FilePath(String(NULL)).c_str());
-}
-
-// "foo/bar" == foo//bar" == "foo///bar"
-TEST(NormalizeTest, MultipleConsecutiveSepaparatorsInMidstring) {
- EXPECT_STREQ("foo" GTEST_PATH_SEP_ "bar",
- FilePath("foo" GTEST_PATH_SEP_ "bar").c_str());
- EXPECT_STREQ("foo" GTEST_PATH_SEP_ "bar",
- FilePath("foo" GTEST_PATH_SEP_ GTEST_PATH_SEP_ "bar").c_str());
- EXPECT_STREQ("foo" GTEST_PATH_SEP_ "bar",
- FilePath("foo" GTEST_PATH_SEP_ GTEST_PATH_SEP_
- GTEST_PATH_SEP_ "bar").c_str());
-}
-
-// "/bar" == //bar" == "///bar"
-TEST(NormalizeTest, MultipleConsecutiveSepaparatorsAtStringStart) {
- EXPECT_STREQ(GTEST_PATH_SEP_ "bar",
- FilePath(GTEST_PATH_SEP_ "bar").c_str());
- EXPECT_STREQ(GTEST_PATH_SEP_ "bar",
- FilePath(GTEST_PATH_SEP_ GTEST_PATH_SEP_ "bar").c_str());
- EXPECT_STREQ(GTEST_PATH_SEP_ "bar",
- FilePath(GTEST_PATH_SEP_ GTEST_PATH_SEP_ GTEST_PATH_SEP_ "bar").c_str());
-}
-
-// "foo/" == foo//" == "foo///"
-TEST(NormalizeTest, MultipleConsecutiveSepaparatorsAtStringEnd) {
- EXPECT_STREQ("foo" GTEST_PATH_SEP_,
- FilePath("foo" GTEST_PATH_SEP_).c_str());
- EXPECT_STREQ("foo" GTEST_PATH_SEP_,
- FilePath("foo" GTEST_PATH_SEP_ GTEST_PATH_SEP_).c_str());
- EXPECT_STREQ("foo" GTEST_PATH_SEP_,
- FilePath("foo" GTEST_PATH_SEP_ GTEST_PATH_SEP_ GTEST_PATH_SEP_).c_str());
-}
-
-#if GTEST_HAS_ALT_PATH_SEP_
-
-// Tests that separators at the end of the string are normalized
-// regardless of their combination (e.g. "foo\" =="foo/\" ==
-// "foo\\/").
-TEST(NormalizeTest, MixAlternateSeparatorAtStringEnd) {
- EXPECT_STREQ("foo" GTEST_PATH_SEP_,
- FilePath("foo/").c_str());
- EXPECT_STREQ("foo" GTEST_PATH_SEP_,
- FilePath("foo" GTEST_PATH_SEP_ "/").c_str());
- EXPECT_STREQ("foo" GTEST_PATH_SEP_,
- FilePath("foo//" GTEST_PATH_SEP_).c_str());
-}
-
-#endif
-
-TEST(AssignmentOperatorTest, DefaultAssignedToNonDefault) {
- FilePath default_path;
- FilePath non_default_path("path");
- non_default_path = default_path;
- EXPECT_STREQ("", non_default_path.c_str());
- EXPECT_STREQ("", default_path.c_str()); // RHS var is unchanged.
-}
-
-TEST(AssignmentOperatorTest, NonDefaultAssignedToDefault) {
- FilePath non_default_path("path");
- FilePath default_path;
- default_path = non_default_path;
- EXPECT_STREQ("path", default_path.c_str());
- EXPECT_STREQ("path", non_default_path.c_str()); // RHS var is unchanged.
-}
-
-TEST(AssignmentOperatorTest, ConstAssignedToNonConst) {
- const FilePath const_default_path("const_path");
- FilePath non_default_path("path");
- non_default_path = const_default_path;
- EXPECT_STREQ("const_path", non_default_path.c_str());
-}
-
-class DirectoryCreationTest : public Test {
- protected:
- virtual void SetUp() {
- testdata_path_.Set(FilePath(String::Format("%s%s%s",
- TempDir().c_str(), GetCurrentExecutableName().c_str(),
- "_directory_creation" GTEST_PATH_SEP_ "test" GTEST_PATH_SEP_)));
- testdata_file_.Set(testdata_path_.RemoveTrailingPathSeparator());
-
- unique_file0_.Set(FilePath::MakeFileName(testdata_path_, FilePath("unique"),
- 0, "txt"));
- unique_file1_.Set(FilePath::MakeFileName(testdata_path_, FilePath("unique"),
- 1, "txt"));
-
- remove(testdata_file_.c_str());
- remove(unique_file0_.c_str());
- remove(unique_file1_.c_str());
- posix::RmDir(testdata_path_.c_str());
- }
-
- virtual void TearDown() {
- remove(testdata_file_.c_str());
- remove(unique_file0_.c_str());
- remove(unique_file1_.c_str());
- posix::RmDir(testdata_path_.c_str());
- }
-
- String TempDir() const {
-#if GTEST_OS_WINDOWS_MOBILE
- return String("\\temp\\");
-#elif GTEST_OS_WINDOWS
- const char* temp_dir = posix::GetEnv("TEMP");
- if (temp_dir == NULL || temp_dir[0] == '\0')
- return String("\\temp\\");
- else if (String(temp_dir).EndsWith("\\"))
- return String(temp_dir);
- else
- return String::Format("%s\\", temp_dir);
-#else
- return String("/tmp/");
-#endif // GTEST_OS_WINDOWS_MOBILE
- }
-
- void CreateTextFile(const char* filename) {
- FILE* f = posix::FOpen(filename, "w");
- fprintf(f, "text\n");
- fclose(f);
- }
-
- // Strings representing a directory and a file, with identical paths
- // except for the trailing separator character that distinquishes
- // a directory named 'test' from a file named 'test'. Example names:
- FilePath testdata_path_; // "/tmp/directory_creation/test/"
- FilePath testdata_file_; // "/tmp/directory_creation/test"
- FilePath unique_file0_; // "/tmp/directory_creation/test/unique.txt"
- FilePath unique_file1_; // "/tmp/directory_creation/test/unique_1.txt"
-};
-
-TEST_F(DirectoryCreationTest, CreateDirectoriesRecursively) {
- EXPECT_FALSE(testdata_path_.DirectoryExists()) << testdata_path_.c_str();
- EXPECT_TRUE(testdata_path_.CreateDirectoriesRecursively());
- EXPECT_TRUE(testdata_path_.DirectoryExists());
-}
-
-TEST_F(DirectoryCreationTest, CreateDirectoriesForAlreadyExistingPath) {
- EXPECT_FALSE(testdata_path_.DirectoryExists()) << testdata_path_.c_str();
- EXPECT_TRUE(testdata_path_.CreateDirectoriesRecursively());
- // Call 'create' again... should still succeed.
- EXPECT_TRUE(testdata_path_.CreateDirectoriesRecursively());
-}
-
-TEST_F(DirectoryCreationTest, CreateDirectoriesAndUniqueFilename) {
- FilePath file_path(FilePath::GenerateUniqueFileName(testdata_path_,
- FilePath("unique"), "txt"));
- EXPECT_STREQ(unique_file0_.c_str(), file_path.c_str());
- EXPECT_FALSE(file_path.FileOrDirectoryExists()); // file not there
-
- testdata_path_.CreateDirectoriesRecursively();
- EXPECT_FALSE(file_path.FileOrDirectoryExists()); // file still not there
- CreateTextFile(file_path.c_str());
- EXPECT_TRUE(file_path.FileOrDirectoryExists());
-
- FilePath file_path2(FilePath::GenerateUniqueFileName(testdata_path_,
- FilePath("unique"), "txt"));
- EXPECT_STREQ(unique_file1_.c_str(), file_path2.c_str());
- EXPECT_FALSE(file_path2.FileOrDirectoryExists()); // file not there
- CreateTextFile(file_path2.c_str());
- EXPECT_TRUE(file_path2.FileOrDirectoryExists());
-}
-
-TEST_F(DirectoryCreationTest, CreateDirectoriesFail) {
- // force a failure by putting a file where we will try to create a directory.
- CreateTextFile(testdata_file_.c_str());
- EXPECT_TRUE(testdata_file_.FileOrDirectoryExists());
- EXPECT_FALSE(testdata_file_.DirectoryExists());
- EXPECT_FALSE(testdata_file_.CreateDirectoriesRecursively());
-}
-
-TEST(NoDirectoryCreationTest, CreateNoDirectoriesForDefaultXmlFile) {
- const FilePath test_detail_xml("test_detail.xml");
- EXPECT_FALSE(test_detail_xml.CreateDirectoriesRecursively());
-}
-
-TEST(FilePathTest, DefaultConstructor) {
- FilePath fp;
- EXPECT_STREQ("", fp.c_str());
-}
-
-TEST(FilePathTest, CharAndCopyConstructors) {
- const FilePath fp("spicy");
- EXPECT_STREQ("spicy", fp.c_str());
-
- const FilePath fp_copy(fp);
- EXPECT_STREQ("spicy", fp_copy.c_str());
-}
-
-TEST(FilePathTest, StringConstructor) {
- const FilePath fp(String("cider"));
- EXPECT_STREQ("cider", fp.c_str());
-}
-
-TEST(FilePathTest, Set) {
- const FilePath apple("apple");
- FilePath mac("mac");
- mac.Set(apple); // Implement Set() since overloading operator= is forbidden.
- EXPECT_STREQ("apple", mac.c_str());
- EXPECT_STREQ("apple", apple.c_str());
-}
-
-TEST(FilePathTest, ToString) {
- const FilePath file("drink");
- String str(file.ToString());
- EXPECT_STREQ("drink", str.c_str());
-}
-
-TEST(FilePathTest, RemoveExtension) {
- EXPECT_STREQ("app", FilePath("app.exe").RemoveExtension("exe").c_str());
- EXPECT_STREQ("APP", FilePath("APP.EXE").RemoveExtension("exe").c_str());
-}
-
-TEST(FilePathTest, RemoveExtensionWhenThereIsNoExtension) {
- EXPECT_STREQ("app", FilePath("app").RemoveExtension("exe").c_str());
-}
-
-TEST(FilePathTest, IsDirectory) {
- EXPECT_FALSE(FilePath("cola").IsDirectory());
- EXPECT_TRUE(FilePath("koala" GTEST_PATH_SEP_).IsDirectory());
-#if GTEST_HAS_ALT_PATH_SEP_
- EXPECT_TRUE(FilePath("koala/").IsDirectory());
-#endif
-}
-
-TEST(FilePathTest, IsAbsolutePath) {
- EXPECT_FALSE(FilePath("is" GTEST_PATH_SEP_ "relative").IsAbsolutePath());
- EXPECT_FALSE(FilePath("").IsAbsolutePath());
-#if GTEST_OS_WINDOWS
- EXPECT_TRUE(FilePath("c:\\" GTEST_PATH_SEP_ "is_not"
- GTEST_PATH_SEP_ "relative").IsAbsolutePath());
- EXPECT_FALSE(FilePath("c:foo" GTEST_PATH_SEP_ "bar").IsAbsolutePath());
- EXPECT_TRUE(FilePath("c:/" GTEST_PATH_SEP_ "is_not"
- GTEST_PATH_SEP_ "relative").IsAbsolutePath());
-#else
- EXPECT_TRUE(FilePath(GTEST_PATH_SEP_ "is_not" GTEST_PATH_SEP_ "relative")
- .IsAbsolutePath());
-#endif // GTEST_OS_WINDOWS
-}
-
-TEST(FilePathTest, IsRootDirectory) {
-#if GTEST_OS_WINDOWS
- EXPECT_TRUE(FilePath("a:\\").IsRootDirectory());
- EXPECT_TRUE(FilePath("Z:/").IsRootDirectory());
- EXPECT_TRUE(FilePath("e://").IsRootDirectory());
- EXPECT_FALSE(FilePath("").IsRootDirectory());
- EXPECT_FALSE(FilePath("b:").IsRootDirectory());
- EXPECT_FALSE(FilePath("b:a").IsRootDirectory());
- EXPECT_FALSE(FilePath("8:/").IsRootDirectory());
- EXPECT_FALSE(FilePath("c|/").IsRootDirectory());
-#else
- EXPECT_TRUE(FilePath("/").IsRootDirectory());
- EXPECT_TRUE(FilePath("//").IsRootDirectory());
- EXPECT_FALSE(FilePath("").IsRootDirectory());
- EXPECT_FALSE(FilePath("\\").IsRootDirectory());
- EXPECT_FALSE(FilePath("/x").IsRootDirectory());
-#endif
-}
-
-} // namespace
-} // namespace internal
-} // namespace testing
diff --git a/src/testing/gtest/test/gtest-linked_ptr_test.cc b/src/testing/gtest/test/gtest-linked_ptr_test.cc
deleted file mode 100644
index 6fcf5124..00000000
--- a/src/testing/gtest/test/gtest-linked_ptr_test.cc
+++ /dev/null
@@ -1,154 +0,0 @@
-// Copyright 2003, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Authors: Dan Egnor (egnor@google.com)
-// Ported to Windows: Vadim Berman (vadimb@google.com)
-
-#include "gtest/internal/gtest-linked_ptr.h"
-
-#include <stdlib.h>
-#include "gtest/gtest.h"
-
-namespace {
-
-using testing::Message;
-using testing::internal::linked_ptr;
-
-int num;
-Message* history = NULL;
-
-// Class which tracks allocation/deallocation
-class A {
- public:
- A(): mynum(num++) { *history << "A" << mynum << " ctor\n"; }
- virtual ~A() { *history << "A" << mynum << " dtor\n"; }
- virtual void Use() { *history << "A" << mynum << " use\n"; }
- protected:
- int mynum;
-};
-
-// Subclass
-class B : public A {
- public:
- B() { *history << "B" << mynum << " ctor\n"; }
- ~B() { *history << "B" << mynum << " dtor\n"; }
- virtual void Use() { *history << "B" << mynum << " use\n"; }
-};
-
-class LinkedPtrTest : public testing::Test {
- public:
- LinkedPtrTest() {
- num = 0;
- history = new Message;
- }
-
- virtual ~LinkedPtrTest() {
- delete history;
- history = NULL;
- }
-};
-
-TEST_F(LinkedPtrTest, GeneralTest) {
- {
- linked_ptr<A> a0, a1, a2;
- // Use explicit function call notation here to suppress self-assign warning.
- a0.operator=(a0);
- a1 = a2;
- ASSERT_EQ(a0.get(), static_cast<A*>(NULL));
- ASSERT_EQ(a1.get(), static_cast<A*>(NULL));
- ASSERT_EQ(a2.get(), static_cast<A*>(NULL));
- ASSERT_TRUE(a0 == NULL);
- ASSERT_TRUE(a1 == NULL);
- ASSERT_TRUE(a2 == NULL);
-
- {
- linked_ptr<A> a3(new A);
- a0 = a3;
- ASSERT_TRUE(a0 == a3);
- ASSERT_TRUE(a0 != NULL);
- ASSERT_TRUE(a0.get() == a3);
- ASSERT_TRUE(a0 == a3.get());
- linked_ptr<A> a4(a0);
- a1 = a4;
- linked_ptr<A> a5(new A);
- ASSERT_TRUE(a5.get() != a3);
- ASSERT_TRUE(a5 != a3.get());
- a2 = a5;
- linked_ptr<B> b0(new B);
- linked_ptr<A> a6(b0);
- ASSERT_TRUE(b0 == a6);
- ASSERT_TRUE(a6 == b0);
- ASSERT_TRUE(b0 != NULL);
- a5 = b0;
- a5 = b0;
- a3->Use();
- a4->Use();
- a5->Use();
- a6->Use();
- b0->Use();
- (*b0).Use();
- b0.get()->Use();
- }
-
- a0->Use();
- a1->Use();
- a2->Use();
-
- a1 = a2;
- a2.reset(new A);
- a0.reset();
-
- linked_ptr<A> a7;
- }
-
- ASSERT_STREQ(
- "A0 ctor\n"
- "A1 ctor\n"
- "A2 ctor\n"
- "B2 ctor\n"
- "A0 use\n"
- "A0 use\n"
- "B2 use\n"
- "B2 use\n"
- "B2 use\n"
- "B2 use\n"
- "B2 use\n"
- "B2 dtor\n"
- "A2 dtor\n"
- "A0 use\n"
- "A0 use\n"
- "A1 use\n"
- "A3 ctor\n"
- "A0 dtor\n"
- "A3 dtor\n"
- "A1 dtor\n",
- history->GetString().c_str());
-}
-
-} // Unnamed namespace
diff --git a/src/testing/gtest/test/gtest-listener_test.cc b/src/testing/gtest/test/gtest-listener_test.cc
deleted file mode 100644
index 10086086..00000000
--- a/src/testing/gtest/test/gtest-listener_test.cc
+++ /dev/null
@@ -1,313 +0,0 @@
-// Copyright 2009 Google Inc. All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: vladl@google.com (Vlad Losev)
-//
-// The Google C++ Testing Framework (Google Test)
-//
-// This file verifies Google Test event listeners receive events at the
-// right times.
-
-#include "gtest/gtest.h"
-#include <vector>
-
-using ::testing::AddGlobalTestEnvironment;
-using ::testing::Environment;
-using ::testing::InitGoogleTest;
-using ::testing::Test;
-using ::testing::TestCase;
-using ::testing::TestEventListener;
-using ::testing::TestInfo;
-using ::testing::TestPartResult;
-using ::testing::UnitTest;
-using ::testing::internal::String;
-
-// Used by tests to register their events.
-std::vector<String>* g_events = NULL;
-
-namespace testing {
-namespace internal {
-
-class EventRecordingListener : public TestEventListener {
- public:
- explicit EventRecordingListener(const char* name) : name_(name) {}
-
- protected:
- virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {
- g_events->push_back(GetFullMethodName("OnTestProgramStart"));
- }
-
- virtual void OnTestIterationStart(const UnitTest& /*unit_test*/,
- int iteration) {
- Message message;
- message << GetFullMethodName("OnTestIterationStart")
- << "(" << iteration << ")";
- g_events->push_back(message.GetString());
- }
-
- virtual void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) {
- g_events->push_back(GetFullMethodName("OnEnvironmentsSetUpStart"));
- }
-
- virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {
- g_events->push_back(GetFullMethodName("OnEnvironmentsSetUpEnd"));
- }
-
- virtual void OnTestCaseStart(const TestCase& /*test_case*/) {
- g_events->push_back(GetFullMethodName("OnTestCaseStart"));
- }
-
- virtual void OnTestStart(const TestInfo& /*test_info*/) {
- g_events->push_back(GetFullMethodName("OnTestStart"));
- }
-
- virtual void OnTestPartResult(const TestPartResult& /*test_part_result*/) {
- g_events->push_back(GetFullMethodName("OnTestPartResult"));
- }
-
- virtual void OnTestEnd(const TestInfo& /*test_info*/) {
- g_events->push_back(GetFullMethodName("OnTestEnd"));
- }
-
- virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {
- g_events->push_back(GetFullMethodName("OnTestCaseEnd"));
- }
-
- virtual void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) {
- g_events->push_back(GetFullMethodName("OnEnvironmentsTearDownStart"));
- }
-
- virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {
- g_events->push_back(GetFullMethodName("OnEnvironmentsTearDownEnd"));
- }
-
- virtual void OnTestIterationEnd(const UnitTest& /*unit_test*/,
- int iteration) {
- Message message;
- message << GetFullMethodName("OnTestIterationEnd")
- << "(" << iteration << ")";
- g_events->push_back(message.GetString());
- }
-
- virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {
- g_events->push_back(GetFullMethodName("OnTestProgramEnd"));
- }
-
- private:
- String GetFullMethodName(const char* name) {
- Message message;
- message << name_ << "." << name;
- return message.GetString();
- }
-
- String name_;
-};
-
-class EnvironmentInvocationCatcher : public Environment {
- protected:
- virtual void SetUp() {
- g_events->push_back(String("Environment::SetUp"));
- }
-
- virtual void TearDown() {
- g_events->push_back(String("Environment::TearDown"));
- }
-};
-
-class ListenerTest : public Test {
- protected:
- static void SetUpTestCase() {
- g_events->push_back(String("ListenerTest::SetUpTestCase"));
- }
-
- static void TearDownTestCase() {
- g_events->push_back(String("ListenerTest::TearDownTestCase"));
- }
-
- virtual void SetUp() {
- g_events->push_back(String("ListenerTest::SetUp"));
- }
-
- virtual void TearDown() {
- g_events->push_back(String("ListenerTest::TearDown"));
- }
-};
-
-TEST_F(ListenerTest, DoesFoo) {
- // Test execution order within a test case is not guaranteed so we are not
- // recording the test name.
- g_events->push_back(String("ListenerTest::* Test Body"));
- SUCCEED(); // Triggers OnTestPartResult.
-}
-
-TEST_F(ListenerTest, DoesBar) {
- g_events->push_back(String("ListenerTest::* Test Body"));
- SUCCEED(); // Triggers OnTestPartResult.
-}
-
-} // namespace internal
-
-} // namespace testing
-
-using ::testing::internal::EnvironmentInvocationCatcher;
-using ::testing::internal::EventRecordingListener;
-
-void VerifyResults(const std::vector<String>& data,
- const char* const* expected_data,
- int expected_data_size) {
- const int actual_size = data.size();
- // If the following assertion fails, a new entry will be appended to
- // data. Hence we save data.size() first.
- EXPECT_EQ(expected_data_size, actual_size);
-
- // Compares the common prefix.
- const int shorter_size = expected_data_size <= actual_size ?
- expected_data_size : actual_size;
- int i = 0;
- for (; i < shorter_size; ++i) {
- ASSERT_STREQ(expected_data[i], data[i].c_str())
- << "at position " << i;
- }
-
- // Prints extra elements in the actual data.
- for (; i < actual_size; ++i) {
- printf(" Actual event #%d: %s\n", i, data[i].c_str());
- }
-}
-
-int main(int argc, char **argv) {
- std::vector<String> events;
- g_events = &events;
- InitGoogleTest(&argc, argv);
-
- UnitTest::GetInstance()->listeners().Append(
- new EventRecordingListener("1st"));
- UnitTest::GetInstance()->listeners().Append(
- new EventRecordingListener("2nd"));
-
- AddGlobalTestEnvironment(new EnvironmentInvocationCatcher);
-
- GTEST_CHECK_(events.size() == 0)
- << "AddGlobalTestEnvironment should not generate any events itself.";
-
- ::testing::GTEST_FLAG(repeat) = 2;
- int ret_val = RUN_ALL_TESTS();
-
- const char* const expected_events[] = {
- "1st.OnTestProgramStart",
- "2nd.OnTestProgramStart",
- "1st.OnTestIterationStart(0)",
- "2nd.OnTestIterationStart(0)",
- "1st.OnEnvironmentsSetUpStart",
- "2nd.OnEnvironmentsSetUpStart",
- "Environment::SetUp",
- "2nd.OnEnvironmentsSetUpEnd",
- "1st.OnEnvironmentsSetUpEnd",
- "1st.OnTestCaseStart",
- "2nd.OnTestCaseStart",
- "ListenerTest::SetUpTestCase",
- "1st.OnTestStart",
- "2nd.OnTestStart",
- "ListenerTest::SetUp",
- "ListenerTest::* Test Body",
- "1st.OnTestPartResult",
- "2nd.OnTestPartResult",
- "ListenerTest::TearDown",
- "2nd.OnTestEnd",
- "1st.OnTestEnd",
- "1st.OnTestStart",
- "2nd.OnTestStart",
- "ListenerTest::SetUp",
- "ListenerTest::* Test Body",
- "1st.OnTestPartResult",
- "2nd.OnTestPartResult",
- "ListenerTest::TearDown",
- "2nd.OnTestEnd",
- "1st.OnTestEnd",
- "ListenerTest::TearDownTestCase",
- "2nd.OnTestCaseEnd",
- "1st.OnTestCaseEnd",
- "1st.OnEnvironmentsTearDownStart",
- "2nd.OnEnvironmentsTearDownStart",
- "Environment::TearDown",
- "2nd.OnEnvironmentsTearDownEnd",
- "1st.OnEnvironmentsTearDownEnd",
- "2nd.OnTestIterationEnd(0)",
- "1st.OnTestIterationEnd(0)",
- "1st.OnTestIterationStart(1)",
- "2nd.OnTestIterationStart(1)",
- "1st.OnEnvironmentsSetUpStart",
- "2nd.OnEnvironmentsSetUpStart",
- "Environment::SetUp",
- "2nd.OnEnvironmentsSetUpEnd",
- "1st.OnEnvironmentsSetUpEnd",
- "1st.OnTestCaseStart",
- "2nd.OnTestCaseStart",
- "ListenerTest::SetUpTestCase",
- "1st.OnTestStart",
- "2nd.OnTestStart",
- "ListenerTest::SetUp",
- "ListenerTest::* Test Body",
- "1st.OnTestPartResult",
- "2nd.OnTestPartResult",
- "ListenerTest::TearDown",
- "2nd.OnTestEnd",
- "1st.OnTestEnd",
- "1st.OnTestStart",
- "2nd.OnTestStart",
- "ListenerTest::SetUp",
- "ListenerTest::* Test Body",
- "1st.OnTestPartResult",
- "2nd.OnTestPartResult",
- "ListenerTest::TearDown",
- "2nd.OnTestEnd",
- "1st.OnTestEnd",
- "ListenerTest::TearDownTestCase",
- "2nd.OnTestCaseEnd",
- "1st.OnTestCaseEnd",
- "1st.OnEnvironmentsTearDownStart",
- "2nd.OnEnvironmentsTearDownStart",
- "Environment::TearDown",
- "2nd.OnEnvironmentsTearDownEnd",
- "1st.OnEnvironmentsTearDownEnd",
- "2nd.OnTestIterationEnd(1)",
- "1st.OnTestIterationEnd(1)",
- "2nd.OnTestProgramEnd",
- "1st.OnTestProgramEnd"
- };
- VerifyResults(events,
- expected_events,
- sizeof(expected_events)/sizeof(expected_events[0]));
-
- // We need to check manually for ad hoc test failures that happen after
- // RUN_ALL_TESTS finishes.
- if (UnitTest::GetInstance()->Failed())
- ret_val = 1;
-
- return ret_val;
-}
diff --git a/src/testing/gtest/test/gtest-message_test.cc b/src/testing/gtest/test/gtest-message_test.cc
deleted file mode 100644
index c09c6a83..00000000
--- a/src/testing/gtest/test/gtest-message_test.cc
+++ /dev/null
@@ -1,166 +0,0 @@
-// Copyright 2005, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-//
-// Tests for the Message class.
-
-#include "gtest/gtest-message.h"
-
-#include "gtest/gtest.h"
-
-namespace {
-
-using ::testing::Message;
-
-// A helper function that turns a Message into a C string.
-const char* ToCString(const Message& msg) {
- static testing::internal::String result;
- result = msg.GetString();
- return result.c_str();
-}
-
-// Tests the testing::Message class
-
-// Tests the default constructor.
-TEST(MessageTest, DefaultConstructor) {
- const Message msg;
- EXPECT_STREQ("", ToCString(msg));
-}
-
-// Tests the copy constructor.
-TEST(MessageTest, CopyConstructor) {
- const Message msg1("Hello");
- const Message msg2(msg1);
- EXPECT_STREQ("Hello", ToCString(msg2));
-}
-
-// Tests constructing a Message from a C-string.
-TEST(MessageTest, ConstructsFromCString) {
- Message msg("Hello");
- EXPECT_STREQ("Hello", ToCString(msg));
-}
-
-// Tests streaming a float.
-TEST(MessageTest, StreamsFloat) {
- const char* const s = ToCString(Message() << 1.23456F << " " << 2.34567F);
- // Both numbers should be printed with enough precision.
- EXPECT_PRED_FORMAT2(testing::IsSubstring, "1.234560", s);
- EXPECT_PRED_FORMAT2(testing::IsSubstring, " 2.345669", s);
-}
-
-// Tests streaming a double.
-TEST(MessageTest, StreamsDouble) {
- const char* const s = ToCString(Message() << 1260570880.4555497 << " "
- << 1260572265.1954534);
- // Both numbers should be printed with enough precision.
- EXPECT_PRED_FORMAT2(testing::IsSubstring, "1260570880.45", s);
- EXPECT_PRED_FORMAT2(testing::IsSubstring, " 1260572265.19", s);
-}
-
-// Tests streaming a non-char pointer.
-TEST(MessageTest, StreamsPointer) {
- int n = 0;
- int* p = &n;
- EXPECT_STRNE("(null)", ToCString(Message() << p));
-}
-
-// Tests streaming a NULL non-char pointer.
-TEST(MessageTest, StreamsNullPointer) {
- int* p = NULL;
- EXPECT_STREQ("(null)", ToCString(Message() << p));
-}
-
-// Tests streaming a C string.
-TEST(MessageTest, StreamsCString) {
- EXPECT_STREQ("Foo", ToCString(Message() << "Foo"));
-}
-
-// Tests streaming a NULL C string.
-TEST(MessageTest, StreamsNullCString) {
- char* p = NULL;
- EXPECT_STREQ("(null)", ToCString(Message() << p));
-}
-
-// Tests streaming std::string.
-TEST(MessageTest, StreamsString) {
- const ::std::string str("Hello");
- EXPECT_STREQ("Hello", ToCString(Message() << str));
-}
-
-// Tests that we can output strings containing embedded NULs.
-TEST(MessageTest, StreamsStringWithEmbeddedNUL) {
- const char char_array_with_nul[] =
- "Here's a NUL\0 and some more string";
- const ::std::string string_with_nul(char_array_with_nul,
- sizeof(char_array_with_nul) - 1);
- EXPECT_STREQ("Here's a NUL\\0 and some more string",
- ToCString(Message() << string_with_nul));
-}
-
-// Tests streaming a NUL char.
-TEST(MessageTest, StreamsNULChar) {
- EXPECT_STREQ("\\0", ToCString(Message() << '\0'));
-}
-
-// Tests streaming int.
-TEST(MessageTest, StreamsInt) {
- EXPECT_STREQ("123", ToCString(Message() << 123));
-}
-
-// Tests that basic IO manipulators (endl, ends, and flush) can be
-// streamed to Message.
-TEST(MessageTest, StreamsBasicIoManip) {
- EXPECT_STREQ("Line 1.\nA NUL char \\0 in line 2.",
- ToCString(Message() << "Line 1." << std::endl
- << "A NUL char " << std::ends << std::flush
- << " in line 2."));
-}
-
-// Tests Message::GetString()
-TEST(MessageTest, GetString) {
- Message msg;
- msg << 1 << " lamb";
- EXPECT_STREQ("1 lamb", msg.GetString().c_str());
-}
-
-// Tests streaming a Message object to an ostream.
-TEST(MessageTest, StreamsToOStream) {
- Message msg("Hello");
- ::std::stringstream ss;
- ss << msg;
- EXPECT_STREQ("Hello", testing::internal::StringStreamToString(&ss).c_str());
-}
-
-// Tests that a Message object doesn't take up too much stack space.
-TEST(MessageTest, DoesNotTakeUpMuchStackSpace) {
- EXPECT_LE(sizeof(Message), 16U);
-}
-
-} // namespace
diff --git a/src/testing/gtest/test/gtest-options_test.cc b/src/testing/gtest/test/gtest-options_test.cc
deleted file mode 100644
index 9e98f3f0..00000000
--- a/src/testing/gtest/test/gtest-options_test.cc
+++ /dev/null
@@ -1,212 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Authors: keith.ray@gmail.com (Keith Ray)
-//
-// Google Test UnitTestOptions tests
-//
-// This file tests classes and functions used internally by
-// Google Test. They are subject to change without notice.
-//
-// This file is #included from gtest.cc, to avoid changing build or
-// make-files on Windows and other platforms. Do not #include this file
-// anywhere else!
-
-#include "gtest/gtest.h"
-
-#if GTEST_OS_WINDOWS_MOBILE
-# include <windows.h>
-#elif GTEST_OS_WINDOWS
-# include <direct.h>
-#endif // GTEST_OS_WINDOWS_MOBILE
-
-// Indicates that this translation unit is part of Google Test's
-// implementation. It must come before gtest-internal-inl.h is
-// included, or there will be a compiler error. This trick is to
-// prevent a user from accidentally including gtest-internal-inl.h in
-// his code.
-#define GTEST_IMPLEMENTATION_ 1
-#include "src/gtest-internal-inl.h"
-#undef GTEST_IMPLEMENTATION_
-
-namespace testing {
-namespace internal {
-namespace {
-
-// Turns the given relative path into an absolute path.
-FilePath GetAbsolutePathOf(const FilePath& relative_path) {
- return FilePath::ConcatPaths(FilePath::GetCurrentDir(), relative_path);
-}
-
-// Testing UnitTestOptions::GetOutputFormat/GetOutputFile.
-
-TEST(XmlOutputTest, GetOutputFormatDefault) {
- GTEST_FLAG(output) = "";
- EXPECT_STREQ("", UnitTestOptions::GetOutputFormat().c_str());
-}
-
-TEST(XmlOutputTest, GetOutputFormat) {
- GTEST_FLAG(output) = "xml:filename";
- EXPECT_STREQ("xml", UnitTestOptions::GetOutputFormat().c_str());
-}
-
-TEST(XmlOutputTest, GetOutputFileDefault) {
- GTEST_FLAG(output) = "";
- EXPECT_STREQ(GetAbsolutePathOf(FilePath("test_detail.xml")).c_str(),
- UnitTestOptions::GetAbsolutePathToOutputFile().c_str());
-}
-
-TEST(XmlOutputTest, GetOutputFileSingleFile) {
- GTEST_FLAG(output) = "xml:filename.abc";
- EXPECT_STREQ(GetAbsolutePathOf(FilePath("filename.abc")).c_str(),
- UnitTestOptions::GetAbsolutePathToOutputFile().c_str());
-}
-
-TEST(XmlOutputTest, GetOutputFileFromDirectoryPath) {
- GTEST_FLAG(output) = "xml:path" GTEST_PATH_SEP_;
- const std::string expected_output_file =
- GetAbsolutePathOf(
- FilePath(std::string("path") + GTEST_PATH_SEP_ +
- GetCurrentExecutableName().c_str() + ".xml")).c_str();
- const String& output_file = UnitTestOptions::GetAbsolutePathToOutputFile();
-#if GTEST_OS_WINDOWS
- EXPECT_STRCASEEQ(expected_output_file.c_str(), output_file.c_str());
-#else
- EXPECT_EQ(expected_output_file, output_file.c_str());
-#endif
-}
-
-TEST(OutputFileHelpersTest, GetCurrentExecutableName) {
- const std::string exe_str = GetCurrentExecutableName().c_str();
-#if GTEST_OS_WINDOWS
- const bool success =
- _strcmpi("gtest-options_test", exe_str.c_str()) == 0 ||
- _strcmpi("gtest-options-ex_test", exe_str.c_str()) == 0 ||
- _strcmpi("gtest_all_test", exe_str.c_str()) == 0 ||
- _strcmpi("gtest_dll_test", exe_str.c_str()) == 0;
-#else
- // TODO(wan@google.com): remove the hard-coded "lt-" prefix when
- // Chandler Carruth's libtool replacement is ready.
- const bool success =
- exe_str == "gtest-options_test" ||
- exe_str == "gtest_all_test" ||
- exe_str == "lt-gtest_all_test" ||
- exe_str == "gtest_dll_test";
-#endif // GTEST_OS_WINDOWS
- if (!success)
- FAIL() << "GetCurrentExecutableName() returns " << exe_str;
-}
-
-class XmlOutputChangeDirTest : public Test {
- protected:
- virtual void SetUp() {
- original_working_dir_ = FilePath::GetCurrentDir();
- posix::ChDir("..");
- // This will make the test fail if run from the root directory.
- EXPECT_STRNE(original_working_dir_.c_str(),
- FilePath::GetCurrentDir().c_str());
- }
-
- virtual void TearDown() {
- posix::ChDir(original_working_dir_.c_str());
- }
-
- FilePath original_working_dir_;
-};
-
-TEST_F(XmlOutputChangeDirTest, PreserveOriginalWorkingDirWithDefault) {
- GTEST_FLAG(output) = "";
- EXPECT_STREQ(FilePath::ConcatPaths(original_working_dir_,
- FilePath("test_detail.xml")).c_str(),
- UnitTestOptions::GetAbsolutePathToOutputFile().c_str());
-}
-
-TEST_F(XmlOutputChangeDirTest, PreserveOriginalWorkingDirWithDefaultXML) {
- GTEST_FLAG(output) = "xml";
- EXPECT_STREQ(FilePath::ConcatPaths(original_working_dir_,
- FilePath("test_detail.xml")).c_str(),
- UnitTestOptions::GetAbsolutePathToOutputFile().c_str());
-}
-
-TEST_F(XmlOutputChangeDirTest, PreserveOriginalWorkingDirWithRelativeFile) {
- GTEST_FLAG(output) = "xml:filename.abc";
- EXPECT_STREQ(FilePath::ConcatPaths(original_working_dir_,
- FilePath("filename.abc")).c_str(),
- UnitTestOptions::GetAbsolutePathToOutputFile().c_str());
-}
-
-TEST_F(XmlOutputChangeDirTest, PreserveOriginalWorkingDirWithRelativePath) {
- GTEST_FLAG(output) = "xml:path" GTEST_PATH_SEP_;
- const std::string expected_output_file =
- FilePath::ConcatPaths(
- original_working_dir_,
- FilePath(std::string("path") + GTEST_PATH_SEP_ +
- GetCurrentExecutableName().c_str() + ".xml")).c_str();
- const String& output_file = UnitTestOptions::GetAbsolutePathToOutputFile();
-#if GTEST_OS_WINDOWS
- EXPECT_STRCASEEQ(expected_output_file.c_str(), output_file.c_str());
-#else
- EXPECT_EQ(expected_output_file, output_file.c_str());
-#endif
-}
-
-TEST_F(XmlOutputChangeDirTest, PreserveOriginalWorkingDirWithAbsoluteFile) {
-#if GTEST_OS_WINDOWS
- GTEST_FLAG(output) = "xml:c:\\tmp\\filename.abc";
- EXPECT_STREQ(FilePath("c:\\tmp\\filename.abc").c_str(),
- UnitTestOptions::GetAbsolutePathToOutputFile().c_str());
-#else
- GTEST_FLAG(output) ="xml:/tmp/filename.abc";
- EXPECT_STREQ(FilePath("/tmp/filename.abc").c_str(),
- UnitTestOptions::GetAbsolutePathToOutputFile().c_str());
-#endif
-}
-
-TEST_F(XmlOutputChangeDirTest, PreserveOriginalWorkingDirWithAbsolutePath) {
-#if GTEST_OS_WINDOWS
- const std::string path = "c:\\tmp\\";
-#else
- const std::string path = "/tmp/";
-#endif
-
- GTEST_FLAG(output) = "xml:" + path;
- const std::string expected_output_file =
- path + GetCurrentExecutableName().c_str() + ".xml";
- const String& output_file = UnitTestOptions::GetAbsolutePathToOutputFile();
-
-#if GTEST_OS_WINDOWS
- EXPECT_STRCASEEQ(expected_output_file.c_str(), output_file.c_str());
-#else
- EXPECT_EQ(expected_output_file, output_file.c_str());
-#endif
-}
-
-} // namespace
-} // namespace internal
-} // namespace testing
diff --git a/src/testing/gtest/test/gtest-param-test2_test.cc b/src/testing/gtest/test/gtest-param-test2_test.cc
deleted file mode 100644
index 4a782fe7..00000000
--- a/src/testing/gtest/test/gtest-param-test2_test.cc
+++ /dev/null
@@ -1,65 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: vladl@google.com (Vlad Losev)
-//
-// Tests for Google Test itself. This verifies that the basic constructs of
-// Google Test work.
-
-#include "gtest/gtest.h"
-
-#include "test/gtest-param-test_test.h"
-
-#if GTEST_HAS_PARAM_TEST
-
-using ::testing::Values;
-using ::testing::internal::ParamGenerator;
-
-// Tests that generators defined in a different translation unit
-// are functional. The test using extern_gen is defined
-// in gtest-param-test_test.cc.
-ParamGenerator<int> extern_gen = Values(33);
-
-// Tests that a parameterized test case can be defined in one translation unit
-// and instantiated in another. The test is defined in gtest-param-test_test.cc
-// and ExternalInstantiationTest fixture class is defined in
-// gtest-param-test_test.h.
-INSTANTIATE_TEST_CASE_P(MultiplesOf33,
- ExternalInstantiationTest,
- Values(33, 66));
-
-// Tests that a parameterized test case can be instantiated
-// in multiple translation units. Another instantiation is defined
-// in gtest-param-test_test.cc and InstantiationInMultipleTranslaionUnitsTest
-// fixture is defined in gtest-param-test_test.h
-INSTANTIATE_TEST_CASE_P(Sequence2,
- InstantiationInMultipleTranslaionUnitsTest,
- Values(42*3, 42*4, 42*5));
-
-#endif // GTEST_HAS_PARAM_TEST
diff --git a/src/testing/gtest/test/gtest-param-test_test.cc b/src/testing/gtest/test/gtest-param-test_test.cc
deleted file mode 100644
index cf618665..00000000
--- a/src/testing/gtest/test/gtest-param-test_test.cc
+++ /dev/null
@@ -1,897 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: vladl@google.com (Vlad Losev)
-//
-// Tests for Google Test itself. This file verifies that the parameter
-// generators objects produce correct parameter sequences and that
-// Google Test runtime instantiates correct tests from those sequences.
-
-#include "gtest/gtest.h"
-
-#if GTEST_HAS_PARAM_TEST
-
-# include <algorithm>
-# include <iostream>
-# include <list>
-# include <sstream>
-# include <string>
-# include <vector>
-
-// To include gtest-internal-inl.h.
-# define GTEST_IMPLEMENTATION_ 1
-# include "src/gtest-internal-inl.h" // for UnitTestOptions
-# undef GTEST_IMPLEMENTATION_
-
-# include "test/gtest-param-test_test.h"
-
-using ::std::vector;
-using ::std::sort;
-
-using ::testing::AddGlobalTestEnvironment;
-using ::testing::Bool;
-using ::testing::Message;
-using ::testing::Range;
-using ::testing::TestWithParam;
-using ::testing::Values;
-using ::testing::ValuesIn;
-
-# if GTEST_HAS_COMBINE
-using ::testing::Combine;
-using ::std::tr1::get;
-using ::std::tr1::make_tuple;
-using ::std::tr1::tuple;
-# endif // GTEST_HAS_COMBINE
-
-using ::testing::internal::ParamGenerator;
-using ::testing::internal::UnitTestOptions;
-
-// Prints a value to a string.
-//
-// TODO(wan@google.com): remove PrintValue() when we move matchers and
-// EXPECT_THAT() from Google Mock to Google Test. At that time, we
-// can write EXPECT_THAT(x, Eq(y)) to compare two tuples x and y, as
-// EXPECT_THAT() and the matchers know how to print tuples.
-template <typename T>
-::std::string PrintValue(const T& value) {
- ::std::stringstream stream;
- stream << value;
- return stream.str();
-}
-
-# if GTEST_HAS_COMBINE
-
-// These overloads allow printing tuples in our tests. We cannot
-// define an operator<< for tuples, as that definition needs to be in
-// the std namespace in order to be picked up by Google Test via
-// Argument-Dependent Lookup, yet defining anything in the std
-// namespace in non-STL code is undefined behavior.
-
-template <typename T1, typename T2>
-::std::string PrintValue(const tuple<T1, T2>& value) {
- ::std::stringstream stream;
- stream << "(" << get<0>(value) << ", " << get<1>(value) << ")";
- return stream.str();
-}
-
-template <typename T1, typename T2, typename T3>
-::std::string PrintValue(const tuple<T1, T2, T3>& value) {
- ::std::stringstream stream;
- stream << "(" << get<0>(value) << ", " << get<1>(value)
- << ", "<< get<2>(value) << ")";
- return stream.str();
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10>
-::std::string PrintValue(
- const tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>& value) {
- ::std::stringstream stream;
- stream << "(" << get<0>(value) << ", " << get<1>(value)
- << ", "<< get<2>(value) << ", " << get<3>(value)
- << ", "<< get<4>(value) << ", " << get<5>(value)
- << ", "<< get<6>(value) << ", " << get<7>(value)
- << ", "<< get<8>(value) << ", " << get<9>(value) << ")";
- return stream.str();
-}
-
-# endif // GTEST_HAS_COMBINE
-
-// Verifies that a sequence generated by the generator and accessed
-// via the iterator object matches the expected one using Google Test
-// assertions.
-template <typename T, size_t N>
-void VerifyGenerator(const ParamGenerator<T>& generator,
- const T (&expected_values)[N]) {
- typename ParamGenerator<T>::iterator it = generator.begin();
- for (size_t i = 0; i < N; ++i) {
- ASSERT_FALSE(it == generator.end())
- << "At element " << i << " when accessing via an iterator "
- << "created with the copy constructor.\n";
- // We cannot use EXPECT_EQ() here as the values may be tuples,
- // which don't support <<.
- EXPECT_TRUE(expected_values[i] == *it)
- << "where i is " << i
- << ", expected_values[i] is " << PrintValue(expected_values[i])
- << ", *it is " << PrintValue(*it)
- << ", and 'it' is an iterator created with the copy constructor.\n";
- it++;
- }
- EXPECT_TRUE(it == generator.end())
- << "At the presumed end of sequence when accessing via an iterator "
- << "created with the copy constructor.\n";
-
- // Test the iterator assignment. The following lines verify that
- // the sequence accessed via an iterator initialized via the
- // assignment operator (as opposed to a copy constructor) matches
- // just the same.
- it = generator.begin();
- for (size_t i = 0; i < N; ++i) {
- ASSERT_FALSE(it == generator.end())
- << "At element " << i << " when accessing via an iterator "
- << "created with the assignment operator.\n";
- EXPECT_TRUE(expected_values[i] == *it)
- << "where i is " << i
- << ", expected_values[i] is " << PrintValue(expected_values[i])
- << ", *it is " << PrintValue(*it)
- << ", and 'it' is an iterator created with the copy constructor.\n";
- it++;
- }
- EXPECT_TRUE(it == generator.end())
- << "At the presumed end of sequence when accessing via an iterator "
- << "created with the assignment operator.\n";
-}
-
-template <typename T>
-void VerifyGeneratorIsEmpty(const ParamGenerator<T>& generator) {
- typename ParamGenerator<T>::iterator it = generator.begin();
- EXPECT_TRUE(it == generator.end());
-
- it = generator.begin();
- EXPECT_TRUE(it == generator.end());
-}
-
-// Generator tests. They test that each of the provided generator functions
-// generates an expected sequence of values. The general test pattern
-// instantiates a generator using one of the generator functions,
-// checks the sequence produced by the generator using its iterator API,
-// and then resets the iterator back to the beginning of the sequence
-// and checks the sequence again.
-
-// Tests that iterators produced by generator functions conform to the
-// ForwardIterator concept.
-TEST(IteratorTest, ParamIteratorConformsToForwardIteratorConcept) {
- const ParamGenerator<int> gen = Range(0, 10);
- ParamGenerator<int>::iterator it = gen.begin();
-
- // Verifies that iterator initialization works as expected.
- ParamGenerator<int>::iterator it2 = it;
- EXPECT_TRUE(*it == *it2) << "Initialized iterators must point to the "
- << "element same as its source points to";
-
- // Verifies that iterator assignment works as expected.
- it++;
- EXPECT_FALSE(*it == *it2);
- it2 = it;
- EXPECT_TRUE(*it == *it2) << "Assigned iterators must point to the "
- << "element same as its source points to";
-
- // Verifies that prefix operator++() returns *this.
- EXPECT_EQ(&it, &(++it)) << "Result of the prefix operator++ must be "
- << "refer to the original object";
-
- // Verifies that the result of the postfix operator++ points to the value
- // pointed to by the original iterator.
- int original_value = *it; // Have to compute it outside of macro call to be
- // unaffected by the parameter evaluation order.
- EXPECT_EQ(original_value, *(it++));
-
- // Verifies that prefix and postfix operator++() advance an iterator
- // all the same.
- it2 = it;
- it++;
- ++it2;
- EXPECT_TRUE(*it == *it2);
-}
-
-// Tests that Range() generates the expected sequence.
-TEST(RangeTest, IntRangeWithDefaultStep) {
- const ParamGenerator<int> gen = Range(0, 3);
- const int expected_values[] = {0, 1, 2};
- VerifyGenerator(gen, expected_values);
-}
-
-// Edge case. Tests that Range() generates the single element sequence
-// as expected when provided with range limits that are equal.
-TEST(RangeTest, IntRangeSingleValue) {
- const ParamGenerator<int> gen = Range(0, 1);
- const int expected_values[] = {0};
- VerifyGenerator(gen, expected_values);
-}
-
-// Edge case. Tests that Range() with generates empty sequence when
-// supplied with an empty range.
-TEST(RangeTest, IntRangeEmpty) {
- const ParamGenerator<int> gen = Range(0, 0);
- VerifyGeneratorIsEmpty(gen);
-}
-
-// Tests that Range() with custom step (greater then one) generates
-// the expected sequence.
-TEST(RangeTest, IntRangeWithCustomStep) {
- const ParamGenerator<int> gen = Range(0, 9, 3);
- const int expected_values[] = {0, 3, 6};
- VerifyGenerator(gen, expected_values);
-}
-
-// Tests that Range() with custom step (greater then one) generates
-// the expected sequence when the last element does not fall on the
-// upper range limit. Sequences generated by Range() must not have
-// elements beyond the range limits.
-TEST(RangeTest, IntRangeWithCustomStepOverUpperBound) {
- const ParamGenerator<int> gen = Range(0, 4, 3);
- const int expected_values[] = {0, 3};
- VerifyGenerator(gen, expected_values);
-}
-
-// Verifies that Range works with user-defined types that define
-// copy constructor, operator=(), operator+(), and operator<().
-class DogAdder {
- public:
- explicit DogAdder(const char* a_value) : value_(a_value) {}
- DogAdder(const DogAdder& other) : value_(other.value_.c_str()) {}
-
- DogAdder operator=(const DogAdder& other) {
- if (this != &other)
- value_ = other.value_;
- return *this;
- }
- DogAdder operator+(const DogAdder& other) const {
- Message msg;
- msg << value_.c_str() << other.value_.c_str();
- return DogAdder(msg.GetString().c_str());
- }
- bool operator<(const DogAdder& other) const {
- return value_ < other.value_;
- }
- const ::testing::internal::String& value() const { return value_; }
-
- private:
- ::testing::internal::String value_;
-};
-
-TEST(RangeTest, WorksWithACustomType) {
- const ParamGenerator<DogAdder> gen =
- Range(DogAdder("cat"), DogAdder("catdogdog"), DogAdder("dog"));
- ParamGenerator<DogAdder>::iterator it = gen.begin();
-
- ASSERT_FALSE(it == gen.end());
- EXPECT_STREQ("cat", it->value().c_str());
-
- ASSERT_FALSE(++it == gen.end());
- EXPECT_STREQ("catdog", it->value().c_str());
-
- EXPECT_TRUE(++it == gen.end());
-}
-
-class IntWrapper {
- public:
- explicit IntWrapper(int a_value) : value_(a_value) {}
- IntWrapper(const IntWrapper& other) : value_(other.value_) {}
-
- IntWrapper operator=(const IntWrapper& other) {
- value_ = other.value_;
- return *this;
- }
- // operator+() adds a different type.
- IntWrapper operator+(int other) const { return IntWrapper(value_ + other); }
- bool operator<(const IntWrapper& other) const {
- return value_ < other.value_;
- }
- int value() const { return value_; }
-
- private:
- int value_;
-};
-
-TEST(RangeTest, WorksWithACustomTypeWithDifferentIncrementType) {
- const ParamGenerator<IntWrapper> gen = Range(IntWrapper(0), IntWrapper(2));
- ParamGenerator<IntWrapper>::iterator it = gen.begin();
-
- ASSERT_FALSE(it == gen.end());
- EXPECT_EQ(0, it->value());
-
- ASSERT_FALSE(++it == gen.end());
- EXPECT_EQ(1, it->value());
-
- EXPECT_TRUE(++it == gen.end());
-}
-
-// Tests that ValuesIn() with an array parameter generates
-// the expected sequence.
-TEST(ValuesInTest, ValuesInArray) {
- int array[] = {3, 5, 8};
- const ParamGenerator<int> gen = ValuesIn(array);
- VerifyGenerator(gen, array);
-}
-
-// Tests that ValuesIn() with a const array parameter generates
-// the expected sequence.
-TEST(ValuesInTest, ValuesInConstArray) {
- const int array[] = {3, 5, 8};
- const ParamGenerator<int> gen = ValuesIn(array);
- VerifyGenerator(gen, array);
-}
-
-// Edge case. Tests that ValuesIn() with an array parameter containing a
-// single element generates the single element sequence.
-TEST(ValuesInTest, ValuesInSingleElementArray) {
- int array[] = {42};
- const ParamGenerator<int> gen = ValuesIn(array);
- VerifyGenerator(gen, array);
-}
-
-// Tests that ValuesIn() generates the expected sequence for an STL
-// container (vector).
-TEST(ValuesInTest, ValuesInVector) {
- typedef ::std::vector<int> ContainerType;
- ContainerType values;
- values.push_back(3);
- values.push_back(5);
- values.push_back(8);
- const ParamGenerator<int> gen = ValuesIn(values);
-
- const int expected_values[] = {3, 5, 8};
- VerifyGenerator(gen, expected_values);
-}
-
-// Tests that ValuesIn() generates the expected sequence.
-TEST(ValuesInTest, ValuesInIteratorRange) {
- typedef ::std::vector<int> ContainerType;
- ContainerType values;
- values.push_back(3);
- values.push_back(5);
- values.push_back(8);
- const ParamGenerator<int> gen = ValuesIn(values.begin(), values.end());
-
- const int expected_values[] = {3, 5, 8};
- VerifyGenerator(gen, expected_values);
-}
-
-// Edge case. Tests that ValuesIn() provided with an iterator range specifying a
-// single value generates a single-element sequence.
-TEST(ValuesInTest, ValuesInSingleElementIteratorRange) {
- typedef ::std::vector<int> ContainerType;
- ContainerType values;
- values.push_back(42);
- const ParamGenerator<int> gen = ValuesIn(values.begin(), values.end());
-
- const int expected_values[] = {42};
- VerifyGenerator(gen, expected_values);
-}
-
-// Edge case. Tests that ValuesIn() provided with an empty iterator range
-// generates an empty sequence.
-TEST(ValuesInTest, ValuesInEmptyIteratorRange) {
- typedef ::std::vector<int> ContainerType;
- ContainerType values;
- const ParamGenerator<int> gen = ValuesIn(values.begin(), values.end());
-
- VerifyGeneratorIsEmpty(gen);
-}
-
-// Tests that the Values() generates the expected sequence.
-TEST(ValuesTest, ValuesWorks) {
- const ParamGenerator<int> gen = Values(3, 5, 8);
-
- const int expected_values[] = {3, 5, 8};
- VerifyGenerator(gen, expected_values);
-}
-
-// Tests that Values() generates the expected sequences from elements of
-// different types convertible to ParamGenerator's parameter type.
-TEST(ValuesTest, ValuesWorksForValuesOfCompatibleTypes) {
- const ParamGenerator<double> gen = Values(3, 5.0f, 8.0);
-
- const double expected_values[] = {3.0, 5.0, 8.0};
- VerifyGenerator(gen, expected_values);
-}
-
-TEST(ValuesTest, ValuesWorksForMaxLengthList) {
- const ParamGenerator<int> gen = Values(
- 10, 20, 30, 40, 50, 60, 70, 80, 90, 100,
- 110, 120, 130, 140, 150, 160, 170, 180, 190, 200,
- 210, 220, 230, 240, 250, 260, 270, 280, 290, 300,
- 310, 320, 330, 340, 350, 360, 370, 380, 390, 400,
- 410, 420, 430, 440, 450, 460, 470, 480, 490, 500);
-
- const int expected_values[] = {
- 10, 20, 30, 40, 50, 60, 70, 80, 90, 100,
- 110, 120, 130, 140, 150, 160, 170, 180, 190, 200,
- 210, 220, 230, 240, 250, 260, 270, 280, 290, 300,
- 310, 320, 330, 340, 350, 360, 370, 380, 390, 400,
- 410, 420, 430, 440, 450, 460, 470, 480, 490, 500};
- VerifyGenerator(gen, expected_values);
-}
-
-// Edge case test. Tests that single-parameter Values() generates the sequence
-// with the single value.
-TEST(ValuesTest, ValuesWithSingleParameter) {
- const ParamGenerator<int> gen = Values(42);
-
- const int expected_values[] = {42};
- VerifyGenerator(gen, expected_values);
-}
-
-// Tests that Bool() generates sequence (false, true).
-TEST(BoolTest, BoolWorks) {
- const ParamGenerator<bool> gen = Bool();
-
- const bool expected_values[] = {false, true};
- VerifyGenerator(gen, expected_values);
-}
-
-# if GTEST_HAS_COMBINE
-
-// Tests that Combine() with two parameters generates the expected sequence.
-TEST(CombineTest, CombineWithTwoParameters) {
- const char* foo = "foo";
- const char* bar = "bar";
- const ParamGenerator<tuple<const char*, int> > gen =
- Combine(Values(foo, bar), Values(3, 4));
-
- tuple<const char*, int> expected_values[] = {
- make_tuple(foo, 3), make_tuple(foo, 4),
- make_tuple(bar, 3), make_tuple(bar, 4)};
- VerifyGenerator(gen, expected_values);
-}
-
-// Tests that Combine() with three parameters generates the expected sequence.
-TEST(CombineTest, CombineWithThreeParameters) {
- const ParamGenerator<tuple<int, int, int> > gen = Combine(Values(0, 1),
- Values(3, 4),
- Values(5, 6));
- tuple<int, int, int> expected_values[] = {
- make_tuple(0, 3, 5), make_tuple(0, 3, 6),
- make_tuple(0, 4, 5), make_tuple(0, 4, 6),
- make_tuple(1, 3, 5), make_tuple(1, 3, 6),
- make_tuple(1, 4, 5), make_tuple(1, 4, 6)};
- VerifyGenerator(gen, expected_values);
-}
-
-// Tests that the Combine() with the first parameter generating a single value
-// sequence generates a sequence with the number of elements equal to the
-// number of elements in the sequence generated by the second parameter.
-TEST(CombineTest, CombineWithFirstParameterSingleValue) {
- const ParamGenerator<tuple<int, int> > gen = Combine(Values(42),
- Values(0, 1));
-
- tuple<int, int> expected_values[] = {make_tuple(42, 0), make_tuple(42, 1)};
- VerifyGenerator(gen, expected_values);
-}
-
-// Tests that the Combine() with the second parameter generating a single value
-// sequence generates a sequence with the number of elements equal to the
-// number of elements in the sequence generated by the first parameter.
-TEST(CombineTest, CombineWithSecondParameterSingleValue) {
- const ParamGenerator<tuple<int, int> > gen = Combine(Values(0, 1),
- Values(42));
-
- tuple<int, int> expected_values[] = {make_tuple(0, 42), make_tuple(1, 42)};
- VerifyGenerator(gen, expected_values);
-}
-
-// Tests that when the first parameter produces an empty sequence,
-// Combine() produces an empty sequence, too.
-TEST(CombineTest, CombineWithFirstParameterEmptyRange) {
- const ParamGenerator<tuple<int, int> > gen = Combine(Range(0, 0),
- Values(0, 1));
- VerifyGeneratorIsEmpty(gen);
-}
-
-// Tests that when the second parameter produces an empty sequence,
-// Combine() produces an empty sequence, too.
-TEST(CombineTest, CombineWithSecondParameterEmptyRange) {
- const ParamGenerator<tuple<int, int> > gen = Combine(Values(0, 1),
- Range(1, 1));
- VerifyGeneratorIsEmpty(gen);
-}
-
-// Edge case. Tests that combine works with the maximum number
-// of parameters supported by Google Test (currently 10).
-TEST(CombineTest, CombineWithMaxNumberOfParameters) {
- const char* foo = "foo";
- const char* bar = "bar";
- const ParamGenerator<tuple<const char*, int, int, int, int, int, int, int,
- int, int> > gen = Combine(Values(foo, bar),
- Values(1), Values(2),
- Values(3), Values(4),
- Values(5), Values(6),
- Values(7), Values(8),
- Values(9));
-
- tuple<const char*, int, int, int, int, int, int, int, int, int>
- expected_values[] = {make_tuple(foo, 1, 2, 3, 4, 5, 6, 7, 8, 9),
- make_tuple(bar, 1, 2, 3, 4, 5, 6, 7, 8, 9)};
- VerifyGenerator(gen, expected_values);
-}
-
-# endif // GTEST_HAS_COMBINE
-
-// Tests that an generator produces correct sequence after being
-// assigned from another generator.
-TEST(ParamGeneratorTest, AssignmentWorks) {
- ParamGenerator<int> gen = Values(1, 2);
- const ParamGenerator<int> gen2 = Values(3, 4);
- gen = gen2;
-
- const int expected_values[] = {3, 4};
- VerifyGenerator(gen, expected_values);
-}
-
-// This test verifies that the tests are expanded and run as specified:
-// one test per element from the sequence produced by the generator
-// specified in INSTANTIATE_TEST_CASE_P. It also verifies that the test's
-// fixture constructor, SetUp(), and TearDown() have run and have been
-// supplied with the correct parameters.
-
-// The use of environment object allows detection of the case where no test
-// case functionality is run at all. In this case TestCaseTearDown will not
-// be able to detect missing tests, naturally.
-template <int kExpectedCalls>
-class TestGenerationEnvironment : public ::testing::Environment {
- public:
- static TestGenerationEnvironment* Instance() {
- static TestGenerationEnvironment* instance = new TestGenerationEnvironment;
- return instance;
- }
-
- void FixtureConstructorExecuted() { fixture_constructor_count_++; }
- void SetUpExecuted() { set_up_count_++; }
- void TearDownExecuted() { tear_down_count_++; }
- void TestBodyExecuted() { test_body_count_++; }
-
- virtual void TearDown() {
- // If all MultipleTestGenerationTest tests have been de-selected
- // by the filter flag, the following checks make no sense.
- bool perform_check = false;
-
- for (int i = 0; i < kExpectedCalls; ++i) {
- Message msg;
- msg << "TestsExpandedAndRun/" << i;
- if (UnitTestOptions::FilterMatchesTest(
- "TestExpansionModule/MultipleTestGenerationTest",
- msg.GetString().c_str())) {
- perform_check = true;
- }
- }
- if (perform_check) {
- EXPECT_EQ(kExpectedCalls, fixture_constructor_count_)
- << "Fixture constructor of ParamTestGenerationTest test case "
- << "has not been run as expected.";
- EXPECT_EQ(kExpectedCalls, set_up_count_)
- << "Fixture SetUp method of ParamTestGenerationTest test case "
- << "has not been run as expected.";
- EXPECT_EQ(kExpectedCalls, tear_down_count_)
- << "Fixture TearDown method of ParamTestGenerationTest test case "
- << "has not been run as expected.";
- EXPECT_EQ(kExpectedCalls, test_body_count_)
- << "Test in ParamTestGenerationTest test case "
- << "has not been run as expected.";
- }
- }
-
- private:
- TestGenerationEnvironment() : fixture_constructor_count_(0), set_up_count_(0),
- tear_down_count_(0), test_body_count_(0) {}
-
- int fixture_constructor_count_;
- int set_up_count_;
- int tear_down_count_;
- int test_body_count_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(TestGenerationEnvironment);
-};
-
-const int test_generation_params[] = {36, 42, 72};
-
-class TestGenerationTest : public TestWithParam<int> {
- public:
- enum {
- PARAMETER_COUNT =
- sizeof(test_generation_params)/sizeof(test_generation_params[0])
- };
-
- typedef TestGenerationEnvironment<PARAMETER_COUNT> Environment;
-
- TestGenerationTest() {
- Environment::Instance()->FixtureConstructorExecuted();
- current_parameter_ = GetParam();
- }
- virtual void SetUp() {
- Environment::Instance()->SetUpExecuted();
- EXPECT_EQ(current_parameter_, GetParam());
- }
- virtual void TearDown() {
- Environment::Instance()->TearDownExecuted();
- EXPECT_EQ(current_parameter_, GetParam());
- }
-
- static void SetUpTestCase() {
- bool all_tests_in_test_case_selected = true;
-
- for (int i = 0; i < PARAMETER_COUNT; ++i) {
- Message test_name;
- test_name << "TestsExpandedAndRun/" << i;
- if ( !UnitTestOptions::FilterMatchesTest(
- "TestExpansionModule/MultipleTestGenerationTest",
- test_name.GetString())) {
- all_tests_in_test_case_selected = false;
- }
- }
- EXPECT_TRUE(all_tests_in_test_case_selected)
- << "When running the TestGenerationTest test case all of its tests\n"
- << "must be selected by the filter flag for the test case to pass.\n"
- << "If not all of them are enabled, we can't reliably conclude\n"
- << "that the correct number of tests have been generated.";
-
- collected_parameters_.clear();
- }
-
- static void TearDownTestCase() {
- vector<int> expected_values(test_generation_params,
- test_generation_params + PARAMETER_COUNT);
- // Test execution order is not guaranteed by Google Test,
- // so the order of values in collected_parameters_ can be
- // different and we have to sort to compare.
- sort(expected_values.begin(), expected_values.end());
- sort(collected_parameters_.begin(), collected_parameters_.end());
-
- EXPECT_TRUE(collected_parameters_ == expected_values);
- }
-
- protected:
- int current_parameter_;
- static vector<int> collected_parameters_;
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(TestGenerationTest);
-};
-vector<int> TestGenerationTest::collected_parameters_;
-
-TEST_P(TestGenerationTest, TestsExpandedAndRun) {
- Environment::Instance()->TestBodyExecuted();
- EXPECT_EQ(current_parameter_, GetParam());
- collected_parameters_.push_back(GetParam());
-}
-INSTANTIATE_TEST_CASE_P(TestExpansionModule, TestGenerationTest,
- ValuesIn(test_generation_params));
-
-// This test verifies that the element sequence (third parameter of
-// INSTANTIATE_TEST_CASE_P) is evaluated in InitGoogleTest() and neither at
-// the call site of INSTANTIATE_TEST_CASE_P nor in RUN_ALL_TESTS(). For
-// that, we declare param_value_ to be a static member of
-// GeneratorEvaluationTest and initialize it to 0. We set it to 1 in
-// main(), just before invocation of InitGoogleTest(). After calling
-// InitGoogleTest(), we set the value to 2. If the sequence is evaluated
-// before or after InitGoogleTest, INSTANTIATE_TEST_CASE_P will create a
-// test with parameter other than 1, and the test body will fail the
-// assertion.
-class GeneratorEvaluationTest : public TestWithParam<int> {
- public:
- static int param_value() { return param_value_; }
- static void set_param_value(int param_value) { param_value_ = param_value; }
-
- private:
- static int param_value_;
-};
-int GeneratorEvaluationTest::param_value_ = 0;
-
-TEST_P(GeneratorEvaluationTest, GeneratorsEvaluatedInMain) {
- EXPECT_EQ(1, GetParam());
-}
-INSTANTIATE_TEST_CASE_P(GenEvalModule,
- GeneratorEvaluationTest,
- Values(GeneratorEvaluationTest::param_value()));
-
-// Tests that generators defined in a different translation unit are
-// functional. Generator extern_gen is defined in gtest-param-test_test2.cc.
-extern ParamGenerator<int> extern_gen;
-class ExternalGeneratorTest : public TestWithParam<int> {};
-TEST_P(ExternalGeneratorTest, ExternalGenerator) {
- // Sequence produced by extern_gen contains only a single value
- // which we verify here.
- EXPECT_EQ(GetParam(), 33);
-}
-INSTANTIATE_TEST_CASE_P(ExternalGeneratorModule,
- ExternalGeneratorTest,
- extern_gen);
-
-// Tests that a parameterized test case can be defined in one translation
-// unit and instantiated in another. This test will be instantiated in
-// gtest-param-test_test2.cc. ExternalInstantiationTest fixture class is
-// defined in gtest-param-test_test.h.
-TEST_P(ExternalInstantiationTest, IsMultipleOf33) {
- EXPECT_EQ(0, GetParam() % 33);
-}
-
-// Tests that a parameterized test case can be instantiated with multiple
-// generators.
-class MultipleInstantiationTest : public TestWithParam<int> {};
-TEST_P(MultipleInstantiationTest, AllowsMultipleInstances) {
-}
-INSTANTIATE_TEST_CASE_P(Sequence1, MultipleInstantiationTest, Values(1, 2));
-INSTANTIATE_TEST_CASE_P(Sequence2, MultipleInstantiationTest, Range(3, 5));
-
-// Tests that a parameterized test case can be instantiated
-// in multiple translation units. This test will be instantiated
-// here and in gtest-param-test_test2.cc.
-// InstantiationInMultipleTranslationUnitsTest fixture class
-// is defined in gtest-param-test_test.h.
-TEST_P(InstantiationInMultipleTranslaionUnitsTest, IsMultipleOf42) {
- EXPECT_EQ(0, GetParam() % 42);
-}
-INSTANTIATE_TEST_CASE_P(Sequence1,
- InstantiationInMultipleTranslaionUnitsTest,
- Values(42, 42*2));
-
-// Tests that each iteration of parameterized test runs in a separate test
-// object.
-class SeparateInstanceTest : public TestWithParam<int> {
- public:
- SeparateInstanceTest() : count_(0) {}
-
- static void TearDownTestCase() {
- EXPECT_GE(global_count_, 2)
- << "If some (but not all) SeparateInstanceTest tests have been "
- << "filtered out this test will fail. Make sure that all "
- << "GeneratorEvaluationTest are selected or de-selected together "
- << "by the test filter.";
- }
-
- protected:
- int count_;
- static int global_count_;
-};
-int SeparateInstanceTest::global_count_ = 0;
-
-TEST_P(SeparateInstanceTest, TestsRunInSeparateInstances) {
- EXPECT_EQ(0, count_++);
- global_count_++;
-}
-INSTANTIATE_TEST_CASE_P(FourElemSequence, SeparateInstanceTest, Range(1, 4));
-
-// Tests that all instantiations of a test have named appropriately. Test
-// defined with TEST_P(TestCaseName, TestName) and instantiated with
-// INSTANTIATE_TEST_CASE_P(SequenceName, TestCaseName, generator) must be named
-// SequenceName/TestCaseName.TestName/i, where i is the 0-based index of the
-// sequence element used to instantiate the test.
-class NamingTest : public TestWithParam<int> {};
-
-TEST_P(NamingTest, TestsReportCorrectNamesAndParameters) {
- const ::testing::TestInfo* const test_info =
- ::testing::UnitTest::GetInstance()->current_test_info();
-
- EXPECT_STREQ("ZeroToFiveSequence/NamingTest", test_info->test_case_name());
-
- Message index_stream;
- index_stream << "TestsReportCorrectNamesAndParameters/" << GetParam();
- EXPECT_STREQ(index_stream.GetString().c_str(), test_info->name());
-
- EXPECT_EQ(::testing::PrintToString(GetParam()), test_info->value_param());
-}
-
-INSTANTIATE_TEST_CASE_P(ZeroToFiveSequence, NamingTest, Range(0, 5));
-
-// Class that cannot be streamed into an ostream. It needs to be copyable
-// (and, in case of MSVC, also assignable) in order to be a test parameter
-// type. Its default copy constructor and assignment operator do exactly
-// what we need.
-class Unstreamable {
- public:
- explicit Unstreamable(int value) : value_(value) {}
-
- private:
- int value_;
-};
-
-class CommentTest : public TestWithParam<Unstreamable> {};
-
-TEST_P(CommentTest, TestsCorrectlyReportUnstreamableParams) {
- const ::testing::TestInfo* const test_info =
- ::testing::UnitTest::GetInstance()->current_test_info();
-
- EXPECT_EQ(::testing::PrintToString(GetParam()), test_info->value_param());
-}
-
-INSTANTIATE_TEST_CASE_P(InstantiationWithComments,
- CommentTest,
- Values(Unstreamable(1)));
-
-// Verify that we can create a hierarchy of test fixtures, where the base
-// class fixture is not parameterized and the derived class is. In this case
-// ParameterizedDerivedTest inherits from NonParameterizedBaseTest. We
-// perform simple tests on both.
-class NonParameterizedBaseTest : public ::testing::Test {
- public:
- NonParameterizedBaseTest() : n_(17) { }
- protected:
- int n_;
-};
-
-class ParameterizedDerivedTest : public NonParameterizedBaseTest,
- public ::testing::WithParamInterface<int> {
- protected:
- ParameterizedDerivedTest() : count_(0) { }
- int count_;
- static int global_count_;
-};
-
-int ParameterizedDerivedTest::global_count_ = 0;
-
-TEST_F(NonParameterizedBaseTest, FixtureIsInitialized) {
- EXPECT_EQ(17, n_);
-}
-
-TEST_P(ParameterizedDerivedTest, SeesSequence) {
- EXPECT_EQ(17, n_);
- EXPECT_EQ(0, count_++);
- EXPECT_EQ(GetParam(), global_count_++);
-}
-
-INSTANTIATE_TEST_CASE_P(RangeZeroToFive, ParameterizedDerivedTest, Range(0, 5));
-
-#endif // GTEST_HAS_PARAM_TEST
-
-TEST(CompileTest, CombineIsDefinedOnlyWhenGtestHasParamTestIsDefined) {
-#if GTEST_HAS_COMBINE && !GTEST_HAS_PARAM_TEST
- FAIL() << "GTEST_HAS_COMBINE is defined while GTEST_HAS_PARAM_TEST is not\n"
-#endif
-}
-
-int main(int argc, char **argv) {
-#if GTEST_HAS_PARAM_TEST
- // Used in TestGenerationTest test case.
- AddGlobalTestEnvironment(TestGenerationTest::Environment::Instance());
- // Used in GeneratorEvaluationTest test case. Tests that the updated value
- // will be picked up for instantiating tests in GeneratorEvaluationTest.
- GeneratorEvaluationTest::set_param_value(1);
-#endif // GTEST_HAS_PARAM_TEST
-
- ::testing::InitGoogleTest(&argc, argv);
-
-#if GTEST_HAS_PARAM_TEST
- // Used in GeneratorEvaluationTest test case. Tests that value updated
- // here will NOT be used for instantiating tests in
- // GeneratorEvaluationTest.
- GeneratorEvaluationTest::set_param_value(2);
-#endif // GTEST_HAS_PARAM_TEST
-
- return RUN_ALL_TESTS();
-}
diff --git a/src/testing/gtest/test/gtest-port_test.cc b/src/testing/gtest/test/gtest-port_test.cc
deleted file mode 100644
index 75471c39..00000000
--- a/src/testing/gtest/test/gtest-port_test.cc
+++ /dev/null
@@ -1,1214 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Authors: vladl@google.com (Vlad Losev), wan@google.com (Zhanyong Wan)
-//
-// This file tests the internal cross-platform support utilities.
-
-#include "gtest/internal/gtest-port.h"
-
-#include <stdio.h>
-
-#if GTEST_OS_MAC
-# include <time.h>
-#endif // GTEST_OS_MAC
-
-#include <list>
-#include <utility> // For std::pair and std::make_pair.
-#include <vector>
-
-#include "gtest/gtest.h"
-#include "gtest/gtest-spi.h"
-
-// Indicates that this translation unit is part of Google Test's
-// implementation. It must come before gtest-internal-inl.h is
-// included, or there will be a compiler error. This trick is to
-// prevent a user from accidentally including gtest-internal-inl.h in
-// his code.
-#define GTEST_IMPLEMENTATION_ 1
-#include "src/gtest-internal-inl.h"
-#undef GTEST_IMPLEMENTATION_
-
-using std::make_pair;
-using std::pair;
-
-namespace testing {
-namespace internal {
-
-class Base {
- public:
- // Copy constructor and assignment operator do exactly what we need, so we
- // use them.
- Base() : member_(0) {}
- explicit Base(int n) : member_(n) {}
- virtual ~Base() {}
- int member() { return member_; }
-
- private:
- int member_;
-};
-
-class Derived : public Base {
- public:
- explicit Derived(int n) : Base(n) {}
-};
-
-TEST(ImplicitCastTest, ConvertsPointers) {
- Derived derived(0);
- EXPECT_TRUE(&derived == ::testing::internal::ImplicitCast_<Base*>(&derived));
-}
-
-TEST(ImplicitCastTest, CanUseInheritance) {
- Derived derived(1);
- Base base = ::testing::internal::ImplicitCast_<Base>(derived);
- EXPECT_EQ(derived.member(), base.member());
-}
-
-class Castable {
- public:
- explicit Castable(bool* converted) : converted_(converted) {}
- operator Base() {
- *converted_ = true;
- return Base();
- }
-
- private:
- bool* converted_;
-};
-
-TEST(ImplicitCastTest, CanUseNonConstCastOperator) {
- bool converted = false;
- Castable castable(&converted);
- Base base = ::testing::internal::ImplicitCast_<Base>(castable);
- EXPECT_TRUE(converted);
-}
-
-class ConstCastable {
- public:
- explicit ConstCastable(bool* converted) : converted_(converted) {}
- operator Base() const {
- *converted_ = true;
- return Base();
- }
-
- private:
- bool* converted_;
-};
-
-TEST(ImplicitCastTest, CanUseConstCastOperatorOnConstValues) {
- bool converted = false;
- const ConstCastable const_castable(&converted);
- Base base = ::testing::internal::ImplicitCast_<Base>(const_castable);
- EXPECT_TRUE(converted);
-}
-
-class ConstAndNonConstCastable {
- public:
- ConstAndNonConstCastable(bool* converted, bool* const_converted)
- : converted_(converted), const_converted_(const_converted) {}
- operator Base() {
- *converted_ = true;
- return Base();
- }
- operator Base() const {
- *const_converted_ = true;
- return Base();
- }
-
- private:
- bool* converted_;
- bool* const_converted_;
-};
-
-TEST(ImplicitCastTest, CanSelectBetweenConstAndNonConstCasrAppropriately) {
- bool converted = false;
- bool const_converted = false;
- ConstAndNonConstCastable castable(&converted, &const_converted);
- Base base = ::testing::internal::ImplicitCast_<Base>(castable);
- EXPECT_TRUE(converted);
- EXPECT_FALSE(const_converted);
-
- converted = false;
- const_converted = false;
- const ConstAndNonConstCastable const_castable(&converted, &const_converted);
- base = ::testing::internal::ImplicitCast_<Base>(const_castable);
- EXPECT_FALSE(converted);
- EXPECT_TRUE(const_converted);
-}
-
-class To {
- public:
- To(bool* converted) { *converted = true; } // NOLINT
-};
-
-TEST(ImplicitCastTest, CanUseImplicitConstructor) {
- bool converted = false;
- To to = ::testing::internal::ImplicitCast_<To>(&converted);
- (void)to;
- EXPECT_TRUE(converted);
-}
-
-TEST(IteratorTraitsTest, WorksForSTLContainerIterators) {
- StaticAssertTypeEq<int,
- IteratorTraits< ::std::vector<int>::const_iterator>::value_type>();
- StaticAssertTypeEq<bool,
- IteratorTraits< ::std::list<bool>::iterator>::value_type>();
-}
-
-TEST(IteratorTraitsTest, WorksForPointerToNonConst) {
- StaticAssertTypeEq<char, IteratorTraits<char*>::value_type>();
- StaticAssertTypeEq<const void*, IteratorTraits<const void**>::value_type>();
-}
-
-TEST(IteratorTraitsTest, WorksForPointerToConst) {
- StaticAssertTypeEq<char, IteratorTraits<const char*>::value_type>();
- StaticAssertTypeEq<const void*,
- IteratorTraits<const void* const*>::value_type>();
-}
-
-// Tests that the element_type typedef is available in scoped_ptr and refers
-// to the parameter type.
-TEST(ScopedPtrTest, DefinesElementType) {
- StaticAssertTypeEq<int, ::testing::internal::scoped_ptr<int>::element_type>();
-}
-
-// TODO(vladl@google.com): Implement THE REST of scoped_ptr tests.
-
-TEST(GtestCheckSyntaxTest, BehavesLikeASingleStatement) {
- if (AlwaysFalse())
- GTEST_CHECK_(false) << "This should never be executed; "
- "It's a compilation test only.";
-
- if (AlwaysTrue())
- GTEST_CHECK_(true);
- else
- ; // NOLINT
-
- if (AlwaysFalse())
- ; // NOLINT
- else
- GTEST_CHECK_(true) << "";
-}
-
-TEST(GtestCheckSyntaxTest, WorksWithSwitch) {
- switch (0) {
- case 1:
- break;
- default:
- GTEST_CHECK_(true);
- }
-
- switch (0)
- case 0:
- GTEST_CHECK_(true) << "Check failed in switch case";
-}
-
-// Verifies behavior of FormatFileLocation.
-TEST(FormatFileLocationTest, FormatsFileLocation) {
- EXPECT_PRED_FORMAT2(IsSubstring, "foo.cc", FormatFileLocation("foo.cc", 42));
- EXPECT_PRED_FORMAT2(IsSubstring, "42", FormatFileLocation("foo.cc", 42));
-}
-
-TEST(FormatFileLocationTest, FormatsUnknownFile) {
- EXPECT_PRED_FORMAT2(
- IsSubstring, "unknown file", FormatFileLocation(NULL, 42));
- EXPECT_PRED_FORMAT2(IsSubstring, "42", FormatFileLocation(NULL, 42));
-}
-
-TEST(FormatFileLocationTest, FormatsUknownLine) {
- EXPECT_EQ("foo.cc:", FormatFileLocation("foo.cc", -1));
-}
-
-TEST(FormatFileLocationTest, FormatsUknownFileAndLine) {
- EXPECT_EQ("unknown file:", FormatFileLocation(NULL, -1));
-}
-
-// Verifies behavior of FormatCompilerIndependentFileLocation.
-TEST(FormatCompilerIndependentFileLocationTest, FormatsFileLocation) {
- EXPECT_EQ("foo.cc:42", FormatCompilerIndependentFileLocation("foo.cc", 42));
-}
-
-TEST(FormatCompilerIndependentFileLocationTest, FormatsUknownFile) {
- EXPECT_EQ("unknown file:42",
- FormatCompilerIndependentFileLocation(NULL, 42));
-}
-
-TEST(FormatCompilerIndependentFileLocationTest, FormatsUknownLine) {
- EXPECT_EQ("foo.cc", FormatCompilerIndependentFileLocation("foo.cc", -1));
-}
-
-TEST(FormatCompilerIndependentFileLocationTest, FormatsUknownFileAndLine) {
- EXPECT_EQ("unknown file", FormatCompilerIndependentFileLocation(NULL, -1));
-}
-
-#if GTEST_OS_MAC || GTEST_OS_QNX
-void* ThreadFunc(void* data) {
- pthread_mutex_t* mutex = static_cast<pthread_mutex_t*>(data);
- pthread_mutex_lock(mutex);
- pthread_mutex_unlock(mutex);
- return NULL;
-}
-
-TEST(GetThreadCountTest, ReturnsCorrectValue) {
- EXPECT_EQ(1U, GetThreadCount());
- pthread_mutex_t mutex;
- pthread_attr_t attr;
- pthread_t thread_id;
-
- // TODO(vladl@google.com): turn mutex into internal::Mutex for automatic
- // destruction.
- pthread_mutex_init(&mutex, NULL);
- pthread_mutex_lock(&mutex);
- ASSERT_EQ(0, pthread_attr_init(&attr));
- ASSERT_EQ(0, pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE));
-
- const int status = pthread_create(&thread_id, &attr, &ThreadFunc, &mutex);
- ASSERT_EQ(0, pthread_attr_destroy(&attr));
- ASSERT_EQ(0, status);
- EXPECT_EQ(2U, GetThreadCount());
- pthread_mutex_unlock(&mutex);
-
- void* dummy;
- ASSERT_EQ(0, pthread_join(thread_id, &dummy));
-
-# if GTEST_OS_MAC
-
- // MacOS X may not immediately report the updated thread count after
- // joining a thread, causing flakiness in this test. To counter that, we
- // wait for up to .5 seconds for the OS to report the correct value.
- for (int i = 0; i < 5; ++i) {
- if (GetThreadCount() == 1)
- break;
-
- SleepMilliseconds(100);
- }
-
-# endif // GTEST_OS_MAC
-
- EXPECT_EQ(1U, GetThreadCount());
- pthread_mutex_destroy(&mutex);
-}
-#else
-TEST(GetThreadCountTest, ReturnsZeroWhenUnableToCountThreads) {
- EXPECT_EQ(0U, GetThreadCount());
-}
-#endif // GTEST_OS_MAC || GTEST_OS_QNX
-
-TEST(GtestCheckDeathTest, DiesWithCorrectOutputOnFailure) {
- const bool a_false_condition = false;
- const char regex[] =
-#ifdef _MSC_VER
- "gtest-port_test\\.cc\\(\\d+\\):"
-#elif GTEST_USES_POSIX_RE
- "gtest-port_test\\.cc:[0-9]+"
-#else
- "gtest-port_test\\.cc:\\d+"
-#endif // _MSC_VER
- ".*a_false_condition.*Extra info.*";
-
- EXPECT_DEATH_IF_SUPPORTED(GTEST_CHECK_(a_false_condition) << "Extra info",
- regex);
-}
-
-#if GTEST_HAS_DEATH_TEST
-
-TEST(GtestCheckDeathTest, LivesSilentlyOnSuccess) {
- EXPECT_EXIT({
- GTEST_CHECK_(true) << "Extra info";
- ::std::cerr << "Success\n";
- exit(0); },
- ::testing::ExitedWithCode(0), "Success");
-}
-
-#endif // GTEST_HAS_DEATH_TEST
-
-// Verifies that Google Test choose regular expression engine appropriate to
-// the platform. The test will produce compiler errors in case of failure.
-// For simplicity, we only cover the most important platforms here.
-TEST(RegexEngineSelectionTest, SelectsCorrectRegexEngine) {
-#if GTEST_HAS_POSIX_RE
-
- EXPECT_TRUE(GTEST_USES_POSIX_RE);
-
-#else
-
- EXPECT_TRUE(GTEST_USES_SIMPLE_RE);
-
-#endif
-}
-
-#if GTEST_USES_POSIX_RE
-
-# if GTEST_HAS_TYPED_TEST
-
-template <typename Str>
-class RETest : public ::testing::Test {};
-
-// Defines StringTypes as the list of all string types that class RE
-// supports.
-typedef testing::Types<
- ::std::string,
-# if GTEST_HAS_GLOBAL_STRING
- ::string,
-# endif // GTEST_HAS_GLOBAL_STRING
- const char*> StringTypes;
-
-TYPED_TEST_CASE(RETest, StringTypes);
-
-// Tests RE's implicit constructors.
-TYPED_TEST(RETest, ImplicitConstructorWorks) {
- const RE empty(TypeParam(""));
- EXPECT_STREQ("", empty.pattern());
-
- const RE simple(TypeParam("hello"));
- EXPECT_STREQ("hello", simple.pattern());
-
- const RE normal(TypeParam(".*(\\w+)"));
- EXPECT_STREQ(".*(\\w+)", normal.pattern());
-}
-
-// Tests that RE's constructors reject invalid regular expressions.
-TYPED_TEST(RETest, RejectsInvalidRegex) {
- EXPECT_NONFATAL_FAILURE({
- const RE invalid(TypeParam("?"));
- }, "\"?\" is not a valid POSIX Extended regular expression.");
-}
-
-// Tests RE::FullMatch().
-TYPED_TEST(RETest, FullMatchWorks) {
- const RE empty(TypeParam(""));
- EXPECT_TRUE(RE::FullMatch(TypeParam(""), empty));
- EXPECT_FALSE(RE::FullMatch(TypeParam("a"), empty));
-
- const RE re(TypeParam("a.*z"));
- EXPECT_TRUE(RE::FullMatch(TypeParam("az"), re));
- EXPECT_TRUE(RE::FullMatch(TypeParam("axyz"), re));
- EXPECT_FALSE(RE::FullMatch(TypeParam("baz"), re));
- EXPECT_FALSE(RE::FullMatch(TypeParam("azy"), re));
-}
-
-// Tests RE::PartialMatch().
-TYPED_TEST(RETest, PartialMatchWorks) {
- const RE empty(TypeParam(""));
- EXPECT_TRUE(RE::PartialMatch(TypeParam(""), empty));
- EXPECT_TRUE(RE::PartialMatch(TypeParam("a"), empty));
-
- const RE re(TypeParam("a.*z"));
- EXPECT_TRUE(RE::PartialMatch(TypeParam("az"), re));
- EXPECT_TRUE(RE::PartialMatch(TypeParam("axyz"), re));
- EXPECT_TRUE(RE::PartialMatch(TypeParam("baz"), re));
- EXPECT_TRUE(RE::PartialMatch(TypeParam("azy"), re));
- EXPECT_FALSE(RE::PartialMatch(TypeParam("zza"), re));
-}
-
-# endif // GTEST_HAS_TYPED_TEST
-
-#elif GTEST_USES_SIMPLE_RE
-
-TEST(IsInSetTest, NulCharIsNotInAnySet) {
- EXPECT_FALSE(IsInSet('\0', ""));
- EXPECT_FALSE(IsInSet('\0', "\0"));
- EXPECT_FALSE(IsInSet('\0', "a"));
-}
-
-TEST(IsInSetTest, WorksForNonNulChars) {
- EXPECT_FALSE(IsInSet('a', "Ab"));
- EXPECT_FALSE(IsInSet('c', ""));
-
- EXPECT_TRUE(IsInSet('b', "bcd"));
- EXPECT_TRUE(IsInSet('b', "ab"));
-}
-
-TEST(IsAsciiDigitTest, IsFalseForNonDigit) {
- EXPECT_FALSE(IsAsciiDigit('\0'));
- EXPECT_FALSE(IsAsciiDigit(' '));
- EXPECT_FALSE(IsAsciiDigit('+'));
- EXPECT_FALSE(IsAsciiDigit('-'));
- EXPECT_FALSE(IsAsciiDigit('.'));
- EXPECT_FALSE(IsAsciiDigit('a'));
-}
-
-TEST(IsAsciiDigitTest, IsTrueForDigit) {
- EXPECT_TRUE(IsAsciiDigit('0'));
- EXPECT_TRUE(IsAsciiDigit('1'));
- EXPECT_TRUE(IsAsciiDigit('5'));
- EXPECT_TRUE(IsAsciiDigit('9'));
-}
-
-TEST(IsAsciiPunctTest, IsFalseForNonPunct) {
- EXPECT_FALSE(IsAsciiPunct('\0'));
- EXPECT_FALSE(IsAsciiPunct(' '));
- EXPECT_FALSE(IsAsciiPunct('\n'));
- EXPECT_FALSE(IsAsciiPunct('a'));
- EXPECT_FALSE(IsAsciiPunct('0'));
-}
-
-TEST(IsAsciiPunctTest, IsTrueForPunct) {
- for (const char* p = "^-!\"#$%&'()*+,./:;<=>?@[\\]_`{|}~"; *p; p++) {
- EXPECT_PRED1(IsAsciiPunct, *p);
- }
-}
-
-TEST(IsRepeatTest, IsFalseForNonRepeatChar) {
- EXPECT_FALSE(IsRepeat('\0'));
- EXPECT_FALSE(IsRepeat(' '));
- EXPECT_FALSE(IsRepeat('a'));
- EXPECT_FALSE(IsRepeat('1'));
- EXPECT_FALSE(IsRepeat('-'));
-}
-
-TEST(IsRepeatTest, IsTrueForRepeatChar) {
- EXPECT_TRUE(IsRepeat('?'));
- EXPECT_TRUE(IsRepeat('*'));
- EXPECT_TRUE(IsRepeat('+'));
-}
-
-TEST(IsAsciiWhiteSpaceTest, IsFalseForNonWhiteSpace) {
- EXPECT_FALSE(IsAsciiWhiteSpace('\0'));
- EXPECT_FALSE(IsAsciiWhiteSpace('a'));
- EXPECT_FALSE(IsAsciiWhiteSpace('1'));
- EXPECT_FALSE(IsAsciiWhiteSpace('+'));
- EXPECT_FALSE(IsAsciiWhiteSpace('_'));
-}
-
-TEST(IsAsciiWhiteSpaceTest, IsTrueForWhiteSpace) {
- EXPECT_TRUE(IsAsciiWhiteSpace(' '));
- EXPECT_TRUE(IsAsciiWhiteSpace('\n'));
- EXPECT_TRUE(IsAsciiWhiteSpace('\r'));
- EXPECT_TRUE(IsAsciiWhiteSpace('\t'));
- EXPECT_TRUE(IsAsciiWhiteSpace('\v'));
- EXPECT_TRUE(IsAsciiWhiteSpace('\f'));
-}
-
-TEST(IsAsciiWordCharTest, IsFalseForNonWordChar) {
- EXPECT_FALSE(IsAsciiWordChar('\0'));
- EXPECT_FALSE(IsAsciiWordChar('+'));
- EXPECT_FALSE(IsAsciiWordChar('.'));
- EXPECT_FALSE(IsAsciiWordChar(' '));
- EXPECT_FALSE(IsAsciiWordChar('\n'));
-}
-
-TEST(IsAsciiWordCharTest, IsTrueForLetter) {
- EXPECT_TRUE(IsAsciiWordChar('a'));
- EXPECT_TRUE(IsAsciiWordChar('b'));
- EXPECT_TRUE(IsAsciiWordChar('A'));
- EXPECT_TRUE(IsAsciiWordChar('Z'));
-}
-
-TEST(IsAsciiWordCharTest, IsTrueForDigit) {
- EXPECT_TRUE(IsAsciiWordChar('0'));
- EXPECT_TRUE(IsAsciiWordChar('1'));
- EXPECT_TRUE(IsAsciiWordChar('7'));
- EXPECT_TRUE(IsAsciiWordChar('9'));
-}
-
-TEST(IsAsciiWordCharTest, IsTrueForUnderscore) {
- EXPECT_TRUE(IsAsciiWordChar('_'));
-}
-
-TEST(IsValidEscapeTest, IsFalseForNonPrintable) {
- EXPECT_FALSE(IsValidEscape('\0'));
- EXPECT_FALSE(IsValidEscape('\007'));
-}
-
-TEST(IsValidEscapeTest, IsFalseForDigit) {
- EXPECT_FALSE(IsValidEscape('0'));
- EXPECT_FALSE(IsValidEscape('9'));
-}
-
-TEST(IsValidEscapeTest, IsFalseForWhiteSpace) {
- EXPECT_FALSE(IsValidEscape(' '));
- EXPECT_FALSE(IsValidEscape('\n'));
-}
-
-TEST(IsValidEscapeTest, IsFalseForSomeLetter) {
- EXPECT_FALSE(IsValidEscape('a'));
- EXPECT_FALSE(IsValidEscape('Z'));
-}
-
-TEST(IsValidEscapeTest, IsTrueForPunct) {
- EXPECT_TRUE(IsValidEscape('.'));
- EXPECT_TRUE(IsValidEscape('-'));
- EXPECT_TRUE(IsValidEscape('^'));
- EXPECT_TRUE(IsValidEscape('$'));
- EXPECT_TRUE(IsValidEscape('('));
- EXPECT_TRUE(IsValidEscape(']'));
- EXPECT_TRUE(IsValidEscape('{'));
- EXPECT_TRUE(IsValidEscape('|'));
-}
-
-TEST(IsValidEscapeTest, IsTrueForSomeLetter) {
- EXPECT_TRUE(IsValidEscape('d'));
- EXPECT_TRUE(IsValidEscape('D'));
- EXPECT_TRUE(IsValidEscape('s'));
- EXPECT_TRUE(IsValidEscape('S'));
- EXPECT_TRUE(IsValidEscape('w'));
- EXPECT_TRUE(IsValidEscape('W'));
-}
-
-TEST(AtomMatchesCharTest, EscapedPunct) {
- EXPECT_FALSE(AtomMatchesChar(true, '\\', '\0'));
- EXPECT_FALSE(AtomMatchesChar(true, '\\', ' '));
- EXPECT_FALSE(AtomMatchesChar(true, '_', '.'));
- EXPECT_FALSE(AtomMatchesChar(true, '.', 'a'));
-
- EXPECT_TRUE(AtomMatchesChar(true, '\\', '\\'));
- EXPECT_TRUE(AtomMatchesChar(true, '_', '_'));
- EXPECT_TRUE(AtomMatchesChar(true, '+', '+'));
- EXPECT_TRUE(AtomMatchesChar(true, '.', '.'));
-}
-
-TEST(AtomMatchesCharTest, Escaped_d) {
- EXPECT_FALSE(AtomMatchesChar(true, 'd', '\0'));
- EXPECT_FALSE(AtomMatchesChar(true, 'd', 'a'));
- EXPECT_FALSE(AtomMatchesChar(true, 'd', '.'));
-
- EXPECT_TRUE(AtomMatchesChar(true, 'd', '0'));
- EXPECT_TRUE(AtomMatchesChar(true, 'd', '9'));
-}
-
-TEST(AtomMatchesCharTest, Escaped_D) {
- EXPECT_FALSE(AtomMatchesChar(true, 'D', '0'));
- EXPECT_FALSE(AtomMatchesChar(true, 'D', '9'));
-
- EXPECT_TRUE(AtomMatchesChar(true, 'D', '\0'));
- EXPECT_TRUE(AtomMatchesChar(true, 'D', 'a'));
- EXPECT_TRUE(AtomMatchesChar(true, 'D', '-'));
-}
-
-TEST(AtomMatchesCharTest, Escaped_s) {
- EXPECT_FALSE(AtomMatchesChar(true, 's', '\0'));
- EXPECT_FALSE(AtomMatchesChar(true, 's', 'a'));
- EXPECT_FALSE(AtomMatchesChar(true, 's', '.'));
- EXPECT_FALSE(AtomMatchesChar(true, 's', '9'));
-
- EXPECT_TRUE(AtomMatchesChar(true, 's', ' '));
- EXPECT_TRUE(AtomMatchesChar(true, 's', '\n'));
- EXPECT_TRUE(AtomMatchesChar(true, 's', '\t'));
-}
-
-TEST(AtomMatchesCharTest, Escaped_S) {
- EXPECT_FALSE(AtomMatchesChar(true, 'S', ' '));
- EXPECT_FALSE(AtomMatchesChar(true, 'S', '\r'));
-
- EXPECT_TRUE(AtomMatchesChar(true, 'S', '\0'));
- EXPECT_TRUE(AtomMatchesChar(true, 'S', 'a'));
- EXPECT_TRUE(AtomMatchesChar(true, 'S', '9'));
-}
-
-TEST(AtomMatchesCharTest, Escaped_w) {
- EXPECT_FALSE(AtomMatchesChar(true, 'w', '\0'));
- EXPECT_FALSE(AtomMatchesChar(true, 'w', '+'));
- EXPECT_FALSE(AtomMatchesChar(true, 'w', ' '));
- EXPECT_FALSE(AtomMatchesChar(true, 'w', '\n'));
-
- EXPECT_TRUE(AtomMatchesChar(true, 'w', '0'));
- EXPECT_TRUE(AtomMatchesChar(true, 'w', 'b'));
- EXPECT_TRUE(AtomMatchesChar(true, 'w', 'C'));
- EXPECT_TRUE(AtomMatchesChar(true, 'w', '_'));
-}
-
-TEST(AtomMatchesCharTest, Escaped_W) {
- EXPECT_FALSE(AtomMatchesChar(true, 'W', 'A'));
- EXPECT_FALSE(AtomMatchesChar(true, 'W', 'b'));
- EXPECT_FALSE(AtomMatchesChar(true, 'W', '9'));
- EXPECT_FALSE(AtomMatchesChar(true, 'W', '_'));
-
- EXPECT_TRUE(AtomMatchesChar(true, 'W', '\0'));
- EXPECT_TRUE(AtomMatchesChar(true, 'W', '*'));
- EXPECT_TRUE(AtomMatchesChar(true, 'W', '\n'));
-}
-
-TEST(AtomMatchesCharTest, EscapedWhiteSpace) {
- EXPECT_FALSE(AtomMatchesChar(true, 'f', '\0'));
- EXPECT_FALSE(AtomMatchesChar(true, 'f', '\n'));
- EXPECT_FALSE(AtomMatchesChar(true, 'n', '\0'));
- EXPECT_FALSE(AtomMatchesChar(true, 'n', '\r'));
- EXPECT_FALSE(AtomMatchesChar(true, 'r', '\0'));
- EXPECT_FALSE(AtomMatchesChar(true, 'r', 'a'));
- EXPECT_FALSE(AtomMatchesChar(true, 't', '\0'));
- EXPECT_FALSE(AtomMatchesChar(true, 't', 't'));
- EXPECT_FALSE(AtomMatchesChar(true, 'v', '\0'));
- EXPECT_FALSE(AtomMatchesChar(true, 'v', '\f'));
-
- EXPECT_TRUE(AtomMatchesChar(true, 'f', '\f'));
- EXPECT_TRUE(AtomMatchesChar(true, 'n', '\n'));
- EXPECT_TRUE(AtomMatchesChar(true, 'r', '\r'));
- EXPECT_TRUE(AtomMatchesChar(true, 't', '\t'));
- EXPECT_TRUE(AtomMatchesChar(true, 'v', '\v'));
-}
-
-TEST(AtomMatchesCharTest, UnescapedDot) {
- EXPECT_FALSE(AtomMatchesChar(false, '.', '\n'));
-
- EXPECT_TRUE(AtomMatchesChar(false, '.', '\0'));
- EXPECT_TRUE(AtomMatchesChar(false, '.', '.'));
- EXPECT_TRUE(AtomMatchesChar(false, '.', 'a'));
- EXPECT_TRUE(AtomMatchesChar(false, '.', ' '));
-}
-
-TEST(AtomMatchesCharTest, UnescapedChar) {
- EXPECT_FALSE(AtomMatchesChar(false, 'a', '\0'));
- EXPECT_FALSE(AtomMatchesChar(false, 'a', 'b'));
- EXPECT_FALSE(AtomMatchesChar(false, '$', 'a'));
-
- EXPECT_TRUE(AtomMatchesChar(false, '$', '$'));
- EXPECT_TRUE(AtomMatchesChar(false, '5', '5'));
- EXPECT_TRUE(AtomMatchesChar(false, 'Z', 'Z'));
-}
-
-TEST(ValidateRegexTest, GeneratesFailureAndReturnsFalseForInvalid) {
- EXPECT_NONFATAL_FAILURE(ASSERT_FALSE(ValidateRegex(NULL)),
- "NULL is not a valid simple regular expression");
- EXPECT_NONFATAL_FAILURE(
- ASSERT_FALSE(ValidateRegex("a\\")),
- "Syntax error at index 1 in simple regular expression \"a\\\": ");
- EXPECT_NONFATAL_FAILURE(ASSERT_FALSE(ValidateRegex("a\\")),
- "'\\' cannot appear at the end");
- EXPECT_NONFATAL_FAILURE(ASSERT_FALSE(ValidateRegex("\\n\\")),
- "'\\' cannot appear at the end");
- EXPECT_NONFATAL_FAILURE(ASSERT_FALSE(ValidateRegex("\\s\\hb")),
- "invalid escape sequence \"\\h\"");
- EXPECT_NONFATAL_FAILURE(ASSERT_FALSE(ValidateRegex("^^")),
- "'^' can only appear at the beginning");
- EXPECT_NONFATAL_FAILURE(ASSERT_FALSE(ValidateRegex(".*^b")),
- "'^' can only appear at the beginning");
- EXPECT_NONFATAL_FAILURE(ASSERT_FALSE(ValidateRegex("$$")),
- "'$' can only appear at the end");
- EXPECT_NONFATAL_FAILURE(ASSERT_FALSE(ValidateRegex("^$a")),
- "'$' can only appear at the end");
- EXPECT_NONFATAL_FAILURE(ASSERT_FALSE(ValidateRegex("a(b")),
- "'(' is unsupported");
- EXPECT_NONFATAL_FAILURE(ASSERT_FALSE(ValidateRegex("ab)")),
- "')' is unsupported");
- EXPECT_NONFATAL_FAILURE(ASSERT_FALSE(ValidateRegex("[ab")),
- "'[' is unsupported");
- EXPECT_NONFATAL_FAILURE(ASSERT_FALSE(ValidateRegex("a{2")),
- "'{' is unsupported");
- EXPECT_NONFATAL_FAILURE(ASSERT_FALSE(ValidateRegex("?")),
- "'?' can only follow a repeatable token");
- EXPECT_NONFATAL_FAILURE(ASSERT_FALSE(ValidateRegex("^*")),
- "'*' can only follow a repeatable token");
- EXPECT_NONFATAL_FAILURE(ASSERT_FALSE(ValidateRegex("5*+")),
- "'+' can only follow a repeatable token");
-}
-
-TEST(ValidateRegexTest, ReturnsTrueForValid) {
- EXPECT_TRUE(ValidateRegex(""));
- EXPECT_TRUE(ValidateRegex("a"));
- EXPECT_TRUE(ValidateRegex(".*"));
- EXPECT_TRUE(ValidateRegex("^a_+"));
- EXPECT_TRUE(ValidateRegex("^a\\t\\&?"));
- EXPECT_TRUE(ValidateRegex("09*$"));
- EXPECT_TRUE(ValidateRegex("^Z$"));
- EXPECT_TRUE(ValidateRegex("a\\^Z\\$\\(\\)\\|\\[\\]\\{\\}"));
-}
-
-TEST(MatchRepetitionAndRegexAtHeadTest, WorksForZeroOrOne) {
- EXPECT_FALSE(MatchRepetitionAndRegexAtHead(false, 'a', '?', "a", "ba"));
- // Repeating more than once.
- EXPECT_FALSE(MatchRepetitionAndRegexAtHead(false, 'a', '?', "b", "aab"));
-
- // Repeating zero times.
- EXPECT_TRUE(MatchRepetitionAndRegexAtHead(false, 'a', '?', "b", "ba"));
- // Repeating once.
- EXPECT_TRUE(MatchRepetitionAndRegexAtHead(false, 'a', '?', "b", "ab"));
- EXPECT_TRUE(MatchRepetitionAndRegexAtHead(false, '#', '?', ".", "##"));
-}
-
-TEST(MatchRepetitionAndRegexAtHeadTest, WorksForZeroOrMany) {
- EXPECT_FALSE(MatchRepetitionAndRegexAtHead(false, '.', '*', "a$", "baab"));
-
- // Repeating zero times.
- EXPECT_TRUE(MatchRepetitionAndRegexAtHead(false, '.', '*', "b", "bc"));
- // Repeating once.
- EXPECT_TRUE(MatchRepetitionAndRegexAtHead(false, '.', '*', "b", "abc"));
- // Repeating more than once.
- EXPECT_TRUE(MatchRepetitionAndRegexAtHead(true, 'w', '*', "-", "ab_1-g"));
-}
-
-TEST(MatchRepetitionAndRegexAtHeadTest, WorksForOneOrMany) {
- EXPECT_FALSE(MatchRepetitionAndRegexAtHead(false, '.', '+', "a$", "baab"));
- // Repeating zero times.
- EXPECT_FALSE(MatchRepetitionAndRegexAtHead(false, '.', '+', "b", "bc"));
-
- // Repeating once.
- EXPECT_TRUE(MatchRepetitionAndRegexAtHead(false, '.', '+', "b", "abc"));
- // Repeating more than once.
- EXPECT_TRUE(MatchRepetitionAndRegexAtHead(true, 'w', '+', "-", "ab_1-g"));
-}
-
-TEST(MatchRegexAtHeadTest, ReturnsTrueForEmptyRegex) {
- EXPECT_TRUE(MatchRegexAtHead("", ""));
- EXPECT_TRUE(MatchRegexAtHead("", "ab"));
-}
-
-TEST(MatchRegexAtHeadTest, WorksWhenDollarIsInRegex) {
- EXPECT_FALSE(MatchRegexAtHead("$", "a"));
-
- EXPECT_TRUE(MatchRegexAtHead("$", ""));
- EXPECT_TRUE(MatchRegexAtHead("a$", "a"));
-}
-
-TEST(MatchRegexAtHeadTest, WorksWhenRegexStartsWithEscapeSequence) {
- EXPECT_FALSE(MatchRegexAtHead("\\w", "+"));
- EXPECT_FALSE(MatchRegexAtHead("\\W", "ab"));
-
- EXPECT_TRUE(MatchRegexAtHead("\\sa", "\nab"));
- EXPECT_TRUE(MatchRegexAtHead("\\d", "1a"));
-}
-
-TEST(MatchRegexAtHeadTest, WorksWhenRegexStartsWithRepetition) {
- EXPECT_FALSE(MatchRegexAtHead(".+a", "abc"));
- EXPECT_FALSE(MatchRegexAtHead("a?b", "aab"));
-
- EXPECT_TRUE(MatchRegexAtHead(".*a", "bc12-ab"));
- EXPECT_TRUE(MatchRegexAtHead("a?b", "b"));
- EXPECT_TRUE(MatchRegexAtHead("a?b", "ab"));
-}
-
-TEST(MatchRegexAtHeadTest,
- WorksWhenRegexStartsWithRepetionOfEscapeSequence) {
- EXPECT_FALSE(MatchRegexAtHead("\\.+a", "abc"));
- EXPECT_FALSE(MatchRegexAtHead("\\s?b", " b"));
-
- EXPECT_TRUE(MatchRegexAtHead("\\(*a", "((((ab"));
- EXPECT_TRUE(MatchRegexAtHead("\\^?b", "^b"));
- EXPECT_TRUE(MatchRegexAtHead("\\\\?b", "b"));
- EXPECT_TRUE(MatchRegexAtHead("\\\\?b", "\\b"));
-}
-
-TEST(MatchRegexAtHeadTest, MatchesSequentially) {
- EXPECT_FALSE(MatchRegexAtHead("ab.*c", "acabc"));
-
- EXPECT_TRUE(MatchRegexAtHead("ab.*c", "ab-fsc"));
-}
-
-TEST(MatchRegexAnywhereTest, ReturnsFalseWhenStringIsNull) {
- EXPECT_FALSE(MatchRegexAnywhere("", NULL));
-}
-
-TEST(MatchRegexAnywhereTest, WorksWhenRegexStartsWithCaret) {
- EXPECT_FALSE(MatchRegexAnywhere("^a", "ba"));
- EXPECT_FALSE(MatchRegexAnywhere("^$", "a"));
-
- EXPECT_TRUE(MatchRegexAnywhere("^a", "ab"));
- EXPECT_TRUE(MatchRegexAnywhere("^", "ab"));
- EXPECT_TRUE(MatchRegexAnywhere("^$", ""));
-}
-
-TEST(MatchRegexAnywhereTest, ReturnsFalseWhenNoMatch) {
- EXPECT_FALSE(MatchRegexAnywhere("a", "bcde123"));
- EXPECT_FALSE(MatchRegexAnywhere("a.+a", "--aa88888888"));
-}
-
-TEST(MatchRegexAnywhereTest, ReturnsTrueWhenMatchingPrefix) {
- EXPECT_TRUE(MatchRegexAnywhere("\\w+", "ab1_ - 5"));
- EXPECT_TRUE(MatchRegexAnywhere(".*=", "="));
- EXPECT_TRUE(MatchRegexAnywhere("x.*ab?.*bc", "xaaabc"));
-}
-
-TEST(MatchRegexAnywhereTest, ReturnsTrueWhenMatchingNonPrefix) {
- EXPECT_TRUE(MatchRegexAnywhere("\\w+", "$$$ ab1_ - 5"));
- EXPECT_TRUE(MatchRegexAnywhere("\\.+=", "= ...="));
-}
-
-// Tests RE's implicit constructors.
-TEST(RETest, ImplicitConstructorWorks) {
- const RE empty("");
- EXPECT_STREQ("", empty.pattern());
-
- const RE simple("hello");
- EXPECT_STREQ("hello", simple.pattern());
-}
-
-// Tests that RE's constructors reject invalid regular expressions.
-TEST(RETest, RejectsInvalidRegex) {
- EXPECT_NONFATAL_FAILURE({
- const RE normal(NULL);
- }, "NULL is not a valid simple regular expression");
-
- EXPECT_NONFATAL_FAILURE({
- const RE normal(".*(\\w+");
- }, "'(' is unsupported");
-
- EXPECT_NONFATAL_FAILURE({
- const RE invalid("^?");
- }, "'?' can only follow a repeatable token");
-}
-
-// Tests RE::FullMatch().
-TEST(RETest, FullMatchWorks) {
- const RE empty("");
- EXPECT_TRUE(RE::FullMatch("", empty));
- EXPECT_FALSE(RE::FullMatch("a", empty));
-
- const RE re1("a");
- EXPECT_TRUE(RE::FullMatch("a", re1));
-
- const RE re("a.*z");
- EXPECT_TRUE(RE::FullMatch("az", re));
- EXPECT_TRUE(RE::FullMatch("axyz", re));
- EXPECT_FALSE(RE::FullMatch("baz", re));
- EXPECT_FALSE(RE::FullMatch("azy", re));
-}
-
-// Tests RE::PartialMatch().
-TEST(RETest, PartialMatchWorks) {
- const RE empty("");
- EXPECT_TRUE(RE::PartialMatch("", empty));
- EXPECT_TRUE(RE::PartialMatch("a", empty));
-
- const RE re("a.*z");
- EXPECT_TRUE(RE::PartialMatch("az", re));
- EXPECT_TRUE(RE::PartialMatch("axyz", re));
- EXPECT_TRUE(RE::PartialMatch("baz", re));
- EXPECT_TRUE(RE::PartialMatch("azy", re));
- EXPECT_FALSE(RE::PartialMatch("zza", re));
-}
-
-#endif // GTEST_USES_POSIX_RE
-
-#if !GTEST_OS_WINDOWS_MOBILE
-
-TEST(CaptureTest, CapturesStdout) {
- CaptureStdout();
- fprintf(stdout, "abc");
- EXPECT_STREQ("abc", GetCapturedStdout().c_str());
-
- CaptureStdout();
- fprintf(stdout, "def%cghi", '\0');
- EXPECT_EQ(::std::string("def\0ghi", 7), ::std::string(GetCapturedStdout()));
-}
-
-TEST(CaptureTest, CapturesStderr) {
- CaptureStderr();
- fprintf(stderr, "jkl");
- EXPECT_STREQ("jkl", GetCapturedStderr().c_str());
-
- CaptureStderr();
- fprintf(stderr, "jkl%cmno", '\0');
- EXPECT_EQ(::std::string("jkl\0mno", 7), ::std::string(GetCapturedStderr()));
-}
-
-// Tests that stdout and stderr capture don't interfere with each other.
-TEST(CaptureTest, CapturesStdoutAndStderr) {
- CaptureStdout();
- CaptureStderr();
- fprintf(stdout, "pqr");
- fprintf(stderr, "stu");
- EXPECT_STREQ("pqr", GetCapturedStdout().c_str());
- EXPECT_STREQ("stu", GetCapturedStderr().c_str());
-}
-
-TEST(CaptureDeathTest, CannotReenterStdoutCapture) {
- CaptureStdout();
- EXPECT_DEATH_IF_SUPPORTED(CaptureStdout(),
- "Only one stdout capturer can exist at a time");
- GetCapturedStdout();
-
- // We cannot test stderr capturing using death tests as they use it
- // themselves.
-}
-
-#endif // !GTEST_OS_WINDOWS_MOBILE
-
-TEST(ThreadLocalTest, DefaultConstructorInitializesToDefaultValues) {
- ThreadLocal<int> t1;
- EXPECT_EQ(0, t1.get());
-
- ThreadLocal<void*> t2;
- EXPECT_TRUE(t2.get() == NULL);
-}
-
-TEST(ThreadLocalTest, SingleParamConstructorInitializesToParam) {
- ThreadLocal<int> t1(123);
- EXPECT_EQ(123, t1.get());
-
- int i = 0;
- ThreadLocal<int*> t2(&i);
- EXPECT_EQ(&i, t2.get());
-}
-
-class NoDefaultContructor {
- public:
- explicit NoDefaultContructor(const char*) {}
- NoDefaultContructor(const NoDefaultContructor&) {}
-};
-
-TEST(ThreadLocalTest, ValueDefaultContructorIsNotRequiredForParamVersion) {
- ThreadLocal<NoDefaultContructor> bar(NoDefaultContructor("foo"));
- bar.pointer();
-}
-
-TEST(ThreadLocalTest, GetAndPointerReturnSameValue) {
- ThreadLocal<String> thread_local_string;
-
- EXPECT_EQ(thread_local_string.pointer(), &(thread_local_string.get()));
-
- // Verifies the condition still holds after calling set.
- thread_local_string.set("foo");
- EXPECT_EQ(thread_local_string.pointer(), &(thread_local_string.get()));
-}
-
-TEST(ThreadLocalTest, PointerAndConstPointerReturnSameValue) {
- ThreadLocal<String> thread_local_string;
- const ThreadLocal<String>& const_thread_local_string = thread_local_string;
-
- EXPECT_EQ(thread_local_string.pointer(), const_thread_local_string.pointer());
-
- thread_local_string.set("foo");
- EXPECT_EQ(thread_local_string.pointer(), const_thread_local_string.pointer());
-}
-
-#if GTEST_IS_THREADSAFE
-
-void AddTwo(int* param) { *param += 2; }
-
-TEST(ThreadWithParamTest, ConstructorExecutesThreadFunc) {
- int i = 40;
- ThreadWithParam<int*> thread(&AddTwo, &i, NULL);
- thread.Join();
- EXPECT_EQ(42, i);
-}
-
-TEST(MutexDeathTest, AssertHeldShouldAssertWhenNotLocked) {
- // AssertHeld() is flaky only in the presence of multiple threads accessing
- // the lock. In this case, the test is robust.
- EXPECT_DEATH_IF_SUPPORTED({
- Mutex m;
- { MutexLock lock(&m); }
- m.AssertHeld();
- },
- "thread .*hold");
-}
-
-TEST(MutexTest, AssertHeldShouldNotAssertWhenLocked) {
- Mutex m;
- MutexLock lock(&m);
- m.AssertHeld();
-}
-
-class AtomicCounterWithMutex {
- public:
- explicit AtomicCounterWithMutex(Mutex* mutex) :
- value_(0), mutex_(mutex), random_(42) {}
-
- void Increment() {
- MutexLock lock(mutex_);
- int temp = value_;
- {
- // Locking a mutex puts up a memory barrier, preventing reads and
- // writes to value_ rearranged when observed from other threads.
- //
- // We cannot use Mutex and MutexLock here or rely on their memory
- // barrier functionality as we are testing them here.
- pthread_mutex_t memory_barrier_mutex;
- GTEST_CHECK_POSIX_SUCCESS_(
- pthread_mutex_init(&memory_barrier_mutex, NULL));
- GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_lock(&memory_barrier_mutex));
-
- SleepMilliseconds(random_.Generate(30));
-
- GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_unlock(&memory_barrier_mutex));
- GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_destroy(&memory_barrier_mutex));
- }
- value_ = temp + 1;
- }
- int value() const { return value_; }
-
- private:
- volatile int value_;
- Mutex* const mutex_; // Protects value_.
- Random random_;
-};
-
-void CountingThreadFunc(pair<AtomicCounterWithMutex*, int> param) {
- for (int i = 0; i < param.second; ++i)
- param.first->Increment();
-}
-
-// Tests that the mutex only lets one thread at a time to lock it.
-TEST(MutexTest, OnlyOneThreadCanLockAtATime) {
- Mutex mutex;
- AtomicCounterWithMutex locked_counter(&mutex);
-
- typedef ThreadWithParam<pair<AtomicCounterWithMutex*, int> > ThreadType;
- const int kCycleCount = 20;
- const int kThreadCount = 7;
- scoped_ptr<ThreadType> counting_threads[kThreadCount];
- Notification threads_can_start;
- // Creates and runs kThreadCount threads that increment locked_counter
- // kCycleCount times each.
- for (int i = 0; i < kThreadCount; ++i) {
- counting_threads[i].reset(new ThreadType(&CountingThreadFunc,
- make_pair(&locked_counter,
- kCycleCount),
- &threads_can_start));
- }
- threads_can_start.Notify();
- for (int i = 0; i < kThreadCount; ++i)
- counting_threads[i]->Join();
-
- // If the mutex lets more than one thread to increment the counter at a
- // time, they are likely to encounter a race condition and have some
- // increments overwritten, resulting in the lower then expected counter
- // value.
- EXPECT_EQ(kCycleCount * kThreadCount, locked_counter.value());
-}
-
-template <typename T>
-void RunFromThread(void (func)(T), T param) {
- ThreadWithParam<T> thread(func, param, NULL);
- thread.Join();
-}
-
-void RetrieveThreadLocalValue(pair<ThreadLocal<String>*, String*> param) {
- *param.second = param.first->get();
-}
-
-TEST(ThreadLocalTest, ParameterizedConstructorSetsDefault) {
- ThreadLocal<String> thread_local_string("foo");
- EXPECT_STREQ("foo", thread_local_string.get().c_str());
-
- thread_local_string.set("bar");
- EXPECT_STREQ("bar", thread_local_string.get().c_str());
-
- String result;
- RunFromThread(&RetrieveThreadLocalValue,
- make_pair(&thread_local_string, &result));
- EXPECT_STREQ("foo", result.c_str());
-}
-
-// DestructorTracker keeps track of whether its instances have been
-// destroyed.
-static std::vector<bool> g_destroyed;
-
-class DestructorTracker {
- public:
- DestructorTracker() : index_(GetNewIndex()) {}
- DestructorTracker(const DestructorTracker& /* rhs */)
- : index_(GetNewIndex()) {}
- ~DestructorTracker() {
- // We never access g_destroyed concurrently, so we don't need to
- // protect the write operation under a mutex.
- g_destroyed[index_] = true;
- }
-
- private:
- static int GetNewIndex() {
- g_destroyed.push_back(false);
- return g_destroyed.size() - 1;
- }
- const int index_;
-};
-
-typedef ThreadLocal<DestructorTracker>* ThreadParam;
-
-void CallThreadLocalGet(ThreadParam thread_local_param) {
- thread_local_param->get();
-}
-
-// Tests that when a ThreadLocal object dies in a thread, it destroys
-// the managed object for that thread.
-TEST(ThreadLocalTest, DestroysManagedObjectForOwnThreadWhenDying) {
- g_destroyed.clear();
-
- {
- // The next line default constructs a DestructorTracker object as
- // the default value of objects managed by thread_local_tracker.
- ThreadLocal<DestructorTracker> thread_local_tracker;
- ASSERT_EQ(1U, g_destroyed.size());
- ASSERT_FALSE(g_destroyed[0]);
-
- // This creates another DestructorTracker object for the main thread.
- thread_local_tracker.get();
- ASSERT_EQ(2U, g_destroyed.size());
- ASSERT_FALSE(g_destroyed[0]);
- ASSERT_FALSE(g_destroyed[1]);
- }
-
- // Now thread_local_tracker has died. It should have destroyed both the
- // default value shared by all threads and the value for the main
- // thread.
- ASSERT_EQ(2U, g_destroyed.size());
- EXPECT_TRUE(g_destroyed[0]);
- EXPECT_TRUE(g_destroyed[1]);
-
- g_destroyed.clear();
-}
-
-// Tests that when a thread exits, the thread-local object for that
-// thread is destroyed.
-TEST(ThreadLocalTest, DestroysManagedObjectAtThreadExit) {
- g_destroyed.clear();
-
- {
- // The next line default constructs a DestructorTracker object as
- // the default value of objects managed by thread_local_tracker.
- ThreadLocal<DestructorTracker> thread_local_tracker;
- ASSERT_EQ(1U, g_destroyed.size());
- ASSERT_FALSE(g_destroyed[0]);
-
- // This creates another DestructorTracker object in the new thread.
- ThreadWithParam<ThreadParam> thread(
- &CallThreadLocalGet, &thread_local_tracker, NULL);
- thread.Join();
-
- // Now the new thread has exited. The per-thread object for it
- // should have been destroyed.
- ASSERT_EQ(2U, g_destroyed.size());
- ASSERT_FALSE(g_destroyed[0]);
- ASSERT_TRUE(g_destroyed[1]);
- }
-
- // Now thread_local_tracker has died. The default value should have been
- // destroyed too.
- ASSERT_EQ(2U, g_destroyed.size());
- EXPECT_TRUE(g_destroyed[0]);
- EXPECT_TRUE(g_destroyed[1]);
-
- g_destroyed.clear();
-}
-
-TEST(ThreadLocalTest, ThreadLocalMutationsAffectOnlyCurrentThread) {
- ThreadLocal<String> thread_local_string;
- thread_local_string.set("Foo");
- EXPECT_STREQ("Foo", thread_local_string.get().c_str());
-
- String result;
- RunFromThread(&RetrieveThreadLocalValue,
- make_pair(&thread_local_string, &result));
- EXPECT_TRUE(result.c_str() == NULL);
-}
-
-#endif // GTEST_IS_THREADSAFE
-
-} // namespace internal
-} // namespace testing
diff --git a/src/testing/gtest/test/gtest-printers_test.cc b/src/testing/gtest/test/gtest-printers_test.cc
deleted file mode 100644
index 58d96225..00000000
--- a/src/testing/gtest/test/gtest-printers_test.cc
+++ /dev/null
@@ -1,1311 +0,0 @@
-// Copyright 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-// Google Test - The Google C++ Testing Framework
-//
-// This file tests the universal value printer.
-
-#include "gtest/gtest-printers.h"
-
-#include <ctype.h>
-#include <limits.h>
-#include <string.h>
-#include <algorithm>
-#include <deque>
-#include <list>
-#include <map>
-#include <set>
-#include <sstream>
-#include <string>
-#include <utility>
-#include <vector>
-
-#include "gtest/gtest.h"
-
-// hash_map and hash_set are available under Visual C++.
-#if _MSC_VER
-# define GTEST_HAS_HASH_MAP_ 1 // Indicates that hash_map is available.
-# include <hash_map> // NOLINT
-# define GTEST_HAS_HASH_SET_ 1 // Indicates that hash_set is available.
-# include <hash_set> // NOLINT
-#endif // GTEST_OS_WINDOWS
-
-// Some user-defined types for testing the universal value printer.
-
-// An anonymous enum type.
-enum AnonymousEnum {
- kAE1 = -1,
- kAE2 = 1
-};
-
-// An enum without a user-defined printer.
-enum EnumWithoutPrinter {
- kEWP1 = -2,
- kEWP2 = 42
-};
-
-// An enum with a << operator.
-enum EnumWithStreaming {
- kEWS1 = 10
-};
-
-std::ostream& operator<<(std::ostream& os, EnumWithStreaming e) {
- return os << (e == kEWS1 ? "kEWS1" : "invalid");
-}
-
-// An enum with a PrintTo() function.
-enum EnumWithPrintTo {
- kEWPT1 = 1
-};
-
-void PrintTo(EnumWithPrintTo e, std::ostream* os) {
- *os << (e == kEWPT1 ? "kEWPT1" : "invalid");
-}
-
-// A class implicitly convertible to BiggestInt.
-class BiggestIntConvertible {
- public:
- operator ::testing::internal::BiggestInt() const { return 42; }
-};
-
-// A user-defined unprintable class template in the global namespace.
-template <typename T>
-class UnprintableTemplateInGlobal {
- public:
- UnprintableTemplateInGlobal() : value_() {}
- private:
- T value_;
-};
-
-// A user-defined streamable type in the global namespace.
-class StreamableInGlobal {
- public:
- virtual ~StreamableInGlobal() {}
-};
-
-inline void operator<<(::std::ostream& os, const StreamableInGlobal& /* x */) {
- os << "StreamableInGlobal";
-}
-
-void operator<<(::std::ostream& os, const StreamableInGlobal* /* x */) {
- os << "StreamableInGlobal*";
-}
-
-namespace foo {
-
-// A user-defined unprintable type in a user namespace.
-class UnprintableInFoo {
- public:
- UnprintableInFoo() : z_(0) { memcpy(xy_, "\xEF\x12\x0\x0\x34\xAB\x0\x0", 8); }
- private:
- char xy_[8];
- double z_;
-};
-
-// A user-defined printable type in a user-chosen namespace.
-struct PrintableViaPrintTo {
- PrintableViaPrintTo() : value() {}
- int value;
-};
-
-void PrintTo(const PrintableViaPrintTo& x, ::std::ostream* os) {
- *os << "PrintableViaPrintTo: " << x.value;
-}
-
-// A type with a user-defined << for printing its pointer.
-struct PointerPrintable {
-};
-
-::std::ostream& operator<<(::std::ostream& os,
- const PointerPrintable* /* x */) {
- return os << "PointerPrintable*";
-}
-
-// A user-defined printable class template in a user-chosen namespace.
-template <typename T>
-class PrintableViaPrintToTemplate {
- public:
- explicit PrintableViaPrintToTemplate(const T& a_value) : value_(a_value) {}
-
- const T& value() const { return value_; }
- private:
- T value_;
-};
-
-template <typename T>
-void PrintTo(const PrintableViaPrintToTemplate<T>& x, ::std::ostream* os) {
- *os << "PrintableViaPrintToTemplate: " << x.value();
-}
-
-// A user-defined streamable class template in a user namespace.
-template <typename T>
-class StreamableTemplateInFoo {
- public:
- StreamableTemplateInFoo() : value_() {}
-
- const T& value() const { return value_; }
- private:
- T value_;
-};
-
-template <typename T>
-inline ::std::ostream& operator<<(::std::ostream& os,
- const StreamableTemplateInFoo<T>& x) {
- return os << "StreamableTemplateInFoo: " << x.value();
-}
-
-} // namespace foo
-
-namespace testing {
-namespace gtest_printers_test {
-
-using ::std::deque;
-using ::std::list;
-using ::std::make_pair;
-using ::std::map;
-using ::std::multimap;
-using ::std::multiset;
-using ::std::pair;
-using ::std::set;
-using ::std::vector;
-using ::testing::PrintToString;
-using ::testing::internal::ImplicitCast_;
-using ::testing::internal::NativeArray;
-using ::testing::internal::RE;
-using ::testing::internal::Strings;
-using ::testing::internal::UniversalTersePrint;
-using ::testing::internal::UniversalPrint;
-using ::testing::internal::UniversalTersePrintTupleFieldsToStrings;
-using ::testing::internal::UniversalPrinter;
-using ::testing::internal::kReference;
-using ::testing::internal::string;
-
-#if GTEST_HAS_TR1_TUPLE
-using ::std::tr1::make_tuple;
-using ::std::tr1::tuple;
-#endif
-
-#if _MSC_VER
-// MSVC defines the following classes in the ::stdext namespace while
-// gcc defines them in the :: namespace. Note that they are not part
-// of the C++ standard.
-using ::stdext::hash_map;
-using ::stdext::hash_set;
-using ::stdext::hash_multimap;
-using ::stdext::hash_multiset;
-#endif
-
-// Prints a value to a string using the universal value printer. This
-// is a helper for testing UniversalPrinter<T>::Print() for various types.
-template <typename T>
-string Print(const T& value) {
- ::std::stringstream ss;
- UniversalPrinter<T>::Print(value, &ss);
- return ss.str();
-}
-
-// Prints a value passed by reference to a string, using the universal
-// value printer. This is a helper for testing
-// UniversalPrinter<T&>::Print() for various types.
-template <typename T>
-string PrintByRef(const T& value) {
- ::std::stringstream ss;
- UniversalPrinter<T&>::Print(value, &ss);
- return ss.str();
-}
-
-// Tests printing various enum types.
-
-TEST(PrintEnumTest, AnonymousEnum) {
- EXPECT_EQ("-1", Print(kAE1));
- EXPECT_EQ("1", Print(kAE2));
-}
-
-TEST(PrintEnumTest, EnumWithoutPrinter) {
- EXPECT_EQ("-2", Print(kEWP1));
- EXPECT_EQ("42", Print(kEWP2));
-}
-
-TEST(PrintEnumTest, EnumWithStreaming) {
- EXPECT_EQ("kEWS1", Print(kEWS1));
- EXPECT_EQ("invalid", Print(static_cast<EnumWithStreaming>(0)));
-}
-
-TEST(PrintEnumTest, EnumWithPrintTo) {
- EXPECT_EQ("kEWPT1", Print(kEWPT1));
- EXPECT_EQ("invalid", Print(static_cast<EnumWithPrintTo>(0)));
-}
-
-// Tests printing a class implicitly convertible to BiggestInt.
-
-TEST(PrintClassTest, BiggestIntConvertible) {
- EXPECT_EQ("42", Print(BiggestIntConvertible()));
-}
-
-// Tests printing various char types.
-
-// char.
-TEST(PrintCharTest, PlainChar) {
- EXPECT_EQ("'\\0'", Print('\0'));
- EXPECT_EQ("'\\'' (39, 0x27)", Print('\''));
- EXPECT_EQ("'\"' (34, 0x22)", Print('"'));
- EXPECT_EQ("'?' (63, 0x3F)", Print('?'));
- EXPECT_EQ("'\\\\' (92, 0x5C)", Print('\\'));
- EXPECT_EQ("'\\a' (7)", Print('\a'));
- EXPECT_EQ("'\\b' (8)", Print('\b'));
- EXPECT_EQ("'\\f' (12, 0xC)", Print('\f'));
- EXPECT_EQ("'\\n' (10, 0xA)", Print('\n'));
- EXPECT_EQ("'\\r' (13, 0xD)", Print('\r'));
- EXPECT_EQ("'\\t' (9)", Print('\t'));
- EXPECT_EQ("'\\v' (11, 0xB)", Print('\v'));
- EXPECT_EQ("'\\x7F' (127)", Print('\x7F'));
- EXPECT_EQ("'\\xFF' (255)", Print('\xFF'));
- EXPECT_EQ("' ' (32, 0x20)", Print(' '));
- EXPECT_EQ("'a' (97, 0x61)", Print('a'));
-}
-
-// signed char.
-TEST(PrintCharTest, SignedChar) {
- EXPECT_EQ("'\\0'", Print(static_cast<signed char>('\0')));
- EXPECT_EQ("'\\xCE' (-50)",
- Print(static_cast<signed char>(-50)));
-}
-
-// unsigned char.
-TEST(PrintCharTest, UnsignedChar) {
- EXPECT_EQ("'\\0'", Print(static_cast<unsigned char>('\0')));
- EXPECT_EQ("'b' (98, 0x62)",
- Print(static_cast<unsigned char>('b')));
-}
-
-// Tests printing other simple, built-in types.
-
-// bool.
-TEST(PrintBuiltInTypeTest, Bool) {
- EXPECT_EQ("false", Print(false));
- EXPECT_EQ("true", Print(true));
-}
-
-// wchar_t.
-TEST(PrintBuiltInTypeTest, Wchar_t) {
- EXPECT_EQ("L'\\0'", Print(L'\0'));
- EXPECT_EQ("L'\\'' (39, 0x27)", Print(L'\''));
- EXPECT_EQ("L'\"' (34, 0x22)", Print(L'"'));
- EXPECT_EQ("L'?' (63, 0x3F)", Print(L'?'));
- EXPECT_EQ("L'\\\\' (92, 0x5C)", Print(L'\\'));
- EXPECT_EQ("L'\\a' (7)", Print(L'\a'));
- EXPECT_EQ("L'\\b' (8)", Print(L'\b'));
- EXPECT_EQ("L'\\f' (12, 0xC)", Print(L'\f'));
- EXPECT_EQ("L'\\n' (10, 0xA)", Print(L'\n'));
- EXPECT_EQ("L'\\r' (13, 0xD)", Print(L'\r'));
- EXPECT_EQ("L'\\t' (9)", Print(L'\t'));
- EXPECT_EQ("L'\\v' (11, 0xB)", Print(L'\v'));
- EXPECT_EQ("L'\\x7F' (127)", Print(L'\x7F'));
- EXPECT_EQ("L'\\xFF' (255)", Print(L'\xFF'));
- EXPECT_EQ("L' ' (32, 0x20)", Print(L' '));
- EXPECT_EQ("L'a' (97, 0x61)", Print(L'a'));
- EXPECT_EQ("L'\\x576' (1398)", Print(static_cast<wchar_t>(0x576)));
- EXPECT_EQ("L'\\xC74D' (51021)", Print(static_cast<wchar_t>(0xC74D)));
-}
-
-// Test that Int64 provides more storage than wchar_t.
-TEST(PrintTypeSizeTest, Wchar_t) {
- EXPECT_LT(sizeof(wchar_t), sizeof(testing::internal::Int64));
-}
-
-// Various integer types.
-TEST(PrintBuiltInTypeTest, Integer) {
- EXPECT_EQ("'\\xFF' (255)", Print(static_cast<unsigned char>(255))); // uint8
- EXPECT_EQ("'\\x80' (-128)", Print(static_cast<signed char>(-128))); // int8
- EXPECT_EQ("65535", Print(USHRT_MAX)); // uint16
- EXPECT_EQ("-32768", Print(SHRT_MIN)); // int16
- EXPECT_EQ("4294967295", Print(UINT_MAX)); // uint32
- EXPECT_EQ("-2147483648", Print(INT_MIN)); // int32
- EXPECT_EQ("18446744073709551615",
- Print(static_cast<testing::internal::UInt64>(-1))); // uint64
- EXPECT_EQ("-9223372036854775808",
- Print(static_cast<testing::internal::Int64>(1) << 63)); // int64
-}
-
-// Size types.
-TEST(PrintBuiltInTypeTest, Size_t) {
- EXPECT_EQ("1", Print(sizeof('a'))); // size_t.
-#if !GTEST_OS_WINDOWS
- // Windows has no ssize_t type.
- EXPECT_EQ("-2", Print(static_cast<ssize_t>(-2))); // ssize_t.
-#endif // !GTEST_OS_WINDOWS
-}
-
-// Floating-points.
-TEST(PrintBuiltInTypeTest, FloatingPoints) {
- EXPECT_EQ("1.5", Print(1.5f)); // float
- EXPECT_EQ("-2.5", Print(-2.5)); // double
-}
-
-// Since ::std::stringstream::operator<<(const void *) formats the pointer
-// output differently with different compilers, we have to create the expected
-// output first and use it as our expectation.
-static string PrintPointer(const void *p) {
- ::std::stringstream expected_result_stream;
- expected_result_stream << p;
- return expected_result_stream.str();
-}
-
-// Tests printing C strings.
-
-// const char*.
-TEST(PrintCStringTest, Const) {
- const char* p = "World";
- EXPECT_EQ(PrintPointer(p) + " pointing to \"World\"", Print(p));
-}
-
-// char*.
-TEST(PrintCStringTest, NonConst) {
- char p[] = "Hi";
- EXPECT_EQ(PrintPointer(p) + " pointing to \"Hi\"",
- Print(static_cast<char*>(p)));
-}
-
-// NULL C string.
-TEST(PrintCStringTest, Null) {
- const char* p = NULL;
- EXPECT_EQ("NULL", Print(p));
-}
-
-// Tests that C strings are escaped properly.
-TEST(PrintCStringTest, EscapesProperly) {
- const char* p = "'\"?\\\a\b\f\n\r\t\v\x7F\xFF a";
- EXPECT_EQ(PrintPointer(p) + " pointing to \"'\\\"?\\\\\\a\\b\\f"
- "\\n\\r\\t\\v\\x7F\\xFF a\"",
- Print(p));
-}
-
-
-
-// MSVC compiler can be configured to define whar_t as a typedef
-// of unsigned short. Defining an overload for const wchar_t* in that case
-// would cause pointers to unsigned shorts be printed as wide strings,
-// possibly accessing more memory than intended and causing invalid
-// memory accesses. MSVC defines _NATIVE_WCHAR_T_DEFINED symbol when
-// wchar_t is implemented as a native type.
-#if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED)
-
-// const wchar_t*.
-TEST(PrintWideCStringTest, Const) {
- const wchar_t* p = L"World";
- EXPECT_EQ(PrintPointer(p) + " pointing to L\"World\"", Print(p));
-}
-
-// wchar_t*.
-TEST(PrintWideCStringTest, NonConst) {
- wchar_t p[] = L"Hi";
- EXPECT_EQ(PrintPointer(p) + " pointing to L\"Hi\"",
- Print(static_cast<wchar_t*>(p)));
-}
-
-// NULL wide C string.
-TEST(PrintWideCStringTest, Null) {
- const wchar_t* p = NULL;
- EXPECT_EQ("NULL", Print(p));
-}
-
-// Tests that wide C strings are escaped properly.
-TEST(PrintWideCStringTest, EscapesProperly) {
- const wchar_t s[] = {'\'', '"', '?', '\\', '\a', '\b', '\f', '\n', '\r',
- '\t', '\v', 0xD3, 0x576, 0x8D3, 0xC74D, ' ', 'a', '\0'};
- EXPECT_EQ(PrintPointer(s) + " pointing to L\"'\\\"?\\\\\\a\\b\\f"
- "\\n\\r\\t\\v\\xD3\\x576\\x8D3\\xC74D a\"",
- Print(static_cast<const wchar_t*>(s)));
-}
-#endif // native wchar_t
-
-// Tests printing pointers to other char types.
-
-// signed char*.
-TEST(PrintCharPointerTest, SignedChar) {
- signed char* p = reinterpret_cast<signed char*>(0x1234);
- EXPECT_EQ(PrintPointer(p), Print(p));
- p = NULL;
- EXPECT_EQ("NULL", Print(p));
-}
-
-// const signed char*.
-TEST(PrintCharPointerTest, ConstSignedChar) {
- signed char* p = reinterpret_cast<signed char*>(0x1234);
- EXPECT_EQ(PrintPointer(p), Print(p));
- p = NULL;
- EXPECT_EQ("NULL", Print(p));
-}
-
-// unsigned char*.
-TEST(PrintCharPointerTest, UnsignedChar) {
- unsigned char* p = reinterpret_cast<unsigned char*>(0x1234);
- EXPECT_EQ(PrintPointer(p), Print(p));
- p = NULL;
- EXPECT_EQ("NULL", Print(p));
-}
-
-// const unsigned char*.
-TEST(PrintCharPointerTest, ConstUnsignedChar) {
- const unsigned char* p = reinterpret_cast<const unsigned char*>(0x1234);
- EXPECT_EQ(PrintPointer(p), Print(p));
- p = NULL;
- EXPECT_EQ("NULL", Print(p));
-}
-
-// Tests printing pointers to simple, built-in types.
-
-// bool*.
-TEST(PrintPointerToBuiltInTypeTest, Bool) {
- bool* p = reinterpret_cast<bool*>(0xABCD);
- EXPECT_EQ(PrintPointer(p), Print(p));
- p = NULL;
- EXPECT_EQ("NULL", Print(p));
-}
-
-// void*.
-TEST(PrintPointerToBuiltInTypeTest, Void) {
- void* p = reinterpret_cast<void*>(0xABCD);
- EXPECT_EQ(PrintPointer(p), Print(p));
- p = NULL;
- EXPECT_EQ("NULL", Print(p));
-}
-
-// const void*.
-TEST(PrintPointerToBuiltInTypeTest, ConstVoid) {
- const void* p = reinterpret_cast<const void*>(0xABCD);
- EXPECT_EQ(PrintPointer(p), Print(p));
- p = NULL;
- EXPECT_EQ("NULL", Print(p));
-}
-
-// Tests printing pointers to pointers.
-TEST(PrintPointerToPointerTest, IntPointerPointer) {
- int** p = reinterpret_cast<int**>(0xABCD);
- EXPECT_EQ(PrintPointer(p), Print(p));
- p = NULL;
- EXPECT_EQ("NULL", Print(p));
-}
-
-// Tests printing (non-member) function pointers.
-
-void MyFunction(int /* n */) {}
-
-TEST(PrintPointerTest, NonMemberFunctionPointer) {
- // We cannot directly cast &MyFunction to const void* because the
- // standard disallows casting between pointers to functions and
- // pointers to objects, and some compilers (e.g. GCC 3.4) enforce
- // this limitation.
- EXPECT_EQ(
- PrintPointer(reinterpret_cast<const void*>(
- reinterpret_cast<internal::BiggestInt>(&MyFunction))),
- Print(&MyFunction));
- int (*p)(bool) = NULL; // NOLINT
- EXPECT_EQ("NULL", Print(p));
-}
-
-// An assertion predicate determining whether a one string is a prefix for
-// another.
-template <typename StringType>
-AssertionResult HasPrefix(const StringType& str, const StringType& prefix) {
- if (str.find(prefix, 0) == 0)
- return AssertionSuccess();
-
- const bool is_wide_string = sizeof(prefix[0]) > 1;
- const char* const begin_string_quote = is_wide_string ? "L\"" : "\"";
- return AssertionFailure()
- << begin_string_quote << prefix << "\" is not a prefix of "
- << begin_string_quote << str << "\"\n";
-}
-
-// Tests printing member variable pointers. Although they are called
-// pointers, they don't point to a location in the address space.
-// Their representation is implementation-defined. Thus they will be
-// printed as raw bytes.
-
-struct Foo {
- public:
- virtual ~Foo() {}
- int MyMethod(char x) { return x + 1; }
- virtual char MyVirtualMethod(int /* n */) { return 'a'; }
-
- int value;
-};
-
-TEST(PrintPointerTest, MemberVariablePointer) {
- EXPECT_TRUE(HasPrefix(Print(&Foo::value),
- Print(sizeof(&Foo::value)) + "-byte object "));
- int (Foo::*p) = NULL; // NOLINT
- EXPECT_TRUE(HasPrefix(Print(p),
- Print(sizeof(p)) + "-byte object "));
-}
-
-// Tests printing member function pointers. Although they are called
-// pointers, they don't point to a location in the address space.
-// Their representation is implementation-defined. Thus they will be
-// printed as raw bytes.
-TEST(PrintPointerTest, MemberFunctionPointer) {
- EXPECT_TRUE(HasPrefix(Print(&Foo::MyMethod),
- Print(sizeof(&Foo::MyMethod)) + "-byte object "));
- EXPECT_TRUE(
- HasPrefix(Print(&Foo::MyVirtualMethod),
- Print(sizeof((&Foo::MyVirtualMethod))) + "-byte object "));
- int (Foo::*p)(char) = NULL; // NOLINT
- EXPECT_TRUE(HasPrefix(Print(p),
- Print(sizeof(p)) + "-byte object "));
-}
-
-// Tests printing C arrays.
-
-// The difference between this and Print() is that it ensures that the
-// argument is a reference to an array.
-template <typename T, size_t N>
-string PrintArrayHelper(T (&a)[N]) {
- return Print(a);
-}
-
-// One-dimensional array.
-TEST(PrintArrayTest, OneDimensionalArray) {
- int a[5] = { 1, 2, 3, 4, 5 };
- EXPECT_EQ("{ 1, 2, 3, 4, 5 }", PrintArrayHelper(a));
-}
-
-// Two-dimensional array.
-TEST(PrintArrayTest, TwoDimensionalArray) {
- int a[2][5] = {
- { 1, 2, 3, 4, 5 },
- { 6, 7, 8, 9, 0 }
- };
- EXPECT_EQ("{ { 1, 2, 3, 4, 5 }, { 6, 7, 8, 9, 0 } }", PrintArrayHelper(a));
-}
-
-// Array of const elements.
-TEST(PrintArrayTest, ConstArray) {
- const bool a[1] = { false };
- EXPECT_EQ("{ false }", PrintArrayHelper(a));
-}
-
-// Char array.
-TEST(PrintArrayTest, CharArray) {
- // Array a contains '\0' in the middle and doesn't end with '\0'.
- char a[3] = { 'H', '\0', 'i' };
- EXPECT_EQ("\"H\\0i\"", PrintArrayHelper(a));
-}
-
-// Const char array.
-TEST(PrintArrayTest, ConstCharArray) {
- const char a[4] = "\0Hi";
- EXPECT_EQ("\"\\0Hi\\0\"", PrintArrayHelper(a));
-}
-
-// Array of objects.
-TEST(PrintArrayTest, ObjectArray) {
- string a[3] = { "Hi", "Hello", "Ni hao" };
- EXPECT_EQ("{ \"Hi\", \"Hello\", \"Ni hao\" }", PrintArrayHelper(a));
-}
-
-// Array with many elements.
-TEST(PrintArrayTest, BigArray) {
- int a[100] = { 1, 2, 3 };
- EXPECT_EQ("{ 1, 2, 3, 0, 0, 0, 0, 0, ..., 0, 0, 0, 0, 0, 0, 0, 0 }",
- PrintArrayHelper(a));
-}
-
-// Tests printing ::string and ::std::string.
-
-#if GTEST_HAS_GLOBAL_STRING
-// ::string.
-TEST(PrintStringTest, StringInGlobalNamespace) {
- const char s[] = "'\"?\\\a\b\f\n\0\r\t\v\x7F\xFF a";
- const ::string str(s, sizeof(s));
- EXPECT_EQ("\"'\\\"?\\\\\\a\\b\\f\\n\\0\\r\\t\\v\\x7F\\xFF a\\0\"",
- Print(str));
-}
-#endif // GTEST_HAS_GLOBAL_STRING
-
-// ::std::string.
-TEST(PrintStringTest, StringInStdNamespace) {
- const char s[] = "'\"?\\\a\b\f\n\0\r\t\v\x7F\xFF a";
- const ::std::string str(s, sizeof(s));
- EXPECT_EQ("\"'\\\"?\\\\\\a\\b\\f\\n\\0\\r\\t\\v\\x7F\\xFF a\\0\"",
- Print(str));
-}
-
-TEST(PrintStringTest, StringAmbiguousHex) {
- // "\x6BANANA" is ambiguous, it can be interpreted as starting with either of:
- // '\x6', '\x6B', or '\x6BA'.
-
- // a hex escaping sequence following by a decimal digit
- EXPECT_EQ("\"0\\x12\" \"3\"", Print(::std::string("0\x12" "3")));
- // a hex escaping sequence following by a hex digit (lower-case)
- EXPECT_EQ("\"mm\\x6\" \"bananas\"", Print(::std::string("mm\x6" "bananas")));
- // a hex escaping sequence following by a hex digit (upper-case)
- EXPECT_EQ("\"NOM\\x6\" \"BANANA\"", Print(::std::string("NOM\x6" "BANANA")));
- // a hex escaping sequence following by a non-xdigit
- EXPECT_EQ("\"!\\x5-!\"", Print(::std::string("!\x5-!")));
-}
-
-// Tests printing ::wstring and ::std::wstring.
-
-#if GTEST_HAS_GLOBAL_WSTRING
-// ::wstring.
-TEST(PrintWideStringTest, StringInGlobalNamespace) {
- const wchar_t s[] = L"'\"?\\\a\b\f\n\0\r\t\v\xD3\x576\x8D3\xC74D a";
- const ::wstring str(s, sizeof(s)/sizeof(wchar_t));
- EXPECT_EQ("L\"'\\\"?\\\\\\a\\b\\f\\n\\0\\r\\t\\v"
- "\\xD3\\x576\\x8D3\\xC74D a\\0\"",
- Print(str));
-}
-#endif // GTEST_HAS_GLOBAL_WSTRING
-
-#if GTEST_HAS_STD_WSTRING
-// ::std::wstring.
-TEST(PrintWideStringTest, StringInStdNamespace) {
- const wchar_t s[] = L"'\"?\\\a\b\f\n\0\r\t\v\xD3\x576\x8D3\xC74D a";
- const ::std::wstring str(s, sizeof(s)/sizeof(wchar_t));
- EXPECT_EQ("L\"'\\\"?\\\\\\a\\b\\f\\n\\0\\r\\t\\v"
- "\\xD3\\x576\\x8D3\\xC74D a\\0\"",
- Print(str));
-}
-
-TEST(PrintWideStringTest, StringAmbiguousHex) {
- // same for wide strings.
- EXPECT_EQ("L\"0\\x12\" L\"3\"", Print(::std::wstring(L"0\x12" L"3")));
- EXPECT_EQ("L\"mm\\x6\" L\"bananas\"",
- Print(::std::wstring(L"mm\x6" L"bananas")));
- EXPECT_EQ("L\"NOM\\x6\" L\"BANANA\"",
- Print(::std::wstring(L"NOM\x6" L"BANANA")));
- EXPECT_EQ("L\"!\\x5-!\"", Print(::std::wstring(L"!\x5-!")));
-}
-#endif // GTEST_HAS_STD_WSTRING
-
-// Tests printing types that support generic streaming (i.e. streaming
-// to std::basic_ostream<Char, CharTraits> for any valid Char and
-// CharTraits types).
-
-// Tests printing a non-template type that supports generic streaming.
-
-class AllowsGenericStreaming {};
-
-template <typename Char, typename CharTraits>
-std::basic_ostream<Char, CharTraits>& operator<<(
- std::basic_ostream<Char, CharTraits>& os,
- const AllowsGenericStreaming& /* a */) {
- return os << "AllowsGenericStreaming";
-}
-
-TEST(PrintTypeWithGenericStreamingTest, NonTemplateType) {
- AllowsGenericStreaming a;
- EXPECT_EQ("AllowsGenericStreaming", Print(a));
-}
-
-// Tests printing a template type that supports generic streaming.
-
-template <typename T>
-class AllowsGenericStreamingTemplate {};
-
-template <typename Char, typename CharTraits, typename T>
-std::basic_ostream<Char, CharTraits>& operator<<(
- std::basic_ostream<Char, CharTraits>& os,
- const AllowsGenericStreamingTemplate<T>& /* a */) {
- return os << "AllowsGenericStreamingTemplate";
-}
-
-TEST(PrintTypeWithGenericStreamingTest, TemplateType) {
- AllowsGenericStreamingTemplate<int> a;
- EXPECT_EQ("AllowsGenericStreamingTemplate", Print(a));
-}
-
-// Tests printing a type that supports generic streaming and can be
-// implicitly converted to another printable type.
-
-template <typename T>
-class AllowsGenericStreamingAndImplicitConversionTemplate {
- public:
- operator bool() const { return false; }
-};
-
-template <typename Char, typename CharTraits, typename T>
-std::basic_ostream<Char, CharTraits>& operator<<(
- std::basic_ostream<Char, CharTraits>& os,
- const AllowsGenericStreamingAndImplicitConversionTemplate<T>& /* a */) {
- return os << "AllowsGenericStreamingAndImplicitConversionTemplate";
-}
-
-TEST(PrintTypeWithGenericStreamingTest, TypeImplicitlyConvertible) {
- AllowsGenericStreamingAndImplicitConversionTemplate<int> a;
- EXPECT_EQ("AllowsGenericStreamingAndImplicitConversionTemplate", Print(a));
-}
-
-#if GTEST_HAS_STRING_PIECE_
-
-// Tests printing StringPiece.
-
-TEST(PrintStringPieceTest, SimpleStringPiece) {
- const StringPiece sp = "Hello";
- EXPECT_EQ("\"Hello\"", Print(sp));
-}
-
-TEST(PrintStringPieceTest, UnprintableCharacters) {
- const char str[] = "NUL (\0) and \r\t";
- const StringPiece sp(str, sizeof(str) - 1);
- EXPECT_EQ("\"NUL (\\0) and \\r\\t\"", Print(sp));
-}
-
-#endif // GTEST_HAS_STRING_PIECE_
-
-// Tests printing STL containers.
-
-TEST(PrintStlContainerTest, EmptyDeque) {
- deque<char> empty;
- EXPECT_EQ("{}", Print(empty));
-}
-
-TEST(PrintStlContainerTest, NonEmptyDeque) {
- deque<int> non_empty;
- non_empty.push_back(1);
- non_empty.push_back(3);
- EXPECT_EQ("{ 1, 3 }", Print(non_empty));
-}
-
-#if GTEST_HAS_HASH_MAP_
-
-TEST(PrintStlContainerTest, OneElementHashMap) {
- hash_map<int, char> map1;
- map1[1] = 'a';
- EXPECT_EQ("{ (1, 'a' (97, 0x61)) }", Print(map1));
-}
-
-TEST(PrintStlContainerTest, HashMultiMap) {
- hash_multimap<int, bool> map1;
- map1.insert(make_pair(5, true));
- map1.insert(make_pair(5, false));
-
- // Elements of hash_multimap can be printed in any order.
- const string result = Print(map1);
- EXPECT_TRUE(result == "{ (5, true), (5, false) }" ||
- result == "{ (5, false), (5, true) }")
- << " where Print(map1) returns \"" << result << "\".";
-}
-
-#endif // GTEST_HAS_HASH_MAP_
-
-#if GTEST_HAS_HASH_SET_
-
-TEST(PrintStlContainerTest, HashSet) {
- hash_set<string> set1;
- set1.insert("hello");
- EXPECT_EQ("{ \"hello\" }", Print(set1));
-}
-
-TEST(PrintStlContainerTest, HashMultiSet) {
- const int kSize = 5;
- int a[kSize] = { 1, 1, 2, 5, 1 };
- hash_multiset<int> set1(a, a + kSize);
-
- // Elements of hash_multiset can be printed in any order.
- const string result = Print(set1);
- const string expected_pattern = "{ d, d, d, d, d }"; // d means a digit.
-
- // Verifies the result matches the expected pattern; also extracts
- // the numbers in the result.
- ASSERT_EQ(expected_pattern.length(), result.length());
- std::vector<int> numbers;
- for (size_t i = 0; i != result.length(); i++) {
- if (expected_pattern[i] == 'd') {
- ASSERT_NE(isdigit(static_cast<unsigned char>(result[i])), 0);
- numbers.push_back(result[i] - '0');
- } else {
- EXPECT_EQ(expected_pattern[i], result[i]) << " where result is "
- << result;
- }
- }
-
- // Makes sure the result contains the right numbers.
- std::sort(numbers.begin(), numbers.end());
- std::sort(a, a + kSize);
- EXPECT_TRUE(std::equal(a, a + kSize, numbers.begin()));
-}
-
-#endif // GTEST_HAS_HASH_SET_
-
-TEST(PrintStlContainerTest, List) {
- const string a[] = {
- "hello",
- "world"
- };
- const list<string> strings(a, a + 2);
- EXPECT_EQ("{ \"hello\", \"world\" }", Print(strings));
-}
-
-TEST(PrintStlContainerTest, Map) {
- map<int, bool> map1;
- map1[1] = true;
- map1[5] = false;
- map1[3] = true;
- EXPECT_EQ("{ (1, true), (3, true), (5, false) }", Print(map1));
-}
-
-TEST(PrintStlContainerTest, MultiMap) {
- multimap<bool, int> map1;
- // The make_pair template function would deduce the type as
- // pair<bool, int> here, and since the key part in a multimap has to
- // be constant, without a templated ctor in the pair class (as in
- // libCstd on Solaris), make_pair call would fail to compile as no
- // implicit conversion is found. Thus explicit typename is used
- // here instead.
- map1.insert(pair<const bool, int>(true, 0));
- map1.insert(pair<const bool, int>(true, 1));
- map1.insert(pair<const bool, int>(false, 2));
- EXPECT_EQ("{ (false, 2), (true, 0), (true, 1) }", Print(map1));
-}
-
-TEST(PrintStlContainerTest, Set) {
- const unsigned int a[] = { 3, 0, 5 };
- set<unsigned int> set1(a, a + 3);
- EXPECT_EQ("{ 0, 3, 5 }", Print(set1));
-}
-
-TEST(PrintStlContainerTest, MultiSet) {
- const int a[] = { 1, 1, 2, 5, 1 };
- multiset<int> set1(a, a + 5);
- EXPECT_EQ("{ 1, 1, 1, 2, 5 }", Print(set1));
-}
-
-TEST(PrintStlContainerTest, Pair) {
- pair<const bool, int> p(true, 5);
- EXPECT_EQ("(true, 5)", Print(p));
-}
-
-TEST(PrintStlContainerTest, Vector) {
- vector<int> v;
- v.push_back(1);
- v.push_back(2);
- EXPECT_EQ("{ 1, 2 }", Print(v));
-}
-
-TEST(PrintStlContainerTest, LongSequence) {
- const int a[100] = { 1, 2, 3 };
- const vector<int> v(a, a + 100);
- EXPECT_EQ("{ 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "
- "0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ... }", Print(v));
-}
-
-TEST(PrintStlContainerTest, NestedContainer) {
- const int a1[] = { 1, 2 };
- const int a2[] = { 3, 4, 5 };
- const list<int> l1(a1, a1 + 2);
- const list<int> l2(a2, a2 + 3);
-
- vector<list<int> > v;
- v.push_back(l1);
- v.push_back(l2);
- EXPECT_EQ("{ { 1, 2 }, { 3, 4, 5 } }", Print(v));
-}
-
-TEST(PrintStlContainerTest, OneDimensionalNativeArray) {
- const int a[3] = { 1, 2, 3 };
- NativeArray<int> b(a, 3, kReference);
- EXPECT_EQ("{ 1, 2, 3 }", Print(b));
-}
-
-TEST(PrintStlContainerTest, TwoDimensionalNativeArray) {
- const int a[2][3] = { { 1, 2, 3 }, { 4, 5, 6 } };
- NativeArray<int[3]> b(a, 2, kReference);
- EXPECT_EQ("{ { 1, 2, 3 }, { 4, 5, 6 } }", Print(b));
-}
-
-// Tests that a class named iterator isn't treated as a container.
-
-struct iterator {
- char x;
-};
-
-TEST(PrintStlContainerTest, Iterator) {
- iterator it = {};
- EXPECT_EQ("1-byte object <00>", Print(it));
-}
-
-// Tests that a class named const_iterator isn't treated as a container.
-
-struct const_iterator {
- char x;
-};
-
-TEST(PrintStlContainerTest, ConstIterator) {
- const_iterator it = {};
- EXPECT_EQ("1-byte object <00>", Print(it));
-}
-
-#if GTEST_HAS_TR1_TUPLE
-// Tests printing tuples.
-
-// Tuples of various arities.
-TEST(PrintTupleTest, VariousSizes) {
- tuple<> t0;
- EXPECT_EQ("()", Print(t0));
-
- tuple<int> t1(5);
- EXPECT_EQ("(5)", Print(t1));
-
- tuple<char, bool> t2('a', true);
- EXPECT_EQ("('a' (97, 0x61), true)", Print(t2));
-
- tuple<bool, int, int> t3(false, 2, 3);
- EXPECT_EQ("(false, 2, 3)", Print(t3));
-
- tuple<bool, int, int, int> t4(false, 2, 3, 4);
- EXPECT_EQ("(false, 2, 3, 4)", Print(t4));
-
- tuple<bool, int, int, int, bool> t5(false, 2, 3, 4, true);
- EXPECT_EQ("(false, 2, 3, 4, true)", Print(t5));
-
- tuple<bool, int, int, int, bool, int> t6(false, 2, 3, 4, true, 6);
- EXPECT_EQ("(false, 2, 3, 4, true, 6)", Print(t6));
-
- tuple<bool, int, int, int, bool, int, int> t7(false, 2, 3, 4, true, 6, 7);
- EXPECT_EQ("(false, 2, 3, 4, true, 6, 7)", Print(t7));
-
- tuple<bool, int, int, int, bool, int, int, bool> t8(
- false, 2, 3, 4, true, 6, 7, true);
- EXPECT_EQ("(false, 2, 3, 4, true, 6, 7, true)", Print(t8));
-
- tuple<bool, int, int, int, bool, int, int, bool, int> t9(
- false, 2, 3, 4, true, 6, 7, true, 9);
- EXPECT_EQ("(false, 2, 3, 4, true, 6, 7, true, 9)", Print(t9));
-
- const char* const str = "8";
- // VC++ 2010's implementation of tuple of C++0x is deficient, requiring
- // an explicit type cast of NULL to be used.
- tuple<bool, char, short, testing::internal::Int32, // NOLINT
- testing::internal::Int64, float, double, const char*, void*, string>
- t10(false, 'a', 3, 4, 5, 1.5F, -2.5, str,
- ImplicitCast_<void*>(NULL), "10");
- EXPECT_EQ("(false, 'a' (97, 0x61), 3, 4, 5, 1.5, -2.5, " + PrintPointer(str) +
- " pointing to \"8\", NULL, \"10\")",
- Print(t10));
-}
-
-// Nested tuples.
-TEST(PrintTupleTest, NestedTuple) {
- tuple<tuple<int, bool>, char> nested(make_tuple(5, true), 'a');
- EXPECT_EQ("((5, true), 'a' (97, 0x61))", Print(nested));
-}
-
-#endif // GTEST_HAS_TR1_TUPLE
-
-// Tests printing user-defined unprintable types.
-
-// Unprintable types in the global namespace.
-TEST(PrintUnprintableTypeTest, InGlobalNamespace) {
- EXPECT_EQ("1-byte object <00>",
- Print(UnprintableTemplateInGlobal<char>()));
-}
-
-// Unprintable types in a user namespace.
-TEST(PrintUnprintableTypeTest, InUserNamespace) {
- EXPECT_EQ("16-byte object <EF-12 00-00 34-AB 00-00 00-00 00-00 00-00 00-00>",
- Print(::foo::UnprintableInFoo()));
-}
-
-// Unprintable types are that too big to be printed completely.
-
-struct Big {
- Big() { memset(array, 0, sizeof(array)); }
- char array[257];
-};
-
-TEST(PrintUnpritableTypeTest, BigObject) {
- EXPECT_EQ("257-byte object <00-00 00-00 00-00 00-00 00-00 00-00 "
- "00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 "
- "00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 "
- "00-00 00-00 00-00 00-00 00-00 00-00 ... 00-00 00-00 00-00 "
- "00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 "
- "00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 "
- "00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00>",
- Print(Big()));
-}
-
-// Tests printing user-defined streamable types.
-
-// Streamable types in the global namespace.
-TEST(PrintStreamableTypeTest, InGlobalNamespace) {
- StreamableInGlobal x;
- EXPECT_EQ("StreamableInGlobal", Print(x));
- EXPECT_EQ("StreamableInGlobal*", Print(&x));
-}
-
-// Printable template types in a user namespace.
-TEST(PrintStreamableTypeTest, TemplateTypeInUserNamespace) {
- EXPECT_EQ("StreamableTemplateInFoo: 0",
- Print(::foo::StreamableTemplateInFoo<int>()));
-}
-
-// Tests printing user-defined types that have a PrintTo() function.
-TEST(PrintPrintableTypeTest, InUserNamespace) {
- EXPECT_EQ("PrintableViaPrintTo: 0",
- Print(::foo::PrintableViaPrintTo()));
-}
-
-// Tests printing a pointer to a user-defined type that has a <<
-// operator for its pointer.
-TEST(PrintPrintableTypeTest, PointerInUserNamespace) {
- ::foo::PointerPrintable x;
- EXPECT_EQ("PointerPrintable*", Print(&x));
-}
-
-// Tests printing user-defined class template that have a PrintTo() function.
-TEST(PrintPrintableTypeTest, TemplateInUserNamespace) {
- EXPECT_EQ("PrintableViaPrintToTemplate: 5",
- Print(::foo::PrintableViaPrintToTemplate<int>(5)));
-}
-
-#if GTEST_HAS_PROTOBUF_
-
-// Tests printing a protocol message.
-TEST(PrintProtocolMessageTest, PrintsShortDebugString) {
- testing::internal::TestMessage msg;
- msg.set_member("yes");
- EXPECT_EQ("<member:\"yes\">", Print(msg));
-}
-
-// Tests printing a short proto2 message.
-TEST(PrintProto2MessageTest, PrintsShortDebugStringWhenItIsShort) {
- testing::internal::FooMessage msg;
- msg.set_int_field(2);
- msg.set_string_field("hello");
- EXPECT_PRED2(RE::FullMatch, Print(msg),
- "<int_field:\\s*2\\s+string_field:\\s*\"hello\">");
-}
-
-// Tests printing a long proto2 message.
-TEST(PrintProto2MessageTest, PrintsDebugStringWhenItIsLong) {
- testing::internal::FooMessage msg;
- msg.set_int_field(2);
- msg.set_string_field("hello");
- msg.add_names("peter");
- msg.add_names("paul");
- msg.add_names("mary");
- EXPECT_PRED2(RE::FullMatch, Print(msg),
- "<\n"
- "int_field:\\s*2\n"
- "string_field:\\s*\"hello\"\n"
- "names:\\s*\"peter\"\n"
- "names:\\s*\"paul\"\n"
- "names:\\s*\"mary\"\n"
- ">");
-}
-
-#endif // GTEST_HAS_PROTOBUF_
-
-// Tests that the universal printer prints both the address and the
-// value of a reference.
-TEST(PrintReferenceTest, PrintsAddressAndValue) {
- int n = 5;
- EXPECT_EQ("@" + PrintPointer(&n) + " 5", PrintByRef(n));
-
- int a[2][3] = {
- { 0, 1, 2 },
- { 3, 4, 5 }
- };
- EXPECT_EQ("@" + PrintPointer(a) + " { { 0, 1, 2 }, { 3, 4, 5 } }",
- PrintByRef(a));
-
- const ::foo::UnprintableInFoo x;
- EXPECT_EQ("@" + PrintPointer(&x) + " 16-byte object "
- "<EF-12 00-00 34-AB 00-00 00-00 00-00 00-00 00-00>",
- PrintByRef(x));
-}
-
-// Tests that the universal printer prints a function pointer passed by
-// reference.
-TEST(PrintReferenceTest, HandlesFunctionPointer) {
- void (*fp)(int n) = &MyFunction;
- const string fp_pointer_string =
- PrintPointer(reinterpret_cast<const void*>(&fp));
- // We cannot directly cast &MyFunction to const void* because the
- // standard disallows casting between pointers to functions and
- // pointers to objects, and some compilers (e.g. GCC 3.4) enforce
- // this limitation.
- const string fp_string = PrintPointer(reinterpret_cast<const void*>(
- reinterpret_cast<internal::BiggestInt>(fp)));
- EXPECT_EQ("@" + fp_pointer_string + " " + fp_string,
- PrintByRef(fp));
-}
-
-// Tests that the universal printer prints a member function pointer
-// passed by reference.
-TEST(PrintReferenceTest, HandlesMemberFunctionPointer) {
- int (Foo::*p)(char ch) = &Foo::MyMethod;
- EXPECT_TRUE(HasPrefix(
- PrintByRef(p),
- "@" + PrintPointer(reinterpret_cast<const void*>(&p)) + " " +
- Print(sizeof(p)) + "-byte object "));
-
- char (Foo::*p2)(int n) = &Foo::MyVirtualMethod;
- EXPECT_TRUE(HasPrefix(
- PrintByRef(p2),
- "@" + PrintPointer(reinterpret_cast<const void*>(&p2)) + " " +
- Print(sizeof(p2)) + "-byte object "));
-}
-
-// Tests that the universal printer prints a member variable pointer
-// passed by reference.
-TEST(PrintReferenceTest, HandlesMemberVariablePointer) {
- int (Foo::*p) = &Foo::value; // NOLINT
- EXPECT_TRUE(HasPrefix(
- PrintByRef(p),
- "@" + PrintPointer(&p) + " " + Print(sizeof(p)) + "-byte object "));
-}
-
-// Useful for testing PrintToString(). We cannot use EXPECT_EQ()
-// there as its implementation uses PrintToString(). The caller must
-// ensure that 'value' has no side effect.
-#define EXPECT_PRINT_TO_STRING_(value, expected_string) \
- EXPECT_TRUE(PrintToString(value) == (expected_string)) \
- << " where " #value " prints as " << (PrintToString(value))
-
-TEST(PrintToStringTest, WorksForScalar) {
- EXPECT_PRINT_TO_STRING_(123, "123");
-}
-
-TEST(PrintToStringTest, WorksForPointerToConstChar) {
- const char* p = "hello";
- EXPECT_PRINT_TO_STRING_(p, "\"hello\"");
-}
-
-TEST(PrintToStringTest, WorksForPointerToNonConstChar) {
- char s[] = "hello";
- char* p = s;
- EXPECT_PRINT_TO_STRING_(p, "\"hello\"");
-}
-
-TEST(PrintToStringTest, WorksForArray) {
- int n[3] = { 1, 2, 3 };
- EXPECT_PRINT_TO_STRING_(n, "{ 1, 2, 3 }");
-}
-
-#undef EXPECT_PRINT_TO_STRING_
-
-TEST(UniversalTersePrintTest, WorksForNonReference) {
- ::std::stringstream ss;
- UniversalTersePrint(123, &ss);
- EXPECT_EQ("123", ss.str());
-}
-
-TEST(UniversalTersePrintTest, WorksForReference) {
- const int& n = 123;
- ::std::stringstream ss;
- UniversalTersePrint(n, &ss);
- EXPECT_EQ("123", ss.str());
-}
-
-TEST(UniversalTersePrintTest, WorksForCString) {
- const char* s1 = "abc";
- ::std::stringstream ss1;
- UniversalTersePrint(s1, &ss1);
- EXPECT_EQ("\"abc\"", ss1.str());
-
- char* s2 = const_cast<char*>(s1);
- ::std::stringstream ss2;
- UniversalTersePrint(s2, &ss2);
- EXPECT_EQ("\"abc\"", ss2.str());
-
- const char* s3 = NULL;
- ::std::stringstream ss3;
- UniversalTersePrint(s3, &ss3);
- EXPECT_EQ("NULL", ss3.str());
-}
-
-TEST(UniversalPrintTest, WorksForNonReference) {
- ::std::stringstream ss;
- UniversalPrint(123, &ss);
- EXPECT_EQ("123", ss.str());
-}
-
-TEST(UniversalPrintTest, WorksForReference) {
- const int& n = 123;
- ::std::stringstream ss;
- UniversalPrint(n, &ss);
- EXPECT_EQ("123", ss.str());
-}
-
-TEST(UniversalPrintTest, WorksForCString) {
- const char* s1 = "abc";
- ::std::stringstream ss1;
- UniversalPrint(s1, &ss1);
- EXPECT_EQ(PrintPointer(s1) + " pointing to \"abc\"", string(ss1.str()));
-
- char* s2 = const_cast<char*>(s1);
- ::std::stringstream ss2;
- UniversalPrint(s2, &ss2);
- EXPECT_EQ(PrintPointer(s2) + " pointing to \"abc\"", string(ss2.str()));
-
- const char* s3 = NULL;
- ::std::stringstream ss3;
- UniversalPrint(s3, &ss3);
- EXPECT_EQ("NULL", ss3.str());
-}
-
-
-#if GTEST_HAS_TR1_TUPLE
-
-TEST(UniversalTersePrintTupleFieldsToStringsTest, PrintsEmptyTuple) {
- Strings result = UniversalTersePrintTupleFieldsToStrings(make_tuple());
- EXPECT_EQ(0u, result.size());
-}
-
-TEST(UniversalTersePrintTupleFieldsToStringsTest, PrintsOneTuple) {
- Strings result = UniversalTersePrintTupleFieldsToStrings(make_tuple(1));
- ASSERT_EQ(1u, result.size());
- EXPECT_EQ("1", result[0]);
-}
-
-TEST(UniversalTersePrintTupleFieldsToStringsTest, PrintsTwoTuple) {
- Strings result = UniversalTersePrintTupleFieldsToStrings(make_tuple(1, 'a'));
- ASSERT_EQ(2u, result.size());
- EXPECT_EQ("1", result[0]);
- EXPECT_EQ("'a' (97, 0x61)", result[1]);
-}
-
-TEST(UniversalTersePrintTupleFieldsToStringsTest, PrintsTersely) {
- const int n = 1;
- Strings result = UniversalTersePrintTupleFieldsToStrings(
- tuple<const int&, const char*>(n, "a"));
- ASSERT_EQ(2u, result.size());
- EXPECT_EQ("1", result[0]);
- EXPECT_EQ("\"a\"", result[1]);
-}
-
-#endif // GTEST_HAS_TR1_TUPLE
-
-} // namespace gtest_printers_test
-} // namespace testing
diff --git a/src/testing/gtest/test/gtest-test-part_test.cc b/src/testing/gtest/test/gtest-test-part_test.cc
deleted file mode 100644
index ca8ba933..00000000
--- a/src/testing/gtest/test/gtest-test-part_test.cc
+++ /dev/null
@@ -1,208 +0,0 @@
-// Copyright 2008 Google Inc.
-// All Rights Reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: mheule@google.com (Markus Heule)
-//
-
-#include "gtest/gtest-test-part.h"
-
-#include "gtest/gtest.h"
-
-using testing::Message;
-using testing::Test;
-using testing::TestPartResult;
-using testing::TestPartResultArray;
-
-namespace {
-
-// Tests the TestPartResult class.
-
-// The test fixture for testing TestPartResult.
-class TestPartResultTest : public Test {
- protected:
- TestPartResultTest()
- : r1_(TestPartResult::kSuccess, "foo/bar.cc", 10, "Success!"),
- r2_(TestPartResult::kNonFatalFailure, "foo/bar.cc", -1, "Failure!"),
- r3_(TestPartResult::kFatalFailure, NULL, -1, "Failure!") {}
-
- TestPartResult r1_, r2_, r3_;
-};
-
-
-TEST_F(TestPartResultTest, ConstructorWorks) {
- Message message;
- message << "something is terribly wrong";
- message << static_cast<const char*>(testing::internal::kStackTraceMarker);
- message << "some unimportant stack trace";
-
- const TestPartResult result(TestPartResult::kNonFatalFailure,
- "some_file.cc",
- 42,
- message.GetString().c_str());
-
- EXPECT_EQ(TestPartResult::kNonFatalFailure, result.type());
- EXPECT_STREQ("some_file.cc", result.file_name());
- EXPECT_EQ(42, result.line_number());
- EXPECT_STREQ(message.GetString().c_str(), result.message());
- EXPECT_STREQ("something is terribly wrong", result.summary());
-}
-
-TEST_F(TestPartResultTest, ResultAccessorsWork) {
- const TestPartResult success(TestPartResult::kSuccess,
- "file.cc",
- 42,
- "message");
- EXPECT_TRUE(success.passed());
- EXPECT_FALSE(success.failed());
- EXPECT_FALSE(success.nonfatally_failed());
- EXPECT_FALSE(success.fatally_failed());
-
- const TestPartResult nonfatal_failure(TestPartResult::kNonFatalFailure,
- "file.cc",
- 42,
- "message");
- EXPECT_FALSE(nonfatal_failure.passed());
- EXPECT_TRUE(nonfatal_failure.failed());
- EXPECT_TRUE(nonfatal_failure.nonfatally_failed());
- EXPECT_FALSE(nonfatal_failure.fatally_failed());
-
- const TestPartResult fatal_failure(TestPartResult::kFatalFailure,
- "file.cc",
- 42,
- "message");
- EXPECT_FALSE(fatal_failure.passed());
- EXPECT_TRUE(fatal_failure.failed());
- EXPECT_FALSE(fatal_failure.nonfatally_failed());
- EXPECT_TRUE(fatal_failure.fatally_failed());
-}
-
-// Tests TestPartResult::type().
-TEST_F(TestPartResultTest, type) {
- EXPECT_EQ(TestPartResult::kSuccess, r1_.type());
- EXPECT_EQ(TestPartResult::kNonFatalFailure, r2_.type());
- EXPECT_EQ(TestPartResult::kFatalFailure, r3_.type());
-}
-
-// Tests TestPartResult::file_name().
-TEST_F(TestPartResultTest, file_name) {
- EXPECT_STREQ("foo/bar.cc", r1_.file_name());
- EXPECT_STREQ(NULL, r3_.file_name());
-}
-
-// Tests TestPartResult::line_number().
-TEST_F(TestPartResultTest, line_number) {
- EXPECT_EQ(10, r1_.line_number());
- EXPECT_EQ(-1, r2_.line_number());
-}
-
-// Tests TestPartResult::message().
-TEST_F(TestPartResultTest, message) {
- EXPECT_STREQ("Success!", r1_.message());
-}
-
-// Tests TestPartResult::passed().
-TEST_F(TestPartResultTest, Passed) {
- EXPECT_TRUE(r1_.passed());
- EXPECT_FALSE(r2_.passed());
- EXPECT_FALSE(r3_.passed());
-}
-
-// Tests TestPartResult::failed().
-TEST_F(TestPartResultTest, Failed) {
- EXPECT_FALSE(r1_.failed());
- EXPECT_TRUE(r2_.failed());
- EXPECT_TRUE(r3_.failed());
-}
-
-// Tests TestPartResult::fatally_failed().
-TEST_F(TestPartResultTest, FatallyFailed) {
- EXPECT_FALSE(r1_.fatally_failed());
- EXPECT_FALSE(r2_.fatally_failed());
- EXPECT_TRUE(r3_.fatally_failed());
-}
-
-// Tests TestPartResult::nonfatally_failed().
-TEST_F(TestPartResultTest, NonfatallyFailed) {
- EXPECT_FALSE(r1_.nonfatally_failed());
- EXPECT_TRUE(r2_.nonfatally_failed());
- EXPECT_FALSE(r3_.nonfatally_failed());
-}
-
-// Tests the TestPartResultArray class.
-
-class TestPartResultArrayTest : public Test {
- protected:
- TestPartResultArrayTest()
- : r1_(TestPartResult::kNonFatalFailure, "foo/bar.cc", -1, "Failure 1"),
- r2_(TestPartResult::kFatalFailure, "foo/bar.cc", -1, "Failure 2") {}
-
- const TestPartResult r1_, r2_;
-};
-
-// Tests that TestPartResultArray initially has size 0.
-TEST_F(TestPartResultArrayTest, InitialSizeIsZero) {
- TestPartResultArray results;
- EXPECT_EQ(0, results.size());
-}
-
-// Tests that TestPartResultArray contains the given TestPartResult
-// after one Append() operation.
-TEST_F(TestPartResultArrayTest, ContainsGivenResultAfterAppend) {
- TestPartResultArray results;
- results.Append(r1_);
- EXPECT_EQ(1, results.size());
- EXPECT_STREQ("Failure 1", results.GetTestPartResult(0).message());
-}
-
-// Tests that TestPartResultArray contains the given TestPartResults
-// after two Append() operations.
-TEST_F(TestPartResultArrayTest, ContainsGivenResultsAfterTwoAppends) {
- TestPartResultArray results;
- results.Append(r1_);
- results.Append(r2_);
- EXPECT_EQ(2, results.size());
- EXPECT_STREQ("Failure 1", results.GetTestPartResult(0).message());
- EXPECT_STREQ("Failure 2", results.GetTestPartResult(1).message());
-}
-
-typedef TestPartResultArrayTest TestPartResultArrayDeathTest;
-
-// Tests that the program dies when GetTestPartResult() is called with
-// an invalid index.
-TEST_F(TestPartResultArrayDeathTest, DiesWhenIndexIsOutOfBound) {
- TestPartResultArray results;
- results.Append(r1_);
-
- EXPECT_DEATH_IF_SUPPORTED(results.GetTestPartResult(-1), "");
- EXPECT_DEATH_IF_SUPPORTED(results.GetTestPartResult(1), "");
-}
-
-// TODO(mheule@google.com): Add a test for the class HasNewFatalFailureHelper.
-
-} // namespace
diff --git a/src/testing/gtest/test/gtest-tuple_test.cc b/src/testing/gtest/test/gtest-tuple_test.cc
deleted file mode 100644
index bfaa3e0a..00000000
--- a/src/testing/gtest/test/gtest-tuple_test.cc
+++ /dev/null
@@ -1,320 +0,0 @@
-// Copyright 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-#include "gtest/internal/gtest-tuple.h"
-#include <utility>
-#include "gtest/gtest.h"
-
-namespace {
-
-using ::std::tr1::get;
-using ::std::tr1::make_tuple;
-using ::std::tr1::tuple;
-using ::std::tr1::tuple_element;
-using ::std::tr1::tuple_size;
-using ::testing::StaticAssertTypeEq;
-
-// Tests that tuple_element<K, tuple<T0, T1, ..., TN> >::type returns TK.
-TEST(tuple_element_Test, ReturnsElementType) {
- StaticAssertTypeEq<int, tuple_element<0, tuple<int, char> >::type>();
- StaticAssertTypeEq<int&, tuple_element<1, tuple<double, int&> >::type>();
- StaticAssertTypeEq<bool, tuple_element<2, tuple<double, int, bool> >::type>();
-}
-
-// Tests that tuple_size<T>::value gives the number of fields in tuple
-// type T.
-TEST(tuple_size_Test, ReturnsNumberOfFields) {
- EXPECT_EQ(0, +tuple_size<tuple<> >::value);
- EXPECT_EQ(1, +tuple_size<tuple<void*> >::value);
- EXPECT_EQ(1, +tuple_size<tuple<char> >::value);
- EXPECT_EQ(1, +(tuple_size<tuple<tuple<int, double> > >::value));
- EXPECT_EQ(2, +(tuple_size<tuple<int&, const char> >::value));
- EXPECT_EQ(3, +(tuple_size<tuple<char*, void, const bool&> >::value));
-}
-
-// Tests comparing a tuple with itself.
-TEST(ComparisonTest, ComparesWithSelf) {
- const tuple<int, char, bool> a(5, 'a', false);
-
- EXPECT_TRUE(a == a);
- EXPECT_FALSE(a != a);
-}
-
-// Tests comparing two tuples with the same value.
-TEST(ComparisonTest, ComparesEqualTuples) {
- const tuple<int, bool> a(5, true), b(5, true);
-
- EXPECT_TRUE(a == b);
- EXPECT_FALSE(a != b);
-}
-
-// Tests comparing two different tuples that have no reference fields.
-TEST(ComparisonTest, ComparesUnequalTuplesWithoutReferenceFields) {
- typedef tuple<const int, char> FooTuple;
-
- const FooTuple a(0, 'x');
- const FooTuple b(1, 'a');
-
- EXPECT_TRUE(a != b);
- EXPECT_FALSE(a == b);
-
- const FooTuple c(1, 'b');
-
- EXPECT_TRUE(b != c);
- EXPECT_FALSE(b == c);
-}
-
-// Tests comparing two different tuples that have reference fields.
-TEST(ComparisonTest, ComparesUnequalTuplesWithReferenceFields) {
- typedef tuple<int&, const char&> FooTuple;
-
- int i = 5;
- const char ch = 'a';
- const FooTuple a(i, ch);
-
- int j = 6;
- const FooTuple b(j, ch);
-
- EXPECT_TRUE(a != b);
- EXPECT_FALSE(a == b);
-
- j = 5;
- const char ch2 = 'b';
- const FooTuple c(j, ch2);
-
- EXPECT_TRUE(b != c);
- EXPECT_FALSE(b == c);
-}
-
-// Tests that a tuple field with a reference type is an alias of the
-// variable it's supposed to reference.
-TEST(ReferenceFieldTest, IsAliasOfReferencedVariable) {
- int n = 0;
- tuple<bool, int&> t(true, n);
-
- n = 1;
- EXPECT_EQ(n, get<1>(t))
- << "Changing a underlying variable should update the reference field.";
-
- // Makes sure that the implementation doesn't do anything funny with
- // the & operator for the return type of get<>().
- EXPECT_EQ(&n, &(get<1>(t)))
- << "The address of a reference field should equal the address of "
- << "the underlying variable.";
-
- get<1>(t) = 2;
- EXPECT_EQ(2, n)
- << "Changing a reference field should update the underlying variable.";
-}
-
-// Tests that tuple's default constructor default initializes each field.
-// This test needs to compile without generating warnings.
-TEST(TupleConstructorTest, DefaultConstructorDefaultInitializesEachField) {
- // The TR1 report requires that tuple's default constructor default
- // initializes each field, even if it's a primitive type. If the
- // implementation forgets to do this, this test will catch it by
- // generating warnings about using uninitialized variables (assuming
- // a decent compiler).
-
- tuple<> empty;
-
- tuple<int> a1, b1;
- b1 = a1;
- EXPECT_EQ(0, get<0>(b1));
-
- tuple<int, double> a2, b2;
- b2 = a2;
- EXPECT_EQ(0, get<0>(b2));
- EXPECT_EQ(0.0, get<1>(b2));
-
- tuple<double, char, bool*> a3, b3;
- b3 = a3;
- EXPECT_EQ(0.0, get<0>(b3));
- EXPECT_EQ('\0', get<1>(b3));
- EXPECT_TRUE(get<2>(b3) == NULL);
-
- tuple<int, int, int, int, int, int, int, int, int, int> a10, b10;
- b10 = a10;
- EXPECT_EQ(0, get<0>(b10));
- EXPECT_EQ(0, get<1>(b10));
- EXPECT_EQ(0, get<2>(b10));
- EXPECT_EQ(0, get<3>(b10));
- EXPECT_EQ(0, get<4>(b10));
- EXPECT_EQ(0, get<5>(b10));
- EXPECT_EQ(0, get<6>(b10));
- EXPECT_EQ(0, get<7>(b10));
- EXPECT_EQ(0, get<8>(b10));
- EXPECT_EQ(0, get<9>(b10));
-}
-
-// Tests constructing a tuple from its fields.
-TEST(TupleConstructorTest, ConstructsFromFields) {
- int n = 1;
- // Reference field.
- tuple<int&> a(n);
- EXPECT_EQ(&n, &(get<0>(a)));
-
- // Non-reference fields.
- tuple<int, char> b(5, 'a');
- EXPECT_EQ(5, get<0>(b));
- EXPECT_EQ('a', get<1>(b));
-
- // Const reference field.
- const int m = 2;
- tuple<bool, const int&> c(true, m);
- EXPECT_TRUE(get<0>(c));
- EXPECT_EQ(&m, &(get<1>(c)));
-}
-
-// Tests tuple's copy constructor.
-TEST(TupleConstructorTest, CopyConstructor) {
- tuple<double, bool> a(0.0, true);
- tuple<double, bool> b(a);
-
- EXPECT_DOUBLE_EQ(0.0, get<0>(b));
- EXPECT_TRUE(get<1>(b));
-}
-
-// Tests constructing a tuple from another tuple that has a compatible
-// but different type.
-TEST(TupleConstructorTest, ConstructsFromDifferentTupleType) {
- tuple<int, int, char> a(0, 1, 'a');
- tuple<double, long, int> b(a);
-
- EXPECT_DOUBLE_EQ(0.0, get<0>(b));
- EXPECT_EQ(1, get<1>(b));
- EXPECT_EQ('a', get<2>(b));
-}
-
-// Tests constructing a 2-tuple from an std::pair.
-TEST(TupleConstructorTest, ConstructsFromPair) {
- ::std::pair<int, char> a(1, 'a');
- tuple<int, char> b(a);
- tuple<int, const char&> c(a);
-}
-
-// Tests assigning a tuple to another tuple with the same type.
-TEST(TupleAssignmentTest, AssignsToSameTupleType) {
- const tuple<int, long> a(5, 7L);
- tuple<int, long> b;
- b = a;
- EXPECT_EQ(5, get<0>(b));
- EXPECT_EQ(7L, get<1>(b));
-}
-
-// Tests assigning a tuple to another tuple with a different but
-// compatible type.
-TEST(TupleAssignmentTest, AssignsToDifferentTupleType) {
- const tuple<int, long, bool> a(1, 7L, true);
- tuple<long, int, bool> b;
- b = a;
- EXPECT_EQ(1L, get<0>(b));
- EXPECT_EQ(7, get<1>(b));
- EXPECT_TRUE(get<2>(b));
-}
-
-// Tests assigning an std::pair to a 2-tuple.
-TEST(TupleAssignmentTest, AssignsFromPair) {
- const ::std::pair<int, bool> a(5, true);
- tuple<int, bool> b;
- b = a;
- EXPECT_EQ(5, get<0>(b));
- EXPECT_TRUE(get<1>(b));
-
- tuple<long, bool> c;
- c = a;
- EXPECT_EQ(5L, get<0>(c));
- EXPECT_TRUE(get<1>(c));
-}
-
-// A fixture for testing big tuples.
-class BigTupleTest : public testing::Test {
- protected:
- typedef tuple<int, int, int, int, int, int, int, int, int, int> BigTuple;
-
- BigTupleTest() :
- a_(1, 0, 0, 0, 0, 0, 0, 0, 0, 2),
- b_(1, 0, 0, 0, 0, 0, 0, 0, 0, 3) {}
-
- BigTuple a_, b_;
-};
-
-// Tests constructing big tuples.
-TEST_F(BigTupleTest, Construction) {
- BigTuple a;
- BigTuple b(b_);
-}
-
-// Tests that get<N>(t) returns the N-th (0-based) field of tuple t.
-TEST_F(BigTupleTest, get) {
- EXPECT_EQ(1, get<0>(a_));
- EXPECT_EQ(2, get<9>(a_));
-
- // Tests that get() works on a const tuple too.
- const BigTuple a(a_);
- EXPECT_EQ(1, get<0>(a));
- EXPECT_EQ(2, get<9>(a));
-}
-
-// Tests comparing big tuples.
-TEST_F(BigTupleTest, Comparisons) {
- EXPECT_TRUE(a_ == a_);
- EXPECT_FALSE(a_ != a_);
-
- EXPECT_TRUE(a_ != b_);
- EXPECT_FALSE(a_ == b_);
-}
-
-TEST(MakeTupleTest, WorksForScalarTypes) {
- tuple<bool, int> a;
- a = make_tuple(true, 5);
- EXPECT_TRUE(get<0>(a));
- EXPECT_EQ(5, get<1>(a));
-
- tuple<char, int, long> b;
- b = make_tuple('a', 'b', 5);
- EXPECT_EQ('a', get<0>(b));
- EXPECT_EQ('b', get<1>(b));
- EXPECT_EQ(5, get<2>(b));
-}
-
-TEST(MakeTupleTest, WorksForPointers) {
- int a[] = { 1, 2, 3, 4 };
- const char* const str = "hi";
- int* const p = a;
-
- tuple<const char*, int*> t;
- t = make_tuple(str, p);
- EXPECT_EQ(str, get<0>(t));
- EXPECT_EQ(p, get<1>(t));
-}
-
-} // namespace
diff --git a/src/testing/gtest/test/gtest-typed-test_test.cc b/src/testing/gtest/test/gtest-typed-test_test.cc
deleted file mode 100644
index dd4ba43b..00000000
--- a/src/testing/gtest/test/gtest-typed-test_test.cc
+++ /dev/null
@@ -1,360 +0,0 @@
-// Copyright 2008 Google Inc.
-// All Rights Reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-#include <set>
-#include <vector>
-
-#include "test/gtest-typed-test_test.h"
-#include "gtest/gtest.h"
-
-using testing::Test;
-
-// Used for testing that SetUpTestCase()/TearDownTestCase(), fixture
-// ctor/dtor, and SetUp()/TearDown() work correctly in typed tests and
-// type-parameterized test.
-template <typename T>
-class CommonTest : public Test {
- // For some technical reason, SetUpTestCase() and TearDownTestCase()
- // must be public.
- public:
- static void SetUpTestCase() {
- shared_ = new T(5);
- }
-
- static void TearDownTestCase() {
- delete shared_;
- shared_ = NULL;
- }
-
- // This 'protected:' is optional. There's no harm in making all
- // members of this fixture class template public.
- protected:
- // We used to use std::list here, but switched to std::vector since
- // MSVC's <list> doesn't compile cleanly with /W4.
- typedef std::vector<T> Vector;
- typedef std::set<int> IntSet;
-
- CommonTest() : value_(1) {}
-
- virtual ~CommonTest() { EXPECT_EQ(3, value_); }
-
- virtual void SetUp() {
- EXPECT_EQ(1, value_);
- value_++;
- }
-
- virtual void TearDown() {
- EXPECT_EQ(2, value_);
- value_++;
- }
-
- T value_;
- static T* shared_;
-};
-
-template <typename T>
-T* CommonTest<T>::shared_ = NULL;
-
-// This #ifdef block tests typed tests.
-#if GTEST_HAS_TYPED_TEST
-
-using testing::Types;
-
-// Tests that SetUpTestCase()/TearDownTestCase(), fixture ctor/dtor,
-// and SetUp()/TearDown() work correctly in typed tests
-
-typedef Types<char, int> TwoTypes;
-TYPED_TEST_CASE(CommonTest, TwoTypes);
-
-TYPED_TEST(CommonTest, ValuesAreCorrect) {
- // Static members of the fixture class template can be visited via
- // the TestFixture:: prefix.
- EXPECT_EQ(5, *TestFixture::shared_);
-
- // Typedefs in the fixture class template can be visited via the
- // "typename TestFixture::" prefix.
- typename TestFixture::Vector empty;
- EXPECT_EQ(0U, empty.size());
-
- typename TestFixture::IntSet empty2;
- EXPECT_EQ(0U, empty2.size());
-
- // Non-static members of the fixture class must be visited via
- // 'this', as required by C++ for class templates.
- EXPECT_EQ(2, this->value_);
-}
-
-// The second test makes sure shared_ is not deleted after the first
-// test.
-TYPED_TEST(CommonTest, ValuesAreStillCorrect) {
- // Static members of the fixture class template can also be visited
- // via 'this'.
- ASSERT_TRUE(this->shared_ != NULL);
- EXPECT_EQ(5, *this->shared_);
-
- // TypeParam can be used to refer to the type parameter.
- EXPECT_EQ(static_cast<TypeParam>(2), this->value_);
-}
-
-// Tests that multiple TYPED_TEST_CASE's can be defined in the same
-// translation unit.
-
-template <typename T>
-class TypedTest1 : public Test {
-};
-
-// Verifies that the second argument of TYPED_TEST_CASE can be a
-// single type.
-TYPED_TEST_CASE(TypedTest1, int);
-TYPED_TEST(TypedTest1, A) {}
-
-template <typename T>
-class TypedTest2 : public Test {
-};
-
-// Verifies that the second argument of TYPED_TEST_CASE can be a
-// Types<...> type list.
-TYPED_TEST_CASE(TypedTest2, Types<int>);
-
-// This also verifies that tests from different typed test cases can
-// share the same name.
-TYPED_TEST(TypedTest2, A) {}
-
-// Tests that a typed test case can be defined in a namespace.
-
-namespace library1 {
-
-template <typename T>
-class NumericTest : public Test {
-};
-
-typedef Types<int, long> NumericTypes;
-TYPED_TEST_CASE(NumericTest, NumericTypes);
-
-TYPED_TEST(NumericTest, DefaultIsZero) {
- EXPECT_EQ(0, TypeParam());
-}
-
-} // namespace library1
-
-#endif // GTEST_HAS_TYPED_TEST
-
-// This #ifdef block tests type-parameterized tests.
-#if GTEST_HAS_TYPED_TEST_P
-
-using testing::Types;
-using testing::internal::TypedTestCasePState;
-
-// Tests TypedTestCasePState.
-
-class TypedTestCasePStateTest : public Test {
- protected:
- virtual void SetUp() {
- state_.AddTestName("foo.cc", 0, "FooTest", "A");
- state_.AddTestName("foo.cc", 0, "FooTest", "B");
- state_.AddTestName("foo.cc", 0, "FooTest", "C");
- }
-
- TypedTestCasePState state_;
-};
-
-TEST_F(TypedTestCasePStateTest, SucceedsForMatchingList) {
- const char* tests = "A, B, C";
- EXPECT_EQ(tests,
- state_.VerifyRegisteredTestNames("foo.cc", 1, tests));
-}
-
-// Makes sure that the order of the tests and spaces around the names
-// don't matter.
-TEST_F(TypedTestCasePStateTest, IgnoresOrderAndSpaces) {
- const char* tests = "A,C, B";
- EXPECT_EQ(tests,
- state_.VerifyRegisteredTestNames("foo.cc", 1, tests));
-}
-
-typedef TypedTestCasePStateTest TypedTestCasePStateDeathTest;
-
-TEST_F(TypedTestCasePStateDeathTest, DetectsDuplicates) {
- EXPECT_DEATH_IF_SUPPORTED(
- state_.VerifyRegisteredTestNames("foo.cc", 1, "A, B, A, C"),
- "foo\\.cc.1.?: Test A is listed more than once\\.");
-}
-
-TEST_F(TypedTestCasePStateDeathTest, DetectsExtraTest) {
- EXPECT_DEATH_IF_SUPPORTED(
- state_.VerifyRegisteredTestNames("foo.cc", 1, "A, B, C, D"),
- "foo\\.cc.1.?: No test named D can be found in this test case\\.");
-}
-
-TEST_F(TypedTestCasePStateDeathTest, DetectsMissedTest) {
- EXPECT_DEATH_IF_SUPPORTED(
- state_.VerifyRegisteredTestNames("foo.cc", 1, "A, C"),
- "foo\\.cc.1.?: You forgot to list test B\\.");
-}
-
-// Tests that defining a test for a parameterized test case generates
-// a run-time error if the test case has been registered.
-TEST_F(TypedTestCasePStateDeathTest, DetectsTestAfterRegistration) {
- state_.VerifyRegisteredTestNames("foo.cc", 1, "A, B, C");
- EXPECT_DEATH_IF_SUPPORTED(
- state_.AddTestName("foo.cc", 2, "FooTest", "D"),
- "foo\\.cc.2.?: Test D must be defined before REGISTER_TYPED_TEST_CASE_P"
- "\\(FooTest, \\.\\.\\.\\)\\.");
-}
-
-// Tests that SetUpTestCase()/TearDownTestCase(), fixture ctor/dtor,
-// and SetUp()/TearDown() work correctly in type-parameterized tests.
-
-template <typename T>
-class DerivedTest : public CommonTest<T> {
-};
-
-TYPED_TEST_CASE_P(DerivedTest);
-
-TYPED_TEST_P(DerivedTest, ValuesAreCorrect) {
- // Static members of the fixture class template can be visited via
- // the TestFixture:: prefix.
- EXPECT_EQ(5, *TestFixture::shared_);
-
- // Non-static members of the fixture class must be visited via
- // 'this', as required by C++ for class templates.
- EXPECT_EQ(2, this->value_);
-}
-
-// The second test makes sure shared_ is not deleted after the first
-// test.
-TYPED_TEST_P(DerivedTest, ValuesAreStillCorrect) {
- // Static members of the fixture class template can also be visited
- // via 'this'.
- ASSERT_TRUE(this->shared_ != NULL);
- EXPECT_EQ(5, *this->shared_);
- EXPECT_EQ(2, this->value_);
-}
-
-REGISTER_TYPED_TEST_CASE_P(DerivedTest,
- ValuesAreCorrect, ValuesAreStillCorrect);
-
-typedef Types<short, long> MyTwoTypes;
-INSTANTIATE_TYPED_TEST_CASE_P(My, DerivedTest, MyTwoTypes);
-
-// Tests that multiple TYPED_TEST_CASE_P's can be defined in the same
-// translation unit.
-
-template <typename T>
-class TypedTestP1 : public Test {
-};
-
-TYPED_TEST_CASE_P(TypedTestP1);
-
-// For testing that the code between TYPED_TEST_CASE_P() and
-// TYPED_TEST_P() is not enclosed in a namespace.
-typedef int IntAfterTypedTestCaseP;
-
-TYPED_TEST_P(TypedTestP1, A) {}
-TYPED_TEST_P(TypedTestP1, B) {}
-
-// For testing that the code between TYPED_TEST_P() and
-// REGISTER_TYPED_TEST_CASE_P() is not enclosed in a namespace.
-typedef int IntBeforeRegisterTypedTestCaseP;
-
-REGISTER_TYPED_TEST_CASE_P(TypedTestP1, A, B);
-
-template <typename T>
-class TypedTestP2 : public Test {
-};
-
-TYPED_TEST_CASE_P(TypedTestP2);
-
-// This also verifies that tests from different type-parameterized
-// test cases can share the same name.
-TYPED_TEST_P(TypedTestP2, A) {}
-
-REGISTER_TYPED_TEST_CASE_P(TypedTestP2, A);
-
-// Verifies that the code between TYPED_TEST_CASE_P() and
-// REGISTER_TYPED_TEST_CASE_P() is not enclosed in a namespace.
-IntAfterTypedTestCaseP after = 0;
-IntBeforeRegisterTypedTestCaseP before = 0;
-
-// Verifies that the last argument of INSTANTIATE_TYPED_TEST_CASE_P()
-// can be either a single type or a Types<...> type list.
-INSTANTIATE_TYPED_TEST_CASE_P(Int, TypedTestP1, int);
-INSTANTIATE_TYPED_TEST_CASE_P(Int, TypedTestP2, Types<int>);
-
-// Tests that the same type-parameterized test case can be
-// instantiated more than once in the same translation unit.
-INSTANTIATE_TYPED_TEST_CASE_P(Double, TypedTestP2, Types<double>);
-
-// Tests that the same type-parameterized test case can be
-// instantiated in different translation units linked together.
-// (ContainerTest is also instantiated in gtest-typed-test_test.cc.)
-typedef Types<std::vector<double>, std::set<char> > MyContainers;
-INSTANTIATE_TYPED_TEST_CASE_P(My, ContainerTest, MyContainers);
-
-// Tests that a type-parameterized test case can be defined and
-// instantiated in a namespace.
-
-namespace library2 {
-
-template <typename T>
-class NumericTest : public Test {
-};
-
-TYPED_TEST_CASE_P(NumericTest);
-
-TYPED_TEST_P(NumericTest, DefaultIsZero) {
- EXPECT_EQ(0, TypeParam());
-}
-
-TYPED_TEST_P(NumericTest, ZeroIsLessThanOne) {
- EXPECT_LT(TypeParam(0), TypeParam(1));
-}
-
-REGISTER_TYPED_TEST_CASE_P(NumericTest,
- DefaultIsZero, ZeroIsLessThanOne);
-typedef Types<int, double> NumericTypes;
-INSTANTIATE_TYPED_TEST_CASE_P(My, NumericTest, NumericTypes);
-
-} // namespace library2
-
-#endif // GTEST_HAS_TYPED_TEST_P
-
-#if !defined(GTEST_HAS_TYPED_TEST) && !defined(GTEST_HAS_TYPED_TEST_P)
-
-// Google Test may not support type-parameterized tests with some
-// compilers. If we use conditional compilation to compile out all
-// code referring to the gtest_main library, MSVC linker will not link
-// that library at all and consequently complain about missing entry
-// point defined in that library (fatal error LNK1561: entry point
-// must be defined). This dummy test keeps gtest_main linked in.
-TEST(DummyTest, TypedTestsAreNotSupportedOnThisPlatform) {}
-
-#endif // #if !defined(GTEST_HAS_TYPED_TEST) && !defined(GTEST_HAS_TYPED_TEST_P)
diff --git a/src/testing/gtest/test/gtest-typed-test_test.h b/src/testing/gtest/test/gtest-typed-test_test.h
deleted file mode 100644
index 41d75704..00000000
--- a/src/testing/gtest/test/gtest-typed-test_test.h
+++ /dev/null
@@ -1,66 +0,0 @@
-// Copyright 2008 Google Inc.
-// All Rights Reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-#ifndef GTEST_TEST_GTEST_TYPED_TEST_TEST_H_
-#define GTEST_TEST_GTEST_TYPED_TEST_TEST_H_
-
-#include "gtest/gtest.h"
-
-#if GTEST_HAS_TYPED_TEST_P
-
-using testing::Test;
-
-// For testing that the same type-parameterized test case can be
-// instantiated in different translation units linked together.
-// ContainerTest will be instantiated in both gtest-typed-test_test.cc
-// and gtest-typed-test2_test.cc.
-
-template <typename T>
-class ContainerTest : public Test {
-};
-
-TYPED_TEST_CASE_P(ContainerTest);
-
-TYPED_TEST_P(ContainerTest, CanBeDefaultConstructed) {
- TypeParam container;
-}
-
-TYPED_TEST_P(ContainerTest, InitialSizeIsZero) {
- TypeParam container;
- EXPECT_EQ(0U, container.size());
-}
-
-REGISTER_TYPED_TEST_CASE_P(ContainerTest,
- CanBeDefaultConstructed, InitialSizeIsZero);
-
-#endif // GTEST_HAS_TYPED_TEST_P
-
-#endif // GTEST_TEST_GTEST_TYPED_TEST_TEST_H_
diff --git a/src/testing/gtest/test/gtest-unittest-api_test.cc b/src/testing/gtest/test/gtest-unittest-api_test.cc
deleted file mode 100644
index 07083e51..00000000
--- a/src/testing/gtest/test/gtest-unittest-api_test.cc
+++ /dev/null
@@ -1,341 +0,0 @@
-// Copyright 2009 Google Inc. All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: vladl@google.com (Vlad Losev)
-//
-// The Google C++ Testing Framework (Google Test)
-//
-// This file contains tests verifying correctness of data provided via
-// UnitTest's public methods.
-
-#include "gtest/gtest.h"
-
-#include <string.h> // For strcmp.
-#include <algorithm>
-
-using ::testing::InitGoogleTest;
-
-namespace testing {
-namespace internal {
-
-template <typename T>
-struct LessByName {
- bool operator()(const T* a, const T* b) {
- return strcmp(a->name(), b->name()) < 0;
- }
-};
-
-class UnitTestHelper {
- public:
- // Returns the array of pointers to all test cases sorted by the test case
- // name. The caller is responsible for deleting the array.
- static TestCase const** const GetSortedTestCases() {
- UnitTest& unit_test = *UnitTest::GetInstance();
- TestCase const** const test_cases =
- new const TestCase*[unit_test.total_test_case_count()];
-
- for (int i = 0; i < unit_test.total_test_case_count(); ++i)
- test_cases[i] = unit_test.GetTestCase(i);
-
- std::sort(test_cases,
- test_cases + unit_test.total_test_case_count(),
- LessByName<TestCase>());
- return test_cases;
- }
-
- // Returns the test case by its name. The caller doesn't own the returned
- // pointer.
- static const TestCase* FindTestCase(const char* name) {
- UnitTest& unit_test = *UnitTest::GetInstance();
- for (int i = 0; i < unit_test.total_test_case_count(); ++i) {
- const TestCase* test_case = unit_test.GetTestCase(i);
- if (0 == strcmp(test_case->name(), name))
- return test_case;
- }
- return NULL;
- }
-
- // Returns the array of pointers to all tests in a particular test case
- // sorted by the test name. The caller is responsible for deleting the
- // array.
- static TestInfo const** const GetSortedTests(const TestCase* test_case) {
- TestInfo const** const tests =
- new const TestInfo*[test_case->total_test_count()];
-
- for (int i = 0; i < test_case->total_test_count(); ++i)
- tests[i] = test_case->GetTestInfo(i);
-
- std::sort(tests, tests + test_case->total_test_count(),
- LessByName<TestInfo>());
- return tests;
- }
-};
-
-#if GTEST_HAS_TYPED_TEST
-template <typename T> class TestCaseWithCommentTest : public Test {};
-TYPED_TEST_CASE(TestCaseWithCommentTest, Types<int>);
-TYPED_TEST(TestCaseWithCommentTest, Dummy) {}
-
-const int kTypedTestCases = 1;
-const int kTypedTests = 1;
-#else
-const int kTypedTestCases = 0;
-const int kTypedTests = 0;
-#endif // GTEST_HAS_TYPED_TEST
-
-// We can only test the accessors that do not change value while tests run.
-// Since tests can be run in any order, the values the accessors that track
-// test execution (such as failed_test_count) can not be predicted.
-TEST(ApiTest, UnitTestImmutableAccessorsWork) {
- UnitTest* unit_test = UnitTest::GetInstance();
-
- ASSERT_EQ(2 + kTypedTestCases, unit_test->total_test_case_count());
- EXPECT_EQ(1 + kTypedTestCases, unit_test->test_case_to_run_count());
- EXPECT_EQ(2, unit_test->disabled_test_count());
- EXPECT_EQ(5 + kTypedTests, unit_test->total_test_count());
- EXPECT_EQ(3 + kTypedTests, unit_test->test_to_run_count());
-
- const TestCase** const test_cases = UnitTestHelper::GetSortedTestCases();
-
- EXPECT_STREQ("ApiTest", test_cases[0]->name());
- EXPECT_STREQ("DISABLED_Test", test_cases[1]->name());
-#if GTEST_HAS_TYPED_TEST
- EXPECT_STREQ("TestCaseWithCommentTest/0", test_cases[2]->name());
-#endif // GTEST_HAS_TYPED_TEST
-
- delete[] test_cases;
-
- // The following lines initiate actions to verify certain methods in
- // FinalSuccessChecker::TearDown.
-
- // Records a test property to verify TestResult::GetTestProperty().
- RecordProperty("key", "value");
-}
-
-AssertionResult IsNull(const char* str) {
- if (str != NULL) {
- return testing::AssertionFailure() << "argument is " << str;
- }
- return AssertionSuccess();
-}
-
-TEST(ApiTest, TestCaseImmutableAccessorsWork) {
- const TestCase* test_case = UnitTestHelper::FindTestCase("ApiTest");
- ASSERT_TRUE(test_case != NULL);
-
- EXPECT_STREQ("ApiTest", test_case->name());
- EXPECT_TRUE(IsNull(test_case->type_param()));
- EXPECT_TRUE(test_case->should_run());
- EXPECT_EQ(1, test_case->disabled_test_count());
- EXPECT_EQ(3, test_case->test_to_run_count());
- ASSERT_EQ(4, test_case->total_test_count());
-
- const TestInfo** tests = UnitTestHelper::GetSortedTests(test_case);
-
- EXPECT_STREQ("DISABLED_Dummy1", tests[0]->name());
- EXPECT_STREQ("ApiTest", tests[0]->test_case_name());
- EXPECT_TRUE(IsNull(tests[0]->value_param()));
- EXPECT_TRUE(IsNull(tests[0]->type_param()));
- EXPECT_FALSE(tests[0]->should_run());
-
- EXPECT_STREQ("TestCaseDisabledAccessorsWork", tests[1]->name());
- EXPECT_STREQ("ApiTest", tests[1]->test_case_name());
- EXPECT_TRUE(IsNull(tests[1]->value_param()));
- EXPECT_TRUE(IsNull(tests[1]->type_param()));
- EXPECT_TRUE(tests[1]->should_run());
-
- EXPECT_STREQ("TestCaseImmutableAccessorsWork", tests[2]->name());
- EXPECT_STREQ("ApiTest", tests[2]->test_case_name());
- EXPECT_TRUE(IsNull(tests[2]->value_param()));
- EXPECT_TRUE(IsNull(tests[2]->type_param()));
- EXPECT_TRUE(tests[2]->should_run());
-
- EXPECT_STREQ("UnitTestImmutableAccessorsWork", tests[3]->name());
- EXPECT_STREQ("ApiTest", tests[3]->test_case_name());
- EXPECT_TRUE(IsNull(tests[3]->value_param()));
- EXPECT_TRUE(IsNull(tests[3]->type_param()));
- EXPECT_TRUE(tests[3]->should_run());
-
- delete[] tests;
- tests = NULL;
-
-#if GTEST_HAS_TYPED_TEST
- test_case = UnitTestHelper::FindTestCase("TestCaseWithCommentTest/0");
- ASSERT_TRUE(test_case != NULL);
-
- EXPECT_STREQ("TestCaseWithCommentTest/0", test_case->name());
- EXPECT_STREQ(GetTypeName<int>().c_str(), test_case->type_param());
- EXPECT_TRUE(test_case->should_run());
- EXPECT_EQ(0, test_case->disabled_test_count());
- EXPECT_EQ(1, test_case->test_to_run_count());
- ASSERT_EQ(1, test_case->total_test_count());
-
- tests = UnitTestHelper::GetSortedTests(test_case);
-
- EXPECT_STREQ("Dummy", tests[0]->name());
- EXPECT_STREQ("TestCaseWithCommentTest/0", tests[0]->test_case_name());
- EXPECT_TRUE(IsNull(tests[0]->value_param()));
- EXPECT_STREQ(GetTypeName<int>().c_str(), tests[0]->type_param());
- EXPECT_TRUE(tests[0]->should_run());
-
- delete[] tests;
-#endif // GTEST_HAS_TYPED_TEST
-}
-
-TEST(ApiTest, TestCaseDisabledAccessorsWork) {
- const TestCase* test_case = UnitTestHelper::FindTestCase("DISABLED_Test");
- ASSERT_TRUE(test_case != NULL);
-
- EXPECT_STREQ("DISABLED_Test", test_case->name());
- EXPECT_TRUE(IsNull(test_case->type_param()));
- EXPECT_FALSE(test_case->should_run());
- EXPECT_EQ(1, test_case->disabled_test_count());
- EXPECT_EQ(0, test_case->test_to_run_count());
- ASSERT_EQ(1, test_case->total_test_count());
-
- const TestInfo* const test_info = test_case->GetTestInfo(0);
- EXPECT_STREQ("Dummy2", test_info->name());
- EXPECT_STREQ("DISABLED_Test", test_info->test_case_name());
- EXPECT_TRUE(IsNull(test_info->value_param()));
- EXPECT_TRUE(IsNull(test_info->type_param()));
- EXPECT_FALSE(test_info->should_run());
-}
-
-// These two tests are here to provide support for testing
-// test_case_to_run_count, disabled_test_count, and test_to_run_count.
-TEST(ApiTest, DISABLED_Dummy1) {}
-TEST(DISABLED_Test, Dummy2) {}
-
-class FinalSuccessChecker : public Environment {
- protected:
- virtual void TearDown() {
- UnitTest* unit_test = UnitTest::GetInstance();
-
- EXPECT_EQ(1 + kTypedTestCases, unit_test->successful_test_case_count());
- EXPECT_EQ(3 + kTypedTests, unit_test->successful_test_count());
- EXPECT_EQ(0, unit_test->failed_test_case_count());
- EXPECT_EQ(0, unit_test->failed_test_count());
- EXPECT_TRUE(unit_test->Passed());
- EXPECT_FALSE(unit_test->Failed());
- ASSERT_EQ(2 + kTypedTestCases, unit_test->total_test_case_count());
-
- const TestCase** const test_cases = UnitTestHelper::GetSortedTestCases();
-
- EXPECT_STREQ("ApiTest", test_cases[0]->name());
- EXPECT_TRUE(IsNull(test_cases[0]->type_param()));
- EXPECT_TRUE(test_cases[0]->should_run());
- EXPECT_EQ(1, test_cases[0]->disabled_test_count());
- ASSERT_EQ(4, test_cases[0]->total_test_count());
- EXPECT_EQ(3, test_cases[0]->successful_test_count());
- EXPECT_EQ(0, test_cases[0]->failed_test_count());
- EXPECT_TRUE(test_cases[0]->Passed());
- EXPECT_FALSE(test_cases[0]->Failed());
-
- EXPECT_STREQ("DISABLED_Test", test_cases[1]->name());
- EXPECT_TRUE(IsNull(test_cases[1]->type_param()));
- EXPECT_FALSE(test_cases[1]->should_run());
- EXPECT_EQ(1, test_cases[1]->disabled_test_count());
- ASSERT_EQ(1, test_cases[1]->total_test_count());
- EXPECT_EQ(0, test_cases[1]->successful_test_count());
- EXPECT_EQ(0, test_cases[1]->failed_test_count());
-
-#if GTEST_HAS_TYPED_TEST
- EXPECT_STREQ("TestCaseWithCommentTest/0", test_cases[2]->name());
- EXPECT_STREQ(GetTypeName<int>().c_str(), test_cases[2]->type_param());
- EXPECT_TRUE(test_cases[2]->should_run());
- EXPECT_EQ(0, test_cases[2]->disabled_test_count());
- ASSERT_EQ(1, test_cases[2]->total_test_count());
- EXPECT_EQ(1, test_cases[2]->successful_test_count());
- EXPECT_EQ(0, test_cases[2]->failed_test_count());
- EXPECT_TRUE(test_cases[2]->Passed());
- EXPECT_FALSE(test_cases[2]->Failed());
-#endif // GTEST_HAS_TYPED_TEST
-
- const TestCase* test_case = UnitTestHelper::FindTestCase("ApiTest");
- const TestInfo** tests = UnitTestHelper::GetSortedTests(test_case);
- EXPECT_STREQ("DISABLED_Dummy1", tests[0]->name());
- EXPECT_STREQ("ApiTest", tests[0]->test_case_name());
- EXPECT_FALSE(tests[0]->should_run());
-
- EXPECT_STREQ("TestCaseDisabledAccessorsWork", tests[1]->name());
- EXPECT_STREQ("ApiTest", tests[1]->test_case_name());
- EXPECT_TRUE(IsNull(tests[1]->value_param()));
- EXPECT_TRUE(IsNull(tests[1]->type_param()));
- EXPECT_TRUE(tests[1]->should_run());
- EXPECT_TRUE(tests[1]->result()->Passed());
- EXPECT_EQ(0, tests[1]->result()->test_property_count());
-
- EXPECT_STREQ("TestCaseImmutableAccessorsWork", tests[2]->name());
- EXPECT_STREQ("ApiTest", tests[2]->test_case_name());
- EXPECT_TRUE(IsNull(tests[2]->value_param()));
- EXPECT_TRUE(IsNull(tests[2]->type_param()));
- EXPECT_TRUE(tests[2]->should_run());
- EXPECT_TRUE(tests[2]->result()->Passed());
- EXPECT_EQ(0, tests[2]->result()->test_property_count());
-
- EXPECT_STREQ("UnitTestImmutableAccessorsWork", tests[3]->name());
- EXPECT_STREQ("ApiTest", tests[3]->test_case_name());
- EXPECT_TRUE(IsNull(tests[3]->value_param()));
- EXPECT_TRUE(IsNull(tests[3]->type_param()));
- EXPECT_TRUE(tests[3]->should_run());
- EXPECT_TRUE(tests[3]->result()->Passed());
- EXPECT_EQ(1, tests[3]->result()->test_property_count());
- const TestProperty& property = tests[3]->result()->GetTestProperty(0);
- EXPECT_STREQ("key", property.key());
- EXPECT_STREQ("value", property.value());
-
- delete[] tests;
-
-#if GTEST_HAS_TYPED_TEST
- test_case = UnitTestHelper::FindTestCase("TestCaseWithCommentTest/0");
- tests = UnitTestHelper::GetSortedTests(test_case);
-
- EXPECT_STREQ("Dummy", tests[0]->name());
- EXPECT_STREQ("TestCaseWithCommentTest/0", tests[0]->test_case_name());
- EXPECT_TRUE(IsNull(tests[0]->value_param()));
- EXPECT_STREQ(GetTypeName<int>().c_str(), tests[0]->type_param());
- EXPECT_TRUE(tests[0]->should_run());
- EXPECT_TRUE(tests[0]->result()->Passed());
- EXPECT_EQ(0, tests[0]->result()->test_property_count());
-
- delete[] tests;
-#endif // GTEST_HAS_TYPED_TEST
- delete[] test_cases;
- }
-};
-
-} // namespace internal
-} // namespace testing
-
-int main(int argc, char **argv) {
- InitGoogleTest(&argc, argv);
-
- AddGlobalTestEnvironment(new testing::internal::FinalSuccessChecker());
-
- return RUN_ALL_TESTS();
-}
diff --git a/src/testing/gtest/test/gtest_all_test.cc b/src/testing/gtest/test/gtest_all_test.cc
deleted file mode 100644
index 955aa628..00000000
--- a/src/testing/gtest/test/gtest_all_test.cc
+++ /dev/null
@@ -1,47 +0,0 @@
-// Copyright 2009, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-//
-// Tests for Google C++ Testing Framework (Google Test)
-//
-// Sometimes it's desirable to build most of Google Test's own tests
-// by compiling a single file. This file serves this purpose.
-#include "test/gtest-filepath_test.cc"
-#include "test/gtest-linked_ptr_test.cc"
-#include "test/gtest-message_test.cc"
-#include "test/gtest-options_test.cc"
-#include "test/gtest-port_test.cc"
-#include "test/gtest_pred_impl_unittest.cc"
-#include "test/gtest_prod_test.cc"
-#include "test/gtest-test-part_test.cc"
-#include "test/gtest-typed-test_test.cc"
-#include "test/gtest-typed-test2_test.cc"
-#include "test/gtest_unittest.cc"
-#include "test/production.cc"
diff --git a/src/testing/gtest/test/gtest_break_on_failure_unittest.py b/src/testing/gtest/test/gtest_break_on_failure_unittest.py
deleted file mode 100755
index c8191833..00000000
--- a/src/testing/gtest/test/gtest_break_on_failure_unittest.py
+++ /dev/null
@@ -1,218 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2006, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-"""Unit test for Google Test's break-on-failure mode.
-
-A user can ask Google Test to seg-fault when an assertion fails, using
-either the GTEST_BREAK_ON_FAILURE environment variable or the
---gtest_break_on_failure flag. This script tests such functionality
-by invoking gtest_break_on_failure_unittest_ (a program written with
-Google Test) with different environments and command line flags.
-"""
-
-__author__ = 'wan@google.com (Zhanyong Wan)'
-
-import gtest_test_utils
-import os
-import sys
-
-
-# Constants.
-
-IS_WINDOWS = os.name == 'nt'
-
-# The environment variable for enabling/disabling the break-on-failure mode.
-BREAK_ON_FAILURE_ENV_VAR = 'GTEST_BREAK_ON_FAILURE'
-
-# The command line flag for enabling/disabling the break-on-failure mode.
-BREAK_ON_FAILURE_FLAG = 'gtest_break_on_failure'
-
-# The environment variable for enabling/disabling the throw-on-failure mode.
-THROW_ON_FAILURE_ENV_VAR = 'GTEST_THROW_ON_FAILURE'
-
-# The environment variable for enabling/disabling the catch-exceptions mode.
-CATCH_EXCEPTIONS_ENV_VAR = 'GTEST_CATCH_EXCEPTIONS'
-
-# Path to the gtest_break_on_failure_unittest_ program.
-EXE_PATH = gtest_test_utils.GetTestExecutablePath(
- 'gtest_break_on_failure_unittest_')
-
-
-# Utilities.
-
-
-environ = os.environ.copy()
-
-
-def SetEnvVar(env_var, value):
- """Sets an environment variable to a given value; unsets it when the
- given value is None.
- """
-
- if value is not None:
- environ[env_var] = value
- elif env_var in environ:
- del environ[env_var]
-
-
-def Run(command):
- """Runs a command; returns 1 if it was killed by a signal, or 0 otherwise."""
-
- p = gtest_test_utils.Subprocess(command, env=environ)
- if p.terminated_by_signal:
- return 1
- else:
- return 0
-
-
-# The tests.
-
-
-class GTestBreakOnFailureUnitTest(gtest_test_utils.TestCase):
- """Tests using the GTEST_BREAK_ON_FAILURE environment variable or
- the --gtest_break_on_failure flag to turn assertion failures into
- segmentation faults.
- """
-
- def RunAndVerify(self, env_var_value, flag_value, expect_seg_fault):
- """Runs gtest_break_on_failure_unittest_ and verifies that it does
- (or does not) have a seg-fault.
-
- Args:
- env_var_value: value of the GTEST_BREAK_ON_FAILURE environment
- variable; None if the variable should be unset.
- flag_value: value of the --gtest_break_on_failure flag;
- None if the flag should not be present.
- expect_seg_fault: 1 if the program is expected to generate a seg-fault;
- 0 otherwise.
- """
-
- SetEnvVar(BREAK_ON_FAILURE_ENV_VAR, env_var_value)
-
- if env_var_value is None:
- env_var_value_msg = ' is not set'
- else:
- env_var_value_msg = '=' + env_var_value
-
- if flag_value is None:
- flag = ''
- elif flag_value == '0':
- flag = '--%s=0' % BREAK_ON_FAILURE_FLAG
- else:
- flag = '--%s' % BREAK_ON_FAILURE_FLAG
-
- command = [EXE_PATH]
- if flag:
- command.append(flag)
-
- if expect_seg_fault:
- should_or_not = 'should'
- else:
- should_or_not = 'should not'
-
- has_seg_fault = Run(command)
-
- SetEnvVar(BREAK_ON_FAILURE_ENV_VAR, None)
-
- msg = ('when %s%s, an assertion failure in "%s" %s cause a seg-fault.' %
- (BREAK_ON_FAILURE_ENV_VAR, env_var_value_msg, ' '.join(command),
- should_or_not))
- self.assert_(has_seg_fault == expect_seg_fault, msg)
-
- def testDefaultBehavior(self):
- """Tests the behavior of the default mode."""
-
- self.RunAndVerify(env_var_value=None,
- flag_value=None,
- expect_seg_fault=0)
-
- def testEnvVar(self):
- """Tests using the GTEST_BREAK_ON_FAILURE environment variable."""
-
- self.RunAndVerify(env_var_value='0',
- flag_value=None,
- expect_seg_fault=0)
- self.RunAndVerify(env_var_value='1',
- flag_value=None,
- expect_seg_fault=1)
-
- def testFlag(self):
- """Tests using the --gtest_break_on_failure flag."""
-
- self.RunAndVerify(env_var_value=None,
- flag_value='0',
- expect_seg_fault=0)
- self.RunAndVerify(env_var_value=None,
- flag_value='1',
- expect_seg_fault=1)
-
- def testFlagOverridesEnvVar(self):
- """Tests that the flag overrides the environment variable."""
-
- self.RunAndVerify(env_var_value='0',
- flag_value='0',
- expect_seg_fault=0)
- self.RunAndVerify(env_var_value='0',
- flag_value='1',
- expect_seg_fault=1)
- self.RunAndVerify(env_var_value='1',
- flag_value='0',
- expect_seg_fault=0)
- self.RunAndVerify(env_var_value='1',
- flag_value='1',
- expect_seg_fault=1)
-
- def testBreakOnFailureOverridesThrowOnFailure(self):
- """Tests that gtest_break_on_failure overrides gtest_throw_on_failure."""
-
- SetEnvVar(THROW_ON_FAILURE_ENV_VAR, '1')
- try:
- self.RunAndVerify(env_var_value=None,
- flag_value='1',
- expect_seg_fault=1)
- finally:
- SetEnvVar(THROW_ON_FAILURE_ENV_VAR, None)
-
- if IS_WINDOWS:
- def testCatchExceptionsDoesNotInterfere(self):
- """Tests that gtest_catch_exceptions doesn't interfere."""
-
- SetEnvVar(CATCH_EXCEPTIONS_ENV_VAR, '1')
- try:
- self.RunAndVerify(env_var_value='1',
- flag_value='1',
- expect_seg_fault=1)
- finally:
- SetEnvVar(CATCH_EXCEPTIONS_ENV_VAR, None)
-
-
-if __name__ == '__main__':
- gtest_test_utils.Main()
diff --git a/src/testing/gtest/test/gtest_break_on_failure_unittest_.cc b/src/testing/gtest/test/gtest_break_on_failure_unittest_.cc
deleted file mode 100644
index dd07478c..00000000
--- a/src/testing/gtest/test/gtest_break_on_failure_unittest_.cc
+++ /dev/null
@@ -1,88 +0,0 @@
-// Copyright 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-// Unit test for Google Test's break-on-failure mode.
-//
-// A user can ask Google Test to seg-fault when an assertion fails, using
-// either the GTEST_BREAK_ON_FAILURE environment variable or the
-// --gtest_break_on_failure flag. This file is used for testing such
-// functionality.
-//
-// This program will be invoked from a Python unit test. It is
-// expected to fail. Don't run it directly.
-
-#include "gtest/gtest.h"
-
-#if GTEST_OS_WINDOWS
-# include <windows.h>
-# include <stdlib.h>
-#endif
-
-namespace {
-
-// A test that's expected to fail.
-TEST(Foo, Bar) {
- EXPECT_EQ(2, 3);
-}
-
-#if GTEST_HAS_SEH && !GTEST_OS_WINDOWS_MOBILE
-// On Windows Mobile global exception handlers are not supported.
-LONG WINAPI ExitWithExceptionCode(
- struct _EXCEPTION_POINTERS* exception_pointers) {
- exit(exception_pointers->ExceptionRecord->ExceptionCode);
-}
-#endif
-
-} // namespace
-
-int main(int argc, char **argv) {
-#if GTEST_OS_WINDOWS
- // Suppresses display of the Windows error dialog upon encountering
- // a general protection fault (segment violation).
- SetErrorMode(SEM_NOGPFAULTERRORBOX | SEM_FAILCRITICALERRORS);
-
-# if GTEST_HAS_SEH && !GTEST_OS_WINDOWS_MOBILE
-
- // The default unhandled exception filter does not always exit
- // with the exception code as exit code - for example it exits with
- // 0 for EXCEPTION_ACCESS_VIOLATION and 1 for EXCEPTION_BREAKPOINT
- // if the application is compiled in debug mode. Thus we use our own
- // filter which always exits with the exception code for unhandled
- // exceptions.
- SetUnhandledExceptionFilter(ExitWithExceptionCode);
-
-# endif
-#endif
-
- testing::InitGoogleTest(&argc, argv);
-
- return RUN_ALL_TESTS();
-}
diff --git a/src/testing/gtest/test/gtest_catch_exceptions_test.py b/src/testing/gtest/test/gtest_catch_exceptions_test.py
deleted file mode 100755
index d7ef10eb..00000000
--- a/src/testing/gtest/test/gtest_catch_exceptions_test.py
+++ /dev/null
@@ -1,223 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2010 Google Inc. All Rights Reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-"""Tests Google Test's exception catching behavior.
-
-This script invokes gtest_catch_exceptions_test_ and
-gtest_catch_exceptions_ex_test_ (programs written with
-Google Test) and verifies their output.
-"""
-
-__author__ = 'vladl@google.com (Vlad Losev)'
-
-import os
-
-import gtest_test_utils
-
-# Constants.
-FLAG_PREFIX = '--gtest_'
-LIST_TESTS_FLAG = FLAG_PREFIX + 'list_tests'
-NO_CATCH_EXCEPTIONS_FLAG = FLAG_PREFIX + 'catch_exceptions=0'
-FILTER_FLAG = FLAG_PREFIX + 'filter'
-
-# Path to the gtest_catch_exceptions_ex_test_ binary, compiled with
-# exceptions enabled.
-EX_EXE_PATH = gtest_test_utils.GetTestExecutablePath(
- 'gtest_catch_exceptions_ex_test_')
-
-# Path to the gtest_catch_exceptions_test_ binary, compiled with
-# exceptions disabled.
-EXE_PATH = gtest_test_utils.GetTestExecutablePath(
- 'gtest_catch_exceptions_no_ex_test_')
-
-TEST_LIST = gtest_test_utils.Subprocess([EXE_PATH, LIST_TESTS_FLAG]).output
-
-SUPPORTS_SEH_EXCEPTIONS = 'ThrowsSehException' in TEST_LIST
-
-if SUPPORTS_SEH_EXCEPTIONS:
- BINARY_OUTPUT = gtest_test_utils.Subprocess([EXE_PATH]).output
-
-EX_BINARY_OUTPUT = gtest_test_utils.Subprocess([EX_EXE_PATH]).output
-
-# The tests.
-if SUPPORTS_SEH_EXCEPTIONS:
- # pylint:disable-msg=C6302
- class CatchSehExceptionsTest(gtest_test_utils.TestCase):
- """Tests exception-catching behavior."""
-
-
- def TestSehExceptions(self, test_output):
- self.assert_('SEH exception with code 0x2a thrown '
- 'in the test fixture\'s constructor'
- in test_output)
- self.assert_('SEH exception with code 0x2a thrown '
- 'in the test fixture\'s destructor'
- in test_output)
- self.assert_('SEH exception with code 0x2a thrown in SetUpTestCase()'
- in test_output)
- self.assert_('SEH exception with code 0x2a thrown in TearDownTestCase()'
- in test_output)
- self.assert_('SEH exception with code 0x2a thrown in SetUp()'
- in test_output)
- self.assert_('SEH exception with code 0x2a thrown in TearDown()'
- in test_output)
- self.assert_('SEH exception with code 0x2a thrown in the test body'
- in test_output)
-
- def testCatchesSehExceptionsWithCxxExceptionsEnabled(self):
- self.TestSehExceptions(EX_BINARY_OUTPUT)
-
- def testCatchesSehExceptionsWithCxxExceptionsDisabled(self):
- self.TestSehExceptions(BINARY_OUTPUT)
-
-
-class CatchCxxExceptionsTest(gtest_test_utils.TestCase):
- """Tests C++ exception-catching behavior.
-
- Tests in this test case verify that:
- * C++ exceptions are caught and logged as C++ (not SEH) exceptions
- * Exception thrown affect the remainder of the test work flow in the
- expected manner.
- """
-
- def testCatchesCxxExceptionsInFixtureConstructor(self):
- self.assert_('C++ exception with description '
- '"Standard C++ exception" thrown '
- 'in the test fixture\'s constructor'
- in EX_BINARY_OUTPUT)
- self.assert_('unexpected' not in EX_BINARY_OUTPUT,
- 'This failure belongs in this test only if '
- '"CxxExceptionInConstructorTest" (no quotes) '
- 'appears on the same line as words "called unexpectedly"')
-
- if ('CxxExceptionInDestructorTest.ThrowsExceptionInDestructor' in
- EX_BINARY_OUTPUT):
-
- def testCatchesCxxExceptionsInFixtureDestructor(self):
- self.assert_('C++ exception with description '
- '"Standard C++ exception" thrown '
- 'in the test fixture\'s destructor'
- in EX_BINARY_OUTPUT)
- self.assert_('CxxExceptionInDestructorTest::TearDownTestCase() '
- 'called as expected.'
- in EX_BINARY_OUTPUT)
-
- def testCatchesCxxExceptionsInSetUpTestCase(self):
- self.assert_('C++ exception with description "Standard C++ exception"'
- ' thrown in SetUpTestCase()'
- in EX_BINARY_OUTPUT)
- self.assert_('CxxExceptionInConstructorTest::TearDownTestCase() '
- 'called as expected.'
- in EX_BINARY_OUTPUT)
- self.assert_('CxxExceptionInSetUpTestCaseTest constructor '
- 'called as expected.'
- in EX_BINARY_OUTPUT)
- self.assert_('CxxExceptionInSetUpTestCaseTest destructor '
- 'called as expected.'
- in EX_BINARY_OUTPUT)
- self.assert_('CxxExceptionInSetUpTestCaseTest::SetUp() '
- 'called as expected.'
- in EX_BINARY_OUTPUT)
- self.assert_('CxxExceptionInSetUpTestCaseTest::TearDown() '
- 'called as expected.'
- in EX_BINARY_OUTPUT)
- self.assert_('CxxExceptionInSetUpTestCaseTest test body '
- 'called as expected.'
- in EX_BINARY_OUTPUT)
-
- def testCatchesCxxExceptionsInTearDownTestCase(self):
- self.assert_('C++ exception with description "Standard C++ exception"'
- ' thrown in TearDownTestCase()'
- in EX_BINARY_OUTPUT)
-
- def testCatchesCxxExceptionsInSetUp(self):
- self.assert_('C++ exception with description "Standard C++ exception"'
- ' thrown in SetUp()'
- in EX_BINARY_OUTPUT)
- self.assert_('CxxExceptionInSetUpTest::TearDownTestCase() '
- 'called as expected.'
- in EX_BINARY_OUTPUT)
- self.assert_('CxxExceptionInSetUpTest destructor '
- 'called as expected.'
- in EX_BINARY_OUTPUT)
- self.assert_('CxxExceptionInSetUpTest::TearDown() '
- 'called as expected.'
- in EX_BINARY_OUTPUT)
- self.assert_('unexpected' not in EX_BINARY_OUTPUT,
- 'This failure belongs in this test only if '
- '"CxxExceptionInSetUpTest" (no quotes) '
- 'appears on the same line as words "called unexpectedly"')
-
- def testCatchesCxxExceptionsInTearDown(self):
- self.assert_('C++ exception with description "Standard C++ exception"'
- ' thrown in TearDown()'
- in EX_BINARY_OUTPUT)
- self.assert_('CxxExceptionInTearDownTest::TearDownTestCase() '
- 'called as expected.'
- in EX_BINARY_OUTPUT)
- self.assert_('CxxExceptionInTearDownTest destructor '
- 'called as expected.'
- in EX_BINARY_OUTPUT)
-
- def testCatchesCxxExceptionsInTestBody(self):
- self.assert_('C++ exception with description "Standard C++ exception"'
- ' thrown in the test body'
- in EX_BINARY_OUTPUT)
- self.assert_('CxxExceptionInTestBodyTest::TearDownTestCase() '
- 'called as expected.'
- in EX_BINARY_OUTPUT)
- self.assert_('CxxExceptionInTestBodyTest destructor '
- 'called as expected.'
- in EX_BINARY_OUTPUT)
- self.assert_('CxxExceptionInTestBodyTest::TearDown() '
- 'called as expected.'
- in EX_BINARY_OUTPUT)
-
- def testCatchesNonStdCxxExceptions(self):
- self.assert_('Unknown C++ exception thrown in the test body'
- in EX_BINARY_OUTPUT)
-
- def testUnhandledCxxExceptionsAbortTheProgram(self):
- # Filters out SEH exception tests on Windows. Unhandled SEH exceptions
- # cause tests to show pop-up windows there.
- FITLER_OUT_SEH_TESTS_FLAG = FILTER_FLAG + '=-*Seh*'
- # By default, Google Test doesn't catch the exceptions.
- uncaught_exceptions_ex_binary_output = gtest_test_utils.Subprocess(
- [EX_EXE_PATH,
- NO_CATCH_EXCEPTIONS_FLAG,
- FITLER_OUT_SEH_TESTS_FLAG]).output
-
- self.assert_('Unhandled C++ exception terminating the program'
- in uncaught_exceptions_ex_binary_output)
- self.assert_('unexpected' not in uncaught_exceptions_ex_binary_output)
-
-
-if __name__ == '__main__':
- gtest_test_utils.Main()
diff --git a/src/testing/gtest/test/gtest_catch_exceptions_test_.cc b/src/testing/gtest/test/gtest_catch_exceptions_test_.cc
deleted file mode 100644
index d0fc82c9..00000000
--- a/src/testing/gtest/test/gtest_catch_exceptions_test_.cc
+++ /dev/null
@@ -1,311 +0,0 @@
-// Copyright 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: vladl@google.com (Vlad Losev)
-//
-// Tests for Google Test itself. Tests in this file throw C++ or SEH
-// exceptions, and the output is verified by gtest_catch_exceptions_test.py.
-
-#include "gtest/gtest.h"
-
-#include <stdio.h> // NOLINT
-#include <stdlib.h> // For exit().
-
-#if GTEST_HAS_SEH
-# include <windows.h>
-#endif
-
-#if GTEST_HAS_EXCEPTIONS
-# include <exception> // For set_terminate().
-# include <stdexcept>
-#endif
-
-using testing::Test;
-
-#if GTEST_HAS_SEH
-
-class SehExceptionInConstructorTest : public Test {
- public:
- SehExceptionInConstructorTest() { RaiseException(42, 0, 0, NULL); }
-};
-
-TEST_F(SehExceptionInConstructorTest, ThrowsExceptionInConstructor) {}
-
-class SehExceptionInDestructorTest : public Test {
- public:
- ~SehExceptionInDestructorTest() { RaiseException(42, 0, 0, NULL); }
-};
-
-TEST_F(SehExceptionInDestructorTest, ThrowsExceptionInDestructor) {}
-
-class SehExceptionInSetUpTestCaseTest : public Test {
- public:
- static void SetUpTestCase() { RaiseException(42, 0, 0, NULL); }
-};
-
-TEST_F(SehExceptionInSetUpTestCaseTest, ThrowsExceptionInSetUpTestCase) {}
-
-class SehExceptionInTearDownTestCaseTest : public Test {
- public:
- static void TearDownTestCase() { RaiseException(42, 0, 0, NULL); }
-};
-
-TEST_F(SehExceptionInTearDownTestCaseTest, ThrowsExceptionInTearDownTestCase) {}
-
-class SehExceptionInSetUpTest : public Test {
- protected:
- virtual void SetUp() { RaiseException(42, 0, 0, NULL); }
-};
-
-TEST_F(SehExceptionInSetUpTest, ThrowsExceptionInSetUp) {}
-
-class SehExceptionInTearDownTest : public Test {
- protected:
- virtual void TearDown() { RaiseException(42, 0, 0, NULL); }
-};
-
-TEST_F(SehExceptionInTearDownTest, ThrowsExceptionInTearDown) {}
-
-TEST(SehExceptionTest, ThrowsSehException) {
- RaiseException(42, 0, 0, NULL);
-}
-
-#endif // GTEST_HAS_SEH
-
-#if GTEST_HAS_EXCEPTIONS
-
-class CxxExceptionInConstructorTest : public Test {
- public:
- CxxExceptionInConstructorTest() {
- // Without this macro VC++ complains about unreachable code at the end of
- // the constructor.
- GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(
- throw std::runtime_error("Standard C++ exception"));
- }
-
- static void TearDownTestCase() {
- printf("%s",
- "CxxExceptionInConstructorTest::TearDownTestCase() "
- "called as expected.\n");
- }
-
- protected:
- ~CxxExceptionInConstructorTest() {
- ADD_FAILURE() << "CxxExceptionInConstructorTest destructor "
- << "called unexpectedly.";
- }
-
- virtual void SetUp() {
- ADD_FAILURE() << "CxxExceptionInConstructorTest::SetUp() "
- << "called unexpectedly.";
- }
-
- virtual void TearDown() {
- ADD_FAILURE() << "CxxExceptionInConstructorTest::TearDown() "
- << "called unexpectedly.";
- }
-};
-
-TEST_F(CxxExceptionInConstructorTest, ThrowsExceptionInConstructor) {
- ADD_FAILURE() << "CxxExceptionInConstructorTest test body "
- << "called unexpectedly.";
-}
-
-// Exceptions in destructors are not supported in C++11.
-#if !defined(__GXX_EXPERIMENTAL_CXX0X__) && __cplusplus < 201103L
-class CxxExceptionInDestructorTest : public Test {
- public:
- static void TearDownTestCase() {
- printf("%s",
- "CxxExceptionInDestructorTest::TearDownTestCase() "
- "called as expected.\n");
- }
-
- protected:
- ~CxxExceptionInDestructorTest() {
- GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(
- throw std::runtime_error("Standard C++ exception"));
- }
-};
-
-TEST_F(CxxExceptionInDestructorTest, ThrowsExceptionInDestructor) {}
-#endif // C++11 mode
-
-class CxxExceptionInSetUpTestCaseTest : public Test {
- public:
- CxxExceptionInSetUpTestCaseTest() {
- printf("%s",
- "CxxExceptionInSetUpTestCaseTest constructor "
- "called as expected.\n");
- }
-
- static void SetUpTestCase() {
- throw std::runtime_error("Standard C++ exception");
- }
-
- static void TearDownTestCase() {
- printf("%s",
- "CxxExceptionInSetUpTestCaseTest::TearDownTestCase() "
- "called as expected.\n");
- }
-
- protected:
- ~CxxExceptionInSetUpTestCaseTest() {
- printf("%s",
- "CxxExceptionInSetUpTestCaseTest destructor "
- "called as expected.\n");
- }
-
- virtual void SetUp() {
- printf("%s",
- "CxxExceptionInSetUpTestCaseTest::SetUp() "
- "called as expected.\n");
- }
-
- virtual void TearDown() {
- printf("%s",
- "CxxExceptionInSetUpTestCaseTest::TearDown() "
- "called as expected.\n");
- }
-};
-
-TEST_F(CxxExceptionInSetUpTestCaseTest, ThrowsExceptionInSetUpTestCase) {
- printf("%s",
- "CxxExceptionInSetUpTestCaseTest test body "
- "called as expected.\n");
-}
-
-class CxxExceptionInTearDownTestCaseTest : public Test {
- public:
- static void TearDownTestCase() {
- throw std::runtime_error("Standard C++ exception");
- }
-};
-
-TEST_F(CxxExceptionInTearDownTestCaseTest, ThrowsExceptionInTearDownTestCase) {}
-
-class CxxExceptionInSetUpTest : public Test {
- public:
- static void TearDownTestCase() {
- printf("%s",
- "CxxExceptionInSetUpTest::TearDownTestCase() "
- "called as expected.\n");
- }
-
- protected:
- ~CxxExceptionInSetUpTest() {
- printf("%s",
- "CxxExceptionInSetUpTest destructor "
- "called as expected.\n");
- }
-
- virtual void SetUp() { throw std::runtime_error("Standard C++ exception"); }
-
- virtual void TearDown() {
- printf("%s",
- "CxxExceptionInSetUpTest::TearDown() "
- "called as expected.\n");
- }
-};
-
-TEST_F(CxxExceptionInSetUpTest, ThrowsExceptionInSetUp) {
- ADD_FAILURE() << "CxxExceptionInSetUpTest test body "
- << "called unexpectedly.";
-}
-
-class CxxExceptionInTearDownTest : public Test {
- public:
- static void TearDownTestCase() {
- printf("%s",
- "CxxExceptionInTearDownTest::TearDownTestCase() "
- "called as expected.\n");
- }
-
- protected:
- ~CxxExceptionInTearDownTest() {
- printf("%s",
- "CxxExceptionInTearDownTest destructor "
- "called as expected.\n");
- }
-
- virtual void TearDown() {
- throw std::runtime_error("Standard C++ exception");
- }
-};
-
-TEST_F(CxxExceptionInTearDownTest, ThrowsExceptionInTearDown) {}
-
-class CxxExceptionInTestBodyTest : public Test {
- public:
- static void TearDownTestCase() {
- printf("%s",
- "CxxExceptionInTestBodyTest::TearDownTestCase() "
- "called as expected.\n");
- }
-
- protected:
- ~CxxExceptionInTestBodyTest() {
- printf("%s",
- "CxxExceptionInTestBodyTest destructor "
- "called as expected.\n");
- }
-
- virtual void TearDown() {
- printf("%s",
- "CxxExceptionInTestBodyTest::TearDown() "
- "called as expected.\n");
- }
-};
-
-TEST_F(CxxExceptionInTestBodyTest, ThrowsStdCxxException) {
- throw std::runtime_error("Standard C++ exception");
-}
-
-TEST(CxxExceptionTest, ThrowsNonStdCxxException) {
- throw "C-string";
-}
-
-// This terminate handler aborts the program using exit() rather than abort().
-// This avoids showing pop-ups on Windows systems and core dumps on Unix-like
-// ones.
-void TerminateHandler() {
- fprintf(stderr, "%s\n", "Unhandled C++ exception terminating the program.");
- fflush(NULL);
- exit(3);
-}
-
-#endif // GTEST_HAS_EXCEPTIONS
-
-int main(int argc, char** argv) {
-#if GTEST_HAS_EXCEPTIONS
- std::set_terminate(&TerminateHandler);
-#endif
- testing::InitGoogleTest(&argc, argv);
- return RUN_ALL_TESTS();
-}
diff --git a/src/testing/gtest/test/gtest_color_test.py b/src/testing/gtest/test/gtest_color_test.py
deleted file mode 100755
index d02a53ed..00000000
--- a/src/testing/gtest/test/gtest_color_test.py
+++ /dev/null
@@ -1,130 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2008, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-"""Verifies that Google Test correctly determines whether to use colors."""
-
-__author__ = 'wan@google.com (Zhanyong Wan)'
-
-import os
-import gtest_test_utils
-
-
-IS_WINDOWS = os.name = 'nt'
-
-COLOR_ENV_VAR = 'GTEST_COLOR'
-COLOR_FLAG = 'gtest_color'
-COMMAND = gtest_test_utils.GetTestExecutablePath('gtest_color_test_')
-
-
-def SetEnvVar(env_var, value):
- """Sets the env variable to 'value'; unsets it when 'value' is None."""
-
- if value is not None:
- os.environ[env_var] = value
- elif env_var in os.environ:
- del os.environ[env_var]
-
-
-def UsesColor(term, color_env_var, color_flag):
- """Runs gtest_color_test_ and returns its exit code."""
-
- SetEnvVar('TERM', term)
- SetEnvVar(COLOR_ENV_VAR, color_env_var)
-
- if color_flag is None:
- args = []
- else:
- args = ['--%s=%s' % (COLOR_FLAG, color_flag)]
- p = gtest_test_utils.Subprocess([COMMAND] + args)
- return not p.exited or p.exit_code
-
-
-class GTestColorTest(gtest_test_utils.TestCase):
- def testNoEnvVarNoFlag(self):
- """Tests the case when there's neither GTEST_COLOR nor --gtest_color."""
-
- if not IS_WINDOWS:
- self.assert_(not UsesColor('dumb', None, None))
- self.assert_(not UsesColor('emacs', None, None))
- self.assert_(not UsesColor('xterm-mono', None, None))
- self.assert_(not UsesColor('unknown', None, None))
- self.assert_(not UsesColor(None, None, None))
- self.assert_(UsesColor('linux', None, None))
- self.assert_(UsesColor('cygwin', None, None))
- self.assert_(UsesColor('xterm', None, None))
- self.assert_(UsesColor('xterm-color', None, None))
- self.assert_(UsesColor('xterm-256color', None, None))
-
- def testFlagOnly(self):
- """Tests the case when there's --gtest_color but not GTEST_COLOR."""
-
- self.assert_(not UsesColor('dumb', None, 'no'))
- self.assert_(not UsesColor('xterm-color', None, 'no'))
- if not IS_WINDOWS:
- self.assert_(not UsesColor('emacs', None, 'auto'))
- self.assert_(UsesColor('xterm', None, 'auto'))
- self.assert_(UsesColor('dumb', None, 'yes'))
- self.assert_(UsesColor('xterm', None, 'yes'))
-
- def testEnvVarOnly(self):
- """Tests the case when there's GTEST_COLOR but not --gtest_color."""
-
- self.assert_(not UsesColor('dumb', 'no', None))
- self.assert_(not UsesColor('xterm-color', 'no', None))
- if not IS_WINDOWS:
- self.assert_(not UsesColor('dumb', 'auto', None))
- self.assert_(UsesColor('xterm-color', 'auto', None))
- self.assert_(UsesColor('dumb', 'yes', None))
- self.assert_(UsesColor('xterm-color', 'yes', None))
-
- def testEnvVarAndFlag(self):
- """Tests the case when there are both GTEST_COLOR and --gtest_color."""
-
- self.assert_(not UsesColor('xterm-color', 'no', 'no'))
- self.assert_(UsesColor('dumb', 'no', 'yes'))
- self.assert_(UsesColor('xterm-color', 'no', 'auto'))
-
- def testAliasesOfYesAndNo(self):
- """Tests using aliases in specifying --gtest_color."""
-
- self.assert_(UsesColor('dumb', None, 'true'))
- self.assert_(UsesColor('dumb', None, 'YES'))
- self.assert_(UsesColor('dumb', None, 'T'))
- self.assert_(UsesColor('dumb', None, '1'))
-
- self.assert_(not UsesColor('xterm', None, 'f'))
- self.assert_(not UsesColor('xterm', None, 'false'))
- self.assert_(not UsesColor('xterm', None, '0'))
- self.assert_(not UsesColor('xterm', None, 'unknown'))
-
-
-if __name__ == '__main__':
- gtest_test_utils.Main()
diff --git a/src/testing/gtest/test/gtest_env_var_test.py b/src/testing/gtest/test/gtest_env_var_test.py
deleted file mode 100755
index 4728bbc3..00000000
--- a/src/testing/gtest/test/gtest_env_var_test.py
+++ /dev/null
@@ -1,104 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2008, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-"""Verifies that Google Test correctly parses environment variables."""
-
-__author__ = 'wan@google.com (Zhanyong Wan)'
-
-import os
-import gtest_test_utils
-
-
-IS_WINDOWS = os.name == 'nt'
-IS_LINUX = os.name == 'posix' and os.uname()[0] == 'Linux'
-
-COMMAND = gtest_test_utils.GetTestExecutablePath('gtest_env_var_test_')
-
-environ = os.environ.copy()
-
-
-def AssertEq(expected, actual):
- if expected != actual:
- print 'Expected: %s' % (expected,)
- print ' Actual: %s' % (actual,)
- raise AssertionError
-
-
-def SetEnvVar(env_var, value):
- """Sets the env variable to 'value'; unsets it when 'value' is None."""
-
- if value is not None:
- environ[env_var] = value
- elif env_var in environ:
- del environ[env_var]
-
-
-def GetFlag(flag):
- """Runs gtest_env_var_test_ and returns its output."""
-
- args = [COMMAND]
- if flag is not None:
- args += [flag]
- return gtest_test_utils.Subprocess(args, env=environ,
- capture_stderr=False).output
-
-
-def TestFlag(flag, test_val, default_val):
- """Verifies that the given flag is affected by the corresponding env var."""
-
- env_var = 'GTEST_' + flag.upper()
- SetEnvVar(env_var, test_val)
- AssertEq(test_val, GetFlag(flag))
- SetEnvVar(env_var, None)
- AssertEq(default_val, GetFlag(flag))
-
-
-class GTestEnvVarTest(gtest_test_utils.TestCase):
- def testEnvVarAffectsFlag(self):
- """Tests that environment variable should affect the corresponding flag."""
-
- TestFlag('break_on_failure', '1', '0')
- TestFlag('color', 'yes', 'auto')
- TestFlag('filter', 'FooTest.Bar', '*')
- TestFlag('output', 'xml:tmp/foo.xml', '')
- TestFlag('print_time', '0', '1')
- TestFlag('repeat', '999', '1')
- TestFlag('throw_on_failure', '1', '0')
- TestFlag('death_test_style', 'threadsafe', 'fast')
- TestFlag('catch_exceptions', '0', '1')
-
- if IS_LINUX:
- TestFlag('death_test_use_fork', '1', '0')
- TestFlag('stack_trace_depth', '0', '100')
-
-
-if __name__ == '__main__':
- gtest_test_utils.Main()
diff --git a/src/testing/gtest/test/gtest_env_var_test_.cc b/src/testing/gtest/test/gtest_env_var_test_.cc
deleted file mode 100644
index 539afc96..00000000
--- a/src/testing/gtest/test/gtest_env_var_test_.cc
+++ /dev/null
@@ -1,126 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-// A helper program for testing that Google Test parses the environment
-// variables correctly.
-
-#include "gtest/gtest.h"
-
-#include <iostream>
-
-#define GTEST_IMPLEMENTATION_ 1
-#include "src/gtest-internal-inl.h"
-#undef GTEST_IMPLEMENTATION_
-
-using ::std::cout;
-
-namespace testing {
-
-// The purpose of this is to make the test more realistic by ensuring
-// that the UnitTest singleton is created before main() is entered.
-// We don't actual run the TEST itself.
-TEST(GTestEnvVarTest, Dummy) {
-}
-
-void PrintFlag(const char* flag) {
- if (strcmp(flag, "break_on_failure") == 0) {
- cout << GTEST_FLAG(break_on_failure);
- return;
- }
-
- if (strcmp(flag, "catch_exceptions") == 0) {
- cout << GTEST_FLAG(catch_exceptions);
- return;
- }
-
- if (strcmp(flag, "color") == 0) {
- cout << GTEST_FLAG(color);
- return;
- }
-
- if (strcmp(flag, "death_test_style") == 0) {
- cout << GTEST_FLAG(death_test_style);
- return;
- }
-
- if (strcmp(flag, "death_test_use_fork") == 0) {
- cout << GTEST_FLAG(death_test_use_fork);
- return;
- }
-
- if (strcmp(flag, "filter") == 0) {
- cout << GTEST_FLAG(filter);
- return;
- }
-
- if (strcmp(flag, "output") == 0) {
- cout << GTEST_FLAG(output);
- return;
- }
-
- if (strcmp(flag, "print_time") == 0) {
- cout << GTEST_FLAG(print_time);
- return;
- }
-
- if (strcmp(flag, "repeat") == 0) {
- cout << GTEST_FLAG(repeat);
- return;
- }
-
- if (strcmp(flag, "stack_trace_depth") == 0) {
- cout << GTEST_FLAG(stack_trace_depth);
- return;
- }
-
- if (strcmp(flag, "throw_on_failure") == 0) {
- cout << GTEST_FLAG(throw_on_failure);
- return;
- }
-
- cout << "Invalid flag name " << flag
- << ". Valid names are break_on_failure, color, filter, etc.\n";
- exit(1);
-}
-
-} // namespace testing
-
-int main(int argc, char** argv) {
- testing::InitGoogleTest(&argc, argv);
-
- if (argc != 2) {
- cout << "Usage: gtest_env_var_test_ NAME_OF_FLAG\n";
- return 1;
- }
-
- testing::PrintFlag(argv[1]);
- return 0;
-}
diff --git a/src/testing/gtest/test/gtest_environment_test.cc b/src/testing/gtest/test/gtest_environment_test.cc
deleted file mode 100644
index 3cff19e7..00000000
--- a/src/testing/gtest/test/gtest_environment_test.cc
+++ /dev/null
@@ -1,192 +0,0 @@
-// Copyright 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-//
-// Tests using global test environments.
-
-#include <stdlib.h>
-#include <stdio.h>
-#include "gtest/gtest.h"
-
-#define GTEST_IMPLEMENTATION_ 1 // Required for the next #include.
-#include "src/gtest-internal-inl.h"
-#undef GTEST_IMPLEMENTATION_
-
-namespace testing {
-GTEST_DECLARE_string_(filter);
-}
-
-namespace {
-
-enum FailureType {
- NO_FAILURE, NON_FATAL_FAILURE, FATAL_FAILURE
-};
-
-// For testing using global test environments.
-class MyEnvironment : public testing::Environment {
- public:
- MyEnvironment() { Reset(); }
-
- // Depending on the value of failure_in_set_up_, SetUp() will
- // generate a non-fatal failure, generate a fatal failure, or
- // succeed.
- virtual void SetUp() {
- set_up_was_run_ = true;
-
- switch (failure_in_set_up_) {
- case NON_FATAL_FAILURE:
- ADD_FAILURE() << "Expected non-fatal failure in global set-up.";
- break;
- case FATAL_FAILURE:
- FAIL() << "Expected fatal failure in global set-up.";
- break;
- default:
- break;
- }
- }
-
- // Generates a non-fatal failure.
- virtual void TearDown() {
- tear_down_was_run_ = true;
- ADD_FAILURE() << "Expected non-fatal failure in global tear-down.";
- }
-
- // Resets the state of the environment s.t. it can be reused.
- void Reset() {
- failure_in_set_up_ = NO_FAILURE;
- set_up_was_run_ = false;
- tear_down_was_run_ = false;
- }
-
- // We call this function to set the type of failure SetUp() should
- // generate.
- void set_failure_in_set_up(FailureType type) {
- failure_in_set_up_ = type;
- }
-
- // Was SetUp() run?
- bool set_up_was_run() const { return set_up_was_run_; }
-
- // Was TearDown() run?
- bool tear_down_was_run() const { return tear_down_was_run_; }
-
- private:
- FailureType failure_in_set_up_;
- bool set_up_was_run_;
- bool tear_down_was_run_;
-};
-
-// Was the TEST run?
-bool test_was_run;
-
-// The sole purpose of this TEST is to enable us to check whether it
-// was run.
-TEST(FooTest, Bar) {
- test_was_run = true;
-}
-
-// Prints the message and aborts the program if condition is false.
-void Check(bool condition, const char* msg) {
- if (!condition) {
- printf("FAILED: %s\n", msg);
- testing::internal::posix::Abort();
- }
-}
-
-// Runs the tests. Return true iff successful.
-//
-// The 'failure' parameter specifies the type of failure that should
-// be generated by the global set-up.
-int RunAllTests(MyEnvironment* env, FailureType failure) {
- env->Reset();
- env->set_failure_in_set_up(failure);
- test_was_run = false;
- testing::internal::GetUnitTestImpl()->ClearAdHocTestResult();
- return RUN_ALL_TESTS();
-}
-
-} // namespace
-
-int main(int argc, char **argv) {
- testing::InitGoogleTest(&argc, argv);
-
- // Registers a global test environment, and verifies that the
- // registration function returns its argument.
- MyEnvironment* const env = new MyEnvironment;
- Check(testing::AddGlobalTestEnvironment(env) == env,
- "AddGlobalTestEnvironment() should return its argument.");
-
- // Verifies that RUN_ALL_TESTS() runs the tests when the global
- // set-up is successful.
- Check(RunAllTests(env, NO_FAILURE) != 0,
- "RUN_ALL_TESTS() should return non-zero, as the global tear-down "
- "should generate a failure.");
- Check(test_was_run,
- "The tests should run, as the global set-up should generate no "
- "failure");
- Check(env->tear_down_was_run(),
- "The global tear-down should run, as the global set-up was run.");
-
- // Verifies that RUN_ALL_TESTS() runs the tests when the global
- // set-up generates no fatal failure.
- Check(RunAllTests(env, NON_FATAL_FAILURE) != 0,
- "RUN_ALL_TESTS() should return non-zero, as both the global set-up "
- "and the global tear-down should generate a non-fatal failure.");
- Check(test_was_run,
- "The tests should run, as the global set-up should generate no "
- "fatal failure.");
- Check(env->tear_down_was_run(),
- "The global tear-down should run, as the global set-up was run.");
-
- // Verifies that RUN_ALL_TESTS() runs no test when the global set-up
- // generates a fatal failure.
- Check(RunAllTests(env, FATAL_FAILURE) != 0,
- "RUN_ALL_TESTS() should return non-zero, as the global set-up "
- "should generate a fatal failure.");
- Check(!test_was_run,
- "The tests should not run, as the global set-up should generate "
- "a fatal failure.");
- Check(env->tear_down_was_run(),
- "The global tear-down should run, as the global set-up was run.");
-
- // Verifies that RUN_ALL_TESTS() doesn't do global set-up or
- // tear-down when there is no test to run.
- testing::GTEST_FLAG(filter) = "-*";
- Check(RunAllTests(env, NO_FAILURE) == 0,
- "RUN_ALL_TESTS() should return zero, as there is no test to run.");
- Check(!env->set_up_was_run(),
- "The global set-up should not run, as there is no test to run.");
- Check(!env->tear_down_was_run(),
- "The global tear-down should not run, "
- "as the global set-up was not run.");
-
- printf("PASS\n");
- return 0;
-}
diff --git a/src/testing/gtest/test/gtest_filter_unittest.py b/src/testing/gtest/test/gtest_filter_unittest.py
deleted file mode 100755
index 0d1a7700..00000000
--- a/src/testing/gtest/test/gtest_filter_unittest.py
+++ /dev/null
@@ -1,633 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2005 Google Inc. All Rights Reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-"""Unit test for Google Test test filters.
-
-A user can specify which test(s) in a Google Test program to run via either
-the GTEST_FILTER environment variable or the --gtest_filter flag.
-This script tests such functionality by invoking
-gtest_filter_unittest_ (a program written with Google Test) with different
-environments and command line flags.
-
-Note that test sharding may also influence which tests are filtered. Therefore,
-we test that here also.
-"""
-
-__author__ = 'wan@google.com (Zhanyong Wan)'
-
-import os
-import re
-import sets
-import sys
-
-import gtest_test_utils
-
-# Constants.
-
-# Checks if this platform can pass empty environment variables to child
-# processes. We set an env variable to an empty string and invoke a python
-# script in a subprocess to print whether the variable is STILL in
-# os.environ. We then use 'eval' to parse the child's output so that an
-# exception is thrown if the input is anything other than 'True' nor 'False'.
-os.environ['EMPTY_VAR'] = ''
-child = gtest_test_utils.Subprocess(
- [sys.executable, '-c', 'import os; print \'EMPTY_VAR\' in os.environ'])
-CAN_PASS_EMPTY_ENV = eval(child.output)
-
-
-# Check if this platform can unset environment variables in child processes.
-# We set an env variable to a non-empty string, unset it, and invoke
-# a python script in a subprocess to print whether the variable
-# is NO LONGER in os.environ.
-# We use 'eval' to parse the child's output so that an exception
-# is thrown if the input is neither 'True' nor 'False'.
-os.environ['UNSET_VAR'] = 'X'
-del os.environ['UNSET_VAR']
-child = gtest_test_utils.Subprocess(
- [sys.executable, '-c', 'import os; print \'UNSET_VAR\' not in os.environ'])
-CAN_UNSET_ENV = eval(child.output)
-
-
-# Checks if we should test with an empty filter. This doesn't
-# make sense on platforms that cannot pass empty env variables (Win32)
-# and on platforms that cannot unset variables (since we cannot tell
-# the difference between "" and NULL -- Borland and Solaris < 5.10)
-CAN_TEST_EMPTY_FILTER = (CAN_PASS_EMPTY_ENV and CAN_UNSET_ENV)
-
-
-# The environment variable for specifying the test filters.
-FILTER_ENV_VAR = 'GTEST_FILTER'
-
-# The environment variables for test sharding.
-TOTAL_SHARDS_ENV_VAR = 'GTEST_TOTAL_SHARDS'
-SHARD_INDEX_ENV_VAR = 'GTEST_SHARD_INDEX'
-SHARD_STATUS_FILE_ENV_VAR = 'GTEST_SHARD_STATUS_FILE'
-
-# The command line flag for specifying the test filters.
-FILTER_FLAG = 'gtest_filter'
-
-# The command line flag for including disabled tests.
-ALSO_RUN_DISABED_TESTS_FLAG = 'gtest_also_run_disabled_tests'
-
-# Command to run the gtest_filter_unittest_ program.
-COMMAND = gtest_test_utils.GetTestExecutablePath('gtest_filter_unittest_')
-
-# Regex for determining whether parameterized tests are enabled in the binary.
-PARAM_TEST_REGEX = re.compile(r'/ParamTest')
-
-# Regex for parsing test case names from Google Test's output.
-TEST_CASE_REGEX = re.compile(r'^\[\-+\] \d+ tests? from (\w+(/\w+)?)')
-
-# Regex for parsing test names from Google Test's output.
-TEST_REGEX = re.compile(r'^\[\s*RUN\s*\].*\.(\w+(/\w+)?)')
-
-# The command line flag to tell Google Test to output the list of tests it
-# will run.
-LIST_TESTS_FLAG = '--gtest_list_tests'
-
-# Indicates whether Google Test supports death tests.
-SUPPORTS_DEATH_TESTS = 'HasDeathTest' in gtest_test_utils.Subprocess(
- [COMMAND, LIST_TESTS_FLAG]).output
-
-# Full names of all tests in gtest_filter_unittests_.
-PARAM_TESTS = [
- 'SeqP/ParamTest.TestX/0',
- 'SeqP/ParamTest.TestX/1',
- 'SeqP/ParamTest.TestY/0',
- 'SeqP/ParamTest.TestY/1',
- 'SeqQ/ParamTest.TestX/0',
- 'SeqQ/ParamTest.TestX/1',
- 'SeqQ/ParamTest.TestY/0',
- 'SeqQ/ParamTest.TestY/1',
- ]
-
-DISABLED_TESTS = [
- 'BarTest.DISABLED_TestFour',
- 'BarTest.DISABLED_TestFive',
- 'BazTest.DISABLED_TestC',
- 'DISABLED_FoobarTest.Test1',
- 'DISABLED_FoobarTest.DISABLED_Test2',
- 'DISABLED_FoobarbazTest.TestA',
- ]
-
-if SUPPORTS_DEATH_TESTS:
- DEATH_TESTS = [
- 'HasDeathTest.Test1',
- 'HasDeathTest.Test2',
- ]
-else:
- DEATH_TESTS = []
-
-# All the non-disabled tests.
-ACTIVE_TESTS = [
- 'FooTest.Abc',
- 'FooTest.Xyz',
-
- 'BarTest.TestOne',
- 'BarTest.TestTwo',
- 'BarTest.TestThree',
-
- 'BazTest.TestOne',
- 'BazTest.TestA',
- 'BazTest.TestB',
- ] + DEATH_TESTS + PARAM_TESTS
-
-param_tests_present = None
-
-# Utilities.
-
-environ = os.environ.copy()
-
-
-def SetEnvVar(env_var, value):
- """Sets the env variable to 'value'; unsets it when 'value' is None."""
-
- if value is not None:
- environ[env_var] = value
- elif env_var in environ:
- del environ[env_var]
-
-
-def RunAndReturnOutput(args = None):
- """Runs the test program and returns its output."""
-
- return gtest_test_utils.Subprocess([COMMAND] + (args or []),
- env=environ).output
-
-
-def RunAndExtractTestList(args = None):
- """Runs the test program and returns its exit code and a list of tests run."""
-
- p = gtest_test_utils.Subprocess([COMMAND] + (args or []), env=environ)
- tests_run = []
- test_case = ''
- test = ''
- for line in p.output.split('\n'):
- match = TEST_CASE_REGEX.match(line)
- if match is not None:
- test_case = match.group(1)
- else:
- match = TEST_REGEX.match(line)
- if match is not None:
- test = match.group(1)
- tests_run.append(test_case + '.' + test)
- return (tests_run, p.exit_code)
-
-
-def InvokeWithModifiedEnv(extra_env, function, *args, **kwargs):
- """Runs the given function and arguments in a modified environment."""
- try:
- original_env = environ.copy()
- environ.update(extra_env)
- return function(*args, **kwargs)
- finally:
- environ.clear()
- environ.update(original_env)
-
-
-def RunWithSharding(total_shards, shard_index, command):
- """Runs a test program shard and returns exit code and a list of tests run."""
-
- extra_env = {SHARD_INDEX_ENV_VAR: str(shard_index),
- TOTAL_SHARDS_ENV_VAR: str(total_shards)}
- return InvokeWithModifiedEnv(extra_env, RunAndExtractTestList, command)
-
-# The unit test.
-
-
-class GTestFilterUnitTest(gtest_test_utils.TestCase):
- """Tests the env variable or the command line flag to filter tests."""
-
- # Utilities.
-
- def AssertSetEqual(self, lhs, rhs):
- """Asserts that two sets are equal."""
-
- for elem in lhs:
- self.assert_(elem in rhs, '%s in %s' % (elem, rhs))
-
- for elem in rhs:
- self.assert_(elem in lhs, '%s in %s' % (elem, lhs))
-
- def AssertPartitionIsValid(self, set_var, list_of_sets):
- """Asserts that list_of_sets is a valid partition of set_var."""
-
- full_partition = []
- for slice_var in list_of_sets:
- full_partition.extend(slice_var)
- self.assertEqual(len(set_var), len(full_partition))
- self.assertEqual(sets.Set(set_var), sets.Set(full_partition))
-
- def AdjustForParameterizedTests(self, tests_to_run):
- """Adjust tests_to_run in case value parameterized tests are disabled."""
-
- global param_tests_present
- if not param_tests_present:
- return list(sets.Set(tests_to_run) - sets.Set(PARAM_TESTS))
- else:
- return tests_to_run
-
- def RunAndVerify(self, gtest_filter, tests_to_run):
- """Checks that the binary runs correct set of tests for a given filter."""
-
- tests_to_run = self.AdjustForParameterizedTests(tests_to_run)
-
- # First, tests using the environment variable.
-
- # Windows removes empty variables from the environment when passing it
- # to a new process. This means it is impossible to pass an empty filter
- # into a process using the environment variable. However, we can still
- # test the case when the variable is not supplied (i.e., gtest_filter is
- # None).
- # pylint: disable-msg=C6403
- if CAN_TEST_EMPTY_FILTER or gtest_filter != '':
- SetEnvVar(FILTER_ENV_VAR, gtest_filter)
- tests_run = RunAndExtractTestList()[0]
- SetEnvVar(FILTER_ENV_VAR, None)
- self.AssertSetEqual(tests_run, tests_to_run)
- # pylint: enable-msg=C6403
-
- # Next, tests using the command line flag.
-
- if gtest_filter is None:
- args = []
- else:
- args = ['--%s=%s' % (FILTER_FLAG, gtest_filter)]
-
- tests_run = RunAndExtractTestList(args)[0]
- self.AssertSetEqual(tests_run, tests_to_run)
-
- def RunAndVerifyWithSharding(self, gtest_filter, total_shards, tests_to_run,
- args=None, check_exit_0=False):
- """Checks that binary runs correct tests for the given filter and shard.
-
- Runs all shards of gtest_filter_unittest_ with the given filter, and
- verifies that the right set of tests were run. The union of tests run
- on each shard should be identical to tests_to_run, without duplicates.
-
- Args:
- gtest_filter: A filter to apply to the tests.
- total_shards: A total number of shards to split test run into.
- tests_to_run: A set of tests expected to run.
- args : Arguments to pass to the to the test binary.
- check_exit_0: When set to a true value, make sure that all shards
- return 0.
- """
-
- tests_to_run = self.AdjustForParameterizedTests(tests_to_run)
-
- # Windows removes empty variables from the environment when passing it
- # to a new process. This means it is impossible to pass an empty filter
- # into a process using the environment variable. However, we can still
- # test the case when the variable is not supplied (i.e., gtest_filter is
- # None).
- # pylint: disable-msg=C6403
- if CAN_TEST_EMPTY_FILTER or gtest_filter != '':
- SetEnvVar(FILTER_ENV_VAR, gtest_filter)
- partition = []
- for i in range(0, total_shards):
- (tests_run, exit_code) = RunWithSharding(total_shards, i, args)
- if check_exit_0:
- self.assertEqual(0, exit_code)
- partition.append(tests_run)
-
- self.AssertPartitionIsValid(tests_to_run, partition)
- SetEnvVar(FILTER_ENV_VAR, None)
- # pylint: enable-msg=C6403
-
- def RunAndVerifyAllowingDisabled(self, gtest_filter, tests_to_run):
- """Checks that the binary runs correct set of tests for the given filter.
-
- Runs gtest_filter_unittest_ with the given filter, and enables
- disabled tests. Verifies that the right set of tests were run.
-
- Args:
- gtest_filter: A filter to apply to the tests.
- tests_to_run: A set of tests expected to run.
- """
-
- tests_to_run = self.AdjustForParameterizedTests(tests_to_run)
-
- # Construct the command line.
- args = ['--%s' % ALSO_RUN_DISABED_TESTS_FLAG]
- if gtest_filter is not None:
- args.append('--%s=%s' % (FILTER_FLAG, gtest_filter))
-
- tests_run = RunAndExtractTestList(args)[0]
- self.AssertSetEqual(tests_run, tests_to_run)
-
- def setUp(self):
- """Sets up test case.
-
- Determines whether value-parameterized tests are enabled in the binary and
- sets the flags accordingly.
- """
-
- global param_tests_present
- if param_tests_present is None:
- param_tests_present = PARAM_TEST_REGEX.search(
- RunAndReturnOutput()) is not None
-
- def testDefaultBehavior(self):
- """Tests the behavior of not specifying the filter."""
-
- self.RunAndVerify(None, ACTIVE_TESTS)
-
- def testDefaultBehaviorWithShards(self):
- """Tests the behavior without the filter, with sharding enabled."""
-
- self.RunAndVerifyWithSharding(None, 1, ACTIVE_TESTS)
- self.RunAndVerifyWithSharding(None, 2, ACTIVE_TESTS)
- self.RunAndVerifyWithSharding(None, len(ACTIVE_TESTS) - 1, ACTIVE_TESTS)
- self.RunAndVerifyWithSharding(None, len(ACTIVE_TESTS), ACTIVE_TESTS)
- self.RunAndVerifyWithSharding(None, len(ACTIVE_TESTS) + 1, ACTIVE_TESTS)
-
- def testEmptyFilter(self):
- """Tests an empty filter."""
-
- self.RunAndVerify('', [])
- self.RunAndVerifyWithSharding('', 1, [])
- self.RunAndVerifyWithSharding('', 2, [])
-
- def testBadFilter(self):
- """Tests a filter that matches nothing."""
-
- self.RunAndVerify('BadFilter', [])
- self.RunAndVerifyAllowingDisabled('BadFilter', [])
-
- def testFullName(self):
- """Tests filtering by full name."""
-
- self.RunAndVerify('FooTest.Xyz', ['FooTest.Xyz'])
- self.RunAndVerifyAllowingDisabled('FooTest.Xyz', ['FooTest.Xyz'])
- self.RunAndVerifyWithSharding('FooTest.Xyz', 5, ['FooTest.Xyz'])
-
- def testUniversalFilters(self):
- """Tests filters that match everything."""
-
- self.RunAndVerify('*', ACTIVE_TESTS)
- self.RunAndVerify('*.*', ACTIVE_TESTS)
- self.RunAndVerifyWithSharding('*.*', len(ACTIVE_TESTS) - 3, ACTIVE_TESTS)
- self.RunAndVerifyAllowingDisabled('*', ACTIVE_TESTS + DISABLED_TESTS)
- self.RunAndVerifyAllowingDisabled('*.*', ACTIVE_TESTS + DISABLED_TESTS)
-
- def testFilterByTestCase(self):
- """Tests filtering by test case name."""
-
- self.RunAndVerify('FooTest.*', ['FooTest.Abc', 'FooTest.Xyz'])
-
- BAZ_TESTS = ['BazTest.TestOne', 'BazTest.TestA', 'BazTest.TestB']
- self.RunAndVerify('BazTest.*', BAZ_TESTS)
- self.RunAndVerifyAllowingDisabled('BazTest.*',
- BAZ_TESTS + ['BazTest.DISABLED_TestC'])
-
- def testFilterByTest(self):
- """Tests filtering by test name."""
-
- self.RunAndVerify('*.TestOne', ['BarTest.TestOne', 'BazTest.TestOne'])
-
- def testFilterDisabledTests(self):
- """Select only the disabled tests to run."""
-
- self.RunAndVerify('DISABLED_FoobarTest.Test1', [])
- self.RunAndVerifyAllowingDisabled('DISABLED_FoobarTest.Test1',
- ['DISABLED_FoobarTest.Test1'])
-
- self.RunAndVerify('*DISABLED_*', [])
- self.RunAndVerifyAllowingDisabled('*DISABLED_*', DISABLED_TESTS)
-
- self.RunAndVerify('*.DISABLED_*', [])
- self.RunAndVerifyAllowingDisabled('*.DISABLED_*', [
- 'BarTest.DISABLED_TestFour',
- 'BarTest.DISABLED_TestFive',
- 'BazTest.DISABLED_TestC',
- 'DISABLED_FoobarTest.DISABLED_Test2',
- ])
-
- self.RunAndVerify('DISABLED_*', [])
- self.RunAndVerifyAllowingDisabled('DISABLED_*', [
- 'DISABLED_FoobarTest.Test1',
- 'DISABLED_FoobarTest.DISABLED_Test2',
- 'DISABLED_FoobarbazTest.TestA',
- ])
-
- def testWildcardInTestCaseName(self):
- """Tests using wildcard in the test case name."""
-
- self.RunAndVerify('*a*.*', [
- 'BarTest.TestOne',
- 'BarTest.TestTwo',
- 'BarTest.TestThree',
-
- 'BazTest.TestOne',
- 'BazTest.TestA',
- 'BazTest.TestB', ] + DEATH_TESTS + PARAM_TESTS)
-
- def testWildcardInTestName(self):
- """Tests using wildcard in the test name."""
-
- self.RunAndVerify('*.*A*', ['FooTest.Abc', 'BazTest.TestA'])
-
- def testFilterWithoutDot(self):
- """Tests a filter that has no '.' in it."""
-
- self.RunAndVerify('*z*', [
- 'FooTest.Xyz',
-
- 'BazTest.TestOne',
- 'BazTest.TestA',
- 'BazTest.TestB',
- ])
-
- def testTwoPatterns(self):
- """Tests filters that consist of two patterns."""
-
- self.RunAndVerify('Foo*.*:*A*', [
- 'FooTest.Abc',
- 'FooTest.Xyz',
-
- 'BazTest.TestA',
- ])
-
- # An empty pattern + a non-empty one
- self.RunAndVerify(':*A*', ['FooTest.Abc', 'BazTest.TestA'])
-
- def testThreePatterns(self):
- """Tests filters that consist of three patterns."""
-
- self.RunAndVerify('*oo*:*A*:*One', [
- 'FooTest.Abc',
- 'FooTest.Xyz',
-
- 'BarTest.TestOne',
-
- 'BazTest.TestOne',
- 'BazTest.TestA',
- ])
-
- # The 2nd pattern is empty.
- self.RunAndVerify('*oo*::*One', [
- 'FooTest.Abc',
- 'FooTest.Xyz',
-
- 'BarTest.TestOne',
-
- 'BazTest.TestOne',
- ])
-
- # The last 2 patterns are empty.
- self.RunAndVerify('*oo*::', [
- 'FooTest.Abc',
- 'FooTest.Xyz',
- ])
-
- def testNegativeFilters(self):
- self.RunAndVerify('*-BazTest.TestOne', [
- 'FooTest.Abc',
- 'FooTest.Xyz',
-
- 'BarTest.TestOne',
- 'BarTest.TestTwo',
- 'BarTest.TestThree',
-
- 'BazTest.TestA',
- 'BazTest.TestB',
- ] + DEATH_TESTS + PARAM_TESTS)
-
- self.RunAndVerify('*-FooTest.Abc:BazTest.*', [
- 'FooTest.Xyz',
-
- 'BarTest.TestOne',
- 'BarTest.TestTwo',
- 'BarTest.TestThree',
- ] + DEATH_TESTS + PARAM_TESTS)
-
- self.RunAndVerify('BarTest.*-BarTest.TestOne', [
- 'BarTest.TestTwo',
- 'BarTest.TestThree',
- ])
-
- # Tests without leading '*'.
- self.RunAndVerify('-FooTest.Abc:FooTest.Xyz:BazTest.*', [
- 'BarTest.TestOne',
- 'BarTest.TestTwo',
- 'BarTest.TestThree',
- ] + DEATH_TESTS + PARAM_TESTS)
-
- # Value parameterized tests.
- self.RunAndVerify('*/*', PARAM_TESTS)
-
- # Value parameterized tests filtering by the sequence name.
- self.RunAndVerify('SeqP/*', [
- 'SeqP/ParamTest.TestX/0',
- 'SeqP/ParamTest.TestX/1',
- 'SeqP/ParamTest.TestY/0',
- 'SeqP/ParamTest.TestY/1',
- ])
-
- # Value parameterized tests filtering by the test name.
- self.RunAndVerify('*/0', [
- 'SeqP/ParamTest.TestX/0',
- 'SeqP/ParamTest.TestY/0',
- 'SeqQ/ParamTest.TestX/0',
- 'SeqQ/ParamTest.TestY/0',
- ])
-
- def testFlagOverridesEnvVar(self):
- """Tests that the filter flag overrides the filtering env. variable."""
-
- SetEnvVar(FILTER_ENV_VAR, 'Foo*')
- args = ['--%s=%s' % (FILTER_FLAG, '*One')]
- tests_run = RunAndExtractTestList(args)[0]
- SetEnvVar(FILTER_ENV_VAR, None)
-
- self.AssertSetEqual(tests_run, ['BarTest.TestOne', 'BazTest.TestOne'])
-
- def testShardStatusFileIsCreated(self):
- """Tests that the shard file is created if specified in the environment."""
-
- shard_status_file = os.path.join(gtest_test_utils.GetTempDir(),
- 'shard_status_file')
- self.assert_(not os.path.exists(shard_status_file))
-
- extra_env = {SHARD_STATUS_FILE_ENV_VAR: shard_status_file}
- try:
- InvokeWithModifiedEnv(extra_env, RunAndReturnOutput)
- finally:
- self.assert_(os.path.exists(shard_status_file))
- os.remove(shard_status_file)
-
- def testShardStatusFileIsCreatedWithListTests(self):
- """Tests that the shard file is created with the "list_tests" flag."""
-
- shard_status_file = os.path.join(gtest_test_utils.GetTempDir(),
- 'shard_status_file2')
- self.assert_(not os.path.exists(shard_status_file))
-
- extra_env = {SHARD_STATUS_FILE_ENV_VAR: shard_status_file}
- try:
- output = InvokeWithModifiedEnv(extra_env,
- RunAndReturnOutput,
- [LIST_TESTS_FLAG])
- finally:
- # This assertion ensures that Google Test enumerated the tests as
- # opposed to running them.
- self.assert_('[==========]' not in output,
- 'Unexpected output during test enumeration.\n'
- 'Please ensure that LIST_TESTS_FLAG is assigned the\n'
- 'correct flag value for listing Google Test tests.')
-
- self.assert_(os.path.exists(shard_status_file))
- os.remove(shard_status_file)
-
- if SUPPORTS_DEATH_TESTS:
- def testShardingWorksWithDeathTests(self):
- """Tests integration with death tests and sharding."""
-
- gtest_filter = 'HasDeathTest.*:SeqP/*'
- expected_tests = [
- 'HasDeathTest.Test1',
- 'HasDeathTest.Test2',
-
- 'SeqP/ParamTest.TestX/0',
- 'SeqP/ParamTest.TestX/1',
- 'SeqP/ParamTest.TestY/0',
- 'SeqP/ParamTest.TestY/1',
- ]
-
- for flag in ['--gtest_death_test_style=threadsafe',
- '--gtest_death_test_style=fast']:
- self.RunAndVerifyWithSharding(gtest_filter, 3, expected_tests,
- check_exit_0=True, args=[flag])
- self.RunAndVerifyWithSharding(gtest_filter, 5, expected_tests,
- check_exit_0=True, args=[flag])
-
-if __name__ == '__main__':
- gtest_test_utils.Main()
diff --git a/src/testing/gtest/test/gtest_filter_unittest_.cc b/src/testing/gtest/test/gtest_filter_unittest_.cc
deleted file mode 100644
index 77deffc3..00000000
--- a/src/testing/gtest/test/gtest_filter_unittest_.cc
+++ /dev/null
@@ -1,140 +0,0 @@
-// Copyright 2005, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-// Unit test for Google Test test filters.
-//
-// A user can specify which test(s) in a Google Test program to run via
-// either the GTEST_FILTER environment variable or the --gtest_filter
-// flag. This is used for testing such functionality.
-//
-// The program will be invoked from a Python unit test. Don't run it
-// directly.
-
-#include "gtest/gtest.h"
-
-namespace {
-
-// Test case FooTest.
-
-class FooTest : public testing::Test {
-};
-
-TEST_F(FooTest, Abc) {
-}
-
-TEST_F(FooTest, Xyz) {
- FAIL() << "Expected failure.";
-}
-
-// Test case BarTest.
-
-TEST(BarTest, TestOne) {
-}
-
-TEST(BarTest, TestTwo) {
-}
-
-TEST(BarTest, TestThree) {
-}
-
-TEST(BarTest, DISABLED_TestFour) {
- FAIL() << "Expected failure.";
-}
-
-TEST(BarTest, DISABLED_TestFive) {
- FAIL() << "Expected failure.";
-}
-
-// Test case BazTest.
-
-TEST(BazTest, TestOne) {
- FAIL() << "Expected failure.";
-}
-
-TEST(BazTest, TestA) {
-}
-
-TEST(BazTest, TestB) {
-}
-
-TEST(BazTest, DISABLED_TestC) {
- FAIL() << "Expected failure.";
-}
-
-// Test case HasDeathTest
-
-TEST(HasDeathTest, Test1) {
- EXPECT_DEATH_IF_SUPPORTED(exit(1), ".*");
-}
-
-// We need at least two death tests to make sure that the all death tests
-// aren't on the first shard.
-TEST(HasDeathTest, Test2) {
- EXPECT_DEATH_IF_SUPPORTED(exit(1), ".*");
-}
-
-// Test case FoobarTest
-
-TEST(DISABLED_FoobarTest, Test1) {
- FAIL() << "Expected failure.";
-}
-
-TEST(DISABLED_FoobarTest, DISABLED_Test2) {
- FAIL() << "Expected failure.";
-}
-
-// Test case FoobarbazTest
-
-TEST(DISABLED_FoobarbazTest, TestA) {
- FAIL() << "Expected failure.";
-}
-
-#if GTEST_HAS_PARAM_TEST
-class ParamTest : public testing::TestWithParam<int> {
-};
-
-TEST_P(ParamTest, TestX) {
-}
-
-TEST_P(ParamTest, TestY) {
-}
-
-INSTANTIATE_TEST_CASE_P(SeqP, ParamTest, testing::Values(1, 2));
-INSTANTIATE_TEST_CASE_P(SeqQ, ParamTest, testing::Values(5, 6));
-#endif // GTEST_HAS_PARAM_TEST
-
-} // namespace
-
-int main(int argc, char **argv) {
- ::testing::InitGoogleTest(&argc, argv);
-
- return RUN_ALL_TESTS();
-}
diff --git a/src/testing/gtest/test/gtest_help_test.py b/src/testing/gtest/test/gtest_help_test.py
deleted file mode 100755
index 093c838d..00000000
--- a/src/testing/gtest/test/gtest_help_test.py
+++ /dev/null
@@ -1,172 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2009, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-"""Tests the --help flag of Google C++ Testing Framework.
-
-SYNOPSIS
- gtest_help_test.py --build_dir=BUILD/DIR
- # where BUILD/DIR contains the built gtest_help_test_ file.
- gtest_help_test.py
-"""
-
-__author__ = 'wan@google.com (Zhanyong Wan)'
-
-import os
-import re
-import gtest_test_utils
-
-
-IS_LINUX = os.name == 'posix' and os.uname()[0] == 'Linux'
-IS_WINDOWS = os.name == 'nt'
-
-PROGRAM_PATH = gtest_test_utils.GetTestExecutablePath('gtest_help_test_')
-FLAG_PREFIX = '--gtest_'
-DEATH_TEST_STYLE_FLAG = FLAG_PREFIX + 'death_test_style'
-STREAM_RESULT_TO_FLAG = FLAG_PREFIX + 'stream_result_to'
-UNKNOWN_FLAG = FLAG_PREFIX + 'unknown_flag_for_testing'
-LIST_TESTS_FLAG = FLAG_PREFIX + 'list_tests'
-INCORRECT_FLAG_VARIANTS = [re.sub('^--', '-', LIST_TESTS_FLAG),
- re.sub('^--', '/', LIST_TESTS_FLAG),
- re.sub('_', '-', LIST_TESTS_FLAG)]
-INTERNAL_FLAG_FOR_TESTING = FLAG_PREFIX + 'internal_flag_for_testing'
-
-SUPPORTS_DEATH_TESTS = "DeathTest" in gtest_test_utils.Subprocess(
- [PROGRAM_PATH, LIST_TESTS_FLAG]).output
-
-# The help message must match this regex.
-HELP_REGEX = re.compile(
- FLAG_PREFIX + r'list_tests.*' +
- FLAG_PREFIX + r'filter=.*' +
- FLAG_PREFIX + r'also_run_disabled_tests.*' +
- FLAG_PREFIX + r'repeat=.*' +
- FLAG_PREFIX + r'shuffle.*' +
- FLAG_PREFIX + r'random_seed=.*' +
- FLAG_PREFIX + r'color=.*' +
- FLAG_PREFIX + r'print_time.*' +
- FLAG_PREFIX + r'output=.*' +
- FLAG_PREFIX + r'break_on_failure.*' +
- FLAG_PREFIX + r'throw_on_failure.*' +
- FLAG_PREFIX + r'catch_exceptions=0.*',
- re.DOTALL)
-
-
-def RunWithFlag(flag):
- """Runs gtest_help_test_ with the given flag.
-
- Returns:
- the exit code and the text output as a tuple.
- Args:
- flag: the command-line flag to pass to gtest_help_test_, or None.
- """
-
- if flag is None:
- command = [PROGRAM_PATH]
- else:
- command = [PROGRAM_PATH, flag]
- child = gtest_test_utils.Subprocess(command)
- return child.exit_code, child.output
-
-
-class GTestHelpTest(gtest_test_utils.TestCase):
- """Tests the --help flag and its equivalent forms."""
-
- def TestHelpFlag(self, flag):
- """Verifies correct behavior when help flag is specified.
-
- The right message must be printed and the tests must
- skipped when the given flag is specified.
-
- Args:
- flag: A flag to pass to the binary or None.
- """
-
- exit_code, output = RunWithFlag(flag)
- self.assertEquals(0, exit_code)
- self.assert_(HELP_REGEX.search(output), output)
-
- if IS_LINUX:
- self.assert_(STREAM_RESULT_TO_FLAG in output, output)
- else:
- self.assert_(STREAM_RESULT_TO_FLAG not in output, output)
-
- if SUPPORTS_DEATH_TESTS and not IS_WINDOWS:
- self.assert_(DEATH_TEST_STYLE_FLAG in output, output)
- else:
- self.assert_(DEATH_TEST_STYLE_FLAG not in output, output)
-
- def TestNonHelpFlag(self, flag):
- """Verifies correct behavior when no help flag is specified.
-
- Verifies that when no help flag is specified, the tests are run
- and the help message is not printed.
-
- Args:
- flag: A flag to pass to the binary or None.
- """
-
- exit_code, output = RunWithFlag(flag)
- self.assert_(exit_code != 0)
- self.assert_(not HELP_REGEX.search(output), output)
-
- def testPrintsHelpWithFullFlag(self):
- self.TestHelpFlag('--help')
-
- def testPrintsHelpWithShortFlag(self):
- self.TestHelpFlag('-h')
-
- def testPrintsHelpWithQuestionFlag(self):
- self.TestHelpFlag('-?')
-
- def testPrintsHelpWithWindowsStyleQuestionFlag(self):
- self.TestHelpFlag('/?')
-
- def testPrintsHelpWithUnrecognizedGoogleTestFlag(self):
- self.TestHelpFlag(UNKNOWN_FLAG)
-
- def testPrintsHelpWithIncorrectFlagStyle(self):
- for incorrect_flag in INCORRECT_FLAG_VARIANTS:
- self.TestHelpFlag(incorrect_flag)
-
- def testRunsTestsWithoutHelpFlag(self):
- """Verifies that when no help flag is specified, the tests are run
- and the help message is not printed."""
-
- self.TestNonHelpFlag(None)
-
- def testRunsTestsWithGtestInternalFlag(self):
- """Verifies that the tests are run and no help message is printed when
- a flag starting with Google Test prefix and 'internal_' is supplied."""
-
- self.TestNonHelpFlag(INTERNAL_FLAG_FOR_TESTING)
-
-
-if __name__ == '__main__':
- gtest_test_utils.Main()
diff --git a/src/testing/gtest/test/gtest_list_tests_unittest.py b/src/testing/gtest/test/gtest_list_tests_unittest.py
deleted file mode 100755
index ce8c3ef0..00000000
--- a/src/testing/gtest/test/gtest_list_tests_unittest.py
+++ /dev/null
@@ -1,177 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2006, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-"""Unit test for Google Test's --gtest_list_tests flag.
-
-A user can ask Google Test to list all tests by specifying the
---gtest_list_tests flag. This script tests such functionality
-by invoking gtest_list_tests_unittest_ (a program written with
-Google Test) the command line flags.
-"""
-
-__author__ = 'phanna@google.com (Patrick Hanna)'
-
-import gtest_test_utils
-
-
-# Constants.
-
-# The command line flag for enabling/disabling listing all tests.
-LIST_TESTS_FLAG = 'gtest_list_tests'
-
-# Path to the gtest_list_tests_unittest_ program.
-EXE_PATH = gtest_test_utils.GetTestExecutablePath('gtest_list_tests_unittest_')
-
-# The expected output when running gtest_list_tests_unittest_ with
-# --gtest_list_tests
-EXPECTED_OUTPUT_NO_FILTER = """FooDeathTest.
- Test1
-Foo.
- Bar1
- Bar2
- DISABLED_Bar3
-Abc.
- Xyz
- Def
-FooBar.
- Baz
-FooTest.
- Test1
- DISABLED_Test2
- Test3
-"""
-
-# The expected output when running gtest_list_tests_unittest_ with
-# --gtest_list_tests and --gtest_filter=Foo*.
-EXPECTED_OUTPUT_FILTER_FOO = """FooDeathTest.
- Test1
-Foo.
- Bar1
- Bar2
- DISABLED_Bar3
-FooBar.
- Baz
-FooTest.
- Test1
- DISABLED_Test2
- Test3
-"""
-
-# Utilities.
-
-
-def Run(args):
- """Runs gtest_list_tests_unittest_ and returns the list of tests printed."""
-
- return gtest_test_utils.Subprocess([EXE_PATH] + args,
- capture_stderr=False).output
-
-
-# The unit test.
-
-class GTestListTestsUnitTest(gtest_test_utils.TestCase):
- """Tests using the --gtest_list_tests flag to list all tests."""
-
- def RunAndVerify(self, flag_value, expected_output, other_flag):
- """Runs gtest_list_tests_unittest_ and verifies that it prints
- the correct tests.
-
- Args:
- flag_value: value of the --gtest_list_tests flag;
- None if the flag should not be present.
-
- expected_output: the expected output after running command;
-
- other_flag: a different flag to be passed to command
- along with gtest_list_tests;
- None if the flag should not be present.
- """
-
- if flag_value is None:
- flag = ''
- flag_expression = 'not set'
- elif flag_value == '0':
- flag = '--%s=0' % LIST_TESTS_FLAG
- flag_expression = '0'
- else:
- flag = '--%s' % LIST_TESTS_FLAG
- flag_expression = '1'
-
- args = [flag]
-
- if other_flag is not None:
- args += [other_flag]
-
- output = Run(args)
-
- msg = ('when %s is %s, the output of "%s" is "%s".' %
- (LIST_TESTS_FLAG, flag_expression, ' '.join(args), output))
-
- if expected_output is not None:
- self.assert_(output == expected_output, msg)
- else:
- self.assert_(output != EXPECTED_OUTPUT_NO_FILTER, msg)
-
- def testDefaultBehavior(self):
- """Tests the behavior of the default mode."""
-
- self.RunAndVerify(flag_value=None,
- expected_output=None,
- other_flag=None)
-
- def testFlag(self):
- """Tests using the --gtest_list_tests flag."""
-
- self.RunAndVerify(flag_value='0',
- expected_output=None,
- other_flag=None)
- self.RunAndVerify(flag_value='1',
- expected_output=EXPECTED_OUTPUT_NO_FILTER,
- other_flag=None)
-
- def testOverrideNonFilterFlags(self):
- """Tests that --gtest_list_tests overrides the non-filter flags."""
-
- self.RunAndVerify(flag_value='1',
- expected_output=EXPECTED_OUTPUT_NO_FILTER,
- other_flag='--gtest_break_on_failure')
-
- def testWithFilterFlags(self):
- """Tests that --gtest_list_tests takes into account the
- --gtest_filter flag."""
-
- self.RunAndVerify(flag_value='1',
- expected_output=EXPECTED_OUTPUT_FILTER_FOO,
- other_flag='--gtest_filter=Foo*')
-
-
-if __name__ == '__main__':
- gtest_test_utils.Main()
diff --git a/src/testing/gtest/test/gtest_no_test_unittest.cc b/src/testing/gtest/test/gtest_no_test_unittest.cc
deleted file mode 100644
index 292599af..00000000
--- a/src/testing/gtest/test/gtest_no_test_unittest.cc
+++ /dev/null
@@ -1,56 +0,0 @@
-// Copyright 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Tests that a Google Test program that has no test defined can run
-// successfully.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-#include "gtest/gtest.h"
-
-int main(int argc, char **argv) {
- testing::InitGoogleTest(&argc, argv);
-
- // An ad-hoc assertion outside of all tests.
- //
- // This serves three purposes:
- //
- // 1. It verifies that an ad-hoc assertion can be executed even if
- // no test is defined.
- // 2. It verifies that a failed ad-hoc assertion causes the test
- // program to fail.
- // 3. We had a bug where the XML output won't be generated if an
- // assertion is executed before RUN_ALL_TESTS() is called, even
- // though --gtest_output=xml is specified. This makes sure the
- // bug is fixed and doesn't regress.
- EXPECT_EQ(1, 2);
-
- // The above EXPECT_EQ() should cause RUN_ALL_TESTS() to return non-zero.
- return RUN_ALL_TESTS() ? 0 : 1;
-}
diff --git a/src/testing/gtest/test/gtest_output_test.py b/src/testing/gtest/test/gtest_output_test.py
deleted file mode 100755
index 72b3ae00..00000000
--- a/src/testing/gtest/test/gtest_output_test.py
+++ /dev/null
@@ -1,335 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2008, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-"""Tests the text output of Google C++ Testing Framework.
-
-SYNOPSIS
- gtest_output_test.py --build_dir=BUILD/DIR --gengolden
- # where BUILD/DIR contains the built gtest_output_test_ file.
- gtest_output_test.py --gengolden
- gtest_output_test.py
-"""
-
-__author__ = 'wan@google.com (Zhanyong Wan)'
-
-import os
-import re
-import sys
-import gtest_test_utils
-
-
-# The flag for generating the golden file
-GENGOLDEN_FLAG = '--gengolden'
-CATCH_EXCEPTIONS_ENV_VAR_NAME = 'GTEST_CATCH_EXCEPTIONS'
-
-IS_WINDOWS = os.name == 'nt'
-
-# TODO(vladl@google.com): remove the _lin suffix.
-GOLDEN_NAME = 'gtest_output_test_golden_lin.txt'
-
-PROGRAM_PATH = gtest_test_utils.GetTestExecutablePath('gtest_output_test_')
-
-# At least one command we exercise must not have the
-# --gtest_internal_skip_environment_and_ad_hoc_tests flag.
-COMMAND_LIST_TESTS = ({}, [PROGRAM_PATH, '--gtest_list_tests'])
-COMMAND_WITH_COLOR = ({}, [PROGRAM_PATH, '--gtest_color=yes'])
-COMMAND_WITH_TIME = ({}, [PROGRAM_PATH,
- '--gtest_print_time',
- '--gtest_internal_skip_environment_and_ad_hoc_tests',
- '--gtest_filter=FatalFailureTest.*:LoggingTest.*'])
-COMMAND_WITH_DISABLED = (
- {}, [PROGRAM_PATH,
- '--gtest_also_run_disabled_tests',
- '--gtest_internal_skip_environment_and_ad_hoc_tests',
- '--gtest_filter=*DISABLED_*'])
-COMMAND_WITH_SHARDING = (
- {'GTEST_SHARD_INDEX': '1', 'GTEST_TOTAL_SHARDS': '2'},
- [PROGRAM_PATH,
- '--gtest_internal_skip_environment_and_ad_hoc_tests',
- '--gtest_filter=PassingTest.*'])
-
-GOLDEN_PATH = os.path.join(gtest_test_utils.GetSourceDir(), GOLDEN_NAME)
-
-
-def ToUnixLineEnding(s):
- """Changes all Windows/Mac line endings in s to UNIX line endings."""
-
- return s.replace('\r\n', '\n').replace('\r', '\n')
-
-
-def RemoveLocations(test_output):
- """Removes all file location info from a Google Test program's output.
-
- Args:
- test_output: the output of a Google Test program.
-
- Returns:
- output with all file location info (in the form of
- 'DIRECTORY/FILE_NAME:LINE_NUMBER: 'or
- 'DIRECTORY\\FILE_NAME(LINE_NUMBER): ') replaced by
- 'FILE_NAME:#: '.
- """
-
- return re.sub(r'.*[/\\](.+)(\:\d+|\(\d+\))\: ', r'\1:#: ', test_output)
-
-
-def RemoveStackTraceDetails(output):
- """Removes all stack traces from a Google Test program's output."""
-
- # *? means "find the shortest string that matches".
- return re.sub(r'Stack trace:(.|\n)*?\n\n',
- 'Stack trace: (omitted)\n\n', output)
-
-
-def RemoveStackTraces(output):
- """Removes all traces of stack traces from a Google Test program's output."""
-
- # *? means "find the shortest string that matches".
- return re.sub(r'Stack trace:(.|\n)*?\n\n', '', output)
-
-
-def RemoveTime(output):
- """Removes all time information from a Google Test program's output."""
-
- return re.sub(r'\(\d+ ms', '(? ms', output)
-
-
-def RemoveTypeInfoDetails(test_output):
- """Removes compiler-specific type info from Google Test program's output.
-
- Args:
- test_output: the output of a Google Test program.
-
- Returns:
- output with type information normalized to canonical form.
- """
-
- # some compilers output the name of type 'unsigned int' as 'unsigned'
- return re.sub(r'unsigned int', 'unsigned', test_output)
-
-
-def NormalizeToCurrentPlatform(test_output):
- """Normalizes platform specific output details for easier comparison."""
-
- if IS_WINDOWS:
- # Removes the color information that is not present on Windows.
- test_output = re.sub('\x1b\\[(0;3\d)?m', '', test_output)
- # Changes failure message headers into the Windows format.
- test_output = re.sub(r': Failure\n', r': error: ', test_output)
- # Changes file(line_number) to file:line_number.
- test_output = re.sub(r'((\w|\.)+)\((\d+)\):', r'\1:\3:', test_output)
-
- return test_output
-
-
-def RemoveTestCounts(output):
- """Removes test counts from a Google Test program's output."""
-
- output = re.sub(r'\d+ tests?, listed below',
- '? tests, listed below', output)
- output = re.sub(r'\d+ FAILED TESTS',
- '? FAILED TESTS', output)
- output = re.sub(r'\d+ tests? from \d+ test cases?',
- '? tests from ? test cases', output)
- output = re.sub(r'\d+ tests? from ([a-zA-Z_])',
- r'? tests from \1', output)
- return re.sub(r'\d+ tests?\.', '? tests.', output)
-
-
-def RemoveMatchingTests(test_output, pattern):
- """Removes output of specified tests from a Google Test program's output.
-
- This function strips not only the beginning and the end of a test but also
- all output in between.
-
- Args:
- test_output: A string containing the test output.
- pattern: A regex string that matches names of test cases or
- tests to remove.
-
- Returns:
- Contents of test_output with tests whose names match pattern removed.
- """
-
- test_output = re.sub(
- r'.*\[ RUN \] .*%s(.|\n)*?\[( FAILED | OK )\] .*%s.*\n' % (
- pattern, pattern),
- '',
- test_output)
- return re.sub(r'.*%s.*\n' % pattern, '', test_output)
-
-
-def NormalizeOutput(output):
- """Normalizes output (the output of gtest_output_test_.exe)."""
-
- output = ToUnixLineEnding(output)
- output = RemoveLocations(output)
- output = RemoveStackTraceDetails(output)
- output = RemoveTime(output)
- return output
-
-
-def GetShellCommandOutput(env_cmd):
- """Runs a command in a sub-process, and returns its output in a string.
-
- Args:
- env_cmd: The shell command. A 2-tuple where element 0 is a dict of extra
- environment variables to set, and element 1 is a string with
- the command and any flags.
-
- Returns:
- A string with the command's combined standard and diagnostic output.
- """
-
- # Spawns cmd in a sub-process, and gets its standard I/O file objects.
- # Set and save the environment properly.
- environ = os.environ.copy()
- environ.update(env_cmd[0])
- p = gtest_test_utils.Subprocess(env_cmd[1], env=environ, capture_stderr=False)
-
- return p.output
-
-
-def GetCommandOutput(env_cmd):
- """Runs a command and returns its output with all file location
- info stripped off.
-
- Args:
- env_cmd: The shell command. A 2-tuple where element 0 is a dict of extra
- environment variables to set, and element 1 is a string with
- the command and any flags.
- """
-
- # Disables exception pop-ups on Windows.
- environ, cmdline = env_cmd
- environ = dict(environ) # Ensures we are modifying a copy.
- environ[CATCH_EXCEPTIONS_ENV_VAR_NAME] = '1'
- return NormalizeOutput(GetShellCommandOutput((environ, cmdline)))
-
-
-def GetOutputOfAllCommands():
- """Returns concatenated output from several representative commands."""
-
- return (GetCommandOutput(COMMAND_WITH_COLOR) +
- GetCommandOutput(COMMAND_WITH_TIME) +
- GetCommandOutput(COMMAND_WITH_DISABLED) +
- GetCommandOutput(COMMAND_WITH_SHARDING))
-
-
-test_list = GetShellCommandOutput(COMMAND_LIST_TESTS)
-SUPPORTS_DEATH_TESTS = 'DeathTest' in test_list
-SUPPORTS_TYPED_TESTS = 'TypedTest' in test_list
-SUPPORTS_THREADS = 'ExpectFailureWithThreadsTest' in test_list
-SUPPORTS_STACK_TRACES = False
-
-CAN_GENERATE_GOLDEN_FILE = (SUPPORTS_DEATH_TESTS and
- SUPPORTS_TYPED_TESTS and
- SUPPORTS_THREADS)
-
-
-class GTestOutputTest(gtest_test_utils.TestCase):
- def RemoveUnsupportedTests(self, test_output):
- if not SUPPORTS_DEATH_TESTS:
- test_output = RemoveMatchingTests(test_output, 'DeathTest')
- if not SUPPORTS_TYPED_TESTS:
- test_output = RemoveMatchingTests(test_output, 'TypedTest')
- test_output = RemoveMatchingTests(test_output, 'TypedDeathTest')
- test_output = RemoveMatchingTests(test_output, 'TypeParamDeathTest')
- if not SUPPORTS_THREADS:
- test_output = RemoveMatchingTests(test_output,
- 'ExpectFailureWithThreadsTest')
- test_output = RemoveMatchingTests(test_output,
- 'ScopedFakeTestPartResultReporterTest')
- test_output = RemoveMatchingTests(test_output,
- 'WorksConcurrently')
- if not SUPPORTS_STACK_TRACES:
- test_output = RemoveStackTraces(test_output)
-
- return test_output
-
- def testOutput(self):
- output = GetOutputOfAllCommands()
-
- golden_file = open(GOLDEN_PATH, 'rb')
- # A mis-configured source control system can cause \r appear in EOL
- # sequences when we read the golden file irrespective of an operating
- # system used. Therefore, we need to strip those \r's from newlines
- # unconditionally.
- golden = ToUnixLineEnding(golden_file.read())
- golden_file.close()
-
- # We want the test to pass regardless of certain features being
- # supported or not.
-
- # We still have to remove type name specifics in all cases.
- normalized_actual = RemoveTypeInfoDetails(output)
- normalized_golden = RemoveTypeInfoDetails(golden)
-
- if CAN_GENERATE_GOLDEN_FILE:
- self.assertEqual(normalized_golden, normalized_actual)
- else:
- normalized_actual = NormalizeToCurrentPlatform(
- RemoveTestCounts(normalized_actual))
- normalized_golden = NormalizeToCurrentPlatform(
- RemoveTestCounts(self.RemoveUnsupportedTests(normalized_golden)))
-
- # This code is very handy when debugging golden file differences:
- if os.getenv('DEBUG_GTEST_OUTPUT_TEST'):
- open(os.path.join(
- gtest_test_utils.GetSourceDir(),
- '_gtest_output_test_normalized_actual.txt'), 'wb').write(
- normalized_actual)
- open(os.path.join(
- gtest_test_utils.GetSourceDir(),
- '_gtest_output_test_normalized_golden.txt'), 'wb').write(
- normalized_golden)
-
- self.assertEqual(normalized_golden, normalized_actual)
-
-
-if __name__ == '__main__':
- if sys.argv[1:] == [GENGOLDEN_FLAG]:
- if CAN_GENERATE_GOLDEN_FILE:
- output = GetOutputOfAllCommands()
- golden_file = open(GOLDEN_PATH, 'wb')
- golden_file.write(output)
- golden_file.close()
- else:
- message = (
- """Unable to write a golden file when compiled in an environment
-that does not support all the required features (death tests, typed tests,
-and multiple threads). Please generate the golden file using a binary built
-with those features enabled.""")
-
- sys.stderr.write(message)
- sys.exit(1)
- else:
- gtest_test_utils.Main()
diff --git a/src/testing/gtest/test/gtest_output_test_.cc b/src/testing/gtest/test/gtest_output_test_.cc
deleted file mode 100644
index 1b08b65b..00000000
--- a/src/testing/gtest/test/gtest_output_test_.cc
+++ /dev/null
@@ -1,1021 +0,0 @@
-// Copyright 2005, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// A unit test for Google Test itself. This verifies that the basic
-// constructs of Google Test work.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-#include "gtest/gtest-spi.h"
-#include "gtest/gtest.h"
-
-// Indicates that this translation unit is part of Google Test's
-// implementation. It must come before gtest-internal-inl.h is
-// included, or there will be a compiler error. This trick is to
-// prevent a user from accidentally including gtest-internal-inl.h in
-// his code.
-#define GTEST_IMPLEMENTATION_ 1
-#include "src/gtest-internal-inl.h"
-#undef GTEST_IMPLEMENTATION_
-
-#include <stdlib.h>
-
-#if GTEST_IS_THREADSAFE
-using testing::ScopedFakeTestPartResultReporter;
-using testing::TestPartResultArray;
-
-using testing::internal::Notification;
-using testing::internal::ThreadWithParam;
-#endif
-
-namespace posix = ::testing::internal::posix;
-using testing::internal::String;
-using testing::internal::scoped_ptr;
-
-// Tests catching fatal failures.
-
-// A subroutine used by the following test.
-void TestEq1(int x) {
- ASSERT_EQ(1, x);
-}
-
-// This function calls a test subroutine, catches the fatal failure it
-// generates, and then returns early.
-void TryTestSubroutine() {
- // Calls a subrountine that yields a fatal failure.
- TestEq1(2);
-
- // Catches the fatal failure and aborts the test.
- //
- // The testing::Test:: prefix is necessary when calling
- // HasFatalFailure() outside of a TEST, TEST_F, or test fixture.
- if (testing::Test::HasFatalFailure()) return;
-
- // If we get here, something is wrong.
- FAIL() << "This should never be reached.";
-}
-
-TEST(PassingTest, PassingTest1) {
-}
-
-TEST(PassingTest, PassingTest2) {
-}
-
-// Tests that parameters of failing parameterized tests are printed in the
-// failing test summary.
-class FailingParamTest : public testing::TestWithParam<int> {};
-
-TEST_P(FailingParamTest, Fails) {
- EXPECT_EQ(1, GetParam());
-}
-
-// This generates a test which will fail. Google Test is expected to print
-// its parameter when it outputs the list of all failed tests.
-INSTANTIATE_TEST_CASE_P(PrintingFailingParams,
- FailingParamTest,
- testing::Values(2));
-
-// Tests catching a fatal failure in a subroutine.
-TEST(FatalFailureTest, FatalFailureInSubroutine) {
- printf("(expecting a failure that x should be 1)\n");
-
- TryTestSubroutine();
-}
-
-// Tests catching a fatal failure in a nested subroutine.
-TEST(FatalFailureTest, FatalFailureInNestedSubroutine) {
- printf("(expecting a failure that x should be 1)\n");
-
- // Calls a subrountine that yields a fatal failure.
- TryTestSubroutine();
-
- // Catches the fatal failure and aborts the test.
- //
- // When calling HasFatalFailure() inside a TEST, TEST_F, or test
- // fixture, the testing::Test:: prefix is not needed.
- if (HasFatalFailure()) return;
-
- // If we get here, something is wrong.
- FAIL() << "This should never be reached.";
-}
-
-// Tests HasFatalFailure() after a failed EXPECT check.
-TEST(FatalFailureTest, NonfatalFailureInSubroutine) {
- printf("(expecting a failure on false)\n");
- EXPECT_TRUE(false); // Generates a nonfatal failure
- ASSERT_FALSE(HasFatalFailure()); // This should succeed.
-}
-
-// Tests interleaving user logging and Google Test assertions.
-TEST(LoggingTest, InterleavingLoggingAndAssertions) {
- static const int a[4] = {
- 3, 9, 2, 6
- };
-
- printf("(expecting 2 failures on (3) >= (a[i]))\n");
- for (int i = 0; i < static_cast<int>(sizeof(a)/sizeof(*a)); i++) {
- printf("i == %d\n", i);
- EXPECT_GE(3, a[i]);
- }
-}
-
-// Tests the SCOPED_TRACE macro.
-
-// A helper function for testing SCOPED_TRACE.
-void SubWithoutTrace(int n) {
- EXPECT_EQ(1, n);
- ASSERT_EQ(2, n);
-}
-
-// Another helper function for testing SCOPED_TRACE.
-void SubWithTrace(int n) {
- SCOPED_TRACE(testing::Message() << "n = " << n);
-
- SubWithoutTrace(n);
-}
-
-// Tests that SCOPED_TRACE() obeys lexical scopes.
-TEST(SCOPED_TRACETest, ObeysScopes) {
- printf("(expected to fail)\n");
-
- // There should be no trace before SCOPED_TRACE() is invoked.
- ADD_FAILURE() << "This failure is expected, and shouldn't have a trace.";
-
- {
- SCOPED_TRACE("Expected trace");
- // After SCOPED_TRACE(), a failure in the current scope should contain
- // the trace.
- ADD_FAILURE() << "This failure is expected, and should have a trace.";
- }
-
- // Once the control leaves the scope of the SCOPED_TRACE(), there
- // should be no trace again.
- ADD_FAILURE() << "This failure is expected, and shouldn't have a trace.";
-}
-
-// Tests that SCOPED_TRACE works inside a loop.
-TEST(SCOPED_TRACETest, WorksInLoop) {
- printf("(expected to fail)\n");
-
- for (int i = 1; i <= 2; i++) {
- SCOPED_TRACE(testing::Message() << "i = " << i);
-
- SubWithoutTrace(i);
- }
-}
-
-// Tests that SCOPED_TRACE works in a subroutine.
-TEST(SCOPED_TRACETest, WorksInSubroutine) {
- printf("(expected to fail)\n");
-
- SubWithTrace(1);
- SubWithTrace(2);
-}
-
-// Tests that SCOPED_TRACE can be nested.
-TEST(SCOPED_TRACETest, CanBeNested) {
- printf("(expected to fail)\n");
-
- SCOPED_TRACE(""); // A trace without a message.
-
- SubWithTrace(2);
-}
-
-// Tests that multiple SCOPED_TRACEs can be used in the same scope.
-TEST(SCOPED_TRACETest, CanBeRepeated) {
- printf("(expected to fail)\n");
-
- SCOPED_TRACE("A");
- ADD_FAILURE()
- << "This failure is expected, and should contain trace point A.";
-
- SCOPED_TRACE("B");
- ADD_FAILURE()
- << "This failure is expected, and should contain trace point A and B.";
-
- {
- SCOPED_TRACE("C");
- ADD_FAILURE() << "This failure is expected, and should "
- << "contain trace point A, B, and C.";
- }
-
- SCOPED_TRACE("D");
- ADD_FAILURE() << "This failure is expected, and should "
- << "contain trace point A, B, and D.";
-}
-
-#if GTEST_IS_THREADSAFE
-// Tests that SCOPED_TRACE()s can be used concurrently from multiple
-// threads. Namely, an assertion should be affected by
-// SCOPED_TRACE()s in its own thread only.
-
-// Here's the sequence of actions that happen in the test:
-//
-// Thread A (main) | Thread B (spawned)
-// ===============================|================================
-// spawns thread B |
-// -------------------------------+--------------------------------
-// waits for n1 | SCOPED_TRACE("Trace B");
-// | generates failure #1
-// | notifies n1
-// -------------------------------+--------------------------------
-// SCOPED_TRACE("Trace A"); | waits for n2
-// generates failure #2 |
-// notifies n2 |
-// -------------------------------|--------------------------------
-// waits for n3 | generates failure #3
-// | trace B dies
-// | generates failure #4
-// | notifies n3
-// -------------------------------|--------------------------------
-// generates failure #5 | finishes
-// trace A dies |
-// generates failure #6 |
-// -------------------------------|--------------------------------
-// waits for thread B to finish |
-
-struct CheckPoints {
- Notification n1;
- Notification n2;
- Notification n3;
-};
-
-static void ThreadWithScopedTrace(CheckPoints* check_points) {
- {
- SCOPED_TRACE("Trace B");
- ADD_FAILURE()
- << "Expected failure #1 (in thread B, only trace B alive).";
- check_points->n1.Notify();
- check_points->n2.WaitForNotification();
-
- ADD_FAILURE()
- << "Expected failure #3 (in thread B, trace A & B both alive).";
- } // Trace B dies here.
- ADD_FAILURE()
- << "Expected failure #4 (in thread B, only trace A alive).";
- check_points->n3.Notify();
-}
-
-TEST(SCOPED_TRACETest, WorksConcurrently) {
- printf("(expecting 6 failures)\n");
-
- CheckPoints check_points;
- ThreadWithParam<CheckPoints*> thread(&ThreadWithScopedTrace,
- &check_points,
- NULL);
- check_points.n1.WaitForNotification();
-
- {
- SCOPED_TRACE("Trace A");
- ADD_FAILURE()
- << "Expected failure #2 (in thread A, trace A & B both alive).";
- check_points.n2.Notify();
- check_points.n3.WaitForNotification();
-
- ADD_FAILURE()
- << "Expected failure #5 (in thread A, only trace A alive).";
- } // Trace A dies here.
- ADD_FAILURE()
- << "Expected failure #6 (in thread A, no trace alive).";
- thread.Join();
-}
-#endif // GTEST_IS_THREADSAFE
-
-TEST(DisabledTestsWarningTest,
- DISABLED_AlsoRunDisabledTestsFlagSuppressesWarning) {
- // This test body is intentionally empty. Its sole purpose is for
- // verifying that the --gtest_also_run_disabled_tests flag
- // suppresses the "YOU HAVE 12 DISABLED TESTS" warning at the end of
- // the test output.
-}
-
-// Tests using assertions outside of TEST and TEST_F.
-//
-// This function creates two failures intentionally.
-void AdHocTest() {
- printf("The non-test part of the code is expected to have 2 failures.\n\n");
- EXPECT_TRUE(false);
- EXPECT_EQ(2, 3);
-}
-
-// Runs all TESTs, all TEST_Fs, and the ad hoc test.
-int RunAllTests() {
- AdHocTest();
- return RUN_ALL_TESTS();
-}
-
-// Tests non-fatal failures in the fixture constructor.
-class NonFatalFailureInFixtureConstructorTest : public testing::Test {
- protected:
- NonFatalFailureInFixtureConstructorTest() {
- printf("(expecting 5 failures)\n");
- ADD_FAILURE() << "Expected failure #1, in the test fixture c'tor.";
- }
-
- ~NonFatalFailureInFixtureConstructorTest() {
- ADD_FAILURE() << "Expected failure #5, in the test fixture d'tor.";
- }
-
- virtual void SetUp() {
- ADD_FAILURE() << "Expected failure #2, in SetUp().";
- }
-
- virtual void TearDown() {
- ADD_FAILURE() << "Expected failure #4, in TearDown.";
- }
-};
-
-TEST_F(NonFatalFailureInFixtureConstructorTest, FailureInConstructor) {
- ADD_FAILURE() << "Expected failure #3, in the test body.";
-}
-
-// Tests fatal failures in the fixture constructor.
-class FatalFailureInFixtureConstructorTest : public testing::Test {
- protected:
- FatalFailureInFixtureConstructorTest() {
- printf("(expecting 2 failures)\n");
- Init();
- }
-
- ~FatalFailureInFixtureConstructorTest() {
- ADD_FAILURE() << "Expected failure #2, in the test fixture d'tor.";
- }
-
- virtual void SetUp() {
- ADD_FAILURE() << "UNEXPECTED failure in SetUp(). "
- << "We should never get here, as the test fixture c'tor "
- << "had a fatal failure.";
- }
-
- virtual void TearDown() {
- ADD_FAILURE() << "UNEXPECTED failure in TearDown(). "
- << "We should never get here, as the test fixture c'tor "
- << "had a fatal failure.";
- }
-
- private:
- void Init() {
- FAIL() << "Expected failure #1, in the test fixture c'tor.";
- }
-};
-
-TEST_F(FatalFailureInFixtureConstructorTest, FailureInConstructor) {
- ADD_FAILURE() << "UNEXPECTED failure in the test body. "
- << "We should never get here, as the test fixture c'tor "
- << "had a fatal failure.";
-}
-
-// Tests non-fatal failures in SetUp().
-class NonFatalFailureInSetUpTest : public testing::Test {
- protected:
- virtual ~NonFatalFailureInSetUpTest() {
- Deinit();
- }
-
- virtual void SetUp() {
- printf("(expecting 4 failures)\n");
- ADD_FAILURE() << "Expected failure #1, in SetUp().";
- }
-
- virtual void TearDown() {
- FAIL() << "Expected failure #3, in TearDown().";
- }
- private:
- void Deinit() {
- FAIL() << "Expected failure #4, in the test fixture d'tor.";
- }
-};
-
-TEST_F(NonFatalFailureInSetUpTest, FailureInSetUp) {
- FAIL() << "Expected failure #2, in the test function.";
-}
-
-// Tests fatal failures in SetUp().
-class FatalFailureInSetUpTest : public testing::Test {
- protected:
- virtual ~FatalFailureInSetUpTest() {
- Deinit();
- }
-
- virtual void SetUp() {
- printf("(expecting 3 failures)\n");
- FAIL() << "Expected failure #1, in SetUp().";
- }
-
- virtual void TearDown() {
- FAIL() << "Expected failure #2, in TearDown().";
- }
- private:
- void Deinit() {
- FAIL() << "Expected failure #3, in the test fixture d'tor.";
- }
-};
-
-TEST_F(FatalFailureInSetUpTest, FailureInSetUp) {
- FAIL() << "UNEXPECTED failure in the test function. "
- << "We should never get here, as SetUp() failed.";
-}
-
-TEST(AddFailureAtTest, MessageContainsSpecifiedFileAndLineNumber) {
- ADD_FAILURE_AT("foo.cc", 42) << "Expected failure in foo.cc";
-}
-
-#if GTEST_IS_THREADSAFE
-
-// A unary function that may die.
-void DieIf(bool should_die) {
- GTEST_CHECK_(!should_die) << " - death inside DieIf().";
-}
-
-// Tests running death tests in a multi-threaded context.
-
-// Used for coordination between the main and the spawn thread.
-struct SpawnThreadNotifications {
- SpawnThreadNotifications() {}
-
- Notification spawn_thread_started;
- Notification spawn_thread_ok_to_terminate;
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(SpawnThreadNotifications);
-};
-
-// The function to be executed in the thread spawn by the
-// MultipleThreads test (below).
-static void ThreadRoutine(SpawnThreadNotifications* notifications) {
- // Signals the main thread that this thread has started.
- notifications->spawn_thread_started.Notify();
-
- // Waits for permission to finish from the main thread.
- notifications->spawn_thread_ok_to_terminate.WaitForNotification();
-}
-
-// This is a death-test test, but it's not named with a DeathTest
-// suffix. It starts threads which might interfere with later
-// death tests, so it must run after all other death tests.
-class DeathTestAndMultiThreadsTest : public testing::Test {
- protected:
- // Starts a thread and waits for it to begin.
- virtual void SetUp() {
- thread_.reset(new ThreadWithParam<SpawnThreadNotifications*>(
- &ThreadRoutine, &notifications_, NULL));
- notifications_.spawn_thread_started.WaitForNotification();
- }
- // Tells the thread to finish, and reaps it.
- // Depending on the version of the thread library in use,
- // a manager thread might still be left running that will interfere
- // with later death tests. This is unfortunate, but this class
- // cleans up after itself as best it can.
- virtual void TearDown() {
- notifications_.spawn_thread_ok_to_terminate.Notify();
- }
-
- private:
- SpawnThreadNotifications notifications_;
- scoped_ptr<ThreadWithParam<SpawnThreadNotifications*> > thread_;
-};
-
-#endif // GTEST_IS_THREADSAFE
-
-// The MixedUpTestCaseTest test case verifies that Google Test will fail a
-// test if it uses a different fixture class than what other tests in
-// the same test case use. It deliberately contains two fixture
-// classes with the same name but defined in different namespaces.
-
-// The MixedUpTestCaseWithSameTestNameTest test case verifies that
-// when the user defines two tests with the same test case name AND
-// same test name (but in different namespaces), the second test will
-// fail.
-
-namespace foo {
-
-class MixedUpTestCaseTest : public testing::Test {
-};
-
-TEST_F(MixedUpTestCaseTest, FirstTestFromNamespaceFoo) {}
-TEST_F(MixedUpTestCaseTest, SecondTestFromNamespaceFoo) {}
-
-class MixedUpTestCaseWithSameTestNameTest : public testing::Test {
-};
-
-TEST_F(MixedUpTestCaseWithSameTestNameTest,
- TheSecondTestWithThisNameShouldFail) {}
-
-} // namespace foo
-
-namespace bar {
-
-class MixedUpTestCaseTest : public testing::Test {
-};
-
-// The following two tests are expected to fail. We rely on the
-// golden file to check that Google Test generates the right error message.
-TEST_F(MixedUpTestCaseTest, ThisShouldFail) {}
-TEST_F(MixedUpTestCaseTest, ThisShouldFailToo) {}
-
-class MixedUpTestCaseWithSameTestNameTest : public testing::Test {
-};
-
-// Expected to fail. We rely on the golden file to check that Google Test
-// generates the right error message.
-TEST_F(MixedUpTestCaseWithSameTestNameTest,
- TheSecondTestWithThisNameShouldFail) {}
-
-} // namespace bar
-
-// The following two test cases verify that Google Test catches the user
-// error of mixing TEST and TEST_F in the same test case. The first
-// test case checks the scenario where TEST_F appears before TEST, and
-// the second one checks where TEST appears before TEST_F.
-
-class TEST_F_before_TEST_in_same_test_case : public testing::Test {
-};
-
-TEST_F(TEST_F_before_TEST_in_same_test_case, DefinedUsingTEST_F) {}
-
-// Expected to fail. We rely on the golden file to check that Google Test
-// generates the right error message.
-TEST(TEST_F_before_TEST_in_same_test_case, DefinedUsingTESTAndShouldFail) {}
-
-class TEST_before_TEST_F_in_same_test_case : public testing::Test {
-};
-
-TEST(TEST_before_TEST_F_in_same_test_case, DefinedUsingTEST) {}
-
-// Expected to fail. We rely on the golden file to check that Google Test
-// generates the right error message.
-TEST_F(TEST_before_TEST_F_in_same_test_case, DefinedUsingTEST_FAndShouldFail) {
-}
-
-// Used for testing EXPECT_NONFATAL_FAILURE() and EXPECT_FATAL_FAILURE().
-int global_integer = 0;
-
-// Tests that EXPECT_NONFATAL_FAILURE() can reference global variables.
-TEST(ExpectNonfatalFailureTest, CanReferenceGlobalVariables) {
- global_integer = 0;
- EXPECT_NONFATAL_FAILURE({
- EXPECT_EQ(1, global_integer) << "Expected non-fatal failure.";
- }, "Expected non-fatal failure.");
-}
-
-// Tests that EXPECT_NONFATAL_FAILURE() can reference local variables
-// (static or not).
-TEST(ExpectNonfatalFailureTest, CanReferenceLocalVariables) {
- int m = 0;
- static int n;
- n = 1;
- EXPECT_NONFATAL_FAILURE({
- EXPECT_EQ(m, n) << "Expected non-fatal failure.";
- }, "Expected non-fatal failure.");
-}
-
-// Tests that EXPECT_NONFATAL_FAILURE() succeeds when there is exactly
-// one non-fatal failure and no fatal failure.
-TEST(ExpectNonfatalFailureTest, SucceedsWhenThereIsOneNonfatalFailure) {
- EXPECT_NONFATAL_FAILURE({
- ADD_FAILURE() << "Expected non-fatal failure.";
- }, "Expected non-fatal failure.");
-}
-
-// Tests that EXPECT_NONFATAL_FAILURE() fails when there is no
-// non-fatal failure.
-TEST(ExpectNonfatalFailureTest, FailsWhenThereIsNoNonfatalFailure) {
- printf("(expecting a failure)\n");
- EXPECT_NONFATAL_FAILURE({
- }, "");
-}
-
-// Tests that EXPECT_NONFATAL_FAILURE() fails when there are two
-// non-fatal failures.
-TEST(ExpectNonfatalFailureTest, FailsWhenThereAreTwoNonfatalFailures) {
- printf("(expecting a failure)\n");
- EXPECT_NONFATAL_FAILURE({
- ADD_FAILURE() << "Expected non-fatal failure 1.";
- ADD_FAILURE() << "Expected non-fatal failure 2.";
- }, "");
-}
-
-// Tests that EXPECT_NONFATAL_FAILURE() fails when there is one fatal
-// failure.
-TEST(ExpectNonfatalFailureTest, FailsWhenThereIsOneFatalFailure) {
- printf("(expecting a failure)\n");
- EXPECT_NONFATAL_FAILURE({
- FAIL() << "Expected fatal failure.";
- }, "");
-}
-
-// Tests that EXPECT_NONFATAL_FAILURE() fails when the statement being
-// tested returns.
-TEST(ExpectNonfatalFailureTest, FailsWhenStatementReturns) {
- printf("(expecting a failure)\n");
- EXPECT_NONFATAL_FAILURE({
- return;
- }, "");
-}
-
-#if GTEST_HAS_EXCEPTIONS
-
-// Tests that EXPECT_NONFATAL_FAILURE() fails when the statement being
-// tested throws.
-TEST(ExpectNonfatalFailureTest, FailsWhenStatementThrows) {
- printf("(expecting a failure)\n");
- try {
- EXPECT_NONFATAL_FAILURE({
- throw 0;
- }, "");
- } catch(int) { // NOLINT
- }
-}
-
-#endif // GTEST_HAS_EXCEPTIONS
-
-// Tests that EXPECT_FATAL_FAILURE() can reference global variables.
-TEST(ExpectFatalFailureTest, CanReferenceGlobalVariables) {
- global_integer = 0;
- EXPECT_FATAL_FAILURE({
- ASSERT_EQ(1, global_integer) << "Expected fatal failure.";
- }, "Expected fatal failure.");
-}
-
-// Tests that EXPECT_FATAL_FAILURE() can reference local static
-// variables.
-TEST(ExpectFatalFailureTest, CanReferenceLocalStaticVariables) {
- static int n;
- n = 1;
- EXPECT_FATAL_FAILURE({
- ASSERT_EQ(0, n) << "Expected fatal failure.";
- }, "Expected fatal failure.");
-}
-
-// Tests that EXPECT_FATAL_FAILURE() succeeds when there is exactly
-// one fatal failure and no non-fatal failure.
-TEST(ExpectFatalFailureTest, SucceedsWhenThereIsOneFatalFailure) {
- EXPECT_FATAL_FAILURE({
- FAIL() << "Expected fatal failure.";
- }, "Expected fatal failure.");
-}
-
-// Tests that EXPECT_FATAL_FAILURE() fails when there is no fatal
-// failure.
-TEST(ExpectFatalFailureTest, FailsWhenThereIsNoFatalFailure) {
- printf("(expecting a failure)\n");
- EXPECT_FATAL_FAILURE({
- }, "");
-}
-
-// A helper for generating a fatal failure.
-void FatalFailure() {
- FAIL() << "Expected fatal failure.";
-}
-
-// Tests that EXPECT_FATAL_FAILURE() fails when there are two
-// fatal failures.
-TEST(ExpectFatalFailureTest, FailsWhenThereAreTwoFatalFailures) {
- printf("(expecting a failure)\n");
- EXPECT_FATAL_FAILURE({
- FatalFailure();
- FatalFailure();
- }, "");
-}
-
-// Tests that EXPECT_FATAL_FAILURE() fails when there is one non-fatal
-// failure.
-TEST(ExpectFatalFailureTest, FailsWhenThereIsOneNonfatalFailure) {
- printf("(expecting a failure)\n");
- EXPECT_FATAL_FAILURE({
- ADD_FAILURE() << "Expected non-fatal failure.";
- }, "");
-}
-
-// Tests that EXPECT_FATAL_FAILURE() fails when the statement being
-// tested returns.
-TEST(ExpectFatalFailureTest, FailsWhenStatementReturns) {
- printf("(expecting a failure)\n");
- EXPECT_FATAL_FAILURE({
- return;
- }, "");
-}
-
-#if GTEST_HAS_EXCEPTIONS
-
-// Tests that EXPECT_FATAL_FAILURE() fails when the statement being
-// tested throws.
-TEST(ExpectFatalFailureTest, FailsWhenStatementThrows) {
- printf("(expecting a failure)\n");
- try {
- EXPECT_FATAL_FAILURE({
- throw 0;
- }, "");
- } catch(int) { // NOLINT
- }
-}
-
-#endif // GTEST_HAS_EXCEPTIONS
-
-// This #ifdef block tests the output of typed tests.
-#if GTEST_HAS_TYPED_TEST
-
-template <typename T>
-class TypedTest : public testing::Test {
-};
-
-TYPED_TEST_CASE(TypedTest, testing::Types<int>);
-
-TYPED_TEST(TypedTest, Success) {
- EXPECT_EQ(0, TypeParam());
-}
-
-TYPED_TEST(TypedTest, Failure) {
- EXPECT_EQ(1, TypeParam()) << "Expected failure";
-}
-
-#endif // GTEST_HAS_TYPED_TEST
-
-// This #ifdef block tests the output of type-parameterized tests.
-#if GTEST_HAS_TYPED_TEST_P
-
-template <typename T>
-class TypedTestP : public testing::Test {
-};
-
-TYPED_TEST_CASE_P(TypedTestP);
-
-TYPED_TEST_P(TypedTestP, Success) {
- EXPECT_EQ(0U, TypeParam());
-}
-
-TYPED_TEST_P(TypedTestP, Failure) {
- EXPECT_EQ(1U, TypeParam()) << "Expected failure";
-}
-
-REGISTER_TYPED_TEST_CASE_P(TypedTestP, Success, Failure);
-
-typedef testing::Types<unsigned char, unsigned int> UnsignedTypes;
-INSTANTIATE_TYPED_TEST_CASE_P(Unsigned, TypedTestP, UnsignedTypes);
-
-#endif // GTEST_HAS_TYPED_TEST_P
-
-#if GTEST_HAS_DEATH_TEST
-
-// We rely on the golden file to verify that tests whose test case
-// name ends with DeathTest are run first.
-
-TEST(ADeathTest, ShouldRunFirst) {
-}
-
-# if GTEST_HAS_TYPED_TEST
-
-// We rely on the golden file to verify that typed tests whose test
-// case name ends with DeathTest are run first.
-
-template <typename T>
-class ATypedDeathTest : public testing::Test {
-};
-
-typedef testing::Types<int, double> NumericTypes;
-TYPED_TEST_CASE(ATypedDeathTest, NumericTypes);
-
-TYPED_TEST(ATypedDeathTest, ShouldRunFirst) {
-}
-
-# endif // GTEST_HAS_TYPED_TEST
-
-# if GTEST_HAS_TYPED_TEST_P
-
-
-// We rely on the golden file to verify that type-parameterized tests
-// whose test case name ends with DeathTest are run first.
-
-template <typename T>
-class ATypeParamDeathTest : public testing::Test {
-};
-
-TYPED_TEST_CASE_P(ATypeParamDeathTest);
-
-TYPED_TEST_P(ATypeParamDeathTest, ShouldRunFirst) {
-}
-
-REGISTER_TYPED_TEST_CASE_P(ATypeParamDeathTest, ShouldRunFirst);
-
-INSTANTIATE_TYPED_TEST_CASE_P(My, ATypeParamDeathTest, NumericTypes);
-
-# endif // GTEST_HAS_TYPED_TEST_P
-
-#endif // GTEST_HAS_DEATH_TEST
-
-// Tests various failure conditions of
-// EXPECT_{,NON}FATAL_FAILURE{,_ON_ALL_THREADS}.
-class ExpectFailureTest : public testing::Test {
- public: // Must be public and not protected due to a bug in g++ 3.4.2.
- enum FailureMode {
- FATAL_FAILURE,
- NONFATAL_FAILURE
- };
- static void AddFailure(FailureMode failure) {
- if (failure == FATAL_FAILURE) {
- FAIL() << "Expected fatal failure.";
- } else {
- ADD_FAILURE() << "Expected non-fatal failure.";
- }
- }
-};
-
-TEST_F(ExpectFailureTest, ExpectFatalFailure) {
- // Expected fatal failure, but succeeds.
- printf("(expecting 1 failure)\n");
- EXPECT_FATAL_FAILURE(SUCCEED(), "Expected fatal failure.");
- // Expected fatal failure, but got a non-fatal failure.
- printf("(expecting 1 failure)\n");
- EXPECT_FATAL_FAILURE(AddFailure(NONFATAL_FAILURE), "Expected non-fatal "
- "failure.");
- // Wrong message.
- printf("(expecting 1 failure)\n");
- EXPECT_FATAL_FAILURE(AddFailure(FATAL_FAILURE), "Some other fatal failure "
- "expected.");
-}
-
-TEST_F(ExpectFailureTest, ExpectNonFatalFailure) {
- // Expected non-fatal failure, but succeeds.
- printf("(expecting 1 failure)\n");
- EXPECT_NONFATAL_FAILURE(SUCCEED(), "Expected non-fatal failure.");
- // Expected non-fatal failure, but got a fatal failure.
- printf("(expecting 1 failure)\n");
- EXPECT_NONFATAL_FAILURE(AddFailure(FATAL_FAILURE), "Expected fatal failure.");
- // Wrong message.
- printf("(expecting 1 failure)\n");
- EXPECT_NONFATAL_FAILURE(AddFailure(NONFATAL_FAILURE), "Some other non-fatal "
- "failure.");
-}
-
-#if GTEST_IS_THREADSAFE
-
-class ExpectFailureWithThreadsTest : public ExpectFailureTest {
- protected:
- static void AddFailureInOtherThread(FailureMode failure) {
- ThreadWithParam<FailureMode> thread(&AddFailure, failure, NULL);
- thread.Join();
- }
-};
-
-TEST_F(ExpectFailureWithThreadsTest, ExpectFatalFailure) {
- // We only intercept the current thread.
- printf("(expecting 2 failures)\n");
- EXPECT_FATAL_FAILURE(AddFailureInOtherThread(FATAL_FAILURE),
- "Expected fatal failure.");
-}
-
-TEST_F(ExpectFailureWithThreadsTest, ExpectNonFatalFailure) {
- // We only intercept the current thread.
- printf("(expecting 2 failures)\n");
- EXPECT_NONFATAL_FAILURE(AddFailureInOtherThread(NONFATAL_FAILURE),
- "Expected non-fatal failure.");
-}
-
-typedef ExpectFailureWithThreadsTest ScopedFakeTestPartResultReporterTest;
-
-// Tests that the ScopedFakeTestPartResultReporter only catches failures from
-// the current thread if it is instantiated with INTERCEPT_ONLY_CURRENT_THREAD.
-TEST_F(ScopedFakeTestPartResultReporterTest, InterceptOnlyCurrentThread) {
- printf("(expecting 2 failures)\n");
- TestPartResultArray results;
- {
- ScopedFakeTestPartResultReporter reporter(
- ScopedFakeTestPartResultReporter::INTERCEPT_ONLY_CURRENT_THREAD,
- &results);
- AddFailureInOtherThread(FATAL_FAILURE);
- AddFailureInOtherThread(NONFATAL_FAILURE);
- }
- // The two failures should not have been intercepted.
- EXPECT_EQ(0, results.size()) << "This shouldn't fail.";
-}
-
-#endif // GTEST_IS_THREADSAFE
-
-TEST_F(ExpectFailureTest, ExpectFatalFailureOnAllThreads) {
- // Expected fatal failure, but succeeds.
- printf("(expecting 1 failure)\n");
- EXPECT_FATAL_FAILURE_ON_ALL_THREADS(SUCCEED(), "Expected fatal failure.");
- // Expected fatal failure, but got a non-fatal failure.
- printf("(expecting 1 failure)\n");
- EXPECT_FATAL_FAILURE_ON_ALL_THREADS(AddFailure(NONFATAL_FAILURE),
- "Expected non-fatal failure.");
- // Wrong message.
- printf("(expecting 1 failure)\n");
- EXPECT_FATAL_FAILURE_ON_ALL_THREADS(AddFailure(FATAL_FAILURE),
- "Some other fatal failure expected.");
-}
-
-TEST_F(ExpectFailureTest, ExpectNonFatalFailureOnAllThreads) {
- // Expected non-fatal failure, but succeeds.
- printf("(expecting 1 failure)\n");
- EXPECT_NONFATAL_FAILURE_ON_ALL_THREADS(SUCCEED(), "Expected non-fatal "
- "failure.");
- // Expected non-fatal failure, but got a fatal failure.
- printf("(expecting 1 failure)\n");
- EXPECT_NONFATAL_FAILURE_ON_ALL_THREADS(AddFailure(FATAL_FAILURE),
- "Expected fatal failure.");
- // Wrong message.
- printf("(expecting 1 failure)\n");
- EXPECT_NONFATAL_FAILURE_ON_ALL_THREADS(AddFailure(NONFATAL_FAILURE),
- "Some other non-fatal failure.");
-}
-
-
-// Two test environments for testing testing::AddGlobalTestEnvironment().
-
-class FooEnvironment : public testing::Environment {
- public:
- virtual void SetUp() {
- printf("%s", "FooEnvironment::SetUp() called.\n");
- }
-
- virtual void TearDown() {
- printf("%s", "FooEnvironment::TearDown() called.\n");
- FAIL() << "Expected fatal failure.";
- }
-};
-
-class BarEnvironment : public testing::Environment {
- public:
- virtual void SetUp() {
- printf("%s", "BarEnvironment::SetUp() called.\n");
- }
-
- virtual void TearDown() {
- printf("%s", "BarEnvironment::TearDown() called.\n");
- ADD_FAILURE() << "Expected non-fatal failure.";
- }
-};
-
-bool GTEST_FLAG(internal_skip_environment_and_ad_hoc_tests) = false;
-
-// The main function.
-//
-// The idea is to use Google Test to run all the tests we have defined (some
-// of them are intended to fail), and then compare the test results
-// with the "golden" file.
-int main(int argc, char **argv) {
- testing::GTEST_FLAG(print_time) = false;
-
- // We just run the tests, knowing some of them are intended to fail.
- // We will use a separate Python script to compare the output of
- // this program with the golden file.
-
- // It's hard to test InitGoogleTest() directly, as it has many
- // global side effects. The following line serves as a sanity test
- // for it.
- testing::InitGoogleTest(&argc, argv);
- if (argc >= 2 &&
- String(argv[1]) == "--gtest_internal_skip_environment_and_ad_hoc_tests")
- GTEST_FLAG(internal_skip_environment_and_ad_hoc_tests) = true;
-
-#if GTEST_HAS_DEATH_TEST
- if (testing::internal::GTEST_FLAG(internal_run_death_test) != "") {
- // Skip the usual output capturing if we're running as the child
- // process of an threadsafe-style death test.
-# if GTEST_OS_WINDOWS
- posix::FReopen("nul:", "w", stdout);
-# else
- posix::FReopen("/dev/null", "w", stdout);
-# endif // GTEST_OS_WINDOWS
- return RUN_ALL_TESTS();
- }
-#endif // GTEST_HAS_DEATH_TEST
-
- if (GTEST_FLAG(internal_skip_environment_and_ad_hoc_tests))
- return RUN_ALL_TESTS();
-
- // Registers two global test environments.
- // The golden file verifies that they are set up in the order they
- // are registered, and torn down in the reverse order.
- testing::AddGlobalTestEnvironment(new FooEnvironment);
- testing::AddGlobalTestEnvironment(new BarEnvironment);
-
- return RunAllTests();
-}
diff --git a/src/testing/gtest/test/gtest_output_test_golden_lin.txt b/src/testing/gtest/test/gtest_output_test_golden_lin.txt
deleted file mode 100644
index a1d342d9..00000000
--- a/src/testing/gtest/test/gtest_output_test_golden_lin.txt
+++ /dev/null
@@ -1,711 +0,0 @@
-The non-test part of the code is expected to have 2 failures.
-
-gtest_output_test_.cc:#: Failure
-Value of: false
- Actual: false
-Expected: true
-gtest_output_test_.cc:#: Failure
-Value of: 3
-Expected: 2
-[==========] Running 62 tests from 27 test cases.
-[----------] Global test environment set-up.
-FooEnvironment::SetUp() called.
-BarEnvironment::SetUp() called.
-[----------] 1 test from ADeathTest
-[ RUN ] ADeathTest.ShouldRunFirst
-[ OK ] ADeathTest.ShouldRunFirst
-[----------] 1 test from ATypedDeathTest/0, where TypeParam = int
-[ RUN ] ATypedDeathTest/0.ShouldRunFirst
-[ OK ] ATypedDeathTest/0.ShouldRunFirst
-[----------] 1 test from ATypedDeathTest/1, where TypeParam = double
-[ RUN ] ATypedDeathTest/1.ShouldRunFirst
-[ OK ] ATypedDeathTest/1.ShouldRunFirst
-[----------] 1 test from My/ATypeParamDeathTest/0, where TypeParam = int
-[ RUN ] My/ATypeParamDeathTest/0.ShouldRunFirst
-[ OK ] My/ATypeParamDeathTest/0.ShouldRunFirst
-[----------] 1 test from My/ATypeParamDeathTest/1, where TypeParam = double
-[ RUN ] My/ATypeParamDeathTest/1.ShouldRunFirst
-[ OK ] My/ATypeParamDeathTest/1.ShouldRunFirst
-[----------] 2 tests from PassingTest
-[ RUN ] PassingTest.PassingTest1
-[ OK ] PassingTest.PassingTest1
-[ RUN ] PassingTest.PassingTest2
-[ OK ] PassingTest.PassingTest2
-[----------] 3 tests from FatalFailureTest
-[ RUN ] FatalFailureTest.FatalFailureInSubroutine
-(expecting a failure that x should be 1)
-gtest_output_test_.cc:#: Failure
-Value of: x
- Actual: 2
-Expected: 1
-[ FAILED ] FatalFailureTest.FatalFailureInSubroutine
-[ RUN ] FatalFailureTest.FatalFailureInNestedSubroutine
-(expecting a failure that x should be 1)
-gtest_output_test_.cc:#: Failure
-Value of: x
- Actual: 2
-Expected: 1
-[ FAILED ] FatalFailureTest.FatalFailureInNestedSubroutine
-[ RUN ] FatalFailureTest.NonfatalFailureInSubroutine
-(expecting a failure on false)
-gtest_output_test_.cc:#: Failure
-Value of: false
- Actual: false
-Expected: true
-[ FAILED ] FatalFailureTest.NonfatalFailureInSubroutine
-[----------] 1 test from LoggingTest
-[ RUN ] LoggingTest.InterleavingLoggingAndAssertions
-(expecting 2 failures on (3) >= (a[i]))
-i == 0
-i == 1
-gtest_output_test_.cc:#: Failure
-Expected: (3) >= (a[i]), actual: 3 vs 9
-i == 2
-i == 3
-gtest_output_test_.cc:#: Failure
-Expected: (3) >= (a[i]), actual: 3 vs 6
-[ FAILED ] LoggingTest.InterleavingLoggingAndAssertions
-[----------] 6 tests from SCOPED_TRACETest
-[ RUN ] SCOPED_TRACETest.ObeysScopes
-(expected to fail)
-gtest_output_test_.cc:#: Failure
-Failed
-This failure is expected, and shouldn't have a trace.
-gtest_output_test_.cc:#: Failure
-Failed
-This failure is expected, and should have a trace.
-Google Test trace:
-gtest_output_test_.cc:#: Expected trace
-gtest_output_test_.cc:#: Failure
-Failed
-This failure is expected, and shouldn't have a trace.
-[ FAILED ] SCOPED_TRACETest.ObeysScopes
-[ RUN ] SCOPED_TRACETest.WorksInLoop
-(expected to fail)
-gtest_output_test_.cc:#: Failure
-Value of: n
- Actual: 1
-Expected: 2
-Google Test trace:
-gtest_output_test_.cc:#: i = 1
-gtest_output_test_.cc:#: Failure
-Value of: n
- Actual: 2
-Expected: 1
-Google Test trace:
-gtest_output_test_.cc:#: i = 2
-[ FAILED ] SCOPED_TRACETest.WorksInLoop
-[ RUN ] SCOPED_TRACETest.WorksInSubroutine
-(expected to fail)
-gtest_output_test_.cc:#: Failure
-Value of: n
- Actual: 1
-Expected: 2
-Google Test trace:
-gtest_output_test_.cc:#: n = 1
-gtest_output_test_.cc:#: Failure
-Value of: n
- Actual: 2
-Expected: 1
-Google Test trace:
-gtest_output_test_.cc:#: n = 2
-[ FAILED ] SCOPED_TRACETest.WorksInSubroutine
-[ RUN ] SCOPED_TRACETest.CanBeNested
-(expected to fail)
-gtest_output_test_.cc:#: Failure
-Value of: n
- Actual: 2
-Expected: 1
-Google Test trace:
-gtest_output_test_.cc:#: n = 2
-gtest_output_test_.cc:#:
-[ FAILED ] SCOPED_TRACETest.CanBeNested
-[ RUN ] SCOPED_TRACETest.CanBeRepeated
-(expected to fail)
-gtest_output_test_.cc:#: Failure
-Failed
-This failure is expected, and should contain trace point A.
-Google Test trace:
-gtest_output_test_.cc:#: A
-gtest_output_test_.cc:#: Failure
-Failed
-This failure is expected, and should contain trace point A and B.
-Google Test trace:
-gtest_output_test_.cc:#: B
-gtest_output_test_.cc:#: A
-gtest_output_test_.cc:#: Failure
-Failed
-This failure is expected, and should contain trace point A, B, and C.
-Google Test trace:
-gtest_output_test_.cc:#: C
-gtest_output_test_.cc:#: B
-gtest_output_test_.cc:#: A
-gtest_output_test_.cc:#: Failure
-Failed
-This failure is expected, and should contain trace point A, B, and D.
-Google Test trace:
-gtest_output_test_.cc:#: D
-gtest_output_test_.cc:#: B
-gtest_output_test_.cc:#: A
-[ FAILED ] SCOPED_TRACETest.CanBeRepeated
-[ RUN ] SCOPED_TRACETest.WorksConcurrently
-(expecting 6 failures)
-gtest_output_test_.cc:#: Failure
-Failed
-Expected failure #1 (in thread B, only trace B alive).
-Google Test trace:
-gtest_output_test_.cc:#: Trace B
-gtest_output_test_.cc:#: Failure
-Failed
-Expected failure #2 (in thread A, trace A & B both alive).
-Google Test trace:
-gtest_output_test_.cc:#: Trace A
-gtest_output_test_.cc:#: Failure
-Failed
-Expected failure #3 (in thread B, trace A & B both alive).
-Google Test trace:
-gtest_output_test_.cc:#: Trace B
-gtest_output_test_.cc:#: Failure
-Failed
-Expected failure #4 (in thread B, only trace A alive).
-gtest_output_test_.cc:#: Failure
-Failed
-Expected failure #5 (in thread A, only trace A alive).
-Google Test trace:
-gtest_output_test_.cc:#: Trace A
-gtest_output_test_.cc:#: Failure
-Failed
-Expected failure #6 (in thread A, no trace alive).
-[ FAILED ] SCOPED_TRACETest.WorksConcurrently
-[----------] 1 test from NonFatalFailureInFixtureConstructorTest
-[ RUN ] NonFatalFailureInFixtureConstructorTest.FailureInConstructor
-(expecting 5 failures)
-gtest_output_test_.cc:#: Failure
-Failed
-Expected failure #1, in the test fixture c'tor.
-gtest_output_test_.cc:#: Failure
-Failed
-Expected failure #2, in SetUp().
-gtest_output_test_.cc:#: Failure
-Failed
-Expected failure #3, in the test body.
-gtest_output_test_.cc:#: Failure
-Failed
-Expected failure #4, in TearDown.
-gtest_output_test_.cc:#: Failure
-Failed
-Expected failure #5, in the test fixture d'tor.
-[ FAILED ] NonFatalFailureInFixtureConstructorTest.FailureInConstructor
-[----------] 1 test from FatalFailureInFixtureConstructorTest
-[ RUN ] FatalFailureInFixtureConstructorTest.FailureInConstructor
-(expecting 2 failures)
-gtest_output_test_.cc:#: Failure
-Failed
-Expected failure #1, in the test fixture c'tor.
-gtest_output_test_.cc:#: Failure
-Failed
-Expected failure #2, in the test fixture d'tor.
-[ FAILED ] FatalFailureInFixtureConstructorTest.FailureInConstructor
-[----------] 1 test from NonFatalFailureInSetUpTest
-[ RUN ] NonFatalFailureInSetUpTest.FailureInSetUp
-(expecting 4 failures)
-gtest_output_test_.cc:#: Failure
-Failed
-Expected failure #1, in SetUp().
-gtest_output_test_.cc:#: Failure
-Failed
-Expected failure #2, in the test function.
-gtest_output_test_.cc:#: Failure
-Failed
-Expected failure #3, in TearDown().
-gtest_output_test_.cc:#: Failure
-Failed
-Expected failure #4, in the test fixture d'tor.
-[ FAILED ] NonFatalFailureInSetUpTest.FailureInSetUp
-[----------] 1 test from FatalFailureInSetUpTest
-[ RUN ] FatalFailureInSetUpTest.FailureInSetUp
-(expecting 3 failures)
-gtest_output_test_.cc:#: Failure
-Failed
-Expected failure #1, in SetUp().
-gtest_output_test_.cc:#: Failure
-Failed
-Expected failure #2, in TearDown().
-gtest_output_test_.cc:#: Failure
-Failed
-Expected failure #3, in the test fixture d'tor.
-[ FAILED ] FatalFailureInSetUpTest.FailureInSetUp
-[----------] 1 test from AddFailureAtTest
-[ RUN ] AddFailureAtTest.MessageContainsSpecifiedFileAndLineNumber
-foo.cc:42: Failure
-Failed
-Expected failure in foo.cc
-[ FAILED ] AddFailureAtTest.MessageContainsSpecifiedFileAndLineNumber
-[----------] 4 tests from MixedUpTestCaseTest
-[ RUN ] MixedUpTestCaseTest.FirstTestFromNamespaceFoo
-[ OK ] MixedUpTestCaseTest.FirstTestFromNamespaceFoo
-[ RUN ] MixedUpTestCaseTest.SecondTestFromNamespaceFoo
-[ OK ] MixedUpTestCaseTest.SecondTestFromNamespaceFoo
-[ RUN ] MixedUpTestCaseTest.ThisShouldFail
-gtest.cc:#: Failure
-Failed
-All tests in the same test case must use the same test fixture
-class. However, in test case MixedUpTestCaseTest,
-you defined test FirstTestFromNamespaceFoo and test ThisShouldFail
-using two different test fixture classes. This can happen if
-the two classes are from different namespaces or translation
-units and have the same name. You should probably rename one
-of the classes to put the tests into different test cases.
-[ FAILED ] MixedUpTestCaseTest.ThisShouldFail
-[ RUN ] MixedUpTestCaseTest.ThisShouldFailToo
-gtest.cc:#: Failure
-Failed
-All tests in the same test case must use the same test fixture
-class. However, in test case MixedUpTestCaseTest,
-you defined test FirstTestFromNamespaceFoo and test ThisShouldFailToo
-using two different test fixture classes. This can happen if
-the two classes are from different namespaces or translation
-units and have the same name. You should probably rename one
-of the classes to put the tests into different test cases.
-[ FAILED ] MixedUpTestCaseTest.ThisShouldFailToo
-[----------] 2 tests from MixedUpTestCaseWithSameTestNameTest
-[ RUN ] MixedUpTestCaseWithSameTestNameTest.TheSecondTestWithThisNameShouldFail
-[ OK ] MixedUpTestCaseWithSameTestNameTest.TheSecondTestWithThisNameShouldFail
-[ RUN ] MixedUpTestCaseWithSameTestNameTest.TheSecondTestWithThisNameShouldFail
-gtest.cc:#: Failure
-Failed
-All tests in the same test case must use the same test fixture
-class. However, in test case MixedUpTestCaseWithSameTestNameTest,
-you defined test TheSecondTestWithThisNameShouldFail and test TheSecondTestWithThisNameShouldFail
-using two different test fixture classes. This can happen if
-the two classes are from different namespaces or translation
-units and have the same name. You should probably rename one
-of the classes to put the tests into different test cases.
-[ FAILED ] MixedUpTestCaseWithSameTestNameTest.TheSecondTestWithThisNameShouldFail
-[----------] 2 tests from TEST_F_before_TEST_in_same_test_case
-[ RUN ] TEST_F_before_TEST_in_same_test_case.DefinedUsingTEST_F
-[ OK ] TEST_F_before_TEST_in_same_test_case.DefinedUsingTEST_F
-[ RUN ] TEST_F_before_TEST_in_same_test_case.DefinedUsingTESTAndShouldFail
-gtest.cc:#: Failure
-Failed
-All tests in the same test case must use the same test fixture
-class, so mixing TEST_F and TEST in the same test case is
-illegal. In test case TEST_F_before_TEST_in_same_test_case,
-test DefinedUsingTEST_F is defined using TEST_F but
-test DefinedUsingTESTAndShouldFail is defined using TEST. You probably
-want to change the TEST to TEST_F or move it to another test
-case.
-[ FAILED ] TEST_F_before_TEST_in_same_test_case.DefinedUsingTESTAndShouldFail
-[----------] 2 tests from TEST_before_TEST_F_in_same_test_case
-[ RUN ] TEST_before_TEST_F_in_same_test_case.DefinedUsingTEST
-[ OK ] TEST_before_TEST_F_in_same_test_case.DefinedUsingTEST
-[ RUN ] TEST_before_TEST_F_in_same_test_case.DefinedUsingTEST_FAndShouldFail
-gtest.cc:#: Failure
-Failed
-All tests in the same test case must use the same test fixture
-class, so mixing TEST_F and TEST in the same test case is
-illegal. In test case TEST_before_TEST_F_in_same_test_case,
-test DefinedUsingTEST_FAndShouldFail is defined using TEST_F but
-test DefinedUsingTEST is defined using TEST. You probably
-want to change the TEST to TEST_F or move it to another test
-case.
-[ FAILED ] TEST_before_TEST_F_in_same_test_case.DefinedUsingTEST_FAndShouldFail
-[----------] 8 tests from ExpectNonfatalFailureTest
-[ RUN ] ExpectNonfatalFailureTest.CanReferenceGlobalVariables
-[ OK ] ExpectNonfatalFailureTest.CanReferenceGlobalVariables
-[ RUN ] ExpectNonfatalFailureTest.CanReferenceLocalVariables
-[ OK ] ExpectNonfatalFailureTest.CanReferenceLocalVariables
-[ RUN ] ExpectNonfatalFailureTest.SucceedsWhenThereIsOneNonfatalFailure
-[ OK ] ExpectNonfatalFailureTest.SucceedsWhenThereIsOneNonfatalFailure
-[ RUN ] ExpectNonfatalFailureTest.FailsWhenThereIsNoNonfatalFailure
-(expecting a failure)
-gtest.cc:#: Failure
-Expected: 1 non-fatal failure
- Actual: 0 failures
-[ FAILED ] ExpectNonfatalFailureTest.FailsWhenThereIsNoNonfatalFailure
-[ RUN ] ExpectNonfatalFailureTest.FailsWhenThereAreTwoNonfatalFailures
-(expecting a failure)
-gtest.cc:#: Failure
-Expected: 1 non-fatal failure
- Actual: 2 failures
-gtest_output_test_.cc:#: Non-fatal failure:
-Failed
-Expected non-fatal failure 1.
-
-gtest_output_test_.cc:#: Non-fatal failure:
-Failed
-Expected non-fatal failure 2.
-
-[ FAILED ] ExpectNonfatalFailureTest.FailsWhenThereAreTwoNonfatalFailures
-[ RUN ] ExpectNonfatalFailureTest.FailsWhenThereIsOneFatalFailure
-(expecting a failure)
-gtest.cc:#: Failure
-Expected: 1 non-fatal failure
- Actual:
-gtest_output_test_.cc:#: Fatal failure:
-Failed
-Expected fatal failure.
-
-[ FAILED ] ExpectNonfatalFailureTest.FailsWhenThereIsOneFatalFailure
-[ RUN ] ExpectNonfatalFailureTest.FailsWhenStatementReturns
-(expecting a failure)
-gtest.cc:#: Failure
-Expected: 1 non-fatal failure
- Actual: 0 failures
-[ FAILED ] ExpectNonfatalFailureTest.FailsWhenStatementReturns
-[ RUN ] ExpectNonfatalFailureTest.FailsWhenStatementThrows
-(expecting a failure)
-gtest.cc:#: Failure
-Expected: 1 non-fatal failure
- Actual: 0 failures
-[ FAILED ] ExpectNonfatalFailureTest.FailsWhenStatementThrows
-[----------] 8 tests from ExpectFatalFailureTest
-[ RUN ] ExpectFatalFailureTest.CanReferenceGlobalVariables
-[ OK ] ExpectFatalFailureTest.CanReferenceGlobalVariables
-[ RUN ] ExpectFatalFailureTest.CanReferenceLocalStaticVariables
-[ OK ] ExpectFatalFailureTest.CanReferenceLocalStaticVariables
-[ RUN ] ExpectFatalFailureTest.SucceedsWhenThereIsOneFatalFailure
-[ OK ] ExpectFatalFailureTest.SucceedsWhenThereIsOneFatalFailure
-[ RUN ] ExpectFatalFailureTest.FailsWhenThereIsNoFatalFailure
-(expecting a failure)
-gtest.cc:#: Failure
-Expected: 1 fatal failure
- Actual: 0 failures
-[ FAILED ] ExpectFatalFailureTest.FailsWhenThereIsNoFatalFailure
-[ RUN ] ExpectFatalFailureTest.FailsWhenThereAreTwoFatalFailures
-(expecting a failure)
-gtest.cc:#: Failure
-Expected: 1 fatal failure
- Actual: 2 failures
-gtest_output_test_.cc:#: Fatal failure:
-Failed
-Expected fatal failure.
-
-gtest_output_test_.cc:#: Fatal failure:
-Failed
-Expected fatal failure.
-
-[ FAILED ] ExpectFatalFailureTest.FailsWhenThereAreTwoFatalFailures
-[ RUN ] ExpectFatalFailureTest.FailsWhenThereIsOneNonfatalFailure
-(expecting a failure)
-gtest.cc:#: Failure
-Expected: 1 fatal failure
- Actual:
-gtest_output_test_.cc:#: Non-fatal failure:
-Failed
-Expected non-fatal failure.
-
-[ FAILED ] ExpectFatalFailureTest.FailsWhenThereIsOneNonfatalFailure
-[ RUN ] ExpectFatalFailureTest.FailsWhenStatementReturns
-(expecting a failure)
-gtest.cc:#: Failure
-Expected: 1 fatal failure
- Actual: 0 failures
-[ FAILED ] ExpectFatalFailureTest.FailsWhenStatementReturns
-[ RUN ] ExpectFatalFailureTest.FailsWhenStatementThrows
-(expecting a failure)
-gtest.cc:#: Failure
-Expected: 1 fatal failure
- Actual: 0 failures
-[ FAILED ] ExpectFatalFailureTest.FailsWhenStatementThrows
-[----------] 2 tests from TypedTest/0, where TypeParam = int
-[ RUN ] TypedTest/0.Success
-[ OK ] TypedTest/0.Success
-[ RUN ] TypedTest/0.Failure
-gtest_output_test_.cc:#: Failure
-Value of: TypeParam()
- Actual: 0
-Expected: 1
-Expected failure
-[ FAILED ] TypedTest/0.Failure, where TypeParam = int
-[----------] 2 tests from Unsigned/TypedTestP/0, where TypeParam = unsigned char
-[ RUN ] Unsigned/TypedTestP/0.Success
-[ OK ] Unsigned/TypedTestP/0.Success
-[ RUN ] Unsigned/TypedTestP/0.Failure
-gtest_output_test_.cc:#: Failure
-Value of: TypeParam()
- Actual: '\0'
-Expected: 1U
-Which is: 1
-Expected failure
-[ FAILED ] Unsigned/TypedTestP/0.Failure, where TypeParam = unsigned char
-[----------] 2 tests from Unsigned/TypedTestP/1, where TypeParam = unsigned int
-[ RUN ] Unsigned/TypedTestP/1.Success
-[ OK ] Unsigned/TypedTestP/1.Success
-[ RUN ] Unsigned/TypedTestP/1.Failure
-gtest_output_test_.cc:#: Failure
-Value of: TypeParam()
- Actual: 0
-Expected: 1U
-Which is: 1
-Expected failure
-[ FAILED ] Unsigned/TypedTestP/1.Failure, where TypeParam = unsigned int
-[----------] 4 tests from ExpectFailureTest
-[ RUN ] ExpectFailureTest.ExpectFatalFailure
-(expecting 1 failure)
-gtest.cc:#: Failure
-Expected: 1 fatal failure
- Actual:
-gtest_output_test_.cc:#: Success:
-Succeeded
-
-(expecting 1 failure)
-gtest.cc:#: Failure
-Expected: 1 fatal failure
- Actual:
-gtest_output_test_.cc:#: Non-fatal failure:
-Failed
-Expected non-fatal failure.
-
-(expecting 1 failure)
-gtest.cc:#: Failure
-Expected: 1 fatal failure containing "Some other fatal failure expected."
- Actual:
-gtest_output_test_.cc:#: Fatal failure:
-Failed
-Expected fatal failure.
-
-[ FAILED ] ExpectFailureTest.ExpectFatalFailure
-[ RUN ] ExpectFailureTest.ExpectNonFatalFailure
-(expecting 1 failure)
-gtest.cc:#: Failure
-Expected: 1 non-fatal failure
- Actual:
-gtest_output_test_.cc:#: Success:
-Succeeded
-
-(expecting 1 failure)
-gtest.cc:#: Failure
-Expected: 1 non-fatal failure
- Actual:
-gtest_output_test_.cc:#: Fatal failure:
-Failed
-Expected fatal failure.
-
-(expecting 1 failure)
-gtest.cc:#: Failure
-Expected: 1 non-fatal failure containing "Some other non-fatal failure."
- Actual:
-gtest_output_test_.cc:#: Non-fatal failure:
-Failed
-Expected non-fatal failure.
-
-[ FAILED ] ExpectFailureTest.ExpectNonFatalFailure
-[ RUN ] ExpectFailureTest.ExpectFatalFailureOnAllThreads
-(expecting 1 failure)
-gtest.cc:#: Failure
-Expected: 1 fatal failure
- Actual:
-gtest_output_test_.cc:#: Success:
-Succeeded
-
-(expecting 1 failure)
-gtest.cc:#: Failure
-Expected: 1 fatal failure
- Actual:
-gtest_output_test_.cc:#: Non-fatal failure:
-Failed
-Expected non-fatal failure.
-
-(expecting 1 failure)
-gtest.cc:#: Failure
-Expected: 1 fatal failure containing "Some other fatal failure expected."
- Actual:
-gtest_output_test_.cc:#: Fatal failure:
-Failed
-Expected fatal failure.
-
-[ FAILED ] ExpectFailureTest.ExpectFatalFailureOnAllThreads
-[ RUN ] ExpectFailureTest.ExpectNonFatalFailureOnAllThreads
-(expecting 1 failure)
-gtest.cc:#: Failure
-Expected: 1 non-fatal failure
- Actual:
-gtest_output_test_.cc:#: Success:
-Succeeded
-
-(expecting 1 failure)
-gtest.cc:#: Failure
-Expected: 1 non-fatal failure
- Actual:
-gtest_output_test_.cc:#: Fatal failure:
-Failed
-Expected fatal failure.
-
-(expecting 1 failure)
-gtest.cc:#: Failure
-Expected: 1 non-fatal failure containing "Some other non-fatal failure."
- Actual:
-gtest_output_test_.cc:#: Non-fatal failure:
-Failed
-Expected non-fatal failure.
-
-[ FAILED ] ExpectFailureTest.ExpectNonFatalFailureOnAllThreads
-[----------] 2 tests from ExpectFailureWithThreadsTest
-[ RUN ] ExpectFailureWithThreadsTest.ExpectFatalFailure
-(expecting 2 failures)
-gtest_output_test_.cc:#: Failure
-Failed
-Expected fatal failure.
-gtest.cc:#: Failure
-Expected: 1 fatal failure
- Actual: 0 failures
-[ FAILED ] ExpectFailureWithThreadsTest.ExpectFatalFailure
-[ RUN ] ExpectFailureWithThreadsTest.ExpectNonFatalFailure
-(expecting 2 failures)
-gtest_output_test_.cc:#: Failure
-Failed
-Expected non-fatal failure.
-gtest.cc:#: Failure
-Expected: 1 non-fatal failure
- Actual: 0 failures
-[ FAILED ] ExpectFailureWithThreadsTest.ExpectNonFatalFailure
-[----------] 1 test from ScopedFakeTestPartResultReporterTest
-[ RUN ] ScopedFakeTestPartResultReporterTest.InterceptOnlyCurrentThread
-(expecting 2 failures)
-gtest_output_test_.cc:#: Failure
-Failed
-Expected fatal failure.
-gtest_output_test_.cc:#: Failure
-Failed
-Expected non-fatal failure.
-[ FAILED ] ScopedFakeTestPartResultReporterTest.InterceptOnlyCurrentThread
-[----------] 1 test from PrintingFailingParams/FailingParamTest
-[ RUN ] PrintingFailingParams/FailingParamTest.Fails/0
-gtest_output_test_.cc:#: Failure
-Value of: GetParam()
- Actual: 2
-Expected: 1
-[ FAILED ] PrintingFailingParams/FailingParamTest.Fails/0, where GetParam() = 2
-[----------] Global test environment tear-down
-BarEnvironment::TearDown() called.
-gtest_output_test_.cc:#: Failure
-Failed
-Expected non-fatal failure.
-FooEnvironment::TearDown() called.
-gtest_output_test_.cc:#: Failure
-Failed
-Expected fatal failure.
-[==========] 62 tests from 27 test cases ran.
-[ PASSED ] 21 tests.
-[ FAILED ] 41 tests, listed below:
-[ FAILED ] FatalFailureTest.FatalFailureInSubroutine
-[ FAILED ] FatalFailureTest.FatalFailureInNestedSubroutine
-[ FAILED ] FatalFailureTest.NonfatalFailureInSubroutine
-[ FAILED ] LoggingTest.InterleavingLoggingAndAssertions
-[ FAILED ] SCOPED_TRACETest.ObeysScopes
-[ FAILED ] SCOPED_TRACETest.WorksInLoop
-[ FAILED ] SCOPED_TRACETest.WorksInSubroutine
-[ FAILED ] SCOPED_TRACETest.CanBeNested
-[ FAILED ] SCOPED_TRACETest.CanBeRepeated
-[ FAILED ] SCOPED_TRACETest.WorksConcurrently
-[ FAILED ] NonFatalFailureInFixtureConstructorTest.FailureInConstructor
-[ FAILED ] FatalFailureInFixtureConstructorTest.FailureInConstructor
-[ FAILED ] NonFatalFailureInSetUpTest.FailureInSetUp
-[ FAILED ] FatalFailureInSetUpTest.FailureInSetUp
-[ FAILED ] AddFailureAtTest.MessageContainsSpecifiedFileAndLineNumber
-[ FAILED ] MixedUpTestCaseTest.ThisShouldFail
-[ FAILED ] MixedUpTestCaseTest.ThisShouldFailToo
-[ FAILED ] MixedUpTestCaseWithSameTestNameTest.TheSecondTestWithThisNameShouldFail
-[ FAILED ] TEST_F_before_TEST_in_same_test_case.DefinedUsingTESTAndShouldFail
-[ FAILED ] TEST_before_TEST_F_in_same_test_case.DefinedUsingTEST_FAndShouldFail
-[ FAILED ] ExpectNonfatalFailureTest.FailsWhenThereIsNoNonfatalFailure
-[ FAILED ] ExpectNonfatalFailureTest.FailsWhenThereAreTwoNonfatalFailures
-[ FAILED ] ExpectNonfatalFailureTest.FailsWhenThereIsOneFatalFailure
-[ FAILED ] ExpectNonfatalFailureTest.FailsWhenStatementReturns
-[ FAILED ] ExpectNonfatalFailureTest.FailsWhenStatementThrows
-[ FAILED ] ExpectFatalFailureTest.FailsWhenThereIsNoFatalFailure
-[ FAILED ] ExpectFatalFailureTest.FailsWhenThereAreTwoFatalFailures
-[ FAILED ] ExpectFatalFailureTest.FailsWhenThereIsOneNonfatalFailure
-[ FAILED ] ExpectFatalFailureTest.FailsWhenStatementReturns
-[ FAILED ] ExpectFatalFailureTest.FailsWhenStatementThrows
-[ FAILED ] TypedTest/0.Failure, where TypeParam = int
-[ FAILED ] Unsigned/TypedTestP/0.Failure, where TypeParam = unsigned char
-[ FAILED ] Unsigned/TypedTestP/1.Failure, where TypeParam = unsigned int
-[ FAILED ] ExpectFailureTest.ExpectFatalFailure
-[ FAILED ] ExpectFailureTest.ExpectNonFatalFailure
-[ FAILED ] ExpectFailureTest.ExpectFatalFailureOnAllThreads
-[ FAILED ] ExpectFailureTest.ExpectNonFatalFailureOnAllThreads
-[ FAILED ] ExpectFailureWithThreadsTest.ExpectFatalFailure
-[ FAILED ] ExpectFailureWithThreadsTest.ExpectNonFatalFailure
-[ FAILED ] ScopedFakeTestPartResultReporterTest.InterceptOnlyCurrentThread
-[ FAILED ] PrintingFailingParams/FailingParamTest.Fails/0, where GetParam() = 2
-
-41 FAILED TESTS
- YOU HAVE 1 DISABLED TEST
-
-Note: Google Test filter = FatalFailureTest.*:LoggingTest.*
-[==========] Running 4 tests from 2 test cases.
-[----------] Global test environment set-up.
-[----------] 3 tests from FatalFailureTest
-[ RUN ] FatalFailureTest.FatalFailureInSubroutine
-(expecting a failure that x should be 1)
-gtest_output_test_.cc:#: Failure
-Value of: x
- Actual: 2
-Expected: 1
-[ FAILED ] FatalFailureTest.FatalFailureInSubroutine (? ms)
-[ RUN ] FatalFailureTest.FatalFailureInNestedSubroutine
-(expecting a failure that x should be 1)
-gtest_output_test_.cc:#: Failure
-Value of: x
- Actual: 2
-Expected: 1
-[ FAILED ] FatalFailureTest.FatalFailureInNestedSubroutine (? ms)
-[ RUN ] FatalFailureTest.NonfatalFailureInSubroutine
-(expecting a failure on false)
-gtest_output_test_.cc:#: Failure
-Value of: false
- Actual: false
-Expected: true
-[ FAILED ] FatalFailureTest.NonfatalFailureInSubroutine (? ms)
-[----------] 3 tests from FatalFailureTest (? ms total)
-
-[----------] 1 test from LoggingTest
-[ RUN ] LoggingTest.InterleavingLoggingAndAssertions
-(expecting 2 failures on (3) >= (a[i]))
-i == 0
-i == 1
-gtest_output_test_.cc:#: Failure
-Expected: (3) >= (a[i]), actual: 3 vs 9
-i == 2
-i == 3
-gtest_output_test_.cc:#: Failure
-Expected: (3) >= (a[i]), actual: 3 vs 6
-[ FAILED ] LoggingTest.InterleavingLoggingAndAssertions (? ms)
-[----------] 1 test from LoggingTest (? ms total)
-
-[----------] Global test environment tear-down
-[==========] 4 tests from 2 test cases ran. (? ms total)
-[ PASSED ] 0 tests.
-[ FAILED ] 4 tests, listed below:
-[ FAILED ] FatalFailureTest.FatalFailureInSubroutine
-[ FAILED ] FatalFailureTest.FatalFailureInNestedSubroutine
-[ FAILED ] FatalFailureTest.NonfatalFailureInSubroutine
-[ FAILED ] LoggingTest.InterleavingLoggingAndAssertions
-
- 4 FAILED TESTS
- YOU HAVE 1 DISABLED TEST
-
-Note: Google Test filter = *DISABLED_*
-[==========] Running 1 test from 1 test case.
-[----------] Global test environment set-up.
-[----------] 1 test from DisabledTestsWarningTest
-[ RUN ] DisabledTestsWarningTest.DISABLED_AlsoRunDisabledTestsFlagSuppressesWarning
-[ OK ] DisabledTestsWarningTest.DISABLED_AlsoRunDisabledTestsFlagSuppressesWarning
-[----------] Global test environment tear-down
-[==========] 1 test from 1 test case ran.
-[ PASSED ] 1 test.
-Note: Google Test filter = PassingTest.*
-Note: This is test shard 2 of 2.
-[==========] Running 1 test from 1 test case.
-[----------] Global test environment set-up.
-[----------] 1 test from PassingTest
-[ RUN ] PassingTest.PassingTest2
-[ OK ] PassingTest.PassingTest2
-[----------] Global test environment tear-down
-[==========] 1 test from 1 test case ran.
-[ PASSED ] 1 test.
-
- YOU HAVE 1 DISABLED TEST
-
diff --git a/src/testing/gtest/test/gtest_pred_impl_unittest.cc b/src/testing/gtest/test/gtest_pred_impl_unittest.cc
deleted file mode 100644
index a84eff86..00000000
--- a/src/testing/gtest/test/gtest_pred_impl_unittest.cc
+++ /dev/null
@@ -1,2427 +0,0 @@
-// Copyright 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// This file is AUTOMATICALLY GENERATED on 10/31/2011 by command
-// 'gen_gtest_pred_impl.py 5'. DO NOT EDIT BY HAND!
-
-// Regression test for gtest_pred_impl.h
-//
-// This file is generated by a script and quite long. If you intend to
-// learn how Google Test works by reading its unit tests, read
-// gtest_unittest.cc instead.
-//
-// This is intended as a regression test for the Google Test predicate
-// assertions. We compile it as part of the gtest_unittest target
-// only to keep the implementation tidy and compact, as it is quite
-// involved to set up the stage for testing Google Test using Google
-// Test itself.
-//
-// Currently, gtest_unittest takes ~11 seconds to run in the testing
-// daemon. In the future, if it grows too large and needs much more
-// time to finish, we should consider separating this file into a
-// stand-alone regression test.
-
-#include <iostream>
-
-#include "gtest/gtest.h"
-#include "gtest/gtest-spi.h"
-
-// A user-defined data type.
-struct Bool {
- explicit Bool(int val) : value(val != 0) {}
-
- bool operator>(int n) const { return value > Bool(n).value; }
-
- Bool operator+(const Bool& rhs) const { return Bool(value + rhs.value); }
-
- bool operator==(const Bool& rhs) const { return value == rhs.value; }
-
- bool value;
-};
-
-// Enables Bool to be used in assertions.
-std::ostream& operator<<(std::ostream& os, const Bool& x) {
- return os << (x.value ? "true" : "false");
-}
-
-// Sample functions/functors for testing unary predicate assertions.
-
-// A unary predicate function.
-template <typename T1>
-bool PredFunction1(T1 v1) {
- return v1 > 0;
-}
-
-// The following two functions are needed to circumvent a bug in
-// gcc 2.95.3, which sometimes has problem with the above template
-// function.
-bool PredFunction1Int(int v1) {
- return v1 > 0;
-}
-bool PredFunction1Bool(Bool v1) {
- return v1 > 0;
-}
-
-// A unary predicate functor.
-struct PredFunctor1 {
- template <typename T1>
- bool operator()(const T1& v1) {
- return v1 > 0;
- }
-};
-
-// A unary predicate-formatter function.
-template <typename T1>
-testing::AssertionResult PredFormatFunction1(const char* e1,
- const T1& v1) {
- if (PredFunction1(v1))
- return testing::AssertionSuccess();
-
- return testing::AssertionFailure()
- << e1
- << " is expected to be positive, but evaluates to "
- << v1 << ".";
-}
-
-// A unary predicate-formatter functor.
-struct PredFormatFunctor1 {
- template <typename T1>
- testing::AssertionResult operator()(const char* e1,
- const T1& v1) const {
- return PredFormatFunction1(e1, v1);
- }
-};
-
-// Tests for {EXPECT|ASSERT}_PRED_FORMAT1.
-
-class Predicate1Test : public testing::Test {
- protected:
- virtual void SetUp() {
- expected_to_finish_ = true;
- finished_ = false;
- n1_ = 0;
- }
-
- virtual void TearDown() {
- // Verifies that each of the predicate's arguments was evaluated
- // exactly once.
- EXPECT_EQ(1, n1_) <<
- "The predicate assertion didn't evaluate argument 2 "
- "exactly once.";
-
- // Verifies that the control flow in the test function is expected.
- if (expected_to_finish_ && !finished_) {
- FAIL() << "The predicate assertion unexpactedly aborted the test.";
- } else if (!expected_to_finish_ && finished_) {
- FAIL() << "The failed predicate assertion didn't abort the test "
- "as expected.";
- }
- }
-
- // true iff the test function is expected to run to finish.
- static bool expected_to_finish_;
-
- // true iff the test function did run to finish.
- static bool finished_;
-
- static int n1_;
-};
-
-bool Predicate1Test::expected_to_finish_;
-bool Predicate1Test::finished_;
-int Predicate1Test::n1_;
-
-typedef Predicate1Test EXPECT_PRED_FORMAT1Test;
-typedef Predicate1Test ASSERT_PRED_FORMAT1Test;
-typedef Predicate1Test EXPECT_PRED1Test;
-typedef Predicate1Test ASSERT_PRED1Test;
-
-// Tests a successful EXPECT_PRED1 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(EXPECT_PRED1Test, FunctionOnBuiltInTypeSuccess) {
- EXPECT_PRED1(PredFunction1Int,
- ++n1_);
- finished_ = true;
-}
-
-// Tests a successful EXPECT_PRED1 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(EXPECT_PRED1Test, FunctionOnUserTypeSuccess) {
- EXPECT_PRED1(PredFunction1Bool,
- Bool(++n1_));
- finished_ = true;
-}
-
-// Tests a successful EXPECT_PRED1 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(EXPECT_PRED1Test, FunctorOnBuiltInTypeSuccess) {
- EXPECT_PRED1(PredFunctor1(),
- ++n1_);
- finished_ = true;
-}
-
-// Tests a successful EXPECT_PRED1 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(EXPECT_PRED1Test, FunctorOnUserTypeSuccess) {
- EXPECT_PRED1(PredFunctor1(),
- Bool(++n1_));
- finished_ = true;
-}
-
-// Tests a failed EXPECT_PRED1 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(EXPECT_PRED1Test, FunctionOnBuiltInTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED1(PredFunction1Int,
- n1_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed EXPECT_PRED1 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(EXPECT_PRED1Test, FunctionOnUserTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED1(PredFunction1Bool,
- Bool(n1_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a failed EXPECT_PRED1 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(EXPECT_PRED1Test, FunctorOnBuiltInTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED1(PredFunctor1(),
- n1_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed EXPECT_PRED1 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(EXPECT_PRED1Test, FunctorOnUserTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED1(PredFunctor1(),
- Bool(n1_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a successful ASSERT_PRED1 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(ASSERT_PRED1Test, FunctionOnBuiltInTypeSuccess) {
- ASSERT_PRED1(PredFunction1Int,
- ++n1_);
- finished_ = true;
-}
-
-// Tests a successful ASSERT_PRED1 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(ASSERT_PRED1Test, FunctionOnUserTypeSuccess) {
- ASSERT_PRED1(PredFunction1Bool,
- Bool(++n1_));
- finished_ = true;
-}
-
-// Tests a successful ASSERT_PRED1 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(ASSERT_PRED1Test, FunctorOnBuiltInTypeSuccess) {
- ASSERT_PRED1(PredFunctor1(),
- ++n1_);
- finished_ = true;
-}
-
-// Tests a successful ASSERT_PRED1 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(ASSERT_PRED1Test, FunctorOnUserTypeSuccess) {
- ASSERT_PRED1(PredFunctor1(),
- Bool(++n1_));
- finished_ = true;
-}
-
-// Tests a failed ASSERT_PRED1 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(ASSERT_PRED1Test, FunctionOnBuiltInTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED1(PredFunction1Int,
- n1_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed ASSERT_PRED1 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(ASSERT_PRED1Test, FunctionOnUserTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED1(PredFunction1Bool,
- Bool(n1_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a failed ASSERT_PRED1 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(ASSERT_PRED1Test, FunctorOnBuiltInTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED1(PredFunctor1(),
- n1_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed ASSERT_PRED1 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(ASSERT_PRED1Test, FunctorOnUserTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED1(PredFunctor1(),
- Bool(n1_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a successful EXPECT_PRED_FORMAT1 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(EXPECT_PRED_FORMAT1Test, FunctionOnBuiltInTypeSuccess) {
- EXPECT_PRED_FORMAT1(PredFormatFunction1,
- ++n1_);
- finished_ = true;
-}
-
-// Tests a successful EXPECT_PRED_FORMAT1 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(EXPECT_PRED_FORMAT1Test, FunctionOnUserTypeSuccess) {
- EXPECT_PRED_FORMAT1(PredFormatFunction1,
- Bool(++n1_));
- finished_ = true;
-}
-
-// Tests a successful EXPECT_PRED_FORMAT1 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(EXPECT_PRED_FORMAT1Test, FunctorOnBuiltInTypeSuccess) {
- EXPECT_PRED_FORMAT1(PredFormatFunctor1(),
- ++n1_);
- finished_ = true;
-}
-
-// Tests a successful EXPECT_PRED_FORMAT1 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(EXPECT_PRED_FORMAT1Test, FunctorOnUserTypeSuccess) {
- EXPECT_PRED_FORMAT1(PredFormatFunctor1(),
- Bool(++n1_));
- finished_ = true;
-}
-
-// Tests a failed EXPECT_PRED_FORMAT1 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(EXPECT_PRED_FORMAT1Test, FunctionOnBuiltInTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED_FORMAT1(PredFormatFunction1,
- n1_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed EXPECT_PRED_FORMAT1 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(EXPECT_PRED_FORMAT1Test, FunctionOnUserTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED_FORMAT1(PredFormatFunction1,
- Bool(n1_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a failed EXPECT_PRED_FORMAT1 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(EXPECT_PRED_FORMAT1Test, FunctorOnBuiltInTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED_FORMAT1(PredFormatFunctor1(),
- n1_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed EXPECT_PRED_FORMAT1 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(EXPECT_PRED_FORMAT1Test, FunctorOnUserTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED_FORMAT1(PredFormatFunctor1(),
- Bool(n1_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a successful ASSERT_PRED_FORMAT1 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(ASSERT_PRED_FORMAT1Test, FunctionOnBuiltInTypeSuccess) {
- ASSERT_PRED_FORMAT1(PredFormatFunction1,
- ++n1_);
- finished_ = true;
-}
-
-// Tests a successful ASSERT_PRED_FORMAT1 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(ASSERT_PRED_FORMAT1Test, FunctionOnUserTypeSuccess) {
- ASSERT_PRED_FORMAT1(PredFormatFunction1,
- Bool(++n1_));
- finished_ = true;
-}
-
-// Tests a successful ASSERT_PRED_FORMAT1 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(ASSERT_PRED_FORMAT1Test, FunctorOnBuiltInTypeSuccess) {
- ASSERT_PRED_FORMAT1(PredFormatFunctor1(),
- ++n1_);
- finished_ = true;
-}
-
-// Tests a successful ASSERT_PRED_FORMAT1 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(ASSERT_PRED_FORMAT1Test, FunctorOnUserTypeSuccess) {
- ASSERT_PRED_FORMAT1(PredFormatFunctor1(),
- Bool(++n1_));
- finished_ = true;
-}
-
-// Tests a failed ASSERT_PRED_FORMAT1 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(ASSERT_PRED_FORMAT1Test, FunctionOnBuiltInTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED_FORMAT1(PredFormatFunction1,
- n1_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed ASSERT_PRED_FORMAT1 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(ASSERT_PRED_FORMAT1Test, FunctionOnUserTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED_FORMAT1(PredFormatFunction1,
- Bool(n1_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a failed ASSERT_PRED_FORMAT1 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(ASSERT_PRED_FORMAT1Test, FunctorOnBuiltInTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED_FORMAT1(PredFormatFunctor1(),
- n1_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed ASSERT_PRED_FORMAT1 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(ASSERT_PRED_FORMAT1Test, FunctorOnUserTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED_FORMAT1(PredFormatFunctor1(),
- Bool(n1_++));
- finished_ = true;
- }, "");
-}
-// Sample functions/functors for testing binary predicate assertions.
-
-// A binary predicate function.
-template <typename T1, typename T2>
-bool PredFunction2(T1 v1, T2 v2) {
- return v1 + v2 > 0;
-}
-
-// The following two functions are needed to circumvent a bug in
-// gcc 2.95.3, which sometimes has problem with the above template
-// function.
-bool PredFunction2Int(int v1, int v2) {
- return v1 + v2 > 0;
-}
-bool PredFunction2Bool(Bool v1, Bool v2) {
- return v1 + v2 > 0;
-}
-
-// A binary predicate functor.
-struct PredFunctor2 {
- template <typename T1, typename T2>
- bool operator()(const T1& v1,
- const T2& v2) {
- return v1 + v2 > 0;
- }
-};
-
-// A binary predicate-formatter function.
-template <typename T1, typename T2>
-testing::AssertionResult PredFormatFunction2(const char* e1,
- const char* e2,
- const T1& v1,
- const T2& v2) {
- if (PredFunction2(v1, v2))
- return testing::AssertionSuccess();
-
- return testing::AssertionFailure()
- << e1 << " + " << e2
- << " is expected to be positive, but evaluates to "
- << v1 + v2 << ".";
-}
-
-// A binary predicate-formatter functor.
-struct PredFormatFunctor2 {
- template <typename T1, typename T2>
- testing::AssertionResult operator()(const char* e1,
- const char* e2,
- const T1& v1,
- const T2& v2) const {
- return PredFormatFunction2(e1, e2, v1, v2);
- }
-};
-
-// Tests for {EXPECT|ASSERT}_PRED_FORMAT2.
-
-class Predicate2Test : public testing::Test {
- protected:
- virtual void SetUp() {
- expected_to_finish_ = true;
- finished_ = false;
- n1_ = n2_ = 0;
- }
-
- virtual void TearDown() {
- // Verifies that each of the predicate's arguments was evaluated
- // exactly once.
- EXPECT_EQ(1, n1_) <<
- "The predicate assertion didn't evaluate argument 2 "
- "exactly once.";
- EXPECT_EQ(1, n2_) <<
- "The predicate assertion didn't evaluate argument 3 "
- "exactly once.";
-
- // Verifies that the control flow in the test function is expected.
- if (expected_to_finish_ && !finished_) {
- FAIL() << "The predicate assertion unexpactedly aborted the test.";
- } else if (!expected_to_finish_ && finished_) {
- FAIL() << "The failed predicate assertion didn't abort the test "
- "as expected.";
- }
- }
-
- // true iff the test function is expected to run to finish.
- static bool expected_to_finish_;
-
- // true iff the test function did run to finish.
- static bool finished_;
-
- static int n1_;
- static int n2_;
-};
-
-bool Predicate2Test::expected_to_finish_;
-bool Predicate2Test::finished_;
-int Predicate2Test::n1_;
-int Predicate2Test::n2_;
-
-typedef Predicate2Test EXPECT_PRED_FORMAT2Test;
-typedef Predicate2Test ASSERT_PRED_FORMAT2Test;
-typedef Predicate2Test EXPECT_PRED2Test;
-typedef Predicate2Test ASSERT_PRED2Test;
-
-// Tests a successful EXPECT_PRED2 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(EXPECT_PRED2Test, FunctionOnBuiltInTypeSuccess) {
- EXPECT_PRED2(PredFunction2Int,
- ++n1_,
- ++n2_);
- finished_ = true;
-}
-
-// Tests a successful EXPECT_PRED2 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(EXPECT_PRED2Test, FunctionOnUserTypeSuccess) {
- EXPECT_PRED2(PredFunction2Bool,
- Bool(++n1_),
- Bool(++n2_));
- finished_ = true;
-}
-
-// Tests a successful EXPECT_PRED2 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(EXPECT_PRED2Test, FunctorOnBuiltInTypeSuccess) {
- EXPECT_PRED2(PredFunctor2(),
- ++n1_,
- ++n2_);
- finished_ = true;
-}
-
-// Tests a successful EXPECT_PRED2 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(EXPECT_PRED2Test, FunctorOnUserTypeSuccess) {
- EXPECT_PRED2(PredFunctor2(),
- Bool(++n1_),
- Bool(++n2_));
- finished_ = true;
-}
-
-// Tests a failed EXPECT_PRED2 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(EXPECT_PRED2Test, FunctionOnBuiltInTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED2(PredFunction2Int,
- n1_++,
- n2_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed EXPECT_PRED2 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(EXPECT_PRED2Test, FunctionOnUserTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED2(PredFunction2Bool,
- Bool(n1_++),
- Bool(n2_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a failed EXPECT_PRED2 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(EXPECT_PRED2Test, FunctorOnBuiltInTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED2(PredFunctor2(),
- n1_++,
- n2_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed EXPECT_PRED2 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(EXPECT_PRED2Test, FunctorOnUserTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED2(PredFunctor2(),
- Bool(n1_++),
- Bool(n2_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a successful ASSERT_PRED2 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(ASSERT_PRED2Test, FunctionOnBuiltInTypeSuccess) {
- ASSERT_PRED2(PredFunction2Int,
- ++n1_,
- ++n2_);
- finished_ = true;
-}
-
-// Tests a successful ASSERT_PRED2 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(ASSERT_PRED2Test, FunctionOnUserTypeSuccess) {
- ASSERT_PRED2(PredFunction2Bool,
- Bool(++n1_),
- Bool(++n2_));
- finished_ = true;
-}
-
-// Tests a successful ASSERT_PRED2 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(ASSERT_PRED2Test, FunctorOnBuiltInTypeSuccess) {
- ASSERT_PRED2(PredFunctor2(),
- ++n1_,
- ++n2_);
- finished_ = true;
-}
-
-// Tests a successful ASSERT_PRED2 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(ASSERT_PRED2Test, FunctorOnUserTypeSuccess) {
- ASSERT_PRED2(PredFunctor2(),
- Bool(++n1_),
- Bool(++n2_));
- finished_ = true;
-}
-
-// Tests a failed ASSERT_PRED2 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(ASSERT_PRED2Test, FunctionOnBuiltInTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED2(PredFunction2Int,
- n1_++,
- n2_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed ASSERT_PRED2 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(ASSERT_PRED2Test, FunctionOnUserTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED2(PredFunction2Bool,
- Bool(n1_++),
- Bool(n2_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a failed ASSERT_PRED2 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(ASSERT_PRED2Test, FunctorOnBuiltInTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED2(PredFunctor2(),
- n1_++,
- n2_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed ASSERT_PRED2 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(ASSERT_PRED2Test, FunctorOnUserTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED2(PredFunctor2(),
- Bool(n1_++),
- Bool(n2_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a successful EXPECT_PRED_FORMAT2 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(EXPECT_PRED_FORMAT2Test, FunctionOnBuiltInTypeSuccess) {
- EXPECT_PRED_FORMAT2(PredFormatFunction2,
- ++n1_,
- ++n2_);
- finished_ = true;
-}
-
-// Tests a successful EXPECT_PRED_FORMAT2 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(EXPECT_PRED_FORMAT2Test, FunctionOnUserTypeSuccess) {
- EXPECT_PRED_FORMAT2(PredFormatFunction2,
- Bool(++n1_),
- Bool(++n2_));
- finished_ = true;
-}
-
-// Tests a successful EXPECT_PRED_FORMAT2 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(EXPECT_PRED_FORMAT2Test, FunctorOnBuiltInTypeSuccess) {
- EXPECT_PRED_FORMAT2(PredFormatFunctor2(),
- ++n1_,
- ++n2_);
- finished_ = true;
-}
-
-// Tests a successful EXPECT_PRED_FORMAT2 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(EXPECT_PRED_FORMAT2Test, FunctorOnUserTypeSuccess) {
- EXPECT_PRED_FORMAT2(PredFormatFunctor2(),
- Bool(++n1_),
- Bool(++n2_));
- finished_ = true;
-}
-
-// Tests a failed EXPECT_PRED_FORMAT2 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(EXPECT_PRED_FORMAT2Test, FunctionOnBuiltInTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED_FORMAT2(PredFormatFunction2,
- n1_++,
- n2_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed EXPECT_PRED_FORMAT2 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(EXPECT_PRED_FORMAT2Test, FunctionOnUserTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED_FORMAT2(PredFormatFunction2,
- Bool(n1_++),
- Bool(n2_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a failed EXPECT_PRED_FORMAT2 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(EXPECT_PRED_FORMAT2Test, FunctorOnBuiltInTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED_FORMAT2(PredFormatFunctor2(),
- n1_++,
- n2_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed EXPECT_PRED_FORMAT2 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(EXPECT_PRED_FORMAT2Test, FunctorOnUserTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED_FORMAT2(PredFormatFunctor2(),
- Bool(n1_++),
- Bool(n2_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a successful ASSERT_PRED_FORMAT2 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(ASSERT_PRED_FORMAT2Test, FunctionOnBuiltInTypeSuccess) {
- ASSERT_PRED_FORMAT2(PredFormatFunction2,
- ++n1_,
- ++n2_);
- finished_ = true;
-}
-
-// Tests a successful ASSERT_PRED_FORMAT2 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(ASSERT_PRED_FORMAT2Test, FunctionOnUserTypeSuccess) {
- ASSERT_PRED_FORMAT2(PredFormatFunction2,
- Bool(++n1_),
- Bool(++n2_));
- finished_ = true;
-}
-
-// Tests a successful ASSERT_PRED_FORMAT2 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(ASSERT_PRED_FORMAT2Test, FunctorOnBuiltInTypeSuccess) {
- ASSERT_PRED_FORMAT2(PredFormatFunctor2(),
- ++n1_,
- ++n2_);
- finished_ = true;
-}
-
-// Tests a successful ASSERT_PRED_FORMAT2 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(ASSERT_PRED_FORMAT2Test, FunctorOnUserTypeSuccess) {
- ASSERT_PRED_FORMAT2(PredFormatFunctor2(),
- Bool(++n1_),
- Bool(++n2_));
- finished_ = true;
-}
-
-// Tests a failed ASSERT_PRED_FORMAT2 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(ASSERT_PRED_FORMAT2Test, FunctionOnBuiltInTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED_FORMAT2(PredFormatFunction2,
- n1_++,
- n2_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed ASSERT_PRED_FORMAT2 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(ASSERT_PRED_FORMAT2Test, FunctionOnUserTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED_FORMAT2(PredFormatFunction2,
- Bool(n1_++),
- Bool(n2_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a failed ASSERT_PRED_FORMAT2 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(ASSERT_PRED_FORMAT2Test, FunctorOnBuiltInTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED_FORMAT2(PredFormatFunctor2(),
- n1_++,
- n2_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed ASSERT_PRED_FORMAT2 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(ASSERT_PRED_FORMAT2Test, FunctorOnUserTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED_FORMAT2(PredFormatFunctor2(),
- Bool(n1_++),
- Bool(n2_++));
- finished_ = true;
- }, "");
-}
-// Sample functions/functors for testing ternary predicate assertions.
-
-// A ternary predicate function.
-template <typename T1, typename T2, typename T3>
-bool PredFunction3(T1 v1, T2 v2, T3 v3) {
- return v1 + v2 + v3 > 0;
-}
-
-// The following two functions are needed to circumvent a bug in
-// gcc 2.95.3, which sometimes has problem with the above template
-// function.
-bool PredFunction3Int(int v1, int v2, int v3) {
- return v1 + v2 + v3 > 0;
-}
-bool PredFunction3Bool(Bool v1, Bool v2, Bool v3) {
- return v1 + v2 + v3 > 0;
-}
-
-// A ternary predicate functor.
-struct PredFunctor3 {
- template <typename T1, typename T2, typename T3>
- bool operator()(const T1& v1,
- const T2& v2,
- const T3& v3) {
- return v1 + v2 + v3 > 0;
- }
-};
-
-// A ternary predicate-formatter function.
-template <typename T1, typename T2, typename T3>
-testing::AssertionResult PredFormatFunction3(const char* e1,
- const char* e2,
- const char* e3,
- const T1& v1,
- const T2& v2,
- const T3& v3) {
- if (PredFunction3(v1, v2, v3))
- return testing::AssertionSuccess();
-
- return testing::AssertionFailure()
- << e1 << " + " << e2 << " + " << e3
- << " is expected to be positive, but evaluates to "
- << v1 + v2 + v3 << ".";
-}
-
-// A ternary predicate-formatter functor.
-struct PredFormatFunctor3 {
- template <typename T1, typename T2, typename T3>
- testing::AssertionResult operator()(const char* e1,
- const char* e2,
- const char* e3,
- const T1& v1,
- const T2& v2,
- const T3& v3) const {
- return PredFormatFunction3(e1, e2, e3, v1, v2, v3);
- }
-};
-
-// Tests for {EXPECT|ASSERT}_PRED_FORMAT3.
-
-class Predicate3Test : public testing::Test {
- protected:
- virtual void SetUp() {
- expected_to_finish_ = true;
- finished_ = false;
- n1_ = n2_ = n3_ = 0;
- }
-
- virtual void TearDown() {
- // Verifies that each of the predicate's arguments was evaluated
- // exactly once.
- EXPECT_EQ(1, n1_) <<
- "The predicate assertion didn't evaluate argument 2 "
- "exactly once.";
- EXPECT_EQ(1, n2_) <<
- "The predicate assertion didn't evaluate argument 3 "
- "exactly once.";
- EXPECT_EQ(1, n3_) <<
- "The predicate assertion didn't evaluate argument 4 "
- "exactly once.";
-
- // Verifies that the control flow in the test function is expected.
- if (expected_to_finish_ && !finished_) {
- FAIL() << "The predicate assertion unexpactedly aborted the test.";
- } else if (!expected_to_finish_ && finished_) {
- FAIL() << "The failed predicate assertion didn't abort the test "
- "as expected.";
- }
- }
-
- // true iff the test function is expected to run to finish.
- static bool expected_to_finish_;
-
- // true iff the test function did run to finish.
- static bool finished_;
-
- static int n1_;
- static int n2_;
- static int n3_;
-};
-
-bool Predicate3Test::expected_to_finish_;
-bool Predicate3Test::finished_;
-int Predicate3Test::n1_;
-int Predicate3Test::n2_;
-int Predicate3Test::n3_;
-
-typedef Predicate3Test EXPECT_PRED_FORMAT3Test;
-typedef Predicate3Test ASSERT_PRED_FORMAT3Test;
-typedef Predicate3Test EXPECT_PRED3Test;
-typedef Predicate3Test ASSERT_PRED3Test;
-
-// Tests a successful EXPECT_PRED3 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(EXPECT_PRED3Test, FunctionOnBuiltInTypeSuccess) {
- EXPECT_PRED3(PredFunction3Int,
- ++n1_,
- ++n2_,
- ++n3_);
- finished_ = true;
-}
-
-// Tests a successful EXPECT_PRED3 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(EXPECT_PRED3Test, FunctionOnUserTypeSuccess) {
- EXPECT_PRED3(PredFunction3Bool,
- Bool(++n1_),
- Bool(++n2_),
- Bool(++n3_));
- finished_ = true;
-}
-
-// Tests a successful EXPECT_PRED3 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(EXPECT_PRED3Test, FunctorOnBuiltInTypeSuccess) {
- EXPECT_PRED3(PredFunctor3(),
- ++n1_,
- ++n2_,
- ++n3_);
- finished_ = true;
-}
-
-// Tests a successful EXPECT_PRED3 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(EXPECT_PRED3Test, FunctorOnUserTypeSuccess) {
- EXPECT_PRED3(PredFunctor3(),
- Bool(++n1_),
- Bool(++n2_),
- Bool(++n3_));
- finished_ = true;
-}
-
-// Tests a failed EXPECT_PRED3 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(EXPECT_PRED3Test, FunctionOnBuiltInTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED3(PredFunction3Int,
- n1_++,
- n2_++,
- n3_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed EXPECT_PRED3 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(EXPECT_PRED3Test, FunctionOnUserTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED3(PredFunction3Bool,
- Bool(n1_++),
- Bool(n2_++),
- Bool(n3_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a failed EXPECT_PRED3 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(EXPECT_PRED3Test, FunctorOnBuiltInTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED3(PredFunctor3(),
- n1_++,
- n2_++,
- n3_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed EXPECT_PRED3 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(EXPECT_PRED3Test, FunctorOnUserTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED3(PredFunctor3(),
- Bool(n1_++),
- Bool(n2_++),
- Bool(n3_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a successful ASSERT_PRED3 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(ASSERT_PRED3Test, FunctionOnBuiltInTypeSuccess) {
- ASSERT_PRED3(PredFunction3Int,
- ++n1_,
- ++n2_,
- ++n3_);
- finished_ = true;
-}
-
-// Tests a successful ASSERT_PRED3 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(ASSERT_PRED3Test, FunctionOnUserTypeSuccess) {
- ASSERT_PRED3(PredFunction3Bool,
- Bool(++n1_),
- Bool(++n2_),
- Bool(++n3_));
- finished_ = true;
-}
-
-// Tests a successful ASSERT_PRED3 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(ASSERT_PRED3Test, FunctorOnBuiltInTypeSuccess) {
- ASSERT_PRED3(PredFunctor3(),
- ++n1_,
- ++n2_,
- ++n3_);
- finished_ = true;
-}
-
-// Tests a successful ASSERT_PRED3 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(ASSERT_PRED3Test, FunctorOnUserTypeSuccess) {
- ASSERT_PRED3(PredFunctor3(),
- Bool(++n1_),
- Bool(++n2_),
- Bool(++n3_));
- finished_ = true;
-}
-
-// Tests a failed ASSERT_PRED3 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(ASSERT_PRED3Test, FunctionOnBuiltInTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED3(PredFunction3Int,
- n1_++,
- n2_++,
- n3_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed ASSERT_PRED3 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(ASSERT_PRED3Test, FunctionOnUserTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED3(PredFunction3Bool,
- Bool(n1_++),
- Bool(n2_++),
- Bool(n3_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a failed ASSERT_PRED3 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(ASSERT_PRED3Test, FunctorOnBuiltInTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED3(PredFunctor3(),
- n1_++,
- n2_++,
- n3_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed ASSERT_PRED3 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(ASSERT_PRED3Test, FunctorOnUserTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED3(PredFunctor3(),
- Bool(n1_++),
- Bool(n2_++),
- Bool(n3_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a successful EXPECT_PRED_FORMAT3 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(EXPECT_PRED_FORMAT3Test, FunctionOnBuiltInTypeSuccess) {
- EXPECT_PRED_FORMAT3(PredFormatFunction3,
- ++n1_,
- ++n2_,
- ++n3_);
- finished_ = true;
-}
-
-// Tests a successful EXPECT_PRED_FORMAT3 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(EXPECT_PRED_FORMAT3Test, FunctionOnUserTypeSuccess) {
- EXPECT_PRED_FORMAT3(PredFormatFunction3,
- Bool(++n1_),
- Bool(++n2_),
- Bool(++n3_));
- finished_ = true;
-}
-
-// Tests a successful EXPECT_PRED_FORMAT3 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(EXPECT_PRED_FORMAT3Test, FunctorOnBuiltInTypeSuccess) {
- EXPECT_PRED_FORMAT3(PredFormatFunctor3(),
- ++n1_,
- ++n2_,
- ++n3_);
- finished_ = true;
-}
-
-// Tests a successful EXPECT_PRED_FORMAT3 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(EXPECT_PRED_FORMAT3Test, FunctorOnUserTypeSuccess) {
- EXPECT_PRED_FORMAT3(PredFormatFunctor3(),
- Bool(++n1_),
- Bool(++n2_),
- Bool(++n3_));
- finished_ = true;
-}
-
-// Tests a failed EXPECT_PRED_FORMAT3 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(EXPECT_PRED_FORMAT3Test, FunctionOnBuiltInTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED_FORMAT3(PredFormatFunction3,
- n1_++,
- n2_++,
- n3_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed EXPECT_PRED_FORMAT3 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(EXPECT_PRED_FORMAT3Test, FunctionOnUserTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED_FORMAT3(PredFormatFunction3,
- Bool(n1_++),
- Bool(n2_++),
- Bool(n3_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a failed EXPECT_PRED_FORMAT3 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(EXPECT_PRED_FORMAT3Test, FunctorOnBuiltInTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED_FORMAT3(PredFormatFunctor3(),
- n1_++,
- n2_++,
- n3_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed EXPECT_PRED_FORMAT3 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(EXPECT_PRED_FORMAT3Test, FunctorOnUserTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED_FORMAT3(PredFormatFunctor3(),
- Bool(n1_++),
- Bool(n2_++),
- Bool(n3_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a successful ASSERT_PRED_FORMAT3 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(ASSERT_PRED_FORMAT3Test, FunctionOnBuiltInTypeSuccess) {
- ASSERT_PRED_FORMAT3(PredFormatFunction3,
- ++n1_,
- ++n2_,
- ++n3_);
- finished_ = true;
-}
-
-// Tests a successful ASSERT_PRED_FORMAT3 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(ASSERT_PRED_FORMAT3Test, FunctionOnUserTypeSuccess) {
- ASSERT_PRED_FORMAT3(PredFormatFunction3,
- Bool(++n1_),
- Bool(++n2_),
- Bool(++n3_));
- finished_ = true;
-}
-
-// Tests a successful ASSERT_PRED_FORMAT3 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(ASSERT_PRED_FORMAT3Test, FunctorOnBuiltInTypeSuccess) {
- ASSERT_PRED_FORMAT3(PredFormatFunctor3(),
- ++n1_,
- ++n2_,
- ++n3_);
- finished_ = true;
-}
-
-// Tests a successful ASSERT_PRED_FORMAT3 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(ASSERT_PRED_FORMAT3Test, FunctorOnUserTypeSuccess) {
- ASSERT_PRED_FORMAT3(PredFormatFunctor3(),
- Bool(++n1_),
- Bool(++n2_),
- Bool(++n3_));
- finished_ = true;
-}
-
-// Tests a failed ASSERT_PRED_FORMAT3 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(ASSERT_PRED_FORMAT3Test, FunctionOnBuiltInTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED_FORMAT3(PredFormatFunction3,
- n1_++,
- n2_++,
- n3_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed ASSERT_PRED_FORMAT3 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(ASSERT_PRED_FORMAT3Test, FunctionOnUserTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED_FORMAT3(PredFormatFunction3,
- Bool(n1_++),
- Bool(n2_++),
- Bool(n3_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a failed ASSERT_PRED_FORMAT3 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(ASSERT_PRED_FORMAT3Test, FunctorOnBuiltInTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED_FORMAT3(PredFormatFunctor3(),
- n1_++,
- n2_++,
- n3_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed ASSERT_PRED_FORMAT3 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(ASSERT_PRED_FORMAT3Test, FunctorOnUserTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED_FORMAT3(PredFormatFunctor3(),
- Bool(n1_++),
- Bool(n2_++),
- Bool(n3_++));
- finished_ = true;
- }, "");
-}
-// Sample functions/functors for testing 4-ary predicate assertions.
-
-// A 4-ary predicate function.
-template <typename T1, typename T2, typename T3, typename T4>
-bool PredFunction4(T1 v1, T2 v2, T3 v3, T4 v4) {
- return v1 + v2 + v3 + v4 > 0;
-}
-
-// The following two functions are needed to circumvent a bug in
-// gcc 2.95.3, which sometimes has problem with the above template
-// function.
-bool PredFunction4Int(int v1, int v2, int v3, int v4) {
- return v1 + v2 + v3 + v4 > 0;
-}
-bool PredFunction4Bool(Bool v1, Bool v2, Bool v3, Bool v4) {
- return v1 + v2 + v3 + v4 > 0;
-}
-
-// A 4-ary predicate functor.
-struct PredFunctor4 {
- template <typename T1, typename T2, typename T3, typename T4>
- bool operator()(const T1& v1,
- const T2& v2,
- const T3& v3,
- const T4& v4) {
- return v1 + v2 + v3 + v4 > 0;
- }
-};
-
-// A 4-ary predicate-formatter function.
-template <typename T1, typename T2, typename T3, typename T4>
-testing::AssertionResult PredFormatFunction4(const char* e1,
- const char* e2,
- const char* e3,
- const char* e4,
- const T1& v1,
- const T2& v2,
- const T3& v3,
- const T4& v4) {
- if (PredFunction4(v1, v2, v3, v4))
- return testing::AssertionSuccess();
-
- return testing::AssertionFailure()
- << e1 << " + " << e2 << " + " << e3 << " + " << e4
- << " is expected to be positive, but evaluates to "
- << v1 + v2 + v3 + v4 << ".";
-}
-
-// A 4-ary predicate-formatter functor.
-struct PredFormatFunctor4 {
- template <typename T1, typename T2, typename T3, typename T4>
- testing::AssertionResult operator()(const char* e1,
- const char* e2,
- const char* e3,
- const char* e4,
- const T1& v1,
- const T2& v2,
- const T3& v3,
- const T4& v4) const {
- return PredFormatFunction4(e1, e2, e3, e4, v1, v2, v3, v4);
- }
-};
-
-// Tests for {EXPECT|ASSERT}_PRED_FORMAT4.
-
-class Predicate4Test : public testing::Test {
- protected:
- virtual void SetUp() {
- expected_to_finish_ = true;
- finished_ = false;
- n1_ = n2_ = n3_ = n4_ = 0;
- }
-
- virtual void TearDown() {
- // Verifies that each of the predicate's arguments was evaluated
- // exactly once.
- EXPECT_EQ(1, n1_) <<
- "The predicate assertion didn't evaluate argument 2 "
- "exactly once.";
- EXPECT_EQ(1, n2_) <<
- "The predicate assertion didn't evaluate argument 3 "
- "exactly once.";
- EXPECT_EQ(1, n3_) <<
- "The predicate assertion didn't evaluate argument 4 "
- "exactly once.";
- EXPECT_EQ(1, n4_) <<
- "The predicate assertion didn't evaluate argument 5 "
- "exactly once.";
-
- // Verifies that the control flow in the test function is expected.
- if (expected_to_finish_ && !finished_) {
- FAIL() << "The predicate assertion unexpactedly aborted the test.";
- } else if (!expected_to_finish_ && finished_) {
- FAIL() << "The failed predicate assertion didn't abort the test "
- "as expected.";
- }
- }
-
- // true iff the test function is expected to run to finish.
- static bool expected_to_finish_;
-
- // true iff the test function did run to finish.
- static bool finished_;
-
- static int n1_;
- static int n2_;
- static int n3_;
- static int n4_;
-};
-
-bool Predicate4Test::expected_to_finish_;
-bool Predicate4Test::finished_;
-int Predicate4Test::n1_;
-int Predicate4Test::n2_;
-int Predicate4Test::n3_;
-int Predicate4Test::n4_;
-
-typedef Predicate4Test EXPECT_PRED_FORMAT4Test;
-typedef Predicate4Test ASSERT_PRED_FORMAT4Test;
-typedef Predicate4Test EXPECT_PRED4Test;
-typedef Predicate4Test ASSERT_PRED4Test;
-
-// Tests a successful EXPECT_PRED4 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(EXPECT_PRED4Test, FunctionOnBuiltInTypeSuccess) {
- EXPECT_PRED4(PredFunction4Int,
- ++n1_,
- ++n2_,
- ++n3_,
- ++n4_);
- finished_ = true;
-}
-
-// Tests a successful EXPECT_PRED4 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(EXPECT_PRED4Test, FunctionOnUserTypeSuccess) {
- EXPECT_PRED4(PredFunction4Bool,
- Bool(++n1_),
- Bool(++n2_),
- Bool(++n3_),
- Bool(++n4_));
- finished_ = true;
-}
-
-// Tests a successful EXPECT_PRED4 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(EXPECT_PRED4Test, FunctorOnBuiltInTypeSuccess) {
- EXPECT_PRED4(PredFunctor4(),
- ++n1_,
- ++n2_,
- ++n3_,
- ++n4_);
- finished_ = true;
-}
-
-// Tests a successful EXPECT_PRED4 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(EXPECT_PRED4Test, FunctorOnUserTypeSuccess) {
- EXPECT_PRED4(PredFunctor4(),
- Bool(++n1_),
- Bool(++n2_),
- Bool(++n3_),
- Bool(++n4_));
- finished_ = true;
-}
-
-// Tests a failed EXPECT_PRED4 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(EXPECT_PRED4Test, FunctionOnBuiltInTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED4(PredFunction4Int,
- n1_++,
- n2_++,
- n3_++,
- n4_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed EXPECT_PRED4 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(EXPECT_PRED4Test, FunctionOnUserTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED4(PredFunction4Bool,
- Bool(n1_++),
- Bool(n2_++),
- Bool(n3_++),
- Bool(n4_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a failed EXPECT_PRED4 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(EXPECT_PRED4Test, FunctorOnBuiltInTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED4(PredFunctor4(),
- n1_++,
- n2_++,
- n3_++,
- n4_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed EXPECT_PRED4 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(EXPECT_PRED4Test, FunctorOnUserTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED4(PredFunctor4(),
- Bool(n1_++),
- Bool(n2_++),
- Bool(n3_++),
- Bool(n4_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a successful ASSERT_PRED4 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(ASSERT_PRED4Test, FunctionOnBuiltInTypeSuccess) {
- ASSERT_PRED4(PredFunction4Int,
- ++n1_,
- ++n2_,
- ++n3_,
- ++n4_);
- finished_ = true;
-}
-
-// Tests a successful ASSERT_PRED4 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(ASSERT_PRED4Test, FunctionOnUserTypeSuccess) {
- ASSERT_PRED4(PredFunction4Bool,
- Bool(++n1_),
- Bool(++n2_),
- Bool(++n3_),
- Bool(++n4_));
- finished_ = true;
-}
-
-// Tests a successful ASSERT_PRED4 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(ASSERT_PRED4Test, FunctorOnBuiltInTypeSuccess) {
- ASSERT_PRED4(PredFunctor4(),
- ++n1_,
- ++n2_,
- ++n3_,
- ++n4_);
- finished_ = true;
-}
-
-// Tests a successful ASSERT_PRED4 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(ASSERT_PRED4Test, FunctorOnUserTypeSuccess) {
- ASSERT_PRED4(PredFunctor4(),
- Bool(++n1_),
- Bool(++n2_),
- Bool(++n3_),
- Bool(++n4_));
- finished_ = true;
-}
-
-// Tests a failed ASSERT_PRED4 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(ASSERT_PRED4Test, FunctionOnBuiltInTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED4(PredFunction4Int,
- n1_++,
- n2_++,
- n3_++,
- n4_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed ASSERT_PRED4 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(ASSERT_PRED4Test, FunctionOnUserTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED4(PredFunction4Bool,
- Bool(n1_++),
- Bool(n2_++),
- Bool(n3_++),
- Bool(n4_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a failed ASSERT_PRED4 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(ASSERT_PRED4Test, FunctorOnBuiltInTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED4(PredFunctor4(),
- n1_++,
- n2_++,
- n3_++,
- n4_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed ASSERT_PRED4 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(ASSERT_PRED4Test, FunctorOnUserTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED4(PredFunctor4(),
- Bool(n1_++),
- Bool(n2_++),
- Bool(n3_++),
- Bool(n4_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a successful EXPECT_PRED_FORMAT4 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(EXPECT_PRED_FORMAT4Test, FunctionOnBuiltInTypeSuccess) {
- EXPECT_PRED_FORMAT4(PredFormatFunction4,
- ++n1_,
- ++n2_,
- ++n3_,
- ++n4_);
- finished_ = true;
-}
-
-// Tests a successful EXPECT_PRED_FORMAT4 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(EXPECT_PRED_FORMAT4Test, FunctionOnUserTypeSuccess) {
- EXPECT_PRED_FORMAT4(PredFormatFunction4,
- Bool(++n1_),
- Bool(++n2_),
- Bool(++n3_),
- Bool(++n4_));
- finished_ = true;
-}
-
-// Tests a successful EXPECT_PRED_FORMAT4 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(EXPECT_PRED_FORMAT4Test, FunctorOnBuiltInTypeSuccess) {
- EXPECT_PRED_FORMAT4(PredFormatFunctor4(),
- ++n1_,
- ++n2_,
- ++n3_,
- ++n4_);
- finished_ = true;
-}
-
-// Tests a successful EXPECT_PRED_FORMAT4 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(EXPECT_PRED_FORMAT4Test, FunctorOnUserTypeSuccess) {
- EXPECT_PRED_FORMAT4(PredFormatFunctor4(),
- Bool(++n1_),
- Bool(++n2_),
- Bool(++n3_),
- Bool(++n4_));
- finished_ = true;
-}
-
-// Tests a failed EXPECT_PRED_FORMAT4 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(EXPECT_PRED_FORMAT4Test, FunctionOnBuiltInTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED_FORMAT4(PredFormatFunction4,
- n1_++,
- n2_++,
- n3_++,
- n4_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed EXPECT_PRED_FORMAT4 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(EXPECT_PRED_FORMAT4Test, FunctionOnUserTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED_FORMAT4(PredFormatFunction4,
- Bool(n1_++),
- Bool(n2_++),
- Bool(n3_++),
- Bool(n4_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a failed EXPECT_PRED_FORMAT4 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(EXPECT_PRED_FORMAT4Test, FunctorOnBuiltInTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED_FORMAT4(PredFormatFunctor4(),
- n1_++,
- n2_++,
- n3_++,
- n4_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed EXPECT_PRED_FORMAT4 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(EXPECT_PRED_FORMAT4Test, FunctorOnUserTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED_FORMAT4(PredFormatFunctor4(),
- Bool(n1_++),
- Bool(n2_++),
- Bool(n3_++),
- Bool(n4_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a successful ASSERT_PRED_FORMAT4 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(ASSERT_PRED_FORMAT4Test, FunctionOnBuiltInTypeSuccess) {
- ASSERT_PRED_FORMAT4(PredFormatFunction4,
- ++n1_,
- ++n2_,
- ++n3_,
- ++n4_);
- finished_ = true;
-}
-
-// Tests a successful ASSERT_PRED_FORMAT4 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(ASSERT_PRED_FORMAT4Test, FunctionOnUserTypeSuccess) {
- ASSERT_PRED_FORMAT4(PredFormatFunction4,
- Bool(++n1_),
- Bool(++n2_),
- Bool(++n3_),
- Bool(++n4_));
- finished_ = true;
-}
-
-// Tests a successful ASSERT_PRED_FORMAT4 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(ASSERT_PRED_FORMAT4Test, FunctorOnBuiltInTypeSuccess) {
- ASSERT_PRED_FORMAT4(PredFormatFunctor4(),
- ++n1_,
- ++n2_,
- ++n3_,
- ++n4_);
- finished_ = true;
-}
-
-// Tests a successful ASSERT_PRED_FORMAT4 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(ASSERT_PRED_FORMAT4Test, FunctorOnUserTypeSuccess) {
- ASSERT_PRED_FORMAT4(PredFormatFunctor4(),
- Bool(++n1_),
- Bool(++n2_),
- Bool(++n3_),
- Bool(++n4_));
- finished_ = true;
-}
-
-// Tests a failed ASSERT_PRED_FORMAT4 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(ASSERT_PRED_FORMAT4Test, FunctionOnBuiltInTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED_FORMAT4(PredFormatFunction4,
- n1_++,
- n2_++,
- n3_++,
- n4_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed ASSERT_PRED_FORMAT4 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(ASSERT_PRED_FORMAT4Test, FunctionOnUserTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED_FORMAT4(PredFormatFunction4,
- Bool(n1_++),
- Bool(n2_++),
- Bool(n3_++),
- Bool(n4_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a failed ASSERT_PRED_FORMAT4 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(ASSERT_PRED_FORMAT4Test, FunctorOnBuiltInTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED_FORMAT4(PredFormatFunctor4(),
- n1_++,
- n2_++,
- n3_++,
- n4_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed ASSERT_PRED_FORMAT4 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(ASSERT_PRED_FORMAT4Test, FunctorOnUserTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED_FORMAT4(PredFormatFunctor4(),
- Bool(n1_++),
- Bool(n2_++),
- Bool(n3_++),
- Bool(n4_++));
- finished_ = true;
- }, "");
-}
-// Sample functions/functors for testing 5-ary predicate assertions.
-
-// A 5-ary predicate function.
-template <typename T1, typename T2, typename T3, typename T4, typename T5>
-bool PredFunction5(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5) {
- return v1 + v2 + v3 + v4 + v5 > 0;
-}
-
-// The following two functions are needed to circumvent a bug in
-// gcc 2.95.3, which sometimes has problem with the above template
-// function.
-bool PredFunction5Int(int v1, int v2, int v3, int v4, int v5) {
- return v1 + v2 + v3 + v4 + v5 > 0;
-}
-bool PredFunction5Bool(Bool v1, Bool v2, Bool v3, Bool v4, Bool v5) {
- return v1 + v2 + v3 + v4 + v5 > 0;
-}
-
-// A 5-ary predicate functor.
-struct PredFunctor5 {
- template <typename T1, typename T2, typename T3, typename T4, typename T5>
- bool operator()(const T1& v1,
- const T2& v2,
- const T3& v3,
- const T4& v4,
- const T5& v5) {
- return v1 + v2 + v3 + v4 + v5 > 0;
- }
-};
-
-// A 5-ary predicate-formatter function.
-template <typename T1, typename T2, typename T3, typename T4, typename T5>
-testing::AssertionResult PredFormatFunction5(const char* e1,
- const char* e2,
- const char* e3,
- const char* e4,
- const char* e5,
- const T1& v1,
- const T2& v2,
- const T3& v3,
- const T4& v4,
- const T5& v5) {
- if (PredFunction5(v1, v2, v3, v4, v5))
- return testing::AssertionSuccess();
-
- return testing::AssertionFailure()
- << e1 << " + " << e2 << " + " << e3 << " + " << e4 << " + " << e5
- << " is expected to be positive, but evaluates to "
- << v1 + v2 + v3 + v4 + v5 << ".";
-}
-
-// A 5-ary predicate-formatter functor.
-struct PredFormatFunctor5 {
- template <typename T1, typename T2, typename T3, typename T4, typename T5>
- testing::AssertionResult operator()(const char* e1,
- const char* e2,
- const char* e3,
- const char* e4,
- const char* e5,
- const T1& v1,
- const T2& v2,
- const T3& v3,
- const T4& v4,
- const T5& v5) const {
- return PredFormatFunction5(e1, e2, e3, e4, e5, v1, v2, v3, v4, v5);
- }
-};
-
-// Tests for {EXPECT|ASSERT}_PRED_FORMAT5.
-
-class Predicate5Test : public testing::Test {
- protected:
- virtual void SetUp() {
- expected_to_finish_ = true;
- finished_ = false;
- n1_ = n2_ = n3_ = n4_ = n5_ = 0;
- }
-
- virtual void TearDown() {
- // Verifies that each of the predicate's arguments was evaluated
- // exactly once.
- EXPECT_EQ(1, n1_) <<
- "The predicate assertion didn't evaluate argument 2 "
- "exactly once.";
- EXPECT_EQ(1, n2_) <<
- "The predicate assertion didn't evaluate argument 3 "
- "exactly once.";
- EXPECT_EQ(1, n3_) <<
- "The predicate assertion didn't evaluate argument 4 "
- "exactly once.";
- EXPECT_EQ(1, n4_) <<
- "The predicate assertion didn't evaluate argument 5 "
- "exactly once.";
- EXPECT_EQ(1, n5_) <<
- "The predicate assertion didn't evaluate argument 6 "
- "exactly once.";
-
- // Verifies that the control flow in the test function is expected.
- if (expected_to_finish_ && !finished_) {
- FAIL() << "The predicate assertion unexpactedly aborted the test.";
- } else if (!expected_to_finish_ && finished_) {
- FAIL() << "The failed predicate assertion didn't abort the test "
- "as expected.";
- }
- }
-
- // true iff the test function is expected to run to finish.
- static bool expected_to_finish_;
-
- // true iff the test function did run to finish.
- static bool finished_;
-
- static int n1_;
- static int n2_;
- static int n3_;
- static int n4_;
- static int n5_;
-};
-
-bool Predicate5Test::expected_to_finish_;
-bool Predicate5Test::finished_;
-int Predicate5Test::n1_;
-int Predicate5Test::n2_;
-int Predicate5Test::n3_;
-int Predicate5Test::n4_;
-int Predicate5Test::n5_;
-
-typedef Predicate5Test EXPECT_PRED_FORMAT5Test;
-typedef Predicate5Test ASSERT_PRED_FORMAT5Test;
-typedef Predicate5Test EXPECT_PRED5Test;
-typedef Predicate5Test ASSERT_PRED5Test;
-
-// Tests a successful EXPECT_PRED5 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(EXPECT_PRED5Test, FunctionOnBuiltInTypeSuccess) {
- EXPECT_PRED5(PredFunction5Int,
- ++n1_,
- ++n2_,
- ++n3_,
- ++n4_,
- ++n5_);
- finished_ = true;
-}
-
-// Tests a successful EXPECT_PRED5 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(EXPECT_PRED5Test, FunctionOnUserTypeSuccess) {
- EXPECT_PRED5(PredFunction5Bool,
- Bool(++n1_),
- Bool(++n2_),
- Bool(++n3_),
- Bool(++n4_),
- Bool(++n5_));
- finished_ = true;
-}
-
-// Tests a successful EXPECT_PRED5 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(EXPECT_PRED5Test, FunctorOnBuiltInTypeSuccess) {
- EXPECT_PRED5(PredFunctor5(),
- ++n1_,
- ++n2_,
- ++n3_,
- ++n4_,
- ++n5_);
- finished_ = true;
-}
-
-// Tests a successful EXPECT_PRED5 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(EXPECT_PRED5Test, FunctorOnUserTypeSuccess) {
- EXPECT_PRED5(PredFunctor5(),
- Bool(++n1_),
- Bool(++n2_),
- Bool(++n3_),
- Bool(++n4_),
- Bool(++n5_));
- finished_ = true;
-}
-
-// Tests a failed EXPECT_PRED5 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(EXPECT_PRED5Test, FunctionOnBuiltInTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED5(PredFunction5Int,
- n1_++,
- n2_++,
- n3_++,
- n4_++,
- n5_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed EXPECT_PRED5 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(EXPECT_PRED5Test, FunctionOnUserTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED5(PredFunction5Bool,
- Bool(n1_++),
- Bool(n2_++),
- Bool(n3_++),
- Bool(n4_++),
- Bool(n5_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a failed EXPECT_PRED5 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(EXPECT_PRED5Test, FunctorOnBuiltInTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED5(PredFunctor5(),
- n1_++,
- n2_++,
- n3_++,
- n4_++,
- n5_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed EXPECT_PRED5 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(EXPECT_PRED5Test, FunctorOnUserTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED5(PredFunctor5(),
- Bool(n1_++),
- Bool(n2_++),
- Bool(n3_++),
- Bool(n4_++),
- Bool(n5_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a successful ASSERT_PRED5 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(ASSERT_PRED5Test, FunctionOnBuiltInTypeSuccess) {
- ASSERT_PRED5(PredFunction5Int,
- ++n1_,
- ++n2_,
- ++n3_,
- ++n4_,
- ++n5_);
- finished_ = true;
-}
-
-// Tests a successful ASSERT_PRED5 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(ASSERT_PRED5Test, FunctionOnUserTypeSuccess) {
- ASSERT_PRED5(PredFunction5Bool,
- Bool(++n1_),
- Bool(++n2_),
- Bool(++n3_),
- Bool(++n4_),
- Bool(++n5_));
- finished_ = true;
-}
-
-// Tests a successful ASSERT_PRED5 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(ASSERT_PRED5Test, FunctorOnBuiltInTypeSuccess) {
- ASSERT_PRED5(PredFunctor5(),
- ++n1_,
- ++n2_,
- ++n3_,
- ++n4_,
- ++n5_);
- finished_ = true;
-}
-
-// Tests a successful ASSERT_PRED5 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(ASSERT_PRED5Test, FunctorOnUserTypeSuccess) {
- ASSERT_PRED5(PredFunctor5(),
- Bool(++n1_),
- Bool(++n2_),
- Bool(++n3_),
- Bool(++n4_),
- Bool(++n5_));
- finished_ = true;
-}
-
-// Tests a failed ASSERT_PRED5 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(ASSERT_PRED5Test, FunctionOnBuiltInTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED5(PredFunction5Int,
- n1_++,
- n2_++,
- n3_++,
- n4_++,
- n5_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed ASSERT_PRED5 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(ASSERT_PRED5Test, FunctionOnUserTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED5(PredFunction5Bool,
- Bool(n1_++),
- Bool(n2_++),
- Bool(n3_++),
- Bool(n4_++),
- Bool(n5_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a failed ASSERT_PRED5 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(ASSERT_PRED5Test, FunctorOnBuiltInTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED5(PredFunctor5(),
- n1_++,
- n2_++,
- n3_++,
- n4_++,
- n5_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed ASSERT_PRED5 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(ASSERT_PRED5Test, FunctorOnUserTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED5(PredFunctor5(),
- Bool(n1_++),
- Bool(n2_++),
- Bool(n3_++),
- Bool(n4_++),
- Bool(n5_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a successful EXPECT_PRED_FORMAT5 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(EXPECT_PRED_FORMAT5Test, FunctionOnBuiltInTypeSuccess) {
- EXPECT_PRED_FORMAT5(PredFormatFunction5,
- ++n1_,
- ++n2_,
- ++n3_,
- ++n4_,
- ++n5_);
- finished_ = true;
-}
-
-// Tests a successful EXPECT_PRED_FORMAT5 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(EXPECT_PRED_FORMAT5Test, FunctionOnUserTypeSuccess) {
- EXPECT_PRED_FORMAT5(PredFormatFunction5,
- Bool(++n1_),
- Bool(++n2_),
- Bool(++n3_),
- Bool(++n4_),
- Bool(++n5_));
- finished_ = true;
-}
-
-// Tests a successful EXPECT_PRED_FORMAT5 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(EXPECT_PRED_FORMAT5Test, FunctorOnBuiltInTypeSuccess) {
- EXPECT_PRED_FORMAT5(PredFormatFunctor5(),
- ++n1_,
- ++n2_,
- ++n3_,
- ++n4_,
- ++n5_);
- finished_ = true;
-}
-
-// Tests a successful EXPECT_PRED_FORMAT5 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(EXPECT_PRED_FORMAT5Test, FunctorOnUserTypeSuccess) {
- EXPECT_PRED_FORMAT5(PredFormatFunctor5(),
- Bool(++n1_),
- Bool(++n2_),
- Bool(++n3_),
- Bool(++n4_),
- Bool(++n5_));
- finished_ = true;
-}
-
-// Tests a failed EXPECT_PRED_FORMAT5 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(EXPECT_PRED_FORMAT5Test, FunctionOnBuiltInTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED_FORMAT5(PredFormatFunction5,
- n1_++,
- n2_++,
- n3_++,
- n4_++,
- n5_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed EXPECT_PRED_FORMAT5 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(EXPECT_PRED_FORMAT5Test, FunctionOnUserTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED_FORMAT5(PredFormatFunction5,
- Bool(n1_++),
- Bool(n2_++),
- Bool(n3_++),
- Bool(n4_++),
- Bool(n5_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a failed EXPECT_PRED_FORMAT5 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(EXPECT_PRED_FORMAT5Test, FunctorOnBuiltInTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED_FORMAT5(PredFormatFunctor5(),
- n1_++,
- n2_++,
- n3_++,
- n4_++,
- n5_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed EXPECT_PRED_FORMAT5 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(EXPECT_PRED_FORMAT5Test, FunctorOnUserTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED_FORMAT5(PredFormatFunctor5(),
- Bool(n1_++),
- Bool(n2_++),
- Bool(n3_++),
- Bool(n4_++),
- Bool(n5_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a successful ASSERT_PRED_FORMAT5 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(ASSERT_PRED_FORMAT5Test, FunctionOnBuiltInTypeSuccess) {
- ASSERT_PRED_FORMAT5(PredFormatFunction5,
- ++n1_,
- ++n2_,
- ++n3_,
- ++n4_,
- ++n5_);
- finished_ = true;
-}
-
-// Tests a successful ASSERT_PRED_FORMAT5 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(ASSERT_PRED_FORMAT5Test, FunctionOnUserTypeSuccess) {
- ASSERT_PRED_FORMAT5(PredFormatFunction5,
- Bool(++n1_),
- Bool(++n2_),
- Bool(++n3_),
- Bool(++n4_),
- Bool(++n5_));
- finished_ = true;
-}
-
-// Tests a successful ASSERT_PRED_FORMAT5 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(ASSERT_PRED_FORMAT5Test, FunctorOnBuiltInTypeSuccess) {
- ASSERT_PRED_FORMAT5(PredFormatFunctor5(),
- ++n1_,
- ++n2_,
- ++n3_,
- ++n4_,
- ++n5_);
- finished_ = true;
-}
-
-// Tests a successful ASSERT_PRED_FORMAT5 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(ASSERT_PRED_FORMAT5Test, FunctorOnUserTypeSuccess) {
- ASSERT_PRED_FORMAT5(PredFormatFunctor5(),
- Bool(++n1_),
- Bool(++n2_),
- Bool(++n3_),
- Bool(++n4_),
- Bool(++n5_));
- finished_ = true;
-}
-
-// Tests a failed ASSERT_PRED_FORMAT5 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(ASSERT_PRED_FORMAT5Test, FunctionOnBuiltInTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED_FORMAT5(PredFormatFunction5,
- n1_++,
- n2_++,
- n3_++,
- n4_++,
- n5_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed ASSERT_PRED_FORMAT5 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(ASSERT_PRED_FORMAT5Test, FunctionOnUserTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED_FORMAT5(PredFormatFunction5,
- Bool(n1_++),
- Bool(n2_++),
- Bool(n3_++),
- Bool(n4_++),
- Bool(n5_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a failed ASSERT_PRED_FORMAT5 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(ASSERT_PRED_FORMAT5Test, FunctorOnBuiltInTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED_FORMAT5(PredFormatFunctor5(),
- n1_++,
- n2_++,
- n3_++,
- n4_++,
- n5_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed ASSERT_PRED_FORMAT5 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(ASSERT_PRED_FORMAT5Test, FunctorOnUserTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED_FORMAT5(PredFormatFunctor5(),
- Bool(n1_++),
- Bool(n2_++),
- Bool(n3_++),
- Bool(n4_++),
- Bool(n5_++));
- finished_ = true;
- }, "");
-}
diff --git a/src/testing/gtest/test/gtest_prod_test.cc b/src/testing/gtest/test/gtest_prod_test.cc
deleted file mode 100644
index 060abce1..00000000
--- a/src/testing/gtest/test/gtest_prod_test.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-// Copyright 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-//
-// Unit test for include/gtest/gtest_prod.h.
-
-#include "gtest/gtest.h"
-#include "test/production.h"
-
-// Tests that private members can be accessed from a TEST declared as
-// a friend of the class.
-TEST(PrivateCodeTest, CanAccessPrivateMembers) {
- PrivateCode a;
- EXPECT_EQ(0, a.x_);
-
- a.set_x(1);
- EXPECT_EQ(1, a.x_);
-}
-
-typedef testing::Test PrivateCodeFixtureTest;
-
-// Tests that private members can be accessed from a TEST_F declared
-// as a friend of the class.
-TEST_F(PrivateCodeFixtureTest, CanAccessPrivateMembers) {
- PrivateCode a;
- EXPECT_EQ(0, a.x_);
-
- a.set_x(2);
- EXPECT_EQ(2, a.x_);
-}
diff --git a/src/testing/gtest/test/gtest_repeat_test.cc b/src/testing/gtest/test/gtest_repeat_test.cc
deleted file mode 100644
index 481012ad..00000000
--- a/src/testing/gtest/test/gtest_repeat_test.cc
+++ /dev/null
@@ -1,253 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-// Tests the --gtest_repeat=number flag.
-
-#include <stdlib.h>
-#include <iostream>
-#include "gtest/gtest.h"
-
-// Indicates that this translation unit is part of Google Test's
-// implementation. It must come before gtest-internal-inl.h is
-// included, or there will be a compiler error. This trick is to
-// prevent a user from accidentally including gtest-internal-inl.h in
-// his code.
-#define GTEST_IMPLEMENTATION_ 1
-#include "src/gtest-internal-inl.h"
-#undef GTEST_IMPLEMENTATION_
-
-namespace testing {
-
-GTEST_DECLARE_string_(death_test_style);
-GTEST_DECLARE_string_(filter);
-GTEST_DECLARE_int32_(repeat);
-
-} // namespace testing
-
-using testing::GTEST_FLAG(death_test_style);
-using testing::GTEST_FLAG(filter);
-using testing::GTEST_FLAG(repeat);
-
-namespace {
-
-// We need this when we are testing Google Test itself and therefore
-// cannot use Google Test assertions.
-#define GTEST_CHECK_INT_EQ_(expected, actual) \
- do {\
- const int expected_val = (expected);\
- const int actual_val = (actual);\
- if (::testing::internal::IsTrue(expected_val != actual_val)) {\
- ::std::cout << "Value of: " #actual "\n"\
- << " Actual: " << actual_val << "\n"\
- << "Expected: " #expected "\n"\
- << "Which is: " << expected_val << "\n";\
- ::testing::internal::posix::Abort();\
- }\
- } while (::testing::internal::AlwaysFalse())
-
-
-// Used for verifying that global environment set-up and tear-down are
-// inside the gtest_repeat loop.
-
-int g_environment_set_up_count = 0;
-int g_environment_tear_down_count = 0;
-
-class MyEnvironment : public testing::Environment {
- public:
- MyEnvironment() {}
- virtual void SetUp() { g_environment_set_up_count++; }
- virtual void TearDown() { g_environment_tear_down_count++; }
-};
-
-// A test that should fail.
-
-int g_should_fail_count = 0;
-
-TEST(FooTest, ShouldFail) {
- g_should_fail_count++;
- EXPECT_EQ(0, 1) << "Expected failure.";
-}
-
-// A test that should pass.
-
-int g_should_pass_count = 0;
-
-TEST(FooTest, ShouldPass) {
- g_should_pass_count++;
-}
-
-// A test that contains a thread-safe death test and a fast death
-// test. It should pass.
-
-int g_death_test_count = 0;
-
-TEST(BarDeathTest, ThreadSafeAndFast) {
- g_death_test_count++;
-
- GTEST_FLAG(death_test_style) = "threadsafe";
- EXPECT_DEATH_IF_SUPPORTED(::testing::internal::posix::Abort(), "");
-
- GTEST_FLAG(death_test_style) = "fast";
- EXPECT_DEATH_IF_SUPPORTED(::testing::internal::posix::Abort(), "");
-}
-
-#if GTEST_HAS_PARAM_TEST
-int g_param_test_count = 0;
-
-const int kNumberOfParamTests = 10;
-
-class MyParamTest : public testing::TestWithParam<int> {};
-
-TEST_P(MyParamTest, ShouldPass) {
- // TODO(vladl@google.com): Make parameter value checking robust
- // WRT order of tests.
- GTEST_CHECK_INT_EQ_(g_param_test_count % kNumberOfParamTests, GetParam());
- g_param_test_count++;
-}
-INSTANTIATE_TEST_CASE_P(MyParamSequence,
- MyParamTest,
- testing::Range(0, kNumberOfParamTests));
-#endif // GTEST_HAS_PARAM_TEST
-
-// Resets the count for each test.
-void ResetCounts() {
- g_environment_set_up_count = 0;
- g_environment_tear_down_count = 0;
- g_should_fail_count = 0;
- g_should_pass_count = 0;
- g_death_test_count = 0;
-#if GTEST_HAS_PARAM_TEST
- g_param_test_count = 0;
-#endif // GTEST_HAS_PARAM_TEST
-}
-
-// Checks that the count for each test is expected.
-void CheckCounts(int expected) {
- GTEST_CHECK_INT_EQ_(expected, g_environment_set_up_count);
- GTEST_CHECK_INT_EQ_(expected, g_environment_tear_down_count);
- GTEST_CHECK_INT_EQ_(expected, g_should_fail_count);
- GTEST_CHECK_INT_EQ_(expected, g_should_pass_count);
- GTEST_CHECK_INT_EQ_(expected, g_death_test_count);
-#if GTEST_HAS_PARAM_TEST
- GTEST_CHECK_INT_EQ_(expected * kNumberOfParamTests, g_param_test_count);
-#endif // GTEST_HAS_PARAM_TEST
-}
-
-// Tests the behavior of Google Test when --gtest_repeat is not specified.
-void TestRepeatUnspecified() {
- ResetCounts();
- GTEST_CHECK_INT_EQ_(1, RUN_ALL_TESTS());
- CheckCounts(1);
-}
-
-// Tests the behavior of Google Test when --gtest_repeat has the given value.
-void TestRepeat(int repeat) {
- GTEST_FLAG(repeat) = repeat;
-
- ResetCounts();
- GTEST_CHECK_INT_EQ_(repeat > 0 ? 1 : 0, RUN_ALL_TESTS());
- CheckCounts(repeat);
-}
-
-// Tests using --gtest_repeat when --gtest_filter specifies an empty
-// set of tests.
-void TestRepeatWithEmptyFilter(int repeat) {
- GTEST_FLAG(repeat) = repeat;
- GTEST_FLAG(filter) = "None";
-
- ResetCounts();
- GTEST_CHECK_INT_EQ_(0, RUN_ALL_TESTS());
- CheckCounts(0);
-}
-
-// Tests using --gtest_repeat when --gtest_filter specifies a set of
-// successful tests.
-void TestRepeatWithFilterForSuccessfulTests(int repeat) {
- GTEST_FLAG(repeat) = repeat;
- GTEST_FLAG(filter) = "*-*ShouldFail";
-
- ResetCounts();
- GTEST_CHECK_INT_EQ_(0, RUN_ALL_TESTS());
- GTEST_CHECK_INT_EQ_(repeat, g_environment_set_up_count);
- GTEST_CHECK_INT_EQ_(repeat, g_environment_tear_down_count);
- GTEST_CHECK_INT_EQ_(0, g_should_fail_count);
- GTEST_CHECK_INT_EQ_(repeat, g_should_pass_count);
- GTEST_CHECK_INT_EQ_(repeat, g_death_test_count);
-#if GTEST_HAS_PARAM_TEST
- GTEST_CHECK_INT_EQ_(repeat * kNumberOfParamTests, g_param_test_count);
-#endif // GTEST_HAS_PARAM_TEST
-}
-
-// Tests using --gtest_repeat when --gtest_filter specifies a set of
-// failed tests.
-void TestRepeatWithFilterForFailedTests(int repeat) {
- GTEST_FLAG(repeat) = repeat;
- GTEST_FLAG(filter) = "*ShouldFail";
-
- ResetCounts();
- GTEST_CHECK_INT_EQ_(1, RUN_ALL_TESTS());
- GTEST_CHECK_INT_EQ_(repeat, g_environment_set_up_count);
- GTEST_CHECK_INT_EQ_(repeat, g_environment_tear_down_count);
- GTEST_CHECK_INT_EQ_(repeat, g_should_fail_count);
- GTEST_CHECK_INT_EQ_(0, g_should_pass_count);
- GTEST_CHECK_INT_EQ_(0, g_death_test_count);
-#if GTEST_HAS_PARAM_TEST
- GTEST_CHECK_INT_EQ_(0, g_param_test_count);
-#endif // GTEST_HAS_PARAM_TEST
-}
-
-} // namespace
-
-int main(int argc, char **argv) {
- testing::InitGoogleTest(&argc, argv);
- testing::AddGlobalTestEnvironment(new MyEnvironment);
-
- TestRepeatUnspecified();
- TestRepeat(0);
- TestRepeat(1);
- TestRepeat(5);
-
- TestRepeatWithEmptyFilter(2);
- TestRepeatWithEmptyFilter(3);
-
- TestRepeatWithFilterForSuccessfulTests(3);
-
- TestRepeatWithFilterForFailedTests(4);
-
- // It would be nice to verify that the tests indeed loop forever
- // when GTEST_FLAG(repeat) is negative, but this test will be quite
- // complicated to write. Since this flag is for interactive
- // debugging only and doesn't affect the normal test result, such a
- // test would be an overkill.
-
- printf("PASS\n");
- return 0;
-}
diff --git a/src/testing/gtest/test/gtest_shuffle_test.py b/src/testing/gtest/test/gtest_shuffle_test.py
deleted file mode 100755
index d3e57809..00000000
--- a/src/testing/gtest/test/gtest_shuffle_test.py
+++ /dev/null
@@ -1,326 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2009 Google Inc. All Rights Reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-"""Verifies that test shuffling works."""
-
-__author__ = 'wan@google.com (Zhanyong Wan)'
-
-import os
-import gtest_test_utils
-
-# Command to run the gtest_shuffle_test_ program.
-COMMAND = gtest_test_utils.GetTestExecutablePath('gtest_shuffle_test_')
-
-# The environment variables for test sharding.
-TOTAL_SHARDS_ENV_VAR = 'GTEST_TOTAL_SHARDS'
-SHARD_INDEX_ENV_VAR = 'GTEST_SHARD_INDEX'
-
-TEST_FILTER = 'A*.A:A*.B:C*'
-
-ALL_TESTS = []
-ACTIVE_TESTS = []
-FILTERED_TESTS = []
-SHARDED_TESTS = []
-
-SHUFFLED_ALL_TESTS = []
-SHUFFLED_ACTIVE_TESTS = []
-SHUFFLED_FILTERED_TESTS = []
-SHUFFLED_SHARDED_TESTS = []
-
-
-def AlsoRunDisabledTestsFlag():
- return '--gtest_also_run_disabled_tests'
-
-
-def FilterFlag(test_filter):
- return '--gtest_filter=%s' % (test_filter,)
-
-
-def RepeatFlag(n):
- return '--gtest_repeat=%s' % (n,)
-
-
-def ShuffleFlag():
- return '--gtest_shuffle'
-
-
-def RandomSeedFlag(n):
- return '--gtest_random_seed=%s' % (n,)
-
-
-def RunAndReturnOutput(extra_env, args):
- """Runs the test program and returns its output."""
-
- environ_copy = os.environ.copy()
- environ_copy.update(extra_env)
-
- return gtest_test_utils.Subprocess([COMMAND] + args, env=environ_copy,
- capture_stderr=False).output
-
-
-def GetTestsForAllIterations(extra_env, args):
- """Runs the test program and returns a list of test lists.
-
- Args:
- extra_env: a map from environment variables to their values
- args: command line flags to pass to gtest_shuffle_test_
-
- Returns:
- A list where the i-th element is the list of tests run in the i-th
- test iteration.
- """
-
- test_iterations = []
- for line in RunAndReturnOutput(extra_env, args).split('\n'):
- if line.startswith('----'):
- tests = []
- test_iterations.append(tests)
- elif line.strip():
- tests.append(line.strip()) # 'TestCaseName.TestName'
-
- return test_iterations
-
-
-def GetTestCases(tests):
- """Returns a list of test cases in the given full test names.
-
- Args:
- tests: a list of full test names
-
- Returns:
- A list of test cases from 'tests', in their original order.
- Consecutive duplicates are removed.
- """
-
- test_cases = []
- for test in tests:
- test_case = test.split('.')[0]
- if not test_case in test_cases:
- test_cases.append(test_case)
-
- return test_cases
-
-
-def CalculateTestLists():
- """Calculates the list of tests run under different flags."""
-
- if not ALL_TESTS:
- ALL_TESTS.extend(
- GetTestsForAllIterations({}, [AlsoRunDisabledTestsFlag()])[0])
-
- if not ACTIVE_TESTS:
- ACTIVE_TESTS.extend(GetTestsForAllIterations({}, [])[0])
-
- if not FILTERED_TESTS:
- FILTERED_TESTS.extend(
- GetTestsForAllIterations({}, [FilterFlag(TEST_FILTER)])[0])
-
- if not SHARDED_TESTS:
- SHARDED_TESTS.extend(
- GetTestsForAllIterations({TOTAL_SHARDS_ENV_VAR: '3',
- SHARD_INDEX_ENV_VAR: '1'},
- [])[0])
-
- if not SHUFFLED_ALL_TESTS:
- SHUFFLED_ALL_TESTS.extend(GetTestsForAllIterations(
- {}, [AlsoRunDisabledTestsFlag(), ShuffleFlag(), RandomSeedFlag(1)])[0])
-
- if not SHUFFLED_ACTIVE_TESTS:
- SHUFFLED_ACTIVE_TESTS.extend(GetTestsForAllIterations(
- {}, [ShuffleFlag(), RandomSeedFlag(1)])[0])
-
- if not SHUFFLED_FILTERED_TESTS:
- SHUFFLED_FILTERED_TESTS.extend(GetTestsForAllIterations(
- {}, [ShuffleFlag(), RandomSeedFlag(1), FilterFlag(TEST_FILTER)])[0])
-
- if not SHUFFLED_SHARDED_TESTS:
- SHUFFLED_SHARDED_TESTS.extend(
- GetTestsForAllIterations({TOTAL_SHARDS_ENV_VAR: '3',
- SHARD_INDEX_ENV_VAR: '1'},
- [ShuffleFlag(), RandomSeedFlag(1)])[0])
-
-
-class GTestShuffleUnitTest(gtest_test_utils.TestCase):
- """Tests test shuffling."""
-
- def setUp(self):
- CalculateTestLists()
-
- def testShufflePreservesNumberOfTests(self):
- self.assertEqual(len(ALL_TESTS), len(SHUFFLED_ALL_TESTS))
- self.assertEqual(len(ACTIVE_TESTS), len(SHUFFLED_ACTIVE_TESTS))
- self.assertEqual(len(FILTERED_TESTS), len(SHUFFLED_FILTERED_TESTS))
- self.assertEqual(len(SHARDED_TESTS), len(SHUFFLED_SHARDED_TESTS))
-
- def testShuffleChangesTestOrder(self):
- self.assert_(SHUFFLED_ALL_TESTS != ALL_TESTS, SHUFFLED_ALL_TESTS)
- self.assert_(SHUFFLED_ACTIVE_TESTS != ACTIVE_TESTS, SHUFFLED_ACTIVE_TESTS)
- self.assert_(SHUFFLED_FILTERED_TESTS != FILTERED_TESTS,
- SHUFFLED_FILTERED_TESTS)
- self.assert_(SHUFFLED_SHARDED_TESTS != SHARDED_TESTS,
- SHUFFLED_SHARDED_TESTS)
-
- def testShuffleChangesTestCaseOrder(self):
- self.assert_(GetTestCases(SHUFFLED_ALL_TESTS) != GetTestCases(ALL_TESTS),
- GetTestCases(SHUFFLED_ALL_TESTS))
- self.assert_(
- GetTestCases(SHUFFLED_ACTIVE_TESTS) != GetTestCases(ACTIVE_TESTS),
- GetTestCases(SHUFFLED_ACTIVE_TESTS))
- self.assert_(
- GetTestCases(SHUFFLED_FILTERED_TESTS) != GetTestCases(FILTERED_TESTS),
- GetTestCases(SHUFFLED_FILTERED_TESTS))
- self.assert_(
- GetTestCases(SHUFFLED_SHARDED_TESTS) != GetTestCases(SHARDED_TESTS),
- GetTestCases(SHUFFLED_SHARDED_TESTS))
-
- def testShuffleDoesNotRepeatTest(self):
- for test in SHUFFLED_ALL_TESTS:
- self.assertEqual(1, SHUFFLED_ALL_TESTS.count(test),
- '%s appears more than once' % (test,))
- for test in SHUFFLED_ACTIVE_TESTS:
- self.assertEqual(1, SHUFFLED_ACTIVE_TESTS.count(test),
- '%s appears more than once' % (test,))
- for test in SHUFFLED_FILTERED_TESTS:
- self.assertEqual(1, SHUFFLED_FILTERED_TESTS.count(test),
- '%s appears more than once' % (test,))
- for test in SHUFFLED_SHARDED_TESTS:
- self.assertEqual(1, SHUFFLED_SHARDED_TESTS.count(test),
- '%s appears more than once' % (test,))
-
- def testShuffleDoesNotCreateNewTest(self):
- for test in SHUFFLED_ALL_TESTS:
- self.assert_(test in ALL_TESTS, '%s is an invalid test' % (test,))
- for test in SHUFFLED_ACTIVE_TESTS:
- self.assert_(test in ACTIVE_TESTS, '%s is an invalid test' % (test,))
- for test in SHUFFLED_FILTERED_TESTS:
- self.assert_(test in FILTERED_TESTS, '%s is an invalid test' % (test,))
- for test in SHUFFLED_SHARDED_TESTS:
- self.assert_(test in SHARDED_TESTS, '%s is an invalid test' % (test,))
-
- def testShuffleIncludesAllTests(self):
- for test in ALL_TESTS:
- self.assert_(test in SHUFFLED_ALL_TESTS, '%s is missing' % (test,))
- for test in ACTIVE_TESTS:
- self.assert_(test in SHUFFLED_ACTIVE_TESTS, '%s is missing' % (test,))
- for test in FILTERED_TESTS:
- self.assert_(test in SHUFFLED_FILTERED_TESTS, '%s is missing' % (test,))
- for test in SHARDED_TESTS:
- self.assert_(test in SHUFFLED_SHARDED_TESTS, '%s is missing' % (test,))
-
- def testShuffleLeavesDeathTestsAtFront(self):
- non_death_test_found = False
- for test in SHUFFLED_ACTIVE_TESTS:
- if 'DeathTest.' in test:
- self.assert_(not non_death_test_found,
- '%s appears after a non-death test' % (test,))
- else:
- non_death_test_found = True
-
- def _VerifyTestCasesDoNotInterleave(self, tests):
- test_cases = []
- for test in tests:
- [test_case, _] = test.split('.')
- if test_cases and test_cases[-1] != test_case:
- test_cases.append(test_case)
- self.assertEqual(1, test_cases.count(test_case),
- 'Test case %s is not grouped together in %s' %
- (test_case, tests))
-
- def testShuffleDoesNotInterleaveTestCases(self):
- self._VerifyTestCasesDoNotInterleave(SHUFFLED_ALL_TESTS)
- self._VerifyTestCasesDoNotInterleave(SHUFFLED_ACTIVE_TESTS)
- self._VerifyTestCasesDoNotInterleave(SHUFFLED_FILTERED_TESTS)
- self._VerifyTestCasesDoNotInterleave(SHUFFLED_SHARDED_TESTS)
-
- def testShuffleRestoresOrderAfterEachIteration(self):
- # Get the test lists in all 3 iterations, using random seed 1, 2,
- # and 3 respectively. Google Test picks a different seed in each
- # iteration, and this test depends on the current implementation
- # picking successive numbers. This dependency is not ideal, but
- # makes the test much easier to write.
- [tests_in_iteration1, tests_in_iteration2, tests_in_iteration3] = (
- GetTestsForAllIterations(
- {}, [ShuffleFlag(), RandomSeedFlag(1), RepeatFlag(3)]))
-
- # Make sure running the tests with random seed 1 gets the same
- # order as in iteration 1 above.
- [tests_with_seed1] = GetTestsForAllIterations(
- {}, [ShuffleFlag(), RandomSeedFlag(1)])
- self.assertEqual(tests_in_iteration1, tests_with_seed1)
-
- # Make sure running the tests with random seed 2 gets the same
- # order as in iteration 2 above. Success means that Google Test
- # correctly restores the test order before re-shuffling at the
- # beginning of iteration 2.
- [tests_with_seed2] = GetTestsForAllIterations(
- {}, [ShuffleFlag(), RandomSeedFlag(2)])
- self.assertEqual(tests_in_iteration2, tests_with_seed2)
-
- # Make sure running the tests with random seed 3 gets the same
- # order as in iteration 3 above. Success means that Google Test
- # correctly restores the test order before re-shuffling at the
- # beginning of iteration 3.
- [tests_with_seed3] = GetTestsForAllIterations(
- {}, [ShuffleFlag(), RandomSeedFlag(3)])
- self.assertEqual(tests_in_iteration3, tests_with_seed3)
-
- def testShuffleGeneratesNewOrderInEachIteration(self):
- [tests_in_iteration1, tests_in_iteration2, tests_in_iteration3] = (
- GetTestsForAllIterations(
- {}, [ShuffleFlag(), RandomSeedFlag(1), RepeatFlag(3)]))
-
- self.assert_(tests_in_iteration1 != tests_in_iteration2,
- tests_in_iteration1)
- self.assert_(tests_in_iteration1 != tests_in_iteration3,
- tests_in_iteration1)
- self.assert_(tests_in_iteration2 != tests_in_iteration3,
- tests_in_iteration2)
-
- def testShuffleShardedTestsPreservesPartition(self):
- # If we run M tests on N shards, the same M tests should be run in
- # total, regardless of the random seeds used by the shards.
- [tests1] = GetTestsForAllIterations({TOTAL_SHARDS_ENV_VAR: '3',
- SHARD_INDEX_ENV_VAR: '0'},
- [ShuffleFlag(), RandomSeedFlag(1)])
- [tests2] = GetTestsForAllIterations({TOTAL_SHARDS_ENV_VAR: '3',
- SHARD_INDEX_ENV_VAR: '1'},
- [ShuffleFlag(), RandomSeedFlag(20)])
- [tests3] = GetTestsForAllIterations({TOTAL_SHARDS_ENV_VAR: '3',
- SHARD_INDEX_ENV_VAR: '2'},
- [ShuffleFlag(), RandomSeedFlag(25)])
- sorted_sharded_tests = tests1 + tests2 + tests3
- sorted_sharded_tests.sort()
- sorted_active_tests = []
- sorted_active_tests.extend(ACTIVE_TESTS)
- sorted_active_tests.sort()
- self.assertEqual(sorted_active_tests, sorted_sharded_tests)
-
-if __name__ == '__main__':
- gtest_test_utils.Main()
diff --git a/src/testing/gtest/test/gtest_shuffle_test_.cc b/src/testing/gtest/test/gtest_shuffle_test_.cc
deleted file mode 100644
index 0752789e..00000000
--- a/src/testing/gtest/test/gtest_shuffle_test_.cc
+++ /dev/null
@@ -1,104 +0,0 @@
-// Copyright 2009, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-// Verifies that test shuffling works.
-
-#include "gtest/gtest.h"
-
-namespace {
-
-using ::testing::EmptyTestEventListener;
-using ::testing::InitGoogleTest;
-using ::testing::Message;
-using ::testing::Test;
-using ::testing::TestEventListeners;
-using ::testing::TestInfo;
-using ::testing::UnitTest;
-using ::testing::internal::String;
-using ::testing::internal::scoped_ptr;
-
-// The test methods are empty, as the sole purpose of this program is
-// to print the test names before/after shuffling.
-
-class A : public Test {};
-TEST_F(A, A) {}
-TEST_F(A, B) {}
-
-TEST(ADeathTest, A) {}
-TEST(ADeathTest, B) {}
-TEST(ADeathTest, C) {}
-
-TEST(B, A) {}
-TEST(B, B) {}
-TEST(B, C) {}
-TEST(B, DISABLED_D) {}
-TEST(B, DISABLED_E) {}
-
-TEST(BDeathTest, A) {}
-TEST(BDeathTest, B) {}
-
-TEST(C, A) {}
-TEST(C, B) {}
-TEST(C, C) {}
-TEST(C, DISABLED_D) {}
-
-TEST(CDeathTest, A) {}
-
-TEST(DISABLED_D, A) {}
-TEST(DISABLED_D, DISABLED_B) {}
-
-// This printer prints the full test names only, starting each test
-// iteration with a "----" marker.
-class TestNamePrinter : public EmptyTestEventListener {
- public:
- virtual void OnTestIterationStart(const UnitTest& /* unit_test */,
- int /* iteration */) {
- printf("----\n");
- }
-
- virtual void OnTestStart(const TestInfo& test_info) {
- printf("%s.%s\n", test_info.test_case_name(), test_info.name());
- }
-};
-
-} // namespace
-
-int main(int argc, char **argv) {
- InitGoogleTest(&argc, argv);
-
- // Replaces the default printer with TestNamePrinter, which prints
- // the test name only.
- TestEventListeners& listeners = UnitTest::GetInstance()->listeners();
- delete listeners.Release(listeners.default_result_printer());
- listeners.Append(new TestNamePrinter);
-
- return RUN_ALL_TESTS();
-}
diff --git a/src/testing/gtest/test/gtest_stress_test.cc b/src/testing/gtest/test/gtest_stress_test.cc
deleted file mode 100644
index 4e7d9bff..00000000
--- a/src/testing/gtest/test/gtest_stress_test.cc
+++ /dev/null
@@ -1,257 +0,0 @@
-// Copyright 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-// Tests that SCOPED_TRACE() and various Google Test assertions can be
-// used in a large number of threads concurrently.
-
-#include "gtest/gtest.h"
-
-#include <iostream>
-#include <vector>
-
-// We must define this macro in order to #include
-// gtest-internal-inl.h. This is how Google Test prevents a user from
-// accidentally depending on its internal implementation.
-#define GTEST_IMPLEMENTATION_ 1
-#include "src/gtest-internal-inl.h"
-#undef GTEST_IMPLEMENTATION_
-
-#if GTEST_IS_THREADSAFE
-
-namespace testing {
-namespace {
-
-using internal::Notification;
-using internal::String;
-using internal::TestPropertyKeyIs;
-using internal::ThreadWithParam;
-using internal::scoped_ptr;
-
-// In order to run tests in this file, for platforms where Google Test is
-// thread safe, implement ThreadWithParam. See the description of its API
-// in gtest-port.h, where it is defined for already supported platforms.
-
-// How many threads to create?
-const int kThreadCount = 50;
-
-String IdToKey(int id, const char* suffix) {
- Message key;
- key << "key_" << id << "_" << suffix;
- return key.GetString();
-}
-
-String IdToString(int id) {
- Message id_message;
- id_message << id;
- return id_message.GetString();
-}
-
-void ExpectKeyAndValueWereRecordedForId(
- const std::vector<TestProperty>& properties,
- int id, const char* suffix) {
- TestPropertyKeyIs matches_key(IdToKey(id, suffix).c_str());
- const std::vector<TestProperty>::const_iterator property =
- std::find_if(properties.begin(), properties.end(), matches_key);
- ASSERT_TRUE(property != properties.end())
- << "expecting " << suffix << " value for id " << id;
- EXPECT_STREQ(IdToString(id).c_str(), property->value());
-}
-
-// Calls a large number of Google Test assertions, where exactly one of them
-// will fail.
-void ManyAsserts(int id) {
- GTEST_LOG_(INFO) << "Thread #" << id << " running...";
-
- SCOPED_TRACE(Message() << "Thread #" << id);
-
- for (int i = 0; i < kThreadCount; i++) {
- SCOPED_TRACE(Message() << "Iteration #" << i);
-
- // A bunch of assertions that should succeed.
- EXPECT_TRUE(true);
- ASSERT_FALSE(false) << "This shouldn't fail.";
- EXPECT_STREQ("a", "a");
- ASSERT_LE(5, 6);
- EXPECT_EQ(i, i) << "This shouldn't fail.";
-
- // RecordProperty() should interact safely with other threads as well.
- // The shared_key forces property updates.
- Test::RecordProperty(IdToKey(id, "string").c_str(), IdToString(id).c_str());
- Test::RecordProperty(IdToKey(id, "int").c_str(), id);
- Test::RecordProperty("shared_key", IdToString(id).c_str());
-
- // This assertion should fail kThreadCount times per thread. It
- // is for testing whether Google Test can handle failed assertions in a
- // multi-threaded context.
- EXPECT_LT(i, 0) << "This should always fail.";
- }
-}
-
-void CheckTestFailureCount(int expected_failures) {
- const TestInfo* const info = UnitTest::GetInstance()->current_test_info();
- const TestResult* const result = info->result();
- GTEST_CHECK_(expected_failures == result->total_part_count())
- << "Logged " << result->total_part_count() << " failures "
- << " vs. " << expected_failures << " expected";
-}
-
-// Tests using SCOPED_TRACE() and Google Test assertions in many threads
-// concurrently.
-TEST(StressTest, CanUseScopedTraceAndAssertionsInManyThreads) {
- {
- scoped_ptr<ThreadWithParam<int> > threads[kThreadCount];
- Notification threads_can_start;
- for (int i = 0; i != kThreadCount; i++)
- threads[i].reset(new ThreadWithParam<int>(&ManyAsserts,
- i,
- &threads_can_start));
-
- threads_can_start.Notify();
-
- // Blocks until all the threads are done.
- for (int i = 0; i != kThreadCount; i++)
- threads[i]->Join();
- }
-
- // Ensures that kThreadCount*kThreadCount failures have been reported.
- const TestInfo* const info = UnitTest::GetInstance()->current_test_info();
- const TestResult* const result = info->result();
-
- std::vector<TestProperty> properties;
- // We have no access to the TestResult's list of properties but we can
- // copy them one by one.
- for (int i = 0; i < result->test_property_count(); ++i)
- properties.push_back(result->GetTestProperty(i));
-
- EXPECT_EQ(kThreadCount * 2 + 1, result->test_property_count())
- << "String and int values recorded on each thread, "
- << "as well as one shared_key";
- for (int i = 0; i < kThreadCount; ++i) {
- ExpectKeyAndValueWereRecordedForId(properties, i, "string");
- ExpectKeyAndValueWereRecordedForId(properties, i, "int");
- }
- CheckTestFailureCount(kThreadCount*kThreadCount);
-}
-
-void FailingThread(bool is_fatal) {
- if (is_fatal)
- FAIL() << "Fatal failure in some other thread. "
- << "(This failure is expected.)";
- else
- ADD_FAILURE() << "Non-fatal failure in some other thread. "
- << "(This failure is expected.)";
-}
-
-void GenerateFatalFailureInAnotherThread(bool is_fatal) {
- ThreadWithParam<bool> thread(&FailingThread, is_fatal, NULL);
- thread.Join();
-}
-
-TEST(NoFatalFailureTest, ExpectNoFatalFailureIgnoresFailuresInOtherThreads) {
- EXPECT_NO_FATAL_FAILURE(GenerateFatalFailureInAnotherThread(true));
- // We should only have one failure (the one from
- // GenerateFatalFailureInAnotherThread()), since the EXPECT_NO_FATAL_FAILURE
- // should succeed.
- CheckTestFailureCount(1);
-}
-
-void AssertNoFatalFailureIgnoresFailuresInOtherThreads() {
- ASSERT_NO_FATAL_FAILURE(GenerateFatalFailureInAnotherThread(true));
-}
-TEST(NoFatalFailureTest, AssertNoFatalFailureIgnoresFailuresInOtherThreads) {
- // Using a subroutine, to make sure, that the test continues.
- AssertNoFatalFailureIgnoresFailuresInOtherThreads();
- // We should only have one failure (the one from
- // GenerateFatalFailureInAnotherThread()), since the EXPECT_NO_FATAL_FAILURE
- // should succeed.
- CheckTestFailureCount(1);
-}
-
-TEST(FatalFailureTest, ExpectFatalFailureIgnoresFailuresInOtherThreads) {
- // This statement should fail, since the current thread doesn't generate a
- // fatal failure, only another one does.
- EXPECT_FATAL_FAILURE(GenerateFatalFailureInAnotherThread(true), "expected");
- CheckTestFailureCount(2);
-}
-
-TEST(FatalFailureOnAllThreadsTest, ExpectFatalFailureOnAllThreads) {
- // This statement should succeed, because failures in all threads are
- // considered.
- EXPECT_FATAL_FAILURE_ON_ALL_THREADS(
- GenerateFatalFailureInAnotherThread(true), "expected");
- CheckTestFailureCount(0);
- // We need to add a failure, because main() checks that there are failures.
- // But when only this test is run, we shouldn't have any failures.
- ADD_FAILURE() << "This is an expected non-fatal failure.";
-}
-
-TEST(NonFatalFailureTest, ExpectNonFatalFailureIgnoresFailuresInOtherThreads) {
- // This statement should fail, since the current thread doesn't generate a
- // fatal failure, only another one does.
- EXPECT_NONFATAL_FAILURE(GenerateFatalFailureInAnotherThread(false),
- "expected");
- CheckTestFailureCount(2);
-}
-
-TEST(NonFatalFailureOnAllThreadsTest, ExpectNonFatalFailureOnAllThreads) {
- // This statement should succeed, because failures in all threads are
- // considered.
- EXPECT_NONFATAL_FAILURE_ON_ALL_THREADS(
- GenerateFatalFailureInAnotherThread(false), "expected");
- CheckTestFailureCount(0);
- // We need to add a failure, because main() checks that there are failures,
- // But when only this test is run, we shouldn't have any failures.
- ADD_FAILURE() << "This is an expected non-fatal failure.";
-}
-
-} // namespace
-} // namespace testing
-
-int main(int argc, char **argv) {
- testing::InitGoogleTest(&argc, argv);
-
- const int result = RUN_ALL_TESTS(); // Expected to fail.
- GTEST_CHECK_(result == 1) << "RUN_ALL_TESTS() did not fail as expected";
-
- printf("\nPASS\n");
- return 0;
-}
-
-#else
-TEST(StressTest,
- DISABLED_ThreadSafetyTestsAreSkippedWhenGoogleTestIsNotThreadSafe) {
-}
-
-int main(int argc, char **argv) {
- testing::InitGoogleTest(&argc, argv);
- return RUN_ALL_TESTS();
-}
-#endif // GTEST_IS_THREADSAFE
diff --git a/src/testing/gtest/test/gtest_test_utils.py b/src/testing/gtest/test/gtest_test_utils.py
deleted file mode 100755
index 6dd8db4b..00000000
--- a/src/testing/gtest/test/gtest_test_utils.py
+++ /dev/null
@@ -1,305 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2006, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-"""Unit test utilities for Google C++ Testing Framework."""
-
-__author__ = 'wan@google.com (Zhanyong Wan)'
-
-import atexit
-import os
-import shutil
-import sys
-import tempfile
-import unittest
-_test_module = unittest
-
-# Suppresses the 'Import not at the top of the file' lint complaint.
-# pylint: disable-msg=C6204
-try:
- import subprocess
- _SUBPROCESS_MODULE_AVAILABLE = True
-except:
- import popen2
- _SUBPROCESS_MODULE_AVAILABLE = False
-# pylint: enable-msg=C6204
-
-GTEST_OUTPUT_VAR_NAME = 'GTEST_OUTPUT'
-
-IS_WINDOWS = os.name == 'nt'
-IS_CYGWIN = os.name == 'posix' and 'CYGWIN' in os.uname()[0]
-
-# Here we expose a class from a particular module, depending on the
-# environment. The comment suppresses the 'Invalid variable name' lint
-# complaint.
-TestCase = _test_module.TestCase # pylint: disable-msg=C6409
-
-# Initially maps a flag to its default value. After
-# _ParseAndStripGTestFlags() is called, maps a flag to its actual value.
-_flag_map = {'source_dir': os.path.dirname(sys.argv[0]),
- 'build_dir': os.path.dirname(sys.argv[0])}
-_gtest_flags_are_parsed = False
-
-
-def _ParseAndStripGTestFlags(argv):
- """Parses and strips Google Test flags from argv. This is idempotent."""
-
- # Suppresses the lint complaint about a global variable since we need it
- # here to maintain module-wide state.
- global _gtest_flags_are_parsed # pylint: disable-msg=W0603
- if _gtest_flags_are_parsed:
- return
-
- _gtest_flags_are_parsed = True
- for flag in _flag_map:
- # The environment variable overrides the default value.
- if flag.upper() in os.environ:
- _flag_map[flag] = os.environ[flag.upper()]
-
- # The command line flag overrides the environment variable.
- i = 1 # Skips the program name.
- while i < len(argv):
- prefix = '--' + flag + '='
- if argv[i].startswith(prefix):
- _flag_map[flag] = argv[i][len(prefix):]
- del argv[i]
- break
- else:
- # We don't increment i in case we just found a --gtest_* flag
- # and removed it from argv.
- i += 1
-
-
-def GetFlag(flag):
- """Returns the value of the given flag."""
-
- # In case GetFlag() is called before Main(), we always call
- # _ParseAndStripGTestFlags() here to make sure the --gtest_* flags
- # are parsed.
- _ParseAndStripGTestFlags(sys.argv)
-
- return _flag_map[flag]
-
-
-def GetSourceDir():
- """Returns the absolute path of the directory where the .py files are."""
-
- return os.path.abspath(GetFlag('source_dir'))
-
-
-def GetBuildDir():
- """Returns the absolute path of the directory where the test binaries are."""
-
- return os.path.abspath(GetFlag('build_dir'))
-
-
-_temp_dir = None
-
-def _RemoveTempDir():
- if _temp_dir:
- shutil.rmtree(_temp_dir, ignore_errors=True)
-
-atexit.register(_RemoveTempDir)
-
-
-def GetTempDir():
- """Returns a directory for temporary files."""
-
- global _temp_dir
- if not _temp_dir:
- _temp_dir = tempfile.mkdtemp()
- return _temp_dir
-
-
-def GetTestExecutablePath(executable_name, build_dir=None):
- """Returns the absolute path of the test binary given its name.
-
- The function will print a message and abort the program if the resulting file
- doesn't exist.
-
- Args:
- executable_name: name of the test binary that the test script runs.
- build_dir: directory where to look for executables, by default
- the result of GetBuildDir().
-
- Returns:
- The absolute path of the test binary.
- """
-
- path = os.path.abspath(os.path.join(build_dir or GetBuildDir(),
- executable_name))
- if (IS_WINDOWS or IS_CYGWIN) and not path.endswith('.exe'):
- path += '.exe'
-
- if not os.path.exists(path):
- message = (
- 'Unable to find the test binary. Please make sure to provide path\n'
- 'to the binary via the --build_dir flag or the BUILD_DIR\n'
- 'environment variable.')
- print >> sys.stderr, message
- sys.exit(1)
-
- return path
-
-
-def GetExitStatus(exit_code):
- """Returns the argument to exit(), or -1 if exit() wasn't called.
-
- Args:
- exit_code: the result value of os.system(command).
- """
-
- if os.name == 'nt':
- # On Windows, os.WEXITSTATUS() doesn't work and os.system() returns
- # the argument to exit() directly.
- return exit_code
- else:
- # On Unix, os.WEXITSTATUS() must be used to extract the exit status
- # from the result of os.system().
- if os.WIFEXITED(exit_code):
- return os.WEXITSTATUS(exit_code)
- else:
- return -1
-
-
-class Subprocess:
- def __init__(self, command, working_dir=None, capture_stderr=True, env=None):
- """Changes into a specified directory, if provided, and executes a command.
-
- Restores the old directory afterwards.
-
- Args:
- command: The command to run, in the form of sys.argv.
- working_dir: The directory to change into.
- capture_stderr: Determines whether to capture stderr in the output member
- or to discard it.
- env: Dictionary with environment to pass to the subprocess.
-
- Returns:
- An object that represents outcome of the executed process. It has the
- following attributes:
- terminated_by_signal True iff the child process has been terminated
- by a signal.
- signal Sygnal that terminated the child process.
- exited True iff the child process exited normally.
- exit_code The code with which the child process exited.
- output Child process's stdout and stderr output
- combined in a string.
- """
-
- # The subprocess module is the preferrable way of running programs
- # since it is available and behaves consistently on all platforms,
- # including Windows. But it is only available starting in python 2.4.
- # In earlier python versions, we revert to the popen2 module, which is
- # available in python 2.0 and later but doesn't provide required
- # functionality (Popen4) under Windows. This allows us to support Mac
- # OS X 10.4 Tiger, which has python 2.3 installed.
- if _SUBPROCESS_MODULE_AVAILABLE:
- if capture_stderr:
- stderr = subprocess.STDOUT
- else:
- stderr = subprocess.PIPE
-
- p = subprocess.Popen(command,
- stdout=subprocess.PIPE, stderr=stderr,
- cwd=working_dir, universal_newlines=True, env=env)
- # communicate returns a tuple with the file obect for the child's
- # output.
- self.output = p.communicate()[0]
- self._return_code = p.returncode
- else:
- old_dir = os.getcwd()
-
- def _ReplaceEnvDict(dest, src):
- # Changes made by os.environ.clear are not inheritable by child
- # processes until Python 2.6. To produce inheritable changes we have
- # to delete environment items with the del statement.
- for key in dest.keys():
- del dest[key]
- dest.update(src)
-
- # When 'env' is not None, backup the environment variables and replace
- # them with the passed 'env'. When 'env' is None, we simply use the
- # current 'os.environ' for compatibility with the subprocess.Popen
- # semantics used above.
- if env is not None:
- old_environ = os.environ.copy()
- _ReplaceEnvDict(os.environ, env)
-
- try:
- if working_dir is not None:
- os.chdir(working_dir)
- if capture_stderr:
- p = popen2.Popen4(command)
- else:
- p = popen2.Popen3(command)
- p.tochild.close()
- self.output = p.fromchild.read()
- ret_code = p.wait()
- finally:
- os.chdir(old_dir)
-
- # Restore the old environment variables
- # if they were replaced.
- if env is not None:
- _ReplaceEnvDict(os.environ, old_environ)
-
- # Converts ret_code to match the semantics of
- # subprocess.Popen.returncode.
- if os.WIFSIGNALED(ret_code):
- self._return_code = -os.WTERMSIG(ret_code)
- else: # os.WIFEXITED(ret_code) should return True here.
- self._return_code = os.WEXITSTATUS(ret_code)
-
- if self._return_code < 0:
- self.terminated_by_signal = True
- self.exited = False
- self.signal = -self._return_code
- else:
- self.terminated_by_signal = False
- self.exited = True
- self.exit_code = self._return_code
-
-
-def Main():
- """Runs the unit test."""
-
- # We must call _ParseAndStripGTestFlags() before calling
- # unittest.main(). Otherwise the latter will be confused by the
- # --gtest_* flags.
- _ParseAndStripGTestFlags(sys.argv)
- # The tested binaries should not be writing XML output files unless the
- # script explicitly instructs them to.
- # TODO(vladl@google.com): Move this into Subprocess when we implement
- # passing environment into it as a parameter.
- if GTEST_OUTPUT_VAR_NAME in os.environ:
- del os.environ[GTEST_OUTPUT_VAR_NAME]
-
- _test_module.main()
diff --git a/src/testing/gtest/test/gtest_throw_on_failure_ex_test.cc b/src/testing/gtest/test/gtest_throw_on_failure_ex_test.cc
deleted file mode 100644
index 8d46c76f..00000000
--- a/src/testing/gtest/test/gtest_throw_on_failure_ex_test.cc
+++ /dev/null
@@ -1,92 +0,0 @@
-// Copyright 2009, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-// Tests Google Test's throw-on-failure mode with exceptions enabled.
-
-#include "gtest/gtest.h"
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdexcept>
-
-// Prints the given failure message and exits the program with
-// non-zero. We use this instead of a Google Test assertion to
-// indicate a failure, as the latter is been tested and cannot be
-// relied on.
-void Fail(const char* msg) {
- printf("FAILURE: %s\n", msg);
- fflush(stdout);
- exit(1);
-}
-
-// Tests that an assertion failure throws a subclass of
-// std::runtime_error.
-void TestFailureThrowsRuntimeError() {
- testing::GTEST_FLAG(throw_on_failure) = true;
-
- // A successful assertion shouldn't throw.
- try {
- EXPECT_EQ(3, 3);
- } catch(...) {
- Fail("A successful assertion wrongfully threw.");
- }
-
- // A failed assertion should throw a subclass of std::runtime_error.
- try {
- EXPECT_EQ(2, 3) << "Expected failure";
- } catch(const std::runtime_error& e) {
- if (strstr(e.what(), "Expected failure") != NULL)
- return;
-
- printf("%s",
- "A failed assertion did throw an exception of the right type, "
- "but the message is incorrect. Instead of containing \"Expected "
- "failure\", it is:\n");
- Fail(e.what());
- } catch(...) {
- Fail("A failed assertion threw the wrong type of exception.");
- }
- Fail("A failed assertion should've thrown but didn't.");
-}
-
-int main(int argc, char** argv) {
- testing::InitGoogleTest(&argc, argv);
-
- // We want to ensure that people can use Google Test assertions in
- // other testing frameworks, as long as they initialize Google Test
- // properly and set the thrown-on-failure mode. Therefore, we don't
- // use Google Test's constructs for defining and running tests
- // (e.g. TEST and RUN_ALL_TESTS) here.
-
- TestFailureThrowsRuntimeError();
- return 0;
-}
diff --git a/src/testing/gtest/test/gtest_throw_on_failure_test.py b/src/testing/gtest/test/gtest_throw_on_failure_test.py
deleted file mode 100755
index 5678ffea..00000000
--- a/src/testing/gtest/test/gtest_throw_on_failure_test.py
+++ /dev/null
@@ -1,171 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2009, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-"""Tests Google Test's throw-on-failure mode with exceptions disabled.
-
-This script invokes gtest_throw_on_failure_test_ (a program written with
-Google Test) with different environments and command line flags.
-"""
-
-__author__ = 'wan@google.com (Zhanyong Wan)'
-
-import os
-import gtest_test_utils
-
-
-# Constants.
-
-# The command line flag for enabling/disabling the throw-on-failure mode.
-THROW_ON_FAILURE = 'gtest_throw_on_failure'
-
-# Path to the gtest_throw_on_failure_test_ program, compiled with
-# exceptions disabled.
-EXE_PATH = gtest_test_utils.GetTestExecutablePath(
- 'gtest_throw_on_failure_test_')
-
-
-# Utilities.
-
-
-def SetEnvVar(env_var, value):
- """Sets an environment variable to a given value; unsets it when the
- given value is None.
- """
-
- env_var = env_var.upper()
- if value is not None:
- os.environ[env_var] = value
- elif env_var in os.environ:
- del os.environ[env_var]
-
-
-def Run(command):
- """Runs a command; returns True/False if its exit code is/isn't 0."""
-
- print 'Running "%s". . .' % ' '.join(command)
- p = gtest_test_utils.Subprocess(command)
- return p.exited and p.exit_code == 0
-
-
-# The tests. TODO(wan@google.com): refactor the class to share common
-# logic with code in gtest_break_on_failure_unittest.py.
-class ThrowOnFailureTest(gtest_test_utils.TestCase):
- """Tests the throw-on-failure mode."""
-
- def RunAndVerify(self, env_var_value, flag_value, should_fail):
- """Runs gtest_throw_on_failure_test_ and verifies that it does
- (or does not) exit with a non-zero code.
-
- Args:
- env_var_value: value of the GTEST_BREAK_ON_FAILURE environment
- variable; None if the variable should be unset.
- flag_value: value of the --gtest_break_on_failure flag;
- None if the flag should not be present.
- should_fail: True iff the program is expected to fail.
- """
-
- SetEnvVar(THROW_ON_FAILURE, env_var_value)
-
- if env_var_value is None:
- env_var_value_msg = ' is not set'
- else:
- env_var_value_msg = '=' + env_var_value
-
- if flag_value is None:
- flag = ''
- elif flag_value == '0':
- flag = '--%s=0' % THROW_ON_FAILURE
- else:
- flag = '--%s' % THROW_ON_FAILURE
-
- command = [EXE_PATH]
- if flag:
- command.append(flag)
-
- if should_fail:
- should_or_not = 'should'
- else:
- should_or_not = 'should not'
-
- failed = not Run(command)
-
- SetEnvVar(THROW_ON_FAILURE, None)
-
- msg = ('when %s%s, an assertion failure in "%s" %s cause a non-zero '
- 'exit code.' %
- (THROW_ON_FAILURE, env_var_value_msg, ' '.join(command),
- should_or_not))
- self.assert_(failed == should_fail, msg)
-
- def testDefaultBehavior(self):
- """Tests the behavior of the default mode."""
-
- self.RunAndVerify(env_var_value=None, flag_value=None, should_fail=False)
-
- def testThrowOnFailureEnvVar(self):
- """Tests using the GTEST_THROW_ON_FAILURE environment variable."""
-
- self.RunAndVerify(env_var_value='0',
- flag_value=None,
- should_fail=False)
- self.RunAndVerify(env_var_value='1',
- flag_value=None,
- should_fail=True)
-
- def testThrowOnFailureFlag(self):
- """Tests using the --gtest_throw_on_failure flag."""
-
- self.RunAndVerify(env_var_value=None,
- flag_value='0',
- should_fail=False)
- self.RunAndVerify(env_var_value=None,
- flag_value='1',
- should_fail=True)
-
- def testThrowOnFailureFlagOverridesEnvVar(self):
- """Tests that --gtest_throw_on_failure overrides GTEST_THROW_ON_FAILURE."""
-
- self.RunAndVerify(env_var_value='0',
- flag_value='0',
- should_fail=False)
- self.RunAndVerify(env_var_value='0',
- flag_value='1',
- should_fail=True)
- self.RunAndVerify(env_var_value='1',
- flag_value='0',
- should_fail=False)
- self.RunAndVerify(env_var_value='1',
- flag_value='1',
- should_fail=True)
-
-
-if __name__ == '__main__':
- gtest_test_utils.Main()
diff --git a/src/testing/gtest/test/gtest_throw_on_failure_test_.cc b/src/testing/gtest/test/gtest_throw_on_failure_test_.cc
deleted file mode 100644
index 2b88fe3d..00000000
--- a/src/testing/gtest/test/gtest_throw_on_failure_test_.cc
+++ /dev/null
@@ -1,72 +0,0 @@
-// Copyright 2009, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-// Tests Google Test's throw-on-failure mode with exceptions disabled.
-//
-// This program must be compiled with exceptions disabled. It will be
-// invoked by gtest_throw_on_failure_test.py, and is expected to exit
-// with non-zero in the throw-on-failure mode or 0 otherwise.
-
-#include "gtest/gtest.h"
-
-#include <stdio.h> // for fflush, fprintf, NULL, etc.
-#include <stdlib.h> // for exit
-#include <exception> // for set_terminate
-
-// This terminate handler aborts the program using exit() rather than abort().
-// This avoids showing pop-ups on Windows systems and core dumps on Unix-like
-// ones.
-void TerminateHandler() {
- fprintf(stderr, "%s\n", "Unhandled C++ exception terminating the program.");
- fflush(NULL);
- exit(1);
-}
-
-int main(int argc, char** argv) {
-#if GTEST_HAS_EXCEPTIONS
- std::set_terminate(&TerminateHandler);
-#endif
- testing::InitGoogleTest(&argc, argv);
-
- // We want to ensure that people can use Google Test assertions in
- // other testing frameworks, as long as they initialize Google Test
- // properly and set the throw-on-failure mode. Therefore, we don't
- // use Google Test's constructs for defining and running tests
- // (e.g. TEST and RUN_ALL_TESTS) here.
-
- // In the throw-on-failure mode with exceptions disabled, this
- // assertion will cause the program to exit with a non-zero code.
- EXPECT_EQ(2, 3);
-
- // When not in the throw-on-failure mode, the control will reach
- // here.
- return 0;
-}
diff --git a/src/testing/gtest/test/gtest_uninitialized_test_.cc b/src/testing/gtest/test/gtest_uninitialized_test_.cc
deleted file mode 100644
index 44316987..00000000
--- a/src/testing/gtest/test/gtest_uninitialized_test_.cc
+++ /dev/null
@@ -1,43 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-#include "gtest/gtest.h"
-
-TEST(DummyTest, Dummy) {
- // This test doesn't verify anything. We just need it to create a
- // realistic stage for testing the behavior of Google Test when
- // RUN_ALL_TESTS() is called without testing::InitGoogleTest() being
- // called first.
-}
-
-int main() {
- return RUN_ALL_TESTS();
-}
diff --git a/src/testing/gtest/test/gtest_unittest.cc b/src/testing/gtest/test/gtest_unittest.cc
deleted file mode 100644
index e61f7919..00000000
--- a/src/testing/gtest/test/gtest_unittest.cc
+++ /dev/null
@@ -1,7557 +0,0 @@
-// Copyright 2005, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-//
-// Tests for Google Test itself. This verifies that the basic constructs of
-// Google Test work.
-
-#include "gtest/gtest.h"
-
-// Verifies that the command line flag variables can be accessed
-// in code once <gtest/gtest.h> has been #included.
-// Do not move it after other #includes.
-TEST(CommandLineFlagsTest, CanBeAccessedInCodeOnceGTestHIsIncluded) {
- bool dummy = testing::GTEST_FLAG(also_run_disabled_tests)
- || testing::GTEST_FLAG(break_on_failure)
- || testing::GTEST_FLAG(catch_exceptions)
- || testing::GTEST_FLAG(color) != "unknown"
- || testing::GTEST_FLAG(filter) != "unknown"
- || testing::GTEST_FLAG(list_tests)
- || testing::GTEST_FLAG(output) != "unknown"
- || testing::GTEST_FLAG(print_time)
- || testing::GTEST_FLAG(random_seed)
- || testing::GTEST_FLAG(repeat) > 0
- || testing::GTEST_FLAG(show_internal_stack_frames)
- || testing::GTEST_FLAG(shuffle)
- || testing::GTEST_FLAG(stack_trace_depth) > 0
- || testing::GTEST_FLAG(stream_result_to) != "unknown"
- || testing::GTEST_FLAG(throw_on_failure);
- EXPECT_TRUE(dummy || !dummy); // Suppresses warning that dummy is unused.
-}
-
-#include <limits.h> // For INT_MAX.
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-
-#include <map>
-#include <vector>
-#include <ostream>
-
-#include "gtest/gtest-spi.h"
-
-// Indicates that this translation unit is part of Google Test's
-// implementation. It must come before gtest-internal-inl.h is
-// included, or there will be a compiler error. This trick is to
-// prevent a user from accidentally including gtest-internal-inl.h in
-// his code.
-#define GTEST_IMPLEMENTATION_ 1
-#include "src/gtest-internal-inl.h"
-#undef GTEST_IMPLEMENTATION_
-
-namespace testing {
-namespace internal {
-
-// Provides access to otherwise private parts of the TestEventListeners class
-// that are needed to test it.
-class TestEventListenersAccessor {
- public:
- static TestEventListener* GetRepeater(TestEventListeners* listeners) {
- return listeners->repeater();
- }
-
- static void SetDefaultResultPrinter(TestEventListeners* listeners,
- TestEventListener* listener) {
- listeners->SetDefaultResultPrinter(listener);
- }
- static void SetDefaultXmlGenerator(TestEventListeners* listeners,
- TestEventListener* listener) {
- listeners->SetDefaultXmlGenerator(listener);
- }
-
- static bool EventForwardingEnabled(const TestEventListeners& listeners) {
- return listeners.EventForwardingEnabled();
- }
-
- static void SuppressEventForwarding(TestEventListeners* listeners) {
- listeners->SuppressEventForwarding();
- }
-};
-
-} // namespace internal
-} // namespace testing
-
-using testing::AssertionFailure;
-using testing::AssertionResult;
-using testing::AssertionSuccess;
-using testing::DoubleLE;
-using testing::EmptyTestEventListener;
-using testing::FloatLE;
-using testing::GTEST_FLAG(also_run_disabled_tests);
-using testing::GTEST_FLAG(break_on_failure);
-using testing::GTEST_FLAG(catch_exceptions);
-using testing::GTEST_FLAG(color);
-using testing::GTEST_FLAG(death_test_use_fork);
-using testing::GTEST_FLAG(filter);
-using testing::GTEST_FLAG(list_tests);
-using testing::GTEST_FLAG(output);
-using testing::GTEST_FLAG(print_time);
-using testing::GTEST_FLAG(random_seed);
-using testing::GTEST_FLAG(repeat);
-using testing::GTEST_FLAG(show_internal_stack_frames);
-using testing::GTEST_FLAG(shuffle);
-using testing::GTEST_FLAG(stack_trace_depth);
-using testing::GTEST_FLAG(stream_result_to);
-using testing::GTEST_FLAG(throw_on_failure);
-using testing::IsNotSubstring;
-using testing::IsSubstring;
-using testing::Message;
-using testing::ScopedFakeTestPartResultReporter;
-using testing::StaticAssertTypeEq;
-using testing::Test;
-using testing::TestCase;
-using testing::TestEventListeners;
-using testing::TestPartResult;
-using testing::TestPartResultArray;
-using testing::TestProperty;
-using testing::TestResult;
-using testing::TimeInMillis;
-using testing::UnitTest;
-using testing::kMaxStackTraceDepth;
-using testing::internal::AddReference;
-using testing::internal::AlwaysFalse;
-using testing::internal::AlwaysTrue;
-using testing::internal::AppendUserMessage;
-using testing::internal::ArrayAwareFind;
-using testing::internal::ArrayEq;
-using testing::internal::CodePointToUtf8;
-using testing::internal::CompileAssertTypesEqual;
-using testing::internal::CopyArray;
-using testing::internal::CountIf;
-using testing::internal::EqFailure;
-using testing::internal::FloatingPoint;
-using testing::internal::ForEach;
-using testing::internal::FormatEpochTimeInMillisAsIso8601;
-using testing::internal::FormatTimeInMillisAsSeconds;
-using testing::internal::GTestFlagSaver;
-using testing::internal::GetCurrentOsStackTraceExceptTop;
-using testing::internal::GetElementOr;
-using testing::internal::GetNextRandomSeed;
-using testing::internal::GetRandomSeedFromFlag;
-using testing::internal::GetTestTypeId;
-using testing::internal::GetTimeInMillis;
-using testing::internal::GetTypeId;
-using testing::internal::GetUnitTestImpl;
-using testing::internal::ImplicitlyConvertible;
-using testing::internal::Int32;
-using testing::internal::Int32FromEnvOrDie;
-using testing::internal::IsAProtocolMessage;
-using testing::internal::IsContainer;
-using testing::internal::IsContainerTest;
-using testing::internal::IsNotContainer;
-using testing::internal::NativeArray;
-using testing::internal::ParseInt32Flag;
-using testing::internal::RemoveConst;
-using testing::internal::RemoveReference;
-using testing::internal::ShouldRunTestOnShard;
-using testing::internal::ShouldShard;
-using testing::internal::ShouldUseColor;
-using testing::internal::Shuffle;
-using testing::internal::ShuffleRange;
-using testing::internal::SkipPrefix;
-using testing::internal::StreamableToString;
-using testing::internal::String;
-using testing::internal::TestEventListenersAccessor;
-using testing::internal::TestResultAccessor;
-using testing::internal::UInt32;
-using testing::internal::WideStringToUtf8;
-using testing::internal::kCopy;
-using testing::internal::kMaxRandomSeed;
-using testing::internal::kReference;
-using testing::internal::kTestTypeIdInGoogleTest;
-using testing::internal::scoped_ptr;
-
-#if GTEST_HAS_STREAM_REDIRECTION
-using testing::internal::CaptureStdout;
-using testing::internal::GetCapturedStdout;
-#endif
-
-#if GTEST_IS_THREADSAFE
-using testing::internal::ThreadWithParam;
-#endif
-
-class TestingVector : public std::vector<int> {
-};
-
-::std::ostream& operator<<(::std::ostream& os,
- const TestingVector& vector) {
- os << "{ ";
- for (size_t i = 0; i < vector.size(); i++) {
- os << vector[i] << " ";
- }
- os << "}";
- return os;
-}
-
-// This line tests that we can define tests in an unnamed namespace.
-namespace {
-
-TEST(GetRandomSeedFromFlagTest, HandlesZero) {
- const int seed = GetRandomSeedFromFlag(0);
- EXPECT_LE(1, seed);
- EXPECT_LE(seed, static_cast<int>(kMaxRandomSeed));
-}
-
-TEST(GetRandomSeedFromFlagTest, PreservesValidSeed) {
- EXPECT_EQ(1, GetRandomSeedFromFlag(1));
- EXPECT_EQ(2, GetRandomSeedFromFlag(2));
- EXPECT_EQ(kMaxRandomSeed - 1, GetRandomSeedFromFlag(kMaxRandomSeed - 1));
- EXPECT_EQ(static_cast<int>(kMaxRandomSeed),
- GetRandomSeedFromFlag(kMaxRandomSeed));
-}
-
-TEST(GetRandomSeedFromFlagTest, NormalizesInvalidSeed) {
- const int seed1 = GetRandomSeedFromFlag(-1);
- EXPECT_LE(1, seed1);
- EXPECT_LE(seed1, static_cast<int>(kMaxRandomSeed));
-
- const int seed2 = GetRandomSeedFromFlag(kMaxRandomSeed + 1);
- EXPECT_LE(1, seed2);
- EXPECT_LE(seed2, static_cast<int>(kMaxRandomSeed));
-}
-
-TEST(GetNextRandomSeedTest, WorksForValidInput) {
- EXPECT_EQ(2, GetNextRandomSeed(1));
- EXPECT_EQ(3, GetNextRandomSeed(2));
- EXPECT_EQ(static_cast<int>(kMaxRandomSeed),
- GetNextRandomSeed(kMaxRandomSeed - 1));
- EXPECT_EQ(1, GetNextRandomSeed(kMaxRandomSeed));
-
- // We deliberately don't test GetNextRandomSeed() with invalid
- // inputs, as that requires death tests, which are expensive. This
- // is fine as GetNextRandomSeed() is internal and has a
- // straightforward definition.
-}
-
-static void ClearCurrentTestPartResults() {
- TestResultAccessor::ClearTestPartResults(
- GetUnitTestImpl()->current_test_result());
-}
-
-// Tests GetTypeId.
-
-TEST(GetTypeIdTest, ReturnsSameValueForSameType) {
- EXPECT_EQ(GetTypeId<int>(), GetTypeId<int>());
- EXPECT_EQ(GetTypeId<Test>(), GetTypeId<Test>());
-}
-
-class SubClassOfTest : public Test {};
-class AnotherSubClassOfTest : public Test {};
-
-TEST(GetTypeIdTest, ReturnsDifferentValuesForDifferentTypes) {
- EXPECT_NE(GetTypeId<int>(), GetTypeId<const int>());
- EXPECT_NE(GetTypeId<int>(), GetTypeId<char>());
- EXPECT_NE(GetTypeId<int>(), GetTestTypeId());
- EXPECT_NE(GetTypeId<SubClassOfTest>(), GetTestTypeId());
- EXPECT_NE(GetTypeId<AnotherSubClassOfTest>(), GetTestTypeId());
- EXPECT_NE(GetTypeId<AnotherSubClassOfTest>(), GetTypeId<SubClassOfTest>());
-}
-
-// Verifies that GetTestTypeId() returns the same value, no matter it
-// is called from inside Google Test or outside of it.
-TEST(GetTestTypeIdTest, ReturnsTheSameValueInsideOrOutsideOfGoogleTest) {
- EXPECT_EQ(kTestTypeIdInGoogleTest, GetTestTypeId());
-}
-
-// Tests FormatTimeInMillisAsSeconds().
-
-TEST(FormatTimeInMillisAsSecondsTest, FormatsZero) {
- EXPECT_EQ("0", FormatTimeInMillisAsSeconds(0));
-}
-
-TEST(FormatTimeInMillisAsSecondsTest, FormatsPositiveNumber) {
- EXPECT_EQ("0.003", FormatTimeInMillisAsSeconds(3));
- EXPECT_EQ("0.01", FormatTimeInMillisAsSeconds(10));
- EXPECT_EQ("0.2", FormatTimeInMillisAsSeconds(200));
- EXPECT_EQ("1.2", FormatTimeInMillisAsSeconds(1200));
- EXPECT_EQ("3", FormatTimeInMillisAsSeconds(3000));
-}
-
-TEST(FormatTimeInMillisAsSecondsTest, FormatsNegativeNumber) {
- EXPECT_EQ("-0.003", FormatTimeInMillisAsSeconds(-3));
- EXPECT_EQ("-0.01", FormatTimeInMillisAsSeconds(-10));
- EXPECT_EQ("-0.2", FormatTimeInMillisAsSeconds(-200));
- EXPECT_EQ("-1.2", FormatTimeInMillisAsSeconds(-1200));
- EXPECT_EQ("-3", FormatTimeInMillisAsSeconds(-3000));
-}
-
-// Tests FormatEpochTimeInMillisAsIso8601(). The correctness of conversion
-// for particular dates below was verified in Python using
-// datetime.datetime.fromutctimestamp(<timetamp>/1000).
-
-// FormatEpochTimeInMillisAsIso8601 depends on the current timezone, so we
-// have to set up a particular timezone to obtain predictable results.
-class FormatEpochTimeInMillisAsIso8601Test : public Test {
- public:
- // On Cygwin, GCC doesn't allow unqualified integer literals to exceed
- // 32 bits, even when 64-bit integer types are available. We have to
- // force the constants to have a 64-bit type here.
- static const TimeInMillis kMillisPerSec = 1000;
-
- private:
- virtual void SetUp() {
- saved_tz_ = NULL;
-#if _MSC_VER
-# pragma warning(push) // Saves the current warning state.
-# pragma warning(disable:4996) // Temporarily disables warning 4996
- // (function or variable may be unsafe
- // for getenv, function is deprecated for
- // strdup).
- if (getenv("TZ"))
- saved_tz_ = strdup(getenv("TZ"));
-# pragma warning(pop) // Restores the warning state again.
-#else
- if (getenv("TZ"))
- saved_tz_ = strdup(getenv("TZ"));
-#endif
-
- // Set up the time zone for FormatEpochTimeInMillisAsIso8601 to use. We
- // cannot use the local time zone because the function's output depends
- // on the time zone.
- SetTimeZone("UTC+00");
- }
-
- virtual void TearDown() {
- SetTimeZone(saved_tz_);
- free(const_cast<char*>(saved_tz_));
- saved_tz_ = NULL;
- }
-
- static void SetTimeZone(const char* time_zone) {
- // tzset() distinguishes between the TZ variable being present and empty
- // and not being present, so we have to consider the case of time_zone
- // being NULL.
-#if _MSC_VER
- // ...Unless it's MSVC, whose standard library's _putenv doesn't
- // distinguish between an empty and a missing variable.
- const std::string env_var =
- std::string("TZ=") + (time_zone ? time_zone : "");
- _putenv(env_var.c_str());
-# pragma warning(push) // Saves the current warning state.
-# pragma warning(disable:4996) // Temporarily disables warning 4996
- // (function is deprecated).
- tzset();
-# pragma warning(pop) // Restores the warning state again.
-#else
- if (time_zone) {
- setenv(("TZ"), time_zone, 1);
- } else {
- unsetenv("TZ");
- }
- tzset();
-#endif
- }
-
- const char* saved_tz_;
-};
-
-const TimeInMillis FormatEpochTimeInMillisAsIso8601Test::kMillisPerSec;
-
-TEST_F(FormatEpochTimeInMillisAsIso8601Test, PrintsTwoDigitSegments) {
- EXPECT_EQ("2011-10-31T18:52:42",
- FormatEpochTimeInMillisAsIso8601(1320087162 * kMillisPerSec));
-}
-
-TEST_F(FormatEpochTimeInMillisAsIso8601Test, MillisecondsDoNotAffectResult) {
- EXPECT_EQ(
- "2011-10-31T18:52:42",
- FormatEpochTimeInMillisAsIso8601(1320087162 * kMillisPerSec + 234));
-}
-
-TEST_F(FormatEpochTimeInMillisAsIso8601Test, PrintsLeadingZeroes) {
- EXPECT_EQ("2011-09-03T05:07:02",
- FormatEpochTimeInMillisAsIso8601(1315026422 * kMillisPerSec));
-}
-
-TEST_F(FormatEpochTimeInMillisAsIso8601Test, Prints24HourTime) {
- EXPECT_EQ("2011-09-28T17:08:22",
- FormatEpochTimeInMillisAsIso8601(1317229702 * kMillisPerSec));
-}
-
-TEST_F(FormatEpochTimeInMillisAsIso8601Test, PrintsEpochStart) {
- EXPECT_EQ("1970-01-01T00:00:00", FormatEpochTimeInMillisAsIso8601(0));
-}
-
-#if GTEST_CAN_COMPARE_NULL
-
-# ifdef __BORLANDC__
-// Silences warnings: "Condition is always true", "Unreachable code"
-# pragma option push -w-ccc -w-rch
-# endif
-
-// Tests that GTEST_IS_NULL_LITERAL_(x) is true when x is a null
-// pointer literal.
-TEST(NullLiteralTest, IsTrueForNullLiterals) {
- EXPECT_TRUE(GTEST_IS_NULL_LITERAL_(NULL));
- EXPECT_TRUE(GTEST_IS_NULL_LITERAL_(0));
- EXPECT_TRUE(GTEST_IS_NULL_LITERAL_(0U));
- EXPECT_TRUE(GTEST_IS_NULL_LITERAL_(0L));
-
-# ifndef __BORLANDC__
-
- // Some compilers may fail to detect some null pointer literals;
- // as long as users of the framework don't use such literals, this
- // is harmless.
- EXPECT_TRUE(GTEST_IS_NULL_LITERAL_(1 - 1));
-
-# endif
-}
-
-// Tests that GTEST_IS_NULL_LITERAL_(x) is false when x is not a null
-// pointer literal.
-TEST(NullLiteralTest, IsFalseForNonNullLiterals) {
- EXPECT_FALSE(GTEST_IS_NULL_LITERAL_(1));
- EXPECT_FALSE(GTEST_IS_NULL_LITERAL_(0.0));
- EXPECT_FALSE(GTEST_IS_NULL_LITERAL_('a'));
- EXPECT_FALSE(GTEST_IS_NULL_LITERAL_(static_cast<void*>(NULL)));
-}
-
-# ifdef __BORLANDC__
-// Restores warnings after previous "#pragma option push" suppressed them.
-# pragma option pop
-# endif
-
-#endif // GTEST_CAN_COMPARE_NULL
-//
-// Tests CodePointToUtf8().
-
-// Tests that the NUL character L'\0' is encoded correctly.
-TEST(CodePointToUtf8Test, CanEncodeNul) {
- char buffer[32];
- EXPECT_STREQ("", CodePointToUtf8(L'\0', buffer));
-}
-
-// Tests that ASCII characters are encoded correctly.
-TEST(CodePointToUtf8Test, CanEncodeAscii) {
- char buffer[32];
- EXPECT_STREQ("a", CodePointToUtf8(L'a', buffer));
- EXPECT_STREQ("Z", CodePointToUtf8(L'Z', buffer));
- EXPECT_STREQ("&", CodePointToUtf8(L'&', buffer));
- EXPECT_STREQ("\x7F", CodePointToUtf8(L'\x7F', buffer));
-}
-
-// Tests that Unicode code-points that have 8 to 11 bits are encoded
-// as 110xxxxx 10xxxxxx.
-TEST(CodePointToUtf8Test, CanEncode8To11Bits) {
- char buffer[32];
- // 000 1101 0011 => 110-00011 10-010011
- EXPECT_STREQ("\xC3\x93", CodePointToUtf8(L'\xD3', buffer));
-
- // 101 0111 0110 => 110-10101 10-110110
- // Some compilers (e.g., GCC on MinGW) cannot handle non-ASCII codepoints
- // in wide strings and wide chars. In order to accomodate them, we have to
- // introduce such character constants as integers.
- EXPECT_STREQ("\xD5\xB6",
- CodePointToUtf8(static_cast<wchar_t>(0x576), buffer));
-}
-
-// Tests that Unicode code-points that have 12 to 16 bits are encoded
-// as 1110xxxx 10xxxxxx 10xxxxxx.
-TEST(CodePointToUtf8Test, CanEncode12To16Bits) {
- char buffer[32];
- // 0000 1000 1101 0011 => 1110-0000 10-100011 10-010011
- EXPECT_STREQ("\xE0\xA3\x93",
- CodePointToUtf8(static_cast<wchar_t>(0x8D3), buffer));
-
- // 1100 0111 0100 1101 => 1110-1100 10-011101 10-001101
- EXPECT_STREQ("\xEC\x9D\x8D",
- CodePointToUtf8(static_cast<wchar_t>(0xC74D), buffer));
-}
-
-#if !GTEST_WIDE_STRING_USES_UTF16_
-// Tests in this group require a wchar_t to hold > 16 bits, and thus
-// are skipped on Windows, Cygwin, and Symbian, where a wchar_t is
-// 16-bit wide. This code may not compile on those systems.
-
-// Tests that Unicode code-points that have 17 to 21 bits are encoded
-// as 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx.
-TEST(CodePointToUtf8Test, CanEncode17To21Bits) {
- char buffer[32];
- // 0 0001 0000 1000 1101 0011 => 11110-000 10-010000 10-100011 10-010011
- EXPECT_STREQ("\xF0\x90\xA3\x93", CodePointToUtf8(L'\x108D3', buffer));
-
- // 0 0001 0000 0100 0000 0000 => 11110-000 10-010000 10-010000 10-000000
- EXPECT_STREQ("\xF0\x90\x90\x80", CodePointToUtf8(L'\x10400', buffer));
-
- // 1 0000 1000 0110 0011 0100 => 11110-100 10-001000 10-011000 10-110100
- EXPECT_STREQ("\xF4\x88\x98\xB4", CodePointToUtf8(L'\x108634', buffer));
-}
-
-// Tests that encoding an invalid code-point generates the expected result.
-TEST(CodePointToUtf8Test, CanEncodeInvalidCodePoint) {
- char buffer[32];
- EXPECT_STREQ("(Invalid Unicode 0x1234ABCD)",
- CodePointToUtf8(L'\x1234ABCD', buffer));
-}
-
-#endif // !GTEST_WIDE_STRING_USES_UTF16_
-
-// Tests WideStringToUtf8().
-
-// Tests that the NUL character L'\0' is encoded correctly.
-TEST(WideStringToUtf8Test, CanEncodeNul) {
- EXPECT_STREQ("", WideStringToUtf8(L"", 0).c_str());
- EXPECT_STREQ("", WideStringToUtf8(L"", -1).c_str());
-}
-
-// Tests that ASCII strings are encoded correctly.
-TEST(WideStringToUtf8Test, CanEncodeAscii) {
- EXPECT_STREQ("a", WideStringToUtf8(L"a", 1).c_str());
- EXPECT_STREQ("ab", WideStringToUtf8(L"ab", 2).c_str());
- EXPECT_STREQ("a", WideStringToUtf8(L"a", -1).c_str());
- EXPECT_STREQ("ab", WideStringToUtf8(L"ab", -1).c_str());
-}
-
-// Tests that Unicode code-points that have 8 to 11 bits are encoded
-// as 110xxxxx 10xxxxxx.
-TEST(WideStringToUtf8Test, CanEncode8To11Bits) {
- // 000 1101 0011 => 110-00011 10-010011
- EXPECT_STREQ("\xC3\x93", WideStringToUtf8(L"\xD3", 1).c_str());
- EXPECT_STREQ("\xC3\x93", WideStringToUtf8(L"\xD3", -1).c_str());
-
- // 101 0111 0110 => 110-10101 10-110110
- const wchar_t s[] = { 0x576, '\0' };
- EXPECT_STREQ("\xD5\xB6", WideStringToUtf8(s, 1).c_str());
- EXPECT_STREQ("\xD5\xB6", WideStringToUtf8(s, -1).c_str());
-}
-
-// Tests that Unicode code-points that have 12 to 16 bits are encoded
-// as 1110xxxx 10xxxxxx 10xxxxxx.
-TEST(WideStringToUtf8Test, CanEncode12To16Bits) {
- // 0000 1000 1101 0011 => 1110-0000 10-100011 10-010011
- const wchar_t s1[] = { 0x8D3, '\0' };
- EXPECT_STREQ("\xE0\xA3\x93", WideStringToUtf8(s1, 1).c_str());
- EXPECT_STREQ("\xE0\xA3\x93", WideStringToUtf8(s1, -1).c_str());
-
- // 1100 0111 0100 1101 => 1110-1100 10-011101 10-001101
- const wchar_t s2[] = { 0xC74D, '\0' };
- EXPECT_STREQ("\xEC\x9D\x8D", WideStringToUtf8(s2, 1).c_str());
- EXPECT_STREQ("\xEC\x9D\x8D", WideStringToUtf8(s2, -1).c_str());
-}
-
-// Tests that the conversion stops when the function encounters \0 character.
-TEST(WideStringToUtf8Test, StopsOnNulCharacter) {
- EXPECT_STREQ("ABC", WideStringToUtf8(L"ABC\0XYZ", 100).c_str());
-}
-
-// Tests that the conversion stops when the function reaches the limit
-// specified by the 'length' parameter.
-TEST(WideStringToUtf8Test, StopsWhenLengthLimitReached) {
- EXPECT_STREQ("ABC", WideStringToUtf8(L"ABCDEF", 3).c_str());
-}
-
-#if !GTEST_WIDE_STRING_USES_UTF16_
-// Tests that Unicode code-points that have 17 to 21 bits are encoded
-// as 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx. This code may not compile
-// on the systems using UTF-16 encoding.
-TEST(WideStringToUtf8Test, CanEncode17To21Bits) {
- // 0 0001 0000 1000 1101 0011 => 11110-000 10-010000 10-100011 10-010011
- EXPECT_STREQ("\xF0\x90\xA3\x93", WideStringToUtf8(L"\x108D3", 1).c_str());
- EXPECT_STREQ("\xF0\x90\xA3\x93", WideStringToUtf8(L"\x108D3", -1).c_str());
-
- // 1 0000 1000 0110 0011 0100 => 11110-100 10-001000 10-011000 10-110100
- EXPECT_STREQ("\xF4\x88\x98\xB4", WideStringToUtf8(L"\x108634", 1).c_str());
- EXPECT_STREQ("\xF4\x88\x98\xB4", WideStringToUtf8(L"\x108634", -1).c_str());
-}
-
-// Tests that encoding an invalid code-point generates the expected result.
-TEST(WideStringToUtf8Test, CanEncodeInvalidCodePoint) {
- EXPECT_STREQ("(Invalid Unicode 0xABCDFF)",
- WideStringToUtf8(L"\xABCDFF", -1).c_str());
-}
-#else // !GTEST_WIDE_STRING_USES_UTF16_
-// Tests that surrogate pairs are encoded correctly on the systems using
-// UTF-16 encoding in the wide strings.
-TEST(WideStringToUtf8Test, CanEncodeValidUtf16SUrrogatePairs) {
- const wchar_t s[] = { 0xD801, 0xDC00, '\0' };
- EXPECT_STREQ("\xF0\x90\x90\x80", WideStringToUtf8(s, -1).c_str());
-}
-
-// Tests that encoding an invalid UTF-16 surrogate pair
-// generates the expected result.
-TEST(WideStringToUtf8Test, CanEncodeInvalidUtf16SurrogatePair) {
- // Leading surrogate is at the end of the string.
- const wchar_t s1[] = { 0xD800, '\0' };
- EXPECT_STREQ("\xED\xA0\x80", WideStringToUtf8(s1, -1).c_str());
- // Leading surrogate is not followed by the trailing surrogate.
- const wchar_t s2[] = { 0xD800, 'M', '\0' };
- EXPECT_STREQ("\xED\xA0\x80M", WideStringToUtf8(s2, -1).c_str());
- // Trailing surrogate appearas without a leading surrogate.
- const wchar_t s3[] = { 0xDC00, 'P', 'Q', 'R', '\0' };
- EXPECT_STREQ("\xED\xB0\x80PQR", WideStringToUtf8(s3, -1).c_str());
-}
-#endif // !GTEST_WIDE_STRING_USES_UTF16_
-
-// Tests that codepoint concatenation works correctly.
-#if !GTEST_WIDE_STRING_USES_UTF16_
-TEST(WideStringToUtf8Test, ConcatenatesCodepointsCorrectly) {
- const wchar_t s[] = { 0x108634, 0xC74D, '\n', 0x576, 0x8D3, 0x108634, '\0'};
- EXPECT_STREQ(
- "\xF4\x88\x98\xB4"
- "\xEC\x9D\x8D"
- "\n"
- "\xD5\xB6"
- "\xE0\xA3\x93"
- "\xF4\x88\x98\xB4",
- WideStringToUtf8(s, -1).c_str());
-}
-#else
-TEST(WideStringToUtf8Test, ConcatenatesCodepointsCorrectly) {
- const wchar_t s[] = { 0xC74D, '\n', 0x576, 0x8D3, '\0'};
- EXPECT_STREQ(
- "\xEC\x9D\x8D" "\n" "\xD5\xB6" "\xE0\xA3\x93",
- WideStringToUtf8(s, -1).c_str());
-}
-#endif // !GTEST_WIDE_STRING_USES_UTF16_
-
-// Tests the Random class.
-
-TEST(RandomDeathTest, GeneratesCrashesOnInvalidRange) {
- testing::internal::Random random(42);
- EXPECT_DEATH_IF_SUPPORTED(
- random.Generate(0),
- "Cannot generate a number in the range \\[0, 0\\)");
- EXPECT_DEATH_IF_SUPPORTED(
- random.Generate(testing::internal::Random::kMaxRange + 1),
- "Generation of a number in \\[0, 2147483649\\) was requested, "
- "but this can only generate numbers in \\[0, 2147483648\\)");
-}
-
-TEST(RandomTest, GeneratesNumbersWithinRange) {
- const UInt32 kRange = 10000;
- testing::internal::Random random(12345);
- for (int i = 0; i < 10; i++) {
- EXPECT_LT(random.Generate(kRange), kRange) << " for iteration " << i;
- }
-
- testing::internal::Random random2(testing::internal::Random::kMaxRange);
- for (int i = 0; i < 10; i++) {
- EXPECT_LT(random2.Generate(kRange), kRange) << " for iteration " << i;
- }
-}
-
-TEST(RandomTest, RepeatsWhenReseeded) {
- const int kSeed = 123;
- const int kArraySize = 10;
- const UInt32 kRange = 10000;
- UInt32 values[kArraySize];
-
- testing::internal::Random random(kSeed);
- for (int i = 0; i < kArraySize; i++) {
- values[i] = random.Generate(kRange);
- }
-
- random.Reseed(kSeed);
- for (int i = 0; i < kArraySize; i++) {
- EXPECT_EQ(values[i], random.Generate(kRange)) << " for iteration " << i;
- }
-}
-
-// Tests STL container utilities.
-
-// Tests CountIf().
-
-static bool IsPositive(int n) { return n > 0; }
-
-TEST(ContainerUtilityTest, CountIf) {
- std::vector<int> v;
- EXPECT_EQ(0, CountIf(v, IsPositive)); // Works for an empty container.
-
- v.push_back(-1);
- v.push_back(0);
- EXPECT_EQ(0, CountIf(v, IsPositive)); // Works when no value satisfies.
-
- v.push_back(2);
- v.push_back(-10);
- v.push_back(10);
- EXPECT_EQ(2, CountIf(v, IsPositive));
-}
-
-// Tests ForEach().
-
-static int g_sum = 0;
-static void Accumulate(int n) { g_sum += n; }
-
-TEST(ContainerUtilityTest, ForEach) {
- std::vector<int> v;
- g_sum = 0;
- ForEach(v, Accumulate);
- EXPECT_EQ(0, g_sum); // Works for an empty container;
-
- g_sum = 0;
- v.push_back(1);
- ForEach(v, Accumulate);
- EXPECT_EQ(1, g_sum); // Works for a container with one element.
-
- g_sum = 0;
- v.push_back(20);
- v.push_back(300);
- ForEach(v, Accumulate);
- EXPECT_EQ(321, g_sum);
-}
-
-// Tests GetElementOr().
-TEST(ContainerUtilityTest, GetElementOr) {
- std::vector<char> a;
- EXPECT_EQ('x', GetElementOr(a, 0, 'x'));
-
- a.push_back('a');
- a.push_back('b');
- EXPECT_EQ('a', GetElementOr(a, 0, 'x'));
- EXPECT_EQ('b', GetElementOr(a, 1, 'x'));
- EXPECT_EQ('x', GetElementOr(a, -2, 'x'));
- EXPECT_EQ('x', GetElementOr(a, 2, 'x'));
-}
-
-TEST(ContainerUtilityDeathTest, ShuffleRange) {
- std::vector<int> a;
- a.push_back(0);
- a.push_back(1);
- a.push_back(2);
- testing::internal::Random random(1);
-
- EXPECT_DEATH_IF_SUPPORTED(
- ShuffleRange(&random, -1, 1, &a),
- "Invalid shuffle range start -1: must be in range \\[0, 3\\]");
- EXPECT_DEATH_IF_SUPPORTED(
- ShuffleRange(&random, 4, 4, &a),
- "Invalid shuffle range start 4: must be in range \\[0, 3\\]");
- EXPECT_DEATH_IF_SUPPORTED(
- ShuffleRange(&random, 3, 2, &a),
- "Invalid shuffle range finish 2: must be in range \\[3, 3\\]");
- EXPECT_DEATH_IF_SUPPORTED(
- ShuffleRange(&random, 3, 4, &a),
- "Invalid shuffle range finish 4: must be in range \\[3, 3\\]");
-}
-
-class VectorShuffleTest : public Test {
- protected:
- static const int kVectorSize = 20;
-
- VectorShuffleTest() : random_(1) {
- for (int i = 0; i < kVectorSize; i++) {
- vector_.push_back(i);
- }
- }
-
- static bool VectorIsCorrupt(const TestingVector& vector) {
- if (kVectorSize != static_cast<int>(vector.size())) {
- return true;
- }
-
- bool found_in_vector[kVectorSize] = { false };
- for (size_t i = 0; i < vector.size(); i++) {
- const int e = vector[i];
- if (e < 0 || e >= kVectorSize || found_in_vector[e]) {
- return true;
- }
- found_in_vector[e] = true;
- }
-
- // Vector size is correct, elements' range is correct, no
- // duplicate elements. Therefore no corruption has occurred.
- return false;
- }
-
- static bool VectorIsNotCorrupt(const TestingVector& vector) {
- return !VectorIsCorrupt(vector);
- }
-
- static bool RangeIsShuffled(const TestingVector& vector, int begin, int end) {
- for (int i = begin; i < end; i++) {
- if (i != vector[i]) {
- return true;
- }
- }
- return false;
- }
-
- static bool RangeIsUnshuffled(
- const TestingVector& vector, int begin, int end) {
- return !RangeIsShuffled(vector, begin, end);
- }
-
- static bool VectorIsShuffled(const TestingVector& vector) {
- return RangeIsShuffled(vector, 0, static_cast<int>(vector.size()));
- }
-
- static bool VectorIsUnshuffled(const TestingVector& vector) {
- return !VectorIsShuffled(vector);
- }
-
- testing::internal::Random random_;
- TestingVector vector_;
-}; // class VectorShuffleTest
-
-const int VectorShuffleTest::kVectorSize;
-
-TEST_F(VectorShuffleTest, HandlesEmptyRange) {
- // Tests an empty range at the beginning...
- ShuffleRange(&random_, 0, 0, &vector_);
- ASSERT_PRED1(VectorIsNotCorrupt, vector_);
- ASSERT_PRED1(VectorIsUnshuffled, vector_);
-
- // ...in the middle...
- ShuffleRange(&random_, kVectorSize/2, kVectorSize/2, &vector_);
- ASSERT_PRED1(VectorIsNotCorrupt, vector_);
- ASSERT_PRED1(VectorIsUnshuffled, vector_);
-
- // ...at the end...
- ShuffleRange(&random_, kVectorSize - 1, kVectorSize - 1, &vector_);
- ASSERT_PRED1(VectorIsNotCorrupt, vector_);
- ASSERT_PRED1(VectorIsUnshuffled, vector_);
-
- // ...and past the end.
- ShuffleRange(&random_, kVectorSize, kVectorSize, &vector_);
- ASSERT_PRED1(VectorIsNotCorrupt, vector_);
- ASSERT_PRED1(VectorIsUnshuffled, vector_);
-}
-
-TEST_F(VectorShuffleTest, HandlesRangeOfSizeOne) {
- // Tests a size one range at the beginning...
- ShuffleRange(&random_, 0, 1, &vector_);
- ASSERT_PRED1(VectorIsNotCorrupt, vector_);
- ASSERT_PRED1(VectorIsUnshuffled, vector_);
-
- // ...in the middle...
- ShuffleRange(&random_, kVectorSize/2, kVectorSize/2 + 1, &vector_);
- ASSERT_PRED1(VectorIsNotCorrupt, vector_);
- ASSERT_PRED1(VectorIsUnshuffled, vector_);
-
- // ...and at the end.
- ShuffleRange(&random_, kVectorSize - 1, kVectorSize, &vector_);
- ASSERT_PRED1(VectorIsNotCorrupt, vector_);
- ASSERT_PRED1(VectorIsUnshuffled, vector_);
-}
-
-// Because we use our own random number generator and a fixed seed,
-// we can guarantee that the following "random" tests will succeed.
-
-TEST_F(VectorShuffleTest, ShufflesEntireVector) {
- Shuffle(&random_, &vector_);
- ASSERT_PRED1(VectorIsNotCorrupt, vector_);
- EXPECT_FALSE(VectorIsUnshuffled(vector_)) << vector_;
-
- // Tests the first and last elements in particular to ensure that
- // there are no off-by-one problems in our shuffle algorithm.
- EXPECT_NE(0, vector_[0]);
- EXPECT_NE(kVectorSize - 1, vector_[kVectorSize - 1]);
-}
-
-TEST_F(VectorShuffleTest, ShufflesStartOfVector) {
- const int kRangeSize = kVectorSize/2;
-
- ShuffleRange(&random_, 0, kRangeSize, &vector_);
-
- ASSERT_PRED1(VectorIsNotCorrupt, vector_);
- EXPECT_PRED3(RangeIsShuffled, vector_, 0, kRangeSize);
- EXPECT_PRED3(RangeIsUnshuffled, vector_, kRangeSize, kVectorSize);
-}
-
-TEST_F(VectorShuffleTest, ShufflesEndOfVector) {
- const int kRangeSize = kVectorSize / 2;
- ShuffleRange(&random_, kRangeSize, kVectorSize, &vector_);
-
- ASSERT_PRED1(VectorIsNotCorrupt, vector_);
- EXPECT_PRED3(RangeIsUnshuffled, vector_, 0, kRangeSize);
- EXPECT_PRED3(RangeIsShuffled, vector_, kRangeSize, kVectorSize);
-}
-
-TEST_F(VectorShuffleTest, ShufflesMiddleOfVector) {
- int kRangeSize = kVectorSize/3;
- ShuffleRange(&random_, kRangeSize, 2*kRangeSize, &vector_);
-
- ASSERT_PRED1(VectorIsNotCorrupt, vector_);
- EXPECT_PRED3(RangeIsUnshuffled, vector_, 0, kRangeSize);
- EXPECT_PRED3(RangeIsShuffled, vector_, kRangeSize, 2*kRangeSize);
- EXPECT_PRED3(RangeIsUnshuffled, vector_, 2*kRangeSize, kVectorSize);
-}
-
-TEST_F(VectorShuffleTest, ShufflesRepeatably) {
- TestingVector vector2;
- for (int i = 0; i < kVectorSize; i++) {
- vector2.push_back(i);
- }
-
- random_.Reseed(1234);
- Shuffle(&random_, &vector_);
- random_.Reseed(1234);
- Shuffle(&random_, &vector2);
-
- ASSERT_PRED1(VectorIsNotCorrupt, vector_);
- ASSERT_PRED1(VectorIsNotCorrupt, vector2);
-
- for (int i = 0; i < kVectorSize; i++) {
- EXPECT_EQ(vector_[i], vector2[i]) << " where i is " << i;
- }
-}
-
-// Tests the size of the AssertHelper class.
-
-TEST(AssertHelperTest, AssertHelperIsSmall) {
- // To avoid breaking clients that use lots of assertions in one
- // function, we cannot grow the size of AssertHelper.
- EXPECT_LE(sizeof(testing::internal::AssertHelper), sizeof(void*));
-}
-
-// Tests the String class.
-
-// Tests String's constructors.
-TEST(StringTest, Constructors) {
- // Default ctor.
- String s1;
- // We aren't using EXPECT_EQ(NULL, s1.c_str()) because comparing
- // pointers with NULL isn't supported on all platforms.
- EXPECT_EQ(0U, s1.length());
- EXPECT_TRUE(NULL == s1.c_str());
-
- // Implicitly constructs from a C-string.
- String s2 = "Hi";
- EXPECT_EQ(2U, s2.length());
- EXPECT_STREQ("Hi", s2.c_str());
-
- // Constructs from a C-string and a length.
- String s3("hello", 3);
- EXPECT_EQ(3U, s3.length());
- EXPECT_STREQ("hel", s3.c_str());
-
- // The empty String should be created when String is constructed with
- // a NULL pointer and length 0.
- EXPECT_EQ(0U, String(NULL, 0).length());
- EXPECT_FALSE(String(NULL, 0).c_str() == NULL);
-
- // Constructs a String that contains '\0'.
- String s4("a\0bcd", 4);
- EXPECT_EQ(4U, s4.length());
- EXPECT_EQ('a', s4.c_str()[0]);
- EXPECT_EQ('\0', s4.c_str()[1]);
- EXPECT_EQ('b', s4.c_str()[2]);
- EXPECT_EQ('c', s4.c_str()[3]);
-
- // Copy ctor where the source is NULL.
- const String null_str;
- String s5 = null_str;
- EXPECT_TRUE(s5.c_str() == NULL);
-
- // Copy ctor where the source isn't NULL.
- String s6 = s3;
- EXPECT_EQ(3U, s6.length());
- EXPECT_STREQ("hel", s6.c_str());
-
- // Copy ctor where the source contains '\0'.
- String s7 = s4;
- EXPECT_EQ(4U, s7.length());
- EXPECT_EQ('a', s7.c_str()[0]);
- EXPECT_EQ('\0', s7.c_str()[1]);
- EXPECT_EQ('b', s7.c_str()[2]);
- EXPECT_EQ('c', s7.c_str()[3]);
-}
-
-TEST(StringTest, ConvertsFromStdString) {
- // An empty std::string.
- const std::string src1("");
- const String dest1 = src1;
- EXPECT_EQ(0U, dest1.length());
- EXPECT_STREQ("", dest1.c_str());
-
- // A normal std::string.
- const std::string src2("Hi");
- const String dest2 = src2;
- EXPECT_EQ(2U, dest2.length());
- EXPECT_STREQ("Hi", dest2.c_str());
-
- // An std::string with an embedded NUL character.
- const char src3[] = "a\0b";
- const String dest3 = std::string(src3, sizeof(src3));
- EXPECT_EQ(sizeof(src3), dest3.length());
- EXPECT_EQ('a', dest3.c_str()[0]);
- EXPECT_EQ('\0', dest3.c_str()[1]);
- EXPECT_EQ('b', dest3.c_str()[2]);
-}
-
-TEST(StringTest, ConvertsToStdString) {
- // An empty String.
- const String src1("");
- const std::string dest1 = src1;
- EXPECT_EQ("", dest1);
-
- // A normal String.
- const String src2("Hi");
- const std::string dest2 = src2;
- EXPECT_EQ("Hi", dest2);
-
- // A String containing a '\0'.
- const String src3("x\0y", 3);
- const std::string dest3 = src3;
- EXPECT_EQ(std::string("x\0y", 3), dest3);
-}
-
-#if GTEST_HAS_GLOBAL_STRING
-
-TEST(StringTest, ConvertsFromGlobalString) {
- // An empty ::string.
- const ::string src1("");
- const String dest1 = src1;
- EXPECT_EQ(0U, dest1.length());
- EXPECT_STREQ("", dest1.c_str());
-
- // A normal ::string.
- const ::string src2("Hi");
- const String dest2 = src2;
- EXPECT_EQ(2U, dest2.length());
- EXPECT_STREQ("Hi", dest2.c_str());
-
- // An ::string with an embedded NUL character.
- const char src3[] = "x\0y";
- const String dest3 = ::string(src3, sizeof(src3));
- EXPECT_EQ(sizeof(src3), dest3.length());
- EXPECT_EQ('x', dest3.c_str()[0]);
- EXPECT_EQ('\0', dest3.c_str()[1]);
- EXPECT_EQ('y', dest3.c_str()[2]);
-}
-
-TEST(StringTest, ConvertsToGlobalString) {
- // An empty String.
- const String src1("");
- const ::string dest1 = src1;
- EXPECT_EQ("", dest1);
-
- // A normal String.
- const String src2("Hi");
- const ::string dest2 = src2;
- EXPECT_EQ("Hi", dest2);
-
- const String src3("x\0y", 3);
- const ::string dest3 = src3;
- EXPECT_EQ(::string("x\0y", 3), dest3);
-}
-
-#endif // GTEST_HAS_GLOBAL_STRING
-
-// Tests String::ShowCStringQuoted().
-TEST(StringTest, ShowCStringQuoted) {
- EXPECT_STREQ("(null)",
- String::ShowCStringQuoted(NULL).c_str());
- EXPECT_STREQ("\"\"",
- String::ShowCStringQuoted("").c_str());
- EXPECT_STREQ("\"foo\"",
- String::ShowCStringQuoted("foo").c_str());
-}
-
-// Tests String::empty().
-TEST(StringTest, Empty) {
- EXPECT_TRUE(String("").empty());
- EXPECT_FALSE(String().empty());
- EXPECT_FALSE(String(NULL).empty());
- EXPECT_FALSE(String("a").empty());
- EXPECT_FALSE(String("\0", 1).empty());
-}
-
-// Tests String::Compare().
-TEST(StringTest, Compare) {
- // NULL vs NULL.
- EXPECT_EQ(0, String().Compare(String()));
-
- // NULL vs non-NULL.
- EXPECT_EQ(-1, String().Compare(String("")));
-
- // Non-NULL vs NULL.
- EXPECT_EQ(1, String("").Compare(String()));
-
- // The following covers non-NULL vs non-NULL.
-
- // "" vs "".
- EXPECT_EQ(0, String("").Compare(String("")));
-
- // "" vs non-"".
- EXPECT_EQ(-1, String("").Compare(String("\0", 1)));
- EXPECT_EQ(-1, String("").Compare(" "));
-
- // Non-"" vs "".
- EXPECT_EQ(1, String("a").Compare(String("")));
-
- // The following covers non-"" vs non-"".
-
- // Same length and equal.
- EXPECT_EQ(0, String("a").Compare(String("a")));
-
- // Same length and different.
- EXPECT_EQ(-1, String("a\0b", 3).Compare(String("a\0c", 3)));
- EXPECT_EQ(1, String("b").Compare(String("a")));
-
- // Different lengths.
- EXPECT_EQ(-1, String("a").Compare(String("ab")));
- EXPECT_EQ(-1, String("a").Compare(String("a\0", 2)));
- EXPECT_EQ(1, String("abc").Compare(String("aacd")));
-}
-
-// Tests String::operator==().
-TEST(StringTest, Equals) {
- const String null(NULL);
- EXPECT_TRUE(null == NULL); // NOLINT
- EXPECT_FALSE(null == ""); // NOLINT
- EXPECT_FALSE(null == "bar"); // NOLINT
-
- const String empty("");
- EXPECT_FALSE(empty == NULL); // NOLINT
- EXPECT_TRUE(empty == ""); // NOLINT
- EXPECT_FALSE(empty == "bar"); // NOLINT
-
- const String foo("foo");
- EXPECT_FALSE(foo == NULL); // NOLINT
- EXPECT_FALSE(foo == ""); // NOLINT
- EXPECT_FALSE(foo == "bar"); // NOLINT
- EXPECT_TRUE(foo == "foo"); // NOLINT
-
- const String bar("x\0y", 3);
- EXPECT_NE(bar, "x");
-}
-
-// Tests String::operator!=().
-TEST(StringTest, NotEquals) {
- const String null(NULL);
- EXPECT_FALSE(null != NULL); // NOLINT
- EXPECT_TRUE(null != ""); // NOLINT
- EXPECT_TRUE(null != "bar"); // NOLINT
-
- const String empty("");
- EXPECT_TRUE(empty != NULL); // NOLINT
- EXPECT_FALSE(empty != ""); // NOLINT
- EXPECT_TRUE(empty != "bar"); // NOLINT
-
- const String foo("foo");
- EXPECT_TRUE(foo != NULL); // NOLINT
- EXPECT_TRUE(foo != ""); // NOLINT
- EXPECT_TRUE(foo != "bar"); // NOLINT
- EXPECT_FALSE(foo != "foo"); // NOLINT
-
- const String bar("x\0y", 3);
- EXPECT_NE(bar, "x");
-}
-
-// Tests String::length().
-TEST(StringTest, Length) {
- EXPECT_EQ(0U, String().length());
- EXPECT_EQ(0U, String("").length());
- EXPECT_EQ(2U, String("ab").length());
- EXPECT_EQ(3U, String("a\0b", 3).length());
-}
-
-// Tests String::EndsWith().
-TEST(StringTest, EndsWith) {
- EXPECT_TRUE(String("foobar").EndsWith("bar"));
- EXPECT_TRUE(String("foobar").EndsWith(""));
- EXPECT_TRUE(String("").EndsWith(""));
-
- EXPECT_FALSE(String("foobar").EndsWith("foo"));
- EXPECT_FALSE(String("").EndsWith("foo"));
-}
-
-// Tests String::EndsWithCaseInsensitive().
-TEST(StringTest, EndsWithCaseInsensitive) {
- EXPECT_TRUE(String("foobar").EndsWithCaseInsensitive("BAR"));
- EXPECT_TRUE(String("foobaR").EndsWithCaseInsensitive("bar"));
- EXPECT_TRUE(String("foobar").EndsWithCaseInsensitive(""));
- EXPECT_TRUE(String("").EndsWithCaseInsensitive(""));
-
- EXPECT_FALSE(String("Foobar").EndsWithCaseInsensitive("foo"));
- EXPECT_FALSE(String("foobar").EndsWithCaseInsensitive("Foo"));
- EXPECT_FALSE(String("").EndsWithCaseInsensitive("foo"));
-}
-
-// C++Builder's preprocessor is buggy; it fails to expand macros that
-// appear in macro parameters after wide char literals. Provide an alias
-// for NULL as a workaround.
-static const wchar_t* const kNull = NULL;
-
-// Tests String::CaseInsensitiveWideCStringEquals
-TEST(StringTest, CaseInsensitiveWideCStringEquals) {
- EXPECT_TRUE(String::CaseInsensitiveWideCStringEquals(NULL, NULL));
- EXPECT_FALSE(String::CaseInsensitiveWideCStringEquals(kNull, L""));
- EXPECT_FALSE(String::CaseInsensitiveWideCStringEquals(L"", kNull));
- EXPECT_FALSE(String::CaseInsensitiveWideCStringEquals(kNull, L"foobar"));
- EXPECT_FALSE(String::CaseInsensitiveWideCStringEquals(L"foobar", kNull));
- EXPECT_TRUE(String::CaseInsensitiveWideCStringEquals(L"foobar", L"foobar"));
- EXPECT_TRUE(String::CaseInsensitiveWideCStringEquals(L"foobar", L"FOOBAR"));
- EXPECT_TRUE(String::CaseInsensitiveWideCStringEquals(L"FOOBAR", L"foobar"));
-}
-
-// Tests that NULL can be assigned to a String.
-TEST(StringTest, CanBeAssignedNULL) {
- const String src(NULL);
- String dest;
-
- dest = src;
- EXPECT_STREQ(NULL, dest.c_str());
-}
-
-// Tests that the empty string "" can be assigned to a String.
-TEST(StringTest, CanBeAssignedEmpty) {
- const String src("");
- String dest;
-
- dest = src;
- EXPECT_STREQ("", dest.c_str());
-}
-
-// Tests that a non-empty string can be assigned to a String.
-TEST(StringTest, CanBeAssignedNonEmpty) {
- const String src("hello");
- String dest;
- dest = src;
- EXPECT_EQ(5U, dest.length());
- EXPECT_STREQ("hello", dest.c_str());
-
- const String src2("x\0y", 3);
- String dest2;
- dest2 = src2;
- EXPECT_EQ(3U, dest2.length());
- EXPECT_EQ('x', dest2.c_str()[0]);
- EXPECT_EQ('\0', dest2.c_str()[1]);
- EXPECT_EQ('y', dest2.c_str()[2]);
-}
-
-// Tests that a String can be assigned to itself.
-TEST(StringTest, CanBeAssignedSelf) {
- String dest("hello");
-
- // Use explicit function call notation here to suppress self-assign warning.
- dest.operator=(dest);
- EXPECT_STREQ("hello", dest.c_str());
-}
-
-// Sun Studio < 12 incorrectly rejects this code due to an overloading
-// ambiguity.
-#if !(defined(__SUNPRO_CC) && __SUNPRO_CC < 0x590)
-// Tests streaming a String.
-TEST(StringTest, Streams) {
- EXPECT_EQ(StreamableToString(String()), "(null)");
- EXPECT_EQ(StreamableToString(String("")), "");
- EXPECT_EQ(StreamableToString(String("a\0b", 3)), "a\\0b");
-}
-#endif
-
-// Tests that String::Format() works.
-TEST(StringTest, FormatWorks) {
- // Normal case: the format spec is valid, the arguments match the
- // spec, and the result is < 4095 characters.
- EXPECT_STREQ("Hello, 42", String::Format("%s, %d", "Hello", 42).c_str());
-
- // Edge case: the result is 4095 characters.
- char buffer[4096];
- const size_t kSize = sizeof(buffer);
- memset(buffer, 'a', kSize - 1);
- buffer[kSize - 1] = '\0';
- EXPECT_STREQ(buffer, String::Format("%s", buffer).c_str());
-
- // The result needs to be 4096 characters, exceeding Format()'s limit.
- EXPECT_STREQ("<formatting error or buffer exceeded>",
- String::Format("x%s", buffer).c_str());
-
-#if GTEST_OS_LINUX
- // On Linux, invalid format spec should lead to an error message.
- // In other environment (e.g. MSVC on Windows), String::Format() may
- // simply ignore a bad format spec, so this assertion is run on
- // Linux only.
- EXPECT_STREQ("<formatting error or buffer exceeded>",
- String::Format("%").c_str());
-#endif
-}
-
-#if GTEST_OS_WINDOWS
-
-// Tests String::ShowWideCString().
-TEST(StringTest, ShowWideCString) {
- EXPECT_STREQ("(null)",
- String::ShowWideCString(NULL).c_str());
- EXPECT_STREQ("", String::ShowWideCString(L"").c_str());
- EXPECT_STREQ("foo", String::ShowWideCString(L"foo").c_str());
-}
-
-// Tests String::ShowWideCStringQuoted().
-TEST(StringTest, ShowWideCStringQuoted) {
- EXPECT_STREQ("(null)",
- String::ShowWideCStringQuoted(NULL).c_str());
- EXPECT_STREQ("L\"\"",
- String::ShowWideCStringQuoted(L"").c_str());
- EXPECT_STREQ("L\"foo\"",
- String::ShowWideCStringQuoted(L"foo").c_str());
-}
-
-# if GTEST_OS_WINDOWS_MOBILE
-TEST(StringTest, AnsiAndUtf16Null) {
- EXPECT_EQ(NULL, String::AnsiToUtf16(NULL));
- EXPECT_EQ(NULL, String::Utf16ToAnsi(NULL));
-}
-
-TEST(StringTest, AnsiAndUtf16ConvertBasic) {
- const char* ansi = String::Utf16ToAnsi(L"str");
- EXPECT_STREQ("str", ansi);
- delete [] ansi;
- const WCHAR* utf16 = String::AnsiToUtf16("str");
- EXPECT_EQ(0, wcsncmp(L"str", utf16, 3));
- delete [] utf16;
-}
-
-TEST(StringTest, AnsiAndUtf16ConvertPathChars) {
- const char* ansi = String::Utf16ToAnsi(L".:\\ \"*?");
- EXPECT_STREQ(".:\\ \"*?", ansi);
- delete [] ansi;
- const WCHAR* utf16 = String::AnsiToUtf16(".:\\ \"*?");
- EXPECT_EQ(0, wcsncmp(L".:\\ \"*?", utf16, 3));
- delete [] utf16;
-}
-# endif // GTEST_OS_WINDOWS_MOBILE
-
-#endif // GTEST_OS_WINDOWS
-
-// Tests TestProperty construction.
-TEST(TestPropertyTest, StringValue) {
- TestProperty property("key", "1");
- EXPECT_STREQ("key", property.key());
- EXPECT_STREQ("1", property.value());
-}
-
-// Tests TestProperty replacing a value.
-TEST(TestPropertyTest, ReplaceStringValue) {
- TestProperty property("key", "1");
- EXPECT_STREQ("1", property.value());
- property.SetValue("2");
- EXPECT_STREQ("2", property.value());
-}
-
-// AddFatalFailure() and AddNonfatalFailure() must be stand-alone
-// functions (i.e. their definitions cannot be inlined at the call
-// sites), or C++Builder won't compile the code.
-static void AddFatalFailure() {
- FAIL() << "Expected fatal failure.";
-}
-
-static void AddNonfatalFailure() {
- ADD_FAILURE() << "Expected non-fatal failure.";
-}
-
-class ScopedFakeTestPartResultReporterTest : public Test {
- public: // Must be public and not protected due to a bug in g++ 3.4.2.
- enum FailureMode {
- FATAL_FAILURE,
- NONFATAL_FAILURE
- };
- static void AddFailure(FailureMode failure) {
- if (failure == FATAL_FAILURE) {
- AddFatalFailure();
- } else {
- AddNonfatalFailure();
- }
- }
-};
-
-// Tests that ScopedFakeTestPartResultReporter intercepts test
-// failures.
-TEST_F(ScopedFakeTestPartResultReporterTest, InterceptsTestFailures) {
- TestPartResultArray results;
- {
- ScopedFakeTestPartResultReporter reporter(
- ScopedFakeTestPartResultReporter::INTERCEPT_ONLY_CURRENT_THREAD,
- &results);
- AddFailure(NONFATAL_FAILURE);
- AddFailure(FATAL_FAILURE);
- }
-
- EXPECT_EQ(2, results.size());
- EXPECT_TRUE(results.GetTestPartResult(0).nonfatally_failed());
- EXPECT_TRUE(results.GetTestPartResult(1).fatally_failed());
-}
-
-TEST_F(ScopedFakeTestPartResultReporterTest, DeprecatedConstructor) {
- TestPartResultArray results;
- {
- // Tests, that the deprecated constructor still works.
- ScopedFakeTestPartResultReporter reporter(&results);
- AddFailure(NONFATAL_FAILURE);
- }
- EXPECT_EQ(1, results.size());
-}
-
-#if GTEST_IS_THREADSAFE
-
-class ScopedFakeTestPartResultReporterWithThreadsTest
- : public ScopedFakeTestPartResultReporterTest {
- protected:
- static void AddFailureInOtherThread(FailureMode failure) {
- ThreadWithParam<FailureMode> thread(&AddFailure, failure, NULL);
- thread.Join();
- }
-};
-
-TEST_F(ScopedFakeTestPartResultReporterWithThreadsTest,
- InterceptsTestFailuresInAllThreads) {
- TestPartResultArray results;
- {
- ScopedFakeTestPartResultReporter reporter(
- ScopedFakeTestPartResultReporter::INTERCEPT_ALL_THREADS, &results);
- AddFailure(NONFATAL_FAILURE);
- AddFailure(FATAL_FAILURE);
- AddFailureInOtherThread(NONFATAL_FAILURE);
- AddFailureInOtherThread(FATAL_FAILURE);
- }
-
- EXPECT_EQ(4, results.size());
- EXPECT_TRUE(results.GetTestPartResult(0).nonfatally_failed());
- EXPECT_TRUE(results.GetTestPartResult(1).fatally_failed());
- EXPECT_TRUE(results.GetTestPartResult(2).nonfatally_failed());
- EXPECT_TRUE(results.GetTestPartResult(3).fatally_failed());
-}
-
-#endif // GTEST_IS_THREADSAFE
-
-// Tests EXPECT_FATAL_FAILURE{,ON_ALL_THREADS}. Makes sure that they
-// work even if the failure is generated in a called function rather than
-// the current context.
-
-typedef ScopedFakeTestPartResultReporterTest ExpectFatalFailureTest;
-
-TEST_F(ExpectFatalFailureTest, CatchesFatalFaliure) {
- EXPECT_FATAL_FAILURE(AddFatalFailure(), "Expected fatal failure.");
-}
-
-#if GTEST_HAS_GLOBAL_STRING
-TEST_F(ExpectFatalFailureTest, AcceptsStringObject) {
- EXPECT_FATAL_FAILURE(AddFatalFailure(), ::string("Expected fatal failure."));
-}
-#endif
-
-TEST_F(ExpectFatalFailureTest, AcceptsStdStringObject) {
- EXPECT_FATAL_FAILURE(AddFatalFailure(),
- ::std::string("Expected fatal failure."));
-}
-
-TEST_F(ExpectFatalFailureTest, CatchesFatalFailureOnAllThreads) {
- // We have another test below to verify that the macro catches fatal
- // failures generated on another thread.
- EXPECT_FATAL_FAILURE_ON_ALL_THREADS(AddFatalFailure(),
- "Expected fatal failure.");
-}
-
-#ifdef __BORLANDC__
-// Silences warnings: "Condition is always true"
-# pragma option push -w-ccc
-#endif
-
-// Tests that EXPECT_FATAL_FAILURE() can be used in a non-void
-// function even when the statement in it contains ASSERT_*.
-
-int NonVoidFunction() {
- EXPECT_FATAL_FAILURE(ASSERT_TRUE(false), "");
- EXPECT_FATAL_FAILURE_ON_ALL_THREADS(FAIL(), "");
- return 0;
-}
-
-TEST_F(ExpectFatalFailureTest, CanBeUsedInNonVoidFunction) {
- NonVoidFunction();
-}
-
-// Tests that EXPECT_FATAL_FAILURE(statement, ...) doesn't abort the
-// current function even though 'statement' generates a fatal failure.
-
-void DoesNotAbortHelper(bool* aborted) {
- EXPECT_FATAL_FAILURE(ASSERT_TRUE(false), "");
- EXPECT_FATAL_FAILURE_ON_ALL_THREADS(FAIL(), "");
-
- *aborted = false;
-}
-
-#ifdef __BORLANDC__
-// Restores warnings after previous "#pragma option push" suppressed them.
-# pragma option pop
-#endif
-
-TEST_F(ExpectFatalFailureTest, DoesNotAbort) {
- bool aborted = true;
- DoesNotAbortHelper(&aborted);
- EXPECT_FALSE(aborted);
-}
-
-// Tests that the EXPECT_FATAL_FAILURE{,_ON_ALL_THREADS} accepts a
-// statement that contains a macro which expands to code containing an
-// unprotected comma.
-
-static int global_var = 0;
-#define GTEST_USE_UNPROTECTED_COMMA_ global_var++, global_var++
-
-TEST_F(ExpectFatalFailureTest, AcceptsMacroThatExpandsToUnprotectedComma) {
-#ifndef __BORLANDC__
- // ICE's in C++Builder.
- EXPECT_FATAL_FAILURE({
- GTEST_USE_UNPROTECTED_COMMA_;
- AddFatalFailure();
- }, "");
-#endif
-
- EXPECT_FATAL_FAILURE_ON_ALL_THREADS({
- GTEST_USE_UNPROTECTED_COMMA_;
- AddFatalFailure();
- }, "");
-}
-
-// Tests EXPECT_NONFATAL_FAILURE{,ON_ALL_THREADS}.
-
-typedef ScopedFakeTestPartResultReporterTest ExpectNonfatalFailureTest;
-
-TEST_F(ExpectNonfatalFailureTest, CatchesNonfatalFailure) {
- EXPECT_NONFATAL_FAILURE(AddNonfatalFailure(),
- "Expected non-fatal failure.");
-}
-
-#if GTEST_HAS_GLOBAL_STRING
-TEST_F(ExpectNonfatalFailureTest, AcceptsStringObject) {
- EXPECT_NONFATAL_FAILURE(AddNonfatalFailure(),
- ::string("Expected non-fatal failure."));
-}
-#endif
-
-TEST_F(ExpectNonfatalFailureTest, AcceptsStdStringObject) {
- EXPECT_NONFATAL_FAILURE(AddNonfatalFailure(),
- ::std::string("Expected non-fatal failure."));
-}
-
-TEST_F(ExpectNonfatalFailureTest, CatchesNonfatalFailureOnAllThreads) {
- // We have another test below to verify that the macro catches
- // non-fatal failures generated on another thread.
- EXPECT_NONFATAL_FAILURE_ON_ALL_THREADS(AddNonfatalFailure(),
- "Expected non-fatal failure.");
-}
-
-// Tests that the EXPECT_NONFATAL_FAILURE{,_ON_ALL_THREADS} accepts a
-// statement that contains a macro which expands to code containing an
-// unprotected comma.
-TEST_F(ExpectNonfatalFailureTest, AcceptsMacroThatExpandsToUnprotectedComma) {
- EXPECT_NONFATAL_FAILURE({
- GTEST_USE_UNPROTECTED_COMMA_;
- AddNonfatalFailure();
- }, "");
-
- EXPECT_NONFATAL_FAILURE_ON_ALL_THREADS({
- GTEST_USE_UNPROTECTED_COMMA_;
- AddNonfatalFailure();
- }, "");
-}
-
-#if GTEST_IS_THREADSAFE
-
-typedef ScopedFakeTestPartResultReporterWithThreadsTest
- ExpectFailureWithThreadsTest;
-
-TEST_F(ExpectFailureWithThreadsTest, ExpectFatalFailureOnAllThreads) {
- EXPECT_FATAL_FAILURE_ON_ALL_THREADS(AddFailureInOtherThread(FATAL_FAILURE),
- "Expected fatal failure.");
-}
-
-TEST_F(ExpectFailureWithThreadsTest, ExpectNonFatalFailureOnAllThreads) {
- EXPECT_NONFATAL_FAILURE_ON_ALL_THREADS(
- AddFailureInOtherThread(NONFATAL_FAILURE), "Expected non-fatal failure.");
-}
-
-#endif // GTEST_IS_THREADSAFE
-
-// Tests the TestProperty class.
-
-TEST(TestPropertyTest, ConstructorWorks) {
- const TestProperty property("key", "value");
- EXPECT_STREQ("key", property.key());
- EXPECT_STREQ("value", property.value());
-}
-
-TEST(TestPropertyTest, SetValue) {
- TestProperty property("key", "value_1");
- EXPECT_STREQ("key", property.key());
- property.SetValue("value_2");
- EXPECT_STREQ("key", property.key());
- EXPECT_STREQ("value_2", property.value());
-}
-
-// Tests the TestResult class
-
-// The test fixture for testing TestResult.
-class TestResultTest : public Test {
- protected:
- typedef std::vector<TestPartResult> TPRVector;
-
- // We make use of 2 TestPartResult objects,
- TestPartResult * pr1, * pr2;
-
- // ... and 3 TestResult objects.
- TestResult * r0, * r1, * r2;
-
- virtual void SetUp() {
- // pr1 is for success.
- pr1 = new TestPartResult(TestPartResult::kSuccess,
- "foo/bar.cc",
- 10,
- "Success!");
-
- // pr2 is for fatal failure.
- pr2 = new TestPartResult(TestPartResult::kFatalFailure,
- "foo/bar.cc",
- -1, // This line number means "unknown"
- "Failure!");
-
- // Creates the TestResult objects.
- r0 = new TestResult();
- r1 = new TestResult();
- r2 = new TestResult();
-
- // In order to test TestResult, we need to modify its internal
- // state, in particular the TestPartResult vector it holds.
- // test_part_results() returns a const reference to this vector.
- // We cast it to a non-const object s.t. it can be modified (yes,
- // this is a hack).
- TPRVector* results1 = const_cast<TPRVector*>(
- &TestResultAccessor::test_part_results(*r1));
- TPRVector* results2 = const_cast<TPRVector*>(
- &TestResultAccessor::test_part_results(*r2));
-
- // r0 is an empty TestResult.
-
- // r1 contains a single SUCCESS TestPartResult.
- results1->push_back(*pr1);
-
- // r2 contains a SUCCESS, and a FAILURE.
- results2->push_back(*pr1);
- results2->push_back(*pr2);
- }
-
- virtual void TearDown() {
- delete pr1;
- delete pr2;
-
- delete r0;
- delete r1;
- delete r2;
- }
-
- // Helper that compares two two TestPartResults.
- static void CompareTestPartResult(const TestPartResult& expected,
- const TestPartResult& actual) {
- EXPECT_EQ(expected.type(), actual.type());
- EXPECT_STREQ(expected.file_name(), actual.file_name());
- EXPECT_EQ(expected.line_number(), actual.line_number());
- EXPECT_STREQ(expected.summary(), actual.summary());
- EXPECT_STREQ(expected.message(), actual.message());
- EXPECT_EQ(expected.passed(), actual.passed());
- EXPECT_EQ(expected.failed(), actual.failed());
- EXPECT_EQ(expected.nonfatally_failed(), actual.nonfatally_failed());
- EXPECT_EQ(expected.fatally_failed(), actual.fatally_failed());
- }
-};
-
-// Tests TestResult::total_part_count().
-TEST_F(TestResultTest, total_part_count) {
- ASSERT_EQ(0, r0->total_part_count());
- ASSERT_EQ(1, r1->total_part_count());
- ASSERT_EQ(2, r2->total_part_count());
-}
-
-// Tests TestResult::Passed().
-TEST_F(TestResultTest, Passed) {
- ASSERT_TRUE(r0->Passed());
- ASSERT_TRUE(r1->Passed());
- ASSERT_FALSE(r2->Passed());
-}
-
-// Tests TestResult::Failed().
-TEST_F(TestResultTest, Failed) {
- ASSERT_FALSE(r0->Failed());
- ASSERT_FALSE(r1->Failed());
- ASSERT_TRUE(r2->Failed());
-}
-
-// Tests TestResult::GetTestPartResult().
-
-typedef TestResultTest TestResultDeathTest;
-
-TEST_F(TestResultDeathTest, GetTestPartResult) {
- CompareTestPartResult(*pr1, r2->GetTestPartResult(0));
- CompareTestPartResult(*pr2, r2->GetTestPartResult(1));
- EXPECT_DEATH_IF_SUPPORTED(r2->GetTestPartResult(2), "");
- EXPECT_DEATH_IF_SUPPORTED(r2->GetTestPartResult(-1), "");
-}
-
-// Tests TestResult has no properties when none are added.
-TEST(TestResultPropertyTest, NoPropertiesFoundWhenNoneAreAdded) {
- TestResult test_result;
- ASSERT_EQ(0, test_result.test_property_count());
-}
-
-// Tests TestResult has the expected property when added.
-TEST(TestResultPropertyTest, OnePropertyFoundWhenAdded) {
- TestResult test_result;
- TestProperty property("key_1", "1");
- TestResultAccessor::RecordProperty(&test_result, property);
- ASSERT_EQ(1, test_result.test_property_count());
- const TestProperty& actual_property = test_result.GetTestProperty(0);
- EXPECT_STREQ("key_1", actual_property.key());
- EXPECT_STREQ("1", actual_property.value());
-}
-
-// Tests TestResult has multiple properties when added.
-TEST(TestResultPropertyTest, MultiplePropertiesFoundWhenAdded) {
- TestResult test_result;
- TestProperty property_1("key_1", "1");
- TestProperty property_2("key_2", "2");
- TestResultAccessor::RecordProperty(&test_result, property_1);
- TestResultAccessor::RecordProperty(&test_result, property_2);
- ASSERT_EQ(2, test_result.test_property_count());
- const TestProperty& actual_property_1 = test_result.GetTestProperty(0);
- EXPECT_STREQ("key_1", actual_property_1.key());
- EXPECT_STREQ("1", actual_property_1.value());
-
- const TestProperty& actual_property_2 = test_result.GetTestProperty(1);
- EXPECT_STREQ("key_2", actual_property_2.key());
- EXPECT_STREQ("2", actual_property_2.value());
-}
-
-// Tests TestResult::RecordProperty() overrides values for duplicate keys.
-TEST(TestResultPropertyTest, OverridesValuesForDuplicateKeys) {
- TestResult test_result;
- TestProperty property_1_1("key_1", "1");
- TestProperty property_2_1("key_2", "2");
- TestProperty property_1_2("key_1", "12");
- TestProperty property_2_2("key_2", "22");
- TestResultAccessor::RecordProperty(&test_result, property_1_1);
- TestResultAccessor::RecordProperty(&test_result, property_2_1);
- TestResultAccessor::RecordProperty(&test_result, property_1_2);
- TestResultAccessor::RecordProperty(&test_result, property_2_2);
-
- ASSERT_EQ(2, test_result.test_property_count());
- const TestProperty& actual_property_1 = test_result.GetTestProperty(0);
- EXPECT_STREQ("key_1", actual_property_1.key());
- EXPECT_STREQ("12", actual_property_1.value());
-
- const TestProperty& actual_property_2 = test_result.GetTestProperty(1);
- EXPECT_STREQ("key_2", actual_property_2.key());
- EXPECT_STREQ("22", actual_property_2.value());
-}
-
-// Tests TestResult::GetTestProperty().
-TEST(TestResultPropertyDeathTest, GetTestProperty) {
- TestResult test_result;
- TestProperty property_1("key_1", "1");
- TestProperty property_2("key_2", "2");
- TestProperty property_3("key_3", "3");
- TestResultAccessor::RecordProperty(&test_result, property_1);
- TestResultAccessor::RecordProperty(&test_result, property_2);
- TestResultAccessor::RecordProperty(&test_result, property_3);
-
- const TestProperty& fetched_property_1 = test_result.GetTestProperty(0);
- const TestProperty& fetched_property_2 = test_result.GetTestProperty(1);
- const TestProperty& fetched_property_3 = test_result.GetTestProperty(2);
-
- EXPECT_STREQ("key_1", fetched_property_1.key());
- EXPECT_STREQ("1", fetched_property_1.value());
-
- EXPECT_STREQ("key_2", fetched_property_2.key());
- EXPECT_STREQ("2", fetched_property_2.value());
-
- EXPECT_STREQ("key_3", fetched_property_3.key());
- EXPECT_STREQ("3", fetched_property_3.value());
-
- EXPECT_DEATH_IF_SUPPORTED(test_result.GetTestProperty(3), "");
- EXPECT_DEATH_IF_SUPPORTED(test_result.GetTestProperty(-1), "");
-}
-
-// When a property using a reserved key is supplied to this function, it tests
-// that a non-fatal failure is added, a fatal failure is not added, and that the
-// property is not recorded.
-void ExpectNonFatalFailureRecordingPropertyWithReservedKey(const char* key) {
- TestResult test_result;
- TestProperty property(key, "1");
- EXPECT_NONFATAL_FAILURE(
- TestResultAccessor::RecordProperty(&test_result, property),
- "Reserved key");
- ASSERT_EQ(0, test_result.test_property_count()) << "Not recorded";
-}
-
-// Attempting to recording a property with the Reserved literal "name"
-// should add a non-fatal failure and the property should not be recorded.
-TEST(TestResultPropertyTest, AddFailureWhenUsingReservedKeyCalledName) {
- ExpectNonFatalFailureRecordingPropertyWithReservedKey("name");
-}
-
-// Attempting to recording a property with the Reserved literal "status"
-// should add a non-fatal failure and the property should not be recorded.
-TEST(TestResultPropertyTest, AddFailureWhenUsingReservedKeyCalledStatus) {
- ExpectNonFatalFailureRecordingPropertyWithReservedKey("status");
-}
-
-// Attempting to recording a property with the Reserved literal "time"
-// should add a non-fatal failure and the property should not be recorded.
-TEST(TestResultPropertyTest, AddFailureWhenUsingReservedKeyCalledTime) {
- ExpectNonFatalFailureRecordingPropertyWithReservedKey("time");
-}
-
-// Attempting to recording a property with the Reserved literal "classname"
-// should add a non-fatal failure and the property should not be recorded.
-TEST(TestResultPropertyTest, AddFailureWhenUsingReservedKeyCalledClassname) {
- ExpectNonFatalFailureRecordingPropertyWithReservedKey("classname");
-}
-
-// Tests that GTestFlagSaver works on Windows and Mac.
-
-class GTestFlagSaverTest : public Test {
- protected:
- // Saves the Google Test flags such that we can restore them later, and
- // then sets them to their default values. This will be called
- // before the first test in this test case is run.
- static void SetUpTestCase() {
- saver_ = new GTestFlagSaver;
-
- GTEST_FLAG(also_run_disabled_tests) = false;
- GTEST_FLAG(break_on_failure) = false;
- GTEST_FLAG(catch_exceptions) = false;
- GTEST_FLAG(death_test_use_fork) = false;
- GTEST_FLAG(color) = "auto";
- GTEST_FLAG(filter) = "";
- GTEST_FLAG(list_tests) = false;
- GTEST_FLAG(output) = "";
- GTEST_FLAG(print_time) = true;
- GTEST_FLAG(random_seed) = 0;
- GTEST_FLAG(repeat) = 1;
- GTEST_FLAG(shuffle) = false;
- GTEST_FLAG(stack_trace_depth) = kMaxStackTraceDepth;
- GTEST_FLAG(stream_result_to) = "";
- GTEST_FLAG(throw_on_failure) = false;
- }
-
- // Restores the Google Test flags that the tests have modified. This will
- // be called after the last test in this test case is run.
- static void TearDownTestCase() {
- delete saver_;
- saver_ = NULL;
- }
-
- // Verifies that the Google Test flags have their default values, and then
- // modifies each of them.
- void VerifyAndModifyFlags() {
- EXPECT_FALSE(GTEST_FLAG(also_run_disabled_tests));
- EXPECT_FALSE(GTEST_FLAG(break_on_failure));
- EXPECT_FALSE(GTEST_FLAG(catch_exceptions));
- EXPECT_STREQ("auto", GTEST_FLAG(color).c_str());
- EXPECT_FALSE(GTEST_FLAG(death_test_use_fork));
- EXPECT_STREQ("", GTEST_FLAG(filter).c_str());
- EXPECT_FALSE(GTEST_FLAG(list_tests));
- EXPECT_STREQ("", GTEST_FLAG(output).c_str());
- EXPECT_TRUE(GTEST_FLAG(print_time));
- EXPECT_EQ(0, GTEST_FLAG(random_seed));
- EXPECT_EQ(1, GTEST_FLAG(repeat));
- EXPECT_FALSE(GTEST_FLAG(shuffle));
- EXPECT_EQ(kMaxStackTraceDepth, GTEST_FLAG(stack_trace_depth));
- EXPECT_STREQ("", GTEST_FLAG(stream_result_to).c_str());
- EXPECT_FALSE(GTEST_FLAG(throw_on_failure));
-
- GTEST_FLAG(also_run_disabled_tests) = true;
- GTEST_FLAG(break_on_failure) = true;
- GTEST_FLAG(catch_exceptions) = true;
- GTEST_FLAG(color) = "no";
- GTEST_FLAG(death_test_use_fork) = true;
- GTEST_FLAG(filter) = "abc";
- GTEST_FLAG(list_tests) = true;
- GTEST_FLAG(output) = "xml:foo.xml";
- GTEST_FLAG(print_time) = false;
- GTEST_FLAG(random_seed) = 1;
- GTEST_FLAG(repeat) = 100;
- GTEST_FLAG(shuffle) = true;
- GTEST_FLAG(stack_trace_depth) = 1;
- GTEST_FLAG(stream_result_to) = "localhost:1234";
- GTEST_FLAG(throw_on_failure) = true;
- }
-
- private:
- // For saving Google Test flags during this test case.
- static GTestFlagSaver* saver_;
-};
-
-GTestFlagSaver* GTestFlagSaverTest::saver_ = NULL;
-
-// Google Test doesn't guarantee the order of tests. The following two
-// tests are designed to work regardless of their order.
-
-// Modifies the Google Test flags in the test body.
-TEST_F(GTestFlagSaverTest, ModifyGTestFlags) {
- VerifyAndModifyFlags();
-}
-
-// Verifies that the Google Test flags in the body of the previous test were
-// restored to their original values.
-TEST_F(GTestFlagSaverTest, VerifyGTestFlags) {
- VerifyAndModifyFlags();
-}
-
-// Sets an environment variable with the given name to the given
-// value. If the value argument is "", unsets the environment
-// variable. The caller must ensure that both arguments are not NULL.
-static void SetEnv(const char* name, const char* value) {
-#if GTEST_OS_WINDOWS_MOBILE
- // Environment variables are not supported on Windows CE.
- return;
-#elif defined(__BORLANDC__) || defined(__SunOS_5_8) || defined(__SunOS_5_9)
- // C++Builder's putenv only stores a pointer to its parameter; we have to
- // ensure that the string remains valid as long as it might be needed.
- // We use an std::map to do so.
- static std::map<String, String*> added_env;
-
- // Because putenv stores a pointer to the string buffer, we can't delete the
- // previous string (if present) until after it's replaced.
- String *prev_env = NULL;
- if (added_env.find(name) != added_env.end()) {
- prev_env = added_env[name];
- }
- added_env[name] = new String((Message() << name << "=" << value).GetString());
-
- // The standard signature of putenv accepts a 'char*' argument. Other
- // implementations, like C++Builder's, accept a 'const char*'.
- // We cast away the 'const' since that would work for both variants.
- putenv(const_cast<char*>(added_env[name]->c_str()));
- delete prev_env;
-#elif GTEST_OS_WINDOWS // If we are on Windows proper.
- _putenv((Message() << name << "=" << value).GetString().c_str());
-#else
- if (*value == '\0') {
- unsetenv(name);
- } else {
- setenv(name, value, 1);
- }
-#endif // GTEST_OS_WINDOWS_MOBILE
-}
-
-#if !GTEST_OS_WINDOWS_MOBILE
-// Environment variables are not supported on Windows CE.
-
-using testing::internal::Int32FromGTestEnv;
-
-// Tests Int32FromGTestEnv().
-
-// Tests that Int32FromGTestEnv() returns the default value when the
-// environment variable is not set.
-TEST(Int32FromGTestEnvTest, ReturnsDefaultWhenVariableIsNotSet) {
- SetEnv(GTEST_FLAG_PREFIX_UPPER_ "TEMP", "");
- EXPECT_EQ(10, Int32FromGTestEnv("temp", 10));
-}
-
-// Tests that Int32FromGTestEnv() returns the default value when the
-// environment variable overflows as an Int32.
-TEST(Int32FromGTestEnvTest, ReturnsDefaultWhenValueOverflows) {
- printf("(expecting 2 warnings)\n");
-
- SetEnv(GTEST_FLAG_PREFIX_UPPER_ "TEMP", "12345678987654321");
- EXPECT_EQ(20, Int32FromGTestEnv("temp", 20));
-
- SetEnv(GTEST_FLAG_PREFIX_UPPER_ "TEMP", "-12345678987654321");
- EXPECT_EQ(30, Int32FromGTestEnv("temp", 30));
-}
-
-// Tests that Int32FromGTestEnv() returns the default value when the
-// environment variable does not represent a valid decimal integer.
-TEST(Int32FromGTestEnvTest, ReturnsDefaultWhenValueIsInvalid) {
- printf("(expecting 2 warnings)\n");
-
- SetEnv(GTEST_FLAG_PREFIX_UPPER_ "TEMP", "A1");
- EXPECT_EQ(40, Int32FromGTestEnv("temp", 40));
-
- SetEnv(GTEST_FLAG_PREFIX_UPPER_ "TEMP", "12X");
- EXPECT_EQ(50, Int32FromGTestEnv("temp", 50));
-}
-
-// Tests that Int32FromGTestEnv() parses and returns the value of the
-// environment variable when it represents a valid decimal integer in
-// the range of an Int32.
-TEST(Int32FromGTestEnvTest, ParsesAndReturnsValidValue) {
- SetEnv(GTEST_FLAG_PREFIX_UPPER_ "TEMP", "123");
- EXPECT_EQ(123, Int32FromGTestEnv("temp", 0));
-
- SetEnv(GTEST_FLAG_PREFIX_UPPER_ "TEMP", "-321");
- EXPECT_EQ(-321, Int32FromGTestEnv("temp", 0));
-}
-#endif // !GTEST_OS_WINDOWS_MOBILE
-
-// Tests ParseInt32Flag().
-
-// Tests that ParseInt32Flag() returns false and doesn't change the
-// output value when the flag has wrong format
-TEST(ParseInt32FlagTest, ReturnsFalseForInvalidFlag) {
- Int32 value = 123;
- EXPECT_FALSE(ParseInt32Flag("--a=100", "b", &value));
- EXPECT_EQ(123, value);
-
- EXPECT_FALSE(ParseInt32Flag("a=100", "a", &value));
- EXPECT_EQ(123, value);
-}
-
-// Tests that ParseInt32Flag() returns false and doesn't change the
-// output value when the flag overflows as an Int32.
-TEST(ParseInt32FlagTest, ReturnsDefaultWhenValueOverflows) {
- printf("(expecting 2 warnings)\n");
-
- Int32 value = 123;
- EXPECT_FALSE(ParseInt32Flag("--abc=12345678987654321", "abc", &value));
- EXPECT_EQ(123, value);
-
- EXPECT_FALSE(ParseInt32Flag("--abc=-12345678987654321", "abc", &value));
- EXPECT_EQ(123, value);
-}
-
-// Tests that ParseInt32Flag() returns false and doesn't change the
-// output value when the flag does not represent a valid decimal
-// integer.
-TEST(ParseInt32FlagTest, ReturnsDefaultWhenValueIsInvalid) {
- printf("(expecting 2 warnings)\n");
-
- Int32 value = 123;
- EXPECT_FALSE(ParseInt32Flag("--abc=A1", "abc", &value));
- EXPECT_EQ(123, value);
-
- EXPECT_FALSE(ParseInt32Flag("--abc=12X", "abc", &value));
- EXPECT_EQ(123, value);
-}
-
-// Tests that ParseInt32Flag() parses the value of the flag and
-// returns true when the flag represents a valid decimal integer in
-// the range of an Int32.
-TEST(ParseInt32FlagTest, ParsesAndReturnsValidValue) {
- Int32 value = 123;
- EXPECT_TRUE(ParseInt32Flag("--" GTEST_FLAG_PREFIX_ "abc=456", "abc", &value));
- EXPECT_EQ(456, value);
-
- EXPECT_TRUE(ParseInt32Flag("--" GTEST_FLAG_PREFIX_ "abc=-789",
- "abc", &value));
- EXPECT_EQ(-789, value);
-}
-
-// Tests that Int32FromEnvOrDie() parses the value of the var or
-// returns the correct default.
-// Environment variables are not supported on Windows CE.
-#if !GTEST_OS_WINDOWS_MOBILE
-TEST(Int32FromEnvOrDieTest, ParsesAndReturnsValidValue) {
- EXPECT_EQ(333, Int32FromEnvOrDie(GTEST_FLAG_PREFIX_UPPER_ "UnsetVar", 333));
- SetEnv(GTEST_FLAG_PREFIX_UPPER_ "UnsetVar", "123");
- EXPECT_EQ(123, Int32FromEnvOrDie(GTEST_FLAG_PREFIX_UPPER_ "UnsetVar", 333));
- SetEnv(GTEST_FLAG_PREFIX_UPPER_ "UnsetVar", "-123");
- EXPECT_EQ(-123, Int32FromEnvOrDie(GTEST_FLAG_PREFIX_UPPER_ "UnsetVar", 333));
-}
-#endif // !GTEST_OS_WINDOWS_MOBILE
-
-// Tests that Int32FromEnvOrDie() aborts with an error message
-// if the variable is not an Int32.
-TEST(Int32FromEnvOrDieDeathTest, AbortsOnFailure) {
- SetEnv(GTEST_FLAG_PREFIX_UPPER_ "VAR", "xxx");
- EXPECT_DEATH_IF_SUPPORTED(
- Int32FromEnvOrDie(GTEST_FLAG_PREFIX_UPPER_ "VAR", 123),
- ".*");
-}
-
-// Tests that Int32FromEnvOrDie() aborts with an error message
-// if the variable cannot be represnted by an Int32.
-TEST(Int32FromEnvOrDieDeathTest, AbortsOnInt32Overflow) {
- SetEnv(GTEST_FLAG_PREFIX_UPPER_ "VAR", "1234567891234567891234");
- EXPECT_DEATH_IF_SUPPORTED(
- Int32FromEnvOrDie(GTEST_FLAG_PREFIX_UPPER_ "VAR", 123),
- ".*");
-}
-
-// Tests that ShouldRunTestOnShard() selects all tests
-// where there is 1 shard.
-TEST(ShouldRunTestOnShardTest, IsPartitionWhenThereIsOneShard) {
- EXPECT_TRUE(ShouldRunTestOnShard(1, 0, 0));
- EXPECT_TRUE(ShouldRunTestOnShard(1, 0, 1));
- EXPECT_TRUE(ShouldRunTestOnShard(1, 0, 2));
- EXPECT_TRUE(ShouldRunTestOnShard(1, 0, 3));
- EXPECT_TRUE(ShouldRunTestOnShard(1, 0, 4));
-}
-
-class ShouldShardTest : public testing::Test {
- protected:
- virtual void SetUp() {
- index_var_ = GTEST_FLAG_PREFIX_UPPER_ "INDEX";
- total_var_ = GTEST_FLAG_PREFIX_UPPER_ "TOTAL";
- }
-
- virtual void TearDown() {
- SetEnv(index_var_, "");
- SetEnv(total_var_, "");
- }
-
- const char* index_var_;
- const char* total_var_;
-};
-
-// Tests that sharding is disabled if neither of the environment variables
-// are set.
-TEST_F(ShouldShardTest, ReturnsFalseWhenNeitherEnvVarIsSet) {
- SetEnv(index_var_, "");
- SetEnv(total_var_, "");
-
- EXPECT_FALSE(ShouldShard(total_var_, index_var_, false));
- EXPECT_FALSE(ShouldShard(total_var_, index_var_, true));
-}
-
-// Tests that sharding is not enabled if total_shards == 1.
-TEST_F(ShouldShardTest, ReturnsFalseWhenTotalShardIsOne) {
- SetEnv(index_var_, "0");
- SetEnv(total_var_, "1");
- EXPECT_FALSE(ShouldShard(total_var_, index_var_, false));
- EXPECT_FALSE(ShouldShard(total_var_, index_var_, true));
-}
-
-// Tests that sharding is enabled if total_shards > 1 and
-// we are not in a death test subprocess.
-// Environment variables are not supported on Windows CE.
-#if !GTEST_OS_WINDOWS_MOBILE
-TEST_F(ShouldShardTest, WorksWhenShardEnvVarsAreValid) {
- SetEnv(index_var_, "4");
- SetEnv(total_var_, "22");
- EXPECT_TRUE(ShouldShard(total_var_, index_var_, false));
- EXPECT_FALSE(ShouldShard(total_var_, index_var_, true));
-
- SetEnv(index_var_, "8");
- SetEnv(total_var_, "9");
- EXPECT_TRUE(ShouldShard(total_var_, index_var_, false));
- EXPECT_FALSE(ShouldShard(total_var_, index_var_, true));
-
- SetEnv(index_var_, "0");
- SetEnv(total_var_, "9");
- EXPECT_TRUE(ShouldShard(total_var_, index_var_, false));
- EXPECT_FALSE(ShouldShard(total_var_, index_var_, true));
-}
-#endif // !GTEST_OS_WINDOWS_MOBILE
-
-// Tests that we exit in error if the sharding values are not valid.
-
-typedef ShouldShardTest ShouldShardDeathTest;
-
-TEST_F(ShouldShardDeathTest, AbortsWhenShardingEnvVarsAreInvalid) {
- SetEnv(index_var_, "4");
- SetEnv(total_var_, "4");
- EXPECT_DEATH_IF_SUPPORTED(ShouldShard(total_var_, index_var_, false), ".*");
-
- SetEnv(index_var_, "4");
- SetEnv(total_var_, "-2");
- EXPECT_DEATH_IF_SUPPORTED(ShouldShard(total_var_, index_var_, false), ".*");
-
- SetEnv(index_var_, "5");
- SetEnv(total_var_, "");
- EXPECT_DEATH_IF_SUPPORTED(ShouldShard(total_var_, index_var_, false), ".*");
-
- SetEnv(index_var_, "");
- SetEnv(total_var_, "5");
- EXPECT_DEATH_IF_SUPPORTED(ShouldShard(total_var_, index_var_, false), ".*");
-}
-
-// Tests that ShouldRunTestOnShard is a partition when 5
-// shards are used.
-TEST(ShouldRunTestOnShardTest, IsPartitionWhenThereAreFiveShards) {
- // Choose an arbitrary number of tests and shards.
- const int num_tests = 17;
- const int num_shards = 5;
-
- // Check partitioning: each test should be on exactly 1 shard.
- for (int test_id = 0; test_id < num_tests; test_id++) {
- int prev_selected_shard_index = -1;
- for (int shard_index = 0; shard_index < num_shards; shard_index++) {
- if (ShouldRunTestOnShard(num_shards, shard_index, test_id)) {
- if (prev_selected_shard_index < 0) {
- prev_selected_shard_index = shard_index;
- } else {
- ADD_FAILURE() << "Shard " << prev_selected_shard_index << " and "
- << shard_index << " are both selected to run test " << test_id;
- }
- }
- }
- }
-
- // Check balance: This is not required by the sharding protocol, but is a
- // desirable property for performance.
- for (int shard_index = 0; shard_index < num_shards; shard_index++) {
- int num_tests_on_shard = 0;
- for (int test_id = 0; test_id < num_tests; test_id++) {
- num_tests_on_shard +=
- ShouldRunTestOnShard(num_shards, shard_index, test_id);
- }
- EXPECT_GE(num_tests_on_shard, num_tests / num_shards);
- }
-}
-
-// For the same reason we are not explicitly testing everything in the
-// Test class, there are no separate tests for the following classes
-// (except for some trivial cases):
-//
-// TestCase, UnitTest, UnitTestResultPrinter.
-//
-// Similarly, there are no separate tests for the following macros:
-//
-// TEST, TEST_F, RUN_ALL_TESTS
-
-TEST(UnitTestTest, CanGetOriginalWorkingDir) {
- ASSERT_TRUE(UnitTest::GetInstance()->original_working_dir() != NULL);
- EXPECT_STRNE(UnitTest::GetInstance()->original_working_dir(), "");
-}
-
-TEST(UnitTestTest, ReturnsPlausibleTimestamp) {
- EXPECT_LT(0, UnitTest::GetInstance()->start_timestamp());
- EXPECT_LE(UnitTest::GetInstance()->start_timestamp(), GetTimeInMillis());
-}
-
-// This group of tests is for predicate assertions (ASSERT_PRED*, etc)
-// of various arities. They do not attempt to be exhaustive. Rather,
-// view them as smoke tests that can be easily reviewed and verified.
-// A more complete set of tests for predicate assertions can be found
-// in gtest_pred_impl_unittest.cc.
-
-// First, some predicates and predicate-formatters needed by the tests.
-
-// Returns true iff the argument is an even number.
-bool IsEven(int n) {
- return (n % 2) == 0;
-}
-
-// A functor that returns true iff the argument is an even number.
-struct IsEvenFunctor {
- bool operator()(int n) { return IsEven(n); }
-};
-
-// A predicate-formatter function that asserts the argument is an even
-// number.
-AssertionResult AssertIsEven(const char* expr, int n) {
- if (IsEven(n)) {
- return AssertionSuccess();
- }
-
- Message msg;
- msg << expr << " evaluates to " << n << ", which is not even.";
- return AssertionFailure(msg);
-}
-
-// A predicate function that returns AssertionResult for use in
-// EXPECT/ASSERT_TRUE/FALSE.
-AssertionResult ResultIsEven(int n) {
- if (IsEven(n))
- return AssertionSuccess() << n << " is even";
- else
- return AssertionFailure() << n << " is odd";
-}
-
-// A predicate function that returns AssertionResult but gives no
-// explanation why it succeeds. Needed for testing that
-// EXPECT/ASSERT_FALSE handles such functions correctly.
-AssertionResult ResultIsEvenNoExplanation(int n) {
- if (IsEven(n))
- return AssertionSuccess();
- else
- return AssertionFailure() << n << " is odd";
-}
-
-// A predicate-formatter functor that asserts the argument is an even
-// number.
-struct AssertIsEvenFunctor {
- AssertionResult operator()(const char* expr, int n) {
- return AssertIsEven(expr, n);
- }
-};
-
-// Returns true iff the sum of the arguments is an even number.
-bool SumIsEven2(int n1, int n2) {
- return IsEven(n1 + n2);
-}
-
-// A functor that returns true iff the sum of the arguments is an even
-// number.
-struct SumIsEven3Functor {
- bool operator()(int n1, int n2, int n3) {
- return IsEven(n1 + n2 + n3);
- }
-};
-
-// A predicate-formatter function that asserts the sum of the
-// arguments is an even number.
-AssertionResult AssertSumIsEven4(
- const char* e1, const char* e2, const char* e3, const char* e4,
- int n1, int n2, int n3, int n4) {
- const int sum = n1 + n2 + n3 + n4;
- if (IsEven(sum)) {
- return AssertionSuccess();
- }
-
- Message msg;
- msg << e1 << " + " << e2 << " + " << e3 << " + " << e4
- << " (" << n1 << " + " << n2 << " + " << n3 << " + " << n4
- << ") evaluates to " << sum << ", which is not even.";
- return AssertionFailure(msg);
-}
-
-// A predicate-formatter functor that asserts the sum of the arguments
-// is an even number.
-struct AssertSumIsEven5Functor {
- AssertionResult operator()(
- const char* e1, const char* e2, const char* e3, const char* e4,
- const char* e5, int n1, int n2, int n3, int n4, int n5) {
- const int sum = n1 + n2 + n3 + n4 + n5;
- if (IsEven(sum)) {
- return AssertionSuccess();
- }
-
- Message msg;
- msg << e1 << " + " << e2 << " + " << e3 << " + " << e4 << " + " << e5
- << " ("
- << n1 << " + " << n2 << " + " << n3 << " + " << n4 << " + " << n5
- << ") evaluates to " << sum << ", which is not even.";
- return AssertionFailure(msg);
- }
-};
-
-
-// Tests unary predicate assertions.
-
-// Tests unary predicate assertions that don't use a custom formatter.
-TEST(Pred1Test, WithoutFormat) {
- // Success cases.
- EXPECT_PRED1(IsEvenFunctor(), 2) << "This failure is UNEXPECTED!";
- ASSERT_PRED1(IsEven, 4);
-
- // Failure cases.
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED1(IsEven, 5) << "This failure is expected.";
- }, "This failure is expected.");
- EXPECT_FATAL_FAILURE(ASSERT_PRED1(IsEvenFunctor(), 5),
- "evaluates to false");
-}
-
-// Tests unary predicate assertions that use a custom formatter.
-TEST(Pred1Test, WithFormat) {
- // Success cases.
- EXPECT_PRED_FORMAT1(AssertIsEven, 2);
- ASSERT_PRED_FORMAT1(AssertIsEvenFunctor(), 4)
- << "This failure is UNEXPECTED!";
-
- // Failure cases.
- const int n = 5;
- EXPECT_NONFATAL_FAILURE(EXPECT_PRED_FORMAT1(AssertIsEvenFunctor(), n),
- "n evaluates to 5, which is not even.");
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED_FORMAT1(AssertIsEven, 5) << "This failure is expected.";
- }, "This failure is expected.");
-}
-
-// Tests that unary predicate assertions evaluates their arguments
-// exactly once.
-TEST(Pred1Test, SingleEvaluationOnFailure) {
- // A success case.
- static int n = 0;
- EXPECT_PRED1(IsEven, n++);
- EXPECT_EQ(1, n) << "The argument is not evaluated exactly once.";
-
- // A failure case.
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED_FORMAT1(AssertIsEvenFunctor(), n++)
- << "This failure is expected.";
- }, "This failure is expected.");
- EXPECT_EQ(2, n) << "The argument is not evaluated exactly once.";
-}
-
-
-// Tests predicate assertions whose arity is >= 2.
-
-// Tests predicate assertions that don't use a custom formatter.
-TEST(PredTest, WithoutFormat) {
- // Success cases.
- ASSERT_PRED2(SumIsEven2, 2, 4) << "This failure is UNEXPECTED!";
- EXPECT_PRED3(SumIsEven3Functor(), 4, 6, 8);
-
- // Failure cases.
- const int n1 = 1;
- const int n2 = 2;
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED2(SumIsEven2, n1, n2) << "This failure is expected.";
- }, "This failure is expected.");
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED3(SumIsEven3Functor(), 1, 2, 4);
- }, "evaluates to false");
-}
-
-// Tests predicate assertions that use a custom formatter.
-TEST(PredTest, WithFormat) {
- // Success cases.
- ASSERT_PRED_FORMAT4(AssertSumIsEven4, 4, 6, 8, 10) <<
- "This failure is UNEXPECTED!";
- EXPECT_PRED_FORMAT5(AssertSumIsEven5Functor(), 2, 4, 6, 8, 10);
-
- // Failure cases.
- const int n1 = 1;
- const int n2 = 2;
- const int n3 = 4;
- const int n4 = 6;
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED_FORMAT4(AssertSumIsEven4, n1, n2, n3, n4);
- }, "evaluates to 13, which is not even.");
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED_FORMAT5(AssertSumIsEven5Functor(), 1, 2, 4, 6, 8)
- << "This failure is expected.";
- }, "This failure is expected.");
-}
-
-// Tests that predicate assertions evaluates their arguments
-// exactly once.
-TEST(PredTest, SingleEvaluationOnFailure) {
- // A success case.
- int n1 = 0;
- int n2 = 0;
- EXPECT_PRED2(SumIsEven2, n1++, n2++);
- EXPECT_EQ(1, n1) << "Argument 1 is not evaluated exactly once.";
- EXPECT_EQ(1, n2) << "Argument 2 is not evaluated exactly once.";
-
- // Another success case.
- n1 = n2 = 0;
- int n3 = 0;
- int n4 = 0;
- int n5 = 0;
- ASSERT_PRED_FORMAT5(AssertSumIsEven5Functor(),
- n1++, n2++, n3++, n4++, n5++)
- << "This failure is UNEXPECTED!";
- EXPECT_EQ(1, n1) << "Argument 1 is not evaluated exactly once.";
- EXPECT_EQ(1, n2) << "Argument 2 is not evaluated exactly once.";
- EXPECT_EQ(1, n3) << "Argument 3 is not evaluated exactly once.";
- EXPECT_EQ(1, n4) << "Argument 4 is not evaluated exactly once.";
- EXPECT_EQ(1, n5) << "Argument 5 is not evaluated exactly once.";
-
- // A failure case.
- n1 = n2 = n3 = 0;
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED3(SumIsEven3Functor(), ++n1, n2++, n3++)
- << "This failure is expected.";
- }, "This failure is expected.");
- EXPECT_EQ(1, n1) << "Argument 1 is not evaluated exactly once.";
- EXPECT_EQ(1, n2) << "Argument 2 is not evaluated exactly once.";
- EXPECT_EQ(1, n3) << "Argument 3 is not evaluated exactly once.";
-
- // Another failure case.
- n1 = n2 = n3 = n4 = 0;
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED_FORMAT4(AssertSumIsEven4, ++n1, n2++, n3++, n4++);
- }, "evaluates to 1, which is not even.");
- EXPECT_EQ(1, n1) << "Argument 1 is not evaluated exactly once.";
- EXPECT_EQ(1, n2) << "Argument 2 is not evaluated exactly once.";
- EXPECT_EQ(1, n3) << "Argument 3 is not evaluated exactly once.";
- EXPECT_EQ(1, n4) << "Argument 4 is not evaluated exactly once.";
-}
-
-
-// Some helper functions for testing using overloaded/template
-// functions with ASSERT_PREDn and EXPECT_PREDn.
-
-bool IsPositive(double x) {
- return x > 0;
-}
-
-template <typename T>
-bool IsNegative(T x) {
- return x < 0;
-}
-
-template <typename T1, typename T2>
-bool GreaterThan(T1 x1, T2 x2) {
- return x1 > x2;
-}
-
-// Tests that overloaded functions can be used in *_PRED* as long as
-// their types are explicitly specified.
-TEST(PredicateAssertionTest, AcceptsOverloadedFunction) {
- // C++Builder requires C-style casts rather than static_cast.
- EXPECT_PRED1((bool (*)(int))(IsPositive), 5); // NOLINT
- ASSERT_PRED1((bool (*)(double))(IsPositive), 6.0); // NOLINT
-}
-
-// Tests that template functions can be used in *_PRED* as long as
-// their types are explicitly specified.
-TEST(PredicateAssertionTest, AcceptsTemplateFunction) {
- EXPECT_PRED1(IsNegative<int>, -5);
- // Makes sure that we can handle templates with more than one
- // parameter.
- ASSERT_PRED2((GreaterThan<int, int>), 5, 0);
-}
-
-
-// Some helper functions for testing using overloaded/template
-// functions with ASSERT_PRED_FORMATn and EXPECT_PRED_FORMATn.
-
-AssertionResult IsPositiveFormat(const char* /* expr */, int n) {
- return n > 0 ? AssertionSuccess() :
- AssertionFailure(Message() << "Failure");
-}
-
-AssertionResult IsPositiveFormat(const char* /* expr */, double x) {
- return x > 0 ? AssertionSuccess() :
- AssertionFailure(Message() << "Failure");
-}
-
-template <typename T>
-AssertionResult IsNegativeFormat(const char* /* expr */, T x) {
- return x < 0 ? AssertionSuccess() :
- AssertionFailure(Message() << "Failure");
-}
-
-template <typename T1, typename T2>
-AssertionResult EqualsFormat(const char* /* expr1 */, const char* /* expr2 */,
- const T1& x1, const T2& x2) {
- return x1 == x2 ? AssertionSuccess() :
- AssertionFailure(Message() << "Failure");
-}
-
-// Tests that overloaded functions can be used in *_PRED_FORMAT*
-// without explicitly specifying their types.
-TEST(PredicateFormatAssertionTest, AcceptsOverloadedFunction) {
- EXPECT_PRED_FORMAT1(IsPositiveFormat, 5);
- ASSERT_PRED_FORMAT1(IsPositiveFormat, 6.0);
-}
-
-// Tests that template functions can be used in *_PRED_FORMAT* without
-// explicitly specifying their types.
-TEST(PredicateFormatAssertionTest, AcceptsTemplateFunction) {
- EXPECT_PRED_FORMAT1(IsNegativeFormat, -5);
- ASSERT_PRED_FORMAT2(EqualsFormat, 3, 3);
-}
-
-
-// Tests string assertions.
-
-// Tests ASSERT_STREQ with non-NULL arguments.
-TEST(StringAssertionTest, ASSERT_STREQ) {
- const char * const p1 = "good";
- ASSERT_STREQ(p1, p1);
-
- // Let p2 have the same content as p1, but be at a different address.
- const char p2[] = "good";
- ASSERT_STREQ(p1, p2);
-
- EXPECT_FATAL_FAILURE(ASSERT_STREQ("bad", "good"),
- "Expected: \"bad\"");
-}
-
-// Tests ASSERT_STREQ with NULL arguments.
-TEST(StringAssertionTest, ASSERT_STREQ_Null) {
- ASSERT_STREQ(static_cast<const char *>(NULL), NULL);
- EXPECT_FATAL_FAILURE(ASSERT_STREQ(NULL, "non-null"),
- "non-null");
-}
-
-// Tests ASSERT_STREQ with NULL arguments.
-TEST(StringAssertionTest, ASSERT_STREQ_Null2) {
- EXPECT_FATAL_FAILURE(ASSERT_STREQ("non-null", NULL),
- "non-null");
-}
-
-// Tests ASSERT_STRNE.
-TEST(StringAssertionTest, ASSERT_STRNE) {
- ASSERT_STRNE("hi", "Hi");
- ASSERT_STRNE("Hi", NULL);
- ASSERT_STRNE(NULL, "Hi");
- ASSERT_STRNE("", NULL);
- ASSERT_STRNE(NULL, "");
- ASSERT_STRNE("", "Hi");
- ASSERT_STRNE("Hi", "");
- EXPECT_FATAL_FAILURE(ASSERT_STRNE("Hi", "Hi"),
- "\"Hi\" vs \"Hi\"");
-}
-
-// Tests ASSERT_STRCASEEQ.
-TEST(StringAssertionTest, ASSERT_STRCASEEQ) {
- ASSERT_STRCASEEQ("hi", "Hi");
- ASSERT_STRCASEEQ(static_cast<const char *>(NULL), NULL);
-
- ASSERT_STRCASEEQ("", "");
- EXPECT_FATAL_FAILURE(ASSERT_STRCASEEQ("Hi", "hi2"),
- "(ignoring case)");
-}
-
-// Tests ASSERT_STRCASENE.
-TEST(StringAssertionTest, ASSERT_STRCASENE) {
- ASSERT_STRCASENE("hi1", "Hi2");
- ASSERT_STRCASENE("Hi", NULL);
- ASSERT_STRCASENE(NULL, "Hi");
- ASSERT_STRCASENE("", NULL);
- ASSERT_STRCASENE(NULL, "");
- ASSERT_STRCASENE("", "Hi");
- ASSERT_STRCASENE("Hi", "");
- EXPECT_FATAL_FAILURE(ASSERT_STRCASENE("Hi", "hi"),
- "(ignoring case)");
-}
-
-// Tests *_STREQ on wide strings.
-TEST(StringAssertionTest, STREQ_Wide) {
- // NULL strings.
- ASSERT_STREQ(static_cast<const wchar_t *>(NULL), NULL);
-
- // Empty strings.
- ASSERT_STREQ(L"", L"");
-
- // Non-null vs NULL.
- EXPECT_NONFATAL_FAILURE(EXPECT_STREQ(L"non-null", NULL),
- "non-null");
-
- // Equal strings.
- EXPECT_STREQ(L"Hi", L"Hi");
-
- // Unequal strings.
- EXPECT_NONFATAL_FAILURE(EXPECT_STREQ(L"abc", L"Abc"),
- "Abc");
-
- // Strings containing wide characters.
- EXPECT_NONFATAL_FAILURE(EXPECT_STREQ(L"abc\x8119", L"abc\x8120"),
- "abc");
-
- // The streaming variation.
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_STREQ(L"abc\x8119", L"abc\x8121") << "Expected failure";
- }, "Expected failure");
-}
-
-// Tests *_STRNE on wide strings.
-TEST(StringAssertionTest, STRNE_Wide) {
- // NULL strings.
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_STRNE(static_cast<const wchar_t *>(NULL), NULL);
- }, "");
-
- // Empty strings.
- EXPECT_NONFATAL_FAILURE(EXPECT_STRNE(L"", L""),
- "L\"\"");
-
- // Non-null vs NULL.
- ASSERT_STRNE(L"non-null", NULL);
-
- // Equal strings.
- EXPECT_NONFATAL_FAILURE(EXPECT_STRNE(L"Hi", L"Hi"),
- "L\"Hi\"");
-
- // Unequal strings.
- EXPECT_STRNE(L"abc", L"Abc");
-
- // Strings containing wide characters.
- EXPECT_NONFATAL_FAILURE(EXPECT_STRNE(L"abc\x8119", L"abc\x8119"),
- "abc");
-
- // The streaming variation.
- ASSERT_STRNE(L"abc\x8119", L"abc\x8120") << "This shouldn't happen";
-}
-
-// Tests for ::testing::IsSubstring().
-
-// Tests that IsSubstring() returns the correct result when the input
-// argument type is const char*.
-TEST(IsSubstringTest, ReturnsCorrectResultForCString) {
- EXPECT_FALSE(IsSubstring("", "", NULL, "a"));
- EXPECT_FALSE(IsSubstring("", "", "b", NULL));
- EXPECT_FALSE(IsSubstring("", "", "needle", "haystack"));
-
- EXPECT_TRUE(IsSubstring("", "", static_cast<const char*>(NULL), NULL));
- EXPECT_TRUE(IsSubstring("", "", "needle", "two needles"));
-}
-
-// Tests that IsSubstring() returns the correct result when the input
-// argument type is const wchar_t*.
-TEST(IsSubstringTest, ReturnsCorrectResultForWideCString) {
- EXPECT_FALSE(IsSubstring("", "", kNull, L"a"));
- EXPECT_FALSE(IsSubstring("", "", L"b", kNull));
- EXPECT_FALSE(IsSubstring("", "", L"needle", L"haystack"));
-
- EXPECT_TRUE(IsSubstring("", "", static_cast<const wchar_t*>(NULL), NULL));
- EXPECT_TRUE(IsSubstring("", "", L"needle", L"two needles"));
-}
-
-// Tests that IsSubstring() generates the correct message when the input
-// argument type is const char*.
-TEST(IsSubstringTest, GeneratesCorrectMessageForCString) {
- EXPECT_STREQ("Value of: needle_expr\n"
- " Actual: \"needle\"\n"
- "Expected: a substring of haystack_expr\n"
- "Which is: \"haystack\"",
- IsSubstring("needle_expr", "haystack_expr",
- "needle", "haystack").failure_message());
-}
-
-// Tests that IsSubstring returns the correct result when the input
-// argument type is ::std::string.
-TEST(IsSubstringTest, ReturnsCorrectResultsForStdString) {
- EXPECT_TRUE(IsSubstring("", "", std::string("hello"), "ahellob"));
- EXPECT_FALSE(IsSubstring("", "", "hello", std::string("world")));
-}
-
-#if GTEST_HAS_STD_WSTRING
-// Tests that IsSubstring returns the correct result when the input
-// argument type is ::std::wstring.
-TEST(IsSubstringTest, ReturnsCorrectResultForStdWstring) {
- EXPECT_TRUE(IsSubstring("", "", ::std::wstring(L"needle"), L"two needles"));
- EXPECT_FALSE(IsSubstring("", "", L"needle", ::std::wstring(L"haystack")));
-}
-
-// Tests that IsSubstring() generates the correct message when the input
-// argument type is ::std::wstring.
-TEST(IsSubstringTest, GeneratesCorrectMessageForWstring) {
- EXPECT_STREQ("Value of: needle_expr\n"
- " Actual: L\"needle\"\n"
- "Expected: a substring of haystack_expr\n"
- "Which is: L\"haystack\"",
- IsSubstring(
- "needle_expr", "haystack_expr",
- ::std::wstring(L"needle"), L"haystack").failure_message());
-}
-
-#endif // GTEST_HAS_STD_WSTRING
-
-// Tests for ::testing::IsNotSubstring().
-
-// Tests that IsNotSubstring() returns the correct result when the input
-// argument type is const char*.
-TEST(IsNotSubstringTest, ReturnsCorrectResultForCString) {
- EXPECT_TRUE(IsNotSubstring("", "", "needle", "haystack"));
- EXPECT_FALSE(IsNotSubstring("", "", "needle", "two needles"));
-}
-
-// Tests that IsNotSubstring() returns the correct result when the input
-// argument type is const wchar_t*.
-TEST(IsNotSubstringTest, ReturnsCorrectResultForWideCString) {
- EXPECT_TRUE(IsNotSubstring("", "", L"needle", L"haystack"));
- EXPECT_FALSE(IsNotSubstring("", "", L"needle", L"two needles"));
-}
-
-// Tests that IsNotSubstring() generates the correct message when the input
-// argument type is const wchar_t*.
-TEST(IsNotSubstringTest, GeneratesCorrectMessageForWideCString) {
- EXPECT_STREQ("Value of: needle_expr\n"
- " Actual: L\"needle\"\n"
- "Expected: not a substring of haystack_expr\n"
- "Which is: L\"two needles\"",
- IsNotSubstring(
- "needle_expr", "haystack_expr",
- L"needle", L"two needles").failure_message());
-}
-
-// Tests that IsNotSubstring returns the correct result when the input
-// argument type is ::std::string.
-TEST(IsNotSubstringTest, ReturnsCorrectResultsForStdString) {
- EXPECT_FALSE(IsNotSubstring("", "", std::string("hello"), "ahellob"));
- EXPECT_TRUE(IsNotSubstring("", "", "hello", std::string("world")));
-}
-
-// Tests that IsNotSubstring() generates the correct message when the input
-// argument type is ::std::string.
-TEST(IsNotSubstringTest, GeneratesCorrectMessageForStdString) {
- EXPECT_STREQ("Value of: needle_expr\n"
- " Actual: \"needle\"\n"
- "Expected: not a substring of haystack_expr\n"
- "Which is: \"two needles\"",
- IsNotSubstring(
- "needle_expr", "haystack_expr",
- ::std::string("needle"), "two needles").failure_message());
-}
-
-#if GTEST_HAS_STD_WSTRING
-
-// Tests that IsNotSubstring returns the correct result when the input
-// argument type is ::std::wstring.
-TEST(IsNotSubstringTest, ReturnsCorrectResultForStdWstring) {
- EXPECT_FALSE(
- IsNotSubstring("", "", ::std::wstring(L"needle"), L"two needles"));
- EXPECT_TRUE(IsNotSubstring("", "", L"needle", ::std::wstring(L"haystack")));
-}
-
-#endif // GTEST_HAS_STD_WSTRING
-
-// Tests floating-point assertions.
-
-template <typename RawType>
-class FloatingPointTest : public Test {
- protected:
- // Pre-calculated numbers to be used by the tests.
- struct TestValues {
- RawType close_to_positive_zero;
- RawType close_to_negative_zero;
- RawType further_from_negative_zero;
-
- RawType close_to_one;
- RawType further_from_one;
-
- RawType infinity;
- RawType close_to_infinity;
- RawType further_from_infinity;
-
- RawType nan1;
- RawType nan2;
- };
-
- typedef typename testing::internal::FloatingPoint<RawType> Floating;
- typedef typename Floating::Bits Bits;
-
- virtual void SetUp() {
- const size_t max_ulps = Floating::kMaxUlps;
-
- // The bits that represent 0.0.
- const Bits zero_bits = Floating(0).bits();
-
- // Makes some numbers close to 0.0.
- values_.close_to_positive_zero = Floating::ReinterpretBits(
- zero_bits + max_ulps/2);
- values_.close_to_negative_zero = -Floating::ReinterpretBits(
- zero_bits + max_ulps - max_ulps/2);
- values_.further_from_negative_zero = -Floating::ReinterpretBits(
- zero_bits + max_ulps + 1 - max_ulps/2);
-
- // The bits that represent 1.0.
- const Bits one_bits = Floating(1).bits();
-
- // Makes some numbers close to 1.0.
- values_.close_to_one = Floating::ReinterpretBits(one_bits + max_ulps);
- values_.further_from_one = Floating::ReinterpretBits(
- one_bits + max_ulps + 1);
-
- // +infinity.
- values_.infinity = Floating::Infinity();
-
- // The bits that represent +infinity.
- const Bits infinity_bits = Floating(values_.infinity).bits();
-
- // Makes some numbers close to infinity.
- values_.close_to_infinity = Floating::ReinterpretBits(
- infinity_bits - max_ulps);
- values_.further_from_infinity = Floating::ReinterpretBits(
- infinity_bits - max_ulps - 1);
-
- // Makes some NAN's. Sets the most significant bit of the fraction so that
- // our NaN's are quiet; trying to process a signaling NaN would raise an
- // exception if our environment enables floating point exceptions.
- values_.nan1 = Floating::ReinterpretBits(Floating::kExponentBitMask
- | (static_cast<Bits>(1) << (Floating::kFractionBitCount - 1)) | 1);
- values_.nan2 = Floating::ReinterpretBits(Floating::kExponentBitMask
- | (static_cast<Bits>(1) << (Floating::kFractionBitCount - 1)) | 200);
- }
-
- void TestSize() {
- EXPECT_EQ(sizeof(RawType), sizeof(Bits));
- }
-
- static TestValues values_;
-};
-
-template <typename RawType>
-typename FloatingPointTest<RawType>::TestValues
- FloatingPointTest<RawType>::values_;
-
-// Instantiates FloatingPointTest for testing *_FLOAT_EQ.
-typedef FloatingPointTest<float> FloatTest;
-
-// Tests that the size of Float::Bits matches the size of float.
-TEST_F(FloatTest, Size) {
- TestSize();
-}
-
-// Tests comparing with +0 and -0.
-TEST_F(FloatTest, Zeros) {
- EXPECT_FLOAT_EQ(0.0, -0.0);
- EXPECT_NONFATAL_FAILURE(EXPECT_FLOAT_EQ(-0.0, 1.0),
- "1.0");
- EXPECT_FATAL_FAILURE(ASSERT_FLOAT_EQ(0.0, 1.5),
- "1.5");
-}
-
-// Tests comparing numbers close to 0.
-//
-// This ensures that *_FLOAT_EQ handles the sign correctly and no
-// overflow occurs when comparing numbers whose absolute value is very
-// small.
-TEST_F(FloatTest, AlmostZeros) {
- // In C++Builder, names within local classes (such as used by
- // EXPECT_FATAL_FAILURE) cannot be resolved against static members of the
- // scoping class. Use a static local alias as a workaround.
- // We use the assignment syntax since some compilers, like Sun Studio,
- // don't allow initializing references using construction syntax
- // (parentheses).
- static const FloatTest::TestValues& v = this->values_;
-
- EXPECT_FLOAT_EQ(0.0, v.close_to_positive_zero);
- EXPECT_FLOAT_EQ(-0.0, v.close_to_negative_zero);
- EXPECT_FLOAT_EQ(v.close_to_positive_zero, v.close_to_negative_zero);
-
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_FLOAT_EQ(v.close_to_positive_zero,
- v.further_from_negative_zero);
- }, "v.further_from_negative_zero");
-}
-
-// Tests comparing numbers close to each other.
-TEST_F(FloatTest, SmallDiff) {
- EXPECT_FLOAT_EQ(1.0, values_.close_to_one);
- EXPECT_NONFATAL_FAILURE(EXPECT_FLOAT_EQ(1.0, values_.further_from_one),
- "values_.further_from_one");
-}
-
-// Tests comparing numbers far apart.
-TEST_F(FloatTest, LargeDiff) {
- EXPECT_NONFATAL_FAILURE(EXPECT_FLOAT_EQ(2.5, 3.0),
- "3.0");
-}
-
-// Tests comparing with infinity.
-//
-// This ensures that no overflow occurs when comparing numbers whose
-// absolute value is very large.
-TEST_F(FloatTest, Infinity) {
- EXPECT_FLOAT_EQ(values_.infinity, values_.close_to_infinity);
- EXPECT_FLOAT_EQ(-values_.infinity, -values_.close_to_infinity);
-#if !GTEST_OS_SYMBIAN
- // Nokia's STLport crashes if we try to output infinity or NaN.
- EXPECT_NONFATAL_FAILURE(EXPECT_FLOAT_EQ(values_.infinity, -values_.infinity),
- "-values_.infinity");
-
- // This is interesting as the representations of infinity and nan1
- // are only 1 DLP apart.
- EXPECT_NONFATAL_FAILURE(EXPECT_FLOAT_EQ(values_.infinity, values_.nan1),
- "values_.nan1");
-#endif // !GTEST_OS_SYMBIAN
-}
-
-// Tests that comparing with NAN always returns false.
-TEST_F(FloatTest, NaN) {
-#if !GTEST_OS_SYMBIAN
-// Nokia's STLport crashes if we try to output infinity or NaN.
-
- // In C++Builder, names within local classes (such as used by
- // EXPECT_FATAL_FAILURE) cannot be resolved against static members of the
- // scoping class. Use a static local alias as a workaround.
- // We use the assignment syntax since some compilers, like Sun Studio,
- // don't allow initializing references using construction syntax
- // (parentheses).
- static const FloatTest::TestValues& v = this->values_;
-
- EXPECT_NONFATAL_FAILURE(EXPECT_FLOAT_EQ(v.nan1, v.nan1),
- "v.nan1");
- EXPECT_NONFATAL_FAILURE(EXPECT_FLOAT_EQ(v.nan1, v.nan2),
- "v.nan2");
- EXPECT_NONFATAL_FAILURE(EXPECT_FLOAT_EQ(1.0, v.nan1),
- "v.nan1");
-
- EXPECT_FATAL_FAILURE(ASSERT_FLOAT_EQ(v.nan1, v.infinity),
- "v.infinity");
-#endif // !GTEST_OS_SYMBIAN
-}
-
-// Tests that *_FLOAT_EQ are reflexive.
-TEST_F(FloatTest, Reflexive) {
- EXPECT_FLOAT_EQ(0.0, 0.0);
- EXPECT_FLOAT_EQ(1.0, 1.0);
- ASSERT_FLOAT_EQ(values_.infinity, values_.infinity);
-}
-
-// Tests that *_FLOAT_EQ are commutative.
-TEST_F(FloatTest, Commutative) {
- // We already tested EXPECT_FLOAT_EQ(1.0, values_.close_to_one).
- EXPECT_FLOAT_EQ(values_.close_to_one, 1.0);
-
- // We already tested EXPECT_FLOAT_EQ(1.0, values_.further_from_one).
- EXPECT_NONFATAL_FAILURE(EXPECT_FLOAT_EQ(values_.further_from_one, 1.0),
- "1.0");
-}
-
-// Tests EXPECT_NEAR.
-TEST_F(FloatTest, EXPECT_NEAR) {
- EXPECT_NEAR(-1.0f, -1.1f, 0.2f);
- EXPECT_NEAR(2.0f, 3.0f, 1.0f);
- EXPECT_NONFATAL_FAILURE(EXPECT_NEAR(1.0f,1.5f, 0.25f), // NOLINT
- "The difference between 1.0f and 1.5f is 0.5, "
- "which exceeds 0.25f");
- // To work around a bug in gcc 2.95.0, there is intentionally no
- // space after the first comma in the previous line.
-}
-
-// Tests ASSERT_NEAR.
-TEST_F(FloatTest, ASSERT_NEAR) {
- ASSERT_NEAR(-1.0f, -1.1f, 0.2f);
- ASSERT_NEAR(2.0f, 3.0f, 1.0f);
- EXPECT_FATAL_FAILURE(ASSERT_NEAR(1.0f,1.5f, 0.25f), // NOLINT
- "The difference between 1.0f and 1.5f is 0.5, "
- "which exceeds 0.25f");
- // To work around a bug in gcc 2.95.0, there is intentionally no
- // space after the first comma in the previous line.
-}
-
-// Tests the cases where FloatLE() should succeed.
-TEST_F(FloatTest, FloatLESucceeds) {
- EXPECT_PRED_FORMAT2(FloatLE, 1.0f, 2.0f); // When val1 < val2,
- ASSERT_PRED_FORMAT2(FloatLE, 1.0f, 1.0f); // val1 == val2,
-
- // or when val1 is greater than, but almost equals to, val2.
- EXPECT_PRED_FORMAT2(FloatLE, values_.close_to_positive_zero, 0.0f);
-}
-
-// Tests the cases where FloatLE() should fail.
-TEST_F(FloatTest, FloatLEFails) {
- // When val1 is greater than val2 by a large margin,
- EXPECT_NONFATAL_FAILURE(EXPECT_PRED_FORMAT2(FloatLE, 2.0f, 1.0f),
- "(2.0f) <= (1.0f)");
-
- // or by a small yet non-negligible margin,
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED_FORMAT2(FloatLE, values_.further_from_one, 1.0f);
- }, "(values_.further_from_one) <= (1.0f)");
-
-#if !GTEST_OS_SYMBIAN && !defined(__BORLANDC__)
- // Nokia's STLport crashes if we try to output infinity or NaN.
- // C++Builder gives bad results for ordered comparisons involving NaNs
- // due to compiler bugs.
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED_FORMAT2(FloatLE, values_.nan1, values_.infinity);
- }, "(values_.nan1) <= (values_.infinity)");
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED_FORMAT2(FloatLE, -values_.infinity, values_.nan1);
- }, "(-values_.infinity) <= (values_.nan1)");
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED_FORMAT2(FloatLE, values_.nan1, values_.nan1);
- }, "(values_.nan1) <= (values_.nan1)");
-#endif // !GTEST_OS_SYMBIAN && !defined(__BORLANDC__)
-}
-
-// Instantiates FloatingPointTest for testing *_DOUBLE_EQ.
-typedef FloatingPointTest<double> DoubleTest;
-
-// Tests that the size of Double::Bits matches the size of double.
-TEST_F(DoubleTest, Size) {
- TestSize();
-}
-
-// Tests comparing with +0 and -0.
-TEST_F(DoubleTest, Zeros) {
- EXPECT_DOUBLE_EQ(0.0, -0.0);
- EXPECT_NONFATAL_FAILURE(EXPECT_DOUBLE_EQ(-0.0, 1.0),
- "1.0");
- EXPECT_FATAL_FAILURE(ASSERT_DOUBLE_EQ(0.0, 1.0),
- "1.0");
-}
-
-// Tests comparing numbers close to 0.
-//
-// This ensures that *_DOUBLE_EQ handles the sign correctly and no
-// overflow occurs when comparing numbers whose absolute value is very
-// small.
-TEST_F(DoubleTest, AlmostZeros) {
- // In C++Builder, names within local classes (such as used by
- // EXPECT_FATAL_FAILURE) cannot be resolved against static members of the
- // scoping class. Use a static local alias as a workaround.
- // We use the assignment syntax since some compilers, like Sun Studio,
- // don't allow initializing references using construction syntax
- // (parentheses).
- static const DoubleTest::TestValues& v = this->values_;
-
- EXPECT_DOUBLE_EQ(0.0, v.close_to_positive_zero);
- EXPECT_DOUBLE_EQ(-0.0, v.close_to_negative_zero);
- EXPECT_DOUBLE_EQ(v.close_to_positive_zero, v.close_to_negative_zero);
-
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_DOUBLE_EQ(v.close_to_positive_zero,
- v.further_from_negative_zero);
- }, "v.further_from_negative_zero");
-}
-
-// Tests comparing numbers close to each other.
-TEST_F(DoubleTest, SmallDiff) {
- EXPECT_DOUBLE_EQ(1.0, values_.close_to_one);
- EXPECT_NONFATAL_FAILURE(EXPECT_DOUBLE_EQ(1.0, values_.further_from_one),
- "values_.further_from_one");
-}
-
-// Tests comparing numbers far apart.
-TEST_F(DoubleTest, LargeDiff) {
- EXPECT_NONFATAL_FAILURE(EXPECT_DOUBLE_EQ(2.0, 3.0),
- "3.0");
-}
-
-// Tests comparing with infinity.
-//
-// This ensures that no overflow occurs when comparing numbers whose
-// absolute value is very large.
-TEST_F(DoubleTest, Infinity) {
- EXPECT_DOUBLE_EQ(values_.infinity, values_.close_to_infinity);
- EXPECT_DOUBLE_EQ(-values_.infinity, -values_.close_to_infinity);
-#if !GTEST_OS_SYMBIAN
- // Nokia's STLport crashes if we try to output infinity or NaN.
- EXPECT_NONFATAL_FAILURE(EXPECT_DOUBLE_EQ(values_.infinity, -values_.infinity),
- "-values_.infinity");
-
- // This is interesting as the representations of infinity_ and nan1_
- // are only 1 DLP apart.
- EXPECT_NONFATAL_FAILURE(EXPECT_DOUBLE_EQ(values_.infinity, values_.nan1),
- "values_.nan1");
-#endif // !GTEST_OS_SYMBIAN
-}
-
-// Tests that comparing with NAN always returns false.
-TEST_F(DoubleTest, NaN) {
-#if !GTEST_OS_SYMBIAN
- // In C++Builder, names within local classes (such as used by
- // EXPECT_FATAL_FAILURE) cannot be resolved against static members of the
- // scoping class. Use a static local alias as a workaround.
- // We use the assignment syntax since some compilers, like Sun Studio,
- // don't allow initializing references using construction syntax
- // (parentheses).
- static const DoubleTest::TestValues& v = this->values_;
-
- // Nokia's STLport crashes if we try to output infinity or NaN.
- EXPECT_NONFATAL_FAILURE(EXPECT_DOUBLE_EQ(v.nan1, v.nan1),
- "v.nan1");
- EXPECT_NONFATAL_FAILURE(EXPECT_DOUBLE_EQ(v.nan1, v.nan2), "v.nan2");
- EXPECT_NONFATAL_FAILURE(EXPECT_DOUBLE_EQ(1.0, v.nan1), "v.nan1");
- EXPECT_FATAL_FAILURE(ASSERT_DOUBLE_EQ(v.nan1, v.infinity),
- "v.infinity");
-#endif // !GTEST_OS_SYMBIAN
-}
-
-// Tests that *_DOUBLE_EQ are reflexive.
-TEST_F(DoubleTest, Reflexive) {
- EXPECT_DOUBLE_EQ(0.0, 0.0);
- EXPECT_DOUBLE_EQ(1.0, 1.0);
-#if !GTEST_OS_SYMBIAN
- // Nokia's STLport crashes if we try to output infinity or NaN.
- ASSERT_DOUBLE_EQ(values_.infinity, values_.infinity);
-#endif // !GTEST_OS_SYMBIAN
-}
-
-// Tests that *_DOUBLE_EQ are commutative.
-TEST_F(DoubleTest, Commutative) {
- // We already tested EXPECT_DOUBLE_EQ(1.0, values_.close_to_one).
- EXPECT_DOUBLE_EQ(values_.close_to_one, 1.0);
-
- // We already tested EXPECT_DOUBLE_EQ(1.0, values_.further_from_one).
- EXPECT_NONFATAL_FAILURE(EXPECT_DOUBLE_EQ(values_.further_from_one, 1.0),
- "1.0");
-}
-
-// Tests EXPECT_NEAR.
-TEST_F(DoubleTest, EXPECT_NEAR) {
- EXPECT_NEAR(-1.0, -1.1, 0.2);
- EXPECT_NEAR(2.0, 3.0, 1.0);
- EXPECT_NONFATAL_FAILURE(EXPECT_NEAR(1.0, 1.5, 0.25), // NOLINT
- "The difference between 1.0 and 1.5 is 0.5, "
- "which exceeds 0.25");
- // To work around a bug in gcc 2.95.0, there is intentionally no
- // space after the first comma in the previous statement.
-}
-
-// Tests ASSERT_NEAR.
-TEST_F(DoubleTest, ASSERT_NEAR) {
- ASSERT_NEAR(-1.0, -1.1, 0.2);
- ASSERT_NEAR(2.0, 3.0, 1.0);
- EXPECT_FATAL_FAILURE(ASSERT_NEAR(1.0, 1.5, 0.25), // NOLINT
- "The difference between 1.0 and 1.5 is 0.5, "
- "which exceeds 0.25");
- // To work around a bug in gcc 2.95.0, there is intentionally no
- // space after the first comma in the previous statement.
-}
-
-// Tests the cases where DoubleLE() should succeed.
-TEST_F(DoubleTest, DoubleLESucceeds) {
- EXPECT_PRED_FORMAT2(DoubleLE, 1.0, 2.0); // When val1 < val2,
- ASSERT_PRED_FORMAT2(DoubleLE, 1.0, 1.0); // val1 == val2,
-
- // or when val1 is greater than, but almost equals to, val2.
- EXPECT_PRED_FORMAT2(DoubleLE, values_.close_to_positive_zero, 0.0);
-}
-
-// Tests the cases where DoubleLE() should fail.
-TEST_F(DoubleTest, DoubleLEFails) {
- // When val1 is greater than val2 by a large margin,
- EXPECT_NONFATAL_FAILURE(EXPECT_PRED_FORMAT2(DoubleLE, 2.0, 1.0),
- "(2.0) <= (1.0)");
-
- // or by a small yet non-negligible margin,
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED_FORMAT2(DoubleLE, values_.further_from_one, 1.0);
- }, "(values_.further_from_one) <= (1.0)");
-
-#if !GTEST_OS_SYMBIAN && !defined(__BORLANDC__)
- // Nokia's STLport crashes if we try to output infinity or NaN.
- // C++Builder gives bad results for ordered comparisons involving NaNs
- // due to compiler bugs.
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED_FORMAT2(DoubleLE, values_.nan1, values_.infinity);
- }, "(values_.nan1) <= (values_.infinity)");
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED_FORMAT2(DoubleLE, -values_.infinity, values_.nan1);
- }, " (-values_.infinity) <= (values_.nan1)");
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED_FORMAT2(DoubleLE, values_.nan1, values_.nan1);
- }, "(values_.nan1) <= (values_.nan1)");
-#endif // !GTEST_OS_SYMBIAN && !defined(__BORLANDC__)
-}
-
-
-// Verifies that a test or test case whose name starts with DISABLED_ is
-// not run.
-
-// A test whose name starts with DISABLED_.
-// Should not run.
-TEST(DisabledTest, DISABLED_TestShouldNotRun) {
- FAIL() << "Unexpected failure: Disabled test should not be run.";
-}
-
-// A test whose name does not start with DISABLED_.
-// Should run.
-TEST(DisabledTest, NotDISABLED_TestShouldRun) {
- EXPECT_EQ(1, 1);
-}
-
-// A test case whose name starts with DISABLED_.
-// Should not run.
-TEST(DISABLED_TestCase, TestShouldNotRun) {
- FAIL() << "Unexpected failure: Test in disabled test case should not be run.";
-}
-
-// A test case and test whose names start with DISABLED_.
-// Should not run.
-TEST(DISABLED_TestCase, DISABLED_TestShouldNotRun) {
- FAIL() << "Unexpected failure: Test in disabled test case should not be run.";
-}
-
-// Check that when all tests in a test case are disabled, SetupTestCase() and
-// TearDownTestCase() are not called.
-class DisabledTestsTest : public Test {
- protected:
- static void SetUpTestCase() {
- FAIL() << "Unexpected failure: All tests disabled in test case. "
- "SetupTestCase() should not be called.";
- }
-
- static void TearDownTestCase() {
- FAIL() << "Unexpected failure: All tests disabled in test case. "
- "TearDownTestCase() should not be called.";
- }
-};
-
-TEST_F(DisabledTestsTest, DISABLED_TestShouldNotRun_1) {
- FAIL() << "Unexpected failure: Disabled test should not be run.";
-}
-
-TEST_F(DisabledTestsTest, DISABLED_TestShouldNotRun_2) {
- FAIL() << "Unexpected failure: Disabled test should not be run.";
-}
-
-// Tests that disabled typed tests aren't run.
-
-#if GTEST_HAS_TYPED_TEST
-
-template <typename T>
-class TypedTest : public Test {
-};
-
-typedef testing::Types<int, double> NumericTypes;
-TYPED_TEST_CASE(TypedTest, NumericTypes);
-
-TYPED_TEST(TypedTest, DISABLED_ShouldNotRun) {
- FAIL() << "Unexpected failure: Disabled typed test should not run.";
-}
-
-template <typename T>
-class DISABLED_TypedTest : public Test {
-};
-
-TYPED_TEST_CASE(DISABLED_TypedTest, NumericTypes);
-
-TYPED_TEST(DISABLED_TypedTest, ShouldNotRun) {
- FAIL() << "Unexpected failure: Disabled typed test should not run.";
-}
-
-#endif // GTEST_HAS_TYPED_TEST
-
-// Tests that disabled type-parameterized tests aren't run.
-
-#if GTEST_HAS_TYPED_TEST_P
-
-template <typename T>
-class TypedTestP : public Test {
-};
-
-TYPED_TEST_CASE_P(TypedTestP);
-
-TYPED_TEST_P(TypedTestP, DISABLED_ShouldNotRun) {
- FAIL() << "Unexpected failure: "
- << "Disabled type-parameterized test should not run.";
-}
-
-REGISTER_TYPED_TEST_CASE_P(TypedTestP, DISABLED_ShouldNotRun);
-
-INSTANTIATE_TYPED_TEST_CASE_P(My, TypedTestP, NumericTypes);
-
-template <typename T>
-class DISABLED_TypedTestP : public Test {
-};
-
-TYPED_TEST_CASE_P(DISABLED_TypedTestP);
-
-TYPED_TEST_P(DISABLED_TypedTestP, ShouldNotRun) {
- FAIL() << "Unexpected failure: "
- << "Disabled type-parameterized test should not run.";
-}
-
-REGISTER_TYPED_TEST_CASE_P(DISABLED_TypedTestP, ShouldNotRun);
-
-INSTANTIATE_TYPED_TEST_CASE_P(My, DISABLED_TypedTestP, NumericTypes);
-
-#endif // GTEST_HAS_TYPED_TEST_P
-
-// Tests that assertion macros evaluate their arguments exactly once.
-
-class SingleEvaluationTest : public Test {
- public: // Must be public and not protected due to a bug in g++ 3.4.2.
- // This helper function is needed by the FailedASSERT_STREQ test
- // below. It's public to work around C++Builder's bug with scoping local
- // classes.
- static void CompareAndIncrementCharPtrs() {
- ASSERT_STREQ(p1_++, p2_++);
- }
-
- // This helper function is needed by the FailedASSERT_NE test below. It's
- // public to work around C++Builder's bug with scoping local classes.
- static void CompareAndIncrementInts() {
- ASSERT_NE(a_++, b_++);
- }
-
- protected:
- SingleEvaluationTest() {
- p1_ = s1_;
- p2_ = s2_;
- a_ = 0;
- b_ = 0;
- }
-
- static const char* const s1_;
- static const char* const s2_;
- static const char* p1_;
- static const char* p2_;
-
- static int a_;
- static int b_;
-};
-
-const char* const SingleEvaluationTest::s1_ = "01234";
-const char* const SingleEvaluationTest::s2_ = "abcde";
-const char* SingleEvaluationTest::p1_;
-const char* SingleEvaluationTest::p2_;
-int SingleEvaluationTest::a_;
-int SingleEvaluationTest::b_;
-
-// Tests that when ASSERT_STREQ fails, it evaluates its arguments
-// exactly once.
-TEST_F(SingleEvaluationTest, FailedASSERT_STREQ) {
- EXPECT_FATAL_FAILURE(SingleEvaluationTest::CompareAndIncrementCharPtrs(),
- "p2_++");
- EXPECT_EQ(s1_ + 1, p1_);
- EXPECT_EQ(s2_ + 1, p2_);
-}
-
-// Tests that string assertion arguments are evaluated exactly once.
-TEST_F(SingleEvaluationTest, ASSERT_STR) {
- // successful EXPECT_STRNE
- EXPECT_STRNE(p1_++, p2_++);
- EXPECT_EQ(s1_ + 1, p1_);
- EXPECT_EQ(s2_ + 1, p2_);
-
- // failed EXPECT_STRCASEEQ
- EXPECT_NONFATAL_FAILURE(EXPECT_STRCASEEQ(p1_++, p2_++),
- "ignoring case");
- EXPECT_EQ(s1_ + 2, p1_);
- EXPECT_EQ(s2_ + 2, p2_);
-}
-
-// Tests that when ASSERT_NE fails, it evaluates its arguments exactly
-// once.
-TEST_F(SingleEvaluationTest, FailedASSERT_NE) {
- EXPECT_FATAL_FAILURE(SingleEvaluationTest::CompareAndIncrementInts(),
- "(a_++) != (b_++)");
- EXPECT_EQ(1, a_);
- EXPECT_EQ(1, b_);
-}
-
-// Tests that assertion arguments are evaluated exactly once.
-TEST_F(SingleEvaluationTest, OtherCases) {
- // successful EXPECT_TRUE
- EXPECT_TRUE(0 == a_++); // NOLINT
- EXPECT_EQ(1, a_);
-
- // failed EXPECT_TRUE
- EXPECT_NONFATAL_FAILURE(EXPECT_TRUE(-1 == a_++), "-1 == a_++");
- EXPECT_EQ(2, a_);
-
- // successful EXPECT_GT
- EXPECT_GT(a_++, b_++);
- EXPECT_EQ(3, a_);
- EXPECT_EQ(1, b_);
-
- // failed EXPECT_LT
- EXPECT_NONFATAL_FAILURE(EXPECT_LT(a_++, b_++), "(a_++) < (b_++)");
- EXPECT_EQ(4, a_);
- EXPECT_EQ(2, b_);
-
- // successful ASSERT_TRUE
- ASSERT_TRUE(0 < a_++); // NOLINT
- EXPECT_EQ(5, a_);
-
- // successful ASSERT_GT
- ASSERT_GT(a_++, b_++);
- EXPECT_EQ(6, a_);
- EXPECT_EQ(3, b_);
-}
-
-#if GTEST_HAS_EXCEPTIONS
-
-void ThrowAnInteger() {
- throw 1;
-}
-
-// Tests that assertion arguments are evaluated exactly once.
-TEST_F(SingleEvaluationTest, ExceptionTests) {
- // successful EXPECT_THROW
- EXPECT_THROW({ // NOLINT
- a_++;
- ThrowAnInteger();
- }, int);
- EXPECT_EQ(1, a_);
-
- // failed EXPECT_THROW, throws different
- EXPECT_NONFATAL_FAILURE(EXPECT_THROW({ // NOLINT
- a_++;
- ThrowAnInteger();
- }, bool), "throws a different type");
- EXPECT_EQ(2, a_);
-
- // failed EXPECT_THROW, throws nothing
- EXPECT_NONFATAL_FAILURE(EXPECT_THROW(a_++, bool), "throws nothing");
- EXPECT_EQ(3, a_);
-
- // successful EXPECT_NO_THROW
- EXPECT_NO_THROW(a_++);
- EXPECT_EQ(4, a_);
-
- // failed EXPECT_NO_THROW
- EXPECT_NONFATAL_FAILURE(EXPECT_NO_THROW({ // NOLINT
- a_++;
- ThrowAnInteger();
- }), "it throws");
- EXPECT_EQ(5, a_);
-
- // successful EXPECT_ANY_THROW
- EXPECT_ANY_THROW({ // NOLINT
- a_++;
- ThrowAnInteger();
- });
- EXPECT_EQ(6, a_);
-
- // failed EXPECT_ANY_THROW
- EXPECT_NONFATAL_FAILURE(EXPECT_ANY_THROW(a_++), "it doesn't");
- EXPECT_EQ(7, a_);
-}
-
-#endif // GTEST_HAS_EXCEPTIONS
-
-// Tests {ASSERT|EXPECT}_NO_FATAL_FAILURE.
-class NoFatalFailureTest : public Test {
- protected:
- void Succeeds() {}
- void FailsNonFatal() {
- ADD_FAILURE() << "some non-fatal failure";
- }
- void Fails() {
- FAIL() << "some fatal failure";
- }
-
- void DoAssertNoFatalFailureOnFails() {
- ASSERT_NO_FATAL_FAILURE(Fails());
- ADD_FAILURE() << "shold not reach here.";
- }
-
- void DoExpectNoFatalFailureOnFails() {
- EXPECT_NO_FATAL_FAILURE(Fails());
- ADD_FAILURE() << "other failure";
- }
-};
-
-TEST_F(NoFatalFailureTest, NoFailure) {
- EXPECT_NO_FATAL_FAILURE(Succeeds());
- ASSERT_NO_FATAL_FAILURE(Succeeds());
-}
-
-TEST_F(NoFatalFailureTest, NonFatalIsNoFailure) {
- EXPECT_NONFATAL_FAILURE(
- EXPECT_NO_FATAL_FAILURE(FailsNonFatal()),
- "some non-fatal failure");
- EXPECT_NONFATAL_FAILURE(
- ASSERT_NO_FATAL_FAILURE(FailsNonFatal()),
- "some non-fatal failure");
-}
-
-TEST_F(NoFatalFailureTest, AssertNoFatalFailureOnFatalFailure) {
- TestPartResultArray gtest_failures;
- {
- ScopedFakeTestPartResultReporter gtest_reporter(&gtest_failures);
- DoAssertNoFatalFailureOnFails();
- }
- ASSERT_EQ(2, gtest_failures.size());
- EXPECT_EQ(TestPartResult::kFatalFailure,
- gtest_failures.GetTestPartResult(0).type());
- EXPECT_EQ(TestPartResult::kFatalFailure,
- gtest_failures.GetTestPartResult(1).type());
- EXPECT_PRED_FORMAT2(testing::IsSubstring, "some fatal failure",
- gtest_failures.GetTestPartResult(0).message());
- EXPECT_PRED_FORMAT2(testing::IsSubstring, "it does",
- gtest_failures.GetTestPartResult(1).message());
-}
-
-TEST_F(NoFatalFailureTest, ExpectNoFatalFailureOnFatalFailure) {
- TestPartResultArray gtest_failures;
- {
- ScopedFakeTestPartResultReporter gtest_reporter(&gtest_failures);
- DoExpectNoFatalFailureOnFails();
- }
- ASSERT_EQ(3, gtest_failures.size());
- EXPECT_EQ(TestPartResult::kFatalFailure,
- gtest_failures.GetTestPartResult(0).type());
- EXPECT_EQ(TestPartResult::kNonFatalFailure,
- gtest_failures.GetTestPartResult(1).type());
- EXPECT_EQ(TestPartResult::kNonFatalFailure,
- gtest_failures.GetTestPartResult(2).type());
- EXPECT_PRED_FORMAT2(testing::IsSubstring, "some fatal failure",
- gtest_failures.GetTestPartResult(0).message());
- EXPECT_PRED_FORMAT2(testing::IsSubstring, "it does",
- gtest_failures.GetTestPartResult(1).message());
- EXPECT_PRED_FORMAT2(testing::IsSubstring, "other failure",
- gtest_failures.GetTestPartResult(2).message());
-}
-
-TEST_F(NoFatalFailureTest, MessageIsStreamable) {
- TestPartResultArray gtest_failures;
- {
- ScopedFakeTestPartResultReporter gtest_reporter(&gtest_failures);
- EXPECT_NO_FATAL_FAILURE(FAIL() << "foo") << "my message";
- }
- ASSERT_EQ(2, gtest_failures.size());
- EXPECT_EQ(TestPartResult::kNonFatalFailure,
- gtest_failures.GetTestPartResult(0).type());
- EXPECT_EQ(TestPartResult::kNonFatalFailure,
- gtest_failures.GetTestPartResult(1).type());
- EXPECT_PRED_FORMAT2(testing::IsSubstring, "foo",
- gtest_failures.GetTestPartResult(0).message());
- EXPECT_PRED_FORMAT2(testing::IsSubstring, "my message",
- gtest_failures.GetTestPartResult(1).message());
-}
-
-// Tests non-string assertions.
-
-// Tests EqFailure(), used for implementing *EQ* assertions.
-TEST(AssertionTest, EqFailure) {
- const String foo_val("5"), bar_val("6");
- const String msg1(
- EqFailure("foo", "bar", foo_val, bar_val, false)
- .failure_message());
- EXPECT_STREQ(
- "Value of: bar\n"
- " Actual: 6\n"
- "Expected: foo\n"
- "Which is: 5",
- msg1.c_str());
-
- const String msg2(
- EqFailure("foo", "6", foo_val, bar_val, false)
- .failure_message());
- EXPECT_STREQ(
- "Value of: 6\n"
- "Expected: foo\n"
- "Which is: 5",
- msg2.c_str());
-
- const String msg3(
- EqFailure("5", "bar", foo_val, bar_val, false)
- .failure_message());
- EXPECT_STREQ(
- "Value of: bar\n"
- " Actual: 6\n"
- "Expected: 5",
- msg3.c_str());
-
- const String msg4(
- EqFailure("5", "6", foo_val, bar_val, false).failure_message());
- EXPECT_STREQ(
- "Value of: 6\n"
- "Expected: 5",
- msg4.c_str());
-
- const String msg5(
- EqFailure("foo", "bar",
- String("\"x\""), String("\"y\""),
- true).failure_message());
- EXPECT_STREQ(
- "Value of: bar\n"
- " Actual: \"y\"\n"
- "Expected: foo (ignoring case)\n"
- "Which is: \"x\"",
- msg5.c_str());
-}
-
-// Tests AppendUserMessage(), used for implementing the *EQ* macros.
-TEST(AssertionTest, AppendUserMessage) {
- const String foo("foo");
-
- Message msg;
- EXPECT_STREQ("foo",
- AppendUserMessage(foo, msg).c_str());
-
- msg << "bar";
- EXPECT_STREQ("foo\nbar",
- AppendUserMessage(foo, msg).c_str());
-}
-
-#ifdef __BORLANDC__
-// Silences warnings: "Condition is always true", "Unreachable code"
-# pragma option push -w-ccc -w-rch
-#endif
-
-// Tests ASSERT_TRUE.
-TEST(AssertionTest, ASSERT_TRUE) {
- ASSERT_TRUE(2 > 1); // NOLINT
- EXPECT_FATAL_FAILURE(ASSERT_TRUE(2 < 1),
- "2 < 1");
-}
-
-// Tests ASSERT_TRUE(predicate) for predicates returning AssertionResult.
-TEST(AssertionTest, AssertTrueWithAssertionResult) {
- ASSERT_TRUE(ResultIsEven(2));
-#ifndef __BORLANDC__
- // ICE's in C++Builder.
- EXPECT_FATAL_FAILURE(ASSERT_TRUE(ResultIsEven(3)),
- "Value of: ResultIsEven(3)\n"
- " Actual: false (3 is odd)\n"
- "Expected: true");
-#endif
- ASSERT_TRUE(ResultIsEvenNoExplanation(2));
- EXPECT_FATAL_FAILURE(ASSERT_TRUE(ResultIsEvenNoExplanation(3)),
- "Value of: ResultIsEvenNoExplanation(3)\n"
- " Actual: false (3 is odd)\n"
- "Expected: true");
-}
-
-// Tests ASSERT_FALSE.
-TEST(AssertionTest, ASSERT_FALSE) {
- ASSERT_FALSE(2 < 1); // NOLINT
- EXPECT_FATAL_FAILURE(ASSERT_FALSE(2 > 1),
- "Value of: 2 > 1\n"
- " Actual: true\n"
- "Expected: false");
-}
-
-// Tests ASSERT_FALSE(predicate) for predicates returning AssertionResult.
-TEST(AssertionTest, AssertFalseWithAssertionResult) {
- ASSERT_FALSE(ResultIsEven(3));
-#ifndef __BORLANDC__
- // ICE's in C++Builder.
- EXPECT_FATAL_FAILURE(ASSERT_FALSE(ResultIsEven(2)),
- "Value of: ResultIsEven(2)\n"
- " Actual: true (2 is even)\n"
- "Expected: false");
-#endif
- ASSERT_FALSE(ResultIsEvenNoExplanation(3));
- EXPECT_FATAL_FAILURE(ASSERT_FALSE(ResultIsEvenNoExplanation(2)),
- "Value of: ResultIsEvenNoExplanation(2)\n"
- " Actual: true\n"
- "Expected: false");
-}
-
-#ifdef __BORLANDC__
-// Restores warnings after previous "#pragma option push" supressed them
-# pragma option pop
-#endif
-
-// Tests using ASSERT_EQ on double values. The purpose is to make
-// sure that the specialization we did for integer and anonymous enums
-// isn't used for double arguments.
-TEST(ExpectTest, ASSERT_EQ_Double) {
- // A success.
- ASSERT_EQ(5.6, 5.6);
-
- // A failure.
- EXPECT_FATAL_FAILURE(ASSERT_EQ(5.1, 5.2),
- "5.1");
-}
-
-// Tests ASSERT_EQ.
-TEST(AssertionTest, ASSERT_EQ) {
- ASSERT_EQ(5, 2 + 3);
- EXPECT_FATAL_FAILURE(ASSERT_EQ(5, 2*3),
- "Value of: 2*3\n"
- " Actual: 6\n"
- "Expected: 5");
-}
-
-// Tests ASSERT_EQ(NULL, pointer).
-#if GTEST_CAN_COMPARE_NULL
-TEST(AssertionTest, ASSERT_EQ_NULL) {
- // A success.
- const char* p = NULL;
- // Some older GCC versions may issue a spurious waring in this or the next
- // assertion statement. This warning should not be suppressed with
- // static_cast since the test verifies the ability to use bare NULL as the
- // expected parameter to the macro.
- ASSERT_EQ(NULL, p);
-
- // A failure.
- static int n = 0;
- EXPECT_FATAL_FAILURE(ASSERT_EQ(NULL, &n),
- "Value of: &n\n");
-}
-#endif // GTEST_CAN_COMPARE_NULL
-
-// Tests ASSERT_EQ(0, non_pointer). Since the literal 0 can be
-// treated as a null pointer by the compiler, we need to make sure
-// that ASSERT_EQ(0, non_pointer) isn't interpreted by Google Test as
-// ASSERT_EQ(static_cast<void*>(NULL), non_pointer).
-TEST(ExpectTest, ASSERT_EQ_0) {
- int n = 0;
-
- // A success.
- ASSERT_EQ(0, n);
-
- // A failure.
- EXPECT_FATAL_FAILURE(ASSERT_EQ(0, 5.6),
- "Expected: 0");
-}
-
-// Tests ASSERT_NE.
-TEST(AssertionTest, ASSERT_NE) {
- ASSERT_NE(6, 7);
- EXPECT_FATAL_FAILURE(ASSERT_NE('a', 'a'),
- "Expected: ('a') != ('a'), "
- "actual: 'a' (97, 0x61) vs 'a' (97, 0x61)");
-}
-
-// Tests ASSERT_LE.
-TEST(AssertionTest, ASSERT_LE) {
- ASSERT_LE(2, 3);
- ASSERT_LE(2, 2);
- EXPECT_FATAL_FAILURE(ASSERT_LE(2, 0),
- "Expected: (2) <= (0), actual: 2 vs 0");
-}
-
-// Tests ASSERT_LT.
-TEST(AssertionTest, ASSERT_LT) {
- ASSERT_LT(2, 3);
- EXPECT_FATAL_FAILURE(ASSERT_LT(2, 2),
- "Expected: (2) < (2), actual: 2 vs 2");
-}
-
-// Tests ASSERT_GE.
-TEST(AssertionTest, ASSERT_GE) {
- ASSERT_GE(2, 1);
- ASSERT_GE(2, 2);
- EXPECT_FATAL_FAILURE(ASSERT_GE(2, 3),
- "Expected: (2) >= (3), actual: 2 vs 3");
-}
-
-// Tests ASSERT_GT.
-TEST(AssertionTest, ASSERT_GT) {
- ASSERT_GT(2, 1);
- EXPECT_FATAL_FAILURE(ASSERT_GT(2, 2),
- "Expected: (2) > (2), actual: 2 vs 2");
-}
-
-#if GTEST_HAS_EXCEPTIONS
-
-void ThrowNothing() {}
-
-// Tests ASSERT_THROW.
-TEST(AssertionTest, ASSERT_THROW) {
- ASSERT_THROW(ThrowAnInteger(), int);
-
-# ifndef __BORLANDC__
-
- // ICE's in C++Builder 2007 and 2009.
- EXPECT_FATAL_FAILURE(
- ASSERT_THROW(ThrowAnInteger(), bool),
- "Expected: ThrowAnInteger() throws an exception of type bool.\n"
- " Actual: it throws a different type.");
-# endif
-
- EXPECT_FATAL_FAILURE(
- ASSERT_THROW(ThrowNothing(), bool),
- "Expected: ThrowNothing() throws an exception of type bool.\n"
- " Actual: it throws nothing.");
-}
-
-// Tests ASSERT_NO_THROW.
-TEST(AssertionTest, ASSERT_NO_THROW) {
- ASSERT_NO_THROW(ThrowNothing());
- EXPECT_FATAL_FAILURE(ASSERT_NO_THROW(ThrowAnInteger()),
- "Expected: ThrowAnInteger() doesn't throw an exception."
- "\n Actual: it throws.");
-}
-
-// Tests ASSERT_ANY_THROW.
-TEST(AssertionTest, ASSERT_ANY_THROW) {
- ASSERT_ANY_THROW(ThrowAnInteger());
- EXPECT_FATAL_FAILURE(
- ASSERT_ANY_THROW(ThrowNothing()),
- "Expected: ThrowNothing() throws an exception.\n"
- " Actual: it doesn't.");
-}
-
-#endif // GTEST_HAS_EXCEPTIONS
-
-// Makes sure we deal with the precedence of <<. This test should
-// compile.
-TEST(AssertionTest, AssertPrecedence) {
- ASSERT_EQ(1 < 2, true);
- bool false_value = false;
- ASSERT_EQ(true && false_value, false);
-}
-
-// A subroutine used by the following test.
-void TestEq1(int x) {
- ASSERT_EQ(1, x);
-}
-
-// Tests calling a test subroutine that's not part of a fixture.
-TEST(AssertionTest, NonFixtureSubroutine) {
- EXPECT_FATAL_FAILURE(TestEq1(2),
- "Value of: x");
-}
-
-// An uncopyable class.
-class Uncopyable {
- public:
- explicit Uncopyable(int a_value) : value_(a_value) {}
-
- int value() const { return value_; }
- bool operator==(const Uncopyable& rhs) const {
- return value() == rhs.value();
- }
- private:
- // This constructor deliberately has no implementation, as we don't
- // want this class to be copyable.
- Uncopyable(const Uncopyable&); // NOLINT
-
- int value_;
-};
-
-::std::ostream& operator<<(::std::ostream& os, const Uncopyable& value) {
- return os << value.value();
-}
-
-
-bool IsPositiveUncopyable(const Uncopyable& x) {
- return x.value() > 0;
-}
-
-// A subroutine used by the following test.
-void TestAssertNonPositive() {
- Uncopyable y(-1);
- ASSERT_PRED1(IsPositiveUncopyable, y);
-}
-// A subroutine used by the following test.
-void TestAssertEqualsUncopyable() {
- Uncopyable x(5);
- Uncopyable y(-1);
- ASSERT_EQ(x, y);
-}
-
-// Tests that uncopyable objects can be used in assertions.
-TEST(AssertionTest, AssertWorksWithUncopyableObject) {
- Uncopyable x(5);
- ASSERT_PRED1(IsPositiveUncopyable, x);
- ASSERT_EQ(x, x);
- EXPECT_FATAL_FAILURE(TestAssertNonPositive(),
- "IsPositiveUncopyable(y) evaluates to false, where\ny evaluates to -1");
- EXPECT_FATAL_FAILURE(TestAssertEqualsUncopyable(),
- "Value of: y\n Actual: -1\nExpected: x\nWhich is: 5");
-}
-
-// Tests that uncopyable objects can be used in expects.
-TEST(AssertionTest, ExpectWorksWithUncopyableObject) {
- Uncopyable x(5);
- EXPECT_PRED1(IsPositiveUncopyable, x);
- Uncopyable y(-1);
- EXPECT_NONFATAL_FAILURE(EXPECT_PRED1(IsPositiveUncopyable, y),
- "IsPositiveUncopyable(y) evaluates to false, where\ny evaluates to -1");
- EXPECT_EQ(x, x);
- EXPECT_NONFATAL_FAILURE(EXPECT_EQ(x, y),
- "Value of: y\n Actual: -1\nExpected: x\nWhich is: 5");
-}
-
-enum NamedEnum {
- kE1 = 0,
- kE2 = 1
-};
-
-TEST(AssertionTest, NamedEnum) {
- EXPECT_EQ(kE1, kE1);
- EXPECT_LT(kE1, kE2);
- EXPECT_NONFATAL_FAILURE(EXPECT_EQ(kE1, kE2), "Which is: 0");
- EXPECT_NONFATAL_FAILURE(EXPECT_EQ(kE1, kE2), "Actual: 1");
-}
-
-// The version of gcc used in XCode 2.2 has a bug and doesn't allow
-// anonymous enums in assertions. Therefore the following test is not
-// done on Mac.
-// Sun Studio and HP aCC also reject this code.
-#if !GTEST_OS_MAC && !defined(__SUNPRO_CC) && !defined(__HP_aCC)
-
-// Tests using assertions with anonymous enums.
-enum {
- kCaseA = -1,
-
-# if GTEST_OS_LINUX
-
- // We want to test the case where the size of the anonymous enum is
- // larger than sizeof(int), to make sure our implementation of the
- // assertions doesn't truncate the enums. However, MSVC
- // (incorrectly) doesn't allow an enum value to exceed the range of
- // an int, so this has to be conditionally compiled.
- //
- // On Linux, kCaseB and kCaseA have the same value when truncated to
- // int size. We want to test whether this will confuse the
- // assertions.
- kCaseB = testing::internal::kMaxBiggestInt,
-
-# else
-
- kCaseB = INT_MAX,
-
-# endif // GTEST_OS_LINUX
-
- kCaseC = 42
-};
-
-TEST(AssertionTest, AnonymousEnum) {
-# if GTEST_OS_LINUX
-
- EXPECT_EQ(static_cast<int>(kCaseA), static_cast<int>(kCaseB));
-
-# endif // GTEST_OS_LINUX
-
- EXPECT_EQ(kCaseA, kCaseA);
- EXPECT_NE(kCaseA, kCaseB);
- EXPECT_LT(kCaseA, kCaseB);
- EXPECT_LE(kCaseA, kCaseB);
- EXPECT_GT(kCaseB, kCaseA);
- EXPECT_GE(kCaseA, kCaseA);
- EXPECT_NONFATAL_FAILURE(EXPECT_GE(kCaseA, kCaseB),
- "(kCaseA) >= (kCaseB)");
- EXPECT_NONFATAL_FAILURE(EXPECT_GE(kCaseA, kCaseC),
- "-1 vs 42");
-
- ASSERT_EQ(kCaseA, kCaseA);
- ASSERT_NE(kCaseA, kCaseB);
- ASSERT_LT(kCaseA, kCaseB);
- ASSERT_LE(kCaseA, kCaseB);
- ASSERT_GT(kCaseB, kCaseA);
- ASSERT_GE(kCaseA, kCaseA);
-
-# ifndef __BORLANDC__
-
- // ICE's in C++Builder.
- EXPECT_FATAL_FAILURE(ASSERT_EQ(kCaseA, kCaseB),
- "Value of: kCaseB");
- EXPECT_FATAL_FAILURE(ASSERT_EQ(kCaseA, kCaseC),
- "Actual: 42");
-# endif
-
- EXPECT_FATAL_FAILURE(ASSERT_EQ(kCaseA, kCaseC),
- "Which is: -1");
-}
-
-#endif // !GTEST_OS_MAC && !defined(__SUNPRO_CC)
-
-#if GTEST_OS_WINDOWS
-
-static HRESULT UnexpectedHRESULTFailure() {
- return E_UNEXPECTED;
-}
-
-static HRESULT OkHRESULTSuccess() {
- return S_OK;
-}
-
-static HRESULT FalseHRESULTSuccess() {
- return S_FALSE;
-}
-
-// HRESULT assertion tests test both zero and non-zero
-// success codes as well as failure message for each.
-//
-// Windows CE doesn't support message texts.
-TEST(HRESULTAssertionTest, EXPECT_HRESULT_SUCCEEDED) {
- EXPECT_HRESULT_SUCCEEDED(S_OK);
- EXPECT_HRESULT_SUCCEEDED(S_FALSE);
-
- EXPECT_NONFATAL_FAILURE(EXPECT_HRESULT_SUCCEEDED(UnexpectedHRESULTFailure()),
- "Expected: (UnexpectedHRESULTFailure()) succeeds.\n"
- " Actual: 0x8000FFFF");
-}
-
-TEST(HRESULTAssertionTest, ASSERT_HRESULT_SUCCEEDED) {
- ASSERT_HRESULT_SUCCEEDED(S_OK);
- ASSERT_HRESULT_SUCCEEDED(S_FALSE);
-
- EXPECT_FATAL_FAILURE(ASSERT_HRESULT_SUCCEEDED(UnexpectedHRESULTFailure()),
- "Expected: (UnexpectedHRESULTFailure()) succeeds.\n"
- " Actual: 0x8000FFFF");
-}
-
-TEST(HRESULTAssertionTest, EXPECT_HRESULT_FAILED) {
- EXPECT_HRESULT_FAILED(E_UNEXPECTED);
-
- EXPECT_NONFATAL_FAILURE(EXPECT_HRESULT_FAILED(OkHRESULTSuccess()),
- "Expected: (OkHRESULTSuccess()) fails.\n"
- " Actual: 0x00000000");
- EXPECT_NONFATAL_FAILURE(EXPECT_HRESULT_FAILED(FalseHRESULTSuccess()),
- "Expected: (FalseHRESULTSuccess()) fails.\n"
- " Actual: 0x00000001");
-}
-
-TEST(HRESULTAssertionTest, ASSERT_HRESULT_FAILED) {
- ASSERT_HRESULT_FAILED(E_UNEXPECTED);
-
-# ifndef __BORLANDC__
-
- // ICE's in C++Builder 2007 and 2009.
- EXPECT_FATAL_FAILURE(ASSERT_HRESULT_FAILED(OkHRESULTSuccess()),
- "Expected: (OkHRESULTSuccess()) fails.\n"
- " Actual: 0x00000000");
-# endif
-
- EXPECT_FATAL_FAILURE(ASSERT_HRESULT_FAILED(FalseHRESULTSuccess()),
- "Expected: (FalseHRESULTSuccess()) fails.\n"
- " Actual: 0x00000001");
-}
-
-// Tests that streaming to the HRESULT macros works.
-TEST(HRESULTAssertionTest, Streaming) {
- EXPECT_HRESULT_SUCCEEDED(S_OK) << "unexpected failure";
- ASSERT_HRESULT_SUCCEEDED(S_OK) << "unexpected failure";
- EXPECT_HRESULT_FAILED(E_UNEXPECTED) << "unexpected failure";
- ASSERT_HRESULT_FAILED(E_UNEXPECTED) << "unexpected failure";
-
- EXPECT_NONFATAL_FAILURE(
- EXPECT_HRESULT_SUCCEEDED(E_UNEXPECTED) << "expected failure",
- "expected failure");
-
-# ifndef __BORLANDC__
-
- // ICE's in C++Builder 2007 and 2009.
- EXPECT_FATAL_FAILURE(
- ASSERT_HRESULT_SUCCEEDED(E_UNEXPECTED) << "expected failure",
- "expected failure");
-# endif
-
- EXPECT_NONFATAL_FAILURE(
- EXPECT_HRESULT_FAILED(S_OK) << "expected failure",
- "expected failure");
-
- EXPECT_FATAL_FAILURE(
- ASSERT_HRESULT_FAILED(S_OK) << "expected failure",
- "expected failure");
-}
-
-#endif // GTEST_OS_WINDOWS
-
-#ifdef __BORLANDC__
-// Silences warnings: "Condition is always true", "Unreachable code"
-# pragma option push -w-ccc -w-rch
-#endif
-
-// Tests that the assertion macros behave like single statements.
-TEST(AssertionSyntaxTest, BasicAssertionsBehavesLikeSingleStatement) {
- if (AlwaysFalse())
- ASSERT_TRUE(false) << "This should never be executed; "
- "It's a compilation test only.";
-
- if (AlwaysTrue())
- EXPECT_FALSE(false);
- else
- ; // NOLINT
-
- if (AlwaysFalse())
- ASSERT_LT(1, 3);
-
- if (AlwaysFalse())
- ; // NOLINT
- else
- EXPECT_GT(3, 2) << "";
-}
-
-#if GTEST_HAS_EXCEPTIONS
-// Tests that the compiler will not complain about unreachable code in the
-// EXPECT_THROW/EXPECT_ANY_THROW/EXPECT_NO_THROW macros.
-TEST(ExpectThrowTest, DoesNotGenerateUnreachableCodeWarning) {
- int n = 0;
-
- EXPECT_THROW(throw 1, int);
- EXPECT_NONFATAL_FAILURE(EXPECT_THROW(n++, int), "");
- EXPECT_NONFATAL_FAILURE(EXPECT_THROW(throw 1, const char*), "");
- EXPECT_NO_THROW(n++);
- EXPECT_NONFATAL_FAILURE(EXPECT_NO_THROW(throw 1), "");
- EXPECT_ANY_THROW(throw 1);
- EXPECT_NONFATAL_FAILURE(EXPECT_ANY_THROW(n++), "");
-}
-
-TEST(AssertionSyntaxTest, ExceptionAssertionsBehavesLikeSingleStatement) {
- if (AlwaysFalse())
- EXPECT_THROW(ThrowNothing(), bool);
-
- if (AlwaysTrue())
- EXPECT_THROW(ThrowAnInteger(), int);
- else
- ; // NOLINT
-
- if (AlwaysFalse())
- EXPECT_NO_THROW(ThrowAnInteger());
-
- if (AlwaysTrue())
- EXPECT_NO_THROW(ThrowNothing());
- else
- ; // NOLINT
-
- if (AlwaysFalse())
- EXPECT_ANY_THROW(ThrowNothing());
-
- if (AlwaysTrue())
- EXPECT_ANY_THROW(ThrowAnInteger());
- else
- ; // NOLINT
-}
-#endif // GTEST_HAS_EXCEPTIONS
-
-TEST(AssertionSyntaxTest, NoFatalFailureAssertionsBehavesLikeSingleStatement) {
- if (AlwaysFalse())
- EXPECT_NO_FATAL_FAILURE(FAIL()) << "This should never be executed. "
- << "It's a compilation test only.";
- else
- ; // NOLINT
-
- if (AlwaysFalse())
- ASSERT_NO_FATAL_FAILURE(FAIL()) << "";
- else
- ; // NOLINT
-
- if (AlwaysTrue())
- EXPECT_NO_FATAL_FAILURE(SUCCEED());
- else
- ; // NOLINT
-
- if (AlwaysFalse())
- ; // NOLINT
- else
- ASSERT_NO_FATAL_FAILURE(SUCCEED());
-}
-
-// Tests that the assertion macros work well with switch statements.
-TEST(AssertionSyntaxTest, WorksWithSwitch) {
- switch (0) {
- case 1:
- break;
- default:
- ASSERT_TRUE(true);
- }
-
- switch (0)
- case 0:
- EXPECT_FALSE(false) << "EXPECT_FALSE failed in switch case";
-
- // Binary assertions are implemented using a different code path
- // than the Boolean assertions. Hence we test them separately.
- switch (0) {
- case 1:
- default:
- ASSERT_EQ(1, 1) << "ASSERT_EQ failed in default switch handler";
- }
-
- switch (0)
- case 0:
- EXPECT_NE(1, 2);
-}
-
-#if GTEST_HAS_EXCEPTIONS
-
-void ThrowAString() {
- throw "String";
-}
-
-// Test that the exception assertion macros compile and work with const
-// type qualifier.
-TEST(AssertionSyntaxTest, WorksWithConst) {
- ASSERT_THROW(ThrowAString(), const char*);
-
- EXPECT_THROW(ThrowAString(), const char*);
-}
-
-#endif // GTEST_HAS_EXCEPTIONS
-
-} // namespace
-
-namespace testing {
-
-// Tests that Google Test tracks SUCCEED*.
-TEST(SuccessfulAssertionTest, SUCCEED) {
- SUCCEED();
- SUCCEED() << "OK";
- EXPECT_EQ(2, GetUnitTestImpl()->current_test_result()->total_part_count());
-}
-
-// Tests that Google Test doesn't track successful EXPECT_*.
-TEST(SuccessfulAssertionTest, EXPECT) {
- EXPECT_TRUE(true);
- EXPECT_EQ(0, GetUnitTestImpl()->current_test_result()->total_part_count());
-}
-
-// Tests that Google Test doesn't track successful EXPECT_STR*.
-TEST(SuccessfulAssertionTest, EXPECT_STR) {
- EXPECT_STREQ("", "");
- EXPECT_EQ(0, GetUnitTestImpl()->current_test_result()->total_part_count());
-}
-
-// Tests that Google Test doesn't track successful ASSERT_*.
-TEST(SuccessfulAssertionTest, ASSERT) {
- ASSERT_TRUE(true);
- EXPECT_EQ(0, GetUnitTestImpl()->current_test_result()->total_part_count());
-}
-
-// Tests that Google Test doesn't track successful ASSERT_STR*.
-TEST(SuccessfulAssertionTest, ASSERT_STR) {
- ASSERT_STREQ("", "");
- EXPECT_EQ(0, GetUnitTestImpl()->current_test_result()->total_part_count());
-}
-
-} // namespace testing
-
-namespace {
-
-// Tests the message streaming variation of assertions.
-
-TEST(AssertionWithMessageTest, EXPECT) {
- EXPECT_EQ(1, 1) << "This should succeed.";
- EXPECT_NONFATAL_FAILURE(EXPECT_NE(1, 1) << "Expected failure #1.",
- "Expected failure #1");
- EXPECT_LE(1, 2) << "This should succeed.";
- EXPECT_NONFATAL_FAILURE(EXPECT_LT(1, 0) << "Expected failure #2.",
- "Expected failure #2.");
- EXPECT_GE(1, 0) << "This should succeed.";
- EXPECT_NONFATAL_FAILURE(EXPECT_GT(1, 2) << "Expected failure #3.",
- "Expected failure #3.");
-
- EXPECT_STREQ("1", "1") << "This should succeed.";
- EXPECT_NONFATAL_FAILURE(EXPECT_STRNE("1", "1") << "Expected failure #4.",
- "Expected failure #4.");
- EXPECT_STRCASEEQ("a", "A") << "This should succeed.";
- EXPECT_NONFATAL_FAILURE(EXPECT_STRCASENE("a", "A") << "Expected failure #5.",
- "Expected failure #5.");
-
- EXPECT_FLOAT_EQ(1, 1) << "This should succeed.";
- EXPECT_NONFATAL_FAILURE(EXPECT_DOUBLE_EQ(1, 1.2) << "Expected failure #6.",
- "Expected failure #6.");
- EXPECT_NEAR(1, 1.1, 0.2) << "This should succeed.";
-}
-
-TEST(AssertionWithMessageTest, ASSERT) {
- ASSERT_EQ(1, 1) << "This should succeed.";
- ASSERT_NE(1, 2) << "This should succeed.";
- ASSERT_LE(1, 2) << "This should succeed.";
- ASSERT_LT(1, 2) << "This should succeed.";
- ASSERT_GE(1, 0) << "This should succeed.";
- EXPECT_FATAL_FAILURE(ASSERT_GT(1, 2) << "Expected failure.",
- "Expected failure.");
-}
-
-TEST(AssertionWithMessageTest, ASSERT_STR) {
- ASSERT_STREQ("1", "1") << "This should succeed.";
- ASSERT_STRNE("1", "2") << "This should succeed.";
- ASSERT_STRCASEEQ("a", "A") << "This should succeed.";
- EXPECT_FATAL_FAILURE(ASSERT_STRCASENE("a", "A") << "Expected failure.",
- "Expected failure.");
-}
-
-TEST(AssertionWithMessageTest, ASSERT_FLOATING) {
- ASSERT_FLOAT_EQ(1, 1) << "This should succeed.";
- ASSERT_DOUBLE_EQ(1, 1) << "This should succeed.";
- EXPECT_FATAL_FAILURE(ASSERT_NEAR(1,1.2, 0.1) << "Expect failure.", // NOLINT
- "Expect failure.");
- // To work around a bug in gcc 2.95.0, there is intentionally no
- // space after the first comma in the previous statement.
-}
-
-// Tests using ASSERT_FALSE with a streamed message.
-TEST(AssertionWithMessageTest, ASSERT_FALSE) {
- ASSERT_FALSE(false) << "This shouldn't fail.";
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_FALSE(true) << "Expected failure: " << 2 << " > " << 1
- << " evaluates to " << true;
- }, "Expected failure");
-}
-
-// Tests using FAIL with a streamed message.
-TEST(AssertionWithMessageTest, FAIL) {
- EXPECT_FATAL_FAILURE(FAIL() << 0,
- "0");
-}
-
-// Tests using SUCCEED with a streamed message.
-TEST(AssertionWithMessageTest, SUCCEED) {
- SUCCEED() << "Success == " << 1;
-}
-
-// Tests using ASSERT_TRUE with a streamed message.
-TEST(AssertionWithMessageTest, ASSERT_TRUE) {
- ASSERT_TRUE(true) << "This should succeed.";
- ASSERT_TRUE(true) << true;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_TRUE(false) << static_cast<const char *>(NULL)
- << static_cast<char *>(NULL);
- }, "(null)(null)");
-}
-
-#if GTEST_OS_WINDOWS
-// Tests using wide strings in assertion messages.
-TEST(AssertionWithMessageTest, WideStringMessage) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_TRUE(false) << L"This failure is expected.\x8119";
- }, "This failure is expected.");
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_EQ(1, 2) << "This failure is "
- << L"expected too.\x8120";
- }, "This failure is expected too.");
-}
-#endif // GTEST_OS_WINDOWS
-
-// Tests EXPECT_TRUE.
-TEST(ExpectTest, EXPECT_TRUE) {
- EXPECT_TRUE(true) << "Intentional success";
- EXPECT_NONFATAL_FAILURE(EXPECT_TRUE(false) << "Intentional failure #1.",
- "Intentional failure #1.");
- EXPECT_NONFATAL_FAILURE(EXPECT_TRUE(false) << "Intentional failure #2.",
- "Intentional failure #2.");
- EXPECT_TRUE(2 > 1); // NOLINT
- EXPECT_NONFATAL_FAILURE(EXPECT_TRUE(2 < 1),
- "Value of: 2 < 1\n"
- " Actual: false\n"
- "Expected: true");
- EXPECT_NONFATAL_FAILURE(EXPECT_TRUE(2 > 3),
- "2 > 3");
-}
-
-// Tests EXPECT_TRUE(predicate) for predicates returning AssertionResult.
-TEST(ExpectTest, ExpectTrueWithAssertionResult) {
- EXPECT_TRUE(ResultIsEven(2));
- EXPECT_NONFATAL_FAILURE(EXPECT_TRUE(ResultIsEven(3)),
- "Value of: ResultIsEven(3)\n"
- " Actual: false (3 is odd)\n"
- "Expected: true");
- EXPECT_TRUE(ResultIsEvenNoExplanation(2));
- EXPECT_NONFATAL_FAILURE(EXPECT_TRUE(ResultIsEvenNoExplanation(3)),
- "Value of: ResultIsEvenNoExplanation(3)\n"
- " Actual: false (3 is odd)\n"
- "Expected: true");
-}
-
-// Tests EXPECT_FALSE with a streamed message.
-TEST(ExpectTest, EXPECT_FALSE) {
- EXPECT_FALSE(2 < 1); // NOLINT
- EXPECT_FALSE(false) << "Intentional success";
- EXPECT_NONFATAL_FAILURE(EXPECT_FALSE(true) << "Intentional failure #1.",
- "Intentional failure #1.");
- EXPECT_NONFATAL_FAILURE(EXPECT_FALSE(true) << "Intentional failure #2.",
- "Intentional failure #2.");
- EXPECT_NONFATAL_FAILURE(EXPECT_FALSE(2 > 1),
- "Value of: 2 > 1\n"
- " Actual: true\n"
- "Expected: false");
- EXPECT_NONFATAL_FAILURE(EXPECT_FALSE(2 < 3),
- "2 < 3");
-}
-
-// Tests EXPECT_FALSE(predicate) for predicates returning AssertionResult.
-TEST(ExpectTest, ExpectFalseWithAssertionResult) {
- EXPECT_FALSE(ResultIsEven(3));
- EXPECT_NONFATAL_FAILURE(EXPECT_FALSE(ResultIsEven(2)),
- "Value of: ResultIsEven(2)\n"
- " Actual: true (2 is even)\n"
- "Expected: false");
- EXPECT_FALSE(ResultIsEvenNoExplanation(3));
- EXPECT_NONFATAL_FAILURE(EXPECT_FALSE(ResultIsEvenNoExplanation(2)),
- "Value of: ResultIsEvenNoExplanation(2)\n"
- " Actual: true\n"
- "Expected: false");
-}
-
-#ifdef __BORLANDC__
-// Restores warnings after previous "#pragma option push" supressed them
-# pragma option pop
-#endif
-
-// Tests EXPECT_EQ.
-TEST(ExpectTest, EXPECT_EQ) {
- EXPECT_EQ(5, 2 + 3);
- EXPECT_NONFATAL_FAILURE(EXPECT_EQ(5, 2*3),
- "Value of: 2*3\n"
- " Actual: 6\n"
- "Expected: 5");
- EXPECT_NONFATAL_FAILURE(EXPECT_EQ(5, 2 - 3),
- "2 - 3");
-}
-
-// Tests using EXPECT_EQ on double values. The purpose is to make
-// sure that the specialization we did for integer and anonymous enums
-// isn't used for double arguments.
-TEST(ExpectTest, EXPECT_EQ_Double) {
- // A success.
- EXPECT_EQ(5.6, 5.6);
-
- // A failure.
- EXPECT_NONFATAL_FAILURE(EXPECT_EQ(5.1, 5.2),
- "5.1");
-}
-
-#if GTEST_CAN_COMPARE_NULL
-// Tests EXPECT_EQ(NULL, pointer).
-TEST(ExpectTest, EXPECT_EQ_NULL) {
- // A success.
- const char* p = NULL;
- // Some older GCC versions may issue a spurious warning in this or the next
- // assertion statement. This warning should not be suppressed with
- // static_cast since the test verifies the ability to use bare NULL as the
- // expected parameter to the macro.
- EXPECT_EQ(NULL, p);
-
- // A failure.
- int n = 0;
- EXPECT_NONFATAL_FAILURE(EXPECT_EQ(NULL, &n),
- "Value of: &n\n");
-}
-#endif // GTEST_CAN_COMPARE_NULL
-
-// Tests EXPECT_EQ(0, non_pointer). Since the literal 0 can be
-// treated as a null pointer by the compiler, we need to make sure
-// that EXPECT_EQ(0, non_pointer) isn't interpreted by Google Test as
-// EXPECT_EQ(static_cast<void*>(NULL), non_pointer).
-TEST(ExpectTest, EXPECT_EQ_0) {
- int n = 0;
-
- // A success.
- EXPECT_EQ(0, n);
-
- // A failure.
- EXPECT_NONFATAL_FAILURE(EXPECT_EQ(0, 5.6),
- "Expected: 0");
-}
-
-// Tests EXPECT_NE.
-TEST(ExpectTest, EXPECT_NE) {
- EXPECT_NE(6, 7);
-
- EXPECT_NONFATAL_FAILURE(EXPECT_NE('a', 'a'),
- "Expected: ('a') != ('a'), "
- "actual: 'a' (97, 0x61) vs 'a' (97, 0x61)");
- EXPECT_NONFATAL_FAILURE(EXPECT_NE(2, 2),
- "2");
- char* const p0 = NULL;
- EXPECT_NONFATAL_FAILURE(EXPECT_NE(p0, p0),
- "p0");
- // Only way to get the Nokia compiler to compile the cast
- // is to have a separate void* variable first. Putting
- // the two casts on the same line doesn't work, neither does
- // a direct C-style to char*.
- void* pv1 = (void*)0x1234; // NOLINT
- char* const p1 = reinterpret_cast<char*>(pv1);
- EXPECT_NONFATAL_FAILURE(EXPECT_NE(p1, p1),
- "p1");
-}
-
-// Tests EXPECT_LE.
-TEST(ExpectTest, EXPECT_LE) {
- EXPECT_LE(2, 3);
- EXPECT_LE(2, 2);
- EXPECT_NONFATAL_FAILURE(EXPECT_LE(2, 0),
- "Expected: (2) <= (0), actual: 2 vs 0");
- EXPECT_NONFATAL_FAILURE(EXPECT_LE(1.1, 0.9),
- "(1.1) <= (0.9)");
-}
-
-// Tests EXPECT_LT.
-TEST(ExpectTest, EXPECT_LT) {
- EXPECT_LT(2, 3);
- EXPECT_NONFATAL_FAILURE(EXPECT_LT(2, 2),
- "Expected: (2) < (2), actual: 2 vs 2");
- EXPECT_NONFATAL_FAILURE(EXPECT_LT(2, 1),
- "(2) < (1)");
-}
-
-// Tests EXPECT_GE.
-TEST(ExpectTest, EXPECT_GE) {
- EXPECT_GE(2, 1);
- EXPECT_GE(2, 2);
- EXPECT_NONFATAL_FAILURE(EXPECT_GE(2, 3),
- "Expected: (2) >= (3), actual: 2 vs 3");
- EXPECT_NONFATAL_FAILURE(EXPECT_GE(0.9, 1.1),
- "(0.9) >= (1.1)");
-}
-
-// Tests EXPECT_GT.
-TEST(ExpectTest, EXPECT_GT) {
- EXPECT_GT(2, 1);
- EXPECT_NONFATAL_FAILURE(EXPECT_GT(2, 2),
- "Expected: (2) > (2), actual: 2 vs 2");
- EXPECT_NONFATAL_FAILURE(EXPECT_GT(2, 3),
- "(2) > (3)");
-}
-
-#if GTEST_HAS_EXCEPTIONS
-
-// Tests EXPECT_THROW.
-TEST(ExpectTest, EXPECT_THROW) {
- EXPECT_THROW(ThrowAnInteger(), int);
- EXPECT_NONFATAL_FAILURE(EXPECT_THROW(ThrowAnInteger(), bool),
- "Expected: ThrowAnInteger() throws an exception of "
- "type bool.\n Actual: it throws a different type.");
- EXPECT_NONFATAL_FAILURE(
- EXPECT_THROW(ThrowNothing(), bool),
- "Expected: ThrowNothing() throws an exception of type bool.\n"
- " Actual: it throws nothing.");
-}
-
-// Tests EXPECT_NO_THROW.
-TEST(ExpectTest, EXPECT_NO_THROW) {
- EXPECT_NO_THROW(ThrowNothing());
- EXPECT_NONFATAL_FAILURE(EXPECT_NO_THROW(ThrowAnInteger()),
- "Expected: ThrowAnInteger() doesn't throw an "
- "exception.\n Actual: it throws.");
-}
-
-// Tests EXPECT_ANY_THROW.
-TEST(ExpectTest, EXPECT_ANY_THROW) {
- EXPECT_ANY_THROW(ThrowAnInteger());
- EXPECT_NONFATAL_FAILURE(
- EXPECT_ANY_THROW(ThrowNothing()),
- "Expected: ThrowNothing() throws an exception.\n"
- " Actual: it doesn't.");
-}
-
-#endif // GTEST_HAS_EXCEPTIONS
-
-// Make sure we deal with the precedence of <<.
-TEST(ExpectTest, ExpectPrecedence) {
- EXPECT_EQ(1 < 2, true);
- EXPECT_NONFATAL_FAILURE(EXPECT_EQ(true, true && false),
- "Value of: true && false");
-}
-
-
-// Tests the StreamableToString() function.
-
-// Tests using StreamableToString() on a scalar.
-TEST(StreamableToStringTest, Scalar) {
- EXPECT_STREQ("5", StreamableToString(5).c_str());
-}
-
-// Tests using StreamableToString() on a non-char pointer.
-TEST(StreamableToStringTest, Pointer) {
- int n = 0;
- int* p = &n;
- EXPECT_STRNE("(null)", StreamableToString(p).c_str());
-}
-
-// Tests using StreamableToString() on a NULL non-char pointer.
-TEST(StreamableToStringTest, NullPointer) {
- int* p = NULL;
- EXPECT_STREQ("(null)", StreamableToString(p).c_str());
-}
-
-// Tests using StreamableToString() on a C string.
-TEST(StreamableToStringTest, CString) {
- EXPECT_STREQ("Foo", StreamableToString("Foo").c_str());
-}
-
-// Tests using StreamableToString() on a NULL C string.
-TEST(StreamableToStringTest, NullCString) {
- char* p = NULL;
- EXPECT_STREQ("(null)", StreamableToString(p).c_str());
-}
-
-// Tests using streamable values as assertion messages.
-
-// Tests using std::string as an assertion message.
-TEST(StreamableTest, string) {
- static const std::string str(
- "This failure message is a std::string, and is expected.");
- EXPECT_FATAL_FAILURE(FAIL() << str,
- str.c_str());
-}
-
-// Tests that we can output strings containing embedded NULs.
-// Limited to Linux because we can only do this with std::string's.
-TEST(StreamableTest, stringWithEmbeddedNUL) {
- static const char char_array_with_nul[] =
- "Here's a NUL\0 and some more string";
- static const std::string string_with_nul(char_array_with_nul,
- sizeof(char_array_with_nul)
- - 1); // drops the trailing NUL
- EXPECT_FATAL_FAILURE(FAIL() << string_with_nul,
- "Here's a NUL\\0 and some more string");
-}
-
-// Tests that we can output a NUL char.
-TEST(StreamableTest, NULChar) {
- EXPECT_FATAL_FAILURE({ // NOLINT
- FAIL() << "A NUL" << '\0' << " and some more string";
- }, "A NUL\\0 and some more string");
-}
-
-// Tests using int as an assertion message.
-TEST(StreamableTest, int) {
- EXPECT_FATAL_FAILURE(FAIL() << 900913,
- "900913");
-}
-
-// Tests using NULL char pointer as an assertion message.
-//
-// In MSVC, streaming a NULL char * causes access violation. Google Test
-// implemented a workaround (substituting "(null)" for NULL). This
-// tests whether the workaround works.
-TEST(StreamableTest, NullCharPtr) {
- EXPECT_FATAL_FAILURE(FAIL() << static_cast<const char*>(NULL),
- "(null)");
-}
-
-// Tests that basic IO manipulators (endl, ends, and flush) can be
-// streamed to testing::Message.
-TEST(StreamableTest, BasicIoManip) {
- EXPECT_FATAL_FAILURE({ // NOLINT
- FAIL() << "Line 1." << std::endl
- << "A NUL char " << std::ends << std::flush << " in line 2.";
- }, "Line 1.\nA NUL char \\0 in line 2.");
-}
-
-// Tests the macros that haven't been covered so far.
-
-void AddFailureHelper(bool* aborted) {
- *aborted = true;
- ADD_FAILURE() << "Intentional failure.";
- *aborted = false;
-}
-
-// Tests ADD_FAILURE.
-TEST(MacroTest, ADD_FAILURE) {
- bool aborted = true;
- EXPECT_NONFATAL_FAILURE(AddFailureHelper(&aborted),
- "Intentional failure.");
- EXPECT_FALSE(aborted);
-}
-
-// Tests ADD_FAILURE_AT.
-TEST(MacroTest, ADD_FAILURE_AT) {
- // Verifies that ADD_FAILURE_AT does generate a nonfatal failure and
- // the failure message contains the user-streamed part.
- EXPECT_NONFATAL_FAILURE(ADD_FAILURE_AT("foo.cc", 42) << "Wrong!", "Wrong!");
-
- // Verifies that the user-streamed part is optional.
- EXPECT_NONFATAL_FAILURE(ADD_FAILURE_AT("foo.cc", 42), "Failed");
-
- // Unfortunately, we cannot verify that the failure message contains
- // the right file path and line number the same way, as
- // EXPECT_NONFATAL_FAILURE() doesn't get to see the file path and
- // line number. Instead, we do that in gtest_output_test_.cc.
-}
-
-// Tests FAIL.
-TEST(MacroTest, FAIL) {
- EXPECT_FATAL_FAILURE(FAIL(),
- "Failed");
- EXPECT_FATAL_FAILURE(FAIL() << "Intentional failure.",
- "Intentional failure.");
-}
-
-// Tests SUCCEED
-TEST(MacroTest, SUCCEED) {
- SUCCEED();
- SUCCEED() << "Explicit success.";
-}
-
-// Tests for EXPECT_EQ() and ASSERT_EQ().
-//
-// These tests fail *intentionally*, s.t. the failure messages can be
-// generated and tested.
-//
-// We have different tests for different argument types.
-
-// Tests using bool values in {EXPECT|ASSERT}_EQ.
-TEST(EqAssertionTest, Bool) {
- EXPECT_EQ(true, true);
- EXPECT_FATAL_FAILURE({
- bool false_value = false;
- ASSERT_EQ(false_value, true);
- }, "Value of: true");
-}
-
-// Tests using int values in {EXPECT|ASSERT}_EQ.
-TEST(EqAssertionTest, Int) {
- ASSERT_EQ(32, 32);
- EXPECT_NONFATAL_FAILURE(EXPECT_EQ(32, 33),
- "33");
-}
-
-// Tests using time_t values in {EXPECT|ASSERT}_EQ.
-TEST(EqAssertionTest, Time_T) {
- EXPECT_EQ(static_cast<time_t>(0),
- static_cast<time_t>(0));
- EXPECT_FATAL_FAILURE(ASSERT_EQ(static_cast<time_t>(0),
- static_cast<time_t>(1234)),
- "1234");
-}
-
-// Tests using char values in {EXPECT|ASSERT}_EQ.
-TEST(EqAssertionTest, Char) {
- ASSERT_EQ('z', 'z');
- const char ch = 'b';
- EXPECT_NONFATAL_FAILURE(EXPECT_EQ('\0', ch),
- "ch");
- EXPECT_NONFATAL_FAILURE(EXPECT_EQ('a', ch),
- "ch");
-}
-
-// Tests using wchar_t values in {EXPECT|ASSERT}_EQ.
-TEST(EqAssertionTest, WideChar) {
- EXPECT_EQ(L'b', L'b');
-
- EXPECT_NONFATAL_FAILURE(EXPECT_EQ(L'\0', L'x'),
- "Value of: L'x'\n"
- " Actual: L'x' (120, 0x78)\n"
- "Expected: L'\0'\n"
- "Which is: L'\0' (0, 0x0)");
-
- static wchar_t wchar;
- wchar = L'b';
- EXPECT_NONFATAL_FAILURE(EXPECT_EQ(L'a', wchar),
- "wchar");
- wchar = 0x8119;
- EXPECT_FATAL_FAILURE(ASSERT_EQ(static_cast<wchar_t>(0x8120), wchar),
- "Value of: wchar");
-}
-
-// Tests using ::std::string values in {EXPECT|ASSERT}_EQ.
-TEST(EqAssertionTest, StdString) {
- // Compares a const char* to an std::string that has identical
- // content.
- ASSERT_EQ("Test", ::std::string("Test"));
-
- // Compares two identical std::strings.
- static const ::std::string str1("A * in the middle");
- static const ::std::string str2(str1);
- EXPECT_EQ(str1, str2);
-
- // Compares a const char* to an std::string that has different
- // content
- EXPECT_NONFATAL_FAILURE(EXPECT_EQ("Test", ::std::string("test")),
- "::std::string(\"test\")");
-
- // Compares an std::string to a char* that has different content.
- char* const p1 = const_cast<char*>("foo");
- EXPECT_NONFATAL_FAILURE(EXPECT_EQ(::std::string("bar"), p1),
- "p1");
-
- // Compares two std::strings that have different contents, one of
- // which having a NUL character in the middle. This should fail.
- static ::std::string str3(str1);
- str3.at(2) = '\0';
- EXPECT_FATAL_FAILURE(ASSERT_EQ(str1, str3),
- "Value of: str3\n"
- " Actual: \"A \\0 in the middle\"");
-}
-
-#if GTEST_HAS_STD_WSTRING
-
-// Tests using ::std::wstring values in {EXPECT|ASSERT}_EQ.
-TEST(EqAssertionTest, StdWideString) {
- // Compares two identical std::wstrings.
- const ::std::wstring wstr1(L"A * in the middle");
- const ::std::wstring wstr2(wstr1);
- ASSERT_EQ(wstr1, wstr2);
-
- // Compares an std::wstring to a const wchar_t* that has identical
- // content.
- const wchar_t kTestX8119[] = { 'T', 'e', 's', 't', 0x8119, '\0' };
- EXPECT_EQ(::std::wstring(kTestX8119), kTestX8119);
-
- // Compares an std::wstring to a const wchar_t* that has different
- // content.
- const wchar_t kTestX8120[] = { 'T', 'e', 's', 't', 0x8120, '\0' };
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_EQ(::std::wstring(kTestX8119), kTestX8120);
- }, "kTestX8120");
-
- // Compares two std::wstrings that have different contents, one of
- // which having a NUL character in the middle.
- ::std::wstring wstr3(wstr1);
- wstr3.at(2) = L'\0';
- EXPECT_NONFATAL_FAILURE(EXPECT_EQ(wstr1, wstr3),
- "wstr3");
-
- // Compares a wchar_t* to an std::wstring that has different
- // content.
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_EQ(const_cast<wchar_t*>(L"foo"), ::std::wstring(L"bar"));
- }, "");
-}
-
-#endif // GTEST_HAS_STD_WSTRING
-
-#if GTEST_HAS_GLOBAL_STRING
-// Tests using ::string values in {EXPECT|ASSERT}_EQ.
-TEST(EqAssertionTest, GlobalString) {
- // Compares a const char* to a ::string that has identical content.
- EXPECT_EQ("Test", ::string("Test"));
-
- // Compares two identical ::strings.
- const ::string str1("A * in the middle");
- const ::string str2(str1);
- ASSERT_EQ(str1, str2);
-
- // Compares a ::string to a const char* that has different content.
- EXPECT_NONFATAL_FAILURE(EXPECT_EQ(::string("Test"), "test"),
- "test");
-
- // Compares two ::strings that have different contents, one of which
- // having a NUL character in the middle.
- ::string str3(str1);
- str3.at(2) = '\0';
- EXPECT_NONFATAL_FAILURE(EXPECT_EQ(str1, str3),
- "str3");
-
- // Compares a ::string to a char* that has different content.
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_EQ(::string("bar"), const_cast<char*>("foo"));
- }, "");
-}
-
-#endif // GTEST_HAS_GLOBAL_STRING
-
-#if GTEST_HAS_GLOBAL_WSTRING
-
-// Tests using ::wstring values in {EXPECT|ASSERT}_EQ.
-TEST(EqAssertionTest, GlobalWideString) {
- // Compares two identical ::wstrings.
- static const ::wstring wstr1(L"A * in the middle");
- static const ::wstring wstr2(wstr1);
- EXPECT_EQ(wstr1, wstr2);
-
- // Compares a const wchar_t* to a ::wstring that has identical content.
- const wchar_t kTestX8119[] = { 'T', 'e', 's', 't', 0x8119, '\0' };
- ASSERT_EQ(kTestX8119, ::wstring(kTestX8119));
-
- // Compares a const wchar_t* to a ::wstring that has different
- // content.
- const wchar_t kTestX8120[] = { 'T', 'e', 's', 't', 0x8120, '\0' };
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_EQ(kTestX8120, ::wstring(kTestX8119));
- }, "Test\\x8119");
-
- // Compares a wchar_t* to a ::wstring that has different content.
- wchar_t* const p1 = const_cast<wchar_t*>(L"foo");
- EXPECT_NONFATAL_FAILURE(EXPECT_EQ(p1, ::wstring(L"bar")),
- "bar");
-
- // Compares two ::wstrings that have different contents, one of which
- // having a NUL character in the middle.
- static ::wstring wstr3;
- wstr3 = wstr1;
- wstr3.at(2) = L'\0';
- EXPECT_FATAL_FAILURE(ASSERT_EQ(wstr1, wstr3),
- "wstr3");
-}
-
-#endif // GTEST_HAS_GLOBAL_WSTRING
-
-// Tests using char pointers in {EXPECT|ASSERT}_EQ.
-TEST(EqAssertionTest, CharPointer) {
- char* const p0 = NULL;
- // Only way to get the Nokia compiler to compile the cast
- // is to have a separate void* variable first. Putting
- // the two casts on the same line doesn't work, neither does
- // a direct C-style to char*.
- void* pv1 = (void*)0x1234; // NOLINT
- void* pv2 = (void*)0xABC0; // NOLINT
- char* const p1 = reinterpret_cast<char*>(pv1);
- char* const p2 = reinterpret_cast<char*>(pv2);
- ASSERT_EQ(p1, p1);
-
- EXPECT_NONFATAL_FAILURE(EXPECT_EQ(p0, p2),
- "Value of: p2");
- EXPECT_NONFATAL_FAILURE(EXPECT_EQ(p1, p2),
- "p2");
- EXPECT_FATAL_FAILURE(ASSERT_EQ(reinterpret_cast<char*>(0x1234),
- reinterpret_cast<char*>(0xABC0)),
- "ABC0");
-}
-
-// Tests using wchar_t pointers in {EXPECT|ASSERT}_EQ.
-TEST(EqAssertionTest, WideCharPointer) {
- wchar_t* const p0 = NULL;
- // Only way to get the Nokia compiler to compile the cast
- // is to have a separate void* variable first. Putting
- // the two casts on the same line doesn't work, neither does
- // a direct C-style to char*.
- void* pv1 = (void*)0x1234; // NOLINT
- void* pv2 = (void*)0xABC0; // NOLINT
- wchar_t* const p1 = reinterpret_cast<wchar_t*>(pv1);
- wchar_t* const p2 = reinterpret_cast<wchar_t*>(pv2);
- EXPECT_EQ(p0, p0);
-
- EXPECT_NONFATAL_FAILURE(EXPECT_EQ(p0, p2),
- "Value of: p2");
- EXPECT_NONFATAL_FAILURE(EXPECT_EQ(p1, p2),
- "p2");
- void* pv3 = (void*)0x1234; // NOLINT
- void* pv4 = (void*)0xABC0; // NOLINT
- const wchar_t* p3 = reinterpret_cast<const wchar_t*>(pv3);
- const wchar_t* p4 = reinterpret_cast<const wchar_t*>(pv4);
- EXPECT_NONFATAL_FAILURE(EXPECT_EQ(p3, p4),
- "p4");
-}
-
-// Tests using other types of pointers in {EXPECT|ASSERT}_EQ.
-TEST(EqAssertionTest, OtherPointer) {
- ASSERT_EQ(static_cast<const int*>(NULL),
- static_cast<const int*>(NULL));
- EXPECT_FATAL_FAILURE(ASSERT_EQ(static_cast<const int*>(NULL),
- reinterpret_cast<const int*>(0x1234)),
- "0x1234");
-}
-
-// A class that supports binary comparison operators but not streaming.
-class UnprintableChar {
- public:
- explicit UnprintableChar(char ch) : char_(ch) {}
-
- bool operator==(const UnprintableChar& rhs) const {
- return char_ == rhs.char_;
- }
- bool operator!=(const UnprintableChar& rhs) const {
- return char_ != rhs.char_;
- }
- bool operator<(const UnprintableChar& rhs) const {
- return char_ < rhs.char_;
- }
- bool operator<=(const UnprintableChar& rhs) const {
- return char_ <= rhs.char_;
- }
- bool operator>(const UnprintableChar& rhs) const {
- return char_ > rhs.char_;
- }
- bool operator>=(const UnprintableChar& rhs) const {
- return char_ >= rhs.char_;
- }
-
- private:
- char char_;
-};
-
-// Tests that ASSERT_EQ() and friends don't require the arguments to
-// be printable.
-TEST(ComparisonAssertionTest, AcceptsUnprintableArgs) {
- const UnprintableChar x('x'), y('y');
- ASSERT_EQ(x, x);
- EXPECT_NE(x, y);
- ASSERT_LT(x, y);
- EXPECT_LE(x, y);
- ASSERT_GT(y, x);
- EXPECT_GE(x, x);
-
- EXPECT_NONFATAL_FAILURE(EXPECT_EQ(x, y), "1-byte object <78>");
- EXPECT_NONFATAL_FAILURE(EXPECT_EQ(x, y), "1-byte object <79>");
- EXPECT_NONFATAL_FAILURE(EXPECT_LT(y, y), "1-byte object <79>");
- EXPECT_NONFATAL_FAILURE(EXPECT_GT(x, y), "1-byte object <78>");
- EXPECT_NONFATAL_FAILURE(EXPECT_GT(x, y), "1-byte object <79>");
-
- // Code tested by EXPECT_FATAL_FAILURE cannot reference local
- // variables, so we have to write UnprintableChar('x') instead of x.
-#ifndef __BORLANDC__
- // ICE's in C++Builder.
- EXPECT_FATAL_FAILURE(ASSERT_NE(UnprintableChar('x'), UnprintableChar('x')),
- "1-byte object <78>");
- EXPECT_FATAL_FAILURE(ASSERT_LE(UnprintableChar('y'), UnprintableChar('x')),
- "1-byte object <78>");
-#endif
- EXPECT_FATAL_FAILURE(ASSERT_LE(UnprintableChar('y'), UnprintableChar('x')),
- "1-byte object <79>");
- EXPECT_FATAL_FAILURE(ASSERT_GE(UnprintableChar('x'), UnprintableChar('y')),
- "1-byte object <78>");
- EXPECT_FATAL_FAILURE(ASSERT_GE(UnprintableChar('x'), UnprintableChar('y')),
- "1-byte object <79>");
-}
-
-// Tests the FRIEND_TEST macro.
-
-// This class has a private member we want to test. We will test it
-// both in a TEST and in a TEST_F.
-class Foo {
- public:
- Foo() {}
-
- private:
- int Bar() const { return 1; }
-
- // Declares the friend tests that can access the private member
- // Bar().
- FRIEND_TEST(FRIEND_TEST_Test, TEST);
- FRIEND_TEST(FRIEND_TEST_Test2, TEST_F);
-};
-
-// Tests that the FRIEND_TEST declaration allows a TEST to access a
-// class's private members. This should compile.
-TEST(FRIEND_TEST_Test, TEST) {
- ASSERT_EQ(1, Foo().Bar());
-}
-
-// The fixture needed to test using FRIEND_TEST with TEST_F.
-class FRIEND_TEST_Test2 : public Test {
- protected:
- Foo foo;
-};
-
-// Tests that the FRIEND_TEST declaration allows a TEST_F to access a
-// class's private members. This should compile.
-TEST_F(FRIEND_TEST_Test2, TEST_F) {
- ASSERT_EQ(1, foo.Bar());
-}
-
-// Tests the life cycle of Test objects.
-
-// The test fixture for testing the life cycle of Test objects.
-//
-// This class counts the number of live test objects that uses this
-// fixture.
-class TestLifeCycleTest : public Test {
- protected:
- // Constructor. Increments the number of test objects that uses
- // this fixture.
- TestLifeCycleTest() { count_++; }
-
- // Destructor. Decrements the number of test objects that uses this
- // fixture.
- ~TestLifeCycleTest() { count_--; }
-
- // Returns the number of live test objects that uses this fixture.
- int count() const { return count_; }
-
- private:
- static int count_;
-};
-
-int TestLifeCycleTest::count_ = 0;
-
-// Tests the life cycle of test objects.
-TEST_F(TestLifeCycleTest, Test1) {
- // There should be only one test object in this test case that's
- // currently alive.
- ASSERT_EQ(1, count());
-}
-
-// Tests the life cycle of test objects.
-TEST_F(TestLifeCycleTest, Test2) {
- // After Test1 is done and Test2 is started, there should still be
- // only one live test object, as the object for Test1 should've been
- // deleted.
- ASSERT_EQ(1, count());
-}
-
-} // namespace
-
-// Tests that the copy constructor works when it is NOT optimized away by
-// the compiler.
-TEST(AssertionResultTest, CopyConstructorWorksWhenNotOptimied) {
- // Checks that the copy constructor doesn't try to dereference NULL pointers
- // in the source object.
- AssertionResult r1 = AssertionSuccess();
- AssertionResult r2 = r1;
- // The following line is added to prevent the compiler from optimizing
- // away the constructor call.
- r1 << "abc";
-
- AssertionResult r3 = r1;
- EXPECT_EQ(static_cast<bool>(r3), static_cast<bool>(r1));
- EXPECT_STREQ("abc", r1.message());
-}
-
-// Tests that AssertionSuccess and AssertionFailure construct
-// AssertionResult objects as expected.
-TEST(AssertionResultTest, ConstructionWorks) {
- AssertionResult r1 = AssertionSuccess();
- EXPECT_TRUE(r1);
- EXPECT_STREQ("", r1.message());
-
- AssertionResult r2 = AssertionSuccess() << "abc";
- EXPECT_TRUE(r2);
- EXPECT_STREQ("abc", r2.message());
-
- AssertionResult r3 = AssertionFailure();
- EXPECT_FALSE(r3);
- EXPECT_STREQ("", r3.message());
-
- AssertionResult r4 = AssertionFailure() << "def";
- EXPECT_FALSE(r4);
- EXPECT_STREQ("def", r4.message());
-
- AssertionResult r5 = AssertionFailure(Message() << "ghi");
- EXPECT_FALSE(r5);
- EXPECT_STREQ("ghi", r5.message());
-}
-
-// Tests that the negation flips the predicate result but keeps the message.
-TEST(AssertionResultTest, NegationWorks) {
- AssertionResult r1 = AssertionSuccess() << "abc";
- EXPECT_FALSE(!r1);
- EXPECT_STREQ("abc", (!r1).message());
-
- AssertionResult r2 = AssertionFailure() << "def";
- EXPECT_TRUE(!r2);
- EXPECT_STREQ("def", (!r2).message());
-}
-
-TEST(AssertionResultTest, StreamingWorks) {
- AssertionResult r = AssertionSuccess();
- r << "abc" << 'd' << 0 << true;
- EXPECT_STREQ("abcd0true", r.message());
-}
-
-TEST(AssertionResultTest, CanStreamOstreamManipulators) {
- AssertionResult r = AssertionSuccess();
- r << "Data" << std::endl << std::flush << std::ends << "Will be visible";
- EXPECT_STREQ("Data\n\\0Will be visible", r.message());
-}
-
-// Tests streaming a user type whose definition and operator << are
-// both in the global namespace.
-class Base {
- public:
- explicit Base(int an_x) : x_(an_x) {}
- int x() const { return x_; }
- private:
- int x_;
-};
-std::ostream& operator<<(std::ostream& os,
- const Base& val) {
- return os << val.x();
-}
-std::ostream& operator<<(std::ostream& os,
- const Base* pointer) {
- return os << "(" << pointer->x() << ")";
-}
-
-TEST(MessageTest, CanStreamUserTypeInGlobalNameSpace) {
- Message msg;
- Base a(1);
-
- msg << a << &a; // Uses ::operator<<.
- EXPECT_STREQ("1(1)", msg.GetString().c_str());
-}
-
-// Tests streaming a user type whose definition and operator<< are
-// both in an unnamed namespace.
-namespace {
-class MyTypeInUnnamedNameSpace : public Base {
- public:
- explicit MyTypeInUnnamedNameSpace(int an_x): Base(an_x) {}
-};
-std::ostream& operator<<(std::ostream& os,
- const MyTypeInUnnamedNameSpace& val) {
- return os << val.x();
-}
-std::ostream& operator<<(std::ostream& os,
- const MyTypeInUnnamedNameSpace* pointer) {
- return os << "(" << pointer->x() << ")";
-}
-} // namespace
-
-TEST(MessageTest, CanStreamUserTypeInUnnamedNameSpace) {
- Message msg;
- MyTypeInUnnamedNameSpace a(1);
-
- msg << a << &a; // Uses <unnamed_namespace>::operator<<.
- EXPECT_STREQ("1(1)", msg.GetString().c_str());
-}
-
-// Tests streaming a user type whose definition and operator<< are
-// both in a user namespace.
-namespace namespace1 {
-class MyTypeInNameSpace1 : public Base {
- public:
- explicit MyTypeInNameSpace1(int an_x): Base(an_x) {}
-};
-std::ostream& operator<<(std::ostream& os,
- const MyTypeInNameSpace1& val) {
- return os << val.x();
-}
-std::ostream& operator<<(std::ostream& os,
- const MyTypeInNameSpace1* pointer) {
- return os << "(" << pointer->x() << ")";
-}
-} // namespace namespace1
-
-TEST(MessageTest, CanStreamUserTypeInUserNameSpace) {
- Message msg;
- namespace1::MyTypeInNameSpace1 a(1);
-
- msg << a << &a; // Uses namespace1::operator<<.
- EXPECT_STREQ("1(1)", msg.GetString().c_str());
-}
-
-// Tests streaming a user type whose definition is in a user namespace
-// but whose operator<< is in the global namespace.
-namespace namespace2 {
-class MyTypeInNameSpace2 : public ::Base {
- public:
- explicit MyTypeInNameSpace2(int an_x): Base(an_x) {}
-};
-} // namespace namespace2
-std::ostream& operator<<(std::ostream& os,
- const namespace2::MyTypeInNameSpace2& val) {
- return os << val.x();
-}
-std::ostream& operator<<(std::ostream& os,
- const namespace2::MyTypeInNameSpace2* pointer) {
- return os << "(" << pointer->x() << ")";
-}
-
-TEST(MessageTest, CanStreamUserTypeInUserNameSpaceWithStreamOperatorInGlobal) {
- Message msg;
- namespace2::MyTypeInNameSpace2 a(1);
-
- msg << a << &a; // Uses ::operator<<.
- EXPECT_STREQ("1(1)", msg.GetString().c_str());
-}
-
-// Tests streaming NULL pointers to testing::Message.
-TEST(MessageTest, NullPointers) {
- Message msg;
- char* const p1 = NULL;
- unsigned char* const p2 = NULL;
- int* p3 = NULL;
- double* p4 = NULL;
- bool* p5 = NULL;
- Message* p6 = NULL;
-
- msg << p1 << p2 << p3 << p4 << p5 << p6;
- ASSERT_STREQ("(null)(null)(null)(null)(null)(null)",
- msg.GetString().c_str());
-}
-
-// Tests streaming wide strings to testing::Message.
-TEST(MessageTest, WideStrings) {
- // Streams a NULL of type const wchar_t*.
- const wchar_t* const_wstr = NULL;
- EXPECT_STREQ("(null)",
- (Message() << const_wstr).GetString().c_str());
-
- // Streams a NULL of type wchar_t*.
- wchar_t* wstr = NULL;
- EXPECT_STREQ("(null)",
- (Message() << wstr).GetString().c_str());
-
- // Streams a non-NULL of type const wchar_t*.
- const_wstr = L"abc\x8119";
- EXPECT_STREQ("abc\xe8\x84\x99",
- (Message() << const_wstr).GetString().c_str());
-
- // Streams a non-NULL of type wchar_t*.
- wstr = const_cast<wchar_t*>(const_wstr);
- EXPECT_STREQ("abc\xe8\x84\x99",
- (Message() << wstr).GetString().c_str());
-}
-
-
-// This line tests that we can define tests in the testing namespace.
-namespace testing {
-
-// Tests the TestInfo class.
-
-class TestInfoTest : public Test {
- protected:
- static const TestInfo* GetTestInfo(const char* test_name) {
- const TestCase* const test_case = GetUnitTestImpl()->
- GetTestCase("TestInfoTest", "", NULL, NULL);
-
- for (int i = 0; i < test_case->total_test_count(); ++i) {
- const TestInfo* const test_info = test_case->GetTestInfo(i);
- if (strcmp(test_name, test_info->name()) == 0)
- return test_info;
- }
- return NULL;
- }
-
- static const TestResult* GetTestResult(
- const TestInfo* test_info) {
- return test_info->result();
- }
-};
-
-// Tests TestInfo::test_case_name() and TestInfo::name().
-TEST_F(TestInfoTest, Names) {
- const TestInfo* const test_info = GetTestInfo("Names");
-
- ASSERT_STREQ("TestInfoTest", test_info->test_case_name());
- ASSERT_STREQ("Names", test_info->name());
-}
-
-// Tests TestInfo::result().
-TEST_F(TestInfoTest, result) {
- const TestInfo* const test_info = GetTestInfo("result");
-
- // Initially, there is no TestPartResult for this test.
- ASSERT_EQ(0, GetTestResult(test_info)->total_part_count());
-
- // After the previous assertion, there is still none.
- ASSERT_EQ(0, GetTestResult(test_info)->total_part_count());
-}
-
-// Tests setting up and tearing down a test case.
-
-class SetUpTestCaseTest : public Test {
- protected:
- // This will be called once before the first test in this test case
- // is run.
- static void SetUpTestCase() {
- printf("Setting up the test case . . .\n");
-
- // Initializes some shared resource. In this simple example, we
- // just create a C string. More complex stuff can be done if
- // desired.
- shared_resource_ = "123";
-
- // Increments the number of test cases that have been set up.
- counter_++;
-
- // SetUpTestCase() should be called only once.
- EXPECT_EQ(1, counter_);
- }
-
- // This will be called once after the last test in this test case is
- // run.
- static void TearDownTestCase() {
- printf("Tearing down the test case . . .\n");
-
- // Decrements the number of test cases that have been set up.
- counter_--;
-
- // TearDownTestCase() should be called only once.
- EXPECT_EQ(0, counter_);
-
- // Cleans up the shared resource.
- shared_resource_ = NULL;
- }
-
- // This will be called before each test in this test case.
- virtual void SetUp() {
- // SetUpTestCase() should be called only once, so counter_ should
- // always be 1.
- EXPECT_EQ(1, counter_);
- }
-
- // Number of test cases that have been set up.
- static int counter_;
-
- // Some resource to be shared by all tests in this test case.
- static const char* shared_resource_;
-};
-
-int SetUpTestCaseTest::counter_ = 0;
-const char* SetUpTestCaseTest::shared_resource_ = NULL;
-
-// A test that uses the shared resource.
-TEST_F(SetUpTestCaseTest, Test1) {
- EXPECT_STRNE(NULL, shared_resource_);
-}
-
-// Another test that uses the shared resource.
-TEST_F(SetUpTestCaseTest, Test2) {
- EXPECT_STREQ("123", shared_resource_);
-}
-
-// The InitGoogleTestTest test case tests testing::InitGoogleTest().
-
-// The Flags struct stores a copy of all Google Test flags.
-struct Flags {
- // Constructs a Flags struct where each flag has its default value.
- Flags() : also_run_disabled_tests(false),
- break_on_failure(false),
- catch_exceptions(false),
- death_test_use_fork(false),
- filter(""),
- list_tests(false),
- output(""),
- print_time(true),
- random_seed(0),
- repeat(1),
- shuffle(false),
- stack_trace_depth(kMaxStackTraceDepth),
- stream_result_to(""),
- throw_on_failure(false) {}
-
- // Factory methods.
-
- // Creates a Flags struct where the gtest_also_run_disabled_tests flag has
- // the given value.
- static Flags AlsoRunDisabledTests(bool also_run_disabled_tests) {
- Flags flags;
- flags.also_run_disabled_tests = also_run_disabled_tests;
- return flags;
- }
-
- // Creates a Flags struct where the gtest_break_on_failure flag has
- // the given value.
- static Flags BreakOnFailure(bool break_on_failure) {
- Flags flags;
- flags.break_on_failure = break_on_failure;
- return flags;
- }
-
- // Creates a Flags struct where the gtest_catch_exceptions flag has
- // the given value.
- static Flags CatchExceptions(bool catch_exceptions) {
- Flags flags;
- flags.catch_exceptions = catch_exceptions;
- return flags;
- }
-
- // Creates a Flags struct where the gtest_death_test_use_fork flag has
- // the given value.
- static Flags DeathTestUseFork(bool death_test_use_fork) {
- Flags flags;
- flags.death_test_use_fork = death_test_use_fork;
- return flags;
- }
-
- // Creates a Flags struct where the gtest_filter flag has the given
- // value.
- static Flags Filter(const char* filter) {
- Flags flags;
- flags.filter = filter;
- return flags;
- }
-
- // Creates a Flags struct where the gtest_list_tests flag has the
- // given value.
- static Flags ListTests(bool list_tests) {
- Flags flags;
- flags.list_tests = list_tests;
- return flags;
- }
-
- // Creates a Flags struct where the gtest_output flag has the given
- // value.
- static Flags Output(const char* output) {
- Flags flags;
- flags.output = output;
- return flags;
- }
-
- // Creates a Flags struct where the gtest_print_time flag has the given
- // value.
- static Flags PrintTime(bool print_time) {
- Flags flags;
- flags.print_time = print_time;
- return flags;
- }
-
- // Creates a Flags struct where the gtest_random_seed flag has
- // the given value.
- static Flags RandomSeed(Int32 random_seed) {
- Flags flags;
- flags.random_seed = random_seed;
- return flags;
- }
-
- // Creates a Flags struct where the gtest_repeat flag has the given
- // value.
- static Flags Repeat(Int32 repeat) {
- Flags flags;
- flags.repeat = repeat;
- return flags;
- }
-
- // Creates a Flags struct where the gtest_shuffle flag has
- // the given value.
- static Flags Shuffle(bool shuffle) {
- Flags flags;
- flags.shuffle = shuffle;
- return flags;
- }
-
- // Creates a Flags struct where the GTEST_FLAG(stack_trace_depth) flag has
- // the given value.
- static Flags StackTraceDepth(Int32 stack_trace_depth) {
- Flags flags;
- flags.stack_trace_depth = stack_trace_depth;
- return flags;
- }
-
- // Creates a Flags struct where the GTEST_FLAG(stream_result_to) flag has
- // the given value.
- static Flags StreamResultTo(const char* stream_result_to) {
- Flags flags;
- flags.stream_result_to = stream_result_to;
- return flags;
- }
-
- // Creates a Flags struct where the gtest_throw_on_failure flag has
- // the given value.
- static Flags ThrowOnFailure(bool throw_on_failure) {
- Flags flags;
- flags.throw_on_failure = throw_on_failure;
- return flags;
- }
-
- // These fields store the flag values.
- bool also_run_disabled_tests;
- bool break_on_failure;
- bool catch_exceptions;
- bool death_test_use_fork;
- const char* filter;
- bool list_tests;
- const char* output;
- bool print_time;
- Int32 random_seed;
- Int32 repeat;
- bool shuffle;
- Int32 stack_trace_depth;
- const char* stream_result_to;
- bool throw_on_failure;
-};
-
-// Fixture for testing InitGoogleTest().
-class InitGoogleTestTest : public Test {
- protected:
- // Clears the flags before each test.
- virtual void SetUp() {
- GTEST_FLAG(also_run_disabled_tests) = false;
- GTEST_FLAG(break_on_failure) = false;
- GTEST_FLAG(catch_exceptions) = false;
- GTEST_FLAG(death_test_use_fork) = false;
- GTEST_FLAG(filter) = "";
- GTEST_FLAG(list_tests) = false;
- GTEST_FLAG(output) = "";
- GTEST_FLAG(print_time) = true;
- GTEST_FLAG(random_seed) = 0;
- GTEST_FLAG(repeat) = 1;
- GTEST_FLAG(shuffle) = false;
- GTEST_FLAG(stack_trace_depth) = kMaxStackTraceDepth;
- GTEST_FLAG(stream_result_to) = "";
- GTEST_FLAG(throw_on_failure) = false;
- }
-
- // Asserts that two narrow or wide string arrays are equal.
- template <typename CharType>
- static void AssertStringArrayEq(size_t size1, CharType** array1,
- size_t size2, CharType** array2) {
- ASSERT_EQ(size1, size2) << " Array sizes different.";
-
- for (size_t i = 0; i != size1; i++) {
- ASSERT_STREQ(array1[i], array2[i]) << " where i == " << i;
- }
- }
-
- // Verifies that the flag values match the expected values.
- static void CheckFlags(const Flags& expected) {
- EXPECT_EQ(expected.also_run_disabled_tests,
- GTEST_FLAG(also_run_disabled_tests));
- EXPECT_EQ(expected.break_on_failure, GTEST_FLAG(break_on_failure));
- EXPECT_EQ(expected.catch_exceptions, GTEST_FLAG(catch_exceptions));
- EXPECT_EQ(expected.death_test_use_fork, GTEST_FLAG(death_test_use_fork));
- EXPECT_STREQ(expected.filter, GTEST_FLAG(filter).c_str());
- EXPECT_EQ(expected.list_tests, GTEST_FLAG(list_tests));
- EXPECT_STREQ(expected.output, GTEST_FLAG(output).c_str());
- EXPECT_EQ(expected.print_time, GTEST_FLAG(print_time));
- EXPECT_EQ(expected.random_seed, GTEST_FLAG(random_seed));
- EXPECT_EQ(expected.repeat, GTEST_FLAG(repeat));
- EXPECT_EQ(expected.shuffle, GTEST_FLAG(shuffle));
- EXPECT_EQ(expected.stack_trace_depth, GTEST_FLAG(stack_trace_depth));
- EXPECT_STREQ(expected.stream_result_to,
- GTEST_FLAG(stream_result_to).c_str());
- EXPECT_EQ(expected.throw_on_failure, GTEST_FLAG(throw_on_failure));
- }
-
- // Parses a command line (specified by argc1 and argv1), then
- // verifies that the flag values are expected and that the
- // recognized flags are removed from the command line.
- template <typename CharType>
- static void TestParsingFlags(int argc1, const CharType** argv1,
- int argc2, const CharType** argv2,
- const Flags& expected, bool should_print_help) {
- const bool saved_help_flag = ::testing::internal::g_help_flag;
- ::testing::internal::g_help_flag = false;
-
-#if GTEST_HAS_STREAM_REDIRECTION
- CaptureStdout();
-#endif
-
- // Parses the command line.
- internal::ParseGoogleTestFlagsOnly(&argc1, const_cast<CharType**>(argv1));
-
-#if GTEST_HAS_STREAM_REDIRECTION
- const String captured_stdout = GetCapturedStdout();
-#endif
-
- // Verifies the flag values.
- CheckFlags(expected);
-
- // Verifies that the recognized flags are removed from the command
- // line.
- AssertStringArrayEq(argc1 + 1, argv1, argc2 + 1, argv2);
-
- // ParseGoogleTestFlagsOnly should neither set g_help_flag nor print the
- // help message for the flags it recognizes.
- EXPECT_EQ(should_print_help, ::testing::internal::g_help_flag);
-
-#if GTEST_HAS_STREAM_REDIRECTION
- const char* const expected_help_fragment =
- "This program contains tests written using";
- if (should_print_help) {
- EXPECT_PRED_FORMAT2(IsSubstring, expected_help_fragment, captured_stdout);
- } else {
- EXPECT_PRED_FORMAT2(IsNotSubstring,
- expected_help_fragment, captured_stdout);
- }
-#endif // GTEST_HAS_STREAM_REDIRECTION
-
- ::testing::internal::g_help_flag = saved_help_flag;
- }
-
- // This macro wraps TestParsingFlags s.t. the user doesn't need
- // to specify the array sizes.
-
-#define GTEST_TEST_PARSING_FLAGS_(argv1, argv2, expected, should_print_help) \
- TestParsingFlags(sizeof(argv1)/sizeof(*argv1) - 1, argv1, \
- sizeof(argv2)/sizeof(*argv2) - 1, argv2, \
- expected, should_print_help)
-};
-
-// Tests parsing an empty command line.
-TEST_F(InitGoogleTestTest, Empty) {
- const char* argv[] = {
- NULL
- };
-
- const char* argv2[] = {
- NULL
- };
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags(), false);
-}
-
-// Tests parsing a command line that has no flag.
-TEST_F(InitGoogleTestTest, NoFlag) {
- const char* argv[] = {
- "foo.exe",
- NULL
- };
-
- const char* argv2[] = {
- "foo.exe",
- NULL
- };
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags(), false);
-}
-
-// Tests parsing a bad --gtest_filter flag.
-TEST_F(InitGoogleTestTest, FilterBad) {
- const char* argv[] = {
- "foo.exe",
- "--gtest_filter",
- NULL
- };
-
- const char* argv2[] = {
- "foo.exe",
- "--gtest_filter",
- NULL
- };
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::Filter(""), true);
-}
-
-// Tests parsing an empty --gtest_filter flag.
-TEST_F(InitGoogleTestTest, FilterEmpty) {
- const char* argv[] = {
- "foo.exe",
- "--gtest_filter=",
- NULL
- };
-
- const char* argv2[] = {
- "foo.exe",
- NULL
- };
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::Filter(""), false);
-}
-
-// Tests parsing a non-empty --gtest_filter flag.
-TEST_F(InitGoogleTestTest, FilterNonEmpty) {
- const char* argv[] = {
- "foo.exe",
- "--gtest_filter=abc",
- NULL
- };
-
- const char* argv2[] = {
- "foo.exe",
- NULL
- };
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::Filter("abc"), false);
-}
-
-// Tests parsing --gtest_break_on_failure.
-TEST_F(InitGoogleTestTest, BreakOnFailureWithoutValue) {
- const char* argv[] = {
- "foo.exe",
- "--gtest_break_on_failure",
- NULL
-};
-
- const char* argv2[] = {
- "foo.exe",
- NULL
- };
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::BreakOnFailure(true), false);
-}
-
-// Tests parsing --gtest_break_on_failure=0.
-TEST_F(InitGoogleTestTest, BreakOnFailureFalse_0) {
- const char* argv[] = {
- "foo.exe",
- "--gtest_break_on_failure=0",
- NULL
- };
-
- const char* argv2[] = {
- "foo.exe",
- NULL
- };
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::BreakOnFailure(false), false);
-}
-
-// Tests parsing --gtest_break_on_failure=f.
-TEST_F(InitGoogleTestTest, BreakOnFailureFalse_f) {
- const char* argv[] = {
- "foo.exe",
- "--gtest_break_on_failure=f",
- NULL
- };
-
- const char* argv2[] = {
- "foo.exe",
- NULL
- };
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::BreakOnFailure(false), false);
-}
-
-// Tests parsing --gtest_break_on_failure=F.
-TEST_F(InitGoogleTestTest, BreakOnFailureFalse_F) {
- const char* argv[] = {
- "foo.exe",
- "--gtest_break_on_failure=F",
- NULL
- };
-
- const char* argv2[] = {
- "foo.exe",
- NULL
- };
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::BreakOnFailure(false), false);
-}
-
-// Tests parsing a --gtest_break_on_failure flag that has a "true"
-// definition.
-TEST_F(InitGoogleTestTest, BreakOnFailureTrue) {
- const char* argv[] = {
- "foo.exe",
- "--gtest_break_on_failure=1",
- NULL
- };
-
- const char* argv2[] = {
- "foo.exe",
- NULL
- };
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::BreakOnFailure(true), false);
-}
-
-// Tests parsing --gtest_catch_exceptions.
-TEST_F(InitGoogleTestTest, CatchExceptions) {
- const char* argv[] = {
- "foo.exe",
- "--gtest_catch_exceptions",
- NULL
- };
-
- const char* argv2[] = {
- "foo.exe",
- NULL
- };
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::CatchExceptions(true), false);
-}
-
-// Tests parsing --gtest_death_test_use_fork.
-TEST_F(InitGoogleTestTest, DeathTestUseFork) {
- const char* argv[] = {
- "foo.exe",
- "--gtest_death_test_use_fork",
- NULL
- };
-
- const char* argv2[] = {
- "foo.exe",
- NULL
- };
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::DeathTestUseFork(true), false);
-}
-
-// Tests having the same flag twice with different values. The
-// expected behavior is that the one coming last takes precedence.
-TEST_F(InitGoogleTestTest, DuplicatedFlags) {
- const char* argv[] = {
- "foo.exe",
- "--gtest_filter=a",
- "--gtest_filter=b",
- NULL
- };
-
- const char* argv2[] = {
- "foo.exe",
- NULL
- };
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::Filter("b"), false);
-}
-
-// Tests having an unrecognized flag on the command line.
-TEST_F(InitGoogleTestTest, UnrecognizedFlag) {
- const char* argv[] = {
- "foo.exe",
- "--gtest_break_on_failure",
- "bar", // Unrecognized by Google Test.
- "--gtest_filter=b",
- NULL
- };
-
- const char* argv2[] = {
- "foo.exe",
- "bar",
- NULL
- };
-
- Flags flags;
- flags.break_on_failure = true;
- flags.filter = "b";
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, flags, false);
-}
-
-// Tests having a --gtest_list_tests flag
-TEST_F(InitGoogleTestTest, ListTestsFlag) {
- const char* argv[] = {
- "foo.exe",
- "--gtest_list_tests",
- NULL
- };
-
- const char* argv2[] = {
- "foo.exe",
- NULL
- };
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::ListTests(true), false);
-}
-
-// Tests having a --gtest_list_tests flag with a "true" value
-TEST_F(InitGoogleTestTest, ListTestsTrue) {
- const char* argv[] = {
- "foo.exe",
- "--gtest_list_tests=1",
- NULL
- };
-
- const char* argv2[] = {
- "foo.exe",
- NULL
- };
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::ListTests(true), false);
-}
-
-// Tests having a --gtest_list_tests flag with a "false" value
-TEST_F(InitGoogleTestTest, ListTestsFalse) {
- const char* argv[] = {
- "foo.exe",
- "--gtest_list_tests=0",
- NULL
- };
-
- const char* argv2[] = {
- "foo.exe",
- NULL
- };
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::ListTests(false), false);
-}
-
-// Tests parsing --gtest_list_tests=f.
-TEST_F(InitGoogleTestTest, ListTestsFalse_f) {
- const char* argv[] = {
- "foo.exe",
- "--gtest_list_tests=f",
- NULL
- };
-
- const char* argv2[] = {
- "foo.exe",
- NULL
- };
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::ListTests(false), false);
-}
-
-// Tests parsing --gtest_list_tests=F.
-TEST_F(InitGoogleTestTest, ListTestsFalse_F) {
- const char* argv[] = {
- "foo.exe",
- "--gtest_list_tests=F",
- NULL
- };
-
- const char* argv2[] = {
- "foo.exe",
- NULL
- };
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::ListTests(false), false);
-}
-
-// Tests parsing --gtest_output (invalid).
-TEST_F(InitGoogleTestTest, OutputEmpty) {
- const char* argv[] = {
- "foo.exe",
- "--gtest_output",
- NULL
- };
-
- const char* argv2[] = {
- "foo.exe",
- "--gtest_output",
- NULL
- };
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags(), true);
-}
-
-// Tests parsing --gtest_output=xml
-TEST_F(InitGoogleTestTest, OutputXml) {
- const char* argv[] = {
- "foo.exe",
- "--gtest_output=xml",
- NULL
- };
-
- const char* argv2[] = {
- "foo.exe",
- NULL
- };
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::Output("xml"), false);
-}
-
-// Tests parsing --gtest_output=xml:file
-TEST_F(InitGoogleTestTest, OutputXmlFile) {
- const char* argv[] = {
- "foo.exe",
- "--gtest_output=xml:file",
- NULL
- };
-
- const char* argv2[] = {
- "foo.exe",
- NULL
- };
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::Output("xml:file"), false);
-}
-
-// Tests parsing --gtest_output=xml:directory/path/
-TEST_F(InitGoogleTestTest, OutputXmlDirectory) {
- const char* argv[] = {
- "foo.exe",
- "--gtest_output=xml:directory/path/",
- NULL
- };
-
- const char* argv2[] = {
- "foo.exe",
- NULL
- };
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2,
- Flags::Output("xml:directory/path/"), false);
-}
-
-// Tests having a --gtest_print_time flag
-TEST_F(InitGoogleTestTest, PrintTimeFlag) {
- const char* argv[] = {
- "foo.exe",
- "--gtest_print_time",
- NULL
- };
-
- const char* argv2[] = {
- "foo.exe",
- NULL
- };
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::PrintTime(true), false);
-}
-
-// Tests having a --gtest_print_time flag with a "true" value
-TEST_F(InitGoogleTestTest, PrintTimeTrue) {
- const char* argv[] = {
- "foo.exe",
- "--gtest_print_time=1",
- NULL
- };
-
- const char* argv2[] = {
- "foo.exe",
- NULL
- };
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::PrintTime(true), false);
-}
-
-// Tests having a --gtest_print_time flag with a "false" value
-TEST_F(InitGoogleTestTest, PrintTimeFalse) {
- const char* argv[] = {
- "foo.exe",
- "--gtest_print_time=0",
- NULL
- };
-
- const char* argv2[] = {
- "foo.exe",
- NULL
- };
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::PrintTime(false), false);
-}
-
-// Tests parsing --gtest_print_time=f.
-TEST_F(InitGoogleTestTest, PrintTimeFalse_f) {
- const char* argv[] = {
- "foo.exe",
- "--gtest_print_time=f",
- NULL
- };
-
- const char* argv2[] = {
- "foo.exe",
- NULL
- };
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::PrintTime(false), false);
-}
-
-// Tests parsing --gtest_print_time=F.
-TEST_F(InitGoogleTestTest, PrintTimeFalse_F) {
- const char* argv[] = {
- "foo.exe",
- "--gtest_print_time=F",
- NULL
- };
-
- const char* argv2[] = {
- "foo.exe",
- NULL
- };
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::PrintTime(false), false);
-}
-
-// Tests parsing --gtest_random_seed=number
-TEST_F(InitGoogleTestTest, RandomSeed) {
- const char* argv[] = {
- "foo.exe",
- "--gtest_random_seed=1000",
- NULL
- };
-
- const char* argv2[] = {
- "foo.exe",
- NULL
- };
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::RandomSeed(1000), false);
-}
-
-// Tests parsing --gtest_repeat=number
-TEST_F(InitGoogleTestTest, Repeat) {
- const char* argv[] = {
- "foo.exe",
- "--gtest_repeat=1000",
- NULL
- };
-
- const char* argv2[] = {
- "foo.exe",
- NULL
- };
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::Repeat(1000), false);
-}
-
-// Tests having a --gtest_also_run_disabled_tests flag
-TEST_F(InitGoogleTestTest, AlsoRunDisabledTestsFlag) {
- const char* argv[] = {
- "foo.exe",
- "--gtest_also_run_disabled_tests",
- NULL
- };
-
- const char* argv2[] = {
- "foo.exe",
- NULL
- };
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2,
- Flags::AlsoRunDisabledTests(true), false);
-}
-
-// Tests having a --gtest_also_run_disabled_tests flag with a "true" value
-TEST_F(InitGoogleTestTest, AlsoRunDisabledTestsTrue) {
- const char* argv[] = {
- "foo.exe",
- "--gtest_also_run_disabled_tests=1",
- NULL
- };
-
- const char* argv2[] = {
- "foo.exe",
- NULL
- };
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2,
- Flags::AlsoRunDisabledTests(true), false);
-}
-
-// Tests having a --gtest_also_run_disabled_tests flag with a "false" value
-TEST_F(InitGoogleTestTest, AlsoRunDisabledTestsFalse) {
- const char* argv[] = {
- "foo.exe",
- "--gtest_also_run_disabled_tests=0",
- NULL
- };
-
- const char* argv2[] = {
- "foo.exe",
- NULL
- };
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2,
- Flags::AlsoRunDisabledTests(false), false);
-}
-
-// Tests parsing --gtest_shuffle.
-TEST_F(InitGoogleTestTest, ShuffleWithoutValue) {
- const char* argv[] = {
- "foo.exe",
- "--gtest_shuffle",
- NULL
-};
-
- const char* argv2[] = {
- "foo.exe",
- NULL
- };
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::Shuffle(true), false);
-}
-
-// Tests parsing --gtest_shuffle=0.
-TEST_F(InitGoogleTestTest, ShuffleFalse_0) {
- const char* argv[] = {
- "foo.exe",
- "--gtest_shuffle=0",
- NULL
- };
-
- const char* argv2[] = {
- "foo.exe",
- NULL
- };
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::Shuffle(false), false);
-}
-
-// Tests parsing a --gtest_shuffle flag that has a "true"
-// definition.
-TEST_F(InitGoogleTestTest, ShuffleTrue) {
- const char* argv[] = {
- "foo.exe",
- "--gtest_shuffle=1",
- NULL
- };
-
- const char* argv2[] = {
- "foo.exe",
- NULL
- };
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::Shuffle(true), false);
-}
-
-// Tests parsing --gtest_stack_trace_depth=number.
-TEST_F(InitGoogleTestTest, StackTraceDepth) {
- const char* argv[] = {
- "foo.exe",
- "--gtest_stack_trace_depth=5",
- NULL
- };
-
- const char* argv2[] = {
- "foo.exe",
- NULL
- };
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::StackTraceDepth(5), false);
-}
-
-TEST_F(InitGoogleTestTest, StreamResultTo) {
- const char* argv[] = {
- "foo.exe",
- "--gtest_stream_result_to=localhost:1234",
- NULL
- };
-
- const char* argv2[] = {
- "foo.exe",
- NULL
- };
-
- GTEST_TEST_PARSING_FLAGS_(
- argv, argv2, Flags::StreamResultTo("localhost:1234"), false);
-}
-
-// Tests parsing --gtest_throw_on_failure.
-TEST_F(InitGoogleTestTest, ThrowOnFailureWithoutValue) {
- const char* argv[] = {
- "foo.exe",
- "--gtest_throw_on_failure",
- NULL
-};
-
- const char* argv2[] = {
- "foo.exe",
- NULL
- };
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::ThrowOnFailure(true), false);
-}
-
-// Tests parsing --gtest_throw_on_failure=0.
-TEST_F(InitGoogleTestTest, ThrowOnFailureFalse_0) {
- const char* argv[] = {
- "foo.exe",
- "--gtest_throw_on_failure=0",
- NULL
- };
-
- const char* argv2[] = {
- "foo.exe",
- NULL
- };
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::ThrowOnFailure(false), false);
-}
-
-// Tests parsing a --gtest_throw_on_failure flag that has a "true"
-// definition.
-TEST_F(InitGoogleTestTest, ThrowOnFailureTrue) {
- const char* argv[] = {
- "foo.exe",
- "--gtest_throw_on_failure=1",
- NULL
- };
-
- const char* argv2[] = {
- "foo.exe",
- NULL
- };
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::ThrowOnFailure(true), false);
-}
-
-#if GTEST_OS_WINDOWS
-// Tests parsing wide strings.
-TEST_F(InitGoogleTestTest, WideStrings) {
- const wchar_t* argv[] = {
- L"foo.exe",
- L"--gtest_filter=Foo*",
- L"--gtest_list_tests=1",
- L"--gtest_break_on_failure",
- L"--non_gtest_flag",
- NULL
- };
-
- const wchar_t* argv2[] = {
- L"foo.exe",
- L"--non_gtest_flag",
- NULL
- };
-
- Flags expected_flags;
- expected_flags.break_on_failure = true;
- expected_flags.filter = "Foo*";
- expected_flags.list_tests = true;
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, expected_flags, false);
-}
-#endif // GTEST_OS_WINDOWS
-
-// Tests current_test_info() in UnitTest.
-class CurrentTestInfoTest : public Test {
- protected:
- // Tests that current_test_info() returns NULL before the first test in
- // the test case is run.
- static void SetUpTestCase() {
- // There should be no tests running at this point.
- const TestInfo* test_info =
- UnitTest::GetInstance()->current_test_info();
- EXPECT_TRUE(test_info == NULL)
- << "There should be no tests running at this point.";
- }
-
- // Tests that current_test_info() returns NULL after the last test in
- // the test case has run.
- static void TearDownTestCase() {
- const TestInfo* test_info =
- UnitTest::GetInstance()->current_test_info();
- EXPECT_TRUE(test_info == NULL)
- << "There should be no tests running at this point.";
- }
-};
-
-// Tests that current_test_info() returns TestInfo for currently running
-// test by checking the expected test name against the actual one.
-TEST_F(CurrentTestInfoTest, WorksForFirstTestInATestCase) {
- const TestInfo* test_info =
- UnitTest::GetInstance()->current_test_info();
- ASSERT_TRUE(NULL != test_info)
- << "There is a test running so we should have a valid TestInfo.";
- EXPECT_STREQ("CurrentTestInfoTest", test_info->test_case_name())
- << "Expected the name of the currently running test case.";
- EXPECT_STREQ("WorksForFirstTestInATestCase", test_info->name())
- << "Expected the name of the currently running test.";
-}
-
-// Tests that current_test_info() returns TestInfo for currently running
-// test by checking the expected test name against the actual one. We
-// use this test to see that the TestInfo object actually changed from
-// the previous invocation.
-TEST_F(CurrentTestInfoTest, WorksForSecondTestInATestCase) {
- const TestInfo* test_info =
- UnitTest::GetInstance()->current_test_info();
- ASSERT_TRUE(NULL != test_info)
- << "There is a test running so we should have a valid TestInfo.";
- EXPECT_STREQ("CurrentTestInfoTest", test_info->test_case_name())
- << "Expected the name of the currently running test case.";
- EXPECT_STREQ("WorksForSecondTestInATestCase", test_info->name())
- << "Expected the name of the currently running test.";
-}
-
-} // namespace testing
-
-// These two lines test that we can define tests in a namespace that
-// has the name "testing" and is nested in another namespace.
-namespace my_namespace {
-namespace testing {
-
-// Makes sure that TEST knows to use ::testing::Test instead of
-// ::my_namespace::testing::Test.
-class Test {};
-
-// Makes sure that an assertion knows to use ::testing::Message instead of
-// ::my_namespace::testing::Message.
-class Message {};
-
-// Makes sure that an assertion knows to use
-// ::testing::AssertionResult instead of
-// ::my_namespace::testing::AssertionResult.
-class AssertionResult {};
-
-// Tests that an assertion that should succeed works as expected.
-TEST(NestedTestingNamespaceTest, Success) {
- EXPECT_EQ(1, 1) << "This shouldn't fail.";
-}
-
-// Tests that an assertion that should fail works as expected.
-TEST(NestedTestingNamespaceTest, Failure) {
- EXPECT_FATAL_FAILURE(FAIL() << "This failure is expected.",
- "This failure is expected.");
-}
-
-} // namespace testing
-} // namespace my_namespace
-
-// Tests that one can call superclass SetUp and TearDown methods--
-// that is, that they are not private.
-// No tests are based on this fixture; the test "passes" if it compiles
-// successfully.
-class ProtectedFixtureMethodsTest : public Test {
- protected:
- virtual void SetUp() {
- Test::SetUp();
- }
- virtual void TearDown() {
- Test::TearDown();
- }
-};
-
-// StreamingAssertionsTest tests the streaming versions of a representative
-// sample of assertions.
-TEST(StreamingAssertionsTest, Unconditional) {
- SUCCEED() << "expected success";
- EXPECT_NONFATAL_FAILURE(ADD_FAILURE() << "expected failure",
- "expected failure");
- EXPECT_FATAL_FAILURE(FAIL() << "expected failure",
- "expected failure");
-}
-
-#ifdef __BORLANDC__
-// Silences warnings: "Condition is always true", "Unreachable code"
-# pragma option push -w-ccc -w-rch
-#endif
-
-TEST(StreamingAssertionsTest, Truth) {
- EXPECT_TRUE(true) << "unexpected failure";
- ASSERT_TRUE(true) << "unexpected failure";
- EXPECT_NONFATAL_FAILURE(EXPECT_TRUE(false) << "expected failure",
- "expected failure");
- EXPECT_FATAL_FAILURE(ASSERT_TRUE(false) << "expected failure",
- "expected failure");
-}
-
-TEST(StreamingAssertionsTest, Truth2) {
- EXPECT_FALSE(false) << "unexpected failure";
- ASSERT_FALSE(false) << "unexpected failure";
- EXPECT_NONFATAL_FAILURE(EXPECT_FALSE(true) << "expected failure",
- "expected failure");
- EXPECT_FATAL_FAILURE(ASSERT_FALSE(true) << "expected failure",
- "expected failure");
-}
-
-#ifdef __BORLANDC__
-// Restores warnings after previous "#pragma option push" supressed them
-# pragma option pop
-#endif
-
-TEST(StreamingAssertionsTest, IntegerEquals) {
- EXPECT_EQ(1, 1) << "unexpected failure";
- ASSERT_EQ(1, 1) << "unexpected failure";
- EXPECT_NONFATAL_FAILURE(EXPECT_EQ(1, 2) << "expected failure",
- "expected failure");
- EXPECT_FATAL_FAILURE(ASSERT_EQ(1, 2) << "expected failure",
- "expected failure");
-}
-
-TEST(StreamingAssertionsTest, IntegerLessThan) {
- EXPECT_LT(1, 2) << "unexpected failure";
- ASSERT_LT(1, 2) << "unexpected failure";
- EXPECT_NONFATAL_FAILURE(EXPECT_LT(2, 1) << "expected failure",
- "expected failure");
- EXPECT_FATAL_FAILURE(ASSERT_LT(2, 1) << "expected failure",
- "expected failure");
-}
-
-TEST(StreamingAssertionsTest, StringsEqual) {
- EXPECT_STREQ("foo", "foo") << "unexpected failure";
- ASSERT_STREQ("foo", "foo") << "unexpected failure";
- EXPECT_NONFATAL_FAILURE(EXPECT_STREQ("foo", "bar") << "expected failure",
- "expected failure");
- EXPECT_FATAL_FAILURE(ASSERT_STREQ("foo", "bar") << "expected failure",
- "expected failure");
-}
-
-TEST(StreamingAssertionsTest, StringsNotEqual) {
- EXPECT_STRNE("foo", "bar") << "unexpected failure";
- ASSERT_STRNE("foo", "bar") << "unexpected failure";
- EXPECT_NONFATAL_FAILURE(EXPECT_STRNE("foo", "foo") << "expected failure",
- "expected failure");
- EXPECT_FATAL_FAILURE(ASSERT_STRNE("foo", "foo") << "expected failure",
- "expected failure");
-}
-
-TEST(StreamingAssertionsTest, StringsEqualIgnoringCase) {
- EXPECT_STRCASEEQ("foo", "FOO") << "unexpected failure";
- ASSERT_STRCASEEQ("foo", "FOO") << "unexpected failure";
- EXPECT_NONFATAL_FAILURE(EXPECT_STRCASEEQ("foo", "bar") << "expected failure",
- "expected failure");
- EXPECT_FATAL_FAILURE(ASSERT_STRCASEEQ("foo", "bar") << "expected failure",
- "expected failure");
-}
-
-TEST(StreamingAssertionsTest, StringNotEqualIgnoringCase) {
- EXPECT_STRCASENE("foo", "bar") << "unexpected failure";
- ASSERT_STRCASENE("foo", "bar") << "unexpected failure";
- EXPECT_NONFATAL_FAILURE(EXPECT_STRCASENE("foo", "FOO") << "expected failure",
- "expected failure");
- EXPECT_FATAL_FAILURE(ASSERT_STRCASENE("bar", "BAR") << "expected failure",
- "expected failure");
-}
-
-TEST(StreamingAssertionsTest, FloatingPointEquals) {
- EXPECT_FLOAT_EQ(1.0, 1.0) << "unexpected failure";
- ASSERT_FLOAT_EQ(1.0, 1.0) << "unexpected failure";
- EXPECT_NONFATAL_FAILURE(EXPECT_FLOAT_EQ(0.0, 1.0) << "expected failure",
- "expected failure");
- EXPECT_FATAL_FAILURE(ASSERT_FLOAT_EQ(0.0, 1.0) << "expected failure",
- "expected failure");
-}
-
-#if GTEST_HAS_EXCEPTIONS
-
-TEST(StreamingAssertionsTest, Throw) {
- EXPECT_THROW(ThrowAnInteger(), int) << "unexpected failure";
- ASSERT_THROW(ThrowAnInteger(), int) << "unexpected failure";
- EXPECT_NONFATAL_FAILURE(EXPECT_THROW(ThrowAnInteger(), bool) <<
- "expected failure", "expected failure");
- EXPECT_FATAL_FAILURE(ASSERT_THROW(ThrowAnInteger(), bool) <<
- "expected failure", "expected failure");
-}
-
-TEST(StreamingAssertionsTest, NoThrow) {
- EXPECT_NO_THROW(ThrowNothing()) << "unexpected failure";
- ASSERT_NO_THROW(ThrowNothing()) << "unexpected failure";
- EXPECT_NONFATAL_FAILURE(EXPECT_NO_THROW(ThrowAnInteger()) <<
- "expected failure", "expected failure");
- EXPECT_FATAL_FAILURE(ASSERT_NO_THROW(ThrowAnInteger()) <<
- "expected failure", "expected failure");
-}
-
-TEST(StreamingAssertionsTest, AnyThrow) {
- EXPECT_ANY_THROW(ThrowAnInteger()) << "unexpected failure";
- ASSERT_ANY_THROW(ThrowAnInteger()) << "unexpected failure";
- EXPECT_NONFATAL_FAILURE(EXPECT_ANY_THROW(ThrowNothing()) <<
- "expected failure", "expected failure");
- EXPECT_FATAL_FAILURE(ASSERT_ANY_THROW(ThrowNothing()) <<
- "expected failure", "expected failure");
-}
-
-#endif // GTEST_HAS_EXCEPTIONS
-
-// Tests that Google Test correctly decides whether to use colors in the output.
-
-TEST(ColoredOutputTest, UsesColorsWhenGTestColorFlagIsYes) {
- GTEST_FLAG(color) = "yes";
-
- SetEnv("TERM", "xterm"); // TERM supports colors.
- EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.
- EXPECT_TRUE(ShouldUseColor(false)); // Stdout is not a TTY.
-
- SetEnv("TERM", "dumb"); // TERM doesn't support colors.
- EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.
- EXPECT_TRUE(ShouldUseColor(false)); // Stdout is not a TTY.
-}
-
-TEST(ColoredOutputTest, UsesColorsWhenGTestColorFlagIsAliasOfYes) {
- SetEnv("TERM", "dumb"); // TERM doesn't support colors.
-
- GTEST_FLAG(color) = "True";
- EXPECT_TRUE(ShouldUseColor(false)); // Stdout is not a TTY.
-
- GTEST_FLAG(color) = "t";
- EXPECT_TRUE(ShouldUseColor(false)); // Stdout is not a TTY.
-
- GTEST_FLAG(color) = "1";
- EXPECT_TRUE(ShouldUseColor(false)); // Stdout is not a TTY.
-}
-
-TEST(ColoredOutputTest, UsesNoColorWhenGTestColorFlagIsNo) {
- GTEST_FLAG(color) = "no";
-
- SetEnv("TERM", "xterm"); // TERM supports colors.
- EXPECT_FALSE(ShouldUseColor(true)); // Stdout is a TTY.
- EXPECT_FALSE(ShouldUseColor(false)); // Stdout is not a TTY.
-
- SetEnv("TERM", "dumb"); // TERM doesn't support colors.
- EXPECT_FALSE(ShouldUseColor(true)); // Stdout is a TTY.
- EXPECT_FALSE(ShouldUseColor(false)); // Stdout is not a TTY.
-}
-
-TEST(ColoredOutputTest, UsesNoColorWhenGTestColorFlagIsInvalid) {
- SetEnv("TERM", "xterm"); // TERM supports colors.
-
- GTEST_FLAG(color) = "F";
- EXPECT_FALSE(ShouldUseColor(true)); // Stdout is a TTY.
-
- GTEST_FLAG(color) = "0";
- EXPECT_FALSE(ShouldUseColor(true)); // Stdout is a TTY.
-
- GTEST_FLAG(color) = "unknown";
- EXPECT_FALSE(ShouldUseColor(true)); // Stdout is a TTY.
-}
-
-TEST(ColoredOutputTest, UsesColorsWhenStdoutIsTty) {
- GTEST_FLAG(color) = "auto";
-
- SetEnv("TERM", "xterm"); // TERM supports colors.
- EXPECT_FALSE(ShouldUseColor(false)); // Stdout is not a TTY.
- EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.
-}
-
-TEST(ColoredOutputTest, UsesColorsWhenTermSupportsColors) {
- GTEST_FLAG(color) = "auto";
-
-#if GTEST_OS_WINDOWS
- // On Windows, we ignore the TERM variable as it's usually not set.
-
- SetEnv("TERM", "dumb");
- EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.
-
- SetEnv("TERM", "");
- EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.
-
- SetEnv("TERM", "xterm");
- EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.
-#else
- // On non-Windows platforms, we rely on TERM to determine if the
- // terminal supports colors.
-
- SetEnv("TERM", "dumb"); // TERM doesn't support colors.
- EXPECT_FALSE(ShouldUseColor(true)); // Stdout is a TTY.
-
- SetEnv("TERM", "emacs"); // TERM doesn't support colors.
- EXPECT_FALSE(ShouldUseColor(true)); // Stdout is a TTY.
-
- SetEnv("TERM", "vt100"); // TERM doesn't support colors.
- EXPECT_FALSE(ShouldUseColor(true)); // Stdout is a TTY.
-
- SetEnv("TERM", "xterm-mono"); // TERM doesn't support colors.
- EXPECT_FALSE(ShouldUseColor(true)); // Stdout is a TTY.
-
- SetEnv("TERM", "xterm"); // TERM supports colors.
- EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.
-
- SetEnv("TERM", "xterm-color"); // TERM supports colors.
- EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.
-
- SetEnv("TERM", "xterm-256color"); // TERM supports colors.
- EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.
-
- SetEnv("TERM", "screen"); // TERM supports colors.
- EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.
-
- SetEnv("TERM", "linux"); // TERM supports colors.
- EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.
-
- SetEnv("TERM", "cygwin"); // TERM supports colors.
- EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.
-#endif // GTEST_OS_WINDOWS
-}
-
-// Verifies that StaticAssertTypeEq works in a namespace scope.
-
-static bool dummy1 GTEST_ATTRIBUTE_UNUSED_ = StaticAssertTypeEq<bool, bool>();
-static bool dummy2 GTEST_ATTRIBUTE_UNUSED_ =
- StaticAssertTypeEq<const int, const int>();
-
-// Verifies that StaticAssertTypeEq works in a class.
-
-template <typename T>
-class StaticAssertTypeEqTestHelper {
- public:
- StaticAssertTypeEqTestHelper() { StaticAssertTypeEq<bool, T>(); }
-};
-
-TEST(StaticAssertTypeEqTest, WorksInClass) {
- StaticAssertTypeEqTestHelper<bool>();
-}
-
-// Verifies that StaticAssertTypeEq works inside a function.
-
-typedef int IntAlias;
-
-TEST(StaticAssertTypeEqTest, CompilesForEqualTypes) {
- StaticAssertTypeEq<int, IntAlias>();
- StaticAssertTypeEq<int*, IntAlias*>();
-}
-
-TEST(GetCurrentOsStackTraceExceptTopTest, ReturnsTheStackTrace) {
- testing::UnitTest* const unit_test = testing::UnitTest::GetInstance();
-
- // We don't have a stack walker in Google Test yet.
- EXPECT_STREQ("", GetCurrentOsStackTraceExceptTop(unit_test, 0).c_str());
- EXPECT_STREQ("", GetCurrentOsStackTraceExceptTop(unit_test, 1).c_str());
-}
-
-TEST(HasNonfatalFailureTest, ReturnsFalseWhenThereIsNoFailure) {
- EXPECT_FALSE(HasNonfatalFailure());
-}
-
-static void FailFatally() { FAIL(); }
-
-TEST(HasNonfatalFailureTest, ReturnsFalseWhenThereIsOnlyFatalFailure) {
- FailFatally();
- const bool has_nonfatal_failure = HasNonfatalFailure();
- ClearCurrentTestPartResults();
- EXPECT_FALSE(has_nonfatal_failure);
-}
-
-TEST(HasNonfatalFailureTest, ReturnsTrueWhenThereIsNonfatalFailure) {
- ADD_FAILURE();
- const bool has_nonfatal_failure = HasNonfatalFailure();
- ClearCurrentTestPartResults();
- EXPECT_TRUE(has_nonfatal_failure);
-}
-
-TEST(HasNonfatalFailureTest, ReturnsTrueWhenThereAreFatalAndNonfatalFailures) {
- FailFatally();
- ADD_FAILURE();
- const bool has_nonfatal_failure = HasNonfatalFailure();
- ClearCurrentTestPartResults();
- EXPECT_TRUE(has_nonfatal_failure);
-}
-
-// A wrapper for calling HasNonfatalFailure outside of a test body.
-static bool HasNonfatalFailureHelper() {
- return testing::Test::HasNonfatalFailure();
-}
-
-TEST(HasNonfatalFailureTest, WorksOutsideOfTestBody) {
- EXPECT_FALSE(HasNonfatalFailureHelper());
-}
-
-TEST(HasNonfatalFailureTest, WorksOutsideOfTestBody2) {
- ADD_FAILURE();
- const bool has_nonfatal_failure = HasNonfatalFailureHelper();
- ClearCurrentTestPartResults();
- EXPECT_TRUE(has_nonfatal_failure);
-}
-
-TEST(HasFailureTest, ReturnsFalseWhenThereIsNoFailure) {
- EXPECT_FALSE(HasFailure());
-}
-
-TEST(HasFailureTest, ReturnsTrueWhenThereIsFatalFailure) {
- FailFatally();
- const bool has_failure = HasFailure();
- ClearCurrentTestPartResults();
- EXPECT_TRUE(has_failure);
-}
-
-TEST(HasFailureTest, ReturnsTrueWhenThereIsNonfatalFailure) {
- ADD_FAILURE();
- const bool has_failure = HasFailure();
- ClearCurrentTestPartResults();
- EXPECT_TRUE(has_failure);
-}
-
-TEST(HasFailureTest, ReturnsTrueWhenThereAreFatalAndNonfatalFailures) {
- FailFatally();
- ADD_FAILURE();
- const bool has_failure = HasFailure();
- ClearCurrentTestPartResults();
- EXPECT_TRUE(has_failure);
-}
-
-// A wrapper for calling HasFailure outside of a test body.
-static bool HasFailureHelper() { return testing::Test::HasFailure(); }
-
-TEST(HasFailureTest, WorksOutsideOfTestBody) {
- EXPECT_FALSE(HasFailureHelper());
-}
-
-TEST(HasFailureTest, WorksOutsideOfTestBody2) {
- ADD_FAILURE();
- const bool has_failure = HasFailureHelper();
- ClearCurrentTestPartResults();
- EXPECT_TRUE(has_failure);
-}
-
-class TestListener : public EmptyTestEventListener {
- public:
- TestListener() : on_start_counter_(NULL), is_destroyed_(NULL) {}
- TestListener(int* on_start_counter, bool* is_destroyed)
- : on_start_counter_(on_start_counter),
- is_destroyed_(is_destroyed) {}
-
- virtual ~TestListener() {
- if (is_destroyed_)
- *is_destroyed_ = true;
- }
-
- protected:
- virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {
- if (on_start_counter_ != NULL)
- (*on_start_counter_)++;
- }
-
- private:
- int* on_start_counter_;
- bool* is_destroyed_;
-};
-
-// Tests the constructor.
-TEST(TestEventListenersTest, ConstructionWorks) {
- TestEventListeners listeners;
-
- EXPECT_TRUE(TestEventListenersAccessor::GetRepeater(&listeners) != NULL);
- EXPECT_TRUE(listeners.default_result_printer() == NULL);
- EXPECT_TRUE(listeners.default_xml_generator() == NULL);
-}
-
-// Tests that the TestEventListeners destructor deletes all the listeners it
-// owns.
-TEST(TestEventListenersTest, DestructionWorks) {
- bool default_result_printer_is_destroyed = false;
- bool default_xml_printer_is_destroyed = false;
- bool extra_listener_is_destroyed = false;
- TestListener* default_result_printer = new TestListener(
- NULL, &default_result_printer_is_destroyed);
- TestListener* default_xml_printer = new TestListener(
- NULL, &default_xml_printer_is_destroyed);
- TestListener* extra_listener = new TestListener(
- NULL, &extra_listener_is_destroyed);
-
- {
- TestEventListeners listeners;
- TestEventListenersAccessor::SetDefaultResultPrinter(&listeners,
- default_result_printer);
- TestEventListenersAccessor::SetDefaultXmlGenerator(&listeners,
- default_xml_printer);
- listeners.Append(extra_listener);
- }
- EXPECT_TRUE(default_result_printer_is_destroyed);
- EXPECT_TRUE(default_xml_printer_is_destroyed);
- EXPECT_TRUE(extra_listener_is_destroyed);
-}
-
-// Tests that a listener Append'ed to a TestEventListeners list starts
-// receiving events.
-TEST(TestEventListenersTest, Append) {
- int on_start_counter = 0;
- bool is_destroyed = false;
- TestListener* listener = new TestListener(&on_start_counter, &is_destroyed);
- {
- TestEventListeners listeners;
- listeners.Append(listener);
- TestEventListenersAccessor::GetRepeater(&listeners)->OnTestProgramStart(
- *UnitTest::GetInstance());
- EXPECT_EQ(1, on_start_counter);
- }
- EXPECT_TRUE(is_destroyed);
-}
-
-// Tests that listeners receive events in the order they were appended to
-// the list, except for *End requests, which must be received in the reverse
-// order.
-class SequenceTestingListener : public EmptyTestEventListener {
- public:
- SequenceTestingListener(std::vector<String>* vector, const char* id)
- : vector_(vector), id_(id) {}
-
- protected:
- virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {
- vector_->push_back(GetEventDescription("OnTestProgramStart"));
- }
-
- virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {
- vector_->push_back(GetEventDescription("OnTestProgramEnd"));
- }
-
- virtual void OnTestIterationStart(const UnitTest& /*unit_test*/,
- int /*iteration*/) {
- vector_->push_back(GetEventDescription("OnTestIterationStart"));
- }
-
- virtual void OnTestIterationEnd(const UnitTest& /*unit_test*/,
- int /*iteration*/) {
- vector_->push_back(GetEventDescription("OnTestIterationEnd"));
- }
-
- private:
- String GetEventDescription(const char* method) {
- Message message;
- message << id_ << "." << method;
- return message.GetString();
- }
-
- std::vector<String>* vector_;
- const char* const id_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(SequenceTestingListener);
-};
-
-TEST(EventListenerTest, AppendKeepsOrder) {
- std::vector<String> vec;
- TestEventListeners listeners;
- listeners.Append(new SequenceTestingListener(&vec, "1st"));
- listeners.Append(new SequenceTestingListener(&vec, "2nd"));
- listeners.Append(new SequenceTestingListener(&vec, "3rd"));
-
- TestEventListenersAccessor::GetRepeater(&listeners)->OnTestProgramStart(
- *UnitTest::GetInstance());
- ASSERT_EQ(3U, vec.size());
- EXPECT_STREQ("1st.OnTestProgramStart", vec[0].c_str());
- EXPECT_STREQ("2nd.OnTestProgramStart", vec[1].c_str());
- EXPECT_STREQ("3rd.OnTestProgramStart", vec[2].c_str());
-
- vec.clear();
- TestEventListenersAccessor::GetRepeater(&listeners)->OnTestProgramEnd(
- *UnitTest::GetInstance());
- ASSERT_EQ(3U, vec.size());
- EXPECT_STREQ("3rd.OnTestProgramEnd", vec[0].c_str());
- EXPECT_STREQ("2nd.OnTestProgramEnd", vec[1].c_str());
- EXPECT_STREQ("1st.OnTestProgramEnd", vec[2].c_str());
-
- vec.clear();
- TestEventListenersAccessor::GetRepeater(&listeners)->OnTestIterationStart(
- *UnitTest::GetInstance(), 0);
- ASSERT_EQ(3U, vec.size());
- EXPECT_STREQ("1st.OnTestIterationStart", vec[0].c_str());
- EXPECT_STREQ("2nd.OnTestIterationStart", vec[1].c_str());
- EXPECT_STREQ("3rd.OnTestIterationStart", vec[2].c_str());
-
- vec.clear();
- TestEventListenersAccessor::GetRepeater(&listeners)->OnTestIterationEnd(
- *UnitTest::GetInstance(), 0);
- ASSERT_EQ(3U, vec.size());
- EXPECT_STREQ("3rd.OnTestIterationEnd", vec[0].c_str());
- EXPECT_STREQ("2nd.OnTestIterationEnd", vec[1].c_str());
- EXPECT_STREQ("1st.OnTestIterationEnd", vec[2].c_str());
-}
-
-// Tests that a listener removed from a TestEventListeners list stops receiving
-// events and is not deleted when the list is destroyed.
-TEST(TestEventListenersTest, Release) {
- int on_start_counter = 0;
- bool is_destroyed = false;
- // Although Append passes the ownership of this object to the list,
- // the following calls release it, and we need to delete it before the
- // test ends.
- TestListener* listener = new TestListener(&on_start_counter, &is_destroyed);
- {
- TestEventListeners listeners;
- listeners.Append(listener);
- EXPECT_EQ(listener, listeners.Release(listener));
- TestEventListenersAccessor::GetRepeater(&listeners)->OnTestProgramStart(
- *UnitTest::GetInstance());
- EXPECT_TRUE(listeners.Release(listener) == NULL);
- }
- EXPECT_EQ(0, on_start_counter);
- EXPECT_FALSE(is_destroyed);
- delete listener;
-}
-
-// Tests that no events are forwarded when event forwarding is disabled.
-TEST(EventListenerTest, SuppressEventForwarding) {
- int on_start_counter = 0;
- TestListener* listener = new TestListener(&on_start_counter, NULL);
-
- TestEventListeners listeners;
- listeners.Append(listener);
- ASSERT_TRUE(TestEventListenersAccessor::EventForwardingEnabled(listeners));
- TestEventListenersAccessor::SuppressEventForwarding(&listeners);
- ASSERT_FALSE(TestEventListenersAccessor::EventForwardingEnabled(listeners));
- TestEventListenersAccessor::GetRepeater(&listeners)->OnTestProgramStart(
- *UnitTest::GetInstance());
- EXPECT_EQ(0, on_start_counter);
-}
-
-// Tests that events generated by Google Test are not forwarded in
-// death test subprocesses.
-TEST(EventListenerDeathTest, EventsNotForwardedInDeathTestSubprecesses) {
- EXPECT_DEATH_IF_SUPPORTED({
- GTEST_CHECK_(TestEventListenersAccessor::EventForwardingEnabled(
- *GetUnitTestImpl()->listeners())) << "expected failure";},
- "expected failure");
-}
-
-// Tests that a listener installed via SetDefaultResultPrinter() starts
-// receiving events and is returned via default_result_printer() and that
-// the previous default_result_printer is removed from the list and deleted.
-TEST(EventListenerTest, default_result_printer) {
- int on_start_counter = 0;
- bool is_destroyed = false;
- TestListener* listener = new TestListener(&on_start_counter, &is_destroyed);
-
- TestEventListeners listeners;
- TestEventListenersAccessor::SetDefaultResultPrinter(&listeners, listener);
-
- EXPECT_EQ(listener, listeners.default_result_printer());
-
- TestEventListenersAccessor::GetRepeater(&listeners)->OnTestProgramStart(
- *UnitTest::GetInstance());
-
- EXPECT_EQ(1, on_start_counter);
-
- // Replacing default_result_printer with something else should remove it
- // from the list and destroy it.
- TestEventListenersAccessor::SetDefaultResultPrinter(&listeners, NULL);
-
- EXPECT_TRUE(listeners.default_result_printer() == NULL);
- EXPECT_TRUE(is_destroyed);
-
- // After broadcasting an event the counter is still the same, indicating
- // the listener is not in the list anymore.
- TestEventListenersAccessor::GetRepeater(&listeners)->OnTestProgramStart(
- *UnitTest::GetInstance());
- EXPECT_EQ(1, on_start_counter);
-}
-
-// Tests that the default_result_printer listener stops receiving events
-// when removed via Release and that is not owned by the list anymore.
-TEST(EventListenerTest, RemovingDefaultResultPrinterWorks) {
- int on_start_counter = 0;
- bool is_destroyed = false;
- // Although Append passes the ownership of this object to the list,
- // the following calls release it, and we need to delete it before the
- // test ends.
- TestListener* listener = new TestListener(&on_start_counter, &is_destroyed);
- {
- TestEventListeners listeners;
- TestEventListenersAccessor::SetDefaultResultPrinter(&listeners, listener);
-
- EXPECT_EQ(listener, listeners.Release(listener));
- EXPECT_TRUE(listeners.default_result_printer() == NULL);
- EXPECT_FALSE(is_destroyed);
-
- // Broadcasting events now should not affect default_result_printer.
- TestEventListenersAccessor::GetRepeater(&listeners)->OnTestProgramStart(
- *UnitTest::GetInstance());
- EXPECT_EQ(0, on_start_counter);
- }
- // Destroying the list should not affect the listener now, too.
- EXPECT_FALSE(is_destroyed);
- delete listener;
-}
-
-// Tests that a listener installed via SetDefaultXmlGenerator() starts
-// receiving events and is returned via default_xml_generator() and that
-// the previous default_xml_generator is removed from the list and deleted.
-TEST(EventListenerTest, default_xml_generator) {
- int on_start_counter = 0;
- bool is_destroyed = false;
- TestListener* listener = new TestListener(&on_start_counter, &is_destroyed);
-
- TestEventListeners listeners;
- TestEventListenersAccessor::SetDefaultXmlGenerator(&listeners, listener);
-
- EXPECT_EQ(listener, listeners.default_xml_generator());
-
- TestEventListenersAccessor::GetRepeater(&listeners)->OnTestProgramStart(
- *UnitTest::GetInstance());
-
- EXPECT_EQ(1, on_start_counter);
-
- // Replacing default_xml_generator with something else should remove it
- // from the list and destroy it.
- TestEventListenersAccessor::SetDefaultXmlGenerator(&listeners, NULL);
-
- EXPECT_TRUE(listeners.default_xml_generator() == NULL);
- EXPECT_TRUE(is_destroyed);
-
- // After broadcasting an event the counter is still the same, indicating
- // the listener is not in the list anymore.
- TestEventListenersAccessor::GetRepeater(&listeners)->OnTestProgramStart(
- *UnitTest::GetInstance());
- EXPECT_EQ(1, on_start_counter);
-}
-
-// Tests that the default_xml_generator listener stops receiving events
-// when removed via Release and that is not owned by the list anymore.
-TEST(EventListenerTest, RemovingDefaultXmlGeneratorWorks) {
- int on_start_counter = 0;
- bool is_destroyed = false;
- // Although Append passes the ownership of this object to the list,
- // the following calls release it, and we need to delete it before the
- // test ends.
- TestListener* listener = new TestListener(&on_start_counter, &is_destroyed);
- {
- TestEventListeners listeners;
- TestEventListenersAccessor::SetDefaultXmlGenerator(&listeners, listener);
-
- EXPECT_EQ(listener, listeners.Release(listener));
- EXPECT_TRUE(listeners.default_xml_generator() == NULL);
- EXPECT_FALSE(is_destroyed);
-
- // Broadcasting events now should not affect default_xml_generator.
- TestEventListenersAccessor::GetRepeater(&listeners)->OnTestProgramStart(
- *UnitTest::GetInstance());
- EXPECT_EQ(0, on_start_counter);
- }
- // Destroying the list should not affect the listener now, too.
- EXPECT_FALSE(is_destroyed);
- delete listener;
-}
-
-// Sanity tests to ensure that the alternative, verbose spellings of
-// some of the macros work. We don't test them thoroughly as that
-// would be quite involved. Since their implementations are
-// straightforward, and they are rarely used, we'll just rely on the
-// users to tell us when they are broken.
-GTEST_TEST(AlternativeNameTest, Works) { // GTEST_TEST is the same as TEST.
- GTEST_SUCCEED() << "OK"; // GTEST_SUCCEED is the same as SUCCEED.
-
- // GTEST_FAIL is the same as FAIL.
- EXPECT_FATAL_FAILURE(GTEST_FAIL() << "An expected failure",
- "An expected failure");
-
- // GTEST_ASSERT_XY is the same as ASSERT_XY.
-
- GTEST_ASSERT_EQ(0, 0);
- EXPECT_FATAL_FAILURE(GTEST_ASSERT_EQ(0, 1) << "An expected failure",
- "An expected failure");
- EXPECT_FATAL_FAILURE(GTEST_ASSERT_EQ(1, 0) << "An expected failure",
- "An expected failure");
-
- GTEST_ASSERT_NE(0, 1);
- GTEST_ASSERT_NE(1, 0);
- EXPECT_FATAL_FAILURE(GTEST_ASSERT_NE(0, 0) << "An expected failure",
- "An expected failure");
-
- GTEST_ASSERT_LE(0, 0);
- GTEST_ASSERT_LE(0, 1);
- EXPECT_FATAL_FAILURE(GTEST_ASSERT_LE(1, 0) << "An expected failure",
- "An expected failure");
-
- GTEST_ASSERT_LT(0, 1);
- EXPECT_FATAL_FAILURE(GTEST_ASSERT_LT(0, 0) << "An expected failure",
- "An expected failure");
- EXPECT_FATAL_FAILURE(GTEST_ASSERT_LT(1, 0) << "An expected failure",
- "An expected failure");
-
- GTEST_ASSERT_GE(0, 0);
- GTEST_ASSERT_GE(1, 0);
- EXPECT_FATAL_FAILURE(GTEST_ASSERT_GE(0, 1) << "An expected failure",
- "An expected failure");
-
- GTEST_ASSERT_GT(1, 0);
- EXPECT_FATAL_FAILURE(GTEST_ASSERT_GT(0, 1) << "An expected failure",
- "An expected failure");
- EXPECT_FATAL_FAILURE(GTEST_ASSERT_GT(1, 1) << "An expected failure",
- "An expected failure");
-}
-
-// Tests for internal utilities necessary for implementation of the universal
-// printing.
-// TODO(vladl@google.com): Find a better home for them.
-
-class ConversionHelperBase {};
-class ConversionHelperDerived : public ConversionHelperBase {};
-
-// Tests that IsAProtocolMessage<T>::value is a compile-time constant.
-TEST(IsAProtocolMessageTest, ValueIsCompileTimeConstant) {
- GTEST_COMPILE_ASSERT_(IsAProtocolMessage<ProtocolMessage>::value,
- const_true);
- GTEST_COMPILE_ASSERT_(!IsAProtocolMessage<int>::value, const_false);
-}
-
-// Tests that IsAProtocolMessage<T>::value is true when T is
-// proto2::Message or a sub-class of it.
-TEST(IsAProtocolMessageTest, ValueIsTrueWhenTypeIsAProtocolMessage) {
- EXPECT_TRUE(IsAProtocolMessage< ::proto2::Message>::value);
- EXPECT_TRUE(IsAProtocolMessage<ProtocolMessage>::value);
-}
-
-// Tests that IsAProtocolMessage<T>::value is false when T is neither
-// ProtocolMessage nor a sub-class of it.
-TEST(IsAProtocolMessageTest, ValueIsFalseWhenTypeIsNotAProtocolMessage) {
- EXPECT_FALSE(IsAProtocolMessage<int>::value);
- EXPECT_FALSE(IsAProtocolMessage<const ConversionHelperBase>::value);
-}
-
-// Tests that CompileAssertTypesEqual compiles when the type arguments are
-// equal.
-TEST(CompileAssertTypesEqual, CompilesWhenTypesAreEqual) {
- CompileAssertTypesEqual<void, void>();
- CompileAssertTypesEqual<int*, int*>();
-}
-
-// Tests that RemoveReference does not affect non-reference types.
-TEST(RemoveReferenceTest, DoesNotAffectNonReferenceType) {
- CompileAssertTypesEqual<int, RemoveReference<int>::type>();
- CompileAssertTypesEqual<const char, RemoveReference<const char>::type>();
-}
-
-// Tests that RemoveReference removes reference from reference types.
-TEST(RemoveReferenceTest, RemovesReference) {
- CompileAssertTypesEqual<int, RemoveReference<int&>::type>();
- CompileAssertTypesEqual<const char, RemoveReference<const char&>::type>();
-}
-
-// Tests GTEST_REMOVE_REFERENCE_.
-
-template <typename T1, typename T2>
-void TestGTestRemoveReference() {
- CompileAssertTypesEqual<T1, GTEST_REMOVE_REFERENCE_(T2)>();
-}
-
-TEST(RemoveReferenceTest, MacroVersion) {
- TestGTestRemoveReference<int, int>();
- TestGTestRemoveReference<const char, const char&>();
-}
-
-
-// Tests that RemoveConst does not affect non-const types.
-TEST(RemoveConstTest, DoesNotAffectNonConstType) {
- CompileAssertTypesEqual<int, RemoveConst<int>::type>();
- CompileAssertTypesEqual<char&, RemoveConst<char&>::type>();
-}
-
-// Tests that RemoveConst removes const from const types.
-TEST(RemoveConstTest, RemovesConst) {
- CompileAssertTypesEqual<int, RemoveConst<const int>::type>();
- CompileAssertTypesEqual<char[2], RemoveConst<const char[2]>::type>();
- CompileAssertTypesEqual<char[2][3], RemoveConst<const char[2][3]>::type>();
-}
-
-// Tests GTEST_REMOVE_CONST_.
-
-template <typename T1, typename T2>
-void TestGTestRemoveConst() {
- CompileAssertTypesEqual<T1, GTEST_REMOVE_CONST_(T2)>();
-}
-
-TEST(RemoveConstTest, MacroVersion) {
- TestGTestRemoveConst<int, int>();
- TestGTestRemoveConst<double&, double&>();
- TestGTestRemoveConst<char, const char>();
-}
-
-// Tests GTEST_REMOVE_REFERENCE_AND_CONST_.
-
-template <typename T1, typename T2>
-void TestGTestRemoveReferenceAndConst() {
- CompileAssertTypesEqual<T1, GTEST_REMOVE_REFERENCE_AND_CONST_(T2)>();
-}
-
-TEST(RemoveReferenceToConstTest, Works) {
- TestGTestRemoveReferenceAndConst<int, int>();
- TestGTestRemoveReferenceAndConst<double, double&>();
- TestGTestRemoveReferenceAndConst<char, const char>();
- TestGTestRemoveReferenceAndConst<char, const char&>();
- TestGTestRemoveReferenceAndConst<const char*, const char*>();
-}
-
-// Tests that AddReference does not affect reference types.
-TEST(AddReferenceTest, DoesNotAffectReferenceType) {
- CompileAssertTypesEqual<int&, AddReference<int&>::type>();
- CompileAssertTypesEqual<const char&, AddReference<const char&>::type>();
-}
-
-// Tests that AddReference adds reference to non-reference types.
-TEST(AddReferenceTest, AddsReference) {
- CompileAssertTypesEqual<int&, AddReference<int>::type>();
- CompileAssertTypesEqual<const char&, AddReference<const char>::type>();
-}
-
-// Tests GTEST_ADD_REFERENCE_.
-
-template <typename T1, typename T2>
-void TestGTestAddReference() {
- CompileAssertTypesEqual<T1, GTEST_ADD_REFERENCE_(T2)>();
-}
-
-TEST(AddReferenceTest, MacroVersion) {
- TestGTestAddReference<int&, int>();
- TestGTestAddReference<const char&, const char&>();
-}
-
-// Tests GTEST_REFERENCE_TO_CONST_.
-
-template <typename T1, typename T2>
-void TestGTestReferenceToConst() {
- CompileAssertTypesEqual<T1, GTEST_REFERENCE_TO_CONST_(T2)>();
-}
-
-TEST(GTestReferenceToConstTest, Works) {
- TestGTestReferenceToConst<const char&, char>();
- TestGTestReferenceToConst<const int&, const int>();
- TestGTestReferenceToConst<const double&, double>();
- TestGTestReferenceToConst<const String&, const String&>();
-}
-
-// Tests that ImplicitlyConvertible<T1, T2>::value is a compile-time constant.
-TEST(ImplicitlyConvertibleTest, ValueIsCompileTimeConstant) {
- GTEST_COMPILE_ASSERT_((ImplicitlyConvertible<int, int>::value), const_true);
- GTEST_COMPILE_ASSERT_((!ImplicitlyConvertible<void*, int*>::value),
- const_false);
-}
-
-// Tests that ImplicitlyConvertible<T1, T2>::value is true when T1 can
-// be implicitly converted to T2.
-TEST(ImplicitlyConvertibleTest, ValueIsTrueWhenConvertible) {
- EXPECT_TRUE((ImplicitlyConvertible<int, double>::value));
- EXPECT_TRUE((ImplicitlyConvertible<double, int>::value));
- EXPECT_TRUE((ImplicitlyConvertible<int*, void*>::value));
- EXPECT_TRUE((ImplicitlyConvertible<int*, const int*>::value));
- EXPECT_TRUE((ImplicitlyConvertible<ConversionHelperDerived&,
- const ConversionHelperBase&>::value));
- EXPECT_TRUE((ImplicitlyConvertible<const ConversionHelperBase,
- ConversionHelperBase>::value));
-}
-
-// Tests that ImplicitlyConvertible<T1, T2>::value is false when T1
-// cannot be implicitly converted to T2.
-TEST(ImplicitlyConvertibleTest, ValueIsFalseWhenNotConvertible) {
- EXPECT_FALSE((ImplicitlyConvertible<double, int*>::value));
- EXPECT_FALSE((ImplicitlyConvertible<void*, int*>::value));
- EXPECT_FALSE((ImplicitlyConvertible<const int*, int*>::value));
- EXPECT_FALSE((ImplicitlyConvertible<ConversionHelperBase&,
- ConversionHelperDerived&>::value));
-}
-
-// Tests IsContainerTest.
-
-class NonContainer {};
-
-TEST(IsContainerTestTest, WorksForNonContainer) {
- EXPECT_EQ(sizeof(IsNotContainer), sizeof(IsContainerTest<int>(0)));
- EXPECT_EQ(sizeof(IsNotContainer), sizeof(IsContainerTest<char[5]>(0)));
- EXPECT_EQ(sizeof(IsNotContainer), sizeof(IsContainerTest<NonContainer>(0)));
-}
-
-TEST(IsContainerTestTest, WorksForContainer) {
- EXPECT_EQ(sizeof(IsContainer),
- sizeof(IsContainerTest<std::vector<bool> >(0)));
- EXPECT_EQ(sizeof(IsContainer),
- sizeof(IsContainerTest<std::map<int, double> >(0)));
-}
-
-// Tests ArrayEq().
-
-TEST(ArrayEqTest, WorksForDegeneratedArrays) {
- EXPECT_TRUE(ArrayEq(5, 5L));
- EXPECT_FALSE(ArrayEq('a', 0));
-}
-
-TEST(ArrayEqTest, WorksForOneDimensionalArrays) {
- // Note that a and b are distinct but compatible types.
- const int a[] = { 0, 1 };
- long b[] = { 0, 1 };
- EXPECT_TRUE(ArrayEq(a, b));
- EXPECT_TRUE(ArrayEq(a, 2, b));
-
- b[0] = 2;
- EXPECT_FALSE(ArrayEq(a, b));
- EXPECT_FALSE(ArrayEq(a, 1, b));
-}
-
-TEST(ArrayEqTest, WorksForTwoDimensionalArrays) {
- const char a[][3] = { "hi", "lo" };
- const char b[][3] = { "hi", "lo" };
- const char c[][3] = { "hi", "li" };
-
- EXPECT_TRUE(ArrayEq(a, b));
- EXPECT_TRUE(ArrayEq(a, 2, b));
-
- EXPECT_FALSE(ArrayEq(a, c));
- EXPECT_FALSE(ArrayEq(a, 2, c));
-}
-
-// Tests ArrayAwareFind().
-
-TEST(ArrayAwareFindTest, WorksForOneDimensionalArray) {
- const char a[] = "hello";
- EXPECT_EQ(a + 4, ArrayAwareFind(a, a + 5, 'o'));
- EXPECT_EQ(a + 5, ArrayAwareFind(a, a + 5, 'x'));
-}
-
-TEST(ArrayAwareFindTest, WorksForTwoDimensionalArray) {
- int a[][2] = { { 0, 1 }, { 2, 3 }, { 4, 5 } };
- const int b[2] = { 2, 3 };
- EXPECT_EQ(a + 1, ArrayAwareFind(a, a + 3, b));
-
- const int c[2] = { 6, 7 };
- EXPECT_EQ(a + 3, ArrayAwareFind(a, a + 3, c));
-}
-
-// Tests CopyArray().
-
-TEST(CopyArrayTest, WorksForDegeneratedArrays) {
- int n = 0;
- CopyArray('a', &n);
- EXPECT_EQ('a', n);
-}
-
-TEST(CopyArrayTest, WorksForOneDimensionalArrays) {
- const char a[3] = "hi";
- int b[3];
-#ifndef __BORLANDC__ // C++Builder cannot compile some array size deductions.
- CopyArray(a, &b);
- EXPECT_TRUE(ArrayEq(a, b));
-#endif
-
- int c[3];
- CopyArray(a, 3, c);
- EXPECT_TRUE(ArrayEq(a, c));
-}
-
-TEST(CopyArrayTest, WorksForTwoDimensionalArrays) {
- const int a[2][3] = { { 0, 1, 2 }, { 3, 4, 5 } };
- int b[2][3];
-#ifndef __BORLANDC__ // C++Builder cannot compile some array size deductions.
- CopyArray(a, &b);
- EXPECT_TRUE(ArrayEq(a, b));
-#endif
-
- int c[2][3];
- CopyArray(a, 2, c);
- EXPECT_TRUE(ArrayEq(a, c));
-}
-
-// Tests NativeArray.
-
-TEST(NativeArrayTest, ConstructorFromArrayWorks) {
- const int a[3] = { 0, 1, 2 };
- NativeArray<int> na(a, 3, kReference);
- EXPECT_EQ(3U, na.size());
- EXPECT_EQ(a, na.begin());
-}
-
-TEST(NativeArrayTest, CreatesAndDeletesCopyOfArrayWhenAskedTo) {
- typedef int Array[2];
- Array* a = new Array[1];
- (*a)[0] = 0;
- (*a)[1] = 1;
- NativeArray<int> na(*a, 2, kCopy);
- EXPECT_NE(*a, na.begin());
- delete[] a;
- EXPECT_EQ(0, na.begin()[0]);
- EXPECT_EQ(1, na.begin()[1]);
-
- // We rely on the heap checker to verify that na deletes the copy of
- // array.
-}
-
-TEST(NativeArrayTest, TypeMembersAreCorrect) {
- StaticAssertTypeEq<char, NativeArray<char>::value_type>();
- StaticAssertTypeEq<int[2], NativeArray<int[2]>::value_type>();
-
- StaticAssertTypeEq<const char*, NativeArray<char>::const_iterator>();
- StaticAssertTypeEq<const bool(*)[2], NativeArray<bool[2]>::const_iterator>();
-}
-
-TEST(NativeArrayTest, MethodsWork) {
- const int a[3] = { 0, 1, 2 };
- NativeArray<int> na(a, 3, kCopy);
- ASSERT_EQ(3U, na.size());
- EXPECT_EQ(3, na.end() - na.begin());
-
- NativeArray<int>::const_iterator it = na.begin();
- EXPECT_EQ(0, *it);
- ++it;
- EXPECT_EQ(1, *it);
- it++;
- EXPECT_EQ(2, *it);
- ++it;
- EXPECT_EQ(na.end(), it);
-
- EXPECT_TRUE(na == na);
-
- NativeArray<int> na2(a, 3, kReference);
- EXPECT_TRUE(na == na2);
-
- const int b1[3] = { 0, 1, 1 };
- const int b2[4] = { 0, 1, 2, 3 };
- EXPECT_FALSE(na == NativeArray<int>(b1, 3, kReference));
- EXPECT_FALSE(na == NativeArray<int>(b2, 4, kCopy));
-}
-
-TEST(NativeArrayTest, WorksForTwoDimensionalArray) {
- const char a[2][3] = { "hi", "lo" };
- NativeArray<char[3]> na(a, 2, kReference);
- ASSERT_EQ(2U, na.size());
- EXPECT_EQ(a, na.begin());
-}
-
-// Tests SkipPrefix().
-
-TEST(SkipPrefixTest, SkipsWhenPrefixMatches) {
- const char* const str = "hello";
-
- const char* p = str;
- EXPECT_TRUE(SkipPrefix("", &p));
- EXPECT_EQ(str, p);
-
- p = str;
- EXPECT_TRUE(SkipPrefix("hell", &p));
- EXPECT_EQ(str + 4, p);
-}
-
-TEST(SkipPrefixTest, DoesNotSkipWhenPrefixDoesNotMatch) {
- const char* const str = "world";
-
- const char* p = str;
- EXPECT_FALSE(SkipPrefix("W", &p));
- EXPECT_EQ(str, p);
-
- p = str;
- EXPECT_FALSE(SkipPrefix("world!", &p));
- EXPECT_EQ(str, p);
-}
diff --git a/src/testing/gtest/test/gtest_xml_outfile1_test_.cc b/src/testing/gtest/test/gtest_xml_outfile1_test_.cc
deleted file mode 100644
index 531ced49..00000000
--- a/src/testing/gtest/test/gtest_xml_outfile1_test_.cc
+++ /dev/null
@@ -1,49 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: keith.ray@gmail.com (Keith Ray)
-//
-// gtest_xml_outfile1_test_ writes some xml via TestProperty used by
-// gtest_xml_outfiles_test.py
-
-#include "gtest/gtest.h"
-
-class PropertyOne : public testing::Test {
- protected:
- virtual void SetUp() {
- RecordProperty("SetUpProp", 1);
- }
- virtual void TearDown() {
- RecordProperty("TearDownProp", 1);
- }
-};
-
-TEST_F(PropertyOne, TestSomeProperties) {
- RecordProperty("TestSomeProperty", 1);
-}
diff --git a/src/testing/gtest/test/gtest_xml_outfile2_test_.cc b/src/testing/gtest/test/gtest_xml_outfile2_test_.cc
deleted file mode 100644
index 7b400b27..00000000
--- a/src/testing/gtest/test/gtest_xml_outfile2_test_.cc
+++ /dev/null
@@ -1,49 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: keith.ray@gmail.com (Keith Ray)
-//
-// gtest_xml_outfile2_test_ writes some xml via TestProperty used by
-// gtest_xml_outfiles_test.py
-
-#include "gtest/gtest.h"
-
-class PropertyTwo : public testing::Test {
- protected:
- virtual void SetUp() {
- RecordProperty("SetUpProp", 2);
- }
- virtual void TearDown() {
- RecordProperty("TearDownProp", 2);
- }
-};
-
-TEST_F(PropertyTwo, TestSomeProperties) {
- RecordProperty("TestSomeProperty", 2);
-}
diff --git a/src/testing/gtest/test/gtest_xml_outfiles_test.py b/src/testing/gtest/test/gtest_xml_outfiles_test.py
deleted file mode 100755
index 524e437e..00000000
--- a/src/testing/gtest/test/gtest_xml_outfiles_test.py
+++ /dev/null
@@ -1,132 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2008, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-"""Unit test for the gtest_xml_output module."""
-
-__author__ = "keith.ray@gmail.com (Keith Ray)"
-
-import os
-from xml.dom import minidom, Node
-
-import gtest_test_utils
-import gtest_xml_test_utils
-
-
-GTEST_OUTPUT_SUBDIR = "xml_outfiles"
-GTEST_OUTPUT_1_TEST = "gtest_xml_outfile1_test_"
-GTEST_OUTPUT_2_TEST = "gtest_xml_outfile2_test_"
-
-EXPECTED_XML_1 = """<?xml version="1.0" encoding="UTF-8"?>
-<testsuites tests="1" failures="0" disabled="0" errors="0" time="*" timestamp="*" name="AllTests">
- <testsuite name="PropertyOne" tests="1" failures="0" disabled="0" errors="0" time="*">
- <testcase name="TestSomeProperties" status="run" time="*" classname="PropertyOne" SetUpProp="1" TestSomeProperty="1" TearDownProp="1" />
- </testsuite>
-</testsuites>
-"""
-
-EXPECTED_XML_2 = """<?xml version="1.0" encoding="UTF-8"?>
-<testsuites tests="1" failures="0" disabled="0" errors="0" time="*" timestamp="*" name="AllTests">
- <testsuite name="PropertyTwo" tests="1" failures="0" disabled="0" errors="0" time="*">
- <testcase name="TestSomeProperties" status="run" time="*" classname="PropertyTwo" SetUpProp="2" TestSomeProperty="2" TearDownProp="2" />
- </testsuite>
-</testsuites>
-"""
-
-
-class GTestXMLOutFilesTest(gtest_xml_test_utils.GTestXMLTestCase):
- """Unit test for Google Test's XML output functionality."""
-
- def setUp(self):
- # We want the trailing '/' that the last "" provides in os.path.join, for
- # telling Google Test to create an output directory instead of a single file
- # for xml output.
- self.output_dir_ = os.path.join(gtest_test_utils.GetTempDir(),
- GTEST_OUTPUT_SUBDIR, "")
- self.DeleteFilesAndDir()
-
- def tearDown(self):
- self.DeleteFilesAndDir()
-
- def DeleteFilesAndDir(self):
- try:
- os.remove(os.path.join(self.output_dir_, GTEST_OUTPUT_1_TEST + ".xml"))
- except os.error:
- pass
- try:
- os.remove(os.path.join(self.output_dir_, GTEST_OUTPUT_2_TEST + ".xml"))
- except os.error:
- pass
- try:
- os.rmdir(self.output_dir_)
- except os.error:
- pass
-
- def testOutfile1(self):
- self._TestOutFile(GTEST_OUTPUT_1_TEST, EXPECTED_XML_1)
-
- def testOutfile2(self):
- self._TestOutFile(GTEST_OUTPUT_2_TEST, EXPECTED_XML_2)
-
- def _TestOutFile(self, test_name, expected_xml):
- gtest_prog_path = gtest_test_utils.GetTestExecutablePath(test_name)
- command = [gtest_prog_path, "--gtest_output=xml:%s" % self.output_dir_]
- p = gtest_test_utils.Subprocess(command,
- working_dir=gtest_test_utils.GetTempDir())
- self.assert_(p.exited)
- self.assertEquals(0, p.exit_code)
-
- # TODO(wan@google.com): libtool causes the built test binary to be
- # named lt-gtest_xml_outfiles_test_ instead of
- # gtest_xml_outfiles_test_. To account for this possibillity, we
- # allow both names in the following code. We should remove this
- # hack when Chandler Carruth's libtool replacement tool is ready.
- output_file_name1 = test_name + ".xml"
- output_file1 = os.path.join(self.output_dir_, output_file_name1)
- output_file_name2 = 'lt-' + output_file_name1
- output_file2 = os.path.join(self.output_dir_, output_file_name2)
- self.assert_(os.path.isfile(output_file1) or os.path.isfile(output_file2),
- output_file1)
-
- expected = minidom.parseString(expected_xml)
- if os.path.isfile(output_file1):
- actual = minidom.parse(output_file1)
- else:
- actual = minidom.parse(output_file2)
- self.NormalizeXml(actual.documentElement)
- self.AssertEquivalentNodes(expected.documentElement,
- actual.documentElement)
- expected.unlink()
- actual.unlink()
-
-
-if __name__ == "__main__":
- os.environ["GTEST_STACK_TRACE_DEPTH"] = "0"
- gtest_test_utils.Main()
diff --git a/src/testing/gtest/test/gtest_xml_output_unittest.py b/src/testing/gtest/test/gtest_xml_output_unittest.py
deleted file mode 100755
index 1bcd4187..00000000
--- a/src/testing/gtest/test/gtest_xml_output_unittest.py
+++ /dev/null
@@ -1,284 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2006, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-"""Unit test for the gtest_xml_output module"""
-
-__author__ = 'eefacm@gmail.com (Sean Mcafee)'
-
-import datetime
-import errno
-import os
-import re
-import sys
-from xml.dom import minidom, Node
-
-import gtest_test_utils
-import gtest_xml_test_utils
-
-
-GTEST_LIST_TESTS_FLAG = '--gtest_list_tests'
-GTEST_OUTPUT_FLAG = "--gtest_output"
-GTEST_DEFAULT_OUTPUT_FILE = "test_detail.xml"
-GTEST_PROGRAM_NAME = "gtest_xml_output_unittest_"
-
-SUPPORTS_STACK_TRACES = False
-
-if SUPPORTS_STACK_TRACES:
- STACK_TRACE_TEMPLATE = '\nStack trace:\n*'
-else:
- STACK_TRACE_TEMPLATE = ''
-
-EXPECTED_NON_EMPTY_XML = """<?xml version="1.0" encoding="UTF-8"?>
-<testsuites tests="23" failures="4" disabled="2" errors="0" time="*" timestamp="*" name="AllTests">
- <testsuite name="SuccessfulTest" tests="1" failures="0" disabled="0" errors="0" time="*">
- <testcase name="Succeeds" status="run" time="*" classname="SuccessfulTest"/>
- </testsuite>
- <testsuite name="FailedTest" tests="1" failures="1" disabled="0" errors="0" time="*">
- <testcase name="Fails" status="run" time="*" classname="FailedTest">
- <failure message="gtest_xml_output_unittest_.cc:*&#x0A;Value of: 2&#x0A;Expected: 1" type=""><![CDATA[gtest_xml_output_unittest_.cc:*
-Value of: 2
-Expected: 1%(stack)s]]></failure>
- </testcase>
- </testsuite>
- <testsuite name="MixedResultTest" tests="3" failures="1" disabled="1" errors="0" time="*">
- <testcase name="Succeeds" status="run" time="*" classname="MixedResultTest"/>
- <testcase name="Fails" status="run" time="*" classname="MixedResultTest">
- <failure message="gtest_xml_output_unittest_.cc:*&#x0A;Value of: 2&#x0A;Expected: 1" type=""><![CDATA[gtest_xml_output_unittest_.cc:*
-Value of: 2
-Expected: 1%(stack)s]]></failure>
- <failure message="gtest_xml_output_unittest_.cc:*&#x0A;Value of: 3&#x0A;Expected: 2" type=""><![CDATA[gtest_xml_output_unittest_.cc:*
-Value of: 3
-Expected: 2%(stack)s]]></failure>
- </testcase>
- <testcase name="DISABLED_test" status="notrun" time="*" classname="MixedResultTest"/>
- </testsuite>
- <testsuite name="XmlQuotingTest" tests="1" failures="1" disabled="0" errors="0" time="*">
- <testcase name="OutputsCData" status="run" time="*" classname="XmlQuotingTest">
- <failure message="gtest_xml_output_unittest_.cc:*&#x0A;Failed&#x0A;XML output: &lt;?xml encoding=&quot;utf-8&quot;&gt;&lt;top&gt;&lt;![CDATA[cdata text]]&gt;&lt;/top&gt;" type=""><![CDATA[gtest_xml_output_unittest_.cc:*
-Failed
-XML output: <?xml encoding="utf-8"><top><![CDATA[cdata text]]>]]&gt;<![CDATA[</top>%(stack)s]]></failure>
- </testcase>
- </testsuite>
- <testsuite name="InvalidCharactersTest" tests="1" failures="1" disabled="0" errors="0" time="*">
- <testcase name="InvalidCharactersInMessage" status="run" time="*" classname="InvalidCharactersTest">
- <failure message="gtest_xml_output_unittest_.cc:*&#x0A;Failed&#x0A;Invalid characters in brackets []" type=""><![CDATA[gtest_xml_output_unittest_.cc:*
-Failed
-Invalid characters in brackets []%(stack)s]]></failure>
- </testcase>
- </testsuite>
- <testsuite name="DisabledTest" tests="1" failures="0" disabled="1" errors="0" time="*">
- <testcase name="DISABLED_test_not_run" status="notrun" time="*" classname="DisabledTest"/>
- </testsuite>
- <testsuite name="PropertyRecordingTest" tests="4" failures="0" disabled="0" errors="0" time="*">
- <testcase name="OneProperty" status="run" time="*" classname="PropertyRecordingTest" key_1="1"/>
- <testcase name="IntValuedProperty" status="run" time="*" classname="PropertyRecordingTest" key_int="1"/>
- <testcase name="ThreeProperties" status="run" time="*" classname="PropertyRecordingTest" key_1="1" key_2="2" key_3="3"/>
- <testcase name="TwoValuesForOneKeyUsesLastValue" status="run" time="*" classname="PropertyRecordingTest" key_1="2"/>
- </testsuite>
- <testsuite name="NoFixtureTest" tests="3" failures="0" disabled="0" errors="0" time="*">
- <testcase name="RecordProperty" status="run" time="*" classname="NoFixtureTest" key="1"/>
- <testcase name="ExternalUtilityThatCallsRecordIntValuedProperty" status="run" time="*" classname="NoFixtureTest" key_for_utility_int="1"/>
- <testcase name="ExternalUtilityThatCallsRecordStringValuedProperty" status="run" time="*" classname="NoFixtureTest" key_for_utility_string="1"/>
- </testsuite>
- <testsuite name="Single/ValueParamTest" tests="4" failures="0" disabled="0" errors="0" time="*">
- <testcase name="HasValueParamAttribute/0" value_param="33" status="run" time="*" classname="Single/ValueParamTest" />
- <testcase name="HasValueParamAttribute/1" value_param="42" status="run" time="*" classname="Single/ValueParamTest" />
- <testcase name="AnotherTestThatHasValueParamAttribute/0" value_param="33" status="run" time="*" classname="Single/ValueParamTest" />
- <testcase name="AnotherTestThatHasValueParamAttribute/1" value_param="42" status="run" time="*" classname="Single/ValueParamTest" />
- </testsuite>
- <testsuite name="TypedTest/0" tests="1" failures="0" disabled="0" errors="0" time="*">
- <testcase name="HasTypeParamAttribute" type_param="*" status="run" time="*" classname="TypedTest/0" />
- </testsuite>
- <testsuite name="TypedTest/1" tests="1" failures="0" disabled="0" errors="0" time="*">
- <testcase name="HasTypeParamAttribute" type_param="*" status="run" time="*" classname="TypedTest/1" />
- </testsuite>
- <testsuite name="Single/TypeParameterizedTestCase/0" tests="1" failures="0" disabled="0" errors="0" time="*">
- <testcase name="HasTypeParamAttribute" type_param="*" status="run" time="*" classname="Single/TypeParameterizedTestCase/0" />
- </testsuite>
- <testsuite name="Single/TypeParameterizedTestCase/1" tests="1" failures="0" disabled="0" errors="0" time="*">
- <testcase name="HasTypeParamAttribute" type_param="*" status="run" time="*" classname="Single/TypeParameterizedTestCase/1" />
- </testsuite>
-</testsuites>""" % {'stack': STACK_TRACE_TEMPLATE}
-
-
-EXPECTED_EMPTY_XML = """<?xml version="1.0" encoding="UTF-8"?>
-<testsuites tests="0" failures="0" disabled="0" errors="0" time="*" timestamp="*" name="AllTests">
-</testsuites>"""
-
-GTEST_PROGRAM_PATH = gtest_test_utils.GetTestExecutablePath(GTEST_PROGRAM_NAME)
-
-SUPPORTS_TYPED_TESTS = 'TypedTest' in gtest_test_utils.Subprocess(
- [GTEST_PROGRAM_PATH, GTEST_LIST_TESTS_FLAG], capture_stderr=False).output
-
-
-class GTestXMLOutputUnitTest(gtest_xml_test_utils.GTestXMLTestCase):
- """
- Unit test for Google Test's XML output functionality.
- """
-
- # This test currently breaks on platforms that do not support typed and
- # type-parameterized tests, so we don't run it under them.
- if SUPPORTS_TYPED_TESTS:
- def testNonEmptyXmlOutput(self):
- """
- Runs a test program that generates a non-empty XML output, and
- tests that the XML output is expected.
- """
- self._TestXmlOutput(GTEST_PROGRAM_NAME, EXPECTED_NON_EMPTY_XML, 1)
-
- def testEmptyXmlOutput(self):
- """Verifies XML output for a Google Test binary without actual tests.
-
- Runs a test program that generates an empty XML output, and
- tests that the XML output is expected.
- """
-
- self._TestXmlOutput('gtest_no_test_unittest', EXPECTED_EMPTY_XML, 0)
-
- def testTimestampValue(self):
- """Checks whether the timestamp attribute in the XML output is valid.
-
- Runs a test program that generates an empty XML output, and checks if
- the timestamp attribute in the testsuites tag is valid.
- """
- actual = self._GetXmlOutput('gtest_no_test_unittest', 0)
- date_time_str = actual.documentElement.getAttributeNode('timestamp').value
- # datetime.strptime() is only available in Python 2.5+ so we have to
- # parse the expected datetime manually.
- match = re.match(r'(\d+)-(\d\d)-(\d\d)T(\d\d):(\d\d):(\d\d)', date_time_str)
- self.assertTrue(
- re.match,
- 'XML datettime string %s has incorrect format' % date_time_str)
- date_time_from_xml = datetime.datetime(
- year=int(match.group(1)), month=int(match.group(2)),
- day=int(match.group(3)), hour=int(match.group(4)),
- minute=int(match.group(5)), second=int(match.group(6)))
-
- time_delta = abs(datetime.datetime.now() - date_time_from_xml)
- # timestamp value should be near the current local time
- self.assertTrue(time_delta < datetime.timedelta(seconds=600),
- 'time_delta is %s' % time_delta)
- actual.unlink()
-
- def testDefaultOutputFile(self):
- """
- Confirms that Google Test produces an XML output file with the expected
- default name if no name is explicitly specified.
- """
- output_file = os.path.join(gtest_test_utils.GetTempDir(),
- GTEST_DEFAULT_OUTPUT_FILE)
- gtest_prog_path = gtest_test_utils.GetTestExecutablePath(
- 'gtest_no_test_unittest')
- try:
- os.remove(output_file)
- except OSError, e:
- if e.errno != errno.ENOENT:
- raise
-
- p = gtest_test_utils.Subprocess(
- [gtest_prog_path, '%s=xml' % GTEST_OUTPUT_FLAG],
- working_dir=gtest_test_utils.GetTempDir())
- self.assert_(p.exited)
- self.assertEquals(0, p.exit_code)
- self.assert_(os.path.isfile(output_file))
-
- def testSuppressedXmlOutput(self):
- """
- Tests that no XML file is generated if the default XML listener is
- shut down before RUN_ALL_TESTS is invoked.
- """
-
- xml_path = os.path.join(gtest_test_utils.GetTempDir(),
- GTEST_PROGRAM_NAME + 'out.xml')
- if os.path.isfile(xml_path):
- os.remove(xml_path)
-
- command = [GTEST_PROGRAM_PATH,
- '%s=xml:%s' % (GTEST_OUTPUT_FLAG, xml_path),
- '--shut_down_xml']
- p = gtest_test_utils.Subprocess(command)
- if p.terminated_by_signal:
- # p.signal is avalable only if p.terminated_by_signal is True.
- self.assertFalse(
- p.terminated_by_signal,
- '%s was killed by signal %d' % (GTEST_PROGRAM_NAME, p.signal))
- else:
- self.assert_(p.exited)
- self.assertEquals(1, p.exit_code,
- "'%s' exited with code %s, which doesn't match "
- 'the expected exit code %s.'
- % (command, p.exit_code, 1))
-
- self.assert_(not os.path.isfile(xml_path))
-
- def _GetXmlOutput(self, gtest_prog_name, expected_exit_code):
- """
- Returns the xml output generated by running the program gtest_prog_name.
- Furthermore, the program's exit code must be expected_exit_code.
- """
- xml_path = os.path.join(gtest_test_utils.GetTempDir(),
- gtest_prog_name + 'out.xml')
- gtest_prog_path = gtest_test_utils.GetTestExecutablePath(gtest_prog_name)
-
- command = [gtest_prog_path, '%s=xml:%s' % (GTEST_OUTPUT_FLAG, xml_path)]
- p = gtest_test_utils.Subprocess(command)
- if p.terminated_by_signal:
- self.assert_(False,
- '%s was killed by signal %d' % (gtest_prog_name, p.signal))
- else:
- self.assert_(p.exited)
- self.assertEquals(expected_exit_code, p.exit_code,
- "'%s' exited with code %s, which doesn't match "
- 'the expected exit code %s.'
- % (command, p.exit_code, expected_exit_code))
- actual = minidom.parse(xml_path)
- return actual
-
- def _TestXmlOutput(self, gtest_prog_name, expected_xml, expected_exit_code):
- """
- Asserts that the XML document generated by running the program
- gtest_prog_name matches expected_xml, a string containing another
- XML document. Furthermore, the program's exit code must be
- expected_exit_code.
- """
-
- actual = self._GetXmlOutput(gtest_prog_name, expected_exit_code)
- expected = minidom.parseString(expected_xml)
- self.NormalizeXml(actual.documentElement)
- self.AssertEquivalentNodes(expected.documentElement,
- actual.documentElement)
- expected.unlink()
- actual.unlink()
-
-
-if __name__ == '__main__':
- os.environ['GTEST_STACK_TRACE_DEPTH'] = '1'
- gtest_test_utils.Main()
diff --git a/src/testing/gtest/test/gtest_xml_output_unittest_.cc b/src/testing/gtest/test/gtest_xml_output_unittest_.cc
deleted file mode 100644
index bf0c871b..00000000
--- a/src/testing/gtest/test/gtest_xml_output_unittest_.cc
+++ /dev/null
@@ -1,177 +0,0 @@
-// Copyright 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Author: eefacm@gmail.com (Sean Mcafee)
-
-// Unit test for Google Test XML output.
-//
-// A user can specify XML output in a Google Test program to run via
-// either the GTEST_OUTPUT environment variable or the --gtest_output
-// flag. This is used for testing such functionality.
-//
-// This program will be invoked from a Python unit test. Don't run it
-// directly.
-
-#include "gtest/gtest.h"
-
-using ::testing::InitGoogleTest;
-using ::testing::TestEventListeners;
-using ::testing::TestWithParam;
-using ::testing::UnitTest;
-using ::testing::Test;
-using ::testing::Values;
-
-class SuccessfulTest : public Test {
-};
-
-TEST_F(SuccessfulTest, Succeeds) {
- SUCCEED() << "This is a success.";
- ASSERT_EQ(1, 1);
-}
-
-class FailedTest : public Test {
-};
-
-TEST_F(FailedTest, Fails) {
- ASSERT_EQ(1, 2);
-}
-
-class DisabledTest : public Test {
-};
-
-TEST_F(DisabledTest, DISABLED_test_not_run) {
- FAIL() << "Unexpected failure: Disabled test should not be run";
-}
-
-TEST(MixedResultTest, Succeeds) {
- EXPECT_EQ(1, 1);
- ASSERT_EQ(1, 1);
-}
-
-TEST(MixedResultTest, Fails) {
- EXPECT_EQ(1, 2);
- ASSERT_EQ(2, 3);
-}
-
-TEST(MixedResultTest, DISABLED_test) {
- FAIL() << "Unexpected failure: Disabled test should not be run";
-}
-
-TEST(XmlQuotingTest, OutputsCData) {
- FAIL() << "XML output: "
- "<?xml encoding=\"utf-8\"><top><![CDATA[cdata text]]></top>";
-}
-
-// Helps to test that invalid characters produced by test code do not make
-// it into the XML file.
-TEST(InvalidCharactersTest, InvalidCharactersInMessage) {
- FAIL() << "Invalid characters in brackets [\x1\x2]";
-}
-
-class PropertyRecordingTest : public Test {
-};
-
-TEST_F(PropertyRecordingTest, OneProperty) {
- RecordProperty("key_1", "1");
-}
-
-TEST_F(PropertyRecordingTest, IntValuedProperty) {
- RecordProperty("key_int", 1);
-}
-
-TEST_F(PropertyRecordingTest, ThreeProperties) {
- RecordProperty("key_1", "1");
- RecordProperty("key_2", "2");
- RecordProperty("key_3", "3");
-}
-
-TEST_F(PropertyRecordingTest, TwoValuesForOneKeyUsesLastValue) {
- RecordProperty("key_1", "1");
- RecordProperty("key_1", "2");
-}
-
-TEST(NoFixtureTest, RecordProperty) {
- RecordProperty("key", "1");
-}
-
-void ExternalUtilityThatCallsRecordProperty(const char* key, int value) {
- testing::Test::RecordProperty(key, value);
-}
-
-void ExternalUtilityThatCallsRecordProperty(const char* key,
- const char* value) {
- testing::Test::RecordProperty(key, value);
-}
-
-TEST(NoFixtureTest, ExternalUtilityThatCallsRecordIntValuedProperty) {
- ExternalUtilityThatCallsRecordProperty("key_for_utility_int", 1);
-}
-
-TEST(NoFixtureTest, ExternalUtilityThatCallsRecordStringValuedProperty) {
- ExternalUtilityThatCallsRecordProperty("key_for_utility_string", "1");
-}
-
-// Verifies that the test parameter value is output in the 'value_param'
-// XML attribute for value-parameterized tests.
-class ValueParamTest : public TestWithParam<int> {};
-TEST_P(ValueParamTest, HasValueParamAttribute) {}
-TEST_P(ValueParamTest, AnotherTestThatHasValueParamAttribute) {}
-INSTANTIATE_TEST_CASE_P(Single, ValueParamTest, Values(33, 42));
-
-#if GTEST_HAS_TYPED_TEST
-// Verifies that the type parameter name is output in the 'type_param'
-// XML attribute for typed tests.
-template <typename T> class TypedTest : public Test {};
-typedef testing::Types<int, long> TypedTestTypes;
-TYPED_TEST_CASE(TypedTest, TypedTestTypes);
-TYPED_TEST(TypedTest, HasTypeParamAttribute) {}
-#endif
-
-#if GTEST_HAS_TYPED_TEST_P
-// Verifies that the type parameter name is output in the 'type_param'
-// XML attribute for type-parameterized tests.
-template <typename T> class TypeParameterizedTestCase : public Test {};
-TYPED_TEST_CASE_P(TypeParameterizedTestCase);
-TYPED_TEST_P(TypeParameterizedTestCase, HasTypeParamAttribute) {}
-REGISTER_TYPED_TEST_CASE_P(TypeParameterizedTestCase, HasTypeParamAttribute);
-typedef testing::Types<int, long> TypeParameterizedTestCaseTypes;
-INSTANTIATE_TYPED_TEST_CASE_P(Single,
- TypeParameterizedTestCase,
- TypeParameterizedTestCaseTypes);
-#endif
-
-int main(int argc, char** argv) {
- InitGoogleTest(&argc, argv);
-
- if (argc > 1 && strcmp(argv[1], "--shut_down_xml") == 0) {
- TestEventListeners& listeners = UnitTest::GetInstance()->listeners();
- delete listeners.Release(listeners.default_xml_generator());
- }
- return RUN_ALL_TESTS();
-}
diff --git a/src/testing/gtest/test/gtest_xml_test_utils.py b/src/testing/gtest/test/gtest_xml_test_utils.py
deleted file mode 100755
index 0e5a1089..00000000
--- a/src/testing/gtest/test/gtest_xml_test_utils.py
+++ /dev/null
@@ -1,190 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2006, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-"""Unit test utilities for gtest_xml_output"""
-
-__author__ = 'eefacm@gmail.com (Sean Mcafee)'
-
-import re
-from xml.dom import minidom, Node
-
-import gtest_test_utils
-
-
-GTEST_OUTPUT_FLAG = '--gtest_output'
-GTEST_DEFAULT_OUTPUT_FILE = 'test_detail.xml'
-
-class GTestXMLTestCase(gtest_test_utils.TestCase):
- """
- Base class for tests of Google Test's XML output functionality.
- """
-
-
- def AssertEquivalentNodes(self, expected_node, actual_node):
- """
- Asserts that actual_node (a DOM node object) is equivalent to
- expected_node (another DOM node object), in that either both of
- them are CDATA nodes and have the same value, or both are DOM
- elements and actual_node meets all of the following conditions:
-
- * It has the same tag name as expected_node.
- * It has the same set of attributes as expected_node, each with
- the same value as the corresponding attribute of expected_node.
- Exceptions are any attribute named "time", which needs only be
- convertible to a floating-point number and any attribute named
- "type_param" which only has to be non-empty.
- * It has an equivalent set of child nodes (including elements and
- CDATA sections) as expected_node. Note that we ignore the
- order of the children as they are not guaranteed to be in any
- particular order.
- """
-
- if expected_node.nodeType == Node.CDATA_SECTION_NODE:
- self.assertEquals(Node.CDATA_SECTION_NODE, actual_node.nodeType)
- self.assertEquals(expected_node.nodeValue, actual_node.nodeValue)
- return
-
- self.assertEquals(Node.ELEMENT_NODE, actual_node.nodeType)
- self.assertEquals(Node.ELEMENT_NODE, expected_node.nodeType)
- self.assertEquals(expected_node.tagName, actual_node.tagName)
-
- expected_attributes = expected_node.attributes
- actual_attributes = actual_node .attributes
- self.assertEquals(
- expected_attributes.length, actual_attributes.length,
- 'attribute numbers differ in element ' + actual_node.tagName)
- for i in range(expected_attributes.length):
- expected_attr = expected_attributes.item(i)
- actual_attr = actual_attributes.get(expected_attr.name)
- self.assert_(
- actual_attr is not None,
- 'expected attribute %s not found in element %s' %
- (expected_attr.name, actual_node.tagName))
- self.assertEquals(expected_attr.value, actual_attr.value,
- ' values of attribute %s in element %s differ' %
- (expected_attr.name, actual_node.tagName))
-
- expected_children = self._GetChildren(expected_node)
- actual_children = self._GetChildren(actual_node)
- self.assertEquals(
- len(expected_children), len(actual_children),
- 'number of child elements differ in element ' + actual_node.tagName)
- for child_id, child in expected_children.iteritems():
- self.assert_(child_id in actual_children,
- '<%s> is not in <%s> (in element %s)' %
- (child_id, actual_children, actual_node.tagName))
- self.AssertEquivalentNodes(child, actual_children[child_id])
-
- identifying_attribute = {
- 'testsuites': 'name',
- 'testsuite': 'name',
- 'testcase': 'name',
- 'failure': 'message',
- }
-
- def _GetChildren(self, element):
- """
- Fetches all of the child nodes of element, a DOM Element object.
- Returns them as the values of a dictionary keyed by the IDs of the
- children. For <testsuites>, <testsuite> and <testcase> elements, the ID
- is the value of their "name" attribute; for <failure> elements, it is
- the value of the "message" attribute; CDATA sections and non-whitespace
- text nodes are concatenated into a single CDATA section with ID
- "detail". An exception is raised if any element other than the above
- four is encountered, if two child elements with the same identifying
- attributes are encountered, or if any other type of node is encountered.
- """
-
- children = {}
- for child in element.childNodes:
- if child.nodeType == Node.ELEMENT_NODE:
- self.assert_(child.tagName in self.identifying_attribute,
- 'Encountered unknown element <%s>' % child.tagName)
- childID = child.getAttribute(self.identifying_attribute[child.tagName])
- self.assert_(childID not in children)
- children[childID] = child
- elif child.nodeType in [Node.TEXT_NODE, Node.CDATA_SECTION_NODE]:
- if 'detail' not in children:
- if (child.nodeType == Node.CDATA_SECTION_NODE or
- not child.nodeValue.isspace()):
- children['detail'] = child.ownerDocument.createCDATASection(
- child.nodeValue)
- else:
- children['detail'].nodeValue += child.nodeValue
- else:
- self.fail('Encountered unexpected node type %d' % child.nodeType)
- return children
-
- def NormalizeXml(self, element):
- """
- Normalizes Google Test's XML output to eliminate references to transient
- information that may change from run to run.
-
- * The "time" attribute of <testsuites>, <testsuite> and <testcase>
- elements is replaced with a single asterisk, if it contains
- only digit characters.
- * The "timestamp" attribute of <testsuites> elements is replaced with a
- single asterisk, if it contains a valid ISO8601 datetime value.
- * The "type_param" attribute of <testcase> elements is replaced with a
- single asterisk (if it sn non-empty) as it is the type name returned
- by the compiler and is platform dependent.
- * The line info reported in the first line of the "message"
- attribute and CDATA section of <failure> elements is replaced with the
- file's basename and a single asterisk for the line number.
- * The directory names in file paths are removed.
- * The stack traces are removed.
- """
-
- if element.tagName == 'testsuites':
- timestamp = element.getAttributeNode('timestamp')
- timestamp.value = re.sub(r'^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d$',
- '*', timestamp.value)
- if element.tagName in ('testsuites', 'testsuite', 'testcase'):
- time = element.getAttributeNode('time')
- time.value = re.sub(r'^\d+(\.\d+)?$', '*', time.value)
- type_param = element.getAttributeNode('type_param')
- if type_param and type_param.value:
- type_param.value = '*'
- elif element.tagName == 'failure':
- source_line_pat = r'^.*[/\\](.*:)\d+\n'
- # Replaces the source line information with a normalized form.
- message = element.getAttributeNode('message')
- message.value = re.sub(source_line_pat, '\\1*\n', message.value)
- for child in element.childNodes:
- if child.nodeType == Node.CDATA_SECTION_NODE:
- # Replaces the source line information with a normalized form.
- cdata = re.sub(source_line_pat, '\\1*\n', child.nodeValue)
- # Removes the actual stack trace.
- child.nodeValue = re.sub(r'\nStack trace:\n(.|\n)*',
- '', cdata)
- for child in element.childNodes:
- if child.nodeType == Node.ELEMENT_NODE:
- self.NormalizeXml(child)
diff --git a/src/testing/gtest/xcode/Config/DebugProject.xcconfig b/src/testing/gtest/xcode/Config/DebugProject.xcconfig
deleted file mode 100644
index 3d68157d..00000000
--- a/src/testing/gtest/xcode/Config/DebugProject.xcconfig
+++ /dev/null
@@ -1,30 +0,0 @@
-//
-// DebugProject.xcconfig
-//
-// These are Debug Configuration project settings for the gtest framework and
-// examples. It is set in the "Based On:" dropdown in the "Project" info
-// dialog.
-// This file is based on the Xcode Configuration files in:
-// http://code.google.com/p/google-toolbox-for-mac/
-//
-
-#include "General.xcconfig"
-
-// No optimization
-GCC_OPTIMIZATION_LEVEL = 0
-
-// Deployment postprocessing is what triggers Xcode to strip, turn it off
-DEPLOYMENT_POSTPROCESSING = NO
-
-// Dead code stripping off
-DEAD_CODE_STRIPPING = NO
-
-// Debug symbols should be on obviously
-GCC_GENERATE_DEBUGGING_SYMBOLS = YES
-
-// Define the DEBUG macro in all debug builds
-OTHER_CFLAGS = $(OTHER_CFLAGS) -DDEBUG=1
-
-// These are turned off to avoid STL incompatibilities with client code
-// // Turns on special C++ STL checks to "encourage" good STL use
-// GCC_PREPROCESSOR_DEFINITIONS = $(GCC_PREPROCESSOR_DEFINITIONS) _GLIBCXX_DEBUG_PEDANTIC _GLIBCXX_DEBUG _GLIBCPP_CONCEPT_CHECKS
diff --git a/src/testing/gtest/xcode/Config/FrameworkTarget.xcconfig b/src/testing/gtest/xcode/Config/FrameworkTarget.xcconfig
deleted file mode 100644
index 357b1c8f..00000000
--- a/src/testing/gtest/xcode/Config/FrameworkTarget.xcconfig
+++ /dev/null
@@ -1,17 +0,0 @@
-//
-// FrameworkTarget.xcconfig
-//
-// These are Framework target settings for the gtest framework and examples. It
-// is set in the "Based On:" dropdown in the "Target" info dialog.
-// This file is based on the Xcode Configuration files in:
-// http://code.google.com/p/google-toolbox-for-mac/
-//
-
-// Dynamic libs need to be position independent
-GCC_DYNAMIC_NO_PIC = NO
-
-// Dynamic libs should not have their external symbols stripped.
-STRIP_STYLE = non-global
-
-// Let the user install by specifying the $DSTROOT with xcodebuild
-SKIP_INSTALL = NO
diff --git a/src/testing/gtest/xcode/Config/General.xcconfig b/src/testing/gtest/xcode/Config/General.xcconfig
deleted file mode 100644
index f23e3222..00000000
--- a/src/testing/gtest/xcode/Config/General.xcconfig
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// General.xcconfig
-//
-// These are General configuration settings for the gtest framework and
-// examples.
-// This file is based on the Xcode Configuration files in:
-// http://code.google.com/p/google-toolbox-for-mac/
-//
-
-// Build for PPC and Intel, 32- and 64-bit
-ARCHS = i386 x86_64 ppc ppc64
-
-// Zerolink prevents link warnings so turn it off
-ZERO_LINK = NO
-
-// Prebinding considered unhelpful in 10.3 and later
-PREBINDING = NO
-
-// Strictest warning policy
-WARNING_CFLAGS = -Wall -Werror -Wendif-labels -Wnewline-eof -Wno-sign-compare -Wshadow
-
-// Work around Xcode bugs by using external strip. See:
-// http://lists.apple.com/archives/Xcode-users/2006/Feb/msg00050.html
-SEPARATE_STRIP = YES
-
-// Force C99 dialect
-GCC_C_LANGUAGE_STANDARD = c99
-
-// not sure why apple defaults this on, but it's pretty risky
-ALWAYS_SEARCH_USER_PATHS = NO
-
-// Turn on position dependent code for most cases (overridden where appropriate)
-GCC_DYNAMIC_NO_PIC = YES
-
-// Default SDK and minimum OS version is 10.4
-SDKROOT = $(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk
-MACOSX_DEPLOYMENT_TARGET = 10.4
-GCC_VERSION = 4.0
-
-// VERSIONING BUILD SETTINGS (used in Info.plist)
-GTEST_VERSIONINFO_ABOUT = © 2008 Google Inc.
diff --git a/src/testing/gtest/xcode/Config/ReleaseProject.xcconfig b/src/testing/gtest/xcode/Config/ReleaseProject.xcconfig
deleted file mode 100644
index 5349f0a0..00000000
--- a/src/testing/gtest/xcode/Config/ReleaseProject.xcconfig
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-// ReleaseProject.xcconfig
-//
-// These are Release Configuration project settings for the gtest framework
-// and examples. It is set in the "Based On:" dropdown in the "Project" info
-// dialog.
-// This file is based on the Xcode Configuration files in:
-// http://code.google.com/p/google-toolbox-for-mac/
-//
-
-#include "General.xcconfig"
-
-// subconfig/Release.xcconfig
-
-// Optimize for space and size (Apple recommendation)
-GCC_OPTIMIZATION_LEVEL = s
-
-// Deploment postprocessing is what triggers Xcode to strip
-DEPLOYMENT_POSTPROCESSING = YES
-
-// No symbols
-GCC_GENERATE_DEBUGGING_SYMBOLS = NO
-
-// Dead code strip does not affect ObjC code but can help for C
-DEAD_CODE_STRIPPING = YES
-
-// NDEBUG is used by things like assert.h, so define it for general compat.
-// ASSERT going away in release tends to create unused vars.
-OTHER_CFLAGS = $(OTHER_CFLAGS) -DNDEBUG=1 -Wno-unused-variable
-
-// When we strip we want to strip all symbols in release, but save externals.
-STRIP_STYLE = all
diff --git a/src/testing/gtest/xcode/Config/StaticLibraryTarget.xcconfig b/src/testing/gtest/xcode/Config/StaticLibraryTarget.xcconfig
deleted file mode 100644
index 3922fa51..00000000
--- a/src/testing/gtest/xcode/Config/StaticLibraryTarget.xcconfig
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// StaticLibraryTarget.xcconfig
-//
-// These are static library target settings for libgtest.a. It
-// is set in the "Based On:" dropdown in the "Target" info dialog.
-// This file is based on the Xcode Configuration files in:
-// http://code.google.com/p/google-toolbox-for-mac/
-//
-
-// Static libs can be included in bundles so make them position independent
-GCC_DYNAMIC_NO_PIC = NO
-
-// Static libs should not have their internal globals or external symbols
-// stripped.
-STRIP_STYLE = debugging
-
-// Let the user install by specifying the $DSTROOT with xcodebuild
-SKIP_INSTALL = NO
diff --git a/src/testing/gtest/xcode/Config/TestTarget.xcconfig b/src/testing/gtest/xcode/Config/TestTarget.xcconfig
deleted file mode 100644
index e6652ba8..00000000
--- a/src/testing/gtest/xcode/Config/TestTarget.xcconfig
+++ /dev/null
@@ -1,8 +0,0 @@
-//
-// TestTarget.xcconfig
-//
-// These are Test target settings for the gtest framework and examples. It
-// is set in the "Based On:" dropdown in the "Target" info dialog.
-
-PRODUCT_NAME = $(TARGET_NAME)
-HEADER_SEARCH_PATHS = ../include
diff --git a/src/testing/gtest/xcode/Resources/Info.plist b/src/testing/gtest/xcode/Resources/Info.plist
deleted file mode 100644
index 9dd28ea1..00000000
--- a/src/testing/gtest/xcode/Resources/Info.plist
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>CFBundleDevelopmentRegion</key>
- <string>English</string>
- <key>CFBundleExecutable</key>
- <string>${EXECUTABLE_NAME}</string>
- <key>CFBundleIconFile</key>
- <string></string>
- <key>CFBundleIdentifier</key>
- <string>com.google.${PRODUCT_NAME}</string>
- <key>CFBundleInfoDictionaryVersion</key>
- <string>6.0</string>
- <key>CFBundlePackageType</key>
- <string>FMWK</string>
- <key>CFBundleSignature</key>
- <string>????</string>
- <key>CFBundleVersion</key>
- <string>GTEST_VERSIONINFO_LONG</string>
- <key>CFBundleShortVersionString</key>
- <string>GTEST_VERSIONINFO_SHORT</string>
- <key>CFBundleGetInfoString</key>
- <string>${PRODUCT_NAME} GTEST_VERSIONINFO_LONG, ${GTEST_VERSIONINFO_ABOUT}</string>
- <key>NSHumanReadableCopyright</key>
- <string>${GTEST_VERSIONINFO_ABOUT}</string>
- <key>CSResourcesFileMapped</key>
- <true/>
-</dict>
-</plist>
diff --git a/src/testing/gtest/xcode/Samples/FrameworkSample/Info.plist b/src/testing/gtest/xcode/Samples/FrameworkSample/Info.plist
deleted file mode 100644
index f3852ede..00000000
--- a/src/testing/gtest/xcode/Samples/FrameworkSample/Info.plist
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>CFBundleDevelopmentRegion</key>
- <string>English</string>
- <key>CFBundleExecutable</key>
- <string>${EXECUTABLE_NAME}</string>
- <key>CFBundleIconFile</key>
- <string></string>
- <key>CFBundleIdentifier</key>
- <string>com.google.gtest.${PRODUCT_NAME:identifier}</string>
- <key>CFBundleInfoDictionaryVersion</key>
- <string>6.0</string>
- <key>CFBundleName</key>
- <string>${PRODUCT_NAME}</string>
- <key>CFBundlePackageType</key>
- <string>FMWK</string>
- <key>CFBundleShortVersionString</key>
- <string>1.0</string>
- <key>CFBundleSignature</key>
- <string>????</string>
- <key>CFBundleVersion</key>
- <string>1.0</string>
- <key>CSResourcesFileMapped</key>
- <true/>
-</dict>
-</plist>
diff --git a/src/testing/gtest/xcode/Samples/FrameworkSample/WidgetFramework.xcodeproj/project.pbxproj b/src/testing/gtest/xcode/Samples/FrameworkSample/WidgetFramework.xcodeproj/project.pbxproj
deleted file mode 100644
index 497617eb..00000000
--- a/src/testing/gtest/xcode/Samples/FrameworkSample/WidgetFramework.xcodeproj/project.pbxproj
+++ /dev/null
@@ -1,457 +0,0 @@
-// !$*UTF8*$!
-{
- archiveVersion = 1;
- classes = {
- };
- objectVersion = 42;
- objects = {
-
-/* Begin PBXAggregateTarget section */
- 4024D162113D7D2400C7059E /* Test */ = {
- isa = PBXAggregateTarget;
- buildConfigurationList = 4024D169113D7D4600C7059E /* Build configuration list for PBXAggregateTarget "Test" */;
- buildPhases = (
- 4024D161113D7D2400C7059E /* ShellScript */,
- );
- dependencies = (
- 4024D166113D7D3100C7059E /* PBXTargetDependency */,
- );
- name = Test;
- productName = TestAndBuild;
- };
- 4024D1E9113D83FF00C7059E /* TestAndBuild */ = {
- isa = PBXAggregateTarget;
- buildConfigurationList = 4024D1F0113D842B00C7059E /* Build configuration list for PBXAggregateTarget "TestAndBuild" */;
- buildPhases = (
- );
- dependencies = (
- 4024D1ED113D840900C7059E /* PBXTargetDependency */,
- 4024D1EF113D840D00C7059E /* PBXTargetDependency */,
- );
- name = TestAndBuild;
- productName = TestAndBuild;
- };
-/* End PBXAggregateTarget section */
-
-/* Begin PBXBuildFile section */
- 3B7EB1250E5AEE3500C7F239 /* widget.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3B7EB1230E5AEE3500C7F239 /* widget.cc */; };
- 3B7EB1260E5AEE3500C7F239 /* widget.h in Headers */ = {isa = PBXBuildFile; fileRef = 3B7EB1240E5AEE3500C7F239 /* widget.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 3B7EB1280E5AEE4600C7F239 /* widget_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3B7EB1270E5AEE4600C7F239 /* widget_test.cc */; };
- 3B7EB1480E5AF3B400C7F239 /* Widget.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8D07F2C80486CC7A007CD1D0 /* Widget.framework */; };
- 4024D188113D7D7800C7059E /* libgtest.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4024D185113D7D5500C7059E /* libgtest.a */; };
- 4024D189113D7D7A00C7059E /* libgtest_main.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4024D183113D7D5500C7059E /* libgtest_main.a */; };
-/* End PBXBuildFile section */
-
-/* Begin PBXContainerItemProxy section */
- 3B07BDF00E3F3FAE00647869 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = 8D07F2BC0486CC7A007CD1D0;
- remoteInfo = gTestExample;
- };
- 4024D165113D7D3100C7059E /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = 3B07BDE90E3F3F9E00647869;
- remoteInfo = WidgetFrameworkTest;
- };
- 4024D1EC113D840900C7059E /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = 8D07F2BC0486CC7A007CD1D0;
- remoteInfo = WidgetFramework;
- };
- 4024D1EE113D840D00C7059E /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = 4024D162113D7D2400C7059E;
- remoteInfo = Test;
- };
-/* End PBXContainerItemProxy section */
-
-/* Begin PBXFileReference section */
- 3B07BDEA0E3F3F9E00647869 /* WidgetFrameworkTest */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = WidgetFrameworkTest; sourceTree = BUILT_PRODUCTS_DIR; };
- 3B7EB1230E5AEE3500C7F239 /* widget.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = widget.cc; sourceTree = "<group>"; };
- 3B7EB1240E5AEE3500C7F239 /* widget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = widget.h; sourceTree = "<group>"; };
- 3B7EB1270E5AEE4600C7F239 /* widget_test.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = widget_test.cc; sourceTree = "<group>"; };
- 4024D183113D7D5500C7059E /* libgtest_main.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libgtest_main.a; path = /usr/local/lib/libgtest_main.a; sourceTree = "<absolute>"; };
- 4024D185113D7D5500C7059E /* libgtest.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libgtest.a; path = /usr/local/lib/libgtest.a; sourceTree = "<absolute>"; };
- 4024D1E2113D838200C7059E /* runtests.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = runtests.sh; sourceTree = "<group>"; };
- 8D07F2C70486CC7A007CD1D0 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
- 8D07F2C80486CC7A007CD1D0 /* Widget.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Widget.framework; sourceTree = BUILT_PRODUCTS_DIR; };
-/* End PBXFileReference section */
-
-/* Begin PBXFrameworksBuildPhase section */
- 3B07BDE80E3F3F9E00647869 /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 4024D189113D7D7A00C7059E /* libgtest_main.a in Frameworks */,
- 4024D188113D7D7800C7059E /* libgtest.a in Frameworks */,
- 3B7EB1480E5AF3B400C7F239 /* Widget.framework in Frameworks */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- 8D07F2C30486CC7A007CD1D0 /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXFrameworksBuildPhase section */
-
-/* Begin PBXGroup section */
- 034768DDFF38A45A11DB9C8B /* Products */ = {
- isa = PBXGroup;
- children = (
- 8D07F2C80486CC7A007CD1D0 /* Widget.framework */,
- 3B07BDEA0E3F3F9E00647869 /* WidgetFrameworkTest */,
- );
- name = Products;
- sourceTree = "<group>";
- };
- 0867D691FE84028FC02AAC07 /* gTestExample */ = {
- isa = PBXGroup;
- children = (
- 4024D1E1113D836C00C7059E /* Scripts */,
- 08FB77ACFE841707C02AAC07 /* Source */,
- 089C1665FE841158C02AAC07 /* Resources */,
- 3B07BE350E4094E400647869 /* Test */,
- 0867D69AFE84028FC02AAC07 /* External Frameworks and Libraries */,
- 034768DDFF38A45A11DB9C8B /* Products */,
- );
- name = gTestExample;
- sourceTree = "<group>";
- };
- 0867D69AFE84028FC02AAC07 /* External Frameworks and Libraries */ = {
- isa = PBXGroup;
- children = (
- 4024D183113D7D5500C7059E /* libgtest_main.a */,
- 4024D185113D7D5500C7059E /* libgtest.a */,
- );
- name = "External Frameworks and Libraries";
- sourceTree = "<group>";
- };
- 089C1665FE841158C02AAC07 /* Resources */ = {
- isa = PBXGroup;
- children = (
- 8D07F2C70486CC7A007CD1D0 /* Info.plist */,
- );
- name = Resources;
- sourceTree = "<group>";
- };
- 08FB77ACFE841707C02AAC07 /* Source */ = {
- isa = PBXGroup;
- children = (
- 3B7EB1230E5AEE3500C7F239 /* widget.cc */,
- 3B7EB1240E5AEE3500C7F239 /* widget.h */,
- );
- name = Source;
- sourceTree = "<group>";
- };
- 3B07BE350E4094E400647869 /* Test */ = {
- isa = PBXGroup;
- children = (
- 3B7EB1270E5AEE4600C7F239 /* widget_test.cc */,
- );
- name = Test;
- sourceTree = "<group>";
- };
- 4024D1E1113D836C00C7059E /* Scripts */ = {
- isa = PBXGroup;
- children = (
- 4024D1E2113D838200C7059E /* runtests.sh */,
- );
- name = Scripts;
- sourceTree = "<group>";
- };
-/* End PBXGroup section */
-
-/* Begin PBXHeadersBuildPhase section */
- 8D07F2BD0486CC7A007CD1D0 /* Headers */ = {
- isa = PBXHeadersBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 3B7EB1260E5AEE3500C7F239 /* widget.h in Headers */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXHeadersBuildPhase section */
-
-/* Begin PBXNativeTarget section */
- 3B07BDE90E3F3F9E00647869 /* WidgetFrameworkTest */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = 3B07BDF40E3F3FB600647869 /* Build configuration list for PBXNativeTarget "WidgetFrameworkTest" */;
- buildPhases = (
- 3B07BDE70E3F3F9E00647869 /* Sources */,
- 3B07BDE80E3F3F9E00647869 /* Frameworks */,
- );
- buildRules = (
- );
- dependencies = (
- 3B07BDF10E3F3FAE00647869 /* PBXTargetDependency */,
- );
- name = WidgetFrameworkTest;
- productName = gTestExampleTest;
- productReference = 3B07BDEA0E3F3F9E00647869 /* WidgetFrameworkTest */;
- productType = "com.apple.product-type.tool";
- };
- 8D07F2BC0486CC7A007CD1D0 /* WidgetFramework */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = 4FADC24208B4156D00ABE55E /* Build configuration list for PBXNativeTarget "WidgetFramework" */;
- buildPhases = (
- 8D07F2C10486CC7A007CD1D0 /* Sources */,
- 8D07F2C30486CC7A007CD1D0 /* Frameworks */,
- 8D07F2BD0486CC7A007CD1D0 /* Headers */,
- 8D07F2BF0486CC7A007CD1D0 /* Resources */,
- 8D07F2C50486CC7A007CD1D0 /* Rez */,
- );
- buildRules = (
- );
- dependencies = (
- );
- name = WidgetFramework;
- productInstallPath = "$(HOME)/Library/Frameworks";
- productName = gTestExample;
- productReference = 8D07F2C80486CC7A007CD1D0 /* Widget.framework */;
- productType = "com.apple.product-type.framework";
- };
-/* End PBXNativeTarget section */
-
-/* Begin PBXProject section */
- 0867D690FE84028FC02AAC07 /* Project object */ = {
- isa = PBXProject;
- buildConfigurationList = 4FADC24608B4156D00ABE55E /* Build configuration list for PBXProject "WidgetFramework" */;
- compatibilityVersion = "Xcode 2.4";
- hasScannedForEncodings = 1;
- mainGroup = 0867D691FE84028FC02AAC07 /* gTestExample */;
- productRefGroup = 034768DDFF38A45A11DB9C8B /* Products */;
- projectDirPath = "";
- projectRoot = "";
- targets = (
- 8D07F2BC0486CC7A007CD1D0 /* WidgetFramework */,
- 3B07BDE90E3F3F9E00647869 /* WidgetFrameworkTest */,
- 4024D162113D7D2400C7059E /* Test */,
- 4024D1E9113D83FF00C7059E /* TestAndBuild */,
- );
- };
-/* End PBXProject section */
-
-/* Begin PBXResourcesBuildPhase section */
- 8D07F2BF0486CC7A007CD1D0 /* Resources */ = {
- isa = PBXResourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXResourcesBuildPhase section */
-
-/* Begin PBXRezBuildPhase section */
- 8D07F2C50486CC7A007CD1D0 /* Rez */ = {
- isa = PBXRezBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXRezBuildPhase section */
-
-/* Begin PBXShellScriptBuildPhase section */
- 4024D161113D7D2400C7059E /* ShellScript */ = {
- isa = PBXShellScriptBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- inputPaths = (
- );
- outputPaths = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- shellPath = /bin/sh;
- shellScript = "/bin/bash $SRCROOT/runtests.sh $BUILT_PRODUCTS_DIR/WidgetFrameworkTest\n";
- };
-/* End PBXShellScriptBuildPhase section */
-
-/* Begin PBXSourcesBuildPhase section */
- 3B07BDE70E3F3F9E00647869 /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 3B7EB1280E5AEE4600C7F239 /* widget_test.cc in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- 8D07F2C10486CC7A007CD1D0 /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 3B7EB1250E5AEE3500C7F239 /* widget.cc in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXSourcesBuildPhase section */
-
-/* Begin PBXTargetDependency section */
- 3B07BDF10E3F3FAE00647869 /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = 8D07F2BC0486CC7A007CD1D0 /* WidgetFramework */;
- targetProxy = 3B07BDF00E3F3FAE00647869 /* PBXContainerItemProxy */;
- };
- 4024D166113D7D3100C7059E /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = 3B07BDE90E3F3F9E00647869 /* WidgetFrameworkTest */;
- targetProxy = 4024D165113D7D3100C7059E /* PBXContainerItemProxy */;
- };
- 4024D1ED113D840900C7059E /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = 8D07F2BC0486CC7A007CD1D0 /* WidgetFramework */;
- targetProxy = 4024D1EC113D840900C7059E /* PBXContainerItemProxy */;
- };
- 4024D1EF113D840D00C7059E /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = 4024D162113D7D2400C7059E /* Test */;
- targetProxy = 4024D1EE113D840D00C7059E /* PBXContainerItemProxy */;
- };
-/* End PBXTargetDependency section */
-
-/* Begin XCBuildConfiguration section */
- 3B07BDEC0E3F3F9F00647869 /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- PRODUCT_NAME = WidgetFrameworkTest;
- };
- name = Debug;
- };
- 3B07BDED0E3F3F9F00647869 /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- PRODUCT_NAME = WidgetFrameworkTest;
- };
- name = Release;
- };
- 4024D163113D7D2400C7059E /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- PRODUCT_NAME = TestAndBuild;
- };
- name = Debug;
- };
- 4024D164113D7D2400C7059E /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- PRODUCT_NAME = TestAndBuild;
- };
- name = Release;
- };
- 4024D1EA113D83FF00C7059E /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- PRODUCT_NAME = TestAndBuild;
- };
- name = Debug;
- };
- 4024D1EB113D83FF00C7059E /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- PRODUCT_NAME = TestAndBuild;
- };
- name = Release;
- };
- 4FADC24308B4156D00ABE55E /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- DYLIB_COMPATIBILITY_VERSION = 1;
- DYLIB_CURRENT_VERSION = 1;
- FRAMEWORK_VERSION = A;
- INFOPLIST_FILE = Info.plist;
- INSTALL_PATH = "@loader_path/../Frameworks";
- PRODUCT_NAME = Widget;
- };
- name = Debug;
- };
- 4FADC24408B4156D00ABE55E /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- DYLIB_COMPATIBILITY_VERSION = 1;
- DYLIB_CURRENT_VERSION = 1;
- FRAMEWORK_VERSION = A;
- INFOPLIST_FILE = Info.plist;
- INSTALL_PATH = "@loader_path/../Frameworks";
- PRODUCT_NAME = Widget;
- };
- name = Release;
- };
- 4FADC24708B4156D00ABE55E /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- GCC_VERSION = 4.0;
- SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
- };
- name = Debug;
- };
- 4FADC24808B4156D00ABE55E /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- GCC_VERSION = 4.0;
- SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
- };
- name = Release;
- };
-/* End XCBuildConfiguration section */
-
-/* Begin XCConfigurationList section */
- 3B07BDF40E3F3FB600647869 /* Build configuration list for PBXNativeTarget "WidgetFrameworkTest" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 3B07BDEC0E3F3F9F00647869 /* Debug */,
- 3B07BDED0E3F3F9F00647869 /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- 4024D169113D7D4600C7059E /* Build configuration list for PBXAggregateTarget "Test" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 4024D163113D7D2400C7059E /* Debug */,
- 4024D164113D7D2400C7059E /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- 4024D1F0113D842B00C7059E /* Build configuration list for PBXAggregateTarget "TestAndBuild" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 4024D1EA113D83FF00C7059E /* Debug */,
- 4024D1EB113D83FF00C7059E /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- 4FADC24208B4156D00ABE55E /* Build configuration list for PBXNativeTarget "WidgetFramework" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 4FADC24308B4156D00ABE55E /* Debug */,
- 4FADC24408B4156D00ABE55E /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- 4FADC24608B4156D00ABE55E /* Build configuration list for PBXProject "WidgetFramework" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 4FADC24708B4156D00ABE55E /* Debug */,
- 4FADC24808B4156D00ABE55E /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
-/* End XCConfigurationList section */
- };
- rootObject = 0867D690FE84028FC02AAC07 /* Project object */;
-}
diff --git a/src/testing/gtest/xcode/Samples/FrameworkSample/widget.cc b/src/testing/gtest/xcode/Samples/FrameworkSample/widget.cc
deleted file mode 100644
index bfc4e7fc..00000000
--- a/src/testing/gtest/xcode/Samples/FrameworkSample/widget.cc
+++ /dev/null
@@ -1,63 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: preston.a.jackson@gmail.com (Preston Jackson)
-//
-// Google Test - FrameworkSample
-// widget.cc
-//
-
-// Widget is a very simple class used for demonstrating the use of gtest
-
-#include "widget.h"
-
-Widget::Widget(int number, const std::string& name)
- : number_(number),
- name_(name) {}
-
-Widget::~Widget() {}
-
-float Widget::GetFloatValue() const {
- return number_;
-}
-
-int Widget::GetIntValue() const {
- return static_cast<int>(number_);
-}
-
-std::string Widget::GetStringValue() const {
- return name_;
-}
-
-void Widget::GetCharPtrValue(char* buffer, size_t max_size) const {
- // Copy the char* representation of name_ into buffer, up to max_size.
- strncpy(buffer, name_.c_str(), max_size-1);
- buffer[max_size-1] = '\0';
- return;
-}
diff --git a/src/testing/gtest/xcode/Scripts/runtests.sh b/src/testing/gtest/xcode/Scripts/runtests.sh
deleted file mode 100644
index 3fc229f1..00000000
--- a/src/testing/gtest/xcode/Scripts/runtests.sh
+++ /dev/null
@@ -1,65 +0,0 @@
-#!/bin/bash
-#
-# Copyright 2008, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-# Executes the samples and tests for the Google Test Framework.
-
-# Help the dynamic linker find the path to the libraries.
-export DYLD_FRAMEWORK_PATH=$BUILT_PRODUCTS_DIR
-export DYLD_LIBRARY_PATH=$BUILT_PRODUCTS_DIR
-
-# Create some executables.
-test_executables=("$BUILT_PRODUCTS_DIR/gtest_unittest-framework"
- "$BUILT_PRODUCTS_DIR/gtest_unittest"
- "$BUILT_PRODUCTS_DIR/sample1_unittest-framework"
- "$BUILT_PRODUCTS_DIR/sample1_unittest-static")
-
-# Now execute each one in turn keeping track of how many succeeded and failed.
-succeeded=0
-failed=0
-failed_list=()
-for test in ${test_executables[*]}; do
- "$test"
- result=$?
- if [ $result -eq 0 ]; then
- succeeded=$(( $succeeded + 1 ))
- else
- failed=$(( failed + 1 ))
- failed_list="$failed_list $test"
- fi
-done
-
-# Report the successes and failures to the console.
-echo "Tests complete with $succeeded successes and $failed failures."
-if [ $failed -ne 0 ]; then
- echo "The following tests failed:"
- echo $failed_list
-fi
-exit $failed
diff --git a/src/testing/gtest/xcode/Scripts/versiongenerate.py b/src/testing/gtest/xcode/Scripts/versiongenerate.py
deleted file mode 100644
index 81de8c96..00000000
--- a/src/testing/gtest/xcode/Scripts/versiongenerate.py
+++ /dev/null
@@ -1,100 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2008, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-"""A script to prepare version informtion for use the gtest Info.plist file.
-
- This script extracts the version information from the configure.ac file and
- uses it to generate a header file containing the same information. The
- #defines in this header file will be included in during the generation of
- the Info.plist of the framework, giving the correct value to the version
- shown in the Finder.
-
- This script makes the following assumptions (these are faults of the script,
- not problems with the Autoconf):
- 1. The AC_INIT macro will be contained within the first 1024 characters
- of configure.ac
- 2. The version string will be 3 integers separated by periods and will be
- surrounded by squre brackets, "[" and "]" (e.g. [1.0.1]). The first
- segment represents the major version, the second represents the minor
- version and the third represents the fix version.
- 3. No ")" character exists between the opening "(" and closing ")" of
- AC_INIT, including in comments and character strings.
-"""
-
-import sys
-import re
-
-# Read the command line argument (the output directory for Version.h)
-if (len(sys.argv) < 3):
- print "Usage: versiongenerate.py input_dir output_dir"
- sys.exit(1)
-else:
- input_dir = sys.argv[1]
- output_dir = sys.argv[2]
-
-# Read the first 1024 characters of the configure.ac file
-config_file = open("%s/configure.ac" % input_dir, 'r')
-buffer_size = 1024
-opening_string = config_file.read(buffer_size)
-config_file.close()
-
-# Extract the version string from the AC_INIT macro
-# The following init_expression means:
-# Extract three integers separated by periods and surrounded by squre
-# brackets(e.g. "[1.0.1]") between "AC_INIT(" and ")". Do not be greedy
-# (*? is the non-greedy flag) since that would pull in everything between
-# the first "(" and the last ")" in the file.
-version_expression = re.compile(r"AC_INIT\(.*?\[(\d+)\.(\d+)\.(\d+)\].*?\)",
- re.DOTALL)
-version_values = version_expression.search(opening_string)
-major_version = version_values.group(1)
-minor_version = version_values.group(2)
-fix_version = version_values.group(3)
-
-# Write the version information to a header file to be included in the
-# Info.plist file.
-file_data = """//
-// DO NOT MODIFY THIS FILE (but you can delete it)
-//
-// This file is autogenerated by the versiongenerate.py script. This script
-// is executed in a "Run Script" build phase when creating gtest.framework. This
-// header file is not used during compilation of C-source. Rather, it simply
-// defines some version strings for substitution in the Info.plist. Because of
-// this, we are not not restricted to C-syntax nor are we using include guards.
-//
-
-#define GTEST_VERSIONINFO_SHORT %s.%s
-#define GTEST_VERSIONINFO_LONG %s.%s.%s
-
-""" % (major_version, minor_version, major_version, minor_version, fix_version)
-version_file = open("%s/Version.h" % output_dir, 'w')
-version_file.write(file_data)
-version_file.close()
diff --git a/src/testing/gtest/xcode/gtest.xcodeproj/project.pbxproj b/src/testing/gtest/xcode/gtest.xcodeproj/project.pbxproj
deleted file mode 100644
index da6455b5..00000000
--- a/src/testing/gtest/xcode/gtest.xcodeproj/project.pbxproj
+++ /dev/null
@@ -1,1084 +0,0 @@
-// !$*UTF8*$!
-{
- archiveVersion = 1;
- classes = {
- };
- objectVersion = 42;
- objects = {
-
-/* Begin PBXAggregateTarget section */
- 3B238F5F0E828B5400846E11 /* Check */ = {
- isa = PBXAggregateTarget;
- buildConfigurationList = 3B238FA30E828BB600846E11 /* Build configuration list for PBXAggregateTarget "Check" */;
- buildPhases = (
- 3B238F5E0E828B5400846E11 /* ShellScript */,
- );
- dependencies = (
- 40899F9D0FFA740F000B29AE /* PBXTargetDependency */,
- 40C849F7101A43440083642A /* PBXTargetDependency */,
- 4089A0980FFAD34A000B29AE /* PBXTargetDependency */,
- 40C849F9101A43490083642A /* PBXTargetDependency */,
- );
- name = Check;
- productName = Check;
- };
- 40C44ADC0E3798F4008FCC51 /* Version Info */ = {
- isa = PBXAggregateTarget;
- buildConfigurationList = 40C44AE40E379905008FCC51 /* Build configuration list for PBXAggregateTarget "Version Info" */;
- buildPhases = (
- 40C44ADB0E3798F4008FCC51 /* Generate Version.h */,
- );
- comments = "The generation of Version.h must be performed in its own target. Since the Info.plist is preprocessed before any of the other build phases in gtest, the Version.h file would not be ready if included as a build phase of that target.";
- dependencies = (
- );
- name = "Version Info";
- productName = Version.h;
- };
-/* End PBXAggregateTarget section */
-
-/* Begin PBXBuildFile section */
- 224A12A30E9EADCC00BD17FD /* gtest-test-part.h in Headers */ = {isa = PBXBuildFile; fileRef = 224A12A20E9EADCC00BD17FD /* gtest-test-part.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 3BF6F2A00E79B5AD000F2EEE /* gtest-type-util.h in Copy Headers Internal */ = {isa = PBXBuildFile; fileRef = 3BF6F29F0E79B5AD000F2EEE /* gtest-type-util.h */; };
- 3BF6F2A50E79B616000F2EEE /* gtest-typed-test.h in Headers */ = {isa = PBXBuildFile; fileRef = 3BF6F2A40E79B616000F2EEE /* gtest-typed-test.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 404884380E2F799B00CF7658 /* gtest-death-test.h in Headers */ = {isa = PBXBuildFile; fileRef = 404883DB0E2F799B00CF7658 /* gtest-death-test.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 404884390E2F799B00CF7658 /* gtest-message.h in Headers */ = {isa = PBXBuildFile; fileRef = 404883DC0E2F799B00CF7658 /* gtest-message.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 4048843A0E2F799B00CF7658 /* gtest-spi.h in Headers */ = {isa = PBXBuildFile; fileRef = 404883DD0E2F799B00CF7658 /* gtest-spi.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 4048843B0E2F799B00CF7658 /* gtest.h in Headers */ = {isa = PBXBuildFile; fileRef = 404883DE0E2F799B00CF7658 /* gtest.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 4048843C0E2F799B00CF7658 /* gtest_pred_impl.h in Headers */ = {isa = PBXBuildFile; fileRef = 404883DF0E2F799B00CF7658 /* gtest_pred_impl.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 4048843D0E2F799B00CF7658 /* gtest_prod.h in Headers */ = {isa = PBXBuildFile; fileRef = 404883E00E2F799B00CF7658 /* gtest_prod.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 404884500E2F799B00CF7658 /* README in Resources */ = {isa = PBXBuildFile; fileRef = 404883F60E2F799B00CF7658 /* README */; };
- 404884A00E2F7BE600CF7658 /* gtest-death-test-internal.h in Copy Headers Internal */ = {isa = PBXBuildFile; fileRef = 404883E20E2F799B00CF7658 /* gtest-death-test-internal.h */; };
- 404884A10E2F7BE600CF7658 /* gtest-filepath.h in Copy Headers Internal */ = {isa = PBXBuildFile; fileRef = 404883E30E2F799B00CF7658 /* gtest-filepath.h */; };
- 404884A20E2F7BE600CF7658 /* gtest-internal.h in Copy Headers Internal */ = {isa = PBXBuildFile; fileRef = 404883E40E2F799B00CF7658 /* gtest-internal.h */; };
- 404884A30E2F7BE600CF7658 /* gtest-port.h in Copy Headers Internal */ = {isa = PBXBuildFile; fileRef = 404883E50E2F799B00CF7658 /* gtest-port.h */; };
- 404884A40E2F7BE600CF7658 /* gtest-string.h in Copy Headers Internal */ = {isa = PBXBuildFile; fileRef = 404883E60E2F799B00CF7658 /* gtest-string.h */; };
- 404884AC0E2F7CD900CF7658 /* CHANGES in Resources */ = {isa = PBXBuildFile; fileRef = 404884A90E2F7CD900CF7658 /* CHANGES */; };
- 404884AD0E2F7CD900CF7658 /* CONTRIBUTORS in Resources */ = {isa = PBXBuildFile; fileRef = 404884AA0E2F7CD900CF7658 /* CONTRIBUTORS */; };
- 404884AE0E2F7CD900CF7658 /* LICENSE in Resources */ = {isa = PBXBuildFile; fileRef = 404884AB0E2F7CD900CF7658 /* LICENSE */; };
- 40899F3A0FFA70D4000B29AE /* gtest-all.cc in Sources */ = {isa = PBXBuildFile; fileRef = 224A12A10E9EADA700BD17FD /* gtest-all.cc */; };
- 40899F500FFA7281000B29AE /* gtest-tuple.h in Copy Headers Internal */ = {isa = PBXBuildFile; fileRef = 40899F4D0FFA7271000B29AE /* gtest-tuple.h */; };
- 40899F530FFA72A0000B29AE /* gtest_unittest.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3B238C120E7FE13C00846E11 /* gtest_unittest.cc */; };
- 4089A0440FFAD1BE000B29AE /* sample1.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4089A02C0FFACF7F000B29AE /* sample1.cc */; };
- 4089A0460FFAD1BE000B29AE /* sample1_unittest.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4089A02E0FFACF7F000B29AE /* sample1_unittest.cc */; };
- 40C848FF101A21150083642A /* gtest-all.cc in Sources */ = {isa = PBXBuildFile; fileRef = 224A12A10E9EADA700BD17FD /* gtest-all.cc */; };
- 40C84915101A21DF0083642A /* gtest_main.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4048840D0E2F799B00CF7658 /* gtest_main.cc */; };
- 40C84916101A235B0083642A /* libgtest_main.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 40C8490B101A217E0083642A /* libgtest_main.a */; };
- 40C84921101A23AD0083642A /* libgtest_main.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 40C8490B101A217E0083642A /* libgtest_main.a */; };
- 40C84978101A36540083642A /* libgtest_main.a in Resources */ = {isa = PBXBuildFile; fileRef = 40C8490B101A217E0083642A /* libgtest_main.a */; };
- 40C84980101A36850083642A /* gtest_unittest.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3B238C120E7FE13C00846E11 /* gtest_unittest.cc */; };
- 40C84982101A36850083642A /* libgtest.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 40C848FA101A209C0083642A /* libgtest.a */; };
- 40C84983101A36850083642A /* libgtest_main.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 40C8490B101A217E0083642A /* libgtest_main.a */; };
- 40C8498F101A36A60083642A /* sample1.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4089A02C0FFACF7F000B29AE /* sample1.cc */; };
- 40C84990101A36A60083642A /* sample1_unittest.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4089A02E0FFACF7F000B29AE /* sample1_unittest.cc */; };
- 40C84992101A36A60083642A /* libgtest.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 40C848FA101A209C0083642A /* libgtest.a */; };
- 40C84993101A36A60083642A /* libgtest_main.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 40C8490B101A217E0083642A /* libgtest_main.a */; };
- 40C849A2101A37050083642A /* gtest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4539C8FF0EC27F6400A70F4C /* gtest.framework */; };
- 40C849A4101A37150083642A /* gtest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4539C8FF0EC27F6400A70F4C /* gtest.framework */; };
- 4539C9340EC280AE00A70F4C /* gtest-param-test.h in Headers */ = {isa = PBXBuildFile; fileRef = 4539C9330EC280AE00A70F4C /* gtest-param-test.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 4539C9380EC280E200A70F4C /* gtest-linked_ptr.h in Copy Headers Internal */ = {isa = PBXBuildFile; fileRef = 4539C9350EC280E200A70F4C /* gtest-linked_ptr.h */; };
- 4539C9390EC280E200A70F4C /* gtest-param-util-generated.h in Copy Headers Internal */ = {isa = PBXBuildFile; fileRef = 4539C9360EC280E200A70F4C /* gtest-param-util-generated.h */; };
- 4539C93A0EC280E200A70F4C /* gtest-param-util.h in Copy Headers Internal */ = {isa = PBXBuildFile; fileRef = 4539C9370EC280E200A70F4C /* gtest-param-util.h */; };
- 4567C8181264FF71007740BE /* gtest-printers.h in Headers */ = {isa = PBXBuildFile; fileRef = 4567C8171264FF71007740BE /* gtest-printers.h */; settings = {ATTRIBUTES = (Public, ); }; };
-/* End PBXBuildFile section */
-
-/* Begin PBXContainerItemProxy section */
- 40899F9C0FFA740F000B29AE /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = 40899F420FFA7184000B29AE;
- remoteInfo = gtest_unittest;
- };
- 4089A0970FFAD34A000B29AE /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = 4089A0120FFACEFC000B29AE;
- remoteInfo = sample1_unittest;
- };
- 408BEC0F1046CFE900DEF522 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = 40C848F9101A209C0083642A;
- remoteInfo = "gtest-static";
- };
- 40C44AE50E379922008FCC51 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = 40C44ADC0E3798F4008FCC51;
- remoteInfo = Version.h;
- };
- 40C8497C101A36850083642A /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = 40C848F9101A209C0083642A;
- remoteInfo = "gtest-static";
- };
- 40C8497E101A36850083642A /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = 40C8490A101A217E0083642A;
- remoteInfo = "gtest_main-static";
- };
- 40C8498B101A36A60083642A /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = 40C848F9101A209C0083642A;
- remoteInfo = "gtest-static";
- };
- 40C8498D101A36A60083642A /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = 40C8490A101A217E0083642A;
- remoteInfo = "gtest_main-static";
- };
- 40C8499B101A36DC0083642A /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = 40C8490A101A217E0083642A;
- remoteInfo = "gtest_main-static";
- };
- 40C8499D101A36E50083642A /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = 8D07F2BC0486CC7A007CD1D0;
- remoteInfo = "gtest-framework";
- };
- 40C8499F101A36F10083642A /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = 8D07F2BC0486CC7A007CD1D0;
- remoteInfo = "gtest-framework";
- };
- 40C849F6101A43440083642A /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = 40C8497A101A36850083642A;
- remoteInfo = "gtest_unittest-static";
- };
- 40C849F8101A43490083642A /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = 40C84989101A36A60083642A;
- remoteInfo = "sample1_unittest-static";
- };
-/* End PBXContainerItemProxy section */
-
-/* Begin PBXCopyFilesBuildPhase section */
- 404884A50E2F7C0400CF7658 /* Copy Headers Internal */ = {
- isa = PBXCopyFilesBuildPhase;
- buildActionMask = 2147483647;
- dstPath = Headers/internal;
- dstSubfolderSpec = 6;
- files = (
- 404884A00E2F7BE600CF7658 /* gtest-death-test-internal.h in Copy Headers Internal */,
- 404884A10E2F7BE600CF7658 /* gtest-filepath.h in Copy Headers Internal */,
- 404884A20E2F7BE600CF7658 /* gtest-internal.h in Copy Headers Internal */,
- 4539C9380EC280E200A70F4C /* gtest-linked_ptr.h in Copy Headers Internal */,
- 4539C9390EC280E200A70F4C /* gtest-param-util-generated.h in Copy Headers Internal */,
- 4539C93A0EC280E200A70F4C /* gtest-param-util.h in Copy Headers Internal */,
- 404884A30E2F7BE600CF7658 /* gtest-port.h in Copy Headers Internal */,
- 404884A40E2F7BE600CF7658 /* gtest-string.h in Copy Headers Internal */,
- 40899F500FFA7281000B29AE /* gtest-tuple.h in Copy Headers Internal */,
- 3BF6F2A00E79B5AD000F2EEE /* gtest-type-util.h in Copy Headers Internal */,
- );
- name = "Copy Headers Internal";
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXCopyFilesBuildPhase section */
-
-/* Begin PBXFileReference section */
- 224A12A10E9EADA700BD17FD /* gtest-all.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = "gtest-all.cc"; sourceTree = "<group>"; };
- 224A12A20E9EADCC00BD17FD /* gtest-test-part.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = "gtest-test-part.h"; sourceTree = "<group>"; };
- 3B238C120E7FE13C00846E11 /* gtest_unittest.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = gtest_unittest.cc; sourceTree = "<group>"; };
- 3B87D2100E96B92E000D1852 /* runtests.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = runtests.sh; sourceTree = "<group>"; };
- 3BF6F29F0E79B5AD000F2EEE /* gtest-type-util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "gtest-type-util.h"; sourceTree = "<group>"; };
- 3BF6F2A40E79B616000F2EEE /* gtest-typed-test.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "gtest-typed-test.h"; sourceTree = "<group>"; };
- 403EE37C0E377822004BD1E2 /* versiongenerate.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = versiongenerate.py; sourceTree = "<group>"; };
- 404883DB0E2F799B00CF7658 /* gtest-death-test.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "gtest-death-test.h"; sourceTree = "<group>"; };
- 404883DC0E2F799B00CF7658 /* gtest-message.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "gtest-message.h"; sourceTree = "<group>"; };
- 404883DD0E2F799B00CF7658 /* gtest-spi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "gtest-spi.h"; sourceTree = "<group>"; };
- 404883DE0E2F799B00CF7658 /* gtest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = gtest.h; sourceTree = "<group>"; };
- 404883DF0E2F799B00CF7658 /* gtest_pred_impl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = gtest_pred_impl.h; sourceTree = "<group>"; };
- 404883E00E2F799B00CF7658 /* gtest_prod.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = gtest_prod.h; sourceTree = "<group>"; };
- 404883E20E2F799B00CF7658 /* gtest-death-test-internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "gtest-death-test-internal.h"; sourceTree = "<group>"; };
- 404883E30E2F799B00CF7658 /* gtest-filepath.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "gtest-filepath.h"; sourceTree = "<group>"; };
- 404883E40E2F799B00CF7658 /* gtest-internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "gtest-internal.h"; sourceTree = "<group>"; };
- 404883E50E2F799B00CF7658 /* gtest-port.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "gtest-port.h"; sourceTree = "<group>"; };
- 404883E60E2F799B00CF7658 /* gtest-string.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "gtest-string.h"; sourceTree = "<group>"; };
- 404883F60E2F799B00CF7658 /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = README; path = ../README; sourceTree = SOURCE_ROOT; };
- 4048840D0E2F799B00CF7658 /* gtest_main.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = gtest_main.cc; sourceTree = "<group>"; };
- 404884A90E2F7CD900CF7658 /* CHANGES */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = CHANGES; path = ../CHANGES; sourceTree = SOURCE_ROOT; };
- 404884AA0E2F7CD900CF7658 /* CONTRIBUTORS */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = CONTRIBUTORS; path = ../CONTRIBUTORS; sourceTree = SOURCE_ROOT; };
- 404884AB0E2F7CD900CF7658 /* LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = SOURCE_ROOT; };
- 40899F430FFA7184000B29AE /* gtest_unittest-framework */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "gtest_unittest-framework"; sourceTree = BUILT_PRODUCTS_DIR; };
- 40899F4D0FFA7271000B29AE /* gtest-tuple.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "gtest-tuple.h"; sourceTree = "<group>"; };
- 40899FB30FFA7567000B29AE /* StaticLibraryTarget.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = StaticLibraryTarget.xcconfig; sourceTree = "<group>"; };
- 4089A0130FFACEFC000B29AE /* sample1_unittest-framework */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "sample1_unittest-framework"; sourceTree = BUILT_PRODUCTS_DIR; };
- 4089A02C0FFACF7F000B29AE /* sample1.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sample1.cc; sourceTree = "<group>"; };
- 4089A02D0FFACF7F000B29AE /* sample1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sample1.h; sourceTree = "<group>"; };
- 4089A02E0FFACF7F000B29AE /* sample1_unittest.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sample1_unittest.cc; sourceTree = "<group>"; };
- 40C848FA101A209C0083642A /* libgtest.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libgtest.a; sourceTree = BUILT_PRODUCTS_DIR; };
- 40C8490B101A217E0083642A /* libgtest_main.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libgtest_main.a; sourceTree = BUILT_PRODUCTS_DIR; };
- 40C84987101A36850083642A /* gtest_unittest */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = gtest_unittest; sourceTree = BUILT_PRODUCTS_DIR; };
- 40C84997101A36A60083642A /* sample1_unittest-static */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "sample1_unittest-static"; sourceTree = BUILT_PRODUCTS_DIR; };
- 40D4CDF10E30E07400294801 /* DebugProject.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = DebugProject.xcconfig; sourceTree = "<group>"; };
- 40D4CDF20E30E07400294801 /* FrameworkTarget.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = FrameworkTarget.xcconfig; sourceTree = "<group>"; };
- 40D4CDF30E30E07400294801 /* General.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = General.xcconfig; sourceTree = "<group>"; };
- 40D4CDF40E30E07400294801 /* ReleaseProject.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = ReleaseProject.xcconfig; sourceTree = "<group>"; };
- 40D4CF510E30F5E200294801 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
- 4539C8FF0EC27F6400A70F4C /* gtest.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = gtest.framework; sourceTree = BUILT_PRODUCTS_DIR; };
- 4539C9330EC280AE00A70F4C /* gtest-param-test.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "gtest-param-test.h"; sourceTree = "<group>"; };
- 4539C9350EC280E200A70F4C /* gtest-linked_ptr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "gtest-linked_ptr.h"; sourceTree = "<group>"; };
- 4539C9360EC280E200A70F4C /* gtest-param-util-generated.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "gtest-param-util-generated.h"; sourceTree = "<group>"; };
- 4539C9370EC280E200A70F4C /* gtest-param-util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "gtest-param-util.h"; sourceTree = "<group>"; };
- 4567C8171264FF71007740BE /* gtest-printers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "gtest-printers.h"; sourceTree = "<group>"; };
-/* End PBXFileReference section */
-
-/* Begin PBXFrameworksBuildPhase section */
- 40899F410FFA7184000B29AE /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 40C849A4101A37150083642A /* gtest.framework in Frameworks */,
- 40C84916101A235B0083642A /* libgtest_main.a in Frameworks */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- 4089A0110FFACEFC000B29AE /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 40C849A2101A37050083642A /* gtest.framework in Frameworks */,
- 40C84921101A23AD0083642A /* libgtest_main.a in Frameworks */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- 40C84981101A36850083642A /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 40C84982101A36850083642A /* libgtest.a in Frameworks */,
- 40C84983101A36850083642A /* libgtest_main.a in Frameworks */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- 40C84991101A36A60083642A /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 40C84992101A36A60083642A /* libgtest.a in Frameworks */,
- 40C84993101A36A60083642A /* libgtest_main.a in Frameworks */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXFrameworksBuildPhase section */
-
-/* Begin PBXGroup section */
- 034768DDFF38A45A11DB9C8B /* Products */ = {
- isa = PBXGroup;
- children = (
- 4539C8FF0EC27F6400A70F4C /* gtest.framework */,
- 40C848FA101A209C0083642A /* libgtest.a */,
- 40C8490B101A217E0083642A /* libgtest_main.a */,
- 40899F430FFA7184000B29AE /* gtest_unittest-framework */,
- 40C84987101A36850083642A /* gtest_unittest */,
- 4089A0130FFACEFC000B29AE /* sample1_unittest-framework */,
- 40C84997101A36A60083642A /* sample1_unittest-static */,
- );
- name = Products;
- sourceTree = "<group>";
- };
- 0867D691FE84028FC02AAC07 /* gtest */ = {
- isa = PBXGroup;
- children = (
- 40D4CDF00E30E07400294801 /* Config */,
- 08FB77ACFE841707C02AAC07 /* Source */,
- 40D4CF4E0E30F5E200294801 /* Resources */,
- 403EE37B0E377822004BD1E2 /* Scripts */,
- 034768DDFF38A45A11DB9C8B /* Products */,
- );
- name = gtest;
- sourceTree = "<group>";
- };
- 08FB77ACFE841707C02AAC07 /* Source */ = {
- isa = PBXGroup;
- children = (
- 404884A90E2F7CD900CF7658 /* CHANGES */,
- 404884AA0E2F7CD900CF7658 /* CONTRIBUTORS */,
- 404884AB0E2F7CD900CF7658 /* LICENSE */,
- 404883F60E2F799B00CF7658 /* README */,
- 404883D90E2F799B00CF7658 /* include */,
- 4089A02F0FFACF84000B29AE /* samples */,
- 404884070E2F799B00CF7658 /* src */,
- 3B238BF00E7FE13B00846E11 /* test */,
- );
- name = Source;
- sourceTree = "<group>";
- };
- 3B238BF00E7FE13B00846E11 /* test */ = {
- isa = PBXGroup;
- children = (
- 3B238C120E7FE13C00846E11 /* gtest_unittest.cc */,
- );
- name = test;
- path = ../test;
- sourceTree = SOURCE_ROOT;
- };
- 403EE37B0E377822004BD1E2 /* Scripts */ = {
- isa = PBXGroup;
- children = (
- 403EE37C0E377822004BD1E2 /* versiongenerate.py */,
- 3B87D2100E96B92E000D1852 /* runtests.sh */,
- );
- path = Scripts;
- sourceTree = "<group>";
- };
- 404883D90E2F799B00CF7658 /* include */ = {
- isa = PBXGroup;
- children = (
- 404883DA0E2F799B00CF7658 /* gtest */,
- );
- name = include;
- path = ../include;
- sourceTree = SOURCE_ROOT;
- };
- 404883DA0E2F799B00CF7658 /* gtest */ = {
- isa = PBXGroup;
- children = (
- 404883E10E2F799B00CF7658 /* internal */,
- 224A12A20E9EADCC00BD17FD /* gtest-test-part.h */,
- 404883DB0E2F799B00CF7658 /* gtest-death-test.h */,
- 404883DC0E2F799B00CF7658 /* gtest-message.h */,
- 4539C9330EC280AE00A70F4C /* gtest-param-test.h */,
- 4567C8171264FF71007740BE /* gtest-printers.h */,
- 404883DD0E2F799B00CF7658 /* gtest-spi.h */,
- 404883DE0E2F799B00CF7658 /* gtest.h */,
- 404883DF0E2F799B00CF7658 /* gtest_pred_impl.h */,
- 404883E00E2F799B00CF7658 /* gtest_prod.h */,
- 3BF6F2A40E79B616000F2EEE /* gtest-typed-test.h */,
- );
- path = gtest;
- sourceTree = "<group>";
- };
- 404883E10E2F799B00CF7658 /* internal */ = {
- isa = PBXGroup;
- children = (
- 404883E20E2F799B00CF7658 /* gtest-death-test-internal.h */,
- 404883E30E2F799B00CF7658 /* gtest-filepath.h */,
- 404883E40E2F799B00CF7658 /* gtest-internal.h */,
- 4539C9350EC280E200A70F4C /* gtest-linked_ptr.h */,
- 4539C9360EC280E200A70F4C /* gtest-param-util-generated.h */,
- 4539C9370EC280E200A70F4C /* gtest-param-util.h */,
- 404883E50E2F799B00CF7658 /* gtest-port.h */,
- 404883E60E2F799B00CF7658 /* gtest-string.h */,
- 40899F4D0FFA7271000B29AE /* gtest-tuple.h */,
- 3BF6F29F0E79B5AD000F2EEE /* gtest-type-util.h */,
- );
- path = internal;
- sourceTree = "<group>";
- };
- 404884070E2F799B00CF7658 /* src */ = {
- isa = PBXGroup;
- children = (
- 224A12A10E9EADA700BD17FD /* gtest-all.cc */,
- 4048840D0E2F799B00CF7658 /* gtest_main.cc */,
- );
- name = src;
- path = ../src;
- sourceTree = SOURCE_ROOT;
- };
- 4089A02F0FFACF84000B29AE /* samples */ = {
- isa = PBXGroup;
- children = (
- 4089A02C0FFACF7F000B29AE /* sample1.cc */,
- 4089A02D0FFACF7F000B29AE /* sample1.h */,
- 4089A02E0FFACF7F000B29AE /* sample1_unittest.cc */,
- );
- name = samples;
- path = ../samples;
- sourceTree = SOURCE_ROOT;
- };
- 40D4CDF00E30E07400294801 /* Config */ = {
- isa = PBXGroup;
- children = (
- 40D4CDF10E30E07400294801 /* DebugProject.xcconfig */,
- 40D4CDF20E30E07400294801 /* FrameworkTarget.xcconfig */,
- 40D4CDF30E30E07400294801 /* General.xcconfig */,
- 40D4CDF40E30E07400294801 /* ReleaseProject.xcconfig */,
- 40899FB30FFA7567000B29AE /* StaticLibraryTarget.xcconfig */,
- );
- path = Config;
- sourceTree = "<group>";
- };
- 40D4CF4E0E30F5E200294801 /* Resources */ = {
- isa = PBXGroup;
- children = (
- 40D4CF510E30F5E200294801 /* Info.plist */,
- );
- path = Resources;
- sourceTree = "<group>";
- };
-/* End PBXGroup section */
-
-/* Begin PBXHeadersBuildPhase section */
- 8D07F2BD0486CC7A007CD1D0 /* Headers */ = {
- isa = PBXHeadersBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 404884380E2F799B00CF7658 /* gtest-death-test.h in Headers */,
- 404884390E2F799B00CF7658 /* gtest-message.h in Headers */,
- 4539C9340EC280AE00A70F4C /* gtest-param-test.h in Headers */,
- 4567C8181264FF71007740BE /* gtest-printers.h in Headers */,
- 3BF6F2A50E79B616000F2EEE /* gtest-typed-test.h in Headers */,
- 4048843A0E2F799B00CF7658 /* gtest-spi.h in Headers */,
- 4048843B0E2F799B00CF7658 /* gtest.h in Headers */,
- 4048843C0E2F799B00CF7658 /* gtest_pred_impl.h in Headers */,
- 4048843D0E2F799B00CF7658 /* gtest_prod.h in Headers */,
- 224A12A30E9EADCC00BD17FD /* gtest-test-part.h in Headers */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXHeadersBuildPhase section */
-
-/* Begin PBXNativeTarget section */
- 40899F420FFA7184000B29AE /* gtest_unittest-framework */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = 40899F4A0FFA71BC000B29AE /* Build configuration list for PBXNativeTarget "gtest_unittest-framework" */;
- buildPhases = (
- 40899F400FFA7184000B29AE /* Sources */,
- 40899F410FFA7184000B29AE /* Frameworks */,
- );
- buildRules = (
- );
- dependencies = (
- 40C849A0101A36F10083642A /* PBXTargetDependency */,
- );
- name = "gtest_unittest-framework";
- productName = gtest_unittest;
- productReference = 40899F430FFA7184000B29AE /* gtest_unittest-framework */;
- productType = "com.apple.product-type.tool";
- };
- 4089A0120FFACEFC000B29AE /* sample1_unittest-framework */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = 4089A0240FFACF01000B29AE /* Build configuration list for PBXNativeTarget "sample1_unittest-framework" */;
- buildPhases = (
- 4089A0100FFACEFC000B29AE /* Sources */,
- 4089A0110FFACEFC000B29AE /* Frameworks */,
- );
- buildRules = (
- );
- dependencies = (
- 40C8499E101A36E50083642A /* PBXTargetDependency */,
- );
- name = "sample1_unittest-framework";
- productName = sample1_unittest;
- productReference = 4089A0130FFACEFC000B29AE /* sample1_unittest-framework */;
- productType = "com.apple.product-type.tool";
- };
- 40C848F9101A209C0083642A /* gtest-static */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = 40C84902101A212E0083642A /* Build configuration list for PBXNativeTarget "gtest-static" */;
- buildPhases = (
- 40C848F7101A209C0083642A /* Sources */,
- );
- buildRules = (
- );
- dependencies = (
- );
- name = "gtest-static";
- productName = "gtest-static";
- productReference = 40C848FA101A209C0083642A /* libgtest.a */;
- productType = "com.apple.product-type.library.static";
- };
- 40C8490A101A217E0083642A /* gtest_main-static */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = 40C84912101A21D20083642A /* Build configuration list for PBXNativeTarget "gtest_main-static" */;
- buildPhases = (
- 40C84908101A217E0083642A /* Sources */,
- );
- buildRules = (
- );
- dependencies = (
- );
- name = "gtest_main-static";
- productName = "gtest_main-static";
- productReference = 40C8490B101A217E0083642A /* libgtest_main.a */;
- productType = "com.apple.product-type.library.static";
- };
- 40C8497A101A36850083642A /* gtest_unittest-static */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = 40C84984101A36850083642A /* Build configuration list for PBXNativeTarget "gtest_unittest-static" */;
- buildPhases = (
- 40C8497F101A36850083642A /* Sources */,
- 40C84981101A36850083642A /* Frameworks */,
- );
- buildRules = (
- );
- dependencies = (
- 40C8497B101A36850083642A /* PBXTargetDependency */,
- 40C8497D101A36850083642A /* PBXTargetDependency */,
- );
- name = "gtest_unittest-static";
- productName = gtest_unittest;
- productReference = 40C84987101A36850083642A /* gtest_unittest */;
- productType = "com.apple.product-type.tool";
- };
- 40C84989101A36A60083642A /* sample1_unittest-static */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = 40C84994101A36A60083642A /* Build configuration list for PBXNativeTarget "sample1_unittest-static" */;
- buildPhases = (
- 40C8498E101A36A60083642A /* Sources */,
- 40C84991101A36A60083642A /* Frameworks */,
- );
- buildRules = (
- );
- dependencies = (
- 40C8498A101A36A60083642A /* PBXTargetDependency */,
- 40C8498C101A36A60083642A /* PBXTargetDependency */,
- );
- name = "sample1_unittest-static";
- productName = sample1_unittest;
- productReference = 40C84997101A36A60083642A /* sample1_unittest-static */;
- productType = "com.apple.product-type.tool";
- };
- 8D07F2BC0486CC7A007CD1D0 /* gtest-framework */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = 4FADC24208B4156D00ABE55E /* Build configuration list for PBXNativeTarget "gtest-framework" */;
- buildPhases = (
- 8D07F2C10486CC7A007CD1D0 /* Sources */,
- 8D07F2BD0486CC7A007CD1D0 /* Headers */,
- 404884A50E2F7C0400CF7658 /* Copy Headers Internal */,
- 8D07F2BF0486CC7A007CD1D0 /* Resources */,
- );
- buildRules = (
- );
- dependencies = (
- 40C44AE60E379922008FCC51 /* PBXTargetDependency */,
- 408BEC101046CFE900DEF522 /* PBXTargetDependency */,
- 40C8499C101A36DC0083642A /* PBXTargetDependency */,
- );
- name = "gtest-framework";
- productInstallPath = "$(HOME)/Library/Frameworks";
- productName = gtest;
- productReference = 4539C8FF0EC27F6400A70F4C /* gtest.framework */;
- productType = "com.apple.product-type.framework";
- };
-/* End PBXNativeTarget section */
-
-/* Begin PBXProject section */
- 0867D690FE84028FC02AAC07 /* Project object */ = {
- isa = PBXProject;
- buildConfigurationList = 4FADC24608B4156D00ABE55E /* Build configuration list for PBXProject "gtest" */;
- compatibilityVersion = "Xcode 2.4";
- hasScannedForEncodings = 1;
- knownRegions = (
- English,
- Japanese,
- French,
- German,
- en,
- );
- mainGroup = 0867D691FE84028FC02AAC07 /* gtest */;
- productRefGroup = 034768DDFF38A45A11DB9C8B /* Products */;
- projectDirPath = "";
- projectRoot = "";
- targets = (
- 8D07F2BC0486CC7A007CD1D0 /* gtest-framework */,
- 40C848F9101A209C0083642A /* gtest-static */,
- 40C8490A101A217E0083642A /* gtest_main-static */,
- 40899F420FFA7184000B29AE /* gtest_unittest-framework */,
- 40C8497A101A36850083642A /* gtest_unittest-static */,
- 4089A0120FFACEFC000B29AE /* sample1_unittest-framework */,
- 40C84989101A36A60083642A /* sample1_unittest-static */,
- 3B238F5F0E828B5400846E11 /* Check */,
- 40C44ADC0E3798F4008FCC51 /* Version Info */,
- );
- };
-/* End PBXProject section */
-
-/* Begin PBXResourcesBuildPhase section */
- 8D07F2BF0486CC7A007CD1D0 /* Resources */ = {
- isa = PBXResourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 404884500E2F799B00CF7658 /* README in Resources */,
- 404884AC0E2F7CD900CF7658 /* CHANGES in Resources */,
- 404884AD0E2F7CD900CF7658 /* CONTRIBUTORS in Resources */,
- 404884AE0E2F7CD900CF7658 /* LICENSE in Resources */,
- 40C84978101A36540083642A /* libgtest_main.a in Resources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXResourcesBuildPhase section */
-
-/* Begin PBXShellScriptBuildPhase section */
- 3B238F5E0E828B5400846E11 /* ShellScript */ = {
- isa = PBXShellScriptBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- inputPaths = (
- );
- outputPaths = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- shellPath = /bin/sh;
- shellScript = "# Remember, this \"Run Script\" build phase will be executed from $SRCROOT\n/bin/bash Scripts/runtests.sh";
- };
- 40C44ADB0E3798F4008FCC51 /* Generate Version.h */ = {
- isa = PBXShellScriptBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- inputPaths = (
- "$(SRCROOT)/Scripts/versiongenerate.py",
- "$(SRCROOT)/../configure.ac",
- );
- name = "Generate Version.h";
- outputPaths = (
- "$(PROJECT_TEMP_DIR)/Version.h",
- );
- runOnlyForDeploymentPostprocessing = 0;
- shellPath = /bin/sh;
- shellScript = "# Remember, this \"Run Script\" build phase will be executed from $SRCROOT\n/usr/bin/python Scripts/versiongenerate.py ../ $PROJECT_TEMP_DIR";
- };
-/* End PBXShellScriptBuildPhase section */
-
-/* Begin PBXSourcesBuildPhase section */
- 40899F400FFA7184000B29AE /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 40899F530FFA72A0000B29AE /* gtest_unittest.cc in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- 4089A0100FFACEFC000B29AE /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 4089A0440FFAD1BE000B29AE /* sample1.cc in Sources */,
- 4089A0460FFAD1BE000B29AE /* sample1_unittest.cc in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- 40C848F7101A209C0083642A /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 40C848FF101A21150083642A /* gtest-all.cc in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- 40C84908101A217E0083642A /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 40C84915101A21DF0083642A /* gtest_main.cc in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- 40C8497F101A36850083642A /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 40C84980101A36850083642A /* gtest_unittest.cc in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- 40C8498E101A36A60083642A /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 40C8498F101A36A60083642A /* sample1.cc in Sources */,
- 40C84990101A36A60083642A /* sample1_unittest.cc in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- 8D07F2C10486CC7A007CD1D0 /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 40899F3A0FFA70D4000B29AE /* gtest-all.cc in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXSourcesBuildPhase section */
-
-/* Begin PBXTargetDependency section */
- 40899F9D0FFA740F000B29AE /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = 40899F420FFA7184000B29AE /* gtest_unittest-framework */;
- targetProxy = 40899F9C0FFA740F000B29AE /* PBXContainerItemProxy */;
- };
- 4089A0980FFAD34A000B29AE /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = 4089A0120FFACEFC000B29AE /* sample1_unittest-framework */;
- targetProxy = 4089A0970FFAD34A000B29AE /* PBXContainerItemProxy */;
- };
- 408BEC101046CFE900DEF522 /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = 40C848F9101A209C0083642A /* gtest-static */;
- targetProxy = 408BEC0F1046CFE900DEF522 /* PBXContainerItemProxy */;
- };
- 40C44AE60E379922008FCC51 /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = 40C44ADC0E3798F4008FCC51 /* Version Info */;
- targetProxy = 40C44AE50E379922008FCC51 /* PBXContainerItemProxy */;
- };
- 40C8497B101A36850083642A /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = 40C848F9101A209C0083642A /* gtest-static */;
- targetProxy = 40C8497C101A36850083642A /* PBXContainerItemProxy */;
- };
- 40C8497D101A36850083642A /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = 40C8490A101A217E0083642A /* gtest_main-static */;
- targetProxy = 40C8497E101A36850083642A /* PBXContainerItemProxy */;
- };
- 40C8498A101A36A60083642A /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = 40C848F9101A209C0083642A /* gtest-static */;
- targetProxy = 40C8498B101A36A60083642A /* PBXContainerItemProxy */;
- };
- 40C8498C101A36A60083642A /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = 40C8490A101A217E0083642A /* gtest_main-static */;
- targetProxy = 40C8498D101A36A60083642A /* PBXContainerItemProxy */;
- };
- 40C8499C101A36DC0083642A /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = 40C8490A101A217E0083642A /* gtest_main-static */;
- targetProxy = 40C8499B101A36DC0083642A /* PBXContainerItemProxy */;
- };
- 40C8499E101A36E50083642A /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = 8D07F2BC0486CC7A007CD1D0 /* gtest-framework */;
- targetProxy = 40C8499D101A36E50083642A /* PBXContainerItemProxy */;
- };
- 40C849A0101A36F10083642A /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = 8D07F2BC0486CC7A007CD1D0 /* gtest-framework */;
- targetProxy = 40C8499F101A36F10083642A /* PBXContainerItemProxy */;
- };
- 40C849F7101A43440083642A /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = 40C8497A101A36850083642A /* gtest_unittest-static */;
- targetProxy = 40C849F6101A43440083642A /* PBXContainerItemProxy */;
- };
- 40C849F9101A43490083642A /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = 40C84989101A36A60083642A /* sample1_unittest-static */;
- targetProxy = 40C849F8101A43490083642A /* PBXContainerItemProxy */;
- };
-/* End PBXTargetDependency section */
-
-/* Begin XCBuildConfiguration section */
- 3B238F600E828B5400846E11 /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- COPY_PHASE_STRIP = NO;
- GCC_DYNAMIC_NO_PIC = NO;
- GCC_OPTIMIZATION_LEVEL = 0;
- PRODUCT_NAME = Check;
- };
- name = Debug;
- };
- 3B238F610E828B5400846E11 /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- COPY_PHASE_STRIP = YES;
- DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
- GCC_ENABLE_FIX_AND_CONTINUE = NO;
- PRODUCT_NAME = Check;
- ZERO_LINK = NO;
- };
- name = Release;
- };
- 40899F450FFA7185000B29AE /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- HEADER_SEARCH_PATHS = ../;
- PRODUCT_NAME = "gtest_unittest-framework";
- };
- name = Debug;
- };
- 40899F460FFA7185000B29AE /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- HEADER_SEARCH_PATHS = ../;
- PRODUCT_NAME = "gtest_unittest-framework";
- };
- name = Release;
- };
- 4089A0150FFACEFD000B29AE /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- PRODUCT_NAME = "sample1_unittest-framework";
- };
- name = Debug;
- };
- 4089A0160FFACEFD000B29AE /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- PRODUCT_NAME = "sample1_unittest-framework";
- };
- name = Release;
- };
- 40C44ADF0E3798F4008FCC51 /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- PRODUCT_NAME = gtest;
- TARGET_NAME = gtest;
- };
- name = Debug;
- };
- 40C44AE00E3798F4008FCC51 /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- PRODUCT_NAME = gtest;
- TARGET_NAME = gtest;
- };
- name = Release;
- };
- 40C848FB101A209D0083642A /* Debug */ = {
- isa = XCBuildConfiguration;
- baseConfigurationReference = 40899FB30FFA7567000B29AE /* StaticLibraryTarget.xcconfig */;
- buildSettings = {
- GCC_INLINES_ARE_PRIVATE_EXTERN = YES;
- GCC_SYMBOLS_PRIVATE_EXTERN = YES;
- HEADER_SEARCH_PATHS = (
- ../,
- ../include/,
- );
- PRODUCT_NAME = gtest;
- };
- name = Debug;
- };
- 40C848FC101A209D0083642A /* Release */ = {
- isa = XCBuildConfiguration;
- baseConfigurationReference = 40899FB30FFA7567000B29AE /* StaticLibraryTarget.xcconfig */;
- buildSettings = {
- GCC_INLINES_ARE_PRIVATE_EXTERN = YES;
- GCC_SYMBOLS_PRIVATE_EXTERN = YES;
- HEADER_SEARCH_PATHS = (
- ../,
- ../include/,
- );
- PRODUCT_NAME = gtest;
- };
- name = Release;
- };
- 40C8490E101A217F0083642A /* Debug */ = {
- isa = XCBuildConfiguration;
- baseConfigurationReference = 40899FB30FFA7567000B29AE /* StaticLibraryTarget.xcconfig */;
- buildSettings = {
- HEADER_SEARCH_PATHS = (
- ../,
- ../include/,
- );
- PRODUCT_NAME = gtest_main;
- };
- name = Debug;
- };
- 40C8490F101A217F0083642A /* Release */ = {
- isa = XCBuildConfiguration;
- baseConfigurationReference = 40899FB30FFA7567000B29AE /* StaticLibraryTarget.xcconfig */;
- buildSettings = {
- HEADER_SEARCH_PATHS = (
- ../,
- ../include/,
- );
- PRODUCT_NAME = gtest_main;
- };
- name = Release;
- };
- 40C84985101A36850083642A /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- HEADER_SEARCH_PATHS = ../;
- PRODUCT_NAME = gtest_unittest;
- };
- name = Debug;
- };
- 40C84986101A36850083642A /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- HEADER_SEARCH_PATHS = ../;
- PRODUCT_NAME = gtest_unittest;
- };
- name = Release;
- };
- 40C84995101A36A60083642A /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- PRODUCT_NAME = "sample1_unittest-static";
- };
- name = Debug;
- };
- 40C84996101A36A60083642A /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- PRODUCT_NAME = "sample1_unittest-static";
- };
- name = Release;
- };
- 4FADC24308B4156D00ABE55E /* Debug */ = {
- isa = XCBuildConfiguration;
- baseConfigurationReference = 40D4CDF20E30E07400294801 /* FrameworkTarget.xcconfig */;
- buildSettings = {
- DYLIB_COMPATIBILITY_VERSION = 1;
- DYLIB_CURRENT_VERSION = 1;
- HEADER_SEARCH_PATHS = (
- ../,
- ../include/,
- );
- INFOPLIST_FILE = Resources/Info.plist;
- INFOPLIST_PREFIX_HEADER = "$(PROJECT_TEMP_DIR)/Version.h";
- INFOPLIST_PREPROCESS = YES;
- PRODUCT_NAME = gtest;
- VERSIONING_SYSTEM = "apple-generic";
- };
- name = Debug;
- };
- 4FADC24408B4156D00ABE55E /* Release */ = {
- isa = XCBuildConfiguration;
- baseConfigurationReference = 40D4CDF20E30E07400294801 /* FrameworkTarget.xcconfig */;
- buildSettings = {
- DYLIB_COMPATIBILITY_VERSION = 1;
- DYLIB_CURRENT_VERSION = 1;
- HEADER_SEARCH_PATHS = (
- ../,
- ../include/,
- );
- INFOPLIST_FILE = Resources/Info.plist;
- INFOPLIST_PREFIX_HEADER = "$(PROJECT_TEMP_DIR)/Version.h";
- INFOPLIST_PREPROCESS = YES;
- PRODUCT_NAME = gtest;
- VERSIONING_SYSTEM = "apple-generic";
- };
- name = Release;
- };
- 4FADC24708B4156D00ABE55E /* Debug */ = {
- isa = XCBuildConfiguration;
- baseConfigurationReference = 40D4CDF10E30E07400294801 /* DebugProject.xcconfig */;
- buildSettings = {
- };
- name = Debug;
- };
- 4FADC24808B4156D00ABE55E /* Release */ = {
- isa = XCBuildConfiguration;
- baseConfigurationReference = 40D4CDF40E30E07400294801 /* ReleaseProject.xcconfig */;
- buildSettings = {
- };
- name = Release;
- };
-/* End XCBuildConfiguration section */
-
-/* Begin XCConfigurationList section */
- 3B238FA30E828BB600846E11 /* Build configuration list for PBXAggregateTarget "Check" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 3B238F600E828B5400846E11 /* Debug */,
- 3B238F610E828B5400846E11 /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- 40899F4A0FFA71BC000B29AE /* Build configuration list for PBXNativeTarget "gtest_unittest-framework" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 40899F450FFA7185000B29AE /* Debug */,
- 40899F460FFA7185000B29AE /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- 4089A0240FFACF01000B29AE /* Build configuration list for PBXNativeTarget "sample1_unittest-framework" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 4089A0150FFACEFD000B29AE /* Debug */,
- 4089A0160FFACEFD000B29AE /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- 40C44AE40E379905008FCC51 /* Build configuration list for PBXAggregateTarget "Version Info" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 40C44ADF0E3798F4008FCC51 /* Debug */,
- 40C44AE00E3798F4008FCC51 /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- 40C84902101A212E0083642A /* Build configuration list for PBXNativeTarget "gtest-static" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 40C848FB101A209D0083642A /* Debug */,
- 40C848FC101A209D0083642A /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- 40C84912101A21D20083642A /* Build configuration list for PBXNativeTarget "gtest_main-static" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 40C8490E101A217F0083642A /* Debug */,
- 40C8490F101A217F0083642A /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- 40C84984101A36850083642A /* Build configuration list for PBXNativeTarget "gtest_unittest-static" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 40C84985101A36850083642A /* Debug */,
- 40C84986101A36850083642A /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- 40C84994101A36A60083642A /* Build configuration list for PBXNativeTarget "sample1_unittest-static" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 40C84995101A36A60083642A /* Debug */,
- 40C84996101A36A60083642A /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- 4FADC24208B4156D00ABE55E /* Build configuration list for PBXNativeTarget "gtest-framework" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 4FADC24308B4156D00ABE55E /* Debug */,
- 4FADC24408B4156D00ABE55E /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- 4FADC24608B4156D00ABE55E /* Build configuration list for PBXProject "gtest" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 4FADC24708B4156D00ABE55E /* Debug */,
- 4FADC24808B4156D00ABE55E /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
-/* End XCConfigurationList section */
- };
- rootObject = 0867D690FE84028FC02AAC07 /* Project object */;
-}
diff --git a/src/testing/include/gmock/gmock-actions.h b/src/testing/include/gmock/gmock-actions.h
deleted file mode 100644
index 7e9708ec..00000000
--- a/src/testing/include/gmock/gmock-actions.h
+++ /dev/null
@@ -1,1078 +0,0 @@
-// Copyright 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-// Google Mock - a framework for writing C++ mock classes.
-//
-// This file implements some commonly used actions.
-
-#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_ACTIONS_H_
-#define GMOCK_INCLUDE_GMOCK_GMOCK_ACTIONS_H_
-
-#ifndef _WIN32_WCE
-# include <errno.h>
-#endif
-
-#include <algorithm>
-#include <string>
-
-#include "gmock/internal/gmock-internal-utils.h"
-#include "gmock/internal/gmock-port.h"
-
-namespace testing {
-
-// To implement an action Foo, define:
-// 1. a class FooAction that implements the ActionInterface interface, and
-// 2. a factory function that creates an Action object from a
-// const FooAction*.
-//
-// The two-level delegation design follows that of Matcher, providing
-// consistency for extension developers. It also eases ownership
-// management as Action objects can now be copied like plain values.
-
-namespace internal {
-
-template <typename F1, typename F2>
-class ActionAdaptor;
-
-// BuiltInDefaultValue<T>::Get() returns the "built-in" default
-// value for type T, which is NULL when T is a pointer type, 0 when T
-// is a numeric type, false when T is bool, or "" when T is string or
-// std::string. For any other type T, this value is undefined and the
-// function will abort the process.
-template <typename T>
-class BuiltInDefaultValue {
- public:
- // This function returns true iff type T has a built-in default value.
- static bool Exists() { return false; }
- static T Get() {
- Assert(false, __FILE__, __LINE__,
- "Default action undefined for the function return type.");
- return internal::Invalid<T>();
- // The above statement will never be reached, but is required in
- // order for this function to compile.
- }
-};
-
-// This partial specialization says that we use the same built-in
-// default value for T and const T.
-template <typename T>
-class BuiltInDefaultValue<const T> {
- public:
- static bool Exists() { return BuiltInDefaultValue<T>::Exists(); }
- static T Get() { return BuiltInDefaultValue<T>::Get(); }
-};
-
-// This partial specialization defines the default values for pointer
-// types.
-template <typename T>
-class BuiltInDefaultValue<T*> {
- public:
- static bool Exists() { return true; }
- static T* Get() { return NULL; }
-};
-
-// The following specializations define the default values for
-// specific types we care about.
-#define GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(type, value) \
- template <> \
- class BuiltInDefaultValue<type> { \
- public: \
- static bool Exists() { return true; } \
- static type Get() { return value; } \
- }
-
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(void, ); // NOLINT
-#if GTEST_HAS_GLOBAL_STRING
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(::string, "");
-#endif // GTEST_HAS_GLOBAL_STRING
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(::std::string, "");
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(bool, false);
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(unsigned char, '\0');
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(signed char, '\0');
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(char, '\0');
-
-// There's no need for a default action for signed wchar_t, as that
-// type is the same as wchar_t for gcc, and invalid for MSVC.
-//
-// There's also no need for a default action for unsigned wchar_t, as
-// that type is the same as unsigned int for gcc, and invalid for
-// MSVC.
-#if GMOCK_WCHAR_T_IS_NATIVE_
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(wchar_t, 0U); // NOLINT
-#endif
-
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(unsigned short, 0U); // NOLINT
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(signed short, 0); // NOLINT
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(unsigned int, 0U);
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(signed int, 0);
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(unsigned long, 0UL); // NOLINT
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(signed long, 0L); // NOLINT
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(UInt64, 0);
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(Int64, 0);
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(float, 0);
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(double, 0);
-
-#undef GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_
-
-} // namespace internal
-
-// When an unexpected function call is encountered, Google Mock will
-// let it return a default value if the user has specified one for its
-// return type, or if the return type has a built-in default value;
-// otherwise Google Mock won't know what value to return and will have
-// to abort the process.
-//
-// The DefaultValue<T> class allows a user to specify the
-// default value for a type T that is both copyable and publicly
-// destructible (i.e. anything that can be used as a function return
-// type). The usage is:
-//
-// // Sets the default value for type T to be foo.
-// DefaultValue<T>::Set(foo);
-template <typename T>
-class DefaultValue {
- public:
- // Sets the default value for type T; requires T to be
- // copy-constructable and have a public destructor.
- static void Set(T x) {
- delete value_;
- value_ = new T(x);
- }
-
- // Unsets the default value for type T.
- static void Clear() {
- delete value_;
- value_ = NULL;
- }
-
- // Returns true iff the user has set the default value for type T.
- static bool IsSet() { return value_ != NULL; }
-
- // Returns true if T has a default return value set by the user or there
- // exists a built-in default value.
- static bool Exists() {
- return IsSet() || internal::BuiltInDefaultValue<T>::Exists();
- }
-
- // Returns the default value for type T if the user has set one;
- // otherwise returns the built-in default value if there is one;
- // otherwise aborts the process.
- static T Get() {
- return value_ == NULL ?
- internal::BuiltInDefaultValue<T>::Get() : *value_;
- }
-
- private:
- static const T* value_;
-};
-
-// This partial specialization allows a user to set default values for
-// reference types.
-template <typename T>
-class DefaultValue<T&> {
- public:
- // Sets the default value for type T&.
- static void Set(T& x) { // NOLINT
- address_ = &x;
- }
-
- // Unsets the default value for type T&.
- static void Clear() {
- address_ = NULL;
- }
-
- // Returns true iff the user has set the default value for type T&.
- static bool IsSet() { return address_ != NULL; }
-
- // Returns true if T has a default return value set by the user or there
- // exists a built-in default value.
- static bool Exists() {
- return IsSet() || internal::BuiltInDefaultValue<T&>::Exists();
- }
-
- // Returns the default value for type T& if the user has set one;
- // otherwise returns the built-in default value if there is one;
- // otherwise aborts the process.
- static T& Get() {
- return address_ == NULL ?
- internal::BuiltInDefaultValue<T&>::Get() : *address_;
- }
-
- private:
- static T* address_;
-};
-
-// This specialization allows DefaultValue<void>::Get() to
-// compile.
-template <>
-class DefaultValue<void> {
- public:
- static bool Exists() { return true; }
- static void Get() {}
-};
-
-// Points to the user-set default value for type T.
-template <typename T>
-const T* DefaultValue<T>::value_ = NULL;
-
-// Points to the user-set default value for type T&.
-template <typename T>
-T* DefaultValue<T&>::address_ = NULL;
-
-// Implement this interface to define an action for function type F.
-template <typename F>
-class ActionInterface {
- public:
- typedef typename internal::Function<F>::Result Result;
- typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
-
- ActionInterface() {}
- virtual ~ActionInterface() {}
-
- // Performs the action. This method is not const, as in general an
- // action can have side effects and be stateful. For example, a
- // get-the-next-element-from-the-collection action will need to
- // remember the current element.
- virtual Result Perform(const ArgumentTuple& args) = 0;
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(ActionInterface);
-};
-
-// An Action<F> is a copyable and IMMUTABLE (except by assignment)
-// object that represents an action to be taken when a mock function
-// of type F is called. The implementation of Action<T> is just a
-// linked_ptr to const ActionInterface<T>, so copying is fairly cheap.
-// Don't inherit from Action!
-//
-// You can view an object implementing ActionInterface<F> as a
-// concrete action (including its current state), and an Action<F>
-// object as a handle to it.
-template <typename F>
-class Action {
- public:
- typedef typename internal::Function<F>::Result Result;
- typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
-
- // Constructs a null Action. Needed for storing Action objects in
- // STL containers.
- Action() : impl_(NULL) {}
-
- // Constructs an Action from its implementation. A NULL impl is
- // used to represent the "do-default" action.
- explicit Action(ActionInterface<F>* impl) : impl_(impl) {}
-
- // Copy constructor.
- Action(const Action& action) : impl_(action.impl_) {}
-
- // This constructor allows us to turn an Action<Func> object into an
- // Action<F>, as long as F's arguments can be implicitly converted
- // to Func's and Func's return type can be implicitly converted to
- // F's.
- template <typename Func>
- explicit Action(const Action<Func>& action);
-
- // Returns true iff this is the DoDefault() action.
- bool IsDoDefault() const { return impl_.get() == NULL; }
-
- // Performs the action. Note that this method is const even though
- // the corresponding method in ActionInterface is not. The reason
- // is that a const Action<F> means that it cannot be re-bound to
- // another concrete action, not that the concrete action it binds to
- // cannot change state. (Think of the difference between a const
- // pointer and a pointer to const.)
- Result Perform(const ArgumentTuple& args) const {
- internal::Assert(
- !IsDoDefault(), __FILE__, __LINE__,
- "You are using DoDefault() inside a composite action like "
- "DoAll() or WithArgs(). This is not supported for technical "
- "reasons. Please instead spell out the default action, or "
- "assign the default action to an Action variable and use "
- "the variable in various places.");
- return impl_->Perform(args);
- }
-
- private:
- template <typename F1, typename F2>
- friend class internal::ActionAdaptor;
-
- internal::linked_ptr<ActionInterface<F> > impl_;
-};
-
-// The PolymorphicAction class template makes it easy to implement a
-// polymorphic action (i.e. an action that can be used in mock
-// functions of than one type, e.g. Return()).
-//
-// To define a polymorphic action, a user first provides a COPYABLE
-// implementation class that has a Perform() method template:
-//
-// class FooAction {
-// public:
-// template <typename Result, typename ArgumentTuple>
-// Result Perform(const ArgumentTuple& args) const {
-// // Processes the arguments and returns a result, using
-// // tr1::get<N>(args) to get the N-th (0-based) argument in the tuple.
-// }
-// ...
-// };
-//
-// Then the user creates the polymorphic action using
-// MakePolymorphicAction(object) where object has type FooAction. See
-// the definition of Return(void) and SetArgumentPointee<N>(value) for
-// complete examples.
-template <typename Impl>
-class PolymorphicAction {
- public:
- explicit PolymorphicAction(const Impl& impl) : impl_(impl) {}
-
- template <typename F>
- operator Action<F>() const {
- return Action<F>(new MonomorphicImpl<F>(impl_));
- }
-
- private:
- template <typename F>
- class MonomorphicImpl : public ActionInterface<F> {
- public:
- typedef typename internal::Function<F>::Result Result;
- typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
-
- explicit MonomorphicImpl(const Impl& impl) : impl_(impl) {}
-
- virtual Result Perform(const ArgumentTuple& args) {
- return impl_.template Perform<Result>(args);
- }
-
- private:
- Impl impl_;
-
- GTEST_DISALLOW_ASSIGN_(MonomorphicImpl);
- };
-
- Impl impl_;
-
- GTEST_DISALLOW_ASSIGN_(PolymorphicAction);
-};
-
-// Creates an Action from its implementation and returns it. The
-// created Action object owns the implementation.
-template <typename F>
-Action<F> MakeAction(ActionInterface<F>* impl) {
- return Action<F>(impl);
-}
-
-// Creates a polymorphic action from its implementation. This is
-// easier to use than the PolymorphicAction<Impl> constructor as it
-// doesn't require you to explicitly write the template argument, e.g.
-//
-// MakePolymorphicAction(foo);
-// vs
-// PolymorphicAction<TypeOfFoo>(foo);
-template <typename Impl>
-inline PolymorphicAction<Impl> MakePolymorphicAction(const Impl& impl) {
- return PolymorphicAction<Impl>(impl);
-}
-
-namespace internal {
-
-// Allows an Action<F2> object to pose as an Action<F1>, as long as F2
-// and F1 are compatible.
-template <typename F1, typename F2>
-class ActionAdaptor : public ActionInterface<F1> {
- public:
- typedef typename internal::Function<F1>::Result Result;
- typedef typename internal::Function<F1>::ArgumentTuple ArgumentTuple;
-
- explicit ActionAdaptor(const Action<F2>& from) : impl_(from.impl_) {}
-
- virtual Result Perform(const ArgumentTuple& args) {
- return impl_->Perform(args);
- }
-
- private:
- const internal::linked_ptr<ActionInterface<F2> > impl_;
-
- GTEST_DISALLOW_ASSIGN_(ActionAdaptor);
-};
-
-// Implements the polymorphic Return(x) action, which can be used in
-// any function that returns the type of x, regardless of the argument
-// types.
-//
-// Note: The value passed into Return must be converted into
-// Function<F>::Result when this action is cast to Action<F> rather than
-// when that action is performed. This is important in scenarios like
-//
-// MOCK_METHOD1(Method, T(U));
-// ...
-// {
-// Foo foo;
-// X x(&foo);
-// EXPECT_CALL(mock, Method(_)).WillOnce(Return(x));
-// }
-//
-// In the example above the variable x holds reference to foo which leaves
-// scope and gets destroyed. If copying X just copies a reference to foo,
-// that copy will be left with a hanging reference. If conversion to T
-// makes a copy of foo, the above code is safe. To support that scenario, we
-// need to make sure that the type conversion happens inside the EXPECT_CALL
-// statement, and conversion of the result of Return to Action<T(U)> is a
-// good place for that.
-//
-template <typename R>
-class ReturnAction {
- public:
- // Constructs a ReturnAction object from the value to be returned.
- // 'value' is passed by value instead of by const reference in order
- // to allow Return("string literal") to compile.
- explicit ReturnAction(R value) : value_(value) {}
-
- // This template type conversion operator allows Return(x) to be
- // used in ANY function that returns x's type.
- template <typename F>
- operator Action<F>() const {
- // Assert statement belongs here because this is the best place to verify
- // conditions on F. It produces the clearest error messages
- // in most compilers.
- // Impl really belongs in this scope as a local class but can't
- // because MSVC produces duplicate symbols in different translation units
- // in this case. Until MS fixes that bug we put Impl into the class scope
- // and put the typedef both here (for use in assert statement) and
- // in the Impl class. But both definitions must be the same.
- typedef typename Function<F>::Result Result;
- GTEST_COMPILE_ASSERT_(
- !internal::is_reference<Result>::value,
- use_ReturnRef_instead_of_Return_to_return_a_reference);
- return Action<F>(new Impl<F>(value_));
- }
-
- private:
- // Implements the Return(x) action for a particular function type F.
- template <typename F>
- class Impl : public ActionInterface<F> {
- public:
- typedef typename Function<F>::Result Result;
- typedef typename Function<F>::ArgumentTuple ArgumentTuple;
-
- // The implicit cast is necessary when Result has more than one
- // single-argument constructor (e.g. Result is std::vector<int>) and R
- // has a type conversion operator template. In that case, value_(value)
- // won't compile as the compiler doesn't known which constructor of
- // Result to call. ImplicitCast_ forces the compiler to convert R to
- // Result without considering explicit constructors, thus resolving the
- // ambiguity. value_ is then initialized using its copy constructor.
- explicit Impl(R value)
- : value_(::testing::internal::ImplicitCast_<Result>(value)) {}
-
- virtual Result Perform(const ArgumentTuple&) { return value_; }
-
- private:
- GTEST_COMPILE_ASSERT_(!internal::is_reference<Result>::value,
- Result_cannot_be_a_reference_type);
- Result value_;
-
- GTEST_DISALLOW_ASSIGN_(Impl);
- };
-
- R value_;
-
- GTEST_DISALLOW_ASSIGN_(ReturnAction);
-};
-
-// Implements the ReturnNull() action.
-class ReturnNullAction {
- public:
- // Allows ReturnNull() to be used in any pointer-returning function.
- template <typename Result, typename ArgumentTuple>
- static Result Perform(const ArgumentTuple&) {
- GTEST_COMPILE_ASSERT_(internal::is_pointer<Result>::value,
- ReturnNull_can_be_used_to_return_a_pointer_only);
- return NULL;
- }
-};
-
-// Implements the Return() action.
-class ReturnVoidAction {
- public:
- // Allows Return() to be used in any void-returning function.
- template <typename Result, typename ArgumentTuple>
- static void Perform(const ArgumentTuple&) {
- CompileAssertTypesEqual<void, Result>();
- }
-};
-
-// Implements the polymorphic ReturnRef(x) action, which can be used
-// in any function that returns a reference to the type of x,
-// regardless of the argument types.
-template <typename T>
-class ReturnRefAction {
- public:
- // Constructs a ReturnRefAction object from the reference to be returned.
- explicit ReturnRefAction(T& ref) : ref_(ref) {} // NOLINT
-
- // This template type conversion operator allows ReturnRef(x) to be
- // used in ANY function that returns a reference to x's type.
- template <typename F>
- operator Action<F>() const {
- typedef typename Function<F>::Result Result;
- // Asserts that the function return type is a reference. This
- // catches the user error of using ReturnRef(x) when Return(x)
- // should be used, and generates some helpful error message.
- GTEST_COMPILE_ASSERT_(internal::is_reference<Result>::value,
- use_Return_instead_of_ReturnRef_to_return_a_value);
- return Action<F>(new Impl<F>(ref_));
- }
-
- private:
- // Implements the ReturnRef(x) action for a particular function type F.
- template <typename F>
- class Impl : public ActionInterface<F> {
- public:
- typedef typename Function<F>::Result Result;
- typedef typename Function<F>::ArgumentTuple ArgumentTuple;
-
- explicit Impl(T& ref) : ref_(ref) {} // NOLINT
-
- virtual Result Perform(const ArgumentTuple&) {
- return ref_;
- }
-
- private:
- T& ref_;
-
- GTEST_DISALLOW_ASSIGN_(Impl);
- };
-
- T& ref_;
-
- GTEST_DISALLOW_ASSIGN_(ReturnRefAction);
-};
-
-// Implements the polymorphic ReturnRefOfCopy(x) action, which can be
-// used in any function that returns a reference to the type of x,
-// regardless of the argument types.
-template <typename T>
-class ReturnRefOfCopyAction {
- public:
- // Constructs a ReturnRefOfCopyAction object from the reference to
- // be returned.
- explicit ReturnRefOfCopyAction(const T& value) : value_(value) {} // NOLINT
-
- // This template type conversion operator allows ReturnRefOfCopy(x) to be
- // used in ANY function that returns a reference to x's type.
- template <typename F>
- operator Action<F>() const {
- typedef typename Function<F>::Result Result;
- // Asserts that the function return type is a reference. This
- // catches the user error of using ReturnRefOfCopy(x) when Return(x)
- // should be used, and generates some helpful error message.
- GTEST_COMPILE_ASSERT_(
- internal::is_reference<Result>::value,
- use_Return_instead_of_ReturnRefOfCopy_to_return_a_value);
- return Action<F>(new Impl<F>(value_));
- }
-
- private:
- // Implements the ReturnRefOfCopy(x) action for a particular function type F.
- template <typename F>
- class Impl : public ActionInterface<F> {
- public:
- typedef typename Function<F>::Result Result;
- typedef typename Function<F>::ArgumentTuple ArgumentTuple;
-
- explicit Impl(const T& value) : value_(value) {} // NOLINT
-
- virtual Result Perform(const ArgumentTuple&) {
- return value_;
- }
-
- private:
- T value_;
-
- GTEST_DISALLOW_ASSIGN_(Impl);
- };
-
- const T value_;
-
- GTEST_DISALLOW_ASSIGN_(ReturnRefOfCopyAction);
-};
-
-// Implements the polymorphic DoDefault() action.
-class DoDefaultAction {
- public:
- // This template type conversion operator allows DoDefault() to be
- // used in any function.
- template <typename F>
- operator Action<F>() const { return Action<F>(NULL); }
-};
-
-// Implements the Assign action to set a given pointer referent to a
-// particular value.
-template <typename T1, typename T2>
-class AssignAction {
- public:
- AssignAction(T1* ptr, T2 value) : ptr_(ptr), value_(value) {}
-
- template <typename Result, typename ArgumentTuple>
- void Perform(const ArgumentTuple& /* args */) const {
- *ptr_ = value_;
- }
-
- private:
- T1* const ptr_;
- const T2 value_;
-
- GTEST_DISALLOW_ASSIGN_(AssignAction);
-};
-
-#if !GTEST_OS_WINDOWS_MOBILE
-
-// Implements the SetErrnoAndReturn action to simulate return from
-// various system calls and libc functions.
-template <typename T>
-class SetErrnoAndReturnAction {
- public:
- SetErrnoAndReturnAction(int errno_value, T result)
- : errno_(errno_value),
- result_(result) {}
- template <typename Result, typename ArgumentTuple>
- Result Perform(const ArgumentTuple& /* args */) const {
- errno = errno_;
- return result_;
- }
-
- private:
- const int errno_;
- const T result_;
-
- GTEST_DISALLOW_ASSIGN_(SetErrnoAndReturnAction);
-};
-
-#endif // !GTEST_OS_WINDOWS_MOBILE
-
-// Implements the SetArgumentPointee<N>(x) action for any function
-// whose N-th argument (0-based) is a pointer to x's type. The
-// template parameter kIsProto is true iff type A is ProtocolMessage,
-// proto2::Message, or a sub-class of those.
-template <size_t N, typename A, bool kIsProto>
-class SetArgumentPointeeAction {
- public:
- // Constructs an action that sets the variable pointed to by the
- // N-th function argument to 'value'.
- explicit SetArgumentPointeeAction(const A& value) : value_(value) {}
-
- template <typename Result, typename ArgumentTuple>
- void Perform(const ArgumentTuple& args) const {
- CompileAssertTypesEqual<void, Result>();
- *::std::tr1::get<N>(args) = value_;
- }
-
- private:
- const A value_;
-
- GTEST_DISALLOW_ASSIGN_(SetArgumentPointeeAction);
-};
-
-template <size_t N, typename Proto>
-class SetArgumentPointeeAction<N, Proto, true> {
- public:
- // Constructs an action that sets the variable pointed to by the
- // N-th function argument to 'proto'. Both ProtocolMessage and
- // proto2::Message have the CopyFrom() method, so the same
- // implementation works for both.
- explicit SetArgumentPointeeAction(const Proto& proto) : proto_(new Proto) {
- proto_->CopyFrom(proto);
- }
-
- template <typename Result, typename ArgumentTuple>
- void Perform(const ArgumentTuple& args) const {
- CompileAssertTypesEqual<void, Result>();
- ::std::tr1::get<N>(args)->CopyFrom(*proto_);
- }
-
- private:
- const internal::linked_ptr<Proto> proto_;
-
- GTEST_DISALLOW_ASSIGN_(SetArgumentPointeeAction);
-};
-
-// Implements the InvokeWithoutArgs(f) action. The template argument
-// FunctionImpl is the implementation type of f, which can be either a
-// function pointer or a functor. InvokeWithoutArgs(f) can be used as an
-// Action<F> as long as f's type is compatible with F (i.e. f can be
-// assigned to a tr1::function<F>).
-template <typename FunctionImpl>
-class InvokeWithoutArgsAction {
- public:
- // The c'tor makes a copy of function_impl (either a function
- // pointer or a functor).
- explicit InvokeWithoutArgsAction(FunctionImpl function_impl)
- : function_impl_(function_impl) {}
-
- // Allows InvokeWithoutArgs(f) to be used as any action whose type is
- // compatible with f.
- template <typename Result, typename ArgumentTuple>
- Result Perform(const ArgumentTuple&) { return function_impl_(); }
-
- private:
- FunctionImpl function_impl_;
-
- GTEST_DISALLOW_ASSIGN_(InvokeWithoutArgsAction);
-};
-
-// Implements the InvokeWithoutArgs(object_ptr, &Class::Method) action.
-template <class Class, typename MethodPtr>
-class InvokeMethodWithoutArgsAction {
- public:
- InvokeMethodWithoutArgsAction(Class* obj_ptr, MethodPtr method_ptr)
- : obj_ptr_(obj_ptr), method_ptr_(method_ptr) {}
-
- template <typename Result, typename ArgumentTuple>
- Result Perform(const ArgumentTuple&) const {
- return (obj_ptr_->*method_ptr_)();
- }
-
- private:
- Class* const obj_ptr_;
- const MethodPtr method_ptr_;
-
- GTEST_DISALLOW_ASSIGN_(InvokeMethodWithoutArgsAction);
-};
-
-// Implements the IgnoreResult(action) action.
-template <typename A>
-class IgnoreResultAction {
- public:
- explicit IgnoreResultAction(const A& action) : action_(action) {}
-
- template <typename F>
- operator Action<F>() const {
- // Assert statement belongs here because this is the best place to verify
- // conditions on F. It produces the clearest error messages
- // in most compilers.
- // Impl really belongs in this scope as a local class but can't
- // because MSVC produces duplicate symbols in different translation units
- // in this case. Until MS fixes that bug we put Impl into the class scope
- // and put the typedef both here (for use in assert statement) and
- // in the Impl class. But both definitions must be the same.
- typedef typename internal::Function<F>::Result Result;
-
- // Asserts at compile time that F returns void.
- CompileAssertTypesEqual<void, Result>();
-
- return Action<F>(new Impl<F>(action_));
- }
-
- private:
- template <typename F>
- class Impl : public ActionInterface<F> {
- public:
- typedef typename internal::Function<F>::Result Result;
- typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
-
- explicit Impl(const A& action) : action_(action) {}
-
- virtual void Perform(const ArgumentTuple& args) {
- // Performs the action and ignores its result.
- action_.Perform(args);
- }
-
- private:
- // Type OriginalFunction is the same as F except that its return
- // type is IgnoredValue.
- typedef typename internal::Function<F>::MakeResultIgnoredValue
- OriginalFunction;
-
- const Action<OriginalFunction> action_;
-
- GTEST_DISALLOW_ASSIGN_(Impl);
- };
-
- const A action_;
-
- GTEST_DISALLOW_ASSIGN_(IgnoreResultAction);
-};
-
-// A ReferenceWrapper<T> object represents a reference to type T,
-// which can be either const or not. It can be explicitly converted
-// from, and implicitly converted to, a T&. Unlike a reference,
-// ReferenceWrapper<T> can be copied and can survive template type
-// inference. This is used to support by-reference arguments in the
-// InvokeArgument<N>(...) action. The idea was from "reference
-// wrappers" in tr1, which we don't have in our source tree yet.
-template <typename T>
-class ReferenceWrapper {
- public:
- // Constructs a ReferenceWrapper<T> object from a T&.
- explicit ReferenceWrapper(T& l_value) : pointer_(&l_value) {} // NOLINT
-
- // Allows a ReferenceWrapper<T> object to be implicitly converted to
- // a T&.
- operator T&() const { return *pointer_; }
- private:
- T* pointer_;
-};
-
-// Allows the expression ByRef(x) to be printed as a reference to x.
-template <typename T>
-void PrintTo(const ReferenceWrapper<T>& ref, ::std::ostream* os) {
- T& value = ref;
- UniversalPrinter<T&>::Print(value, os);
-}
-
-// Does two actions sequentially. Used for implementing the DoAll(a1,
-// a2, ...) action.
-template <typename Action1, typename Action2>
-class DoBothAction {
- public:
- DoBothAction(Action1 action1, Action2 action2)
- : action1_(action1), action2_(action2) {}
-
- // This template type conversion operator allows DoAll(a1, ..., a_n)
- // to be used in ANY function of compatible type.
- template <typename F>
- operator Action<F>() const {
- return Action<F>(new Impl<F>(action1_, action2_));
- }
-
- private:
- // Implements the DoAll(...) action for a particular function type F.
- template <typename F>
- class Impl : public ActionInterface<F> {
- public:
- typedef typename Function<F>::Result Result;
- typedef typename Function<F>::ArgumentTuple ArgumentTuple;
- typedef typename Function<F>::MakeResultVoid VoidResult;
-
- Impl(const Action<VoidResult>& action1, const Action<F>& action2)
- : action1_(action1), action2_(action2) {}
-
- virtual Result Perform(const ArgumentTuple& args) {
- action1_.Perform(args);
- return action2_.Perform(args);
- }
-
- private:
- const Action<VoidResult> action1_;
- const Action<F> action2_;
-
- GTEST_DISALLOW_ASSIGN_(Impl);
- };
-
- Action1 action1_;
- Action2 action2_;
-
- GTEST_DISALLOW_ASSIGN_(DoBothAction);
-};
-
-} // namespace internal
-
-// An Unused object can be implicitly constructed from ANY value.
-// This is handy when defining actions that ignore some or all of the
-// mock function arguments. For example, given
-//
-// MOCK_METHOD3(Foo, double(const string& label, double x, double y));
-// MOCK_METHOD3(Bar, double(int index, double x, double y));
-//
-// instead of
-//
-// double DistanceToOriginWithLabel(const string& label, double x, double y) {
-// return sqrt(x*x + y*y);
-// }
-// double DistanceToOriginWithIndex(int index, double x, double y) {
-// return sqrt(x*x + y*y);
-// }
-// ...
-// EXEPCT_CALL(mock, Foo("abc", _, _))
-// .WillOnce(Invoke(DistanceToOriginWithLabel));
-// EXEPCT_CALL(mock, Bar(5, _, _))
-// .WillOnce(Invoke(DistanceToOriginWithIndex));
-//
-// you could write
-//
-// // We can declare any uninteresting argument as Unused.
-// double DistanceToOrigin(Unused, double x, double y) {
-// return sqrt(x*x + y*y);
-// }
-// ...
-// EXEPCT_CALL(mock, Foo("abc", _, _)).WillOnce(Invoke(DistanceToOrigin));
-// EXEPCT_CALL(mock, Bar(5, _, _)).WillOnce(Invoke(DistanceToOrigin));
-typedef internal::IgnoredValue Unused;
-
-// This constructor allows us to turn an Action<From> object into an
-// Action<To>, as long as To's arguments can be implicitly converted
-// to From's and From's return type cann be implicitly converted to
-// To's.
-template <typename To>
-template <typename From>
-Action<To>::Action(const Action<From>& from)
- : impl_(new internal::ActionAdaptor<To, From>(from)) {}
-
-// Creates an action that returns 'value'. 'value' is passed by value
-// instead of const reference - otherwise Return("string literal")
-// will trigger a compiler error about using array as initializer.
-template <typename R>
-internal::ReturnAction<R> Return(R value) {
- return internal::ReturnAction<R>(value);
-}
-
-// Creates an action that returns NULL.
-inline PolymorphicAction<internal::ReturnNullAction> ReturnNull() {
- return MakePolymorphicAction(internal::ReturnNullAction());
-}
-
-// Creates an action that returns from a void function.
-inline PolymorphicAction<internal::ReturnVoidAction> Return() {
- return MakePolymorphicAction(internal::ReturnVoidAction());
-}
-
-// Creates an action that returns the reference to a variable.
-template <typename R>
-inline internal::ReturnRefAction<R> ReturnRef(R& x) { // NOLINT
- return internal::ReturnRefAction<R>(x);
-}
-
-// Creates an action that returns the reference to a copy of the
-// argument. The copy is created when the action is constructed and
-// lives as long as the action.
-template <typename R>
-inline internal::ReturnRefOfCopyAction<R> ReturnRefOfCopy(const R& x) {
- return internal::ReturnRefOfCopyAction<R>(x);
-}
-
-// Creates an action that does the default action for the give mock function.
-inline internal::DoDefaultAction DoDefault() {
- return internal::DoDefaultAction();
-}
-
-// Creates an action that sets the variable pointed by the N-th
-// (0-based) function argument to 'value'.
-template <size_t N, typename T>
-PolymorphicAction<
- internal::SetArgumentPointeeAction<
- N, T, internal::IsAProtocolMessage<T>::value> >
-SetArgPointee(const T& x) {
- return MakePolymorphicAction(internal::SetArgumentPointeeAction<
- N, T, internal::IsAProtocolMessage<T>::value>(x));
-}
-
-#if !((GTEST_GCC_VER_ && GTEST_GCC_VER_ < 40000) || GTEST_OS_SYMBIAN)
-// This overload allows SetArgPointee() to accept a string literal.
-// GCC prior to the version 4.0 and Symbian C++ compiler cannot distinguish
-// this overload from the templated version and emit a compile error.
-template <size_t N>
-PolymorphicAction<
- internal::SetArgumentPointeeAction<N, const char*, false> >
-SetArgPointee(const char* p) {
- return MakePolymorphicAction(internal::SetArgumentPointeeAction<
- N, const char*, false>(p));
-}
-
-template <size_t N>
-PolymorphicAction<
- internal::SetArgumentPointeeAction<N, const wchar_t*, false> >
-SetArgPointee(const wchar_t* p) {
- return MakePolymorphicAction(internal::SetArgumentPointeeAction<
- N, const wchar_t*, false>(p));
-}
-#endif
-
-// The following version is DEPRECATED.
-template <size_t N, typename T>
-PolymorphicAction<
- internal::SetArgumentPointeeAction<
- N, T, internal::IsAProtocolMessage<T>::value> >
-SetArgumentPointee(const T& x) {
- return MakePolymorphicAction(internal::SetArgumentPointeeAction<
- N, T, internal::IsAProtocolMessage<T>::value>(x));
-}
-
-// Creates an action that sets a pointer referent to a given value.
-template <typename T1, typename T2>
-PolymorphicAction<internal::AssignAction<T1, T2> > Assign(T1* ptr, T2 val) {
- return MakePolymorphicAction(internal::AssignAction<T1, T2>(ptr, val));
-}
-
-#if !GTEST_OS_WINDOWS_MOBILE
-
-// Creates an action that sets errno and returns the appropriate error.
-template <typename T>
-PolymorphicAction<internal::SetErrnoAndReturnAction<T> >
-SetErrnoAndReturn(int errval, T result) {
- return MakePolymorphicAction(
- internal::SetErrnoAndReturnAction<T>(errval, result));
-}
-
-#endif // !GTEST_OS_WINDOWS_MOBILE
-
-// Various overloads for InvokeWithoutArgs().
-
-// Creates an action that invokes 'function_impl' with no argument.
-template <typename FunctionImpl>
-PolymorphicAction<internal::InvokeWithoutArgsAction<FunctionImpl> >
-InvokeWithoutArgs(FunctionImpl function_impl) {
- return MakePolymorphicAction(
- internal::InvokeWithoutArgsAction<FunctionImpl>(function_impl));
-}
-
-// Creates an action that invokes the given method on the given object
-// with no argument.
-template <class Class, typename MethodPtr>
-PolymorphicAction<internal::InvokeMethodWithoutArgsAction<Class, MethodPtr> >
-InvokeWithoutArgs(Class* obj_ptr, MethodPtr method_ptr) {
- return MakePolymorphicAction(
- internal::InvokeMethodWithoutArgsAction<Class, MethodPtr>(
- obj_ptr, method_ptr));
-}
-
-// Creates an action that performs an_action and throws away its
-// result. In other words, it changes the return type of an_action to
-// void. an_action MUST NOT return void, or the code won't compile.
-template <typename A>
-inline internal::IgnoreResultAction<A> IgnoreResult(const A& an_action) {
- return internal::IgnoreResultAction<A>(an_action);
-}
-
-// Creates a reference wrapper for the given L-value. If necessary,
-// you can explicitly specify the type of the reference. For example,
-// suppose 'derived' is an object of type Derived, ByRef(derived)
-// would wrap a Derived&. If you want to wrap a const Base& instead,
-// where Base is a base class of Derived, just write:
-//
-// ByRef<const Base>(derived)
-template <typename T>
-inline internal::ReferenceWrapper<T> ByRef(T& l_value) { // NOLINT
- return internal::ReferenceWrapper<T>(l_value);
-}
-
-} // namespace testing
-
-#endif // GMOCK_INCLUDE_GMOCK_GMOCK_ACTIONS_H_
diff --git a/src/testing/include/gmock/gmock-cardinalities.h b/src/testing/include/gmock/gmock-cardinalities.h
deleted file mode 100644
index fc315f92..00000000
--- a/src/testing/include/gmock/gmock-cardinalities.h
+++ /dev/null
@@ -1,147 +0,0 @@
-// Copyright 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-// Google Mock - a framework for writing C++ mock classes.
-//
-// This file implements some commonly used cardinalities. More
-// cardinalities can be defined by the user implementing the
-// CardinalityInterface interface if necessary.
-
-#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_CARDINALITIES_H_
-#define GMOCK_INCLUDE_GMOCK_GMOCK_CARDINALITIES_H_
-
-#include <limits.h>
-#include <ostream> // NOLINT
-#include "gmock/internal/gmock-port.h"
-#include "gtest/gtest.h"
-
-namespace testing {
-
-// To implement a cardinality Foo, define:
-// 1. a class FooCardinality that implements the
-// CardinalityInterface interface, and
-// 2. a factory function that creates a Cardinality object from a
-// const FooCardinality*.
-//
-// The two-level delegation design follows that of Matcher, providing
-// consistency for extension developers. It also eases ownership
-// management as Cardinality objects can now be copied like plain values.
-
-// The implementation of a cardinality.
-class CardinalityInterface {
- public:
- virtual ~CardinalityInterface() {}
-
- // Conservative estimate on the lower/upper bound of the number of
- // calls allowed.
- virtual int ConservativeLowerBound() const { return 0; }
- virtual int ConservativeUpperBound() const { return INT_MAX; }
-
- // Returns true iff call_count calls will satisfy this cardinality.
- virtual bool IsSatisfiedByCallCount(int call_count) const = 0;
-
- // Returns true iff call_count calls will saturate this cardinality.
- virtual bool IsSaturatedByCallCount(int call_count) const = 0;
-
- // Describes self to an ostream.
- virtual void DescribeTo(::std::ostream* os) const = 0;
-};
-
-// A Cardinality is a copyable and IMMUTABLE (except by assignment)
-// object that specifies how many times a mock function is expected to
-// be called. The implementation of Cardinality is just a linked_ptr
-// to const CardinalityInterface, so copying is fairly cheap.
-// Don't inherit from Cardinality!
-class GTEST_API_ Cardinality {
- public:
- // Constructs a null cardinality. Needed for storing Cardinality
- // objects in STL containers.
- Cardinality() {}
-
- // Constructs a Cardinality from its implementation.
- explicit Cardinality(const CardinalityInterface* impl) : impl_(impl) {}
-
- // Conservative estimate on the lower/upper bound of the number of
- // calls allowed.
- int ConservativeLowerBound() const { return impl_->ConservativeLowerBound(); }
- int ConservativeUpperBound() const { return impl_->ConservativeUpperBound(); }
-
- // Returns true iff call_count calls will satisfy this cardinality.
- bool IsSatisfiedByCallCount(int call_count) const {
- return impl_->IsSatisfiedByCallCount(call_count);
- }
-
- // Returns true iff call_count calls will saturate this cardinality.
- bool IsSaturatedByCallCount(int call_count) const {
- return impl_->IsSaturatedByCallCount(call_count);
- }
-
- // Returns true iff call_count calls will over-saturate this
- // cardinality, i.e. exceed the maximum number of allowed calls.
- bool IsOverSaturatedByCallCount(int call_count) const {
- return impl_->IsSaturatedByCallCount(call_count) &&
- !impl_->IsSatisfiedByCallCount(call_count);
- }
-
- // Describes self to an ostream
- void DescribeTo(::std::ostream* os) const { impl_->DescribeTo(os); }
-
- // Describes the given actual call count to an ostream.
- static void DescribeActualCallCountTo(int actual_call_count,
- ::std::ostream* os);
-
- private:
- internal::linked_ptr<const CardinalityInterface> impl_;
-};
-
-// Creates a cardinality that allows at least n calls.
-GTEST_API_ Cardinality AtLeast(int n);
-
-// Creates a cardinality that allows at most n calls.
-GTEST_API_ Cardinality AtMost(int n);
-
-// Creates a cardinality that allows any number of calls.
-GTEST_API_ Cardinality AnyNumber();
-
-// Creates a cardinality that allows between min and max calls.
-GTEST_API_ Cardinality Between(int min, int max);
-
-// Creates a cardinality that allows exactly n calls.
-GTEST_API_ Cardinality Exactly(int n);
-
-// Creates a cardinality from its implementation.
-inline Cardinality MakeCardinality(const CardinalityInterface* c) {
- return Cardinality(c);
-}
-
-} // namespace testing
-
-#endif // GMOCK_INCLUDE_GMOCK_GMOCK_CARDINALITIES_H_
diff --git a/src/testing/include/gmock/gmock-generated-actions.h b/src/testing/include/gmock/gmock-generated-actions.h
deleted file mode 100644
index 2327393d..00000000
--- a/src/testing/include/gmock/gmock-generated-actions.h
+++ /dev/null
@@ -1,2415 +0,0 @@
-// This file was GENERATED by a script. DO NOT EDIT BY HAND!!!
-
-// Copyright 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-// Google Mock - a framework for writing C++ mock classes.
-//
-// This file implements some commonly used variadic actions.
-
-#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_
-#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_
-
-#include "gmock/gmock-actions.h"
-#include "gmock/internal/gmock-port.h"
-
-namespace testing {
-namespace internal {
-
-// InvokeHelper<F> knows how to unpack an N-tuple and invoke an N-ary
-// function or method with the unpacked values, where F is a function
-// type that takes N arguments.
-template <typename Result, typename ArgumentTuple>
-class InvokeHelper;
-
-template <typename R>
-class InvokeHelper<R, ::std::tr1::tuple<> > {
- public:
- template <typename Function>
- static R Invoke(Function function, const ::std::tr1::tuple<>&) {
- return function();
- }
-
- template <class Class, typename MethodPtr>
- static R InvokeMethod(Class* obj_ptr,
- MethodPtr method_ptr,
- const ::std::tr1::tuple<>&) {
- return (obj_ptr->*method_ptr)();
- }
-};
-
-template <typename R, typename A1>
-class InvokeHelper<R, ::std::tr1::tuple<A1> > {
- public:
- template <typename Function>
- static R Invoke(Function function, const ::std::tr1::tuple<A1>& args) {
- using ::std::tr1::get;
- return function(get<0>(args));
- }
-
- template <class Class, typename MethodPtr>
- static R InvokeMethod(Class* obj_ptr,
- MethodPtr method_ptr,
- const ::std::tr1::tuple<A1>& args) {
- using ::std::tr1::get;
- return (obj_ptr->*method_ptr)(get<0>(args));
- }
-};
-
-template <typename R, typename A1, typename A2>
-class InvokeHelper<R, ::std::tr1::tuple<A1, A2> > {
- public:
- template <typename Function>
- static R Invoke(Function function, const ::std::tr1::tuple<A1, A2>& args) {
- using ::std::tr1::get;
- return function(get<0>(args), get<1>(args));
- }
-
- template <class Class, typename MethodPtr>
- static R InvokeMethod(Class* obj_ptr,
- MethodPtr method_ptr,
- const ::std::tr1::tuple<A1, A2>& args) {
- using ::std::tr1::get;
- return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args));
- }
-};
-
-template <typename R, typename A1, typename A2, typename A3>
-class InvokeHelper<R, ::std::tr1::tuple<A1, A2, A3> > {
- public:
- template <typename Function>
- static R Invoke(Function function, const ::std::tr1::tuple<A1, A2,
- A3>& args) {
- using ::std::tr1::get;
- return function(get<0>(args), get<1>(args), get<2>(args));
- }
-
- template <class Class, typename MethodPtr>
- static R InvokeMethod(Class* obj_ptr,
- MethodPtr method_ptr,
- const ::std::tr1::tuple<A1, A2, A3>& args) {
- using ::std::tr1::get;
- return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), get<2>(args));
- }
-};
-
-template <typename R, typename A1, typename A2, typename A3, typename A4>
-class InvokeHelper<R, ::std::tr1::tuple<A1, A2, A3, A4> > {
- public:
- template <typename Function>
- static R Invoke(Function function, const ::std::tr1::tuple<A1, A2, A3,
- A4>& args) {
- using ::std::tr1::get;
- return function(get<0>(args), get<1>(args), get<2>(args), get<3>(args));
- }
-
- template <class Class, typename MethodPtr>
- static R InvokeMethod(Class* obj_ptr,
- MethodPtr method_ptr,
- const ::std::tr1::tuple<A1, A2, A3, A4>& args) {
- using ::std::tr1::get;
- return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), get<2>(args),
- get<3>(args));
- }
-};
-
-template <typename R, typename A1, typename A2, typename A3, typename A4,
- typename A5>
-class InvokeHelper<R, ::std::tr1::tuple<A1, A2, A3, A4, A5> > {
- public:
- template <typename Function>
- static R Invoke(Function function, const ::std::tr1::tuple<A1, A2, A3, A4,
- A5>& args) {
- using ::std::tr1::get;
- return function(get<0>(args), get<1>(args), get<2>(args), get<3>(args),
- get<4>(args));
- }
-
- template <class Class, typename MethodPtr>
- static R InvokeMethod(Class* obj_ptr,
- MethodPtr method_ptr,
- const ::std::tr1::tuple<A1, A2, A3, A4, A5>& args) {
- using ::std::tr1::get;
- return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), get<2>(args),
- get<3>(args), get<4>(args));
- }
-};
-
-template <typename R, typename A1, typename A2, typename A3, typename A4,
- typename A5, typename A6>
-class InvokeHelper<R, ::std::tr1::tuple<A1, A2, A3, A4, A5, A6> > {
- public:
- template <typename Function>
- static R Invoke(Function function, const ::std::tr1::tuple<A1, A2, A3, A4,
- A5, A6>& args) {
- using ::std::tr1::get;
- return function(get<0>(args), get<1>(args), get<2>(args), get<3>(args),
- get<4>(args), get<5>(args));
- }
-
- template <class Class, typename MethodPtr>
- static R InvokeMethod(Class* obj_ptr,
- MethodPtr method_ptr,
- const ::std::tr1::tuple<A1, A2, A3, A4, A5, A6>& args) {
- using ::std::tr1::get;
- return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), get<2>(args),
- get<3>(args), get<4>(args), get<5>(args));
- }
-};
-
-template <typename R, typename A1, typename A2, typename A3, typename A4,
- typename A5, typename A6, typename A7>
-class InvokeHelper<R, ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7> > {
- public:
- template <typename Function>
- static R Invoke(Function function, const ::std::tr1::tuple<A1, A2, A3, A4,
- A5, A6, A7>& args) {
- using ::std::tr1::get;
- return function(get<0>(args), get<1>(args), get<2>(args), get<3>(args),
- get<4>(args), get<5>(args), get<6>(args));
- }
-
- template <class Class, typename MethodPtr>
- static R InvokeMethod(Class* obj_ptr,
- MethodPtr method_ptr,
- const ::std::tr1::tuple<A1, A2, A3, A4, A5, A6,
- A7>& args) {
- using ::std::tr1::get;
- return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), get<2>(args),
- get<3>(args), get<4>(args), get<5>(args), get<6>(args));
- }
-};
-
-template <typename R, typename A1, typename A2, typename A3, typename A4,
- typename A5, typename A6, typename A7, typename A8>
-class InvokeHelper<R, ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7, A8> > {
- public:
- template <typename Function>
- static R Invoke(Function function, const ::std::tr1::tuple<A1, A2, A3, A4,
- A5, A6, A7, A8>& args) {
- using ::std::tr1::get;
- return function(get<0>(args), get<1>(args), get<2>(args), get<3>(args),
- get<4>(args), get<5>(args), get<6>(args), get<7>(args));
- }
-
- template <class Class, typename MethodPtr>
- static R InvokeMethod(Class* obj_ptr,
- MethodPtr method_ptr,
- const ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7,
- A8>& args) {
- using ::std::tr1::get;
- return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), get<2>(args),
- get<3>(args), get<4>(args), get<5>(args), get<6>(args), get<7>(args));
- }
-};
-
-template <typename R, typename A1, typename A2, typename A3, typename A4,
- typename A5, typename A6, typename A7, typename A8, typename A9>
-class InvokeHelper<R, ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9> > {
- public:
- template <typename Function>
- static R Invoke(Function function, const ::std::tr1::tuple<A1, A2, A3, A4,
- A5, A6, A7, A8, A9>& args) {
- using ::std::tr1::get;
- return function(get<0>(args), get<1>(args), get<2>(args), get<3>(args),
- get<4>(args), get<5>(args), get<6>(args), get<7>(args), get<8>(args));
- }
-
- template <class Class, typename MethodPtr>
- static R InvokeMethod(Class* obj_ptr,
- MethodPtr method_ptr,
- const ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7, A8,
- A9>& args) {
- using ::std::tr1::get;
- return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), get<2>(args),
- get<3>(args), get<4>(args), get<5>(args), get<6>(args), get<7>(args),
- get<8>(args));
- }
-};
-
-template <typename R, typename A1, typename A2, typename A3, typename A4,
- typename A5, typename A6, typename A7, typename A8, typename A9,
- typename A10>
-class InvokeHelper<R, ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9,
- A10> > {
- public:
- template <typename Function>
- static R Invoke(Function function, const ::std::tr1::tuple<A1, A2, A3, A4,
- A5, A6, A7, A8, A9, A10>& args) {
- using ::std::tr1::get;
- return function(get<0>(args), get<1>(args), get<2>(args), get<3>(args),
- get<4>(args), get<5>(args), get<6>(args), get<7>(args), get<8>(args),
- get<9>(args));
- }
-
- template <class Class, typename MethodPtr>
- static R InvokeMethod(Class* obj_ptr,
- MethodPtr method_ptr,
- const ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7, A8,
- A9, A10>& args) {
- using ::std::tr1::get;
- return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), get<2>(args),
- get<3>(args), get<4>(args), get<5>(args), get<6>(args), get<7>(args),
- get<8>(args), get<9>(args));
- }
-};
-
-// CallableHelper has static methods for invoking "callables",
-// i.e. function pointers and functors. It uses overloading to
-// provide a uniform interface for invoking different kinds of
-// callables. In particular, you can use:
-//
-// CallableHelper<R>::Call(callable, a1, a2, ..., an)
-//
-// to invoke an n-ary callable, where R is its return type. If an
-// argument, say a2, needs to be passed by reference, you should write
-// ByRef(a2) instead of a2 in the above expression.
-template <typename R>
-class CallableHelper {
- public:
- // Calls a nullary callable.
- template <typename Function>
- static R Call(Function function) { return function(); }
-
- // Calls a unary callable.
-
- // We deliberately pass a1 by value instead of const reference here
- // in case it is a C-string literal. If we had declared the
- // parameter as 'const A1& a1' and write Call(function, "Hi"), the
- // compiler would've thought A1 is 'char[3]', which causes trouble
- // when you need to copy a value of type A1. By declaring the
- // parameter as 'A1 a1', the compiler will correctly infer that A1
- // is 'const char*' when it sees Call(function, "Hi").
- //
- // Since this function is defined inline, the compiler can get rid
- // of the copying of the arguments. Therefore the performance won't
- // be hurt.
- template <typename Function, typename A1>
- static R Call(Function function, A1 a1) { return function(a1); }
-
- // Calls a binary callable.
- template <typename Function, typename A1, typename A2>
- static R Call(Function function, A1 a1, A2 a2) {
- return function(a1, a2);
- }
-
- // Calls a ternary callable.
- template <typename Function, typename A1, typename A2, typename A3>
- static R Call(Function function, A1 a1, A2 a2, A3 a3) {
- return function(a1, a2, a3);
- }
-
- // Calls a 4-ary callable.
- template <typename Function, typename A1, typename A2, typename A3,
- typename A4>
- static R Call(Function function, A1 a1, A2 a2, A3 a3, A4 a4) {
- return function(a1, a2, a3, a4);
- }
-
- // Calls a 5-ary callable.
- template <typename Function, typename A1, typename A2, typename A3,
- typename A4, typename A5>
- static R Call(Function function, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) {
- return function(a1, a2, a3, a4, a5);
- }
-
- // Calls a 6-ary callable.
- template <typename Function, typename A1, typename A2, typename A3,
- typename A4, typename A5, typename A6>
- static R Call(Function function, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) {
- return function(a1, a2, a3, a4, a5, a6);
- }
-
- // Calls a 7-ary callable.
- template <typename Function, typename A1, typename A2, typename A3,
- typename A4, typename A5, typename A6, typename A7>
- static R Call(Function function, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6,
- A7 a7) {
- return function(a1, a2, a3, a4, a5, a6, a7);
- }
-
- // Calls a 8-ary callable.
- template <typename Function, typename A1, typename A2, typename A3,
- typename A4, typename A5, typename A6, typename A7, typename A8>
- static R Call(Function function, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6,
- A7 a7, A8 a8) {
- return function(a1, a2, a3, a4, a5, a6, a7, a8);
- }
-
- // Calls a 9-ary callable.
- template <typename Function, typename A1, typename A2, typename A3,
- typename A4, typename A5, typename A6, typename A7, typename A8,
- typename A9>
- static R Call(Function function, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6,
- A7 a7, A8 a8, A9 a9) {
- return function(a1, a2, a3, a4, a5, a6, a7, a8, a9);
- }
-
- // Calls a 10-ary callable.
- template <typename Function, typename A1, typename A2, typename A3,
- typename A4, typename A5, typename A6, typename A7, typename A8,
- typename A9, typename A10>
- static R Call(Function function, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6,
- A7 a7, A8 a8, A9 a9, A10 a10) {
- return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);
- }
-}; // class CallableHelper
-
-// An INTERNAL macro for extracting the type of a tuple field. It's
-// subject to change without notice - DO NOT USE IN USER CODE!
-#define GMOCK_FIELD_(Tuple, N) \
- typename ::std::tr1::tuple_element<N, Tuple>::type
-
-// SelectArgs<Result, ArgumentTuple, k1, k2, ..., k_n>::type is the
-// type of an n-ary function whose i-th (1-based) argument type is the
-// k{i}-th (0-based) field of ArgumentTuple, which must be a tuple
-// type, and whose return type is Result. For example,
-// SelectArgs<int, ::std::tr1::tuple<bool, char, double, long>, 0, 3>::type
-// is int(bool, long).
-//
-// SelectArgs<Result, ArgumentTuple, k1, k2, ..., k_n>::Select(args)
-// returns the selected fields (k1, k2, ..., k_n) of args as a tuple.
-// For example,
-// SelectArgs<int, ::std::tr1::tuple<bool, char, double>, 2, 0>::Select(
-// ::std::tr1::make_tuple(true, 'a', 2.5))
-// returns ::std::tr1::tuple (2.5, true).
-//
-// The numbers in list k1, k2, ..., k_n must be >= 0, where n can be
-// in the range [0, 10]. Duplicates are allowed and they don't have
-// to be in an ascending or descending order.
-
-template <typename Result, typename ArgumentTuple, int k1, int k2, int k3,
- int k4, int k5, int k6, int k7, int k8, int k9, int k10>
-class SelectArgs {
- public:
- typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1),
- GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3),
- GMOCK_FIELD_(ArgumentTuple, k4), GMOCK_FIELD_(ArgumentTuple, k5),
- GMOCK_FIELD_(ArgumentTuple, k6), GMOCK_FIELD_(ArgumentTuple, k7),
- GMOCK_FIELD_(ArgumentTuple, k8), GMOCK_FIELD_(ArgumentTuple, k9),
- GMOCK_FIELD_(ArgumentTuple, k10));
- typedef typename Function<type>::ArgumentTuple SelectedArgs;
- static SelectedArgs Select(const ArgumentTuple& args) {
- using ::std::tr1::get;
- return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args),
- get<k4>(args), get<k5>(args), get<k6>(args), get<k7>(args),
- get<k8>(args), get<k9>(args), get<k10>(args));
- }
-};
-
-template <typename Result, typename ArgumentTuple>
-class SelectArgs<Result, ArgumentTuple,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1> {
- public:
- typedef Result type();
- typedef typename Function<type>::ArgumentTuple SelectedArgs;
- static SelectedArgs Select(const ArgumentTuple& /* args */) {
- using ::std::tr1::get;
- return SelectedArgs();
- }
-};
-
-template <typename Result, typename ArgumentTuple, int k1>
-class SelectArgs<Result, ArgumentTuple,
- k1, -1, -1, -1, -1, -1, -1, -1, -1, -1> {
- public:
- typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1));
- typedef typename Function<type>::ArgumentTuple SelectedArgs;
- static SelectedArgs Select(const ArgumentTuple& args) {
- using ::std::tr1::get;
- return SelectedArgs(get<k1>(args));
- }
-};
-
-template <typename Result, typename ArgumentTuple, int k1, int k2>
-class SelectArgs<Result, ArgumentTuple,
- k1, k2, -1, -1, -1, -1, -1, -1, -1, -1> {
- public:
- typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1),
- GMOCK_FIELD_(ArgumentTuple, k2));
- typedef typename Function<type>::ArgumentTuple SelectedArgs;
- static SelectedArgs Select(const ArgumentTuple& args) {
- using ::std::tr1::get;
- return SelectedArgs(get<k1>(args), get<k2>(args));
- }
-};
-
-template <typename Result, typename ArgumentTuple, int k1, int k2, int k3>
-class SelectArgs<Result, ArgumentTuple,
- k1, k2, k3, -1, -1, -1, -1, -1, -1, -1> {
- public:
- typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1),
- GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3));
- typedef typename Function<type>::ArgumentTuple SelectedArgs;
- static SelectedArgs Select(const ArgumentTuple& args) {
- using ::std::tr1::get;
- return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args));
- }
-};
-
-template <typename Result, typename ArgumentTuple, int k1, int k2, int k3,
- int k4>
-class SelectArgs<Result, ArgumentTuple,
- k1, k2, k3, k4, -1, -1, -1, -1, -1, -1> {
- public:
- typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1),
- GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3),
- GMOCK_FIELD_(ArgumentTuple, k4));
- typedef typename Function<type>::ArgumentTuple SelectedArgs;
- static SelectedArgs Select(const ArgumentTuple& args) {
- using ::std::tr1::get;
- return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args),
- get<k4>(args));
- }
-};
-
-template <typename Result, typename ArgumentTuple, int k1, int k2, int k3,
- int k4, int k5>
-class SelectArgs<Result, ArgumentTuple,
- k1, k2, k3, k4, k5, -1, -1, -1, -1, -1> {
- public:
- typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1),
- GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3),
- GMOCK_FIELD_(ArgumentTuple, k4), GMOCK_FIELD_(ArgumentTuple, k5));
- typedef typename Function<type>::ArgumentTuple SelectedArgs;
- static SelectedArgs Select(const ArgumentTuple& args) {
- using ::std::tr1::get;
- return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args),
- get<k4>(args), get<k5>(args));
- }
-};
-
-template <typename Result, typename ArgumentTuple, int k1, int k2, int k3,
- int k4, int k5, int k6>
-class SelectArgs<Result, ArgumentTuple,
- k1, k2, k3, k4, k5, k6, -1, -1, -1, -1> {
- public:
- typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1),
- GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3),
- GMOCK_FIELD_(ArgumentTuple, k4), GMOCK_FIELD_(ArgumentTuple, k5),
- GMOCK_FIELD_(ArgumentTuple, k6));
- typedef typename Function<type>::ArgumentTuple SelectedArgs;
- static SelectedArgs Select(const ArgumentTuple& args) {
- using ::std::tr1::get;
- return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args),
- get<k4>(args), get<k5>(args), get<k6>(args));
- }
-};
-
-template <typename Result, typename ArgumentTuple, int k1, int k2, int k3,
- int k4, int k5, int k6, int k7>
-class SelectArgs<Result, ArgumentTuple,
- k1, k2, k3, k4, k5, k6, k7, -1, -1, -1> {
- public:
- typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1),
- GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3),
- GMOCK_FIELD_(ArgumentTuple, k4), GMOCK_FIELD_(ArgumentTuple, k5),
- GMOCK_FIELD_(ArgumentTuple, k6), GMOCK_FIELD_(ArgumentTuple, k7));
- typedef typename Function<type>::ArgumentTuple SelectedArgs;
- static SelectedArgs Select(const ArgumentTuple& args) {
- using ::std::tr1::get;
- return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args),
- get<k4>(args), get<k5>(args), get<k6>(args), get<k7>(args));
- }
-};
-
-template <typename Result, typename ArgumentTuple, int k1, int k2, int k3,
- int k4, int k5, int k6, int k7, int k8>
-class SelectArgs<Result, ArgumentTuple,
- k1, k2, k3, k4, k5, k6, k7, k8, -1, -1> {
- public:
- typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1),
- GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3),
- GMOCK_FIELD_(ArgumentTuple, k4), GMOCK_FIELD_(ArgumentTuple, k5),
- GMOCK_FIELD_(ArgumentTuple, k6), GMOCK_FIELD_(ArgumentTuple, k7),
- GMOCK_FIELD_(ArgumentTuple, k8));
- typedef typename Function<type>::ArgumentTuple SelectedArgs;
- static SelectedArgs Select(const ArgumentTuple& args) {
- using ::std::tr1::get;
- return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args),
- get<k4>(args), get<k5>(args), get<k6>(args), get<k7>(args),
- get<k8>(args));
- }
-};
-
-template <typename Result, typename ArgumentTuple, int k1, int k2, int k3,
- int k4, int k5, int k6, int k7, int k8, int k9>
-class SelectArgs<Result, ArgumentTuple,
- k1, k2, k3, k4, k5, k6, k7, k8, k9, -1> {
- public:
- typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1),
- GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3),
- GMOCK_FIELD_(ArgumentTuple, k4), GMOCK_FIELD_(ArgumentTuple, k5),
- GMOCK_FIELD_(ArgumentTuple, k6), GMOCK_FIELD_(ArgumentTuple, k7),
- GMOCK_FIELD_(ArgumentTuple, k8), GMOCK_FIELD_(ArgumentTuple, k9));
- typedef typename Function<type>::ArgumentTuple SelectedArgs;
- static SelectedArgs Select(const ArgumentTuple& args) {
- using ::std::tr1::get;
- return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args),
- get<k4>(args), get<k5>(args), get<k6>(args), get<k7>(args),
- get<k8>(args), get<k9>(args));
- }
-};
-
-#undef GMOCK_FIELD_
-
-// Implements the WithArgs action.
-template <typename InnerAction, int k1 = -1, int k2 = -1, int k3 = -1,
- int k4 = -1, int k5 = -1, int k6 = -1, int k7 = -1, int k8 = -1,
- int k9 = -1, int k10 = -1>
-class WithArgsAction {
- public:
- explicit WithArgsAction(const InnerAction& action) : action_(action) {}
-
- template <typename F>
- operator Action<F>() const { return MakeAction(new Impl<F>(action_)); }
-
- private:
- template <typename F>
- class Impl : public ActionInterface<F> {
- public:
- typedef typename Function<F>::Result Result;
- typedef typename Function<F>::ArgumentTuple ArgumentTuple;
-
- explicit Impl(const InnerAction& action) : action_(action) {}
-
- virtual Result Perform(const ArgumentTuple& args) {
- return action_.Perform(SelectArgs<Result, ArgumentTuple, k1, k2, k3, k4,
- k5, k6, k7, k8, k9, k10>::Select(args));
- }
-
- private:
- typedef typename SelectArgs<Result, ArgumentTuple,
- k1, k2, k3, k4, k5, k6, k7, k8, k9, k10>::type InnerFunctionType;
-
- Action<InnerFunctionType> action_;
- };
-
- const InnerAction action_;
-
- GTEST_DISALLOW_ASSIGN_(WithArgsAction);
-};
-
-// A macro from the ACTION* family (defined later in this file)
-// defines an action that can be used in a mock function. Typically,
-// these actions only care about a subset of the arguments of the mock
-// function. For example, if such an action only uses the second
-// argument, it can be used in any mock function that takes >= 2
-// arguments where the type of the second argument is compatible.
-//
-// Therefore, the action implementation must be prepared to take more
-// arguments than it needs. The ExcessiveArg type is used to
-// represent those excessive arguments. In order to keep the compiler
-// error messages tractable, we define it in the testing namespace
-// instead of testing::internal. However, this is an INTERNAL TYPE
-// and subject to change without notice, so a user MUST NOT USE THIS
-// TYPE DIRECTLY.
-struct ExcessiveArg {};
-
-// A helper class needed for implementing the ACTION* macros.
-template <typename Result, class Impl>
-class ActionHelper {
- public:
- static Result Perform(Impl* impl, const ::std::tr1::tuple<>& args) {
- using ::std::tr1::get;
- return impl->template gmock_PerformImpl<>(args, ExcessiveArg(),
- ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
- ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
- ExcessiveArg());
- }
-
- template <typename A0>
- static Result Perform(Impl* impl, const ::std::tr1::tuple<A0>& args) {
- using ::std::tr1::get;
- return impl->template gmock_PerformImpl<A0>(args, get<0>(args),
- ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
- ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
- ExcessiveArg());
- }
-
- template <typename A0, typename A1>
- static Result Perform(Impl* impl, const ::std::tr1::tuple<A0, A1>& args) {
- using ::std::tr1::get;
- return impl->template gmock_PerformImpl<A0, A1>(args, get<0>(args),
- get<1>(args), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
- ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
- ExcessiveArg());
- }
-
- template <typename A0, typename A1, typename A2>
- static Result Perform(Impl* impl, const ::std::tr1::tuple<A0, A1, A2>& args) {
- using ::std::tr1::get;
- return impl->template gmock_PerformImpl<A0, A1, A2>(args, get<0>(args),
- get<1>(args), get<2>(args), ExcessiveArg(), ExcessiveArg(),
- ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
- ExcessiveArg());
- }
-
- template <typename A0, typename A1, typename A2, typename A3>
- static Result Perform(Impl* impl, const ::std::tr1::tuple<A0, A1, A2,
- A3>& args) {
- using ::std::tr1::get;
- return impl->template gmock_PerformImpl<A0, A1, A2, A3>(args, get<0>(args),
- get<1>(args), get<2>(args), get<3>(args), ExcessiveArg(),
- ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
- ExcessiveArg());
- }
-
- template <typename A0, typename A1, typename A2, typename A3, typename A4>
- static Result Perform(Impl* impl, const ::std::tr1::tuple<A0, A1, A2, A3,
- A4>& args) {
- using ::std::tr1::get;
- return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4>(args,
- get<0>(args), get<1>(args), get<2>(args), get<3>(args), get<4>(args),
- ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
- ExcessiveArg());
- }
-
- template <typename A0, typename A1, typename A2, typename A3, typename A4,
- typename A5>
- static Result Perform(Impl* impl, const ::std::tr1::tuple<A0, A1, A2, A3, A4,
- A5>& args) {
- using ::std::tr1::get;
- return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5>(args,
- get<0>(args), get<1>(args), get<2>(args), get<3>(args), get<4>(args),
- get<5>(args), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
- ExcessiveArg());
- }
-
- template <typename A0, typename A1, typename A2, typename A3, typename A4,
- typename A5, typename A6>
- static Result Perform(Impl* impl, const ::std::tr1::tuple<A0, A1, A2, A3, A4,
- A5, A6>& args) {
- using ::std::tr1::get;
- return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5, A6>(args,
- get<0>(args), get<1>(args), get<2>(args), get<3>(args), get<4>(args),
- get<5>(args), get<6>(args), ExcessiveArg(), ExcessiveArg(),
- ExcessiveArg());
- }
-
- template <typename A0, typename A1, typename A2, typename A3, typename A4,
- typename A5, typename A6, typename A7>
- static Result Perform(Impl* impl, const ::std::tr1::tuple<A0, A1, A2, A3, A4,
- A5, A6, A7>& args) {
- using ::std::tr1::get;
- return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5, A6,
- A7>(args, get<0>(args), get<1>(args), get<2>(args), get<3>(args),
- get<4>(args), get<5>(args), get<6>(args), get<7>(args), ExcessiveArg(),
- ExcessiveArg());
- }
-
- template <typename A0, typename A1, typename A2, typename A3, typename A4,
- typename A5, typename A6, typename A7, typename A8>
- static Result Perform(Impl* impl, const ::std::tr1::tuple<A0, A1, A2, A3, A4,
- A5, A6, A7, A8>& args) {
- using ::std::tr1::get;
- return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5, A6, A7,
- A8>(args, get<0>(args), get<1>(args), get<2>(args), get<3>(args),
- get<4>(args), get<5>(args), get<6>(args), get<7>(args), get<8>(args),
- ExcessiveArg());
- }
-
- template <typename A0, typename A1, typename A2, typename A3, typename A4,
- typename A5, typename A6, typename A7, typename A8, typename A9>
- static Result Perform(Impl* impl, const ::std::tr1::tuple<A0, A1, A2, A3, A4,
- A5, A6, A7, A8, A9>& args) {
- using ::std::tr1::get;
- return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5, A6, A7, A8,
- A9>(args, get<0>(args), get<1>(args), get<2>(args), get<3>(args),
- get<4>(args), get<5>(args), get<6>(args), get<7>(args), get<8>(args),
- get<9>(args));
- }
-};
-
-} // namespace internal
-
-// Various overloads for Invoke().
-
-// WithArgs<N1, N2, ..., Nk>(an_action) creates an action that passes
-// the selected arguments of the mock function to an_action and
-// performs it. It serves as an adaptor between actions with
-// different argument lists. C++ doesn't support default arguments for
-// function templates, so we have to overload it.
-template <int k1, typename InnerAction>
-inline internal::WithArgsAction<InnerAction, k1>
-WithArgs(const InnerAction& action) {
- return internal::WithArgsAction<InnerAction, k1>(action);
-}
-
-template <int k1, int k2, typename InnerAction>
-inline internal::WithArgsAction<InnerAction, k1, k2>
-WithArgs(const InnerAction& action) {
- return internal::WithArgsAction<InnerAction, k1, k2>(action);
-}
-
-template <int k1, int k2, int k3, typename InnerAction>
-inline internal::WithArgsAction<InnerAction, k1, k2, k3>
-WithArgs(const InnerAction& action) {
- return internal::WithArgsAction<InnerAction, k1, k2, k3>(action);
-}
-
-template <int k1, int k2, int k3, int k4, typename InnerAction>
-inline internal::WithArgsAction<InnerAction, k1, k2, k3, k4>
-WithArgs(const InnerAction& action) {
- return internal::WithArgsAction<InnerAction, k1, k2, k3, k4>(action);
-}
-
-template <int k1, int k2, int k3, int k4, int k5, typename InnerAction>
-inline internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5>
-WithArgs(const InnerAction& action) {
- return internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5>(action);
-}
-
-template <int k1, int k2, int k3, int k4, int k5, int k6, typename InnerAction>
-inline internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5, k6>
-WithArgs(const InnerAction& action) {
- return internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5, k6>(action);
-}
-
-template <int k1, int k2, int k3, int k4, int k5, int k6, int k7,
- typename InnerAction>
-inline internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5, k6, k7>
-WithArgs(const InnerAction& action) {
- return internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5, k6,
- k7>(action);
-}
-
-template <int k1, int k2, int k3, int k4, int k5, int k6, int k7, int k8,
- typename InnerAction>
-inline internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5, k6, k7, k8>
-WithArgs(const InnerAction& action) {
- return internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5, k6, k7,
- k8>(action);
-}
-
-template <int k1, int k2, int k3, int k4, int k5, int k6, int k7, int k8,
- int k9, typename InnerAction>
-inline internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5, k6, k7, k8, k9>
-WithArgs(const InnerAction& action) {
- return internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5, k6, k7, k8,
- k9>(action);
-}
-
-template <int k1, int k2, int k3, int k4, int k5, int k6, int k7, int k8,
- int k9, int k10, typename InnerAction>
-inline internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5, k6, k7, k8,
- k9, k10>
-WithArgs(const InnerAction& action) {
- return internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5, k6, k7, k8,
- k9, k10>(action);
-}
-
-// Creates an action that does actions a1, a2, ..., sequentially in
-// each invocation.
-template <typename Action1, typename Action2>
-inline internal::DoBothAction<Action1, Action2>
-DoAll(Action1 a1, Action2 a2) {
- return internal::DoBothAction<Action1, Action2>(a1, a2);
-}
-
-template <typename Action1, typename Action2, typename Action3>
-inline internal::DoBothAction<Action1, internal::DoBothAction<Action2,
- Action3> >
-DoAll(Action1 a1, Action2 a2, Action3 a3) {
- return DoAll(a1, DoAll(a2, a3));
-}
-
-template <typename Action1, typename Action2, typename Action3,
- typename Action4>
-inline internal::DoBothAction<Action1, internal::DoBothAction<Action2,
- internal::DoBothAction<Action3, Action4> > >
-DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4) {
- return DoAll(a1, DoAll(a2, a3, a4));
-}
-
-template <typename Action1, typename Action2, typename Action3,
- typename Action4, typename Action5>
-inline internal::DoBothAction<Action1, internal::DoBothAction<Action2,
- internal::DoBothAction<Action3, internal::DoBothAction<Action4,
- Action5> > > >
-DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5) {
- return DoAll(a1, DoAll(a2, a3, a4, a5));
-}
-
-template <typename Action1, typename Action2, typename Action3,
- typename Action4, typename Action5, typename Action6>
-inline internal::DoBothAction<Action1, internal::DoBothAction<Action2,
- internal::DoBothAction<Action3, internal::DoBothAction<Action4,
- internal::DoBothAction<Action5, Action6> > > > >
-DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6) {
- return DoAll(a1, DoAll(a2, a3, a4, a5, a6));
-}
-
-template <typename Action1, typename Action2, typename Action3,
- typename Action4, typename Action5, typename Action6, typename Action7>
-inline internal::DoBothAction<Action1, internal::DoBothAction<Action2,
- internal::DoBothAction<Action3, internal::DoBothAction<Action4,
- internal::DoBothAction<Action5, internal::DoBothAction<Action6,
- Action7> > > > > >
-DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
- Action7 a7) {
- return DoAll(a1, DoAll(a2, a3, a4, a5, a6, a7));
-}
-
-template <typename Action1, typename Action2, typename Action3,
- typename Action4, typename Action5, typename Action6, typename Action7,
- typename Action8>
-inline internal::DoBothAction<Action1, internal::DoBothAction<Action2,
- internal::DoBothAction<Action3, internal::DoBothAction<Action4,
- internal::DoBothAction<Action5, internal::DoBothAction<Action6,
- internal::DoBothAction<Action7, Action8> > > > > > >
-DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
- Action7 a7, Action8 a8) {
- return DoAll(a1, DoAll(a2, a3, a4, a5, a6, a7, a8));
-}
-
-template <typename Action1, typename Action2, typename Action3,
- typename Action4, typename Action5, typename Action6, typename Action7,
- typename Action8, typename Action9>
-inline internal::DoBothAction<Action1, internal::DoBothAction<Action2,
- internal::DoBothAction<Action3, internal::DoBothAction<Action4,
- internal::DoBothAction<Action5, internal::DoBothAction<Action6,
- internal::DoBothAction<Action7, internal::DoBothAction<Action8,
- Action9> > > > > > > >
-DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
- Action7 a7, Action8 a8, Action9 a9) {
- return DoAll(a1, DoAll(a2, a3, a4, a5, a6, a7, a8, a9));
-}
-
-template <typename Action1, typename Action2, typename Action3,
- typename Action4, typename Action5, typename Action6, typename Action7,
- typename Action8, typename Action9, typename Action10>
-inline internal::DoBothAction<Action1, internal::DoBothAction<Action2,
- internal::DoBothAction<Action3, internal::DoBothAction<Action4,
- internal::DoBothAction<Action5, internal::DoBothAction<Action6,
- internal::DoBothAction<Action7, internal::DoBothAction<Action8,
- internal::DoBothAction<Action9, Action10> > > > > > > > >
-DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
- Action7 a7, Action8 a8, Action9 a9, Action10 a10) {
- return DoAll(a1, DoAll(a2, a3, a4, a5, a6, a7, a8, a9, a10));
-}
-
-} // namespace testing
-
-// The ACTION* family of macros can be used in a namespace scope to
-// define custom actions easily. The syntax:
-//
-// ACTION(name) { statements; }
-//
-// will define an action with the given name that executes the
-// statements. The value returned by the statements will be used as
-// the return value of the action. Inside the statements, you can
-// refer to the K-th (0-based) argument of the mock function by
-// 'argK', and refer to its type by 'argK_type'. For example:
-//
-// ACTION(IncrementArg1) {
-// arg1_type temp = arg1;
-// return ++(*temp);
-// }
-//
-// allows you to write
-//
-// ...WillOnce(IncrementArg1());
-//
-// You can also refer to the entire argument tuple and its type by
-// 'args' and 'args_type', and refer to the mock function type and its
-// return type by 'function_type' and 'return_type'.
-//
-// Note that you don't need to specify the types of the mock function
-// arguments. However rest assured that your code is still type-safe:
-// you'll get a compiler error if *arg1 doesn't support the ++
-// operator, or if the type of ++(*arg1) isn't compatible with the
-// mock function's return type, for example.
-//
-// Sometimes you'll want to parameterize the action. For that you can use
-// another macro:
-//
-// ACTION_P(name, param_name) { statements; }
-//
-// For example:
-//
-// ACTION_P(Add, n) { return arg0 + n; }
-//
-// will allow you to write:
-//
-// ...WillOnce(Add(5));
-//
-// Note that you don't need to provide the type of the parameter
-// either. If you need to reference the type of a parameter named
-// 'foo', you can write 'foo_type'. For example, in the body of
-// ACTION_P(Add, n) above, you can write 'n_type' to refer to the type
-// of 'n'.
-//
-// We also provide ACTION_P2, ACTION_P3, ..., up to ACTION_P10 to support
-// multi-parameter actions.
-//
-// For the purpose of typing, you can view
-//
-// ACTION_Pk(Foo, p1, ..., pk) { ... }
-//
-// as shorthand for
-//
-// template <typename p1_type, ..., typename pk_type>
-// FooActionPk<p1_type, ..., pk_type> Foo(p1_type p1, ..., pk_type pk) { ... }
-//
-// In particular, you can provide the template type arguments
-// explicitly when invoking Foo(), as in Foo<long, bool>(5, false);
-// although usually you can rely on the compiler to infer the types
-// for you automatically. You can assign the result of expression
-// Foo(p1, ..., pk) to a variable of type FooActionPk<p1_type, ...,
-// pk_type>. This can be useful when composing actions.
-//
-// You can also overload actions with different numbers of parameters:
-//
-// ACTION_P(Plus, a) { ... }
-// ACTION_P2(Plus, a, b) { ... }
-//
-// While it's tempting to always use the ACTION* macros when defining
-// a new action, you should also consider implementing ActionInterface
-// or using MakePolymorphicAction() instead, especially if you need to
-// use the action a lot. While these approaches require more work,
-// they give you more control on the types of the mock function
-// arguments and the action parameters, which in general leads to
-// better compiler error messages that pay off in the long run. They
-// also allow overloading actions based on parameter types (as opposed
-// to just based on the number of parameters).
-//
-// CAVEAT:
-//
-// ACTION*() can only be used in a namespace scope. The reason is
-// that C++ doesn't yet allow function-local types to be used to
-// instantiate templates. The up-coming C++0x standard will fix this.
-// Once that's done, we'll consider supporting using ACTION*() inside
-// a function.
-//
-// MORE INFORMATION:
-//
-// To learn more about using these macros, please search for 'ACTION'
-// on http://code.google.com/p/googlemock/wiki/CookBook.
-
-// An internal macro needed for implementing ACTION*().
-#define GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_\
- const args_type& args GTEST_ATTRIBUTE_UNUSED_, \
- arg0_type arg0 GTEST_ATTRIBUTE_UNUSED_, \
- arg1_type arg1 GTEST_ATTRIBUTE_UNUSED_, \
- arg2_type arg2 GTEST_ATTRIBUTE_UNUSED_, \
- arg3_type arg3 GTEST_ATTRIBUTE_UNUSED_, \
- arg4_type arg4 GTEST_ATTRIBUTE_UNUSED_, \
- arg5_type arg5 GTEST_ATTRIBUTE_UNUSED_, \
- arg6_type arg6 GTEST_ATTRIBUTE_UNUSED_, \
- arg7_type arg7 GTEST_ATTRIBUTE_UNUSED_, \
- arg8_type arg8 GTEST_ATTRIBUTE_UNUSED_, \
- arg9_type arg9 GTEST_ATTRIBUTE_UNUSED_
-
-// Sometimes you want to give an action explicit template parameters
-// that cannot be inferred from its value parameters. ACTION() and
-// ACTION_P*() don't support that. ACTION_TEMPLATE() remedies that
-// and can be viewed as an extension to ACTION() and ACTION_P*().
-//
-// The syntax:
-//
-// ACTION_TEMPLATE(ActionName,
-// HAS_m_TEMPLATE_PARAMS(kind1, name1, ..., kind_m, name_m),
-// AND_n_VALUE_PARAMS(p1, ..., p_n)) { statements; }
-//
-// defines an action template that takes m explicit template
-// parameters and n value parameters. name_i is the name of the i-th
-// template parameter, and kind_i specifies whether it's a typename,
-// an integral constant, or a template. p_i is the name of the i-th
-// value parameter.
-//
-// Example:
-//
-// // DuplicateArg<k, T>(output) converts the k-th argument of the mock
-// // function to type T and copies it to *output.
-// ACTION_TEMPLATE(DuplicateArg,
-// HAS_2_TEMPLATE_PARAMS(int, k, typename, T),
-// AND_1_VALUE_PARAMS(output)) {
-// *output = T(std::tr1::get<k>(args));
-// }
-// ...
-// int n;
-// EXPECT_CALL(mock, Foo(_, _))
-// .WillOnce(DuplicateArg<1, unsigned char>(&n));
-//
-// To create an instance of an action template, write:
-//
-// ActionName<t1, ..., t_m>(v1, ..., v_n)
-//
-// where the ts are the template arguments and the vs are the value
-// arguments. The value argument types are inferred by the compiler.
-// If you want to explicitly specify the value argument types, you can
-// provide additional template arguments:
-//
-// ActionName<t1, ..., t_m, u1, ..., u_k>(v1, ..., v_n)
-//
-// where u_i is the desired type of v_i.
-//
-// ACTION_TEMPLATE and ACTION/ACTION_P* can be overloaded on the
-// number of value parameters, but not on the number of template
-// parameters. Without the restriction, the meaning of the following
-// is unclear:
-//
-// OverloadedAction<int, bool>(x);
-//
-// Are we using a single-template-parameter action where 'bool' refers
-// to the type of x, or are we using a two-template-parameter action
-// where the compiler is asked to infer the type of x?
-//
-// Implementation notes:
-//
-// GMOCK_INTERNAL_*_HAS_m_TEMPLATE_PARAMS and
-// GMOCK_INTERNAL_*_AND_n_VALUE_PARAMS are internal macros for
-// implementing ACTION_TEMPLATE. The main trick we use is to create
-// new macro invocations when expanding a macro. For example, we have
-//
-// #define ACTION_TEMPLATE(name, template_params, value_params)
-// ... GMOCK_INTERNAL_DECL_##template_params ...
-//
-// which causes ACTION_TEMPLATE(..., HAS_1_TEMPLATE_PARAMS(typename, T), ...)
-// to expand to
-//
-// ... GMOCK_INTERNAL_DECL_HAS_1_TEMPLATE_PARAMS(typename, T) ...
-//
-// Since GMOCK_INTERNAL_DECL_HAS_1_TEMPLATE_PARAMS is a macro, the
-// preprocessor will continue to expand it to
-//
-// ... typename T ...
-//
-// This technique conforms to the C++ standard and is portable. It
-// allows us to implement action templates using O(N) code, where N is
-// the maximum number of template/value parameters supported. Without
-// using it, we'd have to devote O(N^2) amount of code to implement all
-// combinations of m and n.
-
-// Declares the template parameters.
-#define GMOCK_INTERNAL_DECL_HAS_1_TEMPLATE_PARAMS(kind0, name0) kind0 name0
-#define GMOCK_INTERNAL_DECL_HAS_2_TEMPLATE_PARAMS(kind0, name0, kind1, \
- name1) kind0 name0, kind1 name1
-#define GMOCK_INTERNAL_DECL_HAS_3_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
- kind2, name2) kind0 name0, kind1 name1, kind2 name2
-#define GMOCK_INTERNAL_DECL_HAS_4_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
- kind2, name2, kind3, name3) kind0 name0, kind1 name1, kind2 name2, \
- kind3 name3
-#define GMOCK_INTERNAL_DECL_HAS_5_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
- kind2, name2, kind3, name3, kind4, name4) kind0 name0, kind1 name1, \
- kind2 name2, kind3 name3, kind4 name4
-#define GMOCK_INTERNAL_DECL_HAS_6_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
- kind2, name2, kind3, name3, kind4, name4, kind5, name5) kind0 name0, \
- kind1 name1, kind2 name2, kind3 name3, kind4 name4, kind5 name5
-#define GMOCK_INTERNAL_DECL_HAS_7_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
- kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, \
- name6) kind0 name0, kind1 name1, kind2 name2, kind3 name3, kind4 name4, \
- kind5 name5, kind6 name6
-#define GMOCK_INTERNAL_DECL_HAS_8_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
- kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, name6, \
- kind7, name7) kind0 name0, kind1 name1, kind2 name2, kind3 name3, \
- kind4 name4, kind5 name5, kind6 name6, kind7 name7
-#define GMOCK_INTERNAL_DECL_HAS_9_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
- kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, name6, \
- kind7, name7, kind8, name8) kind0 name0, kind1 name1, kind2 name2, \
- kind3 name3, kind4 name4, kind5 name5, kind6 name6, kind7 name7, \
- kind8 name8
-#define GMOCK_INTERNAL_DECL_HAS_10_TEMPLATE_PARAMS(kind0, name0, kind1, \
- name1, kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, \
- name6, kind7, name7, kind8, name8, kind9, name9) kind0 name0, \
- kind1 name1, kind2 name2, kind3 name3, kind4 name4, kind5 name5, \
- kind6 name6, kind7 name7, kind8 name8, kind9 name9
-
-// Lists the template parameters.
-#define GMOCK_INTERNAL_LIST_HAS_1_TEMPLATE_PARAMS(kind0, name0) name0
-#define GMOCK_INTERNAL_LIST_HAS_2_TEMPLATE_PARAMS(kind0, name0, kind1, \
- name1) name0, name1
-#define GMOCK_INTERNAL_LIST_HAS_3_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
- kind2, name2) name0, name1, name2
-#define GMOCK_INTERNAL_LIST_HAS_4_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
- kind2, name2, kind3, name3) name0, name1, name2, name3
-#define GMOCK_INTERNAL_LIST_HAS_5_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
- kind2, name2, kind3, name3, kind4, name4) name0, name1, name2, name3, \
- name4
-#define GMOCK_INTERNAL_LIST_HAS_6_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
- kind2, name2, kind3, name3, kind4, name4, kind5, name5) name0, name1, \
- name2, name3, name4, name5
-#define GMOCK_INTERNAL_LIST_HAS_7_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
- kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, \
- name6) name0, name1, name2, name3, name4, name5, name6
-#define GMOCK_INTERNAL_LIST_HAS_8_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
- kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, name6, \
- kind7, name7) name0, name1, name2, name3, name4, name5, name6, name7
-#define GMOCK_INTERNAL_LIST_HAS_9_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
- kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, name6, \
- kind7, name7, kind8, name8) name0, name1, name2, name3, name4, name5, \
- name6, name7, name8
-#define GMOCK_INTERNAL_LIST_HAS_10_TEMPLATE_PARAMS(kind0, name0, kind1, \
- name1, kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, \
- name6, kind7, name7, kind8, name8, kind9, name9) name0, name1, name2, \
- name3, name4, name5, name6, name7, name8, name9
-
-// Declares the types of value parameters.
-#define GMOCK_INTERNAL_DECL_TYPE_AND_0_VALUE_PARAMS()
-#define GMOCK_INTERNAL_DECL_TYPE_AND_1_VALUE_PARAMS(p0) , typename p0##_type
-#define GMOCK_INTERNAL_DECL_TYPE_AND_2_VALUE_PARAMS(p0, p1) , \
- typename p0##_type, typename p1##_type
-#define GMOCK_INTERNAL_DECL_TYPE_AND_3_VALUE_PARAMS(p0, p1, p2) , \
- typename p0##_type, typename p1##_type, typename p2##_type
-#define GMOCK_INTERNAL_DECL_TYPE_AND_4_VALUE_PARAMS(p0, p1, p2, p3) , \
- typename p0##_type, typename p1##_type, typename p2##_type, \
- typename p3##_type
-#define GMOCK_INTERNAL_DECL_TYPE_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4) , \
- typename p0##_type, typename p1##_type, typename p2##_type, \
- typename p3##_type, typename p4##_type
-#define GMOCK_INTERNAL_DECL_TYPE_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5) , \
- typename p0##_type, typename p1##_type, typename p2##_type, \
- typename p3##_type, typename p4##_type, typename p5##_type
-#define GMOCK_INTERNAL_DECL_TYPE_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
- p6) , typename p0##_type, typename p1##_type, typename p2##_type, \
- typename p3##_type, typename p4##_type, typename p5##_type, \
- typename p6##_type
-#define GMOCK_INTERNAL_DECL_TYPE_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
- p6, p7) , typename p0##_type, typename p1##_type, typename p2##_type, \
- typename p3##_type, typename p4##_type, typename p5##_type, \
- typename p6##_type, typename p7##_type
-#define GMOCK_INTERNAL_DECL_TYPE_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
- p6, p7, p8) , typename p0##_type, typename p1##_type, typename p2##_type, \
- typename p3##_type, typename p4##_type, typename p5##_type, \
- typename p6##_type, typename p7##_type, typename p8##_type
-#define GMOCK_INTERNAL_DECL_TYPE_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
- p6, p7, p8, p9) , typename p0##_type, typename p1##_type, \
- typename p2##_type, typename p3##_type, typename p4##_type, \
- typename p5##_type, typename p6##_type, typename p7##_type, \
- typename p8##_type, typename p9##_type
-
-// Initializes the value parameters.
-#define GMOCK_INTERNAL_INIT_AND_0_VALUE_PARAMS()\
- ()
-#define GMOCK_INTERNAL_INIT_AND_1_VALUE_PARAMS(p0)\
- (p0##_type gmock_p0) : p0(gmock_p0)
-#define GMOCK_INTERNAL_INIT_AND_2_VALUE_PARAMS(p0, p1)\
- (p0##_type gmock_p0, p1##_type gmock_p1) : p0(gmock_p0), p1(gmock_p1)
-#define GMOCK_INTERNAL_INIT_AND_3_VALUE_PARAMS(p0, p1, p2)\
- (p0##_type gmock_p0, p1##_type gmock_p1, \
- p2##_type gmock_p2) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2)
-#define GMOCK_INTERNAL_INIT_AND_4_VALUE_PARAMS(p0, p1, p2, p3)\
- (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
- p3##_type gmock_p3) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
- p3(gmock_p3)
-#define GMOCK_INTERNAL_INIT_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4)\
- (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
- p3##_type gmock_p3, p4##_type gmock_p4) : p0(gmock_p0), p1(gmock_p1), \
- p2(gmock_p2), p3(gmock_p3), p4(gmock_p4)
-#define GMOCK_INTERNAL_INIT_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5)\
- (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
- p3##_type gmock_p3, p4##_type gmock_p4, \
- p5##_type gmock_p5) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
- p3(gmock_p3), p4(gmock_p4), p5(gmock_p5)
-#define GMOCK_INTERNAL_INIT_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6)\
- (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
- p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
- p6##_type gmock_p6) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
- p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6)
-#define GMOCK_INTERNAL_INIT_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7)\
- (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
- p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
- p6##_type gmock_p6, p7##_type gmock_p7) : p0(gmock_p0), p1(gmock_p1), \
- p2(gmock_p2), p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), \
- p7(gmock_p7)
-#define GMOCK_INTERNAL_INIT_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
- p7, p8)\
- (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
- p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
- p6##_type gmock_p6, p7##_type gmock_p7, \
- p8##_type gmock_p8) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
- p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), p7(gmock_p7), \
- p8(gmock_p8)
-#define GMOCK_INTERNAL_INIT_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
- p7, p8, p9)\
- (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
- p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
- p6##_type gmock_p6, p7##_type gmock_p7, p8##_type gmock_p8, \
- p9##_type gmock_p9) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
- p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), p7(gmock_p7), \
- p8(gmock_p8), p9(gmock_p9)
-
-// Declares the fields for storing the value parameters.
-#define GMOCK_INTERNAL_DEFN_AND_0_VALUE_PARAMS()
-#define GMOCK_INTERNAL_DEFN_AND_1_VALUE_PARAMS(p0) p0##_type p0;
-#define GMOCK_INTERNAL_DEFN_AND_2_VALUE_PARAMS(p0, p1) p0##_type p0; \
- p1##_type p1;
-#define GMOCK_INTERNAL_DEFN_AND_3_VALUE_PARAMS(p0, p1, p2) p0##_type p0; \
- p1##_type p1; p2##_type p2;
-#define GMOCK_INTERNAL_DEFN_AND_4_VALUE_PARAMS(p0, p1, p2, p3) p0##_type p0; \
- p1##_type p1; p2##_type p2; p3##_type p3;
-#define GMOCK_INTERNAL_DEFN_AND_5_VALUE_PARAMS(p0, p1, p2, p3, \
- p4) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; p4##_type p4;
-#define GMOCK_INTERNAL_DEFN_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, \
- p5) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; p4##_type p4; \
- p5##_type p5;
-#define GMOCK_INTERNAL_DEFN_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
- p6) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; p4##_type p4; \
- p5##_type p5; p6##_type p6;
-#define GMOCK_INTERNAL_DEFN_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
- p7) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; p4##_type p4; \
- p5##_type p5; p6##_type p6; p7##_type p7;
-#define GMOCK_INTERNAL_DEFN_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
- p7, p8) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; \
- p4##_type p4; p5##_type p5; p6##_type p6; p7##_type p7; p8##_type p8;
-#define GMOCK_INTERNAL_DEFN_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
- p7, p8, p9) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; \
- p4##_type p4; p5##_type p5; p6##_type p6; p7##_type p7; p8##_type p8; \
- p9##_type p9;
-
-// Lists the value parameters.
-#define GMOCK_INTERNAL_LIST_AND_0_VALUE_PARAMS()
-#define GMOCK_INTERNAL_LIST_AND_1_VALUE_PARAMS(p0) p0
-#define GMOCK_INTERNAL_LIST_AND_2_VALUE_PARAMS(p0, p1) p0, p1
-#define GMOCK_INTERNAL_LIST_AND_3_VALUE_PARAMS(p0, p1, p2) p0, p1, p2
-#define GMOCK_INTERNAL_LIST_AND_4_VALUE_PARAMS(p0, p1, p2, p3) p0, p1, p2, p3
-#define GMOCK_INTERNAL_LIST_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4) p0, p1, \
- p2, p3, p4
-#define GMOCK_INTERNAL_LIST_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5) p0, \
- p1, p2, p3, p4, p5
-#define GMOCK_INTERNAL_LIST_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
- p6) p0, p1, p2, p3, p4, p5, p6
-#define GMOCK_INTERNAL_LIST_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
- p7) p0, p1, p2, p3, p4, p5, p6, p7
-#define GMOCK_INTERNAL_LIST_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
- p7, p8) p0, p1, p2, p3, p4, p5, p6, p7, p8
-#define GMOCK_INTERNAL_LIST_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
- p7, p8, p9) p0, p1, p2, p3, p4, p5, p6, p7, p8, p9
-
-// Lists the value parameter types.
-#define GMOCK_INTERNAL_LIST_TYPE_AND_0_VALUE_PARAMS()
-#define GMOCK_INTERNAL_LIST_TYPE_AND_1_VALUE_PARAMS(p0) , p0##_type
-#define GMOCK_INTERNAL_LIST_TYPE_AND_2_VALUE_PARAMS(p0, p1) , p0##_type, \
- p1##_type
-#define GMOCK_INTERNAL_LIST_TYPE_AND_3_VALUE_PARAMS(p0, p1, p2) , p0##_type, \
- p1##_type, p2##_type
-#define GMOCK_INTERNAL_LIST_TYPE_AND_4_VALUE_PARAMS(p0, p1, p2, p3) , \
- p0##_type, p1##_type, p2##_type, p3##_type
-#define GMOCK_INTERNAL_LIST_TYPE_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4) , \
- p0##_type, p1##_type, p2##_type, p3##_type, p4##_type
-#define GMOCK_INTERNAL_LIST_TYPE_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5) , \
- p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, p5##_type
-#define GMOCK_INTERNAL_LIST_TYPE_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
- p6) , p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, p5##_type, \
- p6##_type
-#define GMOCK_INTERNAL_LIST_TYPE_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
- p6, p7) , p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
- p5##_type, p6##_type, p7##_type
-#define GMOCK_INTERNAL_LIST_TYPE_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
- p6, p7, p8) , p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
- p5##_type, p6##_type, p7##_type, p8##_type
-#define GMOCK_INTERNAL_LIST_TYPE_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
- p6, p7, p8, p9) , p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
- p5##_type, p6##_type, p7##_type, p8##_type, p9##_type
-
-// Declares the value parameters.
-#define GMOCK_INTERNAL_DECL_AND_0_VALUE_PARAMS()
-#define GMOCK_INTERNAL_DECL_AND_1_VALUE_PARAMS(p0) p0##_type p0
-#define GMOCK_INTERNAL_DECL_AND_2_VALUE_PARAMS(p0, p1) p0##_type p0, \
- p1##_type p1
-#define GMOCK_INTERNAL_DECL_AND_3_VALUE_PARAMS(p0, p1, p2) p0##_type p0, \
- p1##_type p1, p2##_type p2
-#define GMOCK_INTERNAL_DECL_AND_4_VALUE_PARAMS(p0, p1, p2, p3) p0##_type p0, \
- p1##_type p1, p2##_type p2, p3##_type p3
-#define GMOCK_INTERNAL_DECL_AND_5_VALUE_PARAMS(p0, p1, p2, p3, \
- p4) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4
-#define GMOCK_INTERNAL_DECL_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, \
- p5) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, \
- p5##_type p5
-#define GMOCK_INTERNAL_DECL_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
- p6) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, \
- p5##_type p5, p6##_type p6
-#define GMOCK_INTERNAL_DECL_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
- p7) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, \
- p5##_type p5, p6##_type p6, p7##_type p7
-#define GMOCK_INTERNAL_DECL_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
- p7, p8) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
- p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, p8##_type p8
-#define GMOCK_INTERNAL_DECL_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
- p7, p8, p9) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
- p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, p8##_type p8, \
- p9##_type p9
-
-// The suffix of the class template implementing the action template.
-#define GMOCK_INTERNAL_COUNT_AND_0_VALUE_PARAMS()
-#define GMOCK_INTERNAL_COUNT_AND_1_VALUE_PARAMS(p0) P
-#define GMOCK_INTERNAL_COUNT_AND_2_VALUE_PARAMS(p0, p1) P2
-#define GMOCK_INTERNAL_COUNT_AND_3_VALUE_PARAMS(p0, p1, p2) P3
-#define GMOCK_INTERNAL_COUNT_AND_4_VALUE_PARAMS(p0, p1, p2, p3) P4
-#define GMOCK_INTERNAL_COUNT_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4) P5
-#define GMOCK_INTERNAL_COUNT_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5) P6
-#define GMOCK_INTERNAL_COUNT_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6) P7
-#define GMOCK_INTERNAL_COUNT_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
- p7) P8
-#define GMOCK_INTERNAL_COUNT_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
- p7, p8) P9
-#define GMOCK_INTERNAL_COUNT_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
- p7, p8, p9) P10
-
-// The name of the class template implementing the action template.
-#define GMOCK_ACTION_CLASS_(name, value_params)\
- GTEST_CONCAT_TOKEN_(name##Action, GMOCK_INTERNAL_COUNT_##value_params)
-
-#define ACTION_TEMPLATE(name, template_params, value_params)\
- template <GMOCK_INTERNAL_DECL_##template_params\
- GMOCK_INTERNAL_DECL_TYPE_##value_params>\
- class GMOCK_ACTION_CLASS_(name, value_params) {\
- public:\
- GMOCK_ACTION_CLASS_(name, value_params)\
- GMOCK_INTERNAL_INIT_##value_params {}\
- template <typename F>\
- class gmock_Impl : public ::testing::ActionInterface<F> {\
- public:\
- typedef F function_type;\
- typedef typename ::testing::internal::Function<F>::Result return_type;\
- typedef typename ::testing::internal::Function<F>::ArgumentTuple\
- args_type;\
- explicit gmock_Impl GMOCK_INTERNAL_INIT_##value_params {}\
- virtual return_type Perform(const args_type& args) {\
- return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
- Perform(this, args);\
- }\
- template <typename arg0_type, typename arg1_type, typename arg2_type, \
- typename arg3_type, typename arg4_type, typename arg5_type, \
- typename arg6_type, typename arg7_type, typename arg8_type, \
- typename arg9_type>\
- return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
- arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
- arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
- arg9_type arg9) const;\
- GMOCK_INTERNAL_DEFN_##value_params\
- private:\
- GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
- };\
- template <typename F> operator ::testing::Action<F>() const {\
- return ::testing::Action<F>(\
- new gmock_Impl<F>(GMOCK_INTERNAL_LIST_##value_params));\
- }\
- GMOCK_INTERNAL_DEFN_##value_params\
- private:\
- GTEST_DISALLOW_ASSIGN_(GMOCK_ACTION_CLASS_(name, value_params));\
- };\
- template <GMOCK_INTERNAL_DECL_##template_params\
- GMOCK_INTERNAL_DECL_TYPE_##value_params>\
- inline GMOCK_ACTION_CLASS_(name, value_params)<\
- GMOCK_INTERNAL_LIST_##template_params\
- GMOCK_INTERNAL_LIST_TYPE_##value_params> name(\
- GMOCK_INTERNAL_DECL_##value_params) {\
- return GMOCK_ACTION_CLASS_(name, value_params)<\
- GMOCK_INTERNAL_LIST_##template_params\
- GMOCK_INTERNAL_LIST_TYPE_##value_params>(\
- GMOCK_INTERNAL_LIST_##value_params);\
- }\
- template <GMOCK_INTERNAL_DECL_##template_params\
- GMOCK_INTERNAL_DECL_TYPE_##value_params>\
- template <typename F>\
- template <typename arg0_type, typename arg1_type, typename arg2_type, \
- typename arg3_type, typename arg4_type, typename arg5_type, \
- typename arg6_type, typename arg7_type, typename arg8_type, \
- typename arg9_type>\
- typename ::testing::internal::Function<F>::Result\
- GMOCK_ACTION_CLASS_(name, value_params)<\
- GMOCK_INTERNAL_LIST_##template_params\
- GMOCK_INTERNAL_LIST_TYPE_##value_params>::gmock_Impl<F>::\
- gmock_PerformImpl(\
- GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
-
-#define ACTION(name)\
- class name##Action {\
- public:\
- name##Action() {}\
- template <typename F>\
- class gmock_Impl : public ::testing::ActionInterface<F> {\
- public:\
- typedef F function_type;\
- typedef typename ::testing::internal::Function<F>::Result return_type;\
- typedef typename ::testing::internal::Function<F>::ArgumentTuple\
- args_type;\
- gmock_Impl() {}\
- virtual return_type Perform(const args_type& args) {\
- return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
- Perform(this, args);\
- }\
- template <typename arg0_type, typename arg1_type, typename arg2_type, \
- typename arg3_type, typename arg4_type, typename arg5_type, \
- typename arg6_type, typename arg7_type, typename arg8_type, \
- typename arg9_type>\
- return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
- arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
- arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
- arg9_type arg9) const;\
- private:\
- GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
- };\
- template <typename F> operator ::testing::Action<F>() const {\
- return ::testing::Action<F>(new gmock_Impl<F>());\
- }\
- private:\
- GTEST_DISALLOW_ASSIGN_(name##Action);\
- };\
- inline name##Action name() {\
- return name##Action();\
- }\
- template <typename F>\
- template <typename arg0_type, typename arg1_type, typename arg2_type, \
- typename arg3_type, typename arg4_type, typename arg5_type, \
- typename arg6_type, typename arg7_type, typename arg8_type, \
- typename arg9_type>\
- typename ::testing::internal::Function<F>::Result\
- name##Action::gmock_Impl<F>::gmock_PerformImpl(\
- GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
-
-#define ACTION_P(name, p0)\
- template <typename p0##_type>\
- class name##ActionP {\
- public:\
- name##ActionP(p0##_type gmock_p0) : p0(gmock_p0) {}\
- template <typename F>\
- class gmock_Impl : public ::testing::ActionInterface<F> {\
- public:\
- typedef F function_type;\
- typedef typename ::testing::internal::Function<F>::Result return_type;\
- typedef typename ::testing::internal::Function<F>::ArgumentTuple\
- args_type;\
- explicit gmock_Impl(p0##_type gmock_p0) : p0(gmock_p0) {}\
- virtual return_type Perform(const args_type& args) {\
- return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
- Perform(this, args);\
- }\
- template <typename arg0_type, typename arg1_type, typename arg2_type, \
- typename arg3_type, typename arg4_type, typename arg5_type, \
- typename arg6_type, typename arg7_type, typename arg8_type, \
- typename arg9_type>\
- return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
- arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
- arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
- arg9_type arg9) const;\
- p0##_type p0;\
- private:\
- GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
- };\
- template <typename F> operator ::testing::Action<F>() const {\
- return ::testing::Action<F>(new gmock_Impl<F>(p0));\
- }\
- p0##_type p0;\
- private:\
- GTEST_DISALLOW_ASSIGN_(name##ActionP);\
- };\
- template <typename p0##_type>\
- inline name##ActionP<p0##_type> name(p0##_type p0) {\
- return name##ActionP<p0##_type>(p0);\
- }\
- template <typename p0##_type>\
- template <typename F>\
- template <typename arg0_type, typename arg1_type, typename arg2_type, \
- typename arg3_type, typename arg4_type, typename arg5_type, \
- typename arg6_type, typename arg7_type, typename arg8_type, \
- typename arg9_type>\
- typename ::testing::internal::Function<F>::Result\
- name##ActionP<p0##_type>::gmock_Impl<F>::gmock_PerformImpl(\
- GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
-
-#define ACTION_P2(name, p0, p1)\
- template <typename p0##_type, typename p1##_type>\
- class name##ActionP2 {\
- public:\
- name##ActionP2(p0##_type gmock_p0, p1##_type gmock_p1) : p0(gmock_p0), \
- p1(gmock_p1) {}\
- template <typename F>\
- class gmock_Impl : public ::testing::ActionInterface<F> {\
- public:\
- typedef F function_type;\
- typedef typename ::testing::internal::Function<F>::Result return_type;\
- typedef typename ::testing::internal::Function<F>::ArgumentTuple\
- args_type;\
- gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1) : p0(gmock_p0), \
- p1(gmock_p1) {}\
- virtual return_type Perform(const args_type& args) {\
- return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
- Perform(this, args);\
- }\
- template <typename arg0_type, typename arg1_type, typename arg2_type, \
- typename arg3_type, typename arg4_type, typename arg5_type, \
- typename arg6_type, typename arg7_type, typename arg8_type, \
- typename arg9_type>\
- return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
- arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
- arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
- arg9_type arg9) const;\
- p0##_type p0;\
- p1##_type p1;\
- private:\
- GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
- };\
- template <typename F> operator ::testing::Action<F>() const {\
- return ::testing::Action<F>(new gmock_Impl<F>(p0, p1));\
- }\
- p0##_type p0;\
- p1##_type p1;\
- private:\
- GTEST_DISALLOW_ASSIGN_(name##ActionP2);\
- };\
- template <typename p0##_type, typename p1##_type>\
- inline name##ActionP2<p0##_type, p1##_type> name(p0##_type p0, \
- p1##_type p1) {\
- return name##ActionP2<p0##_type, p1##_type>(p0, p1);\
- }\
- template <typename p0##_type, typename p1##_type>\
- template <typename F>\
- template <typename arg0_type, typename arg1_type, typename arg2_type, \
- typename arg3_type, typename arg4_type, typename arg5_type, \
- typename arg6_type, typename arg7_type, typename arg8_type, \
- typename arg9_type>\
- typename ::testing::internal::Function<F>::Result\
- name##ActionP2<p0##_type, p1##_type>::gmock_Impl<F>::gmock_PerformImpl(\
- GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
-
-#define ACTION_P3(name, p0, p1, p2)\
- template <typename p0##_type, typename p1##_type, typename p2##_type>\
- class name##ActionP3 {\
- public:\
- name##ActionP3(p0##_type gmock_p0, p1##_type gmock_p1, \
- p2##_type gmock_p2) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2) {}\
- template <typename F>\
- class gmock_Impl : public ::testing::ActionInterface<F> {\
- public:\
- typedef F function_type;\
- typedef typename ::testing::internal::Function<F>::Result return_type;\
- typedef typename ::testing::internal::Function<F>::ArgumentTuple\
- args_type;\
- gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, \
- p2##_type gmock_p2) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2) {}\
- virtual return_type Perform(const args_type& args) {\
- return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
- Perform(this, args);\
- }\
- template <typename arg0_type, typename arg1_type, typename arg2_type, \
- typename arg3_type, typename arg4_type, typename arg5_type, \
- typename arg6_type, typename arg7_type, typename arg8_type, \
- typename arg9_type>\
- return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
- arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
- arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
- arg9_type arg9) const;\
- p0##_type p0;\
- p1##_type p1;\
- p2##_type p2;\
- private:\
- GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
- };\
- template <typename F> operator ::testing::Action<F>() const {\
- return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2));\
- }\
- p0##_type p0;\
- p1##_type p1;\
- p2##_type p2;\
- private:\
- GTEST_DISALLOW_ASSIGN_(name##ActionP3);\
- };\
- template <typename p0##_type, typename p1##_type, typename p2##_type>\
- inline name##ActionP3<p0##_type, p1##_type, p2##_type> name(p0##_type p0, \
- p1##_type p1, p2##_type p2) {\
- return name##ActionP3<p0##_type, p1##_type, p2##_type>(p0, p1, p2);\
- }\
- template <typename p0##_type, typename p1##_type, typename p2##_type>\
- template <typename F>\
- template <typename arg0_type, typename arg1_type, typename arg2_type, \
- typename arg3_type, typename arg4_type, typename arg5_type, \
- typename arg6_type, typename arg7_type, typename arg8_type, \
- typename arg9_type>\
- typename ::testing::internal::Function<F>::Result\
- name##ActionP3<p0##_type, p1##_type, \
- p2##_type>::gmock_Impl<F>::gmock_PerformImpl(\
- GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
-
-#define ACTION_P4(name, p0, p1, p2, p3)\
- template <typename p0##_type, typename p1##_type, typename p2##_type, \
- typename p3##_type>\
- class name##ActionP4 {\
- public:\
- name##ActionP4(p0##_type gmock_p0, p1##_type gmock_p1, \
- p2##_type gmock_p2, p3##_type gmock_p3) : p0(gmock_p0), p1(gmock_p1), \
- p2(gmock_p2), p3(gmock_p3) {}\
- template <typename F>\
- class gmock_Impl : public ::testing::ActionInterface<F> {\
- public:\
- typedef F function_type;\
- typedef typename ::testing::internal::Function<F>::Result return_type;\
- typedef typename ::testing::internal::Function<F>::ArgumentTuple\
- args_type;\
- gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
- p3##_type gmock_p3) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
- p3(gmock_p3) {}\
- virtual return_type Perform(const args_type& args) {\
- return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
- Perform(this, args);\
- }\
- template <typename arg0_type, typename arg1_type, typename arg2_type, \
- typename arg3_type, typename arg4_type, typename arg5_type, \
- typename arg6_type, typename arg7_type, typename arg8_type, \
- typename arg9_type>\
- return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
- arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
- arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
- arg9_type arg9) const;\
- p0##_type p0;\
- p1##_type p1;\
- p2##_type p2;\
- p3##_type p3;\
- private:\
- GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
- };\
- template <typename F> operator ::testing::Action<F>() const {\
- return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2, p3));\
- }\
- p0##_type p0;\
- p1##_type p1;\
- p2##_type p2;\
- p3##_type p3;\
- private:\
- GTEST_DISALLOW_ASSIGN_(name##ActionP4);\
- };\
- template <typename p0##_type, typename p1##_type, typename p2##_type, \
- typename p3##_type>\
- inline name##ActionP4<p0##_type, p1##_type, p2##_type, \
- p3##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, \
- p3##_type p3) {\
- return name##ActionP4<p0##_type, p1##_type, p2##_type, p3##_type>(p0, p1, \
- p2, p3);\
- }\
- template <typename p0##_type, typename p1##_type, typename p2##_type, \
- typename p3##_type>\
- template <typename F>\
- template <typename arg0_type, typename arg1_type, typename arg2_type, \
- typename arg3_type, typename arg4_type, typename arg5_type, \
- typename arg6_type, typename arg7_type, typename arg8_type, \
- typename arg9_type>\
- typename ::testing::internal::Function<F>::Result\
- name##ActionP4<p0##_type, p1##_type, p2##_type, \
- p3##_type>::gmock_Impl<F>::gmock_PerformImpl(\
- GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
-
-#define ACTION_P5(name, p0, p1, p2, p3, p4)\
- template <typename p0##_type, typename p1##_type, typename p2##_type, \
- typename p3##_type, typename p4##_type>\
- class name##ActionP5 {\
- public:\
- name##ActionP5(p0##_type gmock_p0, p1##_type gmock_p1, \
- p2##_type gmock_p2, p3##_type gmock_p3, \
- p4##_type gmock_p4) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
- p3(gmock_p3), p4(gmock_p4) {}\
- template <typename F>\
- class gmock_Impl : public ::testing::ActionInterface<F> {\
- public:\
- typedef F function_type;\
- typedef typename ::testing::internal::Function<F>::Result return_type;\
- typedef typename ::testing::internal::Function<F>::ArgumentTuple\
- args_type;\
- gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
- p3##_type gmock_p3, p4##_type gmock_p4) : p0(gmock_p0), \
- p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), p4(gmock_p4) {}\
- virtual return_type Perform(const args_type& args) {\
- return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
- Perform(this, args);\
- }\
- template <typename arg0_type, typename arg1_type, typename arg2_type, \
- typename arg3_type, typename arg4_type, typename arg5_type, \
- typename arg6_type, typename arg7_type, typename arg8_type, \
- typename arg9_type>\
- return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
- arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
- arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
- arg9_type arg9) const;\
- p0##_type p0;\
- p1##_type p1;\
- p2##_type p2;\
- p3##_type p3;\
- p4##_type p4;\
- private:\
- GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
- };\
- template <typename F> operator ::testing::Action<F>() const {\
- return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2, p3, p4));\
- }\
- p0##_type p0;\
- p1##_type p1;\
- p2##_type p2;\
- p3##_type p3;\
- p4##_type p4;\
- private:\
- GTEST_DISALLOW_ASSIGN_(name##ActionP5);\
- };\
- template <typename p0##_type, typename p1##_type, typename p2##_type, \
- typename p3##_type, typename p4##_type>\
- inline name##ActionP5<p0##_type, p1##_type, p2##_type, p3##_type, \
- p4##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
- p4##_type p4) {\
- return name##ActionP5<p0##_type, p1##_type, p2##_type, p3##_type, \
- p4##_type>(p0, p1, p2, p3, p4);\
- }\
- template <typename p0##_type, typename p1##_type, typename p2##_type, \
- typename p3##_type, typename p4##_type>\
- template <typename F>\
- template <typename arg0_type, typename arg1_type, typename arg2_type, \
- typename arg3_type, typename arg4_type, typename arg5_type, \
- typename arg6_type, typename arg7_type, typename arg8_type, \
- typename arg9_type>\
- typename ::testing::internal::Function<F>::Result\
- name##ActionP5<p0##_type, p1##_type, p2##_type, p3##_type, \
- p4##_type>::gmock_Impl<F>::gmock_PerformImpl(\
- GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
-
-#define ACTION_P6(name, p0, p1, p2, p3, p4, p5)\
- template <typename p0##_type, typename p1##_type, typename p2##_type, \
- typename p3##_type, typename p4##_type, typename p5##_type>\
- class name##ActionP6 {\
- public:\
- name##ActionP6(p0##_type gmock_p0, p1##_type gmock_p1, \
- p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
- p5##_type gmock_p5) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
- p3(gmock_p3), p4(gmock_p4), p5(gmock_p5) {}\
- template <typename F>\
- class gmock_Impl : public ::testing::ActionInterface<F> {\
- public:\
- typedef F function_type;\
- typedef typename ::testing::internal::Function<F>::Result return_type;\
- typedef typename ::testing::internal::Function<F>::ArgumentTuple\
- args_type;\
- gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
- p3##_type gmock_p3, p4##_type gmock_p4, \
- p5##_type gmock_p5) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
- p3(gmock_p3), p4(gmock_p4), p5(gmock_p5) {}\
- virtual return_type Perform(const args_type& args) {\
- return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
- Perform(this, args);\
- }\
- template <typename arg0_type, typename arg1_type, typename arg2_type, \
- typename arg3_type, typename arg4_type, typename arg5_type, \
- typename arg6_type, typename arg7_type, typename arg8_type, \
- typename arg9_type>\
- return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
- arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
- arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
- arg9_type arg9) const;\
- p0##_type p0;\
- p1##_type p1;\
- p2##_type p2;\
- p3##_type p3;\
- p4##_type p4;\
- p5##_type p5;\
- private:\
- GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
- };\
- template <typename F> operator ::testing::Action<F>() const {\
- return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2, p3, p4, p5));\
- }\
- p0##_type p0;\
- p1##_type p1;\
- p2##_type p2;\
- p3##_type p3;\
- p4##_type p4;\
- p5##_type p5;\
- private:\
- GTEST_DISALLOW_ASSIGN_(name##ActionP6);\
- };\
- template <typename p0##_type, typename p1##_type, typename p2##_type, \
- typename p3##_type, typename p4##_type, typename p5##_type>\
- inline name##ActionP6<p0##_type, p1##_type, p2##_type, p3##_type, \
- p4##_type, p5##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, \
- p3##_type p3, p4##_type p4, p5##_type p5) {\
- return name##ActionP6<p0##_type, p1##_type, p2##_type, p3##_type, \
- p4##_type, p5##_type>(p0, p1, p2, p3, p4, p5);\
- }\
- template <typename p0##_type, typename p1##_type, typename p2##_type, \
- typename p3##_type, typename p4##_type, typename p5##_type>\
- template <typename F>\
- template <typename arg0_type, typename arg1_type, typename arg2_type, \
- typename arg3_type, typename arg4_type, typename arg5_type, \
- typename arg6_type, typename arg7_type, typename arg8_type, \
- typename arg9_type>\
- typename ::testing::internal::Function<F>::Result\
- name##ActionP6<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
- p5##_type>::gmock_Impl<F>::gmock_PerformImpl(\
- GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
-
-#define ACTION_P7(name, p0, p1, p2, p3, p4, p5, p6)\
- template <typename p0##_type, typename p1##_type, typename p2##_type, \
- typename p3##_type, typename p4##_type, typename p5##_type, \
- typename p6##_type>\
- class name##ActionP7 {\
- public:\
- name##ActionP7(p0##_type gmock_p0, p1##_type gmock_p1, \
- p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
- p5##_type gmock_p5, p6##_type gmock_p6) : p0(gmock_p0), p1(gmock_p1), \
- p2(gmock_p2), p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), \
- p6(gmock_p6) {}\
- template <typename F>\
- class gmock_Impl : public ::testing::ActionInterface<F> {\
- public:\
- typedef F function_type;\
- typedef typename ::testing::internal::Function<F>::Result return_type;\
- typedef typename ::testing::internal::Function<F>::ArgumentTuple\
- args_type;\
- gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
- p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
- p6##_type gmock_p6) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
- p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6) {}\
- virtual return_type Perform(const args_type& args) {\
- return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
- Perform(this, args);\
- }\
- template <typename arg0_type, typename arg1_type, typename arg2_type, \
- typename arg3_type, typename arg4_type, typename arg5_type, \
- typename arg6_type, typename arg7_type, typename arg8_type, \
- typename arg9_type>\
- return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
- arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
- arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
- arg9_type arg9) const;\
- p0##_type p0;\
- p1##_type p1;\
- p2##_type p2;\
- p3##_type p3;\
- p4##_type p4;\
- p5##_type p5;\
- p6##_type p6;\
- private:\
- GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
- };\
- template <typename F> operator ::testing::Action<F>() const {\
- return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2, p3, p4, p5, \
- p6));\
- }\
- p0##_type p0;\
- p1##_type p1;\
- p2##_type p2;\
- p3##_type p3;\
- p4##_type p4;\
- p5##_type p5;\
- p6##_type p6;\
- private:\
- GTEST_DISALLOW_ASSIGN_(name##ActionP7);\
- };\
- template <typename p0##_type, typename p1##_type, typename p2##_type, \
- typename p3##_type, typename p4##_type, typename p5##_type, \
- typename p6##_type>\
- inline name##ActionP7<p0##_type, p1##_type, p2##_type, p3##_type, \
- p4##_type, p5##_type, p6##_type> name(p0##_type p0, p1##_type p1, \
- p2##_type p2, p3##_type p3, p4##_type p4, p5##_type p5, \
- p6##_type p6) {\
- return name##ActionP7<p0##_type, p1##_type, p2##_type, p3##_type, \
- p4##_type, p5##_type, p6##_type>(p0, p1, p2, p3, p4, p5, p6);\
- }\
- template <typename p0##_type, typename p1##_type, typename p2##_type, \
- typename p3##_type, typename p4##_type, typename p5##_type, \
- typename p6##_type>\
- template <typename F>\
- template <typename arg0_type, typename arg1_type, typename arg2_type, \
- typename arg3_type, typename arg4_type, typename arg5_type, \
- typename arg6_type, typename arg7_type, typename arg8_type, \
- typename arg9_type>\
- typename ::testing::internal::Function<F>::Result\
- name##ActionP7<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
- p5##_type, p6##_type>::gmock_Impl<F>::gmock_PerformImpl(\
- GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
-
-#define ACTION_P8(name, p0, p1, p2, p3, p4, p5, p6, p7)\
- template <typename p0##_type, typename p1##_type, typename p2##_type, \
- typename p3##_type, typename p4##_type, typename p5##_type, \
- typename p6##_type, typename p7##_type>\
- class name##ActionP8 {\
- public:\
- name##ActionP8(p0##_type gmock_p0, p1##_type gmock_p1, \
- p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
- p5##_type gmock_p5, p6##_type gmock_p6, \
- p7##_type gmock_p7) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
- p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), \
- p7(gmock_p7) {}\
- template <typename F>\
- class gmock_Impl : public ::testing::ActionInterface<F> {\
- public:\
- typedef F function_type;\
- typedef typename ::testing::internal::Function<F>::Result return_type;\
- typedef typename ::testing::internal::Function<F>::ArgumentTuple\
- args_type;\
- gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
- p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
- p6##_type gmock_p6, p7##_type gmock_p7) : p0(gmock_p0), \
- p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), p4(gmock_p4), \
- p5(gmock_p5), p6(gmock_p6), p7(gmock_p7) {}\
- virtual return_type Perform(const args_type& args) {\
- return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
- Perform(this, args);\
- }\
- template <typename arg0_type, typename arg1_type, typename arg2_type, \
- typename arg3_type, typename arg4_type, typename arg5_type, \
- typename arg6_type, typename arg7_type, typename arg8_type, \
- typename arg9_type>\
- return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
- arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
- arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
- arg9_type arg9) const;\
- p0##_type p0;\
- p1##_type p1;\
- p2##_type p2;\
- p3##_type p3;\
- p4##_type p4;\
- p5##_type p5;\
- p6##_type p6;\
- p7##_type p7;\
- private:\
- GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
- };\
- template <typename F> operator ::testing::Action<F>() const {\
- return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2, p3, p4, p5, \
- p6, p7));\
- }\
- p0##_type p0;\
- p1##_type p1;\
- p2##_type p2;\
- p3##_type p3;\
- p4##_type p4;\
- p5##_type p5;\
- p6##_type p6;\
- p7##_type p7;\
- private:\
- GTEST_DISALLOW_ASSIGN_(name##ActionP8);\
- };\
- template <typename p0##_type, typename p1##_type, typename p2##_type, \
- typename p3##_type, typename p4##_type, typename p5##_type, \
- typename p6##_type, typename p7##_type>\
- inline name##ActionP8<p0##_type, p1##_type, p2##_type, p3##_type, \
- p4##_type, p5##_type, p6##_type, p7##_type> name(p0##_type p0, \
- p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, p5##_type p5, \
- p6##_type p6, p7##_type p7) {\
- return name##ActionP8<p0##_type, p1##_type, p2##_type, p3##_type, \
- p4##_type, p5##_type, p6##_type, p7##_type>(p0, p1, p2, p3, p4, p5, \
- p6, p7);\
- }\
- template <typename p0##_type, typename p1##_type, typename p2##_type, \
- typename p3##_type, typename p4##_type, typename p5##_type, \
- typename p6##_type, typename p7##_type>\
- template <typename F>\
- template <typename arg0_type, typename arg1_type, typename arg2_type, \
- typename arg3_type, typename arg4_type, typename arg5_type, \
- typename arg6_type, typename arg7_type, typename arg8_type, \
- typename arg9_type>\
- typename ::testing::internal::Function<F>::Result\
- name##ActionP8<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
- p5##_type, p6##_type, \
- p7##_type>::gmock_Impl<F>::gmock_PerformImpl(\
- GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
-
-#define ACTION_P9(name, p0, p1, p2, p3, p4, p5, p6, p7, p8)\
- template <typename p0##_type, typename p1##_type, typename p2##_type, \
- typename p3##_type, typename p4##_type, typename p5##_type, \
- typename p6##_type, typename p7##_type, typename p8##_type>\
- class name##ActionP9 {\
- public:\
- name##ActionP9(p0##_type gmock_p0, p1##_type gmock_p1, \
- p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
- p5##_type gmock_p5, p6##_type gmock_p6, p7##_type gmock_p7, \
- p8##_type gmock_p8) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
- p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), p7(gmock_p7), \
- p8(gmock_p8) {}\
- template <typename F>\
- class gmock_Impl : public ::testing::ActionInterface<F> {\
- public:\
- typedef F function_type;\
- typedef typename ::testing::internal::Function<F>::Result return_type;\
- typedef typename ::testing::internal::Function<F>::ArgumentTuple\
- args_type;\
- gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
- p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
- p6##_type gmock_p6, p7##_type gmock_p7, \
- p8##_type gmock_p8) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
- p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), \
- p7(gmock_p7), p8(gmock_p8) {}\
- virtual return_type Perform(const args_type& args) {\
- return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
- Perform(this, args);\
- }\
- template <typename arg0_type, typename arg1_type, typename arg2_type, \
- typename arg3_type, typename arg4_type, typename arg5_type, \
- typename arg6_type, typename arg7_type, typename arg8_type, \
- typename arg9_type>\
- return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
- arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
- arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
- arg9_type arg9) const;\
- p0##_type p0;\
- p1##_type p1;\
- p2##_type p2;\
- p3##_type p3;\
- p4##_type p4;\
- p5##_type p5;\
- p6##_type p6;\
- p7##_type p7;\
- p8##_type p8;\
- private:\
- GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
- };\
- template <typename F> operator ::testing::Action<F>() const {\
- return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2, p3, p4, p5, \
- p6, p7, p8));\
- }\
- p0##_type p0;\
- p1##_type p1;\
- p2##_type p2;\
- p3##_type p3;\
- p4##_type p4;\
- p5##_type p5;\
- p6##_type p6;\
- p7##_type p7;\
- p8##_type p8;\
- private:\
- GTEST_DISALLOW_ASSIGN_(name##ActionP9);\
- };\
- template <typename p0##_type, typename p1##_type, typename p2##_type, \
- typename p3##_type, typename p4##_type, typename p5##_type, \
- typename p6##_type, typename p7##_type, typename p8##_type>\
- inline name##ActionP9<p0##_type, p1##_type, p2##_type, p3##_type, \
- p4##_type, p5##_type, p6##_type, p7##_type, \
- p8##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
- p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, \
- p8##_type p8) {\
- return name##ActionP9<p0##_type, p1##_type, p2##_type, p3##_type, \
- p4##_type, p5##_type, p6##_type, p7##_type, p8##_type>(p0, p1, p2, \
- p3, p4, p5, p6, p7, p8);\
- }\
- template <typename p0##_type, typename p1##_type, typename p2##_type, \
- typename p3##_type, typename p4##_type, typename p5##_type, \
- typename p6##_type, typename p7##_type, typename p8##_type>\
- template <typename F>\
- template <typename arg0_type, typename arg1_type, typename arg2_type, \
- typename arg3_type, typename arg4_type, typename arg5_type, \
- typename arg6_type, typename arg7_type, typename arg8_type, \
- typename arg9_type>\
- typename ::testing::internal::Function<F>::Result\
- name##ActionP9<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
- p5##_type, p6##_type, p7##_type, \
- p8##_type>::gmock_Impl<F>::gmock_PerformImpl(\
- GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
-
-#define ACTION_P10(name, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)\
- template <typename p0##_type, typename p1##_type, typename p2##_type, \
- typename p3##_type, typename p4##_type, typename p5##_type, \
- typename p6##_type, typename p7##_type, typename p8##_type, \
- typename p9##_type>\
- class name##ActionP10 {\
- public:\
- name##ActionP10(p0##_type gmock_p0, p1##_type gmock_p1, \
- p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
- p5##_type gmock_p5, p6##_type gmock_p6, p7##_type gmock_p7, \
- p8##_type gmock_p8, p9##_type gmock_p9) : p0(gmock_p0), p1(gmock_p1), \
- p2(gmock_p2), p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), \
- p7(gmock_p7), p8(gmock_p8), p9(gmock_p9) {}\
- template <typename F>\
- class gmock_Impl : public ::testing::ActionInterface<F> {\
- public:\
- typedef F function_type;\
- typedef typename ::testing::internal::Function<F>::Result return_type;\
- typedef typename ::testing::internal::Function<F>::ArgumentTuple\
- args_type;\
- gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
- p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
- p6##_type gmock_p6, p7##_type gmock_p7, p8##_type gmock_p8, \
- p9##_type gmock_p9) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
- p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), \
- p7(gmock_p7), p8(gmock_p8), p9(gmock_p9) {}\
- virtual return_type Perform(const args_type& args) {\
- return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
- Perform(this, args);\
- }\
- template <typename arg0_type, typename arg1_type, typename arg2_type, \
- typename arg3_type, typename arg4_type, typename arg5_type, \
- typename arg6_type, typename arg7_type, typename arg8_type, \
- typename arg9_type>\
- return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
- arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
- arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
- arg9_type arg9) const;\
- p0##_type p0;\
- p1##_type p1;\
- p2##_type p2;\
- p3##_type p3;\
- p4##_type p4;\
- p5##_type p5;\
- p6##_type p6;\
- p7##_type p7;\
- p8##_type p8;\
- p9##_type p9;\
- private:\
- GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
- };\
- template <typename F> operator ::testing::Action<F>() const {\
- return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2, p3, p4, p5, \
- p6, p7, p8, p9));\
- }\
- p0##_type p0;\
- p1##_type p1;\
- p2##_type p2;\
- p3##_type p3;\
- p4##_type p4;\
- p5##_type p5;\
- p6##_type p6;\
- p7##_type p7;\
- p8##_type p8;\
- p9##_type p9;\
- private:\
- GTEST_DISALLOW_ASSIGN_(name##ActionP10);\
- };\
- template <typename p0##_type, typename p1##_type, typename p2##_type, \
- typename p3##_type, typename p4##_type, typename p5##_type, \
- typename p6##_type, typename p7##_type, typename p8##_type, \
- typename p9##_type>\
- inline name##ActionP10<p0##_type, p1##_type, p2##_type, p3##_type, \
- p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, \
- p9##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
- p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, p8##_type p8, \
- p9##_type p9) {\
- return name##ActionP10<p0##_type, p1##_type, p2##_type, p3##_type, \
- p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, p9##_type>(p0, \
- p1, p2, p3, p4, p5, p6, p7, p8, p9);\
- }\
- template <typename p0##_type, typename p1##_type, typename p2##_type, \
- typename p3##_type, typename p4##_type, typename p5##_type, \
- typename p6##_type, typename p7##_type, typename p8##_type, \
- typename p9##_type>\
- template <typename F>\
- template <typename arg0_type, typename arg1_type, typename arg2_type, \
- typename arg3_type, typename arg4_type, typename arg5_type, \
- typename arg6_type, typename arg7_type, typename arg8_type, \
- typename arg9_type>\
- typename ::testing::internal::Function<F>::Result\
- name##ActionP10<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
- p5##_type, p6##_type, p7##_type, p8##_type, \
- p9##_type>::gmock_Impl<F>::gmock_PerformImpl(\
- GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
-
-namespace testing {
-
-// The ACTION*() macros trigger warning C4100 (unreferenced formal
-// parameter) in MSVC with -W4. Unfortunately they cannot be fixed in
-// the macro definition, as the warnings are generated when the macro
-// is expanded and macro expansion cannot contain #pragma. Therefore
-// we suppress them here.
-#ifdef _MSC_VER
-# pragma warning(push)
-# pragma warning(disable:4100)
-#endif
-
-// Various overloads for InvokeArgument<N>().
-//
-// The InvokeArgument<N>(a1, a2, ..., a_k) action invokes the N-th
-// (0-based) argument, which must be a k-ary callable, of the mock
-// function, with arguments a1, a2, ..., a_k.
-//
-// Notes:
-//
-// 1. The arguments are passed by value by default. If you need to
-// pass an argument by reference, wrap it inside ByRef(). For
-// example,
-//
-// InvokeArgument<1>(5, string("Hello"), ByRef(foo))
-//
-// passes 5 and string("Hello") by value, and passes foo by
-// reference.
-//
-// 2. If the callable takes an argument by reference but ByRef() is
-// not used, it will receive the reference to a copy of the value,
-// instead of the original value. For example, when the 0-th
-// argument of the mock function takes a const string&, the action
-//
-// InvokeArgument<0>(string("Hello"))
-//
-// makes a copy of the temporary string("Hello") object and passes a
-// reference of the copy, instead of the original temporary object,
-// to the callable. This makes it easy for a user to define an
-// InvokeArgument action from temporary values and have it performed
-// later.
-
-ACTION_TEMPLATE(InvokeArgument,
- HAS_1_TEMPLATE_PARAMS(int, k),
- AND_0_VALUE_PARAMS()) {
- return internal::CallableHelper<return_type>::Call(
- ::std::tr1::get<k>(args));
-}
-
-ACTION_TEMPLATE(InvokeArgument,
- HAS_1_TEMPLATE_PARAMS(int, k),
- AND_1_VALUE_PARAMS(p0)) {
- return internal::CallableHelper<return_type>::Call(
- ::std::tr1::get<k>(args), p0);
-}
-
-ACTION_TEMPLATE(InvokeArgument,
- HAS_1_TEMPLATE_PARAMS(int, k),
- AND_2_VALUE_PARAMS(p0, p1)) {
- return internal::CallableHelper<return_type>::Call(
- ::std::tr1::get<k>(args), p0, p1);
-}
-
-ACTION_TEMPLATE(InvokeArgument,
- HAS_1_TEMPLATE_PARAMS(int, k),
- AND_3_VALUE_PARAMS(p0, p1, p2)) {
- return internal::CallableHelper<return_type>::Call(
- ::std::tr1::get<k>(args), p0, p1, p2);
-}
-
-ACTION_TEMPLATE(InvokeArgument,
- HAS_1_TEMPLATE_PARAMS(int, k),
- AND_4_VALUE_PARAMS(p0, p1, p2, p3)) {
- return internal::CallableHelper<return_type>::Call(
- ::std::tr1::get<k>(args), p0, p1, p2, p3);
-}
-
-ACTION_TEMPLATE(InvokeArgument,
- HAS_1_TEMPLATE_PARAMS(int, k),
- AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4)) {
- return internal::CallableHelper<return_type>::Call(
- ::std::tr1::get<k>(args), p0, p1, p2, p3, p4);
-}
-
-ACTION_TEMPLATE(InvokeArgument,
- HAS_1_TEMPLATE_PARAMS(int, k),
- AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5)) {
- return internal::CallableHelper<return_type>::Call(
- ::std::tr1::get<k>(args), p0, p1, p2, p3, p4, p5);
-}
-
-ACTION_TEMPLATE(InvokeArgument,
- HAS_1_TEMPLATE_PARAMS(int, k),
- AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6)) {
- return internal::CallableHelper<return_type>::Call(
- ::std::tr1::get<k>(args), p0, p1, p2, p3, p4, p5, p6);
-}
-
-ACTION_TEMPLATE(InvokeArgument,
- HAS_1_TEMPLATE_PARAMS(int, k),
- AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7)) {
- return internal::CallableHelper<return_type>::Call(
- ::std::tr1::get<k>(args), p0, p1, p2, p3, p4, p5, p6, p7);
-}
-
-ACTION_TEMPLATE(InvokeArgument,
- HAS_1_TEMPLATE_PARAMS(int, k),
- AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8)) {
- return internal::CallableHelper<return_type>::Call(
- ::std::tr1::get<k>(args), p0, p1, p2, p3, p4, p5, p6, p7, p8);
-}
-
-ACTION_TEMPLATE(InvokeArgument,
- HAS_1_TEMPLATE_PARAMS(int, k),
- AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)) {
- return internal::CallableHelper<return_type>::Call(
- ::std::tr1::get<k>(args), p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
-}
-
-// Various overloads for ReturnNew<T>().
-//
-// The ReturnNew<T>(a1, a2, ..., a_k) action returns a pointer to a new
-// instance of type T, constructed on the heap with constructor arguments
-// a1, a2, ..., and a_k. The caller assumes ownership of the returned value.
-ACTION_TEMPLATE(ReturnNew,
- HAS_1_TEMPLATE_PARAMS(typename, T),
- AND_0_VALUE_PARAMS()) {
- return new T();
-}
-
-ACTION_TEMPLATE(ReturnNew,
- HAS_1_TEMPLATE_PARAMS(typename, T),
- AND_1_VALUE_PARAMS(p0)) {
- return new T(p0);
-}
-
-ACTION_TEMPLATE(ReturnNew,
- HAS_1_TEMPLATE_PARAMS(typename, T),
- AND_2_VALUE_PARAMS(p0, p1)) {
- return new T(p0, p1);
-}
-
-ACTION_TEMPLATE(ReturnNew,
- HAS_1_TEMPLATE_PARAMS(typename, T),
- AND_3_VALUE_PARAMS(p0, p1, p2)) {
- return new T(p0, p1, p2);
-}
-
-ACTION_TEMPLATE(ReturnNew,
- HAS_1_TEMPLATE_PARAMS(typename, T),
- AND_4_VALUE_PARAMS(p0, p1, p2, p3)) {
- return new T(p0, p1, p2, p3);
-}
-
-ACTION_TEMPLATE(ReturnNew,
- HAS_1_TEMPLATE_PARAMS(typename, T),
- AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4)) {
- return new T(p0, p1, p2, p3, p4);
-}
-
-ACTION_TEMPLATE(ReturnNew,
- HAS_1_TEMPLATE_PARAMS(typename, T),
- AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5)) {
- return new T(p0, p1, p2, p3, p4, p5);
-}
-
-ACTION_TEMPLATE(ReturnNew,
- HAS_1_TEMPLATE_PARAMS(typename, T),
- AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6)) {
- return new T(p0, p1, p2, p3, p4, p5, p6);
-}
-
-ACTION_TEMPLATE(ReturnNew,
- HAS_1_TEMPLATE_PARAMS(typename, T),
- AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7)) {
- return new T(p0, p1, p2, p3, p4, p5, p6, p7);
-}
-
-ACTION_TEMPLATE(ReturnNew,
- HAS_1_TEMPLATE_PARAMS(typename, T),
- AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8)) {
- return new T(p0, p1, p2, p3, p4, p5, p6, p7, p8);
-}
-
-ACTION_TEMPLATE(ReturnNew,
- HAS_1_TEMPLATE_PARAMS(typename, T),
- AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)) {
- return new T(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
-}
-
-#ifdef _MSC_VER
-# pragma warning(pop)
-#endif
-
-} // namespace testing
-
-#endif // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_
diff --git a/src/testing/include/gmock/gmock-generated-actions.h.pump b/src/testing/include/gmock/gmock-generated-actions.h.pump
deleted file mode 100644
index 8e2b5735..00000000
--- a/src/testing/include/gmock/gmock-generated-actions.h.pump
+++ /dev/null
@@ -1,821 +0,0 @@
-$$ -*- mode: c++; -*-
-$$ This is a Pump source file. Please use Pump to convert it to
-$$ gmock-generated-actions.h.
-$$
-$var n = 10 $$ The maximum arity we support.
-$$}} This meta comment fixes auto-indentation in editors.
-// Copyright 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-// Google Mock - a framework for writing C++ mock classes.
-//
-// This file implements some commonly used variadic actions.
-
-#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_
-#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_
-
-#include "gmock/gmock-actions.h"
-#include "gmock/internal/gmock-port.h"
-
-namespace testing {
-namespace internal {
-
-// InvokeHelper<F> knows how to unpack an N-tuple and invoke an N-ary
-// function or method with the unpacked values, where F is a function
-// type that takes N arguments.
-template <typename Result, typename ArgumentTuple>
-class InvokeHelper;
-
-
-$range i 0..n
-$for i [[
-$range j 1..i
-$var types = [[$for j [[, typename A$j]]]]
-$var as = [[$for j, [[A$j]]]]
-$var args = [[$if i==0 [[]] $else [[ args]]]]
-$var import = [[$if i==0 [[]] $else [[
- using ::std::tr1::get;
-
-]]]]
-$var gets = [[$for j, [[get<$(j - 1)>(args)]]]]
-template <typename R$types>
-class InvokeHelper<R, ::std::tr1::tuple<$as> > {
- public:
- template <typename Function>
- static R Invoke(Function function, const ::std::tr1::tuple<$as>&$args) {
-$import return function($gets);
- }
-
- template <class Class, typename MethodPtr>
- static R InvokeMethod(Class* obj_ptr,
- MethodPtr method_ptr,
- const ::std::tr1::tuple<$as>&$args) {
-$import return (obj_ptr->*method_ptr)($gets);
- }
-};
-
-
-]]
-// CallableHelper has static methods for invoking "callables",
-// i.e. function pointers and functors. It uses overloading to
-// provide a uniform interface for invoking different kinds of
-// callables. In particular, you can use:
-//
-// CallableHelper<R>::Call(callable, a1, a2, ..., an)
-//
-// to invoke an n-ary callable, where R is its return type. If an
-// argument, say a2, needs to be passed by reference, you should write
-// ByRef(a2) instead of a2 in the above expression.
-template <typename R>
-class CallableHelper {
- public:
- // Calls a nullary callable.
- template <typename Function>
- static R Call(Function function) { return function(); }
-
- // Calls a unary callable.
-
- // We deliberately pass a1 by value instead of const reference here
- // in case it is a C-string literal. If we had declared the
- // parameter as 'const A1& a1' and write Call(function, "Hi"), the
- // compiler would've thought A1 is 'char[3]', which causes trouble
- // when you need to copy a value of type A1. By declaring the
- // parameter as 'A1 a1', the compiler will correctly infer that A1
- // is 'const char*' when it sees Call(function, "Hi").
- //
- // Since this function is defined inline, the compiler can get rid
- // of the copying of the arguments. Therefore the performance won't
- // be hurt.
- template <typename Function, typename A1>
- static R Call(Function function, A1 a1) { return function(a1); }
-
-$range i 2..n
-$for i
-[[
-$var arity = [[$if i==2 [[binary]] $elif i==3 [[ternary]] $else [[$i-ary]]]]
-
- // Calls a $arity callable.
-
-$range j 1..i
-$var typename_As = [[$for j, [[typename A$j]]]]
-$var Aas = [[$for j, [[A$j a$j]]]]
-$var as = [[$for j, [[a$j]]]]
-$var typename_Ts = [[$for j, [[typename T$j]]]]
-$var Ts = [[$for j, [[T$j]]]]
- template <typename Function, $typename_As>
- static R Call(Function function, $Aas) {
- return function($as);
- }
-
-]]
-}; // class CallableHelper
-
-// An INTERNAL macro for extracting the type of a tuple field. It's
-// subject to change without notice - DO NOT USE IN USER CODE!
-#define GMOCK_FIELD_(Tuple, N) \
- typename ::std::tr1::tuple_element<N, Tuple>::type
-
-$range i 1..n
-
-// SelectArgs<Result, ArgumentTuple, k1, k2, ..., k_n>::type is the
-// type of an n-ary function whose i-th (1-based) argument type is the
-// k{i}-th (0-based) field of ArgumentTuple, which must be a tuple
-// type, and whose return type is Result. For example,
-// SelectArgs<int, ::std::tr1::tuple<bool, char, double, long>, 0, 3>::type
-// is int(bool, long).
-//
-// SelectArgs<Result, ArgumentTuple, k1, k2, ..., k_n>::Select(args)
-// returns the selected fields (k1, k2, ..., k_n) of args as a tuple.
-// For example,
-// SelectArgs<int, ::std::tr1::tuple<bool, char, double>, 2, 0>::Select(
-// ::std::tr1::make_tuple(true, 'a', 2.5))
-// returns ::std::tr1::tuple (2.5, true).
-//
-// The numbers in list k1, k2, ..., k_n must be >= 0, where n can be
-// in the range [0, $n]. Duplicates are allowed and they don't have
-// to be in an ascending or descending order.
-
-template <typename Result, typename ArgumentTuple, $for i, [[int k$i]]>
-class SelectArgs {
- public:
- typedef Result type($for i, [[GMOCK_FIELD_(ArgumentTuple, k$i)]]);
- typedef typename Function<type>::ArgumentTuple SelectedArgs;
- static SelectedArgs Select(const ArgumentTuple& args) {
- using ::std::tr1::get;
- return SelectedArgs($for i, [[get<k$i>(args)]]);
- }
-};
-
-
-$for i [[
-$range j 1..n
-$range j1 1..i-1
-template <typename Result, typename ArgumentTuple$for j1[[, int k$j1]]>
-class SelectArgs<Result, ArgumentTuple,
- $for j, [[$if j <= i-1 [[k$j]] $else [[-1]]]]> {
- public:
- typedef Result type($for j1, [[GMOCK_FIELD_(ArgumentTuple, k$j1)]]);
- typedef typename Function<type>::ArgumentTuple SelectedArgs;
- static SelectedArgs Select(const ArgumentTuple& [[]]
-$if i == 1 [[/* args */]] $else [[args]]) {
- using ::std::tr1::get;
- return SelectedArgs($for j1, [[get<k$j1>(args)]]);
- }
-};
-
-
-]]
-#undef GMOCK_FIELD_
-
-$var ks = [[$for i, [[k$i]]]]
-
-// Implements the WithArgs action.
-template <typename InnerAction, $for i, [[int k$i = -1]]>
-class WithArgsAction {
- public:
- explicit WithArgsAction(const InnerAction& action) : action_(action) {}
-
- template <typename F>
- operator Action<F>() const { return MakeAction(new Impl<F>(action_)); }
-
- private:
- template <typename F>
- class Impl : public ActionInterface<F> {
- public:
- typedef typename Function<F>::Result Result;
- typedef typename Function<F>::ArgumentTuple ArgumentTuple;
-
- explicit Impl(const InnerAction& action) : action_(action) {}
-
- virtual Result Perform(const ArgumentTuple& args) {
- return action_.Perform(SelectArgs<Result, ArgumentTuple, $ks>::Select(args));
- }
-
- private:
- typedef typename SelectArgs<Result, ArgumentTuple,
- $ks>::type InnerFunctionType;
-
- Action<InnerFunctionType> action_;
- };
-
- const InnerAction action_;
-
- GTEST_DISALLOW_ASSIGN_(WithArgsAction);
-};
-
-// A macro from the ACTION* family (defined later in this file)
-// defines an action that can be used in a mock function. Typically,
-// these actions only care about a subset of the arguments of the mock
-// function. For example, if such an action only uses the second
-// argument, it can be used in any mock function that takes >= 2
-// arguments where the type of the second argument is compatible.
-//
-// Therefore, the action implementation must be prepared to take more
-// arguments than it needs. The ExcessiveArg type is used to
-// represent those excessive arguments. In order to keep the compiler
-// error messages tractable, we define it in the testing namespace
-// instead of testing::internal. However, this is an INTERNAL TYPE
-// and subject to change without notice, so a user MUST NOT USE THIS
-// TYPE DIRECTLY.
-struct ExcessiveArg {};
-
-// A helper class needed for implementing the ACTION* macros.
-template <typename Result, class Impl>
-class ActionHelper {
- public:
-$range i 0..n
-$for i
-
-[[
-$var template = [[$if i==0 [[]] $else [[
-$range j 0..i-1
- template <$for j, [[typename A$j]]>
-]]]]
-$range j 0..i-1
-$var As = [[$for j, [[A$j]]]]
-$var as = [[$for j, [[get<$j>(args)]]]]
-$range k 1..n-i
-$var eas = [[$for k, [[ExcessiveArg()]]]]
-$var arg_list = [[$if (i==0) | (i==n) [[$as$eas]] $else [[$as, $eas]]]]
-$template
- static Result Perform(Impl* impl, const ::std::tr1::tuple<$As>& args) {
- using ::std::tr1::get;
- return impl->template gmock_PerformImpl<$As>(args, $arg_list);
- }
-
-]]
-};
-
-} // namespace internal
-
-// Various overloads for Invoke().
-
-// WithArgs<N1, N2, ..., Nk>(an_action) creates an action that passes
-// the selected arguments of the mock function to an_action and
-// performs it. It serves as an adaptor between actions with
-// different argument lists. C++ doesn't support default arguments for
-// function templates, so we have to overload it.
-
-$range i 1..n
-$for i [[
-$range j 1..i
-template <$for j [[int k$j, ]]typename InnerAction>
-inline internal::WithArgsAction<InnerAction$for j [[, k$j]]>
-WithArgs(const InnerAction& action) {
- return internal::WithArgsAction<InnerAction$for j [[, k$j]]>(action);
-}
-
-
-]]
-// Creates an action that does actions a1, a2, ..., sequentially in
-// each invocation.
-$range i 2..n
-$for i [[
-$range j 2..i
-$var types = [[$for j, [[typename Action$j]]]]
-$var Aas = [[$for j [[, Action$j a$j]]]]
-
-template <typename Action1, $types>
-$range k 1..i-1
-
-inline $for k [[internal::DoBothAction<Action$k, ]]Action$i$for k [[>]]
-
-DoAll(Action1 a1$Aas) {
-$if i==2 [[
-
- return internal::DoBothAction<Action1, Action2>(a1, a2);
-]] $else [[
-$range j2 2..i
-
- return DoAll(a1, DoAll($for j2, [[a$j2]]));
-]]
-
-}
-
-]]
-
-} // namespace testing
-
-// The ACTION* family of macros can be used in a namespace scope to
-// define custom actions easily. The syntax:
-//
-// ACTION(name) { statements; }
-//
-// will define an action with the given name that executes the
-// statements. The value returned by the statements will be used as
-// the return value of the action. Inside the statements, you can
-// refer to the K-th (0-based) argument of the mock function by
-// 'argK', and refer to its type by 'argK_type'. For example:
-//
-// ACTION(IncrementArg1) {
-// arg1_type temp = arg1;
-// return ++(*temp);
-// }
-//
-// allows you to write
-//
-// ...WillOnce(IncrementArg1());
-//
-// You can also refer to the entire argument tuple and its type by
-// 'args' and 'args_type', and refer to the mock function type and its
-// return type by 'function_type' and 'return_type'.
-//
-// Note that you don't need to specify the types of the mock function
-// arguments. However rest assured that your code is still type-safe:
-// you'll get a compiler error if *arg1 doesn't support the ++
-// operator, or if the type of ++(*arg1) isn't compatible with the
-// mock function's return type, for example.
-//
-// Sometimes you'll want to parameterize the action. For that you can use
-// another macro:
-//
-// ACTION_P(name, param_name) { statements; }
-//
-// For example:
-//
-// ACTION_P(Add, n) { return arg0 + n; }
-//
-// will allow you to write:
-//
-// ...WillOnce(Add(5));
-//
-// Note that you don't need to provide the type of the parameter
-// either. If you need to reference the type of a parameter named
-// 'foo', you can write 'foo_type'. For example, in the body of
-// ACTION_P(Add, n) above, you can write 'n_type' to refer to the type
-// of 'n'.
-//
-// We also provide ACTION_P2, ACTION_P3, ..., up to ACTION_P$n to support
-// multi-parameter actions.
-//
-// For the purpose of typing, you can view
-//
-// ACTION_Pk(Foo, p1, ..., pk) { ... }
-//
-// as shorthand for
-//
-// template <typename p1_type, ..., typename pk_type>
-// FooActionPk<p1_type, ..., pk_type> Foo(p1_type p1, ..., pk_type pk) { ... }
-//
-// In particular, you can provide the template type arguments
-// explicitly when invoking Foo(), as in Foo<long, bool>(5, false);
-// although usually you can rely on the compiler to infer the types
-// for you automatically. You can assign the result of expression
-// Foo(p1, ..., pk) to a variable of type FooActionPk<p1_type, ...,
-// pk_type>. This can be useful when composing actions.
-//
-// You can also overload actions with different numbers of parameters:
-//
-// ACTION_P(Plus, a) { ... }
-// ACTION_P2(Plus, a, b) { ... }
-//
-// While it's tempting to always use the ACTION* macros when defining
-// a new action, you should also consider implementing ActionInterface
-// or using MakePolymorphicAction() instead, especially if you need to
-// use the action a lot. While these approaches require more work,
-// they give you more control on the types of the mock function
-// arguments and the action parameters, which in general leads to
-// better compiler error messages that pay off in the long run. They
-// also allow overloading actions based on parameter types (as opposed
-// to just based on the number of parameters).
-//
-// CAVEAT:
-//
-// ACTION*() can only be used in a namespace scope. The reason is
-// that C++ doesn't yet allow function-local types to be used to
-// instantiate templates. The up-coming C++0x standard will fix this.
-// Once that's done, we'll consider supporting using ACTION*() inside
-// a function.
-//
-// MORE INFORMATION:
-//
-// To learn more about using these macros, please search for 'ACTION'
-// on http://code.google.com/p/googlemock/wiki/CookBook.
-
-$range i 0..n
-$range k 0..n-1
-
-// An internal macro needed for implementing ACTION*().
-#define GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_\
- const args_type& args GTEST_ATTRIBUTE_UNUSED_
-$for k [[, \
- arg$k[[]]_type arg$k GTEST_ATTRIBUTE_UNUSED_]]
-
-
-// Sometimes you want to give an action explicit template parameters
-// that cannot be inferred from its value parameters. ACTION() and
-// ACTION_P*() don't support that. ACTION_TEMPLATE() remedies that
-// and can be viewed as an extension to ACTION() and ACTION_P*().
-//
-// The syntax:
-//
-// ACTION_TEMPLATE(ActionName,
-// HAS_m_TEMPLATE_PARAMS(kind1, name1, ..., kind_m, name_m),
-// AND_n_VALUE_PARAMS(p1, ..., p_n)) { statements; }
-//
-// defines an action template that takes m explicit template
-// parameters and n value parameters. name_i is the name of the i-th
-// template parameter, and kind_i specifies whether it's a typename,
-// an integral constant, or a template. p_i is the name of the i-th
-// value parameter.
-//
-// Example:
-//
-// // DuplicateArg<k, T>(output) converts the k-th argument of the mock
-// // function to type T and copies it to *output.
-// ACTION_TEMPLATE(DuplicateArg,
-// HAS_2_TEMPLATE_PARAMS(int, k, typename, T),
-// AND_1_VALUE_PARAMS(output)) {
-// *output = T(std::tr1::get<k>(args));
-// }
-// ...
-// int n;
-// EXPECT_CALL(mock, Foo(_, _))
-// .WillOnce(DuplicateArg<1, unsigned char>(&n));
-//
-// To create an instance of an action template, write:
-//
-// ActionName<t1, ..., t_m>(v1, ..., v_n)
-//
-// where the ts are the template arguments and the vs are the value
-// arguments. The value argument types are inferred by the compiler.
-// If you want to explicitly specify the value argument types, you can
-// provide additional template arguments:
-//
-// ActionName<t1, ..., t_m, u1, ..., u_k>(v1, ..., v_n)
-//
-// where u_i is the desired type of v_i.
-//
-// ACTION_TEMPLATE and ACTION/ACTION_P* can be overloaded on the
-// number of value parameters, but not on the number of template
-// parameters. Without the restriction, the meaning of the following
-// is unclear:
-//
-// OverloadedAction<int, bool>(x);
-//
-// Are we using a single-template-parameter action where 'bool' refers
-// to the type of x, or are we using a two-template-parameter action
-// where the compiler is asked to infer the type of x?
-//
-// Implementation notes:
-//
-// GMOCK_INTERNAL_*_HAS_m_TEMPLATE_PARAMS and
-// GMOCK_INTERNAL_*_AND_n_VALUE_PARAMS are internal macros for
-// implementing ACTION_TEMPLATE. The main trick we use is to create
-// new macro invocations when expanding a macro. For example, we have
-//
-// #define ACTION_TEMPLATE(name, template_params, value_params)
-// ... GMOCK_INTERNAL_DECL_##template_params ...
-//
-// which causes ACTION_TEMPLATE(..., HAS_1_TEMPLATE_PARAMS(typename, T), ...)
-// to expand to
-//
-// ... GMOCK_INTERNAL_DECL_HAS_1_TEMPLATE_PARAMS(typename, T) ...
-//
-// Since GMOCK_INTERNAL_DECL_HAS_1_TEMPLATE_PARAMS is a macro, the
-// preprocessor will continue to expand it to
-//
-// ... typename T ...
-//
-// This technique conforms to the C++ standard and is portable. It
-// allows us to implement action templates using O(N) code, where N is
-// the maximum number of template/value parameters supported. Without
-// using it, we'd have to devote O(N^2) amount of code to implement all
-// combinations of m and n.
-
-// Declares the template parameters.
-
-$range j 1..n
-$for j [[
-$range m 0..j-1
-#define GMOCK_INTERNAL_DECL_HAS_$j[[]]
-_TEMPLATE_PARAMS($for m, [[kind$m, name$m]]) $for m, [[kind$m name$m]]
-
-
-]]
-
-// Lists the template parameters.
-
-$for j [[
-$range m 0..j-1
-#define GMOCK_INTERNAL_LIST_HAS_$j[[]]
-_TEMPLATE_PARAMS($for m, [[kind$m, name$m]]) $for m, [[name$m]]
-
-
-]]
-
-// Declares the types of value parameters.
-
-$for i [[
-$range j 0..i-1
-#define GMOCK_INTERNAL_DECL_TYPE_AND_$i[[]]
-_VALUE_PARAMS($for j, [[p$j]]) $for j [[, typename p$j##_type]]
-
-
-]]
-
-// Initializes the value parameters.
-
-$for i [[
-$range j 0..i-1
-#define GMOCK_INTERNAL_INIT_AND_$i[[]]_VALUE_PARAMS($for j, [[p$j]])\
- ($for j, [[p$j##_type gmock_p$j]])$if i>0 [[ : ]]$for j, [[p$j(gmock_p$j)]]
-
-
-]]
-
-// Declares the fields for storing the value parameters.
-
-$for i [[
-$range j 0..i-1
-#define GMOCK_INTERNAL_DEFN_AND_$i[[]]
-_VALUE_PARAMS($for j, [[p$j]]) $for j [[p$j##_type p$j; ]]
-
-
-]]
-
-// Lists the value parameters.
-
-$for i [[
-$range j 0..i-1
-#define GMOCK_INTERNAL_LIST_AND_$i[[]]
-_VALUE_PARAMS($for j, [[p$j]]) $for j, [[p$j]]
-
-
-]]
-
-// Lists the value parameter types.
-
-$for i [[
-$range j 0..i-1
-#define GMOCK_INTERNAL_LIST_TYPE_AND_$i[[]]
-_VALUE_PARAMS($for j, [[p$j]]) $for j [[, p$j##_type]]
-
-
-]]
-
-// Declares the value parameters.
-
-$for i [[
-$range j 0..i-1
-#define GMOCK_INTERNAL_DECL_AND_$i[[]]_VALUE_PARAMS($for j, [[p$j]]) [[]]
-$for j, [[p$j##_type p$j]]
-
-
-]]
-
-// The suffix of the class template implementing the action template.
-$for i [[
-
-
-$range j 0..i-1
-#define GMOCK_INTERNAL_COUNT_AND_$i[[]]_VALUE_PARAMS($for j, [[p$j]]) [[]]
-$if i==1 [[P]] $elif i>=2 [[P$i]]
-]]
-
-
-// The name of the class template implementing the action template.
-#define GMOCK_ACTION_CLASS_(name, value_params)\
- GTEST_CONCAT_TOKEN_(name##Action, GMOCK_INTERNAL_COUNT_##value_params)
-
-$range k 0..n-1
-
-#define ACTION_TEMPLATE(name, template_params, value_params)\
- template <GMOCK_INTERNAL_DECL_##template_params\
- GMOCK_INTERNAL_DECL_TYPE_##value_params>\
- class GMOCK_ACTION_CLASS_(name, value_params) {\
- public:\
- GMOCK_ACTION_CLASS_(name, value_params)\
- GMOCK_INTERNAL_INIT_##value_params {}\
- template <typename F>\
- class gmock_Impl : public ::testing::ActionInterface<F> {\
- public:\
- typedef F function_type;\
- typedef typename ::testing::internal::Function<F>::Result return_type;\
- typedef typename ::testing::internal::Function<F>::ArgumentTuple\
- args_type;\
- explicit gmock_Impl GMOCK_INTERNAL_INIT_##value_params {}\
- virtual return_type Perform(const args_type& args) {\
- return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
- Perform(this, args);\
- }\
- template <$for k, [[typename arg$k[[]]_type]]>\
- return_type gmock_PerformImpl(const args_type& args[[]]
-$for k [[, arg$k[[]]_type arg$k]]) const;\
- GMOCK_INTERNAL_DEFN_##value_params\
- private:\
- GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
- };\
- template <typename F> operator ::testing::Action<F>() const {\
- return ::testing::Action<F>(\
- new gmock_Impl<F>(GMOCK_INTERNAL_LIST_##value_params));\
- }\
- GMOCK_INTERNAL_DEFN_##value_params\
- private:\
- GTEST_DISALLOW_ASSIGN_(GMOCK_ACTION_CLASS_(name, value_params));\
- };\
- template <GMOCK_INTERNAL_DECL_##template_params\
- GMOCK_INTERNAL_DECL_TYPE_##value_params>\
- inline GMOCK_ACTION_CLASS_(name, value_params)<\
- GMOCK_INTERNAL_LIST_##template_params\
- GMOCK_INTERNAL_LIST_TYPE_##value_params> name(\
- GMOCK_INTERNAL_DECL_##value_params) {\
- return GMOCK_ACTION_CLASS_(name, value_params)<\
- GMOCK_INTERNAL_LIST_##template_params\
- GMOCK_INTERNAL_LIST_TYPE_##value_params>(\
- GMOCK_INTERNAL_LIST_##value_params);\
- }\
- template <GMOCK_INTERNAL_DECL_##template_params\
- GMOCK_INTERNAL_DECL_TYPE_##value_params>\
- template <typename F>\
- template <typename arg0_type, typename arg1_type, typename arg2_type, \
- typename arg3_type, typename arg4_type, typename arg5_type, \
- typename arg6_type, typename arg7_type, typename arg8_type, \
- typename arg9_type>\
- typename ::testing::internal::Function<F>::Result\
- GMOCK_ACTION_CLASS_(name, value_params)<\
- GMOCK_INTERNAL_LIST_##template_params\
- GMOCK_INTERNAL_LIST_TYPE_##value_params>::gmock_Impl<F>::\
- gmock_PerformImpl(\
- GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
-
-$for i
-
-[[
-$var template = [[$if i==0 [[]] $else [[
-$range j 0..i-1
-
- template <$for j, [[typename p$j##_type]]>\
-]]]]
-$var class_name = [[name##Action[[$if i==0 [[]] $elif i==1 [[P]]
- $else [[P$i]]]]]]
-$range j 0..i-1
-$var ctor_param_list = [[$for j, [[p$j##_type gmock_p$j]]]]
-$var param_types_and_names = [[$for j, [[p$j##_type p$j]]]]
-$var inits = [[$if i==0 [[]] $else [[ : $for j, [[p$j(gmock_p$j)]]]]]]
-$var param_field_decls = [[$for j
-[[
-
- p$j##_type p$j;\
-]]]]
-$var param_field_decls2 = [[$for j
-[[
-
- p$j##_type p$j;\
-]]]]
-$var params = [[$for j, [[p$j]]]]
-$var param_types = [[$if i==0 [[]] $else [[<$for j, [[p$j##_type]]>]]]]
-$var typename_arg_types = [[$for k, [[typename arg$k[[]]_type]]]]
-$var arg_types_and_names = [[$for k, [[arg$k[[]]_type arg$k]]]]
-$var macro_name = [[$if i==0 [[ACTION]] $elif i==1 [[ACTION_P]]
- $else [[ACTION_P$i]]]]
-
-#define $macro_name(name$for j [[, p$j]])\$template
- class $class_name {\
- public:\
- $class_name($ctor_param_list)$inits {}\
- template <typename F>\
- class gmock_Impl : public ::testing::ActionInterface<F> {\
- public:\
- typedef F function_type;\
- typedef typename ::testing::internal::Function<F>::Result return_type;\
- typedef typename ::testing::internal::Function<F>::ArgumentTuple\
- args_type;\
- [[$if i==1 [[explicit ]]]]gmock_Impl($ctor_param_list)$inits {}\
- virtual return_type Perform(const args_type& args) {\
- return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
- Perform(this, args);\
- }\
- template <$typename_arg_types>\
- return_type gmock_PerformImpl(const args_type& args, [[]]
-$arg_types_and_names) const;\$param_field_decls
- private:\
- GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
- };\
- template <typename F> operator ::testing::Action<F>() const {\
- return ::testing::Action<F>(new gmock_Impl<F>($params));\
- }\$param_field_decls2
- private:\
- GTEST_DISALLOW_ASSIGN_($class_name);\
- };\$template
- inline $class_name$param_types name($param_types_and_names) {\
- return $class_name$param_types($params);\
- }\$template
- template <typename F>\
- template <$typename_arg_types>\
- typename ::testing::internal::Function<F>::Result\
- $class_name$param_types::gmock_Impl<F>::gmock_PerformImpl(\
- GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
-]]
-$$ } // This meta comment fixes auto-indentation in Emacs. It won't
-$$ // show up in the generated code.
-
-
-namespace testing {
-
-// The ACTION*() macros trigger warning C4100 (unreferenced formal
-// parameter) in MSVC with -W4. Unfortunately they cannot be fixed in
-// the macro definition, as the warnings are generated when the macro
-// is expanded and macro expansion cannot contain #pragma. Therefore
-// we suppress them here.
-#ifdef _MSC_VER
-# pragma warning(push)
-# pragma warning(disable:4100)
-#endif
-
-// Various overloads for InvokeArgument<N>().
-//
-// The InvokeArgument<N>(a1, a2, ..., a_k) action invokes the N-th
-// (0-based) argument, which must be a k-ary callable, of the mock
-// function, with arguments a1, a2, ..., a_k.
-//
-// Notes:
-//
-// 1. The arguments are passed by value by default. If you need to
-// pass an argument by reference, wrap it inside ByRef(). For
-// example,
-//
-// InvokeArgument<1>(5, string("Hello"), ByRef(foo))
-//
-// passes 5 and string("Hello") by value, and passes foo by
-// reference.
-//
-// 2. If the callable takes an argument by reference but ByRef() is
-// not used, it will receive the reference to a copy of the value,
-// instead of the original value. For example, when the 0-th
-// argument of the mock function takes a const string&, the action
-//
-// InvokeArgument<0>(string("Hello"))
-//
-// makes a copy of the temporary string("Hello") object and passes a
-// reference of the copy, instead of the original temporary object,
-// to the callable. This makes it easy for a user to define an
-// InvokeArgument action from temporary values and have it performed
-// later.
-
-$range i 0..n
-$for i [[
-$range j 0..i-1
-
-ACTION_TEMPLATE(InvokeArgument,
- HAS_1_TEMPLATE_PARAMS(int, k),
- AND_$i[[]]_VALUE_PARAMS($for j, [[p$j]])) {
- return internal::CallableHelper<return_type>::Call(
- ::std::tr1::get<k>(args)$for j [[, p$j]]);
-}
-
-]]
-
-// Various overloads for ReturnNew<T>().
-//
-// The ReturnNew<T>(a1, a2, ..., a_k) action returns a pointer to a new
-// instance of type T, constructed on the heap with constructor arguments
-// a1, a2, ..., and a_k. The caller assumes ownership of the returned value.
-$range i 0..n
-$for i [[
-$range j 0..i-1
-$var ps = [[$for j, [[p$j]]]]
-
-ACTION_TEMPLATE(ReturnNew,
- HAS_1_TEMPLATE_PARAMS(typename, T),
- AND_$i[[]]_VALUE_PARAMS($ps)) {
- return new T($ps);
-}
-
-]]
-
-#ifdef _MSC_VER
-# pragma warning(pop)
-#endif
-
-} // namespace testing
-
-#endif // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_
diff --git a/src/testing/include/gmock/gmock-generated-function-mockers.h b/src/testing/include/gmock/gmock-generated-function-mockers.h
deleted file mode 100644
index 509d46cb..00000000
--- a/src/testing/include/gmock/gmock-generated-function-mockers.h
+++ /dev/null
@@ -1,929 +0,0 @@
-// This file was GENERATED by command:
-// pump.py gmock-generated-function-mockers.h.pump
-// DO NOT EDIT BY HAND!!!
-
-// Copyright 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-// Google Mock - a framework for writing C++ mock classes.
-//
-// This file implements function mockers of various arities.
-
-#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_
-#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_
-
-#include "gmock/gmock-spec-builders.h"
-#include "gmock/internal/gmock-internal-utils.h"
-
-namespace testing {
-namespace internal {
-
-template <typename F>
-class FunctionMockerBase;
-
-// Note: class FunctionMocker really belongs to the ::testing
-// namespace. However if we define it in ::testing, MSVC will
-// complain when classes in ::testing::internal declare it as a
-// friend class template. To workaround this compiler bug, we define
-// FunctionMocker in ::testing::internal and import it into ::testing.
-template <typename F>
-class FunctionMocker;
-
-template <typename R>
-class FunctionMocker<R()> : public
- internal::FunctionMockerBase<R()> {
- public:
- typedef R F();
- typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
-
- MockSpec<F>& With() {
- return this->current_spec();
- }
-
- R Invoke() {
- // Even though gcc and MSVC don't enforce it, 'this->' is required
- // by the C++ standard [14.6.4] here, as the base class type is
- // dependent on the template argument (and thus shouldn't be
- // looked into when resolving InvokeWith).
- return this->InvokeWith(ArgumentTuple());
- }
-};
-
-template <typename R, typename A1>
-class FunctionMocker<R(A1)> : public
- internal::FunctionMockerBase<R(A1)> {
- public:
- typedef R F(A1);
- typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
-
- MockSpec<F>& With(const Matcher<A1>& m1) {
- this->current_spec().SetMatchers(::std::tr1::make_tuple(m1));
- return this->current_spec();
- }
-
- R Invoke(A1 a1) {
- // Even though gcc and MSVC don't enforce it, 'this->' is required
- // by the C++ standard [14.6.4] here, as the base class type is
- // dependent on the template argument (and thus shouldn't be
- // looked into when resolving InvokeWith).
- return this->InvokeWith(ArgumentTuple(a1));
- }
-};
-
-template <typename R, typename A1, typename A2>
-class FunctionMocker<R(A1, A2)> : public
- internal::FunctionMockerBase<R(A1, A2)> {
- public:
- typedef R F(A1, A2);
- typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
-
- MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2) {
- this->current_spec().SetMatchers(::std::tr1::make_tuple(m1, m2));
- return this->current_spec();
- }
-
- R Invoke(A1 a1, A2 a2) {
- // Even though gcc and MSVC don't enforce it, 'this->' is required
- // by the C++ standard [14.6.4] here, as the base class type is
- // dependent on the template argument (and thus shouldn't be
- // looked into when resolving InvokeWith).
- return this->InvokeWith(ArgumentTuple(a1, a2));
- }
-};
-
-template <typename R, typename A1, typename A2, typename A3>
-class FunctionMocker<R(A1, A2, A3)> : public
- internal::FunctionMockerBase<R(A1, A2, A3)> {
- public:
- typedef R F(A1, A2, A3);
- typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
-
- MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2,
- const Matcher<A3>& m3) {
- this->current_spec().SetMatchers(::std::tr1::make_tuple(m1, m2, m3));
- return this->current_spec();
- }
-
- R Invoke(A1 a1, A2 a2, A3 a3) {
- // Even though gcc and MSVC don't enforce it, 'this->' is required
- // by the C++ standard [14.6.4] here, as the base class type is
- // dependent on the template argument (and thus shouldn't be
- // looked into when resolving InvokeWith).
- return this->InvokeWith(ArgumentTuple(a1, a2, a3));
- }
-};
-
-template <typename R, typename A1, typename A2, typename A3, typename A4>
-class FunctionMocker<R(A1, A2, A3, A4)> : public
- internal::FunctionMockerBase<R(A1, A2, A3, A4)> {
- public:
- typedef R F(A1, A2, A3, A4);
- typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
-
- MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2,
- const Matcher<A3>& m3, const Matcher<A4>& m4) {
- this->current_spec().SetMatchers(::std::tr1::make_tuple(m1, m2, m3, m4));
- return this->current_spec();
- }
-
- R Invoke(A1 a1, A2 a2, A3 a3, A4 a4) {
- // Even though gcc and MSVC don't enforce it, 'this->' is required
- // by the C++ standard [14.6.4] here, as the base class type is
- // dependent on the template argument (and thus shouldn't be
- // looked into when resolving InvokeWith).
- return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4));
- }
-};
-
-template <typename R, typename A1, typename A2, typename A3, typename A4,
- typename A5>
-class FunctionMocker<R(A1, A2, A3, A4, A5)> : public
- internal::FunctionMockerBase<R(A1, A2, A3, A4, A5)> {
- public:
- typedef R F(A1, A2, A3, A4, A5);
- typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
-
- MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2,
- const Matcher<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5) {
- this->current_spec().SetMatchers(::std::tr1::make_tuple(m1, m2, m3, m4,
- m5));
- return this->current_spec();
- }
-
- R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) {
- // Even though gcc and MSVC don't enforce it, 'this->' is required
- // by the C++ standard [14.6.4] here, as the base class type is
- // dependent on the template argument (and thus shouldn't be
- // looked into when resolving InvokeWith).
- return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5));
- }
-};
-
-template <typename R, typename A1, typename A2, typename A3, typename A4,
- typename A5, typename A6>
-class FunctionMocker<R(A1, A2, A3, A4, A5, A6)> : public
- internal::FunctionMockerBase<R(A1, A2, A3, A4, A5, A6)> {
- public:
- typedef R F(A1, A2, A3, A4, A5, A6);
- typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
-
- MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2,
- const Matcher<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5,
- const Matcher<A6>& m6) {
- this->current_spec().SetMatchers(::std::tr1::make_tuple(m1, m2, m3, m4, m5,
- m6));
- return this->current_spec();
- }
-
- R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) {
- // Even though gcc and MSVC don't enforce it, 'this->' is required
- // by the C++ standard [14.6.4] here, as the base class type is
- // dependent on the template argument (and thus shouldn't be
- // looked into when resolving InvokeWith).
- return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5, a6));
- }
-};
-
-template <typename R, typename A1, typename A2, typename A3, typename A4,
- typename A5, typename A6, typename A7>
-class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7)> : public
- internal::FunctionMockerBase<R(A1, A2, A3, A4, A5, A6, A7)> {
- public:
- typedef R F(A1, A2, A3, A4, A5, A6, A7);
- typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
-
- MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2,
- const Matcher<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5,
- const Matcher<A6>& m6, const Matcher<A7>& m7) {
- this->current_spec().SetMatchers(::std::tr1::make_tuple(m1, m2, m3, m4, m5,
- m6, m7));
- return this->current_spec();
- }
-
- R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) {
- // Even though gcc and MSVC don't enforce it, 'this->' is required
- // by the C++ standard [14.6.4] here, as the base class type is
- // dependent on the template argument (and thus shouldn't be
- // looked into when resolving InvokeWith).
- return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5, a6, a7));
- }
-};
-
-template <typename R, typename A1, typename A2, typename A3, typename A4,
- typename A5, typename A6, typename A7, typename A8>
-class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7, A8)> : public
- internal::FunctionMockerBase<R(A1, A2, A3, A4, A5, A6, A7, A8)> {
- public:
- typedef R F(A1, A2, A3, A4, A5, A6, A7, A8);
- typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
-
- MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2,
- const Matcher<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5,
- const Matcher<A6>& m6, const Matcher<A7>& m7, const Matcher<A8>& m8) {
- this->current_spec().SetMatchers(::std::tr1::make_tuple(m1, m2, m3, m4, m5,
- m6, m7, m8));
- return this->current_spec();
- }
-
- R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) {
- // Even though gcc and MSVC don't enforce it, 'this->' is required
- // by the C++ standard [14.6.4] here, as the base class type is
- // dependent on the template argument (and thus shouldn't be
- // looked into when resolving InvokeWith).
- return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5, a6, a7, a8));
- }
-};
-
-template <typename R, typename A1, typename A2, typename A3, typename A4,
- typename A5, typename A6, typename A7, typename A8, typename A9>
-class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7, A8, A9)> : public
- internal::FunctionMockerBase<R(A1, A2, A3, A4, A5, A6, A7, A8, A9)> {
- public:
- typedef R F(A1, A2, A3, A4, A5, A6, A7, A8, A9);
- typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
-
- MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2,
- const Matcher<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5,
- const Matcher<A6>& m6, const Matcher<A7>& m7, const Matcher<A8>& m8,
- const Matcher<A9>& m9) {
- this->current_spec().SetMatchers(::std::tr1::make_tuple(m1, m2, m3, m4, m5,
- m6, m7, m8, m9));
- return this->current_spec();
- }
-
- R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) {
- // Even though gcc and MSVC don't enforce it, 'this->' is required
- // by the C++ standard [14.6.4] here, as the base class type is
- // dependent on the template argument (and thus shouldn't be
- // looked into when resolving InvokeWith).
- return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5, a6, a7, a8, a9));
- }
-};
-
-template <typename R, typename A1, typename A2, typename A3, typename A4,
- typename A5, typename A6, typename A7, typename A8, typename A9,
- typename A10>
-class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)> : public
- internal::FunctionMockerBase<R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)> {
- public:
- typedef R F(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10);
- typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
-
- MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2,
- const Matcher<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5,
- const Matcher<A6>& m6, const Matcher<A7>& m7, const Matcher<A8>& m8,
- const Matcher<A9>& m9, const Matcher<A10>& m10) {
- this->current_spec().SetMatchers(::std::tr1::make_tuple(m1, m2, m3, m4, m5,
- m6, m7, m8, m9, m10));
- return this->current_spec();
- }
-
- R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9,
- A10 a10) {
- // Even though gcc and MSVC don't enforce it, 'this->' is required
- // by the C++ standard [14.6.4] here, as the base class type is
- // dependent on the template argument (and thus shouldn't be
- // looked into when resolving InvokeWith).
- return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5, a6, a7, a8, a9,
- a10));
- }
-};
-
-} // namespace internal
-
-// The style guide prohibits "using" statements in a namespace scope
-// inside a header file. However, the FunctionMocker class template
-// is meant to be defined in the ::testing namespace. The following
-// line is just a trick for working around a bug in MSVC 8.0, which
-// cannot handle it if we define FunctionMocker in ::testing.
-using internal::FunctionMocker;
-
-// The result type of function type F.
-// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
-#define GMOCK_RESULT_(tn, F) tn ::testing::internal::Function<F>::Result
-
-// The type of argument N of function type F.
-// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
-#define GMOCK_ARG_(tn, F, N) tn ::testing::internal::Function<F>::Argument##N
-
-// The matcher type for argument N of function type F.
-// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
-#define GMOCK_MATCHER_(tn, F, N) const ::testing::Matcher<GMOCK_ARG_(tn, F, N)>&
-
-// The variable for mocking the given method.
-// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
-#define GMOCK_MOCKER_(arity, constness, Method) \
- GTEST_CONCAT_TOKEN_(gmock##constness##arity##_##Method##_, __LINE__)
-
-// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
-#define GMOCK_METHOD0_(tn, constness, ct, Method, F) \
- GMOCK_RESULT_(tn, F) ct Method() constness { \
- GTEST_COMPILE_ASSERT_(::std::tr1::tuple_size< \
- tn ::testing::internal::Function<F>::ArgumentTuple>::value == 0, \
- this_method_does_not_take_0_arguments); \
- GMOCK_MOCKER_(0, constness, Method).SetOwnerAndName(this, #Method); \
- return GMOCK_MOCKER_(0, constness, Method).Invoke(); \
- } \
- ::testing::MockSpec<F>& \
- gmock_##Method() constness { \
- GMOCK_MOCKER_(0, constness, Method).RegisterOwner(this); \
- return GMOCK_MOCKER_(0, constness, Method).With(); \
- } \
- mutable ::testing::FunctionMocker<F> GMOCK_MOCKER_(0, constness, Method)
-
-// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
-#define GMOCK_METHOD1_(tn, constness, ct, Method, F) \
- GMOCK_RESULT_(tn, F) ct Method(GMOCK_ARG_(tn, F, 1) gmock_a1) constness { \
- GTEST_COMPILE_ASSERT_(::std::tr1::tuple_size< \
- tn ::testing::internal::Function<F>::ArgumentTuple>::value == 1, \
- this_method_does_not_take_1_argument); \
- GMOCK_MOCKER_(1, constness, Method).SetOwnerAndName(this, #Method); \
- return GMOCK_MOCKER_(1, constness, Method).Invoke(gmock_a1); \
- } \
- ::testing::MockSpec<F>& \
- gmock_##Method(GMOCK_MATCHER_(tn, F, 1) gmock_a1) constness { \
- GMOCK_MOCKER_(1, constness, Method).RegisterOwner(this); \
- return GMOCK_MOCKER_(1, constness, Method).With(gmock_a1); \
- } \
- mutable ::testing::FunctionMocker<F> GMOCK_MOCKER_(1, constness, Method)
-
-// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
-#define GMOCK_METHOD2_(tn, constness, ct, Method, F) \
- GMOCK_RESULT_(tn, F) ct Method(GMOCK_ARG_(tn, F, 1) gmock_a1, \
- GMOCK_ARG_(tn, F, 2) gmock_a2) constness { \
- GTEST_COMPILE_ASSERT_(::std::tr1::tuple_size< \
- tn ::testing::internal::Function<F>::ArgumentTuple>::value == 2, \
- this_method_does_not_take_2_arguments); \
- GMOCK_MOCKER_(2, constness, Method).SetOwnerAndName(this, #Method); \
- return GMOCK_MOCKER_(2, constness, Method).Invoke(gmock_a1, gmock_a2); \
- } \
- ::testing::MockSpec<F>& \
- gmock_##Method(GMOCK_MATCHER_(tn, F, 1) gmock_a1, \
- GMOCK_MATCHER_(tn, F, 2) gmock_a2) constness { \
- GMOCK_MOCKER_(2, constness, Method).RegisterOwner(this); \
- return GMOCK_MOCKER_(2, constness, Method).With(gmock_a1, gmock_a2); \
- } \
- mutable ::testing::FunctionMocker<F> GMOCK_MOCKER_(2, constness, Method)
-
-// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
-#define GMOCK_METHOD3_(tn, constness, ct, Method, F) \
- GMOCK_RESULT_(tn, F) ct Method(GMOCK_ARG_(tn, F, 1) gmock_a1, \
- GMOCK_ARG_(tn, F, 2) gmock_a2, \
- GMOCK_ARG_(tn, F, 3) gmock_a3) constness { \
- GTEST_COMPILE_ASSERT_(::std::tr1::tuple_size< \
- tn ::testing::internal::Function<F>::ArgumentTuple>::value == 3, \
- this_method_does_not_take_3_arguments); \
- GMOCK_MOCKER_(3, constness, Method).SetOwnerAndName(this, #Method); \
- return GMOCK_MOCKER_(3, constness, Method).Invoke(gmock_a1, gmock_a2, \
- gmock_a3); \
- } \
- ::testing::MockSpec<F>& \
- gmock_##Method(GMOCK_MATCHER_(tn, F, 1) gmock_a1, \
- GMOCK_MATCHER_(tn, F, 2) gmock_a2, \
- GMOCK_MATCHER_(tn, F, 3) gmock_a3) constness { \
- GMOCK_MOCKER_(3, constness, Method).RegisterOwner(this); \
- return GMOCK_MOCKER_(3, constness, Method).With(gmock_a1, gmock_a2, \
- gmock_a3); \
- } \
- mutable ::testing::FunctionMocker<F> GMOCK_MOCKER_(3, constness, Method)
-
-// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
-#define GMOCK_METHOD4_(tn, constness, ct, Method, F) \
- GMOCK_RESULT_(tn, F) ct Method(GMOCK_ARG_(tn, F, 1) gmock_a1, \
- GMOCK_ARG_(tn, F, 2) gmock_a2, \
- GMOCK_ARG_(tn, F, 3) gmock_a3, \
- GMOCK_ARG_(tn, F, 4) gmock_a4) constness { \
- GTEST_COMPILE_ASSERT_(::std::tr1::tuple_size< \
- tn ::testing::internal::Function<F>::ArgumentTuple>::value == 4, \
- this_method_does_not_take_4_arguments); \
- GMOCK_MOCKER_(4, constness, Method).SetOwnerAndName(this, #Method); \
- return GMOCK_MOCKER_(4, constness, Method).Invoke(gmock_a1, gmock_a2, \
- gmock_a3, gmock_a4); \
- } \
- ::testing::MockSpec<F>& \
- gmock_##Method(GMOCK_MATCHER_(tn, F, 1) gmock_a1, \
- GMOCK_MATCHER_(tn, F, 2) gmock_a2, \
- GMOCK_MATCHER_(tn, F, 3) gmock_a3, \
- GMOCK_MATCHER_(tn, F, 4) gmock_a4) constness { \
- GMOCK_MOCKER_(4, constness, Method).RegisterOwner(this); \
- return GMOCK_MOCKER_(4, constness, Method).With(gmock_a1, gmock_a2, \
- gmock_a3, gmock_a4); \
- } \
- mutable ::testing::FunctionMocker<F> GMOCK_MOCKER_(4, constness, Method)
-
-// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
-#define GMOCK_METHOD5_(tn, constness, ct, Method, F) \
- GMOCK_RESULT_(tn, F) ct Method(GMOCK_ARG_(tn, F, 1) gmock_a1, \
- GMOCK_ARG_(tn, F, 2) gmock_a2, \
- GMOCK_ARG_(tn, F, 3) gmock_a3, \
- GMOCK_ARG_(tn, F, 4) gmock_a4, \
- GMOCK_ARG_(tn, F, 5) gmock_a5) constness { \
- GTEST_COMPILE_ASSERT_(::std::tr1::tuple_size< \
- tn ::testing::internal::Function<F>::ArgumentTuple>::value == 5, \
- this_method_does_not_take_5_arguments); \
- GMOCK_MOCKER_(5, constness, Method).SetOwnerAndName(this, #Method); \
- return GMOCK_MOCKER_(5, constness, Method).Invoke(gmock_a1, gmock_a2, \
- gmock_a3, gmock_a4, gmock_a5); \
- } \
- ::testing::MockSpec<F>& \
- gmock_##Method(GMOCK_MATCHER_(tn, F, 1) gmock_a1, \
- GMOCK_MATCHER_(tn, F, 2) gmock_a2, \
- GMOCK_MATCHER_(tn, F, 3) gmock_a3, \
- GMOCK_MATCHER_(tn, F, 4) gmock_a4, \
- GMOCK_MATCHER_(tn, F, 5) gmock_a5) constness { \
- GMOCK_MOCKER_(5, constness, Method).RegisterOwner(this); \
- return GMOCK_MOCKER_(5, constness, Method).With(gmock_a1, gmock_a2, \
- gmock_a3, gmock_a4, gmock_a5); \
- } \
- mutable ::testing::FunctionMocker<F> GMOCK_MOCKER_(5, constness, Method)
-
-// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
-#define GMOCK_METHOD6_(tn, constness, ct, Method, F) \
- GMOCK_RESULT_(tn, F) ct Method(GMOCK_ARG_(tn, F, 1) gmock_a1, \
- GMOCK_ARG_(tn, F, 2) gmock_a2, \
- GMOCK_ARG_(tn, F, 3) gmock_a3, \
- GMOCK_ARG_(tn, F, 4) gmock_a4, \
- GMOCK_ARG_(tn, F, 5) gmock_a5, \
- GMOCK_ARG_(tn, F, 6) gmock_a6) constness { \
- GTEST_COMPILE_ASSERT_(::std::tr1::tuple_size< \
- tn ::testing::internal::Function<F>::ArgumentTuple>::value == 6, \
- this_method_does_not_take_6_arguments); \
- GMOCK_MOCKER_(6, constness, Method).SetOwnerAndName(this, #Method); \
- return GMOCK_MOCKER_(6, constness, Method).Invoke(gmock_a1, gmock_a2, \
- gmock_a3, gmock_a4, gmock_a5, gmock_a6); \
- } \
- ::testing::MockSpec<F>& \
- gmock_##Method(GMOCK_MATCHER_(tn, F, 1) gmock_a1, \
- GMOCK_MATCHER_(tn, F, 2) gmock_a2, \
- GMOCK_MATCHER_(tn, F, 3) gmock_a3, \
- GMOCK_MATCHER_(tn, F, 4) gmock_a4, \
- GMOCK_MATCHER_(tn, F, 5) gmock_a5, \
- GMOCK_MATCHER_(tn, F, 6) gmock_a6) constness { \
- GMOCK_MOCKER_(6, constness, Method).RegisterOwner(this); \
- return GMOCK_MOCKER_(6, constness, Method).With(gmock_a1, gmock_a2, \
- gmock_a3, gmock_a4, gmock_a5, gmock_a6); \
- } \
- mutable ::testing::FunctionMocker<F> GMOCK_MOCKER_(6, constness, Method)
-
-// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
-#define GMOCK_METHOD7_(tn, constness, ct, Method, F) \
- GMOCK_RESULT_(tn, F) ct Method(GMOCK_ARG_(tn, F, 1) gmock_a1, \
- GMOCK_ARG_(tn, F, 2) gmock_a2, \
- GMOCK_ARG_(tn, F, 3) gmock_a3, \
- GMOCK_ARG_(tn, F, 4) gmock_a4, \
- GMOCK_ARG_(tn, F, 5) gmock_a5, \
- GMOCK_ARG_(tn, F, 6) gmock_a6, \
- GMOCK_ARG_(tn, F, 7) gmock_a7) constness { \
- GTEST_COMPILE_ASSERT_(::std::tr1::tuple_size< \
- tn ::testing::internal::Function<F>::ArgumentTuple>::value == 7, \
- this_method_does_not_take_7_arguments); \
- GMOCK_MOCKER_(7, constness, Method).SetOwnerAndName(this, #Method); \
- return GMOCK_MOCKER_(7, constness, Method).Invoke(gmock_a1, gmock_a2, \
- gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7); \
- } \
- ::testing::MockSpec<F>& \
- gmock_##Method(GMOCK_MATCHER_(tn, F, 1) gmock_a1, \
- GMOCK_MATCHER_(tn, F, 2) gmock_a2, \
- GMOCK_MATCHER_(tn, F, 3) gmock_a3, \
- GMOCK_MATCHER_(tn, F, 4) gmock_a4, \
- GMOCK_MATCHER_(tn, F, 5) gmock_a5, \
- GMOCK_MATCHER_(tn, F, 6) gmock_a6, \
- GMOCK_MATCHER_(tn, F, 7) gmock_a7) constness { \
- GMOCK_MOCKER_(7, constness, Method).RegisterOwner(this); \
- return GMOCK_MOCKER_(7, constness, Method).With(gmock_a1, gmock_a2, \
- gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7); \
- } \
- mutable ::testing::FunctionMocker<F> GMOCK_MOCKER_(7, constness, Method)
-
-// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
-#define GMOCK_METHOD8_(tn, constness, ct, Method, F) \
- GMOCK_RESULT_(tn, F) ct Method(GMOCK_ARG_(tn, F, 1) gmock_a1, \
- GMOCK_ARG_(tn, F, 2) gmock_a2, \
- GMOCK_ARG_(tn, F, 3) gmock_a3, \
- GMOCK_ARG_(tn, F, 4) gmock_a4, \
- GMOCK_ARG_(tn, F, 5) gmock_a5, \
- GMOCK_ARG_(tn, F, 6) gmock_a6, \
- GMOCK_ARG_(tn, F, 7) gmock_a7, \
- GMOCK_ARG_(tn, F, 8) gmock_a8) constness { \
- GTEST_COMPILE_ASSERT_(::std::tr1::tuple_size< \
- tn ::testing::internal::Function<F>::ArgumentTuple>::value == 8, \
- this_method_does_not_take_8_arguments); \
- GMOCK_MOCKER_(8, constness, Method).SetOwnerAndName(this, #Method); \
- return GMOCK_MOCKER_(8, constness, Method).Invoke(gmock_a1, gmock_a2, \
- gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8); \
- } \
- ::testing::MockSpec<F>& \
- gmock_##Method(GMOCK_MATCHER_(tn, F, 1) gmock_a1, \
- GMOCK_MATCHER_(tn, F, 2) gmock_a2, \
- GMOCK_MATCHER_(tn, F, 3) gmock_a3, \
- GMOCK_MATCHER_(tn, F, 4) gmock_a4, \
- GMOCK_MATCHER_(tn, F, 5) gmock_a5, \
- GMOCK_MATCHER_(tn, F, 6) gmock_a6, \
- GMOCK_MATCHER_(tn, F, 7) gmock_a7, \
- GMOCK_MATCHER_(tn, F, 8) gmock_a8) constness { \
- GMOCK_MOCKER_(8, constness, Method).RegisterOwner(this); \
- return GMOCK_MOCKER_(8, constness, Method).With(gmock_a1, gmock_a2, \
- gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8); \
- } \
- mutable ::testing::FunctionMocker<F> GMOCK_MOCKER_(8, constness, Method)
-
-// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
-#define GMOCK_METHOD9_(tn, constness, ct, Method, F) \
- GMOCK_RESULT_(tn, F) ct Method(GMOCK_ARG_(tn, F, 1) gmock_a1, \
- GMOCK_ARG_(tn, F, 2) gmock_a2, \
- GMOCK_ARG_(tn, F, 3) gmock_a3, \
- GMOCK_ARG_(tn, F, 4) gmock_a4, \
- GMOCK_ARG_(tn, F, 5) gmock_a5, \
- GMOCK_ARG_(tn, F, 6) gmock_a6, \
- GMOCK_ARG_(tn, F, 7) gmock_a7, \
- GMOCK_ARG_(tn, F, 8) gmock_a8, \
- GMOCK_ARG_(tn, F, 9) gmock_a9) constness { \
- GTEST_COMPILE_ASSERT_(::std::tr1::tuple_size< \
- tn ::testing::internal::Function<F>::ArgumentTuple>::value == 9, \
- this_method_does_not_take_9_arguments); \
- GMOCK_MOCKER_(9, constness, Method).SetOwnerAndName(this, #Method); \
- return GMOCK_MOCKER_(9, constness, Method).Invoke(gmock_a1, gmock_a2, \
- gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8, \
- gmock_a9); \
- } \
- ::testing::MockSpec<F>& \
- gmock_##Method(GMOCK_MATCHER_(tn, F, 1) gmock_a1, \
- GMOCK_MATCHER_(tn, F, 2) gmock_a2, \
- GMOCK_MATCHER_(tn, F, 3) gmock_a3, \
- GMOCK_MATCHER_(tn, F, 4) gmock_a4, \
- GMOCK_MATCHER_(tn, F, 5) gmock_a5, \
- GMOCK_MATCHER_(tn, F, 6) gmock_a6, \
- GMOCK_MATCHER_(tn, F, 7) gmock_a7, \
- GMOCK_MATCHER_(tn, F, 8) gmock_a8, \
- GMOCK_MATCHER_(tn, F, 9) gmock_a9) constness { \
- GMOCK_MOCKER_(9, constness, Method).RegisterOwner(this); \
- return GMOCK_MOCKER_(9, constness, Method).With(gmock_a1, gmock_a2, \
- gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8, \
- gmock_a9); \
- } \
- mutable ::testing::FunctionMocker<F> GMOCK_MOCKER_(9, constness, Method)
-
-// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
-#define GMOCK_METHOD10_(tn, constness, ct, Method, F) \
- GMOCK_RESULT_(tn, F) ct Method(GMOCK_ARG_(tn, F, 1) gmock_a1, \
- GMOCK_ARG_(tn, F, 2) gmock_a2, \
- GMOCK_ARG_(tn, F, 3) gmock_a3, \
- GMOCK_ARG_(tn, F, 4) gmock_a4, \
- GMOCK_ARG_(tn, F, 5) gmock_a5, \
- GMOCK_ARG_(tn, F, 6) gmock_a6, \
- GMOCK_ARG_(tn, F, 7) gmock_a7, \
- GMOCK_ARG_(tn, F, 8) gmock_a8, \
- GMOCK_ARG_(tn, F, 9) gmock_a9, \
- GMOCK_ARG_(tn, F, 10) gmock_a10) constness { \
- GTEST_COMPILE_ASSERT_(::std::tr1::tuple_size< \
- tn ::testing::internal::Function<F>::ArgumentTuple>::value == 10, \
- this_method_does_not_take_10_arguments); \
- GMOCK_MOCKER_(10, constness, Method).SetOwnerAndName(this, #Method); \
- return GMOCK_MOCKER_(10, constness, Method).Invoke(gmock_a1, gmock_a2, \
- gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8, gmock_a9, \
- gmock_a10); \
- } \
- ::testing::MockSpec<F>& \
- gmock_##Method(GMOCK_MATCHER_(tn, F, 1) gmock_a1, \
- GMOCK_MATCHER_(tn, F, 2) gmock_a2, \
- GMOCK_MATCHER_(tn, F, 3) gmock_a3, \
- GMOCK_MATCHER_(tn, F, 4) gmock_a4, \
- GMOCK_MATCHER_(tn, F, 5) gmock_a5, \
- GMOCK_MATCHER_(tn, F, 6) gmock_a6, \
- GMOCK_MATCHER_(tn, F, 7) gmock_a7, \
- GMOCK_MATCHER_(tn, F, 8) gmock_a8, \
- GMOCK_MATCHER_(tn, F, 9) gmock_a9, \
- GMOCK_MATCHER_(tn, F, 10) gmock_a10) constness { \
- GMOCK_MOCKER_(10, constness, Method).RegisterOwner(this); \
- return GMOCK_MOCKER_(10, constness, Method).With(gmock_a1, gmock_a2, \
- gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8, gmock_a9, \
- gmock_a10); \
- } \
- mutable ::testing::FunctionMocker<F> GMOCK_MOCKER_(10, constness, Method)
-
-#define MOCK_METHOD0(m, F) GMOCK_METHOD0_(, , , m, F)
-#define MOCK_METHOD1(m, F) GMOCK_METHOD1_(, , , m, F)
-#define MOCK_METHOD2(m, F) GMOCK_METHOD2_(, , , m, F)
-#define MOCK_METHOD3(m, F) GMOCK_METHOD3_(, , , m, F)
-#define MOCK_METHOD4(m, F) GMOCK_METHOD4_(, , , m, F)
-#define MOCK_METHOD5(m, F) GMOCK_METHOD5_(, , , m, F)
-#define MOCK_METHOD6(m, F) GMOCK_METHOD6_(, , , m, F)
-#define MOCK_METHOD7(m, F) GMOCK_METHOD7_(, , , m, F)
-#define MOCK_METHOD8(m, F) GMOCK_METHOD8_(, , , m, F)
-#define MOCK_METHOD9(m, F) GMOCK_METHOD9_(, , , m, F)
-#define MOCK_METHOD10(m, F) GMOCK_METHOD10_(, , , m, F)
-
-#define MOCK_CONST_METHOD0(m, F) GMOCK_METHOD0_(, const, , m, F)
-#define MOCK_CONST_METHOD1(m, F) GMOCK_METHOD1_(, const, , m, F)
-#define MOCK_CONST_METHOD2(m, F) GMOCK_METHOD2_(, const, , m, F)
-#define MOCK_CONST_METHOD3(m, F) GMOCK_METHOD3_(, const, , m, F)
-#define MOCK_CONST_METHOD4(m, F) GMOCK_METHOD4_(, const, , m, F)
-#define MOCK_CONST_METHOD5(m, F) GMOCK_METHOD5_(, const, , m, F)
-#define MOCK_CONST_METHOD6(m, F) GMOCK_METHOD6_(, const, , m, F)
-#define MOCK_CONST_METHOD7(m, F) GMOCK_METHOD7_(, const, , m, F)
-#define MOCK_CONST_METHOD8(m, F) GMOCK_METHOD8_(, const, , m, F)
-#define MOCK_CONST_METHOD9(m, F) GMOCK_METHOD9_(, const, , m, F)
-#define MOCK_CONST_METHOD10(m, F) GMOCK_METHOD10_(, const, , m, F)
-
-#define MOCK_METHOD0_T(m, F) GMOCK_METHOD0_(typename, , , m, F)
-#define MOCK_METHOD1_T(m, F) GMOCK_METHOD1_(typename, , , m, F)
-#define MOCK_METHOD2_T(m, F) GMOCK_METHOD2_(typename, , , m, F)
-#define MOCK_METHOD3_T(m, F) GMOCK_METHOD3_(typename, , , m, F)
-#define MOCK_METHOD4_T(m, F) GMOCK_METHOD4_(typename, , , m, F)
-#define MOCK_METHOD5_T(m, F) GMOCK_METHOD5_(typename, , , m, F)
-#define MOCK_METHOD6_T(m, F) GMOCK_METHOD6_(typename, , , m, F)
-#define MOCK_METHOD7_T(m, F) GMOCK_METHOD7_(typename, , , m, F)
-#define MOCK_METHOD8_T(m, F) GMOCK_METHOD8_(typename, , , m, F)
-#define MOCK_METHOD9_T(m, F) GMOCK_METHOD9_(typename, , , m, F)
-#define MOCK_METHOD10_T(m, F) GMOCK_METHOD10_(typename, , , m, F)
-
-#define MOCK_CONST_METHOD0_T(m, F) GMOCK_METHOD0_(typename, const, , m, F)
-#define MOCK_CONST_METHOD1_T(m, F) GMOCK_METHOD1_(typename, const, , m, F)
-#define MOCK_CONST_METHOD2_T(m, F) GMOCK_METHOD2_(typename, const, , m, F)
-#define MOCK_CONST_METHOD3_T(m, F) GMOCK_METHOD3_(typename, const, , m, F)
-#define MOCK_CONST_METHOD4_T(m, F) GMOCK_METHOD4_(typename, const, , m, F)
-#define MOCK_CONST_METHOD5_T(m, F) GMOCK_METHOD5_(typename, const, , m, F)
-#define MOCK_CONST_METHOD6_T(m, F) GMOCK_METHOD6_(typename, const, , m, F)
-#define MOCK_CONST_METHOD7_T(m, F) GMOCK_METHOD7_(typename, const, , m, F)
-#define MOCK_CONST_METHOD8_T(m, F) GMOCK_METHOD8_(typename, const, , m, F)
-#define MOCK_CONST_METHOD9_T(m, F) GMOCK_METHOD9_(typename, const, , m, F)
-#define MOCK_CONST_METHOD10_T(m, F) GMOCK_METHOD10_(typename, const, , m, F)
-
-#define MOCK_METHOD0_WITH_CALLTYPE(ct, m, F) GMOCK_METHOD0_(, , ct, m, F)
-#define MOCK_METHOD1_WITH_CALLTYPE(ct, m, F) GMOCK_METHOD1_(, , ct, m, F)
-#define MOCK_METHOD2_WITH_CALLTYPE(ct, m, F) GMOCK_METHOD2_(, , ct, m, F)
-#define MOCK_METHOD3_WITH_CALLTYPE(ct, m, F) GMOCK_METHOD3_(, , ct, m, F)
-#define MOCK_METHOD4_WITH_CALLTYPE(ct, m, F) GMOCK_METHOD4_(, , ct, m, F)
-#define MOCK_METHOD5_WITH_CALLTYPE(ct, m, F) GMOCK_METHOD5_(, , ct, m, F)
-#define MOCK_METHOD6_WITH_CALLTYPE(ct, m, F) GMOCK_METHOD6_(, , ct, m, F)
-#define MOCK_METHOD7_WITH_CALLTYPE(ct, m, F) GMOCK_METHOD7_(, , ct, m, F)
-#define MOCK_METHOD8_WITH_CALLTYPE(ct, m, F) GMOCK_METHOD8_(, , ct, m, F)
-#define MOCK_METHOD9_WITH_CALLTYPE(ct, m, F) GMOCK_METHOD9_(, , ct, m, F)
-#define MOCK_METHOD10_WITH_CALLTYPE(ct, m, F) GMOCK_METHOD10_(, , ct, m, F)
-
-#define MOCK_CONST_METHOD0_WITH_CALLTYPE(ct, m, F) \
- GMOCK_METHOD0_(, const, ct, m, F)
-#define MOCK_CONST_METHOD1_WITH_CALLTYPE(ct, m, F) \
- GMOCK_METHOD1_(, const, ct, m, F)
-#define MOCK_CONST_METHOD2_WITH_CALLTYPE(ct, m, F) \
- GMOCK_METHOD2_(, const, ct, m, F)
-#define MOCK_CONST_METHOD3_WITH_CALLTYPE(ct, m, F) \
- GMOCK_METHOD3_(, const, ct, m, F)
-#define MOCK_CONST_METHOD4_WITH_CALLTYPE(ct, m, F) \
- GMOCK_METHOD4_(, const, ct, m, F)
-#define MOCK_CONST_METHOD5_WITH_CALLTYPE(ct, m, F) \
- GMOCK_METHOD5_(, const, ct, m, F)
-#define MOCK_CONST_METHOD6_WITH_CALLTYPE(ct, m, F) \
- GMOCK_METHOD6_(, const, ct, m, F)
-#define MOCK_CONST_METHOD7_WITH_CALLTYPE(ct, m, F) \
- GMOCK_METHOD7_(, const, ct, m, F)
-#define MOCK_CONST_METHOD8_WITH_CALLTYPE(ct, m, F) \
- GMOCK_METHOD8_(, const, ct, m, F)
-#define MOCK_CONST_METHOD9_WITH_CALLTYPE(ct, m, F) \
- GMOCK_METHOD9_(, const, ct, m, F)
-#define MOCK_CONST_METHOD10_WITH_CALLTYPE(ct, m, F) \
- GMOCK_METHOD10_(, const, ct, m, F)
-
-#define MOCK_METHOD0_T_WITH_CALLTYPE(ct, m, F) \
- GMOCK_METHOD0_(typename, , ct, m, F)
-#define MOCK_METHOD1_T_WITH_CALLTYPE(ct, m, F) \
- GMOCK_METHOD1_(typename, , ct, m, F)
-#define MOCK_METHOD2_T_WITH_CALLTYPE(ct, m, F) \
- GMOCK_METHOD2_(typename, , ct, m, F)
-#define MOCK_METHOD3_T_WITH_CALLTYPE(ct, m, F) \
- GMOCK_METHOD3_(typename, , ct, m, F)
-#define MOCK_METHOD4_T_WITH_CALLTYPE(ct, m, F) \
- GMOCK_METHOD4_(typename, , ct, m, F)
-#define MOCK_METHOD5_T_WITH_CALLTYPE(ct, m, F) \
- GMOCK_METHOD5_(typename, , ct, m, F)
-#define MOCK_METHOD6_T_WITH_CALLTYPE(ct, m, F) \
- GMOCK_METHOD6_(typename, , ct, m, F)
-#define MOCK_METHOD7_T_WITH_CALLTYPE(ct, m, F) \
- GMOCK_METHOD7_(typename, , ct, m, F)
-#define MOCK_METHOD8_T_WITH_CALLTYPE(ct, m, F) \
- GMOCK_METHOD8_(typename, , ct, m, F)
-#define MOCK_METHOD9_T_WITH_CALLTYPE(ct, m, F) \
- GMOCK_METHOD9_(typename, , ct, m, F)
-#define MOCK_METHOD10_T_WITH_CALLTYPE(ct, m, F) \
- GMOCK_METHOD10_(typename, , ct, m, F)
-
-#define MOCK_CONST_METHOD0_T_WITH_CALLTYPE(ct, m, F) \
- GMOCK_METHOD0_(typename, const, ct, m, F)
-#define MOCK_CONST_METHOD1_T_WITH_CALLTYPE(ct, m, F) \
- GMOCK_METHOD1_(typename, const, ct, m, F)
-#define MOCK_CONST_METHOD2_T_WITH_CALLTYPE(ct, m, F) \
- GMOCK_METHOD2_(typename, const, ct, m, F)
-#define MOCK_CONST_METHOD3_T_WITH_CALLTYPE(ct, m, F) \
- GMOCK_METHOD3_(typename, const, ct, m, F)
-#define MOCK_CONST_METHOD4_T_WITH_CALLTYPE(ct, m, F) \
- GMOCK_METHOD4_(typename, const, ct, m, F)
-#define MOCK_CONST_METHOD5_T_WITH_CALLTYPE(ct, m, F) \
- GMOCK_METHOD5_(typename, const, ct, m, F)
-#define MOCK_CONST_METHOD6_T_WITH_CALLTYPE(ct, m, F) \
- GMOCK_METHOD6_(typename, const, ct, m, F)
-#define MOCK_CONST_METHOD7_T_WITH_CALLTYPE(ct, m, F) \
- GMOCK_METHOD7_(typename, const, ct, m, F)
-#define MOCK_CONST_METHOD8_T_WITH_CALLTYPE(ct, m, F) \
- GMOCK_METHOD8_(typename, const, ct, m, F)
-#define MOCK_CONST_METHOD9_T_WITH_CALLTYPE(ct, m, F) \
- GMOCK_METHOD9_(typename, const, ct, m, F)
-#define MOCK_CONST_METHOD10_T_WITH_CALLTYPE(ct, m, F) \
- GMOCK_METHOD10_(typename, const, ct, m, F)
-
-// A MockFunction<F> class has one mock method whose type is F. It is
-// useful when you just want your test code to emit some messages and
-// have Google Mock verify the right messages are sent (and perhaps at
-// the right times). For example, if you are exercising code:
-//
-// Foo(1);
-// Foo(2);
-// Foo(3);
-//
-// and want to verify that Foo(1) and Foo(3) both invoke
-// mock.Bar("a"), but Foo(2) doesn't invoke anything, you can write:
-//
-// TEST(FooTest, InvokesBarCorrectly) {
-// MyMock mock;
-// MockFunction<void(string check_point_name)> check;
-// {
-// InSequence s;
-//
-// EXPECT_CALL(mock, Bar("a"));
-// EXPECT_CALL(check, Call("1"));
-// EXPECT_CALL(check, Call("2"));
-// EXPECT_CALL(mock, Bar("a"));
-// }
-// Foo(1);
-// check.Call("1");
-// Foo(2);
-// check.Call("2");
-// Foo(3);
-// }
-//
-// The expectation spec says that the first Bar("a") must happen
-// before check point "1", the second Bar("a") must happen after check
-// point "2", and nothing should happen between the two check
-// points. The explicit check points make it easy to tell which
-// Bar("a") is called by which call to Foo().
-template <typename F>
-class MockFunction;
-
-template <typename R>
-class MockFunction<R()> {
- public:
- MockFunction() {}
-
- MOCK_METHOD0_T(Call, R());
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
-};
-
-template <typename R, typename A0>
-class MockFunction<R(A0)> {
- public:
- MockFunction() {}
-
- MOCK_METHOD1_T(Call, R(A0));
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
-};
-
-template <typename R, typename A0, typename A1>
-class MockFunction<R(A0, A1)> {
- public:
- MockFunction() {}
-
- MOCK_METHOD2_T(Call, R(A0, A1));
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
-};
-
-template <typename R, typename A0, typename A1, typename A2>
-class MockFunction<R(A0, A1, A2)> {
- public:
- MockFunction() {}
-
- MOCK_METHOD3_T(Call, R(A0, A1, A2));
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
-};
-
-template <typename R, typename A0, typename A1, typename A2, typename A3>
-class MockFunction<R(A0, A1, A2, A3)> {
- public:
- MockFunction() {}
-
- MOCK_METHOD4_T(Call, R(A0, A1, A2, A3));
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
-};
-
-template <typename R, typename A0, typename A1, typename A2, typename A3,
- typename A4>
-class MockFunction<R(A0, A1, A2, A3, A4)> {
- public:
- MockFunction() {}
-
- MOCK_METHOD5_T(Call, R(A0, A1, A2, A3, A4));
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
-};
-
-template <typename R, typename A0, typename A1, typename A2, typename A3,
- typename A4, typename A5>
-class MockFunction<R(A0, A1, A2, A3, A4, A5)> {
- public:
- MockFunction() {}
-
- MOCK_METHOD6_T(Call, R(A0, A1, A2, A3, A4, A5));
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
-};
-
-template <typename R, typename A0, typename A1, typename A2, typename A3,
- typename A4, typename A5, typename A6>
-class MockFunction<R(A0, A1, A2, A3, A4, A5, A6)> {
- public:
- MockFunction() {}
-
- MOCK_METHOD7_T(Call, R(A0, A1, A2, A3, A4, A5, A6));
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
-};
-
-template <typename R, typename A0, typename A1, typename A2, typename A3,
- typename A4, typename A5, typename A6, typename A7>
-class MockFunction<R(A0, A1, A2, A3, A4, A5, A6, A7)> {
- public:
- MockFunction() {}
-
- MOCK_METHOD8_T(Call, R(A0, A1, A2, A3, A4, A5, A6, A7));
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
-};
-
-template <typename R, typename A0, typename A1, typename A2, typename A3,
- typename A4, typename A5, typename A6, typename A7, typename A8>
-class MockFunction<R(A0, A1, A2, A3, A4, A5, A6, A7, A8)> {
- public:
- MockFunction() {}
-
- MOCK_METHOD9_T(Call, R(A0, A1, A2, A3, A4, A5, A6, A7, A8));
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
-};
-
-template <typename R, typename A0, typename A1, typename A2, typename A3,
- typename A4, typename A5, typename A6, typename A7, typename A8,
- typename A9>
-class MockFunction<R(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9)> {
- public:
- MockFunction() {}
-
- MOCK_METHOD10_T(Call, R(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9));
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
-};
-
-} // namespace testing
-
-#endif // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_
diff --git a/src/testing/include/gmock/gmock-generated-function-mockers.h.pump b/src/testing/include/gmock/gmock-generated-function-mockers.h.pump
deleted file mode 100644
index 4f82d622..00000000
--- a/src/testing/include/gmock/gmock-generated-function-mockers.h.pump
+++ /dev/null
@@ -1,258 +0,0 @@
-$$ -*- mode: c++; -*-
-$$ This is a Pump source file. Please use Pump to convert it to
-$$ gmock-generated-function-mockers.h.
-$$
-$var n = 10 $$ The maximum arity we support.
-// Copyright 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-// Google Mock - a framework for writing C++ mock classes.
-//
-// This file implements function mockers of various arities.
-
-#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_
-#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_
-
-#include "gmock/gmock-spec-builders.h"
-#include "gmock/internal/gmock-internal-utils.h"
-
-namespace testing {
-namespace internal {
-
-template <typename F>
-class FunctionMockerBase;
-
-// Note: class FunctionMocker really belongs to the ::testing
-// namespace. However if we define it in ::testing, MSVC will
-// complain when classes in ::testing::internal declare it as a
-// friend class template. To workaround this compiler bug, we define
-// FunctionMocker in ::testing::internal and import it into ::testing.
-template <typename F>
-class FunctionMocker;
-
-
-$range i 0..n
-$for i [[
-$range j 1..i
-$var typename_As = [[$for j [[, typename A$j]]]]
-$var As = [[$for j, [[A$j]]]]
-$var as = [[$for j, [[a$j]]]]
-$var Aas = [[$for j, [[A$j a$j]]]]
-$var ms = [[$for j, [[m$j]]]]
-$var matchers = [[$for j, [[const Matcher<A$j>& m$j]]]]
-template <typename R$typename_As>
-class FunctionMocker<R($As)> : public
- internal::FunctionMockerBase<R($As)> {
- public:
- typedef R F($As);
- typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
-
- MockSpec<F>& With($matchers) {
-
-$if i >= 1 [[
- this->current_spec().SetMatchers(::std::tr1::make_tuple($ms));
-
-]]
- return this->current_spec();
- }
-
- R Invoke($Aas) {
- // Even though gcc and MSVC don't enforce it, 'this->' is required
- // by the C++ standard [14.6.4] here, as the base class type is
- // dependent on the template argument (and thus shouldn't be
- // looked into when resolving InvokeWith).
- return this->InvokeWith(ArgumentTuple($as));
- }
-};
-
-
-]]
-} // namespace internal
-
-// The style guide prohibits "using" statements in a namespace scope
-// inside a header file. However, the FunctionMocker class template
-// is meant to be defined in the ::testing namespace. The following
-// line is just a trick for working around a bug in MSVC 8.0, which
-// cannot handle it if we define FunctionMocker in ::testing.
-using internal::FunctionMocker;
-
-// The result type of function type F.
-// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
-#define GMOCK_RESULT_(tn, F) tn ::testing::internal::Function<F>::Result
-
-// The type of argument N of function type F.
-// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
-#define GMOCK_ARG_(tn, F, N) tn ::testing::internal::Function<F>::Argument##N
-
-// The matcher type for argument N of function type F.
-// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
-#define GMOCK_MATCHER_(tn, F, N) const ::testing::Matcher<GMOCK_ARG_(tn, F, N)>&
-
-// The variable for mocking the given method.
-// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
-#define GMOCK_MOCKER_(arity, constness, Method) \
- GTEST_CONCAT_TOKEN_(gmock##constness##arity##_##Method##_, __LINE__)
-
-
-$for i [[
-$range j 1..i
-$var arg_as = [[$for j, \
- [[GMOCK_ARG_(tn, F, $j) gmock_a$j]]]]
-$var as = [[$for j, [[gmock_a$j]]]]
-$var matcher_as = [[$for j, \
- [[GMOCK_MATCHER_(tn, F, $j) gmock_a$j]]]]
-// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
-#define GMOCK_METHOD$i[[]]_(tn, constness, ct, Method, F) \
- GMOCK_RESULT_(tn, F) ct Method($arg_as) constness { \
- GTEST_COMPILE_ASSERT_(::std::tr1::tuple_size< \
- tn ::testing::internal::Function<F>::ArgumentTuple>::value == $i, \
- this_method_does_not_take_$i[[]]_argument[[$if i != 1 [[s]]]]); \
- GMOCK_MOCKER_($i, constness, Method).SetOwnerAndName(this, #Method); \
- return GMOCK_MOCKER_($i, constness, Method).Invoke($as); \
- } \
- ::testing::MockSpec<F>& \
- gmock_##Method($matcher_as) constness { \
- GMOCK_MOCKER_($i, constness, Method).RegisterOwner(this); \
- return GMOCK_MOCKER_($i, constness, Method).With($as); \
- } \
- mutable ::testing::FunctionMocker<F> GMOCK_MOCKER_($i, constness, Method)
-
-
-]]
-$for i [[
-#define MOCK_METHOD$i(m, F) GMOCK_METHOD$i[[]]_(, , , m, F)
-
-]]
-
-
-$for i [[
-#define MOCK_CONST_METHOD$i(m, F) GMOCK_METHOD$i[[]]_(, const, , m, F)
-
-]]
-
-
-$for i [[
-#define MOCK_METHOD$i[[]]_T(m, F) GMOCK_METHOD$i[[]]_(typename, , , m, F)
-
-]]
-
-
-$for i [[
-#define MOCK_CONST_METHOD$i[[]]_T(m, F) [[]]
-GMOCK_METHOD$i[[]]_(typename, const, , m, F)
-
-]]
-
-
-$for i [[
-#define MOCK_METHOD$i[[]]_WITH_CALLTYPE(ct, m, F) [[]]
-GMOCK_METHOD$i[[]]_(, , ct, m, F)
-
-]]
-
-
-$for i [[
-#define MOCK_CONST_METHOD$i[[]]_WITH_CALLTYPE(ct, m, F) \
- GMOCK_METHOD$i[[]]_(, const, ct, m, F)
-
-]]
-
-
-$for i [[
-#define MOCK_METHOD$i[[]]_T_WITH_CALLTYPE(ct, m, F) \
- GMOCK_METHOD$i[[]]_(typename, , ct, m, F)
-
-]]
-
-
-$for i [[
-#define MOCK_CONST_METHOD$i[[]]_T_WITH_CALLTYPE(ct, m, F) \
- GMOCK_METHOD$i[[]]_(typename, const, ct, m, F)
-
-]]
-
-// A MockFunction<F> class has one mock method whose type is F. It is
-// useful when you just want your test code to emit some messages and
-// have Google Mock verify the right messages are sent (and perhaps at
-// the right times). For example, if you are exercising code:
-//
-// Foo(1);
-// Foo(2);
-// Foo(3);
-//
-// and want to verify that Foo(1) and Foo(3) both invoke
-// mock.Bar("a"), but Foo(2) doesn't invoke anything, you can write:
-//
-// TEST(FooTest, InvokesBarCorrectly) {
-// MyMock mock;
-// MockFunction<void(string check_point_name)> check;
-// {
-// InSequence s;
-//
-// EXPECT_CALL(mock, Bar("a"));
-// EXPECT_CALL(check, Call("1"));
-// EXPECT_CALL(check, Call("2"));
-// EXPECT_CALL(mock, Bar("a"));
-// }
-// Foo(1);
-// check.Call("1");
-// Foo(2);
-// check.Call("2");
-// Foo(3);
-// }
-//
-// The expectation spec says that the first Bar("a") must happen
-// before check point "1", the second Bar("a") must happen after check
-// point "2", and nothing should happen between the two check
-// points. The explicit check points make it easy to tell which
-// Bar("a") is called by which call to Foo().
-template <typename F>
-class MockFunction;
-
-
-$for i [[
-$range j 0..i-1
-template <typename R$for j [[, typename A$j]]>
-class MockFunction<R($for j, [[A$j]])> {
- public:
- MockFunction() {}
-
- MOCK_METHOD$i[[]]_T(Call, R($for j, [[A$j]]));
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
-};
-
-
-]]
-} // namespace testing
-
-#endif // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_
diff --git a/src/testing/include/gmock/gmock-generated-matchers.h b/src/testing/include/gmock/gmock-generated-matchers.h
deleted file mode 100644
index 5527ed3e..00000000
--- a/src/testing/include/gmock/gmock-generated-matchers.h
+++ /dev/null
@@ -1,2210 +0,0 @@
-// This file was GENERATED by command:
-// pump.py gmock-generated-matchers.h.pump
-// DO NOT EDIT BY HAND!!!
-
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Google Mock - a framework for writing C++ mock classes.
-//
-// This file implements some commonly used variadic matchers.
-
-#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_MATCHERS_H_
-#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_MATCHERS_H_
-
-#include <sstream>
-#include <string>
-#include <vector>
-#include "gmock/gmock-matchers.h"
-
-namespace testing {
-namespace internal {
-
-// The type of the i-th (0-based) field of Tuple.
-#define GMOCK_FIELD_TYPE_(Tuple, i) \
- typename ::std::tr1::tuple_element<i, Tuple>::type
-
-// TupleFields<Tuple, k0, ..., kn> is for selecting fields from a
-// tuple of type Tuple. It has two members:
-//
-// type: a tuple type whose i-th field is the ki-th field of Tuple.
-// GetSelectedFields(t): returns fields k0, ..., and kn of t as a tuple.
-//
-// For example, in class TupleFields<tuple<bool, char, int>, 2, 0>, we have:
-//
-// type is tuple<int, bool>, and
-// GetSelectedFields(make_tuple(true, 'a', 42)) is (42, true).
-
-template <class Tuple, int k0 = -1, int k1 = -1, int k2 = -1, int k3 = -1,
- int k4 = -1, int k5 = -1, int k6 = -1, int k7 = -1, int k8 = -1,
- int k9 = -1>
-class TupleFields;
-
-// This generic version is used when there are 10 selectors.
-template <class Tuple, int k0, int k1, int k2, int k3, int k4, int k5, int k6,
- int k7, int k8, int k9>
-class TupleFields {
- public:
- typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
- GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),
- GMOCK_FIELD_TYPE_(Tuple, k3), GMOCK_FIELD_TYPE_(Tuple, k4),
- GMOCK_FIELD_TYPE_(Tuple, k5), GMOCK_FIELD_TYPE_(Tuple, k6),
- GMOCK_FIELD_TYPE_(Tuple, k7), GMOCK_FIELD_TYPE_(Tuple, k8),
- GMOCK_FIELD_TYPE_(Tuple, k9)> type;
- static type GetSelectedFields(const Tuple& t) {
- using ::std::tr1::get;
- return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t), get<k4>(t),
- get<k5>(t), get<k6>(t), get<k7>(t), get<k8>(t), get<k9>(t));
- }
-};
-
-// The following specialization is used for 0 ~ 9 selectors.
-
-template <class Tuple>
-class TupleFields<Tuple, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1> {
- public:
- typedef ::std::tr1::tuple<> type;
- static type GetSelectedFields(const Tuple& /* t */) {
- using ::std::tr1::get;
- return type();
- }
-};
-
-template <class Tuple, int k0>
-class TupleFields<Tuple, k0, -1, -1, -1, -1, -1, -1, -1, -1, -1> {
- public:
- typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0)> type;
- static type GetSelectedFields(const Tuple& t) {
- using ::std::tr1::get;
- return type(get<k0>(t));
- }
-};
-
-template <class Tuple, int k0, int k1>
-class TupleFields<Tuple, k0, k1, -1, -1, -1, -1, -1, -1, -1, -1> {
- public:
- typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
- GMOCK_FIELD_TYPE_(Tuple, k1)> type;
- static type GetSelectedFields(const Tuple& t) {
- using ::std::tr1::get;
- return type(get<k0>(t), get<k1>(t));
- }
-};
-
-template <class Tuple, int k0, int k1, int k2>
-class TupleFields<Tuple, k0, k1, k2, -1, -1, -1, -1, -1, -1, -1> {
- public:
- typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
- GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2)> type;
- static type GetSelectedFields(const Tuple& t) {
- using ::std::tr1::get;
- return type(get<k0>(t), get<k1>(t), get<k2>(t));
- }
-};
-
-template <class Tuple, int k0, int k1, int k2, int k3>
-class TupleFields<Tuple, k0, k1, k2, k3, -1, -1, -1, -1, -1, -1> {
- public:
- typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
- GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),
- GMOCK_FIELD_TYPE_(Tuple, k3)> type;
- static type GetSelectedFields(const Tuple& t) {
- using ::std::tr1::get;
- return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t));
- }
-};
-
-template <class Tuple, int k0, int k1, int k2, int k3, int k4>
-class TupleFields<Tuple, k0, k1, k2, k3, k4, -1, -1, -1, -1, -1> {
- public:
- typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
- GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),
- GMOCK_FIELD_TYPE_(Tuple, k3), GMOCK_FIELD_TYPE_(Tuple, k4)> type;
- static type GetSelectedFields(const Tuple& t) {
- using ::std::tr1::get;
- return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t), get<k4>(t));
- }
-};
-
-template <class Tuple, int k0, int k1, int k2, int k3, int k4, int k5>
-class TupleFields<Tuple, k0, k1, k2, k3, k4, k5, -1, -1, -1, -1> {
- public:
- typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
- GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),
- GMOCK_FIELD_TYPE_(Tuple, k3), GMOCK_FIELD_TYPE_(Tuple, k4),
- GMOCK_FIELD_TYPE_(Tuple, k5)> type;
- static type GetSelectedFields(const Tuple& t) {
- using ::std::tr1::get;
- return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t), get<k4>(t),
- get<k5>(t));
- }
-};
-
-template <class Tuple, int k0, int k1, int k2, int k3, int k4, int k5, int k6>
-class TupleFields<Tuple, k0, k1, k2, k3, k4, k5, k6, -1, -1, -1> {
- public:
- typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
- GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),
- GMOCK_FIELD_TYPE_(Tuple, k3), GMOCK_FIELD_TYPE_(Tuple, k4),
- GMOCK_FIELD_TYPE_(Tuple, k5), GMOCK_FIELD_TYPE_(Tuple, k6)> type;
- static type GetSelectedFields(const Tuple& t) {
- using ::std::tr1::get;
- return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t), get<k4>(t),
- get<k5>(t), get<k6>(t));
- }
-};
-
-template <class Tuple, int k0, int k1, int k2, int k3, int k4, int k5, int k6,
- int k7>
-class TupleFields<Tuple, k0, k1, k2, k3, k4, k5, k6, k7, -1, -1> {
- public:
- typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
- GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),
- GMOCK_FIELD_TYPE_(Tuple, k3), GMOCK_FIELD_TYPE_(Tuple, k4),
- GMOCK_FIELD_TYPE_(Tuple, k5), GMOCK_FIELD_TYPE_(Tuple, k6),
- GMOCK_FIELD_TYPE_(Tuple, k7)> type;
- static type GetSelectedFields(const Tuple& t) {
- using ::std::tr1::get;
- return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t), get<k4>(t),
- get<k5>(t), get<k6>(t), get<k7>(t));
- }
-};
-
-template <class Tuple, int k0, int k1, int k2, int k3, int k4, int k5, int k6,
- int k7, int k8>
-class TupleFields<Tuple, k0, k1, k2, k3, k4, k5, k6, k7, k8, -1> {
- public:
- typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
- GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),
- GMOCK_FIELD_TYPE_(Tuple, k3), GMOCK_FIELD_TYPE_(Tuple, k4),
- GMOCK_FIELD_TYPE_(Tuple, k5), GMOCK_FIELD_TYPE_(Tuple, k6),
- GMOCK_FIELD_TYPE_(Tuple, k7), GMOCK_FIELD_TYPE_(Tuple, k8)> type;
- static type GetSelectedFields(const Tuple& t) {
- using ::std::tr1::get;
- return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t), get<k4>(t),
- get<k5>(t), get<k6>(t), get<k7>(t), get<k8>(t));
- }
-};
-
-#undef GMOCK_FIELD_TYPE_
-
-// Implements the Args() matcher.
-template <class ArgsTuple, int k0 = -1, int k1 = -1, int k2 = -1, int k3 = -1,
- int k4 = -1, int k5 = -1, int k6 = -1, int k7 = -1, int k8 = -1,
- int k9 = -1>
-class ArgsMatcherImpl : public MatcherInterface<ArgsTuple> {
- public:
- // ArgsTuple may have top-level const or reference modifiers.
- typedef GTEST_REMOVE_REFERENCE_AND_CONST_(ArgsTuple) RawArgsTuple;
- typedef typename internal::TupleFields<RawArgsTuple, k0, k1, k2, k3, k4, k5,
- k6, k7, k8, k9>::type SelectedArgs;
- typedef Matcher<const SelectedArgs&> MonomorphicInnerMatcher;
-
- template <typename InnerMatcher>
- explicit ArgsMatcherImpl(const InnerMatcher& inner_matcher)
- : inner_matcher_(SafeMatcherCast<const SelectedArgs&>(inner_matcher)) {}
-
- virtual bool MatchAndExplain(ArgsTuple args,
- MatchResultListener* listener) const {
- const SelectedArgs& selected_args = GetSelectedArgs(args);
- if (!listener->IsInterested())
- return inner_matcher_.Matches(selected_args);
-
- PrintIndices(listener->stream());
- *listener << "are " << PrintToString(selected_args);
-
- StringMatchResultListener inner_listener;
- const bool match = inner_matcher_.MatchAndExplain(selected_args,
- &inner_listener);
- PrintIfNotEmpty(inner_listener.str(), listener->stream());
- return match;
- }
-
- virtual void DescribeTo(::std::ostream* os) const {
- *os << "are a tuple ";
- PrintIndices(os);
- inner_matcher_.DescribeTo(os);
- }
-
- virtual void DescribeNegationTo(::std::ostream* os) const {
- *os << "are a tuple ";
- PrintIndices(os);
- inner_matcher_.DescribeNegationTo(os);
- }
-
- private:
- static SelectedArgs GetSelectedArgs(ArgsTuple args) {
- return TupleFields<RawArgsTuple, k0, k1, k2, k3, k4, k5, k6, k7, k8,
- k9>::GetSelectedFields(args);
- }
-
- // Prints the indices of the selected fields.
- static void PrintIndices(::std::ostream* os) {
- *os << "whose fields (";
- const int indices[10] = { k0, k1, k2, k3, k4, k5, k6, k7, k8, k9 };
- for (int i = 0; i < 10; i++) {
- if (indices[i] < 0)
- break;
-
- if (i >= 1)
- *os << ", ";
-
- *os << "#" << indices[i];
- }
- *os << ") ";
- }
-
- const MonomorphicInnerMatcher inner_matcher_;
-
- GTEST_DISALLOW_ASSIGN_(ArgsMatcherImpl);
-};
-
-template <class InnerMatcher, int k0 = -1, int k1 = -1, int k2 = -1,
- int k3 = -1, int k4 = -1, int k5 = -1, int k6 = -1, int k7 = -1,
- int k8 = -1, int k9 = -1>
-class ArgsMatcher {
- public:
- explicit ArgsMatcher(const InnerMatcher& inner_matcher)
- : inner_matcher_(inner_matcher) {}
-
- template <typename ArgsTuple>
- operator Matcher<ArgsTuple>() const {
- return MakeMatcher(new ArgsMatcherImpl<ArgsTuple, k0, k1, k2, k3, k4, k5,
- k6, k7, k8, k9>(inner_matcher_));
- }
-
- private:
- const InnerMatcher inner_matcher_;
-
- GTEST_DISALLOW_ASSIGN_(ArgsMatcher);
-};
-
-// Implements ElementsAre() of 1-10 arguments.
-
-template <typename T1>
-class ElementsAreMatcher1 {
- public:
- explicit ElementsAreMatcher1(const T1& e1) : e1_(e1) {}
-
- template <typename Container>
- operator Matcher<Container>() const {
- typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer;
- typedef typename internal::StlContainerView<RawContainer>::type::value_type
- Element;
-
- // Nokia's Symbian Compiler has a nasty bug where the object put
- // in a one-element local array is not destructed when the array
- // goes out of scope. This leads to obvious badness as we've
- // added the linked_ptr in it to our other linked_ptrs list.
- // Hence we implement ElementsAreMatcher1 specially to avoid using
- // a local array.
- const Matcher<const Element&> matcher =
- MatcherCast<const Element&>(e1_);
- return MakeMatcher(new ElementsAreMatcherImpl<Container>(&matcher, 1));
- }
-
- private:
- const T1& e1_;
-
- GTEST_DISALLOW_ASSIGN_(ElementsAreMatcher1);
-};
-
-template <typename T1, typename T2>
-class ElementsAreMatcher2 {
- public:
- ElementsAreMatcher2(const T1& e1, const T2& e2) : e1_(e1), e2_(e2) {}
-
- template <typename Container>
- operator Matcher<Container>() const {
- typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer;
- typedef typename internal::StlContainerView<RawContainer>::type::value_type
- Element;
-
- const Matcher<const Element&> matchers[] = {
- MatcherCast<const Element&>(e1_),
- MatcherCast<const Element&>(e2_),
- };
-
- return MakeMatcher(new ElementsAreMatcherImpl<Container>(matchers, 2));
- }
-
- private:
- const T1& e1_;
- const T2& e2_;
-
- GTEST_DISALLOW_ASSIGN_(ElementsAreMatcher2);
-};
-
-template <typename T1, typename T2, typename T3>
-class ElementsAreMatcher3 {
- public:
- ElementsAreMatcher3(const T1& e1, const T2& e2, const T3& e3) : e1_(e1),
- e2_(e2), e3_(e3) {}
-
- template <typename Container>
- operator Matcher<Container>() const {
- typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer;
- typedef typename internal::StlContainerView<RawContainer>::type::value_type
- Element;
-
- const Matcher<const Element&> matchers[] = {
- MatcherCast<const Element&>(e1_),
- MatcherCast<const Element&>(e2_),
- MatcherCast<const Element&>(e3_),
- };
-
- return MakeMatcher(new ElementsAreMatcherImpl<Container>(matchers, 3));
- }
-
- private:
- const T1& e1_;
- const T2& e2_;
- const T3& e3_;
-
- GTEST_DISALLOW_ASSIGN_(ElementsAreMatcher3);
-};
-
-template <typename T1, typename T2, typename T3, typename T4>
-class ElementsAreMatcher4 {
- public:
- ElementsAreMatcher4(const T1& e1, const T2& e2, const T3& e3,
- const T4& e4) : e1_(e1), e2_(e2), e3_(e3), e4_(e4) {}
-
- template <typename Container>
- operator Matcher<Container>() const {
- typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer;
- typedef typename internal::StlContainerView<RawContainer>::type::value_type
- Element;
-
- const Matcher<const Element&> matchers[] = {
- MatcherCast<const Element&>(e1_),
- MatcherCast<const Element&>(e2_),
- MatcherCast<const Element&>(e3_),
- MatcherCast<const Element&>(e4_),
- };
-
- return MakeMatcher(new ElementsAreMatcherImpl<Container>(matchers, 4));
- }
-
- private:
- const T1& e1_;
- const T2& e2_;
- const T3& e3_;
- const T4& e4_;
-
- GTEST_DISALLOW_ASSIGN_(ElementsAreMatcher4);
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5>
-class ElementsAreMatcher5 {
- public:
- ElementsAreMatcher5(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
- const T5& e5) : e1_(e1), e2_(e2), e3_(e3), e4_(e4), e5_(e5) {}
-
- template <typename Container>
- operator Matcher<Container>() const {
- typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer;
- typedef typename internal::StlContainerView<RawContainer>::type::value_type
- Element;
-
- const Matcher<const Element&> matchers[] = {
- MatcherCast<const Element&>(e1_),
- MatcherCast<const Element&>(e2_),
- MatcherCast<const Element&>(e3_),
- MatcherCast<const Element&>(e4_),
- MatcherCast<const Element&>(e5_),
- };
-
- return MakeMatcher(new ElementsAreMatcherImpl<Container>(matchers, 5));
- }
-
- private:
- const T1& e1_;
- const T2& e2_;
- const T3& e3_;
- const T4& e4_;
- const T5& e5_;
-
- GTEST_DISALLOW_ASSIGN_(ElementsAreMatcher5);
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6>
-class ElementsAreMatcher6 {
- public:
- ElementsAreMatcher6(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
- const T5& e5, const T6& e6) : e1_(e1), e2_(e2), e3_(e3), e4_(e4),
- e5_(e5), e6_(e6) {}
-
- template <typename Container>
- operator Matcher<Container>() const {
- typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer;
- typedef typename internal::StlContainerView<RawContainer>::type::value_type
- Element;
-
- const Matcher<const Element&> matchers[] = {
- MatcherCast<const Element&>(e1_),
- MatcherCast<const Element&>(e2_),
- MatcherCast<const Element&>(e3_),
- MatcherCast<const Element&>(e4_),
- MatcherCast<const Element&>(e5_),
- MatcherCast<const Element&>(e6_),
- };
-
- return MakeMatcher(new ElementsAreMatcherImpl<Container>(matchers, 6));
- }
-
- private:
- const T1& e1_;
- const T2& e2_;
- const T3& e3_;
- const T4& e4_;
- const T5& e5_;
- const T6& e6_;
-
- GTEST_DISALLOW_ASSIGN_(ElementsAreMatcher6);
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7>
-class ElementsAreMatcher7 {
- public:
- ElementsAreMatcher7(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
- const T5& e5, const T6& e6, const T7& e7) : e1_(e1), e2_(e2), e3_(e3),
- e4_(e4), e5_(e5), e6_(e6), e7_(e7) {}
-
- template <typename Container>
- operator Matcher<Container>() const {
- typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer;
- typedef typename internal::StlContainerView<RawContainer>::type::value_type
- Element;
-
- const Matcher<const Element&> matchers[] = {
- MatcherCast<const Element&>(e1_),
- MatcherCast<const Element&>(e2_),
- MatcherCast<const Element&>(e3_),
- MatcherCast<const Element&>(e4_),
- MatcherCast<const Element&>(e5_),
- MatcherCast<const Element&>(e6_),
- MatcherCast<const Element&>(e7_),
- };
-
- return MakeMatcher(new ElementsAreMatcherImpl<Container>(matchers, 7));
- }
-
- private:
- const T1& e1_;
- const T2& e2_;
- const T3& e3_;
- const T4& e4_;
- const T5& e5_;
- const T6& e6_;
- const T7& e7_;
-
- GTEST_DISALLOW_ASSIGN_(ElementsAreMatcher7);
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8>
-class ElementsAreMatcher8 {
- public:
- ElementsAreMatcher8(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
- const T5& e5, const T6& e6, const T7& e7, const T8& e8) : e1_(e1),
- e2_(e2), e3_(e3), e4_(e4), e5_(e5), e6_(e6), e7_(e7), e8_(e8) {}
-
- template <typename Container>
- operator Matcher<Container>() const {
- typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer;
- typedef typename internal::StlContainerView<RawContainer>::type::value_type
- Element;
-
- const Matcher<const Element&> matchers[] = {
- MatcherCast<const Element&>(e1_),
- MatcherCast<const Element&>(e2_),
- MatcherCast<const Element&>(e3_),
- MatcherCast<const Element&>(e4_),
- MatcherCast<const Element&>(e5_),
- MatcherCast<const Element&>(e6_),
- MatcherCast<const Element&>(e7_),
- MatcherCast<const Element&>(e8_),
- };
-
- return MakeMatcher(new ElementsAreMatcherImpl<Container>(matchers, 8));
- }
-
- private:
- const T1& e1_;
- const T2& e2_;
- const T3& e3_;
- const T4& e4_;
- const T5& e5_;
- const T6& e6_;
- const T7& e7_;
- const T8& e8_;
-
- GTEST_DISALLOW_ASSIGN_(ElementsAreMatcher8);
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9>
-class ElementsAreMatcher9 {
- public:
- ElementsAreMatcher9(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
- const T5& e5, const T6& e6, const T7& e7, const T8& e8,
- const T9& e9) : e1_(e1), e2_(e2), e3_(e3), e4_(e4), e5_(e5), e6_(e6),
- e7_(e7), e8_(e8), e9_(e9) {}
-
- template <typename Container>
- operator Matcher<Container>() const {
- typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer;
- typedef typename internal::StlContainerView<RawContainer>::type::value_type
- Element;
-
- const Matcher<const Element&> matchers[] = {
- MatcherCast<const Element&>(e1_),
- MatcherCast<const Element&>(e2_),
- MatcherCast<const Element&>(e3_),
- MatcherCast<const Element&>(e4_),
- MatcherCast<const Element&>(e5_),
- MatcherCast<const Element&>(e6_),
- MatcherCast<const Element&>(e7_),
- MatcherCast<const Element&>(e8_),
- MatcherCast<const Element&>(e9_),
- };
-
- return MakeMatcher(new ElementsAreMatcherImpl<Container>(matchers, 9));
- }
-
- private:
- const T1& e1_;
- const T2& e2_;
- const T3& e3_;
- const T4& e4_;
- const T5& e5_;
- const T6& e6_;
- const T7& e7_;
- const T8& e8_;
- const T9& e9_;
-
- GTEST_DISALLOW_ASSIGN_(ElementsAreMatcher9);
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10>
-class ElementsAreMatcher10 {
- public:
- ElementsAreMatcher10(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
- const T5& e5, const T6& e6, const T7& e7, const T8& e8, const T9& e9,
- const T10& e10) : e1_(e1), e2_(e2), e3_(e3), e4_(e4), e5_(e5), e6_(e6),
- e7_(e7), e8_(e8), e9_(e9), e10_(e10) {}
-
- template <typename Container>
- operator Matcher<Container>() const {
- typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer;
- typedef typename internal::StlContainerView<RawContainer>::type::value_type
- Element;
-
- const Matcher<const Element&> matchers[] = {
- MatcherCast<const Element&>(e1_),
- MatcherCast<const Element&>(e2_),
- MatcherCast<const Element&>(e3_),
- MatcherCast<const Element&>(e4_),
- MatcherCast<const Element&>(e5_),
- MatcherCast<const Element&>(e6_),
- MatcherCast<const Element&>(e7_),
- MatcherCast<const Element&>(e8_),
- MatcherCast<const Element&>(e9_),
- MatcherCast<const Element&>(e10_),
- };
-
- return MakeMatcher(new ElementsAreMatcherImpl<Container>(matchers, 10));
- }
-
- private:
- const T1& e1_;
- const T2& e2_;
- const T3& e3_;
- const T4& e4_;
- const T5& e5_;
- const T6& e6_;
- const T7& e7_;
- const T8& e8_;
- const T9& e9_;
- const T10& e10_;
-
- GTEST_DISALLOW_ASSIGN_(ElementsAreMatcher10);
-};
-
-// A set of metafunctions for computing the result type of AllOf.
-// AllOf(m1, ..., mN) returns
-// AllOfResultN<decltype(m1), ..., decltype(mN)>::type.
-
-// Although AllOf isn't defined for one argument, AllOfResult1 is defined
-// to simplify the implementation.
-template <typename M1>
-struct AllOfResult1 {
- typedef M1 type;
-};
-
-template <typename M1, typename M2>
-struct AllOfResult2 {
- typedef BothOfMatcher<
- typename AllOfResult1<M1>::type,
- typename AllOfResult1<M2>::type
- > type;
-};
-
-template <typename M1, typename M2, typename M3>
-struct AllOfResult3 {
- typedef BothOfMatcher<
- typename AllOfResult1<M1>::type,
- typename AllOfResult2<M2, M3>::type
- > type;
-};
-
-template <typename M1, typename M2, typename M3, typename M4>
-struct AllOfResult4 {
- typedef BothOfMatcher<
- typename AllOfResult2<M1, M2>::type,
- typename AllOfResult2<M3, M4>::type
- > type;
-};
-
-template <typename M1, typename M2, typename M3, typename M4, typename M5>
-struct AllOfResult5 {
- typedef BothOfMatcher<
- typename AllOfResult2<M1, M2>::type,
- typename AllOfResult3<M3, M4, M5>::type
- > type;
-};
-
-template <typename M1, typename M2, typename M3, typename M4, typename M5,
- typename M6>
-struct AllOfResult6 {
- typedef BothOfMatcher<
- typename AllOfResult3<M1, M2, M3>::type,
- typename AllOfResult3<M4, M5, M6>::type
- > type;
-};
-
-template <typename M1, typename M2, typename M3, typename M4, typename M5,
- typename M6, typename M7>
-struct AllOfResult7 {
- typedef BothOfMatcher<
- typename AllOfResult3<M1, M2, M3>::type,
- typename AllOfResult4<M4, M5, M6, M7>::type
- > type;
-};
-
-template <typename M1, typename M2, typename M3, typename M4, typename M5,
- typename M6, typename M7, typename M8>
-struct AllOfResult8 {
- typedef BothOfMatcher<
- typename AllOfResult4<M1, M2, M3, M4>::type,
- typename AllOfResult4<M5, M6, M7, M8>::type
- > type;
-};
-
-template <typename M1, typename M2, typename M3, typename M4, typename M5,
- typename M6, typename M7, typename M8, typename M9>
-struct AllOfResult9 {
- typedef BothOfMatcher<
- typename AllOfResult4<M1, M2, M3, M4>::type,
- typename AllOfResult5<M5, M6, M7, M8, M9>::type
- > type;
-};
-
-template <typename M1, typename M2, typename M3, typename M4, typename M5,
- typename M6, typename M7, typename M8, typename M9, typename M10>
-struct AllOfResult10 {
- typedef BothOfMatcher<
- typename AllOfResult5<M1, M2, M3, M4, M5>::type,
- typename AllOfResult5<M6, M7, M8, M9, M10>::type
- > type;
-};
-
-// A set of metafunctions for computing the result type of AnyOf.
-// AnyOf(m1, ..., mN) returns
-// AnyOfResultN<decltype(m1), ..., decltype(mN)>::type.
-
-// Although AnyOf isn't defined for one argument, AnyOfResult1 is defined
-// to simplify the implementation.
-template <typename M1>
-struct AnyOfResult1 {
- typedef M1 type;
-};
-
-template <typename M1, typename M2>
-struct AnyOfResult2 {
- typedef EitherOfMatcher<
- typename AnyOfResult1<M1>::type,
- typename AnyOfResult1<M2>::type
- > type;
-};
-
-template <typename M1, typename M2, typename M3>
-struct AnyOfResult3 {
- typedef EitherOfMatcher<
- typename AnyOfResult1<M1>::type,
- typename AnyOfResult2<M2, M3>::type
- > type;
-};
-
-template <typename M1, typename M2, typename M3, typename M4>
-struct AnyOfResult4 {
- typedef EitherOfMatcher<
- typename AnyOfResult2<M1, M2>::type,
- typename AnyOfResult2<M3, M4>::type
- > type;
-};
-
-template <typename M1, typename M2, typename M3, typename M4, typename M5>
-struct AnyOfResult5 {
- typedef EitherOfMatcher<
- typename AnyOfResult2<M1, M2>::type,
- typename AnyOfResult3<M3, M4, M5>::type
- > type;
-};
-
-template <typename M1, typename M2, typename M3, typename M4, typename M5,
- typename M6>
-struct AnyOfResult6 {
- typedef EitherOfMatcher<
- typename AnyOfResult3<M1, M2, M3>::type,
- typename AnyOfResult3<M4, M5, M6>::type
- > type;
-};
-
-template <typename M1, typename M2, typename M3, typename M4, typename M5,
- typename M6, typename M7>
-struct AnyOfResult7 {
- typedef EitherOfMatcher<
- typename AnyOfResult3<M1, M2, M3>::type,
- typename AnyOfResult4<M4, M5, M6, M7>::type
- > type;
-};
-
-template <typename M1, typename M2, typename M3, typename M4, typename M5,
- typename M6, typename M7, typename M8>
-struct AnyOfResult8 {
- typedef EitherOfMatcher<
- typename AnyOfResult4<M1, M2, M3, M4>::type,
- typename AnyOfResult4<M5, M6, M7, M8>::type
- > type;
-};
-
-template <typename M1, typename M2, typename M3, typename M4, typename M5,
- typename M6, typename M7, typename M8, typename M9>
-struct AnyOfResult9 {
- typedef EitherOfMatcher<
- typename AnyOfResult4<M1, M2, M3, M4>::type,
- typename AnyOfResult5<M5, M6, M7, M8, M9>::type
- > type;
-};
-
-template <typename M1, typename M2, typename M3, typename M4, typename M5,
- typename M6, typename M7, typename M8, typename M9, typename M10>
-struct AnyOfResult10 {
- typedef EitherOfMatcher<
- typename AnyOfResult5<M1, M2, M3, M4, M5>::type,
- typename AnyOfResult5<M6, M7, M8, M9, M10>::type
- > type;
-};
-
-} // namespace internal
-
-// Args<N1, N2, ..., Nk>(a_matcher) matches a tuple if the selected
-// fields of it matches a_matcher. C++ doesn't support default
-// arguments for function templates, so we have to overload it.
-template <typename InnerMatcher>
-inline internal::ArgsMatcher<InnerMatcher>
-Args(const InnerMatcher& matcher) {
- return internal::ArgsMatcher<InnerMatcher>(matcher);
-}
-
-template <int k1, typename InnerMatcher>
-inline internal::ArgsMatcher<InnerMatcher, k1>
-Args(const InnerMatcher& matcher) {
- return internal::ArgsMatcher<InnerMatcher, k1>(matcher);
-}
-
-template <int k1, int k2, typename InnerMatcher>
-inline internal::ArgsMatcher<InnerMatcher, k1, k2>
-Args(const InnerMatcher& matcher) {
- return internal::ArgsMatcher<InnerMatcher, k1, k2>(matcher);
-}
-
-template <int k1, int k2, int k3, typename InnerMatcher>
-inline internal::ArgsMatcher<InnerMatcher, k1, k2, k3>
-Args(const InnerMatcher& matcher) {
- return internal::ArgsMatcher<InnerMatcher, k1, k2, k3>(matcher);
-}
-
-template <int k1, int k2, int k3, int k4, typename InnerMatcher>
-inline internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4>
-Args(const InnerMatcher& matcher) {
- return internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4>(matcher);
-}
-
-template <int k1, int k2, int k3, int k4, int k5, typename InnerMatcher>
-inline internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5>
-Args(const InnerMatcher& matcher) {
- return internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5>(matcher);
-}
-
-template <int k1, int k2, int k3, int k4, int k5, int k6, typename InnerMatcher>
-inline internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5, k6>
-Args(const InnerMatcher& matcher) {
- return internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5, k6>(matcher);
-}
-
-template <int k1, int k2, int k3, int k4, int k5, int k6, int k7,
- typename InnerMatcher>
-inline internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5, k6, k7>
-Args(const InnerMatcher& matcher) {
- return internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5, k6,
- k7>(matcher);
-}
-
-template <int k1, int k2, int k3, int k4, int k5, int k6, int k7, int k8,
- typename InnerMatcher>
-inline internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5, k6, k7, k8>
-Args(const InnerMatcher& matcher) {
- return internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5, k6, k7,
- k8>(matcher);
-}
-
-template <int k1, int k2, int k3, int k4, int k5, int k6, int k7, int k8,
- int k9, typename InnerMatcher>
-inline internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5, k6, k7, k8, k9>
-Args(const InnerMatcher& matcher) {
- return internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5, k6, k7, k8,
- k9>(matcher);
-}
-
-template <int k1, int k2, int k3, int k4, int k5, int k6, int k7, int k8,
- int k9, int k10, typename InnerMatcher>
-inline internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5, k6, k7, k8, k9,
- k10>
-Args(const InnerMatcher& matcher) {
- return internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5, k6, k7, k8,
- k9, k10>(matcher);
-}
-
-// ElementsAre(e0, e1, ..., e_n) matches an STL-style container with
-// (n + 1) elements, where the i-th element in the container must
-// match the i-th argument in the list. Each argument of
-// ElementsAre() can be either a value or a matcher. We support up to
-// 10 arguments.
-//
-// NOTE: Since ElementsAre() cares about the order of the elements, it
-// must not be used with containers whose elements's order is
-// undefined (e.g. hash_map).
-
-inline internal::ElementsAreMatcher0 ElementsAre() {
- return internal::ElementsAreMatcher0();
-}
-
-template <typename T1>
-inline internal::ElementsAreMatcher1<T1> ElementsAre(const T1& e1) {
- return internal::ElementsAreMatcher1<T1>(e1);
-}
-
-template <typename T1, typename T2>
-inline internal::ElementsAreMatcher2<T1, T2> ElementsAre(const T1& e1,
- const T2& e2) {
- return internal::ElementsAreMatcher2<T1, T2>(e1, e2);
-}
-
-template <typename T1, typename T2, typename T3>
-inline internal::ElementsAreMatcher3<T1, T2, T3> ElementsAre(const T1& e1,
- const T2& e2, const T3& e3) {
- return internal::ElementsAreMatcher3<T1, T2, T3>(e1, e2, e3);
-}
-
-template <typename T1, typename T2, typename T3, typename T4>
-inline internal::ElementsAreMatcher4<T1, T2, T3, T4> ElementsAre(const T1& e1,
- const T2& e2, const T3& e3, const T4& e4) {
- return internal::ElementsAreMatcher4<T1, T2, T3, T4>(e1, e2, e3, e4);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5>
-inline internal::ElementsAreMatcher5<T1, T2, T3, T4,
- T5> ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
- const T5& e5) {
- return internal::ElementsAreMatcher5<T1, T2, T3, T4, T5>(e1, e2, e3, e4, e5);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6>
-inline internal::ElementsAreMatcher6<T1, T2, T3, T4, T5,
- T6> ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
- const T5& e5, const T6& e6) {
- return internal::ElementsAreMatcher6<T1, T2, T3, T4, T5, T6>(e1, e2, e3, e4,
- e5, e6);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7>
-inline internal::ElementsAreMatcher7<T1, T2, T3, T4, T5, T6,
- T7> ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
- const T5& e5, const T6& e6, const T7& e7) {
- return internal::ElementsAreMatcher7<T1, T2, T3, T4, T5, T6, T7>(e1, e2, e3,
- e4, e5, e6, e7);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8>
-inline internal::ElementsAreMatcher8<T1, T2, T3, T4, T5, T6, T7,
- T8> ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
- const T5& e5, const T6& e6, const T7& e7, const T8& e8) {
- return internal::ElementsAreMatcher8<T1, T2, T3, T4, T5, T6, T7, T8>(e1, e2,
- e3, e4, e5, e6, e7, e8);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9>
-inline internal::ElementsAreMatcher9<T1, T2, T3, T4, T5, T6, T7, T8,
- T9> ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
- const T5& e5, const T6& e6, const T7& e7, const T8& e8, const T9& e9) {
- return internal::ElementsAreMatcher9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(e1,
- e2, e3, e4, e5, e6, e7, e8, e9);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10>
-inline internal::ElementsAreMatcher10<T1, T2, T3, T4, T5, T6, T7, T8, T9,
- T10> ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
- const T5& e5, const T6& e6, const T7& e7, const T8& e8, const T9& e9,
- const T10& e10) {
- return internal::ElementsAreMatcher10<T1, T2, T3, T4, T5, T6, T7, T8, T9,
- T10>(e1, e2, e3, e4, e5, e6, e7, e8, e9, e10);
-}
-
-// ElementsAreArray(array) and ElementAreArray(array, count) are like
-// ElementsAre(), except that they take an array of values or
-// matchers. The former form infers the size of 'array', which must
-// be a static C-style array. In the latter form, 'array' can either
-// be a static array or a pointer to a dynamically created array.
-
-template <typename T>
-inline internal::ElementsAreArrayMatcher<T> ElementsAreArray(
- const T* first, size_t count) {
- return internal::ElementsAreArrayMatcher<T>(first, count);
-}
-
-template <typename T, size_t N>
-inline internal::ElementsAreArrayMatcher<T>
-ElementsAreArray(const T (&array)[N]) {
- return internal::ElementsAreArrayMatcher<T>(array, N);
-}
-
-// AllOf(m1, m2, ..., mk) matches any value that matches all of the given
-// sub-matchers. AllOf is called fully qualified to prevent ADL from firing.
-
-template <typename M1, typename M2>
-inline typename internal::AllOfResult2<M1, M2>::type
-AllOf(M1 m1, M2 m2) {
- return typename internal::AllOfResult2<M1, M2>::type(
- m1,
- m2);
-}
-
-template <typename M1, typename M2, typename M3>
-inline typename internal::AllOfResult3<M1, M2, M3>::type
-AllOf(M1 m1, M2 m2, M3 m3) {
- return typename internal::AllOfResult3<M1, M2, M3>::type(
- m1,
- ::testing::AllOf(m2, m3));
-}
-
-template <typename M1, typename M2, typename M3, typename M4>
-inline typename internal::AllOfResult4<M1, M2, M3, M4>::type
-AllOf(M1 m1, M2 m2, M3 m3, M4 m4) {
- return typename internal::AllOfResult4<M1, M2, M3, M4>::type(
- ::testing::AllOf(m1, m2),
- ::testing::AllOf(m3, m4));
-}
-
-template <typename M1, typename M2, typename M3, typename M4, typename M5>
-inline typename internal::AllOfResult5<M1, M2, M3, M4, M5>::type
-AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5) {
- return typename internal::AllOfResult5<M1, M2, M3, M4, M5>::type(
- ::testing::AllOf(m1, m2),
- ::testing::AllOf(m3, m4, m5));
-}
-
-template <typename M1, typename M2, typename M3, typename M4, typename M5,
- typename M6>
-inline typename internal::AllOfResult6<M1, M2, M3, M4, M5, M6>::type
-AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6) {
- return typename internal::AllOfResult6<M1, M2, M3, M4, M5, M6>::type(
- ::testing::AllOf(m1, m2, m3),
- ::testing::AllOf(m4, m5, m6));
-}
-
-template <typename M1, typename M2, typename M3, typename M4, typename M5,
- typename M6, typename M7>
-inline typename internal::AllOfResult7<M1, M2, M3, M4, M5, M6, M7>::type
-AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7) {
- return typename internal::AllOfResult7<M1, M2, M3, M4, M5, M6, M7>::type(
- ::testing::AllOf(m1, m2, m3),
- ::testing::AllOf(m4, m5, m6, m7));
-}
-
-template <typename M1, typename M2, typename M3, typename M4, typename M5,
- typename M6, typename M7, typename M8>
-inline typename internal::AllOfResult8<M1, M2, M3, M4, M5, M6, M7, M8>::type
-AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8) {
- return typename internal::AllOfResult8<M1, M2, M3, M4, M5, M6, M7, M8>::type(
- ::testing::AllOf(m1, m2, m3, m4),
- ::testing::AllOf(m5, m6, m7, m8));
-}
-
-template <typename M1, typename M2, typename M3, typename M4, typename M5,
- typename M6, typename M7, typename M8, typename M9>
-inline typename internal::AllOfResult9<M1, M2, M3, M4, M5, M6, M7, M8, M9>::type
-AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9) {
- return typename internal::AllOfResult9<M1, M2, M3, M4, M5, M6, M7, M8,
- M9>::type(
- ::testing::AllOf(m1, m2, m3, m4),
- ::testing::AllOf(m5, m6, m7, m8, m9));
-}
-
-template <typename M1, typename M2, typename M3, typename M4, typename M5,
- typename M6, typename M7, typename M8, typename M9, typename M10>
-inline typename internal::AllOfResult10<M1, M2, M3, M4, M5, M6, M7, M8, M9,
- M10>::type
-AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
- return typename internal::AllOfResult10<M1, M2, M3, M4, M5, M6, M7, M8, M9,
- M10>::type(
- ::testing::AllOf(m1, m2, m3, m4, m5),
- ::testing::AllOf(m6, m7, m8, m9, m10));
-}
-
-// AnyOf(m1, m2, ..., mk) matches any value that matches any of the given
-// sub-matchers. AnyOf is called fully qualified to prevent ADL from firing.
-
-template <typename M1, typename M2>
-inline typename internal::AnyOfResult2<M1, M2>::type
-AnyOf(M1 m1, M2 m2) {
- return typename internal::AnyOfResult2<M1, M2>::type(
- m1,
- m2);
-}
-
-template <typename M1, typename M2, typename M3>
-inline typename internal::AnyOfResult3<M1, M2, M3>::type
-AnyOf(M1 m1, M2 m2, M3 m3) {
- return typename internal::AnyOfResult3<M1, M2, M3>::type(
- m1,
- ::testing::AnyOf(m2, m3));
-}
-
-template <typename M1, typename M2, typename M3, typename M4>
-inline typename internal::AnyOfResult4<M1, M2, M3, M4>::type
-AnyOf(M1 m1, M2 m2, M3 m3, M4 m4) {
- return typename internal::AnyOfResult4<M1, M2, M3, M4>::type(
- ::testing::AnyOf(m1, m2),
- ::testing::AnyOf(m3, m4));
-}
-
-template <typename M1, typename M2, typename M3, typename M4, typename M5>
-inline typename internal::AnyOfResult5<M1, M2, M3, M4, M5>::type
-AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5) {
- return typename internal::AnyOfResult5<M1, M2, M3, M4, M5>::type(
- ::testing::AnyOf(m1, m2),
- ::testing::AnyOf(m3, m4, m5));
-}
-
-template <typename M1, typename M2, typename M3, typename M4, typename M5,
- typename M6>
-inline typename internal::AnyOfResult6<M1, M2, M3, M4, M5, M6>::type
-AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6) {
- return typename internal::AnyOfResult6<M1, M2, M3, M4, M5, M6>::type(
- ::testing::AnyOf(m1, m2, m3),
- ::testing::AnyOf(m4, m5, m6));
-}
-
-template <typename M1, typename M2, typename M3, typename M4, typename M5,
- typename M6, typename M7>
-inline typename internal::AnyOfResult7<M1, M2, M3, M4, M5, M6, M7>::type
-AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7) {
- return typename internal::AnyOfResult7<M1, M2, M3, M4, M5, M6, M7>::type(
- ::testing::AnyOf(m1, m2, m3),
- ::testing::AnyOf(m4, m5, m6, m7));
-}
-
-template <typename M1, typename M2, typename M3, typename M4, typename M5,
- typename M6, typename M7, typename M8>
-inline typename internal::AnyOfResult8<M1, M2, M3, M4, M5, M6, M7, M8>::type
-AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8) {
- return typename internal::AnyOfResult8<M1, M2, M3, M4, M5, M6, M7, M8>::type(
- ::testing::AnyOf(m1, m2, m3, m4),
- ::testing::AnyOf(m5, m6, m7, m8));
-}
-
-template <typename M1, typename M2, typename M3, typename M4, typename M5,
- typename M6, typename M7, typename M8, typename M9>
-inline typename internal::AnyOfResult9<M1, M2, M3, M4, M5, M6, M7, M8, M9>::type
-AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9) {
- return typename internal::AnyOfResult9<M1, M2, M3, M4, M5, M6, M7, M8,
- M9>::type(
- ::testing::AnyOf(m1, m2, m3, m4),
- ::testing::AnyOf(m5, m6, m7, m8, m9));
-}
-
-template <typename M1, typename M2, typename M3, typename M4, typename M5,
- typename M6, typename M7, typename M8, typename M9, typename M10>
-inline typename internal::AnyOfResult10<M1, M2, M3, M4, M5, M6, M7, M8, M9,
- M10>::type
-AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
- return typename internal::AnyOfResult10<M1, M2, M3, M4, M5, M6, M7, M8, M9,
- M10>::type(
- ::testing::AnyOf(m1, m2, m3, m4, m5),
- ::testing::AnyOf(m6, m7, m8, m9, m10));
-}
-
-} // namespace testing
-
-
-// The MATCHER* family of macros can be used in a namespace scope to
-// define custom matchers easily.
-//
-// Basic Usage
-// ===========
-//
-// The syntax
-//
-// MATCHER(name, description_string) { statements; }
-//
-// defines a matcher with the given name that executes the statements,
-// which must return a bool to indicate if the match succeeds. Inside
-// the statements, you can refer to the value being matched by 'arg',
-// and refer to its type by 'arg_type'.
-//
-// The description string documents what the matcher does, and is used
-// to generate the failure message when the match fails. Since a
-// MATCHER() is usually defined in a header file shared by multiple
-// C++ source files, we require the description to be a C-string
-// literal to avoid possible side effects. It can be empty, in which
-// case we'll use the sequence of words in the matcher name as the
-// description.
-//
-// For example:
-//
-// MATCHER(IsEven, "") { return (arg % 2) == 0; }
-//
-// allows you to write
-//
-// // Expects mock_foo.Bar(n) to be called where n is even.
-// EXPECT_CALL(mock_foo, Bar(IsEven()));
-//
-// or,
-//
-// // Verifies that the value of some_expression is even.
-// EXPECT_THAT(some_expression, IsEven());
-//
-// If the above assertion fails, it will print something like:
-//
-// Value of: some_expression
-// Expected: is even
-// Actual: 7
-//
-// where the description "is even" is automatically calculated from the
-// matcher name IsEven.
-//
-// Argument Type
-// =============
-//
-// Note that the type of the value being matched (arg_type) is
-// determined by the context in which you use the matcher and is
-// supplied to you by the compiler, so you don't need to worry about
-// declaring it (nor can you). This allows the matcher to be
-// polymorphic. For example, IsEven() can be used to match any type
-// where the value of "(arg % 2) == 0" can be implicitly converted to
-// a bool. In the "Bar(IsEven())" example above, if method Bar()
-// takes an int, 'arg_type' will be int; if it takes an unsigned long,
-// 'arg_type' will be unsigned long; and so on.
-//
-// Parameterizing Matchers
-// =======================
-//
-// Sometimes you'll want to parameterize the matcher. For that you
-// can use another macro:
-//
-// MATCHER_P(name, param_name, description_string) { statements; }
-//
-// For example:
-//
-// MATCHER_P(HasAbsoluteValue, value, "") { return abs(arg) == value; }
-//
-// will allow you to write:
-//
-// EXPECT_THAT(Blah("a"), HasAbsoluteValue(n));
-//
-// which may lead to this message (assuming n is 10):
-//
-// Value of: Blah("a")
-// Expected: has absolute value 10
-// Actual: -9
-//
-// Note that both the matcher description and its parameter are
-// printed, making the message human-friendly.
-//
-// In the matcher definition body, you can write 'foo_type' to
-// reference the type of a parameter named 'foo'. For example, in the
-// body of MATCHER_P(HasAbsoluteValue, value) above, you can write
-// 'value_type' to refer to the type of 'value'.
-//
-// We also provide MATCHER_P2, MATCHER_P3, ..., up to MATCHER_P10 to
-// support multi-parameter matchers.
-//
-// Describing Parameterized Matchers
-// =================================
-//
-// The last argument to MATCHER*() is a string-typed expression. The
-// expression can reference all of the matcher's parameters and a
-// special bool-typed variable named 'negation'. When 'negation' is
-// false, the expression should evaluate to the matcher's description;
-// otherwise it should evaluate to the description of the negation of
-// the matcher. For example,
-//
-// using testing::PrintToString;
-//
-// MATCHER_P2(InClosedRange, low, hi,
-// string(negation ? "is not" : "is") + " in range [" +
-// PrintToString(low) + ", " + PrintToString(hi) + "]") {
-// return low <= arg && arg <= hi;
-// }
-// ...
-// EXPECT_THAT(3, InClosedRange(4, 6));
-// EXPECT_THAT(3, Not(InClosedRange(2, 4)));
-//
-// would generate two failures that contain the text:
-//
-// Expected: is in range [4, 6]
-// ...
-// Expected: is not in range [2, 4]
-//
-// If you specify "" as the description, the failure message will
-// contain the sequence of words in the matcher name followed by the
-// parameter values printed as a tuple. For example,
-//
-// MATCHER_P2(InClosedRange, low, hi, "") { ... }
-// ...
-// EXPECT_THAT(3, InClosedRange(4, 6));
-// EXPECT_THAT(3, Not(InClosedRange(2, 4)));
-//
-// would generate two failures that contain the text:
-//
-// Expected: in closed range (4, 6)
-// ...
-// Expected: not (in closed range (2, 4))
-//
-// Types of Matcher Parameters
-// ===========================
-//
-// For the purpose of typing, you can view
-//
-// MATCHER_Pk(Foo, p1, ..., pk, description_string) { ... }
-//
-// as shorthand for
-//
-// template <typename p1_type, ..., typename pk_type>
-// FooMatcherPk<p1_type, ..., pk_type>
-// Foo(p1_type p1, ..., pk_type pk) { ... }
-//
-// When you write Foo(v1, ..., vk), the compiler infers the types of
-// the parameters v1, ..., and vk for you. If you are not happy with
-// the result of the type inference, you can specify the types by
-// explicitly instantiating the template, as in Foo<long, bool>(5,
-// false). As said earlier, you don't get to (or need to) specify
-// 'arg_type' as that's determined by the context in which the matcher
-// is used. You can assign the result of expression Foo(p1, ..., pk)
-// to a variable of type FooMatcherPk<p1_type, ..., pk_type>. This
-// can be useful when composing matchers.
-//
-// While you can instantiate a matcher template with reference types,
-// passing the parameters by pointer usually makes your code more
-// readable. If, however, you still want to pass a parameter by
-// reference, be aware that in the failure message generated by the
-// matcher you will see the value of the referenced object but not its
-// address.
-//
-// Explaining Match Results
-// ========================
-//
-// Sometimes the matcher description alone isn't enough to explain why
-// the match has failed or succeeded. For example, when expecting a
-// long string, it can be very helpful to also print the diff between
-// the expected string and the actual one. To achieve that, you can
-// optionally stream additional information to a special variable
-// named result_listener, whose type is a pointer to class
-// MatchResultListener:
-//
-// MATCHER_P(EqualsLongString, str, "") {
-// if (arg == str) return true;
-//
-// *result_listener << "the difference: "
-/// << DiffStrings(str, arg);
-// return false;
-// }
-//
-// Overloading Matchers
-// ====================
-//
-// You can overload matchers with different numbers of parameters:
-//
-// MATCHER_P(Blah, a, description_string1) { ... }
-// MATCHER_P2(Blah, a, b, description_string2) { ... }
-//
-// Caveats
-// =======
-//
-// When defining a new matcher, you should also consider implementing
-// MatcherInterface or using MakePolymorphicMatcher(). These
-// approaches require more work than the MATCHER* macros, but also
-// give you more control on the types of the value being matched and
-// the matcher parameters, which may leads to better compiler error
-// messages when the matcher is used wrong. They also allow
-// overloading matchers based on parameter types (as opposed to just
-// based on the number of parameters).
-//
-// MATCHER*() can only be used in a namespace scope. The reason is
-// that C++ doesn't yet allow function-local types to be used to
-// instantiate templates. The up-coming C++0x standard will fix this.
-// Once that's done, we'll consider supporting using MATCHER*() inside
-// a function.
-//
-// More Information
-// ================
-//
-// To learn more about using these macros, please search for 'MATCHER'
-// on http://code.google.com/p/googlemock/wiki/CookBook.
-
-#define MATCHER(name, description)\
- class name##Matcher {\
- public:\
- template <typename arg_type>\
- class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
- public:\
- gmock_Impl()\
- {}\
- virtual bool MatchAndExplain(\
- arg_type arg, ::testing::MatchResultListener* result_listener) const;\
- virtual void DescribeTo(::std::ostream* gmock_os) const {\
- *gmock_os << FormatDescription(false);\
- }\
- virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
- *gmock_os << FormatDescription(true);\
- }\
- private:\
- ::testing::internal::string FormatDescription(bool negation) const {\
- const ::testing::internal::string gmock_description = (description);\
- if (!gmock_description.empty())\
- return gmock_description;\
- return ::testing::internal::FormatMatcherDescription(\
- negation, #name, \
- ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
- ::std::tr1::tuple<>()));\
- }\
- GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
- };\
- template <typename arg_type>\
- operator ::testing::Matcher<arg_type>() const {\
- return ::testing::Matcher<arg_type>(\
- new gmock_Impl<arg_type>());\
- }\
- name##Matcher() {\
- }\
- private:\
- GTEST_DISALLOW_ASSIGN_(name##Matcher);\
- };\
- inline name##Matcher name() {\
- return name##Matcher();\
- }\
- template <typename arg_type>\
- bool name##Matcher::gmock_Impl<arg_type>::MatchAndExplain(\
- arg_type arg, \
- ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
- const
-
-#define MATCHER_P(name, p0, description)\
- template <typename p0##_type>\
- class name##MatcherP {\
- public:\
- template <typename arg_type>\
- class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
- public:\
- explicit gmock_Impl(p0##_type gmock_p0)\
- : p0(gmock_p0) {}\
- virtual bool MatchAndExplain(\
- arg_type arg, ::testing::MatchResultListener* result_listener) const;\
- virtual void DescribeTo(::std::ostream* gmock_os) const {\
- *gmock_os << FormatDescription(false);\
- }\
- virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
- *gmock_os << FormatDescription(true);\
- }\
- p0##_type p0;\
- private:\
- ::testing::internal::string FormatDescription(bool negation) const {\
- const ::testing::internal::string gmock_description = (description);\
- if (!gmock_description.empty())\
- return gmock_description;\
- return ::testing::internal::FormatMatcherDescription(\
- negation, #name, \
- ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
- ::std::tr1::tuple<p0##_type>(p0)));\
- }\
- GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
- };\
- template <typename arg_type>\
- operator ::testing::Matcher<arg_type>() const {\
- return ::testing::Matcher<arg_type>(\
- new gmock_Impl<arg_type>(p0));\
- }\
- name##MatcherP(p0##_type gmock_p0) : p0(gmock_p0) {\
- }\
- p0##_type p0;\
- private:\
- GTEST_DISALLOW_ASSIGN_(name##MatcherP);\
- };\
- template <typename p0##_type>\
- inline name##MatcherP<p0##_type> name(p0##_type p0) {\
- return name##MatcherP<p0##_type>(p0);\
- }\
- template <typename p0##_type>\
- template <typename arg_type>\
- bool name##MatcherP<p0##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
- arg_type arg, \
- ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
- const
-
-#define MATCHER_P2(name, p0, p1, description)\
- template <typename p0##_type, typename p1##_type>\
- class name##MatcherP2 {\
- public:\
- template <typename arg_type>\
- class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
- public:\
- gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1)\
- : p0(gmock_p0), p1(gmock_p1) {}\
- virtual bool MatchAndExplain(\
- arg_type arg, ::testing::MatchResultListener* result_listener) const;\
- virtual void DescribeTo(::std::ostream* gmock_os) const {\
- *gmock_os << FormatDescription(false);\
- }\
- virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
- *gmock_os << FormatDescription(true);\
- }\
- p0##_type p0;\
- p1##_type p1;\
- private:\
- ::testing::internal::string FormatDescription(bool negation) const {\
- const ::testing::internal::string gmock_description = (description);\
- if (!gmock_description.empty())\
- return gmock_description;\
- return ::testing::internal::FormatMatcherDescription(\
- negation, #name, \
- ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
- ::std::tr1::tuple<p0##_type, p1##_type>(p0, p1)));\
- }\
- GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
- };\
- template <typename arg_type>\
- operator ::testing::Matcher<arg_type>() const {\
- return ::testing::Matcher<arg_type>(\
- new gmock_Impl<arg_type>(p0, p1));\
- }\
- name##MatcherP2(p0##_type gmock_p0, p1##_type gmock_p1) : p0(gmock_p0), \
- p1(gmock_p1) {\
- }\
- p0##_type p0;\
- p1##_type p1;\
- private:\
- GTEST_DISALLOW_ASSIGN_(name##MatcherP2);\
- };\
- template <typename p0##_type, typename p1##_type>\
- inline name##MatcherP2<p0##_type, p1##_type> name(p0##_type p0, \
- p1##_type p1) {\
- return name##MatcherP2<p0##_type, p1##_type>(p0, p1);\
- }\
- template <typename p0##_type, typename p1##_type>\
- template <typename arg_type>\
- bool name##MatcherP2<p0##_type, \
- p1##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
- arg_type arg, \
- ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
- const
-
-#define MATCHER_P3(name, p0, p1, p2, description)\
- template <typename p0##_type, typename p1##_type, typename p2##_type>\
- class name##MatcherP3 {\
- public:\
- template <typename arg_type>\
- class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
- public:\
- gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2)\
- : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2) {}\
- virtual bool MatchAndExplain(\
- arg_type arg, ::testing::MatchResultListener* result_listener) const;\
- virtual void DescribeTo(::std::ostream* gmock_os) const {\
- *gmock_os << FormatDescription(false);\
- }\
- virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
- *gmock_os << FormatDescription(true);\
- }\
- p0##_type p0;\
- p1##_type p1;\
- p2##_type p2;\
- private:\
- ::testing::internal::string FormatDescription(bool negation) const {\
- const ::testing::internal::string gmock_description = (description);\
- if (!gmock_description.empty())\
- return gmock_description;\
- return ::testing::internal::FormatMatcherDescription(\
- negation, #name, \
- ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
- ::std::tr1::tuple<p0##_type, p1##_type, p2##_type>(p0, p1, \
- p2)));\
- }\
- GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
- };\
- template <typename arg_type>\
- operator ::testing::Matcher<arg_type>() const {\
- return ::testing::Matcher<arg_type>(\
- new gmock_Impl<arg_type>(p0, p1, p2));\
- }\
- name##MatcherP3(p0##_type gmock_p0, p1##_type gmock_p1, \
- p2##_type gmock_p2) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2) {\
- }\
- p0##_type p0;\
- p1##_type p1;\
- p2##_type p2;\
- private:\
- GTEST_DISALLOW_ASSIGN_(name##MatcherP3);\
- };\
- template <typename p0##_type, typename p1##_type, typename p2##_type>\
- inline name##MatcherP3<p0##_type, p1##_type, p2##_type> name(p0##_type p0, \
- p1##_type p1, p2##_type p2) {\
- return name##MatcherP3<p0##_type, p1##_type, p2##_type>(p0, p1, p2);\
- }\
- template <typename p0##_type, typename p1##_type, typename p2##_type>\
- template <typename arg_type>\
- bool name##MatcherP3<p0##_type, p1##_type, \
- p2##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
- arg_type arg, \
- ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
- const
-
-#define MATCHER_P4(name, p0, p1, p2, p3, description)\
- template <typename p0##_type, typename p1##_type, typename p2##_type, \
- typename p3##_type>\
- class name##MatcherP4 {\
- public:\
- template <typename arg_type>\
- class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
- public:\
- gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
- p3##_type gmock_p3)\
- : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3) {}\
- virtual bool MatchAndExplain(\
- arg_type arg, ::testing::MatchResultListener* result_listener) const;\
- virtual void DescribeTo(::std::ostream* gmock_os) const {\
- *gmock_os << FormatDescription(false);\
- }\
- virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
- *gmock_os << FormatDescription(true);\
- }\
- p0##_type p0;\
- p1##_type p1;\
- p2##_type p2;\
- p3##_type p3;\
- private:\
- ::testing::internal::string FormatDescription(bool negation) const {\
- const ::testing::internal::string gmock_description = (description);\
- if (!gmock_description.empty())\
- return gmock_description;\
- return ::testing::internal::FormatMatcherDescription(\
- negation, #name, \
- ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
- ::std::tr1::tuple<p0##_type, p1##_type, p2##_type, \
- p3##_type>(p0, p1, p2, p3)));\
- }\
- GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
- };\
- template <typename arg_type>\
- operator ::testing::Matcher<arg_type>() const {\
- return ::testing::Matcher<arg_type>(\
- new gmock_Impl<arg_type>(p0, p1, p2, p3));\
- }\
- name##MatcherP4(p0##_type gmock_p0, p1##_type gmock_p1, \
- p2##_type gmock_p2, p3##_type gmock_p3) : p0(gmock_p0), p1(gmock_p1), \
- p2(gmock_p2), p3(gmock_p3) {\
- }\
- p0##_type p0;\
- p1##_type p1;\
- p2##_type p2;\
- p3##_type p3;\
- private:\
- GTEST_DISALLOW_ASSIGN_(name##MatcherP4);\
- };\
- template <typename p0##_type, typename p1##_type, typename p2##_type, \
- typename p3##_type>\
- inline name##MatcherP4<p0##_type, p1##_type, p2##_type, \
- p3##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, \
- p3##_type p3) {\
- return name##MatcherP4<p0##_type, p1##_type, p2##_type, p3##_type>(p0, \
- p1, p2, p3);\
- }\
- template <typename p0##_type, typename p1##_type, typename p2##_type, \
- typename p3##_type>\
- template <typename arg_type>\
- bool name##MatcherP4<p0##_type, p1##_type, p2##_type, \
- p3##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
- arg_type arg, \
- ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
- const
-
-#define MATCHER_P5(name, p0, p1, p2, p3, p4, description)\
- template <typename p0##_type, typename p1##_type, typename p2##_type, \
- typename p3##_type, typename p4##_type>\
- class name##MatcherP5 {\
- public:\
- template <typename arg_type>\
- class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
- public:\
- gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
- p3##_type gmock_p3, p4##_type gmock_p4)\
- : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), \
- p4(gmock_p4) {}\
- virtual bool MatchAndExplain(\
- arg_type arg, ::testing::MatchResultListener* result_listener) const;\
- virtual void DescribeTo(::std::ostream* gmock_os) const {\
- *gmock_os << FormatDescription(false);\
- }\
- virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
- *gmock_os << FormatDescription(true);\
- }\
- p0##_type p0;\
- p1##_type p1;\
- p2##_type p2;\
- p3##_type p3;\
- p4##_type p4;\
- private:\
- ::testing::internal::string FormatDescription(bool negation) const {\
- const ::testing::internal::string gmock_description = (description);\
- if (!gmock_description.empty())\
- return gmock_description;\
- return ::testing::internal::FormatMatcherDescription(\
- negation, #name, \
- ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
- ::std::tr1::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
- p4##_type>(p0, p1, p2, p3, p4)));\
- }\
- GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
- };\
- template <typename arg_type>\
- operator ::testing::Matcher<arg_type>() const {\
- return ::testing::Matcher<arg_type>(\
- new gmock_Impl<arg_type>(p0, p1, p2, p3, p4));\
- }\
- name##MatcherP5(p0##_type gmock_p0, p1##_type gmock_p1, \
- p2##_type gmock_p2, p3##_type gmock_p3, \
- p4##_type gmock_p4) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
- p3(gmock_p3), p4(gmock_p4) {\
- }\
- p0##_type p0;\
- p1##_type p1;\
- p2##_type p2;\
- p3##_type p3;\
- p4##_type p4;\
- private:\
- GTEST_DISALLOW_ASSIGN_(name##MatcherP5);\
- };\
- template <typename p0##_type, typename p1##_type, typename p2##_type, \
- typename p3##_type, typename p4##_type>\
- inline name##MatcherP5<p0##_type, p1##_type, p2##_type, p3##_type, \
- p4##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
- p4##_type p4) {\
- return name##MatcherP5<p0##_type, p1##_type, p2##_type, p3##_type, \
- p4##_type>(p0, p1, p2, p3, p4);\
- }\
- template <typename p0##_type, typename p1##_type, typename p2##_type, \
- typename p3##_type, typename p4##_type>\
- template <typename arg_type>\
- bool name##MatcherP5<p0##_type, p1##_type, p2##_type, p3##_type, \
- p4##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
- arg_type arg, \
- ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
- const
-
-#define MATCHER_P6(name, p0, p1, p2, p3, p4, p5, description)\
- template <typename p0##_type, typename p1##_type, typename p2##_type, \
- typename p3##_type, typename p4##_type, typename p5##_type>\
- class name##MatcherP6 {\
- public:\
- template <typename arg_type>\
- class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
- public:\
- gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
- p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5)\
- : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), \
- p4(gmock_p4), p5(gmock_p5) {}\
- virtual bool MatchAndExplain(\
- arg_type arg, ::testing::MatchResultListener* result_listener) const;\
- virtual void DescribeTo(::std::ostream* gmock_os) const {\
- *gmock_os << FormatDescription(false);\
- }\
- virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
- *gmock_os << FormatDescription(true);\
- }\
- p0##_type p0;\
- p1##_type p1;\
- p2##_type p2;\
- p3##_type p3;\
- p4##_type p4;\
- p5##_type p5;\
- private:\
- ::testing::internal::string FormatDescription(bool negation) const {\
- const ::testing::internal::string gmock_description = (description);\
- if (!gmock_description.empty())\
- return gmock_description;\
- return ::testing::internal::FormatMatcherDescription(\
- negation, #name, \
- ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
- ::std::tr1::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
- p4##_type, p5##_type>(p0, p1, p2, p3, p4, p5)));\
- }\
- GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
- };\
- template <typename arg_type>\
- operator ::testing::Matcher<arg_type>() const {\
- return ::testing::Matcher<arg_type>(\
- new gmock_Impl<arg_type>(p0, p1, p2, p3, p4, p5));\
- }\
- name##MatcherP6(p0##_type gmock_p0, p1##_type gmock_p1, \
- p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
- p5##_type gmock_p5) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
- p3(gmock_p3), p4(gmock_p4), p5(gmock_p5) {\
- }\
- p0##_type p0;\
- p1##_type p1;\
- p2##_type p2;\
- p3##_type p3;\
- p4##_type p4;\
- p5##_type p5;\
- private:\
- GTEST_DISALLOW_ASSIGN_(name##MatcherP6);\
- };\
- template <typename p0##_type, typename p1##_type, typename p2##_type, \
- typename p3##_type, typename p4##_type, typename p5##_type>\
- inline name##MatcherP6<p0##_type, p1##_type, p2##_type, p3##_type, \
- p4##_type, p5##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, \
- p3##_type p3, p4##_type p4, p5##_type p5) {\
- return name##MatcherP6<p0##_type, p1##_type, p2##_type, p3##_type, \
- p4##_type, p5##_type>(p0, p1, p2, p3, p4, p5);\
- }\
- template <typename p0##_type, typename p1##_type, typename p2##_type, \
- typename p3##_type, typename p4##_type, typename p5##_type>\
- template <typename arg_type>\
- bool name##MatcherP6<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
- p5##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
- arg_type arg, \
- ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
- const
-
-#define MATCHER_P7(name, p0, p1, p2, p3, p4, p5, p6, description)\
- template <typename p0##_type, typename p1##_type, typename p2##_type, \
- typename p3##_type, typename p4##_type, typename p5##_type, \
- typename p6##_type>\
- class name##MatcherP7 {\
- public:\
- template <typename arg_type>\
- class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
- public:\
- gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
- p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
- p6##_type gmock_p6)\
- : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), \
- p4(gmock_p4), p5(gmock_p5), p6(gmock_p6) {}\
- virtual bool MatchAndExplain(\
- arg_type arg, ::testing::MatchResultListener* result_listener) const;\
- virtual void DescribeTo(::std::ostream* gmock_os) const {\
- *gmock_os << FormatDescription(false);\
- }\
- virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
- *gmock_os << FormatDescription(true);\
- }\
- p0##_type p0;\
- p1##_type p1;\
- p2##_type p2;\
- p3##_type p3;\
- p4##_type p4;\
- p5##_type p5;\
- p6##_type p6;\
- private:\
- ::testing::internal::string FormatDescription(bool negation) const {\
- const ::testing::internal::string gmock_description = (description);\
- if (!gmock_description.empty())\
- return gmock_description;\
- return ::testing::internal::FormatMatcherDescription(\
- negation, #name, \
- ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
- ::std::tr1::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
- p4##_type, p5##_type, p6##_type>(p0, p1, p2, p3, p4, p5, \
- p6)));\
- }\
- GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
- };\
- template <typename arg_type>\
- operator ::testing::Matcher<arg_type>() const {\
- return ::testing::Matcher<arg_type>(\
- new gmock_Impl<arg_type>(p0, p1, p2, p3, p4, p5, p6));\
- }\
- name##MatcherP7(p0##_type gmock_p0, p1##_type gmock_p1, \
- p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
- p5##_type gmock_p5, p6##_type gmock_p6) : p0(gmock_p0), p1(gmock_p1), \
- p2(gmock_p2), p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), \
- p6(gmock_p6) {\
- }\
- p0##_type p0;\
- p1##_type p1;\
- p2##_type p2;\
- p3##_type p3;\
- p4##_type p4;\
- p5##_type p5;\
- p6##_type p6;\
- private:\
- GTEST_DISALLOW_ASSIGN_(name##MatcherP7);\
- };\
- template <typename p0##_type, typename p1##_type, typename p2##_type, \
- typename p3##_type, typename p4##_type, typename p5##_type, \
- typename p6##_type>\
- inline name##MatcherP7<p0##_type, p1##_type, p2##_type, p3##_type, \
- p4##_type, p5##_type, p6##_type> name(p0##_type p0, p1##_type p1, \
- p2##_type p2, p3##_type p3, p4##_type p4, p5##_type p5, \
- p6##_type p6) {\
- return name##MatcherP7<p0##_type, p1##_type, p2##_type, p3##_type, \
- p4##_type, p5##_type, p6##_type>(p0, p1, p2, p3, p4, p5, p6);\
- }\
- template <typename p0##_type, typename p1##_type, typename p2##_type, \
- typename p3##_type, typename p4##_type, typename p5##_type, \
- typename p6##_type>\
- template <typename arg_type>\
- bool name##MatcherP7<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
- p5##_type, p6##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
- arg_type arg, \
- ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
- const
-
-#define MATCHER_P8(name, p0, p1, p2, p3, p4, p5, p6, p7, description)\
- template <typename p0##_type, typename p1##_type, typename p2##_type, \
- typename p3##_type, typename p4##_type, typename p5##_type, \
- typename p6##_type, typename p7##_type>\
- class name##MatcherP8 {\
- public:\
- template <typename arg_type>\
- class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
- public:\
- gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
- p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
- p6##_type gmock_p6, p7##_type gmock_p7)\
- : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), \
- p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), p7(gmock_p7) {}\
- virtual bool MatchAndExplain(\
- arg_type arg, ::testing::MatchResultListener* result_listener) const;\
- virtual void DescribeTo(::std::ostream* gmock_os) const {\
- *gmock_os << FormatDescription(false);\
- }\
- virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
- *gmock_os << FormatDescription(true);\
- }\
- p0##_type p0;\
- p1##_type p1;\
- p2##_type p2;\
- p3##_type p3;\
- p4##_type p4;\
- p5##_type p5;\
- p6##_type p6;\
- p7##_type p7;\
- private:\
- ::testing::internal::string FormatDescription(bool negation) const {\
- const ::testing::internal::string gmock_description = (description);\
- if (!gmock_description.empty())\
- return gmock_description;\
- return ::testing::internal::FormatMatcherDescription(\
- negation, #name, \
- ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
- ::std::tr1::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
- p4##_type, p5##_type, p6##_type, p7##_type>(p0, p1, p2, \
- p3, p4, p5, p6, p7)));\
- }\
- GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
- };\
- template <typename arg_type>\
- operator ::testing::Matcher<arg_type>() const {\
- return ::testing::Matcher<arg_type>(\
- new gmock_Impl<arg_type>(p0, p1, p2, p3, p4, p5, p6, p7));\
- }\
- name##MatcherP8(p0##_type gmock_p0, p1##_type gmock_p1, \
- p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
- p5##_type gmock_p5, p6##_type gmock_p6, \
- p7##_type gmock_p7) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
- p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), \
- p7(gmock_p7) {\
- }\
- p0##_type p0;\
- p1##_type p1;\
- p2##_type p2;\
- p3##_type p3;\
- p4##_type p4;\
- p5##_type p5;\
- p6##_type p6;\
- p7##_type p7;\
- private:\
- GTEST_DISALLOW_ASSIGN_(name##MatcherP8);\
- };\
- template <typename p0##_type, typename p1##_type, typename p2##_type, \
- typename p3##_type, typename p4##_type, typename p5##_type, \
- typename p6##_type, typename p7##_type>\
- inline name##MatcherP8<p0##_type, p1##_type, p2##_type, p3##_type, \
- p4##_type, p5##_type, p6##_type, p7##_type> name(p0##_type p0, \
- p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, p5##_type p5, \
- p6##_type p6, p7##_type p7) {\
- return name##MatcherP8<p0##_type, p1##_type, p2##_type, p3##_type, \
- p4##_type, p5##_type, p6##_type, p7##_type>(p0, p1, p2, p3, p4, p5, \
- p6, p7);\
- }\
- template <typename p0##_type, typename p1##_type, typename p2##_type, \
- typename p3##_type, typename p4##_type, typename p5##_type, \
- typename p6##_type, typename p7##_type>\
- template <typename arg_type>\
- bool name##MatcherP8<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
- p5##_type, p6##_type, \
- p7##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
- arg_type arg, \
- ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
- const
-
-#define MATCHER_P9(name, p0, p1, p2, p3, p4, p5, p6, p7, p8, description)\
- template <typename p0##_type, typename p1##_type, typename p2##_type, \
- typename p3##_type, typename p4##_type, typename p5##_type, \
- typename p6##_type, typename p7##_type, typename p8##_type>\
- class name##MatcherP9 {\
- public:\
- template <typename arg_type>\
- class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
- public:\
- gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
- p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
- p6##_type gmock_p6, p7##_type gmock_p7, p8##_type gmock_p8)\
- : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), \
- p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), p7(gmock_p7), \
- p8(gmock_p8) {}\
- virtual bool MatchAndExplain(\
- arg_type arg, ::testing::MatchResultListener* result_listener) const;\
- virtual void DescribeTo(::std::ostream* gmock_os) const {\
- *gmock_os << FormatDescription(false);\
- }\
- virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
- *gmock_os << FormatDescription(true);\
- }\
- p0##_type p0;\
- p1##_type p1;\
- p2##_type p2;\
- p3##_type p3;\
- p4##_type p4;\
- p5##_type p5;\
- p6##_type p6;\
- p7##_type p7;\
- p8##_type p8;\
- private:\
- ::testing::internal::string FormatDescription(bool negation) const {\
- const ::testing::internal::string gmock_description = (description);\
- if (!gmock_description.empty())\
- return gmock_description;\
- return ::testing::internal::FormatMatcherDescription(\
- negation, #name, \
- ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
- ::std::tr1::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
- p4##_type, p5##_type, p6##_type, p7##_type, \
- p8##_type>(p0, p1, p2, p3, p4, p5, p6, p7, p8)));\
- }\
- GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
- };\
- template <typename arg_type>\
- operator ::testing::Matcher<arg_type>() const {\
- return ::testing::Matcher<arg_type>(\
- new gmock_Impl<arg_type>(p0, p1, p2, p3, p4, p5, p6, p7, p8));\
- }\
- name##MatcherP9(p0##_type gmock_p0, p1##_type gmock_p1, \
- p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
- p5##_type gmock_p5, p6##_type gmock_p6, p7##_type gmock_p7, \
- p8##_type gmock_p8) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
- p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), p7(gmock_p7), \
- p8(gmock_p8) {\
- }\
- p0##_type p0;\
- p1##_type p1;\
- p2##_type p2;\
- p3##_type p3;\
- p4##_type p4;\
- p5##_type p5;\
- p6##_type p6;\
- p7##_type p7;\
- p8##_type p8;\
- private:\
- GTEST_DISALLOW_ASSIGN_(name##MatcherP9);\
- };\
- template <typename p0##_type, typename p1##_type, typename p2##_type, \
- typename p3##_type, typename p4##_type, typename p5##_type, \
- typename p6##_type, typename p7##_type, typename p8##_type>\
- inline name##MatcherP9<p0##_type, p1##_type, p2##_type, p3##_type, \
- p4##_type, p5##_type, p6##_type, p7##_type, \
- p8##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
- p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, \
- p8##_type p8) {\
- return name##MatcherP9<p0##_type, p1##_type, p2##_type, p3##_type, \
- p4##_type, p5##_type, p6##_type, p7##_type, p8##_type>(p0, p1, p2, \
- p3, p4, p5, p6, p7, p8);\
- }\
- template <typename p0##_type, typename p1##_type, typename p2##_type, \
- typename p3##_type, typename p4##_type, typename p5##_type, \
- typename p6##_type, typename p7##_type, typename p8##_type>\
- template <typename arg_type>\
- bool name##MatcherP9<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
- p5##_type, p6##_type, p7##_type, \
- p8##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
- arg_type arg, \
- ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
- const
-
-#define MATCHER_P10(name, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, description)\
- template <typename p0##_type, typename p1##_type, typename p2##_type, \
- typename p3##_type, typename p4##_type, typename p5##_type, \
- typename p6##_type, typename p7##_type, typename p8##_type, \
- typename p9##_type>\
- class name##MatcherP10 {\
- public:\
- template <typename arg_type>\
- class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
- public:\
- gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
- p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
- p6##_type gmock_p6, p7##_type gmock_p7, p8##_type gmock_p8, \
- p9##_type gmock_p9)\
- : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), \
- p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), p7(gmock_p7), \
- p8(gmock_p8), p9(gmock_p9) {}\
- virtual bool MatchAndExplain(\
- arg_type arg, ::testing::MatchResultListener* result_listener) const;\
- virtual void DescribeTo(::std::ostream* gmock_os) const {\
- *gmock_os << FormatDescription(false);\
- }\
- virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
- *gmock_os << FormatDescription(true);\
- }\
- p0##_type p0;\
- p1##_type p1;\
- p2##_type p2;\
- p3##_type p3;\
- p4##_type p4;\
- p5##_type p5;\
- p6##_type p6;\
- p7##_type p7;\
- p8##_type p8;\
- p9##_type p9;\
- private:\
- ::testing::internal::string FormatDescription(bool negation) const {\
- const ::testing::internal::string gmock_description = (description);\
- if (!gmock_description.empty())\
- return gmock_description;\
- return ::testing::internal::FormatMatcherDescription(\
- negation, #name, \
- ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
- ::std::tr1::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
- p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, \
- p9##_type>(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)));\
- }\
- GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
- };\
- template <typename arg_type>\
- operator ::testing::Matcher<arg_type>() const {\
- return ::testing::Matcher<arg_type>(\
- new gmock_Impl<arg_type>(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9));\
- }\
- name##MatcherP10(p0##_type gmock_p0, p1##_type gmock_p1, \
- p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
- p5##_type gmock_p5, p6##_type gmock_p6, p7##_type gmock_p7, \
- p8##_type gmock_p8, p9##_type gmock_p9) : p0(gmock_p0), p1(gmock_p1), \
- p2(gmock_p2), p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), \
- p7(gmock_p7), p8(gmock_p8), p9(gmock_p9) {\
- }\
- p0##_type p0;\
- p1##_type p1;\
- p2##_type p2;\
- p3##_type p3;\
- p4##_type p4;\
- p5##_type p5;\
- p6##_type p6;\
- p7##_type p7;\
- p8##_type p8;\
- p9##_type p9;\
- private:\
- GTEST_DISALLOW_ASSIGN_(name##MatcherP10);\
- };\
- template <typename p0##_type, typename p1##_type, typename p2##_type, \
- typename p3##_type, typename p4##_type, typename p5##_type, \
- typename p6##_type, typename p7##_type, typename p8##_type, \
- typename p9##_type>\
- inline name##MatcherP10<p0##_type, p1##_type, p2##_type, p3##_type, \
- p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, \
- p9##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
- p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, p8##_type p8, \
- p9##_type p9) {\
- return name##MatcherP10<p0##_type, p1##_type, p2##_type, p3##_type, \
- p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, p9##_type>(p0, \
- p1, p2, p3, p4, p5, p6, p7, p8, p9);\
- }\
- template <typename p0##_type, typename p1##_type, typename p2##_type, \
- typename p3##_type, typename p4##_type, typename p5##_type, \
- typename p6##_type, typename p7##_type, typename p8##_type, \
- typename p9##_type>\
- template <typename arg_type>\
- bool name##MatcherP10<p0##_type, p1##_type, p2##_type, p3##_type, \
- p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, \
- p9##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
- arg_type arg, \
- ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
- const
-
-#endif // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_MATCHERS_H_
diff --git a/src/testing/include/gmock/gmock-generated-matchers.h.pump b/src/testing/include/gmock/gmock-generated-matchers.h.pump
deleted file mode 100644
index 7cdb84bf..00000000
--- a/src/testing/include/gmock/gmock-generated-matchers.h.pump
+++ /dev/null
@@ -1,705 +0,0 @@
-$$ -*- mode: c++; -*-
-$$ This is a Pump source file. Please use Pump to convert it to
-$$ gmock-generated-actions.h.
-$$
-$var n = 10 $$ The maximum arity we support.
-$$ }} This line fixes auto-indentation of the following code in Emacs.
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Google Mock - a framework for writing C++ mock classes.
-//
-// This file implements some commonly used variadic matchers.
-
-#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_MATCHERS_H_
-#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_MATCHERS_H_
-
-#include <sstream>
-#include <string>
-#include <vector>
-#include "gmock/gmock-matchers.h"
-
-namespace testing {
-namespace internal {
-
-$range i 0..n-1
-
-// The type of the i-th (0-based) field of Tuple.
-#define GMOCK_FIELD_TYPE_(Tuple, i) \
- typename ::std::tr1::tuple_element<i, Tuple>::type
-
-// TupleFields<Tuple, k0, ..., kn> is for selecting fields from a
-// tuple of type Tuple. It has two members:
-//
-// type: a tuple type whose i-th field is the ki-th field of Tuple.
-// GetSelectedFields(t): returns fields k0, ..., and kn of t as a tuple.
-//
-// For example, in class TupleFields<tuple<bool, char, int>, 2, 0>, we have:
-//
-// type is tuple<int, bool>, and
-// GetSelectedFields(make_tuple(true, 'a', 42)) is (42, true).
-
-template <class Tuple$for i [[, int k$i = -1]]>
-class TupleFields;
-
-// This generic version is used when there are $n selectors.
-template <class Tuple$for i [[, int k$i]]>
-class TupleFields {
- public:
- typedef ::std::tr1::tuple<$for i, [[GMOCK_FIELD_TYPE_(Tuple, k$i)]]> type;
- static type GetSelectedFields(const Tuple& t) {
- using ::std::tr1::get;
- return type($for i, [[get<k$i>(t)]]);
- }
-};
-
-// The following specialization is used for 0 ~ $(n-1) selectors.
-
-$for i [[
-$$ }}}
-$range j 0..i-1
-$range k 0..n-1
-
-template <class Tuple$for j [[, int k$j]]>
-class TupleFields<Tuple, $for k, [[$if k < i [[k$k]] $else [[-1]]]]> {
- public:
- typedef ::std::tr1::tuple<$for j, [[GMOCK_FIELD_TYPE_(Tuple, k$j)]]> type;
- static type GetSelectedFields(const Tuple& $if i==0 [[/* t */]] $else [[t]]) {
- using ::std::tr1::get;
- return type($for j, [[get<k$j>(t)]]);
- }
-};
-
-]]
-
-#undef GMOCK_FIELD_TYPE_
-
-// Implements the Args() matcher.
-
-$var ks = [[$for i, [[k$i]]]]
-template <class ArgsTuple$for i [[, int k$i = -1]]>
-class ArgsMatcherImpl : public MatcherInterface<ArgsTuple> {
- public:
- // ArgsTuple may have top-level const or reference modifiers.
- typedef GTEST_REMOVE_REFERENCE_AND_CONST_(ArgsTuple) RawArgsTuple;
- typedef typename internal::TupleFields<RawArgsTuple, $ks>::type SelectedArgs;
- typedef Matcher<const SelectedArgs&> MonomorphicInnerMatcher;
-
- template <typename InnerMatcher>
- explicit ArgsMatcherImpl(const InnerMatcher& inner_matcher)
- : inner_matcher_(SafeMatcherCast<const SelectedArgs&>(inner_matcher)) {}
-
- virtual bool MatchAndExplain(ArgsTuple args,
- MatchResultListener* listener) const {
- const SelectedArgs& selected_args = GetSelectedArgs(args);
- if (!listener->IsInterested())
- return inner_matcher_.Matches(selected_args);
-
- PrintIndices(listener->stream());
- *listener << "are " << PrintToString(selected_args);
-
- StringMatchResultListener inner_listener;
- const bool match = inner_matcher_.MatchAndExplain(selected_args,
- &inner_listener);
- PrintIfNotEmpty(inner_listener.str(), listener->stream());
- return match;
- }
-
- virtual void DescribeTo(::std::ostream* os) const {
- *os << "are a tuple ";
- PrintIndices(os);
- inner_matcher_.DescribeTo(os);
- }
-
- virtual void DescribeNegationTo(::std::ostream* os) const {
- *os << "are a tuple ";
- PrintIndices(os);
- inner_matcher_.DescribeNegationTo(os);
- }
-
- private:
- static SelectedArgs GetSelectedArgs(ArgsTuple args) {
- return TupleFields<RawArgsTuple, $ks>::GetSelectedFields(args);
- }
-
- // Prints the indices of the selected fields.
- static void PrintIndices(::std::ostream* os) {
- *os << "whose fields (";
- const int indices[$n] = { $ks };
- for (int i = 0; i < $n; i++) {
- if (indices[i] < 0)
- break;
-
- if (i >= 1)
- *os << ", ";
-
- *os << "#" << indices[i];
- }
- *os << ") ";
- }
-
- const MonomorphicInnerMatcher inner_matcher_;
-
- GTEST_DISALLOW_ASSIGN_(ArgsMatcherImpl);
-};
-
-template <class InnerMatcher$for i [[, int k$i = -1]]>
-class ArgsMatcher {
- public:
- explicit ArgsMatcher(const InnerMatcher& inner_matcher)
- : inner_matcher_(inner_matcher) {}
-
- template <typename ArgsTuple>
- operator Matcher<ArgsTuple>() const {
- return MakeMatcher(new ArgsMatcherImpl<ArgsTuple, $ks>(inner_matcher_));
- }
-
- private:
- const InnerMatcher inner_matcher_;
-
- GTEST_DISALLOW_ASSIGN_(ArgsMatcher);
-};
-
-// Implements ElementsAre() of 1-$n arguments.
-
-
-$range i 1..n
-$for i [[
-$range j 1..i
-template <$for j, [[typename T$j]]>
-class ElementsAreMatcher$i {
- public:
- $if i==1 [[explicit ]]ElementsAreMatcher$i($for j, [[const T$j& e$j]])$if i > 0 [[ : ]]
- $for j, [[e$j[[]]_(e$j)]] {}
-
- template <typename Container>
- operator Matcher<Container>() const {
- typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer;
- typedef typename internal::StlContainerView<RawContainer>::type::value_type
- Element;
-
-$if i==1 [[
-
- // Nokia's Symbian Compiler has a nasty bug where the object put
- // in a one-element local array is not destructed when the array
- // goes out of scope. This leads to obvious badness as we've
- // added the linked_ptr in it to our other linked_ptrs list.
- // Hence we implement ElementsAreMatcher1 specially to avoid using
- // a local array.
- const Matcher<const Element&> matcher =
- MatcherCast<const Element&>(e1_);
- return MakeMatcher(new ElementsAreMatcherImpl<Container>(&matcher, 1));
-]] $else [[
-
- const Matcher<const Element&> matchers[] = {
-
-$for j [[
- MatcherCast<const Element&>(e$j[[]]_),
-
-]]
- };
-
- return MakeMatcher(new ElementsAreMatcherImpl<Container>(matchers, $i));
-]]
-
- }
-
- private:
-
-$for j [[
- const T$j& e$j[[]]_;
-
-]]
-
- GTEST_DISALLOW_ASSIGN_(ElementsAreMatcher$i);
-};
-
-
-]]
-// A set of metafunctions for computing the result type of AllOf.
-// AllOf(m1, ..., mN) returns
-// AllOfResultN<decltype(m1), ..., decltype(mN)>::type.
-
-// Although AllOf isn't defined for one argument, AllOfResult1 is defined
-// to simplify the implementation.
-template <typename M1>
-struct AllOfResult1 {
- typedef M1 type;
-};
-
-$range i 1..n
-
-$range i 2..n
-$for i [[
-$range j 2..i
-$var m = i/2
-$range k 1..m
-$range t m+1..i
-
-template <typename M1$for j [[, typename M$j]]>
-struct AllOfResult$i {
- typedef BothOfMatcher<
- typename AllOfResult$m<$for k, [[M$k]]>::type,
- typename AllOfResult$(i-m)<$for t, [[M$t]]>::type
- > type;
-};
-
-]]
-
-// A set of metafunctions for computing the result type of AnyOf.
-// AnyOf(m1, ..., mN) returns
-// AnyOfResultN<decltype(m1), ..., decltype(mN)>::type.
-
-// Although AnyOf isn't defined for one argument, AnyOfResult1 is defined
-// to simplify the implementation.
-template <typename M1>
-struct AnyOfResult1 {
- typedef M1 type;
-};
-
-$range i 1..n
-
-$range i 2..n
-$for i [[
-$range j 2..i
-$var m = i/2
-$range k 1..m
-$range t m+1..i
-
-template <typename M1$for j [[, typename M$j]]>
-struct AnyOfResult$i {
- typedef EitherOfMatcher<
- typename AnyOfResult$m<$for k, [[M$k]]>::type,
- typename AnyOfResult$(i-m)<$for t, [[M$t]]>::type
- > type;
-};
-
-]]
-
-} // namespace internal
-
-// Args<N1, N2, ..., Nk>(a_matcher) matches a tuple if the selected
-// fields of it matches a_matcher. C++ doesn't support default
-// arguments for function templates, so we have to overload it.
-
-$range i 0..n
-$for i [[
-$range j 1..i
-template <$for j [[int k$j, ]]typename InnerMatcher>
-inline internal::ArgsMatcher<InnerMatcher$for j [[, k$j]]>
-Args(const InnerMatcher& matcher) {
- return internal::ArgsMatcher<InnerMatcher$for j [[, k$j]]>(matcher);
-}
-
-
-]]
-// ElementsAre(e0, e1, ..., e_n) matches an STL-style container with
-// (n + 1) elements, where the i-th element in the container must
-// match the i-th argument in the list. Each argument of
-// ElementsAre() can be either a value or a matcher. We support up to
-// $n arguments.
-//
-// NOTE: Since ElementsAre() cares about the order of the elements, it
-// must not be used with containers whose elements's order is
-// undefined (e.g. hash_map).
-
-inline internal::ElementsAreMatcher0 ElementsAre() {
- return internal::ElementsAreMatcher0();
-}
-
-$range i 1..n
-$for i [[
-$range j 1..i
-
-template <$for j, [[typename T$j]]>
-inline internal::ElementsAreMatcher$i<$for j, [[T$j]]> ElementsAre($for j, [[const T$j& e$j]]) {
- return internal::ElementsAreMatcher$i<$for j, [[T$j]]>($for j, [[e$j]]);
-}
-
-]]
-
-// ElementsAreArray(array) and ElementAreArray(array, count) are like
-// ElementsAre(), except that they take an array of values or
-// matchers. The former form infers the size of 'array', which must
-// be a static C-style array. In the latter form, 'array' can either
-// be a static array or a pointer to a dynamically created array.
-
-template <typename T>
-inline internal::ElementsAreArrayMatcher<T> ElementsAreArray(
- const T* first, size_t count) {
- return internal::ElementsAreArrayMatcher<T>(first, count);
-}
-
-template <typename T, size_t N>
-inline internal::ElementsAreArrayMatcher<T>
-ElementsAreArray(const T (&array)[N]) {
- return internal::ElementsAreArrayMatcher<T>(array, N);
-}
-
-// AllOf(m1, m2, ..., mk) matches any value that matches all of the given
-// sub-matchers. AllOf is called fully qualified to prevent ADL from firing.
-
-$range i 2..n
-$for i [[
-$range j 1..i
-$var m = i/2
-$range k 1..m
-$range t m+1..i
-
-template <$for j, [[typename M$j]]>
-inline typename internal::AllOfResult$i<$for j, [[M$j]]>::type
-AllOf($for j, [[M$j m$j]]) {
- return typename internal::AllOfResult$i<$for j, [[M$j]]>::type(
- $if m == 1 [[m1]] $else [[::testing::AllOf($for k, [[m$k]])]],
- $if m+1 == i [[m$i]] $else [[::testing::AllOf($for t, [[m$t]])]]);
-}
-
-]]
-
-// AnyOf(m1, m2, ..., mk) matches any value that matches any of the given
-// sub-matchers. AnyOf is called fully qualified to prevent ADL from firing.
-
-$range i 2..n
-$for i [[
-$range j 1..i
-$var m = i/2
-$range k 1..m
-$range t m+1..i
-
-template <$for j, [[typename M$j]]>
-inline typename internal::AnyOfResult$i<$for j, [[M$j]]>::type
-AnyOf($for j, [[M$j m$j]]) {
- return typename internal::AnyOfResult$i<$for j, [[M$j]]>::type(
- $if m == 1 [[m1]] $else [[::testing::AnyOf($for k, [[m$k]])]],
- $if m+1 == i [[m$i]] $else [[::testing::AnyOf($for t, [[m$t]])]]);
-}
-
-]]
-
-} // namespace testing
-$$ } // This Pump meta comment fixes auto-indentation in Emacs. It will not
-$$ // show up in the generated code.
-
-
-// The MATCHER* family of macros can be used in a namespace scope to
-// define custom matchers easily.
-//
-// Basic Usage
-// ===========
-//
-// The syntax
-//
-// MATCHER(name, description_string) { statements; }
-//
-// defines a matcher with the given name that executes the statements,
-// which must return a bool to indicate if the match succeeds. Inside
-// the statements, you can refer to the value being matched by 'arg',
-// and refer to its type by 'arg_type'.
-//
-// The description string documents what the matcher does, and is used
-// to generate the failure message when the match fails. Since a
-// MATCHER() is usually defined in a header file shared by multiple
-// C++ source files, we require the description to be a C-string
-// literal to avoid possible side effects. It can be empty, in which
-// case we'll use the sequence of words in the matcher name as the
-// description.
-//
-// For example:
-//
-// MATCHER(IsEven, "") { return (arg % 2) == 0; }
-//
-// allows you to write
-//
-// // Expects mock_foo.Bar(n) to be called where n is even.
-// EXPECT_CALL(mock_foo, Bar(IsEven()));
-//
-// or,
-//
-// // Verifies that the value of some_expression is even.
-// EXPECT_THAT(some_expression, IsEven());
-//
-// If the above assertion fails, it will print something like:
-//
-// Value of: some_expression
-// Expected: is even
-// Actual: 7
-//
-// where the description "is even" is automatically calculated from the
-// matcher name IsEven.
-//
-// Argument Type
-// =============
-//
-// Note that the type of the value being matched (arg_type) is
-// determined by the context in which you use the matcher and is
-// supplied to you by the compiler, so you don't need to worry about
-// declaring it (nor can you). This allows the matcher to be
-// polymorphic. For example, IsEven() can be used to match any type
-// where the value of "(arg % 2) == 0" can be implicitly converted to
-// a bool. In the "Bar(IsEven())" example above, if method Bar()
-// takes an int, 'arg_type' will be int; if it takes an unsigned long,
-// 'arg_type' will be unsigned long; and so on.
-//
-// Parameterizing Matchers
-// =======================
-//
-// Sometimes you'll want to parameterize the matcher. For that you
-// can use another macro:
-//
-// MATCHER_P(name, param_name, description_string) { statements; }
-//
-// For example:
-//
-// MATCHER_P(HasAbsoluteValue, value, "") { return abs(arg) == value; }
-//
-// will allow you to write:
-//
-// EXPECT_THAT(Blah("a"), HasAbsoluteValue(n));
-//
-// which may lead to this message (assuming n is 10):
-//
-// Value of: Blah("a")
-// Expected: has absolute value 10
-// Actual: -9
-//
-// Note that both the matcher description and its parameter are
-// printed, making the message human-friendly.
-//
-// In the matcher definition body, you can write 'foo_type' to
-// reference the type of a parameter named 'foo'. For example, in the
-// body of MATCHER_P(HasAbsoluteValue, value) above, you can write
-// 'value_type' to refer to the type of 'value'.
-//
-// We also provide MATCHER_P2, MATCHER_P3, ..., up to MATCHER_P$n to
-// support multi-parameter matchers.
-//
-// Describing Parameterized Matchers
-// =================================
-//
-// The last argument to MATCHER*() is a string-typed expression. The
-// expression can reference all of the matcher's parameters and a
-// special bool-typed variable named 'negation'. When 'negation' is
-// false, the expression should evaluate to the matcher's description;
-// otherwise it should evaluate to the description of the negation of
-// the matcher. For example,
-//
-// using testing::PrintToString;
-//
-// MATCHER_P2(InClosedRange, low, hi,
-// string(negation ? "is not" : "is") + " in range [" +
-// PrintToString(low) + ", " + PrintToString(hi) + "]") {
-// return low <= arg && arg <= hi;
-// }
-// ...
-// EXPECT_THAT(3, InClosedRange(4, 6));
-// EXPECT_THAT(3, Not(InClosedRange(2, 4)));
-//
-// would generate two failures that contain the text:
-//
-// Expected: is in range [4, 6]
-// ...
-// Expected: is not in range [2, 4]
-//
-// If you specify "" as the description, the failure message will
-// contain the sequence of words in the matcher name followed by the
-// parameter values printed as a tuple. For example,
-//
-// MATCHER_P2(InClosedRange, low, hi, "") { ... }
-// ...
-// EXPECT_THAT(3, InClosedRange(4, 6));
-// EXPECT_THAT(3, Not(InClosedRange(2, 4)));
-//
-// would generate two failures that contain the text:
-//
-// Expected: in closed range (4, 6)
-// ...
-// Expected: not (in closed range (2, 4))
-//
-// Types of Matcher Parameters
-// ===========================
-//
-// For the purpose of typing, you can view
-//
-// MATCHER_Pk(Foo, p1, ..., pk, description_string) { ... }
-//
-// as shorthand for
-//
-// template <typename p1_type, ..., typename pk_type>
-// FooMatcherPk<p1_type, ..., pk_type>
-// Foo(p1_type p1, ..., pk_type pk) { ... }
-//
-// When you write Foo(v1, ..., vk), the compiler infers the types of
-// the parameters v1, ..., and vk for you. If you are not happy with
-// the result of the type inference, you can specify the types by
-// explicitly instantiating the template, as in Foo<long, bool>(5,
-// false). As said earlier, you don't get to (or need to) specify
-// 'arg_type' as that's determined by the context in which the matcher
-// is used. You can assign the result of expression Foo(p1, ..., pk)
-// to a variable of type FooMatcherPk<p1_type, ..., pk_type>. This
-// can be useful when composing matchers.
-//
-// While you can instantiate a matcher template with reference types,
-// passing the parameters by pointer usually makes your code more
-// readable. If, however, you still want to pass a parameter by
-// reference, be aware that in the failure message generated by the
-// matcher you will see the value of the referenced object but not its
-// address.
-//
-// Explaining Match Results
-// ========================
-//
-// Sometimes the matcher description alone isn't enough to explain why
-// the match has failed or succeeded. For example, when expecting a
-// long string, it can be very helpful to also print the diff between
-// the expected string and the actual one. To achieve that, you can
-// optionally stream additional information to a special variable
-// named result_listener, whose type is a pointer to class
-// MatchResultListener:
-//
-// MATCHER_P(EqualsLongString, str, "") {
-// if (arg == str) return true;
-//
-// *result_listener << "the difference: "
-/// << DiffStrings(str, arg);
-// return false;
-// }
-//
-// Overloading Matchers
-// ====================
-//
-// You can overload matchers with different numbers of parameters:
-//
-// MATCHER_P(Blah, a, description_string1) { ... }
-// MATCHER_P2(Blah, a, b, description_string2) { ... }
-//
-// Caveats
-// =======
-//
-// When defining a new matcher, you should also consider implementing
-// MatcherInterface or using MakePolymorphicMatcher(). These
-// approaches require more work than the MATCHER* macros, but also
-// give you more control on the types of the value being matched and
-// the matcher parameters, which may leads to better compiler error
-// messages when the matcher is used wrong. They also allow
-// overloading matchers based on parameter types (as opposed to just
-// based on the number of parameters).
-//
-// MATCHER*() can only be used in a namespace scope. The reason is
-// that C++ doesn't yet allow function-local types to be used to
-// instantiate templates. The up-coming C++0x standard will fix this.
-// Once that's done, we'll consider supporting using MATCHER*() inside
-// a function.
-//
-// More Information
-// ================
-//
-// To learn more about using these macros, please search for 'MATCHER'
-// on http://code.google.com/p/googlemock/wiki/CookBook.
-
-$range i 0..n
-$for i
-
-[[
-$var macro_name = [[$if i==0 [[MATCHER]] $elif i==1 [[MATCHER_P]]
- $else [[MATCHER_P$i]]]]
-$var class_name = [[name##Matcher[[$if i==0 [[]] $elif i==1 [[P]]
- $else [[P$i]]]]]]
-$range j 0..i-1
-$var template = [[$if i==0 [[]] $else [[
-
- template <$for j, [[typename p$j##_type]]>\
-]]]]
-$var ctor_param_list = [[$for j, [[p$j##_type gmock_p$j]]]]
-$var impl_ctor_param_list = [[$for j, [[p$j##_type gmock_p$j]]]]
-$var impl_inits = [[$if i==0 [[]] $else [[ : $for j, [[p$j(gmock_p$j)]]]]]]
-$var inits = [[$if i==0 [[]] $else [[ : $for j, [[p$j(gmock_p$j)]]]]]]
-$var params = [[$for j, [[p$j]]]]
-$var param_types = [[$if i==0 [[]] $else [[<$for j, [[p$j##_type]]>]]]]
-$var param_types_and_names = [[$for j, [[p$j##_type p$j]]]]
-$var param_field_decls = [[$for j
-[[
-
- p$j##_type p$j;\
-]]]]
-$var param_field_decls2 = [[$for j
-[[
-
- p$j##_type p$j;\
-]]]]
-
-#define $macro_name(name$for j [[, p$j]], description)\$template
- class $class_name {\
- public:\
- template <typename arg_type>\
- class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
- public:\
- [[$if i==1 [[explicit ]]]]gmock_Impl($impl_ctor_param_list)\
- $impl_inits {}\
- virtual bool MatchAndExplain(\
- arg_type arg, ::testing::MatchResultListener* result_listener) const;\
- virtual void DescribeTo(::std::ostream* gmock_os) const {\
- *gmock_os << FormatDescription(false);\
- }\
- virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
- *gmock_os << FormatDescription(true);\
- }\$param_field_decls
- private:\
- ::testing::internal::string FormatDescription(bool negation) const {\
- const ::testing::internal::string gmock_description = (description);\
- if (!gmock_description.empty())\
- return gmock_description;\
- return ::testing::internal::FormatMatcherDescription(\
- negation, #name, \
- ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
- ::std::tr1::tuple<$for j, [[p$j##_type]]>($for j, [[p$j]])));\
- }\
- GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
- };\
- template <typename arg_type>\
- operator ::testing::Matcher<arg_type>() const {\
- return ::testing::Matcher<arg_type>(\
- new gmock_Impl<arg_type>($params));\
- }\
- $class_name($ctor_param_list)$inits {\
- }\$param_field_decls2
- private:\
- GTEST_DISALLOW_ASSIGN_($class_name);\
- };\$template
- inline $class_name$param_types name($param_types_and_names) {\
- return $class_name$param_types($params);\
- }\$template
- template <typename arg_type>\
- bool $class_name$param_types::gmock_Impl<arg_type>::MatchAndExplain(\
- arg_type arg, \
- ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
- const
-]]
-
-
-#endif // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_MATCHERS_H_
diff --git a/src/testing/include/gmock/gmock-generated-nice-strict.h b/src/testing/include/gmock/gmock-generated-nice-strict.h
deleted file mode 100644
index 6099e81e..00000000
--- a/src/testing/include/gmock/gmock-generated-nice-strict.h
+++ /dev/null
@@ -1,274 +0,0 @@
-// This file was GENERATED by a script. DO NOT EDIT BY HAND!!!
-
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-// Implements class templates NiceMock and StrictMock.
-//
-// Given a mock class MockFoo that is created using Google Mock,
-// NiceMock<MockFoo> is a subclass of MockFoo that allows
-// uninteresting calls (i.e. calls to mock methods that have no
-// EXPECT_CALL specs), and StrictMock<MockFoo> is a subclass of
-// MockFoo that treats all uninteresting calls as errors.
-//
-// NiceMock and StrictMock "inherits" the constructors of their
-// respective base class, with up-to 10 arguments. Therefore you can
-// write NiceMock<MockFoo>(5, "a") to construct a nice mock where
-// MockFoo has a constructor that accepts (int, const char*), for
-// example.
-//
-// A known limitation is that NiceMock<MockFoo> and
-// StrictMock<MockFoo> only works for mock methods defined using the
-// MOCK_METHOD* family of macros DIRECTLY in the MockFoo class. If a
-// mock method is defined in a base class of MockFoo, the "nice" or
-// "strict" modifier may not affect it, depending on the compiler. In
-// particular, nesting NiceMock and StrictMock is NOT supported.
-//
-// Another known limitation is that the constructors of the base mock
-// cannot have arguments passed by non-const reference, which are
-// banned by the Google C++ style guide anyway.
-
-#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_NICE_STRICT_H_
-#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_NICE_STRICT_H_
-
-#include "gmock/gmock-spec-builders.h"
-#include "gmock/internal/gmock-port.h"
-
-namespace testing {
-
-template <class MockClass>
-class NiceMock : public MockClass {
- public:
- // We don't factor out the constructor body to a common method, as
- // we have to avoid a possible clash with members of MockClass.
- NiceMock() {
- ::testing::Mock::AllowUninterestingCalls(
- internal::ImplicitCast_<MockClass*>(this));
- }
-
- // C++ doesn't (yet) allow inheritance of constructors, so we have
- // to define it for each arity.
- template <typename A1>
- explicit NiceMock(const A1& a1) : MockClass(a1) {
- ::testing::Mock::AllowUninterestingCalls(
- internal::ImplicitCast_<MockClass*>(this));
- }
- template <typename A1, typename A2>
- NiceMock(const A1& a1, const A2& a2) : MockClass(a1, a2) {
- ::testing::Mock::AllowUninterestingCalls(
- internal::ImplicitCast_<MockClass*>(this));
- }
-
- template <typename A1, typename A2, typename A3>
- NiceMock(const A1& a1, const A2& a2, const A3& a3) : MockClass(a1, a2, a3) {
- ::testing::Mock::AllowUninterestingCalls(
- internal::ImplicitCast_<MockClass*>(this));
- }
-
- template <typename A1, typename A2, typename A3, typename A4>
- NiceMock(const A1& a1, const A2& a2, const A3& a3,
- const A4& a4) : MockClass(a1, a2, a3, a4) {
- ::testing::Mock::AllowUninterestingCalls(
- internal::ImplicitCast_<MockClass*>(this));
- }
-
- template <typename A1, typename A2, typename A3, typename A4, typename A5>
- NiceMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,
- const A5& a5) : MockClass(a1, a2, a3, a4, a5) {
- ::testing::Mock::AllowUninterestingCalls(
- internal::ImplicitCast_<MockClass*>(this));
- }
-
- template <typename A1, typename A2, typename A3, typename A4, typename A5,
- typename A6>
- NiceMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,
- const A5& a5, const A6& a6) : MockClass(a1, a2, a3, a4, a5, a6) {
- ::testing::Mock::AllowUninterestingCalls(
- internal::ImplicitCast_<MockClass*>(this));
- }
-
- template <typename A1, typename A2, typename A3, typename A4, typename A5,
- typename A6, typename A7>
- NiceMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,
- const A5& a5, const A6& a6, const A7& a7) : MockClass(a1, a2, a3, a4, a5,
- a6, a7) {
- ::testing::Mock::AllowUninterestingCalls(
- internal::ImplicitCast_<MockClass*>(this));
- }
-
- template <typename A1, typename A2, typename A3, typename A4, typename A5,
- typename A6, typename A7, typename A8>
- NiceMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,
- const A5& a5, const A6& a6, const A7& a7, const A8& a8) : MockClass(a1,
- a2, a3, a4, a5, a6, a7, a8) {
- ::testing::Mock::AllowUninterestingCalls(
- internal::ImplicitCast_<MockClass*>(this));
- }
-
- template <typename A1, typename A2, typename A3, typename A4, typename A5,
- typename A6, typename A7, typename A8, typename A9>
- NiceMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,
- const A5& a5, const A6& a6, const A7& a7, const A8& a8,
- const A9& a9) : MockClass(a1, a2, a3, a4, a5, a6, a7, a8, a9) {
- ::testing::Mock::AllowUninterestingCalls(
- internal::ImplicitCast_<MockClass*>(this));
- }
-
- template <typename A1, typename A2, typename A3, typename A4, typename A5,
- typename A6, typename A7, typename A8, typename A9, typename A10>
- NiceMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,
- const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9,
- const A10& a10) : MockClass(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) {
- ::testing::Mock::AllowUninterestingCalls(
- internal::ImplicitCast_<MockClass*>(this));
- }
-
- virtual ~NiceMock() {
- ::testing::Mock::UnregisterCallReaction(
- internal::ImplicitCast_<MockClass*>(this));
- }
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(NiceMock);
-};
-
-template <class MockClass>
-class StrictMock : public MockClass {
- public:
- // We don't factor out the constructor body to a common method, as
- // we have to avoid a possible clash with members of MockClass.
- StrictMock() {
- ::testing::Mock::FailUninterestingCalls(
- internal::ImplicitCast_<MockClass*>(this));
- }
-
- template <typename A1>
- explicit StrictMock(const A1& a1) : MockClass(a1) {
- ::testing::Mock::FailUninterestingCalls(
- internal::ImplicitCast_<MockClass*>(this));
- }
- template <typename A1, typename A2>
- StrictMock(const A1& a1, const A2& a2) : MockClass(a1, a2) {
- ::testing::Mock::FailUninterestingCalls(
- internal::ImplicitCast_<MockClass*>(this));
- }
-
- template <typename A1, typename A2, typename A3>
- StrictMock(const A1& a1, const A2& a2, const A3& a3) : MockClass(a1, a2, a3) {
- ::testing::Mock::FailUninterestingCalls(
- internal::ImplicitCast_<MockClass*>(this));
- }
-
- template <typename A1, typename A2, typename A3, typename A4>
- StrictMock(const A1& a1, const A2& a2, const A3& a3,
- const A4& a4) : MockClass(a1, a2, a3, a4) {
- ::testing::Mock::FailUninterestingCalls(
- internal::ImplicitCast_<MockClass*>(this));
- }
-
- template <typename A1, typename A2, typename A3, typename A4, typename A5>
- StrictMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,
- const A5& a5) : MockClass(a1, a2, a3, a4, a5) {
- ::testing::Mock::FailUninterestingCalls(
- internal::ImplicitCast_<MockClass*>(this));
- }
-
- template <typename A1, typename A2, typename A3, typename A4, typename A5,
- typename A6>
- StrictMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,
- const A5& a5, const A6& a6) : MockClass(a1, a2, a3, a4, a5, a6) {
- ::testing::Mock::FailUninterestingCalls(
- internal::ImplicitCast_<MockClass*>(this));
- }
-
- template <typename A1, typename A2, typename A3, typename A4, typename A5,
- typename A6, typename A7>
- StrictMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,
- const A5& a5, const A6& a6, const A7& a7) : MockClass(a1, a2, a3, a4, a5,
- a6, a7) {
- ::testing::Mock::FailUninterestingCalls(
- internal::ImplicitCast_<MockClass*>(this));
- }
-
- template <typename A1, typename A2, typename A3, typename A4, typename A5,
- typename A6, typename A7, typename A8>
- StrictMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,
- const A5& a5, const A6& a6, const A7& a7, const A8& a8) : MockClass(a1,
- a2, a3, a4, a5, a6, a7, a8) {
- ::testing::Mock::FailUninterestingCalls(
- internal::ImplicitCast_<MockClass*>(this));
- }
-
- template <typename A1, typename A2, typename A3, typename A4, typename A5,
- typename A6, typename A7, typename A8, typename A9>
- StrictMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,
- const A5& a5, const A6& a6, const A7& a7, const A8& a8,
- const A9& a9) : MockClass(a1, a2, a3, a4, a5, a6, a7, a8, a9) {
- ::testing::Mock::FailUninterestingCalls(
- internal::ImplicitCast_<MockClass*>(this));
- }
-
- template <typename A1, typename A2, typename A3, typename A4, typename A5,
- typename A6, typename A7, typename A8, typename A9, typename A10>
- StrictMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,
- const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9,
- const A10& a10) : MockClass(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) {
- ::testing::Mock::FailUninterestingCalls(
- internal::ImplicitCast_<MockClass*>(this));
- }
-
- virtual ~StrictMock() {
- ::testing::Mock::UnregisterCallReaction(
- internal::ImplicitCast_<MockClass*>(this));
- }
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(StrictMock);
-};
-
-// The following specializations catch some (relatively more common)
-// user errors of nesting nice and strict mocks. They do NOT catch
-// all possible errors.
-
-// These specializations are declared but not defined, as NiceMock and
-// StrictMock cannot be nested.
-template <typename MockClass>
-class NiceMock<NiceMock<MockClass> >;
-template <typename MockClass>
-class NiceMock<StrictMock<MockClass> >;
-template <typename MockClass>
-class StrictMock<NiceMock<MockClass> >;
-template <typename MockClass>
-class StrictMock<StrictMock<MockClass> >;
-
-} // namespace testing
-
-#endif // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_NICE_STRICT_H_
diff --git a/src/testing/include/gmock/gmock-generated-nice-strict.h.pump b/src/testing/include/gmock/gmock-generated-nice-strict.h.pump
deleted file mode 100644
index b7964db3..00000000
--- a/src/testing/include/gmock/gmock-generated-nice-strict.h.pump
+++ /dev/null
@@ -1,160 +0,0 @@
-$$ -*- mode: c++; -*-
-$$ This is a Pump source file. Please use Pump to convert it to
-$$ gmock-generated-nice-strict.h.
-$$
-$var n = 10 $$ The maximum arity we support.
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-// Implements class templates NiceMock and StrictMock.
-//
-// Given a mock class MockFoo that is created using Google Mock,
-// NiceMock<MockFoo> is a subclass of MockFoo that allows
-// uninteresting calls (i.e. calls to mock methods that have no
-// EXPECT_CALL specs), and StrictMock<MockFoo> is a subclass of
-// MockFoo that treats all uninteresting calls as errors.
-//
-// NiceMock and StrictMock "inherits" the constructors of their
-// respective base class, with up-to $n arguments. Therefore you can
-// write NiceMock<MockFoo>(5, "a") to construct a nice mock where
-// MockFoo has a constructor that accepts (int, const char*), for
-// example.
-//
-// A known limitation is that NiceMock<MockFoo> and
-// StrictMock<MockFoo> only works for mock methods defined using the
-// MOCK_METHOD* family of macros DIRECTLY in the MockFoo class. If a
-// mock method is defined in a base class of MockFoo, the "nice" or
-// "strict" modifier may not affect it, depending on the compiler. In
-// particular, nesting NiceMock and StrictMock is NOT supported.
-//
-// Another known limitation is that the constructors of the base mock
-// cannot have arguments passed by non-const reference, which are
-// banned by the Google C++ style guide anyway.
-
-#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_NICE_STRICT_H_
-#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_NICE_STRICT_H_
-
-#include "gmock/gmock-spec-builders.h"
-#include "gmock/internal/gmock-port.h"
-
-namespace testing {
-
-template <class MockClass>
-class NiceMock : public MockClass {
- public:
- // We don't factor out the constructor body to a common method, as
- // we have to avoid a possible clash with members of MockClass.
- NiceMock() {
- ::testing::Mock::AllowUninterestingCalls(
- internal::ImplicitCast_<MockClass*>(this));
- }
-
- // C++ doesn't (yet) allow inheritance of constructors, so we have
- // to define it for each arity.
- template <typename A1>
- explicit NiceMock(const A1& a1) : MockClass(a1) {
- ::testing::Mock::AllowUninterestingCalls(
- internal::ImplicitCast_<MockClass*>(this));
- }
-
-$range i 2..n
-$for i [[
-$range j 1..i
- template <$for j, [[typename A$j]]>
- NiceMock($for j, [[const A$j& a$j]]) : MockClass($for j, [[a$j]]) {
- ::testing::Mock::AllowUninterestingCalls(
- internal::ImplicitCast_<MockClass*>(this));
- }
-
-
-]]
- virtual ~NiceMock() {
- ::testing::Mock::UnregisterCallReaction(
- internal::ImplicitCast_<MockClass*>(this));
- }
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(NiceMock);
-};
-
-template <class MockClass>
-class StrictMock : public MockClass {
- public:
- // We don't factor out the constructor body to a common method, as
- // we have to avoid a possible clash with members of MockClass.
- StrictMock() {
- ::testing::Mock::FailUninterestingCalls(
- internal::ImplicitCast_<MockClass*>(this));
- }
-
- template <typename A1>
- explicit StrictMock(const A1& a1) : MockClass(a1) {
- ::testing::Mock::FailUninterestingCalls(
- internal::ImplicitCast_<MockClass*>(this));
- }
-
-$for i [[
-$range j 1..i
- template <$for j, [[typename A$j]]>
- StrictMock($for j, [[const A$j& a$j]]) : MockClass($for j, [[a$j]]) {
- ::testing::Mock::FailUninterestingCalls(
- internal::ImplicitCast_<MockClass*>(this));
- }
-
-
-]]
- virtual ~StrictMock() {
- ::testing::Mock::UnregisterCallReaction(
- internal::ImplicitCast_<MockClass*>(this));
- }
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(StrictMock);
-};
-
-// The following specializations catch some (relatively more common)
-// user errors of nesting nice and strict mocks. They do NOT catch
-// all possible errors.
-
-// These specializations are declared but not defined, as NiceMock and
-// StrictMock cannot be nested.
-template <typename MockClass>
-class NiceMock<NiceMock<MockClass> >;
-template <typename MockClass>
-class NiceMock<StrictMock<MockClass> >;
-template <typename MockClass>
-class StrictMock<NiceMock<MockClass> >;
-template <typename MockClass>
-class StrictMock<StrictMock<MockClass> >;
-
-} // namespace testing
-
-#endif // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_NICE_STRICT_H_
diff --git a/src/testing/include/gmock/gmock-matchers.h b/src/testing/include/gmock/gmock-matchers.h
deleted file mode 100644
index 4f1c433c..00000000
--- a/src/testing/include/gmock/gmock-matchers.h
+++ /dev/null
@@ -1,3207 +0,0 @@
-// Copyright 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-// Google Mock - a framework for writing C++ mock classes.
-//
-// This file implements some commonly used argument matchers. More
-// matchers can be defined by the user implementing the
-// MatcherInterface<T> interface if necessary.
-
-#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_MATCHERS_H_
-#define GMOCK_INCLUDE_GMOCK_GMOCK_MATCHERS_H_
-
-#include <algorithm>
-#include <limits>
-#include <ostream> // NOLINT
-#include <sstream>
-#include <string>
-#include <utility>
-#include <vector>
-
-#include "gmock/internal/gmock-internal-utils.h"
-#include "gmock/internal/gmock-port.h"
-#include "gtest/gtest.h"
-
-namespace testing {
-
-// To implement a matcher Foo for type T, define:
-// 1. a class FooMatcherImpl that implements the
-// MatcherInterface<T> interface, and
-// 2. a factory function that creates a Matcher<T> object from a
-// FooMatcherImpl*.
-//
-// The two-level delegation design makes it possible to allow a user
-// to write "v" instead of "Eq(v)" where a Matcher is expected, which
-// is impossible if we pass matchers by pointers. It also eases
-// ownership management as Matcher objects can now be copied like
-// plain values.
-
-// MatchResultListener is an abstract class. Its << operator can be
-// used by a matcher to explain why a value matches or doesn't match.
-//
-// TODO(wan@google.com): add method
-// bool InterestedInWhy(bool result) const;
-// to indicate whether the listener is interested in why the match
-// result is 'result'.
-class MatchResultListener {
- public:
- // Creates a listener object with the given underlying ostream. The
- // listener does not own the ostream.
- explicit MatchResultListener(::std::ostream* os) : stream_(os) {}
- virtual ~MatchResultListener() = 0; // Makes this class abstract.
-
- // Streams x to the underlying ostream; does nothing if the ostream
- // is NULL.
- template <typename T>
- MatchResultListener& operator<<(const T& x) {
- if (stream_ != NULL)
- *stream_ << x;
- return *this;
- }
-
- // Returns the underlying ostream.
- ::std::ostream* stream() { return stream_; }
-
- // Returns true iff the listener is interested in an explanation of
- // the match result. A matcher's MatchAndExplain() method can use
- // this information to avoid generating the explanation when no one
- // intends to hear it.
- bool IsInterested() const { return stream_ != NULL; }
-
- private:
- ::std::ostream* const stream_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(MatchResultListener);
-};
-
-inline MatchResultListener::~MatchResultListener() {
-}
-
-// The implementation of a matcher.
-template <typename T>
-class MatcherInterface {
- public:
- virtual ~MatcherInterface() {}
-
- // Returns true iff the matcher matches x; also explains the match
- // result to 'listener', in the form of a non-restrictive relative
- // clause ("which ...", "whose ...", etc) that describes x. For
- // example, the MatchAndExplain() method of the Pointee(...) matcher
- // should generate an explanation like "which points to ...".
- //
- // You should override this method when defining a new matcher.
- //
- // It's the responsibility of the caller (Google Mock) to guarantee
- // that 'listener' is not NULL. This helps to simplify a matcher's
- // implementation when it doesn't care about the performance, as it
- // can talk to 'listener' without checking its validity first.
- // However, in order to implement dummy listeners efficiently,
- // listener->stream() may be NULL.
- virtual bool MatchAndExplain(T x, MatchResultListener* listener) const = 0;
-
- // Describes this matcher to an ostream. The function should print
- // a verb phrase that describes the property a value matching this
- // matcher should have. The subject of the verb phrase is the value
- // being matched. For example, the DescribeTo() method of the Gt(7)
- // matcher prints "is greater than 7".
- virtual void DescribeTo(::std::ostream* os) const = 0;
-
- // Describes the negation of this matcher to an ostream. For
- // example, if the description of this matcher is "is greater than
- // 7", the negated description could be "is not greater than 7".
- // You are not required to override this when implementing
- // MatcherInterface, but it is highly advised so that your matcher
- // can produce good error messages.
- virtual void DescribeNegationTo(::std::ostream* os) const {
- *os << "not (";
- DescribeTo(os);
- *os << ")";
- }
-};
-
-namespace internal {
-
-// A match result listener that ignores the explanation.
-class DummyMatchResultListener : public MatchResultListener {
- public:
- DummyMatchResultListener() : MatchResultListener(NULL) {}
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(DummyMatchResultListener);
-};
-
-// A match result listener that forwards the explanation to a given
-// ostream. The difference between this and MatchResultListener is
-// that the former is concrete.
-class StreamMatchResultListener : public MatchResultListener {
- public:
- explicit StreamMatchResultListener(::std::ostream* os)
- : MatchResultListener(os) {}
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(StreamMatchResultListener);
-};
-
-// A match result listener that stores the explanation in a string.
-class StringMatchResultListener : public MatchResultListener {
- public:
- StringMatchResultListener() : MatchResultListener(&ss_) {}
-
- // Returns the explanation heard so far.
- internal::string str() const { return ss_.str(); }
-
- private:
- ::std::stringstream ss_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(StringMatchResultListener);
-};
-
-// An internal class for implementing Matcher<T>, which will derive
-// from it. We put functionalities common to all Matcher<T>
-// specializations here to avoid code duplication.
-template <typename T>
-class MatcherBase {
- public:
- // Returns true iff the matcher matches x; also explains the match
- // result to 'listener'.
- bool MatchAndExplain(T x, MatchResultListener* listener) const {
- return impl_->MatchAndExplain(x, listener);
- }
-
- // Returns true iff this matcher matches x.
- bool Matches(T x) const {
- DummyMatchResultListener dummy;
- return MatchAndExplain(x, &dummy);
- }
-
- // Describes this matcher to an ostream.
- void DescribeTo(::std::ostream* os) const { impl_->DescribeTo(os); }
-
- // Describes the negation of this matcher to an ostream.
- void DescribeNegationTo(::std::ostream* os) const {
- impl_->DescribeNegationTo(os);
- }
-
- // Explains why x matches, or doesn't match, the matcher.
- void ExplainMatchResultTo(T x, ::std::ostream* os) const {
- StreamMatchResultListener listener(os);
- MatchAndExplain(x, &listener);
- }
-
- protected:
- MatcherBase() {}
-
- // Constructs a matcher from its implementation.
- explicit MatcherBase(const MatcherInterface<T>* impl)
- : impl_(impl) {}
-
- virtual ~MatcherBase() {}
-
- private:
- // shared_ptr (util/gtl/shared_ptr.h) and linked_ptr have similar
- // interfaces. The former dynamically allocates a chunk of memory
- // to hold the reference count, while the latter tracks all
- // references using a circular linked list without allocating
- // memory. It has been observed that linked_ptr performs better in
- // typical scenarios. However, shared_ptr can out-perform
- // linked_ptr when there are many more uses of the copy constructor
- // than the default constructor.
- //
- // If performance becomes a problem, we should see if using
- // shared_ptr helps.
- ::testing::internal::linked_ptr<const MatcherInterface<T> > impl_;
-};
-
-} // namespace internal
-
-// A Matcher<T> is a copyable and IMMUTABLE (except by assignment)
-// object that can check whether a value of type T matches. The
-// implementation of Matcher<T> is just a linked_ptr to const
-// MatcherInterface<T>, so copying is fairly cheap. Don't inherit
-// from Matcher!
-template <typename T>
-class Matcher : public internal::MatcherBase<T> {
- public:
- // Constructs a null matcher. Needed for storing Matcher objects in STL
- // containers. A default-constructed matcher is not yet initialized. You
- // cannot use it until a valid value has been assigned to it.
- Matcher() {}
-
- // Constructs a matcher from its implementation.
- explicit Matcher(const MatcherInterface<T>* impl)
- : internal::MatcherBase<T>(impl) {}
-
- // Implicit constructor here allows people to write
- // EXPECT_CALL(foo, Bar(5)) instead of EXPECT_CALL(foo, Bar(Eq(5))) sometimes
- Matcher(T value); // NOLINT
-};
-
-// The following two specializations allow the user to write str
-// instead of Eq(str) and "foo" instead of Eq("foo") when a string
-// matcher is expected.
-template <>
-class GTEST_API_ Matcher<const internal::string&>
- : public internal::MatcherBase<const internal::string&> {
- public:
- Matcher() {}
-
- explicit Matcher(const MatcherInterface<const internal::string&>* impl)
- : internal::MatcherBase<const internal::string&>(impl) {}
-
- // Allows the user to write str instead of Eq(str) sometimes, where
- // str is a string object.
- Matcher(const internal::string& s); // NOLINT
-
- // Allows the user to write "foo" instead of Eq("foo") sometimes.
- Matcher(const char* s); // NOLINT
-};
-
-template <>
-class GTEST_API_ Matcher<internal::string>
- : public internal::MatcherBase<internal::string> {
- public:
- Matcher() {}
-
- explicit Matcher(const MatcherInterface<internal::string>* impl)
- : internal::MatcherBase<internal::string>(impl) {}
-
- // Allows the user to write str instead of Eq(str) sometimes, where
- // str is a string object.
- Matcher(const internal::string& s); // NOLINT
-
- // Allows the user to write "foo" instead of Eq("foo") sometimes.
- Matcher(const char* s); // NOLINT
-};
-
-// The PolymorphicMatcher class template makes it easy to implement a
-// polymorphic matcher (i.e. a matcher that can match values of more
-// than one type, e.g. Eq(n) and NotNull()).
-//
-// To define a polymorphic matcher, a user should provide an Impl
-// class that has a DescribeTo() method and a DescribeNegationTo()
-// method, and define a member function (or member function template)
-//
-// bool MatchAndExplain(const Value& value,
-// MatchResultListener* listener) const;
-//
-// See the definition of NotNull() for a complete example.
-template <class Impl>
-class PolymorphicMatcher {
- public:
- explicit PolymorphicMatcher(const Impl& an_impl) : impl_(an_impl) {}
-
- // Returns a mutable reference to the underlying matcher
- // implementation object.
- Impl& mutable_impl() { return impl_; }
-
- // Returns an immutable reference to the underlying matcher
- // implementation object.
- const Impl& impl() const { return impl_; }
-
- template <typename T>
- operator Matcher<T>() const {
- return Matcher<T>(new MonomorphicImpl<T>(impl_));
- }
-
- private:
- template <typename T>
- class MonomorphicImpl : public MatcherInterface<T> {
- public:
- explicit MonomorphicImpl(const Impl& impl) : impl_(impl) {}
-
- virtual void DescribeTo(::std::ostream* os) const {
- impl_.DescribeTo(os);
- }
-
- virtual void DescribeNegationTo(::std::ostream* os) const {
- impl_.DescribeNegationTo(os);
- }
-
- virtual bool MatchAndExplain(T x, MatchResultListener* listener) const {
- return impl_.MatchAndExplain(x, listener);
- }
-
- private:
- const Impl impl_;
-
- GTEST_DISALLOW_ASSIGN_(MonomorphicImpl);
- };
-
- Impl impl_;
-
- GTEST_DISALLOW_ASSIGN_(PolymorphicMatcher);
-};
-
-// Creates a matcher from its implementation. This is easier to use
-// than the Matcher<T> constructor as it doesn't require you to
-// explicitly write the template argument, e.g.
-//
-// MakeMatcher(foo);
-// vs
-// Matcher<const string&>(foo);
-template <typename T>
-inline Matcher<T> MakeMatcher(const MatcherInterface<T>* impl) {
- return Matcher<T>(impl);
-};
-
-// Creates a polymorphic matcher from its implementation. This is
-// easier to use than the PolymorphicMatcher<Impl> constructor as it
-// doesn't require you to explicitly write the template argument, e.g.
-//
-// MakePolymorphicMatcher(foo);
-// vs
-// PolymorphicMatcher<TypeOfFoo>(foo);
-template <class Impl>
-inline PolymorphicMatcher<Impl> MakePolymorphicMatcher(const Impl& impl) {
- return PolymorphicMatcher<Impl>(impl);
-}
-
-// Anything inside the 'internal' namespace IS INTERNAL IMPLEMENTATION
-// and MUST NOT BE USED IN USER CODE!!!
-namespace internal {
-
-// The MatcherCastImpl class template is a helper for implementing
-// MatcherCast(). We need this helper in order to partially
-// specialize the implementation of MatcherCast() (C++ allows
-// class/struct templates to be partially specialized, but not
-// function templates.).
-
-// This general version is used when MatcherCast()'s argument is a
-// polymorphic matcher (i.e. something that can be converted to a
-// Matcher but is not one yet; for example, Eq(value)) or a value (for
-// example, "hello").
-template <typename T, typename M>
-class MatcherCastImpl {
- public:
- static Matcher<T> Cast(M polymorphic_matcher_or_value) {
- // M can be a polymorhic matcher, in which case we want to use
- // its conversion operator to create Matcher<T>. Or it can be a value
- // that should be passed to the Matcher<T>'s constructor.
- //
- // We can't call Matcher<T>(polymorphic_matcher_or_value) when M is a
- // polymorphic matcher because it'll be ambiguous if T has an implicit
- // constructor from M (this usually happens when T has an implicit
- // constructor from any type).
- //
- // It won't work to unconditionally implict_cast
- // polymorphic_matcher_or_value to Matcher<T> because it won't trigger
- // a user-defined conversion from M to T if one exists (assuming M is
- // a value).
- return CastImpl(
- polymorphic_matcher_or_value,
- BooleanConstant<
- internal::ImplicitlyConvertible<M, Matcher<T> >::value>());
- }
-
- private:
- static Matcher<T> CastImpl(M value, BooleanConstant<false>) {
- // M can't be implicitly converted to Matcher<T>, so M isn't a polymorphic
- // matcher. It must be a value then. Use direct initialization to create
- // a matcher.
- return Matcher<T>(ImplicitCast_<T>(value));
- }
-
- static Matcher<T> CastImpl(M polymorphic_matcher_or_value,
- BooleanConstant<true>) {
- // M is implicitly convertible to Matcher<T>, which means that either
- // M is a polymorhpic matcher or Matcher<T> has an implicit constructor
- // from M. In both cases using the implicit conversion will produce a
- // matcher.
- //
- // Even if T has an implicit constructor from M, it won't be called because
- // creating Matcher<T> would require a chain of two user-defined conversions
- // (first to create T from M and then to create Matcher<T> from T).
- return polymorphic_matcher_or_value;
- }
-};
-
-// This more specialized version is used when MatcherCast()'s argument
-// is already a Matcher. This only compiles when type T can be
-// statically converted to type U.
-template <typename T, typename U>
-class MatcherCastImpl<T, Matcher<U> > {
- public:
- static Matcher<T> Cast(const Matcher<U>& source_matcher) {
- return Matcher<T>(new Impl(source_matcher));
- }
-
- private:
- class Impl : public MatcherInterface<T> {
- public:
- explicit Impl(const Matcher<U>& source_matcher)
- : source_matcher_(source_matcher) {}
-
- // We delegate the matching logic to the source matcher.
- virtual bool MatchAndExplain(T x, MatchResultListener* listener) const {
- return source_matcher_.MatchAndExplain(static_cast<U>(x), listener);
- }
-
- virtual void DescribeTo(::std::ostream* os) const {
- source_matcher_.DescribeTo(os);
- }
-
- virtual void DescribeNegationTo(::std::ostream* os) const {
- source_matcher_.DescribeNegationTo(os);
- }
-
- private:
- const Matcher<U> source_matcher_;
-
- GTEST_DISALLOW_ASSIGN_(Impl);
- };
-};
-
-// This even more specialized version is used for efficiently casting
-// a matcher to its own type.
-template <typename T>
-class MatcherCastImpl<T, Matcher<T> > {
- public:
- static Matcher<T> Cast(const Matcher<T>& matcher) { return matcher; }
-};
-
-} // namespace internal
-
-// In order to be safe and clear, casting between different matcher
-// types is done explicitly via MatcherCast<T>(m), which takes a
-// matcher m and returns a Matcher<T>. It compiles only when T can be
-// statically converted to the argument type of m.
-template <typename T, typename M>
-inline Matcher<T> MatcherCast(M matcher) {
- return internal::MatcherCastImpl<T, M>::Cast(matcher);
-}
-
-// Implements SafeMatcherCast().
-//
-// We use an intermediate class to do the actual safe casting as Nokia's
-// Symbian compiler cannot decide between
-// template <T, M> ... (M) and
-// template <T, U> ... (const Matcher<U>&)
-// for function templates but can for member function templates.
-template <typename T>
-class SafeMatcherCastImpl {
- public:
- // This overload handles polymorphic matchers and values only since
- // monomorphic matchers are handled by the next one.
- template <typename M>
- static inline Matcher<T> Cast(M polymorphic_matcher_or_value) {
- return internal::MatcherCastImpl<T, M>::Cast(polymorphic_matcher_or_value);
- }
-
- // This overload handles monomorphic matchers.
- //
- // In general, if type T can be implicitly converted to type U, we can
- // safely convert a Matcher<U> to a Matcher<T> (i.e. Matcher is
- // contravariant): just keep a copy of the original Matcher<U>, convert the
- // argument from type T to U, and then pass it to the underlying Matcher<U>.
- // The only exception is when U is a reference and T is not, as the
- // underlying Matcher<U> may be interested in the argument's address, which
- // is not preserved in the conversion from T to U.
- template <typename U>
- static inline Matcher<T> Cast(const Matcher<U>& matcher) {
- // Enforce that T can be implicitly converted to U.
- GTEST_COMPILE_ASSERT_((internal::ImplicitlyConvertible<T, U>::value),
- T_must_be_implicitly_convertible_to_U);
- // Enforce that we are not converting a non-reference type T to a reference
- // type U.
- GTEST_COMPILE_ASSERT_(
- internal::is_reference<T>::value || !internal::is_reference<U>::value,
- cannot_convert_non_referentce_arg_to_reference);
- // In case both T and U are arithmetic types, enforce that the
- // conversion is not lossy.
- typedef GTEST_REMOVE_REFERENCE_AND_CONST_(T) RawT;
- typedef GTEST_REMOVE_REFERENCE_AND_CONST_(U) RawU;
- const bool kTIsOther = GMOCK_KIND_OF_(RawT) == internal::kOther;
- const bool kUIsOther = GMOCK_KIND_OF_(RawU) == internal::kOther;
- GTEST_COMPILE_ASSERT_(
- kTIsOther || kUIsOther ||
- (internal::LosslessArithmeticConvertible<RawT, RawU>::value),
- conversion_of_arithmetic_types_must_be_lossless);
- return MatcherCast<T>(matcher);
- }
-};
-
-template <typename T, typename M>
-inline Matcher<T> SafeMatcherCast(const M& polymorphic_matcher) {
- return SafeMatcherCastImpl<T>::Cast(polymorphic_matcher);
-}
-
-// A<T>() returns a matcher that matches any value of type T.
-template <typename T>
-Matcher<T> A();
-
-// Anything inside the 'internal' namespace IS INTERNAL IMPLEMENTATION
-// and MUST NOT BE USED IN USER CODE!!!
-namespace internal {
-
-// If the explanation is not empty, prints it to the ostream.
-inline void PrintIfNotEmpty(const internal::string& explanation,
- std::ostream* os) {
- if (explanation != "" && os != NULL) {
- *os << ", " << explanation;
- }
-}
-
-// Returns true if the given type name is easy to read by a human.
-// This is used to decide whether printing the type of a value might
-// be helpful.
-inline bool IsReadableTypeName(const string& type_name) {
- // We consider a type name readable if it's short or doesn't contain
- // a template or function type.
- return (type_name.length() <= 20 ||
- type_name.find_first_of("<(") == string::npos);
-}
-
-// Matches the value against the given matcher, prints the value and explains
-// the match result to the listener. Returns the match result.
-// 'listener' must not be NULL.
-// Value cannot be passed by const reference, because some matchers take a
-// non-const argument.
-template <typename Value, typename T>
-bool MatchPrintAndExplain(Value& value, const Matcher<T>& matcher,
- MatchResultListener* listener) {
- if (!listener->IsInterested()) {
- // If the listener is not interested, we do not need to construct the
- // inner explanation.
- return matcher.Matches(value);
- }
-
- StringMatchResultListener inner_listener;
- const bool match = matcher.MatchAndExplain(value, &inner_listener);
-
- UniversalPrint(value, listener->stream());
-#if GTEST_HAS_RTTI
- const string& type_name = GetTypeName<Value>();
- if (IsReadableTypeName(type_name))
- *listener->stream() << " (of type " << type_name << ")";
-#endif
- PrintIfNotEmpty(inner_listener.str(), listener->stream());
-
- return match;
-}
-
-// An internal helper class for doing compile-time loop on a tuple's
-// fields.
-template <size_t N>
-class TuplePrefix {
- public:
- // TuplePrefix<N>::Matches(matcher_tuple, value_tuple) returns true
- // iff the first N fields of matcher_tuple matches the first N
- // fields of value_tuple, respectively.
- template <typename MatcherTuple, typename ValueTuple>
- static bool Matches(const MatcherTuple& matcher_tuple,
- const ValueTuple& value_tuple) {
- using ::std::tr1::get;
- return TuplePrefix<N - 1>::Matches(matcher_tuple, value_tuple)
- && get<N - 1>(matcher_tuple).Matches(get<N - 1>(value_tuple));
- }
-
- // TuplePrefix<N>::ExplainMatchFailuresTo(matchers, values, os)
- // describes failures in matching the first N fields of matchers
- // against the first N fields of values. If there is no failure,
- // nothing will be streamed to os.
- template <typename MatcherTuple, typename ValueTuple>
- static void ExplainMatchFailuresTo(const MatcherTuple& matchers,
- const ValueTuple& values,
- ::std::ostream* os) {
- using ::std::tr1::tuple_element;
- using ::std::tr1::get;
-
- // First, describes failures in the first N - 1 fields.
- TuplePrefix<N - 1>::ExplainMatchFailuresTo(matchers, values, os);
-
- // Then describes the failure (if any) in the (N - 1)-th (0-based)
- // field.
- typename tuple_element<N - 1, MatcherTuple>::type matcher =
- get<N - 1>(matchers);
- typedef typename tuple_element<N - 1, ValueTuple>::type Value;
- Value value = get<N - 1>(values);
- StringMatchResultListener listener;
- if (!matcher.MatchAndExplain(value, &listener)) {
- // TODO(wan): include in the message the name of the parameter
- // as used in MOCK_METHOD*() when possible.
- *os << " Expected arg #" << N - 1 << ": ";
- get<N - 1>(matchers).DescribeTo(os);
- *os << "\n Actual: ";
- // We remove the reference in type Value to prevent the
- // universal printer from printing the address of value, which
- // isn't interesting to the user most of the time. The
- // matcher's MatchAndExplain() method handles the case when
- // the address is interesting.
- internal::UniversalPrint(value, os);
- PrintIfNotEmpty(listener.str(), os);
- *os << "\n";
- }
- }
-};
-
-// The base case.
-template <>
-class TuplePrefix<0> {
- public:
- template <typename MatcherTuple, typename ValueTuple>
- static bool Matches(const MatcherTuple& /* matcher_tuple */,
- const ValueTuple& /* value_tuple */) {
- return true;
- }
-
- template <typename MatcherTuple, typename ValueTuple>
- static void ExplainMatchFailuresTo(const MatcherTuple& /* matchers */,
- const ValueTuple& /* values */,
- ::std::ostream* /* os */) {}
-};
-
-// TupleMatches(matcher_tuple, value_tuple) returns true iff all
-// matchers in matcher_tuple match the corresponding fields in
-// value_tuple. It is a compiler error if matcher_tuple and
-// value_tuple have different number of fields or incompatible field
-// types.
-template <typename MatcherTuple, typename ValueTuple>
-bool TupleMatches(const MatcherTuple& matcher_tuple,
- const ValueTuple& value_tuple) {
- using ::std::tr1::tuple_size;
- // Makes sure that matcher_tuple and value_tuple have the same
- // number of fields.
- GTEST_COMPILE_ASSERT_(tuple_size<MatcherTuple>::value ==
- tuple_size<ValueTuple>::value,
- matcher_and_value_have_different_numbers_of_fields);
- return TuplePrefix<tuple_size<ValueTuple>::value>::
- Matches(matcher_tuple, value_tuple);
-}
-
-// Describes failures in matching matchers against values. If there
-// is no failure, nothing will be streamed to os.
-template <typename MatcherTuple, typename ValueTuple>
-void ExplainMatchFailureTupleTo(const MatcherTuple& matchers,
- const ValueTuple& values,
- ::std::ostream* os) {
- using ::std::tr1::tuple_size;
- TuplePrefix<tuple_size<MatcherTuple>::value>::ExplainMatchFailuresTo(
- matchers, values, os);
-}
-
-// Implements A<T>().
-template <typename T>
-class AnyMatcherImpl : public MatcherInterface<T> {
- public:
- virtual bool MatchAndExplain(
- T /* x */, MatchResultListener* /* listener */) const { return true; }
- virtual void DescribeTo(::std::ostream* os) const { *os << "is anything"; }
- virtual void DescribeNegationTo(::std::ostream* os) const {
- // This is mostly for completeness' safe, as it's not very useful
- // to write Not(A<bool>()). However we cannot completely rule out
- // such a possibility, and it doesn't hurt to be prepared.
- *os << "never matches";
- }
-};
-
-// Implements _, a matcher that matches any value of any
-// type. This is a polymorphic matcher, so we need a template type
-// conversion operator to make it appearing as a Matcher<T> for any
-// type T.
-class AnythingMatcher {
- public:
- template <typename T>
- operator Matcher<T>() const { return A<T>(); }
-};
-
-// Implements a matcher that compares a given value with a
-// pre-supplied value using one of the ==, <=, <, etc, operators. The
-// two values being compared don't have to have the same type.
-//
-// The matcher defined here is polymorphic (for example, Eq(5) can be
-// used to match an int, a short, a double, etc). Therefore we use
-// a template type conversion operator in the implementation.
-//
-// We define this as a macro in order to eliminate duplicated source
-// code.
-//
-// The following template definition assumes that the Rhs parameter is
-// a "bare" type (i.e. neither 'const T' nor 'T&').
-#define GMOCK_IMPLEMENT_COMPARISON_MATCHER_( \
- name, op, relation, negated_relation) \
- template <typename Rhs> class name##Matcher { \
- public: \
- explicit name##Matcher(const Rhs& rhs) : rhs_(rhs) {} \
- template <typename Lhs> \
- operator Matcher<Lhs>() const { \
- return MakeMatcher(new Impl<Lhs>(rhs_)); \
- } \
- private: \
- template <typename Lhs> \
- class Impl : public MatcherInterface<Lhs> { \
- public: \
- explicit Impl(const Rhs& rhs) : rhs_(rhs) {} \
- virtual bool MatchAndExplain(\
- Lhs lhs, MatchResultListener* /* listener */) const { \
- return lhs op rhs_; \
- } \
- virtual void DescribeTo(::std::ostream* os) const { \
- *os << relation " "; \
- UniversalPrint(rhs_, os); \
- } \
- virtual void DescribeNegationTo(::std::ostream* os) const { \
- *os << negated_relation " "; \
- UniversalPrint(rhs_, os); \
- } \
- private: \
- Rhs rhs_; \
- GTEST_DISALLOW_ASSIGN_(Impl); \
- }; \
- Rhs rhs_; \
- GTEST_DISALLOW_ASSIGN_(name##Matcher); \
- }
-
-// Implements Eq(v), Ge(v), Gt(v), Le(v), Lt(v), and Ne(v)
-// respectively.
-GMOCK_IMPLEMENT_COMPARISON_MATCHER_(Eq, ==, "is equal to", "isn't equal to");
-GMOCK_IMPLEMENT_COMPARISON_MATCHER_(Ge, >=, "is >=", "isn't >=");
-GMOCK_IMPLEMENT_COMPARISON_MATCHER_(Gt, >, "is >", "isn't >");
-GMOCK_IMPLEMENT_COMPARISON_MATCHER_(Le, <=, "is <=", "isn't <=");
-GMOCK_IMPLEMENT_COMPARISON_MATCHER_(Lt, <, "is <", "isn't <");
-GMOCK_IMPLEMENT_COMPARISON_MATCHER_(Ne, !=, "isn't equal to", "is equal to");
-
-#undef GMOCK_IMPLEMENT_COMPARISON_MATCHER_
-
-// Implements the polymorphic IsNull() matcher, which matches any raw or smart
-// pointer that is NULL.
-class IsNullMatcher {
- public:
- template <typename Pointer>
- bool MatchAndExplain(const Pointer& p,
- MatchResultListener* /* listener */) const {
- return GetRawPointer(p) == NULL;
- }
-
- void DescribeTo(::std::ostream* os) const { *os << "is NULL"; }
- void DescribeNegationTo(::std::ostream* os) const {
- *os << "isn't NULL";
- }
-};
-
-// Implements the polymorphic NotNull() matcher, which matches any raw or smart
-// pointer that is not NULL.
-class NotNullMatcher {
- public:
- template <typename Pointer>
- bool MatchAndExplain(const Pointer& p,
- MatchResultListener* /* listener */) const {
- return GetRawPointer(p) != NULL;
- }
-
- void DescribeTo(::std::ostream* os) const { *os << "isn't NULL"; }
- void DescribeNegationTo(::std::ostream* os) const {
- *os << "is NULL";
- }
-};
-
-// Ref(variable) matches any argument that is a reference to
-// 'variable'. This matcher is polymorphic as it can match any
-// super type of the type of 'variable'.
-//
-// The RefMatcher template class implements Ref(variable). It can
-// only be instantiated with a reference type. This prevents a user
-// from mistakenly using Ref(x) to match a non-reference function
-// argument. For example, the following will righteously cause a
-// compiler error:
-//
-// int n;
-// Matcher<int> m1 = Ref(n); // This won't compile.
-// Matcher<int&> m2 = Ref(n); // This will compile.
-template <typename T>
-class RefMatcher;
-
-template <typename T>
-class RefMatcher<T&> {
- // Google Mock is a generic framework and thus needs to support
- // mocking any function types, including those that take non-const
- // reference arguments. Therefore the template parameter T (and
- // Super below) can be instantiated to either a const type or a
- // non-const type.
- public:
- // RefMatcher() takes a T& instead of const T&, as we want the
- // compiler to catch using Ref(const_value) as a matcher for a
- // non-const reference.
- explicit RefMatcher(T& x) : object_(x) {} // NOLINT
-
- template <typename Super>
- operator Matcher<Super&>() const {
- // By passing object_ (type T&) to Impl(), which expects a Super&,
- // we make sure that Super is a super type of T. In particular,
- // this catches using Ref(const_value) as a matcher for a
- // non-const reference, as you cannot implicitly convert a const
- // reference to a non-const reference.
- return MakeMatcher(new Impl<Super>(object_));
- }
-
- private:
- template <typename Super>
- class Impl : public MatcherInterface<Super&> {
- public:
- explicit Impl(Super& x) : object_(x) {} // NOLINT
-
- // MatchAndExplain() takes a Super& (as opposed to const Super&)
- // in order to match the interface MatcherInterface<Super&>.
- virtual bool MatchAndExplain(
- Super& x, MatchResultListener* listener) const {
- *listener << "which is located @" << static_cast<const void*>(&x);
- return &x == &object_;
- }
-
- virtual void DescribeTo(::std::ostream* os) const {
- *os << "references the variable ";
- UniversalPrinter<Super&>::Print(object_, os);
- }
-
- virtual void DescribeNegationTo(::std::ostream* os) const {
- *os << "does not reference the variable ";
- UniversalPrinter<Super&>::Print(object_, os);
- }
-
- private:
- const Super& object_;
-
- GTEST_DISALLOW_ASSIGN_(Impl);
- };
-
- T& object_;
-
- GTEST_DISALLOW_ASSIGN_(RefMatcher);
-};
-
-// Polymorphic helper functions for narrow and wide string matchers.
-inline bool CaseInsensitiveCStringEquals(const char* lhs, const char* rhs) {
- return String::CaseInsensitiveCStringEquals(lhs, rhs);
-}
-
-inline bool CaseInsensitiveCStringEquals(const wchar_t* lhs,
- const wchar_t* rhs) {
- return String::CaseInsensitiveWideCStringEquals(lhs, rhs);
-}
-
-// String comparison for narrow or wide strings that can have embedded NUL
-// characters.
-template <typename StringType>
-bool CaseInsensitiveStringEquals(const StringType& s1,
- const StringType& s2) {
- // Are the heads equal?
- if (!CaseInsensitiveCStringEquals(s1.c_str(), s2.c_str())) {
- return false;
- }
-
- // Skip the equal heads.
- const typename StringType::value_type nul = 0;
- const size_t i1 = s1.find(nul), i2 = s2.find(nul);
-
- // Are we at the end of either s1 or s2?
- if (i1 == StringType::npos || i2 == StringType::npos) {
- return i1 == i2;
- }
-
- // Are the tails equal?
- return CaseInsensitiveStringEquals(s1.substr(i1 + 1), s2.substr(i2 + 1));
-}
-
-// String matchers.
-
-// Implements equality-based string matchers like StrEq, StrCaseNe, and etc.
-template <typename StringType>
-class StrEqualityMatcher {
- public:
- typedef typename StringType::const_pointer ConstCharPointer;
-
- StrEqualityMatcher(const StringType& str, bool expect_eq,
- bool case_sensitive)
- : string_(str), expect_eq_(expect_eq), case_sensitive_(case_sensitive) {}
-
- // When expect_eq_ is true, returns true iff s is equal to string_;
- // otherwise returns true iff s is not equal to string_.
- bool MatchAndExplain(ConstCharPointer s,
- MatchResultListener* listener) const {
- if (s == NULL) {
- return !expect_eq_;
- }
- return MatchAndExplain(StringType(s), listener);
- }
-
- bool MatchAndExplain(const StringType& s,
- MatchResultListener* /* listener */) const {
- const bool eq = case_sensitive_ ? s == string_ :
- CaseInsensitiveStringEquals(s, string_);
- return expect_eq_ == eq;
- }
-
- void DescribeTo(::std::ostream* os) const {
- DescribeToHelper(expect_eq_, os);
- }
-
- void DescribeNegationTo(::std::ostream* os) const {
- DescribeToHelper(!expect_eq_, os);
- }
-
- private:
- void DescribeToHelper(bool expect_eq, ::std::ostream* os) const {
- *os << (expect_eq ? "is " : "isn't ");
- *os << "equal to ";
- if (!case_sensitive_) {
- *os << "(ignoring case) ";
- }
- UniversalPrint(string_, os);
- }
-
- const StringType string_;
- const bool expect_eq_;
- const bool case_sensitive_;
-
- GTEST_DISALLOW_ASSIGN_(StrEqualityMatcher);
-};
-
-// Implements the polymorphic HasSubstr(substring) matcher, which
-// can be used as a Matcher<T> as long as T can be converted to a
-// string.
-template <typename StringType>
-class HasSubstrMatcher {
- public:
- typedef typename StringType::const_pointer ConstCharPointer;
-
- explicit HasSubstrMatcher(const StringType& substring)
- : substring_(substring) {}
-
- // These overloaded methods allow HasSubstr(substring) to be used as a
- // Matcher<T> as long as T can be converted to string. Returns true
- // iff s contains substring_ as a substring.
- bool MatchAndExplain(ConstCharPointer s,
- MatchResultListener* listener) const {
- return s != NULL && MatchAndExplain(StringType(s), listener);
- }
-
- bool MatchAndExplain(const StringType& s,
- MatchResultListener* /* listener */) const {
- return s.find(substring_) != StringType::npos;
- }
-
- // Describes what this matcher matches.
- void DescribeTo(::std::ostream* os) const {
- *os << "has substring ";
- UniversalPrint(substring_, os);
- }
-
- void DescribeNegationTo(::std::ostream* os) const {
- *os << "has no substring ";
- UniversalPrint(substring_, os);
- }
-
- private:
- const StringType substring_;
-
- GTEST_DISALLOW_ASSIGN_(HasSubstrMatcher);
-};
-
-// Implements the polymorphic StartsWith(substring) matcher, which
-// can be used as a Matcher<T> as long as T can be converted to a
-// string.
-template <typename StringType>
-class StartsWithMatcher {
- public:
- typedef typename StringType::const_pointer ConstCharPointer;
-
- explicit StartsWithMatcher(const StringType& prefix) : prefix_(prefix) {
- }
-
- // These overloaded methods allow StartsWith(prefix) to be used as a
- // Matcher<T> as long as T can be converted to string. Returns true
- // iff s starts with prefix_.
- bool MatchAndExplain(ConstCharPointer s,
- MatchResultListener* listener) const {
- return s != NULL && MatchAndExplain(StringType(s), listener);
- }
-
- bool MatchAndExplain(const StringType& s,
- MatchResultListener* /* listener */) const {
- return s.length() >= prefix_.length() &&
- s.substr(0, prefix_.length()) == prefix_;
- }
-
- void DescribeTo(::std::ostream* os) const {
- *os << "starts with ";
- UniversalPrint(prefix_, os);
- }
-
- void DescribeNegationTo(::std::ostream* os) const {
- *os << "doesn't start with ";
- UniversalPrint(prefix_, os);
- }
-
- private:
- const StringType prefix_;
-
- GTEST_DISALLOW_ASSIGN_(StartsWithMatcher);
-};
-
-// Implements the polymorphic EndsWith(substring) matcher, which
-// can be used as a Matcher<T> as long as T can be converted to a
-// string.
-template <typename StringType>
-class EndsWithMatcher {
- public:
- typedef typename StringType::const_pointer ConstCharPointer;
-
- explicit EndsWithMatcher(const StringType& suffix) : suffix_(suffix) {}
-
- // These overloaded methods allow EndsWith(suffix) to be used as a
- // Matcher<T> as long as T can be converted to string. Returns true
- // iff s ends with suffix_.
- bool MatchAndExplain(ConstCharPointer s,
- MatchResultListener* listener) const {
- return s != NULL && MatchAndExplain(StringType(s), listener);
- }
-
- bool MatchAndExplain(const StringType& s,
- MatchResultListener* /* listener */) const {
- return s.length() >= suffix_.length() &&
- s.substr(s.length() - suffix_.length()) == suffix_;
- }
-
- void DescribeTo(::std::ostream* os) const {
- *os << "ends with ";
- UniversalPrint(suffix_, os);
- }
-
- void DescribeNegationTo(::std::ostream* os) const {
- *os << "doesn't end with ";
- UniversalPrint(suffix_, os);
- }
-
- private:
- const StringType suffix_;
-
- GTEST_DISALLOW_ASSIGN_(EndsWithMatcher);
-};
-
-// Implements polymorphic matchers MatchesRegex(regex) and
-// ContainsRegex(regex), which can be used as a Matcher<T> as long as
-// T can be converted to a string.
-class MatchesRegexMatcher {
- public:
- MatchesRegexMatcher(const RE* regex, bool full_match)
- : regex_(regex), full_match_(full_match) {}
-
- // These overloaded methods allow MatchesRegex(regex) to be used as
- // a Matcher<T> as long as T can be converted to string. Returns
- // true iff s matches regular expression regex. When full_match_ is
- // true, a full match is done; otherwise a partial match is done.
- bool MatchAndExplain(const char* s,
- MatchResultListener* listener) const {
- return s != NULL && MatchAndExplain(internal::string(s), listener);
- }
-
- bool MatchAndExplain(const internal::string& s,
- MatchResultListener* /* listener */) const {
- return full_match_ ? RE::FullMatch(s, *regex_) :
- RE::PartialMatch(s, *regex_);
- }
-
- void DescribeTo(::std::ostream* os) const {
- *os << (full_match_ ? "matches" : "contains")
- << " regular expression ";
- UniversalPrinter<internal::string>::Print(regex_->pattern(), os);
- }
-
- void DescribeNegationTo(::std::ostream* os) const {
- *os << "doesn't " << (full_match_ ? "match" : "contain")
- << " regular expression ";
- UniversalPrinter<internal::string>::Print(regex_->pattern(), os);
- }
-
- private:
- const internal::linked_ptr<const RE> regex_;
- const bool full_match_;
-
- GTEST_DISALLOW_ASSIGN_(MatchesRegexMatcher);
-};
-
-// Implements a matcher that compares the two fields of a 2-tuple
-// using one of the ==, <=, <, etc, operators. The two fields being
-// compared don't have to have the same type.
-//
-// The matcher defined here is polymorphic (for example, Eq() can be
-// used to match a tuple<int, short>, a tuple<const long&, double>,
-// etc). Therefore we use a template type conversion operator in the
-// implementation.
-//
-// We define this as a macro in order to eliminate duplicated source
-// code.
-#define GMOCK_IMPLEMENT_COMPARISON2_MATCHER_(name, op, relation) \
- class name##2Matcher { \
- public: \
- template <typename T1, typename T2> \
- operator Matcher< ::std::tr1::tuple<T1, T2> >() const { \
- return MakeMatcher(new Impl< ::std::tr1::tuple<T1, T2> >); \
- } \
- template <typename T1, typename T2> \
- operator Matcher<const ::std::tr1::tuple<T1, T2>&>() const { \
- return MakeMatcher(new Impl<const ::std::tr1::tuple<T1, T2>&>); \
- } \
- private: \
- template <typename Tuple> \
- class Impl : public MatcherInterface<Tuple> { \
- public: \
- virtual bool MatchAndExplain( \
- Tuple args, \
- MatchResultListener* /* listener */) const { \
- return ::std::tr1::get<0>(args) op ::std::tr1::get<1>(args); \
- } \
- virtual void DescribeTo(::std::ostream* os) const { \
- *os << "are " relation; \
- } \
- virtual void DescribeNegationTo(::std::ostream* os) const { \
- *os << "aren't " relation; \
- } \
- }; \
- }
-
-// Implements Eq(), Ge(), Gt(), Le(), Lt(), and Ne() respectively.
-GMOCK_IMPLEMENT_COMPARISON2_MATCHER_(Eq, ==, "an equal pair");
-GMOCK_IMPLEMENT_COMPARISON2_MATCHER_(
- Ge, >=, "a pair where the first >= the second");
-GMOCK_IMPLEMENT_COMPARISON2_MATCHER_(
- Gt, >, "a pair where the first > the second");
-GMOCK_IMPLEMENT_COMPARISON2_MATCHER_(
- Le, <=, "a pair where the first <= the second");
-GMOCK_IMPLEMENT_COMPARISON2_MATCHER_(
- Lt, <, "a pair where the first < the second");
-GMOCK_IMPLEMENT_COMPARISON2_MATCHER_(Ne, !=, "an unequal pair");
-
-#undef GMOCK_IMPLEMENT_COMPARISON2_MATCHER_
-
-// Implements the Not(...) matcher for a particular argument type T.
-// We do not nest it inside the NotMatcher class template, as that
-// will prevent different instantiations of NotMatcher from sharing
-// the same NotMatcherImpl<T> class.
-template <typename T>
-class NotMatcherImpl : public MatcherInterface<T> {
- public:
- explicit NotMatcherImpl(const Matcher<T>& matcher)
- : matcher_(matcher) {}
-
- virtual bool MatchAndExplain(T x, MatchResultListener* listener) const {
- return !matcher_.MatchAndExplain(x, listener);
- }
-
- virtual void DescribeTo(::std::ostream* os) const {
- matcher_.DescribeNegationTo(os);
- }
-
- virtual void DescribeNegationTo(::std::ostream* os) const {
- matcher_.DescribeTo(os);
- }
-
- private:
- const Matcher<T> matcher_;
-
- GTEST_DISALLOW_ASSIGN_(NotMatcherImpl);
-};
-
-// Implements the Not(m) matcher, which matches a value that doesn't
-// match matcher m.
-template <typename InnerMatcher>
-class NotMatcher {
- public:
- explicit NotMatcher(InnerMatcher matcher) : matcher_(matcher) {}
-
- // This template type conversion operator allows Not(m) to be used
- // to match any type m can match.
- template <typename T>
- operator Matcher<T>() const {
- return Matcher<T>(new NotMatcherImpl<T>(SafeMatcherCast<T>(matcher_)));
- }
-
- private:
- InnerMatcher matcher_;
-
- GTEST_DISALLOW_ASSIGN_(NotMatcher);
-};
-
-// Implements the AllOf(m1, m2) matcher for a particular argument type
-// T. We do not nest it inside the BothOfMatcher class template, as
-// that will prevent different instantiations of BothOfMatcher from
-// sharing the same BothOfMatcherImpl<T> class.
-template <typename T>
-class BothOfMatcherImpl : public MatcherInterface<T> {
- public:
- BothOfMatcherImpl(const Matcher<T>& matcher1, const Matcher<T>& matcher2)
- : matcher1_(matcher1), matcher2_(matcher2) {}
-
- virtual void DescribeTo(::std::ostream* os) const {
- *os << "(";
- matcher1_.DescribeTo(os);
- *os << ") and (";
- matcher2_.DescribeTo(os);
- *os << ")";
- }
-
- virtual void DescribeNegationTo(::std::ostream* os) const {
- *os << "(";
- matcher1_.DescribeNegationTo(os);
- *os << ") or (";
- matcher2_.DescribeNegationTo(os);
- *os << ")";
- }
-
- virtual bool MatchAndExplain(T x, MatchResultListener* listener) const {
- // If either matcher1_ or matcher2_ doesn't match x, we only need
- // to explain why one of them fails.
- StringMatchResultListener listener1;
- if (!matcher1_.MatchAndExplain(x, &listener1)) {
- *listener << listener1.str();
- return false;
- }
-
- StringMatchResultListener listener2;
- if (!matcher2_.MatchAndExplain(x, &listener2)) {
- *listener << listener2.str();
- return false;
- }
-
- // Otherwise we need to explain why *both* of them match.
- const internal::string s1 = listener1.str();
- const internal::string s2 = listener2.str();
-
- if (s1 == "") {
- *listener << s2;
- } else {
- *listener << s1;
- if (s2 != "") {
- *listener << ", and " << s2;
- }
- }
- return true;
- }
-
- private:
- const Matcher<T> matcher1_;
- const Matcher<T> matcher2_;
-
- GTEST_DISALLOW_ASSIGN_(BothOfMatcherImpl);
-};
-
-// Used for implementing the AllOf(m_1, ..., m_n) matcher, which
-// matches a value that matches all of the matchers m_1, ..., and m_n.
-template <typename Matcher1, typename Matcher2>
-class BothOfMatcher {
- public:
- BothOfMatcher(Matcher1 matcher1, Matcher2 matcher2)
- : matcher1_(matcher1), matcher2_(matcher2) {}
-
- // This template type conversion operator allows a
- // BothOfMatcher<Matcher1, Matcher2> object to match any type that
- // both Matcher1 and Matcher2 can match.
- template <typename T>
- operator Matcher<T>() const {
- return Matcher<T>(new BothOfMatcherImpl<T>(SafeMatcherCast<T>(matcher1_),
- SafeMatcherCast<T>(matcher2_)));
- }
-
- private:
- Matcher1 matcher1_;
- Matcher2 matcher2_;
-
- GTEST_DISALLOW_ASSIGN_(BothOfMatcher);
-};
-
-// Implements the AnyOf(m1, m2) matcher for a particular argument type
-// T. We do not nest it inside the AnyOfMatcher class template, as
-// that will prevent different instantiations of AnyOfMatcher from
-// sharing the same EitherOfMatcherImpl<T> class.
-template <typename T>
-class EitherOfMatcherImpl : public MatcherInterface<T> {
- public:
- EitherOfMatcherImpl(const Matcher<T>& matcher1, const Matcher<T>& matcher2)
- : matcher1_(matcher1), matcher2_(matcher2) {}
-
- virtual void DescribeTo(::std::ostream* os) const {
- *os << "(";
- matcher1_.DescribeTo(os);
- *os << ") or (";
- matcher2_.DescribeTo(os);
- *os << ")";
- }
-
- virtual void DescribeNegationTo(::std::ostream* os) const {
- *os << "(";
- matcher1_.DescribeNegationTo(os);
- *os << ") and (";
- matcher2_.DescribeNegationTo(os);
- *os << ")";
- }
-
- virtual bool MatchAndExplain(T x, MatchResultListener* listener) const {
- // If either matcher1_ or matcher2_ matches x, we just need to
- // explain why *one* of them matches.
- StringMatchResultListener listener1;
- if (matcher1_.MatchAndExplain(x, &listener1)) {
- *listener << listener1.str();
- return true;
- }
-
- StringMatchResultListener listener2;
- if (matcher2_.MatchAndExplain(x, &listener2)) {
- *listener << listener2.str();
- return true;
- }
-
- // Otherwise we need to explain why *both* of them fail.
- const internal::string s1 = listener1.str();
- const internal::string s2 = listener2.str();
-
- if (s1 == "") {
- *listener << s2;
- } else {
- *listener << s1;
- if (s2 != "") {
- *listener << ", and " << s2;
- }
- }
- return false;
- }
-
- private:
- const Matcher<T> matcher1_;
- const Matcher<T> matcher2_;
-
- GTEST_DISALLOW_ASSIGN_(EitherOfMatcherImpl);
-};
-
-// Used for implementing the AnyOf(m_1, ..., m_n) matcher, which
-// matches a value that matches at least one of the matchers m_1, ...,
-// and m_n.
-template <typename Matcher1, typename Matcher2>
-class EitherOfMatcher {
- public:
- EitherOfMatcher(Matcher1 matcher1, Matcher2 matcher2)
- : matcher1_(matcher1), matcher2_(matcher2) {}
-
- // This template type conversion operator allows a
- // EitherOfMatcher<Matcher1, Matcher2> object to match any type that
- // both Matcher1 and Matcher2 can match.
- template <typename T>
- operator Matcher<T>() const {
- return Matcher<T>(new EitherOfMatcherImpl<T>(
- SafeMatcherCast<T>(matcher1_), SafeMatcherCast<T>(matcher2_)));
- }
-
- private:
- Matcher1 matcher1_;
- Matcher2 matcher2_;
-
- GTEST_DISALLOW_ASSIGN_(EitherOfMatcher);
-};
-
-// Used for implementing Truly(pred), which turns a predicate into a
-// matcher.
-template <typename Predicate>
-class TrulyMatcher {
- public:
- explicit TrulyMatcher(Predicate pred) : predicate_(pred) {}
-
- // This method template allows Truly(pred) to be used as a matcher
- // for type T where T is the argument type of predicate 'pred'. The
- // argument is passed by reference as the predicate may be
- // interested in the address of the argument.
- template <typename T>
- bool MatchAndExplain(T& x, // NOLINT
- MatchResultListener* /* listener */) const {
- // Without the if-statement, MSVC sometimes warns about converting
- // a value to bool (warning 4800).
- //
- // We cannot write 'return !!predicate_(x);' as that doesn't work
- // when predicate_(x) returns a class convertible to bool but
- // having no operator!().
- if (predicate_(x))
- return true;
- return false;
- }
-
- void DescribeTo(::std::ostream* os) const {
- *os << "satisfies the given predicate";
- }
-
- void DescribeNegationTo(::std::ostream* os) const {
- *os << "doesn't satisfy the given predicate";
- }
-
- private:
- Predicate predicate_;
-
- GTEST_DISALLOW_ASSIGN_(TrulyMatcher);
-};
-
-// Used for implementing Matches(matcher), which turns a matcher into
-// a predicate.
-template <typename M>
-class MatcherAsPredicate {
- public:
- explicit MatcherAsPredicate(M matcher) : matcher_(matcher) {}
-
- // This template operator() allows Matches(m) to be used as a
- // predicate on type T where m is a matcher on type T.
- //
- // The argument x is passed by reference instead of by value, as
- // some matcher may be interested in its address (e.g. as in
- // Matches(Ref(n))(x)).
- template <typename T>
- bool operator()(const T& x) const {
- // We let matcher_ commit to a particular type here instead of
- // when the MatcherAsPredicate object was constructed. This
- // allows us to write Matches(m) where m is a polymorphic matcher
- // (e.g. Eq(5)).
- //
- // If we write Matcher<T>(matcher_).Matches(x) here, it won't
- // compile when matcher_ has type Matcher<const T&>; if we write
- // Matcher<const T&>(matcher_).Matches(x) here, it won't compile
- // when matcher_ has type Matcher<T>; if we just write
- // matcher_.Matches(x), it won't compile when matcher_ is
- // polymorphic, e.g. Eq(5).
- //
- // MatcherCast<const T&>() is necessary for making the code work
- // in all of the above situations.
- return MatcherCast<const T&>(matcher_).Matches(x);
- }
-
- private:
- M matcher_;
-
- GTEST_DISALLOW_ASSIGN_(MatcherAsPredicate);
-};
-
-// For implementing ASSERT_THAT() and EXPECT_THAT(). The template
-// argument M must be a type that can be converted to a matcher.
-template <typename M>
-class PredicateFormatterFromMatcher {
- public:
- explicit PredicateFormatterFromMatcher(const M& m) : matcher_(m) {}
-
- // This template () operator allows a PredicateFormatterFromMatcher
- // object to act as a predicate-formatter suitable for using with
- // Google Test's EXPECT_PRED_FORMAT1() macro.
- template <typename T>
- AssertionResult operator()(const char* value_text, const T& x) const {
- // We convert matcher_ to a Matcher<const T&> *now* instead of
- // when the PredicateFormatterFromMatcher object was constructed,
- // as matcher_ may be polymorphic (e.g. NotNull()) and we won't
- // know which type to instantiate it to until we actually see the
- // type of x here.
- //
- // We write MatcherCast<const T&>(matcher_) instead of
- // Matcher<const T&>(matcher_), as the latter won't compile when
- // matcher_ has type Matcher<T> (e.g. An<int>()).
- const Matcher<const T&> matcher = MatcherCast<const T&>(matcher_);
- StringMatchResultListener listener;
- if (MatchPrintAndExplain(x, matcher, &listener))
- return AssertionSuccess();
-
- ::std::stringstream ss;
- ss << "Value of: " << value_text << "\n"
- << "Expected: ";
- matcher.DescribeTo(&ss);
- ss << "\n Actual: " << listener.str();
- return AssertionFailure() << ss.str();
- }
-
- private:
- const M matcher_;
-
- GTEST_DISALLOW_ASSIGN_(PredicateFormatterFromMatcher);
-};
-
-// A helper function for converting a matcher to a predicate-formatter
-// without the user needing to explicitly write the type. This is
-// used for implementing ASSERT_THAT() and EXPECT_THAT().
-template <typename M>
-inline PredicateFormatterFromMatcher<M>
-MakePredicateFormatterFromMatcher(const M& matcher) {
- return PredicateFormatterFromMatcher<M>(matcher);
-}
-
-// Implements the polymorphic floating point equality matcher, which
-// matches two float values using ULP-based approximation. The
-// template is meant to be instantiated with FloatType being either
-// float or double.
-template <typename FloatType>
-class FloatingEqMatcher {
- public:
- // Constructor for FloatingEqMatcher.
- // The matcher's input will be compared with rhs. The matcher treats two
- // NANs as equal if nan_eq_nan is true. Otherwise, under IEEE standards,
- // equality comparisons between NANs will always return false.
- FloatingEqMatcher(FloatType rhs, bool nan_eq_nan) :
- rhs_(rhs), nan_eq_nan_(nan_eq_nan) {}
-
- // Implements floating point equality matcher as a Matcher<T>.
- template <typename T>
- class Impl : public MatcherInterface<T> {
- public:
- Impl(FloatType rhs, bool nan_eq_nan) :
- rhs_(rhs), nan_eq_nan_(nan_eq_nan) {}
-
- virtual bool MatchAndExplain(T value,
- MatchResultListener* /* listener */) const {
- const FloatingPoint<FloatType> lhs(value), rhs(rhs_);
-
- // Compares NaNs first, if nan_eq_nan_ is true.
- if (nan_eq_nan_ && lhs.is_nan()) {
- return rhs.is_nan();
- }
-
- return lhs.AlmostEquals(rhs);
- }
-
- virtual void DescribeTo(::std::ostream* os) const {
- // os->precision() returns the previously set precision, which we
- // store to restore the ostream to its original configuration
- // after outputting.
- const ::std::streamsize old_precision = os->precision(
- ::std::numeric_limits<FloatType>::digits10 + 2);
- if (FloatingPoint<FloatType>(rhs_).is_nan()) {
- if (nan_eq_nan_) {
- *os << "is NaN";
- } else {
- *os << "never matches";
- }
- } else {
- *os << "is approximately " << rhs_;
- }
- os->precision(old_precision);
- }
-
- virtual void DescribeNegationTo(::std::ostream* os) const {
- // As before, get original precision.
- const ::std::streamsize old_precision = os->precision(
- ::std::numeric_limits<FloatType>::digits10 + 2);
- if (FloatingPoint<FloatType>(rhs_).is_nan()) {
- if (nan_eq_nan_) {
- *os << "isn't NaN";
- } else {
- *os << "is anything";
- }
- } else {
- *os << "isn't approximately " << rhs_;
- }
- // Restore original precision.
- os->precision(old_precision);
- }
-
- private:
- const FloatType rhs_;
- const bool nan_eq_nan_;
-
- GTEST_DISALLOW_ASSIGN_(Impl);
- };
-
- // The following 3 type conversion operators allow FloatEq(rhs) and
- // NanSensitiveFloatEq(rhs) to be used as a Matcher<float>, a
- // Matcher<const float&>, or a Matcher<float&>, but nothing else.
- // (While Google's C++ coding style doesn't allow arguments passed
- // by non-const reference, we may see them in code not conforming to
- // the style. Therefore Google Mock needs to support them.)
- operator Matcher<FloatType>() const {
- return MakeMatcher(new Impl<FloatType>(rhs_, nan_eq_nan_));
- }
-
- operator Matcher<const FloatType&>() const {
- return MakeMatcher(new Impl<const FloatType&>(rhs_, nan_eq_nan_));
- }
-
- operator Matcher<FloatType&>() const {
- return MakeMatcher(new Impl<FloatType&>(rhs_, nan_eq_nan_));
- }
-
- private:
- const FloatType rhs_;
- const bool nan_eq_nan_;
-
- GTEST_DISALLOW_ASSIGN_(FloatingEqMatcher);
-};
-
-// Implements the Pointee(m) matcher for matching a pointer whose
-// pointee matches matcher m. The pointer can be either raw or smart.
-template <typename InnerMatcher>
-class PointeeMatcher {
- public:
- explicit PointeeMatcher(const InnerMatcher& matcher) : matcher_(matcher) {}
-
- // This type conversion operator template allows Pointee(m) to be
- // used as a matcher for any pointer type whose pointee type is
- // compatible with the inner matcher, where type Pointer can be
- // either a raw pointer or a smart pointer.
- //
- // The reason we do this instead of relying on
- // MakePolymorphicMatcher() is that the latter is not flexible
- // enough for implementing the DescribeTo() method of Pointee().
- template <typename Pointer>
- operator Matcher<Pointer>() const {
- return MakeMatcher(new Impl<Pointer>(matcher_));
- }
-
- private:
- // The monomorphic implementation that works for a particular pointer type.
- template <typename Pointer>
- class Impl : public MatcherInterface<Pointer> {
- public:
- typedef typename PointeeOf<GTEST_REMOVE_CONST_( // NOLINT
- GTEST_REMOVE_REFERENCE_(Pointer))>::type Pointee;
-
- explicit Impl(const InnerMatcher& matcher)
- : matcher_(MatcherCast<const Pointee&>(matcher)) {}
-
- virtual void DescribeTo(::std::ostream* os) const {
- *os << "points to a value that ";
- matcher_.DescribeTo(os);
- }
-
- virtual void DescribeNegationTo(::std::ostream* os) const {
- *os << "does not point to a value that ";
- matcher_.DescribeTo(os);
- }
-
- virtual bool MatchAndExplain(Pointer pointer,
- MatchResultListener* listener) const {
- if (GetRawPointer(pointer) == NULL)
- return false;
-
- *listener << "which points to ";
- return MatchPrintAndExplain(*pointer, matcher_, listener);
- }
-
- private:
- const Matcher<const Pointee&> matcher_;
-
- GTEST_DISALLOW_ASSIGN_(Impl);
- };
-
- const InnerMatcher matcher_;
-
- GTEST_DISALLOW_ASSIGN_(PointeeMatcher);
-};
-
-// Implements the Field() matcher for matching a field (i.e. member
-// variable) of an object.
-template <typename Class, typename FieldType>
-class FieldMatcher {
- public:
- FieldMatcher(FieldType Class::*field,
- const Matcher<const FieldType&>& matcher)
- : field_(field), matcher_(matcher) {}
-
- void DescribeTo(::std::ostream* os) const {
- *os << "is an object whose given field ";
- matcher_.DescribeTo(os);
- }
-
- void DescribeNegationTo(::std::ostream* os) const {
- *os << "is an object whose given field ";
- matcher_.DescribeNegationTo(os);
- }
-
- template <typename T>
- bool MatchAndExplain(const T& value, MatchResultListener* listener) const {
- return MatchAndExplainImpl(
- typename ::testing::internal::
- is_pointer<GTEST_REMOVE_CONST_(T)>::type(),
- value, listener);
- }
-
- private:
- // The first argument of MatchAndExplainImpl() is needed to help
- // Symbian's C++ compiler choose which overload to use. Its type is
- // true_type iff the Field() matcher is used to match a pointer.
- bool MatchAndExplainImpl(false_type /* is_not_pointer */, const Class& obj,
- MatchResultListener* listener) const {
- *listener << "whose given field is ";
- return MatchPrintAndExplain(obj.*field_, matcher_, listener);
- }
-
- bool MatchAndExplainImpl(true_type /* is_pointer */, const Class* p,
- MatchResultListener* listener) const {
- if (p == NULL)
- return false;
-
- *listener << "which points to an object ";
- // Since *p has a field, it must be a class/struct/union type and
- // thus cannot be a pointer. Therefore we pass false_type() as
- // the first argument.
- return MatchAndExplainImpl(false_type(), *p, listener);
- }
-
- const FieldType Class::*field_;
- const Matcher<const FieldType&> matcher_;
-
- GTEST_DISALLOW_ASSIGN_(FieldMatcher);
-};
-
-// Implements the Property() matcher for matching a property
-// (i.e. return value of a getter method) of an object.
-template <typename Class, typename PropertyType>
-class PropertyMatcher {
- public:
- // The property may have a reference type, so 'const PropertyType&'
- // may cause double references and fail to compile. That's why we
- // need GTEST_REFERENCE_TO_CONST, which works regardless of
- // PropertyType being a reference or not.
- typedef GTEST_REFERENCE_TO_CONST_(PropertyType) RefToConstProperty;
-
- PropertyMatcher(PropertyType (Class::*property)() const,
- const Matcher<RefToConstProperty>& matcher)
- : property_(property), matcher_(matcher) {}
-
- void DescribeTo(::std::ostream* os) const {
- *os << "is an object whose given property ";
- matcher_.DescribeTo(os);
- }
-
- void DescribeNegationTo(::std::ostream* os) const {
- *os << "is an object whose given property ";
- matcher_.DescribeNegationTo(os);
- }
-
- template <typename T>
- bool MatchAndExplain(const T&value, MatchResultListener* listener) const {
- return MatchAndExplainImpl(
- typename ::testing::internal::
- is_pointer<GTEST_REMOVE_CONST_(T)>::type(),
- value, listener);
- }
-
- private:
- // The first argument of MatchAndExplainImpl() is needed to help
- // Symbian's C++ compiler choose which overload to use. Its type is
- // true_type iff the Property() matcher is used to match a pointer.
- bool MatchAndExplainImpl(false_type /* is_not_pointer */, const Class& obj,
- MatchResultListener* listener) const {
- *listener << "whose given property is ";
- // Cannot pass the return value (for example, int) to MatchPrintAndExplain,
- // which takes a non-const reference as argument.
- RefToConstProperty result = (obj.*property_)();
- return MatchPrintAndExplain(result, matcher_, listener);
- }
-
- bool MatchAndExplainImpl(true_type /* is_pointer */, const Class* p,
- MatchResultListener* listener) const {
- if (p == NULL)
- return false;
-
- *listener << "which points to an object ";
- // Since *p has a property method, it must be a class/struct/union
- // type and thus cannot be a pointer. Therefore we pass
- // false_type() as the first argument.
- return MatchAndExplainImpl(false_type(), *p, listener);
- }
-
- PropertyType (Class::*property_)() const;
- const Matcher<RefToConstProperty> matcher_;
-
- GTEST_DISALLOW_ASSIGN_(PropertyMatcher);
-};
-
-// Type traits specifying various features of different functors for ResultOf.
-// The default template specifies features for functor objects.
-// Functor classes have to typedef argument_type and result_type
-// to be compatible with ResultOf.
-template <typename Functor>
-struct CallableTraits {
- typedef typename Functor::result_type ResultType;
- typedef Functor StorageType;
-
- static void CheckIsValid(Functor /* functor */) {}
- template <typename T>
- static ResultType Invoke(Functor f, T arg) { return f(arg); }
-};
-
-// Specialization for function pointers.
-template <typename ArgType, typename ResType>
-struct CallableTraits<ResType(*)(ArgType)> {
- typedef ResType ResultType;
- typedef ResType(*StorageType)(ArgType);
-
- static void CheckIsValid(ResType(*f)(ArgType)) {
- GTEST_CHECK_(f != NULL)
- << "NULL function pointer is passed into ResultOf().";
- }
- template <typename T>
- static ResType Invoke(ResType(*f)(ArgType), T arg) {
- return (*f)(arg);
- }
-};
-
-// Implements the ResultOf() matcher for matching a return value of a
-// unary function of an object.
-template <typename Callable>
-class ResultOfMatcher {
- public:
- typedef typename CallableTraits<Callable>::ResultType ResultType;
-
- ResultOfMatcher(Callable callable, const Matcher<ResultType>& matcher)
- : callable_(callable), matcher_(matcher) {
- CallableTraits<Callable>::CheckIsValid(callable_);
- }
-
- template <typename T>
- operator Matcher<T>() const {
- return Matcher<T>(new Impl<T>(callable_, matcher_));
- }
-
- private:
- typedef typename CallableTraits<Callable>::StorageType CallableStorageType;
-
- template <typename T>
- class Impl : public MatcherInterface<T> {
- public:
- Impl(CallableStorageType callable, const Matcher<ResultType>& matcher)
- : callable_(callable), matcher_(matcher) {}
-
- virtual void DescribeTo(::std::ostream* os) const {
- *os << "is mapped by the given callable to a value that ";
- matcher_.DescribeTo(os);
- }
-
- virtual void DescribeNegationTo(::std::ostream* os) const {
- *os << "is mapped by the given callable to a value that ";
- matcher_.DescribeNegationTo(os);
- }
-
- virtual bool MatchAndExplain(T obj, MatchResultListener* listener) const {
- *listener << "which is mapped by the given callable to ";
- // Cannot pass the return value (for example, int) to
- // MatchPrintAndExplain, which takes a non-const reference as argument.
- ResultType result =
- CallableTraits<Callable>::template Invoke<T>(callable_, obj);
- return MatchPrintAndExplain(result, matcher_, listener);
- }
-
- private:
- // Functors often define operator() as non-const method even though
- // they are actualy stateless. But we need to use them even when
- // 'this' is a const pointer. It's the user's responsibility not to
- // use stateful callables with ResultOf(), which does't guarantee
- // how many times the callable will be invoked.
- mutable CallableStorageType callable_;
- const Matcher<ResultType> matcher_;
-
- GTEST_DISALLOW_ASSIGN_(Impl);
- }; // class Impl
-
- const CallableStorageType callable_;
- const Matcher<ResultType> matcher_;
-
- GTEST_DISALLOW_ASSIGN_(ResultOfMatcher);
-};
-
-// Implements an equality matcher for any STL-style container whose elements
-// support ==. This matcher is like Eq(), but its failure explanations provide
-// more detailed information that is useful when the container is used as a set.
-// The failure message reports elements that are in one of the operands but not
-// the other. The failure messages do not report duplicate or out-of-order
-// elements in the containers (which don't properly matter to sets, but can
-// occur if the containers are vectors or lists, for example).
-//
-// Uses the container's const_iterator, value_type, operator ==,
-// begin(), and end().
-template <typename Container>
-class ContainerEqMatcher {
- public:
- typedef internal::StlContainerView<Container> View;
- typedef typename View::type StlContainer;
- typedef typename View::const_reference StlContainerReference;
-
- // We make a copy of rhs in case the elements in it are modified
- // after this matcher is created.
- explicit ContainerEqMatcher(const Container& rhs) : rhs_(View::Copy(rhs)) {
- // Makes sure the user doesn't instantiate this class template
- // with a const or reference type.
- (void)testing::StaticAssertTypeEq<Container,
- GTEST_REMOVE_REFERENCE_AND_CONST_(Container)>();
- }
-
- void DescribeTo(::std::ostream* os) const {
- *os << "equals ";
- UniversalPrint(rhs_, os);
- }
- void DescribeNegationTo(::std::ostream* os) const {
- *os << "does not equal ";
- UniversalPrint(rhs_, os);
- }
-
- template <typename LhsContainer>
- bool MatchAndExplain(const LhsContainer& lhs,
- MatchResultListener* listener) const {
- // GTEST_REMOVE_CONST_() is needed to work around an MSVC 8.0 bug
- // that causes LhsContainer to be a const type sometimes.
- typedef internal::StlContainerView<GTEST_REMOVE_CONST_(LhsContainer)>
- LhsView;
- typedef typename LhsView::type LhsStlContainer;
- StlContainerReference lhs_stl_container = LhsView::ConstReference(lhs);
- if (lhs_stl_container == rhs_)
- return true;
-
- ::std::ostream* const os = listener->stream();
- if (os != NULL) {
- // Something is different. Check for extra values first.
- bool printed_header = false;
- for (typename LhsStlContainer::const_iterator it =
- lhs_stl_container.begin();
- it != lhs_stl_container.end(); ++it) {
- if (internal::ArrayAwareFind(rhs_.begin(), rhs_.end(), *it) ==
- rhs_.end()) {
- if (printed_header) {
- *os << ", ";
- } else {
- *os << "which has these unexpected elements: ";
- printed_header = true;
- }
- UniversalPrint(*it, os);
- }
- }
-
- // Now check for missing values.
- bool printed_header2 = false;
- for (typename StlContainer::const_iterator it = rhs_.begin();
- it != rhs_.end(); ++it) {
- if (internal::ArrayAwareFind(
- lhs_stl_container.begin(), lhs_stl_container.end(), *it) ==
- lhs_stl_container.end()) {
- if (printed_header2) {
- *os << ", ";
- } else {
- *os << (printed_header ? ",\nand" : "which")
- << " doesn't have these expected elements: ";
- printed_header2 = true;
- }
- UniversalPrint(*it, os);
- }
- }
- }
-
- return false;
- }
-
- private:
- const StlContainer rhs_;
-
- GTEST_DISALLOW_ASSIGN_(ContainerEqMatcher);
-};
-
-// A comparator functor that uses the < operator to compare two values.
-struct LessComparator {
- template <typename T, typename U>
- bool operator()(const T& lhs, const U& rhs) const { return lhs < rhs; }
-};
-
-// Implements WhenSortedBy(comparator, container_matcher).
-template <typename Comparator, typename ContainerMatcher>
-class WhenSortedByMatcher {
- public:
- WhenSortedByMatcher(const Comparator& comparator,
- const ContainerMatcher& matcher)
- : comparator_(comparator), matcher_(matcher) {}
-
- template <typename LhsContainer>
- operator Matcher<LhsContainer>() const {
- return MakeMatcher(new Impl<LhsContainer>(comparator_, matcher_));
- }
-
- template <typename LhsContainer>
- class Impl : public MatcherInterface<LhsContainer> {
- public:
- typedef internal::StlContainerView<
- GTEST_REMOVE_REFERENCE_AND_CONST_(LhsContainer)> LhsView;
- typedef typename LhsView::type LhsStlContainer;
- typedef typename LhsView::const_reference LhsStlContainerReference;
- typedef typename LhsStlContainer::value_type LhsValue;
-
- Impl(const Comparator& comparator, const ContainerMatcher& matcher)
- : comparator_(comparator), matcher_(matcher) {}
-
- virtual void DescribeTo(::std::ostream* os) const {
- *os << "(when sorted) ";
- matcher_.DescribeTo(os);
- }
-
- virtual void DescribeNegationTo(::std::ostream* os) const {
- *os << "(when sorted) ";
- matcher_.DescribeNegationTo(os);
- }
-
- virtual bool MatchAndExplain(LhsContainer lhs,
- MatchResultListener* listener) const {
- LhsStlContainerReference lhs_stl_container = LhsView::ConstReference(lhs);
- std::vector<LhsValue> sorted_container(lhs_stl_container.begin(),
- lhs_stl_container.end());
- std::sort(sorted_container.begin(), sorted_container.end(), comparator_);
-
- if (!listener->IsInterested()) {
- // If the listener is not interested, we do not need to
- // construct the inner explanation.
- return matcher_.Matches(sorted_container);
- }
-
- *listener << "which is ";
- UniversalPrint(sorted_container, listener->stream());
- *listener << " when sorted";
-
- StringMatchResultListener inner_listener;
- const bool match = matcher_.MatchAndExplain(sorted_container,
- &inner_listener);
- PrintIfNotEmpty(inner_listener.str(), listener->stream());
- return match;
- }
-
- private:
- const Comparator comparator_;
- const Matcher<const std::vector<LhsValue>&> matcher_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(Impl);
- };
-
- private:
- const Comparator comparator_;
- const ContainerMatcher matcher_;
-
- GTEST_DISALLOW_ASSIGN_(WhenSortedByMatcher);
-};
-
-// Implements Pointwise(tuple_matcher, rhs_container). tuple_matcher
-// must be able to be safely cast to Matcher<tuple<const T1&, const
-// T2&> >, where T1 and T2 are the types of elements in the LHS
-// container and the RHS container respectively.
-template <typename TupleMatcher, typename RhsContainer>
-class PointwiseMatcher {
- public:
- typedef internal::StlContainerView<RhsContainer> RhsView;
- typedef typename RhsView::type RhsStlContainer;
- typedef typename RhsStlContainer::value_type RhsValue;
-
- // Like ContainerEq, we make a copy of rhs in case the elements in
- // it are modified after this matcher is created.
- PointwiseMatcher(const TupleMatcher& tuple_matcher, const RhsContainer& rhs)
- : tuple_matcher_(tuple_matcher), rhs_(RhsView::Copy(rhs)) {
- // Makes sure the user doesn't instantiate this class template
- // with a const or reference type.
- (void)testing::StaticAssertTypeEq<RhsContainer,
- GTEST_REMOVE_REFERENCE_AND_CONST_(RhsContainer)>();
- }
-
- template <typename LhsContainer>
- operator Matcher<LhsContainer>() const {
- return MakeMatcher(new Impl<LhsContainer>(tuple_matcher_, rhs_));
- }
-
- template <typename LhsContainer>
- class Impl : public MatcherInterface<LhsContainer> {
- public:
- typedef internal::StlContainerView<
- GTEST_REMOVE_REFERENCE_AND_CONST_(LhsContainer)> LhsView;
- typedef typename LhsView::type LhsStlContainer;
- typedef typename LhsView::const_reference LhsStlContainerReference;
- typedef typename LhsStlContainer::value_type LhsValue;
- // We pass the LHS value and the RHS value to the inner matcher by
- // reference, as they may be expensive to copy. We must use tuple
- // instead of pair here, as a pair cannot hold references (C++ 98,
- // 20.2.2 [lib.pairs]).
- typedef std::tr1::tuple<const LhsValue&, const RhsValue&> InnerMatcherArg;
-
- Impl(const TupleMatcher& tuple_matcher, const RhsStlContainer& rhs)
- // mono_tuple_matcher_ holds a monomorphic version of the tuple matcher.
- : mono_tuple_matcher_(SafeMatcherCast<InnerMatcherArg>(tuple_matcher)),
- rhs_(rhs) {}
-
- virtual void DescribeTo(::std::ostream* os) const {
- *os << "contains " << rhs_.size()
- << " values, where each value and its corresponding value in ";
- UniversalPrinter<RhsStlContainer>::Print(rhs_, os);
- *os << " ";
- mono_tuple_matcher_.DescribeTo(os);
- }
- virtual void DescribeNegationTo(::std::ostream* os) const {
- *os << "doesn't contain exactly " << rhs_.size()
- << " values, or contains a value x at some index i"
- << " where x and the i-th value of ";
- UniversalPrint(rhs_, os);
- *os << " ";
- mono_tuple_matcher_.DescribeNegationTo(os);
- }
-
- virtual bool MatchAndExplain(LhsContainer lhs,
- MatchResultListener* listener) const {
- LhsStlContainerReference lhs_stl_container = LhsView::ConstReference(lhs);
- const size_t actual_size = lhs_stl_container.size();
- if (actual_size != rhs_.size()) {
- *listener << "which contains " << actual_size << " values";
- return false;
- }
-
- typename LhsStlContainer::const_iterator left = lhs_stl_container.begin();
- typename RhsStlContainer::const_iterator right = rhs_.begin();
- for (size_t i = 0; i != actual_size; ++i, ++left, ++right) {
- const InnerMatcherArg value_pair(*left, *right);
-
- if (listener->IsInterested()) {
- StringMatchResultListener inner_listener;
- if (!mono_tuple_matcher_.MatchAndExplain(
- value_pair, &inner_listener)) {
- *listener << "where the value pair (";
- UniversalPrint(*left, listener->stream());
- *listener << ", ";
- UniversalPrint(*right, listener->stream());
- *listener << ") at index #" << i << " don't match";
- PrintIfNotEmpty(inner_listener.str(), listener->stream());
- return false;
- }
- } else {
- if (!mono_tuple_matcher_.Matches(value_pair))
- return false;
- }
- }
-
- return true;
- }
-
- private:
- const Matcher<InnerMatcherArg> mono_tuple_matcher_;
- const RhsStlContainer rhs_;
-
- GTEST_DISALLOW_ASSIGN_(Impl);
- };
-
- private:
- const TupleMatcher tuple_matcher_;
- const RhsStlContainer rhs_;
-
- GTEST_DISALLOW_ASSIGN_(PointwiseMatcher);
-};
-
-// Holds the logic common to ContainsMatcherImpl and EachMatcherImpl.
-template <typename Container>
-class QuantifierMatcherImpl : public MatcherInterface<Container> {
- public:
- typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer;
- typedef StlContainerView<RawContainer> View;
- typedef typename View::type StlContainer;
- typedef typename View::const_reference StlContainerReference;
- typedef typename StlContainer::value_type Element;
-
- template <typename InnerMatcher>
- explicit QuantifierMatcherImpl(InnerMatcher inner_matcher)
- : inner_matcher_(
- testing::SafeMatcherCast<const Element&>(inner_matcher)) {}
-
- // Checks whether:
- // * All elements in the container match, if all_elements_should_match.
- // * Any element in the container matches, if !all_elements_should_match.
- bool MatchAndExplainImpl(bool all_elements_should_match,
- Container container,
- MatchResultListener* listener) const {
- StlContainerReference stl_container = View::ConstReference(container);
- size_t i = 0;
- for (typename StlContainer::const_iterator it = stl_container.begin();
- it != stl_container.end(); ++it, ++i) {
- StringMatchResultListener inner_listener;
- const bool matches = inner_matcher_.MatchAndExplain(*it, &inner_listener);
-
- if (matches != all_elements_should_match) {
- *listener << "whose element #" << i
- << (matches ? " matches" : " doesn't match");
- PrintIfNotEmpty(inner_listener.str(), listener->stream());
- return !all_elements_should_match;
- }
- }
- return all_elements_should_match;
- }
-
- protected:
- const Matcher<const Element&> inner_matcher_;
-
- GTEST_DISALLOW_ASSIGN_(QuantifierMatcherImpl);
-};
-
-// Implements Contains(element_matcher) for the given argument type Container.
-// Symmetric to EachMatcherImpl.
-template <typename Container>
-class ContainsMatcherImpl : public QuantifierMatcherImpl<Container> {
- public:
- template <typename InnerMatcher>
- explicit ContainsMatcherImpl(InnerMatcher inner_matcher)
- : QuantifierMatcherImpl<Container>(inner_matcher) {}
-
- // Describes what this matcher does.
- virtual void DescribeTo(::std::ostream* os) const {
- *os << "contains at least one element that ";
- this->inner_matcher_.DescribeTo(os);
- }
-
- virtual void DescribeNegationTo(::std::ostream* os) const {
- *os << "doesn't contain any element that ";
- this->inner_matcher_.DescribeTo(os);
- }
-
- virtual bool MatchAndExplain(Container container,
- MatchResultListener* listener) const {
- return this->MatchAndExplainImpl(false, container, listener);
- }
-
- private:
- GTEST_DISALLOW_ASSIGN_(ContainsMatcherImpl);
-};
-
-// Implements Each(element_matcher) for the given argument type Container.
-// Symmetric to ContainsMatcherImpl.
-template <typename Container>
-class EachMatcherImpl : public QuantifierMatcherImpl<Container> {
- public:
- template <typename InnerMatcher>
- explicit EachMatcherImpl(InnerMatcher inner_matcher)
- : QuantifierMatcherImpl<Container>(inner_matcher) {}
-
- // Describes what this matcher does.
- virtual void DescribeTo(::std::ostream* os) const {
- *os << "only contains elements that ";
- this->inner_matcher_.DescribeTo(os);
- }
-
- virtual void DescribeNegationTo(::std::ostream* os) const {
- *os << "contains some element that ";
- this->inner_matcher_.DescribeNegationTo(os);
- }
-
- virtual bool MatchAndExplain(Container container,
- MatchResultListener* listener) const {
- return this->MatchAndExplainImpl(true, container, listener);
- }
-
- private:
- GTEST_DISALLOW_ASSIGN_(EachMatcherImpl);
-};
-
-// Implements polymorphic Contains(element_matcher).
-template <typename M>
-class ContainsMatcher {
- public:
- explicit ContainsMatcher(M m) : inner_matcher_(m) {}
-
- template <typename Container>
- operator Matcher<Container>() const {
- return MakeMatcher(new ContainsMatcherImpl<Container>(inner_matcher_));
- }
-
- private:
- const M inner_matcher_;
-
- GTEST_DISALLOW_ASSIGN_(ContainsMatcher);
-};
-
-// Implements polymorphic Each(element_matcher).
-template <typename M>
-class EachMatcher {
- public:
- explicit EachMatcher(M m) : inner_matcher_(m) {}
-
- template <typename Container>
- operator Matcher<Container>() const {
- return MakeMatcher(new EachMatcherImpl<Container>(inner_matcher_));
- }
-
- private:
- const M inner_matcher_;
-
- GTEST_DISALLOW_ASSIGN_(EachMatcher);
-};
-
-// Implements Key(inner_matcher) for the given argument pair type.
-// Key(inner_matcher) matches an std::pair whose 'first' field matches
-// inner_matcher. For example, Contains(Key(Ge(5))) can be used to match an
-// std::map that contains at least one element whose key is >= 5.
-template <typename PairType>
-class KeyMatcherImpl : public MatcherInterface<PairType> {
- public:
- typedef GTEST_REMOVE_REFERENCE_AND_CONST_(PairType) RawPairType;
- typedef typename RawPairType::first_type KeyType;
-
- template <typename InnerMatcher>
- explicit KeyMatcherImpl(InnerMatcher inner_matcher)
- : inner_matcher_(
- testing::SafeMatcherCast<const KeyType&>(inner_matcher)) {
- }
-
- // Returns true iff 'key_value.first' (the key) matches the inner matcher.
- virtual bool MatchAndExplain(PairType key_value,
- MatchResultListener* listener) const {
- StringMatchResultListener inner_listener;
- const bool match = inner_matcher_.MatchAndExplain(key_value.first,
- &inner_listener);
- const internal::string explanation = inner_listener.str();
- if (explanation != "") {
- *listener << "whose first field is a value " << explanation;
- }
- return match;
- }
-
- // Describes what this matcher does.
- virtual void DescribeTo(::std::ostream* os) const {
- *os << "has a key that ";
- inner_matcher_.DescribeTo(os);
- }
-
- // Describes what the negation of this matcher does.
- virtual void DescribeNegationTo(::std::ostream* os) const {
- *os << "doesn't have a key that ";
- inner_matcher_.DescribeTo(os);
- }
-
- private:
- const Matcher<const KeyType&> inner_matcher_;
-
- GTEST_DISALLOW_ASSIGN_(KeyMatcherImpl);
-};
-
-// Implements polymorphic Key(matcher_for_key).
-template <typename M>
-class KeyMatcher {
- public:
- explicit KeyMatcher(M m) : matcher_for_key_(m) {}
-
- template <typename PairType>
- operator Matcher<PairType>() const {
- return MakeMatcher(new KeyMatcherImpl<PairType>(matcher_for_key_));
- }
-
- private:
- const M matcher_for_key_;
-
- GTEST_DISALLOW_ASSIGN_(KeyMatcher);
-};
-
-// Implements Pair(first_matcher, second_matcher) for the given argument pair
-// type with its two matchers. See Pair() function below.
-template <typename PairType>
-class PairMatcherImpl : public MatcherInterface<PairType> {
- public:
- typedef GTEST_REMOVE_REFERENCE_AND_CONST_(PairType) RawPairType;
- typedef typename RawPairType::first_type FirstType;
- typedef typename RawPairType::second_type SecondType;
-
- template <typename FirstMatcher, typename SecondMatcher>
- PairMatcherImpl(FirstMatcher first_matcher, SecondMatcher second_matcher)
- : first_matcher_(
- testing::SafeMatcherCast<const FirstType&>(first_matcher)),
- second_matcher_(
- testing::SafeMatcherCast<const SecondType&>(second_matcher)) {
- }
-
- // Describes what this matcher does.
- virtual void DescribeTo(::std::ostream* os) const {
- *os << "has a first field that ";
- first_matcher_.DescribeTo(os);
- *os << ", and has a second field that ";
- second_matcher_.DescribeTo(os);
- }
-
- // Describes what the negation of this matcher does.
- virtual void DescribeNegationTo(::std::ostream* os) const {
- *os << "has a first field that ";
- first_matcher_.DescribeNegationTo(os);
- *os << ", or has a second field that ";
- second_matcher_.DescribeNegationTo(os);
- }
-
- // Returns true iff 'a_pair.first' matches first_matcher and 'a_pair.second'
- // matches second_matcher.
- virtual bool MatchAndExplain(PairType a_pair,
- MatchResultListener* listener) const {
- if (!listener->IsInterested()) {
- // If the listener is not interested, we don't need to construct the
- // explanation.
- return first_matcher_.Matches(a_pair.first) &&
- second_matcher_.Matches(a_pair.second);
- }
- StringMatchResultListener first_inner_listener;
- if (!first_matcher_.MatchAndExplain(a_pair.first,
- &first_inner_listener)) {
- *listener << "whose first field does not match";
- PrintIfNotEmpty(first_inner_listener.str(), listener->stream());
- return false;
- }
- StringMatchResultListener second_inner_listener;
- if (!second_matcher_.MatchAndExplain(a_pair.second,
- &second_inner_listener)) {
- *listener << "whose second field does not match";
- PrintIfNotEmpty(second_inner_listener.str(), listener->stream());
- return false;
- }
- ExplainSuccess(first_inner_listener.str(), second_inner_listener.str(),
- listener);
- return true;
- }
-
- private:
- void ExplainSuccess(const internal::string& first_explanation,
- const internal::string& second_explanation,
- MatchResultListener* listener) const {
- *listener << "whose both fields match";
- if (first_explanation != "") {
- *listener << ", where the first field is a value " << first_explanation;
- }
- if (second_explanation != "") {
- *listener << ", ";
- if (first_explanation != "") {
- *listener << "and ";
- } else {
- *listener << "where ";
- }
- *listener << "the second field is a value " << second_explanation;
- }
- }
-
- const Matcher<const FirstType&> first_matcher_;
- const Matcher<const SecondType&> second_matcher_;
-
- GTEST_DISALLOW_ASSIGN_(PairMatcherImpl);
-};
-
-// Implements polymorphic Pair(first_matcher, second_matcher).
-template <typename FirstMatcher, typename SecondMatcher>
-class PairMatcher {
- public:
- PairMatcher(FirstMatcher first_matcher, SecondMatcher second_matcher)
- : first_matcher_(first_matcher), second_matcher_(second_matcher) {}
-
- template <typename PairType>
- operator Matcher<PairType> () const {
- return MakeMatcher(
- new PairMatcherImpl<PairType>(
- first_matcher_, second_matcher_));
- }
-
- private:
- const FirstMatcher first_matcher_;
- const SecondMatcher second_matcher_;
-
- GTEST_DISALLOW_ASSIGN_(PairMatcher);
-};
-
-// Implements ElementsAre() and ElementsAreArray().
-template <typename Container>
-class ElementsAreMatcherImpl : public MatcherInterface<Container> {
- public:
- typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer;
- typedef internal::StlContainerView<RawContainer> View;
- typedef typename View::type StlContainer;
- typedef typename View::const_reference StlContainerReference;
- typedef typename StlContainer::value_type Element;
-
- // Constructs the matcher from a sequence of element values or
- // element matchers.
- template <typename InputIter>
- ElementsAreMatcherImpl(InputIter first, size_t a_count) {
- matchers_.reserve(a_count);
- InputIter it = first;
- for (size_t i = 0; i != a_count; ++i, ++it) {
- matchers_.push_back(MatcherCast<const Element&>(*it));
- }
- }
-
- // Describes what this matcher does.
- virtual void DescribeTo(::std::ostream* os) const {
- if (count() == 0) {
- *os << "is empty";
- } else if (count() == 1) {
- *os << "has 1 element that ";
- matchers_[0].DescribeTo(os);
- } else {
- *os << "has " << Elements(count()) << " where\n";
- for (size_t i = 0; i != count(); ++i) {
- *os << "element #" << i << " ";
- matchers_[i].DescribeTo(os);
- if (i + 1 < count()) {
- *os << ",\n";
- }
- }
- }
- }
-
- // Describes what the negation of this matcher does.
- virtual void DescribeNegationTo(::std::ostream* os) const {
- if (count() == 0) {
- *os << "isn't empty";
- return;
- }
-
- *os << "doesn't have " << Elements(count()) << ", or\n";
- for (size_t i = 0; i != count(); ++i) {
- *os << "element #" << i << " ";
- matchers_[i].DescribeNegationTo(os);
- if (i + 1 < count()) {
- *os << ", or\n";
- }
- }
- }
-
- virtual bool MatchAndExplain(Container container,
- MatchResultListener* listener) const {
- StlContainerReference stl_container = View::ConstReference(container);
- const size_t actual_count = stl_container.size();
- if (actual_count != count()) {
- // The element count doesn't match. If the container is empty,
- // there's no need to explain anything as Google Mock already
- // prints the empty container. Otherwise we just need to show
- // how many elements there actually are.
- if (actual_count != 0) {
- *listener << "which has " << Elements(actual_count);
- }
- return false;
- }
-
- typename StlContainer::const_iterator it = stl_container.begin();
- // explanations[i] is the explanation of the element at index i.
- std::vector<internal::string> explanations(count());
- for (size_t i = 0; i != count(); ++it, ++i) {
- StringMatchResultListener s;
- if (matchers_[i].MatchAndExplain(*it, &s)) {
- explanations[i] = s.str();
- } else {
- // The container has the right size but the i-th element
- // doesn't match its expectation.
- *listener << "whose element #" << i << " doesn't match";
- PrintIfNotEmpty(s.str(), listener->stream());
- return false;
- }
- }
-
- // Every element matches its expectation. We need to explain why
- // (the obvious ones can be skipped).
- bool reason_printed = false;
- for (size_t i = 0; i != count(); ++i) {
- const internal::string& s = explanations[i];
- if (!s.empty()) {
- if (reason_printed) {
- *listener << ",\nand ";
- }
- *listener << "whose element #" << i << " matches, " << s;
- reason_printed = true;
- }
- }
-
- return true;
- }
-
- private:
- static Message Elements(size_t count) {
- return Message() << count << (count == 1 ? " element" : " elements");
- }
-
- size_t count() const { return matchers_.size(); }
- std::vector<Matcher<const Element&> > matchers_;
-
- GTEST_DISALLOW_ASSIGN_(ElementsAreMatcherImpl);
-};
-
-// Implements ElementsAre() of 0 arguments.
-class ElementsAreMatcher0 {
- public:
- ElementsAreMatcher0() {}
-
- template <typename Container>
- operator Matcher<Container>() const {
- typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer;
- typedef typename internal::StlContainerView<RawContainer>::type::value_type
- Element;
-
- const Matcher<const Element&>* const matchers = NULL;
- return MakeMatcher(new ElementsAreMatcherImpl<Container>(matchers, 0));
- }
-};
-
-// Implements ElementsAreArray().
-template <typename T>
-class ElementsAreArrayMatcher {
- public:
- ElementsAreArrayMatcher(const T* first, size_t count) :
- first_(first), count_(count) {}
-
- template <typename Container>
- operator Matcher<Container>() const {
- typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer;
- typedef typename internal::StlContainerView<RawContainer>::type::value_type
- Element;
-
- return MakeMatcher(new ElementsAreMatcherImpl<Container>(first_, count_));
- }
-
- private:
- const T* const first_;
- const size_t count_;
-
- GTEST_DISALLOW_ASSIGN_(ElementsAreArrayMatcher);
-};
-
-// Returns the description for a matcher defined using the MATCHER*()
-// macro where the user-supplied description string is "", if
-// 'negation' is false; otherwise returns the description of the
-// negation of the matcher. 'param_values' contains a list of strings
-// that are the print-out of the matcher's parameters.
-GTEST_API_ string FormatMatcherDescription(bool negation,
- const char* matcher_name,
- const Strings& param_values);
-
-} // namespace internal
-
-// _ is a matcher that matches anything of any type.
-//
-// This definition is fine as:
-//
-// 1. The C++ standard permits using the name _ in a namespace that
-// is not the global namespace or ::std.
-// 2. The AnythingMatcher class has no data member or constructor,
-// so it's OK to create global variables of this type.
-// 3. c-style has approved of using _ in this case.
-const internal::AnythingMatcher _ = {};
-// Creates a matcher that matches any value of the given type T.
-template <typename T>
-inline Matcher<T> A() { return MakeMatcher(new internal::AnyMatcherImpl<T>()); }
-
-// Creates a matcher that matches any value of the given type T.
-template <typename T>
-inline Matcher<T> An() { return A<T>(); }
-
-// Creates a polymorphic matcher that matches anything equal to x.
-// Note: if the parameter of Eq() were declared as const T&, Eq("foo")
-// wouldn't compile.
-template <typename T>
-inline internal::EqMatcher<T> Eq(T x) { return internal::EqMatcher<T>(x); }
-
-// Constructs a Matcher<T> from a 'value' of type T. The constructed
-// matcher matches any value that's equal to 'value'.
-template <typename T>
-Matcher<T>::Matcher(T value) { *this = Eq(value); }
-
-// Creates a monomorphic matcher that matches anything with type Lhs
-// and equal to rhs. A user may need to use this instead of Eq(...)
-// in order to resolve an overloading ambiguity.
-//
-// TypedEq<T>(x) is just a convenient short-hand for Matcher<T>(Eq(x))
-// or Matcher<T>(x), but more readable than the latter.
-//
-// We could define similar monomorphic matchers for other comparison
-// operations (e.g. TypedLt, TypedGe, and etc), but decided not to do
-// it yet as those are used much less than Eq() in practice. A user
-// can always write Matcher<T>(Lt(5)) to be explicit about the type,
-// for example.
-template <typename Lhs, typename Rhs>
-inline Matcher<Lhs> TypedEq(const Rhs& rhs) { return Eq(rhs); }
-
-// Creates a polymorphic matcher that matches anything >= x.
-template <typename Rhs>
-inline internal::GeMatcher<Rhs> Ge(Rhs x) {
- return internal::GeMatcher<Rhs>(x);
-}
-
-// Creates a polymorphic matcher that matches anything > x.
-template <typename Rhs>
-inline internal::GtMatcher<Rhs> Gt(Rhs x) {
- return internal::GtMatcher<Rhs>(x);
-}
-
-// Creates a polymorphic matcher that matches anything <= x.
-template <typename Rhs>
-inline internal::LeMatcher<Rhs> Le(Rhs x) {
- return internal::LeMatcher<Rhs>(x);
-}
-
-// Creates a polymorphic matcher that matches anything < x.
-template <typename Rhs>
-inline internal::LtMatcher<Rhs> Lt(Rhs x) {
- return internal::LtMatcher<Rhs>(x);
-}
-
-// Creates a polymorphic matcher that matches anything != x.
-template <typename Rhs>
-inline internal::NeMatcher<Rhs> Ne(Rhs x) {
- return internal::NeMatcher<Rhs>(x);
-}
-
-// Creates a polymorphic matcher that matches any NULL pointer.
-inline PolymorphicMatcher<internal::IsNullMatcher > IsNull() {
- return MakePolymorphicMatcher(internal::IsNullMatcher());
-}
-
-// Creates a polymorphic matcher that matches any non-NULL pointer.
-// This is convenient as Not(NULL) doesn't compile (the compiler
-// thinks that that expression is comparing a pointer with an integer).
-inline PolymorphicMatcher<internal::NotNullMatcher > NotNull() {
- return MakePolymorphicMatcher(internal::NotNullMatcher());
-}
-
-// Creates a polymorphic matcher that matches any argument that
-// references variable x.
-template <typename T>
-inline internal::RefMatcher<T&> Ref(T& x) { // NOLINT
- return internal::RefMatcher<T&>(x);
-}
-
-// Creates a matcher that matches any double argument approximately
-// equal to rhs, where two NANs are considered unequal.
-inline internal::FloatingEqMatcher<double> DoubleEq(double rhs) {
- return internal::FloatingEqMatcher<double>(rhs, false);
-}
-
-// Creates a matcher that matches any double argument approximately
-// equal to rhs, including NaN values when rhs is NaN.
-inline internal::FloatingEqMatcher<double> NanSensitiveDoubleEq(double rhs) {
- return internal::FloatingEqMatcher<double>(rhs, true);
-}
-
-// Creates a matcher that matches any float argument approximately
-// equal to rhs, where two NANs are considered unequal.
-inline internal::FloatingEqMatcher<float> FloatEq(float rhs) {
- return internal::FloatingEqMatcher<float>(rhs, false);
-}
-
-// Creates a matcher that matches any double argument approximately
-// equal to rhs, including NaN values when rhs is NaN.
-inline internal::FloatingEqMatcher<float> NanSensitiveFloatEq(float rhs) {
- return internal::FloatingEqMatcher<float>(rhs, true);
-}
-
-// Creates a matcher that matches a pointer (raw or smart) that points
-// to a value that matches inner_matcher.
-template <typename InnerMatcher>
-inline internal::PointeeMatcher<InnerMatcher> Pointee(
- const InnerMatcher& inner_matcher) {
- return internal::PointeeMatcher<InnerMatcher>(inner_matcher);
-}
-
-// Creates a matcher that matches an object whose given field matches
-// 'matcher'. For example,
-// Field(&Foo::number, Ge(5))
-// matches a Foo object x iff x.number >= 5.
-template <typename Class, typename FieldType, typename FieldMatcher>
-inline PolymorphicMatcher<
- internal::FieldMatcher<Class, FieldType> > Field(
- FieldType Class::*field, const FieldMatcher& matcher) {
- return MakePolymorphicMatcher(
- internal::FieldMatcher<Class, FieldType>(
- field, MatcherCast<const FieldType&>(matcher)));
- // The call to MatcherCast() is required for supporting inner
- // matchers of compatible types. For example, it allows
- // Field(&Foo::bar, m)
- // to compile where bar is an int32 and m is a matcher for int64.
-}
-
-// Creates a matcher that matches an object whose given property
-// matches 'matcher'. For example,
-// Property(&Foo::str, StartsWith("hi"))
-// matches a Foo object x iff x.str() starts with "hi".
-template <typename Class, typename PropertyType, typename PropertyMatcher>
-inline PolymorphicMatcher<
- internal::PropertyMatcher<Class, PropertyType> > Property(
- PropertyType (Class::*property)() const, const PropertyMatcher& matcher) {
- return MakePolymorphicMatcher(
- internal::PropertyMatcher<Class, PropertyType>(
- property,
- MatcherCast<GTEST_REFERENCE_TO_CONST_(PropertyType)>(matcher)));
- // The call to MatcherCast() is required for supporting inner
- // matchers of compatible types. For example, it allows
- // Property(&Foo::bar, m)
- // to compile where bar() returns an int32 and m is a matcher for int64.
-}
-
-// Creates a matcher that matches an object iff the result of applying
-// a callable to x matches 'matcher'.
-// For example,
-// ResultOf(f, StartsWith("hi"))
-// matches a Foo object x iff f(x) starts with "hi".
-// callable parameter can be a function, function pointer, or a functor.
-// Callable has to satisfy the following conditions:
-// * It is required to keep no state affecting the results of
-// the calls on it and make no assumptions about how many calls
-// will be made. Any state it keeps must be protected from the
-// concurrent access.
-// * If it is a function object, it has to define type result_type.
-// We recommend deriving your functor classes from std::unary_function.
-template <typename Callable, typename ResultOfMatcher>
-internal::ResultOfMatcher<Callable> ResultOf(
- Callable callable, const ResultOfMatcher& matcher) {
- return internal::ResultOfMatcher<Callable>(
- callable,
- MatcherCast<typename internal::CallableTraits<Callable>::ResultType>(
- matcher));
- // The call to MatcherCast() is required for supporting inner
- // matchers of compatible types. For example, it allows
- // ResultOf(Function, m)
- // to compile where Function() returns an int32 and m is a matcher for int64.
-}
-
-// String matchers.
-
-// Matches a string equal to str.
-inline PolymorphicMatcher<internal::StrEqualityMatcher<internal::string> >
- StrEq(const internal::string& str) {
- return MakePolymorphicMatcher(internal::StrEqualityMatcher<internal::string>(
- str, true, true));
-}
-
-// Matches a string not equal to str.
-inline PolymorphicMatcher<internal::StrEqualityMatcher<internal::string> >
- StrNe(const internal::string& str) {
- return MakePolymorphicMatcher(internal::StrEqualityMatcher<internal::string>(
- str, false, true));
-}
-
-// Matches a string equal to str, ignoring case.
-inline PolymorphicMatcher<internal::StrEqualityMatcher<internal::string> >
- StrCaseEq(const internal::string& str) {
- return MakePolymorphicMatcher(internal::StrEqualityMatcher<internal::string>(
- str, true, false));
-}
-
-// Matches a string not equal to str, ignoring case.
-inline PolymorphicMatcher<internal::StrEqualityMatcher<internal::string> >
- StrCaseNe(const internal::string& str) {
- return MakePolymorphicMatcher(internal::StrEqualityMatcher<internal::string>(
- str, false, false));
-}
-
-// Creates a matcher that matches any string, std::string, or C string
-// that contains the given substring.
-inline PolymorphicMatcher<internal::HasSubstrMatcher<internal::string> >
- HasSubstr(const internal::string& substring) {
- return MakePolymorphicMatcher(internal::HasSubstrMatcher<internal::string>(
- substring));
-}
-
-// Matches a string that starts with 'prefix' (case-sensitive).
-inline PolymorphicMatcher<internal::StartsWithMatcher<internal::string> >
- StartsWith(const internal::string& prefix) {
- return MakePolymorphicMatcher(internal::StartsWithMatcher<internal::string>(
- prefix));
-}
-
-// Matches a string that ends with 'suffix' (case-sensitive).
-inline PolymorphicMatcher<internal::EndsWithMatcher<internal::string> >
- EndsWith(const internal::string& suffix) {
- return MakePolymorphicMatcher(internal::EndsWithMatcher<internal::string>(
- suffix));
-}
-
-// Matches a string that fully matches regular expression 'regex'.
-// The matcher takes ownership of 'regex'.
-inline PolymorphicMatcher<internal::MatchesRegexMatcher> MatchesRegex(
- const internal::RE* regex) {
- return MakePolymorphicMatcher(internal::MatchesRegexMatcher(regex, true));
-}
-inline PolymorphicMatcher<internal::MatchesRegexMatcher> MatchesRegex(
- const internal::string& regex) {
- return MatchesRegex(new internal::RE(regex));
-}
-
-// Matches a string that contains regular expression 'regex'.
-// The matcher takes ownership of 'regex'.
-inline PolymorphicMatcher<internal::MatchesRegexMatcher> ContainsRegex(
- const internal::RE* regex) {
- return MakePolymorphicMatcher(internal::MatchesRegexMatcher(regex, false));
-}
-inline PolymorphicMatcher<internal::MatchesRegexMatcher> ContainsRegex(
- const internal::string& regex) {
- return ContainsRegex(new internal::RE(regex));
-}
-
-#if GTEST_HAS_GLOBAL_WSTRING || GTEST_HAS_STD_WSTRING
-// Wide string matchers.
-
-// Matches a string equal to str.
-inline PolymorphicMatcher<internal::StrEqualityMatcher<internal::wstring> >
- StrEq(const internal::wstring& str) {
- return MakePolymorphicMatcher(internal::StrEqualityMatcher<internal::wstring>(
- str, true, true));
-}
-
-// Matches a string not equal to str.
-inline PolymorphicMatcher<internal::StrEqualityMatcher<internal::wstring> >
- StrNe(const internal::wstring& str) {
- return MakePolymorphicMatcher(internal::StrEqualityMatcher<internal::wstring>(
- str, false, true));
-}
-
-// Matches a string equal to str, ignoring case.
-inline PolymorphicMatcher<internal::StrEqualityMatcher<internal::wstring> >
- StrCaseEq(const internal::wstring& str) {
- return MakePolymorphicMatcher(internal::StrEqualityMatcher<internal::wstring>(
- str, true, false));
-}
-
-// Matches a string not equal to str, ignoring case.
-inline PolymorphicMatcher<internal::StrEqualityMatcher<internal::wstring> >
- StrCaseNe(const internal::wstring& str) {
- return MakePolymorphicMatcher(internal::StrEqualityMatcher<internal::wstring>(
- str, false, false));
-}
-
-// Creates a matcher that matches any wstring, std::wstring, or C wide string
-// that contains the given substring.
-inline PolymorphicMatcher<internal::HasSubstrMatcher<internal::wstring> >
- HasSubstr(const internal::wstring& substring) {
- return MakePolymorphicMatcher(internal::HasSubstrMatcher<internal::wstring>(
- substring));
-}
-
-// Matches a string that starts with 'prefix' (case-sensitive).
-inline PolymorphicMatcher<internal::StartsWithMatcher<internal::wstring> >
- StartsWith(const internal::wstring& prefix) {
- return MakePolymorphicMatcher(internal::StartsWithMatcher<internal::wstring>(
- prefix));
-}
-
-// Matches a string that ends with 'suffix' (case-sensitive).
-inline PolymorphicMatcher<internal::EndsWithMatcher<internal::wstring> >
- EndsWith(const internal::wstring& suffix) {
- return MakePolymorphicMatcher(internal::EndsWithMatcher<internal::wstring>(
- suffix));
-}
-
-#endif // GTEST_HAS_GLOBAL_WSTRING || GTEST_HAS_STD_WSTRING
-
-// Creates a polymorphic matcher that matches a 2-tuple where the
-// first field == the second field.
-inline internal::Eq2Matcher Eq() { return internal::Eq2Matcher(); }
-
-// Creates a polymorphic matcher that matches a 2-tuple where the
-// first field >= the second field.
-inline internal::Ge2Matcher Ge() { return internal::Ge2Matcher(); }
-
-// Creates a polymorphic matcher that matches a 2-tuple where the
-// first field > the second field.
-inline internal::Gt2Matcher Gt() { return internal::Gt2Matcher(); }
-
-// Creates a polymorphic matcher that matches a 2-tuple where the
-// first field <= the second field.
-inline internal::Le2Matcher Le() { return internal::Le2Matcher(); }
-
-// Creates a polymorphic matcher that matches a 2-tuple where the
-// first field < the second field.
-inline internal::Lt2Matcher Lt() { return internal::Lt2Matcher(); }
-
-// Creates a polymorphic matcher that matches a 2-tuple where the
-// first field != the second field.
-inline internal::Ne2Matcher Ne() { return internal::Ne2Matcher(); }
-
-// Creates a matcher that matches any value of type T that m doesn't
-// match.
-template <typename InnerMatcher>
-inline internal::NotMatcher<InnerMatcher> Not(InnerMatcher m) {
- return internal::NotMatcher<InnerMatcher>(m);
-}
-
-// Returns a matcher that matches anything that satisfies the given
-// predicate. The predicate can be any unary function or functor
-// whose return type can be implicitly converted to bool.
-template <typename Predicate>
-inline PolymorphicMatcher<internal::TrulyMatcher<Predicate> >
-Truly(Predicate pred) {
- return MakePolymorphicMatcher(internal::TrulyMatcher<Predicate>(pred));
-}
-
-// Returns a matcher that matches an equal container.
-// This matcher behaves like Eq(), but in the event of mismatch lists the
-// values that are included in one container but not the other. (Duplicate
-// values and order differences are not explained.)
-template <typename Container>
-inline PolymorphicMatcher<internal::ContainerEqMatcher< // NOLINT
- GTEST_REMOVE_CONST_(Container)> >
- ContainerEq(const Container& rhs) {
- // This following line is for working around a bug in MSVC 8.0,
- // which causes Container to be a const type sometimes.
- typedef GTEST_REMOVE_CONST_(Container) RawContainer;
- return MakePolymorphicMatcher(
- internal::ContainerEqMatcher<RawContainer>(rhs));
-}
-
-// Returns a matcher that matches a container that, when sorted using
-// the given comparator, matches container_matcher.
-template <typename Comparator, typename ContainerMatcher>
-inline internal::WhenSortedByMatcher<Comparator, ContainerMatcher>
-WhenSortedBy(const Comparator& comparator,
- const ContainerMatcher& container_matcher) {
- return internal::WhenSortedByMatcher<Comparator, ContainerMatcher>(
- comparator, container_matcher);
-}
-
-// Returns a matcher that matches a container that, when sorted using
-// the < operator, matches container_matcher.
-template <typename ContainerMatcher>
-inline internal::WhenSortedByMatcher<internal::LessComparator, ContainerMatcher>
-WhenSorted(const ContainerMatcher& container_matcher) {
- return
- internal::WhenSortedByMatcher<internal::LessComparator, ContainerMatcher>(
- internal::LessComparator(), container_matcher);
-}
-
-// Matches an STL-style container or a native array that contains the
-// same number of elements as in rhs, where its i-th element and rhs's
-// i-th element (as a pair) satisfy the given pair matcher, for all i.
-// TupleMatcher must be able to be safely cast to Matcher<tuple<const
-// T1&, const T2&> >, where T1 and T2 are the types of elements in the
-// LHS container and the RHS container respectively.
-template <typename TupleMatcher, typename Container>
-inline internal::PointwiseMatcher<TupleMatcher,
- GTEST_REMOVE_CONST_(Container)>
-Pointwise(const TupleMatcher& tuple_matcher, const Container& rhs) {
- // This following line is for working around a bug in MSVC 8.0,
- // which causes Container to be a const type sometimes.
- typedef GTEST_REMOVE_CONST_(Container) RawContainer;
- return internal::PointwiseMatcher<TupleMatcher, RawContainer>(
- tuple_matcher, rhs);
-}
-
-// Matches an STL-style container or a native array that contains at
-// least one element matching the given value or matcher.
-//
-// Examples:
-// ::std::set<int> page_ids;
-// page_ids.insert(3);
-// page_ids.insert(1);
-// EXPECT_THAT(page_ids, Contains(1));
-// EXPECT_THAT(page_ids, Contains(Gt(2)));
-// EXPECT_THAT(page_ids, Not(Contains(4)));
-//
-// ::std::map<int, size_t> page_lengths;
-// page_lengths[1] = 100;
-// EXPECT_THAT(page_lengths,
-// Contains(::std::pair<const int, size_t>(1, 100)));
-//
-// const char* user_ids[] = { "joe", "mike", "tom" };
-// EXPECT_THAT(user_ids, Contains(Eq(::std::string("tom"))));
-template <typename M>
-inline internal::ContainsMatcher<M> Contains(M matcher) {
- return internal::ContainsMatcher<M>(matcher);
-}
-
-// Matches an STL-style container or a native array that contains only
-// elements matching the given value or matcher.
-//
-// Each(m) is semantically equivalent to Not(Contains(Not(m))). Only
-// the messages are different.
-//
-// Examples:
-// ::std::set<int> page_ids;
-// // Each(m) matches an empty container, regardless of what m is.
-// EXPECT_THAT(page_ids, Each(Eq(1)));
-// EXPECT_THAT(page_ids, Each(Eq(77)));
-//
-// page_ids.insert(3);
-// EXPECT_THAT(page_ids, Each(Gt(0)));
-// EXPECT_THAT(page_ids, Not(Each(Gt(4))));
-// page_ids.insert(1);
-// EXPECT_THAT(page_ids, Not(Each(Lt(2))));
-//
-// ::std::map<int, size_t> page_lengths;
-// page_lengths[1] = 100;
-// page_lengths[2] = 200;
-// page_lengths[3] = 300;
-// EXPECT_THAT(page_lengths, Not(Each(Pair(1, 100))));
-// EXPECT_THAT(page_lengths, Each(Key(Le(3))));
-//
-// const char* user_ids[] = { "joe", "mike", "tom" };
-// EXPECT_THAT(user_ids, Not(Each(Eq(::std::string("tom")))));
-template <typename M>
-inline internal::EachMatcher<M> Each(M matcher) {
- return internal::EachMatcher<M>(matcher);
-}
-
-// Key(inner_matcher) matches an std::pair whose 'first' field matches
-// inner_matcher. For example, Contains(Key(Ge(5))) can be used to match an
-// std::map that contains at least one element whose key is >= 5.
-template <typename M>
-inline internal::KeyMatcher<M> Key(M inner_matcher) {
- return internal::KeyMatcher<M>(inner_matcher);
-}
-
-// Pair(first_matcher, second_matcher) matches a std::pair whose 'first' field
-// matches first_matcher and whose 'second' field matches second_matcher. For
-// example, EXPECT_THAT(map_type, ElementsAre(Pair(Ge(5), "foo"))) can be used
-// to match a std::map<int, string> that contains exactly one element whose key
-// is >= 5 and whose value equals "foo".
-template <typename FirstMatcher, typename SecondMatcher>
-inline internal::PairMatcher<FirstMatcher, SecondMatcher>
-Pair(FirstMatcher first_matcher, SecondMatcher second_matcher) {
- return internal::PairMatcher<FirstMatcher, SecondMatcher>(
- first_matcher, second_matcher);
-}
-
-// Returns a predicate that is satisfied by anything that matches the
-// given matcher.
-template <typename M>
-inline internal::MatcherAsPredicate<M> Matches(M matcher) {
- return internal::MatcherAsPredicate<M>(matcher);
-}
-
-// Returns true iff the value matches the matcher.
-template <typename T, typename M>
-inline bool Value(const T& value, M matcher) {
- return testing::Matches(matcher)(value);
-}
-
-// Matches the value against the given matcher and explains the match
-// result to listener.
-template <typename T, typename M>
-inline bool ExplainMatchResult(
- M matcher, const T& value, MatchResultListener* listener) {
- return SafeMatcherCast<const T&>(matcher).MatchAndExplain(value, listener);
-}
-
-// AllArgs(m) is a synonym of m. This is useful in
-//
-// EXPECT_CALL(foo, Bar(_, _)).With(AllArgs(Eq()));
-//
-// which is easier to read than
-//
-// EXPECT_CALL(foo, Bar(_, _)).With(Eq());
-template <typename InnerMatcher>
-inline InnerMatcher AllArgs(const InnerMatcher& matcher) { return matcher; }
-
-// These macros allow using matchers to check values in Google Test
-// tests. ASSERT_THAT(value, matcher) and EXPECT_THAT(value, matcher)
-// succeed iff the value matches the matcher. If the assertion fails,
-// the value and the description of the matcher will be printed.
-#define ASSERT_THAT(value, matcher) ASSERT_PRED_FORMAT1(\
- ::testing::internal::MakePredicateFormatterFromMatcher(matcher), value)
-#define EXPECT_THAT(value, matcher) EXPECT_PRED_FORMAT1(\
- ::testing::internal::MakePredicateFormatterFromMatcher(matcher), value)
-
-} // namespace testing
-
-#endif // GMOCK_INCLUDE_GMOCK_GMOCK_MATCHERS_H_
diff --git a/src/testing/include/gmock/gmock-more-actions.h b/src/testing/include/gmock/gmock-more-actions.h
deleted file mode 100644
index fc5e5ca8..00000000
--- a/src/testing/include/gmock/gmock-more-actions.h
+++ /dev/null
@@ -1,233 +0,0 @@
-// Copyright 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-// Google Mock - a framework for writing C++ mock classes.
-//
-// This file implements some actions that depend on gmock-generated-actions.h.
-
-#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_MORE_ACTIONS_H_
-#define GMOCK_INCLUDE_GMOCK_GMOCK_MORE_ACTIONS_H_
-
-#include <algorithm>
-
-#include "gmock/gmock-generated-actions.h"
-
-namespace testing {
-namespace internal {
-
-// Implements the Invoke(f) action. The template argument
-// FunctionImpl is the implementation type of f, which can be either a
-// function pointer or a functor. Invoke(f) can be used as an
-// Action<F> as long as f's type is compatible with F (i.e. f can be
-// assigned to a tr1::function<F>).
-template <typename FunctionImpl>
-class InvokeAction {
- public:
- // The c'tor makes a copy of function_impl (either a function
- // pointer or a functor).
- explicit InvokeAction(FunctionImpl function_impl)
- : function_impl_(function_impl) {}
-
- template <typename Result, typename ArgumentTuple>
- Result Perform(const ArgumentTuple& args) {
- return InvokeHelper<Result, ArgumentTuple>::Invoke(function_impl_, args);
- }
-
- private:
- FunctionImpl function_impl_;
-
- GTEST_DISALLOW_ASSIGN_(InvokeAction);
-};
-
-// Implements the Invoke(object_ptr, &Class::Method) action.
-template <class Class, typename MethodPtr>
-class InvokeMethodAction {
- public:
- InvokeMethodAction(Class* obj_ptr, MethodPtr method_ptr)
- : obj_ptr_(obj_ptr), method_ptr_(method_ptr) {}
-
- template <typename Result, typename ArgumentTuple>
- Result Perform(const ArgumentTuple& args) const {
- return InvokeHelper<Result, ArgumentTuple>::InvokeMethod(
- obj_ptr_, method_ptr_, args);
- }
-
- private:
- Class* const obj_ptr_;
- const MethodPtr method_ptr_;
-
- GTEST_DISALLOW_ASSIGN_(InvokeMethodAction);
-};
-
-} // namespace internal
-
-// Various overloads for Invoke().
-
-// Creates an action that invokes 'function_impl' with the mock
-// function's arguments.
-template <typename FunctionImpl>
-PolymorphicAction<internal::InvokeAction<FunctionImpl> > Invoke(
- FunctionImpl function_impl) {
- return MakePolymorphicAction(
- internal::InvokeAction<FunctionImpl>(function_impl));
-}
-
-// Creates an action that invokes the given method on the given object
-// with the mock function's arguments.
-template <class Class, typename MethodPtr>
-PolymorphicAction<internal::InvokeMethodAction<Class, MethodPtr> > Invoke(
- Class* obj_ptr, MethodPtr method_ptr) {
- return MakePolymorphicAction(
- internal::InvokeMethodAction<Class, MethodPtr>(obj_ptr, method_ptr));
-}
-
-// WithoutArgs(inner_action) can be used in a mock function with a
-// non-empty argument list to perform inner_action, which takes no
-// argument. In other words, it adapts an action accepting no
-// argument to one that accepts (and ignores) arguments.
-template <typename InnerAction>
-inline internal::WithArgsAction<InnerAction>
-WithoutArgs(const InnerAction& action) {
- return internal::WithArgsAction<InnerAction>(action);
-}
-
-// WithArg<k>(an_action) creates an action that passes the k-th
-// (0-based) argument of the mock function to an_action and performs
-// it. It adapts an action accepting one argument to one that accepts
-// multiple arguments. For convenience, we also provide
-// WithArgs<k>(an_action) (defined below) as a synonym.
-template <int k, typename InnerAction>
-inline internal::WithArgsAction<InnerAction, k>
-WithArg(const InnerAction& action) {
- return internal::WithArgsAction<InnerAction, k>(action);
-}
-
-// The ACTION*() macros trigger warning C4100 (unreferenced formal
-// parameter) in MSVC with -W4. Unfortunately they cannot be fixed in
-// the macro definition, as the warnings are generated when the macro
-// is expanded and macro expansion cannot contain #pragma. Therefore
-// we suppress them here.
-#ifdef _MSC_VER
-# pragma warning(push)
-# pragma warning(disable:4100)
-#endif
-
-// Action ReturnArg<k>() returns the k-th argument of the mock function.
-ACTION_TEMPLATE(ReturnArg,
- HAS_1_TEMPLATE_PARAMS(int, k),
- AND_0_VALUE_PARAMS()) {
- return std::tr1::get<k>(args);
-}
-
-// Action SaveArg<k>(pointer) saves the k-th (0-based) argument of the
-// mock function to *pointer.
-ACTION_TEMPLATE(SaveArg,
- HAS_1_TEMPLATE_PARAMS(int, k),
- AND_1_VALUE_PARAMS(pointer)) {
- *pointer = ::std::tr1::get<k>(args);
-}
-
-// Action SaveArgPointee<k>(pointer) saves the value pointed to
-// by the k-th (0-based) argument of the mock function to *pointer.
-ACTION_TEMPLATE(SaveArgPointee,
- HAS_1_TEMPLATE_PARAMS(int, k),
- AND_1_VALUE_PARAMS(pointer)) {
- *pointer = *::std::tr1::get<k>(args);
-}
-
-// Action SetArgReferee<k>(value) assigns 'value' to the variable
-// referenced by the k-th (0-based) argument of the mock function.
-ACTION_TEMPLATE(SetArgReferee,
- HAS_1_TEMPLATE_PARAMS(int, k),
- AND_1_VALUE_PARAMS(value)) {
- typedef typename ::std::tr1::tuple_element<k, args_type>::type argk_type;
- // Ensures that argument #k is a reference. If you get a compiler
- // error on the next line, you are using SetArgReferee<k>(value) in
- // a mock function whose k-th (0-based) argument is not a reference.
- GTEST_COMPILE_ASSERT_(internal::is_reference<argk_type>::value,
- SetArgReferee_must_be_used_with_a_reference_argument);
- ::std::tr1::get<k>(args) = value;
-}
-
-// Action SetArrayArgument<k>(first, last) copies the elements in
-// source range [first, last) to the array pointed to by the k-th
-// (0-based) argument, which can be either a pointer or an
-// iterator. The action does not take ownership of the elements in the
-// source range.
-ACTION_TEMPLATE(SetArrayArgument,
- HAS_1_TEMPLATE_PARAMS(int, k),
- AND_2_VALUE_PARAMS(first, last)) {
- // Microsoft compiler deprecates ::std::copy, so we want to suppress warning
- // 4996 (Function call with parameters that may be unsafe) there.
-#ifdef _MSC_VER
-# pragma warning(push) // Saves the current warning state.
-# pragma warning(disable:4996) // Temporarily disables warning 4996.
-#endif
- ::std::copy(first, last, ::std::tr1::get<k>(args));
-#ifdef _MSC_VER
-# pragma warning(pop) // Restores the warning state.
-#endif
-}
-
-// Action DeleteArg<k>() deletes the k-th (0-based) argument of the mock
-// function.
-ACTION_TEMPLATE(DeleteArg,
- HAS_1_TEMPLATE_PARAMS(int, k),
- AND_0_VALUE_PARAMS()) {
- delete ::std::tr1::get<k>(args);
-}
-
-// This action returns the value pointed to by 'pointer'.
-ACTION_P(ReturnPointee, pointer) { return *pointer; }
-
-// Action Throw(exception) can be used in a mock function of any type
-// to throw the given exception. Any copyable value can be thrown.
-#if GTEST_HAS_EXCEPTIONS
-
-// Suppresses the 'unreachable code' warning that VC generates in opt modes.
-# ifdef _MSC_VER
-# pragma warning(push) // Saves the current warning state.
-# pragma warning(disable:4702) // Temporarily disables warning 4702.
-# endif
-ACTION_P(Throw, exception) { throw exception; }
-# ifdef _MSC_VER
-# pragma warning(pop) // Restores the warning state.
-# endif
-
-#endif // GTEST_HAS_EXCEPTIONS
-
-#ifdef _MSC_VER
-# pragma warning(pop)
-#endif
-
-} // namespace testing
-
-#endif // GMOCK_INCLUDE_GMOCK_GMOCK_MORE_ACTIONS_H_
diff --git a/src/testing/include/gmock/gmock-spec-builders.h b/src/testing/include/gmock/gmock-spec-builders.h
deleted file mode 100644
index c677333c..00000000
--- a/src/testing/include/gmock/gmock-spec-builders.h
+++ /dev/null
@@ -1,1774 +0,0 @@
-// Copyright 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-// Google Mock - a framework for writing C++ mock classes.
-//
-// This file implements the ON_CALL() and EXPECT_CALL() macros.
-//
-// A user can use the ON_CALL() macro to specify the default action of
-// a mock method. The syntax is:
-//
-// ON_CALL(mock_object, Method(argument-matchers))
-// .With(multi-argument-matcher)
-// .WillByDefault(action);
-//
-// where the .With() clause is optional.
-//
-// A user can use the EXPECT_CALL() macro to specify an expectation on
-// a mock method. The syntax is:
-//
-// EXPECT_CALL(mock_object, Method(argument-matchers))
-// .With(multi-argument-matchers)
-// .Times(cardinality)
-// .InSequence(sequences)
-// .After(expectations)
-// .WillOnce(action)
-// .WillRepeatedly(action)
-// .RetiresOnSaturation();
-//
-// where all clauses are optional, and .InSequence()/.After()/
-// .WillOnce() can appear any number of times.
-
-#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_SPEC_BUILDERS_H_
-#define GMOCK_INCLUDE_GMOCK_GMOCK_SPEC_BUILDERS_H_
-
-#include <map>
-#include <set>
-#include <sstream>
-#include <string>
-#include <vector>
-
-#include "gmock/gmock-actions.h"
-#include "gmock/gmock-cardinalities.h"
-#include "gmock/gmock-matchers.h"
-#include "gmock/internal/gmock-internal-utils.h"
-#include "gmock/internal/gmock-port.h"
-#include "gtest/gtest.h"
-
-namespace testing {
-
-// An abstract handle of an expectation.
-class Expectation;
-
-// A set of expectation handles.
-class ExpectationSet;
-
-// Anything inside the 'internal' namespace IS INTERNAL IMPLEMENTATION
-// and MUST NOT BE USED IN USER CODE!!!
-namespace internal {
-
-// Implements a mock function.
-template <typename F> class FunctionMocker;
-
-// Base class for expectations.
-class ExpectationBase;
-
-// Implements an expectation.
-template <typename F> class TypedExpectation;
-
-// Helper class for testing the Expectation class template.
-class ExpectationTester;
-
-// Base class for function mockers.
-template <typename F> class FunctionMockerBase;
-
-// Protects the mock object registry (in class Mock), all function
-// mockers, and all expectations.
-//
-// The reason we don't use more fine-grained protection is: when a
-// mock function Foo() is called, it needs to consult its expectations
-// to see which one should be picked. If another thread is allowed to
-// call a mock function (either Foo() or a different one) at the same
-// time, it could affect the "retired" attributes of Foo()'s
-// expectations when InSequence() is used, and thus affect which
-// expectation gets picked. Therefore, we sequence all mock function
-// calls to ensure the integrity of the mock objects' states.
-GTEST_API_ GTEST_DECLARE_STATIC_MUTEX_(g_gmock_mutex);
-
-// Untyped base class for ActionResultHolder<R>.
-class UntypedActionResultHolderBase;
-
-// Abstract base class of FunctionMockerBase. This is the
-// type-agnostic part of the function mocker interface. Its pure
-// virtual methods are implemented by FunctionMockerBase.
-class GTEST_API_ UntypedFunctionMockerBase {
- public:
- UntypedFunctionMockerBase();
- virtual ~UntypedFunctionMockerBase();
-
- // Verifies that all expectations on this mock function have been
- // satisfied. Reports one or more Google Test non-fatal failures
- // and returns false if not.
- bool VerifyAndClearExpectationsLocked()
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex);
-
- // Clears the ON_CALL()s set on this mock function.
- virtual void ClearDefaultActionsLocked()
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) = 0;
-
- // In all of the following Untyped* functions, it's the caller's
- // responsibility to guarantee the correctness of the arguments'
- // types.
-
- // Performs the default action with the given arguments and returns
- // the action's result. The call description string will be used in
- // the error message to describe the call in the case the default
- // action fails.
- // L = *
- virtual UntypedActionResultHolderBase* UntypedPerformDefaultAction(
- const void* untyped_args,
- const string& call_description) const = 0;
-
- // Performs the given action with the given arguments and returns
- // the action's result.
- // L = *
- virtual UntypedActionResultHolderBase* UntypedPerformAction(
- const void* untyped_action,
- const void* untyped_args) const = 0;
-
- // Writes a message that the call is uninteresting (i.e. neither
- // explicitly expected nor explicitly unexpected) to the given
- // ostream.
- virtual void UntypedDescribeUninterestingCall(
- const void* untyped_args,
- ::std::ostream* os) const
- GTEST_LOCK_EXCLUDED_(g_gmock_mutex) = 0;
-
- // Returns the expectation that matches the given function arguments
- // (or NULL is there's no match); when a match is found,
- // untyped_action is set to point to the action that should be
- // performed (or NULL if the action is "do default"), and
- // is_excessive is modified to indicate whether the call exceeds the
- // expected number.
- virtual const ExpectationBase* UntypedFindMatchingExpectation(
- const void* untyped_args,
- const void** untyped_action, bool* is_excessive,
- ::std::ostream* what, ::std::ostream* why)
- GTEST_LOCK_EXCLUDED_(g_gmock_mutex) = 0;
-
- // Prints the given function arguments to the ostream.
- virtual void UntypedPrintArgs(const void* untyped_args,
- ::std::ostream* os) const = 0;
-
- // Sets the mock object this mock method belongs to, and registers
- // this information in the global mock registry. Will be called
- // whenever an EXPECT_CALL() or ON_CALL() is executed on this mock
- // method.
- // TODO(wan@google.com): rename to SetAndRegisterOwner().
- void RegisterOwner(const void* mock_obj)
- GTEST_LOCK_EXCLUDED_(g_gmock_mutex);
-
- // Sets the mock object this mock method belongs to, and sets the
- // name of the mock function. Will be called upon each invocation
- // of this mock function.
- void SetOwnerAndName(const void* mock_obj, const char* name)
- GTEST_LOCK_EXCLUDED_(g_gmock_mutex);
-
- // Returns the mock object this mock method belongs to. Must be
- // called after RegisterOwner() or SetOwnerAndName() has been
- // called.
- const void* MockObject() const
- GTEST_LOCK_EXCLUDED_(g_gmock_mutex);
-
- // Returns the name of this mock method. Must be called after
- // SetOwnerAndName() has been called.
- const char* Name() const
- GTEST_LOCK_EXCLUDED_(g_gmock_mutex);
-
- // Returns the result of invoking this mock function with the given
- // arguments. This function can be safely called from multiple
- // threads concurrently. The caller is responsible for deleting the
- // result.
- const UntypedActionResultHolderBase* UntypedInvokeWith(
- const void* untyped_args)
- GTEST_LOCK_EXCLUDED_(g_gmock_mutex);
-
- protected:
- typedef std::vector<const void*> UntypedOnCallSpecs;
-
- typedef std::vector<internal::linked_ptr<ExpectationBase> >
- UntypedExpectations;
-
- // Returns an Expectation object that references and co-owns exp,
- // which must be an expectation on this mock function.
- Expectation GetHandleOf(ExpectationBase* exp);
-
- // Address of the mock object this mock method belongs to. Only
- // valid after this mock method has been called or
- // ON_CALL/EXPECT_CALL has been invoked on it.
- const void* mock_obj_; // Protected by g_gmock_mutex.
-
- // Name of the function being mocked. Only valid after this mock
- // method has been called.
- const char* name_; // Protected by g_gmock_mutex.
-
- // All default action specs for this function mocker.
- UntypedOnCallSpecs untyped_on_call_specs_;
-
- // All expectations for this function mocker.
- UntypedExpectations untyped_expectations_;
-}; // class UntypedFunctionMockerBase
-
-// Untyped base class for OnCallSpec<F>.
-class UntypedOnCallSpecBase {
- public:
- // The arguments are the location of the ON_CALL() statement.
- UntypedOnCallSpecBase(const char* a_file, int a_line)
- : file_(a_file), line_(a_line), last_clause_(kNone) {}
-
- // Where in the source file was the default action spec defined?
- const char* file() const { return file_; }
- int line() const { return line_; }
-
- protected:
- // Gives each clause in the ON_CALL() statement a name.
- enum Clause {
- // Do not change the order of the enum members! The run-time
- // syntax checking relies on it.
- kNone,
- kWith,
- kWillByDefault
- };
-
- // Asserts that the ON_CALL() statement has a certain property.
- void AssertSpecProperty(bool property, const string& failure_message) const {
- Assert(property, file_, line_, failure_message);
- }
-
- // Expects that the ON_CALL() statement has a certain property.
- void ExpectSpecProperty(bool property, const string& failure_message) const {
- Expect(property, file_, line_, failure_message);
- }
-
- const char* file_;
- int line_;
-
- // The last clause in the ON_CALL() statement as seen so far.
- // Initially kNone and changes as the statement is parsed.
- Clause last_clause_;
-}; // class UntypedOnCallSpecBase
-
-// This template class implements an ON_CALL spec.
-template <typename F>
-class OnCallSpec : public UntypedOnCallSpecBase {
- public:
- typedef typename Function<F>::ArgumentTuple ArgumentTuple;
- typedef typename Function<F>::ArgumentMatcherTuple ArgumentMatcherTuple;
-
- // Constructs an OnCallSpec object from the information inside
- // the parenthesis of an ON_CALL() statement.
- OnCallSpec(const char* a_file, int a_line,
- const ArgumentMatcherTuple& matchers)
- : UntypedOnCallSpecBase(a_file, a_line),
- matchers_(matchers),
- // By default, extra_matcher_ should match anything. However,
- // we cannot initialize it with _ as that triggers a compiler
- // bug in Symbian's C++ compiler (cannot decide between two
- // overloaded constructors of Matcher<const ArgumentTuple&>).
- extra_matcher_(A<const ArgumentTuple&>()) {
- }
-
- // Implements the .With() clause.
- OnCallSpec& With(const Matcher<const ArgumentTuple&>& m) {
- // Makes sure this is called at most once.
- ExpectSpecProperty(last_clause_ < kWith,
- ".With() cannot appear "
- "more than once in an ON_CALL().");
- last_clause_ = kWith;
-
- extra_matcher_ = m;
- return *this;
- }
-
- // Implements the .WillByDefault() clause.
- OnCallSpec& WillByDefault(const Action<F>& action) {
- ExpectSpecProperty(last_clause_ < kWillByDefault,
- ".WillByDefault() must appear "
- "exactly once in an ON_CALL().");
- last_clause_ = kWillByDefault;
-
- ExpectSpecProperty(!action.IsDoDefault(),
- "DoDefault() cannot be used in ON_CALL().");
- action_ = action;
- return *this;
- }
-
- // Returns true iff the given arguments match the matchers.
- bool Matches(const ArgumentTuple& args) const {
- return TupleMatches(matchers_, args) && extra_matcher_.Matches(args);
- }
-
- // Returns the action specified by the user.
- const Action<F>& GetAction() const {
- AssertSpecProperty(last_clause_ == kWillByDefault,
- ".WillByDefault() must appear exactly "
- "once in an ON_CALL().");
- return action_;
- }
-
- private:
- // The information in statement
- //
- // ON_CALL(mock_object, Method(matchers))
- // .With(multi-argument-matcher)
- // .WillByDefault(action);
- //
- // is recorded in the data members like this:
- //
- // source file that contains the statement => file_
- // line number of the statement => line_
- // matchers => matchers_
- // multi-argument-matcher => extra_matcher_
- // action => action_
- ArgumentMatcherTuple matchers_;
- Matcher<const ArgumentTuple&> extra_matcher_;
- Action<F> action_;
-}; // class OnCallSpec
-
-// Possible reactions on uninteresting calls.
-enum CallReaction {
- kAllow,
- kWarn,
- kFail
-};
-
-} // namespace internal
-
-// Utilities for manipulating mock objects.
-class GTEST_API_ Mock {
- public:
- // The following public methods can be called concurrently.
-
- // Tells Google Mock to ignore mock_obj when checking for leaked
- // mock objects.
- static void AllowLeak(const void* mock_obj)
- GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex);
-
- // Verifies and clears all expectations on the given mock object.
- // If the expectations aren't satisfied, generates one or more
- // Google Test non-fatal failures and returns false.
- static bool VerifyAndClearExpectations(void* mock_obj)
- GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex);
-
- // Verifies all expectations on the given mock object and clears its
- // default actions and expectations. Returns true iff the
- // verification was successful.
- static bool VerifyAndClear(void* mock_obj)
- GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex);
-
- private:
- friend class internal::UntypedFunctionMockerBase;
-
- // Needed for a function mocker to register itself (so that we know
- // how to clear a mock object).
- template <typename F>
- friend class internal::FunctionMockerBase;
-
- template <typename M>
- friend class NiceMock;
-
- template <typename M>
- friend class StrictMock;
-
- // Tells Google Mock to allow uninteresting calls on the given mock
- // object.
- static void AllowUninterestingCalls(const void* mock_obj)
- GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex);
-
- // Tells Google Mock to warn the user about uninteresting calls on
- // the given mock object.
- static void WarnUninterestingCalls(const void* mock_obj)
- GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex);
-
- // Tells Google Mock to fail uninteresting calls on the given mock
- // object.
- static void FailUninterestingCalls(const void* mock_obj)
- GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex);
-
- // Tells Google Mock the given mock object is being destroyed and
- // its entry in the call-reaction table should be removed.
- static void UnregisterCallReaction(const void* mock_obj)
- GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex);
-
- // Returns the reaction Google Mock will have on uninteresting calls
- // made on the given mock object.
- static internal::CallReaction GetReactionOnUninterestingCalls(
- const void* mock_obj)
- GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex);
-
- // Verifies that all expectations on the given mock object have been
- // satisfied. Reports one or more Google Test non-fatal failures
- // and returns false if not.
- static bool VerifyAndClearExpectationsLocked(void* mock_obj)
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(internal::g_gmock_mutex);
-
- // Clears all ON_CALL()s set on the given mock object.
- static void ClearDefaultActionsLocked(void* mock_obj)
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(internal::g_gmock_mutex);
-
- // Registers a mock object and a mock method it owns.
- static void Register(
- const void* mock_obj,
- internal::UntypedFunctionMockerBase* mocker)
- GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex);
-
- // Tells Google Mock where in the source code mock_obj is used in an
- // ON_CALL or EXPECT_CALL. In case mock_obj is leaked, this
- // information helps the user identify which object it is.
- static void RegisterUseByOnCallOrExpectCall(
- const void* mock_obj, const char* file, int line)
- GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex);
-
- // Unregisters a mock method; removes the owning mock object from
- // the registry when the last mock method associated with it has
- // been unregistered. This is called only in the destructor of
- // FunctionMockerBase.
- static void UnregisterLocked(internal::UntypedFunctionMockerBase* mocker)
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(internal::g_gmock_mutex);
-}; // class Mock
-
-// An abstract handle of an expectation. Useful in the .After()
-// clause of EXPECT_CALL() for setting the (partial) order of
-// expectations. The syntax:
-//
-// Expectation e1 = EXPECT_CALL(...)...;
-// EXPECT_CALL(...).After(e1)...;
-//
-// sets two expectations where the latter can only be matched after
-// the former has been satisfied.
-//
-// Notes:
-// - This class is copyable and has value semantics.
-// - Constness is shallow: a const Expectation object itself cannot
-// be modified, but the mutable methods of the ExpectationBase
-// object it references can be called via expectation_base().
-// - The constructors and destructor are defined out-of-line because
-// the Symbian WINSCW compiler wants to otherwise instantiate them
-// when it sees this class definition, at which point it doesn't have
-// ExpectationBase available yet, leading to incorrect destruction
-// in the linked_ptr (or compilation errors if using a checking
-// linked_ptr).
-class GTEST_API_ Expectation {
- public:
- // Constructs a null object that doesn't reference any expectation.
- Expectation();
-
- ~Expectation();
-
- // This single-argument ctor must not be explicit, in order to support the
- // Expectation e = EXPECT_CALL(...);
- // syntax.
- //
- // A TypedExpectation object stores its pre-requisites as
- // Expectation objects, and needs to call the non-const Retire()
- // method on the ExpectationBase objects they reference. Therefore
- // Expectation must receive a *non-const* reference to the
- // ExpectationBase object.
- Expectation(internal::ExpectationBase& exp); // NOLINT
-
- // The compiler-generated copy ctor and operator= work exactly as
- // intended, so we don't need to define our own.
-
- // Returns true iff rhs references the same expectation as this object does.
- bool operator==(const Expectation& rhs) const {
- return expectation_base_ == rhs.expectation_base_;
- }
-
- bool operator!=(const Expectation& rhs) const { return !(*this == rhs); }
-
- private:
- friend class ExpectationSet;
- friend class Sequence;
- friend class ::testing::internal::ExpectationBase;
- friend class ::testing::internal::UntypedFunctionMockerBase;
-
- template <typename F>
- friend class ::testing::internal::FunctionMockerBase;
-
- template <typename F>
- friend class ::testing::internal::TypedExpectation;
-
- // This comparator is needed for putting Expectation objects into a set.
- class Less {
- public:
- bool operator()(const Expectation& lhs, const Expectation& rhs) const {
- return lhs.expectation_base_.get() < rhs.expectation_base_.get();
- }
- };
-
- typedef ::std::set<Expectation, Less> Set;
-
- Expectation(
- const internal::linked_ptr<internal::ExpectationBase>& expectation_base);
-
- // Returns the expectation this object references.
- const internal::linked_ptr<internal::ExpectationBase>&
- expectation_base() const {
- return expectation_base_;
- }
-
- // A linked_ptr that co-owns the expectation this handle references.
- internal::linked_ptr<internal::ExpectationBase> expectation_base_;
-};
-
-// A set of expectation handles. Useful in the .After() clause of
-// EXPECT_CALL() for setting the (partial) order of expectations. The
-// syntax:
-//
-// ExpectationSet es;
-// es += EXPECT_CALL(...)...;
-// es += EXPECT_CALL(...)...;
-// EXPECT_CALL(...).After(es)...;
-//
-// sets three expectations where the last one can only be matched
-// after the first two have both been satisfied.
-//
-// This class is copyable and has value semantics.
-class ExpectationSet {
- public:
- // A bidirectional iterator that can read a const element in the set.
- typedef Expectation::Set::const_iterator const_iterator;
-
- // An object stored in the set. This is an alias of Expectation.
- typedef Expectation::Set::value_type value_type;
-
- // Constructs an empty set.
- ExpectationSet() {}
-
- // This single-argument ctor must not be explicit, in order to support the
- // ExpectationSet es = EXPECT_CALL(...);
- // syntax.
- ExpectationSet(internal::ExpectationBase& exp) { // NOLINT
- *this += Expectation(exp);
- }
-
- // This single-argument ctor implements implicit conversion from
- // Expectation and thus must not be explicit. This allows either an
- // Expectation or an ExpectationSet to be used in .After().
- ExpectationSet(const Expectation& e) { // NOLINT
- *this += e;
- }
-
- // The compiler-generator ctor and operator= works exactly as
- // intended, so we don't need to define our own.
-
- // Returns true iff rhs contains the same set of Expectation objects
- // as this does.
- bool operator==(const ExpectationSet& rhs) const {
- return expectations_ == rhs.expectations_;
- }
-
- bool operator!=(const ExpectationSet& rhs) const { return !(*this == rhs); }
-
- // Implements the syntax
- // expectation_set += EXPECT_CALL(...);
- ExpectationSet& operator+=(const Expectation& e) {
- expectations_.insert(e);
- return *this;
- }
-
- int size() const { return static_cast<int>(expectations_.size()); }
-
- const_iterator begin() const { return expectations_.begin(); }
- const_iterator end() const { return expectations_.end(); }
-
- private:
- Expectation::Set expectations_;
-};
-
-
-// Sequence objects are used by a user to specify the relative order
-// in which the expectations should match. They are copyable (we rely
-// on the compiler-defined copy constructor and assignment operator).
-class GTEST_API_ Sequence {
- public:
- // Constructs an empty sequence.
- Sequence() : last_expectation_(new Expectation) {}
-
- // Adds an expectation to this sequence. The caller must ensure
- // that no other thread is accessing this Sequence object.
- void AddExpectation(const Expectation& expectation) const;
-
- private:
- // The last expectation in this sequence. We use a linked_ptr here
- // because Sequence objects are copyable and we want the copies to
- // be aliases. The linked_ptr allows the copies to co-own and share
- // the same Expectation object.
- internal::linked_ptr<Expectation> last_expectation_;
-}; // class Sequence
-
-// An object of this type causes all EXPECT_CALL() statements
-// encountered in its scope to be put in an anonymous sequence. The
-// work is done in the constructor and destructor. You should only
-// create an InSequence object on the stack.
-//
-// The sole purpose for this class is to support easy definition of
-// sequential expectations, e.g.
-//
-// {
-// InSequence dummy; // The name of the object doesn't matter.
-//
-// // The following expectations must match in the order they appear.
-// EXPECT_CALL(a, Bar())...;
-// EXPECT_CALL(a, Baz())...;
-// ...
-// EXPECT_CALL(b, Xyz())...;
-// }
-//
-// You can create InSequence objects in multiple threads, as long as
-// they are used to affect different mock objects. The idea is that
-// each thread can create and set up its own mocks as if it's the only
-// thread. However, for clarity of your tests we recommend you to set
-// up mocks in the main thread unless you have a good reason not to do
-// so.
-class GTEST_API_ InSequence {
- public:
- InSequence();
- ~InSequence();
- private:
- bool sequence_created_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(InSequence); // NOLINT
-} GTEST_ATTRIBUTE_UNUSED_;
-
-namespace internal {
-
-// Points to the implicit sequence introduced by a living InSequence
-// object (if any) in the current thread or NULL.
-GTEST_API_ extern ThreadLocal<Sequence*> g_gmock_implicit_sequence;
-
-// Base class for implementing expectations.
-//
-// There are two reasons for having a type-agnostic base class for
-// Expectation:
-//
-// 1. We need to store collections of expectations of different
-// types (e.g. all pre-requisites of a particular expectation, all
-// expectations in a sequence). Therefore these expectation objects
-// must share a common base class.
-//
-// 2. We can avoid binary code bloat by moving methods not depending
-// on the template argument of Expectation to the base class.
-//
-// This class is internal and mustn't be used by user code directly.
-class GTEST_API_ ExpectationBase {
- public:
- // source_text is the EXPECT_CALL(...) source that created this Expectation.
- ExpectationBase(const char* file, int line, const string& source_text);
-
- virtual ~ExpectationBase();
-
- // Where in the source file was the expectation spec defined?
- const char* file() const { return file_; }
- int line() const { return line_; }
- const char* source_text() const { return source_text_.c_str(); }
- // Returns the cardinality specified in the expectation spec.
- const Cardinality& cardinality() const { return cardinality_; }
-
- // Describes the source file location of this expectation.
- void DescribeLocationTo(::std::ostream* os) const {
- *os << FormatFileLocation(file(), line()) << " ";
- }
-
- // Describes how many times a function call matching this
- // expectation has occurred.
- void DescribeCallCountTo(::std::ostream* os) const
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex);
-
- // If this mock method has an extra matcher (i.e. .With(matcher)),
- // describes it to the ostream.
- virtual void MaybeDescribeExtraMatcherTo(::std::ostream* os) = 0;
-
- protected:
- friend class ::testing::Expectation;
- friend class UntypedFunctionMockerBase;
-
- enum Clause {
- // Don't change the order of the enum members!
- kNone,
- kWith,
- kTimes,
- kInSequence,
- kAfter,
- kWillOnce,
- kWillRepeatedly,
- kRetiresOnSaturation
- };
-
- typedef std::vector<const void*> UntypedActions;
-
- // Returns an Expectation object that references and co-owns this
- // expectation.
- virtual Expectation GetHandle() = 0;
-
- // Asserts that the EXPECT_CALL() statement has the given property.
- void AssertSpecProperty(bool property, const string& failure_message) const {
- Assert(property, file_, line_, failure_message);
- }
-
- // Expects that the EXPECT_CALL() statement has the given property.
- void ExpectSpecProperty(bool property, const string& failure_message) const {
- Expect(property, file_, line_, failure_message);
- }
-
- // Explicitly specifies the cardinality of this expectation. Used
- // by the subclasses to implement the .Times() clause.
- void SpecifyCardinality(const Cardinality& cardinality);
-
- // Returns true iff the user specified the cardinality explicitly
- // using a .Times().
- bool cardinality_specified() const { return cardinality_specified_; }
-
- // Sets the cardinality of this expectation spec.
- void set_cardinality(const Cardinality& a_cardinality) {
- cardinality_ = a_cardinality;
- }
-
- // The following group of methods should only be called after the
- // EXPECT_CALL() statement, and only when g_gmock_mutex is held by
- // the current thread.
-
- // Retires all pre-requisites of this expectation.
- void RetireAllPreRequisites()
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex);
-
- // Returns true iff this expectation is retired.
- bool is_retired() const
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
- g_gmock_mutex.AssertHeld();
- return retired_;
- }
-
- // Retires this expectation.
- void Retire()
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
- g_gmock_mutex.AssertHeld();
- retired_ = true;
- }
-
- // Returns true iff this expectation is satisfied.
- bool IsSatisfied() const
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
- g_gmock_mutex.AssertHeld();
- return cardinality().IsSatisfiedByCallCount(call_count_);
- }
-
- // Returns true iff this expectation is saturated.
- bool IsSaturated() const
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
- g_gmock_mutex.AssertHeld();
- return cardinality().IsSaturatedByCallCount(call_count_);
- }
-
- // Returns true iff this expectation is over-saturated.
- bool IsOverSaturated() const
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
- g_gmock_mutex.AssertHeld();
- return cardinality().IsOverSaturatedByCallCount(call_count_);
- }
-
- // Returns true iff all pre-requisites of this expectation are satisfied.
- bool AllPrerequisitesAreSatisfied() const
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex);
-
- // Adds unsatisfied pre-requisites of this expectation to 'result'.
- void FindUnsatisfiedPrerequisites(ExpectationSet* result) const
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex);
-
- // Returns the number this expectation has been invoked.
- int call_count() const
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
- g_gmock_mutex.AssertHeld();
- return call_count_;
- }
-
- // Increments the number this expectation has been invoked.
- void IncrementCallCount()
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
- g_gmock_mutex.AssertHeld();
- call_count_++;
- }
-
- // Checks the action count (i.e. the number of WillOnce() and
- // WillRepeatedly() clauses) against the cardinality if this hasn't
- // been done before. Prints a warning if there are too many or too
- // few actions.
- void CheckActionCountIfNotDone() const
- GTEST_LOCK_EXCLUDED_(mutex_);
-
- friend class ::testing::Sequence;
- friend class ::testing::internal::ExpectationTester;
-
- template <typename Function>
- friend class TypedExpectation;
-
- // Implements the .Times() clause.
- void UntypedTimes(const Cardinality& a_cardinality);
-
- // This group of fields are part of the spec and won't change after
- // an EXPECT_CALL() statement finishes.
- const char* file_; // The file that contains the expectation.
- int line_; // The line number of the expectation.
- const string source_text_; // The EXPECT_CALL(...) source text.
- // True iff the cardinality is specified explicitly.
- bool cardinality_specified_;
- Cardinality cardinality_; // The cardinality of the expectation.
- // The immediate pre-requisites (i.e. expectations that must be
- // satisfied before this expectation can be matched) of this
- // expectation. We use linked_ptr in the set because we want an
- // Expectation object to be co-owned by its FunctionMocker and its
- // successors. This allows multiple mock objects to be deleted at
- // different times.
- ExpectationSet immediate_prerequisites_;
-
- // This group of fields are the current state of the expectation,
- // and can change as the mock function is called.
- int call_count_; // How many times this expectation has been invoked.
- bool retired_; // True iff this expectation has retired.
- UntypedActions untyped_actions_;
- bool extra_matcher_specified_;
- bool repeated_action_specified_; // True if a WillRepeatedly() was specified.
- bool retires_on_saturation_;
- Clause last_clause_;
- mutable bool action_count_checked_; // Under mutex_.
- mutable Mutex mutex_; // Protects action_count_checked_.
-
- GTEST_DISALLOW_ASSIGN_(ExpectationBase);
-}; // class ExpectationBase
-
-// Impements an expectation for the given function type.
-template <typename F>
-class TypedExpectation : public ExpectationBase {
- public:
- typedef typename Function<F>::ArgumentTuple ArgumentTuple;
- typedef typename Function<F>::ArgumentMatcherTuple ArgumentMatcherTuple;
- typedef typename Function<F>::Result Result;
-
- TypedExpectation(FunctionMockerBase<F>* owner,
- const char* a_file, int a_line, const string& a_source_text,
- const ArgumentMatcherTuple& m)
- : ExpectationBase(a_file, a_line, a_source_text),
- owner_(owner),
- matchers_(m),
- // By default, extra_matcher_ should match anything. However,
- // we cannot initialize it with _ as that triggers a compiler
- // bug in Symbian's C++ compiler (cannot decide between two
- // overloaded constructors of Matcher<const ArgumentTuple&>).
- extra_matcher_(A<const ArgumentTuple&>()),
- repeated_action_(DoDefault()) {}
-
- virtual ~TypedExpectation() {
- // Check the validity of the action count if it hasn't been done
- // yet (for example, if the expectation was never used).
- CheckActionCountIfNotDone();
- for (UntypedActions::const_iterator it = untyped_actions_.begin();
- it != untyped_actions_.end(); ++it) {
- delete static_cast<const Action<F>*>(*it);
- }
- }
-
- // Implements the .With() clause.
- TypedExpectation& With(const Matcher<const ArgumentTuple&>& m) {
- if (last_clause_ == kWith) {
- ExpectSpecProperty(false,
- ".With() cannot appear "
- "more than once in an EXPECT_CALL().");
- } else {
- ExpectSpecProperty(last_clause_ < kWith,
- ".With() must be the first "
- "clause in an EXPECT_CALL().");
- }
- last_clause_ = kWith;
-
- extra_matcher_ = m;
- extra_matcher_specified_ = true;
- return *this;
- }
-
- // Implements the .Times() clause.
- TypedExpectation& Times(const Cardinality& a_cardinality) {
- ExpectationBase::UntypedTimes(a_cardinality);
- return *this;
- }
-
- // Implements the .Times() clause.
- TypedExpectation& Times(int n) {
- return Times(Exactly(n));
- }
-
- // Implements the .InSequence() clause.
- TypedExpectation& InSequence(const Sequence& s) {
- ExpectSpecProperty(last_clause_ <= kInSequence,
- ".InSequence() cannot appear after .After(),"
- " .WillOnce(), .WillRepeatedly(), or "
- ".RetiresOnSaturation().");
- last_clause_ = kInSequence;
-
- s.AddExpectation(GetHandle());
- return *this;
- }
- TypedExpectation& InSequence(const Sequence& s1, const Sequence& s2) {
- return InSequence(s1).InSequence(s2);
- }
- TypedExpectation& InSequence(const Sequence& s1, const Sequence& s2,
- const Sequence& s3) {
- return InSequence(s1, s2).InSequence(s3);
- }
- TypedExpectation& InSequence(const Sequence& s1, const Sequence& s2,
- const Sequence& s3, const Sequence& s4) {
- return InSequence(s1, s2, s3).InSequence(s4);
- }
- TypedExpectation& InSequence(const Sequence& s1, const Sequence& s2,
- const Sequence& s3, const Sequence& s4,
- const Sequence& s5) {
- return InSequence(s1, s2, s3, s4).InSequence(s5);
- }
-
- // Implements that .After() clause.
- TypedExpectation& After(const ExpectationSet& s) {
- ExpectSpecProperty(last_clause_ <= kAfter,
- ".After() cannot appear after .WillOnce(),"
- " .WillRepeatedly(), or "
- ".RetiresOnSaturation().");
- last_clause_ = kAfter;
-
- for (ExpectationSet::const_iterator it = s.begin(); it != s.end(); ++it) {
- immediate_prerequisites_ += *it;
- }
- return *this;
- }
- TypedExpectation& After(const ExpectationSet& s1, const ExpectationSet& s2) {
- return After(s1).After(s2);
- }
- TypedExpectation& After(const ExpectationSet& s1, const ExpectationSet& s2,
- const ExpectationSet& s3) {
- return After(s1, s2).After(s3);
- }
- TypedExpectation& After(const ExpectationSet& s1, const ExpectationSet& s2,
- const ExpectationSet& s3, const ExpectationSet& s4) {
- return After(s1, s2, s3).After(s4);
- }
- TypedExpectation& After(const ExpectationSet& s1, const ExpectationSet& s2,
- const ExpectationSet& s3, const ExpectationSet& s4,
- const ExpectationSet& s5) {
- return After(s1, s2, s3, s4).After(s5);
- }
-
- // Implements the .WillOnce() clause.
- TypedExpectation& WillOnce(const Action<F>& action) {
- ExpectSpecProperty(last_clause_ <= kWillOnce,
- ".WillOnce() cannot appear after "
- ".WillRepeatedly() or .RetiresOnSaturation().");
- last_clause_ = kWillOnce;
-
- untyped_actions_.push_back(new Action<F>(action));
- if (!cardinality_specified()) {
- set_cardinality(Exactly(static_cast<int>(untyped_actions_.size())));
- }
- return *this;
- }
-
- // Implements the .WillRepeatedly() clause.
- TypedExpectation& WillRepeatedly(const Action<F>& action) {
- if (last_clause_ == kWillRepeatedly) {
- ExpectSpecProperty(false,
- ".WillRepeatedly() cannot appear "
- "more than once in an EXPECT_CALL().");
- } else {
- ExpectSpecProperty(last_clause_ < kWillRepeatedly,
- ".WillRepeatedly() cannot appear "
- "after .RetiresOnSaturation().");
- }
- last_clause_ = kWillRepeatedly;
- repeated_action_specified_ = true;
-
- repeated_action_ = action;
- if (!cardinality_specified()) {
- set_cardinality(AtLeast(static_cast<int>(untyped_actions_.size())));
- }
-
- // Now that no more action clauses can be specified, we check
- // whether their count makes sense.
- CheckActionCountIfNotDone();
- return *this;
- }
-
- // Implements the .RetiresOnSaturation() clause.
- TypedExpectation& RetiresOnSaturation() {
- ExpectSpecProperty(last_clause_ < kRetiresOnSaturation,
- ".RetiresOnSaturation() cannot appear "
- "more than once.");
- last_clause_ = kRetiresOnSaturation;
- retires_on_saturation_ = true;
-
- // Now that no more action clauses can be specified, we check
- // whether their count makes sense.
- CheckActionCountIfNotDone();
- return *this;
- }
-
- // Returns the matchers for the arguments as specified inside the
- // EXPECT_CALL() macro.
- const ArgumentMatcherTuple& matchers() const {
- return matchers_;
- }
-
- // Returns the matcher specified by the .With() clause.
- const Matcher<const ArgumentTuple&>& extra_matcher() const {
- return extra_matcher_;
- }
-
- // Returns the action specified by the .WillRepeatedly() clause.
- const Action<F>& repeated_action() const { return repeated_action_; }
-
- // If this mock method has an extra matcher (i.e. .With(matcher)),
- // describes it to the ostream.
- virtual void MaybeDescribeExtraMatcherTo(::std::ostream* os) {
- if (extra_matcher_specified_) {
- *os << " Expected args: ";
- extra_matcher_.DescribeTo(os);
- *os << "\n";
- }
- }
-
- private:
- template <typename Function>
- friend class FunctionMockerBase;
-
- // Returns an Expectation object that references and co-owns this
- // expectation.
- virtual Expectation GetHandle() {
- return owner_->GetHandleOf(this);
- }
-
- // The following methods will be called only after the EXPECT_CALL()
- // statement finishes and when the current thread holds
- // g_gmock_mutex.
-
- // Returns true iff this expectation matches the given arguments.
- bool Matches(const ArgumentTuple& args) const
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
- g_gmock_mutex.AssertHeld();
- return TupleMatches(matchers_, args) && extra_matcher_.Matches(args);
- }
-
- // Returns true iff this expectation should handle the given arguments.
- bool ShouldHandleArguments(const ArgumentTuple& args) const
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
- g_gmock_mutex.AssertHeld();
-
- // In case the action count wasn't checked when the expectation
- // was defined (e.g. if this expectation has no WillRepeatedly()
- // or RetiresOnSaturation() clause), we check it when the
- // expectation is used for the first time.
- CheckActionCountIfNotDone();
- return !is_retired() && AllPrerequisitesAreSatisfied() && Matches(args);
- }
-
- // Describes the result of matching the arguments against this
- // expectation to the given ostream.
- void ExplainMatchResultTo(
- const ArgumentTuple& args,
- ::std::ostream* os) const
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
- g_gmock_mutex.AssertHeld();
-
- if (is_retired()) {
- *os << " Expected: the expectation is active\n"
- << " Actual: it is retired\n";
- } else if (!Matches(args)) {
- if (!TupleMatches(matchers_, args)) {
- ExplainMatchFailureTupleTo(matchers_, args, os);
- }
- StringMatchResultListener listener;
- if (!extra_matcher_.MatchAndExplain(args, &listener)) {
- *os << " Expected args: ";
- extra_matcher_.DescribeTo(os);
- *os << "\n Actual: don't match";
-
- internal::PrintIfNotEmpty(listener.str(), os);
- *os << "\n";
- }
- } else if (!AllPrerequisitesAreSatisfied()) {
- *os << " Expected: all pre-requisites are satisfied\n"
- << " Actual: the following immediate pre-requisites "
- << "are not satisfied:\n";
- ExpectationSet unsatisfied_prereqs;
- FindUnsatisfiedPrerequisites(&unsatisfied_prereqs);
- int i = 0;
- for (ExpectationSet::const_iterator it = unsatisfied_prereqs.begin();
- it != unsatisfied_prereqs.end(); ++it) {
- it->expectation_base()->DescribeLocationTo(os);
- *os << "pre-requisite #" << i++ << "\n";
- }
- *os << " (end of pre-requisites)\n";
- } else {
- // This line is here just for completeness' sake. It will never
- // be executed as currently the ExplainMatchResultTo() function
- // is called only when the mock function call does NOT match the
- // expectation.
- *os << "The call matches the expectation.\n";
- }
- }
-
- // Returns the action that should be taken for the current invocation.
- const Action<F>& GetCurrentAction(
- const FunctionMockerBase<F>* mocker,
- const ArgumentTuple& args) const
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
- g_gmock_mutex.AssertHeld();
- const int count = call_count();
- Assert(count >= 1, __FILE__, __LINE__,
- "call_count() is <= 0 when GetCurrentAction() is "
- "called - this should never happen.");
-
- const int action_count = static_cast<int>(untyped_actions_.size());
- if (action_count > 0 && !repeated_action_specified_ &&
- count > action_count) {
- // If there is at least one WillOnce() and no WillRepeatedly(),
- // we warn the user when the WillOnce() clauses ran out.
- ::std::stringstream ss;
- DescribeLocationTo(&ss);
- ss << "Actions ran out in " << source_text() << "...\n"
- << "Called " << count << " times, but only "
- << action_count << " WillOnce()"
- << (action_count == 1 ? " is" : "s are") << " specified - ";
- mocker->DescribeDefaultActionTo(args, &ss);
- Log(kWarning, ss.str(), 1);
- }
-
- return count <= action_count ?
- *static_cast<const Action<F>*>(untyped_actions_[count - 1]) :
- repeated_action();
- }
-
- // Given the arguments of a mock function call, if the call will
- // over-saturate this expectation, returns the default action;
- // otherwise, returns the next action in this expectation. Also
- // describes *what* happened to 'what', and explains *why* Google
- // Mock does it to 'why'. This method is not const as it calls
- // IncrementCallCount(). A return value of NULL means the default
- // action.
- const Action<F>* GetActionForArguments(
- const FunctionMockerBase<F>* mocker,
- const ArgumentTuple& args,
- ::std::ostream* what,
- ::std::ostream* why)
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
- g_gmock_mutex.AssertHeld();
- if (IsSaturated()) {
- // We have an excessive call.
- IncrementCallCount();
- *what << "Mock function called more times than expected - ";
- mocker->DescribeDefaultActionTo(args, what);
- DescribeCallCountTo(why);
-
- // TODO(wan@google.com): allow the user to control whether
- // unexpected calls should fail immediately or continue using a
- // flag --gmock_unexpected_calls_are_fatal.
- return NULL;
- }
-
- IncrementCallCount();
- RetireAllPreRequisites();
-
- if (retires_on_saturation_ && IsSaturated()) {
- Retire();
- }
-
- // Must be done after IncrementCount()!
- *what << "Mock function call matches " << source_text() <<"...\n";
- return &(GetCurrentAction(mocker, args));
- }
-
- // All the fields below won't change once the EXPECT_CALL()
- // statement finishes.
- FunctionMockerBase<F>* const owner_;
- ArgumentMatcherTuple matchers_;
- Matcher<const ArgumentTuple&> extra_matcher_;
- Action<F> repeated_action_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(TypedExpectation);
-}; // class TypedExpectation
-
-// A MockSpec object is used by ON_CALL() or EXPECT_CALL() for
-// specifying the default behavior of, or expectation on, a mock
-// function.
-
-// Note: class MockSpec really belongs to the ::testing namespace.
-// However if we define it in ::testing, MSVC will complain when
-// classes in ::testing::internal declare it as a friend class
-// template. To workaround this compiler bug, we define MockSpec in
-// ::testing::internal and import it into ::testing.
-
-// Logs a message including file and line number information.
-GTEST_API_ void LogWithLocation(testing::internal::LogSeverity severity,
- const char* file, int line,
- const string& message);
-
-template <typename F>
-class MockSpec {
- public:
- typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
- typedef typename internal::Function<F>::ArgumentMatcherTuple
- ArgumentMatcherTuple;
-
- // Constructs a MockSpec object, given the function mocker object
- // that the spec is associated with.
- explicit MockSpec(internal::FunctionMockerBase<F>* function_mocker)
- : function_mocker_(function_mocker) {}
-
- // Adds a new default action spec to the function mocker and returns
- // the newly created spec.
- internal::OnCallSpec<F>& InternalDefaultActionSetAt(
- const char* file, int line, const char* obj, const char* call) {
- LogWithLocation(internal::kInfo, file, line,
- string("ON_CALL(") + obj + ", " + call + ") invoked");
- return function_mocker_->AddNewOnCallSpec(file, line, matchers_);
- }
-
- // Adds a new expectation spec to the function mocker and returns
- // the newly created spec.
- internal::TypedExpectation<F>& InternalExpectedAt(
- const char* file, int line, const char* obj, const char* call) {
- const string source_text(string("EXPECT_CALL(") + obj + ", " + call + ")");
- LogWithLocation(internal::kInfo, file, line, source_text + " invoked");
- return function_mocker_->AddNewExpectation(
- file, line, source_text, matchers_);
- }
-
- private:
- template <typename Function>
- friend class internal::FunctionMocker;
-
- void SetMatchers(const ArgumentMatcherTuple& matchers) {
- matchers_ = matchers;
- }
-
- // The function mocker that owns this spec.
- internal::FunctionMockerBase<F>* const function_mocker_;
- // The argument matchers specified in the spec.
- ArgumentMatcherTuple matchers_;
-
- GTEST_DISALLOW_ASSIGN_(MockSpec);
-}; // class MockSpec
-
-// MSVC warns about using 'this' in base member initializer list, so
-// we need to temporarily disable the warning. We have to do it for
-// the entire class to suppress the warning, even though it's about
-// the constructor only.
-
-#ifdef _MSC_VER
-# pragma warning(push) // Saves the current warning state.
-# pragma warning(disable:4355) // Temporarily disables warning 4355.
-#endif // _MSV_VER
-
-// C++ treats the void type specially. For example, you cannot define
-// a void-typed variable or pass a void value to a function.
-// ActionResultHolder<T> holds a value of type T, where T must be a
-// copyable type or void (T doesn't need to be default-constructable).
-// It hides the syntactic difference between void and other types, and
-// is used to unify the code for invoking both void-returning and
-// non-void-returning mock functions.
-
-// Untyped base class for ActionResultHolder<T>.
-class UntypedActionResultHolderBase {
- public:
- virtual ~UntypedActionResultHolderBase() {}
-
- // Prints the held value as an action's result to os.
- virtual void PrintAsActionResult(::std::ostream* os) const = 0;
-};
-
-// This generic definition is used when T is not void.
-template <typename T>
-class ActionResultHolder : public UntypedActionResultHolderBase {
- public:
- explicit ActionResultHolder(T a_value) : value_(a_value) {}
-
- // The compiler-generated copy constructor and assignment operator
- // are exactly what we need, so we don't need to define them.
-
- // Returns the held value and deletes this object.
- T GetValueAndDelete() const {
- T retval(value_);
- delete this;
- return retval;
- }
-
- // Prints the held value as an action's result to os.
- virtual void PrintAsActionResult(::std::ostream* os) const {
- *os << "\n Returns: ";
- // T may be a reference type, so we don't use UniversalPrint().
- UniversalPrinter<T>::Print(value_, os);
- }
-
- // Performs the given mock function's default action and returns the
- // result in a new-ed ActionResultHolder.
- template <typename F>
- static ActionResultHolder* PerformDefaultAction(
- const FunctionMockerBase<F>* func_mocker,
- const typename Function<F>::ArgumentTuple& args,
- const string& call_description) {
- return new ActionResultHolder(
- func_mocker->PerformDefaultAction(args, call_description));
- }
-
- // Performs the given action and returns the result in a new-ed
- // ActionResultHolder.
- template <typename F>
- static ActionResultHolder*
- PerformAction(const Action<F>& action,
- const typename Function<F>::ArgumentTuple& args) {
- return new ActionResultHolder(action.Perform(args));
- }
-
- private:
- T value_;
-
- // T could be a reference type, so = isn't supported.
- GTEST_DISALLOW_ASSIGN_(ActionResultHolder);
-};
-
-// Specialization for T = void.
-template <>
-class ActionResultHolder<void> : public UntypedActionResultHolderBase {
- public:
- void GetValueAndDelete() const { delete this; }
-
- virtual void PrintAsActionResult(::std::ostream* /* os */) const {}
-
- // Performs the given mock function's default action and returns NULL;
- template <typename F>
- static ActionResultHolder* PerformDefaultAction(
- const FunctionMockerBase<F>* func_mocker,
- const typename Function<F>::ArgumentTuple& args,
- const string& call_description) {
- func_mocker->PerformDefaultAction(args, call_description);
- return NULL;
- }
-
- // Performs the given action and returns NULL.
- template <typename F>
- static ActionResultHolder* PerformAction(
- const Action<F>& action,
- const typename Function<F>::ArgumentTuple& args) {
- action.Perform(args);
- return NULL;
- }
-};
-
-// The base of the function mocker class for the given function type.
-// We put the methods in this class instead of its child to avoid code
-// bloat.
-template <typename F>
-class FunctionMockerBase : public UntypedFunctionMockerBase {
- public:
- typedef typename Function<F>::Result Result;
- typedef typename Function<F>::ArgumentTuple ArgumentTuple;
- typedef typename Function<F>::ArgumentMatcherTuple ArgumentMatcherTuple;
-
- FunctionMockerBase() : current_spec_(this) {}
-
- // The destructor verifies that all expectations on this mock
- // function have been satisfied. If not, it will report Google Test
- // non-fatal failures for the violations.
- virtual ~FunctionMockerBase()
- GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {
- MutexLock l(&g_gmock_mutex);
- VerifyAndClearExpectationsLocked();
- Mock::UnregisterLocked(this);
- ClearDefaultActionsLocked();
- }
-
- // Returns the ON_CALL spec that matches this mock function with the
- // given arguments; returns NULL if no matching ON_CALL is found.
- // L = *
- const OnCallSpec<F>* FindOnCallSpec(
- const ArgumentTuple& args) const {
- for (UntypedOnCallSpecs::const_reverse_iterator it
- = untyped_on_call_specs_.rbegin();
- it != untyped_on_call_specs_.rend(); ++it) {
- const OnCallSpec<F>* spec = static_cast<const OnCallSpec<F>*>(*it);
- if (spec->Matches(args))
- return spec;
- }
-
- return NULL;
- }
-
- // Performs the default action of this mock function on the given arguments
- // and returns the result. Asserts with a helpful call descrption if there is
- // no valid return value. This method doesn't depend on the mutable state of
- // this object, and thus can be called concurrently without locking.
- // L = *
- Result PerformDefaultAction(const ArgumentTuple& args,
- const string& call_description) const {
- const OnCallSpec<F>* const spec =
- this->FindOnCallSpec(args);
- if (spec != NULL) {
- return spec->GetAction().Perform(args);
- }
- Assert(DefaultValue<Result>::Exists(), "", -1,
- call_description + "\n The mock function has no default action "
- "set, and its return type has no default value set.");
- return DefaultValue<Result>::Get();
- }
-
- // Performs the default action with the given arguments and returns
- // the action's result. The call description string will be used in
- // the error message to describe the call in the case the default
- // action fails. The caller is responsible for deleting the result.
- // L = *
- virtual UntypedActionResultHolderBase* UntypedPerformDefaultAction(
- const void* untyped_args, // must point to an ArgumentTuple
- const string& call_description) const {
- const ArgumentTuple& args =
- *static_cast<const ArgumentTuple*>(untyped_args);
- return ResultHolder::PerformDefaultAction(this, args, call_description);
- }
-
- // Performs the given action with the given arguments and returns
- // the action's result. The caller is responsible for deleting the
- // result.
- // L = *
- virtual UntypedActionResultHolderBase* UntypedPerformAction(
- const void* untyped_action, const void* untyped_args) const {
- // Make a copy of the action before performing it, in case the
- // action deletes the mock object (and thus deletes itself).
- const Action<F> action = *static_cast<const Action<F>*>(untyped_action);
- const ArgumentTuple& args =
- *static_cast<const ArgumentTuple*>(untyped_args);
- return ResultHolder::PerformAction(action, args);
- }
-
- // Implements UntypedFunctionMockerBase::ClearDefaultActionsLocked():
- // clears the ON_CALL()s set on this mock function.
- virtual void ClearDefaultActionsLocked()
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
- g_gmock_mutex.AssertHeld();
-
- // Deleting our default actions may trigger other mock objects to be
- // deleted, for example if an action contains a reference counted smart
- // pointer to that mock object, and that is the last reference. So if we
- // delete our actions within the context of the global mutex we may deadlock
- // when this method is called again. Instead, make a copy of the set of
- // actions to delete, clear our set within the mutex, and then delete the
- // actions outside of the mutex.
- UntypedOnCallSpecs specs_to_delete;
- untyped_on_call_specs_.swap(specs_to_delete);
-
- g_gmock_mutex.Unlock();
- for (UntypedOnCallSpecs::const_iterator it =
- specs_to_delete.begin();
- it != specs_to_delete.end(); ++it) {
- delete static_cast<const OnCallSpec<F>*>(*it);
- }
-
- // Lock the mutex again, since the caller expects it to be locked when we
- // return.
- g_gmock_mutex.Lock();
- }
-
- protected:
- template <typename Function>
- friend class MockSpec;
-
- typedef ActionResultHolder<Result> ResultHolder;
-
- // Returns the result of invoking this mock function with the given
- // arguments. This function can be safely called from multiple
- // threads concurrently.
- Result InvokeWith(const ArgumentTuple& args)
- GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {
- return static_cast<const ResultHolder*>(
- this->UntypedInvokeWith(&args))->GetValueAndDelete();
- }
-
- // Adds and returns a default action spec for this mock function.
- OnCallSpec<F>& AddNewOnCallSpec(
- const char* file, int line,
- const ArgumentMatcherTuple& m)
- GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {
- Mock::RegisterUseByOnCallOrExpectCall(MockObject(), file, line);
- OnCallSpec<F>* const on_call_spec = new OnCallSpec<F>(file, line, m);
- untyped_on_call_specs_.push_back(on_call_spec);
- return *on_call_spec;
- }
-
- // Adds and returns an expectation spec for this mock function.
- TypedExpectation<F>& AddNewExpectation(
- const char* file,
- int line,
- const string& source_text,
- const ArgumentMatcherTuple& m)
- GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {
- Mock::RegisterUseByOnCallOrExpectCall(MockObject(), file, line);
- TypedExpectation<F>* const expectation =
- new TypedExpectation<F>(this, file, line, source_text, m);
- const linked_ptr<ExpectationBase> untyped_expectation(expectation);
- untyped_expectations_.push_back(untyped_expectation);
-
- // Adds this expectation into the implicit sequence if there is one.
- Sequence* const implicit_sequence = g_gmock_implicit_sequence.get();
- if (implicit_sequence != NULL) {
- implicit_sequence->AddExpectation(Expectation(untyped_expectation));
- }
-
- return *expectation;
- }
-
- // The current spec (either default action spec or expectation spec)
- // being described on this function mocker.
- MockSpec<F>& current_spec() { return current_spec_; }
-
- private:
- template <typename Func> friend class TypedExpectation;
-
- // Some utilities needed for implementing UntypedInvokeWith().
-
- // Describes what default action will be performed for the given
- // arguments.
- // L = *
- void DescribeDefaultActionTo(const ArgumentTuple& args,
- ::std::ostream* os) const {
- const OnCallSpec<F>* const spec = FindOnCallSpec(args);
-
- if (spec == NULL) {
- *os << (internal::type_equals<Result, void>::value ?
- "returning directly.\n" :
- "returning default value.\n");
- } else {
- *os << "taking default action specified at:\n"
- << FormatFileLocation(spec->file(), spec->line()) << "\n";
- }
- }
-
- // Writes a message that the call is uninteresting (i.e. neither
- // explicitly expected nor explicitly unexpected) to the given
- // ostream.
- virtual void UntypedDescribeUninterestingCall(
- const void* untyped_args,
- ::std::ostream* os) const
- GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {
- const ArgumentTuple& args =
- *static_cast<const ArgumentTuple*>(untyped_args);
- *os << "Uninteresting mock function call - ";
- DescribeDefaultActionTo(args, os);
- *os << " Function call: " << Name();
- UniversalPrint(args, os);
- }
-
- // Returns the expectation that matches the given function arguments
- // (or NULL is there's no match); when a match is found,
- // untyped_action is set to point to the action that should be
- // performed (or NULL if the action is "do default"), and
- // is_excessive is modified to indicate whether the call exceeds the
- // expected number.
- //
- // Critical section: We must find the matching expectation and the
- // corresponding action that needs to be taken in an ATOMIC
- // transaction. Otherwise another thread may call this mock
- // method in the middle and mess up the state.
- //
- // However, performing the action has to be left out of the critical
- // section. The reason is that we have no control on what the
- // action does (it can invoke an arbitrary user function or even a
- // mock function) and excessive locking could cause a dead lock.
- virtual const ExpectationBase* UntypedFindMatchingExpectation(
- const void* untyped_args,
- const void** untyped_action, bool* is_excessive,
- ::std::ostream* what, ::std::ostream* why)
- GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {
- const ArgumentTuple& args =
- *static_cast<const ArgumentTuple*>(untyped_args);
- MutexLock l(&g_gmock_mutex);
- TypedExpectation<F>* exp = this->FindMatchingExpectationLocked(args);
- if (exp == NULL) { // A match wasn't found.
- this->FormatUnexpectedCallMessageLocked(args, what, why);
- return NULL;
- }
-
- // This line must be done before calling GetActionForArguments(),
- // which will increment the call count for *exp and thus affect
- // its saturation status.
- *is_excessive = exp->IsSaturated();
- const Action<F>* action = exp->GetActionForArguments(this, args, what, why);
- if (action != NULL && action->IsDoDefault())
- action = NULL; // Normalize "do default" to NULL.
- *untyped_action = action;
- return exp;
- }
-
- // Prints the given function arguments to the ostream.
- virtual void UntypedPrintArgs(const void* untyped_args,
- ::std::ostream* os) const {
- const ArgumentTuple& args =
- *static_cast<const ArgumentTuple*>(untyped_args);
- UniversalPrint(args, os);
- }
-
- // Returns the expectation that matches the arguments, or NULL if no
- // expectation matches them.
- TypedExpectation<F>* FindMatchingExpectationLocked(
- const ArgumentTuple& args) const
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
- g_gmock_mutex.AssertHeld();
- for (typename UntypedExpectations::const_reverse_iterator it =
- untyped_expectations_.rbegin();
- it != untyped_expectations_.rend(); ++it) {
- TypedExpectation<F>* const exp =
- static_cast<TypedExpectation<F>*>(it->get());
- if (exp->ShouldHandleArguments(args)) {
- return exp;
- }
- }
- return NULL;
- }
-
- // Returns a message that the arguments don't match any expectation.
- void FormatUnexpectedCallMessageLocked(
- const ArgumentTuple& args,
- ::std::ostream* os,
- ::std::ostream* why) const
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
- g_gmock_mutex.AssertHeld();
- *os << "\nUnexpected mock function call - ";
- DescribeDefaultActionTo(args, os);
- PrintTriedExpectationsLocked(args, why);
- }
-
- // Prints a list of expectations that have been tried against the
- // current mock function call.
- void PrintTriedExpectationsLocked(
- const ArgumentTuple& args,
- ::std::ostream* why) const
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
- g_gmock_mutex.AssertHeld();
- const int count = static_cast<int>(untyped_expectations_.size());
- *why << "Google Mock tried the following " << count << " "
- << (count == 1 ? "expectation, but it didn't match" :
- "expectations, but none matched")
- << ":\n";
- for (int i = 0; i < count; i++) {
- TypedExpectation<F>* const expectation =
- static_cast<TypedExpectation<F>*>(untyped_expectations_[i].get());
- *why << "\n";
- expectation->DescribeLocationTo(why);
- if (count > 1) {
- *why << "tried expectation #" << i << ": ";
- }
- *why << expectation->source_text() << "...\n";
- expectation->ExplainMatchResultTo(args, why);
- expectation->DescribeCallCountTo(why);
- }
- }
-
- // The current spec (either default action spec or expectation spec)
- // being described on this function mocker.
- MockSpec<F> current_spec_;
-
- // There is no generally useful and implementable semantics of
- // copying a mock object, so copying a mock is usually a user error.
- // Thus we disallow copying function mockers. If the user really
- // wants to copy a mock object, he should implement his own copy
- // operation, for example:
- //
- // class MockFoo : public Foo {
- // public:
- // // Defines a copy constructor explicitly.
- // MockFoo(const MockFoo& src) {}
- // ...
- // };
- GTEST_DISALLOW_COPY_AND_ASSIGN_(FunctionMockerBase);
-}; // class FunctionMockerBase
-
-#ifdef _MSC_VER
-# pragma warning(pop) // Restores the warning state.
-#endif // _MSV_VER
-
-// Implements methods of FunctionMockerBase.
-
-// Verifies that all expectations on this mock function have been
-// satisfied. Reports one or more Google Test non-fatal failures and
-// returns false if not.
-
-// Reports an uninteresting call (whose description is in msg) in the
-// manner specified by 'reaction'.
-void ReportUninterestingCall(CallReaction reaction, const string& msg);
-
-} // namespace internal
-
-// The style guide prohibits "using" statements in a namespace scope
-// inside a header file. However, the MockSpec class template is
-// meant to be defined in the ::testing namespace. The following line
-// is just a trick for working around a bug in MSVC 8.0, which cannot
-// handle it if we define MockSpec in ::testing.
-using internal::MockSpec;
-
-// Const(x) is a convenient function for obtaining a const reference
-// to x. This is useful for setting expectations on an overloaded
-// const mock method, e.g.
-//
-// class MockFoo : public FooInterface {
-// public:
-// MOCK_METHOD0(Bar, int());
-// MOCK_CONST_METHOD0(Bar, int&());
-// };
-//
-// MockFoo foo;
-// // Expects a call to non-const MockFoo::Bar().
-// EXPECT_CALL(foo, Bar());
-// // Expects a call to const MockFoo::Bar().
-// EXPECT_CALL(Const(foo), Bar());
-template <typename T>
-inline const T& Const(const T& x) { return x; }
-
-// Constructs an Expectation object that references and co-owns exp.
-inline Expectation::Expectation(internal::ExpectationBase& exp) // NOLINT
- : expectation_base_(exp.GetHandle().expectation_base()) {}
-
-} // namespace testing
-
-// A separate macro is required to avoid compile errors when the name
-// of the method used in call is a result of macro expansion.
-// See CompilesWithMethodNameExpandedFromMacro tests in
-// internal/gmock-spec-builders_test.cc for more details.
-#define GMOCK_ON_CALL_IMPL_(obj, call) \
- ((obj).gmock_##call).InternalDefaultActionSetAt(__FILE__, __LINE__, \
- #obj, #call)
-#define ON_CALL(obj, call) GMOCK_ON_CALL_IMPL_(obj, call)
-
-#define GMOCK_EXPECT_CALL_IMPL_(obj, call) \
- ((obj).gmock_##call).InternalExpectedAt(__FILE__, __LINE__, #obj, #call)
-#define EXPECT_CALL(obj, call) GMOCK_EXPECT_CALL_IMPL_(obj, call)
-
-#endif // GMOCK_INCLUDE_GMOCK_GMOCK_SPEC_BUILDERS_H_
diff --git a/src/testing/include/gmock/gmock.h b/src/testing/include/gmock/gmock.h
deleted file mode 100644
index 481e5706..00000000
--- a/src/testing/include/gmock/gmock.h
+++ /dev/null
@@ -1,93 +0,0 @@
-// Copyright 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-// Google Mock - a framework for writing C++ mock classes.
-//
-// This is the main header file a user should include.
-
-#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_H_
-#define GMOCK_INCLUDE_GMOCK_GMOCK_H_
-
-// This file implements the following syntax:
-//
-// ON_CALL(mock_object.Method(...))
-// .With(...) ?
-// .WillByDefault(...);
-//
-// where With() is optional and WillByDefault() must appear exactly
-// once.
-//
-// EXPECT_CALL(mock_object.Method(...))
-// .With(...) ?
-// .Times(...) ?
-// .InSequence(...) *
-// .WillOnce(...) *
-// .WillRepeatedly(...) ?
-// .RetiresOnSaturation() ? ;
-//
-// where all clauses are optional and WillOnce() can be repeated.
-
-#include "gmock/gmock-actions.h"
-#include "gmock/gmock-cardinalities.h"
-#include "gmock/gmock-generated-actions.h"
-#include "gmock/gmock-generated-function-mockers.h"
-#include "gmock/gmock-generated-matchers.h"
-#include "gmock/gmock-more-actions.h"
-#include "gmock/gmock-generated-nice-strict.h"
-#include "gmock/gmock-matchers.h"
-#include "gmock/internal/gmock-internal-utils.h"
-
-namespace testing {
-
-// Declares Google Mock flags that we want a user to use programmatically.
-GMOCK_DECLARE_bool_(catch_leaked_mocks);
-GMOCK_DECLARE_string_(verbose);
-
-// Initializes Google Mock. This must be called before running the
-// tests. In particular, it parses the command line for the flags
-// that Google Mock recognizes. Whenever a Google Mock flag is seen,
-// it is removed from argv, and *argc is decremented.
-//
-// No value is returned. Instead, the Google Mock flag variables are
-// updated.
-//
-// Since Google Test is needed for Google Mock to work, this function
-// also initializes Google Test and parses its flags, if that hasn't
-// been done.
-GTEST_API_ void InitGoogleMock(int* argc, char** argv);
-
-// This overloaded version can be used in Windows programs compiled in
-// UNICODE mode.
-GTEST_API_ void InitGoogleMock(int* argc, wchar_t** argv);
-
-} // namespace testing
-
-#endif // GMOCK_INCLUDE_GMOCK_GMOCK_H_
diff --git a/src/testing/include/gmock/internal/gmock-generated-internal-utils.h b/src/testing/include/gmock/internal/gmock-generated-internal-utils.h
deleted file mode 100644
index 02258451..00000000
--- a/src/testing/include/gmock/internal/gmock-generated-internal-utils.h
+++ /dev/null
@@ -1,279 +0,0 @@
-// This file was GENERATED by command:
-// pump.py gmock-generated-internal-utils.h.pump
-// DO NOT EDIT BY HAND!!!
-
-// Copyright 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-// Google Mock - a framework for writing C++ mock classes.
-//
-// This file contains template meta-programming utility classes needed
-// for implementing Google Mock.
-
-#ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_GENERATED_INTERNAL_UTILS_H_
-#define GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_GENERATED_INTERNAL_UTILS_H_
-
-#include "gmock/internal/gmock-port.h"
-
-namespace testing {
-
-template <typename T>
-class Matcher;
-
-namespace internal {
-
-// An IgnoredValue object can be implicitly constructed from ANY value.
-// This is used in implementing the IgnoreResult(a) action.
-class IgnoredValue {
- public:
- // This constructor template allows any value to be implicitly
- // converted to IgnoredValue. The object has no data member and
- // doesn't try to remember anything about the argument. We
- // deliberately omit the 'explicit' keyword in order to allow the
- // conversion to be implicit.
- template <typename T>
- IgnoredValue(const T& /* ignored */) {} // NOLINT(runtime/explicit)
-};
-
-// MatcherTuple<T>::type is a tuple type where each field is a Matcher
-// for the corresponding field in tuple type T.
-template <typename Tuple>
-struct MatcherTuple;
-
-template <>
-struct MatcherTuple< ::std::tr1::tuple<> > {
- typedef ::std::tr1::tuple< > type;
-};
-
-template <typename A1>
-struct MatcherTuple< ::std::tr1::tuple<A1> > {
- typedef ::std::tr1::tuple<Matcher<A1> > type;
-};
-
-template <typename A1, typename A2>
-struct MatcherTuple< ::std::tr1::tuple<A1, A2> > {
- typedef ::std::tr1::tuple<Matcher<A1>, Matcher<A2> > type;
-};
-
-template <typename A1, typename A2, typename A3>
-struct MatcherTuple< ::std::tr1::tuple<A1, A2, A3> > {
- typedef ::std::tr1::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3> > type;
-};
-
-template <typename A1, typename A2, typename A3, typename A4>
-struct MatcherTuple< ::std::tr1::tuple<A1, A2, A3, A4> > {
- typedef ::std::tr1::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>,
- Matcher<A4> > type;
-};
-
-template <typename A1, typename A2, typename A3, typename A4, typename A5>
-struct MatcherTuple< ::std::tr1::tuple<A1, A2, A3, A4, A5> > {
- typedef ::std::tr1::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
- Matcher<A5> > type;
-};
-
-template <typename A1, typename A2, typename A3, typename A4, typename A5,
- typename A6>
-struct MatcherTuple< ::std::tr1::tuple<A1, A2, A3, A4, A5, A6> > {
- typedef ::std::tr1::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
- Matcher<A5>, Matcher<A6> > type;
-};
-
-template <typename A1, typename A2, typename A3, typename A4, typename A5,
- typename A6, typename A7>
-struct MatcherTuple< ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7> > {
- typedef ::std::tr1::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
- Matcher<A5>, Matcher<A6>, Matcher<A7> > type;
-};
-
-template <typename A1, typename A2, typename A3, typename A4, typename A5,
- typename A6, typename A7, typename A8>
-struct MatcherTuple< ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7, A8> > {
- typedef ::std::tr1::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
- Matcher<A5>, Matcher<A6>, Matcher<A7>, Matcher<A8> > type;
-};
-
-template <typename A1, typename A2, typename A3, typename A4, typename A5,
- typename A6, typename A7, typename A8, typename A9>
-struct MatcherTuple< ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9> > {
- typedef ::std::tr1::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
- Matcher<A5>, Matcher<A6>, Matcher<A7>, Matcher<A8>, Matcher<A9> > type;
-};
-
-template <typename A1, typename A2, typename A3, typename A4, typename A5,
- typename A6, typename A7, typename A8, typename A9, typename A10>
-struct MatcherTuple< ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9,
- A10> > {
- typedef ::std::tr1::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
- Matcher<A5>, Matcher<A6>, Matcher<A7>, Matcher<A8>, Matcher<A9>,
- Matcher<A10> > type;
-};
-
-// Template struct Function<F>, where F must be a function type, contains
-// the following typedefs:
-//
-// Result: the function's return type.
-// ArgumentN: the type of the N-th argument, where N starts with 1.
-// ArgumentTuple: the tuple type consisting of all parameters of F.
-// ArgumentMatcherTuple: the tuple type consisting of Matchers for all
-// parameters of F.
-// MakeResultVoid: the function type obtained by substituting void
-// for the return type of F.
-// MakeResultIgnoredValue:
-// the function type obtained by substituting Something
-// for the return type of F.
-template <typename F>
-struct Function;
-
-template <typename R>
-struct Function<R()> {
- typedef R Result;
- typedef ::std::tr1::tuple<> ArgumentTuple;
- typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
- typedef void MakeResultVoid();
- typedef IgnoredValue MakeResultIgnoredValue();
-};
-
-template <typename R, typename A1>
-struct Function<R(A1)>
- : Function<R()> {
- typedef A1 Argument1;
- typedef ::std::tr1::tuple<A1> ArgumentTuple;
- typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
- typedef void MakeResultVoid(A1);
- typedef IgnoredValue MakeResultIgnoredValue(A1);
-};
-
-template <typename R, typename A1, typename A2>
-struct Function<R(A1, A2)>
- : Function<R(A1)> {
- typedef A2 Argument2;
- typedef ::std::tr1::tuple<A1, A2> ArgumentTuple;
- typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
- typedef void MakeResultVoid(A1, A2);
- typedef IgnoredValue MakeResultIgnoredValue(A1, A2);
-};
-
-template <typename R, typename A1, typename A2, typename A3>
-struct Function<R(A1, A2, A3)>
- : Function<R(A1, A2)> {
- typedef A3 Argument3;
- typedef ::std::tr1::tuple<A1, A2, A3> ArgumentTuple;
- typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
- typedef void MakeResultVoid(A1, A2, A3);
- typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3);
-};
-
-template <typename R, typename A1, typename A2, typename A3, typename A4>
-struct Function<R(A1, A2, A3, A4)>
- : Function<R(A1, A2, A3)> {
- typedef A4 Argument4;
- typedef ::std::tr1::tuple<A1, A2, A3, A4> ArgumentTuple;
- typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
- typedef void MakeResultVoid(A1, A2, A3, A4);
- typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4);
-};
-
-template <typename R, typename A1, typename A2, typename A3, typename A4,
- typename A5>
-struct Function<R(A1, A2, A3, A4, A5)>
- : Function<R(A1, A2, A3, A4)> {
- typedef A5 Argument5;
- typedef ::std::tr1::tuple<A1, A2, A3, A4, A5> ArgumentTuple;
- typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
- typedef void MakeResultVoid(A1, A2, A3, A4, A5);
- typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5);
-};
-
-template <typename R, typename A1, typename A2, typename A3, typename A4,
- typename A5, typename A6>
-struct Function<R(A1, A2, A3, A4, A5, A6)>
- : Function<R(A1, A2, A3, A4, A5)> {
- typedef A6 Argument6;
- typedef ::std::tr1::tuple<A1, A2, A3, A4, A5, A6> ArgumentTuple;
- typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
- typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6);
- typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5, A6);
-};
-
-template <typename R, typename A1, typename A2, typename A3, typename A4,
- typename A5, typename A6, typename A7>
-struct Function<R(A1, A2, A3, A4, A5, A6, A7)>
- : Function<R(A1, A2, A3, A4, A5, A6)> {
- typedef A7 Argument7;
- typedef ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7> ArgumentTuple;
- typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
- typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6, A7);
- typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5, A6, A7);
-};
-
-template <typename R, typename A1, typename A2, typename A3, typename A4,
- typename A5, typename A6, typename A7, typename A8>
-struct Function<R(A1, A2, A3, A4, A5, A6, A7, A8)>
- : Function<R(A1, A2, A3, A4, A5, A6, A7)> {
- typedef A8 Argument8;
- typedef ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7, A8> ArgumentTuple;
- typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
- typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6, A7, A8);
- typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5, A6, A7, A8);
-};
-
-template <typename R, typename A1, typename A2, typename A3, typename A4,
- typename A5, typename A6, typename A7, typename A8, typename A9>
-struct Function<R(A1, A2, A3, A4, A5, A6, A7, A8, A9)>
- : Function<R(A1, A2, A3, A4, A5, A6, A7, A8)> {
- typedef A9 Argument9;
- typedef ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9> ArgumentTuple;
- typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
- typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6, A7, A8, A9);
- typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5, A6, A7, A8,
- A9);
-};
-
-template <typename R, typename A1, typename A2, typename A3, typename A4,
- typename A5, typename A6, typename A7, typename A8, typename A9,
- typename A10>
-struct Function<R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)>
- : Function<R(A1, A2, A3, A4, A5, A6, A7, A8, A9)> {
- typedef A10 Argument10;
- typedef ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9,
- A10> ArgumentTuple;
- typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
- typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10);
- typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5, A6, A7, A8,
- A9, A10);
-};
-
-} // namespace internal
-
-} // namespace testing
-
-#endif // GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_GENERATED_INTERNAL_UTILS_H_
diff --git a/src/testing/include/gmock/internal/gmock-generated-internal-utils.h.pump b/src/testing/include/gmock/internal/gmock-generated-internal-utils.h.pump
deleted file mode 100644
index e7ecc8b8..00000000
--- a/src/testing/include/gmock/internal/gmock-generated-internal-utils.h.pump
+++ /dev/null
@@ -1,136 +0,0 @@
-$$ -*- mode: c++; -*-
-$$ This is a Pump source file. Please use Pump to convert it to
-$$ gmock-generated-function-mockers.h.
-$$
-$var n = 10 $$ The maximum arity we support.
-// Copyright 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-// Google Mock - a framework for writing C++ mock classes.
-//
-// This file contains template meta-programming utility classes needed
-// for implementing Google Mock.
-
-#ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_GENERATED_INTERNAL_UTILS_H_
-#define GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_GENERATED_INTERNAL_UTILS_H_
-
-#include "gmock/internal/gmock-port.h"
-
-namespace testing {
-
-template <typename T>
-class Matcher;
-
-namespace internal {
-
-// An IgnoredValue object can be implicitly constructed from ANY value.
-// This is used in implementing the IgnoreResult(a) action.
-class IgnoredValue {
- public:
- // This constructor template allows any value to be implicitly
- // converted to IgnoredValue. The object has no data member and
- // doesn't try to remember anything about the argument. We
- // deliberately omit the 'explicit' keyword in order to allow the
- // conversion to be implicit.
- template <typename T>
- IgnoredValue(const T& /* ignored */) {} // NOLINT(runtime/explicit)
-};
-
-// MatcherTuple<T>::type is a tuple type where each field is a Matcher
-// for the corresponding field in tuple type T.
-template <typename Tuple>
-struct MatcherTuple;
-
-
-$range i 0..n
-$for i [[
-$range j 1..i
-$var typename_As = [[$for j, [[typename A$j]]]]
-$var As = [[$for j, [[A$j]]]]
-$var matcher_As = [[$for j, [[Matcher<A$j>]]]]
-template <$typename_As>
-struct MatcherTuple< ::std::tr1::tuple<$As> > {
- typedef ::std::tr1::tuple<$matcher_As > type;
-};
-
-
-]]
-// Template struct Function<F>, where F must be a function type, contains
-// the following typedefs:
-//
-// Result: the function's return type.
-// ArgumentN: the type of the N-th argument, where N starts with 1.
-// ArgumentTuple: the tuple type consisting of all parameters of F.
-// ArgumentMatcherTuple: the tuple type consisting of Matchers for all
-// parameters of F.
-// MakeResultVoid: the function type obtained by substituting void
-// for the return type of F.
-// MakeResultIgnoredValue:
-// the function type obtained by substituting Something
-// for the return type of F.
-template <typename F>
-struct Function;
-
-template <typename R>
-struct Function<R()> {
- typedef R Result;
- typedef ::std::tr1::tuple<> ArgumentTuple;
- typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
- typedef void MakeResultVoid();
- typedef IgnoredValue MakeResultIgnoredValue();
-};
-
-
-$range i 1..n
-$for i [[
-$range j 1..i
-$var typename_As = [[$for j [[, typename A$j]]]]
-$var As = [[$for j, [[A$j]]]]
-$var matcher_As = [[$for j, [[Matcher<A$j>]]]]
-$range k 1..i-1
-$var prev_As = [[$for k, [[A$k]]]]
-template <typename R$typename_As>
-struct Function<R($As)>
- : Function<R($prev_As)> {
- typedef A$i Argument$i;
- typedef ::std::tr1::tuple<$As> ArgumentTuple;
- typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
- typedef void MakeResultVoid($As);
- typedef IgnoredValue MakeResultIgnoredValue($As);
-};
-
-
-]]
-} // namespace internal
-
-} // namespace testing
-
-#endif // GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_GENERATED_INTERNAL_UTILS_H_
diff --git a/src/testing/include/gmock/internal/gmock-internal-utils.h b/src/testing/include/gmock/internal/gmock-internal-utils.h
deleted file mode 100644
index d63fb223..00000000
--- a/src/testing/include/gmock/internal/gmock-internal-utils.h
+++ /dev/null
@@ -1,471 +0,0 @@
-// Copyright 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-// Google Mock - a framework for writing C++ mock classes.
-//
-// This file defines some utilities useful for implementing Google
-// Mock. They are subject to change without notice, so please DO NOT
-// USE THEM IN USER CODE.
-
-#ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_INTERNAL_UTILS_H_
-#define GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_INTERNAL_UTILS_H_
-
-#include <stdio.h>
-#include <ostream> // NOLINT
-#include <string>
-
-#include "gmock/internal/gmock-generated-internal-utils.h"
-#include "gmock/internal/gmock-port.h"
-#include "gtest/gtest.h"
-
-namespace testing {
-namespace internal {
-
-// Converts an identifier name to a space-separated list of lower-case
-// words. Each maximum substring of the form [A-Za-z][a-z]*|\d+ is
-// treated as one word. For example, both "FooBar123" and
-// "foo_bar_123" are converted to "foo bar 123".
-GTEST_API_ string ConvertIdentifierNameToWords(const char* id_name);
-
-// PointeeOf<Pointer>::type is the type of a value pointed to by a
-// Pointer, which can be either a smart pointer or a raw pointer. The
-// following default implementation is for the case where Pointer is a
-// smart pointer.
-template <typename Pointer>
-struct PointeeOf {
- // Smart pointer classes define type element_type as the type of
- // their pointees.
- typedef typename Pointer::element_type type;
-};
-// This specialization is for the raw pointer case.
-template <typename T>
-struct PointeeOf<T*> { typedef T type; }; // NOLINT
-
-// GetRawPointer(p) returns the raw pointer underlying p when p is a
-// smart pointer, or returns p itself when p is already a raw pointer.
-// The following default implementation is for the smart pointer case.
-template <typename Pointer>
-inline const typename Pointer::element_type* GetRawPointer(const Pointer& p) {
- return p.get();
-}
-// This overloaded version is for the raw pointer case.
-template <typename Element>
-inline Element* GetRawPointer(Element* p) { return p; }
-
-// This comparator allows linked_ptr to be stored in sets.
-template <typename T>
-struct LinkedPtrLessThan {
- bool operator()(const ::testing::internal::linked_ptr<T>& lhs,
- const ::testing::internal::linked_ptr<T>& rhs) const {
- return lhs.get() < rhs.get();
- }
-};
-
-// Symbian compilation can be done with wchar_t being either a native
-// type or a typedef. Using Google Mock with OpenC without wchar_t
-// should require the definition of _STLP_NO_WCHAR_T.
-//
-// MSVC treats wchar_t as a native type usually, but treats it as the
-// same as unsigned short when the compiler option /Zc:wchar_t- is
-// specified. It defines _NATIVE_WCHAR_T_DEFINED symbol when wchar_t
-// is a native type.
-#if (GTEST_OS_SYMBIAN && defined(_STLP_NO_WCHAR_T)) || \
- (defined(_MSC_VER) && !defined(_NATIVE_WCHAR_T_DEFINED))
-// wchar_t is a typedef.
-#else
-# define GMOCK_WCHAR_T_IS_NATIVE_ 1
-#endif
-
-// signed wchar_t and unsigned wchar_t are NOT in the C++ standard.
-// Using them is a bad practice and not portable. So DON'T use them.
-//
-// Still, Google Mock is designed to work even if the user uses signed
-// wchar_t or unsigned wchar_t (obviously, assuming the compiler
-// supports them).
-//
-// To gcc,
-// wchar_t == signed wchar_t != unsigned wchar_t == unsigned int
-#ifdef __GNUC__
-// signed/unsigned wchar_t are valid types.
-# define GMOCK_HAS_SIGNED_WCHAR_T_ 1
-#endif
-
-// In what follows, we use the term "kind" to indicate whether a type
-// is bool, an integer type (excluding bool), a floating-point type,
-// or none of them. This categorization is useful for determining
-// when a matcher argument type can be safely converted to another
-// type in the implementation of SafeMatcherCast.
-enum TypeKind {
- kBool, kInteger, kFloatingPoint, kOther
-};
-
-// KindOf<T>::value is the kind of type T.
-template <typename T> struct KindOf {
- enum { value = kOther }; // The default kind.
-};
-
-// This macro declares that the kind of 'type' is 'kind'.
-#define GMOCK_DECLARE_KIND_(type, kind) \
- template <> struct KindOf<type> { enum { value = kind }; }
-
-GMOCK_DECLARE_KIND_(bool, kBool);
-
-// All standard integer types.
-GMOCK_DECLARE_KIND_(char, kInteger);
-GMOCK_DECLARE_KIND_(signed char, kInteger);
-GMOCK_DECLARE_KIND_(unsigned char, kInteger);
-GMOCK_DECLARE_KIND_(short, kInteger); // NOLINT
-GMOCK_DECLARE_KIND_(unsigned short, kInteger); // NOLINT
-GMOCK_DECLARE_KIND_(int, kInteger);
-GMOCK_DECLARE_KIND_(unsigned int, kInteger);
-GMOCK_DECLARE_KIND_(long, kInteger); // NOLINT
-GMOCK_DECLARE_KIND_(unsigned long, kInteger); // NOLINT
-
-#if GMOCK_WCHAR_T_IS_NATIVE_
-GMOCK_DECLARE_KIND_(wchar_t, kInteger);
-#endif
-
-// Non-standard integer types.
-GMOCK_DECLARE_KIND_(Int64, kInteger);
-GMOCK_DECLARE_KIND_(UInt64, kInteger);
-
-// All standard floating-point types.
-GMOCK_DECLARE_KIND_(float, kFloatingPoint);
-GMOCK_DECLARE_KIND_(double, kFloatingPoint);
-GMOCK_DECLARE_KIND_(long double, kFloatingPoint);
-
-#undef GMOCK_DECLARE_KIND_
-
-// Evaluates to the kind of 'type'.
-#define GMOCK_KIND_OF_(type) \
- static_cast< ::testing::internal::TypeKind>( \
- ::testing::internal::KindOf<type>::value)
-
-// Evaluates to true iff integer type T is signed.
-#define GMOCK_IS_SIGNED_(T) (static_cast<T>(-1) < 0)
-
-// LosslessArithmeticConvertibleImpl<kFromKind, From, kToKind, To>::value
-// is true iff arithmetic type From can be losslessly converted to
-// arithmetic type To.
-//
-// It's the user's responsibility to ensure that both From and To are
-// raw (i.e. has no CV modifier, is not a pointer, and is not a
-// reference) built-in arithmetic types, kFromKind is the kind of
-// From, and kToKind is the kind of To; the value is
-// implementation-defined when the above pre-condition is violated.
-template <TypeKind kFromKind, typename From, TypeKind kToKind, typename To>
-struct LosslessArithmeticConvertibleImpl : public false_type {};
-
-// Converting bool to bool is lossless.
-template <>
-struct LosslessArithmeticConvertibleImpl<kBool, bool, kBool, bool>
- : public true_type {}; // NOLINT
-
-// Converting bool to any integer type is lossless.
-template <typename To>
-struct LosslessArithmeticConvertibleImpl<kBool, bool, kInteger, To>
- : public true_type {}; // NOLINT
-
-// Converting bool to any floating-point type is lossless.
-template <typename To>
-struct LosslessArithmeticConvertibleImpl<kBool, bool, kFloatingPoint, To>
- : public true_type {}; // NOLINT
-
-// Converting an integer to bool is lossy.
-template <typename From>
-struct LosslessArithmeticConvertibleImpl<kInteger, From, kBool, bool>
- : public false_type {}; // NOLINT
-
-// Converting an integer to another non-bool integer is lossless iff
-// the target type's range encloses the source type's range.
-template <typename From, typename To>
-struct LosslessArithmeticConvertibleImpl<kInteger, From, kInteger, To>
- : public bool_constant<
- // When converting from a smaller size to a larger size, we are
- // fine as long as we are not converting from signed to unsigned.
- ((sizeof(From) < sizeof(To)) &&
- (!GMOCK_IS_SIGNED_(From) || GMOCK_IS_SIGNED_(To))) ||
- // When converting between the same size, the signedness must match.
- ((sizeof(From) == sizeof(To)) &&
- (GMOCK_IS_SIGNED_(From) == GMOCK_IS_SIGNED_(To)))> {}; // NOLINT
-
-#undef GMOCK_IS_SIGNED_
-
-// Converting an integer to a floating-point type may be lossy, since
-// the format of a floating-point number is implementation-defined.
-template <typename From, typename To>
-struct LosslessArithmeticConvertibleImpl<kInteger, From, kFloatingPoint, To>
- : public false_type {}; // NOLINT
-
-// Converting a floating-point to bool is lossy.
-template <typename From>
-struct LosslessArithmeticConvertibleImpl<kFloatingPoint, From, kBool, bool>
- : public false_type {}; // NOLINT
-
-// Converting a floating-point to an integer is lossy.
-template <typename From, typename To>
-struct LosslessArithmeticConvertibleImpl<kFloatingPoint, From, kInteger, To>
- : public false_type {}; // NOLINT
-
-// Converting a floating-point to another floating-point is lossless
-// iff the target type is at least as big as the source type.
-template <typename From, typename To>
-struct LosslessArithmeticConvertibleImpl<
- kFloatingPoint, From, kFloatingPoint, To>
- : public bool_constant<sizeof(From) <= sizeof(To)> {}; // NOLINT
-
-// LosslessArithmeticConvertible<From, To>::value is true iff arithmetic
-// type From can be losslessly converted to arithmetic type To.
-//
-// It's the user's responsibility to ensure that both From and To are
-// raw (i.e. has no CV modifier, is not a pointer, and is not a
-// reference) built-in arithmetic types; the value is
-// implementation-defined when the above pre-condition is violated.
-template <typename From, typename To>
-struct LosslessArithmeticConvertible
- : public LosslessArithmeticConvertibleImpl<
- GMOCK_KIND_OF_(From), From, GMOCK_KIND_OF_(To), To> {}; // NOLINT
-
-// This interface knows how to report a Google Mock failure (either
-// non-fatal or fatal).
-class FailureReporterInterface {
- public:
- // The type of a failure (either non-fatal or fatal).
- enum FailureType {
- kNonfatal, kFatal
- };
-
- virtual ~FailureReporterInterface() {}
-
- // Reports a failure that occurred at the given source file location.
- virtual void ReportFailure(FailureType type, const char* file, int line,
- const string& message) = 0;
-};
-
-// Returns the failure reporter used by Google Mock.
-GTEST_API_ FailureReporterInterface* GetFailureReporter();
-
-// Asserts that condition is true; aborts the process with the given
-// message if condition is false. We cannot use LOG(FATAL) or CHECK()
-// as Google Mock might be used to mock the log sink itself. We
-// inline this function to prevent it from showing up in the stack
-// trace.
-inline void Assert(bool condition, const char* file, int line,
- const string& msg) {
- if (!condition) {
- GetFailureReporter()->ReportFailure(FailureReporterInterface::kFatal,
- file, line, msg);
- }
-}
-inline void Assert(bool condition, const char* file, int line) {
- Assert(condition, file, line, "Assertion failed.");
-}
-
-// Verifies that condition is true; generates a non-fatal failure if
-// condition is false.
-inline void Expect(bool condition, const char* file, int line,
- const string& msg) {
- if (!condition) {
- GetFailureReporter()->ReportFailure(FailureReporterInterface::kNonfatal,
- file, line, msg);
- }
-}
-inline void Expect(bool condition, const char* file, int line) {
- Expect(condition, file, line, "Expectation failed.");
-}
-
-// Severity level of a log.
-enum LogSeverity {
- kInfo = 0,
- kWarning = 1
-};
-
-// Valid values for the --gmock_verbose flag.
-
-// All logs (informational and warnings) are printed.
-const char kInfoVerbosity[] = "info";
-// Only warnings are printed.
-const char kWarningVerbosity[] = "warning";
-// No logs are printed.
-const char kErrorVerbosity[] = "error";
-
-// Returns true iff a log with the given severity is visible according
-// to the --gmock_verbose flag.
-GTEST_API_ bool LogIsVisible(LogSeverity severity);
-
-// Prints the given message to stdout iff 'severity' >= the level
-// specified by the --gmock_verbose flag. If stack_frames_to_skip >=
-// 0, also prints the stack trace excluding the top
-// stack_frames_to_skip frames. In opt mode, any positive
-// stack_frames_to_skip is treated as 0, since we don't know which
-// function calls will be inlined by the compiler and need to be
-// conservative.
-GTEST_API_ void Log(LogSeverity severity,
- const string& message,
- int stack_frames_to_skip);
-
-// TODO(wan@google.com): group all type utilities together.
-
-// Type traits.
-
-// is_reference<T>::value is non-zero iff T is a reference type.
-template <typename T> struct is_reference : public false_type {};
-template <typename T> struct is_reference<T&> : public true_type {};
-
-// type_equals<T1, T2>::value is non-zero iff T1 and T2 are the same type.
-template <typename T1, typename T2> struct type_equals : public false_type {};
-template <typename T> struct type_equals<T, T> : public true_type {};
-
-// remove_reference<T>::type removes the reference from type T, if any.
-template <typename T> struct remove_reference { typedef T type; }; // NOLINT
-template <typename T> struct remove_reference<T&> { typedef T type; }; // NOLINT
-
-// Invalid<T>() returns an invalid value of type T. This is useful
-// when a value of type T is needed for compilation, but the statement
-// will not really be executed (or we don't care if the statement
-// crashes).
-template <typename T>
-inline T Invalid() {
- return const_cast<typename remove_reference<T>::type&>(
- *static_cast<volatile typename remove_reference<T>::type*>(NULL));
-}
-template <>
-inline void Invalid<void>() {}
-
-// Given a raw type (i.e. having no top-level reference or const
-// modifier) RawContainer that's either an STL-style container or a
-// native array, class StlContainerView<RawContainer> has the
-// following members:
-//
-// - type is a type that provides an STL-style container view to
-// (i.e. implements the STL container concept for) RawContainer;
-// - const_reference is a type that provides a reference to a const
-// RawContainer;
-// - ConstReference(raw_container) returns a const reference to an STL-style
-// container view to raw_container, which is a RawContainer.
-// - Copy(raw_container) returns an STL-style container view of a
-// copy of raw_container, which is a RawContainer.
-//
-// This generic version is used when RawContainer itself is already an
-// STL-style container.
-template <class RawContainer>
-class StlContainerView {
- public:
- typedef RawContainer type;
- typedef const type& const_reference;
-
- static const_reference ConstReference(const RawContainer& container) {
- // Ensures that RawContainer is not a const type.
- testing::StaticAssertTypeEq<RawContainer,
- GTEST_REMOVE_CONST_(RawContainer)>();
- return container;
- }
- static type Copy(const RawContainer& container) { return container; }
-};
-
-// This specialization is used when RawContainer is a native array type.
-template <typename Element, size_t N>
-class StlContainerView<Element[N]> {
- public:
- typedef GTEST_REMOVE_CONST_(Element) RawElement;
- typedef internal::NativeArray<RawElement> type;
- // NativeArray<T> can represent a native array either by value or by
- // reference (selected by a constructor argument), so 'const type'
- // can be used to reference a const native array. We cannot
- // 'typedef const type& const_reference' here, as that would mean
- // ConstReference() has to return a reference to a local variable.
- typedef const type const_reference;
-
- static const_reference ConstReference(const Element (&array)[N]) {
- // Ensures that Element is not a const type.
- testing::StaticAssertTypeEq<Element, RawElement>();
-#if GTEST_OS_SYMBIAN
- // The Nokia Symbian compiler confuses itself in template instantiation
- // for this call without the cast to Element*:
- // function call '[testing::internal::NativeArray<char *>].NativeArray(
- // {lval} const char *[4], long, testing::internal::RelationToSource)'
- // does not match
- // 'testing::internal::NativeArray<char *>::NativeArray(
- // char *const *, unsigned int, testing::internal::RelationToSource)'
- // (instantiating: 'testing::internal::ContainsMatcherImpl
- // <const char * (&)[4]>::Matches(const char * (&)[4]) const')
- // (instantiating: 'testing::internal::StlContainerView<char *[4]>::
- // ConstReference(const char * (&)[4])')
- // (and though the N parameter type is mismatched in the above explicit
- // conversion of it doesn't help - only the conversion of the array).
- return type(const_cast<Element*>(&array[0]), N, kReference);
-#else
- return type(array, N, kReference);
-#endif // GTEST_OS_SYMBIAN
- }
- static type Copy(const Element (&array)[N]) {
-#if GTEST_OS_SYMBIAN
- return type(const_cast<Element*>(&array[0]), N, kCopy);
-#else
- return type(array, N, kCopy);
-#endif // GTEST_OS_SYMBIAN
- }
-};
-
-// This specialization is used when RawContainer is a native array
-// represented as a (pointer, size) tuple.
-template <typename ElementPointer, typename Size>
-class StlContainerView< ::std::tr1::tuple<ElementPointer, Size> > {
- public:
- typedef GTEST_REMOVE_CONST_(
- typename internal::PointeeOf<ElementPointer>::type) RawElement;
- typedef internal::NativeArray<RawElement> type;
- typedef const type const_reference;
-
- static const_reference ConstReference(
- const ::std::tr1::tuple<ElementPointer, Size>& array) {
- using ::std::tr1::get;
- return type(get<0>(array), get<1>(array), kReference);
- }
- static type Copy(const ::std::tr1::tuple<ElementPointer, Size>& array) {
- using ::std::tr1::get;
- return type(get<0>(array), get<1>(array), kCopy);
- }
-};
-
-// The following specialization prevents the user from instantiating
-// StlContainer with a reference type.
-template <typename T> class StlContainerView<T&>;
-
-// Mapping from booleans to types. Similar to boost::bool_<kValue> and
-// std::integral_constant<bool, kValue>.
-template <bool kValue>
-struct BooleanConstant {};
-
-} // namespace internal
-} // namespace testing
-
-#endif // GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_INTERNAL_UTILS_H_
diff --git a/src/testing/include/gmock/internal/gmock-port.h b/src/testing/include/gmock/internal/gmock-port.h
deleted file mode 100644
index 6a515d87..00000000
--- a/src/testing/include/gmock/internal/gmock-port.h
+++ /dev/null
@@ -1,78 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: vadimb@google.com (Vadim Berman)
-//
-// Low-level types and utilities for porting Google Mock to various
-// platforms. They are subject to change without notice. DO NOT USE
-// THEM IN USER CODE.
-
-#ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_PORT_H_
-#define GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_PORT_H_
-
-#include <assert.h>
-#include <stdlib.h>
-#include <iostream>
-
-// Most of the types needed for porting Google Mock are also required
-// for Google Test and are defined in gtest-port.h.
-#include "gtest/internal/gtest-linked_ptr.h"
-#include "gtest/internal/gtest-port.h"
-
-// To avoid conditional compilation everywhere, we make it
-// gmock-port.h's responsibility to #include the header implementing
-// tr1/tuple. gmock-port.h does this via gtest-port.h, which is
-// guaranteed to pull in the tuple header.
-
-// For MS Visual C++, check the compiler version. At least VS 2003 is
-// required to compile Google Mock.
-#if defined(_MSC_VER) && _MSC_VER < 1310
-# error "At least Visual C++ 2003 (7.1) is required to compile Google Mock."
-#endif
-
-// Macro for referencing flags. This is public as we want the user to
-// use this syntax to reference Google Mock flags.
-#define GMOCK_FLAG(name) FLAGS_gmock_##name
-
-// Macros for declaring flags.
-#define GMOCK_DECLARE_bool_(name) extern GTEST_API_ bool GMOCK_FLAG(name)
-#define GMOCK_DECLARE_int32_(name) \
- extern GTEST_API_ ::testing::internal::Int32 GMOCK_FLAG(name)
-#define GMOCK_DECLARE_string_(name) \
- extern GTEST_API_ ::testing::internal::String GMOCK_FLAG(name)
-
-// Macros for defining flags.
-#define GMOCK_DEFINE_bool_(name, default_val, doc) \
- GTEST_API_ bool GMOCK_FLAG(name) = (default_val)
-#define GMOCK_DEFINE_int32_(name, default_val, doc) \
- GTEST_API_ ::testing::internal::Int32 GMOCK_FLAG(name) = (default_val)
-#define GMOCK_DEFINE_string_(name, default_val, doc) \
- GTEST_API_ ::testing::internal::String GMOCK_FLAG(name) = (default_val)
-
-#endif // GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_PORT_H_
diff --git a/src/testing/make/Makefile b/src/testing/make/Makefile
deleted file mode 100644
index 6386e5b2..00000000
--- a/src/testing/make/Makefile
+++ /dev/null
@@ -1,98 +0,0 @@
-# A sample Makefile for building both Google Mock and Google Test and
-# using them in user tests. This file is self-contained, so you don't
-# need to use the Makefile in Google Test's source tree. Please tweak
-# it to suit your environment and project. You may want to move it to
-# your project's root directory.
-#
-# SYNOPSIS:
-#
-# make [all] - makes everything.
-# make TARGET - makes the given target.
-# make clean - removes all files generated by make.
-
-# Please tweak the following variable definitions as needed by your
-# project, except GMOCK_HEADERS and GTEST_HEADERS, which you can use
-# in your own targets but shouldn't modify.
-
-# Points to the root of Google Test, relative to where this file is.
-# Remember to tweak this if you move this file, or if you want to use
-# a copy of Google Test at a different location.
-GTEST_DIR = ../gtest
-
-# Points to the root of Google Mock, relative to where this file is.
-# Remember to tweak this if you move this file.
-GMOCK_DIR = ..
-
-# Where to find user code.
-USER_DIR = ../test
-
-# Flags passed to the preprocessor.
-CPPFLAGS += -I$(GTEST_DIR)/include -I$(GMOCK_DIR)/include
-
-# Flags passed to the C++ compiler.
-CXXFLAGS += -g -Wall -Wextra
-
-# All tests produced by this Makefile. Remember to add new tests you
-# created to the list.
-TESTS = gmock_test
-
-# All Google Test headers. Usually you shouldn't change this
-# definition.
-GTEST_HEADERS = $(GTEST_DIR)/include/gtest/*.h \
- $(GTEST_DIR)/include/gtest/internal/*.h
-
-# All Google Mock headers. Note that all Google Test headers are
-# included here too, as they are #included by Google Mock headers.
-# Usually you shouldn't change this definition.
-GMOCK_HEADERS = $(GMOCK_DIR)/include/gmock/*.h \
- $(GMOCK_DIR)/include/gmock/internal/*.h \
- $(GTEST_HEADERS)
-
-# House-keeping build targets.
-
-all : $(TESTS)
-
-clean :
- rm -f $(TESTS) gmock.a gmock_main.a *.o
-
-# Builds gmock.a and gmock_main.a. These libraries contain both
-# Google Mock and Google Test. A test should link with either gmock.a
-# or gmock_main.a, depending on whether it defines its own main()
-# function. It's fine if your test only uses features from Google
-# Test (and not Google Mock).
-
-# Usually you shouldn't tweak such internal variables, indicated by a
-# trailing _.
-GTEST_SRCS_ = $(GTEST_DIR)/src/*.cc $(GTEST_DIR)/src/*.h $(GTEST_HEADERS)
-GMOCK_SRCS_ = $(GMOCK_DIR)/src/*.cc $(GMOCK_HEADERS)
-
-# For simplicity and to avoid depending on implementation details of
-# Google Mock and Google Test, the dependencies specified below are
-# conservative and not optimized. This is fine as Google Mock and
-# Google Test compile fast and for ordinary users their source rarely
-# changes.
-gtest-all.o : $(GTEST_SRCS_)
- $(CXX) $(CPPFLAGS) -I$(GTEST_DIR) -I$(GMOCK_DIR) $(CXXFLAGS) \
- -c $(GTEST_DIR)/src/gtest-all.cc
-
-gmock-all.o : $(GMOCK_SRCS_)
- $(CXX) $(CPPFLAGS) -I$(GTEST_DIR) -I$(GMOCK_DIR) $(CXXFLAGS) \
- -c $(GMOCK_DIR)/src/gmock-all.cc
-
-gmock_main.o : $(GMOCK_SRCS_)
- $(CXX) $(CPPFLAGS) -I$(GTEST_DIR) -I$(GMOCK_DIR) $(CXXFLAGS) \
- -c $(GMOCK_DIR)/src/gmock_main.cc
-
-gmock.a : gmock-all.o gtest-all.o
- $(AR) $(ARFLAGS) $@ $^
-
-gmock_main.a : gmock-all.o gtest-all.o gmock_main.o
- $(AR) $(ARFLAGS) $@ $^
-
-# Builds a sample test.
-
-gmock_test.o : $(USER_DIR)/gmock_test.cc $(GMOCK_HEADERS)
- $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(USER_DIR)/gmock_test.cc
-
-gmock_test : gmock_test.o gmock_main.a
- $(CXX) $(CPPFLAGS) $(CXXFLAGS) -lpthread $^ -o $@
diff --git a/src/testing/msvc/2005/gmock.sln b/src/testing/msvc/2005/gmock.sln
deleted file mode 100644
index b752f876..00000000
--- a/src/testing/msvc/2005/gmock.sln
+++ /dev/null
@@ -1,32 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 9.00
-# Visual Studio 2005
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gmock", "gmock.vcproj", "{34681F0D-CE45-415D-B5F2-5C662DFE3BD5}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gmock_test", "gmock_test.vcproj", "{F10D22F8-AC7B-4213-8720-608E7D878CD2}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gmock_main", "gmock_main.vcproj", "{E4EF614B-30DF-4954-8C53-580A0BF6B589}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Win32 = Debug|Win32
- Release|Win32 = Release|Win32
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {34681F0D-CE45-415D-B5F2-5C662DFE3BD5}.Debug|Win32.ActiveCfg = Debug|Win32
- {34681F0D-CE45-415D-B5F2-5C662DFE3BD5}.Debug|Win32.Build.0 = Debug|Win32
- {34681F0D-CE45-415D-B5F2-5C662DFE3BD5}.Release|Win32.ActiveCfg = Release|Win32
- {34681F0D-CE45-415D-B5F2-5C662DFE3BD5}.Release|Win32.Build.0 = Release|Win32
- {F10D22F8-AC7B-4213-8720-608E7D878CD2}.Debug|Win32.ActiveCfg = Debug|Win32
- {F10D22F8-AC7B-4213-8720-608E7D878CD2}.Debug|Win32.Build.0 = Debug|Win32
- {F10D22F8-AC7B-4213-8720-608E7D878CD2}.Release|Win32.ActiveCfg = Release|Win32
- {F10D22F8-AC7B-4213-8720-608E7D878CD2}.Release|Win32.Build.0 = Release|Win32
- {E4EF614B-30DF-4954-8C53-580A0BF6B589}.Debug|Win32.ActiveCfg = Debug|Win32
- {E4EF614B-30DF-4954-8C53-580A0BF6B589}.Debug|Win32.Build.0 = Debug|Win32
- {E4EF614B-30DF-4954-8C53-580A0BF6B589}.Release|Win32.ActiveCfg = Release|Win32
- {E4EF614B-30DF-4954-8C53-580A0BF6B589}.Release|Win32.Build.0 = Release|Win32
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/src/testing/msvc/2005/gmock.vcproj b/src/testing/msvc/2005/gmock.vcproj
deleted file mode 100644
index 4bbfe989..00000000
--- a/src/testing/msvc/2005/gmock.vcproj
+++ /dev/null
@@ -1,191 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="8.00"
- Name="gmock"
- ProjectGUID="{34681F0D-CE45-415D-B5F2-5C662DFE3BD5}"
- RootNamespace="gmock"
- Keyword="Win32Proj"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="$(OutDir)\$(ProjectName)"
- ConfigurationType="4"
- InheritedPropertySheets=".\gmock_config.vsprops"
- CharacterSet="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\include;..\.."
- PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="1"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="true"
- DebugInformationFormat="3"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="$(OutDir)\$(ProjectName)"
- ConfigurationType="4"
- InheritedPropertySheets=".\gmock_config.vsprops"
- CharacterSet="1"
- WholeProgramOptimization="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\include;..\.."
- PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
- RuntimeLibrary="0"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="true"
- DebugInformationFormat="3"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
- >
- <File
- RelativePath="..\..\src\gmock-all.cc"
- >
- </File>
- <File
- RelativePath="$(GTestDir)\src\gtest-all.cc"
- >
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="$(GTestDir)"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="$(GTestDir)"
- />
- </FileConfiguration>
- </File>
- </Filter>
- <Filter
- Name="Public Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
- >
- </Filter>
- <Filter
- Name="Private Header Files"
- >
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/src/testing/msvc/2005/gmock_config.vsprops b/src/testing/msvc/2005/gmock_config.vsprops
deleted file mode 100644
index 8b65cfb6..00000000
--- a/src/testing/msvc/2005/gmock_config.vsprops
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioPropertySheet
- ProjectType="Visual C++"
- Version="8.00"
- Name="gmock_config"
- >
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="&quot;$(GTestDir)/include&quot;"
- />
- <UserMacro
- Name="GTestDir"
- Value="../../gtest"
- />
-</VisualStudioPropertySheet>
diff --git a/src/testing/msvc/2005/gmock_main.vcproj b/src/testing/msvc/2005/gmock_main.vcproj
deleted file mode 100644
index 01505a93..00000000
--- a/src/testing/msvc/2005/gmock_main.vcproj
+++ /dev/null
@@ -1,187 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="8.00"
- Name="gmock_main"
- ProjectGUID="{E4EF614B-30DF-4954-8C53-580A0BF6B589}"
- RootNamespace="gmock_main"
- Keyword="Win32Proj"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="$(OutDir)\$(ProjectName)"
- ConfigurationType="4"
- InheritedPropertySheets=".\gmock_config.vsprops"
- CharacterSet="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="../../include"
- PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="1"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="true"
- DebugInformationFormat="3"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="$(OutDir)\$(ProjectName)"
- ConfigurationType="4"
- InheritedPropertySheets=".\gmock_config.vsprops"
- CharacterSet="1"
- WholeProgramOptimization="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="../../include"
- PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
- RuntimeLibrary="0"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="true"
- DebugInformationFormat="3"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- <ProjectReference
- ReferencedProjectIdentifier="{34681F0D-CE45-415D-B5F2-5C662DFE3BD5}"
- RelativePathToProject=".\gmock.vcproj"
- />
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
- >
- <File
- RelativePath="..\..\src\gmock_main.cc"
- >
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="../../include"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="../../include"
- />
- </FileConfiguration>
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
- >
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/src/testing/msvc/2005/gmock_test.vcproj b/src/testing/msvc/2005/gmock_test.vcproj
deleted file mode 100644
index d1e01e71..00000000
--- a/src/testing/msvc/2005/gmock_test.vcproj
+++ /dev/null
@@ -1,201 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="8.00"
- Name="gmock_test"
- ProjectGUID="{F10D22F8-AC7B-4213-8720-608E7D878CD2}"
- RootNamespace="gmock_test"
- Keyword="Win32Proj"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="$(OutDir)\$(ProjectName)"
- ConfigurationType="1"
- InheritedPropertySheets=".\gmock_config.vsprops"
- CharacterSet="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalOptions="/bigobj"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\include;..\.."
- PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="1"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="true"
- DebugInformationFormat="3"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- LinkIncremental="2"
- GenerateDebugInformation="true"
- SubSystem="1"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="$(OutDir)\$(ProjectName)"
- ConfigurationType="1"
- InheritedPropertySheets=".\gmock_config.vsprops"
- CharacterSet="1"
- WholeProgramOptimization="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalOptions="/bigobj"
- AdditionalIncludeDirectories="..\..\include;..\.."
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
- RuntimeLibrary="0"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="true"
- DebugInformationFormat="3"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- LinkIncremental="1"
- GenerateDebugInformation="true"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- <ProjectReference
- ReferencedProjectIdentifier="{E4EF614B-30DF-4954-8C53-580A0BF6B589}"
- RelativePathToProject=".\gmock_main.vcproj"
- />
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
- >
- <File
- RelativePath="..\..\test\gmock_all_test.cc"
- >
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
- >
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/src/testing/msvc/2010/gmock.sln b/src/testing/msvc/2010/gmock.sln
deleted file mode 100644
index d9496569..00000000
--- a/src/testing/msvc/2010/gmock.sln
+++ /dev/null
@@ -1,32 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual C++ Express 2010
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gmock", "gmock.vcxproj", "{34681F0D-CE45-415D-B5F2-5C662DFE3BD5}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gmock_test", "gmock_test.vcxproj", "{F10D22F8-AC7B-4213-8720-608E7D878CD2}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gmock_main", "gmock_main.vcxproj", "{E4EF614B-30DF-4954-8C53-580A0BF6B589}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Win32 = Debug|Win32
- Release|Win32 = Release|Win32
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {34681F0D-CE45-415D-B5F2-5C662DFE3BD5}.Debug|Win32.ActiveCfg = Debug|Win32
- {34681F0D-CE45-415D-B5F2-5C662DFE3BD5}.Debug|Win32.Build.0 = Debug|Win32
- {34681F0D-CE45-415D-B5F2-5C662DFE3BD5}.Release|Win32.ActiveCfg = Release|Win32
- {34681F0D-CE45-415D-B5F2-5C662DFE3BD5}.Release|Win32.Build.0 = Release|Win32
- {F10D22F8-AC7B-4213-8720-608E7D878CD2}.Debug|Win32.ActiveCfg = Debug|Win32
- {F10D22F8-AC7B-4213-8720-608E7D878CD2}.Debug|Win32.Build.0 = Debug|Win32
- {F10D22F8-AC7B-4213-8720-608E7D878CD2}.Release|Win32.ActiveCfg = Release|Win32
- {F10D22F8-AC7B-4213-8720-608E7D878CD2}.Release|Win32.Build.0 = Release|Win32
- {E4EF614B-30DF-4954-8C53-580A0BF6B589}.Debug|Win32.ActiveCfg = Debug|Win32
- {E4EF614B-30DF-4954-8C53-580A0BF6B589}.Debug|Win32.Build.0 = Debug|Win32
- {E4EF614B-30DF-4954-8C53-580A0BF6B589}.Release|Win32.ActiveCfg = Release|Win32
- {E4EF614B-30DF-4954-8C53-580A0BF6B589}.Release|Win32.Build.0 = Release|Win32
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/src/testing/msvc/2010/gmock.vcxproj b/src/testing/msvc/2010/gmock.vcxproj
deleted file mode 100644
index 21a85ef6..00000000
--- a/src/testing/msvc/2010/gmock.vcxproj
+++ /dev/null
@@ -1,82 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup Label="ProjectConfigurations">
- <ProjectConfiguration Include="Debug|Win32">
- <Configuration>Debug</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Release|Win32">
- <Configuration>Release</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- </ItemGroup>
- <PropertyGroup Label="Globals">
- <ProjectGuid>{34681F0D-CE45-415D-B5F2-5C662DFE3BD5}</ProjectGuid>
- <RootNamespace>gmock</RootNamespace>
- <Keyword>Win32Proj</Keyword>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
- <ConfigurationType>StaticLibrary</ConfigurationType>
- <CharacterSet>Unicode</CharacterSet>
- <WholeProgramOptimization>true</WholeProgramOptimization>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
- <ConfigurationType>StaticLibrary</ConfigurationType>
- <CharacterSet>Unicode</CharacterSet>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
- <ImportGroup Label="ExtensionSettings">
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- <Import Project="gmock_config.props" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- <Import Project="gmock_config.props" />
- </ImportGroup>
- <PropertyGroup Label="UserMacros" />
- <PropertyGroup>
- <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(OutDir)$(ProjectName)\</IntDir>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(OutDir)$(ProjectName)\</IntDir>
- </PropertyGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <ClCompile>
- <Optimization>Disabled</Optimization>
- <AdditionalIncludeDirectories>..\..\include;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <MinimalRebuild>true</MinimalRebuild>
- <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
- <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
- </ClCompile>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <ClCompile>
- <AdditionalIncludeDirectories>..\..\include;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
- </ClCompile>
- </ItemDefinitionGroup>
- <ItemGroup>
- <ClCompile Include="..\..\src\gmock-all.cc" />
- <ClCompile Include="$(GTestDir)\src\gtest-all.cc">
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(GTestDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(GTestDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- </ClCompile>
- </ItemGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
- <ImportGroup Label="ExtensionTargets">
- </ImportGroup>
-</Project>
diff --git a/src/testing/msvc/2010/gmock_config.props b/src/testing/msvc/2010/gmock_config.props
deleted file mode 100644
index bd497f1d..00000000
--- a/src/testing/msvc/2010/gmock_config.props
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup Label="UserMacros">
- <GTestDir>../../gtest</GTestDir>
- </PropertyGroup>
- <PropertyGroup>
- <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
- </PropertyGroup>
- <ItemDefinitionGroup>
- <ClCompile>
- <AdditionalIncludeDirectories>$(GTestDir)/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- </ClCompile>
- </ItemDefinitionGroup>
- <ItemGroup>
- <BuildMacro Include="GTestDir">
- <Value>$(GTestDir)</Value>
- </BuildMacro>
- </ItemGroup>
-</Project>
diff --git a/src/testing/msvc/2010/gmock_main.vcxproj b/src/testing/msvc/2010/gmock_main.vcxproj
deleted file mode 100644
index 27fecd5f..00000000
--- a/src/testing/msvc/2010/gmock_main.vcxproj
+++ /dev/null
@@ -1,88 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup Label="ProjectConfigurations">
- <ProjectConfiguration Include="Debug|Win32">
- <Configuration>Debug</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Release|Win32">
- <Configuration>Release</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- </ItemGroup>
- <PropertyGroup Label="Globals">
- <ProjectGuid>{E4EF614B-30DF-4954-8C53-580A0BF6B589}</ProjectGuid>
- <RootNamespace>gmock_main</RootNamespace>
- <Keyword>Win32Proj</Keyword>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
- <ConfigurationType>StaticLibrary</ConfigurationType>
- <CharacterSet>Unicode</CharacterSet>
- <WholeProgramOptimization>true</WholeProgramOptimization>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
- <ConfigurationType>StaticLibrary</ConfigurationType>
- <CharacterSet>Unicode</CharacterSet>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
- <ImportGroup Label="ExtensionSettings">
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- <Import Project="gmock_config.props" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- <Import Project="gmock_config.props" />
- </ImportGroup>
- <PropertyGroup Label="UserMacros" />
- <PropertyGroup>
- <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(OutDir)$(ProjectName)\</IntDir>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(OutDir)$(ProjectName)\</IntDir>
- </PropertyGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <ClCompile>
- <Optimization>Disabled</Optimization>
- <AdditionalIncludeDirectories>../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <MinimalRebuild>true</MinimalRebuild>
- <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
- <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
- </ClCompile>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <ClCompile>
- <AdditionalIncludeDirectories>../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
- </ClCompile>
- </ItemDefinitionGroup>
- <ItemGroup>
- <ProjectReference Include="gmock.vcxproj">
- <Project>{34681f0d-ce45-415d-b5f2-5c662dfe3bd5}</Project>
- <CopyLocalSatelliteAssemblies>true</CopyLocalSatelliteAssemblies>
- <ReferenceOutputAssembly>true</ReferenceOutputAssembly>
- </ProjectReference>
- </ItemGroup>
- <ItemGroup>
- <ClCompile Include="..\..\src\gmock_main.cc">
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- </ClCompile>
- </ItemGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
- <ImportGroup Label="ExtensionTargets">
- </ImportGroup>
-</Project>
diff --git a/src/testing/msvc/2010/gmock_test.vcxproj b/src/testing/msvc/2010/gmock_test.vcxproj
deleted file mode 100644
index 265439ec..00000000
--- a/src/testing/msvc/2010/gmock_test.vcxproj
+++ /dev/null
@@ -1,101 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup Label="ProjectConfigurations">
- <ProjectConfiguration Include="Debug|Win32">
- <Configuration>Debug</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Release|Win32">
- <Configuration>Release</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- </ItemGroup>
- <PropertyGroup Label="Globals">
- <ProjectGuid>{F10D22F8-AC7B-4213-8720-608E7D878CD2}</ProjectGuid>
- <RootNamespace>gmock_test</RootNamespace>
- <Keyword>Win32Proj</Keyword>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <CharacterSet>Unicode</CharacterSet>
- <WholeProgramOptimization>true</WholeProgramOptimization>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <CharacterSet>Unicode</CharacterSet>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
- <ImportGroup Label="ExtensionSettings">
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- <Import Project="gmock_config.props" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- <Import Project="gmock_config.props" />
- </ImportGroup>
- <PropertyGroup Label="UserMacros" />
- <PropertyGroup>
- <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(OutDir)$(ProjectName)\</IntDir>
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(OutDir)$(ProjectName)\</IntDir>
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
- </PropertyGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <ClCompile>
- <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
- <Optimization>Disabled</Optimization>
- <AdditionalIncludeDirectories>..\..\include;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <MinimalRebuild>true</MinimalRebuild>
- <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
- <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
- </ClCompile>
- <Link>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <SubSystem>Console</SubSystem>
- <TargetMachine>MachineX86</TargetMachine>
- </Link>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <ClCompile>
- <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
- <AdditionalIncludeDirectories>..\..\include;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
- </ClCompile>
- <Link>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <SubSystem>Console</SubSystem>
- <OptimizeReferences>true</OptimizeReferences>
- <EnableCOMDATFolding>true</EnableCOMDATFolding>
- <TargetMachine>MachineX86</TargetMachine>
- </Link>
- </ItemDefinitionGroup>
- <ItemGroup>
- <ProjectReference Include="gmock_main.vcxproj">
- <Project>{e4ef614b-30df-4954-8c53-580a0bf6b589}</Project>
- <CopyLocalSatelliteAssemblies>true</CopyLocalSatelliteAssemblies>
- <ReferenceOutputAssembly>true</ReferenceOutputAssembly>
- </ProjectReference>
- </ItemGroup>
- <ItemGroup>
- <ClCompile Include="..\..\test\gmock_all_test.cc" />
- </ItemGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
- <ImportGroup Label="ExtensionTargets">
- </ImportGroup>
-</Project>
diff --git a/src/testing/scripts/fuse_gmock_files.py b/src/testing/scripts/fuse_gmock_files.py
deleted file mode 100755
index fc0baf79..00000000
--- a/src/testing/scripts/fuse_gmock_files.py
+++ /dev/null
@@ -1,240 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2009, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-"""fuse_gmock_files.py v0.1.0
-Fuses Google Mock and Google Test source code into two .h files and a .cc file.
-
-SYNOPSIS
- fuse_gmock_files.py [GMOCK_ROOT_DIR] OUTPUT_DIR
-
- Scans GMOCK_ROOT_DIR for Google Mock and Google Test source
- code, assuming Google Test is in the GMOCK_ROOT_DIR/gtest
- sub-directory, and generates three files:
- OUTPUT_DIR/gtest/gtest.h, OUTPUT_DIR/gmock/gmock.h, and
- OUTPUT_DIR/gmock-gtest-all.cc. Then you can build your tests
- by adding OUTPUT_DIR to the include search path and linking
- with OUTPUT_DIR/gmock-gtest-all.cc. These three files contain
- everything you need to use Google Mock. Hence you can
- "install" Google Mock by copying them to wherever you want.
-
- GMOCK_ROOT_DIR can be omitted and defaults to the parent
- directory of the directory holding this script.
-
-EXAMPLES
- ./fuse_gmock_files.py fused_gmock
- ./fuse_gmock_files.py path/to/unpacked/gmock fused_gmock
-
-This tool is experimental. In particular, it assumes that there is no
-conditional inclusion of Google Mock or Google Test headers. Please
-report any problems to googlemock@googlegroups.com. You can read
-http://code.google.com/p/googlemock/wiki/CookBook for more
-information.
-"""
-
-__author__ = 'wan@google.com (Zhanyong Wan)'
-
-import os
-import re
-import sets
-import sys
-
-# We assume that this file is in the scripts/ directory in the Google
-# Mock root directory.
-DEFAULT_GMOCK_ROOT_DIR = os.path.join(os.path.dirname(__file__), '..')
-
-# We need to call into gtest/scripts/fuse_gtest_files.py.
-sys.path.append(os.path.join(DEFAULT_GMOCK_ROOT_DIR, 'gtest/scripts'))
-import fuse_gtest_files
-gtest = fuse_gtest_files
-
-# Regex for matching '#include "gmock/..."'.
-INCLUDE_GMOCK_FILE_REGEX = re.compile(r'^\s*#\s*include\s*"(gmock/.+)"')
-
-# Where to find the source seed files.
-GMOCK_H_SEED = 'include/gmock/gmock.h'
-GMOCK_ALL_CC_SEED = 'src/gmock-all.cc'
-
-# Where to put the generated files.
-GTEST_H_OUTPUT = 'gtest/gtest.h'
-GMOCK_H_OUTPUT = 'gmock/gmock.h'
-GMOCK_GTEST_ALL_CC_OUTPUT = 'gmock-gtest-all.cc'
-
-
-def GetGTestRootDir(gmock_root):
- """Returns the root directory of Google Test."""
-
- return os.path.join(gmock_root, 'gtest')
-
-
-def ValidateGMockRootDir(gmock_root):
- """Makes sure gmock_root points to a valid gmock root directory.
-
- The function aborts the program on failure.
- """
-
- gtest.ValidateGTestRootDir(GetGTestRootDir(gmock_root))
- gtest.VerifyFileExists(gmock_root, GMOCK_H_SEED)
- gtest.VerifyFileExists(gmock_root, GMOCK_ALL_CC_SEED)
-
-
-def ValidateOutputDir(output_dir):
- """Makes sure output_dir points to a valid output directory.
-
- The function aborts the program on failure.
- """
-
- gtest.VerifyOutputFile(output_dir, gtest.GTEST_H_OUTPUT)
- gtest.VerifyOutputFile(output_dir, GMOCK_H_OUTPUT)
- gtest.VerifyOutputFile(output_dir, GMOCK_GTEST_ALL_CC_OUTPUT)
-
-
-def FuseGMockH(gmock_root, output_dir):
- """Scans folder gmock_root to generate gmock/gmock.h in output_dir."""
-
- output_file = file(os.path.join(output_dir, GMOCK_H_OUTPUT), 'w')
- processed_files = sets.Set() # Holds all gmock headers we've processed.
-
- def ProcessFile(gmock_header_path):
- """Processes the given gmock header file."""
-
- # We don't process the same header twice.
- if gmock_header_path in processed_files:
- return
-
- processed_files.add(gmock_header_path)
-
- # Reads each line in the given gmock header.
- for line in file(os.path.join(gmock_root, gmock_header_path), 'r'):
- m = INCLUDE_GMOCK_FILE_REGEX.match(line)
- if m:
- # It's '#include "gmock/..."' - let's process it recursively.
- ProcessFile('include/' + m.group(1))
- else:
- m = gtest.INCLUDE_GTEST_FILE_REGEX.match(line)
- if m:
- # It's '#include "gtest/foo.h"'. We translate it to
- # "gtest/gtest.h", regardless of what foo is, since all
- # gtest headers are fused into gtest/gtest.h.
-
- # There is no need to #include gtest.h twice.
- if not gtest.GTEST_H_SEED in processed_files:
- processed_files.add(gtest.GTEST_H_SEED)
- output_file.write('#include "%s"\n' % (gtest.GTEST_H_OUTPUT,))
- else:
- # Otherwise we copy the line unchanged to the output file.
- output_file.write(line)
-
- ProcessFile(GMOCK_H_SEED)
- output_file.close()
-
-
-def FuseGMockAllCcToFile(gmock_root, output_file):
- """Scans folder gmock_root to fuse gmock-all.cc into output_file."""
-
- processed_files = sets.Set()
-
- def ProcessFile(gmock_source_file):
- """Processes the given gmock source file."""
-
- # We don't process the same #included file twice.
- if gmock_source_file in processed_files:
- return
-
- processed_files.add(gmock_source_file)
-
- # Reads each line in the given gmock source file.
- for line in file(os.path.join(gmock_root, gmock_source_file), 'r'):
- m = INCLUDE_GMOCK_FILE_REGEX.match(line)
- if m:
- # It's '#include "gmock/foo.h"'. We treat it as '#include
- # "gmock/gmock.h"', as all other gmock headers are being fused
- # into gmock.h and cannot be #included directly.
-
- # There is no need to #include "gmock/gmock.h" more than once.
- if not GMOCK_H_SEED in processed_files:
- processed_files.add(GMOCK_H_SEED)
- output_file.write('#include "%s"\n' % (GMOCK_H_OUTPUT,))
- else:
- m = gtest.INCLUDE_GTEST_FILE_REGEX.match(line)
- if m:
- # It's '#include "gtest/..."'.
- # There is no need to #include gtest.h as it has been
- # #included by gtest-all.cc.
- pass
- else:
- m = gtest.INCLUDE_SRC_FILE_REGEX.match(line)
- if m:
- # It's '#include "src/foo"' - let's process it recursively.
- ProcessFile(m.group(1))
- else:
- # Otherwise we copy the line unchanged to the output file.
- output_file.write(line)
-
- ProcessFile(GMOCK_ALL_CC_SEED)
-
-
-def FuseGMockGTestAllCc(gmock_root, output_dir):
- """Scans folder gmock_root to generate gmock-gtest-all.cc in output_dir."""
-
- output_file = file(os.path.join(output_dir, GMOCK_GTEST_ALL_CC_OUTPUT), 'w')
- # First, fuse gtest-all.cc into gmock-gtest-all.cc.
- gtest.FuseGTestAllCcToFile(GetGTestRootDir(gmock_root), output_file)
- # Next, append fused gmock-all.cc to gmock-gtest-all.cc.
- FuseGMockAllCcToFile(gmock_root, output_file)
- output_file.close()
-
-
-def FuseGMock(gmock_root, output_dir):
- """Fuses gtest.h, gmock.h, and gmock-gtest-all.h."""
-
- ValidateGMockRootDir(gmock_root)
- ValidateOutputDir(output_dir)
-
- gtest.FuseGTestH(GetGTestRootDir(gmock_root), output_dir)
- FuseGMockH(gmock_root, output_dir)
- FuseGMockGTestAllCc(gmock_root, output_dir)
-
-
-def main():
- argc = len(sys.argv)
- if argc == 2:
- # fuse_gmock_files.py OUTPUT_DIR
- FuseGMock(DEFAULT_GMOCK_ROOT_DIR, sys.argv[1])
- elif argc == 3:
- # fuse_gmock_files.py GMOCK_ROOT_DIR OUTPUT_DIR
- FuseGMock(sys.argv[1], sys.argv[2])
- else:
- print __doc__
- sys.exit(1)
-
-
-if __name__ == '__main__':
- main()
diff --git a/src/testing/scripts/generator/LICENSE b/src/testing/scripts/generator/LICENSE
deleted file mode 100644
index 87ea0636..00000000
--- a/src/testing/scripts/generator/LICENSE
+++ /dev/null
@@ -1,203 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [2007] Neal Norwitz
- Portions Copyright [2007] Google Inc.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/src/testing/scripts/generator/README b/src/testing/scripts/generator/README
deleted file mode 100644
index d6f95974..00000000
--- a/src/testing/scripts/generator/README
+++ /dev/null
@@ -1,35 +0,0 @@
-
-The Google Mock class generator is an application that is part of cppclean.
-For more information about cppclean, see the README.cppclean file or
-visit http://code.google.com/p/cppclean/
-
-cppclean requires Python 2.3.5 or later. If you don't have Python installed
-on your system, you will also need to install it. You can download Python
-from: http://www.python.org/download/releases/
-
-To use the Google Mock class generator, you need to call it
-on the command line passing the header file and class for which you want
-to generate a Google Mock class.
-
-Make sure to install the scripts somewhere in your path. Then you can
-run the program.
-
- gmock_gen.py header-file.h [ClassName]...
-
-If no ClassNames are specified, all classes in the file are emitted.
-
-To change the indentation from the default of 2, set INDENT in
-the environment. For example to use an indent of 4 spaces:
-
-INDENT=4 gmock_gen.py header-file.h ClassName
-
-This version was made from SVN revision 281 in the cppclean repository.
-
-Known Limitations
------------------
-Not all code will be generated properly. For example, when mocking templated
-classes, the template information is lost. You will need to add the template
-information manually.
-
-Not all permutations of using multiple pointers/references will be rendered
-properly. These will also have to be fixed manually.
diff --git a/src/testing/scripts/generator/README.cppclean b/src/testing/scripts/generator/README.cppclean
deleted file mode 100644
index 65431b61..00000000
--- a/src/testing/scripts/generator/README.cppclean
+++ /dev/null
@@ -1,115 +0,0 @@
-Goal:
------
- CppClean attempts to find problems in C++ source that slow development
- in large code bases, for example various forms of unused code.
- Unused code can be unused functions, methods, data members, types, etc
- to unnecessary #include directives. Unnecessary #includes can cause
- considerable extra compiles increasing the edit-compile-run cycle.
-
- The project home page is: http://code.google.com/p/cppclean/
-
-
-Features:
----------
- * Find and print C++ language constructs: classes, methods, functions, etc.
- * Find classes with virtual methods, no virtual destructor, and no bases
- * Find global/static data that are potential problems when using threads
- * Unnecessary forward class declarations
- * Unnecessary function declarations
- * Undeclared function definitions
- * (planned) Find unnecessary header files #included
- - No direct reference to anything in the header
- - Header is unnecessary if classes were forward declared instead
- * (planned) Source files that reference headers not directly #included,
- ie, files that rely on a transitive #include from another header
- * (planned) Unused members (private, protected, & public) methods and data
- * (planned) Store AST in a SQL database so relationships can be queried
-
-AST is Abstract Syntax Tree, a representation of parsed source code.
-http://en.wikipedia.org/wiki/Abstract_syntax_tree
-
-
-System Requirements:
---------------------
- * Python 2.4 or later (2.3 probably works too)
- * Works on Windows (untested), Mac OS X, and Unix
-
-
-How to Run:
------------
- For all examples, it is assumed that cppclean resides in a directory called
- /cppclean.
-
- To print warnings for classes with virtual methods, no virtual destructor and
- no base classes:
-
- /cppclean/run.sh nonvirtual_dtors.py file1.h file2.h file3.cc ...
-
- To print all the functions defined in header file(s):
-
- /cppclean/run.sh functions.py file1.h file2.h ...
-
- All the commands take multiple files on the command line. Other programs
- include: find_warnings, headers, methods, and types. Some other programs
- are available, but used primarily for debugging.
-
- run.sh is a simple wrapper that sets PYTHONPATH to /cppclean and then
- runs the program in /cppclean/cpp/PROGRAM.py. There is currently
- no equivalent for Windows. Contributions for a run.bat file
- would be greatly appreciated.
-
-
-How to Configure:
------------------
- You can add a siteheaders.py file in /cppclean/cpp to configure where
- to look for other headers (typically -I options passed to a compiler).
- Currently two values are supported: _TRANSITIVE and GetIncludeDirs.
- _TRANSITIVE should be set to a boolean value (True or False) indicating
- whether to transitively process all header files. The default is False.
-
- GetIncludeDirs is a function that takes a single argument and returns
- a sequence of directories to include. This can be a generator or
- return a static list.
-
- def GetIncludeDirs(filename):
- return ['/some/path/with/other/headers']
-
- # Here is a more complicated example.
- def GetIncludeDirs(filename):
- yield '/path1'
- yield os.path.join('/path2', os.path.dirname(filename))
- yield '/path3'
-
-
-How to Test:
-------------
- For all examples, it is assumed that cppclean resides in a directory called
- /cppclean. The tests require
-
- cd /cppclean
- make test
- # To generate expected results after a change:
- make expected
-
-
-Current Status:
----------------
- The parser works pretty well for header files, parsing about 99% of Google's
- header files. Anything which inspects structure of C++ source files should
- work reasonably well. Function bodies are not transformed to an AST,
- but left as tokens. Much work is still needed on finding unused header files
- and storing an AST in a database.
-
-
-Non-goals:
-----------
- * Parsing all valid C++ source
- * Handling invalid C++ source gracefully
- * Compiling to machine code (or anything beyond an AST)
-
-
-Contact:
---------
- If you used cppclean, I would love to hear about your experiences
- cppclean@googlegroups.com. Even if you don't use cppclean, I'd like to
- hear from you. :-) (You can contact me directly at: nnorwitz@gmail.com)
diff --git a/src/testing/scripts/generator/cpp/__init__.py b/src/testing/scripts/generator/cpp/__init__.py
deleted file mode 100755
index e69de29b..00000000
--- a/src/testing/scripts/generator/cpp/__init__.py
+++ /dev/null
diff --git a/src/testing/scripts/generator/cpp/ast.py b/src/testing/scripts/generator/cpp/ast.py
deleted file mode 100755
index 6f61f877..00000000
--- a/src/testing/scripts/generator/cpp/ast.py
+++ /dev/null
@@ -1,1723 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2007 Neal Norwitz
-# Portions Copyright 2007 Google Inc.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-"""Generate an Abstract Syntax Tree (AST) for C++."""
-
-__author__ = 'nnorwitz@google.com (Neal Norwitz)'
-
-
-# TODO:
-# * Tokens should never be exported, need to convert to Nodes
-# (return types, parameters, etc.)
-# * Handle static class data for templatized classes
-# * Handle casts (both C++ and C-style)
-# * Handle conditions and loops (if/else, switch, for, while/do)
-#
-# TODO much, much later:
-# * Handle #define
-# * exceptions
-
-
-try:
- # Python 3.x
- import builtins
-except ImportError:
- # Python 2.x
- import __builtin__ as builtins
-
-import sys
-import traceback
-
-from cpp import keywords
-from cpp import tokenize
-from cpp import utils
-
-
-if not hasattr(builtins, 'reversed'):
- # Support Python 2.3 and earlier.
- def reversed(seq):
- for i in range(len(seq)-1, -1, -1):
- yield seq[i]
-
-if not hasattr(builtins, 'next'):
- # Support Python 2.5 and earlier.
- def next(obj):
- return obj.next()
-
-
-VISIBILITY_PUBLIC, VISIBILITY_PROTECTED, VISIBILITY_PRIVATE = range(3)
-
-FUNCTION_NONE = 0x00
-FUNCTION_CONST = 0x01
-FUNCTION_VIRTUAL = 0x02
-FUNCTION_PURE_VIRTUAL = 0x04
-FUNCTION_CTOR = 0x08
-FUNCTION_DTOR = 0x10
-FUNCTION_ATTRIBUTE = 0x20
-FUNCTION_UNKNOWN_ANNOTATION = 0x40
-FUNCTION_THROW = 0x80
-
-"""
-These are currently unused. Should really handle these properly at some point.
-
-TYPE_MODIFIER_INLINE = 0x010000
-TYPE_MODIFIER_EXTERN = 0x020000
-TYPE_MODIFIER_STATIC = 0x040000
-TYPE_MODIFIER_CONST = 0x080000
-TYPE_MODIFIER_REGISTER = 0x100000
-TYPE_MODIFIER_VOLATILE = 0x200000
-TYPE_MODIFIER_MUTABLE = 0x400000
-
-TYPE_MODIFIER_MAP = {
- 'inline': TYPE_MODIFIER_INLINE,
- 'extern': TYPE_MODIFIER_EXTERN,
- 'static': TYPE_MODIFIER_STATIC,
- 'const': TYPE_MODIFIER_CONST,
- 'register': TYPE_MODIFIER_REGISTER,
- 'volatile': TYPE_MODIFIER_VOLATILE,
- 'mutable': TYPE_MODIFIER_MUTABLE,
- }
-"""
-
-_INTERNAL_TOKEN = 'internal'
-_NAMESPACE_POP = 'ns-pop'
-
-
-# TODO(nnorwitz): use this as a singleton for templated_types, etc
-# where we don't want to create a new empty dict each time. It is also const.
-class _NullDict(object):
- __contains__ = lambda self: False
- keys = values = items = iterkeys = itervalues = iteritems = lambda self: ()
-
-
-# TODO(nnorwitz): move AST nodes into a separate module.
-class Node(object):
- """Base AST node."""
-
- def __init__(self, start, end):
- self.start = start
- self.end = end
-
- def IsDeclaration(self):
- """Returns bool if this node is a declaration."""
- return False
-
- def IsDefinition(self):
- """Returns bool if this node is a definition."""
- return False
-
- def IsExportable(self):
- """Returns bool if this node exportable from a header file."""
- return False
-
- def Requires(self, node):
- """Does this AST node require the definition of the node passed in?"""
- return False
-
- def XXX__str__(self):
- return self._StringHelper(self.__class__.__name__, '')
-
- def _StringHelper(self, name, suffix):
- if not utils.DEBUG:
- return '%s(%s)' % (name, suffix)
- return '%s(%d, %d, %s)' % (name, self.start, self.end, suffix)
-
- def __repr__(self):
- return str(self)
-
-
-class Define(Node):
- def __init__(self, start, end, name, definition):
- Node.__init__(self, start, end)
- self.name = name
- self.definition = definition
-
- def __str__(self):
- value = '%s %s' % (self.name, self.definition)
- return self._StringHelper(self.__class__.__name__, value)
-
-
-class Include(Node):
- def __init__(self, start, end, filename, system):
- Node.__init__(self, start, end)
- self.filename = filename
- self.system = system
-
- def __str__(self):
- fmt = '"%s"'
- if self.system:
- fmt = '<%s>'
- return self._StringHelper(self.__class__.__name__, fmt % self.filename)
-
-
-class Goto(Node):
- def __init__(self, start, end, label):
- Node.__init__(self, start, end)
- self.label = label
-
- def __str__(self):
- return self._StringHelper(self.__class__.__name__, str(self.label))
-
-
-class Expr(Node):
- def __init__(self, start, end, expr):
- Node.__init__(self, start, end)
- self.expr = expr
-
- def Requires(self, node):
- # TODO(nnorwitz): impl.
- return False
-
- def __str__(self):
- return self._StringHelper(self.__class__.__name__, str(self.expr))
-
-
-class Return(Expr):
- pass
-
-
-class Delete(Expr):
- pass
-
-
-class Friend(Expr):
- def __init__(self, start, end, expr, namespace):
- Expr.__init__(self, start, end, expr)
- self.namespace = namespace[:]
-
-
-class Using(Node):
- def __init__(self, start, end, names):
- Node.__init__(self, start, end)
- self.names = names
-
- def __str__(self):
- return self._StringHelper(self.__class__.__name__, str(self.names))
-
-
-class Parameter(Node):
- def __init__(self, start, end, name, parameter_type, default):
- Node.__init__(self, start, end)
- self.name = name
- self.type = parameter_type
- self.default = default
-
- def Requires(self, node):
- # TODO(nnorwitz): handle namespaces, etc.
- return self.type.name == node.name
-
- def __str__(self):
- name = str(self.type)
- suffix = '%s %s' % (name, self.name)
- if self.default:
- suffix += ' = ' + ''.join([d.name for d in self.default])
- return self._StringHelper(self.__class__.__name__, suffix)
-
-
-class _GenericDeclaration(Node):
- def __init__(self, start, end, name, namespace):
- Node.__init__(self, start, end)
- self.name = name
- self.namespace = namespace[:]
-
- def FullName(self):
- prefix = ''
- if self.namespace and self.namespace[-1]:
- prefix = '::'.join(self.namespace) + '::'
- return prefix + self.name
-
- def _TypeStringHelper(self, suffix):
- if self.namespace:
- names = [n or '<anonymous>' for n in self.namespace]
- suffix += ' in ' + '::'.join(names)
- return self._StringHelper(self.__class__.__name__, suffix)
-
-
-# TODO(nnorwitz): merge with Parameter in some way?
-class VariableDeclaration(_GenericDeclaration):
- def __init__(self, start, end, name, var_type, initial_value, namespace):
- _GenericDeclaration.__init__(self, start, end, name, namespace)
- self.type = var_type
- self.initial_value = initial_value
-
- def Requires(self, node):
- # TODO(nnorwitz): handle namespaces, etc.
- return self.type.name == node.name
-
- def ToString(self):
- """Return a string that tries to reconstitute the variable decl."""
- suffix = '%s %s' % (self.type, self.name)
- if self.initial_value:
- suffix += ' = ' + self.initial_value
- return suffix
-
- def __str__(self):
- return self._StringHelper(self.__class__.__name__, self.ToString())
-
-
-class Typedef(_GenericDeclaration):
- def __init__(self, start, end, name, alias, namespace):
- _GenericDeclaration.__init__(self, start, end, name, namespace)
- self.alias = alias
-
- def IsDefinition(self):
- return True
-
- def IsExportable(self):
- return True
-
- def Requires(self, node):
- # TODO(nnorwitz): handle namespaces, etc.
- name = node.name
- for token in self.alias:
- if token is not None and name == token.name:
- return True
- return False
-
- def __str__(self):
- suffix = '%s, %s' % (self.name, self.alias)
- return self._TypeStringHelper(suffix)
-
-
-class _NestedType(_GenericDeclaration):
- def __init__(self, start, end, name, fields, namespace):
- _GenericDeclaration.__init__(self, start, end, name, namespace)
- self.fields = fields
-
- def IsDefinition(self):
- return True
-
- def IsExportable(self):
- return True
-
- def __str__(self):
- suffix = '%s, {%s}' % (self.name, self.fields)
- return self._TypeStringHelper(suffix)
-
-
-class Union(_NestedType):
- pass
-
-
-class Enum(_NestedType):
- pass
-
-
-class Class(_GenericDeclaration):
- def __init__(self, start, end, name, bases, templated_types, body, namespace):
- _GenericDeclaration.__init__(self, start, end, name, namespace)
- self.bases = bases
- self.body = body
- self.templated_types = templated_types
-
- def IsDeclaration(self):
- return self.bases is None and self.body is None
-
- def IsDefinition(self):
- return not self.IsDeclaration()
-
- def IsExportable(self):
- return not self.IsDeclaration()
-
- def Requires(self, node):
- # TODO(nnorwitz): handle namespaces, etc.
- if self.bases:
- for token_list in self.bases:
- # TODO(nnorwitz): bases are tokens, do name comparision.
- for token in token_list:
- if token.name == node.name:
- return True
- # TODO(nnorwitz): search in body too.
- return False
-
- def __str__(self):
- name = self.name
- if self.templated_types:
- name += '<%s>' % self.templated_types
- suffix = '%s, %s, %s' % (name, self.bases, self.body)
- return self._TypeStringHelper(suffix)
-
-
-class Struct(Class):
- pass
-
-
-class Function(_GenericDeclaration):
- def __init__(self, start, end, name, return_type, parameters,
- modifiers, templated_types, body, namespace):
- _GenericDeclaration.__init__(self, start, end, name, namespace)
- converter = TypeConverter(namespace)
- self.return_type = converter.CreateReturnType(return_type)
- self.parameters = converter.ToParameters(parameters)
- self.modifiers = modifiers
- self.body = body
- self.templated_types = templated_types
-
- def IsDeclaration(self):
- return self.body is None
-
- def IsDefinition(self):
- return self.body is not None
-
- def IsExportable(self):
- if self.return_type and 'static' in self.return_type.modifiers:
- return False
- return None not in self.namespace
-
- def Requires(self, node):
- if self.parameters:
- # TODO(nnorwitz): parameters are tokens, do name comparision.
- for p in self.parameters:
- if p.name == node.name:
- return True
- # TODO(nnorwitz): search in body too.
- return False
-
- def __str__(self):
- # TODO(nnorwitz): add templated_types.
- suffix = ('%s %s(%s), 0x%02x, %s' %
- (self.return_type, self.name, self.parameters,
- self.modifiers, self.body))
- return self._TypeStringHelper(suffix)
-
-
-class Method(Function):
- def __init__(self, start, end, name, in_class, return_type, parameters,
- modifiers, templated_types, body, namespace):
- Function.__init__(self, start, end, name, return_type, parameters,
- modifiers, templated_types, body, namespace)
- # TODO(nnorwitz): in_class could also be a namespace which can
- # mess up finding functions properly.
- self.in_class = in_class
-
-
-class Type(_GenericDeclaration):
- """Type used for any variable (eg class, primitive, struct, etc)."""
-
- def __init__(self, start, end, name, templated_types, modifiers,
- reference, pointer, array):
- """
- Args:
- name: str name of main type
- templated_types: [Class (Type?)] template type info between <>
- modifiers: [str] type modifiers (keywords) eg, const, mutable, etc.
- reference, pointer, array: bools
- """
- _GenericDeclaration.__init__(self, start, end, name, [])
- self.templated_types = templated_types
- if not name and modifiers:
- self.name = modifiers.pop()
- self.modifiers = modifiers
- self.reference = reference
- self.pointer = pointer
- self.array = array
-
- def __str__(self):
- prefix = ''
- if self.modifiers:
- prefix = ' '.join(self.modifiers) + ' '
- name = str(self.name)
- if self.templated_types:
- name += '<%s>' % self.templated_types
- suffix = prefix + name
- if self.reference:
- suffix += '&'
- if self.pointer:
- suffix += '*'
- if self.array:
- suffix += '[]'
- return self._TypeStringHelper(suffix)
-
- # By definition, Is* are always False. A Type can only exist in
- # some sort of variable declaration, parameter, or return value.
- def IsDeclaration(self):
- return False
-
- def IsDefinition(self):
- return False
-
- def IsExportable(self):
- return False
-
-
-class TypeConverter(object):
-
- def __init__(self, namespace_stack):
- self.namespace_stack = namespace_stack
-
- def _GetTemplateEnd(self, tokens, start):
- count = 1
- end = start
- while 1:
- token = tokens[end]
- end += 1
- if token.name == '<':
- count += 1
- elif token.name == '>':
- count -= 1
- if count == 0:
- break
- return tokens[start:end-1], end
-
- def ToType(self, tokens):
- """Convert [Token,...] to [Class(...), ] useful for base classes.
- For example, code like class Foo : public Bar<x, y> { ... };
- the "Bar<x, y>" portion gets converted to an AST.
-
- Returns:
- [Class(...), ...]
- """
- result = []
- name_tokens = []
- reference = pointer = array = False
-
- def AddType(templated_types):
- # Partition tokens into name and modifier tokens.
- names = []
- modifiers = []
- for t in name_tokens:
- if keywords.IsKeyword(t.name):
- modifiers.append(t.name)
- else:
- names.append(t.name)
- name = ''.join(names)
- result.append(Type(name_tokens[0].start, name_tokens[-1].end,
- name, templated_types, modifiers,
- reference, pointer, array))
- del name_tokens[:]
-
- i = 0
- end = len(tokens)
- while i < end:
- token = tokens[i]
- if token.name == '<':
- new_tokens, new_end = self._GetTemplateEnd(tokens, i+1)
- AddType(self.ToType(new_tokens))
- # If there is a comma after the template, we need to consume
- # that here otherwise it becomes part of the name.
- i = new_end
- reference = pointer = array = False
- elif token.name == ',':
- AddType([])
- reference = pointer = array = False
- elif token.name == '*':
- pointer = True
- elif token.name == '&':
- reference = True
- elif token.name == '[':
- pointer = True
- elif token.name == ']':
- pass
- else:
- name_tokens.append(token)
- i += 1
-
- if name_tokens:
- # No '<' in the tokens, just a simple name and no template.
- AddType([])
- return result
-
- def DeclarationToParts(self, parts, needs_name_removed):
- name = None
- default = []
- if needs_name_removed:
- # Handle default (initial) values properly.
- for i, t in enumerate(parts):
- if t.name == '=':
- default = parts[i+1:]
- name = parts[i-1].name
- if name == ']' and parts[i-2].name == '[':
- name = parts[i-3].name
- i -= 1
- parts = parts[:i-1]
- break
- else:
- if parts[-1].token_type == tokenize.NAME:
- name = parts.pop().name
- else:
- # TODO(nnorwitz): this is a hack that happens for code like
- # Register(Foo<T>); where it thinks this is a function call
- # but it's actually a declaration.
- name = '???'
- modifiers = []
- type_name = []
- other_tokens = []
- templated_types = []
- i = 0
- end = len(parts)
- while i < end:
- p = parts[i]
- if keywords.IsKeyword(p.name):
- modifiers.append(p.name)
- elif p.name == '<':
- templated_tokens, new_end = self._GetTemplateEnd(parts, i+1)
- templated_types = self.ToType(templated_tokens)
- i = new_end - 1
- # Don't add a spurious :: to data members being initialized.
- next_index = i + 1
- if next_index < end and parts[next_index].name == '::':
- i += 1
- elif p.name in ('[', ']', '='):
- # These are handled elsewhere.
- other_tokens.append(p)
- elif p.name not in ('*', '&', '>'):
- # Ensure that names have a space between them.
- if (type_name and type_name[-1].token_type == tokenize.NAME and
- p.token_type == tokenize.NAME):
- type_name.append(tokenize.Token(tokenize.SYNTAX, ' ', 0, 0))
- type_name.append(p)
- else:
- other_tokens.append(p)
- i += 1
- type_name = ''.join([t.name for t in type_name])
- return name, type_name, templated_types, modifiers, default, other_tokens
-
- def ToParameters(self, tokens):
- if not tokens:
- return []
-
- result = []
- name = type_name = ''
- type_modifiers = []
- pointer = reference = array = False
- first_token = None
- default = []
-
- def AddParameter():
- if default:
- del default[0] # Remove flag.
- end = type_modifiers[-1].end
- parts = self.DeclarationToParts(type_modifiers, True)
- (name, type_name, templated_types, modifiers,
- unused_default, unused_other_tokens) = parts
- parameter_type = Type(first_token.start, first_token.end,
- type_name, templated_types, modifiers,
- reference, pointer, array)
- p = Parameter(first_token.start, end, name,
- parameter_type, default)
- result.append(p)
-
- template_count = 0
- for s in tokens:
- if not first_token:
- first_token = s
- if s.name == '<':
- template_count += 1
- elif s.name == '>':
- template_count -= 1
- if template_count > 0:
- type_modifiers.append(s)
- continue
-
- if s.name == ',':
- AddParameter()
- name = type_name = ''
- type_modifiers = []
- pointer = reference = array = False
- first_token = None
- default = []
- elif s.name == '*':
- pointer = True
- elif s.name == '&':
- reference = True
- elif s.name == '[':
- array = True
- elif s.name == ']':
- pass # Just don't add to type_modifiers.
- elif s.name == '=':
- # Got a default value. Add any value (None) as a flag.
- default.append(None)
- elif default:
- default.append(s)
- else:
- type_modifiers.append(s)
- AddParameter()
- return result
-
- def CreateReturnType(self, return_type_seq):
- if not return_type_seq:
- return None
- start = return_type_seq[0].start
- end = return_type_seq[-1].end
- _, name, templated_types, modifiers, default, other_tokens = \
- self.DeclarationToParts(return_type_seq, False)
- names = [n.name for n in other_tokens]
- reference = '&' in names
- pointer = '*' in names
- array = '[' in names
- return Type(start, end, name, templated_types, modifiers,
- reference, pointer, array)
-
- def GetTemplateIndices(self, names):
- # names is a list of strings.
- start = names.index('<')
- end = len(names) - 1
- while end > 0:
- if names[end] == '>':
- break
- end -= 1
- return start, end+1
-
-class AstBuilder(object):
- def __init__(self, token_stream, filename, in_class='', visibility=None,
- namespace_stack=[]):
- self.tokens = token_stream
- self.filename = filename
- # TODO(nnorwitz): use a better data structure (deque) for the queue.
- # Switching directions of the "queue" improved perf by about 25%.
- # Using a deque should be even better since we access from both sides.
- self.token_queue = []
- self.namespace_stack = namespace_stack[:]
- self.in_class = in_class
- if in_class is None:
- self.in_class_name_only = None
- else:
- self.in_class_name_only = in_class.split('::')[-1]
- self.visibility = visibility
- self.in_function = False
- self.current_token = None
- # Keep the state whether we are currently handling a typedef or not.
- self._handling_typedef = False
-
- self.converter = TypeConverter(self.namespace_stack)
-
- def HandleError(self, msg, token):
- printable_queue = list(reversed(self.token_queue[-20:]))
- sys.stderr.write('Got %s in %s @ %s %s\n' %
- (msg, self.filename, token, printable_queue))
-
- def Generate(self):
- while 1:
- token = self._GetNextToken()
- if not token:
- break
-
- # Get the next token.
- self.current_token = token
-
- # Dispatch on the next token type.
- if token.token_type == _INTERNAL_TOKEN:
- if token.name == _NAMESPACE_POP:
- self.namespace_stack.pop()
- continue
-
- try:
- result = self._GenerateOne(token)
- if result is not None:
- yield result
- except:
- self.HandleError('exception', token)
- raise
-
- def _CreateVariable(self, pos_token, name, type_name, type_modifiers,
- ref_pointer_name_seq, templated_types, value=None):
- reference = '&' in ref_pointer_name_seq
- pointer = '*' in ref_pointer_name_seq
- array = '[' in ref_pointer_name_seq
- var_type = Type(pos_token.start, pos_token.end, type_name,
- templated_types, type_modifiers,
- reference, pointer, array)
- return VariableDeclaration(pos_token.start, pos_token.end,
- name, var_type, value, self.namespace_stack)
-
- def _GenerateOne(self, token):
- if token.token_type == tokenize.NAME:
- if (keywords.IsKeyword(token.name) and
- not keywords.IsBuiltinType(token.name)):
- method = getattr(self, 'handle_' + token.name)
- return method()
- elif token.name == self.in_class_name_only:
- # The token name is the same as the class, must be a ctor if
- # there is a paren. Otherwise, it's the return type.
- # Peek ahead to get the next token to figure out which.
- next = self._GetNextToken()
- self._AddBackToken(next)
- if next.token_type == tokenize.SYNTAX and next.name == '(':
- return self._GetMethod([token], FUNCTION_CTOR, None, True)
- # Fall through--handle like any other method.
-
- # Handle data or function declaration/definition.
- syntax = tokenize.SYNTAX
- temp_tokens, last_token = \
- self._GetVarTokensUpTo(syntax, '(', ';', '{', '[')
- temp_tokens.insert(0, token)
- if last_token.name == '(':
- # If there is an assignment before the paren,
- # this is an expression, not a method.
- expr = bool([e for e in temp_tokens if e.name == '='])
- if expr:
- new_temp = self._GetTokensUpTo(tokenize.SYNTAX, ';')
- temp_tokens.append(last_token)
- temp_tokens.extend(new_temp)
- last_token = tokenize.Token(tokenize.SYNTAX, ';', 0, 0)
-
- if last_token.name == '[':
- # Handle array, this isn't a method, unless it's an operator.
- # TODO(nnorwitz): keep the size somewhere.
- # unused_size = self._GetTokensUpTo(tokenize.SYNTAX, ']')
- temp_tokens.append(last_token)
- if temp_tokens[-2].name == 'operator':
- temp_tokens.append(self._GetNextToken())
- else:
- temp_tokens2, last_token = \
- self._GetVarTokensUpTo(tokenize.SYNTAX, ';')
- temp_tokens.extend(temp_tokens2)
-
- if last_token.name == ';':
- # Handle data, this isn't a method.
- parts = self.converter.DeclarationToParts(temp_tokens, True)
- (name, type_name, templated_types, modifiers, default,
- unused_other_tokens) = parts
-
- t0 = temp_tokens[0]
- names = [t.name for t in temp_tokens]
- if templated_types:
- start, end = self.converter.GetTemplateIndices(names)
- names = names[:start] + names[end:]
- default = ''.join([t.name for t in default])
- return self._CreateVariable(t0, name, type_name, modifiers,
- names, templated_types, default)
- if last_token.name == '{':
- self._AddBackTokens(temp_tokens[1:])
- self._AddBackToken(last_token)
- method_name = temp_tokens[0].name
- method = getattr(self, 'handle_' + method_name, None)
- if not method:
- # Must be declaring a variable.
- # TODO(nnorwitz): handle the declaration.
- return None
- return method()
- return self._GetMethod(temp_tokens, 0, None, False)
- elif token.token_type == tokenize.SYNTAX:
- if token.name == '~' and self.in_class:
- # Must be a dtor (probably not in method body).
- token = self._GetNextToken()
- # self.in_class can contain A::Name, but the dtor will only
- # be Name. Make sure to compare against the right value.
- if (token.token_type == tokenize.NAME and
- token.name == self.in_class_name_only):
- return self._GetMethod([token], FUNCTION_DTOR, None, True)
- # TODO(nnorwitz): handle a lot more syntax.
- elif token.token_type == tokenize.PREPROCESSOR:
- # TODO(nnorwitz): handle more preprocessor directives.
- # token starts with a #, so remove it and strip whitespace.
- name = token.name[1:].lstrip()
- if name.startswith('include'):
- # Remove "include".
- name = name[7:].strip()
- assert name
- # Handle #include \<newline> "header-on-second-line.h".
- if name.startswith('\\'):
- name = name[1:].strip()
- assert name[0] in '<"', token
- assert name[-1] in '>"', token
- system = name[0] == '<'
- filename = name[1:-1]
- return Include(token.start, token.end, filename, system)
- if name.startswith('define'):
- # Remove "define".
- name = name[6:].strip()
- assert name
- value = ''
- for i, c in enumerate(name):
- if c.isspace():
- value = name[i:].lstrip()
- name = name[:i]
- break
- return Define(token.start, token.end, name, value)
- if name.startswith('if') and name[2:3].isspace():
- condition = name[3:].strip()
- if condition.startswith('0') or condition.startswith('(0)'):
- self._SkipIf0Blocks()
- return None
-
- def _GetTokensUpTo(self, expected_token_type, expected_token):
- return self._GetVarTokensUpTo(expected_token_type, expected_token)[0]
-
- def _GetVarTokensUpTo(self, expected_token_type, *expected_tokens):
- last_token = self._GetNextToken()
- tokens = []
- while (last_token.token_type != expected_token_type or
- last_token.name not in expected_tokens):
- tokens.append(last_token)
- last_token = self._GetNextToken()
- return tokens, last_token
-
- # TODO(nnorwitz): remove _IgnoreUpTo() it shouldn't be necesary.
- def _IgnoreUpTo(self, token_type, token):
- unused_tokens = self._GetTokensUpTo(token_type, token)
-
- def _SkipIf0Blocks(self):
- count = 1
- while 1:
- token = self._GetNextToken()
- if token.token_type != tokenize.PREPROCESSOR:
- continue
-
- name = token.name[1:].lstrip()
- if name.startswith('endif'):
- count -= 1
- if count == 0:
- break
- elif name.startswith('if'):
- count += 1
-
- def _GetMatchingChar(self, open_paren, close_paren, GetNextToken=None):
- if GetNextToken is None:
- GetNextToken = self._GetNextToken
- # Assumes the current token is open_paren and we will consume
- # and return up to the close_paren.
- count = 1
- token = GetNextToken()
- while 1:
- if token.token_type == tokenize.SYNTAX:
- if token.name == open_paren:
- count += 1
- elif token.name == close_paren:
- count -= 1
- if count == 0:
- break
- yield token
- token = GetNextToken()
- yield token
-
- def _GetParameters(self):
- return self._GetMatchingChar('(', ')')
-
- def GetScope(self):
- return self._GetMatchingChar('{', '}')
-
- def _GetNextToken(self):
- if self.token_queue:
- return self.token_queue.pop()
- return next(self.tokens)
-
- def _AddBackToken(self, token):
- if token.whence == tokenize.WHENCE_STREAM:
- token.whence = tokenize.WHENCE_QUEUE
- self.token_queue.insert(0, token)
- else:
- assert token.whence == tokenize.WHENCE_QUEUE, token
- self.token_queue.append(token)
-
- def _AddBackTokens(self, tokens):
- if tokens:
- if tokens[-1].whence == tokenize.WHENCE_STREAM:
- for token in tokens:
- token.whence = tokenize.WHENCE_QUEUE
- self.token_queue[:0] = reversed(tokens)
- else:
- assert tokens[-1].whence == tokenize.WHENCE_QUEUE, tokens
- self.token_queue.extend(reversed(tokens))
-
- def GetName(self, seq=None):
- """Returns ([tokens], next_token_info)."""
- GetNextToken = self._GetNextToken
- if seq is not None:
- it = iter(seq)
- GetNextToken = lambda: next(it)
- next_token = GetNextToken()
- tokens = []
- last_token_was_name = False
- while (next_token.token_type == tokenize.NAME or
- (next_token.token_type == tokenize.SYNTAX and
- next_token.name in ('::', '<'))):
- # Two NAMEs in a row means the identifier should terminate.
- # It's probably some sort of variable declaration.
- if last_token_was_name and next_token.token_type == tokenize.NAME:
- break
- last_token_was_name = next_token.token_type == tokenize.NAME
- tokens.append(next_token)
- # Handle templated names.
- if next_token.name == '<':
- tokens.extend(self._GetMatchingChar('<', '>', GetNextToken))
- last_token_was_name = True
- next_token = GetNextToken()
- return tokens, next_token
-
- def GetMethod(self, modifiers, templated_types):
- return_type_and_name = self._GetTokensUpTo(tokenize.SYNTAX, '(')
- assert len(return_type_and_name) >= 1
- return self._GetMethod(return_type_and_name, modifiers, templated_types,
- False)
-
- def _GetMethod(self, return_type_and_name, modifiers, templated_types,
- get_paren):
- template_portion = None
- if get_paren:
- token = self._GetNextToken()
- assert token.token_type == tokenize.SYNTAX, token
- if token.name == '<':
- # Handle templatized dtors.
- template_portion = [token]
- template_portion.extend(self._GetMatchingChar('<', '>'))
- token = self._GetNextToken()
- assert token.token_type == tokenize.SYNTAX, token
- assert token.name == '(', token
-
- name = return_type_and_name.pop()
- # Handle templatized ctors.
- if name.name == '>':
- index = 1
- while return_type_and_name[index].name != '<':
- index += 1
- template_portion = return_type_and_name[index:] + [name]
- del return_type_and_name[index:]
- name = return_type_and_name.pop()
- elif name.name == ']':
- rt = return_type_and_name
- assert rt[-1].name == '[', return_type_and_name
- assert rt[-2].name == 'operator', return_type_and_name
- name_seq = return_type_and_name[-2:]
- del return_type_and_name[-2:]
- name = tokenize.Token(tokenize.NAME, 'operator[]',
- name_seq[0].start, name.end)
- # Get the open paren so _GetParameters() below works.
- unused_open_paren = self._GetNextToken()
-
- # TODO(nnorwitz): store template_portion.
- return_type = return_type_and_name
- indices = name
- if return_type:
- indices = return_type[0]
-
- # Force ctor for templatized ctors.
- if name.name == self.in_class and not modifiers:
- modifiers |= FUNCTION_CTOR
- parameters = list(self._GetParameters())
- del parameters[-1] # Remove trailing ')'.
-
- # Handling operator() is especially weird.
- if name.name == 'operator' and not parameters:
- token = self._GetNextToken()
- assert token.name == '(', token
- parameters = list(self._GetParameters())
- del parameters[-1] # Remove trailing ')'.
-
- token = self._GetNextToken()
- while token.token_type == tokenize.NAME:
- modifier_token = token
- token = self._GetNextToken()
- if modifier_token.name == 'const':
- modifiers |= FUNCTION_CONST
- elif modifier_token.name == '__attribute__':
- # TODO(nnorwitz): handle more __attribute__ details.
- modifiers |= FUNCTION_ATTRIBUTE
- assert token.name == '(', token
- # Consume everything between the (parens).
- unused_tokens = list(self._GetMatchingChar('(', ')'))
- token = self._GetNextToken()
- elif modifier_token.name == 'throw':
- modifiers |= FUNCTION_THROW
- assert token.name == '(', token
- # Consume everything between the (parens).
- unused_tokens = list(self._GetMatchingChar('(', ')'))
- token = self._GetNextToken()
- elif modifier_token.name == modifier_token.name.upper():
- # HACK(nnorwitz): assume that all upper-case names
- # are some macro we aren't expanding.
- modifiers |= FUNCTION_UNKNOWN_ANNOTATION
- else:
- self.HandleError('unexpected token', modifier_token)
-
- assert token.token_type == tokenize.SYNTAX, token
- # Handle ctor initializers.
- if token.name == ':':
- # TODO(nnorwitz): anything else to handle for initializer list?
- while token.name != ';' and token.name != '{':
- token = self._GetNextToken()
-
- # Handle pointer to functions that are really data but look
- # like method declarations.
- if token.name == '(':
- if parameters[0].name == '*':
- # name contains the return type.
- name = parameters.pop()
- # parameters contains the name of the data.
- modifiers = [p.name for p in parameters]
- # Already at the ( to open the parameter list.
- function_parameters = list(self._GetMatchingChar('(', ')'))
- del function_parameters[-1] # Remove trailing ')'.
- # TODO(nnorwitz): store the function_parameters.
- token = self._GetNextToken()
- assert token.token_type == tokenize.SYNTAX, token
- assert token.name == ';', token
- return self._CreateVariable(indices, name.name, indices.name,
- modifiers, '', None)
- # At this point, we got something like:
- # return_type (type::*name_)(params);
- # This is a data member called name_ that is a function pointer.
- # With this code: void (sq_type::*field_)(string&);
- # We get: name=void return_type=[] parameters=sq_type ... field_
- # TODO(nnorwitz): is return_type always empty?
- # TODO(nnorwitz): this isn't even close to being correct.
- # Just put in something so we don't crash and can move on.
- real_name = parameters[-1]
- modifiers = [p.name for p in self._GetParameters()]
- del modifiers[-1] # Remove trailing ')'.
- return self._CreateVariable(indices, real_name.name, indices.name,
- modifiers, '', None)
-
- if token.name == '{':
- body = list(self.GetScope())
- del body[-1] # Remove trailing '}'.
- else:
- body = None
- if token.name == '=':
- token = self._GetNextToken()
- assert token.token_type == tokenize.CONSTANT, token
- assert token.name == '0', token
- modifiers |= FUNCTION_PURE_VIRTUAL
- token = self._GetNextToken()
-
- if token.name == '[':
- # TODO(nnorwitz): store tokens and improve parsing.
- # template <typename T, size_t N> char (&ASH(T (&seq)[N]))[N];
- tokens = list(self._GetMatchingChar('[', ']'))
- token = self._GetNextToken()
-
- assert token.name == ';', (token, return_type_and_name, parameters)
-
- # Looks like we got a method, not a function.
- if len(return_type) > 2 and return_type[-1].name == '::':
- return_type, in_class = \
- self._GetReturnTypeAndClassName(return_type)
- return Method(indices.start, indices.end, name.name, in_class,
- return_type, parameters, modifiers, templated_types,
- body, self.namespace_stack)
- return Function(indices.start, indices.end, name.name, return_type,
- parameters, modifiers, templated_types, body,
- self.namespace_stack)
-
- def _GetReturnTypeAndClassName(self, token_seq):
- # Splitting the return type from the class name in a method
- # can be tricky. For example, Return::Type::Is::Hard::To::Find().
- # Where is the return type and where is the class name?
- # The heuristic used is to pull the last name as the class name.
- # This includes all the templated type info.
- # TODO(nnorwitz): if there is only One name like in the
- # example above, punt and assume the last bit is the class name.
-
- # Ignore a :: prefix, if exists so we can find the first real name.
- i = 0
- if token_seq[0].name == '::':
- i = 1
- # Ignore a :: suffix, if exists.
- end = len(token_seq) - 1
- if token_seq[end-1].name == '::':
- end -= 1
-
- # Make a copy of the sequence so we can append a sentinel
- # value. This is required for GetName will has to have some
- # terminating condition beyond the last name.
- seq_copy = token_seq[i:end]
- seq_copy.append(tokenize.Token(tokenize.SYNTAX, '', 0, 0))
- names = []
- while i < end:
- # Iterate through the sequence parsing out each name.
- new_name, next = self.GetName(seq_copy[i:])
- assert new_name, 'Got empty new_name, next=%s' % next
- # We got a pointer or ref. Add it to the name.
- if next and next.token_type == tokenize.SYNTAX:
- new_name.append(next)
- names.append(new_name)
- i += len(new_name)
-
- # Now that we have the names, it's time to undo what we did.
-
- # Remove the sentinel value.
- names[-1].pop()
- # Flatten the token sequence for the return type.
- return_type = [e for seq in names[:-1] for e in seq]
- # The class name is the last name.
- class_name = names[-1]
- return return_type, class_name
-
- def handle_bool(self):
- pass
-
- def handle_char(self):
- pass
-
- def handle_int(self):
- pass
-
- def handle_long(self):
- pass
-
- def handle_short(self):
- pass
-
- def handle_double(self):
- pass
-
- def handle_float(self):
- pass
-
- def handle_void(self):
- pass
-
- def handle_wchar_t(self):
- pass
-
- def handle_unsigned(self):
- pass
-
- def handle_signed(self):
- pass
-
- def _GetNestedType(self, ctor):
- name = None
- name_tokens, token = self.GetName()
- if name_tokens:
- name = ''.join([t.name for t in name_tokens])
-
- # Handle forward declarations.
- if token.token_type == tokenize.SYNTAX and token.name == ';':
- return ctor(token.start, token.end, name, None,
- self.namespace_stack)
-
- if token.token_type == tokenize.NAME and self._handling_typedef:
- self._AddBackToken(token)
- return ctor(token.start, token.end, name, None,
- self.namespace_stack)
-
- # Must be the type declaration.
- fields = list(self._GetMatchingChar('{', '}'))
- del fields[-1] # Remove trailing '}'.
- if token.token_type == tokenize.SYNTAX and token.name == '{':
- next = self._GetNextToken()
- new_type = ctor(token.start, token.end, name, fields,
- self.namespace_stack)
- # A name means this is an anonymous type and the name
- # is the variable declaration.
- if next.token_type != tokenize.NAME:
- return new_type
- name = new_type
- token = next
-
- # Must be variable declaration using the type prefixed with keyword.
- assert token.token_type == tokenize.NAME, token
- return self._CreateVariable(token, token.name, name, [], '', None)
-
- def handle_struct(self):
- # Special case the handling typedef/aliasing of structs here.
- # It would be a pain to handle in the class code.
- name_tokens, var_token = self.GetName()
- if name_tokens:
- next_token = self._GetNextToken()
- is_syntax = (var_token.token_type == tokenize.SYNTAX and
- var_token.name[0] in '*&')
- is_variable = (var_token.token_type == tokenize.NAME and
- next_token.name == ';')
- variable = var_token
- if is_syntax and not is_variable:
- variable = next_token
- temp = self._GetNextToken()
- if temp.token_type == tokenize.SYNTAX and temp.name == '(':
- # Handle methods declared to return a struct.
- t0 = name_tokens[0]
- struct = tokenize.Token(tokenize.NAME, 'struct',
- t0.start-7, t0.start-2)
- type_and_name = [struct]
- type_and_name.extend(name_tokens)
- type_and_name.extend((var_token, next_token))
- return self._GetMethod(type_and_name, 0, None, False)
- assert temp.name == ';', (temp, name_tokens, var_token)
- if is_syntax or (is_variable and not self._handling_typedef):
- modifiers = ['struct']
- type_name = ''.join([t.name for t in name_tokens])
- position = name_tokens[0]
- return self._CreateVariable(position, variable.name, type_name,
- modifiers, var_token.name, None)
- name_tokens.extend((var_token, next_token))
- self._AddBackTokens(name_tokens)
- else:
- self._AddBackToken(var_token)
- return self._GetClass(Struct, VISIBILITY_PUBLIC, None)
-
- def handle_union(self):
- return self._GetNestedType(Union)
-
- def handle_enum(self):
- return self._GetNestedType(Enum)
-
- def handle_auto(self):
- # TODO(nnorwitz): warn about using auto? Probably not since it
- # will be reclaimed and useful for C++0x.
- pass
-
- def handle_register(self):
- pass
-
- def handle_const(self):
- pass
-
- def handle_inline(self):
- pass
-
- def handle_extern(self):
- pass
-
- def handle_static(self):
- pass
-
- def handle_virtual(self):
- # What follows must be a method.
- token = token2 = self._GetNextToken()
- if token.name == 'inline':
- # HACK(nnorwitz): handle inline dtors by ignoring 'inline'.
- token2 = self._GetNextToken()
- if token2.token_type == tokenize.SYNTAX and token2.name == '~':
- return self.GetMethod(FUNCTION_VIRTUAL + FUNCTION_DTOR, None)
- assert token.token_type == tokenize.NAME or token.name == '::', token
- return_type_and_name = self._GetTokensUpTo(tokenize.SYNTAX, '(')
- return_type_and_name.insert(0, token)
- if token2 is not token:
- return_type_and_name.insert(1, token2)
- return self._GetMethod(return_type_and_name, FUNCTION_VIRTUAL,
- None, False)
-
- def handle_volatile(self):
- pass
-
- def handle_mutable(self):
- pass
-
- def handle_public(self):
- assert self.in_class
- self.visibility = VISIBILITY_PUBLIC
-
- def handle_protected(self):
- assert self.in_class
- self.visibility = VISIBILITY_PROTECTED
-
- def handle_private(self):
- assert self.in_class
- self.visibility = VISIBILITY_PRIVATE
-
- def handle_friend(self):
- tokens = self._GetTokensUpTo(tokenize.SYNTAX, ';')
- assert tokens
- t0 = tokens[0]
- return Friend(t0.start, t0.end, tokens, self.namespace_stack)
-
- def handle_static_cast(self):
- pass
-
- def handle_const_cast(self):
- pass
-
- def handle_dynamic_cast(self):
- pass
-
- def handle_reinterpret_cast(self):
- pass
-
- def handle_new(self):
- pass
-
- def handle_delete(self):
- tokens = self._GetTokensUpTo(tokenize.SYNTAX, ';')
- assert tokens
- return Delete(tokens[0].start, tokens[0].end, tokens)
-
- def handle_typedef(self):
- token = self._GetNextToken()
- if (token.token_type == tokenize.NAME and
- keywords.IsKeyword(token.name)):
- # Token must be struct/enum/union/class.
- method = getattr(self, 'handle_' + token.name)
- self._handling_typedef = True
- tokens = [method()]
- self._handling_typedef = False
- else:
- tokens = [token]
-
- # Get the remainder of the typedef up to the semi-colon.
- tokens.extend(self._GetTokensUpTo(tokenize.SYNTAX, ';'))
-
- # TODO(nnorwitz): clean all this up.
- assert tokens
- name = tokens.pop()
- indices = name
- if tokens:
- indices = tokens[0]
- if not indices:
- indices = token
- if name.name == ')':
- # HACK(nnorwitz): Handle pointers to functions "properly".
- if (len(tokens) >= 4 and
- tokens[1].name == '(' and tokens[2].name == '*'):
- tokens.append(name)
- name = tokens[3]
- elif name.name == ']':
- # HACK(nnorwitz): Handle arrays properly.
- if len(tokens) >= 2:
- tokens.append(name)
- name = tokens[1]
- new_type = tokens
- if tokens and isinstance(tokens[0], tokenize.Token):
- new_type = self.converter.ToType(tokens)[0]
- return Typedef(indices.start, indices.end, name.name,
- new_type, self.namespace_stack)
-
- def handle_typeid(self):
- pass # Not needed yet.
-
- def handle_typename(self):
- pass # Not needed yet.
-
- def _GetTemplatedTypes(self):
- result = {}
- tokens = list(self._GetMatchingChar('<', '>'))
- len_tokens = len(tokens) - 1 # Ignore trailing '>'.
- i = 0
- while i < len_tokens:
- key = tokens[i].name
- i += 1
- if keywords.IsKeyword(key) or key == ',':
- continue
- type_name = default = None
- if i < len_tokens:
- i += 1
- if tokens[i-1].name == '=':
- assert i < len_tokens, '%s %s' % (i, tokens)
- default, unused_next_token = self.GetName(tokens[i:])
- i += len(default)
- else:
- if tokens[i-1].name != ',':
- # We got something like: Type variable.
- # Re-adjust the key (variable) and type_name (Type).
- key = tokens[i-1].name
- type_name = tokens[i-2]
-
- result[key] = (type_name, default)
- return result
-
- def handle_template(self):
- token = self._GetNextToken()
- assert token.token_type == tokenize.SYNTAX, token
- assert token.name == '<', token
- templated_types = self._GetTemplatedTypes()
- # TODO(nnorwitz): for now, just ignore the template params.
- token = self._GetNextToken()
- if token.token_type == tokenize.NAME:
- if token.name == 'class':
- return self._GetClass(Class, VISIBILITY_PRIVATE, templated_types)
- elif token.name == 'struct':
- return self._GetClass(Struct, VISIBILITY_PUBLIC, templated_types)
- elif token.name == 'friend':
- return self.handle_friend()
- self._AddBackToken(token)
- tokens, last = self._GetVarTokensUpTo(tokenize.SYNTAX, '(', ';')
- tokens.append(last)
- self._AddBackTokens(tokens)
- if last.name == '(':
- return self.GetMethod(FUNCTION_NONE, templated_types)
- # Must be a variable definition.
- return None
-
- def handle_true(self):
- pass # Nothing to do.
-
- def handle_false(self):
- pass # Nothing to do.
-
- def handle_asm(self):
- pass # Not needed yet.
-
- def handle_class(self):
- return self._GetClass(Class, VISIBILITY_PRIVATE, None)
-
- def _GetBases(self):
- # Get base classes.
- bases = []
- while 1:
- token = self._GetNextToken()
- assert token.token_type == tokenize.NAME, token
- # TODO(nnorwitz): store kind of inheritance...maybe.
- if token.name not in ('public', 'protected', 'private'):
- # If inheritance type is not specified, it is private.
- # Just put the token back so we can form a name.
- # TODO(nnorwitz): it would be good to warn about this.
- self._AddBackToken(token)
- else:
- # Check for virtual inheritance.
- token = self._GetNextToken()
- if token.name != 'virtual':
- self._AddBackToken(token)
- else:
- # TODO(nnorwitz): store that we got virtual for this base.
- pass
- base, next_token = self.GetName()
- bases_ast = self.converter.ToType(base)
- assert len(bases_ast) == 1, bases_ast
- bases.append(bases_ast[0])
- assert next_token.token_type == tokenize.SYNTAX, next_token
- if next_token.name == '{':
- token = next_token
- break
- # Support multiple inheritance.
- assert next_token.name == ',', next_token
- return bases, token
-
- def _GetClass(self, class_type, visibility, templated_types):
- class_name = None
- class_token = self._GetNextToken()
- if class_token.token_type != tokenize.NAME:
- assert class_token.token_type == tokenize.SYNTAX, class_token
- token = class_token
- else:
- # Skip any macro (e.g. storage class specifiers) after the
- # 'class' keyword.
- next_token = self._GetNextToken()
- if next_token.token_type == tokenize.NAME:
- self._AddBackToken(next_token)
- else:
- self._AddBackTokens([class_token, next_token])
- name_tokens, token = self.GetName()
- class_name = ''.join([t.name for t in name_tokens])
- bases = None
- if token.token_type == tokenize.SYNTAX:
- if token.name == ';':
- # Forward declaration.
- return class_type(class_token.start, class_token.end,
- class_name, None, templated_types, None,
- self.namespace_stack)
- if token.name in '*&':
- # Inline forward declaration. Could be method or data.
- name_token = self._GetNextToken()
- next_token = self._GetNextToken()
- if next_token.name == ';':
- # Handle data
- modifiers = ['class']
- return self._CreateVariable(class_token, name_token.name,
- class_name,
- modifiers, token.name, None)
- else:
- # Assume this is a method.
- tokens = (class_token, token, name_token, next_token)
- self._AddBackTokens(tokens)
- return self.GetMethod(FUNCTION_NONE, None)
- if token.name == ':':
- bases, token = self._GetBases()
-
- body = None
- if token.token_type == tokenize.SYNTAX and token.name == '{':
- assert token.token_type == tokenize.SYNTAX, token
- assert token.name == '{', token
-
- ast = AstBuilder(self.GetScope(), self.filename, class_name,
- visibility, self.namespace_stack)
- body = list(ast.Generate())
-
- if not self._handling_typedef:
- token = self._GetNextToken()
- if token.token_type != tokenize.NAME:
- assert token.token_type == tokenize.SYNTAX, token
- assert token.name == ';', token
- else:
- new_class = class_type(class_token.start, class_token.end,
- class_name, bases, None,
- body, self.namespace_stack)
-
- modifiers = []
- return self._CreateVariable(class_token,
- token.name, new_class,
- modifiers, token.name, None)
- else:
- if not self._handling_typedef:
- self.HandleError('non-typedef token', token)
- self._AddBackToken(token)
-
- return class_type(class_token.start, class_token.end, class_name,
- bases, None, body, self.namespace_stack)
-
- def handle_namespace(self):
- token = self._GetNextToken()
- # Support anonymous namespaces.
- name = None
- if token.token_type == tokenize.NAME:
- name = token.name
- token = self._GetNextToken()
- self.namespace_stack.append(name)
- assert token.token_type == tokenize.SYNTAX, token
- # Create an internal token that denotes when the namespace is complete.
- internal_token = tokenize.Token(_INTERNAL_TOKEN, _NAMESPACE_POP,
- None, None)
- internal_token.whence = token.whence
- if token.name == '=':
- # TODO(nnorwitz): handle aliasing namespaces.
- name, next_token = self.GetName()
- assert next_token.name == ';', next_token
- self._AddBackToken(internal_token)
- else:
- assert token.name == '{', token
- tokens = list(self.GetScope())
- # Replace the trailing } with the internal namespace pop token.
- tokens[-1] = internal_token
- # Handle namespace with nothing in it.
- self._AddBackTokens(tokens)
- return None
-
- def handle_using(self):
- tokens = self._GetTokensUpTo(tokenize.SYNTAX, ';')
- assert tokens
- return Using(tokens[0].start, tokens[0].end, tokens)
-
- def handle_explicit(self):
- assert self.in_class
- # Nothing much to do.
- # TODO(nnorwitz): maybe verify the method name == class name.
- # This must be a ctor.
- return self.GetMethod(FUNCTION_CTOR, None)
-
- def handle_this(self):
- pass # Nothing to do.
-
- def handle_operator(self):
- # Pull off the next token(s?) and make that part of the method name.
- pass
-
- def handle_sizeof(self):
- pass
-
- def handle_case(self):
- pass
-
- def handle_switch(self):
- pass
-
- def handle_default(self):
- token = self._GetNextToken()
- assert token.token_type == tokenize.SYNTAX
- assert token.name == ':'
-
- def handle_if(self):
- pass
-
- def handle_else(self):
- pass
-
- def handle_return(self):
- tokens = self._GetTokensUpTo(tokenize.SYNTAX, ';')
- if not tokens:
- return Return(self.current_token.start, self.current_token.end, None)
- return Return(tokens[0].start, tokens[0].end, tokens)
-
- def handle_goto(self):
- tokens = self._GetTokensUpTo(tokenize.SYNTAX, ';')
- assert len(tokens) == 1, str(tokens)
- return Goto(tokens[0].start, tokens[0].end, tokens[0].name)
-
- def handle_try(self):
- pass # Not needed yet.
-
- def handle_catch(self):
- pass # Not needed yet.
-
- def handle_throw(self):
- pass # Not needed yet.
-
- def handle_while(self):
- pass
-
- def handle_do(self):
- pass
-
- def handle_for(self):
- pass
-
- def handle_break(self):
- self._IgnoreUpTo(tokenize.SYNTAX, ';')
-
- def handle_continue(self):
- self._IgnoreUpTo(tokenize.SYNTAX, ';')
-
-
-def BuilderFromSource(source, filename):
- """Utility method that returns an AstBuilder from source code.
-
- Args:
- source: 'C++ source code'
- filename: 'file1'
-
- Returns:
- AstBuilder
- """
- return AstBuilder(tokenize.GetTokens(source), filename)
-
-
-def PrintIndentifiers(filename, should_print):
- """Prints all identifiers for a C++ source file.
-
- Args:
- filename: 'file1'
- should_print: predicate with signature: bool Function(token)
- """
- source = utils.ReadFile(filename, False)
- if source is None:
- sys.stderr.write('Unable to find: %s\n' % filename)
- return
-
- #print('Processing %s' % actual_filename)
- builder = BuilderFromSource(source, filename)
- try:
- for node in builder.Generate():
- if should_print(node):
- print(node.name)
- except KeyboardInterrupt:
- return
- except:
- pass
-
-
-def PrintAllIndentifiers(filenames, should_print):
- """Prints all identifiers for each C++ source file in filenames.
-
- Args:
- filenames: ['file1', 'file2', ...]
- should_print: predicate with signature: bool Function(token)
- """
- for path in filenames:
- PrintIndentifiers(path, should_print)
-
-
-def main(argv):
- for filename in argv[1:]:
- source = utils.ReadFile(filename)
- if source is None:
- continue
-
- print('Processing %s' % filename)
- builder = BuilderFromSource(source, filename)
- try:
- entire_ast = filter(None, builder.Generate())
- except KeyboardInterrupt:
- return
- except:
- # Already printed a warning, print the traceback and continue.
- traceback.print_exc()
- else:
- if utils.DEBUG:
- for ast in entire_ast:
- print(ast)
-
-
-if __name__ == '__main__':
- main(sys.argv)
diff --git a/src/testing/scripts/generator/cpp/gmock_class.py b/src/testing/scripts/generator/cpp/gmock_class.py
deleted file mode 100755
index 427d206a..00000000
--- a/src/testing/scripts/generator/cpp/gmock_class.py
+++ /dev/null
@@ -1,208 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2008 Google Inc. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-"""Generate Google Mock classes from base classes.
-
-This program will read in a C++ source file and output the Google Mock
-classes for the specified classes. If no class is specified, all
-classes in the source file are emitted.
-
-Usage:
- gmock_class.py header-file.h [ClassName]...
-
-Output is sent to stdout.
-"""
-
-__author__ = 'nnorwitz@google.com (Neal Norwitz)'
-
-
-import os
-import re
-import sys
-
-from cpp import ast
-from cpp import utils
-
-# Preserve compatibility with Python 2.3.
-try:
- _dummy = set
-except NameError:
- import sets
- set = sets.Set
-
-_VERSION = (1, 0, 1) # The version of this script.
-# How many spaces to indent. Can set me with the INDENT environment variable.
-_INDENT = 2
-
-
-def _GenerateMethods(output_lines, source, class_node):
- function_type = ast.FUNCTION_VIRTUAL | ast.FUNCTION_PURE_VIRTUAL
- ctor_or_dtor = ast.FUNCTION_CTOR | ast.FUNCTION_DTOR
- indent = ' ' * _INDENT
-
- for node in class_node.body:
- # We only care about virtual functions.
- if (isinstance(node, ast.Function) and
- node.modifiers & function_type and
- not node.modifiers & ctor_or_dtor):
- # Pick out all the elements we need from the original function.
- const = ''
- if node.modifiers & ast.FUNCTION_CONST:
- const = 'CONST_'
- return_type = 'void'
- if node.return_type:
- # Add modifiers like 'const'.
- modifiers = ''
- if node.return_type.modifiers:
- modifiers = ' '.join(node.return_type.modifiers) + ' '
- return_type = modifiers + node.return_type.name
- template_args = [arg.name for arg in node.return_type.templated_types]
- if template_args:
- return_type += '<' + ', '.join(template_args) + '>'
- if len(template_args) > 1:
- for line in [
- '// The following line won\'t really compile, as the return',
- '// type has multiple template arguments. To fix it, use a',
- '// typedef for the return type.']:
- output_lines.append(indent + line)
- if node.return_type.pointer:
- return_type += '*'
- if node.return_type.reference:
- return_type += '&'
- num_parameters = len(node.parameters)
- if len(node.parameters) == 1:
- first_param = node.parameters[0]
- if source[first_param.start:first_param.end].strip() == 'void':
- # We must treat T(void) as a function with no parameters.
- num_parameters = 0
- mock_method_macro = 'MOCK_%sMETHOD%d' % (const, num_parameters)
- args = ''
- if node.parameters:
- # Due to the parser limitations, it is impossible to keep comments
- # while stripping the default parameters. When defaults are
- # present, we choose to strip them and comments (and produce
- # compilable code).
- # TODO(nnorwitz@google.com): Investigate whether it is possible to
- # preserve parameter name when reconstructing parameter text from
- # the AST.
- if len([param for param in node.parameters if param.default]) > 0:
- args = ', '.join(param.type.name for param in node.parameters)
- else:
- # Get the full text of the parameters from the start
- # of the first parameter to the end of the last parameter.
- start = node.parameters[0].start
- end = node.parameters[-1].end
- # Remove // comments.
- args_strings = re.sub(r'//.*', '', source[start:end])
- # Condense multiple spaces and eliminate newlines putting the
- # parameters together on a single line. Ensure there is a
- # space in an argument which is split by a newline without
- # intervening whitespace, e.g.: int\nBar
- args = re.sub(' +', ' ', args_strings.replace('\n', ' '))
-
- # Create the mock method definition.
- output_lines.extend(['%s%s(%s,' % (indent, mock_method_macro, node.name),
- '%s%s(%s));' % (indent*3, return_type, args)])
-
-
-def _GenerateMocks(filename, source, ast_list, desired_class_names):
- processed_class_names = set()
- lines = []
- for node in ast_list:
- if (isinstance(node, ast.Class) and node.body and
- # desired_class_names being None means that all classes are selected.
- (not desired_class_names or node.name in desired_class_names)):
- class_name = node.name
- processed_class_names.add(class_name)
- class_node = node
- # Add namespace before the class.
- if class_node.namespace:
- lines.extend(['namespace %s {' % n for n in class_node.namespace]) # }
- lines.append('')
-
- # Add the class prolog.
- lines.append('class Mock%s : public %s {' % (class_name, class_name)) # }
- lines.append('%spublic:' % (' ' * (_INDENT // 2)))
-
- # Add all the methods.
- _GenerateMethods(lines, source, class_node)
-
- # Close the class.
- if lines:
- # If there are no virtual methods, no need for a public label.
- if len(lines) == 2:
- del lines[-1]
-
- # Only close the class if there really is a class.
- lines.append('};')
- lines.append('') # Add an extra newline.
-
- # Close the namespace.
- if class_node.namespace:
- for i in range(len(class_node.namespace)-1, -1, -1):
- lines.append('} // namespace %s' % class_node.namespace[i])
- lines.append('') # Add an extra newline.
-
- if desired_class_names:
- missing_class_name_list = list(desired_class_names - processed_class_names)
- if missing_class_name_list:
- missing_class_name_list.sort()
- sys.stderr.write('Class(es) not found in %s: %s\n' %
- (filename, ', '.join(missing_class_name_list)))
- elif not processed_class_names:
- sys.stderr.write('No class found in %s\n' % filename)
-
- return lines
-
-
-def main(argv=sys.argv):
- if len(argv) < 2:
- sys.stderr.write('Google Mock Class Generator v%s\n\n' %
- '.'.join(map(str, _VERSION)))
- sys.stderr.write(__doc__)
- return 1
-
- global _INDENT
- try:
- _INDENT = int(os.environ['INDENT'])
- except KeyError:
- pass
- except:
- sys.stderr.write('Unable to use indent of %s\n' % os.environ.get('INDENT'))
-
- filename = argv[1]
- desired_class_names = None # None means all classes in the source file.
- if len(argv) >= 3:
- desired_class_names = set(argv[2:])
- source = utils.ReadFile(filename)
- if source is None:
- return 1
-
- builder = ast.BuilderFromSource(source, filename)
- try:
- entire_ast = filter(None, builder.Generate())
- except KeyboardInterrupt:
- return
- except:
- # An error message was already printed since we couldn't parse.
- pass
- else:
- lines = _GenerateMocks(filename, source, entire_ast, desired_class_names)
- sys.stdout.write('\n'.join(lines))
-
-
-if __name__ == '__main__':
- main(sys.argv)
diff --git a/src/testing/scripts/generator/cpp/gmock_class_test.py b/src/testing/scripts/generator/cpp/gmock_class_test.py
deleted file mode 100755
index 7aa70276..00000000
--- a/src/testing/scripts/generator/cpp/gmock_class_test.py
+++ /dev/null
@@ -1,259 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2009 Neal Norwitz All Rights Reserved.
-# Portions Copyright 2009 Google Inc. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-"""Tests for gmock.scripts.generator.cpp.gmock_class."""
-
-__author__ = 'nnorwitz@google.com (Neal Norwitz)'
-
-
-import os
-import sys
-import unittest
-
-# Allow the cpp imports below to work when run as a standalone script.
-sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
-
-from cpp import ast
-from cpp import gmock_class
-
-
-class TestCase(unittest.TestCase):
- """Helper class that adds assert methods."""
-
- def StripLeadingWhitespace(self, lines):
- """Strip leading whitespace in each line in 'lines'."""
- return '\n'.join([s.lstrip() for s in lines.split('\n')])
-
- def assertEqualIgnoreLeadingWhitespace(self, expected_lines, lines):
- """Specialized assert that ignores the indent level."""
- self.assertEqual(expected_lines, self.StripLeadingWhitespace(lines))
-
-
-class GenerateMethodsTest(TestCase):
-
- def GenerateMethodSource(self, cpp_source):
- """Convert C++ source to Google Mock output source lines."""
- method_source_lines = []
- # <test> is a pseudo-filename, it is not read or written.
- builder = ast.BuilderFromSource(cpp_source, '<test>')
- ast_list = list(builder.Generate())
- gmock_class._GenerateMethods(method_source_lines, cpp_source, ast_list[0])
- return '\n'.join(method_source_lines)
-
- def testSimpleMethod(self):
- source = """
-class Foo {
- public:
- virtual int Bar();
-};
-"""
- self.assertEqualIgnoreLeadingWhitespace(
- 'MOCK_METHOD0(Bar,\nint());',
- self.GenerateMethodSource(source))
-
- def testSimpleConstMethod(self):
- source = """
-class Foo {
- public:
- virtual void Bar(bool flag) const;
-};
-"""
- self.assertEqualIgnoreLeadingWhitespace(
- 'MOCK_CONST_METHOD1(Bar,\nvoid(bool flag));',
- self.GenerateMethodSource(source))
-
- def testExplicitVoid(self):
- source = """
-class Foo {
- public:
- virtual int Bar(void);
-};
-"""
- self.assertEqualIgnoreLeadingWhitespace(
- 'MOCK_METHOD0(Bar,\nint(void));',
- self.GenerateMethodSource(source))
-
- def testStrangeNewlineInParameter(self):
- source = """
-class Foo {
- public:
- virtual void Bar(int
-a) = 0;
-};
-"""
- self.assertEqualIgnoreLeadingWhitespace(
- 'MOCK_METHOD1(Bar,\nvoid(int a));',
- self.GenerateMethodSource(source))
-
- def testDefaultParameters(self):
- source = """
-class Foo {
- public:
- virtual void Bar(int a, char c = 'x') = 0;
-};
-"""
- self.assertEqualIgnoreLeadingWhitespace(
- 'MOCK_METHOD2(Bar,\nvoid(int, char));',
- self.GenerateMethodSource(source))
-
- def testMultipleDefaultParameters(self):
- source = """
-class Foo {
- public:
- virtual void Bar(int a = 42, char c = 'x') = 0;
-};
-"""
- self.assertEqualIgnoreLeadingWhitespace(
- 'MOCK_METHOD2(Bar,\nvoid(int, char));',
- self.GenerateMethodSource(source))
-
- def testRemovesCommentsWhenDefaultsArePresent(self):
- source = """
-class Foo {
- public:
- virtual void Bar(int a = 42 /* a comment */,
- char /* other comment */ c= 'x') = 0;
-};
-"""
- self.assertEqualIgnoreLeadingWhitespace(
- 'MOCK_METHOD2(Bar,\nvoid(int, char));',
- self.GenerateMethodSource(source))
-
- def testDoubleSlashCommentsInParameterListAreRemoved(self):
- source = """
-class Foo {
- public:
- virtual void Bar(int a, // inline comments should be elided.
- int b // inline comments should be elided.
- ) const = 0;
-};
-"""
- self.assertEqualIgnoreLeadingWhitespace(
- 'MOCK_CONST_METHOD2(Bar,\nvoid(int a, int b));',
- self.GenerateMethodSource(source))
-
- def testCStyleCommentsInParameterListAreNotRemoved(self):
- # NOTE(nnorwitz): I'm not sure if it's the best behavior to keep these
- # comments. Also note that C style comments after the last parameter
- # are still elided.
- source = """
-class Foo {
- public:
- virtual const string& Bar(int /* keeper */, int b);
-};
-"""
- self.assertEqualIgnoreLeadingWhitespace(
- 'MOCK_METHOD2(Bar,\nconst string&(int /* keeper */, int b));',
- self.GenerateMethodSource(source))
-
- def testArgsOfTemplateTypes(self):
- source = """
-class Foo {
- public:
- virtual int Bar(const vector<int>& v, map<int, string>* output);
-};"""
- self.assertEqualIgnoreLeadingWhitespace(
- 'MOCK_METHOD2(Bar,\n'
- 'int(const vector<int>& v, map<int, string>* output));',
- self.GenerateMethodSource(source))
-
- def testReturnTypeWithOneTemplateArg(self):
- source = """
-class Foo {
- public:
- virtual vector<int>* Bar(int n);
-};"""
- self.assertEqualIgnoreLeadingWhitespace(
- 'MOCK_METHOD1(Bar,\nvector<int>*(int n));',
- self.GenerateMethodSource(source))
-
- def testReturnTypeWithManyTemplateArgs(self):
- source = """
-class Foo {
- public:
- virtual map<int, string> Bar();
-};"""
- # Comparing the comment text is brittle - we'll think of something
- # better in case this gets annoying, but for now let's keep it simple.
- self.assertEqualIgnoreLeadingWhitespace(
- '// The following line won\'t really compile, as the return\n'
- '// type has multiple template arguments. To fix it, use a\n'
- '// typedef for the return type.\n'
- 'MOCK_METHOD0(Bar,\nmap<int, string>());',
- self.GenerateMethodSource(source))
-
-
-class GenerateMocksTest(TestCase):
-
- def GenerateMocks(self, cpp_source):
- """Convert C++ source to complete Google Mock output source."""
- # <test> is a pseudo-filename, it is not read or written.
- filename = '<test>'
- builder = ast.BuilderFromSource(cpp_source, filename)
- ast_list = list(builder.Generate())
- lines = gmock_class._GenerateMocks(filename, cpp_source, ast_list, None)
- return '\n'.join(lines)
-
- def testNamespaces(self):
- source = """
-namespace Foo {
-namespace Bar { class Forward; }
-namespace Baz {
-
-class Test {
- public:
- virtual void Foo();
-};
-
-} // namespace Baz
-} // namespace Foo
-"""
- expected = """\
-namespace Foo {
-namespace Baz {
-
-class MockTest : public Test {
-public:
-MOCK_METHOD0(Foo,
-void());
-};
-
-} // namespace Baz
-} // namespace Foo
-"""
- self.assertEqualIgnoreLeadingWhitespace(
- expected, self.GenerateMocks(source))
-
- def testClassWithStorageSpecifierMacro(self):
- source = """
-class STORAGE_SPECIFIER Test {
- public:
- virtual void Foo();
-};
-"""
- expected = """\
-class MockTest : public Test {
-public:
-MOCK_METHOD0(Foo,
-void());
-};
-"""
- self.assertEqualIgnoreLeadingWhitespace(
- expected, self.GenerateMocks(source))
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/src/testing/scripts/generator/cpp/keywords.py b/src/testing/scripts/generator/cpp/keywords.py
deleted file mode 100755
index f694450e..00000000
--- a/src/testing/scripts/generator/cpp/keywords.py
+++ /dev/null
@@ -1,59 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2007 Neal Norwitz
-# Portions Copyright 2007 Google Inc.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-"""C++ keywords and helper utilities for determining keywords."""
-
-__author__ = 'nnorwitz@google.com (Neal Norwitz)'
-
-
-try:
- # Python 3.x
- import builtins
-except ImportError:
- # Python 2.x
- import __builtin__ as builtins
-
-
-if not hasattr(builtins, 'set'):
- # Nominal support for Python 2.3.
- from sets import Set as set
-
-
-TYPES = set('bool char int long short double float void wchar_t unsigned signed'.split())
-TYPE_MODIFIERS = set('auto register const inline extern static virtual volatile mutable'.split())
-ACCESS = set('public protected private friend'.split())
-
-CASTS = set('static_cast const_cast dynamic_cast reinterpret_cast'.split())
-
-OTHERS = set('true false asm class namespace using explicit this operator sizeof'.split())
-OTHER_TYPES = set('new delete typedef struct union enum typeid typename template'.split())
-
-CONTROL = set('case switch default if else return goto'.split())
-EXCEPTION = set('try catch throw'.split())
-LOOP = set('while do for break continue'.split())
-
-ALL = TYPES | TYPE_MODIFIERS | ACCESS | CASTS | OTHERS | OTHER_TYPES | CONTROL | EXCEPTION | LOOP
-
-
-def IsKeyword(token):
- return token in ALL
-
-def IsBuiltinType(token):
- if token in ('virtual', 'inline'):
- # These only apply to methods, they can't be types by themselves.
- return False
- return token in TYPES or token in TYPE_MODIFIERS
diff --git a/src/testing/scripts/generator/cpp/tokenize.py b/src/testing/scripts/generator/cpp/tokenize.py
deleted file mode 100755
index 28c33452..00000000
--- a/src/testing/scripts/generator/cpp/tokenize.py
+++ /dev/null
@@ -1,287 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2007 Neal Norwitz
-# Portions Copyright 2007 Google Inc.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-"""Tokenize C++ source code."""
-
-__author__ = 'nnorwitz@google.com (Neal Norwitz)'
-
-
-try:
- # Python 3.x
- import builtins
-except ImportError:
- # Python 2.x
- import __builtin__ as builtins
-
-
-import sys
-
-from cpp import utils
-
-
-if not hasattr(builtins, 'set'):
- # Nominal support for Python 2.3.
- from sets import Set as set
-
-
-# Add $ as a valid identifier char since so much code uses it.
-_letters = 'abcdefghijklmnopqrstuvwxyz'
-VALID_IDENTIFIER_CHARS = set(_letters + _letters.upper() + '_0123456789$')
-HEX_DIGITS = set('0123456789abcdefABCDEF')
-INT_OR_FLOAT_DIGITS = set('01234567890eE-+')
-
-
-# C++0x string preffixes.
-_STR_PREFIXES = set(('R', 'u8', 'u8R', 'u', 'uR', 'U', 'UR', 'L', 'LR'))
-
-
-# Token types.
-UNKNOWN = 'UNKNOWN'
-SYNTAX = 'SYNTAX'
-CONSTANT = 'CONSTANT'
-NAME = 'NAME'
-PREPROCESSOR = 'PREPROCESSOR'
-
-# Where the token originated from. This can be used for backtracking.
-# It is always set to WHENCE_STREAM in this code.
-WHENCE_STREAM, WHENCE_QUEUE = range(2)
-
-
-class Token(object):
- """Data container to represent a C++ token.
-
- Tokens can be identifiers, syntax char(s), constants, or
- pre-processor directives.
-
- start contains the index of the first char of the token in the source
- end contains the index of the last char of the token in the source
- """
-
- def __init__(self, token_type, name, start, end):
- self.token_type = token_type
- self.name = name
- self.start = start
- self.end = end
- self.whence = WHENCE_STREAM
-
- def __str__(self):
- if not utils.DEBUG:
- return 'Token(%r)' % self.name
- return 'Token(%r, %s, %s)' % (self.name, self.start, self.end)
-
- __repr__ = __str__
-
-
-def _GetString(source, start, i):
- i = source.find('"', i+1)
- while source[i-1] == '\\':
- # Count the trailing backslashes.
- backslash_count = 1
- j = i - 2
- while source[j] == '\\':
- backslash_count += 1
- j -= 1
- # When trailing backslashes are even, they escape each other.
- if (backslash_count % 2) == 0:
- break
- i = source.find('"', i+1)
- return i + 1
-
-
-def _GetChar(source, start, i):
- # NOTE(nnorwitz): may not be quite correct, should be good enough.
- i = source.find("'", i+1)
- while source[i-1] == '\\':
- # Need to special case '\\'.
- if (i - 2) > start and source[i-2] == '\\':
- break
- i = source.find("'", i+1)
- # Try to handle unterminated single quotes (in a #if 0 block).
- if i < 0:
- i = start
- return i + 1
-
-
-def GetTokens(source):
- """Returns a sequence of Tokens.
-
- Args:
- source: string of C++ source code.
-
- Yields:
- Token that represents the next token in the source.
- """
- # Cache various valid character sets for speed.
- valid_identifier_chars = VALID_IDENTIFIER_CHARS
- hex_digits = HEX_DIGITS
- int_or_float_digits = INT_OR_FLOAT_DIGITS
- int_or_float_digits2 = int_or_float_digits | set('.')
-
- # Only ignore errors while in a #if 0 block.
- ignore_errors = False
- count_ifs = 0
-
- i = 0
- end = len(source)
- while i < end:
- # Skip whitespace.
- while i < end and source[i].isspace():
- i += 1
- if i >= end:
- return
-
- token_type = UNKNOWN
- start = i
- c = source[i]
- if c.isalpha() or c == '_': # Find a string token.
- token_type = NAME
- while source[i] in valid_identifier_chars:
- i += 1
- # String and character constants can look like a name if
- # they are something like L"".
- if (source[i] == "'" and (i - start) == 1 and
- source[start:i] in 'uUL'):
- # u, U, and L are valid C++0x character preffixes.
- token_type = CONSTANT
- i = _GetChar(source, start, i)
- elif source[i] == "'" and source[start:i] in _STR_PREFIXES:
- token_type = CONSTANT
- i = _GetString(source, start, i)
- elif c == '/' and source[i+1] == '/': # Find // comments.
- i = source.find('\n', i)
- if i == -1: # Handle EOF.
- i = end
- continue
- elif c == '/' and source[i+1] == '*': # Find /* comments. */
- i = source.find('*/', i) + 2
- continue
- elif c in ':+-<>&|*=': # : or :: (plus other chars).
- token_type = SYNTAX
- i += 1
- new_ch = source[i]
- if new_ch == c:
- i += 1
- elif c == '-' and new_ch == '>':
- i += 1
- elif new_ch == '=':
- i += 1
- elif c in '()[]{}~!?^%;/.,': # Handle single char tokens.
- token_type = SYNTAX
- i += 1
- if c == '.' and source[i].isdigit():
- token_type = CONSTANT
- i += 1
- while source[i] in int_or_float_digits:
- i += 1
- # Handle float suffixes.
- for suffix in ('l', 'f'):
- if suffix == source[i:i+1].lower():
- i += 1
- break
- elif c.isdigit(): # Find integer.
- token_type = CONSTANT
- if c == '0' and source[i+1] in 'xX':
- # Handle hex digits.
- i += 2
- while source[i] in hex_digits:
- i += 1
- else:
- while source[i] in int_or_float_digits2:
- i += 1
- # Handle integer (and float) suffixes.
- for suffix in ('ull', 'll', 'ul', 'l', 'f', 'u'):
- size = len(suffix)
- if suffix == source[i:i+size].lower():
- i += size
- break
- elif c == '"': # Find string.
- token_type = CONSTANT
- i = _GetString(source, start, i)
- elif c == "'": # Find char.
- token_type = CONSTANT
- i = _GetChar(source, start, i)
- elif c == '#': # Find pre-processor command.
- token_type = PREPROCESSOR
- got_if = source[i:i+3] == '#if' and source[i+3:i+4].isspace()
- if got_if:
- count_ifs += 1
- elif source[i:i+6] == '#endif':
- count_ifs -= 1
- if count_ifs == 0:
- ignore_errors = False
-
- # TODO(nnorwitz): handle preprocessor statements (\ continuations).
- while 1:
- i1 = source.find('\n', i)
- i2 = source.find('//', i)
- i3 = source.find('/*', i)
- i4 = source.find('"', i)
- # NOTE(nnorwitz): doesn't handle comments in #define macros.
- # Get the first important symbol (newline, comment, EOF/end).
- i = min([x for x in (i1, i2, i3, i4, end) if x != -1])
-
- # Handle #include "dir//foo.h" properly.
- if source[i] == '"':
- i = source.find('"', i+1) + 1
- assert i > 0
- continue
- # Keep going if end of the line and the line ends with \.
- if not (i == i1 and source[i-1] == '\\'):
- if got_if:
- condition = source[start+4:i].lstrip()
- if (condition.startswith('0') or
- condition.startswith('(0)')):
- ignore_errors = True
- break
- i += 1
- elif c == '\\': # Handle \ in code.
- # This is different from the pre-processor \ handling.
- i += 1
- continue
- elif ignore_errors:
- # The tokenizer seems to be in pretty good shape. This
- # raise is conditionally disabled so that bogus code
- # in an #if 0 block can be handled. Since we will ignore
- # it anyways, this is probably fine. So disable the
- # exception and return the bogus char.
- i += 1
- else:
- sys.stderr.write('Got invalid token in %s @ %d token:%s: %r\n' %
- ('?', i, c, source[i-10:i+10]))
- raise RuntimeError('unexpected token')
-
- if i <= 0:
- print('Invalid index, exiting now.')
- return
- yield Token(token_type, source[start:i], start, i)
-
-
-if __name__ == '__main__':
- def main(argv):
- """Driver mostly for testing purposes."""
- for filename in argv[1:]:
- source = utils.ReadFile(filename)
- if source is None:
- continue
-
- for token in GetTokens(source):
- print('%-12s: %s' % (token.token_type, token.name))
- # print('\r%6.2f%%' % (100.0 * index / token.end),)
- sys.stdout.write('\n')
-
-
- main(sys.argv)
diff --git a/src/testing/scripts/generator/cpp/utils.py b/src/testing/scripts/generator/cpp/utils.py
deleted file mode 100755
index eab36eec..00000000
--- a/src/testing/scripts/generator/cpp/utils.py
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2007 Neal Norwitz
-# Portions Copyright 2007 Google Inc.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-"""Generic utilities for C++ parsing."""
-
-__author__ = 'nnorwitz@google.com (Neal Norwitz)'
-
-
-import sys
-
-
-# Set to True to see the start/end token indices.
-DEBUG = True
-
-
-def ReadFile(filename, print_error=True):
- """Returns the contents of a file."""
- try:
- fp = open(filename)
- try:
- return fp.read()
- finally:
- fp.close()
- except IOError:
- if print_error:
- print('Error reading %s: %s' % (filename, sys.exc_info()[1]))
- return None
diff --git a/src/testing/scripts/generator/gmock_gen.py b/src/testing/scripts/generator/gmock_gen.py
deleted file mode 100755
index 8cc0d135..00000000
--- a/src/testing/scripts/generator/gmock_gen.py
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2008 Google Inc. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-"""Driver for starting up Google Mock class generator."""
-
-__author__ = 'nnorwitz@google.com (Neal Norwitz)'
-
-import os
-import sys
-
-if __name__ == '__main__':
- # Add the directory of this script to the path so we can import gmock_class.
- sys.path.append(os.path.dirname(__file__))
-
- from cpp import gmock_class
- # Fix the docstring in case they require the usage.
- gmock_class.__doc__ = gmock_class.__doc__.replace('gmock_class.py', __file__)
- gmock_class.main()
diff --git a/src/testing/scripts/gmock-config.in b/src/testing/scripts/gmock-config.in
deleted file mode 100755
index 2baefe94..00000000
--- a/src/testing/scripts/gmock-config.in
+++ /dev/null
@@ -1,303 +0,0 @@
-#!/bin/sh
-
-# These variables are automatically filled in by the configure script.
-name="@PACKAGE_TARNAME@"
-version="@PACKAGE_VERSION@"
-
-show_usage()
-{
- echo "Usage: gmock-config [OPTIONS...]"
-}
-
-show_help()
-{
- show_usage
- cat <<\EOF
-
-The `gmock-config' script provides access to the necessary compile and linking
-flags to connect with Google C++ Mocking Framework, both in a build prior to
-installation, and on the system proper after installation. The installation
-overrides may be issued in combination with any other queries, but will only
-affect installation queries if called on a built but not installed gmock. The
-installation queries may not be issued with any other types of queries, and
-only one installation query may be made at a time. The version queries and
-compiler flag queries may be combined as desired but not mixed. Different
-version queries are always combined with logical "and" semantics, and only the
-last of any particular query is used while all previous ones ignored. All
-versions must be specified as a sequence of numbers separated by periods.
-Compiler flag queries output the union of the sets of flags when combined.
-
- Examples:
- gmock-config --min-version=1.0 || echo "Insufficient Google Mock version."
-
- g++ $(gmock-config --cppflags --cxxflags) -o foo.o -c foo.cpp
- g++ $(gmock-config --ldflags --libs) -o foo foo.o
-
- # When using a built but not installed Google Mock:
- g++ $(../../my_gmock_build/scripts/gmock-config ...) ...
-
- # When using an installed Google Mock, but with installation overrides:
- export GMOCK_PREFIX="/opt"
- g++ $(gmock-config --libdir="/opt/lib64" ...) ...
-
- Help:
- --usage brief usage information
- --help display this help message
-
- Installation Overrides:
- --prefix=<dir> overrides the installation prefix
- --exec-prefix=<dir> overrides the executable installation prefix
- --libdir=<dir> overrides the library installation prefix
- --includedir=<dir> overrides the header file installation prefix
-
- Installation Queries:
- --prefix installation prefix
- --exec-prefix executable installation prefix
- --libdir library installation directory
- --includedir header file installation directory
- --version the version of the Google Mock installation
-
- Version Queries:
- --min-version=VERSION return 0 if the version is at least VERSION
- --exact-version=VERSION return 0 if the version is exactly VERSION
- --max-version=VERSION return 0 if the version is at most VERSION
-
- Compilation Flag Queries:
- --cppflags compile flags specific to the C-like preprocessors
- --cxxflags compile flags appropriate for C++ programs
- --ldflags linker flags
- --libs libraries for linking
-
-EOF
-}
-
-# This function bounds our version with a min and a max. It uses some clever
-# POSIX-compliant variable expansion to portably do all the work in the shell
-# and avoid any dependency on a particular "sed" or "awk" implementation.
-# Notable is that it will only ever compare the first 3 components of versions.
-# Further components will be cleanly stripped off. All versions must be
-# unadorned, so "v1.0" will *not* work. The minimum version must be in $1, and
-# the max in $2. TODO(chandlerc@google.com): If this ever breaks, we should
-# investigate expanding this via autom4te from AS_VERSION_COMPARE rather than
-# continuing to maintain our own shell version.
-check_versions()
-{
- major_version=${version%%.*}
- minor_version="0"
- point_version="0"
- if test "${version#*.}" != "${version}"; then
- minor_version=${version#*.}
- minor_version=${minor_version%%.*}
- fi
- if test "${version#*.*.}" != "${version}"; then
- point_version=${version#*.*.}
- point_version=${point_version%%.*}
- fi
-
- min_version="$1"
- min_major_version=${min_version%%.*}
- min_minor_version="0"
- min_point_version="0"
- if test "${min_version#*.}" != "${min_version}"; then
- min_minor_version=${min_version#*.}
- min_minor_version=${min_minor_version%%.*}
- fi
- if test "${min_version#*.*.}" != "${min_version}"; then
- min_point_version=${min_version#*.*.}
- min_point_version=${min_point_version%%.*}
- fi
-
- max_version="$2"
- max_major_version=${max_version%%.*}
- max_minor_version="0"
- max_point_version="0"
- if test "${max_version#*.}" != "${max_version}"; then
- max_minor_version=${max_version#*.}
- max_minor_version=${max_minor_version%%.*}
- fi
- if test "${max_version#*.*.}" != "${max_version}"; then
- max_point_version=${max_version#*.*.}
- max_point_version=${max_point_version%%.*}
- fi
-
- test $(($major_version)) -lt $(($min_major_version)) && exit 1
- if test $(($major_version)) -eq $(($min_major_version)); then
- test $(($minor_version)) -lt $(($min_minor_version)) && exit 1
- if test $(($minor_version)) -eq $(($min_minor_version)); then
- test $(($point_version)) -lt $(($min_point_version)) && exit 1
- fi
- fi
-
- test $(($major_version)) -gt $(($max_major_version)) && exit 1
- if test $(($major_version)) -eq $(($max_major_version)); then
- test $(($minor_version)) -gt $(($max_minor_version)) && exit 1
- if test $(($minor_version)) -eq $(($max_minor_version)); then
- test $(($point_version)) -gt $(($max_point_version)) && exit 1
- fi
- fi
-
- exit 0
-}
-
-# Show the usage line when no arguments are specified.
-if test $# -eq 0; then
- show_usage
- exit 1
-fi
-
-while test $# -gt 0; do
- case $1 in
- --usage) show_usage; exit 0;;
- --help) show_help; exit 0;;
-
- # Installation overrides
- --prefix=*) GMOCK_PREFIX=${1#--prefix=};;
- --exec-prefix=*) GMOCK_EXEC_PREFIX=${1#--exec-prefix=};;
- --libdir=*) GMOCK_LIBDIR=${1#--libdir=};;
- --includedir=*) GMOCK_INCLUDEDIR=${1#--includedir=};;
-
- # Installation queries
- --prefix|--exec-prefix|--libdir|--includedir|--version)
- if test -n "${do_query}"; then
- show_usage
- exit 1
- fi
- do_query=${1#--}
- ;;
-
- # Version checking
- --min-version=*)
- do_check_versions=yes
- min_version=${1#--min-version=}
- ;;
- --max-version=*)
- do_check_versions=yes
- max_version=${1#--max-version=}
- ;;
- --exact-version=*)
- do_check_versions=yes
- exact_version=${1#--exact-version=}
- ;;
-
- # Compiler flag output
- --cppflags) echo_cppflags=yes;;
- --cxxflags) echo_cxxflags=yes;;
- --ldflags) echo_ldflags=yes;;
- --libs) echo_libs=yes;;
-
- # Everything else is an error
- *) show_usage; exit 1;;
- esac
- shift
-done
-
-# These have defaults filled in by the configure script but can also be
-# overridden by environment variables or command line parameters.
-prefix="${GMOCK_PREFIX:-@prefix@}"
-exec_prefix="${GMOCK_EXEC_PREFIX:-@exec_prefix@}"
-libdir="${GMOCK_LIBDIR:-@libdir@}"
-includedir="${GMOCK_INCLUDEDIR:-@includedir@}"
-
-# We try and detect if our binary is not located at its installed location. If
-# it's not, we provide variables pointing to the source and build tree rather
-# than to the install tree. We also locate Google Test using the configured
-# gtest-config script rather than searching the PATH and our bindir for one.
-# This allows building against a just-built gmock rather than an installed
-# gmock.
-bindir="@bindir@"
-this_relative_bindir=`dirname $0`
-this_bindir=`cd ${this_relative_bindir}; pwd -P`
-if test "${this_bindir}" = "${this_bindir%${bindir}}"; then
- # The path to the script doesn't end in the bindir sequence from Autoconf,
- # assume that we are in a build tree.
- build_dir=`dirname ${this_bindir}`
- src_dir=`cd ${this_bindir}/@top_srcdir@; pwd -P`
-
- # TODO(chandlerc@google.com): This is a dangerous dependency on libtool, we
- # should work to remove it, and/or remove libtool altogether, replacing it
- # with direct references to the library and a link path.
- gmock_libs="${build_dir}/lib/libgmock.la"
- gmock_ldflags=""
-
- # We provide hooks to include from either the source or build dir, where the
- # build dir is always preferred. This will potentially allow us to write
- # build rules for generated headers and have them automatically be preferred
- # over provided versions.
- gmock_cppflags="-I${build_dir}/include -I${src_dir}/include"
- gmock_cxxflags=""
-
- # Directly invoke the gtest-config script used during the build process.
- gtest_config="@GTEST_CONFIG@"
-else
- # We're using an installed gmock, although it may be staged under some
- # prefix. Assume (as our own libraries do) that we can resolve the prefix,
- # and are present in the dynamic link paths.
- gmock_ldflags="-L${libdir}"
- gmock_libs="-l${name}"
- gmock_cppflags="-I${includedir}"
- gmock_cxxflags=""
-
- # We also prefer any gtest-config script installed in our prefix. Lacking
- # one, we look in the PATH for one.
- gtest_config="${bindir}/gtest-config"
- if test ! -x "${gtest_config}"; then
- gtest_config=`which gtest-config`
- fi
-fi
-
-# Ensure that we have located a Google Test to link against.
-if ! test -x "${gtest_config}"; then
- echo "Unable to locate Google Test, check your Google Mock configuration" \
- "and installation" >&2
- exit 1
-elif ! "${gtest_config}" "--exact-version=@GTEST_VERSION@"; then
- echo "The Google Test found is not the same version as Google Mock was " \
- "built against" >&2
- exit 1
-fi
-
-# Add the necessary Google Test bits into the various flag variables
-gmock_cppflags="${gmock_cppflags} `${gtest_config} --cppflags`"
-gmock_cxxflags="${gmock_cxxflags} `${gtest_config} --cxxflags`"
-gmock_ldflags="${gmock_ldflags} `${gtest_config} --ldflags`"
-gmock_libs="${gmock_libs} `${gtest_config} --libs`"
-
-# Do an installation query if requested.
-if test -n "$do_query"; then
- case $do_query in
- prefix) echo $prefix; exit 0;;
- exec-prefix) echo $exec_prefix; exit 0;;
- libdir) echo $libdir; exit 0;;
- includedir) echo $includedir; exit 0;;
- version) echo $version; exit 0;;
- *) show_usage; exit 1;;
- esac
-fi
-
-# Do a version check if requested.
-if test "$do_check_versions" = "yes"; then
- # Make sure we didn't receive a bad combination of parameters.
- test "$echo_cppflags" = "yes" && show_usage && exit 1
- test "$echo_cxxflags" = "yes" && show_usage && exit 1
- test "$echo_ldflags" = "yes" && show_usage && exit 1
- test "$echo_libs" = "yes" && show_usage && exit 1
-
- if test "$exact_version" != ""; then
- check_versions $exact_version $exact_version
- # unreachable
- else
- check_versions ${min_version:-0.0.0} ${max_version:-9999.9999.9999}
- # unreachable
- fi
-fi
-
-# Do the output in the correct order so that these can be used in-line of
-# a compiler invocation.
-output=""
-test "$echo_cppflags" = "yes" && output="$output $gmock_cppflags"
-test "$echo_cxxflags" = "yes" && output="$output $gmock_cxxflags"
-test "$echo_ldflags" = "yes" && output="$output $gmock_ldflags"
-test "$echo_libs" = "yes" && output="$output $gmock_libs"
-echo $output
-
-exit 0
diff --git a/src/testing/scripts/gmock_doctor.py b/src/testing/scripts/gmock_doctor.py
deleted file mode 100755
index f7c3920f..00000000
--- a/src/testing/scripts/gmock_doctor.py
+++ /dev/null
@@ -1,631 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2008, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-"""Converts compiler's errors in code using Google Mock to plain English."""
-
-__author__ = 'wan@google.com (Zhanyong Wan)'
-
-import re
-import sys
-
-_VERSION = '1.0.3'
-
-_EMAIL = 'googlemock@googlegroups.com'
-
-_COMMON_GMOCK_SYMBOLS = [
- # Matchers
- '_',
- 'A',
- 'AddressSatisfies',
- 'AllOf',
- 'An',
- 'AnyOf',
- 'ContainerEq',
- 'Contains',
- 'ContainsRegex',
- 'DoubleEq',
- 'ElementsAre',
- 'ElementsAreArray',
- 'EndsWith',
- 'Eq',
- 'Field',
- 'FloatEq',
- 'Ge',
- 'Gt',
- 'HasSubstr',
- 'IsInitializedProto',
- 'Le',
- 'Lt',
- 'MatcherCast',
- 'Matches',
- 'MatchesRegex',
- 'NanSensitiveDoubleEq',
- 'NanSensitiveFloatEq',
- 'Ne',
- 'Not',
- 'NotNull',
- 'Pointee',
- 'Property',
- 'Ref',
- 'ResultOf',
- 'SafeMatcherCast',
- 'StartsWith',
- 'StrCaseEq',
- 'StrCaseNe',
- 'StrEq',
- 'StrNe',
- 'Truly',
- 'TypedEq',
- 'Value',
-
- # Actions
- 'Assign',
- 'ByRef',
- 'DeleteArg',
- 'DoAll',
- 'DoDefault',
- 'IgnoreResult',
- 'Invoke',
- 'InvokeArgument',
- 'InvokeWithoutArgs',
- 'Return',
- 'ReturnNew',
- 'ReturnNull',
- 'ReturnRef',
- 'SaveArg',
- 'SetArgReferee',
- 'SetArgPointee',
- 'SetArgumentPointee',
- 'SetArrayArgument',
- 'SetErrnoAndReturn',
- 'Throw',
- 'WithArg',
- 'WithArgs',
- 'WithoutArgs',
-
- # Cardinalities
- 'AnyNumber',
- 'AtLeast',
- 'AtMost',
- 'Between',
- 'Exactly',
-
- # Sequences
- 'InSequence',
- 'Sequence',
-
- # Misc
- 'DefaultValue',
- 'Mock',
- ]
-
-# Regex for matching source file path and line number in the compiler's errors.
-_GCC_FILE_LINE_RE = r'(?P<file>.*):(?P<line>\d+):(\d+:)?\s+'
-_CLANG_FILE_LINE_RE = r'(?P<file>.*):(?P<line>\d+):(?P<column>\d+):\s+'
-_CLANG_NON_GMOCK_FILE_LINE_RE = (
- r'(?P<file>.*[/\\^](?!gmock-)[^/\\]+):(?P<line>\d+):(?P<column>\d+):\s+')
-
-
-def _FindAllMatches(regex, s):
- """Generates all matches of regex in string s."""
-
- r = re.compile(regex)
- return r.finditer(s)
-
-
-def _GenericDiagnoser(short_name, long_name, diagnoses, msg):
- """Diagnoses the given disease by pattern matching.
-
- Can provide different diagnoses for different patterns.
-
- Args:
- short_name: Short name of the disease.
- long_name: Long name of the disease.
- diagnoses: A list of pairs (regex, pattern for formatting the diagnosis
- for matching regex).
- msg: Compiler's error messages.
- Yields:
- Tuples of the form
- (short name of disease, long name of disease, diagnosis).
- """
- for regex, diagnosis in diagnoses:
- if re.search(regex, msg):
- diagnosis = '%(file)s:%(line)s:' + diagnosis
- for m in _FindAllMatches(regex, msg):
- yield (short_name, long_name, diagnosis % m.groupdict())
-
-
-def _NeedToReturnReferenceDiagnoser(msg):
- """Diagnoses the NRR disease, given the error messages by the compiler."""
-
- gcc_regex = (r'In member function \'testing::internal::ReturnAction<R>.*\n'
- + _GCC_FILE_LINE_RE + r'instantiated from here\n'
- r'.*gmock-actions\.h.*error: creating array with negative size')
- clang_regex = (r'error:.*array.*negative.*\r?\n'
- r'(.*\n)*?' +
- _CLANG_NON_GMOCK_FILE_LINE_RE +
- r'note: in instantiation of function template specialization '
- r'\'testing::internal::ReturnAction<(?P<type>.*)>'
- r'::operator Action<.*>\' requested here')
- diagnosis = """
-You are using a Return() action in a function that returns a reference to
-%(type)s. Please use ReturnRef() instead."""
- return _GenericDiagnoser('NRR', 'Need to Return Reference',
- [(clang_regex, diagnosis),
- (gcc_regex, diagnosis % {'type': 'a type'})],
- msg)
-
-
-def _NeedToReturnSomethingDiagnoser(msg):
- """Diagnoses the NRS disease, given the error messages by the compiler."""
-
- gcc_regex = (_GCC_FILE_LINE_RE + r'(instantiated from here\n.'
- r'*gmock.*actions\.h.*error: void value not ignored)'
- r'|(error: control reaches end of non-void function)')
- clang_regex1 = (_CLANG_FILE_LINE_RE +
- r'error: cannot initialize return object '
- r'of type \'Result\' \(aka \'(?P<return_type>.*)\'\) '
- r'with an rvalue of type \'void\'')
- clang_regex2 = (_CLANG_FILE_LINE_RE +
- r'error: cannot initialize return object '
- r'of type \'(?P<return_type>.*)\' '
- r'with an rvalue of type \'void\'')
- diagnosis = """
-You are using an action that returns void, but it needs to return
-%(return_type)s. Please tell it *what* to return. Perhaps you can use
-the pattern DoAll(some_action, Return(some_value))?"""
- return _GenericDiagnoser(
- 'NRS',
- 'Need to Return Something',
- [(gcc_regex, diagnosis % {'return_type': '*something*'}),
- (clang_regex1, diagnosis),
- (clang_regex2, diagnosis)],
- msg)
-
-
-def _NeedToReturnNothingDiagnoser(msg):
- """Diagnoses the NRN disease, given the error messages by the compiler."""
-
- gcc_regex = (_GCC_FILE_LINE_RE + r'instantiated from here\n'
- r'.*gmock-actions\.h.*error: instantiation of '
- r'\'testing::internal::ReturnAction<R>::Impl<F>::value_\' '
- r'as type \'void\'')
- clang_regex1 = (r'error: field has incomplete type '
- r'\'Result\' \(aka \'void\'\)(\r)?\n'
- r'(.*\n)*?' +
- _CLANG_NON_GMOCK_FILE_LINE_RE + r'note: in instantiation '
- r'of function template specialization '
- r'\'testing::internal::ReturnAction<(?P<return_type>.*)>'
- r'::operator Action<void \(.*\)>\' requested here')
- clang_regex2 = (r'error: field has incomplete type '
- r'\'Result\' \(aka \'void\'\)(\r)?\n'
- r'(.*\n)*?' +
- _CLANG_NON_GMOCK_FILE_LINE_RE + r'note: in instantiation '
- r'of function template specialization '
- r'\'testing::internal::DoBothAction<.*>'
- r'::operator Action<(?P<return_type>.*) \(.*\)>\' '
- r'requested here')
- diagnosis = """
-You are using an action that returns %(return_type)s, but it needs to return
-void. Please use a void-returning action instead.
-
-All actions but the last in DoAll(...) must return void. Perhaps you need
-to re-arrange the order of actions in a DoAll(), if you are using one?"""
- return _GenericDiagnoser(
- 'NRN',
- 'Need to Return Nothing',
- [(gcc_regex, diagnosis % {'return_type': '*something*'}),
- (clang_regex1, diagnosis),
- (clang_regex2, diagnosis)],
- msg)
-
-
-def _IncompleteByReferenceArgumentDiagnoser(msg):
- """Diagnoses the IBRA disease, given the error messages by the compiler."""
-
- gcc_regex = (_GCC_FILE_LINE_RE + r'instantiated from here\n'
- r'.*gtest-printers\.h.*error: invalid application of '
- r'\'sizeof\' to incomplete type \'(?P<type>.*)\'')
-
- clang_regex = (r'.*gtest-printers\.h.*error: invalid application of '
- r'\'sizeof\' to an incomplete type '
- r'\'(?P<type>.*)( const)?\'\r?\n'
- r'(.*\n)*?' +
- _CLANG_NON_GMOCK_FILE_LINE_RE +
- r'note: in instantiation of member function '
- r'\'testing::internal2::TypeWithoutFormatter<.*>::'
- r'PrintValue\' requested here')
- diagnosis = """
-In order to mock this function, Google Mock needs to see the definition
-of type "%(type)s" - declaration alone is not enough. Either #include
-the header that defines it, or change the argument to be passed
-by pointer."""
-
- return _GenericDiagnoser('IBRA', 'Incomplete By-Reference Argument Type',
- [(gcc_regex, diagnosis),
- (clang_regex, diagnosis)],
- msg)
-
-
-def _OverloadedFunctionMatcherDiagnoser(msg):
- """Diagnoses the OFM disease, given the error messages by the compiler."""
-
- gcc_regex = (_GCC_FILE_LINE_RE + r'error: no matching function for '
- r'call to \'Truly\(<unresolved overloaded function type>\)')
- clang_regex = (_CLANG_FILE_LINE_RE + r'error: no matching function for '
- r'call to \'Truly')
- diagnosis = """
-The argument you gave to Truly() is an overloaded function. Please tell
-your compiler which overloaded version you want to use.
-
-For example, if you want to use the version whose signature is
- bool Foo(int n);
-you should write
- Truly(static_cast<bool (*)(int n)>(Foo))"""
- return _GenericDiagnoser('OFM', 'Overloaded Function Matcher',
- [(gcc_regex, diagnosis),
- (clang_regex, diagnosis)],
- msg)
-
-
-def _OverloadedFunctionActionDiagnoser(msg):
- """Diagnoses the OFA disease, given the error messages by the compiler."""
-
- gcc_regex = (_GCC_FILE_LINE_RE + r'error: no matching function for call to '
- r'\'Invoke\(<unresolved overloaded function type>')
- clang_regex = (_CLANG_FILE_LINE_RE + r'error: no matching '
- r'function for call to \'Invoke\'\r?\n'
- r'(.*\n)*?'
- r'.*\bgmock-\w+-actions\.h:\d+:\d+:\s+'
- r'note: candidate template ignored:\s+'
- r'couldn\'t infer template argument \'FunctionImpl\'')
- diagnosis = """
-Function you are passing to Invoke is overloaded. Please tell your compiler
-which overloaded version you want to use.
-
-For example, if you want to use the version whose signature is
- bool MyFunction(int n, double x);
-you should write something like
- Invoke(static_cast<bool (*)(int n, double x)>(MyFunction))"""
- return _GenericDiagnoser('OFA', 'Overloaded Function Action',
- [(gcc_regex, diagnosis),
- (clang_regex, diagnosis)],
- msg)
-
-
-def _OverloadedMethodActionDiagnoser(msg):
- """Diagnoses the OMA disease, given the error messages by the compiler."""
-
- gcc_regex = (_GCC_FILE_LINE_RE + r'error: no matching function for '
- r'call to \'Invoke\(.+, <unresolved overloaded function '
- r'type>\)')
- clang_regex = (_CLANG_FILE_LINE_RE + r'error: no matching function '
- r'for call to \'Invoke\'\r?\n'
- r'(.*\n)*?'
- r'.*\bgmock-\w+-actions\.h:\d+:\d+: '
- r'note: candidate function template not viable: '
- r'requires .*, but 2 (arguments )?were provided')
- diagnosis = """
-The second argument you gave to Invoke() is an overloaded method. Please
-tell your compiler which overloaded version you want to use.
-
-For example, if you want to use the version whose signature is
- class Foo {
- ...
- bool Bar(int n, double x);
- };
-you should write something like
- Invoke(foo, static_cast<bool (Foo::*)(int n, double x)>(&Foo::Bar))"""
- return _GenericDiagnoser('OMA', 'Overloaded Method Action',
- [(gcc_regex, diagnosis),
- (clang_regex, diagnosis)],
- msg)
-
-
-def _MockObjectPointerDiagnoser(msg):
- """Diagnoses the MOP disease, given the error messages by the compiler."""
-
- gcc_regex = (_GCC_FILE_LINE_RE + r'error: request for member '
- r'\'gmock_(?P<method>.+)\' in \'(?P<mock_object>.+)\', '
- r'which is of non-class type \'(.*::)*(?P<class_name>.+)\*\'')
- clang_regex = (_CLANG_FILE_LINE_RE + r'error: member reference type '
- r'\'(?P<class_name>.*?) *\' is a pointer; '
- r'maybe you meant to use \'->\'\?')
- diagnosis = """
-The first argument to ON_CALL() and EXPECT_CALL() must be a mock *object*,
-not a *pointer* to it. Please write '*(%(mock_object)s)' instead of
-'%(mock_object)s' as your first argument.
-
-For example, given the mock class:
-
- class %(class_name)s : public ... {
- ...
- MOCK_METHOD0(%(method)s, ...);
- };
-
-and the following mock instance:
-
- %(class_name)s* mock_ptr = ...
-
-you should use the EXPECT_CALL like this:
-
- EXPECT_CALL(*mock_ptr, %(method)s(...));"""
-
- return _GenericDiagnoser(
- 'MOP',
- 'Mock Object Pointer',
- [(gcc_regex, diagnosis),
- (clang_regex, diagnosis % {'mock_object': 'mock_object',
- 'method': 'method',
- 'class_name': '%(class_name)s'})],
- msg)
-
-
-def _NeedToUseSymbolDiagnoser(msg):
- """Diagnoses the NUS disease, given the error messages by the compiler."""
-
- gcc_regex = (_GCC_FILE_LINE_RE + r'error: \'(?P<symbol>.+)\' '
- r'(was not declared in this scope|has not been declared)')
- clang_regex = (_CLANG_FILE_LINE_RE +
- r'error: (use of undeclared identifier|unknown type name|'
- r'no template named) \'(?P<symbol>[^\']+)\'')
- diagnosis = """
-'%(symbol)s' is defined by Google Mock in the testing namespace.
-Did you forget to write
- using testing::%(symbol)s;
-?"""
- for m in (list(_FindAllMatches(gcc_regex, msg)) +
- list(_FindAllMatches(clang_regex, msg))):
- symbol = m.groupdict()['symbol']
- if symbol in _COMMON_GMOCK_SYMBOLS:
- yield ('NUS', 'Need to Use Symbol', diagnosis % m.groupdict())
-
-
-def _NeedToUseReturnNullDiagnoser(msg):
- """Diagnoses the NRNULL disease, given the error messages by the compiler."""
-
- gcc_regex = ('instantiated from \'testing::internal::ReturnAction<R>'
- '::operator testing::Action<Func>\(\) const.*\n' +
- _GCC_FILE_LINE_RE + r'instantiated from here\n'
- r'.*error: no matching function for call to \'ImplicitCast_\('
- r'(:?long )?int&\)')
- clang_regex = (r'\bgmock-actions.h:.* error: no matching function for '
- r'call to \'ImplicitCast_\'\r?\n'
- r'(.*\n)*?' +
- _CLANG_NON_GMOCK_FILE_LINE_RE + r'note: in instantiation '
- r'of function template specialization '
- r'\'testing::internal::ReturnAction<(int|long)>::operator '
- r'Action<(?P<type>.*)\(\)>\' requested here')
- diagnosis = """
-You are probably calling Return(NULL) and the compiler isn't sure how to turn
-NULL into %(type)s. Use ReturnNull() instead.
-Note: the line number may be off; please fix all instances of Return(NULL)."""
- return _GenericDiagnoser(
- 'NRNULL', 'Need to use ReturnNull',
- [(clang_regex, diagnosis),
- (gcc_regex, diagnosis % {'type': 'the right type'})],
- msg)
-
-
-def _TypeInTemplatedBaseDiagnoser(msg):
- """Diagnoses the TTB disease, given the error messages by the compiler."""
-
- # This version works when the type is used as the mock function's return
- # type.
- gcc_4_3_1_regex_type_in_retval = (
- r'In member function \'int .*\n' + _GCC_FILE_LINE_RE +
- r'error: a function call cannot appear in a constant-expression')
- gcc_4_4_0_regex_type_in_retval = (
- r'error: a function call cannot appear in a constant-expression'
- + _GCC_FILE_LINE_RE + r'error: template argument 1 is invalid\n')
- # This version works when the type is used as the mock function's sole
- # parameter type.
- gcc_regex_type_of_sole_param = (
- _GCC_FILE_LINE_RE +
- r'error: \'(?P<type>.+)\' was not declared in this scope\n'
- r'.*error: template argument 1 is invalid\n')
- # This version works when the type is used as a parameter of a mock
- # function that has multiple parameters.
- gcc_regex_type_of_a_param = (
- r'error: expected `;\' before \'::\' token\n'
- + _GCC_FILE_LINE_RE +
- r'error: \'(?P<type>.+)\' was not declared in this scope\n'
- r'.*error: template argument 1 is invalid\n'
- r'.*error: \'.+\' was not declared in this scope')
- clang_regex_type_of_retval_or_sole_param = (
- _CLANG_FILE_LINE_RE +
- r'error: use of undeclared identifier \'(?P<type>.*)\'\n'
- r'(.*\n)*?'
- r'(?P=file):(?P=line):\d+: error: '
- r'non-friend class member \'Result\' cannot have a qualified name'
- )
- clang_regex_type_of_a_param = (
- _CLANG_FILE_LINE_RE +
- r'error: C\+\+ requires a type specifier for all declarations\n'
- r'(.*\n)*?'
- r'(?P=file):(?P=line):(?P=column): error: '
- r'C\+\+ requires a type specifier for all declarations'
- )
- clang_regex_unknown_type = (
- _CLANG_FILE_LINE_RE +
- r'error: unknown type name \'(?P<type>[^\']+)\''
- )
-
- diagnosis = """
-In a mock class template, types or typedefs defined in the base class
-template are *not* automatically visible. This is how C++ works. Before
-you can use a type or typedef named %(type)s defined in base class Base<T>, you
-need to make it visible. One way to do it is:
-
- typedef typename Base<T>::%(type)s %(type)s;"""
-
- for diag in _GenericDiagnoser(
- 'TTB', 'Type in Template Base',
- [(gcc_4_3_1_regex_type_in_retval, diagnosis % {'type': 'Foo'}),
- (gcc_4_4_0_regex_type_in_retval, diagnosis % {'type': 'Foo'}),
- (gcc_regex_type_of_sole_param, diagnosis),
- (gcc_regex_type_of_a_param, diagnosis),
- (clang_regex_type_of_retval_or_sole_param, diagnosis),
- (clang_regex_type_of_a_param, diagnosis % {'type': 'Foo'})],
- msg):
- yield diag
- # Avoid overlap with the NUS pattern.
- for m in _FindAllMatches(clang_regex_unknown_type, msg):
- type_ = m.groupdict()['type']
- if type_ not in _COMMON_GMOCK_SYMBOLS:
- yield ('TTB', 'Type in Template Base', diagnosis % m.groupdict())
-
-
-def _WrongMockMethodMacroDiagnoser(msg):
- """Diagnoses the WMM disease, given the error messages by the compiler."""
-
- gcc_regex = (_GCC_FILE_LINE_RE +
- r'.*this_method_does_not_take_(?P<wrong_args>\d+)_argument.*\n'
- r'.*\n'
- r'.*candidates are.*FunctionMocker<[^>]+A(?P<args>\d+)\)>')
- clang_regex = (_CLANG_NON_GMOCK_FILE_LINE_RE +
- r'error:.*array.*negative.*r?\n'
- r'(.*\n)*?'
- r'(?P=file):(?P=line):(?P=column): error: too few arguments '
- r'to function call, expected (?P<args>\d+), '
- r'have (?P<wrong_args>\d+)')
- diagnosis = """
-You are using MOCK_METHOD%(wrong_args)s to define a mock method that has
-%(args)s arguments. Use MOCK_METHOD%(args)s (or MOCK_CONST_METHOD%(args)s,
-MOCK_METHOD%(args)s_T, MOCK_CONST_METHOD%(args)s_T as appropriate) instead."""
- return _GenericDiagnoser('WMM', 'Wrong MOCK_METHODn Macro',
- [(gcc_regex, diagnosis),
- (clang_regex, diagnosis)],
- msg)
-
-
-def _WrongParenPositionDiagnoser(msg):
- """Diagnoses the WPP disease, given the error messages by the compiler."""
-
- gcc_regex = (_GCC_FILE_LINE_RE +
- r'error:.*testing::internal::MockSpec<.* has no member named \''
- r'(?P<method>\w+)\'')
- clang_regex = (_CLANG_NON_GMOCK_FILE_LINE_RE +
- r'error: no member named \'(?P<method>\w+)\' in '
- r'\'testing::internal::MockSpec<.*>\'')
- diagnosis = """
-The closing parenthesis of ON_CALL or EXPECT_CALL should be *before*
-".%(method)s". For example, you should write:
- EXPECT_CALL(my_mock, Foo(_)).%(method)s(...);
-instead of:
- EXPECT_CALL(my_mock, Foo(_).%(method)s(...));"""
- return _GenericDiagnoser('WPP', 'Wrong Parenthesis Position',
- [(gcc_regex, diagnosis),
- (clang_regex, diagnosis)],
- msg)
-
-
-_DIAGNOSERS = [
- _IncompleteByReferenceArgumentDiagnoser,
- _MockObjectPointerDiagnoser,
- _NeedToReturnNothingDiagnoser,
- _NeedToReturnReferenceDiagnoser,
- _NeedToReturnSomethingDiagnoser,
- _NeedToUseReturnNullDiagnoser,
- _NeedToUseSymbolDiagnoser,
- _OverloadedFunctionActionDiagnoser,
- _OverloadedFunctionMatcherDiagnoser,
- _OverloadedMethodActionDiagnoser,
- _TypeInTemplatedBaseDiagnoser,
- _WrongMockMethodMacroDiagnoser,
- _WrongParenPositionDiagnoser,
- ]
-
-
-def Diagnose(msg):
- """Generates all possible diagnoses given the compiler error message."""
-
- msg = re.sub(r'\x1b\[[^m]*m', '', msg) # Strips all color formatting.
- # Assuming the string is using the UTF-8 encoding, replaces the left and
- # the right single quote characters with apostrophes.
- msg = re.sub(r'(\xe2\x80\x98|\xe2\x80\x99)', "'", msg)
-
- diagnoses = []
- for diagnoser in _DIAGNOSERS:
- for diag in diagnoser(msg):
- diagnosis = '[%s - %s]\n%s' % diag
- if not diagnosis in diagnoses:
- diagnoses.append(diagnosis)
- return diagnoses
-
-
-def main():
- print ('Google Mock Doctor v%s - '
- 'diagnoses problems in code using Google Mock.' % _VERSION)
-
- if sys.stdin.isatty():
- print ('Please copy and paste the compiler errors here. Press c-D when '
- 'you are done:')
- else:
- print 'Waiting for compiler errors on stdin . . .'
-
- msg = sys.stdin.read().strip()
- diagnoses = Diagnose(msg)
- count = len(diagnoses)
- if not count:
- print ("""
-Your compiler complained:
-8<------------------------------------------------------------
-%s
------------------------------------------------------------->8
-
-Uh-oh, I'm not smart enough to figure out what the problem is. :-(
-However...
-If you send your source code and the compiler's error messages to
-%s, you can be helped and I can get smarter --
-win-win for us!""" % (msg, _EMAIL))
- else:
- print '------------------------------------------------------------'
- print 'Your code appears to have the following',
- if count > 1:
- print '%s diseases:' % (count,)
- else:
- print 'disease:'
- i = 0
- for d in diagnoses:
- i += 1
- if count > 1:
- print '\n#%s:' % (i,)
- print d
- print ("""
-How did I do? If you think I'm wrong or unhelpful, please send your
-source code and the compiler's error messages to %s.
-Then you can be helped and I can get smarter -- I promise I won't be upset!""" %
- _EMAIL)
-
-
-if __name__ == '__main__':
- main()
diff --git a/src/testing/scripts/upload.py b/src/testing/scripts/upload.py
deleted file mode 100755
index 6e6f9a14..00000000
--- a/src/testing/scripts/upload.py
+++ /dev/null
@@ -1,1387 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2007 Google Inc.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-"""Tool for uploading diffs from a version control system to the codereview app.
-
-Usage summary: upload.py [options] [-- diff_options]
-
-Diff options are passed to the diff command of the underlying system.
-
-Supported version control systems:
- Git
- Mercurial
- Subversion
-
-It is important for Git/Mercurial users to specify a tree/node/branch to diff
-against by using the '--rev' option.
-"""
-# This code is derived from appcfg.py in the App Engine SDK (open source),
-# and from ASPN recipe #146306.
-
-import cookielib
-import getpass
-import logging
-import md5
-import mimetypes
-import optparse
-import os
-import re
-import socket
-import subprocess
-import sys
-import urllib
-import urllib2
-import urlparse
-
-try:
- import readline
-except ImportError:
- pass
-
-# The logging verbosity:
-# 0: Errors only.
-# 1: Status messages.
-# 2: Info logs.
-# 3: Debug logs.
-verbosity = 1
-
-# Max size of patch or base file.
-MAX_UPLOAD_SIZE = 900 * 1024
-
-
-def GetEmail(prompt):
- """Prompts the user for their email address and returns it.
-
- The last used email address is saved to a file and offered up as a suggestion
- to the user. If the user presses enter without typing in anything the last
- used email address is used. If the user enters a new address, it is saved
- for next time we prompt.
-
- """
- last_email_file_name = os.path.expanduser("~/.last_codereview_email_address")
- last_email = ""
- if os.path.exists(last_email_file_name):
- try:
- last_email_file = open(last_email_file_name, "r")
- last_email = last_email_file.readline().strip("\n")
- last_email_file.close()
- prompt += " [%s]" % last_email
- except IOError, e:
- pass
- email = raw_input(prompt + ": ").strip()
- if email:
- try:
- last_email_file = open(last_email_file_name, "w")
- last_email_file.write(email)
- last_email_file.close()
- except IOError, e:
- pass
- else:
- email = last_email
- return email
-
-
-def StatusUpdate(msg):
- """Print a status message to stdout.
-
- If 'verbosity' is greater than 0, print the message.
-
- Args:
- msg: The string to print.
- """
- if verbosity > 0:
- print msg
-
-
-def ErrorExit(msg):
- """Print an error message to stderr and exit."""
- print >>sys.stderr, msg
- sys.exit(1)
-
-
-class ClientLoginError(urllib2.HTTPError):
- """Raised to indicate there was an error authenticating with ClientLogin."""
-
- def __init__(self, url, code, msg, headers, args):
- urllib2.HTTPError.__init__(self, url, code, msg, headers, None)
- self.args = args
- self.reason = args["Error"]
-
-
-class AbstractRpcServer(object):
- """Provides a common interface for a simple RPC server."""
-
- def __init__(self, host, auth_function, host_override=None, extra_headers={},
- save_cookies=False):
- """Creates a new HttpRpcServer.
-
- Args:
- host: The host to send requests to.
- auth_function: A function that takes no arguments and returns an
- (email, password) tuple when called. Will be called if authentication
- is required.
- host_override: The host header to send to the server (defaults to host).
- extra_headers: A dict of extra headers to append to every request.
- save_cookies: If True, save the authentication cookies to local disk.
- If False, use an in-memory cookiejar instead. Subclasses must
- implement this functionality. Defaults to False.
- """
- self.host = host
- self.host_override = host_override
- self.auth_function = auth_function
- self.authenticated = False
- self.extra_headers = extra_headers
- self.save_cookies = save_cookies
- self.opener = self._GetOpener()
- if self.host_override:
- logging.info("Server: %s; Host: %s", self.host, self.host_override)
- else:
- logging.info("Server: %s", self.host)
-
- def _GetOpener(self):
- """Returns an OpenerDirector for making HTTP requests.
-
- Returns:
- A urllib2.OpenerDirector object.
- """
- raise NotImplementedError()
-
- def _CreateRequest(self, url, data=None):
- """Creates a new urllib request."""
- logging.debug("Creating request for: '%s' with payload:\n%s", url, data)
- req = urllib2.Request(url, data=data)
- if self.host_override:
- req.add_header("Host", self.host_override)
- for key, value in self.extra_headers.iteritems():
- req.add_header(key, value)
- return req
-
- def _GetAuthToken(self, email, password):
- """Uses ClientLogin to authenticate the user, returning an auth token.
-
- Args:
- email: The user's email address
- password: The user's password
-
- Raises:
- ClientLoginError: If there was an error authenticating with ClientLogin.
- HTTPError: If there was some other form of HTTP error.
-
- Returns:
- The authentication token returned by ClientLogin.
- """
- account_type = "GOOGLE"
- if self.host.endswith(".google.com"):
- # Needed for use inside Google.
- account_type = "HOSTED"
- req = self._CreateRequest(
- url="https://www.google.com/accounts/ClientLogin",
- data=urllib.urlencode({
- "Email": email,
- "Passwd": password,
- "service": "ah",
- "source": "rietveld-codereview-upload",
- "accountType": account_type,
- }),
- )
- try:
- response = self.opener.open(req)
- response_body = response.read()
- response_dict = dict(x.split("=")
- for x in response_body.split("\n") if x)
- return response_dict["Auth"]
- except urllib2.HTTPError, e:
- if e.code == 403:
- body = e.read()
- response_dict = dict(x.split("=", 1) for x in body.split("\n") if x)
- raise ClientLoginError(req.get_full_url(), e.code, e.msg,
- e.headers, response_dict)
- else:
- raise
-
- def _GetAuthCookie(self, auth_token):
- """Fetches authentication cookies for an authentication token.
-
- Args:
- auth_token: The authentication token returned by ClientLogin.
-
- Raises:
- HTTPError: If there was an error fetching the authentication cookies.
- """
- # This is a dummy value to allow us to identify when we're successful.
- continue_location = "http://localhost/"
- args = {"continue": continue_location, "auth": auth_token}
- req = self._CreateRequest("http://%s/_ah/login?%s" %
- (self.host, urllib.urlencode(args)))
- try:
- response = self.opener.open(req)
- except urllib2.HTTPError, e:
- response = e
- if (response.code != 302 or
- response.info()["location"] != continue_location):
- raise urllib2.HTTPError(req.get_full_url(), response.code, response.msg,
- response.headers, response.fp)
- self.authenticated = True
-
- def _Authenticate(self):
- """Authenticates the user.
-
- The authentication process works as follows:
- 1) We get a username and password from the user
- 2) We use ClientLogin to obtain an AUTH token for the user
- (see http://code.google.com/apis/accounts/AuthForInstalledApps.html).
- 3) We pass the auth token to /_ah/login on the server to obtain an
- authentication cookie. If login was successful, it tries to redirect
- us to the URL we provided.
-
- If we attempt to access the upload API without first obtaining an
- authentication cookie, it returns a 401 response and directs us to
- authenticate ourselves with ClientLogin.
- """
- for i in range(3):
- credentials = self.auth_function()
- try:
- auth_token = self._GetAuthToken(credentials[0], credentials[1])
- except ClientLoginError, e:
- if e.reason == "BadAuthentication":
- print >>sys.stderr, "Invalid username or password."
- continue
- if e.reason == "CaptchaRequired":
- print >>sys.stderr, (
- "Please go to\n"
- "https://www.google.com/accounts/DisplayUnlockCaptcha\n"
- "and verify you are a human. Then try again.")
- break
- if e.reason == "NotVerified":
- print >>sys.stderr, "Account not verified."
- break
- if e.reason == "TermsNotAgreed":
- print >>sys.stderr, "User has not agreed to TOS."
- break
- if e.reason == "AccountDeleted":
- print >>sys.stderr, "The user account has been deleted."
- break
- if e.reason == "AccountDisabled":
- print >>sys.stderr, "The user account has been disabled."
- break
- if e.reason == "ServiceDisabled":
- print >>sys.stderr, ("The user's access to the service has been "
- "disabled.")
- break
- if e.reason == "ServiceUnavailable":
- print >>sys.stderr, "The service is not available; try again later."
- break
- raise
- self._GetAuthCookie(auth_token)
- return
-
- def Send(self, request_path, payload=None,
- content_type="application/octet-stream",
- timeout=None,
- **kwargs):
- """Sends an RPC and returns the response.
-
- Args:
- request_path: The path to send the request to, eg /api/appversion/create.
- payload: The body of the request, or None to send an empty request.
- content_type: The Content-Type header to use.
- timeout: timeout in seconds; default None i.e. no timeout.
- (Note: for large requests on OS X, the timeout doesn't work right.)
- kwargs: Any keyword arguments are converted into query string parameters.
-
- Returns:
- The response body, as a string.
- """
- # TODO: Don't require authentication. Let the server say
- # whether it is necessary.
- if not self.authenticated:
- self._Authenticate()
-
- old_timeout = socket.getdefaulttimeout()
- socket.setdefaulttimeout(timeout)
- try:
- tries = 0
- while True:
- tries += 1
- args = dict(kwargs)
- url = "http://%s%s" % (self.host, request_path)
- if args:
- url += "?" + urllib.urlencode(args)
- req = self._CreateRequest(url=url, data=payload)
- req.add_header("Content-Type", content_type)
- try:
- f = self.opener.open(req)
- response = f.read()
- f.close()
- return response
- except urllib2.HTTPError, e:
- if tries > 3:
- raise
- elif e.code == 401:
- self._Authenticate()
-## elif e.code >= 500 and e.code < 600:
-## # Server Error - try again.
-## continue
- else:
- raise
- finally:
- socket.setdefaulttimeout(old_timeout)
-
-
-class HttpRpcServer(AbstractRpcServer):
- """Provides a simplified RPC-style interface for HTTP requests."""
-
- def _Authenticate(self):
- """Save the cookie jar after authentication."""
- super(HttpRpcServer, self)._Authenticate()
- if self.save_cookies:
- StatusUpdate("Saving authentication cookies to %s" % self.cookie_file)
- self.cookie_jar.save()
-
- def _GetOpener(self):
- """Returns an OpenerDirector that supports cookies and ignores redirects.
-
- Returns:
- A urllib2.OpenerDirector object.
- """
- opener = urllib2.OpenerDirector()
- opener.add_handler(urllib2.ProxyHandler())
- opener.add_handler(urllib2.UnknownHandler())
- opener.add_handler(urllib2.HTTPHandler())
- opener.add_handler(urllib2.HTTPDefaultErrorHandler())
- opener.add_handler(urllib2.HTTPSHandler())
- opener.add_handler(urllib2.HTTPErrorProcessor())
- if self.save_cookies:
- self.cookie_file = os.path.expanduser("~/.codereview_upload_cookies")
- self.cookie_jar = cookielib.MozillaCookieJar(self.cookie_file)
- if os.path.exists(self.cookie_file):
- try:
- self.cookie_jar.load()
- self.authenticated = True
- StatusUpdate("Loaded authentication cookies from %s" %
- self.cookie_file)
- except (cookielib.LoadError, IOError):
- # Failed to load cookies - just ignore them.
- pass
- else:
- # Create an empty cookie file with mode 600
- fd = os.open(self.cookie_file, os.O_CREAT, 0600)
- os.close(fd)
- # Always chmod the cookie file
- os.chmod(self.cookie_file, 0600)
- else:
- # Don't save cookies across runs of update.py.
- self.cookie_jar = cookielib.CookieJar()
- opener.add_handler(urllib2.HTTPCookieProcessor(self.cookie_jar))
- return opener
-
-
-parser = optparse.OptionParser(usage="%prog [options] [-- diff_options]")
-parser.add_option("-y", "--assume_yes", action="store_true",
- dest="assume_yes", default=False,
- help="Assume that the answer to yes/no questions is 'yes'.")
-# Logging
-group = parser.add_option_group("Logging options")
-group.add_option("-q", "--quiet", action="store_const", const=0,
- dest="verbose", help="Print errors only.")
-group.add_option("-v", "--verbose", action="store_const", const=2,
- dest="verbose", default=1,
- help="Print info level logs (default).")
-group.add_option("--noisy", action="store_const", const=3,
- dest="verbose", help="Print all logs.")
-# Review server
-group = parser.add_option_group("Review server options")
-group.add_option("-s", "--server", action="store", dest="server",
- default="codereview.appspot.com",
- metavar="SERVER",
- help=("The server to upload to. The format is host[:port]. "
- "Defaults to 'codereview.appspot.com'."))
-group.add_option("-e", "--email", action="store", dest="email",
- metavar="EMAIL", default=None,
- help="The username to use. Will prompt if omitted.")
-group.add_option("-H", "--host", action="store", dest="host",
- metavar="HOST", default=None,
- help="Overrides the Host header sent with all RPCs.")
-group.add_option("--no_cookies", action="store_false",
- dest="save_cookies", default=True,
- help="Do not save authentication cookies to local disk.")
-# Issue
-group = parser.add_option_group("Issue options")
-group.add_option("-d", "--description", action="store", dest="description",
- metavar="DESCRIPTION", default=None,
- help="Optional description when creating an issue.")
-group.add_option("-f", "--description_file", action="store",
- dest="description_file", metavar="DESCRIPTION_FILE",
- default=None,
- help="Optional path of a file that contains "
- "the description when creating an issue.")
-group.add_option("-r", "--reviewers", action="store", dest="reviewers",
- metavar="REVIEWERS", default=None,
- help="Add reviewers (comma separated email addresses).")
-group.add_option("--cc", action="store", dest="cc",
- metavar="CC", default=None,
- help="Add CC (comma separated email addresses).")
-# Upload options
-group = parser.add_option_group("Patch options")
-group.add_option("-m", "--message", action="store", dest="message",
- metavar="MESSAGE", default=None,
- help="A message to identify the patch. "
- "Will prompt if omitted.")
-group.add_option("-i", "--issue", type="int", action="store",
- metavar="ISSUE", default=None,
- help="Issue number to which to add. Defaults to new issue.")
-group.add_option("--download_base", action="store_true",
- dest="download_base", default=False,
- help="Base files will be downloaded by the server "
- "(side-by-side diffs may not work on files with CRs).")
-group.add_option("--rev", action="store", dest="revision",
- metavar="REV", default=None,
- help="Branch/tree/revision to diff against (used by DVCS).")
-group.add_option("--send_mail", action="store_true",
- dest="send_mail", default=False,
- help="Send notification email to reviewers.")
-
-
-def GetRpcServer(options):
- """Returns an instance of an AbstractRpcServer.
-
- Returns:
- A new AbstractRpcServer, on which RPC calls can be made.
- """
-
- rpc_server_class = HttpRpcServer
-
- def GetUserCredentials():
- """Prompts the user for a username and password."""
- email = options.email
- if email is None:
- email = GetEmail("Email (login for uploading to %s)" % options.server)
- password = getpass.getpass("Password for %s: " % email)
- return (email, password)
-
- # If this is the dev_appserver, use fake authentication.
- host = (options.host or options.server).lower()
- if host == "localhost" or host.startswith("localhost:"):
- email = options.email
- if email is None:
- email = "test@example.com"
- logging.info("Using debug user %s. Override with --email" % email)
- server = rpc_server_class(
- options.server,
- lambda: (email, "password"),
- host_override=options.host,
- extra_headers={"Cookie":
- 'dev_appserver_login="%s:False"' % email},
- save_cookies=options.save_cookies)
- # Don't try to talk to ClientLogin.
- server.authenticated = True
- return server
-
- return rpc_server_class(options.server, GetUserCredentials,
- host_override=options.host,
- save_cookies=options.save_cookies)
-
-
-def EncodeMultipartFormData(fields, files):
- """Encode form fields for multipart/form-data.
-
- Args:
- fields: A sequence of (name, value) elements for regular form fields.
- files: A sequence of (name, filename, value) elements for data to be
- uploaded as files.
- Returns:
- (content_type, body) ready for httplib.HTTP instance.
-
- Source:
- http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/146306
- """
- BOUNDARY = '-M-A-G-I-C---B-O-U-N-D-A-R-Y-'
- CRLF = '\r\n'
- lines = []
- for (key, value) in fields:
- lines.append('--' + BOUNDARY)
- lines.append('Content-Disposition: form-data; name="%s"' % key)
- lines.append('')
- lines.append(value)
- for (key, filename, value) in files:
- lines.append('--' + BOUNDARY)
- lines.append('Content-Disposition: form-data; name="%s"; filename="%s"' %
- (key, filename))
- lines.append('Content-Type: %s' % GetContentType(filename))
- lines.append('')
- lines.append(value)
- lines.append('--' + BOUNDARY + '--')
- lines.append('')
- body = CRLF.join(lines)
- content_type = 'multipart/form-data; boundary=%s' % BOUNDARY
- return content_type, body
-
-
-def GetContentType(filename):
- """Helper to guess the content-type from the filename."""
- return mimetypes.guess_type(filename)[0] or 'application/octet-stream'
-
-
-# Use a shell for subcommands on Windows to get a PATH search.
-use_shell = sys.platform.startswith("win")
-
-def RunShellWithReturnCode(command, print_output=False,
- universal_newlines=True):
- """Executes a command and returns the output from stdout and the return code.
-
- Args:
- command: Command to execute.
- print_output: If True, the output is printed to stdout.
- If False, both stdout and stderr are ignored.
- universal_newlines: Use universal_newlines flag (default: True).
-
- Returns:
- Tuple (output, return code)
- """
- logging.info("Running %s", command)
- p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
- shell=use_shell, universal_newlines=universal_newlines)
- if print_output:
- output_array = []
- while True:
- line = p.stdout.readline()
- if not line:
- break
- print line.strip("\n")
- output_array.append(line)
- output = "".join(output_array)
- else:
- output = p.stdout.read()
- p.wait()
- errout = p.stderr.read()
- if print_output and errout:
- print >>sys.stderr, errout
- p.stdout.close()
- p.stderr.close()
- return output, p.returncode
-
-
-def RunShell(command, silent_ok=False, universal_newlines=True,
- print_output=False):
- data, retcode = RunShellWithReturnCode(command, print_output,
- universal_newlines)
- if retcode:
- ErrorExit("Got error status from %s:\n%s" % (command, data))
- if not silent_ok and not data:
- ErrorExit("No output from %s" % command)
- return data
-
-
-class VersionControlSystem(object):
- """Abstract base class providing an interface to the VCS."""
-
- def __init__(self, options):
- """Constructor.
-
- Args:
- options: Command line options.
- """
- self.options = options
-
- def GenerateDiff(self, args):
- """Return the current diff as a string.
-
- Args:
- args: Extra arguments to pass to the diff command.
- """
- raise NotImplementedError(
- "abstract method -- subclass %s must override" % self.__class__)
-
- def GetUnknownFiles(self):
- """Return a list of files unknown to the VCS."""
- raise NotImplementedError(
- "abstract method -- subclass %s must override" % self.__class__)
-
- def CheckForUnknownFiles(self):
- """Show an "are you sure?" prompt if there are unknown files."""
- unknown_files = self.GetUnknownFiles()
- if unknown_files:
- print "The following files are not added to version control:"
- for line in unknown_files:
- print line
- prompt = "Are you sure to continue?(y/N) "
- answer = raw_input(prompt).strip()
- if answer != "y":
- ErrorExit("User aborted")
-
- def GetBaseFile(self, filename):
- """Get the content of the upstream version of a file.
-
- Returns:
- A tuple (base_content, new_content, is_binary, status)
- base_content: The contents of the base file.
- new_content: For text files, this is empty. For binary files, this is
- the contents of the new file, since the diff output won't contain
- information to reconstruct the current file.
- is_binary: True iff the file is binary.
- status: The status of the file.
- """
-
- raise NotImplementedError(
- "abstract method -- subclass %s must override" % self.__class__)
-
-
- def GetBaseFiles(self, diff):
- """Helper that calls GetBase file for each file in the patch.
-
- Returns:
- A dictionary that maps from filename to GetBaseFile's tuple. Filenames
- are retrieved based on lines that start with "Index:" or
- "Property changes on:".
- """
- files = {}
- for line in diff.splitlines(True):
- if line.startswith('Index:') or line.startswith('Property changes on:'):
- unused, filename = line.split(':', 1)
- # On Windows if a file has property changes its filename uses '\'
- # instead of '/'.
- filename = filename.strip().replace('\\', '/')
- files[filename] = self.GetBaseFile(filename)
- return files
-
-
- def UploadBaseFiles(self, issue, rpc_server, patch_list, patchset, options,
- files):
- """Uploads the base files (and if necessary, the current ones as well)."""
-
- def UploadFile(filename, file_id, content, is_binary, status, is_base):
- """Uploads a file to the server."""
- file_too_large = False
- if is_base:
- type = "base"
- else:
- type = "current"
- if len(content) > MAX_UPLOAD_SIZE:
- print ("Not uploading the %s file for %s because it's too large." %
- (type, filename))
- file_too_large = True
- content = ""
- checksum = md5.new(content).hexdigest()
- if options.verbose > 0 and not file_too_large:
- print "Uploading %s file for %s" % (type, filename)
- url = "/%d/upload_content/%d/%d" % (int(issue), int(patchset), file_id)
- form_fields = [("filename", filename),
- ("status", status),
- ("checksum", checksum),
- ("is_binary", str(is_binary)),
- ("is_current", str(not is_base)),
- ]
- if file_too_large:
- form_fields.append(("file_too_large", "1"))
- if options.email:
- form_fields.append(("user", options.email))
- ctype, body = EncodeMultipartFormData(form_fields,
- [("data", filename, content)])
- response_body = rpc_server.Send(url, body,
- content_type=ctype)
- if not response_body.startswith("OK"):
- StatusUpdate(" --> %s" % response_body)
- sys.exit(1)
-
- patches = dict()
- [patches.setdefault(v, k) for k, v in patch_list]
- for filename in patches.keys():
- base_content, new_content, is_binary, status = files[filename]
- file_id_str = patches.get(filename)
- if file_id_str.find("nobase") != -1:
- base_content = None
- file_id_str = file_id_str[file_id_str.rfind("_") + 1:]
- file_id = int(file_id_str)
- if base_content != None:
- UploadFile(filename, file_id, base_content, is_binary, status, True)
- if new_content != None:
- UploadFile(filename, file_id, new_content, is_binary, status, False)
-
- def IsImage(self, filename):
- """Returns true if the filename has an image extension."""
- mimetype = mimetypes.guess_type(filename)[0]
- if not mimetype:
- return False
- return mimetype.startswith("image/")
-
-
-class SubversionVCS(VersionControlSystem):
- """Implementation of the VersionControlSystem interface for Subversion."""
-
- def __init__(self, options):
- super(SubversionVCS, self).__init__(options)
- if self.options.revision:
- match = re.match(r"(\d+)(:(\d+))?", self.options.revision)
- if not match:
- ErrorExit("Invalid Subversion revision %s." % self.options.revision)
- self.rev_start = match.group(1)
- self.rev_end = match.group(3)
- else:
- self.rev_start = self.rev_end = None
- # Cache output from "svn list -r REVNO dirname".
- # Keys: dirname, Values: 2-tuple (ouput for start rev and end rev).
- self.svnls_cache = {}
- # SVN base URL is required to fetch files deleted in an older revision.
- # Result is cached to not guess it over and over again in GetBaseFile().
- required = self.options.download_base or self.options.revision is not None
- self.svn_base = self._GuessBase(required)
-
- def GuessBase(self, required):
- """Wrapper for _GuessBase."""
- return self.svn_base
-
- def _GuessBase(self, required):
- """Returns the SVN base URL.
-
- Args:
- required: If true, exits if the url can't be guessed, otherwise None is
- returned.
- """
- info = RunShell(["svn", "info"])
- for line in info.splitlines():
- words = line.split()
- if len(words) == 2 and words[0] == "URL:":
- url = words[1]
- scheme, netloc, path, params, query, fragment = urlparse.urlparse(url)
- username, netloc = urllib.splituser(netloc)
- if username:
- logging.info("Removed username from base URL")
- if netloc.endswith("svn.python.org"):
- if netloc == "svn.python.org":
- if path.startswith("/projects/"):
- path = path[9:]
- elif netloc != "pythondev@svn.python.org":
- ErrorExit("Unrecognized Python URL: %s" % url)
- base = "http://svn.python.org/view/*checkout*%s/" % path
- logging.info("Guessed Python base = %s", base)
- elif netloc.endswith("svn.collab.net"):
- if path.startswith("/repos/"):
- path = path[6:]
- base = "http://svn.collab.net/viewvc/*checkout*%s/" % path
- logging.info("Guessed CollabNet base = %s", base)
- elif netloc.endswith(".googlecode.com"):
- path = path + "/"
- base = urlparse.urlunparse(("http", netloc, path, params,
- query, fragment))
- logging.info("Guessed Google Code base = %s", base)
- else:
- path = path + "/"
- base = urlparse.urlunparse((scheme, netloc, path, params,
- query, fragment))
- logging.info("Guessed base = %s", base)
- return base
- if required:
- ErrorExit("Can't find URL in output from svn info")
- return None
-
- def GenerateDiff(self, args):
- cmd = ["svn", "diff"]
- if self.options.revision:
- cmd += ["-r", self.options.revision]
- cmd.extend(args)
- data = RunShell(cmd)
- count = 0
- for line in data.splitlines():
- if line.startswith("Index:") or line.startswith("Property changes on:"):
- count += 1
- logging.info(line)
- if not count:
- ErrorExit("No valid patches found in output from svn diff")
- return data
-
- def _CollapseKeywords(self, content, keyword_str):
- """Collapses SVN keywords."""
- # svn cat translates keywords but svn diff doesn't. As a result of this
- # behavior patching.PatchChunks() fails with a chunk mismatch error.
- # This part was originally written by the Review Board development team
- # who had the same problem (http://reviews.review-board.org/r/276/).
- # Mapping of keywords to known aliases
- svn_keywords = {
- # Standard keywords
- 'Date': ['Date', 'LastChangedDate'],
- 'Revision': ['Revision', 'LastChangedRevision', 'Rev'],
- 'Author': ['Author', 'LastChangedBy'],
- 'HeadURL': ['HeadURL', 'URL'],
- 'Id': ['Id'],
-
- # Aliases
- 'LastChangedDate': ['LastChangedDate', 'Date'],
- 'LastChangedRevision': ['LastChangedRevision', 'Rev', 'Revision'],
- 'LastChangedBy': ['LastChangedBy', 'Author'],
- 'URL': ['URL', 'HeadURL'],
- }
-
- def repl(m):
- if m.group(2):
- return "$%s::%s$" % (m.group(1), " " * len(m.group(3)))
- return "$%s$" % m.group(1)
- keywords = [keyword
- for name in keyword_str.split(" ")
- for keyword in svn_keywords.get(name, [])]
- return re.sub(r"\$(%s):(:?)([^\$]+)\$" % '|'.join(keywords), repl, content)
-
- def GetUnknownFiles(self):
- status = RunShell(["svn", "status", "--ignore-externals"], silent_ok=True)
- unknown_files = []
- for line in status.split("\n"):
- if line and line[0] == "?":
- unknown_files.append(line)
- return unknown_files
-
- def ReadFile(self, filename):
- """Returns the contents of a file."""
- file = open(filename, 'rb')
- result = ""
- try:
- result = file.read()
- finally:
- file.close()
- return result
-
- def GetStatus(self, filename):
- """Returns the status of a file."""
- if not self.options.revision:
- status = RunShell(["svn", "status", "--ignore-externals", filename])
- if not status:
- ErrorExit("svn status returned no output for %s" % filename)
- status_lines = status.splitlines()
- # If file is in a cl, the output will begin with
- # "\n--- Changelist 'cl_name':\n". See
- # http://svn.collab.net/repos/svn/trunk/notes/changelist-design.txt
- if (len(status_lines) == 3 and
- not status_lines[0] and
- status_lines[1].startswith("--- Changelist")):
- status = status_lines[2]
- else:
- status = status_lines[0]
- # If we have a revision to diff against we need to run "svn list"
- # for the old and the new revision and compare the results to get
- # the correct status for a file.
- else:
- dirname, relfilename = os.path.split(filename)
- if dirname not in self.svnls_cache:
- cmd = ["svn", "list", "-r", self.rev_start, dirname or "."]
- out, returncode = RunShellWithReturnCode(cmd)
- if returncode:
- ErrorExit("Failed to get status for %s." % filename)
- old_files = out.splitlines()
- args = ["svn", "list"]
- if self.rev_end:
- args += ["-r", self.rev_end]
- cmd = args + [dirname or "."]
- out, returncode = RunShellWithReturnCode(cmd)
- if returncode:
- ErrorExit("Failed to run command %s" % cmd)
- self.svnls_cache[dirname] = (old_files, out.splitlines())
- old_files, new_files = self.svnls_cache[dirname]
- if relfilename in old_files and relfilename not in new_files:
- status = "D "
- elif relfilename in old_files and relfilename in new_files:
- status = "M "
- else:
- status = "A "
- return status
-
- def GetBaseFile(self, filename):
- status = self.GetStatus(filename)
- base_content = None
- new_content = None
-
- # If a file is copied its status will be "A +", which signifies
- # "addition-with-history". See "svn st" for more information. We need to
- # upload the original file or else diff parsing will fail if the file was
- # edited.
- if status[0] == "A" and status[3] != "+":
- # We'll need to upload the new content if we're adding a binary file
- # since diff's output won't contain it.
- mimetype = RunShell(["svn", "propget", "svn:mime-type", filename],
- silent_ok=True)
- base_content = ""
- is_binary = mimetype and not mimetype.startswith("text/")
- if is_binary and self.IsImage(filename):
- new_content = self.ReadFile(filename)
- elif (status[0] in ("M", "D", "R") or
- (status[0] == "A" and status[3] == "+") or # Copied file.
- (status[0] == " " and status[1] == "M")): # Property change.
- args = []
- if self.options.revision:
- url = "%s/%s@%s" % (self.svn_base, filename, self.rev_start)
- else:
- # Don't change filename, it's needed later.
- url = filename
- args += ["-r", "BASE"]
- cmd = ["svn"] + args + ["propget", "svn:mime-type", url]
- mimetype, returncode = RunShellWithReturnCode(cmd)
- if returncode:
- # File does not exist in the requested revision.
- # Reset mimetype, it contains an error message.
- mimetype = ""
- get_base = False
- is_binary = mimetype and not mimetype.startswith("text/")
- if status[0] == " ":
- # Empty base content just to force an upload.
- base_content = ""
- elif is_binary:
- if self.IsImage(filename):
- get_base = True
- if status[0] == "M":
- if not self.rev_end:
- new_content = self.ReadFile(filename)
- else:
- url = "%s/%s@%s" % (self.svn_base, filename, self.rev_end)
- new_content = RunShell(["svn", "cat", url],
- universal_newlines=True, silent_ok=True)
- else:
- base_content = ""
- else:
- get_base = True
-
- if get_base:
- if is_binary:
- universal_newlines = False
- else:
- universal_newlines = True
- if self.rev_start:
- # "svn cat -r REV delete_file.txt" doesn't work. cat requires
- # the full URL with "@REV" appended instead of using "-r" option.
- url = "%s/%s@%s" % (self.svn_base, filename, self.rev_start)
- base_content = RunShell(["svn", "cat", url],
- universal_newlines=universal_newlines,
- silent_ok=True)
- else:
- base_content = RunShell(["svn", "cat", filename],
- universal_newlines=universal_newlines,
- silent_ok=True)
- if not is_binary:
- args = []
- if self.rev_start:
- url = "%s/%s@%s" % (self.svn_base, filename, self.rev_start)
- else:
- url = filename
- args += ["-r", "BASE"]
- cmd = ["svn"] + args + ["propget", "svn:keywords", url]
- keywords, returncode = RunShellWithReturnCode(cmd)
- if keywords and not returncode:
- base_content = self._CollapseKeywords(base_content, keywords)
- else:
- StatusUpdate("svn status returned unexpected output: %s" % status)
- sys.exit(1)
- return base_content, new_content, is_binary, status[0:5]
-
-
-class GitVCS(VersionControlSystem):
- """Implementation of the VersionControlSystem interface for Git."""
-
- def __init__(self, options):
- super(GitVCS, self).__init__(options)
- # Map of filename -> hash of base file.
- self.base_hashes = {}
-
- def GenerateDiff(self, extra_args):
- # This is more complicated than svn's GenerateDiff because we must convert
- # the diff output to include an svn-style "Index:" line as well as record
- # the hashes of the base files, so we can upload them along with our diff.
- if self.options.revision:
- extra_args = [self.options.revision] + extra_args
- gitdiff = RunShell(["git", "diff", "--full-index"] + extra_args)
- svndiff = []
- filecount = 0
- filename = None
- for line in gitdiff.splitlines():
- match = re.match(r"diff --git a/(.*) b/.*$", line)
- if match:
- filecount += 1
- filename = match.group(1)
- svndiff.append("Index: %s\n" % filename)
- else:
- # The "index" line in a git diff looks like this (long hashes elided):
- # index 82c0d44..b2cee3f 100755
- # We want to save the left hash, as that identifies the base file.
- match = re.match(r"index (\w+)\.\.", line)
- if match:
- self.base_hashes[filename] = match.group(1)
- svndiff.append(line + "\n")
- if not filecount:
- ErrorExit("No valid patches found in output from git diff")
- return "".join(svndiff)
-
- def GetUnknownFiles(self):
- status = RunShell(["git", "ls-files", "--exclude-standard", "--others"],
- silent_ok=True)
- return status.splitlines()
-
- def GetBaseFile(self, filename):
- hash = self.base_hashes[filename]
- base_content = None
- new_content = None
- is_binary = False
- if hash == "0" * 40: # All-zero hash indicates no base file.
- status = "A"
- base_content = ""
- else:
- status = "M"
- base_content, returncode = RunShellWithReturnCode(["git", "show", hash])
- if returncode:
- ErrorExit("Got error status from 'git show %s'" % hash)
- return (base_content, new_content, is_binary, status)
-
-
-class MercurialVCS(VersionControlSystem):
- """Implementation of the VersionControlSystem interface for Mercurial."""
-
- def __init__(self, options, repo_dir):
- super(MercurialVCS, self).__init__(options)
- # Absolute path to repository (we can be in a subdir)
- self.repo_dir = os.path.normpath(repo_dir)
- # Compute the subdir
- cwd = os.path.normpath(os.getcwd())
- assert cwd.startswith(self.repo_dir)
- self.subdir = cwd[len(self.repo_dir):].lstrip(r"\/")
- if self.options.revision:
- self.base_rev = self.options.revision
- else:
- self.base_rev = RunShell(["hg", "parent", "-q"]).split(':')[1].strip()
-
- def _GetRelPath(self, filename):
- """Get relative path of a file according to the current directory,
- given its logical path in the repo."""
- assert filename.startswith(self.subdir), filename
- return filename[len(self.subdir):].lstrip(r"\/")
-
- def GenerateDiff(self, extra_args):
- # If no file specified, restrict to the current subdir
- extra_args = extra_args or ["."]
- cmd = ["hg", "diff", "--git", "-r", self.base_rev] + extra_args
- data = RunShell(cmd, silent_ok=True)
- svndiff = []
- filecount = 0
- for line in data.splitlines():
- m = re.match("diff --git a/(\S+) b/(\S+)", line)
- if m:
- # Modify line to make it look like as it comes from svn diff.
- # With this modification no changes on the server side are required
- # to make upload.py work with Mercurial repos.
- # NOTE: for proper handling of moved/copied files, we have to use
- # the second filename.
- filename = m.group(2)
- svndiff.append("Index: %s" % filename)
- svndiff.append("=" * 67)
- filecount += 1
- logging.info(line)
- else:
- svndiff.append(line)
- if not filecount:
- ErrorExit("No valid patches found in output from hg diff")
- return "\n".join(svndiff) + "\n"
-
- def GetUnknownFiles(self):
- """Return a list of files unknown to the VCS."""
- args = []
- status = RunShell(["hg", "status", "--rev", self.base_rev, "-u", "."],
- silent_ok=True)
- unknown_files = []
- for line in status.splitlines():
- st, fn = line.split(" ", 1)
- if st == "?":
- unknown_files.append(fn)
- return unknown_files
-
- def GetBaseFile(self, filename):
- # "hg status" and "hg cat" both take a path relative to the current subdir
- # rather than to the repo root, but "hg diff" has given us the full path
- # to the repo root.
- base_content = ""
- new_content = None
- is_binary = False
- oldrelpath = relpath = self._GetRelPath(filename)
- # "hg status -C" returns two lines for moved/copied files, one otherwise
- out = RunShell(["hg", "status", "-C", "--rev", self.base_rev, relpath])
- out = out.splitlines()
- # HACK: strip error message about missing file/directory if it isn't in
- # the working copy
- if out[0].startswith('%s: ' % relpath):
- out = out[1:]
- if len(out) > 1:
- # Moved/copied => considered as modified, use old filename to
- # retrieve base contents
- oldrelpath = out[1].strip()
- status = "M"
- else:
- status, _ = out[0].split(' ', 1)
- if status != "A":
- base_content = RunShell(["hg", "cat", "-r", self.base_rev, oldrelpath],
- silent_ok=True)
- is_binary = "\0" in base_content # Mercurial's heuristic
- if status != "R":
- new_content = open(relpath, "rb").read()
- is_binary = is_binary or "\0" in new_content
- if is_binary and base_content:
- # Fetch again without converting newlines
- base_content = RunShell(["hg", "cat", "-r", self.base_rev, oldrelpath],
- silent_ok=True, universal_newlines=False)
- if not is_binary or not self.IsImage(relpath):
- new_content = None
- return base_content, new_content, is_binary, status
-
-
-# NOTE: The SplitPatch function is duplicated in engine.py, keep them in sync.
-def SplitPatch(data):
- """Splits a patch into separate pieces for each file.
-
- Args:
- data: A string containing the output of svn diff.
-
- Returns:
- A list of 2-tuple (filename, text) where text is the svn diff output
- pertaining to filename.
- """
- patches = []
- filename = None
- diff = []
- for line in data.splitlines(True):
- new_filename = None
- if line.startswith('Index:'):
- unused, new_filename = line.split(':', 1)
- new_filename = new_filename.strip()
- elif line.startswith('Property changes on:'):
- unused, temp_filename = line.split(':', 1)
- # When a file is modified, paths use '/' between directories, however
- # when a property is modified '\' is used on Windows. Make them the same
- # otherwise the file shows up twice.
- temp_filename = temp_filename.strip().replace('\\', '/')
- if temp_filename != filename:
- # File has property changes but no modifications, create a new diff.
- new_filename = temp_filename
- if new_filename:
- if filename and diff:
- patches.append((filename, ''.join(diff)))
- filename = new_filename
- diff = [line]
- continue
- if diff is not None:
- diff.append(line)
- if filename and diff:
- patches.append((filename, ''.join(diff)))
- return patches
-
-
-def UploadSeparatePatches(issue, rpc_server, patchset, data, options):
- """Uploads a separate patch for each file in the diff output.
-
- Returns a list of [patch_key, filename] for each file.
- """
- patches = SplitPatch(data)
- rv = []
- for patch in patches:
- if len(patch[1]) > MAX_UPLOAD_SIZE:
- print ("Not uploading the patch for " + patch[0] +
- " because the file is too large.")
- continue
- form_fields = [("filename", patch[0])]
- if not options.download_base:
- form_fields.append(("content_upload", "1"))
- files = [("data", "data.diff", patch[1])]
- ctype, body = EncodeMultipartFormData(form_fields, files)
- url = "/%d/upload_patch/%d" % (int(issue), int(patchset))
- print "Uploading patch for " + patch[0]
- response_body = rpc_server.Send(url, body, content_type=ctype)
- lines = response_body.splitlines()
- if not lines or lines[0] != "OK":
- StatusUpdate(" --> %s" % response_body)
- sys.exit(1)
- rv.append([lines[1], patch[0]])
- return rv
-
-
-def GuessVCS(options):
- """Helper to guess the version control system.
-
- This examines the current directory, guesses which VersionControlSystem
- we're using, and returns an instance of the appropriate class. Exit with an
- error if we can't figure it out.
-
- Returns:
- A VersionControlSystem instance. Exits if the VCS can't be guessed.
- """
- # Mercurial has a command to get the base directory of a repository
- # Try running it, but don't die if we don't have hg installed.
- # NOTE: we try Mercurial first as it can sit on top of an SVN working copy.
- try:
- out, returncode = RunShellWithReturnCode(["hg", "root"])
- if returncode == 0:
- return MercurialVCS(options, out.strip())
- except OSError, (errno, message):
- if errno != 2: # ENOENT -- they don't have hg installed.
- raise
-
- # Subversion has a .svn in all working directories.
- if os.path.isdir('.svn'):
- logging.info("Guessed VCS = Subversion")
- return SubversionVCS(options)
-
- # Git has a command to test if you're in a git tree.
- # Try running it, but don't die if we don't have git installed.
- try:
- out, returncode = RunShellWithReturnCode(["git", "rev-parse",
- "--is-inside-work-tree"])
- if returncode == 0:
- return GitVCS(options)
- except OSError, (errno, message):
- if errno != 2: # ENOENT -- they don't have git installed.
- raise
-
- ErrorExit(("Could not guess version control system. "
- "Are you in a working copy directory?"))
-
-
-def RealMain(argv, data=None):
- """The real main function.
-
- Args:
- argv: Command line arguments.
- data: Diff contents. If None (default) the diff is generated by
- the VersionControlSystem implementation returned by GuessVCS().
-
- Returns:
- A 2-tuple (issue id, patchset id).
- The patchset id is None if the base files are not uploaded by this
- script (applies only to SVN checkouts).
- """
- logging.basicConfig(format=("%(asctime).19s %(levelname)s %(filename)s:"
- "%(lineno)s %(message)s "))
- os.environ['LC_ALL'] = 'C'
- options, args = parser.parse_args(argv[1:])
- global verbosity
- verbosity = options.verbose
- if verbosity >= 3:
- logging.getLogger().setLevel(logging.DEBUG)
- elif verbosity >= 2:
- logging.getLogger().setLevel(logging.INFO)
- vcs = GuessVCS(options)
- if isinstance(vcs, SubversionVCS):
- # base field is only allowed for Subversion.
- # Note: Fetching base files may become deprecated in future releases.
- base = vcs.GuessBase(options.download_base)
- else:
- base = None
- if not base and options.download_base:
- options.download_base = True
- logging.info("Enabled upload of base file")
- if not options.assume_yes:
- vcs.CheckForUnknownFiles()
- if data is None:
- data = vcs.GenerateDiff(args)
- files = vcs.GetBaseFiles(data)
- if verbosity >= 1:
- print "Upload server:", options.server, "(change with -s/--server)"
- if options.issue:
- prompt = "Message describing this patch set: "
- else:
- prompt = "New issue subject: "
- message = options.message or raw_input(prompt).strip()
- if not message:
- ErrorExit("A non-empty message is required")
- rpc_server = GetRpcServer(options)
- form_fields = [("subject", message)]
- if base:
- form_fields.append(("base", base))
- if options.issue:
- form_fields.append(("issue", str(options.issue)))
- if options.email:
- form_fields.append(("user", options.email))
- if options.reviewers:
- for reviewer in options.reviewers.split(','):
- if "@" in reviewer and not reviewer.split("@")[1].count(".") == 1:
- ErrorExit("Invalid email address: %s" % reviewer)
- form_fields.append(("reviewers", options.reviewers))
- if options.cc:
- for cc in options.cc.split(','):
- if "@" in cc and not cc.split("@")[1].count(".") == 1:
- ErrorExit("Invalid email address: %s" % cc)
- form_fields.append(("cc", options.cc))
- description = options.description
- if options.description_file:
- if options.description:
- ErrorExit("Can't specify description and description_file")
- file = open(options.description_file, 'r')
- description = file.read()
- file.close()
- if description:
- form_fields.append(("description", description))
- # Send a hash of all the base file so the server can determine if a copy
- # already exists in an earlier patchset.
- base_hashes = ""
- for file, info in files.iteritems():
- if not info[0] is None:
- checksum = md5.new(info[0]).hexdigest()
- if base_hashes:
- base_hashes += "|"
- base_hashes += checksum + ":" + file
- form_fields.append(("base_hashes", base_hashes))
- # If we're uploading base files, don't send the email before the uploads, so
- # that it contains the file status.
- if options.send_mail and options.download_base:
- form_fields.append(("send_mail", "1"))
- if not options.download_base:
- form_fields.append(("content_upload", "1"))
- if len(data) > MAX_UPLOAD_SIZE:
- print "Patch is large, so uploading file patches separately."
- uploaded_diff_file = []
- form_fields.append(("separate_patches", "1"))
- else:
- uploaded_diff_file = [("data", "data.diff", data)]
- ctype, body = EncodeMultipartFormData(form_fields, uploaded_diff_file)
- response_body = rpc_server.Send("/upload", body, content_type=ctype)
- patchset = None
- if not options.download_base or not uploaded_diff_file:
- lines = response_body.splitlines()
- if len(lines) >= 2:
- msg = lines[0]
- patchset = lines[1].strip()
- patches = [x.split(" ", 1) for x in lines[2:]]
- else:
- msg = response_body
- else:
- msg = response_body
- StatusUpdate(msg)
- if not response_body.startswith("Issue created.") and \
- not response_body.startswith("Issue updated."):
- sys.exit(0)
- issue = msg[msg.rfind("/")+1:]
-
- if not uploaded_diff_file:
- result = UploadSeparatePatches(issue, rpc_server, patchset, data, options)
- if not options.download_base:
- patches = result
-
- if not options.download_base:
- vcs.UploadBaseFiles(issue, rpc_server, patches, patchset, options, files)
- if options.send_mail:
- rpc_server.Send("/" + issue + "/mail", payload="")
- return issue, patchset
-
-
-def main():
- try:
- RealMain(sys.argv)
- except KeyboardInterrupt:
- print
- StatusUpdate("Interrupted.")
- sys.exit(1)
-
-
-if __name__ == "__main__":
- main()
diff --git a/src/testing/scripts/upload_gmock.py b/src/testing/scripts/upload_gmock.py
deleted file mode 100755
index 5dc484b3..00000000
--- a/src/testing/scripts/upload_gmock.py
+++ /dev/null
@@ -1,78 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2009, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-"""upload_gmock.py v0.1.0 -- uploads a Google Mock patch for review.
-
-This simple wrapper passes all command line flags and
---cc=googlemock@googlegroups.com to upload.py.
-
-USAGE: upload_gmock.py [options for upload.py]
-"""
-
-__author__ = 'wan@google.com (Zhanyong Wan)'
-
-import os
-import sys
-
-CC_FLAG = '--cc='
-GMOCK_GROUP = 'googlemock@googlegroups.com'
-
-
-def main():
- # Finds the path to upload.py, assuming it is in the same directory
- # as this file.
- my_dir = os.path.dirname(os.path.abspath(__file__))
- upload_py_path = os.path.join(my_dir, 'upload.py')
-
- # Adds Google Mock discussion group to the cc line if it's not there
- # already.
- upload_py_argv = [upload_py_path]
- found_cc_flag = False
- for arg in sys.argv[1:]:
- if arg.startswith(CC_FLAG):
- found_cc_flag = True
- cc_line = arg[len(CC_FLAG):]
- cc_list = [addr for addr in cc_line.split(',') if addr]
- if GMOCK_GROUP not in cc_list:
- cc_list.append(GMOCK_GROUP)
- upload_py_argv.append(CC_FLAG + ','.join(cc_list))
- else:
- upload_py_argv.append(arg)
-
- if not found_cc_flag:
- upload_py_argv.append(CC_FLAG + GMOCK_GROUP)
-
- # Invokes upload.py with the modified command line flags.
- os.execv(upload_py_path, upload_py_argv)
-
-
-if __name__ == '__main__':
- main()
diff --git a/src/testing/src/gmock-all.cc b/src/testing/src/gmock-all.cc
deleted file mode 100644
index 7aebce7a..00000000
--- a/src/testing/src/gmock-all.cc
+++ /dev/null
@@ -1,47 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-//
-// Google C++ Mocking Framework (Google Mock)
-//
-// This file #includes all Google Mock implementation .cc files. The
-// purpose is to allow a user to build Google Mock by compiling this
-// file alone.
-
-// This line ensures that gmock.h can be compiled on its own, even
-// when it's fused.
-#include "gmock/gmock.h"
-
-// The following lines pull in the real gmock *.cc files.
-#include "src/gmock-cardinalities.cc"
-#include "src/gmock-internal-utils.cc"
-#include "src/gmock-matchers.cc"
-#include "src/gmock-spec-builders.cc"
-#include "src/gmock.cc"
diff --git a/src/testing/src/gmock-cardinalities.cc b/src/testing/src/gmock-cardinalities.cc
deleted file mode 100644
index 50ec7286..00000000
--- a/src/testing/src/gmock-cardinalities.cc
+++ /dev/null
@@ -1,156 +0,0 @@
-// Copyright 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-// Google Mock - a framework for writing C++ mock classes.
-//
-// This file implements cardinalities.
-
-#include "gmock/gmock-cardinalities.h"
-
-#include <limits.h>
-#include <ostream> // NOLINT
-#include <sstream>
-#include <string>
-#include "gmock/internal/gmock-internal-utils.h"
-#include "gtest/gtest.h"
-
-namespace testing {
-
-namespace {
-
-// Implements the Between(m, n) cardinality.
-class BetweenCardinalityImpl : public CardinalityInterface {
- public:
- BetweenCardinalityImpl(int min, int max)
- : min_(min >= 0 ? min : 0),
- max_(max >= min_ ? max : min_) {
- std::stringstream ss;
- if (min < 0) {
- ss << "The invocation lower bound must be >= 0, "
- << "but is actually " << min << ".";
- internal::Expect(false, __FILE__, __LINE__, ss.str());
- } else if (max < 0) {
- ss << "The invocation upper bound must be >= 0, "
- << "but is actually " << max << ".";
- internal::Expect(false, __FILE__, __LINE__, ss.str());
- } else if (min > max) {
- ss << "The invocation upper bound (" << max
- << ") must be >= the invocation lower bound (" << min
- << ").";
- internal::Expect(false, __FILE__, __LINE__, ss.str());
- }
- }
-
- // Conservative estimate on the lower/upper bound of the number of
- // calls allowed.
- virtual int ConservativeLowerBound() const { return min_; }
- virtual int ConservativeUpperBound() const { return max_; }
-
- virtual bool IsSatisfiedByCallCount(int call_count) const {
- return min_ <= call_count && call_count <= max_;
- }
-
- virtual bool IsSaturatedByCallCount(int call_count) const {
- return call_count >= max_;
- }
-
- virtual void DescribeTo(::std::ostream* os) const;
-
- private:
- const int min_;
- const int max_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(BetweenCardinalityImpl);
-};
-
-// Formats "n times" in a human-friendly way.
-inline internal::string FormatTimes(int n) {
- if (n == 1) {
- return "once";
- } else if (n == 2) {
- return "twice";
- } else {
- std::stringstream ss;
- ss << n << " times";
- return ss.str();
- }
-}
-
-// Describes the Between(m, n) cardinality in human-friendly text.
-void BetweenCardinalityImpl::DescribeTo(::std::ostream* os) const {
- if (min_ == 0) {
- if (max_ == 0) {
- *os << "never called";
- } else if (max_ == INT_MAX) {
- *os << "called any number of times";
- } else {
- *os << "called at most " << FormatTimes(max_);
- }
- } else if (min_ == max_) {
- *os << "called " << FormatTimes(min_);
- } else if (max_ == INT_MAX) {
- *os << "called at least " << FormatTimes(min_);
- } else {
- // 0 < min_ < max_ < INT_MAX
- *os << "called between " << min_ << " and " << max_ << " times";
- }
-}
-
-} // Unnamed namespace
-
-// Describes the given call count to an ostream.
-void Cardinality::DescribeActualCallCountTo(int actual_call_count,
- ::std::ostream* os) {
- if (actual_call_count > 0) {
- *os << "called " << FormatTimes(actual_call_count);
- } else {
- *os << "never called";
- }
-}
-
-// Creates a cardinality that allows at least n calls.
-GTEST_API_ Cardinality AtLeast(int n) { return Between(n, INT_MAX); }
-
-// Creates a cardinality that allows at most n calls.
-GTEST_API_ Cardinality AtMost(int n) { return Between(0, n); }
-
-// Creates a cardinality that allows any number of calls.
-GTEST_API_ Cardinality AnyNumber() { return AtLeast(0); }
-
-// Creates a cardinality that allows between min and max calls.
-GTEST_API_ Cardinality Between(int min, int max) {
- return Cardinality(new BetweenCardinalityImpl(min, max));
-}
-
-// Creates a cardinality that allows exactly n calls.
-GTEST_API_ Cardinality Exactly(int n) { return Between(n, n); }
-
-} // namespace testing
diff --git a/src/testing/src/gmock-internal-utils.cc b/src/testing/src/gmock-internal-utils.cc
deleted file mode 100644
index fb530801..00000000
--- a/src/testing/src/gmock-internal-utils.cc
+++ /dev/null
@@ -1,174 +0,0 @@
-// Copyright 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-// Google Mock - a framework for writing C++ mock classes.
-//
-// This file defines some utilities useful for implementing Google
-// Mock. They are subject to change without notice, so please DO NOT
-// USE THEM IN USER CODE.
-
-#include "gmock/internal/gmock-internal-utils.h"
-
-#include <ctype.h>
-#include <ostream> // NOLINT
-#include <string>
-#include "gmock/gmock.h"
-#include "gmock/internal/gmock-port.h"
-#include "gtest/gtest.h"
-
-namespace testing {
-namespace internal {
-
-// Converts an identifier name to a space-separated list of lower-case
-// words. Each maximum substring of the form [A-Za-z][a-z]*|\d+ is
-// treated as one word. For example, both "FooBar123" and
-// "foo_bar_123" are converted to "foo bar 123".
-GTEST_API_ string ConvertIdentifierNameToWords(const char* id_name) {
- string result;
- char prev_char = '\0';
- for (const char* p = id_name; *p != '\0'; prev_char = *(p++)) {
- // We don't care about the current locale as the input is
- // guaranteed to be a valid C++ identifier name.
- const bool starts_new_word = IsUpper(*p) ||
- (!IsAlpha(prev_char) && IsLower(*p)) ||
- (!IsDigit(prev_char) && IsDigit(*p));
-
- if (IsAlNum(*p)) {
- if (starts_new_word && result != "")
- result += ' ';
- result += ToLower(*p);
- }
- }
- return result;
-}
-
-// This class reports Google Mock failures as Google Test failures. A
-// user can define another class in a similar fashion if he intends to
-// use Google Mock with a testing framework other than Google Test.
-class GoogleTestFailureReporter : public FailureReporterInterface {
- public:
- virtual void ReportFailure(FailureType type, const char* file, int line,
- const string& message) {
- AssertHelper(type == kFatal ?
- TestPartResult::kFatalFailure :
- TestPartResult::kNonFatalFailure,
- file,
- line,
- message.c_str()) = Message();
- if (type == kFatal) {
- posix::Abort();
- }
- }
-};
-
-// Returns the global failure reporter. Will create a
-// GoogleTestFailureReporter and return it the first time called.
-GTEST_API_ FailureReporterInterface* GetFailureReporter() {
- // Points to the global failure reporter used by Google Mock. gcc
- // guarantees that the following use of failure_reporter is
- // thread-safe. We may need to add additional synchronization to
- // protect failure_reporter if we port Google Mock to other
- // compilers.
- static FailureReporterInterface* const failure_reporter =
- new GoogleTestFailureReporter();
- return failure_reporter;
-}
-
-// Protects global resources (stdout in particular) used by Log().
-static GTEST_DEFINE_STATIC_MUTEX_(g_log_mutex);
-
-// Returns true iff a log with the given severity is visible according
-// to the --gmock_verbose flag.
-GTEST_API_ bool LogIsVisible(LogSeverity severity) {
- if (GMOCK_FLAG(verbose) == kInfoVerbosity) {
- // Always show the log if --gmock_verbose=info.
- return true;
- } else if (GMOCK_FLAG(verbose) == kErrorVerbosity) {
- // Always hide it if --gmock_verbose=error.
- return false;
- } else {
- // If --gmock_verbose is neither "info" nor "error", we treat it
- // as "warning" (its default value).
- return severity == kWarning;
- }
-}
-
-// Prints the given message to stdout iff 'severity' >= the level
-// specified by the --gmock_verbose flag. If stack_frames_to_skip >=
-// 0, also prints the stack trace excluding the top
-// stack_frames_to_skip frames. In opt mode, any positive
-// stack_frames_to_skip is treated as 0, since we don't know which
-// function calls will be inlined by the compiler and need to be
-// conservative.
-GTEST_API_ void Log(LogSeverity severity,
- const string& message,
- int stack_frames_to_skip) {
- if (!LogIsVisible(severity))
- return;
-
- // Ensures that logs from different threads don't interleave.
- MutexLock l(&g_log_mutex);
-
- // "using ::std::cout;" doesn't work with Symbian's STLport, where cout is a
- // macro.
-
- if (severity == kWarning) {
- // Prints a GMOCK WARNING marker to make the warnings easily searchable.
- std::cout << "\nGMOCK WARNING:";
- }
- // Pre-pends a new-line to message if it doesn't start with one.
- if (message.empty() || message[0] != '\n') {
- std::cout << "\n";
- }
- std::cout << message;
- if (stack_frames_to_skip >= 0) {
-#ifdef NDEBUG
- // In opt mode, we have to be conservative and skip no stack frame.
- const int actual_to_skip = 0;
-#else
- // In dbg mode, we can do what the caller tell us to do (plus one
- // for skipping this function's stack frame).
- const int actual_to_skip = stack_frames_to_skip + 1;
-#endif // NDEBUG
-
- // Appends a new-line to message if it doesn't end with one.
- if (!message.empty() && *message.rbegin() != '\n') {
- std::cout << "\n";
- }
- std::cout << "Stack trace:\n"
- << ::testing::internal::GetCurrentOsStackTraceExceptTop(
- ::testing::UnitTest::GetInstance(), actual_to_skip);
- }
- std::cout << ::std::flush;
-}
-
-} // namespace internal
-} // namespace testing
diff --git a/src/testing/src/gmock-matchers.cc b/src/testing/src/gmock-matchers.cc
deleted file mode 100644
index 63f3859b..00000000
--- a/src/testing/src/gmock-matchers.cc
+++ /dev/null
@@ -1,102 +0,0 @@
-// Copyright 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-// Google Mock - a framework for writing C++ mock classes.
-//
-// This file implements Matcher<const string&>, Matcher<string>, and
-// utilities for defining matchers.
-
-#include "gmock/gmock-matchers.h"
-#include "gmock/gmock-generated-matchers.h"
-
-#include <string.h>
-#include <sstream>
-#include <string>
-
-namespace testing {
-
-// Constructs a matcher that matches a const string& whose value is
-// equal to s.
-Matcher<const internal::string&>::Matcher(const internal::string& s) {
- *this = Eq(s);
-}
-
-// Constructs a matcher that matches a const string& whose value is
-// equal to s.
-Matcher<const internal::string&>::Matcher(const char* s) {
- *this = Eq(internal::string(s));
-}
-
-// Constructs a matcher that matches a string whose value is equal to s.
-Matcher<internal::string>::Matcher(const internal::string& s) { *this = Eq(s); }
-
-// Constructs a matcher that matches a string whose value is equal to s.
-Matcher<internal::string>::Matcher(const char* s) {
- *this = Eq(internal::string(s));
-}
-
-namespace internal {
-
-// Joins a vector of strings as if they are fields of a tuple; returns
-// the joined string.
-GTEST_API_ string JoinAsTuple(const Strings& fields) {
- switch (fields.size()) {
- case 0:
- return "";
- case 1:
- return fields[0];
- default:
- string result = "(" + fields[0];
- for (size_t i = 1; i < fields.size(); i++) {
- result += ", ";
- result += fields[i];
- }
- result += ")";
- return result;
- }
-}
-
-// Returns the description for a matcher defined using the MATCHER*()
-// macro where the user-supplied description string is "", if
-// 'negation' is false; otherwise returns the description of the
-// negation of the matcher. 'param_values' contains a list of strings
-// that are the print-out of the matcher's parameters.
-GTEST_API_ string FormatMatcherDescription(bool negation,
- const char* matcher_name,
- const Strings& param_values) {
- string result = ConvertIdentifierNameToWords(matcher_name);
- if (param_values.size() >= 1)
- result += " " + JoinAsTuple(param_values);
- return negation ? "not (" + result + ")" : result;
-}
-
-} // namespace internal
-} // namespace testing
diff --git a/src/testing/src/gmock-spec-builders.cc b/src/testing/src/gmock-spec-builders.cc
deleted file mode 100644
index 9fcb61ea..00000000
--- a/src/testing/src/gmock-spec-builders.cc
+++ /dev/null
@@ -1,813 +0,0 @@
-// Copyright 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-// Google Mock - a framework for writing C++ mock classes.
-//
-// This file implements the spec builder syntax (ON_CALL and
-// EXPECT_CALL).
-
-#include "gmock/gmock-spec-builders.h"
-
-#include <stdlib.h>
-#include <iostream> // NOLINT
-#include <map>
-#include <set>
-#include <string>
-#include "gmock/gmock.h"
-#include "gtest/gtest.h"
-
-#if GTEST_OS_CYGWIN || GTEST_OS_LINUX || GTEST_OS_MAC
-# include <unistd.h> // NOLINT
-#endif
-
-namespace testing {
-namespace internal {
-
-// Protects the mock object registry (in class Mock), all function
-// mockers, and all expectations.
-GTEST_API_ GTEST_DEFINE_STATIC_MUTEX_(g_gmock_mutex);
-
-// Logs a message including file and line number information.
-GTEST_API_ void LogWithLocation(testing::internal::LogSeverity severity,
- const char* file, int line,
- const string& message) {
- ::std::ostringstream s;
- s << file << ":" << line << ": " << message << ::std::endl;
- Log(severity, s.str(), 0);
-}
-
-// Constructs an ExpectationBase object.
-ExpectationBase::ExpectationBase(const char* a_file,
- int a_line,
- const string& a_source_text)
- : file_(a_file),
- line_(a_line),
- source_text_(a_source_text),
- cardinality_specified_(false),
- cardinality_(Exactly(1)),
- call_count_(0),
- retired_(false),
- extra_matcher_specified_(false),
- repeated_action_specified_(false),
- retires_on_saturation_(false),
- last_clause_(kNone),
- action_count_checked_(false) {}
-
-// Destructs an ExpectationBase object.
-ExpectationBase::~ExpectationBase() {}
-
-// Explicitly specifies the cardinality of this expectation. Used by
-// the subclasses to implement the .Times() clause.
-void ExpectationBase::SpecifyCardinality(const Cardinality& a_cardinality) {
- cardinality_specified_ = true;
- cardinality_ = a_cardinality;
-}
-
-// Retires all pre-requisites of this expectation.
-void ExpectationBase::RetireAllPreRequisites()
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
- if (is_retired()) {
- // We can take this short-cut as we never retire an expectation
- // until we have retired all its pre-requisites.
- return;
- }
-
- for (ExpectationSet::const_iterator it = immediate_prerequisites_.begin();
- it != immediate_prerequisites_.end(); ++it) {
- ExpectationBase* const prerequisite = it->expectation_base().get();
- if (!prerequisite->is_retired()) {
- prerequisite->RetireAllPreRequisites();
- prerequisite->Retire();
- }
- }
-}
-
-// Returns true iff all pre-requisites of this expectation have been
-// satisfied.
-bool ExpectationBase::AllPrerequisitesAreSatisfied() const
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
- g_gmock_mutex.AssertHeld();
- for (ExpectationSet::const_iterator it = immediate_prerequisites_.begin();
- it != immediate_prerequisites_.end(); ++it) {
- if (!(it->expectation_base()->IsSatisfied()) ||
- !(it->expectation_base()->AllPrerequisitesAreSatisfied()))
- return false;
- }
- return true;
-}
-
-// Adds unsatisfied pre-requisites of this expectation to 'result'.
-void ExpectationBase::FindUnsatisfiedPrerequisites(ExpectationSet* result) const
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
- g_gmock_mutex.AssertHeld();
- for (ExpectationSet::const_iterator it = immediate_prerequisites_.begin();
- it != immediate_prerequisites_.end(); ++it) {
- if (it->expectation_base()->IsSatisfied()) {
- // If *it is satisfied and has a call count of 0, some of its
- // pre-requisites may not be satisfied yet.
- if (it->expectation_base()->call_count_ == 0) {
- it->expectation_base()->FindUnsatisfiedPrerequisites(result);
- }
- } else {
- // Now that we know *it is unsatisfied, we are not so interested
- // in whether its pre-requisites are satisfied. Therefore we
- // don't recursively call FindUnsatisfiedPrerequisites() here.
- *result += *it;
- }
- }
-}
-
-// Describes how many times a function call matching this
-// expectation has occurred.
-void ExpectationBase::DescribeCallCountTo(::std::ostream* os) const
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
- g_gmock_mutex.AssertHeld();
-
- // Describes how many times the function is expected to be called.
- *os << " Expected: to be ";
- cardinality().DescribeTo(os);
- *os << "\n Actual: ";
- Cardinality::DescribeActualCallCountTo(call_count(), os);
-
- // Describes the state of the expectation (e.g. is it satisfied?
- // is it active?).
- *os << " - " << (IsOverSaturated() ? "over-saturated" :
- IsSaturated() ? "saturated" :
- IsSatisfied() ? "satisfied" : "unsatisfied")
- << " and "
- << (is_retired() ? "retired" : "active");
-}
-
-// Checks the action count (i.e. the number of WillOnce() and
-// WillRepeatedly() clauses) against the cardinality if this hasn't
-// been done before. Prints a warning if there are too many or too
-// few actions.
-void ExpectationBase::CheckActionCountIfNotDone() const
- GTEST_LOCK_EXCLUDED_(mutex_) {
- bool should_check = false;
- {
- MutexLock l(&mutex_);
- if (!action_count_checked_) {
- action_count_checked_ = true;
- should_check = true;
- }
- }
-
- if (should_check) {
- if (!cardinality_specified_) {
- // The cardinality was inferred - no need to check the action
- // count against it.
- return;
- }
-
- // The cardinality was explicitly specified.
- const int action_count = static_cast<int>(untyped_actions_.size());
- const int upper_bound = cardinality().ConservativeUpperBound();
- const int lower_bound = cardinality().ConservativeLowerBound();
- bool too_many; // True if there are too many actions, or false
- // if there are too few.
- if (action_count > upper_bound ||
- (action_count == upper_bound && repeated_action_specified_)) {
- too_many = true;
- } else if (0 < action_count && action_count < lower_bound &&
- !repeated_action_specified_) {
- too_many = false;
- } else {
- return;
- }
-
- ::std::stringstream ss;
- DescribeLocationTo(&ss);
- ss << "Too " << (too_many ? "many" : "few")
- << " actions specified in " << source_text() << "...\n"
- << "Expected to be ";
- cardinality().DescribeTo(&ss);
- ss << ", but has " << (too_many ? "" : "only ")
- << action_count << " WillOnce()"
- << (action_count == 1 ? "" : "s");
- if (repeated_action_specified_) {
- ss << " and a WillRepeatedly()";
- }
- ss << ".";
- Log(kWarning, ss.str(), -1); // -1 means "don't print stack trace".
- }
-}
-
-// Implements the .Times() clause.
-void ExpectationBase::UntypedTimes(const Cardinality& a_cardinality) {
- if (last_clause_ == kTimes) {
- ExpectSpecProperty(false,
- ".Times() cannot appear "
- "more than once in an EXPECT_CALL().");
- } else {
- ExpectSpecProperty(last_clause_ < kTimes,
- ".Times() cannot appear after "
- ".InSequence(), .WillOnce(), .WillRepeatedly(), "
- "or .RetiresOnSaturation().");
- }
- last_clause_ = kTimes;
-
- SpecifyCardinality(a_cardinality);
-}
-
-// Points to the implicit sequence introduced by a living InSequence
-// object (if any) in the current thread or NULL.
-GTEST_API_ ThreadLocal<Sequence*> g_gmock_implicit_sequence;
-
-// Reports an uninteresting call (whose description is in msg) in the
-// manner specified by 'reaction'.
-void ReportUninterestingCall(CallReaction reaction, const string& msg) {
- switch (reaction) {
- case kAllow:
- Log(kInfo, msg, 3);
- break;
- case kWarn:
- Log(kWarning, msg, 3);
- break;
- default: // FAIL
- Expect(false, NULL, -1, msg);
- }
-}
-
-UntypedFunctionMockerBase::UntypedFunctionMockerBase()
- : mock_obj_(NULL), name_("") {}
-
-UntypedFunctionMockerBase::~UntypedFunctionMockerBase() {}
-
-// Sets the mock object this mock method belongs to, and registers
-// this information in the global mock registry. Will be called
-// whenever an EXPECT_CALL() or ON_CALL() is executed on this mock
-// method.
-void UntypedFunctionMockerBase::RegisterOwner(const void* mock_obj)
- GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {
- {
- MutexLock l(&g_gmock_mutex);
- mock_obj_ = mock_obj;
- }
- Mock::Register(mock_obj, this);
-}
-
-// Sets the mock object this mock method belongs to, and sets the name
-// of the mock function. Will be called upon each invocation of this
-// mock function.
-void UntypedFunctionMockerBase::SetOwnerAndName(const void* mock_obj,
- const char* name)
- GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {
- // We protect name_ under g_gmock_mutex in case this mock function
- // is called from two threads concurrently.
- MutexLock l(&g_gmock_mutex);
- mock_obj_ = mock_obj;
- name_ = name;
-}
-
-// Returns the name of the function being mocked. Must be called
-// after RegisterOwner() or SetOwnerAndName() has been called.
-const void* UntypedFunctionMockerBase::MockObject() const
- GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {
- const void* mock_obj;
- {
- // We protect mock_obj_ under g_gmock_mutex in case this mock
- // function is called from two threads concurrently.
- MutexLock l(&g_gmock_mutex);
- Assert(mock_obj_ != NULL, __FILE__, __LINE__,
- "MockObject() must not be called before RegisterOwner() or "
- "SetOwnerAndName() has been called.");
- mock_obj = mock_obj_;
- }
- return mock_obj;
-}
-
-// Returns the name of this mock method. Must be called after
-// SetOwnerAndName() has been called.
-const char* UntypedFunctionMockerBase::Name() const
- GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {
- const char* name;
- {
- // We protect name_ under g_gmock_mutex in case this mock
- // function is called from two threads concurrently.
- MutexLock l(&g_gmock_mutex);
- Assert(name_ != NULL, __FILE__, __LINE__,
- "Name() must not be called before SetOwnerAndName() has "
- "been called.");
- name = name_;
- }
- return name;
-}
-
-// Calculates the result of invoking this mock function with the given
-// arguments, prints it, and returns it. The caller is responsible
-// for deleting the result.
-const UntypedActionResultHolderBase*
-UntypedFunctionMockerBase::UntypedInvokeWith(const void* const untyped_args)
- GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {
- if (untyped_expectations_.size() == 0) {
- // No expectation is set on this mock method - we have an
- // uninteresting call.
-
- // We must get Google Mock's reaction on uninteresting calls
- // made on this mock object BEFORE performing the action,
- // because the action may DELETE the mock object and make the
- // following expression meaningless.
- const CallReaction reaction =
- Mock::GetReactionOnUninterestingCalls(MockObject());
-
- // True iff we need to print this call's arguments and return
- // value. This definition must be kept in sync with
- // the behavior of ReportUninterestingCall().
- const bool need_to_report_uninteresting_call =
- // If the user allows this uninteresting call, we print it
- // only when he wants informational messages.
- reaction == kAllow ? LogIsVisible(kInfo) :
- // If the user wants this to be a warning, we print it only
- // when he wants to see warnings.
- reaction == kWarn ? LogIsVisible(kWarning) :
- // Otherwise, the user wants this to be an error, and we
- // should always print detailed information in the error.
- true;
-
- if (!need_to_report_uninteresting_call) {
- // Perform the action without printing the call information.
- return this->UntypedPerformDefaultAction(untyped_args, "");
- }
-
- // Warns about the uninteresting call.
- ::std::stringstream ss;
- this->UntypedDescribeUninterestingCall(untyped_args, &ss);
-
- // Calculates the function result.
- const UntypedActionResultHolderBase* const result =
- this->UntypedPerformDefaultAction(untyped_args, ss.str());
-
- // Prints the function result.
- if (result != NULL)
- result->PrintAsActionResult(&ss);
-
- ReportUninterestingCall(reaction, ss.str());
- return result;
- }
-
- bool is_excessive = false;
- ::std::stringstream ss;
- ::std::stringstream why;
- ::std::stringstream loc;
- const void* untyped_action = NULL;
-
- // The UntypedFindMatchingExpectation() function acquires and
- // releases g_gmock_mutex.
- const ExpectationBase* const untyped_expectation =
- this->UntypedFindMatchingExpectation(
- untyped_args, &untyped_action, &is_excessive,
- &ss, &why);
- const bool found = untyped_expectation != NULL;
-
- // True iff we need to print the call's arguments and return value.
- // This definition must be kept in sync with the uses of Expect()
- // and Log() in this function.
- const bool need_to_report_call =
- !found || is_excessive || LogIsVisible(kInfo);
- if (!need_to_report_call) {
- // Perform the action without printing the call information.
- return
- untyped_action == NULL ?
- this->UntypedPerformDefaultAction(untyped_args, "") :
- this->UntypedPerformAction(untyped_action, untyped_args);
- }
-
- ss << " Function call: " << Name();
- this->UntypedPrintArgs(untyped_args, &ss);
-
- // In case the action deletes a piece of the expectation, we
- // generate the message beforehand.
- if (found && !is_excessive) {
- untyped_expectation->DescribeLocationTo(&loc);
- }
-
- const UntypedActionResultHolderBase* const result =
- untyped_action == NULL ?
- this->UntypedPerformDefaultAction(untyped_args, ss.str()) :
- this->UntypedPerformAction(untyped_action, untyped_args);
- if (result != NULL)
- result->PrintAsActionResult(&ss);
- ss << "\n" << why.str();
-
- if (!found) {
- // No expectation matches this call - reports a failure.
- Expect(false, NULL, -1, ss.str());
- } else if (is_excessive) {
- // We had an upper-bound violation and the failure message is in ss.
- Expect(false, untyped_expectation->file(),
- untyped_expectation->line(), ss.str());
- } else {
- // We had an expected call and the matching expectation is
- // described in ss.
- Log(kInfo, loc.str() + ss.str(), 2);
- }
-
- return result;
-}
-
-// Returns an Expectation object that references and co-owns exp,
-// which must be an expectation on this mock function.
-Expectation UntypedFunctionMockerBase::GetHandleOf(ExpectationBase* exp) {
- for (UntypedExpectations::const_iterator it =
- untyped_expectations_.begin();
- it != untyped_expectations_.end(); ++it) {
- if (it->get() == exp) {
- return Expectation(*it);
- }
- }
-
- Assert(false, __FILE__, __LINE__, "Cannot find expectation.");
- return Expectation();
- // The above statement is just to make the code compile, and will
- // never be executed.
-}
-
-// Verifies that all expectations on this mock function have been
-// satisfied. Reports one or more Google Test non-fatal failures
-// and returns false if not.
-bool UntypedFunctionMockerBase::VerifyAndClearExpectationsLocked()
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
- g_gmock_mutex.AssertHeld();
- bool expectations_met = true;
- for (UntypedExpectations::const_iterator it =
- untyped_expectations_.begin();
- it != untyped_expectations_.end(); ++it) {
- ExpectationBase* const untyped_expectation = it->get();
- if (untyped_expectation->IsOverSaturated()) {
- // There was an upper-bound violation. Since the error was
- // already reported when it occurred, there is no need to do
- // anything here.
- expectations_met = false;
- } else if (!untyped_expectation->IsSatisfied()) {
- expectations_met = false;
- ::std::stringstream ss;
- ss << "Actual function call count doesn't match "
- << untyped_expectation->source_text() << "...\n";
- // No need to show the source file location of the expectation
- // in the description, as the Expect() call that follows already
- // takes care of it.
- untyped_expectation->MaybeDescribeExtraMatcherTo(&ss);
- untyped_expectation->DescribeCallCountTo(&ss);
- Expect(false, untyped_expectation->file(),
- untyped_expectation->line(), ss.str());
- }
- }
-
- // Deleting our expectations may trigger other mock objects to be deleted, for
- // example if an action contains a reference counted smart pointer to that
- // mock object, and that is the last reference. So if we delete our
- // expectations within the context of the global mutex we may deadlock when
- // this method is called again. Instead, make a copy of the set of
- // expectations to delete, clear our set within the mutex, and then clear the
- // copied set outside of it.
- UntypedExpectations expectations_to_delete;
- untyped_expectations_.swap(expectations_to_delete);
-
- g_gmock_mutex.Unlock();
- expectations_to_delete.clear();
- g_gmock_mutex.Lock();
-
- return expectations_met;
-}
-
-} // namespace internal
-
-// Class Mock.
-
-namespace {
-
-typedef std::set<internal::UntypedFunctionMockerBase*> FunctionMockers;
-
-// The current state of a mock object. Such information is needed for
-// detecting leaked mock objects and explicitly verifying a mock's
-// expectations.
-struct MockObjectState {
- MockObjectState()
- : first_used_file(NULL), first_used_line(-1), leakable(false) {}
-
- // Where in the source file an ON_CALL or EXPECT_CALL is first
- // invoked on this mock object.
- const char* first_used_file;
- int first_used_line;
- ::std::string first_used_test_case;
- ::std::string first_used_test;
- bool leakable; // true iff it's OK to leak the object.
- FunctionMockers function_mockers; // All registered methods of the object.
-};
-
-// A global registry holding the state of all mock objects that are
-// alive. A mock object is added to this registry the first time
-// Mock::AllowLeak(), ON_CALL(), or EXPECT_CALL() is called on it. It
-// is removed from the registry in the mock object's destructor.
-class MockObjectRegistry {
- public:
- // Maps a mock object (identified by its address) to its state.
- typedef std::map<const void*, MockObjectState> StateMap;
-
- // This destructor will be called when a program exits, after all
- // tests in it have been run. By then, there should be no mock
- // object alive. Therefore we report any living object as test
- // failure, unless the user explicitly asked us to ignore it.
- ~MockObjectRegistry() {
- // "using ::std::cout;" doesn't work with Symbian's STLport, where cout is
- // a macro.
-
- if (!GMOCK_FLAG(catch_leaked_mocks))
- return;
-
- int leaked_count = 0;
- for (StateMap::const_iterator it = states_.begin(); it != states_.end();
- ++it) {
- if (it->second.leakable) // The user said it's fine to leak this object.
- continue;
-
- // TODO(wan@google.com): Print the type of the leaked object.
- // This can help the user identify the leaked object.
- std::cout << "\n";
- const MockObjectState& state = it->second;
- std::cout << internal::FormatFileLocation(state.first_used_file,
- state.first_used_line);
- std::cout << " ERROR: this mock object";
- if (state.first_used_test != "") {
- std::cout << " (used in test " << state.first_used_test_case << "."
- << state.first_used_test << ")";
- }
- std::cout << " should be deleted but never is. Its address is @"
- << it->first << ".";
- leaked_count++;
- }
- if (leaked_count > 0) {
- std::cout << "\nERROR: " << leaked_count
- << " leaked mock " << (leaked_count == 1 ? "object" : "objects")
- << " found at program exit.\n";
- std::cout.flush();
- ::std::cerr.flush();
- // RUN_ALL_TESTS() has already returned when this destructor is
- // called. Therefore we cannot use the normal Google Test
- // failure reporting mechanism.
- _exit(1); // We cannot call exit() as it is not reentrant and
- // may already have been called.
- }
- }
-
- StateMap& states() { return states_; }
-
- private:
- StateMap states_;
-};
-
-// Protected by g_gmock_mutex.
-MockObjectRegistry g_mock_object_registry;
-
-// Maps a mock object to the reaction Google Mock should have when an
-// uninteresting method is called. Protected by g_gmock_mutex.
-std::map<const void*, internal::CallReaction> g_uninteresting_call_reaction;
-
-// Sets the reaction Google Mock should have when an uninteresting
-// method of the given mock object is called.
-void SetReactionOnUninterestingCalls(const void* mock_obj,
- internal::CallReaction reaction)
- GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex) {
- internal::MutexLock l(&internal::g_gmock_mutex);
- g_uninteresting_call_reaction[mock_obj] = reaction;
-}
-
-} // namespace
-
-// Tells Google Mock to allow uninteresting calls on the given mock
-// object.
-void Mock::AllowUninterestingCalls(const void* mock_obj)
- GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex) {
- SetReactionOnUninterestingCalls(mock_obj, internal::kAllow);
-}
-
-// Tells Google Mock to warn the user about uninteresting calls on the
-// given mock object.
-void Mock::WarnUninterestingCalls(const void* mock_obj)
- GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex) {
- SetReactionOnUninterestingCalls(mock_obj, internal::kWarn);
-}
-
-// Tells Google Mock to fail uninteresting calls on the given mock
-// object.
-void Mock::FailUninterestingCalls(const void* mock_obj)
- GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex) {
- SetReactionOnUninterestingCalls(mock_obj, internal::kFail);
-}
-
-// Tells Google Mock the given mock object is being destroyed and its
-// entry in the call-reaction table should be removed.
-void Mock::UnregisterCallReaction(const void* mock_obj)
- GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex) {
- internal::MutexLock l(&internal::g_gmock_mutex);
- g_uninteresting_call_reaction.erase(mock_obj);
-}
-
-// Returns the reaction Google Mock will have on uninteresting calls
-// made on the given mock object.
-internal::CallReaction Mock::GetReactionOnUninterestingCalls(
- const void* mock_obj)
- GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex) {
- internal::MutexLock l(&internal::g_gmock_mutex);
- return (g_uninteresting_call_reaction.count(mock_obj) == 0) ?
- internal::kWarn : g_uninteresting_call_reaction[mock_obj];
-}
-
-// Tells Google Mock to ignore mock_obj when checking for leaked mock
-// objects.
-void Mock::AllowLeak(const void* mock_obj)
- GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex) {
- internal::MutexLock l(&internal::g_gmock_mutex);
- g_mock_object_registry.states()[mock_obj].leakable = true;
-}
-
-// Verifies and clears all expectations on the given mock object. If
-// the expectations aren't satisfied, generates one or more Google
-// Test non-fatal failures and returns false.
-bool Mock::VerifyAndClearExpectations(void* mock_obj)
- GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex) {
- internal::MutexLock l(&internal::g_gmock_mutex);
- return VerifyAndClearExpectationsLocked(mock_obj);
-}
-
-// Verifies all expectations on the given mock object and clears its
-// default actions and expectations. Returns true iff the
-// verification was successful.
-bool Mock::VerifyAndClear(void* mock_obj)
- GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex) {
- internal::MutexLock l(&internal::g_gmock_mutex);
- ClearDefaultActionsLocked(mock_obj);
- return VerifyAndClearExpectationsLocked(mock_obj);
-}
-
-// Verifies and clears all expectations on the given mock object. If
-// the expectations aren't satisfied, generates one or more Google
-// Test non-fatal failures and returns false.
-bool Mock::VerifyAndClearExpectationsLocked(void* mock_obj)
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(internal::g_gmock_mutex) {
- internal::g_gmock_mutex.AssertHeld();
- if (g_mock_object_registry.states().count(mock_obj) == 0) {
- // No EXPECT_CALL() was set on the given mock object.
- return true;
- }
-
- // Verifies and clears the expectations on each mock method in the
- // given mock object.
- bool expectations_met = true;
- FunctionMockers& mockers =
- g_mock_object_registry.states()[mock_obj].function_mockers;
- for (FunctionMockers::const_iterator it = mockers.begin();
- it != mockers.end(); ++it) {
- if (!(*it)->VerifyAndClearExpectationsLocked()) {
- expectations_met = false;
- }
- }
-
- // We don't clear the content of mockers, as they may still be
- // needed by ClearDefaultActionsLocked().
- return expectations_met;
-}
-
-// Registers a mock object and a mock method it owns.
-void Mock::Register(const void* mock_obj,
- internal::UntypedFunctionMockerBase* mocker)
- GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex) {
- internal::MutexLock l(&internal::g_gmock_mutex);
- g_mock_object_registry.states()[mock_obj].function_mockers.insert(mocker);
-}
-
-// Tells Google Mock where in the source code mock_obj is used in an
-// ON_CALL or EXPECT_CALL. In case mock_obj is leaked, this
-// information helps the user identify which object it is.
-void Mock::RegisterUseByOnCallOrExpectCall(const void* mock_obj,
- const char* file, int line)
- GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex) {
- internal::MutexLock l(&internal::g_gmock_mutex);
- MockObjectState& state = g_mock_object_registry.states()[mock_obj];
- if (state.first_used_file == NULL) {
- state.first_used_file = file;
- state.first_used_line = line;
- const TestInfo* const test_info =
- UnitTest::GetInstance()->current_test_info();
- if (test_info != NULL) {
- // TODO(wan@google.com): record the test case name when the
- // ON_CALL or EXPECT_CALL is invoked from SetUpTestCase() or
- // TearDownTestCase().
- state.first_used_test_case = test_info->test_case_name();
- state.first_used_test = test_info->name();
- }
- }
-}
-
-// Unregisters a mock method; removes the owning mock object from the
-// registry when the last mock method associated with it has been
-// unregistered. This is called only in the destructor of
-// FunctionMockerBase.
-void Mock::UnregisterLocked(internal::UntypedFunctionMockerBase* mocker)
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(internal::g_gmock_mutex) {
- internal::g_gmock_mutex.AssertHeld();
- for (MockObjectRegistry::StateMap::iterator it =
- g_mock_object_registry.states().begin();
- it != g_mock_object_registry.states().end(); ++it) {
- FunctionMockers& mockers = it->second.function_mockers;
- if (mockers.erase(mocker) > 0) {
- // mocker was in mockers and has been just removed.
- if (mockers.empty()) {
- g_mock_object_registry.states().erase(it);
- }
- return;
- }
- }
-}
-
-// Clears all ON_CALL()s set on the given mock object.
-void Mock::ClearDefaultActionsLocked(void* mock_obj)
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(internal::g_gmock_mutex) {
- internal::g_gmock_mutex.AssertHeld();
-
- if (g_mock_object_registry.states().count(mock_obj) == 0) {
- // No ON_CALL() was set on the given mock object.
- return;
- }
-
- // Clears the default actions for each mock method in the given mock
- // object.
- FunctionMockers& mockers =
- g_mock_object_registry.states()[mock_obj].function_mockers;
- for (FunctionMockers::const_iterator it = mockers.begin();
- it != mockers.end(); ++it) {
- (*it)->ClearDefaultActionsLocked();
- }
-
- // We don't clear the content of mockers, as they may still be
- // needed by VerifyAndClearExpectationsLocked().
-}
-
-Expectation::Expectation() {}
-
-Expectation::Expectation(
- const internal::linked_ptr<internal::ExpectationBase>& an_expectation_base)
- : expectation_base_(an_expectation_base) {}
-
-Expectation::~Expectation() {}
-
-// Adds an expectation to a sequence.
-void Sequence::AddExpectation(const Expectation& expectation) const {
- if (*last_expectation_ != expectation) {
- if (last_expectation_->expectation_base() != NULL) {
- expectation.expectation_base()->immediate_prerequisites_
- += *last_expectation_;
- }
- *last_expectation_ = expectation;
- }
-}
-
-// Creates the implicit sequence if there isn't one.
-InSequence::InSequence() {
- if (internal::g_gmock_implicit_sequence.get() == NULL) {
- internal::g_gmock_implicit_sequence.set(new Sequence);
- sequence_created_ = true;
- } else {
- sequence_created_ = false;
- }
-}
-
-// Deletes the implicit sequence if it was created by the constructor
-// of this object.
-InSequence::~InSequence() {
- if (sequence_created_) {
- delete internal::g_gmock_implicit_sequence.get();
- internal::g_gmock_implicit_sequence.set(NULL);
- }
-}
-
-} // namespace testing
diff --git a/src/testing/src/gmock.cc b/src/testing/src/gmock.cc
deleted file mode 100644
index e06acc5c..00000000
--- a/src/testing/src/gmock.cc
+++ /dev/null
@@ -1,182 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-#include "gmock/gmock.h"
-#include "gmock/internal/gmock-port.h"
-
-namespace testing {
-
-// TODO(wan@google.com): support using environment variables to
-// control the flag values, like what Google Test does.
-
-GMOCK_DEFINE_bool_(catch_leaked_mocks, true,
- "true iff Google Mock should report leaked mock objects "
- "as failures.");
-
-GMOCK_DEFINE_string_(verbose, internal::kWarningVerbosity,
- "Controls how verbose Google Mock's output is."
- " Valid values:\n"
- " info - prints all messages.\n"
- " warning - prints warnings and errors.\n"
- " error - prints errors only.");
-
-namespace internal {
-
-// Parses a string as a command line flag. The string should have the
-// format "--gmock_flag=value". When def_optional is true, the
-// "=value" part can be omitted.
-//
-// Returns the value of the flag, or NULL if the parsing failed.
-static const char* ParseGoogleMockFlagValue(const char* str,
- const char* flag,
- bool def_optional) {
- // str and flag must not be NULL.
- if (str == NULL || flag == NULL) return NULL;
-
- // The flag must start with "--gmock_".
- const String flag_str = String::Format("--gmock_%s", flag);
- const size_t flag_len = flag_str.length();
- if (strncmp(str, flag_str.c_str(), flag_len) != 0) return NULL;
-
- // Skips the flag name.
- const char* flag_end = str + flag_len;
-
- // When def_optional is true, it's OK to not have a "=value" part.
- if (def_optional && (flag_end[0] == '\0')) {
- return flag_end;
- }
-
- // If def_optional is true and there are more characters after the
- // flag name, or if def_optional is false, there must be a '=' after
- // the flag name.
- if (flag_end[0] != '=') return NULL;
-
- // Returns the string after "=".
- return flag_end + 1;
-}
-
-// Parses a string for a Google Mock bool flag, in the form of
-// "--gmock_flag=value".
-//
-// On success, stores the value of the flag in *value, and returns
-// true. On failure, returns false without changing *value.
-static bool ParseGoogleMockBoolFlag(const char* str, const char* flag,
- bool* value) {
- // Gets the value of the flag as a string.
- const char* const value_str = ParseGoogleMockFlagValue(str, flag, true);
-
- // Aborts if the parsing failed.
- if (value_str == NULL) return false;
-
- // Converts the string value to a bool.
- *value = !(*value_str == '0' || *value_str == 'f' || *value_str == 'F');
- return true;
-}
-
-// Parses a string for a Google Mock string flag, in the form of
-// "--gmock_flag=value".
-//
-// On success, stores the value of the flag in *value, and returns
-// true. On failure, returns false without changing *value.
-static bool ParseGoogleMockStringFlag(const char* str, const char* flag,
- String* value) {
- // Gets the value of the flag as a string.
- const char* const value_str = ParseGoogleMockFlagValue(str, flag, false);
-
- // Aborts if the parsing failed.
- if (value_str == NULL) return false;
-
- // Sets *value to the value of the flag.
- *value = value_str;
- return true;
-}
-
-// The internal implementation of InitGoogleMock().
-//
-// The type parameter CharType can be instantiated to either char or
-// wchar_t.
-template <typename CharType>
-void InitGoogleMockImpl(int* argc, CharType** argv) {
- // Makes sure Google Test is initialized. InitGoogleTest() is
- // idempotent, so it's fine if the user has already called it.
- InitGoogleTest(argc, argv);
- if (*argc <= 0) return;
-
- for (int i = 1; i != *argc; i++) {
- const String arg_string = StreamableToString(argv[i]);
- const char* const arg = arg_string.c_str();
-
- // Do we see a Google Mock flag?
- if (ParseGoogleMockBoolFlag(arg, "catch_leaked_mocks",
- &GMOCK_FLAG(catch_leaked_mocks)) ||
- ParseGoogleMockStringFlag(arg, "verbose", &GMOCK_FLAG(verbose))) {
- // Yes. Shift the remainder of the argv list left by one. Note
- // that argv has (*argc + 1) elements, the last one always being
- // NULL. The following loop moves the trailing NULL element as
- // well.
- for (int j = i; j != *argc; j++) {
- argv[j] = argv[j + 1];
- }
-
- // Decrements the argument count.
- (*argc)--;
-
- // We also need to decrement the iterator as we just removed
- // an element.
- i--;
- }
- }
-}
-
-} // namespace internal
-
-// Initializes Google Mock. This must be called before running the
-// tests. In particular, it parses a command line for the flags that
-// Google Mock recognizes. Whenever a Google Mock flag is seen, it is
-// removed from argv, and *argc is decremented.
-//
-// No value is returned. Instead, the Google Mock flag variables are
-// updated.
-//
-// Since Google Test is needed for Google Mock to work, this function
-// also initializes Google Test and parses its flags, if that hasn't
-// been done.
-GTEST_API_ void InitGoogleMock(int* argc, char** argv) {
- internal::InitGoogleMockImpl(argc, argv);
-}
-
-// This overloaded version can be used in Windows programs compiled in
-// UNICODE mode.
-GTEST_API_ void InitGoogleMock(int* argc, wchar_t** argv) {
- internal::InitGoogleMockImpl(argc, argv);
-}
-
-} // namespace testing
diff --git a/src/testing/src/gmock_main.cc b/src/testing/src/gmock_main.cc
deleted file mode 100644
index bd5be03b..00000000
--- a/src/testing/src/gmock_main.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-#include <iostream>
-#include "gmock/gmock.h"
-#include "gtest/gtest.h"
-
-// MS C++ compiler/linker has a bug on Windows (not on Windows CE), which
-// causes a link error when _tmain is defined in a static library and UNICODE
-// is enabled. For this reason instead of _tmain, main function is used on
-// Windows. See the following link to track the current status of this bug:
-// http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=394464 // NOLINT
-#if GTEST_OS_WINDOWS_MOBILE
-# include <tchar.h> // NOLINT
-
-GTEST_API_ int _tmain(int argc, TCHAR** argv) {
-#else
-GTEST_API_ int main(int argc, char** argv) {
-#endif // GTEST_OS_WINDOWS_MOBILE
- std::cout << "Running main() from gmock_main.cc\n";
- // Since Google Mock depends on Google Test, InitGoogleMock() is
- // also responsible for initializing Google Test. Therefore there's
- // no need for calling testing::InitGoogleTest() separately.
- testing::InitGoogleMock(&argc, argv);
- return RUN_ALL_TESTS();
-}
diff --git a/src/testing/test/gmock-actions_test.cc b/src/testing/test/gmock-actions_test.cc
deleted file mode 100644
index fd87c74c..00000000
--- a/src/testing/test/gmock-actions_test.cc
+++ /dev/null
@@ -1,1308 +0,0 @@
-// Copyright 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-// Google Mock - a framework for writing C++ mock classes.
-//
-// This file tests the built-in actions.
-
-#include "gmock/gmock-actions.h"
-#include <algorithm>
-#include <iterator>
-#include <string>
-#include "gmock/gmock.h"
-#include "gmock/internal/gmock-port.h"
-#include "gtest/gtest.h"
-#include "gtest/gtest-spi.h"
-
-namespace {
-
-using ::std::tr1::get;
-using ::std::tr1::make_tuple;
-using ::std::tr1::tuple;
-using ::std::tr1::tuple_element;
-using testing::internal::BuiltInDefaultValue;
-using testing::internal::Int64;
-using testing::internal::UInt64;
-// This list should be kept sorted.
-using testing::_;
-using testing::Action;
-using testing::ActionInterface;
-using testing::Assign;
-using testing::ByRef;
-using testing::DefaultValue;
-using testing::DoDefault;
-using testing::IgnoreResult;
-using testing::Invoke;
-using testing::InvokeWithoutArgs;
-using testing::MakePolymorphicAction;
-using testing::Ne;
-using testing::PolymorphicAction;
-using testing::Return;
-using testing::ReturnNull;
-using testing::ReturnRef;
-using testing::ReturnRefOfCopy;
-using testing::SetArgPointee;
-using testing::SetArgumentPointee;
-
-#if !GTEST_OS_WINDOWS_MOBILE
-using testing::SetErrnoAndReturn;
-#endif
-
-#if GTEST_HAS_PROTOBUF_
-using testing::internal::TestMessage;
-#endif // GTEST_HAS_PROTOBUF_
-
-// Tests that BuiltInDefaultValue<T*>::Get() returns NULL.
-TEST(BuiltInDefaultValueTest, IsNullForPointerTypes) {
- EXPECT_TRUE(BuiltInDefaultValue<int*>::Get() == NULL);
- EXPECT_TRUE(BuiltInDefaultValue<const char*>::Get() == NULL);
- EXPECT_TRUE(BuiltInDefaultValue<void*>::Get() == NULL);
-}
-
-// Tests that BuiltInDefaultValue<T*>::Exists() return true.
-TEST(BuiltInDefaultValueTest, ExistsForPointerTypes) {
- EXPECT_TRUE(BuiltInDefaultValue<int*>::Exists());
- EXPECT_TRUE(BuiltInDefaultValue<const char*>::Exists());
- EXPECT_TRUE(BuiltInDefaultValue<void*>::Exists());
-}
-
-// Tests that BuiltInDefaultValue<T>::Get() returns 0 when T is a
-// built-in numeric type.
-TEST(BuiltInDefaultValueTest, IsZeroForNumericTypes) {
- EXPECT_EQ(0U, BuiltInDefaultValue<unsigned char>::Get());
- EXPECT_EQ(0, BuiltInDefaultValue<signed char>::Get());
- EXPECT_EQ(0, BuiltInDefaultValue<char>::Get());
-#if GMOCK_HAS_SIGNED_WCHAR_T_
- EXPECT_EQ(0U, BuiltInDefaultValue<unsigned wchar_t>::Get());
- EXPECT_EQ(0, BuiltInDefaultValue<signed wchar_t>::Get());
-#endif
-#if GMOCK_WCHAR_T_IS_NATIVE_
- EXPECT_EQ(0, BuiltInDefaultValue<wchar_t>::Get());
-#endif
- EXPECT_EQ(0U, BuiltInDefaultValue<unsigned short>::Get()); // NOLINT
- EXPECT_EQ(0, BuiltInDefaultValue<signed short>::Get()); // NOLINT
- EXPECT_EQ(0, BuiltInDefaultValue<short>::Get()); // NOLINT
- EXPECT_EQ(0U, BuiltInDefaultValue<unsigned int>::Get());
- EXPECT_EQ(0, BuiltInDefaultValue<signed int>::Get());
- EXPECT_EQ(0, BuiltInDefaultValue<int>::Get());
- EXPECT_EQ(0U, BuiltInDefaultValue<unsigned long>::Get()); // NOLINT
- EXPECT_EQ(0, BuiltInDefaultValue<signed long>::Get()); // NOLINT
- EXPECT_EQ(0, BuiltInDefaultValue<long>::Get()); // NOLINT
- EXPECT_EQ(0U, BuiltInDefaultValue<UInt64>::Get());
- EXPECT_EQ(0, BuiltInDefaultValue<Int64>::Get());
- EXPECT_EQ(0, BuiltInDefaultValue<float>::Get());
- EXPECT_EQ(0, BuiltInDefaultValue<double>::Get());
-}
-
-// Tests that BuiltInDefaultValue<T>::Exists() returns true when T is a
-// built-in numeric type.
-TEST(BuiltInDefaultValueTest, ExistsForNumericTypes) {
- EXPECT_TRUE(BuiltInDefaultValue<unsigned char>::Exists());
- EXPECT_TRUE(BuiltInDefaultValue<signed char>::Exists());
- EXPECT_TRUE(BuiltInDefaultValue<char>::Exists());
-#if GMOCK_HAS_SIGNED_WCHAR_T_
- EXPECT_TRUE(BuiltInDefaultValue<unsigned wchar_t>::Exists());
- EXPECT_TRUE(BuiltInDefaultValue<signed wchar_t>::Exists());
-#endif
-#if GMOCK_WCHAR_T_IS_NATIVE_
- EXPECT_TRUE(BuiltInDefaultValue<wchar_t>::Exists());
-#endif
- EXPECT_TRUE(BuiltInDefaultValue<unsigned short>::Exists()); // NOLINT
- EXPECT_TRUE(BuiltInDefaultValue<signed short>::Exists()); // NOLINT
- EXPECT_TRUE(BuiltInDefaultValue<short>::Exists()); // NOLINT
- EXPECT_TRUE(BuiltInDefaultValue<unsigned int>::Exists());
- EXPECT_TRUE(BuiltInDefaultValue<signed int>::Exists());
- EXPECT_TRUE(BuiltInDefaultValue<int>::Exists());
- EXPECT_TRUE(BuiltInDefaultValue<unsigned long>::Exists()); // NOLINT
- EXPECT_TRUE(BuiltInDefaultValue<signed long>::Exists()); // NOLINT
- EXPECT_TRUE(BuiltInDefaultValue<long>::Exists()); // NOLINT
- EXPECT_TRUE(BuiltInDefaultValue<UInt64>::Exists());
- EXPECT_TRUE(BuiltInDefaultValue<Int64>::Exists());
- EXPECT_TRUE(BuiltInDefaultValue<float>::Exists());
- EXPECT_TRUE(BuiltInDefaultValue<double>::Exists());
-}
-
-// Tests that BuiltInDefaultValue<bool>::Get() returns false.
-TEST(BuiltInDefaultValueTest, IsFalseForBool) {
- EXPECT_FALSE(BuiltInDefaultValue<bool>::Get());
-}
-
-// Tests that BuiltInDefaultValue<bool>::Exists() returns true.
-TEST(BuiltInDefaultValueTest, BoolExists) {
- EXPECT_TRUE(BuiltInDefaultValue<bool>::Exists());
-}
-
-// Tests that BuiltInDefaultValue<T>::Get() returns "" when T is a
-// string type.
-TEST(BuiltInDefaultValueTest, IsEmptyStringForString) {
-#if GTEST_HAS_GLOBAL_STRING
- EXPECT_EQ("", BuiltInDefaultValue< ::string>::Get());
-#endif // GTEST_HAS_GLOBAL_STRING
-
- EXPECT_EQ("", BuiltInDefaultValue< ::std::string>::Get());
-}
-
-// Tests that BuiltInDefaultValue<T>::Exists() returns true when T is a
-// string type.
-TEST(BuiltInDefaultValueTest, ExistsForString) {
-#if GTEST_HAS_GLOBAL_STRING
- EXPECT_TRUE(BuiltInDefaultValue< ::string>::Exists());
-#endif // GTEST_HAS_GLOBAL_STRING
-
- EXPECT_TRUE(BuiltInDefaultValue< ::std::string>::Exists());
-}
-
-// Tests that BuiltInDefaultValue<const T>::Get() returns the same
-// value as BuiltInDefaultValue<T>::Get() does.
-TEST(BuiltInDefaultValueTest, WorksForConstTypes) {
- EXPECT_EQ("", BuiltInDefaultValue<const std::string>::Get());
- EXPECT_EQ(0, BuiltInDefaultValue<const int>::Get());
- EXPECT_TRUE(BuiltInDefaultValue<char* const>::Get() == NULL);
- EXPECT_FALSE(BuiltInDefaultValue<const bool>::Get());
-}
-
-// Tests that BuiltInDefaultValue<T>::Get() aborts the program with
-// the correct error message when T is a user-defined type.
-struct UserType {
- UserType() : value(0) {}
-
- int value;
-};
-
-TEST(BuiltInDefaultValueTest, UserTypeHasNoDefault) {
- EXPECT_FALSE(BuiltInDefaultValue<UserType>::Exists());
-}
-
-// Tests that BuiltInDefaultValue<T&>::Get() aborts the program.
-TEST(BuiltInDefaultValueDeathTest, IsUndefinedForReferences) {
- EXPECT_DEATH_IF_SUPPORTED({
- BuiltInDefaultValue<int&>::Get();
- }, "");
- EXPECT_DEATH_IF_SUPPORTED({
- BuiltInDefaultValue<const char&>::Get();
- }, "");
-}
-
-TEST(BuiltInDefaultValueDeathTest, IsUndefinedForUserTypes) {
- EXPECT_DEATH_IF_SUPPORTED({
- BuiltInDefaultValue<UserType>::Get();
- }, "");
-}
-
-// Tests that DefaultValue<T>::IsSet() is false initially.
-TEST(DefaultValueTest, IsInitiallyUnset) {
- EXPECT_FALSE(DefaultValue<int>::IsSet());
- EXPECT_FALSE(DefaultValue<const UserType>::IsSet());
-}
-
-// Tests that DefaultValue<T> can be set and then unset.
-TEST(DefaultValueTest, CanBeSetAndUnset) {
- EXPECT_TRUE(DefaultValue<int>::Exists());
- EXPECT_FALSE(DefaultValue<const UserType>::Exists());
-
- DefaultValue<int>::Set(1);
- DefaultValue<const UserType>::Set(UserType());
-
- EXPECT_EQ(1, DefaultValue<int>::Get());
- EXPECT_EQ(0, DefaultValue<const UserType>::Get().value);
-
- EXPECT_TRUE(DefaultValue<int>::Exists());
- EXPECT_TRUE(DefaultValue<const UserType>::Exists());
-
- DefaultValue<int>::Clear();
- DefaultValue<const UserType>::Clear();
-
- EXPECT_FALSE(DefaultValue<int>::IsSet());
- EXPECT_FALSE(DefaultValue<const UserType>::IsSet());
-
- EXPECT_TRUE(DefaultValue<int>::Exists());
- EXPECT_FALSE(DefaultValue<const UserType>::Exists());
-}
-
-// Tests that DefaultValue<T>::Get() returns the
-// BuiltInDefaultValue<T>::Get() when DefaultValue<T>::IsSet() is
-// false.
-TEST(DefaultValueDeathTest, GetReturnsBuiltInDefaultValueWhenUnset) {
- EXPECT_FALSE(DefaultValue<int>::IsSet());
- EXPECT_TRUE(DefaultValue<int>::Exists());
- EXPECT_FALSE(DefaultValue<UserType>::IsSet());
- EXPECT_FALSE(DefaultValue<UserType>::Exists());
-
- EXPECT_EQ(0, DefaultValue<int>::Get());
-
- EXPECT_DEATH_IF_SUPPORTED({
- DefaultValue<UserType>::Get();
- }, "");
-}
-
-// Tests that DefaultValue<void>::Get() returns void.
-TEST(DefaultValueTest, GetWorksForVoid) {
- return DefaultValue<void>::Get();
-}
-
-// Tests using DefaultValue with a reference type.
-
-// Tests that DefaultValue<T&>::IsSet() is false initially.
-TEST(DefaultValueOfReferenceTest, IsInitiallyUnset) {
- EXPECT_FALSE(DefaultValue<int&>::IsSet());
- EXPECT_FALSE(DefaultValue<UserType&>::IsSet());
-}
-
-// Tests that DefaultValue<T&>::Exists is false initiallly.
-TEST(DefaultValueOfReferenceTest, IsInitiallyNotExisting) {
- EXPECT_FALSE(DefaultValue<int&>::Exists());
- EXPECT_FALSE(DefaultValue<UserType&>::Exists());
-}
-
-// Tests that DefaultValue<T&> can be set and then unset.
-TEST(DefaultValueOfReferenceTest, CanBeSetAndUnset) {
- int n = 1;
- DefaultValue<const int&>::Set(n);
- UserType u;
- DefaultValue<UserType&>::Set(u);
-
- EXPECT_TRUE(DefaultValue<const int&>::Exists());
- EXPECT_TRUE(DefaultValue<UserType&>::Exists());
-
- EXPECT_EQ(&n, &(DefaultValue<const int&>::Get()));
- EXPECT_EQ(&u, &(DefaultValue<UserType&>::Get()));
-
- DefaultValue<const int&>::Clear();
- DefaultValue<UserType&>::Clear();
-
- EXPECT_FALSE(DefaultValue<const int&>::Exists());
- EXPECT_FALSE(DefaultValue<UserType&>::Exists());
-
- EXPECT_FALSE(DefaultValue<const int&>::IsSet());
- EXPECT_FALSE(DefaultValue<UserType&>::IsSet());
-}
-
-// Tests that DefaultValue<T&>::Get() returns the
-// BuiltInDefaultValue<T&>::Get() when DefaultValue<T&>::IsSet() is
-// false.
-TEST(DefaultValueOfReferenceDeathTest, GetReturnsBuiltInDefaultValueWhenUnset) {
- EXPECT_FALSE(DefaultValue<int&>::IsSet());
- EXPECT_FALSE(DefaultValue<UserType&>::IsSet());
-
- EXPECT_DEATH_IF_SUPPORTED({
- DefaultValue<int&>::Get();
- }, "");
- EXPECT_DEATH_IF_SUPPORTED({
- DefaultValue<UserType>::Get();
- }, "");
-}
-
-// Tests that ActionInterface can be implemented by defining the
-// Perform method.
-
-typedef int MyFunction(bool, int);
-
-class MyActionImpl : public ActionInterface<MyFunction> {
- public:
- virtual int Perform(const tuple<bool, int>& args) {
- return get<0>(args) ? get<1>(args) : 0;
- }
-};
-
-TEST(ActionInterfaceTest, CanBeImplementedByDefiningPerform) {
- MyActionImpl my_action_impl;
- (void)my_action_impl;
-}
-
-TEST(ActionInterfaceTest, MakeAction) {
- Action<MyFunction> action = MakeAction(new MyActionImpl);
-
- // When exercising the Perform() method of Action<F>, we must pass
- // it a tuple whose size and type are compatible with F's argument
- // types. For example, if F is int(), then Perform() takes a
- // 0-tuple; if F is void(bool, int), then Perform() takes a
- // tuple<bool, int>, and so on.
- EXPECT_EQ(5, action.Perform(make_tuple(true, 5)));
-}
-
-// Tests that Action<F> can be contructed from a pointer to
-// ActionInterface<F>.
-TEST(ActionTest, CanBeConstructedFromActionInterface) {
- Action<MyFunction> action(new MyActionImpl);
-}
-
-// Tests that Action<F> delegates actual work to ActionInterface<F>.
-TEST(ActionTest, DelegatesWorkToActionInterface) {
- const Action<MyFunction> action(new MyActionImpl);
-
- EXPECT_EQ(5, action.Perform(make_tuple(true, 5)));
- EXPECT_EQ(0, action.Perform(make_tuple(false, 1)));
-}
-
-// Tests that Action<F> can be copied.
-TEST(ActionTest, IsCopyable) {
- Action<MyFunction> a1(new MyActionImpl);
- Action<MyFunction> a2(a1); // Tests the copy constructor.
-
- // a1 should continue to work after being copied from.
- EXPECT_EQ(5, a1.Perform(make_tuple(true, 5)));
- EXPECT_EQ(0, a1.Perform(make_tuple(false, 1)));
-
- // a2 should work like the action it was copied from.
- EXPECT_EQ(5, a2.Perform(make_tuple(true, 5)));
- EXPECT_EQ(0, a2.Perform(make_tuple(false, 1)));
-
- a2 = a1; // Tests the assignment operator.
-
- // a1 should continue to work after being copied from.
- EXPECT_EQ(5, a1.Perform(make_tuple(true, 5)));
- EXPECT_EQ(0, a1.Perform(make_tuple(false, 1)));
-
- // a2 should work like the action it was copied from.
- EXPECT_EQ(5, a2.Perform(make_tuple(true, 5)));
- EXPECT_EQ(0, a2.Perform(make_tuple(false, 1)));
-}
-
-// Tests that an Action<From> object can be converted to a
-// compatible Action<To> object.
-
-class IsNotZero : public ActionInterface<bool(int)> { // NOLINT
- public:
- virtual bool Perform(const tuple<int>& arg) {
- return get<0>(arg) != 0;
- }
-};
-
-#if !GTEST_OS_SYMBIAN
-// Compiling this test on Nokia's Symbian compiler fails with:
-// 'Result' is not a member of class 'testing::internal::Function<int>'
-// (point of instantiation: '@unnamed@gmock_actions_test_cc@::
-// ActionTest_CanBeConvertedToOtherActionType_Test::TestBody()')
-// with no obvious fix.
-TEST(ActionTest, CanBeConvertedToOtherActionType) {
- const Action<bool(int)> a1(new IsNotZero); // NOLINT
- const Action<int(char)> a2 = Action<int(char)>(a1); // NOLINT
- EXPECT_EQ(1, a2.Perform(make_tuple('a')));
- EXPECT_EQ(0, a2.Perform(make_tuple('\0')));
-}
-#endif // !GTEST_OS_SYMBIAN
-
-// The following two classes are for testing MakePolymorphicAction().
-
-// Implements a polymorphic action that returns the second of the
-// arguments it receives.
-class ReturnSecondArgumentAction {
- public:
- // We want to verify that MakePolymorphicAction() can work with a
- // polymorphic action whose Perform() method template is either
- // const or not. This lets us verify the non-const case.
- template <typename Result, typename ArgumentTuple>
- Result Perform(const ArgumentTuple& args) { return get<1>(args); }
-};
-
-// Implements a polymorphic action that can be used in a nullary
-// function to return 0.
-class ReturnZeroFromNullaryFunctionAction {
- public:
- // For testing that MakePolymorphicAction() works when the
- // implementation class' Perform() method template takes only one
- // template parameter.
- //
- // We want to verify that MakePolymorphicAction() can work with a
- // polymorphic action whose Perform() method template is either
- // const or not. This lets us verify the const case.
- template <typename Result>
- Result Perform(const tuple<>&) const { return 0; }
-};
-
-// These functions verify that MakePolymorphicAction() returns a
-// PolymorphicAction<T> where T is the argument's type.
-
-PolymorphicAction<ReturnSecondArgumentAction> ReturnSecondArgument() {
- return MakePolymorphicAction(ReturnSecondArgumentAction());
-}
-
-PolymorphicAction<ReturnZeroFromNullaryFunctionAction>
-ReturnZeroFromNullaryFunction() {
- return MakePolymorphicAction(ReturnZeroFromNullaryFunctionAction());
-}
-
-// Tests that MakePolymorphicAction() turns a polymorphic action
-// implementation class into a polymorphic action.
-TEST(MakePolymorphicActionTest, ConstructsActionFromImpl) {
- Action<int(bool, int, double)> a1 = ReturnSecondArgument(); // NOLINT
- EXPECT_EQ(5, a1.Perform(make_tuple(false, 5, 2.0)));
-}
-
-// Tests that MakePolymorphicAction() works when the implementation
-// class' Perform() method template has only one template parameter.
-TEST(MakePolymorphicActionTest, WorksWhenPerformHasOneTemplateParameter) {
- Action<int()> a1 = ReturnZeroFromNullaryFunction();
- EXPECT_EQ(0, a1.Perform(make_tuple()));
-
- Action<void*()> a2 = ReturnZeroFromNullaryFunction();
- EXPECT_TRUE(a2.Perform(make_tuple()) == NULL);
-}
-
-// Tests that Return() works as an action for void-returning
-// functions.
-TEST(ReturnTest, WorksForVoid) {
- const Action<void(int)> ret = Return(); // NOLINT
- return ret.Perform(make_tuple(1));
-}
-
-// Tests that Return(v) returns v.
-TEST(ReturnTest, ReturnsGivenValue) {
- Action<int()> ret = Return(1); // NOLINT
- EXPECT_EQ(1, ret.Perform(make_tuple()));
-
- ret = Return(-5);
- EXPECT_EQ(-5, ret.Perform(make_tuple()));
-}
-
-// Tests that Return("string literal") works.
-TEST(ReturnTest, AcceptsStringLiteral) {
- Action<const char*()> a1 = Return("Hello");
- EXPECT_STREQ("Hello", a1.Perform(make_tuple()));
-
- Action<std::string()> a2 = Return("world");
- EXPECT_EQ("world", a2.Perform(make_tuple()));
-}
-
-// Tests that Return(v) is covaraint.
-
-struct Base {
- bool operator==(const Base&) { return true; }
-};
-
-struct Derived : public Base {
- bool operator==(const Derived&) { return true; }
-};
-
-TEST(ReturnTest, IsCovariant) {
- Base base;
- Derived derived;
- Action<Base*()> ret = Return(&base);
- EXPECT_EQ(&base, ret.Perform(make_tuple()));
-
- ret = Return(&derived);
- EXPECT_EQ(&derived, ret.Perform(make_tuple()));
-}
-
-// Tests that the type of the value passed into Return is converted into T
-// when the action is cast to Action<T(...)> rather than when the action is
-// performed. See comments on testing::internal::ReturnAction in
-// gmock-actions.h for more information.
-class FromType {
- public:
- explicit FromType(bool* is_converted) : converted_(is_converted) {}
- bool* converted() const { return converted_; }
-
- private:
- bool* const converted_;
-
- GTEST_DISALLOW_ASSIGN_(FromType);
-};
-
-class ToType {
- public:
- // Must allow implicit conversion due to use in ImplicitCast_<T>.
- ToType(const FromType& x) { *x.converted() = true; } // NOLINT
-};
-
-TEST(ReturnTest, ConvertsArgumentWhenConverted) {
- bool converted = false;
- FromType x(&converted);
- Action<ToType()> action(Return(x));
- EXPECT_TRUE(converted) << "Return must convert its argument in its own "
- << "conversion operator.";
- converted = false;
- action.Perform(tuple<>());
- EXPECT_FALSE(converted) << "Action must NOT convert its argument "
- << "when performed.";
-}
-
-class DestinationType {};
-
-class SourceType {
- public:
- // Note: a non-const typecast operator.
- operator DestinationType() { return DestinationType(); }
-};
-
-TEST(ReturnTest, CanConvertArgumentUsingNonConstTypeCastOperator) {
- SourceType s;
- Action<DestinationType()> action(Return(s));
-}
-
-// Tests that ReturnNull() returns NULL in a pointer-returning function.
-TEST(ReturnNullTest, WorksInPointerReturningFunction) {
- const Action<int*()> a1 = ReturnNull();
- EXPECT_TRUE(a1.Perform(make_tuple()) == NULL);
-
- const Action<const char*(bool)> a2 = ReturnNull(); // NOLINT
- EXPECT_TRUE(a2.Perform(make_tuple(true)) == NULL);
-}
-
-// Tests that ReturnRef(v) works for reference types.
-TEST(ReturnRefTest, WorksForReference) {
- const int n = 0;
- const Action<const int&(bool)> ret = ReturnRef(n); // NOLINT
-
- EXPECT_EQ(&n, &ret.Perform(make_tuple(true)));
-}
-
-// Tests that ReturnRef(v) is covariant.
-TEST(ReturnRefTest, IsCovariant) {
- Base base;
- Derived derived;
- Action<Base&()> a = ReturnRef(base);
- EXPECT_EQ(&base, &a.Perform(make_tuple()));
-
- a = ReturnRef(derived);
- EXPECT_EQ(&derived, &a.Perform(make_tuple()));
-}
-
-// Tests that ReturnRefOfCopy(v) works for reference types.
-TEST(ReturnRefOfCopyTest, WorksForReference) {
- int n = 42;
- const Action<const int&()> ret = ReturnRefOfCopy(n);
-
- EXPECT_NE(&n, &ret.Perform(make_tuple()));
- EXPECT_EQ(42, ret.Perform(make_tuple()));
-
- n = 43;
- EXPECT_NE(&n, &ret.Perform(make_tuple()));
- EXPECT_EQ(42, ret.Perform(make_tuple()));
-}
-
-// Tests that ReturnRefOfCopy(v) is covariant.
-TEST(ReturnRefOfCopyTest, IsCovariant) {
- Base base;
- Derived derived;
- Action<Base&()> a = ReturnRefOfCopy(base);
- EXPECT_NE(&base, &a.Perform(make_tuple()));
-
- a = ReturnRefOfCopy(derived);
- EXPECT_NE(&derived, &a.Perform(make_tuple()));
-}
-
-// Tests that DoDefault() does the default action for the mock method.
-
-class MyClass {};
-
-class MockClass {
- public:
- MockClass() {}
-
- MOCK_METHOD1(IntFunc, int(bool flag)); // NOLINT
- MOCK_METHOD0(Foo, MyClass());
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(MockClass);
-};
-
-// Tests that DoDefault() returns the built-in default value for the
-// return type by default.
-TEST(DoDefaultTest, ReturnsBuiltInDefaultValueByDefault) {
- MockClass mock;
- EXPECT_CALL(mock, IntFunc(_))
- .WillOnce(DoDefault());
- EXPECT_EQ(0, mock.IntFunc(true));
-}
-
-// Tests that DoDefault() aborts the process when there is no built-in
-// default value for the return type.
-TEST(DoDefaultDeathTest, DiesForUnknowType) {
- MockClass mock;
- EXPECT_CALL(mock, Foo())
- .WillRepeatedly(DoDefault());
- EXPECT_DEATH_IF_SUPPORTED({
- mock.Foo();
- }, "");
-}
-
-// Tests that using DoDefault() inside a composite action leads to a
-// run-time error.
-
-void VoidFunc(bool /* flag */) {}
-
-TEST(DoDefaultDeathTest, DiesIfUsedInCompositeAction) {
- MockClass mock;
- EXPECT_CALL(mock, IntFunc(_))
- .WillRepeatedly(DoAll(Invoke(VoidFunc),
- DoDefault()));
-
- // Ideally we should verify the error message as well. Sadly,
- // EXPECT_DEATH() can only capture stderr, while Google Mock's
- // errors are printed on stdout. Therefore we have to settle for
- // not verifying the message.
- EXPECT_DEATH_IF_SUPPORTED({
- mock.IntFunc(true);
- }, "");
-}
-
-// Tests that DoDefault() returns the default value set by
-// DefaultValue<T>::Set() when it's not overriden by an ON_CALL().
-TEST(DoDefaultTest, ReturnsUserSpecifiedPerTypeDefaultValueWhenThereIsOne) {
- DefaultValue<int>::Set(1);
- MockClass mock;
- EXPECT_CALL(mock, IntFunc(_))
- .WillOnce(DoDefault());
- EXPECT_EQ(1, mock.IntFunc(false));
- DefaultValue<int>::Clear();
-}
-
-// Tests that DoDefault() does the action specified by ON_CALL().
-TEST(DoDefaultTest, DoesWhatOnCallSpecifies) {
- MockClass mock;
- ON_CALL(mock, IntFunc(_))
- .WillByDefault(Return(2));
- EXPECT_CALL(mock, IntFunc(_))
- .WillOnce(DoDefault());
- EXPECT_EQ(2, mock.IntFunc(false));
-}
-
-// Tests that using DoDefault() in ON_CALL() leads to a run-time failure.
-TEST(DoDefaultTest, CannotBeUsedInOnCall) {
- MockClass mock;
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- ON_CALL(mock, IntFunc(_))
- .WillByDefault(DoDefault());
- }, "DoDefault() cannot be used in ON_CALL()");
-}
-
-// Tests that SetArgPointee<N>(v) sets the variable pointed to by
-// the N-th (0-based) argument to v.
-TEST(SetArgPointeeTest, SetsTheNthPointee) {
- typedef void MyFunction(bool, int*, char*);
- Action<MyFunction> a = SetArgPointee<1>(2);
-
- int n = 0;
- char ch = '\0';
- a.Perform(make_tuple(true, &n, &ch));
- EXPECT_EQ(2, n);
- EXPECT_EQ('\0', ch);
-
- a = SetArgPointee<2>('a');
- n = 0;
- ch = '\0';
- a.Perform(make_tuple(true, &n, &ch));
- EXPECT_EQ(0, n);
- EXPECT_EQ('a', ch);
-}
-
-#if !((GTEST_GCC_VER_ && GTEST_GCC_VER_ < 40000) || GTEST_OS_SYMBIAN)
-// Tests that SetArgPointee<N>() accepts a string literal.
-// GCC prior to v4.0 and the Symbian compiler do not support this.
-TEST(SetArgPointeeTest, AcceptsStringLiteral) {
- typedef void MyFunction(std::string*, const char**);
- Action<MyFunction> a = SetArgPointee<0>("hi");
- std::string str;
- const char* ptr = NULL;
- a.Perform(make_tuple(&str, &ptr));
- EXPECT_EQ("hi", str);
- EXPECT_TRUE(ptr == NULL);
-
- a = SetArgPointee<1>("world");
- str = "";
- a.Perform(make_tuple(&str, &ptr));
- EXPECT_EQ("", str);
- EXPECT_STREQ("world", ptr);
-}
-
-TEST(SetArgPointeeTest, AcceptsWideStringLiteral) {
- typedef void MyFunction(const wchar_t**);
- Action<MyFunction> a = SetArgPointee<0>(L"world");
- const wchar_t* ptr = NULL;
- a.Perform(make_tuple(&ptr));
- EXPECT_STREQ(L"world", ptr);
-
-# if GTEST_HAS_STD_WSTRING
-
- typedef void MyStringFunction(std::wstring*);
- Action<MyStringFunction> a2 = SetArgPointee<0>(L"world");
- std::wstring str = L"";
- a2.Perform(make_tuple(&str));
- EXPECT_EQ(L"world", str);
-
-# endif
-}
-#endif
-
-// Tests that SetArgPointee<N>() accepts a char pointer.
-TEST(SetArgPointeeTest, AcceptsCharPointer) {
- typedef void MyFunction(bool, std::string*, const char**);
- const char* const hi = "hi";
- Action<MyFunction> a = SetArgPointee<1>(hi);
- std::string str;
- const char* ptr = NULL;
- a.Perform(make_tuple(true, &str, &ptr));
- EXPECT_EQ("hi", str);
- EXPECT_TRUE(ptr == NULL);
-
- char world_array[] = "world";
- char* const world = world_array;
- a = SetArgPointee<2>(world);
- str = "";
- a.Perform(make_tuple(true, &str, &ptr));
- EXPECT_EQ("", str);
- EXPECT_EQ(world, ptr);
-}
-
-TEST(SetArgPointeeTest, AcceptsWideCharPointer) {
- typedef void MyFunction(bool, const wchar_t**);
- const wchar_t* const hi = L"hi";
- Action<MyFunction> a = SetArgPointee<1>(hi);
- const wchar_t* ptr = NULL;
- a.Perform(make_tuple(true, &ptr));
- EXPECT_EQ(hi, ptr);
-
-# if GTEST_HAS_STD_WSTRING
-
- typedef void MyStringFunction(bool, std::wstring*);
- wchar_t world_array[] = L"world";
- wchar_t* const world = world_array;
- Action<MyStringFunction> a2 = SetArgPointee<1>(world);
- std::wstring str;
- a2.Perform(make_tuple(true, &str));
- EXPECT_EQ(world_array, str);
-# endif
-}
-
-#if GTEST_HAS_PROTOBUF_
-
-// Tests that SetArgPointee<N>(proto_buffer) sets the v1 protobuf
-// variable pointed to by the N-th (0-based) argument to proto_buffer.
-TEST(SetArgPointeeTest, SetsTheNthPointeeOfProtoBufferType) {
- TestMessage* const msg = new TestMessage;
- msg->set_member("yes");
- TestMessage orig_msg;
- orig_msg.CopyFrom(*msg);
-
- Action<void(bool, TestMessage*)> a = SetArgPointee<1>(*msg);
- // SetArgPointee<N>(proto_buffer) makes a copy of proto_buffer
- // s.t. the action works even when the original proto_buffer has
- // died. We ensure this behavior by deleting msg before using the
- // action.
- delete msg;
-
- TestMessage dest;
- EXPECT_FALSE(orig_msg.Equals(dest));
- a.Perform(make_tuple(true, &dest));
- EXPECT_TRUE(orig_msg.Equals(dest));
-}
-
-// Tests that SetArgPointee<N>(proto_buffer) sets the
-// ::ProtocolMessage variable pointed to by the N-th (0-based)
-// argument to proto_buffer.
-TEST(SetArgPointeeTest, SetsTheNthPointeeOfProtoBufferBaseType) {
- TestMessage* const msg = new TestMessage;
- msg->set_member("yes");
- TestMessage orig_msg;
- orig_msg.CopyFrom(*msg);
-
- Action<void(bool, ::ProtocolMessage*)> a = SetArgPointee<1>(*msg);
- // SetArgPointee<N>(proto_buffer) makes a copy of proto_buffer
- // s.t. the action works even when the original proto_buffer has
- // died. We ensure this behavior by deleting msg before using the
- // action.
- delete msg;
-
- TestMessage dest;
- ::ProtocolMessage* const dest_base = &dest;
- EXPECT_FALSE(orig_msg.Equals(dest));
- a.Perform(make_tuple(true, dest_base));
- EXPECT_TRUE(orig_msg.Equals(dest));
-}
-
-// Tests that SetArgPointee<N>(proto2_buffer) sets the v2
-// protobuf variable pointed to by the N-th (0-based) argument to
-// proto2_buffer.
-TEST(SetArgPointeeTest, SetsTheNthPointeeOfProto2BufferType) {
- using testing::internal::FooMessage;
- FooMessage* const msg = new FooMessage;
- msg->set_int_field(2);
- msg->set_string_field("hi");
- FooMessage orig_msg;
- orig_msg.CopyFrom(*msg);
-
- Action<void(bool, FooMessage*)> a = SetArgPointee<1>(*msg);
- // SetArgPointee<N>(proto2_buffer) makes a copy of
- // proto2_buffer s.t. the action works even when the original
- // proto2_buffer has died. We ensure this behavior by deleting msg
- // before using the action.
- delete msg;
-
- FooMessage dest;
- dest.set_int_field(0);
- a.Perform(make_tuple(true, &dest));
- EXPECT_EQ(2, dest.int_field());
- EXPECT_EQ("hi", dest.string_field());
-}
-
-// Tests that SetArgPointee<N>(proto2_buffer) sets the
-// proto2::Message variable pointed to by the N-th (0-based) argument
-// to proto2_buffer.
-TEST(SetArgPointeeTest, SetsTheNthPointeeOfProto2BufferBaseType) {
- using testing::internal::FooMessage;
- FooMessage* const msg = new FooMessage;
- msg->set_int_field(2);
- msg->set_string_field("hi");
- FooMessage orig_msg;
- orig_msg.CopyFrom(*msg);
-
- Action<void(bool, ::proto2::Message*)> a = SetArgPointee<1>(*msg);
- // SetArgPointee<N>(proto2_buffer) makes a copy of
- // proto2_buffer s.t. the action works even when the original
- // proto2_buffer has died. We ensure this behavior by deleting msg
- // before using the action.
- delete msg;
-
- FooMessage dest;
- dest.set_int_field(0);
- ::proto2::Message* const dest_base = &dest;
- a.Perform(make_tuple(true, dest_base));
- EXPECT_EQ(2, dest.int_field());
- EXPECT_EQ("hi", dest.string_field());
-}
-
-#endif // GTEST_HAS_PROTOBUF_
-
-// Tests that SetArgumentPointee<N>(v) sets the variable pointed to by
-// the N-th (0-based) argument to v.
-TEST(SetArgumentPointeeTest, SetsTheNthPointee) {
- typedef void MyFunction(bool, int*, char*);
- Action<MyFunction> a = SetArgumentPointee<1>(2);
-
- int n = 0;
- char ch = '\0';
- a.Perform(make_tuple(true, &n, &ch));
- EXPECT_EQ(2, n);
- EXPECT_EQ('\0', ch);
-
- a = SetArgumentPointee<2>('a');
- n = 0;
- ch = '\0';
- a.Perform(make_tuple(true, &n, &ch));
- EXPECT_EQ(0, n);
- EXPECT_EQ('a', ch);
-}
-
-#if GTEST_HAS_PROTOBUF_
-
-// Tests that SetArgumentPointee<N>(proto_buffer) sets the v1 protobuf
-// variable pointed to by the N-th (0-based) argument to proto_buffer.
-TEST(SetArgumentPointeeTest, SetsTheNthPointeeOfProtoBufferType) {
- TestMessage* const msg = new TestMessage;
- msg->set_member("yes");
- TestMessage orig_msg;
- orig_msg.CopyFrom(*msg);
-
- Action<void(bool, TestMessage*)> a = SetArgumentPointee<1>(*msg);
- // SetArgumentPointee<N>(proto_buffer) makes a copy of proto_buffer
- // s.t. the action works even when the original proto_buffer has
- // died. We ensure this behavior by deleting msg before using the
- // action.
- delete msg;
-
- TestMessage dest;
- EXPECT_FALSE(orig_msg.Equals(dest));
- a.Perform(make_tuple(true, &dest));
- EXPECT_TRUE(orig_msg.Equals(dest));
-}
-
-// Tests that SetArgumentPointee<N>(proto_buffer) sets the
-// ::ProtocolMessage variable pointed to by the N-th (0-based)
-// argument to proto_buffer.
-TEST(SetArgumentPointeeTest, SetsTheNthPointeeOfProtoBufferBaseType) {
- TestMessage* const msg = new TestMessage;
- msg->set_member("yes");
- TestMessage orig_msg;
- orig_msg.CopyFrom(*msg);
-
- Action<void(bool, ::ProtocolMessage*)> a = SetArgumentPointee<1>(*msg);
- // SetArgumentPointee<N>(proto_buffer) makes a copy of proto_buffer
- // s.t. the action works even when the original proto_buffer has
- // died. We ensure this behavior by deleting msg before using the
- // action.
- delete msg;
-
- TestMessage dest;
- ::ProtocolMessage* const dest_base = &dest;
- EXPECT_FALSE(orig_msg.Equals(dest));
- a.Perform(make_tuple(true, dest_base));
- EXPECT_TRUE(orig_msg.Equals(dest));
-}
-
-// Tests that SetArgumentPointee<N>(proto2_buffer) sets the v2
-// protobuf variable pointed to by the N-th (0-based) argument to
-// proto2_buffer.
-TEST(SetArgumentPointeeTest, SetsTheNthPointeeOfProto2BufferType) {
- using testing::internal::FooMessage;
- FooMessage* const msg = new FooMessage;
- msg->set_int_field(2);
- msg->set_string_field("hi");
- FooMessage orig_msg;
- orig_msg.CopyFrom(*msg);
-
- Action<void(bool, FooMessage*)> a = SetArgumentPointee<1>(*msg);
- // SetArgumentPointee<N>(proto2_buffer) makes a copy of
- // proto2_buffer s.t. the action works even when the original
- // proto2_buffer has died. We ensure this behavior by deleting msg
- // before using the action.
- delete msg;
-
- FooMessage dest;
- dest.set_int_field(0);
- a.Perform(make_tuple(true, &dest));
- EXPECT_EQ(2, dest.int_field());
- EXPECT_EQ("hi", dest.string_field());
-}
-
-// Tests that SetArgumentPointee<N>(proto2_buffer) sets the
-// proto2::Message variable pointed to by the N-th (0-based) argument
-// to proto2_buffer.
-TEST(SetArgumentPointeeTest, SetsTheNthPointeeOfProto2BufferBaseType) {
- using testing::internal::FooMessage;
- FooMessage* const msg = new FooMessage;
- msg->set_int_field(2);
- msg->set_string_field("hi");
- FooMessage orig_msg;
- orig_msg.CopyFrom(*msg);
-
- Action<void(bool, ::proto2::Message*)> a = SetArgumentPointee<1>(*msg);
- // SetArgumentPointee<N>(proto2_buffer) makes a copy of
- // proto2_buffer s.t. the action works even when the original
- // proto2_buffer has died. We ensure this behavior by deleting msg
- // before using the action.
- delete msg;
-
- FooMessage dest;
- dest.set_int_field(0);
- ::proto2::Message* const dest_base = &dest;
- a.Perform(make_tuple(true, dest_base));
- EXPECT_EQ(2, dest.int_field());
- EXPECT_EQ("hi", dest.string_field());
-}
-
-#endif // GTEST_HAS_PROTOBUF_
-
-// Sample functions and functors for testing Invoke() and etc.
-int Nullary() { return 1; }
-
-class NullaryFunctor {
- public:
- int operator()() { return 2; }
-};
-
-bool g_done = false;
-void VoidNullary() { g_done = true; }
-
-class VoidNullaryFunctor {
- public:
- void operator()() { g_done = true; }
-};
-
-bool Unary(int x) { return x < 0; }
-
-const char* Plus1(const char* s) { return s + 1; }
-
-void VoidUnary(int /* n */) { g_done = true; }
-
-bool ByConstRef(const std::string& s) { return s == "Hi"; }
-
-const double g_double = 0;
-bool ReferencesGlobalDouble(const double& x) { return &x == &g_double; }
-
-std::string ByNonConstRef(std::string& s) { return s += "+"; } // NOLINT
-
-struct UnaryFunctor {
- int operator()(bool x) { return x ? 1 : -1; }
-};
-
-const char* Binary(const char* input, short n) { return input + n; } // NOLINT
-
-void VoidBinary(int, char) { g_done = true; }
-
-int Ternary(int x, char y, short z) { return x + y + z; } // NOLINT
-
-void VoidTernary(int, char, bool) { g_done = true; }
-
-int SumOf4(int a, int b, int c, int d) { return a + b + c + d; }
-
-void VoidFunctionWithFourArguments(char, int, float, double) { g_done = true; }
-
-int SumOf5(int a, int b, int c, int d, int e) { return a + b + c + d + e; }
-
-struct SumOf5Functor {
- int operator()(int a, int b, int c, int d, int e) {
- return a + b + c + d + e;
- }
-};
-
-int SumOf6(int a, int b, int c, int d, int e, int f) {
- return a + b + c + d + e + f;
-}
-
-struct SumOf6Functor {
- int operator()(int a, int b, int c, int d, int e, int f) {
- return a + b + c + d + e + f;
- }
-};
-
-class Foo {
- public:
- Foo() : value_(123) {}
-
- int Nullary() const { return value_; }
- short Unary(long x) { return static_cast<short>(value_ + x); } // NOLINT
- std::string Binary(const std::string& str, char c) const { return str + c; }
- int Ternary(int x, bool y, char z) { return value_ + x + y*z; }
- int SumOf4(int a, int b, int c, int d) const {
- return a + b + c + d + value_;
- }
- int SumOf5(int a, int b, int c, int d, int e) { return a + b + c + d + e; }
- int SumOf6(int a, int b, int c, int d, int e, int f) {
- return a + b + c + d + e + f;
- }
- private:
- int value_;
-};
-
-// Tests InvokeWithoutArgs(function).
-TEST(InvokeWithoutArgsTest, Function) {
- // As an action that takes one argument.
- Action<int(int)> a = InvokeWithoutArgs(Nullary); // NOLINT
- EXPECT_EQ(1, a.Perform(make_tuple(2)));
-
- // As an action that takes two arguments.
- Action<int(int, double)> a2 = InvokeWithoutArgs(Nullary); // NOLINT
- EXPECT_EQ(1, a2.Perform(make_tuple(2, 3.5)));
-
- // As an action that returns void.
- Action<void(int)> a3 = InvokeWithoutArgs(VoidNullary); // NOLINT
- g_done = false;
- a3.Perform(make_tuple(1));
- EXPECT_TRUE(g_done);
-}
-
-// Tests InvokeWithoutArgs(functor).
-TEST(InvokeWithoutArgsTest, Functor) {
- // As an action that takes no argument.
- Action<int()> a = InvokeWithoutArgs(NullaryFunctor()); // NOLINT
- EXPECT_EQ(2, a.Perform(make_tuple()));
-
- // As an action that takes three arguments.
- Action<int(int, double, char)> a2 = // NOLINT
- InvokeWithoutArgs(NullaryFunctor());
- EXPECT_EQ(2, a2.Perform(make_tuple(3, 3.5, 'a')));
-
- // As an action that returns void.
- Action<void()> a3 = InvokeWithoutArgs(VoidNullaryFunctor());
- g_done = false;
- a3.Perform(make_tuple());
- EXPECT_TRUE(g_done);
-}
-
-// Tests InvokeWithoutArgs(obj_ptr, method).
-TEST(InvokeWithoutArgsTest, Method) {
- Foo foo;
- Action<int(bool, char)> a = // NOLINT
- InvokeWithoutArgs(&foo, &Foo::Nullary);
- EXPECT_EQ(123, a.Perform(make_tuple(true, 'a')));
-}
-
-// Tests using IgnoreResult() on a polymorphic action.
-TEST(IgnoreResultTest, PolymorphicAction) {
- Action<void(int)> a = IgnoreResult(Return(5)); // NOLINT
- a.Perform(make_tuple(1));
-}
-
-// Tests using IgnoreResult() on a monomorphic action.
-
-int ReturnOne() {
- g_done = true;
- return 1;
-}
-
-TEST(IgnoreResultTest, MonomorphicAction) {
- g_done = false;
- Action<void()> a = IgnoreResult(Invoke(ReturnOne));
- a.Perform(make_tuple());
- EXPECT_TRUE(g_done);
-}
-
-// Tests using IgnoreResult() on an action that returns a class type.
-
-MyClass ReturnMyClass(double /* x */) {
- g_done = true;
- return MyClass();
-}
-
-TEST(IgnoreResultTest, ActionReturningClass) {
- g_done = false;
- Action<void(int)> a = IgnoreResult(Invoke(ReturnMyClass)); // NOLINT
- a.Perform(make_tuple(2));
- EXPECT_TRUE(g_done);
-}
-
-TEST(AssignTest, Int) {
- int x = 0;
- Action<void(int)> a = Assign(&x, 5);
- a.Perform(make_tuple(0));
- EXPECT_EQ(5, x);
-}
-
-TEST(AssignTest, String) {
- ::std::string x;
- Action<void(void)> a = Assign(&x, "Hello, world");
- a.Perform(make_tuple());
- EXPECT_EQ("Hello, world", x);
-}
-
-TEST(AssignTest, CompatibleTypes) {
- double x = 0;
- Action<void(int)> a = Assign(&x, 5);
- a.Perform(make_tuple(0));
- EXPECT_DOUBLE_EQ(5, x);
-}
-
-#if !GTEST_OS_WINDOWS_MOBILE
-
-class SetErrnoAndReturnTest : public testing::Test {
- protected:
- virtual void SetUp() { errno = 0; }
- virtual void TearDown() { errno = 0; }
-};
-
-TEST_F(SetErrnoAndReturnTest, Int) {
- Action<int(void)> a = SetErrnoAndReturn(ENOTTY, -5);
- EXPECT_EQ(-5, a.Perform(make_tuple()));
- EXPECT_EQ(ENOTTY, errno);
-}
-
-TEST_F(SetErrnoAndReturnTest, Ptr) {
- int x;
- Action<int*(void)> a = SetErrnoAndReturn(ENOTTY, &x);
- EXPECT_EQ(&x, a.Perform(make_tuple()));
- EXPECT_EQ(ENOTTY, errno);
-}
-
-TEST_F(SetErrnoAndReturnTest, CompatibleTypes) {
- Action<double()> a = SetErrnoAndReturn(EINVAL, 5);
- EXPECT_DOUBLE_EQ(5.0, a.Perform(make_tuple()));
- EXPECT_EQ(EINVAL, errno);
-}
-
-#endif // !GTEST_OS_WINDOWS_MOBILE
-
-// Tests ByRef().
-
-// Tests that ReferenceWrapper<T> is copyable.
-TEST(ByRefTest, IsCopyable) {
- const std::string s1 = "Hi";
- const std::string s2 = "Hello";
-
- ::testing::internal::ReferenceWrapper<const std::string> ref_wrapper =
- ByRef(s1);
- const std::string& r1 = ref_wrapper;
- EXPECT_EQ(&s1, &r1);
-
- // Assigns a new value to ref_wrapper.
- ref_wrapper = ByRef(s2);
- const std::string& r2 = ref_wrapper;
- EXPECT_EQ(&s2, &r2);
-
- ::testing::internal::ReferenceWrapper<const std::string> ref_wrapper1 =
- ByRef(s1);
- // Copies ref_wrapper1 to ref_wrapper.
- ref_wrapper = ref_wrapper1;
- const std::string& r3 = ref_wrapper;
- EXPECT_EQ(&s1, &r3);
-}
-
-// Tests using ByRef() on a const value.
-TEST(ByRefTest, ConstValue) {
- const int n = 0;
- // int& ref = ByRef(n); // This shouldn't compile - we have a
- // negative compilation test to catch it.
- const int& const_ref = ByRef(n);
- EXPECT_EQ(&n, &const_ref);
-}
-
-// Tests using ByRef() on a non-const value.
-TEST(ByRefTest, NonConstValue) {
- int n = 0;
-
- // ByRef(n) can be used as either an int&,
- int& ref = ByRef(n);
- EXPECT_EQ(&n, &ref);
-
- // or a const int&.
- const int& const_ref = ByRef(n);
- EXPECT_EQ(&n, &const_ref);
-}
-
-// Tests explicitly specifying the type when using ByRef().
-TEST(ByRefTest, ExplicitType) {
- int n = 0;
- const int& r1 = ByRef<const int>(n);
- EXPECT_EQ(&n, &r1);
-
- // ByRef<char>(n); // This shouldn't compile - we have a negative
- // compilation test to catch it.
-
- Derived d;
- Derived& r2 = ByRef<Derived>(d);
- EXPECT_EQ(&d, &r2);
-
- const Derived& r3 = ByRef<const Derived>(d);
- EXPECT_EQ(&d, &r3);
-
- Base& r4 = ByRef<Base>(d);
- EXPECT_EQ(&d, &r4);
-
- const Base& r5 = ByRef<const Base>(d);
- EXPECT_EQ(&d, &r5);
-
- // The following shouldn't compile - we have a negative compilation
- // test for it.
- //
- // Base b;
- // ByRef<Derived>(b);
-}
-
-// Tests that Google Mock prints expression ByRef(x) as a reference to x.
-TEST(ByRefTest, PrintsCorrectly) {
- int n = 42;
- ::std::stringstream expected, actual;
- testing::internal::UniversalPrinter<const int&>::Print(n, &expected);
- testing::internal::UniversalPrint(ByRef(n), &actual);
- EXPECT_EQ(expected.str(), actual.str());
-}
-
-} // Unnamed namespace
diff --git a/src/testing/test/gmock-cardinalities_test.cc b/src/testing/test/gmock-cardinalities_test.cc
deleted file mode 100644
index 64815e57..00000000
--- a/src/testing/test/gmock-cardinalities_test.cc
+++ /dev/null
@@ -1,428 +0,0 @@
-// Copyright 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-// Google Mock - a framework for writing C++ mock classes.
-//
-// This file tests the built-in cardinalities.
-
-#include "gmock/gmock.h"
-#include "gtest/gtest.h"
-#include "gtest/gtest-spi.h"
-
-namespace {
-
-using std::stringstream;
-using testing::AnyNumber;
-using testing::AtLeast;
-using testing::AtMost;
-using testing::Between;
-using testing::Cardinality;
-using testing::CardinalityInterface;
-using testing::Exactly;
-using testing::IsSubstring;
-using testing::MakeCardinality;
-
-class MockFoo {
- public:
- MockFoo() {}
- MOCK_METHOD0(Bar, int()); // NOLINT
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFoo);
-};
-
-// Tests that Cardinality objects can be default constructed.
-TEST(CardinalityTest, IsDefaultConstructable) {
- Cardinality c;
-}
-
-// Tests that Cardinality objects are copyable.
-TEST(CardinalityTest, IsCopyable) {
- // Tests the copy constructor.
- Cardinality c = Exactly(1);
- EXPECT_FALSE(c.IsSatisfiedByCallCount(0));
- EXPECT_TRUE(c.IsSatisfiedByCallCount(1));
- EXPECT_TRUE(c.IsSaturatedByCallCount(1));
-
- // Tests the assignment operator.
- c = Exactly(2);
- EXPECT_FALSE(c.IsSatisfiedByCallCount(1));
- EXPECT_TRUE(c.IsSatisfiedByCallCount(2));
- EXPECT_TRUE(c.IsSaturatedByCallCount(2));
-}
-
-TEST(CardinalityTest, IsOverSaturatedByCallCountWorks) {
- const Cardinality c = AtMost(5);
- EXPECT_FALSE(c.IsOverSaturatedByCallCount(4));
- EXPECT_FALSE(c.IsOverSaturatedByCallCount(5));
- EXPECT_TRUE(c.IsOverSaturatedByCallCount(6));
-}
-
-// Tests that Cardinality::DescribeActualCallCountTo() creates the
-// correct description.
-TEST(CardinalityTest, CanDescribeActualCallCount) {
- stringstream ss0;
- Cardinality::DescribeActualCallCountTo(0, &ss0);
- EXPECT_EQ("never called", ss0.str());
-
- stringstream ss1;
- Cardinality::DescribeActualCallCountTo(1, &ss1);
- EXPECT_EQ("called once", ss1.str());
-
- stringstream ss2;
- Cardinality::DescribeActualCallCountTo(2, &ss2);
- EXPECT_EQ("called twice", ss2.str());
-
- stringstream ss3;
- Cardinality::DescribeActualCallCountTo(3, &ss3);
- EXPECT_EQ("called 3 times", ss3.str());
-}
-
-// Tests AnyNumber()
-TEST(AnyNumber, Works) {
- const Cardinality c = AnyNumber();
- EXPECT_TRUE(c.IsSatisfiedByCallCount(0));
- EXPECT_FALSE(c.IsSaturatedByCallCount(0));
-
- EXPECT_TRUE(c.IsSatisfiedByCallCount(1));
- EXPECT_FALSE(c.IsSaturatedByCallCount(1));
-
- EXPECT_TRUE(c.IsSatisfiedByCallCount(9));
- EXPECT_FALSE(c.IsSaturatedByCallCount(9));
-
- stringstream ss;
- c.DescribeTo(&ss);
- EXPECT_PRED_FORMAT2(IsSubstring, "called any number of times",
- ss.str());
-}
-
-TEST(AnyNumberTest, HasCorrectBounds) {
- const Cardinality c = AnyNumber();
- EXPECT_EQ(0, c.ConservativeLowerBound());
- EXPECT_EQ(INT_MAX, c.ConservativeUpperBound());
-}
-
-// Tests AtLeast(n).
-
-TEST(AtLeastTest, OnNegativeNumber) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- AtLeast(-1);
- }, "The invocation lower bound must be >= 0");
-}
-
-TEST(AtLeastTest, OnZero) {
- const Cardinality c = AtLeast(0);
- EXPECT_TRUE(c.IsSatisfiedByCallCount(0));
- EXPECT_FALSE(c.IsSaturatedByCallCount(0));
-
- EXPECT_TRUE(c.IsSatisfiedByCallCount(1));
- EXPECT_FALSE(c.IsSaturatedByCallCount(1));
-
- stringstream ss;
- c.DescribeTo(&ss);
- EXPECT_PRED_FORMAT2(IsSubstring, "any number of times",
- ss.str());
-}
-
-TEST(AtLeastTest, OnPositiveNumber) {
- const Cardinality c = AtLeast(2);
- EXPECT_FALSE(c.IsSatisfiedByCallCount(0));
- EXPECT_FALSE(c.IsSaturatedByCallCount(0));
-
- EXPECT_FALSE(c.IsSatisfiedByCallCount(1));
- EXPECT_FALSE(c.IsSaturatedByCallCount(1));
-
- EXPECT_TRUE(c.IsSatisfiedByCallCount(2));
- EXPECT_FALSE(c.IsSaturatedByCallCount(2));
-
- stringstream ss1;
- AtLeast(1).DescribeTo(&ss1);
- EXPECT_PRED_FORMAT2(IsSubstring, "at least once",
- ss1.str());
-
- stringstream ss2;
- c.DescribeTo(&ss2);
- EXPECT_PRED_FORMAT2(IsSubstring, "at least twice",
- ss2.str());
-
- stringstream ss3;
- AtLeast(3).DescribeTo(&ss3);
- EXPECT_PRED_FORMAT2(IsSubstring, "at least 3 times",
- ss3.str());
-}
-
-TEST(AtLeastTest, HasCorrectBounds) {
- const Cardinality c = AtLeast(2);
- EXPECT_EQ(2, c.ConservativeLowerBound());
- EXPECT_EQ(INT_MAX, c.ConservativeUpperBound());
-}
-
-// Tests AtMost(n).
-
-TEST(AtMostTest, OnNegativeNumber) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- AtMost(-1);
- }, "The invocation upper bound must be >= 0");
-}
-
-TEST(AtMostTest, OnZero) {
- const Cardinality c = AtMost(0);
- EXPECT_TRUE(c.IsSatisfiedByCallCount(0));
- EXPECT_TRUE(c.IsSaturatedByCallCount(0));
-
- EXPECT_FALSE(c.IsSatisfiedByCallCount(1));
- EXPECT_TRUE(c.IsSaturatedByCallCount(1));
-
- stringstream ss;
- c.DescribeTo(&ss);
- EXPECT_PRED_FORMAT2(IsSubstring, "never called",
- ss.str());
-}
-
-TEST(AtMostTest, OnPositiveNumber) {
- const Cardinality c = AtMost(2);
- EXPECT_TRUE(c.IsSatisfiedByCallCount(0));
- EXPECT_FALSE(c.IsSaturatedByCallCount(0));
-
- EXPECT_TRUE(c.IsSatisfiedByCallCount(1));
- EXPECT_FALSE(c.IsSaturatedByCallCount(1));
-
- EXPECT_TRUE(c.IsSatisfiedByCallCount(2));
- EXPECT_TRUE(c.IsSaturatedByCallCount(2));
-
- stringstream ss1;
- AtMost(1).DescribeTo(&ss1);
- EXPECT_PRED_FORMAT2(IsSubstring, "called at most once",
- ss1.str());
-
- stringstream ss2;
- c.DescribeTo(&ss2);
- EXPECT_PRED_FORMAT2(IsSubstring, "called at most twice",
- ss2.str());
-
- stringstream ss3;
- AtMost(3).DescribeTo(&ss3);
- EXPECT_PRED_FORMAT2(IsSubstring, "called at most 3 times",
- ss3.str());
-}
-
-TEST(AtMostTest, HasCorrectBounds) {
- const Cardinality c = AtMost(2);
- EXPECT_EQ(0, c.ConservativeLowerBound());
- EXPECT_EQ(2, c.ConservativeUpperBound());
-}
-
-// Tests Between(m, n).
-
-TEST(BetweenTest, OnNegativeStart) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- Between(-1, 2);
- }, "The invocation lower bound must be >= 0, but is actually -1");
-}
-
-TEST(BetweenTest, OnNegativeEnd) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- Between(1, -2);
- }, "The invocation upper bound must be >= 0, but is actually -2");
-}
-
-TEST(BetweenTest, OnStartBiggerThanEnd) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- Between(2, 1);
- }, "The invocation upper bound (1) must be >= "
- "the invocation lower bound (2)");
-}
-
-TEST(BetweenTest, OnZeroStartAndZeroEnd) {
- const Cardinality c = Between(0, 0);
-
- EXPECT_TRUE(c.IsSatisfiedByCallCount(0));
- EXPECT_TRUE(c.IsSaturatedByCallCount(0));
-
- EXPECT_FALSE(c.IsSatisfiedByCallCount(1));
- EXPECT_TRUE(c.IsSaturatedByCallCount(1));
-
- stringstream ss;
- c.DescribeTo(&ss);
- EXPECT_PRED_FORMAT2(IsSubstring, "never called",
- ss.str());
-}
-
-TEST(BetweenTest, OnZeroStartAndNonZeroEnd) {
- const Cardinality c = Between(0, 2);
-
- EXPECT_TRUE(c.IsSatisfiedByCallCount(0));
- EXPECT_FALSE(c.IsSaturatedByCallCount(0));
-
- EXPECT_TRUE(c.IsSatisfiedByCallCount(2));
- EXPECT_TRUE(c.IsSaturatedByCallCount(2));
-
- EXPECT_FALSE(c.IsSatisfiedByCallCount(4));
- EXPECT_TRUE(c.IsSaturatedByCallCount(4));
-
- stringstream ss;
- c.DescribeTo(&ss);
- EXPECT_PRED_FORMAT2(IsSubstring, "called at most twice",
- ss.str());
-}
-
-TEST(BetweenTest, OnSameStartAndEnd) {
- const Cardinality c = Between(3, 3);
-
- EXPECT_FALSE(c.IsSatisfiedByCallCount(2));
- EXPECT_FALSE(c.IsSaturatedByCallCount(2));
-
- EXPECT_TRUE(c.IsSatisfiedByCallCount(3));
- EXPECT_TRUE(c.IsSaturatedByCallCount(3));
-
- EXPECT_FALSE(c.IsSatisfiedByCallCount(4));
- EXPECT_TRUE(c.IsSaturatedByCallCount(4));
-
- stringstream ss;
- c.DescribeTo(&ss);
- EXPECT_PRED_FORMAT2(IsSubstring, "called 3 times",
- ss.str());
-}
-
-TEST(BetweenTest, OnDifferentStartAndEnd) {
- const Cardinality c = Between(3, 5);
-
- EXPECT_FALSE(c.IsSatisfiedByCallCount(2));
- EXPECT_FALSE(c.IsSaturatedByCallCount(2));
-
- EXPECT_TRUE(c.IsSatisfiedByCallCount(3));
- EXPECT_FALSE(c.IsSaturatedByCallCount(3));
-
- EXPECT_TRUE(c.IsSatisfiedByCallCount(5));
- EXPECT_TRUE(c.IsSaturatedByCallCount(5));
-
- EXPECT_FALSE(c.IsSatisfiedByCallCount(6));
- EXPECT_TRUE(c.IsSaturatedByCallCount(6));
-
- stringstream ss;
- c.DescribeTo(&ss);
- EXPECT_PRED_FORMAT2(IsSubstring, "called between 3 and 5 times",
- ss.str());
-}
-
-TEST(BetweenTest, HasCorrectBounds) {
- const Cardinality c = Between(3, 5);
- EXPECT_EQ(3, c.ConservativeLowerBound());
- EXPECT_EQ(5, c.ConservativeUpperBound());
-}
-
-// Tests Exactly(n).
-
-TEST(ExactlyTest, OnNegativeNumber) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- Exactly(-1);
- }, "The invocation lower bound must be >= 0");
-}
-
-TEST(ExactlyTest, OnZero) {
- const Cardinality c = Exactly(0);
- EXPECT_TRUE(c.IsSatisfiedByCallCount(0));
- EXPECT_TRUE(c.IsSaturatedByCallCount(0));
-
- EXPECT_FALSE(c.IsSatisfiedByCallCount(1));
- EXPECT_TRUE(c.IsSaturatedByCallCount(1));
-
- stringstream ss;
- c.DescribeTo(&ss);
- EXPECT_PRED_FORMAT2(IsSubstring, "never called",
- ss.str());
-}
-
-TEST(ExactlyTest, OnPositiveNumber) {
- const Cardinality c = Exactly(2);
- EXPECT_FALSE(c.IsSatisfiedByCallCount(0));
- EXPECT_FALSE(c.IsSaturatedByCallCount(0));
-
- EXPECT_TRUE(c.IsSatisfiedByCallCount(2));
- EXPECT_TRUE(c.IsSaturatedByCallCount(2));
-
- stringstream ss1;
- Exactly(1).DescribeTo(&ss1);
- EXPECT_PRED_FORMAT2(IsSubstring, "called once",
- ss1.str());
-
- stringstream ss2;
- c.DescribeTo(&ss2);
- EXPECT_PRED_FORMAT2(IsSubstring, "called twice",
- ss2.str());
-
- stringstream ss3;
- Exactly(3).DescribeTo(&ss3);
- EXPECT_PRED_FORMAT2(IsSubstring, "called 3 times",
- ss3.str());
-}
-
-TEST(ExactlyTest, HasCorrectBounds) {
- const Cardinality c = Exactly(3);
- EXPECT_EQ(3, c.ConservativeLowerBound());
- EXPECT_EQ(3, c.ConservativeUpperBound());
-}
-
-// Tests that a user can make his own cardinality by implementing
-// CardinalityInterface and calling MakeCardinality().
-
-class EvenCardinality : public CardinalityInterface {
- public:
- // Returns true iff call_count calls will satisfy this cardinality.
- virtual bool IsSatisfiedByCallCount(int call_count) const {
- return (call_count % 2 == 0);
- }
-
- // Returns true iff call_count calls will saturate this cardinality.
- virtual bool IsSaturatedByCallCount(int /* call_count */) const {
- return false;
- }
-
- // Describes self to an ostream.
- virtual void DescribeTo(::std::ostream* ss) const {
- *ss << "called even number of times";
- }
-};
-
-TEST(MakeCardinalityTest, ConstructsCardinalityFromInterface) {
- const Cardinality c = MakeCardinality(new EvenCardinality);
-
- EXPECT_TRUE(c.IsSatisfiedByCallCount(2));
- EXPECT_FALSE(c.IsSatisfiedByCallCount(3));
-
- EXPECT_FALSE(c.IsSaturatedByCallCount(10000));
-
- stringstream ss;
- c.DescribeTo(&ss);
- EXPECT_EQ("called even number of times", ss.str());
-}
-
-} // Unnamed namespace
diff --git a/src/testing/test/gmock-generated-actions_test.cc b/src/testing/test/gmock-generated-actions_test.cc
deleted file mode 100644
index 436f1a2e..00000000
--- a/src/testing/test/gmock-generated-actions_test.cc
+++ /dev/null
@@ -1,1212 +0,0 @@
-// Copyright 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-// Google Mock - a framework for writing C++ mock classes.
-//
-// This file tests the built-in actions generated by a script.
-
-#include "gmock/gmock-generated-actions.h"
-
-#include <functional>
-#include <sstream>
-#include <string>
-#include "gmock/gmock.h"
-#include "gtest/gtest.h"
-
-namespace testing {
-namespace gmock_generated_actions_test {
-
-using ::std::plus;
-using ::std::string;
-using ::std::tr1::get;
-using ::std::tr1::make_tuple;
-using ::std::tr1::tuple;
-using ::std::tr1::tuple_element;
-using testing::_;
-using testing::Action;
-using testing::ActionInterface;
-using testing::ByRef;
-using testing::DoAll;
-using testing::Invoke;
-using testing::Return;
-using testing::ReturnNew;
-using testing::SetArgPointee;
-using testing::StaticAssertTypeEq;
-using testing::Unused;
-using testing::WithArgs;
-
-// For suppressing compiler warnings on conversion possibly losing precision.
-inline short Short(short n) { return n; } // NOLINT
-inline char Char(char ch) { return ch; }
-
-// Sample functions and functors for testing various actions.
-int Nullary() { return 1; }
-
-class NullaryFunctor {
- public:
- int operator()() { return 2; }
-};
-
-bool g_done = false;
-
-bool Unary(int x) { return x < 0; }
-
-const char* Plus1(const char* s) { return s + 1; }
-
-bool ByConstRef(const string& s) { return s == "Hi"; }
-
-const double g_double = 0;
-bool ReferencesGlobalDouble(const double& x) { return &x == &g_double; }
-
-string ByNonConstRef(string& s) { return s += "+"; } // NOLINT
-
-struct UnaryFunctor {
- int operator()(bool x) { return x ? 1 : -1; }
-};
-
-const char* Binary(const char* input, short n) { return input + n; } // NOLINT
-
-void VoidBinary(int, char) { g_done = true; }
-
-int Ternary(int x, char y, short z) { return x + y + z; } // NOLINT
-
-void VoidTernary(int, char, bool) { g_done = true; }
-
-int SumOf4(int a, int b, int c, int d) { return a + b + c + d; }
-
-string Concat4(const char* s1, const char* s2, const char* s3,
- const char* s4) {
- return string(s1) + s2 + s3 + s4;
-}
-
-int SumOf5(int a, int b, int c, int d, int e) { return a + b + c + d + e; }
-
-struct SumOf5Functor {
- int operator()(int a, int b, int c, int d, int e) {
- return a + b + c + d + e;
- }
-};
-
-string Concat5(const char* s1, const char* s2, const char* s3,
- const char* s4, const char* s5) {
- return string(s1) + s2 + s3 + s4 + s5;
-}
-
-int SumOf6(int a, int b, int c, int d, int e, int f) {
- return a + b + c + d + e + f;
-}
-
-struct SumOf6Functor {
- int operator()(int a, int b, int c, int d, int e, int f) {
- return a + b + c + d + e + f;
- }
-};
-
-string Concat6(const char* s1, const char* s2, const char* s3,
- const char* s4, const char* s5, const char* s6) {
- return string(s1) + s2 + s3 + s4 + s5 + s6;
-}
-
-string Concat7(const char* s1, const char* s2, const char* s3,
- const char* s4, const char* s5, const char* s6,
- const char* s7) {
- return string(s1) + s2 + s3 + s4 + s5 + s6 + s7;
-}
-
-string Concat8(const char* s1, const char* s2, const char* s3,
- const char* s4, const char* s5, const char* s6,
- const char* s7, const char* s8) {
- return string(s1) + s2 + s3 + s4 + s5 + s6 + s7 + s8;
-}
-
-string Concat9(const char* s1, const char* s2, const char* s3,
- const char* s4, const char* s5, const char* s6,
- const char* s7, const char* s8, const char* s9) {
- return string(s1) + s2 + s3 + s4 + s5 + s6 + s7 + s8 + s9;
-}
-
-string Concat10(const char* s1, const char* s2, const char* s3,
- const char* s4, const char* s5, const char* s6,
- const char* s7, const char* s8, const char* s9,
- const char* s10) {
- return string(s1) + s2 + s3 + s4 + s5 + s6 + s7 + s8 + s9 + s10;
-}
-
-// A helper that turns the type of a C-string literal from const
-// char[N] to const char*.
-inline const char* CharPtr(const char* s) { return s; }
-
-// Tests InvokeArgument<N>(...).
-
-// Tests using InvokeArgument with a nullary function.
-TEST(InvokeArgumentTest, Function0) {
- Action<int(int, int(*)())> a = InvokeArgument<1>(); // NOLINT
- EXPECT_EQ(1, a.Perform(make_tuple(2, &Nullary)));
-}
-
-// Tests using InvokeArgument with a unary function.
-TEST(InvokeArgumentTest, Functor1) {
- Action<int(UnaryFunctor)> a = InvokeArgument<0>(true); // NOLINT
- EXPECT_EQ(1, a.Perform(make_tuple(UnaryFunctor())));
-}
-
-// Tests using InvokeArgument with a 5-ary function.
-TEST(InvokeArgumentTest, Function5) {
- Action<int(int(*)(int, int, int, int, int))> a = // NOLINT
- InvokeArgument<0>(10000, 2000, 300, 40, 5);
- EXPECT_EQ(12345, a.Perform(make_tuple(&SumOf5)));
-}
-
-// Tests using InvokeArgument with a 5-ary functor.
-TEST(InvokeArgumentTest, Functor5) {
- Action<int(SumOf5Functor)> a = // NOLINT
- InvokeArgument<0>(10000, 2000, 300, 40, 5);
- EXPECT_EQ(12345, a.Perform(make_tuple(SumOf5Functor())));
-}
-
-// Tests using InvokeArgument with a 6-ary function.
-TEST(InvokeArgumentTest, Function6) {
- Action<int(int(*)(int, int, int, int, int, int))> a = // NOLINT
- InvokeArgument<0>(100000, 20000, 3000, 400, 50, 6);
- EXPECT_EQ(123456, a.Perform(make_tuple(&SumOf6)));
-}
-
-// Tests using InvokeArgument with a 6-ary functor.
-TEST(InvokeArgumentTest, Functor6) {
- Action<int(SumOf6Functor)> a = // NOLINT
- InvokeArgument<0>(100000, 20000, 3000, 400, 50, 6);
- EXPECT_EQ(123456, a.Perform(make_tuple(SumOf6Functor())));
-}
-
-// Tests using InvokeArgument with a 7-ary function.
-TEST(InvokeArgumentTest, Function7) {
- Action<string(string(*)(const char*, const char*, const char*,
- const char*, const char*, const char*,
- const char*))> a =
- InvokeArgument<0>("1", "2", "3", "4", "5", "6", "7");
- EXPECT_EQ("1234567", a.Perform(make_tuple(&Concat7)));
-}
-
-// Tests using InvokeArgument with a 8-ary function.
-TEST(InvokeArgumentTest, Function8) {
- Action<string(string(*)(const char*, const char*, const char*,
- const char*, const char*, const char*,
- const char*, const char*))> a =
- InvokeArgument<0>("1", "2", "3", "4", "5", "6", "7", "8");
- EXPECT_EQ("12345678", a.Perform(make_tuple(&Concat8)));
-}
-
-// Tests using InvokeArgument with a 9-ary function.
-TEST(InvokeArgumentTest, Function9) {
- Action<string(string(*)(const char*, const char*, const char*,
- const char*, const char*, const char*,
- const char*, const char*, const char*))> a =
- InvokeArgument<0>("1", "2", "3", "4", "5", "6", "7", "8", "9");
- EXPECT_EQ("123456789", a.Perform(make_tuple(&Concat9)));
-}
-
-// Tests using InvokeArgument with a 10-ary function.
-TEST(InvokeArgumentTest, Function10) {
- Action<string(string(*)(const char*, const char*, const char*,
- const char*, const char*, const char*,
- const char*, const char*, const char*,
- const char*))> a =
- InvokeArgument<0>("1", "2", "3", "4", "5", "6", "7", "8", "9", "0");
- EXPECT_EQ("1234567890", a.Perform(make_tuple(&Concat10)));
-}
-
-// Tests using InvokeArgument with a function that takes a pointer argument.
-TEST(InvokeArgumentTest, ByPointerFunction) {
- Action<const char*(const char*(*)(const char* input, short n))> a = // NOLINT
- InvokeArgument<0>(static_cast<const char*>("Hi"), Short(1));
- EXPECT_STREQ("i", a.Perform(make_tuple(&Binary)));
-}
-
-// Tests using InvokeArgument with a function that takes a const char*
-// by passing it a C-string literal.
-TEST(InvokeArgumentTest, FunctionWithCStringLiteral) {
- Action<const char*(const char*(*)(const char* input, short n))> a = // NOLINT
- InvokeArgument<0>("Hi", Short(1));
- EXPECT_STREQ("i", a.Perform(make_tuple(&Binary)));
-}
-
-// Tests using InvokeArgument with a function that takes a const reference.
-TEST(InvokeArgumentTest, ByConstReferenceFunction) {
- Action<bool(bool(*function)(const string& s))> a = // NOLINT
- InvokeArgument<0>(string("Hi"));
- // When action 'a' is constructed, it makes a copy of the temporary
- // string object passed to it, so it's OK to use 'a' later, when the
- // temporary object has already died.
- EXPECT_TRUE(a.Perform(make_tuple(&ByConstRef)));
-}
-
-// Tests using InvokeArgument with ByRef() and a function that takes a
-// const reference.
-TEST(InvokeArgumentTest, ByExplicitConstReferenceFunction) {
- Action<bool(bool(*)(const double& x))> a = // NOLINT
- InvokeArgument<0>(ByRef(g_double));
- // The above line calls ByRef() on a const value.
- EXPECT_TRUE(a.Perform(make_tuple(&ReferencesGlobalDouble)));
-
- double x = 0;
- a = InvokeArgument<0>(ByRef(x)); // This calls ByRef() on a non-const.
- EXPECT_FALSE(a.Perform(make_tuple(&ReferencesGlobalDouble)));
-}
-
-// Tests using WithArgs and with an action that takes 1 argument.
-TEST(WithArgsTest, OneArg) {
- Action<bool(double x, int n)> a = WithArgs<1>(Invoke(Unary)); // NOLINT
- EXPECT_TRUE(a.Perform(make_tuple(1.5, -1)));
- EXPECT_FALSE(a.Perform(make_tuple(1.5, 1)));
-}
-
-// Tests using WithArgs with an action that takes 2 arguments.
-TEST(WithArgsTest, TwoArgs) {
- Action<const char*(const char* s, double x, short n)> a =
- WithArgs<0, 2>(Invoke(Binary));
- const char s[] = "Hello";
- EXPECT_EQ(s + 2, a.Perform(make_tuple(CharPtr(s), 0.5, Short(2))));
-}
-
-// Tests using WithArgs with an action that takes 3 arguments.
-TEST(WithArgsTest, ThreeArgs) {
- Action<int(int, double, char, short)> a = // NOLINT
- WithArgs<0, 2, 3>(Invoke(Ternary));
- EXPECT_EQ(123, a.Perform(make_tuple(100, 6.5, Char(20), Short(3))));
-}
-
-// Tests using WithArgs with an action that takes 4 arguments.
-TEST(WithArgsTest, FourArgs) {
- Action<string(const char*, const char*, double, const char*, const char*)> a =
- WithArgs<4, 3, 1, 0>(Invoke(Concat4));
- EXPECT_EQ("4310", a.Perform(make_tuple(CharPtr("0"), CharPtr("1"), 2.5,
- CharPtr("3"), CharPtr("4"))));
-}
-
-// Tests using WithArgs with an action that takes 5 arguments.
-TEST(WithArgsTest, FiveArgs) {
- Action<string(const char*, const char*, const char*,
- const char*, const char*)> a =
- WithArgs<4, 3, 2, 1, 0>(Invoke(Concat5));
- EXPECT_EQ("43210",
- a.Perform(make_tuple(CharPtr("0"), CharPtr("1"), CharPtr("2"),
- CharPtr("3"), CharPtr("4"))));
-}
-
-// Tests using WithArgs with an action that takes 6 arguments.
-TEST(WithArgsTest, SixArgs) {
- Action<string(const char*, const char*, const char*)> a =
- WithArgs<0, 1, 2, 2, 1, 0>(Invoke(Concat6));
- EXPECT_EQ("012210",
- a.Perform(make_tuple(CharPtr("0"), CharPtr("1"), CharPtr("2"))));
-}
-
-// Tests using WithArgs with an action that takes 7 arguments.
-TEST(WithArgsTest, SevenArgs) {
- Action<string(const char*, const char*, const char*, const char*)> a =
- WithArgs<0, 1, 2, 3, 2, 1, 0>(Invoke(Concat7));
- EXPECT_EQ("0123210",
- a.Perform(make_tuple(CharPtr("0"), CharPtr("1"), CharPtr("2"),
- CharPtr("3"))));
-}
-
-// Tests using WithArgs with an action that takes 8 arguments.
-TEST(WithArgsTest, EightArgs) {
- Action<string(const char*, const char*, const char*, const char*)> a =
- WithArgs<0, 1, 2, 3, 0, 1, 2, 3>(Invoke(Concat8));
- EXPECT_EQ("01230123",
- a.Perform(make_tuple(CharPtr("0"), CharPtr("1"), CharPtr("2"),
- CharPtr("3"))));
-}
-
-// Tests using WithArgs with an action that takes 9 arguments.
-TEST(WithArgsTest, NineArgs) {
- Action<string(const char*, const char*, const char*, const char*)> a =
- WithArgs<0, 1, 2, 3, 1, 2, 3, 2, 3>(Invoke(Concat9));
- EXPECT_EQ("012312323",
- a.Perform(make_tuple(CharPtr("0"), CharPtr("1"), CharPtr("2"),
- CharPtr("3"))));
-}
-
-// Tests using WithArgs with an action that takes 10 arguments.
-TEST(WithArgsTest, TenArgs) {
- Action<string(const char*, const char*, const char*, const char*)> a =
- WithArgs<0, 1, 2, 3, 2, 1, 0, 1, 2, 3>(Invoke(Concat10));
- EXPECT_EQ("0123210123",
- a.Perform(make_tuple(CharPtr("0"), CharPtr("1"), CharPtr("2"),
- CharPtr("3"))));
-}
-
-// Tests using WithArgs with an action that is not Invoke().
-class SubstractAction : public ActionInterface<int(int, int)> { // NOLINT
- public:
- virtual int Perform(const tuple<int, int>& args) {
- return get<0>(args) - get<1>(args);
- }
-};
-
-TEST(WithArgsTest, NonInvokeAction) {
- Action<int(const string&, int, int)> a = // NOLINT
- WithArgs<2, 1>(MakeAction(new SubstractAction));
- EXPECT_EQ(8, a.Perform(make_tuple(CharPtr("hi"), 2, 10)));
-}
-
-// Tests using WithArgs to pass all original arguments in the original order.
-TEST(WithArgsTest, Identity) {
- Action<int(int x, char y, short z)> a = // NOLINT
- WithArgs<0, 1, 2>(Invoke(Ternary));
- EXPECT_EQ(123, a.Perform(make_tuple(100, Char(20), Short(3))));
-}
-
-// Tests using WithArgs with repeated arguments.
-TEST(WithArgsTest, RepeatedArguments) {
- Action<int(bool, int m, int n)> a = // NOLINT
- WithArgs<1, 1, 1, 1>(Invoke(SumOf4));
- EXPECT_EQ(4, a.Perform(make_tuple(false, 1, 10)));
-}
-
-// Tests using WithArgs with reversed argument order.
-TEST(WithArgsTest, ReversedArgumentOrder) {
- Action<const char*(short n, const char* input)> a = // NOLINT
- WithArgs<1, 0>(Invoke(Binary));
- const char s[] = "Hello";
- EXPECT_EQ(s + 2, a.Perform(make_tuple(Short(2), CharPtr(s))));
-}
-
-// Tests using WithArgs with compatible, but not identical, argument types.
-TEST(WithArgsTest, ArgsOfCompatibleTypes) {
- Action<long(short x, char y, double z, char c)> a = // NOLINT
- WithArgs<0, 1, 3>(Invoke(Ternary));
- EXPECT_EQ(123, a.Perform(make_tuple(Short(100), Char(20), 5.6, Char(3))));
-}
-
-// Tests using WithArgs with an action that returns void.
-TEST(WithArgsTest, VoidAction) {
- Action<void(double x, char c, int n)> a = WithArgs<2, 1>(Invoke(VoidBinary));
- g_done = false;
- a.Perform(make_tuple(1.5, 'a', 3));
- EXPECT_TRUE(g_done);
-}
-
-// Tests DoAll(a1, a2).
-TEST(DoAllTest, TwoActions) {
- int n = 0;
- Action<int(int*)> a = DoAll(SetArgPointee<0>(1), // NOLINT
- Return(2));
- EXPECT_EQ(2, a.Perform(make_tuple(&n)));
- EXPECT_EQ(1, n);
-}
-
-// Tests DoAll(a1, a2, a3).
-TEST(DoAllTest, ThreeActions) {
- int m = 0, n = 0;
- Action<int(int*, int*)> a = DoAll(SetArgPointee<0>(1), // NOLINT
- SetArgPointee<1>(2),
- Return(3));
- EXPECT_EQ(3, a.Perform(make_tuple(&m, &n)));
- EXPECT_EQ(1, m);
- EXPECT_EQ(2, n);
-}
-
-// Tests DoAll(a1, a2, a3, a4).
-TEST(DoAllTest, FourActions) {
- int m = 0, n = 0;
- char ch = '\0';
- Action<int(int*, int*, char*)> a = // NOLINT
- DoAll(SetArgPointee<0>(1),
- SetArgPointee<1>(2),
- SetArgPointee<2>('a'),
- Return(3));
- EXPECT_EQ(3, a.Perform(make_tuple(&m, &n, &ch)));
- EXPECT_EQ(1, m);
- EXPECT_EQ(2, n);
- EXPECT_EQ('a', ch);
-}
-
-// Tests DoAll(a1, a2, a3, a4, a5).
-TEST(DoAllTest, FiveActions) {
- int m = 0, n = 0;
- char a = '\0', b = '\0';
- Action<int(int*, int*, char*, char*)> action = // NOLINT
- DoAll(SetArgPointee<0>(1),
- SetArgPointee<1>(2),
- SetArgPointee<2>('a'),
- SetArgPointee<3>('b'),
- Return(3));
- EXPECT_EQ(3, action.Perform(make_tuple(&m, &n, &a, &b)));
- EXPECT_EQ(1, m);
- EXPECT_EQ(2, n);
- EXPECT_EQ('a', a);
- EXPECT_EQ('b', b);
-}
-
-// Tests DoAll(a1, a2, ..., a6).
-TEST(DoAllTest, SixActions) {
- int m = 0, n = 0;
- char a = '\0', b = '\0', c = '\0';
- Action<int(int*, int*, char*, char*, char*)> action = // NOLINT
- DoAll(SetArgPointee<0>(1),
- SetArgPointee<1>(2),
- SetArgPointee<2>('a'),
- SetArgPointee<3>('b'),
- SetArgPointee<4>('c'),
- Return(3));
- EXPECT_EQ(3, action.Perform(make_tuple(&m, &n, &a, &b, &c)));
- EXPECT_EQ(1, m);
- EXPECT_EQ(2, n);
- EXPECT_EQ('a', a);
- EXPECT_EQ('b', b);
- EXPECT_EQ('c', c);
-}
-
-// Tests DoAll(a1, a2, ..., a7).
-TEST(DoAllTest, SevenActions) {
- int m = 0, n = 0;
- char a = '\0', b = '\0', c = '\0', d = '\0';
- Action<int(int*, int*, char*, char*, char*, char*)> action = // NOLINT
- DoAll(SetArgPointee<0>(1),
- SetArgPointee<1>(2),
- SetArgPointee<2>('a'),
- SetArgPointee<3>('b'),
- SetArgPointee<4>('c'),
- SetArgPointee<5>('d'),
- Return(3));
- EXPECT_EQ(3, action.Perform(make_tuple(&m, &n, &a, &b, &c, &d)));
- EXPECT_EQ(1, m);
- EXPECT_EQ(2, n);
- EXPECT_EQ('a', a);
- EXPECT_EQ('b', b);
- EXPECT_EQ('c', c);
- EXPECT_EQ('d', d);
-}
-
-// Tests DoAll(a1, a2, ..., a8).
-TEST(DoAllTest, EightActions) {
- int m = 0, n = 0;
- char a = '\0', b = '\0', c = '\0', d = '\0', e = '\0';
- Action<int(int*, int*, char*, char*, char*, char*, // NOLINT
- char*)> action =
- DoAll(SetArgPointee<0>(1),
- SetArgPointee<1>(2),
- SetArgPointee<2>('a'),
- SetArgPointee<3>('b'),
- SetArgPointee<4>('c'),
- SetArgPointee<5>('d'),
- SetArgPointee<6>('e'),
- Return(3));
- EXPECT_EQ(3, action.Perform(make_tuple(&m, &n, &a, &b, &c, &d, &e)));
- EXPECT_EQ(1, m);
- EXPECT_EQ(2, n);
- EXPECT_EQ('a', a);
- EXPECT_EQ('b', b);
- EXPECT_EQ('c', c);
- EXPECT_EQ('d', d);
- EXPECT_EQ('e', e);
-}
-
-// Tests DoAll(a1, a2, ..., a9).
-TEST(DoAllTest, NineActions) {
- int m = 0, n = 0;
- char a = '\0', b = '\0', c = '\0', d = '\0', e = '\0', f = '\0';
- Action<int(int*, int*, char*, char*, char*, char*, // NOLINT
- char*, char*)> action =
- DoAll(SetArgPointee<0>(1),
- SetArgPointee<1>(2),
- SetArgPointee<2>('a'),
- SetArgPointee<3>('b'),
- SetArgPointee<4>('c'),
- SetArgPointee<5>('d'),
- SetArgPointee<6>('e'),
- SetArgPointee<7>('f'),
- Return(3));
- EXPECT_EQ(3, action.Perform(make_tuple(&m, &n, &a, &b, &c, &d, &e, &f)));
- EXPECT_EQ(1, m);
- EXPECT_EQ(2, n);
- EXPECT_EQ('a', a);
- EXPECT_EQ('b', b);
- EXPECT_EQ('c', c);
- EXPECT_EQ('d', d);
- EXPECT_EQ('e', e);
- EXPECT_EQ('f', f);
-}
-
-// Tests DoAll(a1, a2, ..., a10).
-TEST(DoAllTest, TenActions) {
- int m = 0, n = 0;
- char a = '\0', b = '\0', c = '\0', d = '\0';
- char e = '\0', f = '\0', g = '\0';
- Action<int(int*, int*, char*, char*, char*, char*, // NOLINT
- char*, char*, char*)> action =
- DoAll(SetArgPointee<0>(1),
- SetArgPointee<1>(2),
- SetArgPointee<2>('a'),
- SetArgPointee<3>('b'),
- SetArgPointee<4>('c'),
- SetArgPointee<5>('d'),
- SetArgPointee<6>('e'),
- SetArgPointee<7>('f'),
- SetArgPointee<8>('g'),
- Return(3));
- EXPECT_EQ(3, action.Perform(make_tuple(&m, &n, &a, &b, &c, &d, &e, &f, &g)));
- EXPECT_EQ(1, m);
- EXPECT_EQ(2, n);
- EXPECT_EQ('a', a);
- EXPECT_EQ('b', b);
- EXPECT_EQ('c', c);
- EXPECT_EQ('d', d);
- EXPECT_EQ('e', e);
- EXPECT_EQ('f', f);
- EXPECT_EQ('g', g);
-}
-
-// The ACTION*() macros trigger warning C4100 (unreferenced formal
-// parameter) in MSVC with -W4. Unfortunately they cannot be fixed in
-// the macro definition, as the warnings are generated when the macro
-// is expanded and macro expansion cannot contain #pragma. Therefore
-// we suppress them here.
-#ifdef _MSC_VER
-# pragma warning(push)
-# pragma warning(disable:4100)
-#endif
-
-// Tests the ACTION*() macro family.
-
-// Tests that ACTION() can define an action that doesn't reference the
-// mock function arguments.
-ACTION(Return5) { return 5; }
-
-TEST(ActionMacroTest, WorksWhenNotReferencingArguments) {
- Action<double()> a1 = Return5();
- EXPECT_DOUBLE_EQ(5, a1.Perform(make_tuple()));
-
- Action<int(double, bool)> a2 = Return5();
- EXPECT_EQ(5, a2.Perform(make_tuple(1, true)));
-}
-
-// Tests that ACTION() can define an action that returns void.
-ACTION(IncrementArg1) { (*arg1)++; }
-
-TEST(ActionMacroTest, WorksWhenReturningVoid) {
- Action<void(int, int*)> a1 = IncrementArg1();
- int n = 0;
- a1.Perform(make_tuple(5, &n));
- EXPECT_EQ(1, n);
-}
-
-// Tests that the body of ACTION() can reference the type of the
-// argument.
-ACTION(IncrementArg2) {
- StaticAssertTypeEq<int*, arg2_type>();
- arg2_type temp = arg2;
- (*temp)++;
-}
-
-TEST(ActionMacroTest, CanReferenceArgumentType) {
- Action<void(int, bool, int*)> a1 = IncrementArg2();
- int n = 0;
- a1.Perform(make_tuple(5, false, &n));
- EXPECT_EQ(1, n);
-}
-
-// Tests that the body of ACTION() can reference the argument tuple
-// via args_type and args.
-ACTION(Sum2) {
- StaticAssertTypeEq< ::std::tr1::tuple<int, char, int*>, args_type>();
- args_type args_copy = args;
- return get<0>(args_copy) + get<1>(args_copy);
-}
-
-TEST(ActionMacroTest, CanReferenceArgumentTuple) {
- Action<int(int, char, int*)> a1 = Sum2();
- int dummy = 0;
- EXPECT_EQ(11, a1.Perform(make_tuple(5, Char(6), &dummy)));
-}
-
-// Tests that the body of ACTION() can reference the mock function
-// type.
-int Dummy(bool flag) { return flag? 1 : 0; }
-
-ACTION(InvokeDummy) {
- StaticAssertTypeEq<int(bool), function_type>();
- function_type* fp = &Dummy;
- return (*fp)(true);
-}
-
-TEST(ActionMacroTest, CanReferenceMockFunctionType) {
- Action<int(bool)> a1 = InvokeDummy();
- EXPECT_EQ(1, a1.Perform(make_tuple(true)));
- EXPECT_EQ(1, a1.Perform(make_tuple(false)));
-}
-
-// Tests that the body of ACTION() can reference the mock function's
-// return type.
-ACTION(InvokeDummy2) {
- StaticAssertTypeEq<int, return_type>();
- return_type result = Dummy(true);
- return result;
-}
-
-TEST(ActionMacroTest, CanReferenceMockFunctionReturnType) {
- Action<int(bool)> a1 = InvokeDummy2();
- EXPECT_EQ(1, a1.Perform(make_tuple(true)));
- EXPECT_EQ(1, a1.Perform(make_tuple(false)));
-}
-
-// Tests that ACTION() works for arguments passed by const reference.
-ACTION(ReturnAddrOfConstBoolReferenceArg) {
- StaticAssertTypeEq<const bool&, arg1_type>();
- return &arg1;
-}
-
-TEST(ActionMacroTest, WorksForConstReferenceArg) {
- Action<const bool*(int, const bool&)> a = ReturnAddrOfConstBoolReferenceArg();
- const bool b = false;
- EXPECT_EQ(&b, a.Perform(tuple<int, const bool&>(0, b)));
-}
-
-// Tests that ACTION() works for arguments passed by non-const reference.
-ACTION(ReturnAddrOfIntReferenceArg) {
- StaticAssertTypeEq<int&, arg0_type>();
- return &arg0;
-}
-
-TEST(ActionMacroTest, WorksForNonConstReferenceArg) {
- Action<int*(int&, bool, int)> a = ReturnAddrOfIntReferenceArg();
- int n = 0;
- EXPECT_EQ(&n, a.Perform(tuple<int&, bool, int>(n, true, 1)));
-}
-
-// Tests that ACTION() can be used in a namespace.
-namespace action_test {
-ACTION(Sum) { return arg0 + arg1; }
-} // namespace action_test
-
-TEST(ActionMacroTest, WorksInNamespace) {
- Action<int(int, int)> a1 = action_test::Sum();
- EXPECT_EQ(3, a1.Perform(make_tuple(1, 2)));
-}
-
-// Tests that the same ACTION definition works for mock functions with
-// different argument numbers.
-ACTION(PlusTwo) { return arg0 + 2; }
-
-TEST(ActionMacroTest, WorksForDifferentArgumentNumbers) {
- Action<int(int)> a1 = PlusTwo();
- EXPECT_EQ(4, a1.Perform(make_tuple(2)));
-
- Action<double(float, void*)> a2 = PlusTwo();
- int dummy;
- EXPECT_DOUBLE_EQ(6, a2.Perform(make_tuple(4.0f, &dummy)));
-}
-
-// Tests that ACTION_P can define a parameterized action.
-ACTION_P(Plus, n) { return arg0 + n; }
-
-TEST(ActionPMacroTest, DefinesParameterizedAction) {
- Action<int(int m, bool t)> a1 = Plus(9);
- EXPECT_EQ(10, a1.Perform(make_tuple(1, true)));
-}
-
-// Tests that the body of ACTION_P can reference the argument types
-// and the parameter type.
-ACTION_P(TypedPlus, n) {
- arg0_type t1 = arg0;
- n_type t2 = n;
- return t1 + t2;
-}
-
-TEST(ActionPMacroTest, CanReferenceArgumentAndParameterTypes) {
- Action<int(char m, bool t)> a1 = TypedPlus(9);
- EXPECT_EQ(10, a1.Perform(make_tuple(Char(1), true)));
-}
-
-// Tests that a parameterized action can be used in any mock function
-// whose type is compatible.
-TEST(ActionPMacroTest, WorksInCompatibleMockFunction) {
- Action<std::string(const std::string& s)> a1 = Plus("tail");
- const std::string re = "re";
- EXPECT_EQ("retail", a1.Perform(make_tuple(re)));
-}
-
-// Tests that we can use ACTION*() to define actions overloaded on the
-// number of parameters.
-
-ACTION(OverloadedAction) { return arg0 ? arg1 : "hello"; }
-
-ACTION_P(OverloadedAction, default_value) {
- return arg0 ? arg1 : default_value;
-}
-
-ACTION_P2(OverloadedAction, true_value, false_value) {
- return arg0 ? true_value : false_value;
-}
-
-TEST(ActionMacroTest, CanDefineOverloadedActions) {
- typedef Action<const char*(bool, const char*)> MyAction;
-
- const MyAction a1 = OverloadedAction();
- EXPECT_STREQ("hello", a1.Perform(make_tuple(false, CharPtr("world"))));
- EXPECT_STREQ("world", a1.Perform(make_tuple(true, CharPtr("world"))));
-
- const MyAction a2 = OverloadedAction("hi");
- EXPECT_STREQ("hi", a2.Perform(make_tuple(false, CharPtr("world"))));
- EXPECT_STREQ("world", a2.Perform(make_tuple(true, CharPtr("world"))));
-
- const MyAction a3 = OverloadedAction("hi", "you");
- EXPECT_STREQ("hi", a3.Perform(make_tuple(true, CharPtr("world"))));
- EXPECT_STREQ("you", a3.Perform(make_tuple(false, CharPtr("world"))));
-}
-
-// Tests ACTION_Pn where n >= 3.
-
-ACTION_P3(Plus, m, n, k) { return arg0 + m + n + k; }
-
-TEST(ActionPnMacroTest, WorksFor3Parameters) {
- Action<double(int m, bool t)> a1 = Plus(100, 20, 3.4);
- EXPECT_DOUBLE_EQ(3123.4, a1.Perform(make_tuple(3000, true)));
-
- Action<std::string(const std::string& s)> a2 = Plus("tail", "-", ">");
- const std::string re = "re";
- EXPECT_EQ("retail->", a2.Perform(make_tuple(re)));
-}
-
-ACTION_P4(Plus, p0, p1, p2, p3) { return arg0 + p0 + p1 + p2 + p3; }
-
-TEST(ActionPnMacroTest, WorksFor4Parameters) {
- Action<int(int)> a1 = Plus(1, 2, 3, 4);
- EXPECT_EQ(10 + 1 + 2 + 3 + 4, a1.Perform(make_tuple(10)));
-}
-
-ACTION_P5(Plus, p0, p1, p2, p3, p4) { return arg0 + p0 + p1 + p2 + p3 + p4; }
-
-TEST(ActionPnMacroTest, WorksFor5Parameters) {
- Action<int(int)> a1 = Plus(1, 2, 3, 4, 5);
- EXPECT_EQ(10 + 1 + 2 + 3 + 4 + 5, a1.Perform(make_tuple(10)));
-}
-
-ACTION_P6(Plus, p0, p1, p2, p3, p4, p5) {
- return arg0 + p0 + p1 + p2 + p3 + p4 + p5;
-}
-
-TEST(ActionPnMacroTest, WorksFor6Parameters) {
- Action<int(int)> a1 = Plus(1, 2, 3, 4, 5, 6);
- EXPECT_EQ(10 + 1 + 2 + 3 + 4 + 5 + 6, a1.Perform(make_tuple(10)));
-}
-
-ACTION_P7(Plus, p0, p1, p2, p3, p4, p5, p6) {
- return arg0 + p0 + p1 + p2 + p3 + p4 + p5 + p6;
-}
-
-TEST(ActionPnMacroTest, WorksFor7Parameters) {
- Action<int(int)> a1 = Plus(1, 2, 3, 4, 5, 6, 7);
- EXPECT_EQ(10 + 1 + 2 + 3 + 4 + 5 + 6 + 7, a1.Perform(make_tuple(10)));
-}
-
-ACTION_P8(Plus, p0, p1, p2, p3, p4, p5, p6, p7) {
- return arg0 + p0 + p1 + p2 + p3 + p4 + p5 + p6 + p7;
-}
-
-TEST(ActionPnMacroTest, WorksFor8Parameters) {
- Action<int(int)> a1 = Plus(1, 2, 3, 4, 5, 6, 7, 8);
- EXPECT_EQ(10 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8, a1.Perform(make_tuple(10)));
-}
-
-ACTION_P9(Plus, p0, p1, p2, p3, p4, p5, p6, p7, p8) {
- return arg0 + p0 + p1 + p2 + p3 + p4 + p5 + p6 + p7 + p8;
-}
-
-TEST(ActionPnMacroTest, WorksFor9Parameters) {
- Action<int(int)> a1 = Plus(1, 2, 3, 4, 5, 6, 7, 8, 9);
- EXPECT_EQ(10 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9, a1.Perform(make_tuple(10)));
-}
-
-ACTION_P10(Plus, p0, p1, p2, p3, p4, p5, p6, p7, p8, last_param) {
- arg0_type t0 = arg0;
- last_param_type t9 = last_param;
- return t0 + p0 + p1 + p2 + p3 + p4 + p5 + p6 + p7 + p8 + t9;
-}
-
-TEST(ActionPnMacroTest, WorksFor10Parameters) {
- Action<int(int)> a1 = Plus(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
- EXPECT_EQ(10 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10,
- a1.Perform(make_tuple(10)));
-}
-
-// Tests that the action body can promote the parameter types.
-
-ACTION_P2(PadArgument, prefix, suffix) {
- // The following lines promote the two parameters to desired types.
- std::string prefix_str(prefix);
- char suffix_char = static_cast<char>(suffix);
- return prefix_str + arg0 + suffix_char;
-}
-
-TEST(ActionPnMacroTest, SimpleTypePromotion) {
- Action<std::string(const char*)> no_promo =
- PadArgument(std::string("foo"), 'r');
- Action<std::string(const char*)> promo =
- PadArgument("foo", static_cast<int>('r'));
- EXPECT_EQ("foobar", no_promo.Perform(make_tuple(CharPtr("ba"))));
- EXPECT_EQ("foobar", promo.Perform(make_tuple(CharPtr("ba"))));
-}
-
-// Tests that we can partially restrict parameter types using a
-// straight-forward pattern.
-
-// Defines a generic action that doesn't restrict the types of its
-// parameters.
-ACTION_P3(ConcatImpl, a, b, c) {
- std::stringstream ss;
- ss << a << b << c;
- return ss.str();
-}
-
-// Next, we try to restrict that either the first parameter is a
-// string, or the second parameter is an int.
-
-// Defines a partially specialized wrapper that restricts the first
-// parameter to std::string.
-template <typename T1, typename T2>
-// ConcatImplActionP3 is the class template ACTION_P3 uses to
-// implement ConcatImpl. We shouldn't change the name as this
-// pattern requires the user to use it directly.
-ConcatImplActionP3<std::string, T1, T2>
-Concat(const std::string& a, T1 b, T2 c) {
- if (true) {
- // This branch verifies that ConcatImpl() can be invoked without
- // explicit template arguments.
- return ConcatImpl(a, b, c);
- } else {
- // This branch verifies that ConcatImpl() can also be invoked with
- // explicit template arguments. It doesn't really need to be
- // executed as this is a compile-time verification.
- return ConcatImpl<std::string, T1, T2>(a, b, c);
- }
-}
-
-// Defines another partially specialized wrapper that restricts the
-// second parameter to int.
-template <typename T1, typename T2>
-ConcatImplActionP3<T1, int, T2>
-Concat(T1 a, int b, T2 c) {
- return ConcatImpl(a, b, c);
-}
-
-TEST(ActionPnMacroTest, CanPartiallyRestrictParameterTypes) {
- Action<const std::string()> a1 = Concat("Hello", "1", 2);
- EXPECT_EQ("Hello12", a1.Perform(make_tuple()));
-
- a1 = Concat(1, 2, 3);
- EXPECT_EQ("123", a1.Perform(make_tuple()));
-}
-
-// Verifies the type of an ACTION*.
-
-ACTION(DoFoo) {}
-ACTION_P(DoFoo, p) {}
-ACTION_P2(DoFoo, p0, p1) {}
-
-TEST(ActionPnMacroTest, TypesAreCorrect) {
- // DoFoo() must be assignable to a DoFooAction variable.
- DoFooAction a0 = DoFoo();
-
- // DoFoo(1) must be assignable to a DoFooActionP variable.
- DoFooActionP<int> a1 = DoFoo(1);
-
- // DoFoo(p1, ..., pk) must be assignable to a DoFooActionPk
- // variable, and so on.
- DoFooActionP2<int, char> a2 = DoFoo(1, '2');
- PlusActionP3<int, int, char> a3 = Plus(1, 2, '3');
- PlusActionP4<int, int, int, char> a4 = Plus(1, 2, 3, '4');
- PlusActionP5<int, int, int, int, char> a5 = Plus(1, 2, 3, 4, '5');
- PlusActionP6<int, int, int, int, int, char> a6 = Plus(1, 2, 3, 4, 5, '6');
- PlusActionP7<int, int, int, int, int, int, char> a7 =
- Plus(1, 2, 3, 4, 5, 6, '7');
- PlusActionP8<int, int, int, int, int, int, int, char> a8 =
- Plus(1, 2, 3, 4, 5, 6, 7, '8');
- PlusActionP9<int, int, int, int, int, int, int, int, char> a9 =
- Plus(1, 2, 3, 4, 5, 6, 7, 8, '9');
- PlusActionP10<int, int, int, int, int, int, int, int, int, char> a10 =
- Plus(1, 2, 3, 4, 5, 6, 7, 8, 9, '0');
-}
-
-// Tests that an ACTION_P*() action can be explicitly instantiated
-// with reference-typed parameters.
-
-ACTION_P(Plus1, x) { return x; }
-ACTION_P2(Plus2, x, y) { return x + y; }
-ACTION_P3(Plus3, x, y, z) { return x + y + z; }
-ACTION_P10(Plus10, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) {
- return a0 + a1 + a2 + a3 + a4 + a5 + a6 + a7 + a8 + a9;
-}
-
-TEST(ActionPnMacroTest, CanExplicitlyInstantiateWithReferenceTypes) {
- int x = 1, y = 2, z = 3;
- const tuple<> empty = make_tuple();
-
- Action<int()> a = Plus1<int&>(x);
- EXPECT_EQ(1, a.Perform(empty));
-
- a = Plus2<const int&, int&>(x, y);
- EXPECT_EQ(3, a.Perform(empty));
-
- a = Plus3<int&, const int&, int&>(x, y, z);
- EXPECT_EQ(6, a.Perform(empty));
-
- int n[10] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
- a = Plus10<const int&, int&, const int&, int&, const int&, int&, const int&,
- int&, const int&, int&>(n[0], n[1], n[2], n[3], n[4], n[5], n[6], n[7],
- n[8], n[9]);
- EXPECT_EQ(55, a.Perform(empty));
-}
-
-class NullaryConstructorClass {
- public:
- NullaryConstructorClass() : value_(123) {}
- int value_;
-};
-
-// Tests using ReturnNew() with a nullary constructor.
-TEST(ReturnNewTest, NoArgs) {
- Action<NullaryConstructorClass*()> a = ReturnNew<NullaryConstructorClass>();
- NullaryConstructorClass* c = a.Perform(make_tuple());
- EXPECT_EQ(123, c->value_);
- delete c;
-}
-
-class UnaryConstructorClass {
- public:
- explicit UnaryConstructorClass(int value) : value_(value) {}
- int value_;
-};
-
-// Tests using ReturnNew() with a unary constructor.
-TEST(ReturnNewTest, Unary) {
- Action<UnaryConstructorClass*()> a = ReturnNew<UnaryConstructorClass>(4000);
- UnaryConstructorClass* c = a.Perform(make_tuple());
- EXPECT_EQ(4000, c->value_);
- delete c;
-}
-
-TEST(ReturnNewTest, UnaryWorksWhenMockMethodHasArgs) {
- Action<UnaryConstructorClass*(bool, int)> a =
- ReturnNew<UnaryConstructorClass>(4000);
- UnaryConstructorClass* c = a.Perform(make_tuple(false, 5));
- EXPECT_EQ(4000, c->value_);
- delete c;
-}
-
-TEST(ReturnNewTest, UnaryWorksWhenMockMethodReturnsPointerToConst) {
- Action<const UnaryConstructorClass*()> a =
- ReturnNew<UnaryConstructorClass>(4000);
- const UnaryConstructorClass* c = a.Perform(make_tuple());
- EXPECT_EQ(4000, c->value_);
- delete c;
-}
-
-class TenArgConstructorClass {
- public:
- TenArgConstructorClass(int a1, int a2, int a3, int a4, int a5,
- int a6, int a7, int a8, int a9, int a10)
- : value_(a1 + a2 + a3 + a4 + a5 + a6 + a7 + a8 + a9 + a10) {
- }
- int value_;
-};
-
-// Tests using ReturnNew() with a 10-argument constructor.
-TEST(ReturnNewTest, ConstructorThatTakes10Arguments) {
- Action<TenArgConstructorClass*()> a =
- ReturnNew<TenArgConstructorClass>(1000000000, 200000000, 30000000,
- 4000000, 500000, 60000,
- 7000, 800, 90, 0);
- TenArgConstructorClass* c = a.Perform(make_tuple());
- EXPECT_EQ(1234567890, c->value_);
- delete c;
-}
-
-// Tests that ACTION_TEMPLATE works when there is no value parameter.
-ACTION_TEMPLATE(CreateNew,
- HAS_1_TEMPLATE_PARAMS(typename, T),
- AND_0_VALUE_PARAMS()) {
- return new T;
-}
-
-TEST(ActionTemplateTest, WorksWithoutValueParam) {
- const Action<int*()> a = CreateNew<int>();
- int* p = a.Perform(make_tuple());
- delete p;
-}
-
-// Tests that ACTION_TEMPLATE works when there are value parameters.
-ACTION_TEMPLATE(CreateNew,
- HAS_1_TEMPLATE_PARAMS(typename, T),
- AND_1_VALUE_PARAMS(a0)) {
- return new T(a0);
-}
-
-TEST(ActionTemplateTest, WorksWithValueParams) {
- const Action<int*()> a = CreateNew<int>(42);
- int* p = a.Perform(make_tuple());
- EXPECT_EQ(42, *p);
- delete p;
-}
-
-// Tests that ACTION_TEMPLATE works for integral template parameters.
-ACTION_TEMPLATE(MyDeleteArg,
- HAS_1_TEMPLATE_PARAMS(int, k),
- AND_0_VALUE_PARAMS()) {
- delete std::tr1::get<k>(args);
-}
-
-// Resets a bool variable in the destructor.
-class BoolResetter {
- public:
- explicit BoolResetter(bool* value) : value_(value) {}
- ~BoolResetter() { *value_ = false; }
- private:
- bool* value_;
-};
-
-TEST(ActionTemplateTest, WorksForIntegralTemplateParams) {
- const Action<void(int*, BoolResetter*)> a = MyDeleteArg<1>();
- int n = 0;
- bool b = true;
- BoolResetter* resetter = new BoolResetter(&b);
- a.Perform(make_tuple(&n, resetter));
- EXPECT_FALSE(b); // Verifies that resetter is deleted.
-}
-
-// Tests that ACTION_TEMPLATES works for template template parameters.
-ACTION_TEMPLATE(ReturnSmartPointer,
- HAS_1_TEMPLATE_PARAMS(template <typename Pointee> class,
- Pointer),
- AND_1_VALUE_PARAMS(pointee)) {
- return Pointer<pointee_type>(new pointee_type(pointee));
-}
-
-TEST(ActionTemplateTest, WorksForTemplateTemplateParameters) {
- using ::testing::internal::linked_ptr;
- const Action<linked_ptr<int>()> a = ReturnSmartPointer<linked_ptr>(42);
- linked_ptr<int> p = a.Perform(make_tuple());
- EXPECT_EQ(42, *p);
-}
-
-// Tests that ACTION_TEMPLATE works for 10 template parameters.
-template <typename T1, typename T2, typename T3, int k4, bool k5,
- unsigned int k6, typename T7, typename T8, typename T9>
-struct GiantTemplate {
- public:
- explicit GiantTemplate(int a_value) : value(a_value) {}
- int value;
-};
-
-ACTION_TEMPLATE(ReturnGiant,
- HAS_10_TEMPLATE_PARAMS(
- typename, T1,
- typename, T2,
- typename, T3,
- int, k4,
- bool, k5,
- unsigned int, k6,
- class, T7,
- class, T8,
- class, T9,
- template <typename T> class, T10),
- AND_1_VALUE_PARAMS(value)) {
- return GiantTemplate<T10<T1>, T2, T3, k4, k5, k6, T7, T8, T9>(value);
-}
-
-TEST(ActionTemplateTest, WorksFor10TemplateParameters) {
- using ::testing::internal::linked_ptr;
- typedef GiantTemplate<linked_ptr<int>, bool, double, 5,
- true, 6, char, unsigned, int> Giant;
- const Action<Giant()> a = ReturnGiant<
- int, bool, double, 5, true, 6, char, unsigned, int, linked_ptr>(42);
- Giant giant = a.Perform(make_tuple());
- EXPECT_EQ(42, giant.value);
-}
-
-// Tests that ACTION_TEMPLATE works for 10 value parameters.
-ACTION_TEMPLATE(ReturnSum,
- HAS_1_TEMPLATE_PARAMS(typename, Number),
- AND_10_VALUE_PARAMS(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10)) {
- return static_cast<Number>(v1) + v2 + v3 + v4 + v5 + v6 + v7 + v8 + v9 + v10;
-}
-
-TEST(ActionTemplateTest, WorksFor10ValueParameters) {
- const Action<int()> a = ReturnSum<int>(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
- EXPECT_EQ(55, a.Perform(make_tuple()));
-}
-
-// Tests that ACTION_TEMPLATE and ACTION/ACTION_P* can be overloaded
-// on the number of value parameters.
-
-ACTION(ReturnSum) { return 0; }
-
-ACTION_P(ReturnSum, x) { return x; }
-
-ACTION_TEMPLATE(ReturnSum,
- HAS_1_TEMPLATE_PARAMS(typename, Number),
- AND_2_VALUE_PARAMS(v1, v2)) {
- return static_cast<Number>(v1) + v2;
-}
-
-ACTION_TEMPLATE(ReturnSum,
- HAS_1_TEMPLATE_PARAMS(typename, Number),
- AND_3_VALUE_PARAMS(v1, v2, v3)) {
- return static_cast<Number>(v1) + v2 + v3;
-}
-
-ACTION_TEMPLATE(ReturnSum,
- HAS_2_TEMPLATE_PARAMS(typename, Number, int, k),
- AND_4_VALUE_PARAMS(v1, v2, v3, v4)) {
- return static_cast<Number>(v1) + v2 + v3 + v4 + k;
-}
-
-TEST(ActionTemplateTest, CanBeOverloadedOnNumberOfValueParameters) {
- const Action<int()> a0 = ReturnSum();
- const Action<int()> a1 = ReturnSum(1);
- const Action<int()> a2 = ReturnSum<int>(1, 2);
- const Action<int()> a3 = ReturnSum<int>(1, 2, 3);
- const Action<int()> a4 = ReturnSum<int, 10000>(2000, 300, 40, 5);
- EXPECT_EQ(0, a0.Perform(make_tuple()));
- EXPECT_EQ(1, a1.Perform(make_tuple()));
- EXPECT_EQ(3, a2.Perform(make_tuple()));
- EXPECT_EQ(6, a3.Perform(make_tuple()));
- EXPECT_EQ(12345, a4.Perform(make_tuple()));
-}
-
-#ifdef _MSC_VER
-# pragma warning(pop)
-#endif
-
-} // namespace gmock_generated_actions_test
-} // namespace testing
diff --git a/src/testing/test/gmock-generated-function-mockers_test.cc b/src/testing/test/gmock-generated-function-mockers_test.cc
deleted file mode 100644
index 2087f991..00000000
--- a/src/testing/test/gmock-generated-function-mockers_test.cc
+++ /dev/null
@@ -1,540 +0,0 @@
-// Copyright 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-// Google Mock - a framework for writing C++ mock classes.
-//
-// This file tests the function mocker classes.
-
-#include "gmock/gmock-generated-function-mockers.h"
-
-#if GTEST_OS_WINDOWS
-// MSDN says the header file to be included for STDMETHOD is BaseTyps.h but
-// we are getting compiler errors if we use basetyps.h, hence including
-// objbase.h for definition of STDMETHOD.
-# include <objbase.h>
-#endif // GTEST_OS_WINDOWS
-
-#include <map>
-#include <string>
-#include "gmock/gmock.h"
-#include "gtest/gtest.h"
-
-// There is a bug in MSVC (fixed in VS 2008) that prevents creating a
-// mock for a function with const arguments, so we don't test such
-// cases for MSVC versions older than 2008.
-#if !GTEST_OS_WINDOWS || (_MSC_VER >= 1500)
-# define GMOCK_ALLOWS_CONST_PARAM_FUNCTIONS
-#endif // !GTEST_OS_WINDOWS || (_MSC_VER >= 1500)
-
-namespace testing {
-namespace gmock_generated_function_mockers_test {
-
-using testing::internal::string;
-using testing::_;
-using testing::A;
-using testing::An;
-using testing::AnyNumber;
-using testing::Const;
-using testing::DoDefault;
-using testing::Eq;
-using testing::Lt;
-using testing::MockFunction;
-using testing::Ref;
-using testing::Return;
-using testing::ReturnRef;
-using testing::TypedEq;
-
-class FooInterface {
- public:
- virtual ~FooInterface() {}
-
- virtual void VoidReturning(int x) = 0;
-
- virtual int Nullary() = 0;
- virtual bool Unary(int x) = 0;
- virtual long Binary(short x, int y) = 0; // NOLINT
- virtual int Decimal(bool b, char c, short d, int e, long f, // NOLINT
- float g, double h, unsigned i, char* j, const string& k)
- = 0;
-
- virtual bool TakesNonConstReference(int& n) = 0; // NOLINT
- virtual string TakesConstReference(const int& n) = 0;
-#ifdef GMOCK_ALLOWS_CONST_PARAM_FUNCTIONS
- virtual bool TakesConst(const int x) = 0;
-#endif // GMOCK_ALLOWS_CONST_PARAM_FUNCTIONS
-
- virtual int OverloadedOnArgumentNumber() = 0;
- virtual int OverloadedOnArgumentNumber(int n) = 0;
-
- virtual int OverloadedOnArgumentType(int n) = 0;
- virtual char OverloadedOnArgumentType(char c) = 0;
-
- virtual int OverloadedOnConstness() = 0;
- virtual char OverloadedOnConstness() const = 0;
-
- virtual int TypeWithHole(int (*func)()) = 0;
- virtual int TypeWithComma(const std::map<int, string>& a_map) = 0;
-
-#if GTEST_OS_WINDOWS
- STDMETHOD_(int, CTNullary)() = 0;
- STDMETHOD_(bool, CTUnary)(int x) = 0;
- STDMETHOD_(int, CTDecimal)(bool b, char c, short d, int e, long f, // NOLINT
- float g, double h, unsigned i, char* j, const string& k) = 0;
- STDMETHOD_(char, CTConst)(int x) const = 0;
-#endif // GTEST_OS_WINDOWS
-};
-
-class MockFoo : public FooInterface {
- public:
- MockFoo() {}
-
- // Makes sure that a mock function parameter can be named.
- MOCK_METHOD1(VoidReturning, void(int n)); // NOLINT
-
- MOCK_METHOD0(Nullary, int()); // NOLINT
-
- // Makes sure that a mock function parameter can be unnamed.
- MOCK_METHOD1(Unary, bool(int)); // NOLINT
- MOCK_METHOD2(Binary, long(short, int)); // NOLINT
- MOCK_METHOD10(Decimal, int(bool, char, short, int, long, float, // NOLINT
- double, unsigned, char*, const string& str));
-
- MOCK_METHOD1(TakesNonConstReference, bool(int&)); // NOLINT
- MOCK_METHOD1(TakesConstReference, string(const int&));
-#ifdef GMOCK_ALLOWS_CONST_PARAM_FUNCTIONS
- MOCK_METHOD1(TakesConst, bool(const int)); // NOLINT
-#endif // GMOCK_ALLOWS_CONST_PARAM_FUNCTIONS
- MOCK_METHOD0(OverloadedOnArgumentNumber, int()); // NOLINT
- MOCK_METHOD1(OverloadedOnArgumentNumber, int(int)); // NOLINT
-
- MOCK_METHOD1(OverloadedOnArgumentType, int(int)); // NOLINT
- MOCK_METHOD1(OverloadedOnArgumentType, char(char)); // NOLINT
-
- MOCK_METHOD0(OverloadedOnConstness, int()); // NOLINT
- MOCK_CONST_METHOD0(OverloadedOnConstness, char()); // NOLINT
-
- MOCK_METHOD1(TypeWithHole, int(int (*)())); // NOLINT
- MOCK_METHOD1(TypeWithComma, int(const std::map<int, string>&)); // NOLINT
-#if GTEST_OS_WINDOWS
- MOCK_METHOD0_WITH_CALLTYPE(STDMETHODCALLTYPE, CTNullary, int());
- MOCK_METHOD1_WITH_CALLTYPE(STDMETHODCALLTYPE, CTUnary, bool(int));
- MOCK_METHOD10_WITH_CALLTYPE(STDMETHODCALLTYPE, CTDecimal, int(bool b, char c,
- short d, int e, long f, float g, double h, unsigned i, char* j,
- const string& k));
- MOCK_CONST_METHOD1_WITH_CALLTYPE(STDMETHODCALLTYPE, CTConst, char(int));
-#endif // GTEST_OS_WINDOWS
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFoo);
-};
-
-class FunctionMockerTest : public testing::Test {
- protected:
- FunctionMockerTest() : foo_(&mock_foo_) {}
-
- FooInterface* const foo_;
- MockFoo mock_foo_;
-};
-
-// Tests mocking a void-returning function.
-TEST_F(FunctionMockerTest, MocksVoidFunction) {
- EXPECT_CALL(mock_foo_, VoidReturning(Lt(100)));
- foo_->VoidReturning(0);
-}
-
-// Tests mocking a nullary function.
-TEST_F(FunctionMockerTest, MocksNullaryFunction) {
- EXPECT_CALL(mock_foo_, Nullary())
- .WillOnce(DoDefault())
- .WillOnce(Return(1));
-
- EXPECT_EQ(0, foo_->Nullary());
- EXPECT_EQ(1, foo_->Nullary());
-}
-
-// Tests mocking a unary function.
-TEST_F(FunctionMockerTest, MocksUnaryFunction) {
- EXPECT_CALL(mock_foo_, Unary(Eq(2)))
- .Times(2)
- .WillOnce(Return(true));
-
- EXPECT_TRUE(foo_->Unary(2));
- EXPECT_FALSE(foo_->Unary(2));
-}
-
-// Tests mocking a binary function.
-TEST_F(FunctionMockerTest, MocksBinaryFunction) {
- EXPECT_CALL(mock_foo_, Binary(2, _))
- .WillOnce(Return(3));
-
- EXPECT_EQ(3, foo_->Binary(2, 1));
-}
-
-// Tests mocking a decimal function.
-TEST_F(FunctionMockerTest, MocksDecimalFunction) {
- EXPECT_CALL(mock_foo_, Decimal(true, 'a', 0, 0, 1L, A<float>(),
- Lt(100), 5U, NULL, "hi"))
- .WillOnce(Return(5));
-
- EXPECT_EQ(5, foo_->Decimal(true, 'a', 0, 0, 1, 0, 0, 5, NULL, "hi"));
-}
-
-// Tests mocking a function that takes a non-const reference.
-TEST_F(FunctionMockerTest, MocksFunctionWithNonConstReferenceArgument) {
- int a = 0;
- EXPECT_CALL(mock_foo_, TakesNonConstReference(Ref(a)))
- .WillOnce(Return(true));
-
- EXPECT_TRUE(foo_->TakesNonConstReference(a));
-}
-
-// Tests mocking a function that takes a const reference.
-TEST_F(FunctionMockerTest, MocksFunctionWithConstReferenceArgument) {
- int a = 0;
- EXPECT_CALL(mock_foo_, TakesConstReference(Ref(a)))
- .WillOnce(Return("Hello"));
-
- EXPECT_EQ("Hello", foo_->TakesConstReference(a));
-}
-
-#ifdef GMOCK_ALLOWS_CONST_PARAM_FUNCTIONS
-// Tests mocking a function that takes a const variable.
-TEST_F(FunctionMockerTest, MocksFunctionWithConstArgument) {
- EXPECT_CALL(mock_foo_, TakesConst(Lt(10)))
- .WillOnce(DoDefault());
-
- EXPECT_FALSE(foo_->TakesConst(5));
-}
-#endif // GMOCK_ALLOWS_CONST_PARAM_FUNCTIONS
-
-// Tests mocking functions overloaded on the number of arguments.
-TEST_F(FunctionMockerTest, MocksFunctionsOverloadedOnArgumentNumber) {
- EXPECT_CALL(mock_foo_, OverloadedOnArgumentNumber())
- .WillOnce(Return(1));
- EXPECT_CALL(mock_foo_, OverloadedOnArgumentNumber(_))
- .WillOnce(Return(2));
-
- EXPECT_EQ(2, foo_->OverloadedOnArgumentNumber(1));
- EXPECT_EQ(1, foo_->OverloadedOnArgumentNumber());
-}
-
-// Tests mocking functions overloaded on the types of argument.
-TEST_F(FunctionMockerTest, MocksFunctionsOverloadedOnArgumentType) {
- EXPECT_CALL(mock_foo_, OverloadedOnArgumentType(An<int>()))
- .WillOnce(Return(1));
- EXPECT_CALL(mock_foo_, OverloadedOnArgumentType(TypedEq<char>('a')))
- .WillOnce(Return('b'));
-
- EXPECT_EQ(1, foo_->OverloadedOnArgumentType(0));
- EXPECT_EQ('b', foo_->OverloadedOnArgumentType('a'));
-}
-
-// Tests mocking functions overloaded on the const-ness of this object.
-TEST_F(FunctionMockerTest, MocksFunctionsOverloadedOnConstnessOfThis) {
- EXPECT_CALL(mock_foo_, OverloadedOnConstness());
- EXPECT_CALL(Const(mock_foo_), OverloadedOnConstness())
- .WillOnce(Return('a'));
-
- EXPECT_EQ(0, foo_->OverloadedOnConstness());
- EXPECT_EQ('a', Const(*foo_).OverloadedOnConstness());
-}
-
-#if GTEST_OS_WINDOWS
-// Tests mocking a nullary function with calltype.
-TEST_F(FunctionMockerTest, MocksNullaryFunctionWithCallType) {
- EXPECT_CALL(mock_foo_, CTNullary())
- .WillOnce(Return(-1))
- .WillOnce(Return(0));
-
- EXPECT_EQ(-1, foo_->CTNullary());
- EXPECT_EQ(0, foo_->CTNullary());
-}
-
-// Tests mocking a unary function with calltype.
-TEST_F(FunctionMockerTest, MocksUnaryFunctionWithCallType) {
- EXPECT_CALL(mock_foo_, CTUnary(Eq(2)))
- .Times(2)
- .WillOnce(Return(true))
- .WillOnce(Return(false));
-
- EXPECT_TRUE(foo_->CTUnary(2));
- EXPECT_FALSE(foo_->CTUnary(2));
-}
-
-// Tests mocking a decimal function with calltype.
-TEST_F(FunctionMockerTest, MocksDecimalFunctionWithCallType) {
- EXPECT_CALL(mock_foo_, CTDecimal(true, 'a', 0, 0, 1L, A<float>(),
- Lt(100), 5U, NULL, "hi"))
- .WillOnce(Return(10));
-
- EXPECT_EQ(10, foo_->CTDecimal(true, 'a', 0, 0, 1, 0, 0, 5, NULL, "hi"));
-}
-
-// Tests mocking functions overloaded on the const-ness of this object.
-TEST_F(FunctionMockerTest, MocksFunctionsConstFunctionWithCallType) {
- EXPECT_CALL(Const(mock_foo_), CTConst(_))
- .WillOnce(Return('a'));
-
- EXPECT_EQ('a', Const(*foo_).CTConst(0));
-}
-
-#endif // GTEST_OS_WINDOWS
-
-class MockB {
- public:
- MockB() {}
-
- MOCK_METHOD0(DoB, void());
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(MockB);
-};
-
-// Tests that functions with no EXPECT_CALL() ruls can be called any
-// number of times.
-TEST(ExpectCallTest, UnmentionedFunctionCanBeCalledAnyNumberOfTimes) {
- {
- MockB b;
- }
-
- {
- MockB b;
- b.DoB();
- }
-
- {
- MockB b;
- b.DoB();
- b.DoB();
- }
-}
-
-// Tests mocking template interfaces.
-
-template <typename T>
-class StackInterface {
- public:
- virtual ~StackInterface() {}
-
- // Template parameter appears in function parameter.
- virtual void Push(const T& value) = 0;
- virtual void Pop() = 0;
- virtual int GetSize() const = 0;
- // Template parameter appears in function return type.
- virtual const T& GetTop() const = 0;
-};
-
-template <typename T>
-class MockStack : public StackInterface<T> {
- public:
- MockStack() {}
-
- MOCK_METHOD1_T(Push, void(const T& elem));
- MOCK_METHOD0_T(Pop, void());
- MOCK_CONST_METHOD0_T(GetSize, int()); // NOLINT
- MOCK_CONST_METHOD0_T(GetTop, const T&());
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(MockStack);
-};
-
-// Tests that template mock works.
-TEST(TemplateMockTest, Works) {
- MockStack<int> mock;
-
- EXPECT_CALL(mock, GetSize())
- .WillOnce(Return(0))
- .WillOnce(Return(1))
- .WillOnce(Return(0));
- EXPECT_CALL(mock, Push(_));
- int n = 5;
- EXPECT_CALL(mock, GetTop())
- .WillOnce(ReturnRef(n));
- EXPECT_CALL(mock, Pop())
- .Times(AnyNumber());
-
- EXPECT_EQ(0, mock.GetSize());
- mock.Push(5);
- EXPECT_EQ(1, mock.GetSize());
- EXPECT_EQ(5, mock.GetTop());
- mock.Pop();
- EXPECT_EQ(0, mock.GetSize());
-}
-
-#if GTEST_OS_WINDOWS
-// Tests mocking template interfaces with calltype.
-
-template <typename T>
-class StackInterfaceWithCallType {
- public:
- virtual ~StackInterfaceWithCallType() {}
-
- // Template parameter appears in function parameter.
- STDMETHOD_(void, Push)(const T& value) = 0;
- STDMETHOD_(void, Pop)() = 0;
- STDMETHOD_(int, GetSize)() const = 0;
- // Template parameter appears in function return type.
- STDMETHOD_(const T&, GetTop)() const = 0;
-};
-
-template <typename T>
-class MockStackWithCallType : public StackInterfaceWithCallType<T> {
- public:
- MockStackWithCallType() {}
-
- MOCK_METHOD1_T_WITH_CALLTYPE(STDMETHODCALLTYPE, Push, void(const T& elem));
- MOCK_METHOD0_T_WITH_CALLTYPE(STDMETHODCALLTYPE, Pop, void());
- MOCK_CONST_METHOD0_T_WITH_CALLTYPE(STDMETHODCALLTYPE, GetSize, int());
- MOCK_CONST_METHOD0_T_WITH_CALLTYPE(STDMETHODCALLTYPE, GetTop, const T&());
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(MockStackWithCallType);
-};
-
-// Tests that template mock with calltype works.
-TEST(TemplateMockTestWithCallType, Works) {
- MockStackWithCallType<int> mock;
-
- EXPECT_CALL(mock, GetSize())
- .WillOnce(Return(0))
- .WillOnce(Return(1))
- .WillOnce(Return(0));
- EXPECT_CALL(mock, Push(_));
- int n = 5;
- EXPECT_CALL(mock, GetTop())
- .WillOnce(ReturnRef(n));
- EXPECT_CALL(mock, Pop())
- .Times(AnyNumber());
-
- EXPECT_EQ(0, mock.GetSize());
- mock.Push(5);
- EXPECT_EQ(1, mock.GetSize());
- EXPECT_EQ(5, mock.GetTop());
- mock.Pop();
- EXPECT_EQ(0, mock.GetSize());
-}
-#endif // GTEST_OS_WINDOWS
-
-#define MY_MOCK_METHODS1_ \
- MOCK_METHOD0(Overloaded, void()); \
- MOCK_CONST_METHOD1(Overloaded, int(int n)); \
- MOCK_METHOD2(Overloaded, bool(bool f, int n))
-
-class MockOverloadedOnArgNumber {
- public:
- MockOverloadedOnArgNumber() {}
-
- MY_MOCK_METHODS1_;
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(MockOverloadedOnArgNumber);
-};
-
-TEST(OverloadedMockMethodTest, CanOverloadOnArgNumberInMacroBody) {
- MockOverloadedOnArgNumber mock;
- EXPECT_CALL(mock, Overloaded());
- EXPECT_CALL(mock, Overloaded(1)).WillOnce(Return(2));
- EXPECT_CALL(mock, Overloaded(true, 1)).WillOnce(Return(true));
-
- mock.Overloaded();
- EXPECT_EQ(2, mock.Overloaded(1));
- EXPECT_TRUE(mock.Overloaded(true, 1));
-}
-
-#define MY_MOCK_METHODS2_ \
- MOCK_CONST_METHOD1(Overloaded, int(int n)); \
- MOCK_METHOD1(Overloaded, int(int n));
-
-class MockOverloadedOnConstness {
- public:
- MockOverloadedOnConstness() {}
-
- MY_MOCK_METHODS2_;
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(MockOverloadedOnConstness);
-};
-
-TEST(OverloadedMockMethodTest, CanOverloadOnConstnessInMacroBody) {
- MockOverloadedOnConstness mock;
- const MockOverloadedOnConstness* const_mock = &mock;
- EXPECT_CALL(mock, Overloaded(1)).WillOnce(Return(2));
- EXPECT_CALL(*const_mock, Overloaded(1)).WillOnce(Return(3));
-
- EXPECT_EQ(2, mock.Overloaded(1));
- EXPECT_EQ(3, const_mock->Overloaded(1));
-}
-
-TEST(MockFunctionTest, WorksForVoidNullary) {
- MockFunction<void()> foo;
- EXPECT_CALL(foo, Call());
- foo.Call();
-}
-
-TEST(MockFunctionTest, WorksForNonVoidNullary) {
- MockFunction<int()> foo;
- EXPECT_CALL(foo, Call())
- .WillOnce(Return(1))
- .WillOnce(Return(2));
- EXPECT_EQ(1, foo.Call());
- EXPECT_EQ(2, foo.Call());
-}
-
-TEST(MockFunctionTest, WorksForVoidUnary) {
- MockFunction<void(int)> foo;
- EXPECT_CALL(foo, Call(1));
- foo.Call(1);
-}
-
-TEST(MockFunctionTest, WorksForNonVoidBinary) {
- MockFunction<int(bool, int)> foo;
- EXPECT_CALL(foo, Call(false, 42))
- .WillOnce(Return(1))
- .WillOnce(Return(2));
- EXPECT_CALL(foo, Call(true, Ge(100)))
- .WillOnce(Return(3));
- EXPECT_EQ(1, foo.Call(false, 42));
- EXPECT_EQ(2, foo.Call(false, 42));
- EXPECT_EQ(3, foo.Call(true, 120));
-}
-
-TEST(MockFunctionTest, WorksFor10Arguments) {
- MockFunction<int(bool a0, char a1, int a2, int a3, int a4,
- int a5, int a6, char a7, int a8, bool a9)> foo;
- EXPECT_CALL(foo, Call(_, 'a', _, _, _, _, _, _, _, _))
- .WillOnce(Return(1))
- .WillOnce(Return(2));
- EXPECT_EQ(1, foo.Call(false, 'a', 0, 0, 0, 0, 0, 'b', 0, true));
- EXPECT_EQ(2, foo.Call(true, 'a', 0, 0, 0, 0, 0, 'b', 1, false));
-}
-
-} // namespace gmock_generated_function_mockers_test
-} // namespace testing
diff --git a/src/testing/test/gmock-generated-internal-utils_test.cc b/src/testing/test/gmock-generated-internal-utils_test.cc
deleted file mode 100644
index 1156c7db..00000000
--- a/src/testing/test/gmock-generated-internal-utils_test.cc
+++ /dev/null
@@ -1,127 +0,0 @@
-// Copyright 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-// Google Mock - a framework for writing C++ mock classes.
-//
-// This file tests the internal utilities.
-
-#include "gmock/internal/gmock-generated-internal-utils.h"
-#include "gmock/internal/gmock-internal-utils.h"
-#include "gtest/gtest.h"
-
-namespace {
-
-using ::std::tr1::tuple;
-using ::testing::Matcher;
-using ::testing::internal::CompileAssertTypesEqual;
-using ::testing::internal::MatcherTuple;
-using ::testing::internal::Function;
-using ::testing::internal::IgnoredValue;
-
-// Tests the MatcherTuple template struct.
-
-TEST(MatcherTupleTest, ForSize0) {
- CompileAssertTypesEqual<tuple<>, MatcherTuple<tuple<> >::type>();
-}
-
-TEST(MatcherTupleTest, ForSize1) {
- CompileAssertTypesEqual<tuple<Matcher<int> >,
- MatcherTuple<tuple<int> >::type>();
-}
-
-TEST(MatcherTupleTest, ForSize2) {
- CompileAssertTypesEqual<tuple<Matcher<int>, Matcher<char> >,
- MatcherTuple<tuple<int, char> >::type>();
-}
-
-TEST(MatcherTupleTest, ForSize5) {
- CompileAssertTypesEqual<tuple<Matcher<int>, Matcher<char>, Matcher<bool>,
- Matcher<double>, Matcher<char*> >,
- MatcherTuple<tuple<int, char, bool, double, char*>
- >::type>();
-}
-
-// Tests the Function template struct.
-
-TEST(FunctionTest, Nullary) {
- typedef Function<int()> F; // NOLINT
- CompileAssertTypesEqual<int, F::Result>();
- CompileAssertTypesEqual<tuple<>, F::ArgumentTuple>();
- CompileAssertTypesEqual<tuple<>, F::ArgumentMatcherTuple>();
- CompileAssertTypesEqual<void(), F::MakeResultVoid>();
- CompileAssertTypesEqual<IgnoredValue(), F::MakeResultIgnoredValue>();
-}
-
-TEST(FunctionTest, Unary) {
- typedef Function<int(bool)> F; // NOLINT
- CompileAssertTypesEqual<int, F::Result>();
- CompileAssertTypesEqual<bool, F::Argument1>();
- CompileAssertTypesEqual<tuple<bool>, F::ArgumentTuple>();
- CompileAssertTypesEqual<tuple<Matcher<bool> >, F::ArgumentMatcherTuple>();
- CompileAssertTypesEqual<void(bool), F::MakeResultVoid>(); // NOLINT
- CompileAssertTypesEqual<IgnoredValue(bool), // NOLINT
- F::MakeResultIgnoredValue>();
-}
-
-TEST(FunctionTest, Binary) {
- typedef Function<int(bool, const long&)> F; // NOLINT
- CompileAssertTypesEqual<int, F::Result>();
- CompileAssertTypesEqual<bool, F::Argument1>();
- CompileAssertTypesEqual<const long&, F::Argument2>(); // NOLINT
- CompileAssertTypesEqual<tuple<bool, const long&>, F::ArgumentTuple>(); // NOLINT
- CompileAssertTypesEqual<tuple<Matcher<bool>, Matcher<const long&> >, // NOLINT
- F::ArgumentMatcherTuple>();
- CompileAssertTypesEqual<void(bool, const long&), F::MakeResultVoid>(); // NOLINT
- CompileAssertTypesEqual<IgnoredValue(bool, const long&), // NOLINT
- F::MakeResultIgnoredValue>();
-}
-
-TEST(FunctionTest, LongArgumentList) {
- typedef Function<char(bool, int, char*, int&, const long&)> F; // NOLINT
- CompileAssertTypesEqual<char, F::Result>();
- CompileAssertTypesEqual<bool, F::Argument1>();
- CompileAssertTypesEqual<int, F::Argument2>();
- CompileAssertTypesEqual<char*, F::Argument3>();
- CompileAssertTypesEqual<int&, F::Argument4>();
- CompileAssertTypesEqual<const long&, F::Argument5>(); // NOLINT
- CompileAssertTypesEqual<tuple<bool, int, char*, int&, const long&>, // NOLINT
- F::ArgumentTuple>();
- CompileAssertTypesEqual<tuple<Matcher<bool>, Matcher<int>, Matcher<char*>,
- Matcher<int&>, Matcher<const long&> >, // NOLINT
- F::ArgumentMatcherTuple>();
- CompileAssertTypesEqual<void(bool, int, char*, int&, const long&), // NOLINT
- F::MakeResultVoid>();
- CompileAssertTypesEqual<
- IgnoredValue(bool, int, char*, int&, const long&), // NOLINT
- F::MakeResultIgnoredValue>();
-}
-
-} // Unnamed namespace
diff --git a/src/testing/test/gmock-generated-matchers_test.cc b/src/testing/test/gmock-generated-matchers_test.cc
deleted file mode 100644
index b35c4505..00000000
--- a/src/testing/test/gmock-generated-matchers_test.cc
+++ /dev/null
@@ -1,1141 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Google Mock - a framework for writing C++ mock classes.
-//
-// This file tests the built-in matchers generated by a script.
-
-#include "gmock/gmock-generated-matchers.h"
-
-#include <list>
-#include <map>
-#include <set>
-#include <sstream>
-#include <string>
-#include <utility>
-#include <vector>
-
-#include "gmock/gmock.h"
-#include "gtest/gtest.h"
-#include "gtest/gtest-spi.h"
-
-namespace {
-
-using std::list;
-using std::map;
-using std::pair;
-using std::set;
-using std::stringstream;
-using std::vector;
-using std::tr1::get;
-using std::tr1::make_tuple;
-using std::tr1::tuple;
-using testing::_;
-using testing::Args;
-using testing::Contains;
-using testing::ElementsAre;
-using testing::ElementsAreArray;
-using testing::Eq;
-using testing::Ge;
-using testing::Gt;
-using testing::Lt;
-using testing::MakeMatcher;
-using testing::Matcher;
-using testing::MatcherInterface;
-using testing::MatchResultListener;
-using testing::Ne;
-using testing::Not;
-using testing::Pointee;
-using testing::PrintToString;
-using testing::Ref;
-using testing::StaticAssertTypeEq;
-using testing::StrEq;
-using testing::Value;
-using testing::internal::string;
-
-// Returns the description of the given matcher.
-template <typename T>
-string Describe(const Matcher<T>& m) {
- stringstream ss;
- m.DescribeTo(&ss);
- return ss.str();
-}
-
-// Returns the description of the negation of the given matcher.
-template <typename T>
-string DescribeNegation(const Matcher<T>& m) {
- stringstream ss;
- m.DescribeNegationTo(&ss);
- return ss.str();
-}
-
-// Returns the reason why x matches, or doesn't match, m.
-template <typename MatcherType, typename Value>
-string Explain(const MatcherType& m, const Value& x) {
- stringstream ss;
- m.ExplainMatchResultTo(x, &ss);
- return ss.str();
-}
-
-// Tests Args<k0, ..., kn>(m).
-
-TEST(ArgsTest, AcceptsZeroTemplateArg) {
- const tuple<int, bool> t(5, true);
- EXPECT_THAT(t, Args<>(Eq(tuple<>())));
- EXPECT_THAT(t, Not(Args<>(Ne(tuple<>()))));
-}
-
-TEST(ArgsTest, AcceptsOneTemplateArg) {
- const tuple<int, bool> t(5, true);
- EXPECT_THAT(t, Args<0>(Eq(make_tuple(5))));
- EXPECT_THAT(t, Args<1>(Eq(make_tuple(true))));
- EXPECT_THAT(t, Not(Args<1>(Eq(make_tuple(false)))));
-}
-
-TEST(ArgsTest, AcceptsTwoTemplateArgs) {
- const tuple<short, int, long> t(4, 5, 6L); // NOLINT
-
- EXPECT_THAT(t, (Args<0, 1>(Lt())));
- EXPECT_THAT(t, (Args<1, 2>(Lt())));
- EXPECT_THAT(t, Not(Args<0, 2>(Gt())));
-}
-
-TEST(ArgsTest, AcceptsRepeatedTemplateArgs) {
- const tuple<short, int, long> t(4, 5, 6L); // NOLINT
- EXPECT_THAT(t, (Args<0, 0>(Eq())));
- EXPECT_THAT(t, Not(Args<1, 1>(Ne())));
-}
-
-TEST(ArgsTest, AcceptsDecreasingTemplateArgs) {
- const tuple<short, int, long> t(4, 5, 6L); // NOLINT
- EXPECT_THAT(t, (Args<2, 0>(Gt())));
- EXPECT_THAT(t, Not(Args<2, 1>(Lt())));
-}
-
-// The MATCHER*() macros trigger warning C4100 (unreferenced formal
-// parameter) in MSVC with -W4. Unfortunately they cannot be fixed in
-// the macro definition, as the warnings are generated when the macro
-// is expanded and macro expansion cannot contain #pragma. Therefore
-// we suppress them here.
-#ifdef _MSC_VER
-# pragma warning(push)
-# pragma warning(disable:4100)
-#endif
-
-MATCHER(SumIsZero, "") {
- return get<0>(arg) + get<1>(arg) + get<2>(arg) == 0;
-}
-
-TEST(ArgsTest, AcceptsMoreTemplateArgsThanArityOfOriginalTuple) {
- EXPECT_THAT(make_tuple(-1, 2), (Args<0, 0, 1>(SumIsZero())));
- EXPECT_THAT(make_tuple(1, 2), Not(Args<0, 0, 1>(SumIsZero())));
-}
-
-TEST(ArgsTest, CanBeNested) {
- const tuple<short, int, long, int> t(4, 5, 6L, 6); // NOLINT
- EXPECT_THAT(t, (Args<1, 2, 3>(Args<1, 2>(Eq()))));
- EXPECT_THAT(t, (Args<0, 1, 3>(Args<0, 2>(Lt()))));
-}
-
-TEST(ArgsTest, CanMatchTupleByValue) {
- typedef tuple<char, int, int> Tuple3;
- const Matcher<Tuple3> m = Args<1, 2>(Lt());
- EXPECT_TRUE(m.Matches(Tuple3('a', 1, 2)));
- EXPECT_FALSE(m.Matches(Tuple3('b', 2, 2)));
-}
-
-TEST(ArgsTest, CanMatchTupleByReference) {
- typedef tuple<char, char, int> Tuple3;
- const Matcher<const Tuple3&> m = Args<0, 1>(Lt());
- EXPECT_TRUE(m.Matches(Tuple3('a', 'b', 2)));
- EXPECT_FALSE(m.Matches(Tuple3('b', 'b', 2)));
-}
-
-// Validates that arg is printed as str.
-MATCHER_P(PrintsAs, str, "") {
- return testing::PrintToString(arg) == str;
-}
-
-TEST(ArgsTest, AcceptsTenTemplateArgs) {
- EXPECT_THAT(make_tuple(0, 1L, 2, 3L, 4, 5, 6, 7, 8, 9),
- (Args<9, 8, 7, 6, 5, 4, 3, 2, 1, 0>(
- PrintsAs("(9, 8, 7, 6, 5, 4, 3, 2, 1, 0)"))));
- EXPECT_THAT(make_tuple(0, 1L, 2, 3L, 4, 5, 6, 7, 8, 9),
- Not(Args<9, 8, 7, 6, 5, 4, 3, 2, 1, 0>(
- PrintsAs("(0, 8, 7, 6, 5, 4, 3, 2, 1, 0)"))));
-}
-
-TEST(ArgsTest, DescirbesSelfCorrectly) {
- const Matcher<tuple<int, bool, char> > m = Args<2, 0>(Lt());
- EXPECT_EQ("are a tuple whose fields (#2, #0) are a pair where "
- "the first < the second",
- Describe(m));
-}
-
-TEST(ArgsTest, DescirbesNestedArgsCorrectly) {
- const Matcher<const tuple<int, bool, char, int>&> m =
- Args<0, 2, 3>(Args<2, 0>(Lt()));
- EXPECT_EQ("are a tuple whose fields (#0, #2, #3) are a tuple "
- "whose fields (#2, #0) are a pair where the first < the second",
- Describe(m));
-}
-
-TEST(ArgsTest, DescribesNegationCorrectly) {
- const Matcher<tuple<int, char> > m = Args<1, 0>(Gt());
- EXPECT_EQ("are a tuple whose fields (#1, #0) aren't a pair "
- "where the first > the second",
- DescribeNegation(m));
-}
-
-TEST(ArgsTest, ExplainsMatchResultWithoutInnerExplanation) {
- const Matcher<tuple<bool, int, int> > m = Args<1, 2>(Eq());
- EXPECT_EQ("whose fields (#1, #2) are (42, 42)",
- Explain(m, make_tuple(false, 42, 42)));
- EXPECT_EQ("whose fields (#1, #2) are (42, 43)",
- Explain(m, make_tuple(false, 42, 43)));
-}
-
-// For testing Args<>'s explanation.
-class LessThanMatcher : public MatcherInterface<tuple<char, int> > {
- public:
- virtual void DescribeTo(::std::ostream* os) const {}
-
- virtual bool MatchAndExplain(tuple<char, int> value,
- MatchResultListener* listener) const {
- const int diff = get<0>(value) - get<1>(value);
- if (diff > 0) {
- *listener << "where the first value is " << diff
- << " more than the second";
- }
- return diff < 0;
- }
-};
-
-Matcher<tuple<char, int> > LessThan() {
- return MakeMatcher(new LessThanMatcher);
-}
-
-TEST(ArgsTest, ExplainsMatchResultWithInnerExplanation) {
- const Matcher<tuple<char, int, int> > m = Args<0, 2>(LessThan());
- EXPECT_EQ("whose fields (#0, #2) are ('a' (97, 0x61), 42), "
- "where the first value is 55 more than the second",
- Explain(m, make_tuple('a', 42, 42)));
- EXPECT_EQ("whose fields (#0, #2) are ('\\0', 43)",
- Explain(m, make_tuple('\0', 42, 43)));
-}
-
-// For testing ExplainMatchResultTo().
-class GreaterThanMatcher : public MatcherInterface<int> {
- public:
- explicit GreaterThanMatcher(int rhs) : rhs_(rhs) {}
-
- virtual void DescribeTo(::std::ostream* os) const {
- *os << "is greater than " << rhs_;
- }
-
- virtual bool MatchAndExplain(int lhs,
- MatchResultListener* listener) const {
- const int diff = lhs - rhs_;
- if (diff > 0) {
- *listener << "which is " << diff << " more than " << rhs_;
- } else if (diff == 0) {
- *listener << "which is the same as " << rhs_;
- } else {
- *listener << "which is " << -diff << " less than " << rhs_;
- }
-
- return lhs > rhs_;
- }
-
- private:
- int rhs_;
-};
-
-Matcher<int> GreaterThan(int n) {
- return MakeMatcher(new GreaterThanMatcher(n));
-}
-
-// Tests for ElementsAre().
-
-// Evaluates to the number of elements in 'array'.
-#define GMOCK_ARRAY_SIZE_(array) (sizeof(array)/sizeof(array[0]))
-
-TEST(ElementsAreTest, CanDescribeExpectingNoElement) {
- Matcher<const vector<int>&> m = ElementsAre();
- EXPECT_EQ("is empty", Describe(m));
-}
-
-TEST(ElementsAreTest, CanDescribeExpectingOneElement) {
- Matcher<vector<int> > m = ElementsAre(Gt(5));
- EXPECT_EQ("has 1 element that is > 5", Describe(m));
-}
-
-TEST(ElementsAreTest, CanDescribeExpectingManyElements) {
- Matcher<list<string> > m = ElementsAre(StrEq("one"), "two");
- EXPECT_EQ("has 2 elements where\n"
- "element #0 is equal to \"one\",\n"
- "element #1 is equal to \"two\"", Describe(m));
-}
-
-TEST(ElementsAreTest, CanDescribeNegationOfExpectingNoElement) {
- Matcher<vector<int> > m = ElementsAre();
- EXPECT_EQ("isn't empty", DescribeNegation(m));
-}
-
-TEST(ElementsAreTest, CanDescribeNegationOfExpectingOneElment) {
- Matcher<const list<int>& > m = ElementsAre(Gt(5));
- EXPECT_EQ("doesn't have 1 element, or\n"
- "element #0 isn't > 5", DescribeNegation(m));
-}
-
-TEST(ElementsAreTest, CanDescribeNegationOfExpectingManyElements) {
- Matcher<const list<string>& > m = ElementsAre("one", "two");
- EXPECT_EQ("doesn't have 2 elements, or\n"
- "element #0 isn't equal to \"one\", or\n"
- "element #1 isn't equal to \"two\"", DescribeNegation(m));
-}
-
-TEST(ElementsAreTest, DoesNotExplainTrivialMatch) {
- Matcher<const list<int>& > m = ElementsAre(1, Ne(2));
-
- list<int> test_list;
- test_list.push_back(1);
- test_list.push_back(3);
- EXPECT_EQ("", Explain(m, test_list)); // No need to explain anything.
-}
-
-TEST(ElementsAreTest, ExplainsNonTrivialMatch) {
- Matcher<const vector<int>& > m =
- ElementsAre(GreaterThan(1), 0, GreaterThan(2));
-
- const int a[] = { 10, 0, 100 };
- vector<int> test_vector(a, a + GMOCK_ARRAY_SIZE_(a));
- EXPECT_EQ("whose element #0 matches, which is 9 more than 1,\n"
- "and whose element #2 matches, which is 98 more than 2",
- Explain(m, test_vector));
-}
-
-TEST(ElementsAreTest, CanExplainMismatchWrongSize) {
- Matcher<const list<int>& > m = ElementsAre(1, 3);
-
- list<int> test_list;
- // No need to explain when the container is empty.
- EXPECT_EQ("", Explain(m, test_list));
-
- test_list.push_back(1);
- EXPECT_EQ("which has 1 element", Explain(m, test_list));
-}
-
-TEST(ElementsAreTest, CanExplainMismatchRightSize) {
- Matcher<const vector<int>& > m = ElementsAre(1, GreaterThan(5));
-
- vector<int> v;
- v.push_back(2);
- v.push_back(1);
- EXPECT_EQ("whose element #0 doesn't match", Explain(m, v));
-
- v[0] = 1;
- EXPECT_EQ("whose element #1 doesn't match, which is 4 less than 5",
- Explain(m, v));
-}
-
-TEST(ElementsAreTest, MatchesOneElementVector) {
- vector<string> test_vector;
- test_vector.push_back("test string");
-
- EXPECT_THAT(test_vector, ElementsAre(StrEq("test string")));
-}
-
-TEST(ElementsAreTest, MatchesOneElementList) {
- list<string> test_list;
- test_list.push_back("test string");
-
- EXPECT_THAT(test_list, ElementsAre("test string"));
-}
-
-TEST(ElementsAreTest, MatchesThreeElementVector) {
- vector<string> test_vector;
- test_vector.push_back("one");
- test_vector.push_back("two");
- test_vector.push_back("three");
-
- EXPECT_THAT(test_vector, ElementsAre("one", StrEq("two"), _));
-}
-
-TEST(ElementsAreTest, MatchesOneElementEqMatcher) {
- vector<int> test_vector;
- test_vector.push_back(4);
-
- EXPECT_THAT(test_vector, ElementsAre(Eq(4)));
-}
-
-TEST(ElementsAreTest, MatchesOneElementAnyMatcher) {
- vector<int> test_vector;
- test_vector.push_back(4);
-
- EXPECT_THAT(test_vector, ElementsAre(_));
-}
-
-TEST(ElementsAreTest, MatchesOneElementValue) {
- vector<int> test_vector;
- test_vector.push_back(4);
-
- EXPECT_THAT(test_vector, ElementsAre(4));
-}
-
-TEST(ElementsAreTest, MatchesThreeElementsMixedMatchers) {
- vector<int> test_vector;
- test_vector.push_back(1);
- test_vector.push_back(2);
- test_vector.push_back(3);
-
- EXPECT_THAT(test_vector, ElementsAre(1, Eq(2), _));
-}
-
-TEST(ElementsAreTest, MatchesTenElementVector) {
- const int a[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
- vector<int> test_vector(a, a + GMOCK_ARRAY_SIZE_(a));
-
- EXPECT_THAT(test_vector,
- // The element list can contain values and/or matchers
- // of different types.
- ElementsAre(0, Ge(0), _, 3, 4, Ne(2), Eq(6), 7, 8, _));
-}
-
-TEST(ElementsAreTest, DoesNotMatchWrongSize) {
- vector<string> test_vector;
- test_vector.push_back("test string");
- test_vector.push_back("test string");
-
- Matcher<vector<string> > m = ElementsAre(StrEq("test string"));
- EXPECT_FALSE(m.Matches(test_vector));
-}
-
-TEST(ElementsAreTest, DoesNotMatchWrongValue) {
- vector<string> test_vector;
- test_vector.push_back("other string");
-
- Matcher<vector<string> > m = ElementsAre(StrEq("test string"));
- EXPECT_FALSE(m.Matches(test_vector));
-}
-
-TEST(ElementsAreTest, DoesNotMatchWrongOrder) {
- vector<string> test_vector;
- test_vector.push_back("one");
- test_vector.push_back("three");
- test_vector.push_back("two");
-
- Matcher<vector<string> > m = ElementsAre(
- StrEq("one"), StrEq("two"), StrEq("three"));
- EXPECT_FALSE(m.Matches(test_vector));
-}
-
-TEST(ElementsAreTest, WorksForNestedContainer) {
- const char* strings[] = {
- "Hi",
- "world"
- };
-
- vector<list<char> > nested;
- for (size_t i = 0; i < GMOCK_ARRAY_SIZE_(strings); i++) {
- nested.push_back(list<char>(strings[i], strings[i] + strlen(strings[i])));
- }
-
- EXPECT_THAT(nested, ElementsAre(ElementsAre('H', Ne('e')),
- ElementsAre('w', 'o', _, _, 'd')));
- EXPECT_THAT(nested, Not(ElementsAre(ElementsAre('H', 'e'),
- ElementsAre('w', 'o', _, _, 'd'))));
-}
-
-TEST(ElementsAreTest, WorksWithByRefElementMatchers) {
- int a[] = { 0, 1, 2 };
- vector<int> v(a, a + GMOCK_ARRAY_SIZE_(a));
-
- EXPECT_THAT(v, ElementsAre(Ref(v[0]), Ref(v[1]), Ref(v[2])));
- EXPECT_THAT(v, Not(ElementsAre(Ref(v[0]), Ref(v[1]), Ref(a[2]))));
-}
-
-TEST(ElementsAreTest, WorksWithContainerPointerUsingPointee) {
- int a[] = { 0, 1, 2 };
- vector<int> v(a, a + GMOCK_ARRAY_SIZE_(a));
-
- EXPECT_THAT(&v, Pointee(ElementsAre(0, 1, _)));
- EXPECT_THAT(&v, Not(Pointee(ElementsAre(0, _, 3))));
-}
-
-TEST(ElementsAreTest, WorksWithNativeArrayPassedByReference) {
- int array[] = { 0, 1, 2 };
- EXPECT_THAT(array, ElementsAre(0, 1, _));
- EXPECT_THAT(array, Not(ElementsAre(1, _, _)));
- EXPECT_THAT(array, Not(ElementsAre(0, _)));
-}
-
-class NativeArrayPassedAsPointerAndSize {
- public:
- NativeArrayPassedAsPointerAndSize() {}
-
- MOCK_METHOD2(Helper, void(int* array, int size));
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(NativeArrayPassedAsPointerAndSize);
-};
-
-TEST(ElementsAreTest, WorksWithNativeArrayPassedAsPointerAndSize) {
- int array[] = { 0, 1 };
- ::std::tr1::tuple<int*, size_t> array_as_tuple(array, 2);
- EXPECT_THAT(array_as_tuple, ElementsAre(0, 1));
- EXPECT_THAT(array_as_tuple, Not(ElementsAre(0)));
-
- NativeArrayPassedAsPointerAndSize helper;
- EXPECT_CALL(helper, Helper(_, _))
- .With(ElementsAre(0, 1));
- helper.Helper(array, 2);
-}
-
-TEST(ElementsAreTest, WorksWithTwoDimensionalNativeArray) {
- const char a2[][3] = { "hi", "lo" };
- EXPECT_THAT(a2, ElementsAre(ElementsAre('h', 'i', '\0'),
- ElementsAre('l', 'o', '\0')));
- EXPECT_THAT(a2, ElementsAre(StrEq("hi"), StrEq("lo")));
- EXPECT_THAT(a2, ElementsAre(Not(ElementsAre('h', 'o', '\0')),
- ElementsAre('l', 'o', '\0')));
-}
-
-// Tests for ElementsAreArray(). Since ElementsAreArray() shares most
-// of the implementation with ElementsAre(), we don't test it as
-// thoroughly here.
-
-TEST(ElementsAreArrayTest, CanBeCreatedWithValueArray) {
- const int a[] = { 1, 2, 3 };
-
- vector<int> test_vector(a, a + GMOCK_ARRAY_SIZE_(a));
- EXPECT_THAT(test_vector, ElementsAreArray(a));
-
- test_vector[2] = 0;
- EXPECT_THAT(test_vector, Not(ElementsAreArray(a)));
-}
-
-TEST(ElementsAreArrayTest, CanBeCreatedWithArraySize) {
- const char* a[] = { "one", "two", "three" };
-
- vector<string> test_vector(a, a + GMOCK_ARRAY_SIZE_(a));
- EXPECT_THAT(test_vector, ElementsAreArray(a, GMOCK_ARRAY_SIZE_(a)));
-
- const char** p = a;
- test_vector[0] = "1";
- EXPECT_THAT(test_vector, Not(ElementsAreArray(p, GMOCK_ARRAY_SIZE_(a))));
-}
-
-TEST(ElementsAreArrayTest, CanBeCreatedWithoutArraySize) {
- const char* a[] = { "one", "two", "three" };
-
- vector<string> test_vector(a, a + GMOCK_ARRAY_SIZE_(a));
- EXPECT_THAT(test_vector, ElementsAreArray(a));
-
- test_vector[0] = "1";
- EXPECT_THAT(test_vector, Not(ElementsAreArray(a)));
-}
-
-TEST(ElementsAreArrayTest, CanBeCreatedWithMatcherArray) {
- const Matcher<string> kMatcherArray[] =
- { StrEq("one"), StrEq("two"), StrEq("three") };
-
- vector<string> test_vector;
- test_vector.push_back("one");
- test_vector.push_back("two");
- test_vector.push_back("three");
- EXPECT_THAT(test_vector, ElementsAreArray(kMatcherArray));
-
- test_vector.push_back("three");
- EXPECT_THAT(test_vector, Not(ElementsAreArray(kMatcherArray)));
-}
-
-// Since ElementsAre() and ElementsAreArray() share much of the
-// implementation, we only do a sanity test for native arrays here.
-TEST(ElementsAreArrayTest, WorksWithNativeArray) {
- ::std::string a[] = { "hi", "ho" };
- ::std::string b[] = { "hi", "ho" };
-
- EXPECT_THAT(a, ElementsAreArray(b));
- EXPECT_THAT(a, ElementsAreArray(b, 2));
- EXPECT_THAT(a, Not(ElementsAreArray(b, 1)));
-}
-
-// Tests for the MATCHER*() macro family.
-
-// Tests that a simple MATCHER() definition works.
-
-MATCHER(IsEven, "") { return (arg % 2) == 0; }
-
-TEST(MatcherMacroTest, Works) {
- const Matcher<int> m = IsEven();
- EXPECT_TRUE(m.Matches(6));
- EXPECT_FALSE(m.Matches(7));
-
- EXPECT_EQ("is even", Describe(m));
- EXPECT_EQ("not (is even)", DescribeNegation(m));
- EXPECT_EQ("", Explain(m, 6));
- EXPECT_EQ("", Explain(m, 7));
-}
-
-// This also tests that the description string can reference 'negation'.
-MATCHER(IsEven2, negation ? "is odd" : "is even") {
- if ((arg % 2) == 0) {
- // Verifies that we can stream to result_listener, a listener
- // supplied by the MATCHER macro implicitly.
- *result_listener << "OK";
- return true;
- } else {
- *result_listener << "% 2 == " << (arg % 2);
- return false;
- }
-}
-
-// This also tests that the description string can reference matcher
-// parameters.
-MATCHER_P2(EqSumOf, x, y,
- string(negation ? "doesn't equal" : "equals") + " the sum of " +
- PrintToString(x) + " and " + PrintToString(y)) {
- if (arg == (x + y)) {
- *result_listener << "OK";
- return true;
- } else {
- // Verifies that we can stream to the underlying stream of
- // result_listener.
- if (result_listener->stream() != NULL) {
- *result_listener->stream() << "diff == " << (x + y - arg);
- }
- return false;
- }
-}
-
-// Tests that the matcher description can reference 'negation' and the
-// matcher parameters.
-TEST(MatcherMacroTest, DescriptionCanReferenceNegationAndParameters) {
- const Matcher<int> m1 = IsEven2();
- EXPECT_EQ("is even", Describe(m1));
- EXPECT_EQ("is odd", DescribeNegation(m1));
-
- const Matcher<int> m2 = EqSumOf(5, 9);
- EXPECT_EQ("equals the sum of 5 and 9", Describe(m2));
- EXPECT_EQ("doesn't equal the sum of 5 and 9", DescribeNegation(m2));
-}
-
-// Tests explaining match result in a MATCHER* macro.
-TEST(MatcherMacroTest, CanExplainMatchResult) {
- const Matcher<int> m1 = IsEven2();
- EXPECT_EQ("OK", Explain(m1, 4));
- EXPECT_EQ("% 2 == 1", Explain(m1, 5));
-
- const Matcher<int> m2 = EqSumOf(1, 2);
- EXPECT_EQ("OK", Explain(m2, 3));
- EXPECT_EQ("diff == -1", Explain(m2, 4));
-}
-
-// Tests that the body of MATCHER() can reference the type of the
-// value being matched.
-
-MATCHER(IsEmptyString, "") {
- StaticAssertTypeEq< ::std::string, arg_type>();
- return arg == "";
-}
-
-MATCHER(IsEmptyStringByRef, "") {
- StaticAssertTypeEq<const ::std::string&, arg_type>();
- return arg == "";
-}
-
-TEST(MatcherMacroTest, CanReferenceArgType) {
- const Matcher< ::std::string> m1 = IsEmptyString();
- EXPECT_TRUE(m1.Matches(""));
-
- const Matcher<const ::std::string&> m2 = IsEmptyStringByRef();
- EXPECT_TRUE(m2.Matches(""));
-}
-
-// Tests that MATCHER() can be used in a namespace.
-
-namespace matcher_test {
-MATCHER(IsOdd, "") { return (arg % 2) != 0; }
-} // namespace matcher_test
-
-TEST(MatcherMacroTest, WorksInNamespace) {
- Matcher<int> m = matcher_test::IsOdd();
- EXPECT_FALSE(m.Matches(4));
- EXPECT_TRUE(m.Matches(5));
-}
-
-// Tests that Value() can be used to compose matchers.
-MATCHER(IsPositiveOdd, "") {
- return Value(arg, matcher_test::IsOdd()) && arg > 0;
-}
-
-TEST(MatcherMacroTest, CanBeComposedUsingValue) {
- EXPECT_THAT(3, IsPositiveOdd());
- EXPECT_THAT(4, Not(IsPositiveOdd()));
- EXPECT_THAT(-1, Not(IsPositiveOdd()));
-}
-
-// Tests that a simple MATCHER_P() definition works.
-
-MATCHER_P(IsGreaterThan32And, n, "") { return arg > 32 && arg > n; }
-
-TEST(MatcherPMacroTest, Works) {
- const Matcher<int> m = IsGreaterThan32And(5);
- EXPECT_TRUE(m.Matches(36));
- EXPECT_FALSE(m.Matches(5));
-
- EXPECT_EQ("is greater than 32 and 5", Describe(m));
- EXPECT_EQ("not (is greater than 32 and 5)", DescribeNegation(m));
- EXPECT_EQ("", Explain(m, 36));
- EXPECT_EQ("", Explain(m, 5));
-}
-
-// Tests that the description is calculated correctly from the matcher name.
-MATCHER_P(_is_Greater_Than32and_, n, "") { return arg > 32 && arg > n; }
-
-TEST(MatcherPMacroTest, GeneratesCorrectDescription) {
- const Matcher<int> m = _is_Greater_Than32and_(5);
-
- EXPECT_EQ("is greater than 32 and 5", Describe(m));
- EXPECT_EQ("not (is greater than 32 and 5)", DescribeNegation(m));
- EXPECT_EQ("", Explain(m, 36));
- EXPECT_EQ("", Explain(m, 5));
-}
-
-// Tests that a MATCHER_P matcher can be explicitly instantiated with
-// a reference parameter type.
-
-class UncopyableFoo {
- public:
- explicit UncopyableFoo(char value) : value_(value) {}
- private:
- UncopyableFoo(const UncopyableFoo&);
- void operator=(const UncopyableFoo&);
-
- char value_;
-};
-
-MATCHER_P(ReferencesUncopyable, variable, "") { return &arg == &variable; }
-
-TEST(MatcherPMacroTest, WorksWhenExplicitlyInstantiatedWithReference) {
- UncopyableFoo foo1('1'), foo2('2');
- const Matcher<const UncopyableFoo&> m =
- ReferencesUncopyable<const UncopyableFoo&>(foo1);
-
- EXPECT_TRUE(m.Matches(foo1));
- EXPECT_FALSE(m.Matches(foo2));
-
- // We don't want the address of the parameter printed, as most
- // likely it will just annoy the user. If the address is
- // interesting, the user should consider passing the parameter by
- // pointer instead.
- EXPECT_EQ("references uncopyable 1-byte object <31>", Describe(m));
-}
-
-
-// Tests that the body of MATCHER_Pn() can reference the parameter
-// types.
-
-MATCHER_P3(ParamTypesAreIntLongAndChar, foo, bar, baz, "") {
- StaticAssertTypeEq<int, foo_type>();
- StaticAssertTypeEq<long, bar_type>(); // NOLINT
- StaticAssertTypeEq<char, baz_type>();
- return arg == 0;
-}
-
-TEST(MatcherPnMacroTest, CanReferenceParamTypes) {
- EXPECT_THAT(0, ParamTypesAreIntLongAndChar(10, 20L, 'a'));
-}
-
-// Tests that a MATCHER_Pn matcher can be explicitly instantiated with
-// reference parameter types.
-
-MATCHER_P2(ReferencesAnyOf, variable1, variable2, "") {
- return &arg == &variable1 || &arg == &variable2;
-}
-
-TEST(MatcherPnMacroTest, WorksWhenExplicitlyInstantiatedWithReferences) {
- UncopyableFoo foo1('1'), foo2('2'), foo3('3');
- const Matcher<const UncopyableFoo&> m =
- ReferencesAnyOf<const UncopyableFoo&, const UncopyableFoo&>(foo1, foo2);
-
- EXPECT_TRUE(m.Matches(foo1));
- EXPECT_TRUE(m.Matches(foo2));
- EXPECT_FALSE(m.Matches(foo3));
-}
-
-TEST(MatcherPnMacroTest,
- GeneratesCorretDescriptionWhenExplicitlyInstantiatedWithReferences) {
- UncopyableFoo foo1('1'), foo2('2');
- const Matcher<const UncopyableFoo&> m =
- ReferencesAnyOf<const UncopyableFoo&, const UncopyableFoo&>(foo1, foo2);
-
- // We don't want the addresses of the parameters printed, as most
- // likely they will just annoy the user. If the addresses are
- // interesting, the user should consider passing the parameters by
- // pointers instead.
- EXPECT_EQ("references any of (1-byte object <31>, 1-byte object <32>)",
- Describe(m));
-}
-
-// Tests that a simple MATCHER_P2() definition works.
-
-MATCHER_P2(IsNotInClosedRange, low, hi, "") { return arg < low || arg > hi; }
-
-TEST(MatcherPnMacroTest, Works) {
- const Matcher<const long&> m = IsNotInClosedRange(10, 20); // NOLINT
- EXPECT_TRUE(m.Matches(36L));
- EXPECT_FALSE(m.Matches(15L));
-
- EXPECT_EQ("is not in closed range (10, 20)", Describe(m));
- EXPECT_EQ("not (is not in closed range (10, 20))", DescribeNegation(m));
- EXPECT_EQ("", Explain(m, 36L));
- EXPECT_EQ("", Explain(m, 15L));
-}
-
-// Tests that MATCHER*() definitions can be overloaded on the number
-// of parameters; also tests MATCHER_Pn() where n >= 3.
-
-MATCHER(EqualsSumOf, "") { return arg == 0; }
-MATCHER_P(EqualsSumOf, a, "") { return arg == a; }
-MATCHER_P2(EqualsSumOf, a, b, "") { return arg == a + b; }
-MATCHER_P3(EqualsSumOf, a, b, c, "") { return arg == a + b + c; }
-MATCHER_P4(EqualsSumOf, a, b, c, d, "") { return arg == a + b + c + d; }
-MATCHER_P5(EqualsSumOf, a, b, c, d, e, "") { return arg == a + b + c + d + e; }
-MATCHER_P6(EqualsSumOf, a, b, c, d, e, f, "") {
- return arg == a + b + c + d + e + f;
-}
-MATCHER_P7(EqualsSumOf, a, b, c, d, e, f, g, "") {
- return arg == a + b + c + d + e + f + g;
-}
-MATCHER_P8(EqualsSumOf, a, b, c, d, e, f, g, h, "") {
- return arg == a + b + c + d + e + f + g + h;
-}
-MATCHER_P9(EqualsSumOf, a, b, c, d, e, f, g, h, i, "") {
- return arg == a + b + c + d + e + f + g + h + i;
-}
-MATCHER_P10(EqualsSumOf, a, b, c, d, e, f, g, h, i, j, "") {
- return arg == a + b + c + d + e + f + g + h + i + j;
-}
-
-TEST(MatcherPnMacroTest, CanBeOverloadedOnNumberOfParameters) {
- EXPECT_THAT(0, EqualsSumOf());
- EXPECT_THAT(1, EqualsSumOf(1));
- EXPECT_THAT(12, EqualsSumOf(10, 2));
- EXPECT_THAT(123, EqualsSumOf(100, 20, 3));
- EXPECT_THAT(1234, EqualsSumOf(1000, 200, 30, 4));
- EXPECT_THAT(12345, EqualsSumOf(10000, 2000, 300, 40, 5));
- EXPECT_THAT("abcdef",
- EqualsSumOf(::std::string("a"), 'b', 'c', "d", "e", 'f'));
- EXPECT_THAT("abcdefg",
- EqualsSumOf(::std::string("a"), 'b', 'c', "d", "e", 'f', 'g'));
- EXPECT_THAT("abcdefgh",
- EqualsSumOf(::std::string("a"), 'b', 'c', "d", "e", 'f', 'g',
- "h"));
- EXPECT_THAT("abcdefghi",
- EqualsSumOf(::std::string("a"), 'b', 'c', "d", "e", 'f', 'g',
- "h", 'i'));
- EXPECT_THAT("abcdefghij",
- EqualsSumOf(::std::string("a"), 'b', 'c', "d", "e", 'f', 'g',
- "h", 'i', ::std::string("j")));
-
- EXPECT_THAT(1, Not(EqualsSumOf()));
- EXPECT_THAT(-1, Not(EqualsSumOf(1)));
- EXPECT_THAT(-12, Not(EqualsSumOf(10, 2)));
- EXPECT_THAT(-123, Not(EqualsSumOf(100, 20, 3)));
- EXPECT_THAT(-1234, Not(EqualsSumOf(1000, 200, 30, 4)));
- EXPECT_THAT(-12345, Not(EqualsSumOf(10000, 2000, 300, 40, 5)));
- EXPECT_THAT("abcdef ",
- Not(EqualsSumOf(::std::string("a"), 'b', 'c', "d", "e", 'f')));
- EXPECT_THAT("abcdefg ",
- Not(EqualsSumOf(::std::string("a"), 'b', 'c', "d", "e", 'f',
- 'g')));
- EXPECT_THAT("abcdefgh ",
- Not(EqualsSumOf(::std::string("a"), 'b', 'c', "d", "e", 'f', 'g',
- "h")));
- EXPECT_THAT("abcdefghi ",
- Not(EqualsSumOf(::std::string("a"), 'b', 'c', "d", "e", 'f', 'g',
- "h", 'i')));
- EXPECT_THAT("abcdefghij ",
- Not(EqualsSumOf(::std::string("a"), 'b', 'c', "d", "e", 'f', 'g',
- "h", 'i', ::std::string("j"))));
-}
-
-// Tests that a MATCHER_Pn() definition can be instantiated with any
-// compatible parameter types.
-TEST(MatcherPnMacroTest, WorksForDifferentParameterTypes) {
- EXPECT_THAT(123, EqualsSumOf(100L, 20, static_cast<char>(3)));
- EXPECT_THAT("abcd", EqualsSumOf(::std::string("a"), "b", 'c', "d"));
-
- EXPECT_THAT(124, Not(EqualsSumOf(100L, 20, static_cast<char>(3))));
- EXPECT_THAT("abcde", Not(EqualsSumOf(::std::string("a"), "b", 'c', "d")));
-}
-
-// Tests that the matcher body can promote the parameter types.
-
-MATCHER_P2(EqConcat, prefix, suffix, "") {
- // The following lines promote the two parameters to desired types.
- std::string prefix_str(prefix);
- char suffix_char = static_cast<char>(suffix);
- return arg == prefix_str + suffix_char;
-}
-
-TEST(MatcherPnMacroTest, SimpleTypePromotion) {
- Matcher<std::string> no_promo =
- EqConcat(std::string("foo"), 't');
- Matcher<const std::string&> promo =
- EqConcat("foo", static_cast<int>('t'));
- EXPECT_FALSE(no_promo.Matches("fool"));
- EXPECT_FALSE(promo.Matches("fool"));
- EXPECT_TRUE(no_promo.Matches("foot"));
- EXPECT_TRUE(promo.Matches("foot"));
-}
-
-// Verifies the type of a MATCHER*.
-
-TEST(MatcherPnMacroTest, TypesAreCorrect) {
- // EqualsSumOf() must be assignable to a EqualsSumOfMatcher variable.
- EqualsSumOfMatcher a0 = EqualsSumOf();
-
- // EqualsSumOf(1) must be assignable to a EqualsSumOfMatcherP variable.
- EqualsSumOfMatcherP<int> a1 = EqualsSumOf(1);
-
- // EqualsSumOf(p1, ..., pk) must be assignable to a EqualsSumOfMatcherPk
- // variable, and so on.
- EqualsSumOfMatcherP2<int, char> a2 = EqualsSumOf(1, '2');
- EqualsSumOfMatcherP3<int, int, char> a3 = EqualsSumOf(1, 2, '3');
- EqualsSumOfMatcherP4<int, int, int, char> a4 = EqualsSumOf(1, 2, 3, '4');
- EqualsSumOfMatcherP5<int, int, int, int, char> a5 =
- EqualsSumOf(1, 2, 3, 4, '5');
- EqualsSumOfMatcherP6<int, int, int, int, int, char> a6 =
- EqualsSumOf(1, 2, 3, 4, 5, '6');
- EqualsSumOfMatcherP7<int, int, int, int, int, int, char> a7 =
- EqualsSumOf(1, 2, 3, 4, 5, 6, '7');
- EqualsSumOfMatcherP8<int, int, int, int, int, int, int, char> a8 =
- EqualsSumOf(1, 2, 3, 4, 5, 6, 7, '8');
- EqualsSumOfMatcherP9<int, int, int, int, int, int, int, int, char> a9 =
- EqualsSumOf(1, 2, 3, 4, 5, 6, 7, 8, '9');
- EqualsSumOfMatcherP10<int, int, int, int, int, int, int, int, int, char> a10 =
- EqualsSumOf(1, 2, 3, 4, 5, 6, 7, 8, 9, '0');
-}
-
-// Tests that matcher-typed parameters can be used in Value() inside a
-// MATCHER_Pn definition.
-
-// Succeeds if arg matches exactly 2 of the 3 matchers.
-MATCHER_P3(TwoOf, m1, m2, m3, "") {
- const int count = static_cast<int>(Value(arg, m1))
- + static_cast<int>(Value(arg, m2)) + static_cast<int>(Value(arg, m3));
- return count == 2;
-}
-
-TEST(MatcherPnMacroTest, CanUseMatcherTypedParameterInValue) {
- EXPECT_THAT(42, TwoOf(Gt(0), Lt(50), Eq(10)));
- EXPECT_THAT(0, Not(TwoOf(Gt(-1), Lt(1), Eq(0))));
-}
-
-// Tests Contains().
-
-TEST(ContainsTest, ListMatchesWhenElementIsInContainer) {
- list<int> some_list;
- some_list.push_back(3);
- some_list.push_back(1);
- some_list.push_back(2);
- EXPECT_THAT(some_list, Contains(1));
- EXPECT_THAT(some_list, Contains(Gt(2.5)));
- EXPECT_THAT(some_list, Contains(Eq(2.0f)));
-
- list<string> another_list;
- another_list.push_back("fee");
- another_list.push_back("fie");
- another_list.push_back("foe");
- another_list.push_back("fum");
- EXPECT_THAT(another_list, Contains(string("fee")));
-}
-
-TEST(ContainsTest, ListDoesNotMatchWhenElementIsNotInContainer) {
- list<int> some_list;
- some_list.push_back(3);
- some_list.push_back(1);
- EXPECT_THAT(some_list, Not(Contains(4)));
-}
-
-TEST(ContainsTest, SetMatchesWhenElementIsInContainer) {
- set<int> some_set;
- some_set.insert(3);
- some_set.insert(1);
- some_set.insert(2);
- EXPECT_THAT(some_set, Contains(Eq(1.0)));
- EXPECT_THAT(some_set, Contains(Eq(3.0f)));
- EXPECT_THAT(some_set, Contains(2));
-
- set<const char*> another_set;
- another_set.insert("fee");
- another_set.insert("fie");
- another_set.insert("foe");
- another_set.insert("fum");
- EXPECT_THAT(another_set, Contains(Eq(string("fum"))));
-}
-
-TEST(ContainsTest, SetDoesNotMatchWhenElementIsNotInContainer) {
- set<int> some_set;
- some_set.insert(3);
- some_set.insert(1);
- EXPECT_THAT(some_set, Not(Contains(4)));
-
- set<const char*> c_string_set;
- c_string_set.insert("hello");
- EXPECT_THAT(c_string_set, Not(Contains(string("hello").c_str())));
-}
-
-TEST(ContainsTest, ExplainsMatchResultCorrectly) {
- const int a[2] = { 1, 2 };
- Matcher<const int(&)[2]> m = Contains(2);
- EXPECT_EQ("whose element #1 matches", Explain(m, a));
-
- m = Contains(3);
- EXPECT_EQ("", Explain(m, a));
-
- m = Contains(GreaterThan(0));
- EXPECT_EQ("whose element #0 matches, which is 1 more than 0", Explain(m, a));
-
- m = Contains(GreaterThan(10));
- EXPECT_EQ("", Explain(m, a));
-}
-
-TEST(ContainsTest, DescribesItselfCorrectly) {
- Matcher<vector<int> > m = Contains(1);
- EXPECT_EQ("contains at least one element that is equal to 1", Describe(m));
-
- Matcher<vector<int> > m2 = Not(m);
- EXPECT_EQ("doesn't contain any element that is equal to 1", Describe(m2));
-}
-
-TEST(ContainsTest, MapMatchesWhenElementIsInContainer) {
- map<const char*, int> my_map;
- const char* bar = "a string";
- my_map[bar] = 2;
- EXPECT_THAT(my_map, Contains(pair<const char* const, int>(bar, 2)));
-
- map<string, int> another_map;
- another_map["fee"] = 1;
- another_map["fie"] = 2;
- another_map["foe"] = 3;
- another_map["fum"] = 4;
- EXPECT_THAT(another_map, Contains(pair<const string, int>(string("fee"), 1)));
- EXPECT_THAT(another_map, Contains(pair<const string, int>("fie", 2)));
-}
-
-TEST(ContainsTest, MapDoesNotMatchWhenElementIsNotInContainer) {
- map<int, int> some_map;
- some_map[1] = 11;
- some_map[2] = 22;
- EXPECT_THAT(some_map, Not(Contains(pair<const int, int>(2, 23))));
-}
-
-TEST(ContainsTest, ArrayMatchesWhenElementIsInContainer) {
- const char* string_array[] = { "fee", "fie", "foe", "fum" };
- EXPECT_THAT(string_array, Contains(Eq(string("fum"))));
-}
-
-TEST(ContainsTest, ArrayDoesNotMatchWhenElementIsNotInContainer) {
- int int_array[] = { 1, 2, 3, 4 };
- EXPECT_THAT(int_array, Not(Contains(5)));
-}
-
-TEST(ContainsTest, AcceptsMatcher) {
- const int a[] = { 1, 2, 3 };
- EXPECT_THAT(a, Contains(Gt(2)));
- EXPECT_THAT(a, Not(Contains(Gt(4))));
-}
-
-TEST(ContainsTest, WorksForNativeArrayAsTuple) {
- const int a[] = { 1, 2 };
- const int* const pointer = a;
- EXPECT_THAT(make_tuple(pointer, 2), Contains(1));
- EXPECT_THAT(make_tuple(pointer, 2), Not(Contains(Gt(3))));
-}
-
-TEST(ContainsTest, WorksForTwoDimensionalNativeArray) {
- int a[][3] = { { 1, 2, 3 }, { 4, 5, 6 } };
- EXPECT_THAT(a, Contains(ElementsAre(4, 5, 6)));
- EXPECT_THAT(a, Contains(Contains(5)));
- EXPECT_THAT(a, Not(Contains(ElementsAre(3, 4, 5))));
- EXPECT_THAT(a, Contains(Not(Contains(5))));
-}
-
-TEST(AllOfTest, HugeMatcher) {
- // Verify that using AllOf with many arguments doesn't cause
- // the compiler to exceed template instantiation depth limit.
- EXPECT_THAT(0, testing::AllOf(_, _, _, _, _, _, _, _, _,
- testing::AllOf(_, _, _, _, _, _, _, _, _, _)));
-}
-
-TEST(AnyOfTest, HugeMatcher) {
- // Verify that using AnyOf with many arguments doesn't cause
- // the compiler to exceed template instantiation depth limit.
- EXPECT_THAT(0, testing::AnyOf(_, _, _, _, _, _, _, _, _,
- testing::AnyOf(_, _, _, _, _, _, _, _, _, _)));
-}
-
-namespace adl_test {
-
-// Verifies that the implementation of ::testing::AllOf and ::testing::AnyOf
-// don't issue unqualified recursive calls. If they do, the argument dependent
-// name lookup will cause AllOf/AnyOf in the 'adl_test' namespace to be found
-// as a candidate and the compilation will break due to an ambiguous overload.
-
-// The matcher must be in the same namespace as AllOf/AnyOf to make argument
-// dependent lookup find those.
-MATCHER(M, "") { return true; }
-
-template <typename T1, typename T2>
-bool AllOf(const T1& t1, const T2& t2) { return true; }
-
-TEST(AllOfTest, DoesNotCallAllOfUnqualified) {
- EXPECT_THAT(42, testing::AllOf(
- M(), M(), M(), M(), M(), M(), M(), M(), M(), M()));
-}
-
-template <typename T1, typename T2> bool
-AnyOf(const T1& t1, const T2& t2) { return true; }
-
-TEST(AnyOfTest, DoesNotCallAnyOfUnqualified) {
- EXPECT_THAT(42, testing::AnyOf(
- M(), M(), M(), M(), M(), M(), M(), M(), M(), M()));
-}
-
-} // namespace adl_test
-
-#ifdef _MSC_VER
-# pragma warning(pop)
-#endif
-
-} // namespace
diff --git a/src/testing/test/gmock-internal-utils_test.cc b/src/testing/test/gmock-internal-utils_test.cc
deleted file mode 100644
index d53282eb..00000000
--- a/src/testing/test/gmock-internal-utils_test.cc
+++ /dev/null
@@ -1,655 +0,0 @@
-// Copyright 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-// Google Mock - a framework for writing C++ mock classes.
-//
-// This file tests the internal utilities.
-
-#include "gmock/internal/gmock-internal-utils.h"
-#include <stdlib.h>
-#include <map>
-#include <string>
-#include <sstream>
-#include <vector>
-#include "gmock/gmock.h"
-#include "gmock/internal/gmock-port.h"
-#include "gtest/gtest.h"
-#include "gtest/gtest-spi.h"
-
-#if GTEST_OS_CYGWIN
-# include <sys/types.h> // For ssize_t. NOLINT
-#endif
-
-class ProtocolMessage;
-
-namespace proto2 {
-class Message;
-} // namespace proto2
-
-namespace testing {
-namespace internal {
-
-namespace {
-
-using ::std::tr1::make_tuple;
-using ::std::tr1::tuple;
-
-TEST(ConvertIdentifierNameToWordsTest, WorksWhenNameContainsNoWord) {
- EXPECT_EQ("", ConvertIdentifierNameToWords(""));
- EXPECT_EQ("", ConvertIdentifierNameToWords("_"));
- EXPECT_EQ("", ConvertIdentifierNameToWords("__"));
-}
-
-TEST(ConvertIdentifierNameToWordsTest, WorksWhenNameContainsDigits) {
- EXPECT_EQ("1", ConvertIdentifierNameToWords("_1"));
- EXPECT_EQ("2", ConvertIdentifierNameToWords("2_"));
- EXPECT_EQ("34", ConvertIdentifierNameToWords("_34_"));
- EXPECT_EQ("34 56", ConvertIdentifierNameToWords("_34_56"));
-}
-
-TEST(ConvertIdentifierNameToWordsTest, WorksWhenNameContainsCamelCaseWords) {
- EXPECT_EQ("a big word", ConvertIdentifierNameToWords("ABigWord"));
- EXPECT_EQ("foo bar", ConvertIdentifierNameToWords("FooBar"));
- EXPECT_EQ("foo", ConvertIdentifierNameToWords("Foo_"));
- EXPECT_EQ("foo bar", ConvertIdentifierNameToWords("_Foo_Bar_"));
- EXPECT_EQ("foo and bar", ConvertIdentifierNameToWords("_Foo__And_Bar"));
-}
-
-TEST(ConvertIdentifierNameToWordsTest, WorksWhenNameContains_SeparatedWords) {
- EXPECT_EQ("foo bar", ConvertIdentifierNameToWords("foo_bar"));
- EXPECT_EQ("foo", ConvertIdentifierNameToWords("_foo_"));
- EXPECT_EQ("foo bar", ConvertIdentifierNameToWords("_foo_bar_"));
- EXPECT_EQ("foo and bar", ConvertIdentifierNameToWords("_foo__and_bar"));
-}
-
-TEST(ConvertIdentifierNameToWordsTest, WorksWhenNameIsMixture) {
- EXPECT_EQ("foo bar 123", ConvertIdentifierNameToWords("Foo_bar123"));
- EXPECT_EQ("chapter 11 section 1",
- ConvertIdentifierNameToWords("_Chapter11Section_1_"));
-}
-
-TEST(PointeeOfTest, WorksForSmartPointers) {
- CompileAssertTypesEqual<const char,
- PointeeOf<internal::linked_ptr<const char> >::type>();
-}
-
-TEST(PointeeOfTest, WorksForRawPointers) {
- CompileAssertTypesEqual<int, PointeeOf<int*>::type>();
- CompileAssertTypesEqual<const char, PointeeOf<const char*>::type>();
- CompileAssertTypesEqual<void, PointeeOf<void*>::type>();
-}
-
-TEST(GetRawPointerTest, WorksForSmartPointers) {
- const char* const raw_p4 = new const char('a'); // NOLINT
- const internal::linked_ptr<const char> p4(raw_p4);
- EXPECT_EQ(raw_p4, GetRawPointer(p4));
-}
-
-TEST(GetRawPointerTest, WorksForRawPointers) {
- int* p = NULL;
- // Don't use EXPECT_EQ as no NULL-testing magic on Symbian.
- EXPECT_TRUE(NULL == GetRawPointer(p));
- int n = 1;
- EXPECT_EQ(&n, GetRawPointer(&n));
-}
-
-// Tests KindOf<T>.
-
-class Base {};
-class Derived : public Base {};
-
-TEST(KindOfTest, Bool) {
- EXPECT_EQ(kBool, GMOCK_KIND_OF_(bool)); // NOLINT
-}
-
-TEST(KindOfTest, Integer) {
- EXPECT_EQ(kInteger, GMOCK_KIND_OF_(char)); // NOLINT
- EXPECT_EQ(kInteger, GMOCK_KIND_OF_(signed char)); // NOLINT
- EXPECT_EQ(kInteger, GMOCK_KIND_OF_(unsigned char)); // NOLINT
- EXPECT_EQ(kInteger, GMOCK_KIND_OF_(short)); // NOLINT
- EXPECT_EQ(kInteger, GMOCK_KIND_OF_(unsigned short)); // NOLINT
- EXPECT_EQ(kInteger, GMOCK_KIND_OF_(int)); // NOLINT
- EXPECT_EQ(kInteger, GMOCK_KIND_OF_(unsigned int)); // NOLINT
- EXPECT_EQ(kInteger, GMOCK_KIND_OF_(long)); // NOLINT
- EXPECT_EQ(kInteger, GMOCK_KIND_OF_(unsigned long)); // NOLINT
- EXPECT_EQ(kInteger, GMOCK_KIND_OF_(wchar_t)); // NOLINT
- EXPECT_EQ(kInteger, GMOCK_KIND_OF_(Int64)); // NOLINT
- EXPECT_EQ(kInteger, GMOCK_KIND_OF_(UInt64)); // NOLINT
- EXPECT_EQ(kInteger, GMOCK_KIND_OF_(size_t)); // NOLINT
-#if GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_CYGWIN
- // ssize_t is not defined on Windows and possibly some other OSes.
- EXPECT_EQ(kInteger, GMOCK_KIND_OF_(ssize_t)); // NOLINT
-#endif
-}
-
-TEST(KindOfTest, FloatingPoint) {
- EXPECT_EQ(kFloatingPoint, GMOCK_KIND_OF_(float)); // NOLINT
- EXPECT_EQ(kFloatingPoint, GMOCK_KIND_OF_(double)); // NOLINT
- EXPECT_EQ(kFloatingPoint, GMOCK_KIND_OF_(long double)); // NOLINT
-}
-
-TEST(KindOfTest, Other) {
- EXPECT_EQ(kOther, GMOCK_KIND_OF_(void*)); // NOLINT
- EXPECT_EQ(kOther, GMOCK_KIND_OF_(char**)); // NOLINT
- EXPECT_EQ(kOther, GMOCK_KIND_OF_(Base)); // NOLINT
-}
-
-// Tests LosslessArithmeticConvertible<T, U>.
-
-TEST(LosslessArithmeticConvertibleTest, BoolToBool) {
- EXPECT_TRUE((LosslessArithmeticConvertible<bool, bool>::value));
-}
-
-TEST(LosslessArithmeticConvertibleTest, BoolToInteger) {
- EXPECT_TRUE((LosslessArithmeticConvertible<bool, char>::value));
- EXPECT_TRUE((LosslessArithmeticConvertible<bool, int>::value));
- EXPECT_TRUE(
- (LosslessArithmeticConvertible<bool, unsigned long>::value)); // NOLINT
-}
-
-TEST(LosslessArithmeticConvertibleTest, BoolToFloatingPoint) {
- EXPECT_TRUE((LosslessArithmeticConvertible<bool, float>::value));
- EXPECT_TRUE((LosslessArithmeticConvertible<bool, double>::value));
-}
-
-TEST(LosslessArithmeticConvertibleTest, IntegerToBool) {
- EXPECT_FALSE((LosslessArithmeticConvertible<unsigned char, bool>::value));
- EXPECT_FALSE((LosslessArithmeticConvertible<int, bool>::value));
-}
-
-TEST(LosslessArithmeticConvertibleTest, IntegerToInteger) {
- // Unsigned => larger signed is fine.
- EXPECT_TRUE((LosslessArithmeticConvertible<unsigned char, int>::value));
-
- // Unsigned => larger unsigned is fine.
- EXPECT_TRUE(
- (LosslessArithmeticConvertible<unsigned short, UInt64>::value)); // NOLINT
-
- // Signed => unsigned is not fine.
- EXPECT_FALSE((LosslessArithmeticConvertible<short, UInt64>::value)); // NOLINT
- EXPECT_FALSE((LosslessArithmeticConvertible<
- signed char, unsigned int>::value)); // NOLINT
-
- // Same size and same signedness: fine too.
- EXPECT_TRUE((LosslessArithmeticConvertible<
- unsigned char, unsigned char>::value));
- EXPECT_TRUE((LosslessArithmeticConvertible<int, int>::value));
- EXPECT_TRUE((LosslessArithmeticConvertible<wchar_t, wchar_t>::value));
- EXPECT_TRUE((LosslessArithmeticConvertible<
- unsigned long, unsigned long>::value)); // NOLINT
-
- // Same size, different signedness: not fine.
- EXPECT_FALSE((LosslessArithmeticConvertible<
- unsigned char, signed char>::value));
- EXPECT_FALSE((LosslessArithmeticConvertible<int, unsigned int>::value));
- EXPECT_FALSE((LosslessArithmeticConvertible<UInt64, Int64>::value));
-
- // Larger size => smaller size is not fine.
- EXPECT_FALSE((LosslessArithmeticConvertible<long, char>::value)); // NOLINT
- EXPECT_FALSE((LosslessArithmeticConvertible<int, signed char>::value));
- EXPECT_FALSE((LosslessArithmeticConvertible<Int64, unsigned int>::value));
-}
-
-TEST(LosslessArithmeticConvertibleTest, IntegerToFloatingPoint) {
- // Integers cannot be losslessly converted to floating-points, as
- // the format of the latter is implementation-defined.
- EXPECT_FALSE((LosslessArithmeticConvertible<char, float>::value));
- EXPECT_FALSE((LosslessArithmeticConvertible<int, double>::value));
- EXPECT_FALSE((LosslessArithmeticConvertible<
- short, long double>::value)); // NOLINT
-}
-
-TEST(LosslessArithmeticConvertibleTest, FloatingPointToBool) {
- EXPECT_FALSE((LosslessArithmeticConvertible<float, bool>::value));
- EXPECT_FALSE((LosslessArithmeticConvertible<double, bool>::value));
-}
-
-TEST(LosslessArithmeticConvertibleTest, FloatingPointToInteger) {
- EXPECT_FALSE((LosslessArithmeticConvertible<float, long>::value)); // NOLINT
- EXPECT_FALSE((LosslessArithmeticConvertible<double, Int64>::value));
- EXPECT_FALSE((LosslessArithmeticConvertible<long double, int>::value));
-}
-
-TEST(LosslessArithmeticConvertibleTest, FloatingPointToFloatingPoint) {
- // Smaller size => larger size is fine.
- EXPECT_TRUE((LosslessArithmeticConvertible<float, double>::value));
- EXPECT_TRUE((LosslessArithmeticConvertible<float, long double>::value));
- EXPECT_TRUE((LosslessArithmeticConvertible<double, long double>::value));
-
- // Same size: fine.
- EXPECT_TRUE((LosslessArithmeticConvertible<float, float>::value));
- EXPECT_TRUE((LosslessArithmeticConvertible<double, double>::value));
-
- // Larger size => smaller size is not fine.
- EXPECT_FALSE((LosslessArithmeticConvertible<double, float>::value));
- if (sizeof(double) == sizeof(long double)) { // NOLINT
- // In some implementations (e.g. MSVC), double and long double
- // have the same size.
- EXPECT_TRUE((LosslessArithmeticConvertible<long double, double>::value));
- } else {
- EXPECT_FALSE((LosslessArithmeticConvertible<long double, double>::value));
- }
-}
-
-// Tests the TupleMatches() template function.
-
-TEST(TupleMatchesTest, WorksForSize0) {
- tuple<> matchers;
- tuple<> values;
-
- EXPECT_TRUE(TupleMatches(matchers, values));
-}
-
-TEST(TupleMatchesTest, WorksForSize1) {
- tuple<Matcher<int> > matchers(Eq(1));
- tuple<int> values1(1),
- values2(2);
-
- EXPECT_TRUE(TupleMatches(matchers, values1));
- EXPECT_FALSE(TupleMatches(matchers, values2));
-}
-
-TEST(TupleMatchesTest, WorksForSize2) {
- tuple<Matcher<int>, Matcher<char> > matchers(Eq(1), Eq('a'));
- tuple<int, char> values1(1, 'a'),
- values2(1, 'b'),
- values3(2, 'a'),
- values4(2, 'b');
-
- EXPECT_TRUE(TupleMatches(matchers, values1));
- EXPECT_FALSE(TupleMatches(matchers, values2));
- EXPECT_FALSE(TupleMatches(matchers, values3));
- EXPECT_FALSE(TupleMatches(matchers, values4));
-}
-
-TEST(TupleMatchesTest, WorksForSize5) {
- tuple<Matcher<int>, Matcher<char>, Matcher<bool>, Matcher<long>, // NOLINT
- Matcher<string> >
- matchers(Eq(1), Eq('a'), Eq(true), Eq(2L), Eq("hi"));
- tuple<int, char, bool, long, string> // NOLINT
- values1(1, 'a', true, 2L, "hi"),
- values2(1, 'a', true, 2L, "hello"),
- values3(2, 'a', true, 2L, "hi");
-
- EXPECT_TRUE(TupleMatches(matchers, values1));
- EXPECT_FALSE(TupleMatches(matchers, values2));
- EXPECT_FALSE(TupleMatches(matchers, values3));
-}
-
-// Tests that Assert(true, ...) succeeds.
-TEST(AssertTest, SucceedsOnTrue) {
- Assert(true, __FILE__, __LINE__, "This should succeed.");
- Assert(true, __FILE__, __LINE__); // This should succeed too.
-}
-
-// Tests that Assert(false, ...) generates a fatal failure.
-TEST(AssertTest, FailsFatallyOnFalse) {
- EXPECT_DEATH_IF_SUPPORTED({
- Assert(false, __FILE__, __LINE__, "This should fail.");
- }, "");
-
- EXPECT_DEATH_IF_SUPPORTED({
- Assert(false, __FILE__, __LINE__);
- }, "");
-}
-
-// Tests that Expect(true, ...) succeeds.
-TEST(ExpectTest, SucceedsOnTrue) {
- Expect(true, __FILE__, __LINE__, "This should succeed.");
- Expect(true, __FILE__, __LINE__); // This should succeed too.
-}
-
-// Tests that Expect(false, ...) generates a non-fatal failure.
-TEST(ExpectTest, FailsNonfatallyOnFalse) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- Expect(false, __FILE__, __LINE__, "This should fail.");
- }, "This should fail");
-
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- Expect(false, __FILE__, __LINE__);
- }, "Expectation failed");
-}
-
-// Tests LogIsVisible().
-
-class LogIsVisibleTest : public ::testing::Test {
- protected:
- virtual void SetUp() {
- // The code needs to work when both ::string and ::std::string are
- // defined and the flag is implemented as a
- // testing::internal::String. In this case, without the call to
- // c_str(), the compiler will complain that it cannot figure out
- // whether the String flag should be converted to a ::string or an
- // ::std::string before being assigned to original_verbose_.
- original_verbose_ = GMOCK_FLAG(verbose).c_str();
- }
-
- virtual void TearDown() { GMOCK_FLAG(verbose) = original_verbose_; }
-
- string original_verbose_;
-};
-
-TEST_F(LogIsVisibleTest, AlwaysReturnsTrueIfVerbosityIsInfo) {
- GMOCK_FLAG(verbose) = kInfoVerbosity;
- EXPECT_TRUE(LogIsVisible(kInfo));
- EXPECT_TRUE(LogIsVisible(kWarning));
-}
-
-TEST_F(LogIsVisibleTest, AlwaysReturnsFalseIfVerbosityIsError) {
- GMOCK_FLAG(verbose) = kErrorVerbosity;
- EXPECT_FALSE(LogIsVisible(kInfo));
- EXPECT_FALSE(LogIsVisible(kWarning));
-}
-
-TEST_F(LogIsVisibleTest, WorksWhenVerbosityIsWarning) {
- GMOCK_FLAG(verbose) = kWarningVerbosity;
- EXPECT_FALSE(LogIsVisible(kInfo));
- EXPECT_TRUE(LogIsVisible(kWarning));
-}
-
-#if GTEST_HAS_STREAM_REDIRECTION
-
-// Tests the Log() function.
-
-// Verifies that Log() behaves correctly for the given verbosity level
-// and log severity.
-void TestLogWithSeverity(const string& verbosity, LogSeverity severity,
- bool should_print) {
- const string old_flag = GMOCK_FLAG(verbose);
- GMOCK_FLAG(verbose) = verbosity;
- CaptureStdout();
- Log(severity, "Test log.\n", 0);
- if (should_print) {
- EXPECT_THAT(GetCapturedStdout().c_str(),
- ContainsRegex(
- severity == kWarning ?
- "^\nGMOCK WARNING:\nTest log\\.\nStack trace:\n" :
- "^\nTest log\\.\nStack trace:\n"));
- } else {
- EXPECT_STREQ("", GetCapturedStdout().c_str());
- }
- GMOCK_FLAG(verbose) = old_flag;
-}
-
-// Tests that when the stack_frames_to_skip parameter is negative,
-// Log() doesn't include the stack trace in the output.
-TEST(LogTest, NoStackTraceWhenStackFramesToSkipIsNegative) {
- const string saved_flag = GMOCK_FLAG(verbose);
- GMOCK_FLAG(verbose) = kInfoVerbosity;
- CaptureStdout();
- Log(kInfo, "Test log.\n", -1);
- EXPECT_STREQ("\nTest log.\n", GetCapturedStdout().c_str());
- GMOCK_FLAG(verbose) = saved_flag;
-}
-
-// Tests that in opt mode, a positive stack_frames_to_skip argument is
-// treated as 0.
-TEST(LogTest, NoSkippingStackFrameInOptMode) {
- CaptureStdout();
- Log(kWarning, "Test log.\n", 100);
- const String log = GetCapturedStdout();
-
-# if defined(NDEBUG) && GTEST_GOOGLE3_MODE_
-
- // In opt mode, no stack frame should be skipped.
- EXPECT_THAT(log, ContainsRegex("\nGMOCK WARNING:\n"
- "Test log\\.\n"
- "Stack trace:\n"
- ".+"));
-# else
-
- // In dbg mode, the stack frames should be skipped.
- EXPECT_STREQ("\nGMOCK WARNING:\n"
- "Test log.\n"
- "Stack trace:\n", log.c_str());
-# endif
-}
-
-// Tests that all logs are printed when the value of the
-// --gmock_verbose flag is "info".
-TEST(LogTest, AllLogsArePrintedWhenVerbosityIsInfo) {
- TestLogWithSeverity(kInfoVerbosity, kInfo, true);
- TestLogWithSeverity(kInfoVerbosity, kWarning, true);
-}
-
-// Tests that only warnings are printed when the value of the
-// --gmock_verbose flag is "warning".
-TEST(LogTest, OnlyWarningsArePrintedWhenVerbosityIsWarning) {
- TestLogWithSeverity(kWarningVerbosity, kInfo, false);
- TestLogWithSeverity(kWarningVerbosity, kWarning, true);
-}
-
-// Tests that no logs are printed when the value of the
-// --gmock_verbose flag is "error".
-TEST(LogTest, NoLogsArePrintedWhenVerbosityIsError) {
- TestLogWithSeverity(kErrorVerbosity, kInfo, false);
- TestLogWithSeverity(kErrorVerbosity, kWarning, false);
-}
-
-// Tests that only warnings are printed when the value of the
-// --gmock_verbose flag is invalid.
-TEST(LogTest, OnlyWarningsArePrintedWhenVerbosityIsInvalid) {
- TestLogWithSeverity("invalid", kInfo, false);
- TestLogWithSeverity("invalid", kWarning, true);
-}
-
-#endif // GTEST_HAS_STREAM_REDIRECTION
-
-TEST(TypeTraitsTest, true_type) {
- EXPECT_TRUE(true_type::value);
-}
-
-TEST(TypeTraitsTest, false_type) {
- EXPECT_FALSE(false_type::value);
-}
-
-TEST(TypeTraitsTest, is_reference) {
- EXPECT_FALSE(is_reference<int>::value);
- EXPECT_FALSE(is_reference<char*>::value);
- EXPECT_TRUE(is_reference<const int&>::value);
-}
-
-TEST(TypeTraitsTest, is_pointer) {
- EXPECT_FALSE(is_pointer<int>::value);
- EXPECT_FALSE(is_pointer<char&>::value);
- EXPECT_TRUE(is_pointer<const int*>::value);
-}
-
-TEST(TypeTraitsTest, type_equals) {
- EXPECT_FALSE((type_equals<int, const int>::value));
- EXPECT_FALSE((type_equals<int, int&>::value));
- EXPECT_FALSE((type_equals<int, double>::value));
- EXPECT_TRUE((type_equals<char, char>::value));
-}
-
-TEST(TypeTraitsTest, remove_reference) {
- EXPECT_TRUE((type_equals<char, remove_reference<char&>::type>::value));
- EXPECT_TRUE((type_equals<const int,
- remove_reference<const int&>::type>::value));
- EXPECT_TRUE((type_equals<int, remove_reference<int>::type>::value));
- EXPECT_TRUE((type_equals<double*, remove_reference<double*>::type>::value));
-}
-
-#if GTEST_HAS_STREAM_REDIRECTION
-
-// Verifies that Log() behaves correctly for the given verbosity level
-// and log severity.
-String GrabOutput(void(*logger)(), const char* verbosity) {
- const string saved_flag = GMOCK_FLAG(verbose);
- GMOCK_FLAG(verbose) = verbosity;
- CaptureStdout();
- logger();
- GMOCK_FLAG(verbose) = saved_flag;
- return GetCapturedStdout();
-}
-
-class DummyMock {
- public:
- MOCK_METHOD0(TestMethod, void());
- MOCK_METHOD1(TestMethodArg, void(int dummy));
-};
-
-void ExpectCallLogger() {
- DummyMock mock;
- EXPECT_CALL(mock, TestMethod());
- mock.TestMethod();
-};
-
-// Verifies that EXPECT_CALL logs if the --gmock_verbose flag is set to "info".
-TEST(ExpectCallTest, LogsWhenVerbosityIsInfo) {
- EXPECT_THAT(GrabOutput(ExpectCallLogger, kInfoVerbosity),
- HasSubstr("EXPECT_CALL(mock, TestMethod())"));
-}
-
-// Verifies that EXPECT_CALL doesn't log
-// if the --gmock_verbose flag is set to "warning".
-TEST(ExpectCallTest, DoesNotLogWhenVerbosityIsWarning) {
- EXPECT_STREQ("", GrabOutput(ExpectCallLogger, kWarningVerbosity).c_str());
-}
-
-// Verifies that EXPECT_CALL doesn't log
-// if the --gmock_verbose flag is set to "error".
-TEST(ExpectCallTest, DoesNotLogWhenVerbosityIsError) {
- EXPECT_STREQ("", GrabOutput(ExpectCallLogger, kErrorVerbosity).c_str());
-}
-
-void OnCallLogger() {
- DummyMock mock;
- ON_CALL(mock, TestMethod());
-};
-
-// Verifies that ON_CALL logs if the --gmock_verbose flag is set to "info".
-TEST(OnCallTest, LogsWhenVerbosityIsInfo) {
- EXPECT_THAT(GrabOutput(OnCallLogger, kInfoVerbosity),
- HasSubstr("ON_CALL(mock, TestMethod())"));
-}
-
-// Verifies that ON_CALL doesn't log
-// if the --gmock_verbose flag is set to "warning".
-TEST(OnCallTest, DoesNotLogWhenVerbosityIsWarning) {
- EXPECT_STREQ("", GrabOutput(OnCallLogger, kWarningVerbosity).c_str());
-}
-
-// Verifies that ON_CALL doesn't log if
-// the --gmock_verbose flag is set to "error".
-TEST(OnCallTest, DoesNotLogWhenVerbosityIsError) {
- EXPECT_STREQ("", GrabOutput(OnCallLogger, kErrorVerbosity).c_str());
-}
-
-void OnCallAnyArgumentLogger() {
- DummyMock mock;
- ON_CALL(mock, TestMethodArg(_));
-}
-
-// Verifies that ON_CALL prints provided _ argument.
-TEST(OnCallTest, LogsAnythingArgument) {
- EXPECT_THAT(GrabOutput(OnCallAnyArgumentLogger, kInfoVerbosity),
- HasSubstr("ON_CALL(mock, TestMethodArg(_)"));
-}
-
-#endif // GTEST_HAS_STREAM_REDIRECTION
-
-// Tests StlContainerView.
-
-TEST(StlContainerViewTest, WorksForStlContainer) {
- StaticAssertTypeEq<std::vector<int>,
- StlContainerView<std::vector<int> >::type>();
- StaticAssertTypeEq<const std::vector<double>&,
- StlContainerView<std::vector<double> >::const_reference>();
-
- typedef std::vector<char> Chars;
- Chars v1;
- const Chars& v2(StlContainerView<Chars>::ConstReference(v1));
- EXPECT_EQ(&v1, &v2);
-
- v1.push_back('a');
- Chars v3 = StlContainerView<Chars>::Copy(v1);
- EXPECT_THAT(v3, Eq(v3));
-}
-
-TEST(StlContainerViewTest, WorksForStaticNativeArray) {
- StaticAssertTypeEq<NativeArray<int>,
- StlContainerView<int[3]>::type>();
- StaticAssertTypeEq<NativeArray<double>,
- StlContainerView<const double[4]>::type>();
- StaticAssertTypeEq<NativeArray<char[3]>,
- StlContainerView<const char[2][3]>::type>();
-
- StaticAssertTypeEq<const NativeArray<int>,
- StlContainerView<int[2]>::const_reference>();
-
- int a1[3] = { 0, 1, 2 };
- NativeArray<int> a2 = StlContainerView<int[3]>::ConstReference(a1);
- EXPECT_EQ(3U, a2.size());
- EXPECT_EQ(a1, a2.begin());
-
- const NativeArray<int> a3 = StlContainerView<int[3]>::Copy(a1);
- ASSERT_EQ(3U, a3.size());
- EXPECT_EQ(0, a3.begin()[0]);
- EXPECT_EQ(1, a3.begin()[1]);
- EXPECT_EQ(2, a3.begin()[2]);
-
- // Makes sure a1 and a3 aren't aliases.
- a1[0] = 3;
- EXPECT_EQ(0, a3.begin()[0]);
-}
-
-TEST(StlContainerViewTest, WorksForDynamicNativeArray) {
- StaticAssertTypeEq<NativeArray<int>,
- StlContainerView<tuple<const int*, size_t> >::type>();
- StaticAssertTypeEq<NativeArray<double>,
- StlContainerView<tuple<linked_ptr<double>, int> >::type>();
-
- StaticAssertTypeEq<const NativeArray<int>,
- StlContainerView<tuple<const int*, int> >::const_reference>();
-
- int a1[3] = { 0, 1, 2 };
- const int* const p1 = a1;
- NativeArray<int> a2 = StlContainerView<tuple<const int*, int> >::
- ConstReference(make_tuple(p1, 3));
- EXPECT_EQ(3U, a2.size());
- EXPECT_EQ(a1, a2.begin());
-
- const NativeArray<int> a3 = StlContainerView<tuple<int*, size_t> >::
- Copy(make_tuple(static_cast<int*>(a1), 3));
- ASSERT_EQ(3U, a3.size());
- EXPECT_EQ(0, a3.begin()[0]);
- EXPECT_EQ(1, a3.begin()[1]);
- EXPECT_EQ(2, a3.begin()[2]);
-
- // Makes sure a1 and a3 aren't aliases.
- a1[0] = 3;
- EXPECT_EQ(0, a3.begin()[0]);
-}
-
-} // namespace
-} // namespace internal
-} // namespace testing
diff --git a/src/testing/test/gmock-matchers_test.cc b/src/testing/test/gmock-matchers_test.cc
deleted file mode 100644
index 6e5d5c31..00000000
--- a/src/testing/test/gmock-matchers_test.cc
+++ /dev/null
@@ -1,4197 +0,0 @@
-// Copyright 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-// Google Mock - a framework for writing C++ mock classes.
-//
-// This file tests some commonly used argument matchers.
-
-#include "gmock/gmock-matchers.h"
-
-#include <string.h>
-#include <functional>
-#include <iostream>
-#include <list>
-#include <map>
-#include <set>
-#include <sstream>
-#include <string>
-#include <utility>
-#include <vector>
-#include "gmock/gmock.h"
-#include "gtest/gtest.h"
-#include "gtest/gtest-spi.h"
-
-namespace testing {
-
-namespace internal {
-GTEST_API_ string JoinAsTuple(const Strings& fields);
-} // namespace internal
-
-namespace gmock_matchers_test {
-
-using std::greater;
-using std::less;
-using std::list;
-using std::make_pair;
-using std::map;
-using std::multimap;
-using std::multiset;
-using std::ostream;
-using std::pair;
-using std::set;
-using std::stringstream;
-using std::tr1::get;
-using std::tr1::make_tuple;
-using std::tr1::tuple;
-using std::vector;
-using testing::A;
-using testing::AllArgs;
-using testing::AllOf;
-using testing::An;
-using testing::AnyOf;
-using testing::ByRef;
-using testing::ContainsRegex;
-using testing::DoubleEq;
-using testing::EndsWith;
-using testing::Eq;
-using testing::ExplainMatchResult;
-using testing::Field;
-using testing::FloatEq;
-using testing::Ge;
-using testing::Gt;
-using testing::HasSubstr;
-using testing::IsNull;
-using testing::Key;
-using testing::Le;
-using testing::Lt;
-using testing::MakeMatcher;
-using testing::MakePolymorphicMatcher;
-using testing::MatchResultListener;
-using testing::Matcher;
-using testing::MatcherCast;
-using testing::MatcherInterface;
-using testing::Matches;
-using testing::MatchesRegex;
-using testing::NanSensitiveDoubleEq;
-using testing::NanSensitiveFloatEq;
-using testing::Ne;
-using testing::Not;
-using testing::NotNull;
-using testing::Pair;
-using testing::Pointee;
-using testing::Pointwise;
-using testing::PolymorphicMatcher;
-using testing::Property;
-using testing::Ref;
-using testing::ResultOf;
-using testing::StartsWith;
-using testing::StrCaseEq;
-using testing::StrCaseNe;
-using testing::StrEq;
-using testing::StrNe;
-using testing::Truly;
-using testing::TypedEq;
-using testing::Value;
-using testing::WhenSorted;
-using testing::WhenSortedBy;
-using testing::_;
-using testing::internal::DummyMatchResultListener;
-using testing::internal::ExplainMatchFailureTupleTo;
-using testing::internal::FloatingEqMatcher;
-using testing::internal::FormatMatcherDescription;
-using testing::internal::IsReadableTypeName;
-using testing::internal::JoinAsTuple;
-using testing::internal::RE;
-using testing::internal::StreamMatchResultListener;
-using testing::internal::String;
-using testing::internal::StringMatchResultListener;
-using testing::internal::Strings;
-using testing::internal::linked_ptr;
-using testing::internal::scoped_ptr;
-using testing::internal::string;
-
-// For testing ExplainMatchResultTo().
-class GreaterThanMatcher : public MatcherInterface<int> {
- public:
- explicit GreaterThanMatcher(int rhs) : rhs_(rhs) {}
-
- virtual void DescribeTo(ostream* os) const {
- *os << "is > " << rhs_;
- }
-
- virtual bool MatchAndExplain(int lhs,
- MatchResultListener* listener) const {
- const int diff = lhs - rhs_;
- if (diff > 0) {
- *listener << "which is " << diff << " more than " << rhs_;
- } else if (diff == 0) {
- *listener << "which is the same as " << rhs_;
- } else {
- *listener << "which is " << -diff << " less than " << rhs_;
- }
-
- return lhs > rhs_;
- }
-
- private:
- int rhs_;
-};
-
-Matcher<int> GreaterThan(int n) {
- return MakeMatcher(new GreaterThanMatcher(n));
-}
-
-string OfType(const string& type_name) {
-#if GTEST_HAS_RTTI
- return " (of type " + type_name + ")";
-#else
- return "";
-#endif
-}
-
-// Returns the description of the given matcher.
-template <typename T>
-string Describe(const Matcher<T>& m) {
- stringstream ss;
- m.DescribeTo(&ss);
- return ss.str();
-}
-
-// Returns the description of the negation of the given matcher.
-template <typename T>
-string DescribeNegation(const Matcher<T>& m) {
- stringstream ss;
- m.DescribeNegationTo(&ss);
- return ss.str();
-}
-
-// Returns the reason why x matches, or doesn't match, m.
-template <typename MatcherType, typename Value>
-string Explain(const MatcherType& m, const Value& x) {
- StringMatchResultListener listener;
- ExplainMatchResult(m, x, &listener);
- return listener.str();
-}
-
-TEST(MatchResultListenerTest, StreamingWorks) {
- StringMatchResultListener listener;
- listener << "hi" << 5;
- EXPECT_EQ("hi5", listener.str());
-
- // Streaming shouldn't crash when the underlying ostream is NULL.
- DummyMatchResultListener dummy;
- dummy << "hi" << 5;
-}
-
-TEST(MatchResultListenerTest, CanAccessUnderlyingStream) {
- EXPECT_TRUE(DummyMatchResultListener().stream() == NULL);
- EXPECT_TRUE(StreamMatchResultListener(NULL).stream() == NULL);
-
- EXPECT_EQ(&std::cout, StreamMatchResultListener(&std::cout).stream());
-}
-
-TEST(MatchResultListenerTest, IsInterestedWorks) {
- EXPECT_TRUE(StringMatchResultListener().IsInterested());
- EXPECT_TRUE(StreamMatchResultListener(&std::cout).IsInterested());
-
- EXPECT_FALSE(DummyMatchResultListener().IsInterested());
- EXPECT_FALSE(StreamMatchResultListener(NULL).IsInterested());
-}
-
-// Makes sure that the MatcherInterface<T> interface doesn't
-// change.
-class EvenMatcherImpl : public MatcherInterface<int> {
- public:
- virtual bool MatchAndExplain(int x,
- MatchResultListener* /* listener */) const {
- return x % 2 == 0;
- }
-
- virtual void DescribeTo(ostream* os) const {
- *os << "is an even number";
- }
-
- // We deliberately don't define DescribeNegationTo() and
- // ExplainMatchResultTo() here, to make sure the definition of these
- // two methods is optional.
-};
-
-// Makes sure that the MatcherInterface API doesn't change.
-TEST(MatcherInterfaceTest, CanBeImplementedUsingPublishedAPI) {
- EvenMatcherImpl m;
-}
-
-// Tests implementing a monomorphic matcher using MatchAndExplain().
-
-class NewEvenMatcherImpl : public MatcherInterface<int> {
- public:
- virtual bool MatchAndExplain(int x, MatchResultListener* listener) const {
- const bool match = x % 2 == 0;
- // Verifies that we can stream to a listener directly.
- *listener << "value % " << 2;
- if (listener->stream() != NULL) {
- // Verifies that we can stream to a listener's underlying stream
- // too.
- *listener->stream() << " == " << (x % 2);
- }
- return match;
- }
-
- virtual void DescribeTo(ostream* os) const {
- *os << "is an even number";
- }
-};
-
-TEST(MatcherInterfaceTest, CanBeImplementedUsingNewAPI) {
- Matcher<int> m = MakeMatcher(new NewEvenMatcherImpl);
- EXPECT_TRUE(m.Matches(2));
- EXPECT_FALSE(m.Matches(3));
- EXPECT_EQ("value % 2 == 0", Explain(m, 2));
- EXPECT_EQ("value % 2 == 1", Explain(m, 3));
-}
-
-// Tests default-constructing a matcher.
-TEST(MatcherTest, CanBeDefaultConstructed) {
- Matcher<double> m;
-}
-
-// Tests that Matcher<T> can be constructed from a MatcherInterface<T>*.
-TEST(MatcherTest, CanBeConstructedFromMatcherInterface) {
- const MatcherInterface<int>* impl = new EvenMatcherImpl;
- Matcher<int> m(impl);
- EXPECT_TRUE(m.Matches(4));
- EXPECT_FALSE(m.Matches(5));
-}
-
-// Tests that value can be used in place of Eq(value).
-TEST(MatcherTest, CanBeImplicitlyConstructedFromValue) {
- Matcher<int> m1 = 5;
- EXPECT_TRUE(m1.Matches(5));
- EXPECT_FALSE(m1.Matches(6));
-}
-
-// Tests that NULL can be used in place of Eq(NULL).
-TEST(MatcherTest, CanBeImplicitlyConstructedFromNULL) {
- Matcher<int*> m1 = NULL;
- EXPECT_TRUE(m1.Matches(NULL));
- int n = 0;
- EXPECT_FALSE(m1.Matches(&n));
-}
-
-// Tests that matchers are copyable.
-TEST(MatcherTest, IsCopyable) {
- // Tests the copy constructor.
- Matcher<bool> m1 = Eq(false);
- EXPECT_TRUE(m1.Matches(false));
- EXPECT_FALSE(m1.Matches(true));
-
- // Tests the assignment operator.
- m1 = Eq(true);
- EXPECT_TRUE(m1.Matches(true));
- EXPECT_FALSE(m1.Matches(false));
-}
-
-// Tests that Matcher<T>::DescribeTo() calls
-// MatcherInterface<T>::DescribeTo().
-TEST(MatcherTest, CanDescribeItself) {
- EXPECT_EQ("is an even number",
- Describe(Matcher<int>(new EvenMatcherImpl)));
-}
-
-// Tests Matcher<T>::MatchAndExplain().
-TEST(MatcherTest, MatchAndExplain) {
- Matcher<int> m = GreaterThan(0);
- StringMatchResultListener listener1;
- EXPECT_TRUE(m.MatchAndExplain(42, &listener1));
- EXPECT_EQ("which is 42 more than 0", listener1.str());
-
- StringMatchResultListener listener2;
- EXPECT_FALSE(m.MatchAndExplain(-9, &listener2));
- EXPECT_EQ("which is 9 less than 0", listener2.str());
-}
-
-// Tests that a C-string literal can be implicitly converted to a
-// Matcher<string> or Matcher<const string&>.
-TEST(StringMatcherTest, CanBeImplicitlyConstructedFromCStringLiteral) {
- Matcher<string> m1 = "hi";
- EXPECT_TRUE(m1.Matches("hi"));
- EXPECT_FALSE(m1.Matches("hello"));
-
- Matcher<const string&> m2 = "hi";
- EXPECT_TRUE(m2.Matches("hi"));
- EXPECT_FALSE(m2.Matches("hello"));
-}
-
-// Tests that a string object can be implicitly converted to a
-// Matcher<string> or Matcher<const string&>.
-TEST(StringMatcherTest, CanBeImplicitlyConstructedFromString) {
- Matcher<string> m1 = string("hi");
- EXPECT_TRUE(m1.Matches("hi"));
- EXPECT_FALSE(m1.Matches("hello"));
-
- Matcher<const string&> m2 = string("hi");
- EXPECT_TRUE(m2.Matches("hi"));
- EXPECT_FALSE(m2.Matches("hello"));
-}
-
-// Tests that MakeMatcher() constructs a Matcher<T> from a
-// MatcherInterface* without requiring the user to explicitly
-// write the type.
-TEST(MakeMatcherTest, ConstructsMatcherFromMatcherInterface) {
- const MatcherInterface<int>* dummy_impl = NULL;
- Matcher<int> m = MakeMatcher(dummy_impl);
-}
-
-// Tests that MakePolymorphicMatcher() can construct a polymorphic
-// matcher from its implementation using the old API.
-const int g_bar = 1;
-class ReferencesBarOrIsZeroImpl {
- public:
- template <typename T>
- bool MatchAndExplain(const T& x,
- MatchResultListener* /* listener */) const {
- const void* p = &x;
- return p == &g_bar || x == 0;
- }
-
- void DescribeTo(ostream* os) const { *os << "g_bar or zero"; }
-
- void DescribeNegationTo(ostream* os) const {
- *os << "doesn't reference g_bar and is not zero";
- }
-};
-
-// This function verifies that MakePolymorphicMatcher() returns a
-// PolymorphicMatcher<T> where T is the argument's type.
-PolymorphicMatcher<ReferencesBarOrIsZeroImpl> ReferencesBarOrIsZero() {
- return MakePolymorphicMatcher(ReferencesBarOrIsZeroImpl());
-}
-
-TEST(MakePolymorphicMatcherTest, ConstructsMatcherUsingOldAPI) {
- // Using a polymorphic matcher to match a reference type.
- Matcher<const int&> m1 = ReferencesBarOrIsZero();
- EXPECT_TRUE(m1.Matches(0));
- // Verifies that the identity of a by-reference argument is preserved.
- EXPECT_TRUE(m1.Matches(g_bar));
- EXPECT_FALSE(m1.Matches(1));
- EXPECT_EQ("g_bar or zero", Describe(m1));
-
- // Using a polymorphic matcher to match a value type.
- Matcher<double> m2 = ReferencesBarOrIsZero();
- EXPECT_TRUE(m2.Matches(0.0));
- EXPECT_FALSE(m2.Matches(0.1));
- EXPECT_EQ("g_bar or zero", Describe(m2));
-}
-
-// Tests implementing a polymorphic matcher using MatchAndExplain().
-
-class PolymorphicIsEvenImpl {
- public:
- void DescribeTo(ostream* os) const { *os << "is even"; }
-
- void DescribeNegationTo(ostream* os) const {
- *os << "is odd";
- }
-
- template <typename T>
- bool MatchAndExplain(const T& x, MatchResultListener* listener) const {
- // Verifies that we can stream to the listener directly.
- *listener << "% " << 2;
- if (listener->stream() != NULL) {
- // Verifies that we can stream to the listener's underlying stream
- // too.
- *listener->stream() << " == " << (x % 2);
- }
- return (x % 2) == 0;
- }
-};
-
-PolymorphicMatcher<PolymorphicIsEvenImpl> PolymorphicIsEven() {
- return MakePolymorphicMatcher(PolymorphicIsEvenImpl());
-}
-
-TEST(MakePolymorphicMatcherTest, ConstructsMatcherUsingNewAPI) {
- // Using PolymorphicIsEven() as a Matcher<int>.
- const Matcher<int> m1 = PolymorphicIsEven();
- EXPECT_TRUE(m1.Matches(42));
- EXPECT_FALSE(m1.Matches(43));
- EXPECT_EQ("is even", Describe(m1));
-
- const Matcher<int> not_m1 = Not(m1);
- EXPECT_EQ("is odd", Describe(not_m1));
-
- EXPECT_EQ("% 2 == 0", Explain(m1, 42));
-
- // Using PolymorphicIsEven() as a Matcher<char>.
- const Matcher<char> m2 = PolymorphicIsEven();
- EXPECT_TRUE(m2.Matches('\x42'));
- EXPECT_FALSE(m2.Matches('\x43'));
- EXPECT_EQ("is even", Describe(m2));
-
- const Matcher<char> not_m2 = Not(m2);
- EXPECT_EQ("is odd", Describe(not_m2));
-
- EXPECT_EQ("% 2 == 0", Explain(m2, '\x42'));
-}
-
-// Tests that MatcherCast<T>(m) works when m is a polymorphic matcher.
-TEST(MatcherCastTest, FromPolymorphicMatcher) {
- Matcher<int> m = MatcherCast<int>(Eq(5));
- EXPECT_TRUE(m.Matches(5));
- EXPECT_FALSE(m.Matches(6));
-}
-
-// For testing casting matchers between compatible types.
-class IntValue {
- public:
- // An int can be statically (although not implicitly) cast to a
- // IntValue.
- explicit IntValue(int a_value) : value_(a_value) {}
-
- int value() const { return value_; }
- private:
- int value_;
-};
-
-// For testing casting matchers between compatible types.
-bool IsPositiveIntValue(const IntValue& foo) {
- return foo.value() > 0;
-}
-
-// Tests that MatcherCast<T>(m) works when m is a Matcher<U> where T
-// can be statically converted to U.
-TEST(MatcherCastTest, FromCompatibleType) {
- Matcher<double> m1 = Eq(2.0);
- Matcher<int> m2 = MatcherCast<int>(m1);
- EXPECT_TRUE(m2.Matches(2));
- EXPECT_FALSE(m2.Matches(3));
-
- Matcher<IntValue> m3 = Truly(IsPositiveIntValue);
- Matcher<int> m4 = MatcherCast<int>(m3);
- // In the following, the arguments 1 and 0 are statically converted
- // to IntValue objects, and then tested by the IsPositiveIntValue()
- // predicate.
- EXPECT_TRUE(m4.Matches(1));
- EXPECT_FALSE(m4.Matches(0));
-}
-
-// Tests that MatcherCast<T>(m) works when m is a Matcher<const T&>.
-TEST(MatcherCastTest, FromConstReferenceToNonReference) {
- Matcher<const int&> m1 = Eq(0);
- Matcher<int> m2 = MatcherCast<int>(m1);
- EXPECT_TRUE(m2.Matches(0));
- EXPECT_FALSE(m2.Matches(1));
-}
-
-// Tests that MatcherCast<T>(m) works when m is a Matcher<T&>.
-TEST(MatcherCastTest, FromReferenceToNonReference) {
- Matcher<int&> m1 = Eq(0);
- Matcher<int> m2 = MatcherCast<int>(m1);
- EXPECT_TRUE(m2.Matches(0));
- EXPECT_FALSE(m2.Matches(1));
-}
-
-// Tests that MatcherCast<const T&>(m) works when m is a Matcher<T>.
-TEST(MatcherCastTest, FromNonReferenceToConstReference) {
- Matcher<int> m1 = Eq(0);
- Matcher<const int&> m2 = MatcherCast<const int&>(m1);
- EXPECT_TRUE(m2.Matches(0));
- EXPECT_FALSE(m2.Matches(1));
-}
-
-// Tests that MatcherCast<T&>(m) works when m is a Matcher<T>.
-TEST(MatcherCastTest, FromNonReferenceToReference) {
- Matcher<int> m1 = Eq(0);
- Matcher<int&> m2 = MatcherCast<int&>(m1);
- int n = 0;
- EXPECT_TRUE(m2.Matches(n));
- n = 1;
- EXPECT_FALSE(m2.Matches(n));
-}
-
-// Tests that MatcherCast<T>(m) works when m is a Matcher<T>.
-TEST(MatcherCastTest, FromSameType) {
- Matcher<int> m1 = Eq(0);
- Matcher<int> m2 = MatcherCast<int>(m1);
- EXPECT_TRUE(m2.Matches(0));
- EXPECT_FALSE(m2.Matches(1));
-}
-
-// Implicitly convertible form any type.
-struct ConvertibleFromAny {
- ConvertibleFromAny(int a_value) : value(a_value) {}
- template <typename T>
- ConvertibleFromAny(const T& a_value) : value(-1) {
- ADD_FAILURE() << "Conversion constructor called";
- }
- int value;
-};
-
-bool operator==(const ConvertibleFromAny& a, const ConvertibleFromAny& b) {
- return a.value == b.value;
-}
-
-ostream& operator<<(ostream& os, const ConvertibleFromAny& a) {
- return os << a.value;
-}
-
-TEST(MatcherCastTest, ConversionConstructorIsUsed) {
- Matcher<ConvertibleFromAny> m = MatcherCast<ConvertibleFromAny>(1);
- EXPECT_TRUE(m.Matches(ConvertibleFromAny(1)));
- EXPECT_FALSE(m.Matches(ConvertibleFromAny(2)));
-}
-
-TEST(MatcherCastTest, FromConvertibleFromAny) {
- Matcher<ConvertibleFromAny> m =
- MatcherCast<ConvertibleFromAny>(Eq(ConvertibleFromAny(1)));
- EXPECT_TRUE(m.Matches(ConvertibleFromAny(1)));
- EXPECT_FALSE(m.Matches(ConvertibleFromAny(2)));
-}
-
-class Base {};
-class Derived : public Base {};
-
-// Tests that SafeMatcherCast<T>(m) works when m is a polymorphic matcher.
-TEST(SafeMatcherCastTest, FromPolymorphicMatcher) {
- Matcher<char> m2 = SafeMatcherCast<char>(Eq(32));
- EXPECT_TRUE(m2.Matches(' '));
- EXPECT_FALSE(m2.Matches('\n'));
-}
-
-// Tests that SafeMatcherCast<T>(m) works when m is a Matcher<U> where
-// T and U are arithmetic types and T can be losslessly converted to
-// U.
-TEST(SafeMatcherCastTest, FromLosslesslyConvertibleArithmeticType) {
- Matcher<double> m1 = DoubleEq(1.0);
- Matcher<float> m2 = SafeMatcherCast<float>(m1);
- EXPECT_TRUE(m2.Matches(1.0f));
- EXPECT_FALSE(m2.Matches(2.0f));
-
- Matcher<char> m3 = SafeMatcherCast<char>(TypedEq<int>('a'));
- EXPECT_TRUE(m3.Matches('a'));
- EXPECT_FALSE(m3.Matches('b'));
-}
-
-// Tests that SafeMatcherCast<T>(m) works when m is a Matcher<U> where T and U
-// are pointers or references to a derived and a base class, correspondingly.
-TEST(SafeMatcherCastTest, FromBaseClass) {
- Derived d, d2;
- Matcher<Base*> m1 = Eq(&d);
- Matcher<Derived*> m2 = SafeMatcherCast<Derived*>(m1);
- EXPECT_TRUE(m2.Matches(&d));
- EXPECT_FALSE(m2.Matches(&d2));
-
- Matcher<Base&> m3 = Ref(d);
- Matcher<Derived&> m4 = SafeMatcherCast<Derived&>(m3);
- EXPECT_TRUE(m4.Matches(d));
- EXPECT_FALSE(m4.Matches(d2));
-}
-
-// Tests that SafeMatcherCast<T&>(m) works when m is a Matcher<const T&>.
-TEST(SafeMatcherCastTest, FromConstReferenceToReference) {
- int n = 0;
- Matcher<const int&> m1 = Ref(n);
- Matcher<int&> m2 = SafeMatcherCast<int&>(m1);
- int n1 = 0;
- EXPECT_TRUE(m2.Matches(n));
- EXPECT_FALSE(m2.Matches(n1));
-}
-
-// Tests that MatcherCast<const T&>(m) works when m is a Matcher<T>.
-TEST(SafeMatcherCastTest, FromNonReferenceToConstReference) {
- Matcher<int> m1 = Eq(0);
- Matcher<const int&> m2 = SafeMatcherCast<const int&>(m1);
- EXPECT_TRUE(m2.Matches(0));
- EXPECT_FALSE(m2.Matches(1));
-}
-
-// Tests that SafeMatcherCast<T&>(m) works when m is a Matcher<T>.
-TEST(SafeMatcherCastTest, FromNonReferenceToReference) {
- Matcher<int> m1 = Eq(0);
- Matcher<int&> m2 = SafeMatcherCast<int&>(m1);
- int n = 0;
- EXPECT_TRUE(m2.Matches(n));
- n = 1;
- EXPECT_FALSE(m2.Matches(n));
-}
-
-// Tests that SafeMatcherCast<T>(m) works when m is a Matcher<T>.
-TEST(SafeMatcherCastTest, FromSameType) {
- Matcher<int> m1 = Eq(0);
- Matcher<int> m2 = SafeMatcherCast<int>(m1);
- EXPECT_TRUE(m2.Matches(0));
- EXPECT_FALSE(m2.Matches(1));
-}
-
-TEST(SafeMatcherCastTest, ConversionConstructorIsUsed) {
- Matcher<ConvertibleFromAny> m = SafeMatcherCast<ConvertibleFromAny>(1);
- EXPECT_TRUE(m.Matches(ConvertibleFromAny(1)));
- EXPECT_FALSE(m.Matches(ConvertibleFromAny(2)));
-}
-
-TEST(SafeMatcherCastTest, FromConvertibleFromAny) {
- Matcher<ConvertibleFromAny> m =
- SafeMatcherCast<ConvertibleFromAny>(Eq(ConvertibleFromAny(1)));
- EXPECT_TRUE(m.Matches(ConvertibleFromAny(1)));
- EXPECT_FALSE(m.Matches(ConvertibleFromAny(2)));
-}
-
-// Tests that A<T>() matches any value of type T.
-TEST(ATest, MatchesAnyValue) {
- // Tests a matcher for a value type.
- Matcher<double> m1 = A<double>();
- EXPECT_TRUE(m1.Matches(91.43));
- EXPECT_TRUE(m1.Matches(-15.32));
-
- // Tests a matcher for a reference type.
- int a = 2;
- int b = -6;
- Matcher<int&> m2 = A<int&>();
- EXPECT_TRUE(m2.Matches(a));
- EXPECT_TRUE(m2.Matches(b));
-}
-
-// Tests that A<T>() describes itself properly.
-TEST(ATest, CanDescribeSelf) {
- EXPECT_EQ("is anything", Describe(A<bool>()));
-}
-
-// Tests that An<T>() matches any value of type T.
-TEST(AnTest, MatchesAnyValue) {
- // Tests a matcher for a value type.
- Matcher<int> m1 = An<int>();
- EXPECT_TRUE(m1.Matches(9143));
- EXPECT_TRUE(m1.Matches(-1532));
-
- // Tests a matcher for a reference type.
- int a = 2;
- int b = -6;
- Matcher<int&> m2 = An<int&>();
- EXPECT_TRUE(m2.Matches(a));
- EXPECT_TRUE(m2.Matches(b));
-}
-
-// Tests that An<T>() describes itself properly.
-TEST(AnTest, CanDescribeSelf) {
- EXPECT_EQ("is anything", Describe(An<int>()));
-}
-
-// Tests that _ can be used as a matcher for any type and matches any
-// value of that type.
-TEST(UnderscoreTest, MatchesAnyValue) {
- // Uses _ as a matcher for a value type.
- Matcher<int> m1 = _;
- EXPECT_TRUE(m1.Matches(123));
- EXPECT_TRUE(m1.Matches(-242));
-
- // Uses _ as a matcher for a reference type.
- bool a = false;
- const bool b = true;
- Matcher<const bool&> m2 = _;
- EXPECT_TRUE(m2.Matches(a));
- EXPECT_TRUE(m2.Matches(b));
-}
-
-// Tests that _ describes itself properly.
-TEST(UnderscoreTest, CanDescribeSelf) {
- Matcher<int> m = _;
- EXPECT_EQ("is anything", Describe(m));
-}
-
-// Tests that Eq(x) matches any value equal to x.
-TEST(EqTest, MatchesEqualValue) {
- // 2 C-strings with same content but different addresses.
- const char a1[] = "hi";
- const char a2[] = "hi";
-
- Matcher<const char*> m1 = Eq(a1);
- EXPECT_TRUE(m1.Matches(a1));
- EXPECT_FALSE(m1.Matches(a2));
-}
-
-// Tests that Eq(v) describes itself properly.
-
-class Unprintable {
- public:
- Unprintable() : c_('a') {}
-
- bool operator==(const Unprintable& /* rhs */) { return true; }
- private:
- char c_;
-};
-
-TEST(EqTest, CanDescribeSelf) {
- Matcher<Unprintable> m = Eq(Unprintable());
- EXPECT_EQ("is equal to 1-byte object <61>", Describe(m));
-}
-
-// Tests that Eq(v) can be used to match any type that supports
-// comparing with type T, where T is v's type.
-TEST(EqTest, IsPolymorphic) {
- Matcher<int> m1 = Eq(1);
- EXPECT_TRUE(m1.Matches(1));
- EXPECT_FALSE(m1.Matches(2));
-
- Matcher<char> m2 = Eq(1);
- EXPECT_TRUE(m2.Matches('\1'));
- EXPECT_FALSE(m2.Matches('a'));
-}
-
-// Tests that TypedEq<T>(v) matches values of type T that's equal to v.
-TEST(TypedEqTest, ChecksEqualityForGivenType) {
- Matcher<char> m1 = TypedEq<char>('a');
- EXPECT_TRUE(m1.Matches('a'));
- EXPECT_FALSE(m1.Matches('b'));
-
- Matcher<int> m2 = TypedEq<int>(6);
- EXPECT_TRUE(m2.Matches(6));
- EXPECT_FALSE(m2.Matches(7));
-}
-
-// Tests that TypedEq(v) describes itself properly.
-TEST(TypedEqTest, CanDescribeSelf) {
- EXPECT_EQ("is equal to 2", Describe(TypedEq<int>(2)));
-}
-
-// Tests that TypedEq<T>(v) has type Matcher<T>.
-
-// Type<T>::IsTypeOf(v) compiles iff the type of value v is T, where T
-// is a "bare" type (i.e. not in the form of const U or U&). If v's
-// type is not T, the compiler will generate a message about
-// "undefined referece".
-template <typename T>
-struct Type {
- static bool IsTypeOf(const T& /* v */) { return true; }
-
- template <typename T2>
- static void IsTypeOf(T2 v);
-};
-
-TEST(TypedEqTest, HasSpecifiedType) {
- // Verfies that the type of TypedEq<T>(v) is Matcher<T>.
- Type<Matcher<int> >::IsTypeOf(TypedEq<int>(5));
- Type<Matcher<double> >::IsTypeOf(TypedEq<double>(5));
-}
-
-// Tests that Ge(v) matches anything >= v.
-TEST(GeTest, ImplementsGreaterThanOrEqual) {
- Matcher<int> m1 = Ge(0);
- EXPECT_TRUE(m1.Matches(1));
- EXPECT_TRUE(m1.Matches(0));
- EXPECT_FALSE(m1.Matches(-1));
-}
-
-// Tests that Ge(v) describes itself properly.
-TEST(GeTest, CanDescribeSelf) {
- Matcher<int> m = Ge(5);
- EXPECT_EQ("is >= 5", Describe(m));
-}
-
-// Tests that Gt(v) matches anything > v.
-TEST(GtTest, ImplementsGreaterThan) {
- Matcher<double> m1 = Gt(0);
- EXPECT_TRUE(m1.Matches(1.0));
- EXPECT_FALSE(m1.Matches(0.0));
- EXPECT_FALSE(m1.Matches(-1.0));
-}
-
-// Tests that Gt(v) describes itself properly.
-TEST(GtTest, CanDescribeSelf) {
- Matcher<int> m = Gt(5);
- EXPECT_EQ("is > 5", Describe(m));
-}
-
-// Tests that Le(v) matches anything <= v.
-TEST(LeTest, ImplementsLessThanOrEqual) {
- Matcher<char> m1 = Le('b');
- EXPECT_TRUE(m1.Matches('a'));
- EXPECT_TRUE(m1.Matches('b'));
- EXPECT_FALSE(m1.Matches('c'));
-}
-
-// Tests that Le(v) describes itself properly.
-TEST(LeTest, CanDescribeSelf) {
- Matcher<int> m = Le(5);
- EXPECT_EQ("is <= 5", Describe(m));
-}
-
-// Tests that Lt(v) matches anything < v.
-TEST(LtTest, ImplementsLessThan) {
- Matcher<const string&> m1 = Lt("Hello");
- EXPECT_TRUE(m1.Matches("Abc"));
- EXPECT_FALSE(m1.Matches("Hello"));
- EXPECT_FALSE(m1.Matches("Hello, world!"));
-}
-
-// Tests that Lt(v) describes itself properly.
-TEST(LtTest, CanDescribeSelf) {
- Matcher<int> m = Lt(5);
- EXPECT_EQ("is < 5", Describe(m));
-}
-
-// Tests that Ne(v) matches anything != v.
-TEST(NeTest, ImplementsNotEqual) {
- Matcher<int> m1 = Ne(0);
- EXPECT_TRUE(m1.Matches(1));
- EXPECT_TRUE(m1.Matches(-1));
- EXPECT_FALSE(m1.Matches(0));
-}
-
-// Tests that Ne(v) describes itself properly.
-TEST(NeTest, CanDescribeSelf) {
- Matcher<int> m = Ne(5);
- EXPECT_EQ("isn't equal to 5", Describe(m));
-}
-
-// Tests that IsNull() matches any NULL pointer of any type.
-TEST(IsNullTest, MatchesNullPointer) {
- Matcher<int*> m1 = IsNull();
- int* p1 = NULL;
- int n = 0;
- EXPECT_TRUE(m1.Matches(p1));
- EXPECT_FALSE(m1.Matches(&n));
-
- Matcher<const char*> m2 = IsNull();
- const char* p2 = NULL;
- EXPECT_TRUE(m2.Matches(p2));
- EXPECT_FALSE(m2.Matches("hi"));
-
-#if !GTEST_OS_SYMBIAN
- // Nokia's Symbian compiler generates:
- // gmock-matchers.h: ambiguous access to overloaded function
- // gmock-matchers.h: 'testing::Matcher<void *>::Matcher(void *)'
- // gmock-matchers.h: 'testing::Matcher<void *>::Matcher(const testing::
- // MatcherInterface<void *> *)'
- // gmock-matchers.h: (point of instantiation: 'testing::
- // gmock_matchers_test::IsNullTest_MatchesNullPointer_Test::TestBody()')
- // gmock-matchers.h: (instantiating: 'testing::PolymorphicMatc
- Matcher<void*> m3 = IsNull();
- void* p3 = NULL;
- EXPECT_TRUE(m3.Matches(p3));
- EXPECT_FALSE(m3.Matches(reinterpret_cast<void*>(0xbeef)));
-#endif
-}
-
-TEST(IsNullTest, LinkedPtr) {
- const Matcher<linked_ptr<int> > m = IsNull();
- const linked_ptr<int> null_p;
- const linked_ptr<int> non_null_p(new int);
-
- EXPECT_TRUE(m.Matches(null_p));
- EXPECT_FALSE(m.Matches(non_null_p));
-}
-
-TEST(IsNullTest, ReferenceToConstLinkedPtr) {
- const Matcher<const linked_ptr<double>&> m = IsNull();
- const linked_ptr<double> null_p;
- const linked_ptr<double> non_null_p(new double);
-
- EXPECT_TRUE(m.Matches(null_p));
- EXPECT_FALSE(m.Matches(non_null_p));
-}
-
-TEST(IsNullTest, ReferenceToConstScopedPtr) {
- const Matcher<const scoped_ptr<double>&> m = IsNull();
- const scoped_ptr<double> null_p;
- const scoped_ptr<double> non_null_p(new double);
-
- EXPECT_TRUE(m.Matches(null_p));
- EXPECT_FALSE(m.Matches(non_null_p));
-}
-
-// Tests that IsNull() describes itself properly.
-TEST(IsNullTest, CanDescribeSelf) {
- Matcher<int*> m = IsNull();
- EXPECT_EQ("is NULL", Describe(m));
- EXPECT_EQ("isn't NULL", DescribeNegation(m));
-}
-
-// Tests that NotNull() matches any non-NULL pointer of any type.
-TEST(NotNullTest, MatchesNonNullPointer) {
- Matcher<int*> m1 = NotNull();
- int* p1 = NULL;
- int n = 0;
- EXPECT_FALSE(m1.Matches(p1));
- EXPECT_TRUE(m1.Matches(&n));
-
- Matcher<const char*> m2 = NotNull();
- const char* p2 = NULL;
- EXPECT_FALSE(m2.Matches(p2));
- EXPECT_TRUE(m2.Matches("hi"));
-}
-
-TEST(NotNullTest, LinkedPtr) {
- const Matcher<linked_ptr<int> > m = NotNull();
- const linked_ptr<int> null_p;
- const linked_ptr<int> non_null_p(new int);
-
- EXPECT_FALSE(m.Matches(null_p));
- EXPECT_TRUE(m.Matches(non_null_p));
-}
-
-TEST(NotNullTest, ReferenceToConstLinkedPtr) {
- const Matcher<const linked_ptr<double>&> m = NotNull();
- const linked_ptr<double> null_p;
- const linked_ptr<double> non_null_p(new double);
-
- EXPECT_FALSE(m.Matches(null_p));
- EXPECT_TRUE(m.Matches(non_null_p));
-}
-
-TEST(NotNullTest, ReferenceToConstScopedPtr) {
- const Matcher<const scoped_ptr<double>&> m = NotNull();
- const scoped_ptr<double> null_p;
- const scoped_ptr<double> non_null_p(new double);
-
- EXPECT_FALSE(m.Matches(null_p));
- EXPECT_TRUE(m.Matches(non_null_p));
-}
-
-// Tests that NotNull() describes itself properly.
-TEST(NotNullTest, CanDescribeSelf) {
- Matcher<int*> m = NotNull();
- EXPECT_EQ("isn't NULL", Describe(m));
-}
-
-// Tests that Ref(variable) matches an argument that references
-// 'variable'.
-TEST(RefTest, MatchesSameVariable) {
- int a = 0;
- int b = 0;
- Matcher<int&> m = Ref(a);
- EXPECT_TRUE(m.Matches(a));
- EXPECT_FALSE(m.Matches(b));
-}
-
-// Tests that Ref(variable) describes itself properly.
-TEST(RefTest, CanDescribeSelf) {
- int n = 5;
- Matcher<int&> m = Ref(n);
- stringstream ss;
- ss << "references the variable @" << &n << " 5";
- EXPECT_EQ(string(ss.str()), Describe(m));
-}
-
-// Test that Ref(non_const_varialbe) can be used as a matcher for a
-// const reference.
-TEST(RefTest, CanBeUsedAsMatcherForConstReference) {
- int a = 0;
- int b = 0;
- Matcher<const int&> m = Ref(a);
- EXPECT_TRUE(m.Matches(a));
- EXPECT_FALSE(m.Matches(b));
-}
-
-// Tests that Ref(variable) is covariant, i.e. Ref(derived) can be
-// used wherever Ref(base) can be used (Ref(derived) is a sub-type
-// of Ref(base), but not vice versa.
-
-TEST(RefTest, IsCovariant) {
- Base base, base2;
- Derived derived;
- Matcher<const Base&> m1 = Ref(base);
- EXPECT_TRUE(m1.Matches(base));
- EXPECT_FALSE(m1.Matches(base2));
- EXPECT_FALSE(m1.Matches(derived));
-
- m1 = Ref(derived);
- EXPECT_TRUE(m1.Matches(derived));
- EXPECT_FALSE(m1.Matches(base));
- EXPECT_FALSE(m1.Matches(base2));
-}
-
-TEST(RefTest, ExplainsResult) {
- int n = 0;
- EXPECT_THAT(Explain(Matcher<const int&>(Ref(n)), n),
- StartsWith("which is located @"));
-
- int m = 0;
- EXPECT_THAT(Explain(Matcher<const int&>(Ref(n)), m),
- StartsWith("which is located @"));
-}
-
-// Tests string comparison matchers.
-
-TEST(StrEqTest, MatchesEqualString) {
- Matcher<const char*> m = StrEq(string("Hello"));
- EXPECT_TRUE(m.Matches("Hello"));
- EXPECT_FALSE(m.Matches("hello"));
- EXPECT_FALSE(m.Matches(NULL));
-
- Matcher<const string&> m2 = StrEq("Hello");
- EXPECT_TRUE(m2.Matches("Hello"));
- EXPECT_FALSE(m2.Matches("Hi"));
-}
-
-TEST(StrEqTest, CanDescribeSelf) {
- Matcher<string> m = StrEq("Hi-\'\"?\\\a\b\f\n\r\t\v\xD3");
- EXPECT_EQ("is equal to \"Hi-\'\\\"?\\\\\\a\\b\\f\\n\\r\\t\\v\\xD3\"",
- Describe(m));
-
- string str("01204500800");
- str[3] = '\0';
- Matcher<string> m2 = StrEq(str);
- EXPECT_EQ("is equal to \"012\\04500800\"", Describe(m2));
- str[0] = str[6] = str[7] = str[9] = str[10] = '\0';
- Matcher<string> m3 = StrEq(str);
- EXPECT_EQ("is equal to \"\\012\\045\\0\\08\\0\\0\"", Describe(m3));
-}
-
-TEST(StrNeTest, MatchesUnequalString) {
- Matcher<const char*> m = StrNe("Hello");
- EXPECT_TRUE(m.Matches(""));
- EXPECT_TRUE(m.Matches(NULL));
- EXPECT_FALSE(m.Matches("Hello"));
-
- Matcher<string> m2 = StrNe(string("Hello"));
- EXPECT_TRUE(m2.Matches("hello"));
- EXPECT_FALSE(m2.Matches("Hello"));
-}
-
-TEST(StrNeTest, CanDescribeSelf) {
- Matcher<const char*> m = StrNe("Hi");
- EXPECT_EQ("isn't equal to \"Hi\"", Describe(m));
-}
-
-TEST(StrCaseEqTest, MatchesEqualStringIgnoringCase) {
- Matcher<const char*> m = StrCaseEq(string("Hello"));
- EXPECT_TRUE(m.Matches("Hello"));
- EXPECT_TRUE(m.Matches("hello"));
- EXPECT_FALSE(m.Matches("Hi"));
- EXPECT_FALSE(m.Matches(NULL));
-
- Matcher<const string&> m2 = StrCaseEq("Hello");
- EXPECT_TRUE(m2.Matches("hello"));
- EXPECT_FALSE(m2.Matches("Hi"));
-}
-
-TEST(StrCaseEqTest, MatchesEqualStringWith0IgnoringCase) {
- string str1("oabocdooeoo");
- string str2("OABOCDOOEOO");
- Matcher<const string&> m0 = StrCaseEq(str1);
- EXPECT_FALSE(m0.Matches(str2 + string(1, '\0')));
-
- str1[3] = str2[3] = '\0';
- Matcher<const string&> m1 = StrCaseEq(str1);
- EXPECT_TRUE(m1.Matches(str2));
-
- str1[0] = str1[6] = str1[7] = str1[10] = '\0';
- str2[0] = str2[6] = str2[7] = str2[10] = '\0';
- Matcher<const string&> m2 = StrCaseEq(str1);
- str1[9] = str2[9] = '\0';
- EXPECT_FALSE(m2.Matches(str2));
-
- Matcher<const string&> m3 = StrCaseEq(str1);
- EXPECT_TRUE(m3.Matches(str2));
-
- EXPECT_FALSE(m3.Matches(str2 + "x"));
- str2.append(1, '\0');
- EXPECT_FALSE(m3.Matches(str2));
- EXPECT_FALSE(m3.Matches(string(str2, 0, 9)));
-}
-
-TEST(StrCaseEqTest, CanDescribeSelf) {
- Matcher<string> m = StrCaseEq("Hi");
- EXPECT_EQ("is equal to (ignoring case) \"Hi\"", Describe(m));
-}
-
-TEST(StrCaseNeTest, MatchesUnequalStringIgnoringCase) {
- Matcher<const char*> m = StrCaseNe("Hello");
- EXPECT_TRUE(m.Matches("Hi"));
- EXPECT_TRUE(m.Matches(NULL));
- EXPECT_FALSE(m.Matches("Hello"));
- EXPECT_FALSE(m.Matches("hello"));
-
- Matcher<string> m2 = StrCaseNe(string("Hello"));
- EXPECT_TRUE(m2.Matches(""));
- EXPECT_FALSE(m2.Matches("Hello"));
-}
-
-TEST(StrCaseNeTest, CanDescribeSelf) {
- Matcher<const char*> m = StrCaseNe("Hi");
- EXPECT_EQ("isn't equal to (ignoring case) \"Hi\"", Describe(m));
-}
-
-// Tests that HasSubstr() works for matching string-typed values.
-TEST(HasSubstrTest, WorksForStringClasses) {
- const Matcher<string> m1 = HasSubstr("foo");
- EXPECT_TRUE(m1.Matches(string("I love food.")));
- EXPECT_FALSE(m1.Matches(string("tofo")));
-
- const Matcher<const std::string&> m2 = HasSubstr("foo");
- EXPECT_TRUE(m2.Matches(std::string("I love food.")));
- EXPECT_FALSE(m2.Matches(std::string("tofo")));
-}
-
-// Tests that HasSubstr() works for matching C-string-typed values.
-TEST(HasSubstrTest, WorksForCStrings) {
- const Matcher<char*> m1 = HasSubstr("foo");
- EXPECT_TRUE(m1.Matches(const_cast<char*>("I love food.")));
- EXPECT_FALSE(m1.Matches(const_cast<char*>("tofo")));
- EXPECT_FALSE(m1.Matches(NULL));
-
- const Matcher<const char*> m2 = HasSubstr("foo");
- EXPECT_TRUE(m2.Matches("I love food."));
- EXPECT_FALSE(m2.Matches("tofo"));
- EXPECT_FALSE(m2.Matches(NULL));
-}
-
-// Tests that HasSubstr(s) describes itself properly.
-TEST(HasSubstrTest, CanDescribeSelf) {
- Matcher<string> m = HasSubstr("foo\n\"");
- EXPECT_EQ("has substring \"foo\\n\\\"\"", Describe(m));
-}
-
-TEST(KeyTest, CanDescribeSelf) {
- Matcher<const pair<std::string, int>&> m = Key("foo");
- EXPECT_EQ("has a key that is equal to \"foo\"", Describe(m));
- EXPECT_EQ("doesn't have a key that is equal to \"foo\"", DescribeNegation(m));
-}
-
-TEST(KeyTest, ExplainsResult) {
- Matcher<pair<int, bool> > m = Key(GreaterThan(10));
- EXPECT_EQ("whose first field is a value which is 5 less than 10",
- Explain(m, make_pair(5, true)));
- EXPECT_EQ("whose first field is a value which is 5 more than 10",
- Explain(m, make_pair(15, true)));
-}
-
-TEST(KeyTest, MatchesCorrectly) {
- pair<int, std::string> p(25, "foo");
- EXPECT_THAT(p, Key(25));
- EXPECT_THAT(p, Not(Key(42)));
- EXPECT_THAT(p, Key(Ge(20)));
- EXPECT_THAT(p, Not(Key(Lt(25))));
-}
-
-TEST(KeyTest, SafelyCastsInnerMatcher) {
- Matcher<int> is_positive = Gt(0);
- Matcher<int> is_negative = Lt(0);
- pair<char, bool> p('a', true);
- EXPECT_THAT(p, Key(is_positive));
- EXPECT_THAT(p, Not(Key(is_negative)));
-}
-
-TEST(KeyTest, InsideContainsUsingMap) {
- map<int, char> container;
- container.insert(make_pair(1, 'a'));
- container.insert(make_pair(2, 'b'));
- container.insert(make_pair(4, 'c'));
- EXPECT_THAT(container, Contains(Key(1)));
- EXPECT_THAT(container, Not(Contains(Key(3))));
-}
-
-TEST(KeyTest, InsideContainsUsingMultimap) {
- multimap<int, char> container;
- container.insert(make_pair(1, 'a'));
- container.insert(make_pair(2, 'b'));
- container.insert(make_pair(4, 'c'));
-
- EXPECT_THAT(container, Not(Contains(Key(25))));
- container.insert(make_pair(25, 'd'));
- EXPECT_THAT(container, Contains(Key(25)));
- container.insert(make_pair(25, 'e'));
- EXPECT_THAT(container, Contains(Key(25)));
-
- EXPECT_THAT(container, Contains(Key(1)));
- EXPECT_THAT(container, Not(Contains(Key(3))));
-}
-
-TEST(PairTest, Typing) {
- // Test verifies the following type conversions can be compiled.
- Matcher<const pair<const char*, int>&> m1 = Pair("foo", 42);
- Matcher<const pair<const char*, int> > m2 = Pair("foo", 42);
- Matcher<pair<const char*, int> > m3 = Pair("foo", 42);
-
- Matcher<pair<int, const std::string> > m4 = Pair(25, "42");
- Matcher<pair<const std::string, int> > m5 = Pair("25", 42);
-}
-
-TEST(PairTest, CanDescribeSelf) {
- Matcher<const pair<std::string, int>&> m1 = Pair("foo", 42);
- EXPECT_EQ("has a first field that is equal to \"foo\""
- ", and has a second field that is equal to 42",
- Describe(m1));
- EXPECT_EQ("has a first field that isn't equal to \"foo\""
- ", or has a second field that isn't equal to 42",
- DescribeNegation(m1));
- // Double and triple negation (1 or 2 times not and description of negation).
- Matcher<const pair<int, int>&> m2 = Not(Pair(Not(13), 42));
- EXPECT_EQ("has a first field that isn't equal to 13"
- ", and has a second field that is equal to 42",
- DescribeNegation(m2));
-}
-
-TEST(PairTest, CanExplainMatchResultTo) {
- // If neither field matches, Pair() should explain about the first
- // field.
- const Matcher<pair<int, int> > m = Pair(GreaterThan(0), GreaterThan(0));
- EXPECT_EQ("whose first field does not match, which is 1 less than 0",
- Explain(m, make_pair(-1, -2)));
-
- // If the first field matches but the second doesn't, Pair() should
- // explain about the second field.
- EXPECT_EQ("whose second field does not match, which is 2 less than 0",
- Explain(m, make_pair(1, -2)));
-
- // If the first field doesn't match but the second does, Pair()
- // should explain about the first field.
- EXPECT_EQ("whose first field does not match, which is 1 less than 0",
- Explain(m, make_pair(-1, 2)));
-
- // If both fields match, Pair() should explain about them both.
- EXPECT_EQ("whose both fields match, where the first field is a value "
- "which is 1 more than 0, and the second field is a value "
- "which is 2 more than 0",
- Explain(m, make_pair(1, 2)));
-
- // If only the first match has an explanation, only this explanation should
- // be printed.
- const Matcher<pair<int, int> > explain_first = Pair(GreaterThan(0), 0);
- EXPECT_EQ("whose both fields match, where the first field is a value "
- "which is 1 more than 0",
- Explain(explain_first, make_pair(1, 0)));
-
- // If only the second match has an explanation, only this explanation should
- // be printed.
- const Matcher<pair<int, int> > explain_second = Pair(0, GreaterThan(0));
- EXPECT_EQ("whose both fields match, where the second field is a value "
- "which is 1 more than 0",
- Explain(explain_second, make_pair(0, 1)));
-}
-
-TEST(PairTest, MatchesCorrectly) {
- pair<int, std::string> p(25, "foo");
-
- // Both fields match.
- EXPECT_THAT(p, Pair(25, "foo"));
- EXPECT_THAT(p, Pair(Ge(20), HasSubstr("o")));
-
- // 'first' doesnt' match, but 'second' matches.
- EXPECT_THAT(p, Not(Pair(42, "foo")));
- EXPECT_THAT(p, Not(Pair(Lt(25), "foo")));
-
- // 'first' matches, but 'second' doesn't match.
- EXPECT_THAT(p, Not(Pair(25, "bar")));
- EXPECT_THAT(p, Not(Pair(25, Not("foo"))));
-
- // Neither field matches.
- EXPECT_THAT(p, Not(Pair(13, "bar")));
- EXPECT_THAT(p, Not(Pair(Lt(13), HasSubstr("a"))));
-}
-
-TEST(PairTest, SafelyCastsInnerMatchers) {
- Matcher<int> is_positive = Gt(0);
- Matcher<int> is_negative = Lt(0);
- pair<char, bool> p('a', true);
- EXPECT_THAT(p, Pair(is_positive, _));
- EXPECT_THAT(p, Not(Pair(is_negative, _)));
- EXPECT_THAT(p, Pair(_, is_positive));
- EXPECT_THAT(p, Not(Pair(_, is_negative)));
-}
-
-TEST(PairTest, InsideContainsUsingMap) {
- map<int, char> container;
- container.insert(make_pair(1, 'a'));
- container.insert(make_pair(2, 'b'));
- container.insert(make_pair(4, 'c'));
- EXPECT_THAT(container, Contains(Pair(1, 'a')));
- EXPECT_THAT(container, Contains(Pair(1, _)));
- EXPECT_THAT(container, Contains(Pair(_, 'a')));
- EXPECT_THAT(container, Not(Contains(Pair(3, _))));
-}
-
-// Tests StartsWith(s).
-
-TEST(StartsWithTest, MatchesStringWithGivenPrefix) {
- const Matcher<const char*> m1 = StartsWith(string(""));
- EXPECT_TRUE(m1.Matches("Hi"));
- EXPECT_TRUE(m1.Matches(""));
- EXPECT_FALSE(m1.Matches(NULL));
-
- const Matcher<const string&> m2 = StartsWith("Hi");
- EXPECT_TRUE(m2.Matches("Hi"));
- EXPECT_TRUE(m2.Matches("Hi Hi!"));
- EXPECT_TRUE(m2.Matches("High"));
- EXPECT_FALSE(m2.Matches("H"));
- EXPECT_FALSE(m2.Matches(" Hi"));
-}
-
-TEST(StartsWithTest, CanDescribeSelf) {
- Matcher<const std::string> m = StartsWith("Hi");
- EXPECT_EQ("starts with \"Hi\"", Describe(m));
-}
-
-// Tests EndsWith(s).
-
-TEST(EndsWithTest, MatchesStringWithGivenSuffix) {
- const Matcher<const char*> m1 = EndsWith("");
- EXPECT_TRUE(m1.Matches("Hi"));
- EXPECT_TRUE(m1.Matches(""));
- EXPECT_FALSE(m1.Matches(NULL));
-
- const Matcher<const string&> m2 = EndsWith(string("Hi"));
- EXPECT_TRUE(m2.Matches("Hi"));
- EXPECT_TRUE(m2.Matches("Wow Hi Hi"));
- EXPECT_TRUE(m2.Matches("Super Hi"));
- EXPECT_FALSE(m2.Matches("i"));
- EXPECT_FALSE(m2.Matches("Hi "));
-}
-
-TEST(EndsWithTest, CanDescribeSelf) {
- Matcher<const std::string> m = EndsWith("Hi");
- EXPECT_EQ("ends with \"Hi\"", Describe(m));
-}
-
-// Tests MatchesRegex().
-
-TEST(MatchesRegexTest, MatchesStringMatchingGivenRegex) {
- const Matcher<const char*> m1 = MatchesRegex("a.*z");
- EXPECT_TRUE(m1.Matches("az"));
- EXPECT_TRUE(m1.Matches("abcz"));
- EXPECT_FALSE(m1.Matches(NULL));
-
- const Matcher<const string&> m2 = MatchesRegex(new RE("a.*z"));
- EXPECT_TRUE(m2.Matches("azbz"));
- EXPECT_FALSE(m2.Matches("az1"));
- EXPECT_FALSE(m2.Matches("1az"));
-}
-
-TEST(MatchesRegexTest, CanDescribeSelf) {
- Matcher<const std::string> m1 = MatchesRegex(string("Hi.*"));
- EXPECT_EQ("matches regular expression \"Hi.*\"", Describe(m1));
-
- Matcher<const char*> m2 = MatchesRegex(new RE("a.*"));
- EXPECT_EQ("matches regular expression \"a.*\"", Describe(m2));
-}
-
-// Tests ContainsRegex().
-
-TEST(ContainsRegexTest, MatchesStringContainingGivenRegex) {
- const Matcher<const char*> m1 = ContainsRegex(string("a.*z"));
- EXPECT_TRUE(m1.Matches("az"));
- EXPECT_TRUE(m1.Matches("0abcz1"));
- EXPECT_FALSE(m1.Matches(NULL));
-
- const Matcher<const string&> m2 = ContainsRegex(new RE("a.*z"));
- EXPECT_TRUE(m2.Matches("azbz"));
- EXPECT_TRUE(m2.Matches("az1"));
- EXPECT_FALSE(m2.Matches("1a"));
-}
-
-TEST(ContainsRegexTest, CanDescribeSelf) {
- Matcher<const std::string> m1 = ContainsRegex("Hi.*");
- EXPECT_EQ("contains regular expression \"Hi.*\"", Describe(m1));
-
- Matcher<const char*> m2 = ContainsRegex(new RE("a.*"));
- EXPECT_EQ("contains regular expression \"a.*\"", Describe(m2));
-}
-
-// Tests for wide strings.
-#if GTEST_HAS_STD_WSTRING
-TEST(StdWideStrEqTest, MatchesEqual) {
- Matcher<const wchar_t*> m = StrEq(::std::wstring(L"Hello"));
- EXPECT_TRUE(m.Matches(L"Hello"));
- EXPECT_FALSE(m.Matches(L"hello"));
- EXPECT_FALSE(m.Matches(NULL));
-
- Matcher<const ::std::wstring&> m2 = StrEq(L"Hello");
- EXPECT_TRUE(m2.Matches(L"Hello"));
- EXPECT_FALSE(m2.Matches(L"Hi"));
-
- Matcher<const ::std::wstring&> m3 = StrEq(L"\xD3\x576\x8D3\xC74D");
- EXPECT_TRUE(m3.Matches(L"\xD3\x576\x8D3\xC74D"));
- EXPECT_FALSE(m3.Matches(L"\xD3\x576\x8D3\xC74E"));
-
- ::std::wstring str(L"01204500800");
- str[3] = L'\0';
- Matcher<const ::std::wstring&> m4 = StrEq(str);
- EXPECT_TRUE(m4.Matches(str));
- str[0] = str[6] = str[7] = str[9] = str[10] = L'\0';
- Matcher<const ::std::wstring&> m5 = StrEq(str);
- EXPECT_TRUE(m5.Matches(str));
-}
-
-TEST(StdWideStrEqTest, CanDescribeSelf) {
- Matcher< ::std::wstring> m = StrEq(L"Hi-\'\"?\\\a\b\f\n\r\t\v");
- EXPECT_EQ("is equal to L\"Hi-\'\\\"?\\\\\\a\\b\\f\\n\\r\\t\\v\"",
- Describe(m));
-
- Matcher< ::std::wstring> m2 = StrEq(L"\xD3\x576\x8D3\xC74D");
- EXPECT_EQ("is equal to L\"\\xD3\\x576\\x8D3\\xC74D\"",
- Describe(m2));
-
- ::std::wstring str(L"01204500800");
- str[3] = L'\0';
- Matcher<const ::std::wstring&> m4 = StrEq(str);
- EXPECT_EQ("is equal to L\"012\\04500800\"", Describe(m4));
- str[0] = str[6] = str[7] = str[9] = str[10] = L'\0';
- Matcher<const ::std::wstring&> m5 = StrEq(str);
- EXPECT_EQ("is equal to L\"\\012\\045\\0\\08\\0\\0\"", Describe(m5));
-}
-
-TEST(StdWideStrNeTest, MatchesUnequalString) {
- Matcher<const wchar_t*> m = StrNe(L"Hello");
- EXPECT_TRUE(m.Matches(L""));
- EXPECT_TRUE(m.Matches(NULL));
- EXPECT_FALSE(m.Matches(L"Hello"));
-
- Matcher< ::std::wstring> m2 = StrNe(::std::wstring(L"Hello"));
- EXPECT_TRUE(m2.Matches(L"hello"));
- EXPECT_FALSE(m2.Matches(L"Hello"));
-}
-
-TEST(StdWideStrNeTest, CanDescribeSelf) {
- Matcher<const wchar_t*> m = StrNe(L"Hi");
- EXPECT_EQ("isn't equal to L\"Hi\"", Describe(m));
-}
-
-TEST(StdWideStrCaseEqTest, MatchesEqualStringIgnoringCase) {
- Matcher<const wchar_t*> m = StrCaseEq(::std::wstring(L"Hello"));
- EXPECT_TRUE(m.Matches(L"Hello"));
- EXPECT_TRUE(m.Matches(L"hello"));
- EXPECT_FALSE(m.Matches(L"Hi"));
- EXPECT_FALSE(m.Matches(NULL));
-
- Matcher<const ::std::wstring&> m2 = StrCaseEq(L"Hello");
- EXPECT_TRUE(m2.Matches(L"hello"));
- EXPECT_FALSE(m2.Matches(L"Hi"));
-}
-
-TEST(StdWideStrCaseEqTest, MatchesEqualStringWith0IgnoringCase) {
- ::std::wstring str1(L"oabocdooeoo");
- ::std::wstring str2(L"OABOCDOOEOO");
- Matcher<const ::std::wstring&> m0 = StrCaseEq(str1);
- EXPECT_FALSE(m0.Matches(str2 + ::std::wstring(1, L'\0')));
-
- str1[3] = str2[3] = L'\0';
- Matcher<const ::std::wstring&> m1 = StrCaseEq(str1);
- EXPECT_TRUE(m1.Matches(str2));
-
- str1[0] = str1[6] = str1[7] = str1[10] = L'\0';
- str2[0] = str2[6] = str2[7] = str2[10] = L'\0';
- Matcher<const ::std::wstring&> m2 = StrCaseEq(str1);
- str1[9] = str2[9] = L'\0';
- EXPECT_FALSE(m2.Matches(str2));
-
- Matcher<const ::std::wstring&> m3 = StrCaseEq(str1);
- EXPECT_TRUE(m3.Matches(str2));
-
- EXPECT_FALSE(m3.Matches(str2 + L"x"));
- str2.append(1, L'\0');
- EXPECT_FALSE(m3.Matches(str2));
- EXPECT_FALSE(m3.Matches(::std::wstring(str2, 0, 9)));
-}
-
-TEST(StdWideStrCaseEqTest, CanDescribeSelf) {
- Matcher< ::std::wstring> m = StrCaseEq(L"Hi");
- EXPECT_EQ("is equal to (ignoring case) L\"Hi\"", Describe(m));
-}
-
-TEST(StdWideStrCaseNeTest, MatchesUnequalStringIgnoringCase) {
- Matcher<const wchar_t*> m = StrCaseNe(L"Hello");
- EXPECT_TRUE(m.Matches(L"Hi"));
- EXPECT_TRUE(m.Matches(NULL));
- EXPECT_FALSE(m.Matches(L"Hello"));
- EXPECT_FALSE(m.Matches(L"hello"));
-
- Matcher< ::std::wstring> m2 = StrCaseNe(::std::wstring(L"Hello"));
- EXPECT_TRUE(m2.Matches(L""));
- EXPECT_FALSE(m2.Matches(L"Hello"));
-}
-
-TEST(StdWideStrCaseNeTest, CanDescribeSelf) {
- Matcher<const wchar_t*> m = StrCaseNe(L"Hi");
- EXPECT_EQ("isn't equal to (ignoring case) L\"Hi\"", Describe(m));
-}
-
-// Tests that HasSubstr() works for matching wstring-typed values.
-TEST(StdWideHasSubstrTest, WorksForStringClasses) {
- const Matcher< ::std::wstring> m1 = HasSubstr(L"foo");
- EXPECT_TRUE(m1.Matches(::std::wstring(L"I love food.")));
- EXPECT_FALSE(m1.Matches(::std::wstring(L"tofo")));
-
- const Matcher<const ::std::wstring&> m2 = HasSubstr(L"foo");
- EXPECT_TRUE(m2.Matches(::std::wstring(L"I love food.")));
- EXPECT_FALSE(m2.Matches(::std::wstring(L"tofo")));
-}
-
-// Tests that HasSubstr() works for matching C-wide-string-typed values.
-TEST(StdWideHasSubstrTest, WorksForCStrings) {
- const Matcher<wchar_t*> m1 = HasSubstr(L"foo");
- EXPECT_TRUE(m1.Matches(const_cast<wchar_t*>(L"I love food.")));
- EXPECT_FALSE(m1.Matches(const_cast<wchar_t*>(L"tofo")));
- EXPECT_FALSE(m1.Matches(NULL));
-
- const Matcher<const wchar_t*> m2 = HasSubstr(L"foo");
- EXPECT_TRUE(m2.Matches(L"I love food."));
- EXPECT_FALSE(m2.Matches(L"tofo"));
- EXPECT_FALSE(m2.Matches(NULL));
-}
-
-// Tests that HasSubstr(s) describes itself properly.
-TEST(StdWideHasSubstrTest, CanDescribeSelf) {
- Matcher< ::std::wstring> m = HasSubstr(L"foo\n\"");
- EXPECT_EQ("has substring L\"foo\\n\\\"\"", Describe(m));
-}
-
-// Tests StartsWith(s).
-
-TEST(StdWideStartsWithTest, MatchesStringWithGivenPrefix) {
- const Matcher<const wchar_t*> m1 = StartsWith(::std::wstring(L""));
- EXPECT_TRUE(m1.Matches(L"Hi"));
- EXPECT_TRUE(m1.Matches(L""));
- EXPECT_FALSE(m1.Matches(NULL));
-
- const Matcher<const ::std::wstring&> m2 = StartsWith(L"Hi");
- EXPECT_TRUE(m2.Matches(L"Hi"));
- EXPECT_TRUE(m2.Matches(L"Hi Hi!"));
- EXPECT_TRUE(m2.Matches(L"High"));
- EXPECT_FALSE(m2.Matches(L"H"));
- EXPECT_FALSE(m2.Matches(L" Hi"));
-}
-
-TEST(StdWideStartsWithTest, CanDescribeSelf) {
- Matcher<const ::std::wstring> m = StartsWith(L"Hi");
- EXPECT_EQ("starts with L\"Hi\"", Describe(m));
-}
-
-// Tests EndsWith(s).
-
-TEST(StdWideEndsWithTest, MatchesStringWithGivenSuffix) {
- const Matcher<const wchar_t*> m1 = EndsWith(L"");
- EXPECT_TRUE(m1.Matches(L"Hi"));
- EXPECT_TRUE(m1.Matches(L""));
- EXPECT_FALSE(m1.Matches(NULL));
-
- const Matcher<const ::std::wstring&> m2 = EndsWith(::std::wstring(L"Hi"));
- EXPECT_TRUE(m2.Matches(L"Hi"));
- EXPECT_TRUE(m2.Matches(L"Wow Hi Hi"));
- EXPECT_TRUE(m2.Matches(L"Super Hi"));
- EXPECT_FALSE(m2.Matches(L"i"));
- EXPECT_FALSE(m2.Matches(L"Hi "));
-}
-
-TEST(StdWideEndsWithTest, CanDescribeSelf) {
- Matcher<const ::std::wstring> m = EndsWith(L"Hi");
- EXPECT_EQ("ends with L\"Hi\"", Describe(m));
-}
-
-#endif // GTEST_HAS_STD_WSTRING
-
-#if GTEST_HAS_GLOBAL_WSTRING
-TEST(GlobalWideStrEqTest, MatchesEqual) {
- Matcher<const wchar_t*> m = StrEq(::wstring(L"Hello"));
- EXPECT_TRUE(m.Matches(L"Hello"));
- EXPECT_FALSE(m.Matches(L"hello"));
- EXPECT_FALSE(m.Matches(NULL));
-
- Matcher<const ::wstring&> m2 = StrEq(L"Hello");
- EXPECT_TRUE(m2.Matches(L"Hello"));
- EXPECT_FALSE(m2.Matches(L"Hi"));
-
- Matcher<const ::wstring&> m3 = StrEq(L"\xD3\x576\x8D3\xC74D");
- EXPECT_TRUE(m3.Matches(L"\xD3\x576\x8D3\xC74D"));
- EXPECT_FALSE(m3.Matches(L"\xD3\x576\x8D3\xC74E"));
-
- ::wstring str(L"01204500800");
- str[3] = L'\0';
- Matcher<const ::wstring&> m4 = StrEq(str);
- EXPECT_TRUE(m4.Matches(str));
- str[0] = str[6] = str[7] = str[9] = str[10] = L'\0';
- Matcher<const ::wstring&> m5 = StrEq(str);
- EXPECT_TRUE(m5.Matches(str));
-}
-
-TEST(GlobalWideStrEqTest, CanDescribeSelf) {
- Matcher< ::wstring> m = StrEq(L"Hi-\'\"?\\\a\b\f\n\r\t\v");
- EXPECT_EQ("is equal to L\"Hi-\'\\\"?\\\\\\a\\b\\f\\n\\r\\t\\v\"",
- Describe(m));
-
- Matcher< ::wstring> m2 = StrEq(L"\xD3\x576\x8D3\xC74D");
- EXPECT_EQ("is equal to L\"\\xD3\\x576\\x8D3\\xC74D\"",
- Describe(m2));
-
- ::wstring str(L"01204500800");
- str[3] = L'\0';
- Matcher<const ::wstring&> m4 = StrEq(str);
- EXPECT_EQ("is equal to L\"012\\04500800\"", Describe(m4));
- str[0] = str[6] = str[7] = str[9] = str[10] = L'\0';
- Matcher<const ::wstring&> m5 = StrEq(str);
- EXPECT_EQ("is equal to L\"\\012\\045\\0\\08\\0\\0\"", Describe(m5));
-}
-
-TEST(GlobalWideStrNeTest, MatchesUnequalString) {
- Matcher<const wchar_t*> m = StrNe(L"Hello");
- EXPECT_TRUE(m.Matches(L""));
- EXPECT_TRUE(m.Matches(NULL));
- EXPECT_FALSE(m.Matches(L"Hello"));
-
- Matcher< ::wstring> m2 = StrNe(::wstring(L"Hello"));
- EXPECT_TRUE(m2.Matches(L"hello"));
- EXPECT_FALSE(m2.Matches(L"Hello"));
-}
-
-TEST(GlobalWideStrNeTest, CanDescribeSelf) {
- Matcher<const wchar_t*> m = StrNe(L"Hi");
- EXPECT_EQ("isn't equal to L\"Hi\"", Describe(m));
-}
-
-TEST(GlobalWideStrCaseEqTest, MatchesEqualStringIgnoringCase) {
- Matcher<const wchar_t*> m = StrCaseEq(::wstring(L"Hello"));
- EXPECT_TRUE(m.Matches(L"Hello"));
- EXPECT_TRUE(m.Matches(L"hello"));
- EXPECT_FALSE(m.Matches(L"Hi"));
- EXPECT_FALSE(m.Matches(NULL));
-
- Matcher<const ::wstring&> m2 = StrCaseEq(L"Hello");
- EXPECT_TRUE(m2.Matches(L"hello"));
- EXPECT_FALSE(m2.Matches(L"Hi"));
-}
-
-TEST(GlobalWideStrCaseEqTest, MatchesEqualStringWith0IgnoringCase) {
- ::wstring str1(L"oabocdooeoo");
- ::wstring str2(L"OABOCDOOEOO");
- Matcher<const ::wstring&> m0 = StrCaseEq(str1);
- EXPECT_FALSE(m0.Matches(str2 + ::wstring(1, L'\0')));
-
- str1[3] = str2[3] = L'\0';
- Matcher<const ::wstring&> m1 = StrCaseEq(str1);
- EXPECT_TRUE(m1.Matches(str2));
-
- str1[0] = str1[6] = str1[7] = str1[10] = L'\0';
- str2[0] = str2[6] = str2[7] = str2[10] = L'\0';
- Matcher<const ::wstring&> m2 = StrCaseEq(str1);
- str1[9] = str2[9] = L'\0';
- EXPECT_FALSE(m2.Matches(str2));
-
- Matcher<const ::wstring&> m3 = StrCaseEq(str1);
- EXPECT_TRUE(m3.Matches(str2));
-
- EXPECT_FALSE(m3.Matches(str2 + L"x"));
- str2.append(1, L'\0');
- EXPECT_FALSE(m3.Matches(str2));
- EXPECT_FALSE(m3.Matches(::wstring(str2, 0, 9)));
-}
-
-TEST(GlobalWideStrCaseEqTest, CanDescribeSelf) {
- Matcher< ::wstring> m = StrCaseEq(L"Hi");
- EXPECT_EQ("is equal to (ignoring case) L\"Hi\"", Describe(m));
-}
-
-TEST(GlobalWideStrCaseNeTest, MatchesUnequalStringIgnoringCase) {
- Matcher<const wchar_t*> m = StrCaseNe(L"Hello");
- EXPECT_TRUE(m.Matches(L"Hi"));
- EXPECT_TRUE(m.Matches(NULL));
- EXPECT_FALSE(m.Matches(L"Hello"));
- EXPECT_FALSE(m.Matches(L"hello"));
-
- Matcher< ::wstring> m2 = StrCaseNe(::wstring(L"Hello"));
- EXPECT_TRUE(m2.Matches(L""));
- EXPECT_FALSE(m2.Matches(L"Hello"));
-}
-
-TEST(GlobalWideStrCaseNeTest, CanDescribeSelf) {
- Matcher<const wchar_t*> m = StrCaseNe(L"Hi");
- EXPECT_EQ("isn't equal to (ignoring case) L\"Hi\"", Describe(m));
-}
-
-// Tests that HasSubstr() works for matching wstring-typed values.
-TEST(GlobalWideHasSubstrTest, WorksForStringClasses) {
- const Matcher< ::wstring> m1 = HasSubstr(L"foo");
- EXPECT_TRUE(m1.Matches(::wstring(L"I love food.")));
- EXPECT_FALSE(m1.Matches(::wstring(L"tofo")));
-
- const Matcher<const ::wstring&> m2 = HasSubstr(L"foo");
- EXPECT_TRUE(m2.Matches(::wstring(L"I love food.")));
- EXPECT_FALSE(m2.Matches(::wstring(L"tofo")));
-}
-
-// Tests that HasSubstr() works for matching C-wide-string-typed values.
-TEST(GlobalWideHasSubstrTest, WorksForCStrings) {
- const Matcher<wchar_t*> m1 = HasSubstr(L"foo");
- EXPECT_TRUE(m1.Matches(const_cast<wchar_t*>(L"I love food.")));
- EXPECT_FALSE(m1.Matches(const_cast<wchar_t*>(L"tofo")));
- EXPECT_FALSE(m1.Matches(NULL));
-
- const Matcher<const wchar_t*> m2 = HasSubstr(L"foo");
- EXPECT_TRUE(m2.Matches(L"I love food."));
- EXPECT_FALSE(m2.Matches(L"tofo"));
- EXPECT_FALSE(m2.Matches(NULL));
-}
-
-// Tests that HasSubstr(s) describes itself properly.
-TEST(GlobalWideHasSubstrTest, CanDescribeSelf) {
- Matcher< ::wstring> m = HasSubstr(L"foo\n\"");
- EXPECT_EQ("has substring L\"foo\\n\\\"\"", Describe(m));
-}
-
-// Tests StartsWith(s).
-
-TEST(GlobalWideStartsWithTest, MatchesStringWithGivenPrefix) {
- const Matcher<const wchar_t*> m1 = StartsWith(::wstring(L""));
- EXPECT_TRUE(m1.Matches(L"Hi"));
- EXPECT_TRUE(m1.Matches(L""));
- EXPECT_FALSE(m1.Matches(NULL));
-
- const Matcher<const ::wstring&> m2 = StartsWith(L"Hi");
- EXPECT_TRUE(m2.Matches(L"Hi"));
- EXPECT_TRUE(m2.Matches(L"Hi Hi!"));
- EXPECT_TRUE(m2.Matches(L"High"));
- EXPECT_FALSE(m2.Matches(L"H"));
- EXPECT_FALSE(m2.Matches(L" Hi"));
-}
-
-TEST(GlobalWideStartsWithTest, CanDescribeSelf) {
- Matcher<const ::wstring> m = StartsWith(L"Hi");
- EXPECT_EQ("starts with L\"Hi\"", Describe(m));
-}
-
-// Tests EndsWith(s).
-
-TEST(GlobalWideEndsWithTest, MatchesStringWithGivenSuffix) {
- const Matcher<const wchar_t*> m1 = EndsWith(L"");
- EXPECT_TRUE(m1.Matches(L"Hi"));
- EXPECT_TRUE(m1.Matches(L""));
- EXPECT_FALSE(m1.Matches(NULL));
-
- const Matcher<const ::wstring&> m2 = EndsWith(::wstring(L"Hi"));
- EXPECT_TRUE(m2.Matches(L"Hi"));
- EXPECT_TRUE(m2.Matches(L"Wow Hi Hi"));
- EXPECT_TRUE(m2.Matches(L"Super Hi"));
- EXPECT_FALSE(m2.Matches(L"i"));
- EXPECT_FALSE(m2.Matches(L"Hi "));
-}
-
-TEST(GlobalWideEndsWithTest, CanDescribeSelf) {
- Matcher<const ::wstring> m = EndsWith(L"Hi");
- EXPECT_EQ("ends with L\"Hi\"", Describe(m));
-}
-
-#endif // GTEST_HAS_GLOBAL_WSTRING
-
-
-typedef ::std::tr1::tuple<long, int> Tuple2; // NOLINT
-
-// Tests that Eq() matches a 2-tuple where the first field == the
-// second field.
-TEST(Eq2Test, MatchesEqualArguments) {
- Matcher<const Tuple2&> m = Eq();
- EXPECT_TRUE(m.Matches(Tuple2(5L, 5)));
- EXPECT_FALSE(m.Matches(Tuple2(5L, 6)));
-}
-
-// Tests that Eq() describes itself properly.
-TEST(Eq2Test, CanDescribeSelf) {
- Matcher<const Tuple2&> m = Eq();
- EXPECT_EQ("are an equal pair", Describe(m));
-}
-
-// Tests that Ge() matches a 2-tuple where the first field >= the
-// second field.
-TEST(Ge2Test, MatchesGreaterThanOrEqualArguments) {
- Matcher<const Tuple2&> m = Ge();
- EXPECT_TRUE(m.Matches(Tuple2(5L, 4)));
- EXPECT_TRUE(m.Matches(Tuple2(5L, 5)));
- EXPECT_FALSE(m.Matches(Tuple2(5L, 6)));
-}
-
-// Tests that Ge() describes itself properly.
-TEST(Ge2Test, CanDescribeSelf) {
- Matcher<const Tuple2&> m = Ge();
- EXPECT_EQ("are a pair where the first >= the second", Describe(m));
-}
-
-// Tests that Gt() matches a 2-tuple where the first field > the
-// second field.
-TEST(Gt2Test, MatchesGreaterThanArguments) {
- Matcher<const Tuple2&> m = Gt();
- EXPECT_TRUE(m.Matches(Tuple2(5L, 4)));
- EXPECT_FALSE(m.Matches(Tuple2(5L, 5)));
- EXPECT_FALSE(m.Matches(Tuple2(5L, 6)));
-}
-
-// Tests that Gt() describes itself properly.
-TEST(Gt2Test, CanDescribeSelf) {
- Matcher<const Tuple2&> m = Gt();
- EXPECT_EQ("are a pair where the first > the second", Describe(m));
-}
-
-// Tests that Le() matches a 2-tuple where the first field <= the
-// second field.
-TEST(Le2Test, MatchesLessThanOrEqualArguments) {
- Matcher<const Tuple2&> m = Le();
- EXPECT_TRUE(m.Matches(Tuple2(5L, 6)));
- EXPECT_TRUE(m.Matches(Tuple2(5L, 5)));
- EXPECT_FALSE(m.Matches(Tuple2(5L, 4)));
-}
-
-// Tests that Le() describes itself properly.
-TEST(Le2Test, CanDescribeSelf) {
- Matcher<const Tuple2&> m = Le();
- EXPECT_EQ("are a pair where the first <= the second", Describe(m));
-}
-
-// Tests that Lt() matches a 2-tuple where the first field < the
-// second field.
-TEST(Lt2Test, MatchesLessThanArguments) {
- Matcher<const Tuple2&> m = Lt();
- EXPECT_TRUE(m.Matches(Tuple2(5L, 6)));
- EXPECT_FALSE(m.Matches(Tuple2(5L, 5)));
- EXPECT_FALSE(m.Matches(Tuple2(5L, 4)));
-}
-
-// Tests that Lt() describes itself properly.
-TEST(Lt2Test, CanDescribeSelf) {
- Matcher<const Tuple2&> m = Lt();
- EXPECT_EQ("are a pair where the first < the second", Describe(m));
-}
-
-// Tests that Ne() matches a 2-tuple where the first field != the
-// second field.
-TEST(Ne2Test, MatchesUnequalArguments) {
- Matcher<const Tuple2&> m = Ne();
- EXPECT_TRUE(m.Matches(Tuple2(5L, 6)));
- EXPECT_TRUE(m.Matches(Tuple2(5L, 4)));
- EXPECT_FALSE(m.Matches(Tuple2(5L, 5)));
-}
-
-// Tests that Ne() describes itself properly.
-TEST(Ne2Test, CanDescribeSelf) {
- Matcher<const Tuple2&> m = Ne();
- EXPECT_EQ("are an unequal pair", Describe(m));
-}
-
-// Tests that Not(m) matches any value that doesn't match m.
-TEST(NotTest, NegatesMatcher) {
- Matcher<int> m;
- m = Not(Eq(2));
- EXPECT_TRUE(m.Matches(3));
- EXPECT_FALSE(m.Matches(2));
-}
-
-// Tests that Not(m) describes itself properly.
-TEST(NotTest, CanDescribeSelf) {
- Matcher<int> m = Not(Eq(5));
- EXPECT_EQ("isn't equal to 5", Describe(m));
-}
-
-// Tests that monomorphic matchers are safely cast by the Not matcher.
-TEST(NotTest, NotMatcherSafelyCastsMonomorphicMatchers) {
- // greater_than_5 is a monomorphic matcher.
- Matcher<int> greater_than_5 = Gt(5);
-
- Matcher<const int&> m = Not(greater_than_5);
- Matcher<int&> m2 = Not(greater_than_5);
- Matcher<int&> m3 = Not(m);
-}
-
-// Helper to allow easy testing of AllOf matchers with num parameters.
-void AllOfMatches(int num, const Matcher<int>& m) {
- SCOPED_TRACE(Describe(m));
- EXPECT_TRUE(m.Matches(0));
- for (int i = 1; i <= num; ++i) {
- EXPECT_FALSE(m.Matches(i));
- }
- EXPECT_TRUE(m.Matches(num + 1));
-}
-
-// Tests that AllOf(m1, ..., mn) matches any value that matches all of
-// the given matchers.
-TEST(AllOfTest, MatchesWhenAllMatch) {
- Matcher<int> m;
- m = AllOf(Le(2), Ge(1));
- EXPECT_TRUE(m.Matches(1));
- EXPECT_TRUE(m.Matches(2));
- EXPECT_FALSE(m.Matches(0));
- EXPECT_FALSE(m.Matches(3));
-
- m = AllOf(Gt(0), Ne(1), Ne(2));
- EXPECT_TRUE(m.Matches(3));
- EXPECT_FALSE(m.Matches(2));
- EXPECT_FALSE(m.Matches(1));
- EXPECT_FALSE(m.Matches(0));
-
- m = AllOf(Gt(0), Ne(1), Ne(2), Ne(3));
- EXPECT_TRUE(m.Matches(4));
- EXPECT_FALSE(m.Matches(3));
- EXPECT_FALSE(m.Matches(2));
- EXPECT_FALSE(m.Matches(1));
- EXPECT_FALSE(m.Matches(0));
-
- m = AllOf(Ge(0), Lt(10), Ne(3), Ne(5), Ne(7));
- EXPECT_TRUE(m.Matches(0));
- EXPECT_TRUE(m.Matches(1));
- EXPECT_FALSE(m.Matches(3));
-
- // The following tests for varying number of sub-matchers. Due to the way
- // the sub-matchers are handled it is enough to test every sub-matcher once
- // with sub-matchers using the same matcher type. Varying matcher types are
- // checked for above.
- AllOfMatches(2, AllOf(Ne(1), Ne(2)));
- AllOfMatches(3, AllOf(Ne(1), Ne(2), Ne(3)));
- AllOfMatches(4, AllOf(Ne(1), Ne(2), Ne(3), Ne(4)));
- AllOfMatches(5, AllOf(Ne(1), Ne(2), Ne(3), Ne(4), Ne(5)));
- AllOfMatches(6, AllOf(Ne(1), Ne(2), Ne(3), Ne(4), Ne(5), Ne(6)));
- AllOfMatches(7, AllOf(Ne(1), Ne(2), Ne(3), Ne(4), Ne(5), Ne(6), Ne(7)));
- AllOfMatches(8, AllOf(Ne(1), Ne(2), Ne(3), Ne(4), Ne(5), Ne(6), Ne(7),
- Ne(8)));
- AllOfMatches(9, AllOf(Ne(1), Ne(2), Ne(3), Ne(4), Ne(5), Ne(6), Ne(7),
- Ne(8), Ne(9)));
- AllOfMatches(10, AllOf(Ne(1), Ne(2), Ne(3), Ne(4), Ne(5), Ne(6), Ne(7), Ne(8),
- Ne(9), Ne(10)));
-}
-
-// Tests that AllOf(m1, ..., mn) describes itself properly.
-TEST(AllOfTest, CanDescribeSelf) {
- Matcher<int> m;
- m = AllOf(Le(2), Ge(1));
- EXPECT_EQ("(is <= 2) and (is >= 1)", Describe(m));
-
- m = AllOf(Gt(0), Ne(1), Ne(2));
- EXPECT_EQ("(is > 0) and "
- "((isn't equal to 1) and "
- "(isn't equal to 2))",
- Describe(m));
-
-
- m = AllOf(Gt(0), Ne(1), Ne(2), Ne(3));
- EXPECT_EQ("((is > 0) and "
- "(isn't equal to 1)) and "
- "((isn't equal to 2) and "
- "(isn't equal to 3))",
- Describe(m));
-
-
- m = AllOf(Ge(0), Lt(10), Ne(3), Ne(5), Ne(7));
- EXPECT_EQ("((is >= 0) and "
- "(is < 10)) and "
- "((isn't equal to 3) and "
- "((isn't equal to 5) and "
- "(isn't equal to 7)))",
- Describe(m));
-}
-
-// Tests that AllOf(m1, ..., mn) describes its negation properly.
-TEST(AllOfTest, CanDescribeNegation) {
- Matcher<int> m;
- m = AllOf(Le(2), Ge(1));
- EXPECT_EQ("(isn't <= 2) or "
- "(isn't >= 1)",
- DescribeNegation(m));
-
- m = AllOf(Gt(0), Ne(1), Ne(2));
- EXPECT_EQ("(isn't > 0) or "
- "((is equal to 1) or "
- "(is equal to 2))",
- DescribeNegation(m));
-
-
- m = AllOf(Gt(0), Ne(1), Ne(2), Ne(3));
- EXPECT_EQ("((isn't > 0) or "
- "(is equal to 1)) or "
- "((is equal to 2) or "
- "(is equal to 3))",
- DescribeNegation(m));
-
-
- m = AllOf(Ge(0), Lt(10), Ne(3), Ne(5), Ne(7));
- EXPECT_EQ("((isn't >= 0) or "
- "(isn't < 10)) or "
- "((is equal to 3) or "
- "((is equal to 5) or "
- "(is equal to 7)))",
- DescribeNegation(m));
-}
-
-// Tests that monomorphic matchers are safely cast by the AllOf matcher.
-TEST(AllOfTest, AllOfMatcherSafelyCastsMonomorphicMatchers) {
- // greater_than_5 and less_than_10 are monomorphic matchers.
- Matcher<int> greater_than_5 = Gt(5);
- Matcher<int> less_than_10 = Lt(10);
-
- Matcher<const int&> m = AllOf(greater_than_5, less_than_10);
- Matcher<int&> m2 = AllOf(greater_than_5, less_than_10);
- Matcher<int&> m3 = AllOf(greater_than_5, m2);
-
- // Tests that BothOf works when composing itself.
- Matcher<const int&> m4 = AllOf(greater_than_5, less_than_10, less_than_10);
- Matcher<int&> m5 = AllOf(greater_than_5, less_than_10, less_than_10);
-}
-
-TEST(AllOfTest, ExplainsResult) {
- Matcher<int> m;
-
- // Successful match. Both matchers need to explain. The second
- // matcher doesn't give an explanation, so only the first matcher's
- // explanation is printed.
- m = AllOf(GreaterThan(10), Lt(30));
- EXPECT_EQ("which is 15 more than 10", Explain(m, 25));
-
- // Successful match. Both matchers need to explain.
- m = AllOf(GreaterThan(10), GreaterThan(20));
- EXPECT_EQ("which is 20 more than 10, and which is 10 more than 20",
- Explain(m, 30));
-
- // Successful match. All matchers need to explain. The second
- // matcher doesn't given an explanation.
- m = AllOf(GreaterThan(10), Lt(30), GreaterThan(20));
- EXPECT_EQ("which is 15 more than 10, and which is 5 more than 20",
- Explain(m, 25));
-
- // Successful match. All matchers need to explain.
- m = AllOf(GreaterThan(10), GreaterThan(20), GreaterThan(30));
- EXPECT_EQ("which is 30 more than 10, and which is 20 more than 20, "
- "and which is 10 more than 30",
- Explain(m, 40));
-
- // Failed match. The first matcher, which failed, needs to
- // explain.
- m = AllOf(GreaterThan(10), GreaterThan(20));
- EXPECT_EQ("which is 5 less than 10", Explain(m, 5));
-
- // Failed match. The second matcher, which failed, needs to
- // explain. Since it doesn't given an explanation, nothing is
- // printed.
- m = AllOf(GreaterThan(10), Lt(30));
- EXPECT_EQ("", Explain(m, 40));
-
- // Failed match. The second matcher, which failed, needs to
- // explain.
- m = AllOf(GreaterThan(10), GreaterThan(20));
- EXPECT_EQ("which is 5 less than 20", Explain(m, 15));
-}
-
-// Helper to allow easy testing of AnyOf matchers with num parameters.
-void AnyOfMatches(int num, const Matcher<int>& m) {
- SCOPED_TRACE(Describe(m));
- EXPECT_FALSE(m.Matches(0));
- for (int i = 1; i <= num; ++i) {
- EXPECT_TRUE(m.Matches(i));
- }
- EXPECT_FALSE(m.Matches(num + 1));
-}
-
-// Tests that AnyOf(m1, ..., mn) matches any value that matches at
-// least one of the given matchers.
-TEST(AnyOfTest, MatchesWhenAnyMatches) {
- Matcher<int> m;
- m = AnyOf(Le(1), Ge(3));
- EXPECT_TRUE(m.Matches(1));
- EXPECT_TRUE(m.Matches(4));
- EXPECT_FALSE(m.Matches(2));
-
- m = AnyOf(Lt(0), Eq(1), Eq(2));
- EXPECT_TRUE(m.Matches(-1));
- EXPECT_TRUE(m.Matches(1));
- EXPECT_TRUE(m.Matches(2));
- EXPECT_FALSE(m.Matches(0));
-
- m = AnyOf(Lt(0), Eq(1), Eq(2), Eq(3));
- EXPECT_TRUE(m.Matches(-1));
- EXPECT_TRUE(m.Matches(1));
- EXPECT_TRUE(m.Matches(2));
- EXPECT_TRUE(m.Matches(3));
- EXPECT_FALSE(m.Matches(0));
-
- m = AnyOf(Le(0), Gt(10), 3, 5, 7);
- EXPECT_TRUE(m.Matches(0));
- EXPECT_TRUE(m.Matches(11));
- EXPECT_TRUE(m.Matches(3));
- EXPECT_FALSE(m.Matches(2));
-
- // The following tests for varying number of sub-matchers. Due to the way
- // the sub-matchers are handled it is enough to test every sub-matcher once
- // with sub-matchers using the same matcher type. Varying matcher types are
- // checked for above.
- AnyOfMatches(2, AnyOf(1, 2));
- AnyOfMatches(3, AnyOf(1, 2, 3));
- AnyOfMatches(4, AnyOf(1, 2, 3, 4));
- AnyOfMatches(5, AnyOf(1, 2, 3, 4, 5));
- AnyOfMatches(6, AnyOf(1, 2, 3, 4, 5, 6));
- AnyOfMatches(7, AnyOf(1, 2, 3, 4, 5, 6, 7));
- AnyOfMatches(8, AnyOf(1, 2, 3, 4, 5, 6, 7, 8));
- AnyOfMatches(9, AnyOf(1, 2, 3, 4, 5, 6, 7, 8, 9));
- AnyOfMatches(10, AnyOf(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
-}
-
-// Tests that AnyOf(m1, ..., mn) describes itself properly.
-TEST(AnyOfTest, CanDescribeSelf) {
- Matcher<int> m;
- m = AnyOf(Le(1), Ge(3));
- EXPECT_EQ("(is <= 1) or (is >= 3)",
- Describe(m));
-
- m = AnyOf(Lt(0), Eq(1), Eq(2));
- EXPECT_EQ("(is < 0) or "
- "((is equal to 1) or (is equal to 2))",
- Describe(m));
-
- m = AnyOf(Lt(0), Eq(1), Eq(2), Eq(3));
- EXPECT_EQ("((is < 0) or "
- "(is equal to 1)) or "
- "((is equal to 2) or "
- "(is equal to 3))",
- Describe(m));
-
- m = AnyOf(Le(0), Gt(10), 3, 5, 7);
- EXPECT_EQ("((is <= 0) or "
- "(is > 10)) or "
- "((is equal to 3) or "
- "((is equal to 5) or "
- "(is equal to 7)))",
- Describe(m));
-}
-
-// Tests that AnyOf(m1, ..., mn) describes its negation properly.
-TEST(AnyOfTest, CanDescribeNegation) {
- Matcher<int> m;
- m = AnyOf(Le(1), Ge(3));
- EXPECT_EQ("(isn't <= 1) and (isn't >= 3)",
- DescribeNegation(m));
-
- m = AnyOf(Lt(0), Eq(1), Eq(2));
- EXPECT_EQ("(isn't < 0) and "
- "((isn't equal to 1) and (isn't equal to 2))",
- DescribeNegation(m));
-
- m = AnyOf(Lt(0), Eq(1), Eq(2), Eq(3));
- EXPECT_EQ("((isn't < 0) and "
- "(isn't equal to 1)) and "
- "((isn't equal to 2) and "
- "(isn't equal to 3))",
- DescribeNegation(m));
-
- m = AnyOf(Le(0), Gt(10), 3, 5, 7);
- EXPECT_EQ("((isn't <= 0) and "
- "(isn't > 10)) and "
- "((isn't equal to 3) and "
- "((isn't equal to 5) and "
- "(isn't equal to 7)))",
- DescribeNegation(m));
-}
-
-// Tests that monomorphic matchers are safely cast by the AnyOf matcher.
-TEST(AnyOfTest, AnyOfMatcherSafelyCastsMonomorphicMatchers) {
- // greater_than_5 and less_than_10 are monomorphic matchers.
- Matcher<int> greater_than_5 = Gt(5);
- Matcher<int> less_than_10 = Lt(10);
-
- Matcher<const int&> m = AnyOf(greater_than_5, less_than_10);
- Matcher<int&> m2 = AnyOf(greater_than_5, less_than_10);
- Matcher<int&> m3 = AnyOf(greater_than_5, m2);
-
- // Tests that EitherOf works when composing itself.
- Matcher<const int&> m4 = AnyOf(greater_than_5, less_than_10, less_than_10);
- Matcher<int&> m5 = AnyOf(greater_than_5, less_than_10, less_than_10);
-}
-
-TEST(AnyOfTest, ExplainsResult) {
- Matcher<int> m;
-
- // Failed match. Both matchers need to explain. The second
- // matcher doesn't give an explanation, so only the first matcher's
- // explanation is printed.
- m = AnyOf(GreaterThan(10), Lt(0));
- EXPECT_EQ("which is 5 less than 10", Explain(m, 5));
-
- // Failed match. Both matchers need to explain.
- m = AnyOf(GreaterThan(10), GreaterThan(20));
- EXPECT_EQ("which is 5 less than 10, and which is 15 less than 20",
- Explain(m, 5));
-
- // Failed match. All matchers need to explain. The second
- // matcher doesn't given an explanation.
- m = AnyOf(GreaterThan(10), Gt(20), GreaterThan(30));
- EXPECT_EQ("which is 5 less than 10, and which is 25 less than 30",
- Explain(m, 5));
-
- // Failed match. All matchers need to explain.
- m = AnyOf(GreaterThan(10), GreaterThan(20), GreaterThan(30));
- EXPECT_EQ("which is 5 less than 10, and which is 15 less than 20, "
- "and which is 25 less than 30",
- Explain(m, 5));
-
- // Successful match. The first matcher, which succeeded, needs to
- // explain.
- m = AnyOf(GreaterThan(10), GreaterThan(20));
- EXPECT_EQ("which is 5 more than 10", Explain(m, 15));
-
- // Successful match. The second matcher, which succeeded, needs to
- // explain. Since it doesn't given an explanation, nothing is
- // printed.
- m = AnyOf(GreaterThan(10), Lt(30));
- EXPECT_EQ("", Explain(m, 0));
-
- // Successful match. The second matcher, which succeeded, needs to
- // explain.
- m = AnyOf(GreaterThan(30), GreaterThan(20));
- EXPECT_EQ("which is 5 more than 20", Explain(m, 25));
-}
-
-// The following predicate function and predicate functor are for
-// testing the Truly(predicate) matcher.
-
-// Returns non-zero if the input is positive. Note that the return
-// type of this function is not bool. It's OK as Truly() accepts any
-// unary function or functor whose return type can be implicitly
-// converted to bool.
-int IsPositive(double x) {
- return x > 0 ? 1 : 0;
-}
-
-// This functor returns true if the input is greater than the given
-// number.
-class IsGreaterThan {
- public:
- explicit IsGreaterThan(int threshold) : threshold_(threshold) {}
-
- bool operator()(int n) const { return n > threshold_; }
-
- private:
- int threshold_;
-};
-
-// For testing Truly().
-const int foo = 0;
-
-// This predicate returns true iff the argument references foo and has
-// a zero value.
-bool ReferencesFooAndIsZero(const int& n) {
- return (&n == &foo) && (n == 0);
-}
-
-// Tests that Truly(predicate) matches what satisfies the given
-// predicate.
-TEST(TrulyTest, MatchesWhatSatisfiesThePredicate) {
- Matcher<double> m = Truly(IsPositive);
- EXPECT_TRUE(m.Matches(2.0));
- EXPECT_FALSE(m.Matches(-1.5));
-}
-
-// Tests that Truly(predicate_functor) works too.
-TEST(TrulyTest, CanBeUsedWithFunctor) {
- Matcher<int> m = Truly(IsGreaterThan(5));
- EXPECT_TRUE(m.Matches(6));
- EXPECT_FALSE(m.Matches(4));
-}
-
-// A class that can be implicitly converted to bool.
-class ConvertibleToBool {
- public:
- explicit ConvertibleToBool(int number) : number_(number) {}
- operator bool() const { return number_ != 0; }
-
- private:
- int number_;
-};
-
-ConvertibleToBool IsNotZero(int number) {
- return ConvertibleToBool(number);
-}
-
-// Tests that the predicate used in Truly() may return a class that's
-// implicitly convertible to bool, even when the class has no
-// operator!().
-TEST(TrulyTest, PredicateCanReturnAClassConvertibleToBool) {
- Matcher<int> m = Truly(IsNotZero);
- EXPECT_TRUE(m.Matches(1));
- EXPECT_FALSE(m.Matches(0));
-}
-
-// Tests that Truly(predicate) can describe itself properly.
-TEST(TrulyTest, CanDescribeSelf) {
- Matcher<double> m = Truly(IsPositive);
- EXPECT_EQ("satisfies the given predicate",
- Describe(m));
-}
-
-// Tests that Truly(predicate) works when the matcher takes its
-// argument by reference.
-TEST(TrulyTest, WorksForByRefArguments) {
- Matcher<const int&> m = Truly(ReferencesFooAndIsZero);
- EXPECT_TRUE(m.Matches(foo));
- int n = 0;
- EXPECT_FALSE(m.Matches(n));
-}
-
-// Tests that Matches(m) is a predicate satisfied by whatever that
-// matches matcher m.
-TEST(MatchesTest, IsSatisfiedByWhatMatchesTheMatcher) {
- EXPECT_TRUE(Matches(Ge(0))(1));
- EXPECT_FALSE(Matches(Eq('a'))('b'));
-}
-
-// Tests that Matches(m) works when the matcher takes its argument by
-// reference.
-TEST(MatchesTest, WorksOnByRefArguments) {
- int m = 0, n = 0;
- EXPECT_TRUE(Matches(AllOf(Ref(n), Eq(0)))(n));
- EXPECT_FALSE(Matches(Ref(m))(n));
-}
-
-// Tests that a Matcher on non-reference type can be used in
-// Matches().
-TEST(MatchesTest, WorksWithMatcherOnNonRefType) {
- Matcher<int> eq5 = Eq(5);
- EXPECT_TRUE(Matches(eq5)(5));
- EXPECT_FALSE(Matches(eq5)(2));
-}
-
-// Tests Value(value, matcher). Since Value() is a simple wrapper for
-// Matches(), which has been tested already, we don't spend a lot of
-// effort on testing Value().
-TEST(ValueTest, WorksWithPolymorphicMatcher) {
- EXPECT_TRUE(Value("hi", StartsWith("h")));
- EXPECT_FALSE(Value(5, Gt(10)));
-}
-
-TEST(ValueTest, WorksWithMonomorphicMatcher) {
- const Matcher<int> is_zero = Eq(0);
- EXPECT_TRUE(Value(0, is_zero));
- EXPECT_FALSE(Value('a', is_zero));
-
- int n = 0;
- const Matcher<const int&> ref_n = Ref(n);
- EXPECT_TRUE(Value(n, ref_n));
- EXPECT_FALSE(Value(1, ref_n));
-}
-
-TEST(ExplainMatchResultTest, WorksWithPolymorphicMatcher) {
- StringMatchResultListener listener1;
- EXPECT_TRUE(ExplainMatchResult(PolymorphicIsEven(), 42, &listener1));
- EXPECT_EQ("% 2 == 0", listener1.str());
-
- StringMatchResultListener listener2;
- EXPECT_FALSE(ExplainMatchResult(Ge(42), 1.5, &listener2));
- EXPECT_EQ("", listener2.str());
-}
-
-TEST(ExplainMatchResultTest, WorksWithMonomorphicMatcher) {
- const Matcher<int> is_even = PolymorphicIsEven();
- StringMatchResultListener listener1;
- EXPECT_TRUE(ExplainMatchResult(is_even, 42, &listener1));
- EXPECT_EQ("% 2 == 0", listener1.str());
-
- const Matcher<const double&> is_zero = Eq(0);
- StringMatchResultListener listener2;
- EXPECT_FALSE(ExplainMatchResult(is_zero, 1.5, &listener2));
- EXPECT_EQ("", listener2.str());
-}
-
-MATCHER_P(Really, inner_matcher, "") {
- return ExplainMatchResult(inner_matcher, arg, result_listener);
-}
-
-TEST(ExplainMatchResultTest, WorksInsideMATCHER) {
- EXPECT_THAT(0, Really(Eq(0)));
-}
-
-TEST(AllArgsTest, WorksForTuple) {
- EXPECT_THAT(make_tuple(1, 2L), AllArgs(Lt()));
- EXPECT_THAT(make_tuple(2L, 1), Not(AllArgs(Lt())));
-}
-
-TEST(AllArgsTest, WorksForNonTuple) {
- EXPECT_THAT(42, AllArgs(Gt(0)));
- EXPECT_THAT('a', Not(AllArgs(Eq('b'))));
-}
-
-class AllArgsHelper {
- public:
- AllArgsHelper() {}
-
- MOCK_METHOD2(Helper, int(char x, int y));
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(AllArgsHelper);
-};
-
-TEST(AllArgsTest, WorksInWithClause) {
- AllArgsHelper helper;
- ON_CALL(helper, Helper(_, _))
- .With(AllArgs(Lt()))
- .WillByDefault(Return(1));
- EXPECT_CALL(helper, Helper(_, _));
- EXPECT_CALL(helper, Helper(_, _))
- .With(AllArgs(Gt()))
- .WillOnce(Return(2));
-
- EXPECT_EQ(1, helper.Helper('\1', 2));
- EXPECT_EQ(2, helper.Helper('a', 1));
-}
-
-// Tests that ASSERT_THAT() and EXPECT_THAT() work when the value
-// matches the matcher.
-TEST(MatcherAssertionTest, WorksWhenMatcherIsSatisfied) {
- ASSERT_THAT(5, Ge(2)) << "This should succeed.";
- ASSERT_THAT("Foo", EndsWith("oo"));
- EXPECT_THAT(2, AllOf(Le(7), Ge(0))) << "This should succeed too.";
- EXPECT_THAT("Hello", StartsWith("Hell"));
-}
-
-// Tests that ASSERT_THAT() and EXPECT_THAT() work when the value
-// doesn't match the matcher.
-TEST(MatcherAssertionTest, WorksWhenMatcherIsNotSatisfied) {
- // 'n' must be static as it is used in an EXPECT_FATAL_FAILURE(),
- // which cannot reference auto variables.
- static unsigned short n; // NOLINT
- n = 5;
-
- // VC++ prior to version 8.0 SP1 has a bug where it will not see any
- // functions declared in the namespace scope from within nested classes.
- // EXPECT/ASSERT_(NON)FATAL_FAILURE macros use nested classes so that all
- // namespace-level functions invoked inside them need to be explicitly
- // resolved.
- EXPECT_FATAL_FAILURE(ASSERT_THAT(n, ::testing::Gt(10)),
- "Value of: n\n"
- "Expected: is > 10\n"
- " Actual: 5" + OfType("unsigned short"));
- n = 0;
- EXPECT_NONFATAL_FAILURE(
- EXPECT_THAT(n, ::testing::AllOf(::testing::Le(7), ::testing::Ge(5))),
- "Value of: n\n"
- "Expected: (is <= 7) and (is >= 5)\n"
- " Actual: 0" + OfType("unsigned short"));
-}
-
-// Tests that ASSERT_THAT() and EXPECT_THAT() work when the argument
-// has a reference type.
-TEST(MatcherAssertionTest, WorksForByRefArguments) {
- // We use a static variable here as EXPECT_FATAL_FAILURE() cannot
- // reference auto variables.
- static int n;
- n = 0;
- EXPECT_THAT(n, AllOf(Le(7), Ref(n)));
- EXPECT_FATAL_FAILURE(ASSERT_THAT(n, ::testing::Not(::testing::Ref(n))),
- "Value of: n\n"
- "Expected: does not reference the variable @");
- // Tests the "Actual" part.
- EXPECT_FATAL_FAILURE(ASSERT_THAT(n, ::testing::Not(::testing::Ref(n))),
- "Actual: 0" + OfType("int") + ", which is located @");
-}
-
-#if !GTEST_OS_SYMBIAN
-// Tests that ASSERT_THAT() and EXPECT_THAT() work when the matcher is
-// monomorphic.
-
-// ASSERT_THAT("hello", starts_with_he) fails to compile with Nokia's
-// Symbian compiler: it tries to compile
-// template<T, U> class MatcherCastImpl { ...
-// virtual bool MatchAndExplain(T x, ...) const {
-// return source_matcher_.MatchAndExplain(static_cast<U>(x), ...);
-// with U == string and T == const char*
-// With ASSERT_THAT("hello"...) changed to ASSERT_THAT(string("hello") ... )
-// the compiler silently crashes with no output.
-// If MatcherCastImpl is changed to use U(x) instead of static_cast<U>(x)
-// the code compiles but the converted string is bogus.
-TEST(MatcherAssertionTest, WorksForMonomorphicMatcher) {
- Matcher<const char*> starts_with_he = StartsWith("he");
- ASSERT_THAT("hello", starts_with_he);
-
- Matcher<const string&> ends_with_ok = EndsWith("ok");
- ASSERT_THAT("book", ends_with_ok);
- const string bad = "bad";
- EXPECT_NONFATAL_FAILURE(EXPECT_THAT(bad, ends_with_ok),
- "Value of: bad\n"
- "Expected: ends with \"ok\"\n"
- " Actual: \"bad\"");
- Matcher<int> is_greater_than_5 = Gt(5);
- EXPECT_NONFATAL_FAILURE(EXPECT_THAT(5, is_greater_than_5),
- "Value of: 5\n"
- "Expected: is > 5\n"
- " Actual: 5" + OfType("int"));
-}
-#endif // !GTEST_OS_SYMBIAN
-
-// Tests floating-point matchers.
-template <typename RawType>
-class FloatingPointTest : public testing::Test {
- protected:
- typedef typename testing::internal::FloatingPoint<RawType> Floating;
- typedef typename Floating::Bits Bits;
-
- virtual void SetUp() {
- const size_t max_ulps = Floating::kMaxUlps;
-
- // The bits that represent 0.0.
- const Bits zero_bits = Floating(0).bits();
-
- // Makes some numbers close to 0.0.
- close_to_positive_zero_ = Floating::ReinterpretBits(zero_bits + max_ulps/2);
- close_to_negative_zero_ = -Floating::ReinterpretBits(
- zero_bits + max_ulps - max_ulps/2);
- further_from_negative_zero_ = -Floating::ReinterpretBits(
- zero_bits + max_ulps + 1 - max_ulps/2);
-
- // The bits that represent 1.0.
- const Bits one_bits = Floating(1).bits();
-
- // Makes some numbers close to 1.0.
- close_to_one_ = Floating::ReinterpretBits(one_bits + max_ulps);
- further_from_one_ = Floating::ReinterpretBits(one_bits + max_ulps + 1);
-
- // +infinity.
- infinity_ = Floating::Infinity();
-
- // The bits that represent +infinity.
- const Bits infinity_bits = Floating(infinity_).bits();
-
- // Makes some numbers close to infinity.
- close_to_infinity_ = Floating::ReinterpretBits(infinity_bits - max_ulps);
- further_from_infinity_ = Floating::ReinterpretBits(
- infinity_bits - max_ulps - 1);
-
- // Makes some NAN's.
- nan1_ = Floating::ReinterpretBits(Floating::kExponentBitMask | 1);
- nan2_ = Floating::ReinterpretBits(Floating::kExponentBitMask | 200);
- }
-
- void TestSize() {
- EXPECT_EQ(sizeof(RawType), sizeof(Bits));
- }
-
- // A battery of tests for FloatingEqMatcher::Matches.
- // matcher_maker is a pointer to a function which creates a FloatingEqMatcher.
- void TestMatches(
- testing::internal::FloatingEqMatcher<RawType> (*matcher_maker)(RawType)) {
- Matcher<RawType> m1 = matcher_maker(0.0);
- EXPECT_TRUE(m1.Matches(-0.0));
- EXPECT_TRUE(m1.Matches(close_to_positive_zero_));
- EXPECT_TRUE(m1.Matches(close_to_negative_zero_));
- EXPECT_FALSE(m1.Matches(1.0));
-
- Matcher<RawType> m2 = matcher_maker(close_to_positive_zero_);
- EXPECT_FALSE(m2.Matches(further_from_negative_zero_));
-
- Matcher<RawType> m3 = matcher_maker(1.0);
- EXPECT_TRUE(m3.Matches(close_to_one_));
- EXPECT_FALSE(m3.Matches(further_from_one_));
-
- // Test commutativity: matcher_maker(0.0).Matches(1.0) was tested above.
- EXPECT_FALSE(m3.Matches(0.0));
-
- Matcher<RawType> m4 = matcher_maker(-infinity_);
- EXPECT_TRUE(m4.Matches(-close_to_infinity_));
-
- Matcher<RawType> m5 = matcher_maker(infinity_);
- EXPECT_TRUE(m5.Matches(close_to_infinity_));
-
- // This is interesting as the representations of infinity_ and nan1_
- // are only 1 DLP apart.
- EXPECT_FALSE(m5.Matches(nan1_));
-
- // matcher_maker can produce a Matcher<const RawType&>, which is needed in
- // some cases.
- Matcher<const RawType&> m6 = matcher_maker(0.0);
- EXPECT_TRUE(m6.Matches(-0.0));
- EXPECT_TRUE(m6.Matches(close_to_positive_zero_));
- EXPECT_FALSE(m6.Matches(1.0));
-
- // matcher_maker can produce a Matcher<RawType&>, which is needed in some
- // cases.
- Matcher<RawType&> m7 = matcher_maker(0.0);
- RawType x = 0.0;
- EXPECT_TRUE(m7.Matches(x));
- x = 0.01f;
- EXPECT_FALSE(m7.Matches(x));
- }
-
- // Pre-calculated numbers to be used by the tests.
-
- static RawType close_to_positive_zero_;
- static RawType close_to_negative_zero_;
- static RawType further_from_negative_zero_;
-
- static RawType close_to_one_;
- static RawType further_from_one_;
-
- static RawType infinity_;
- static RawType close_to_infinity_;
- static RawType further_from_infinity_;
-
- static RawType nan1_;
- static RawType nan2_;
-};
-
-template <typename RawType>
-RawType FloatingPointTest<RawType>::close_to_positive_zero_;
-
-template <typename RawType>
-RawType FloatingPointTest<RawType>::close_to_negative_zero_;
-
-template <typename RawType>
-RawType FloatingPointTest<RawType>::further_from_negative_zero_;
-
-template <typename RawType>
-RawType FloatingPointTest<RawType>::close_to_one_;
-
-template <typename RawType>
-RawType FloatingPointTest<RawType>::further_from_one_;
-
-template <typename RawType>
-RawType FloatingPointTest<RawType>::infinity_;
-
-template <typename RawType>
-RawType FloatingPointTest<RawType>::close_to_infinity_;
-
-template <typename RawType>
-RawType FloatingPointTest<RawType>::further_from_infinity_;
-
-template <typename RawType>
-RawType FloatingPointTest<RawType>::nan1_;
-
-template <typename RawType>
-RawType FloatingPointTest<RawType>::nan2_;
-
-// Instantiate FloatingPointTest for testing floats.
-typedef FloatingPointTest<float> FloatTest;
-
-TEST_F(FloatTest, FloatEqApproximatelyMatchesFloats) {
- TestMatches(&FloatEq);
-}
-
-TEST_F(FloatTest, NanSensitiveFloatEqApproximatelyMatchesFloats) {
- TestMatches(&NanSensitiveFloatEq);
-}
-
-TEST_F(FloatTest, FloatEqCannotMatchNaN) {
- // FloatEq never matches NaN.
- Matcher<float> m = FloatEq(nan1_);
- EXPECT_FALSE(m.Matches(nan1_));
- EXPECT_FALSE(m.Matches(nan2_));
- EXPECT_FALSE(m.Matches(1.0));
-}
-
-TEST_F(FloatTest, NanSensitiveFloatEqCanMatchNaN) {
- // NanSensitiveFloatEq will match NaN.
- Matcher<float> m = NanSensitiveFloatEq(nan1_);
- EXPECT_TRUE(m.Matches(nan1_));
- EXPECT_TRUE(m.Matches(nan2_));
- EXPECT_FALSE(m.Matches(1.0));
-}
-
-TEST_F(FloatTest, FloatEqCanDescribeSelf) {
- Matcher<float> m1 = FloatEq(2.0f);
- EXPECT_EQ("is approximately 2", Describe(m1));
- EXPECT_EQ("isn't approximately 2", DescribeNegation(m1));
-
- Matcher<float> m2 = FloatEq(0.5f);
- EXPECT_EQ("is approximately 0.5", Describe(m2));
- EXPECT_EQ("isn't approximately 0.5", DescribeNegation(m2));
-
- Matcher<float> m3 = FloatEq(nan1_);
- EXPECT_EQ("never matches", Describe(m3));
- EXPECT_EQ("is anything", DescribeNegation(m3));
-}
-
-TEST_F(FloatTest, NanSensitiveFloatEqCanDescribeSelf) {
- Matcher<float> m1 = NanSensitiveFloatEq(2.0f);
- EXPECT_EQ("is approximately 2", Describe(m1));
- EXPECT_EQ("isn't approximately 2", DescribeNegation(m1));
-
- Matcher<float> m2 = NanSensitiveFloatEq(0.5f);
- EXPECT_EQ("is approximately 0.5", Describe(m2));
- EXPECT_EQ("isn't approximately 0.5", DescribeNegation(m2));
-
- Matcher<float> m3 = NanSensitiveFloatEq(nan1_);
- EXPECT_EQ("is NaN", Describe(m3));
- EXPECT_EQ("isn't NaN", DescribeNegation(m3));
-}
-
-// Instantiate FloatingPointTest for testing doubles.
-typedef FloatingPointTest<double> DoubleTest;
-
-TEST_F(DoubleTest, DoubleEqApproximatelyMatchesDoubles) {
- TestMatches(&DoubleEq);
-}
-
-TEST_F(DoubleTest, NanSensitiveDoubleEqApproximatelyMatchesDoubles) {
- TestMatches(&NanSensitiveDoubleEq);
-}
-
-TEST_F(DoubleTest, DoubleEqCannotMatchNaN) {
- // DoubleEq never matches NaN.
- Matcher<double> m = DoubleEq(nan1_);
- EXPECT_FALSE(m.Matches(nan1_));
- EXPECT_FALSE(m.Matches(nan2_));
- EXPECT_FALSE(m.Matches(1.0));
-}
-
-TEST_F(DoubleTest, NanSensitiveDoubleEqCanMatchNaN) {
- // NanSensitiveDoubleEq will match NaN.
- Matcher<double> m = NanSensitiveDoubleEq(nan1_);
- EXPECT_TRUE(m.Matches(nan1_));
- EXPECT_TRUE(m.Matches(nan2_));
- EXPECT_FALSE(m.Matches(1.0));
-}
-
-TEST_F(DoubleTest, DoubleEqCanDescribeSelf) {
- Matcher<double> m1 = DoubleEq(2.0);
- EXPECT_EQ("is approximately 2", Describe(m1));
- EXPECT_EQ("isn't approximately 2", DescribeNegation(m1));
-
- Matcher<double> m2 = DoubleEq(0.5);
- EXPECT_EQ("is approximately 0.5", Describe(m2));
- EXPECT_EQ("isn't approximately 0.5", DescribeNegation(m2));
-
- Matcher<double> m3 = DoubleEq(nan1_);
- EXPECT_EQ("never matches", Describe(m3));
- EXPECT_EQ("is anything", DescribeNegation(m3));
-}
-
-TEST_F(DoubleTest, NanSensitiveDoubleEqCanDescribeSelf) {
- Matcher<double> m1 = NanSensitiveDoubleEq(2.0);
- EXPECT_EQ("is approximately 2", Describe(m1));
- EXPECT_EQ("isn't approximately 2", DescribeNegation(m1));
-
- Matcher<double> m2 = NanSensitiveDoubleEq(0.5);
- EXPECT_EQ("is approximately 0.5", Describe(m2));
- EXPECT_EQ("isn't approximately 0.5", DescribeNegation(m2));
-
- Matcher<double> m3 = NanSensitiveDoubleEq(nan1_);
- EXPECT_EQ("is NaN", Describe(m3));
- EXPECT_EQ("isn't NaN", DescribeNegation(m3));
-}
-
-TEST(PointeeTest, RawPointer) {
- const Matcher<int*> m = Pointee(Ge(0));
-
- int n = 1;
- EXPECT_TRUE(m.Matches(&n));
- n = -1;
- EXPECT_FALSE(m.Matches(&n));
- EXPECT_FALSE(m.Matches(NULL));
-}
-
-TEST(PointeeTest, RawPointerToConst) {
- const Matcher<const double*> m = Pointee(Ge(0));
-
- double x = 1;
- EXPECT_TRUE(m.Matches(&x));
- x = -1;
- EXPECT_FALSE(m.Matches(&x));
- EXPECT_FALSE(m.Matches(NULL));
-}
-
-TEST(PointeeTest, ReferenceToConstRawPointer) {
- const Matcher<int* const &> m = Pointee(Ge(0));
-
- int n = 1;
- EXPECT_TRUE(m.Matches(&n));
- n = -1;
- EXPECT_FALSE(m.Matches(&n));
- EXPECT_FALSE(m.Matches(NULL));
-}
-
-TEST(PointeeTest, ReferenceToNonConstRawPointer) {
- const Matcher<double* &> m = Pointee(Ge(0));
-
- double x = 1.0;
- double* p = &x;
- EXPECT_TRUE(m.Matches(p));
- x = -1;
- EXPECT_FALSE(m.Matches(p));
- p = NULL;
- EXPECT_FALSE(m.Matches(p));
-}
-
-// Minimal const-propagating pointer.
-template <typename T>
-class ConstPropagatingPtr {
- public:
- typedef T element_type;
-
- ConstPropagatingPtr() : val_() {}
- explicit ConstPropagatingPtr(T* t) : val_(t) {}
- ConstPropagatingPtr(const ConstPropagatingPtr& other) : val_(other.val_) {}
-
- T* get() { return val_; }
- T& operator*() { return *val_; }
- // Most smart pointers return non-const T* and T& from the next methods.
- const T* get() const { return val_; }
- const T& operator*() const { return *val_; }
-
- private:
- T* val_;
-};
-
-TEST(PointeeTest, WorksWithConstPropagatingPointers) {
- const Matcher< ConstPropagatingPtr<int> > m = Pointee(Lt(5));
- int three = 3;
- const ConstPropagatingPtr<int> co(&three);
- ConstPropagatingPtr<int> o(&three);
- EXPECT_TRUE(m.Matches(o));
- EXPECT_TRUE(m.Matches(co));
- *o = 6;
- EXPECT_FALSE(m.Matches(o));
- EXPECT_FALSE(m.Matches(ConstPropagatingPtr<int>()));
-}
-
-TEST(PointeeTest, NeverMatchesNull) {
- const Matcher<const char*> m = Pointee(_);
- EXPECT_FALSE(m.Matches(NULL));
-}
-
-// Tests that we can write Pointee(value) instead of Pointee(Eq(value)).
-TEST(PointeeTest, MatchesAgainstAValue) {
- const Matcher<int*> m = Pointee(5);
-
- int n = 5;
- EXPECT_TRUE(m.Matches(&n));
- n = -1;
- EXPECT_FALSE(m.Matches(&n));
- EXPECT_FALSE(m.Matches(NULL));
-}
-
-TEST(PointeeTest, CanDescribeSelf) {
- const Matcher<int*> m = Pointee(Gt(3));
- EXPECT_EQ("points to a value that is > 3", Describe(m));
- EXPECT_EQ("does not point to a value that is > 3",
- DescribeNegation(m));
-}
-
-TEST(PointeeTest, CanExplainMatchResult) {
- const Matcher<const string*> m = Pointee(StartsWith("Hi"));
-
- EXPECT_EQ("", Explain(m, static_cast<const string*>(NULL)));
-
- const Matcher<long*> m2 = Pointee(GreaterThan(1)); // NOLINT
- long n = 3; // NOLINT
- EXPECT_EQ("which points to 3" + OfType("long") + ", which is 2 more than 1",
- Explain(m2, &n));
-}
-
-TEST(PointeeTest, AlwaysExplainsPointee) {
- const Matcher<int*> m = Pointee(0);
- int n = 42;
- EXPECT_EQ("which points to 42" + OfType("int"), Explain(m, &n));
-}
-
-// An uncopyable class.
-class Uncopyable {
- public:
- explicit Uncopyable(int a_value) : value_(a_value) {}
-
- int value() const { return value_; }
- private:
- const int value_;
- GTEST_DISALLOW_COPY_AND_ASSIGN_(Uncopyable);
-};
-
-// Returns true iff x.value() is positive.
-bool ValueIsPositive(const Uncopyable& x) { return x.value() > 0; }
-
-// A user-defined struct for testing Field().
-struct AStruct {
- AStruct() : x(0), y(1.0), z(5), p(NULL) {}
- AStruct(const AStruct& rhs)
- : x(rhs.x), y(rhs.y), z(rhs.z.value()), p(rhs.p) {}
-
- int x; // A non-const field.
- const double y; // A const field.
- Uncopyable z; // An uncopyable field.
- const char* p; // A pointer field.
-
- private:
- GTEST_DISALLOW_ASSIGN_(AStruct);
-};
-
-// A derived struct for testing Field().
-struct DerivedStruct : public AStruct {
- char ch;
-
- private:
- GTEST_DISALLOW_ASSIGN_(DerivedStruct);
-};
-
-// Tests that Field(&Foo::field, ...) works when field is non-const.
-TEST(FieldTest, WorksForNonConstField) {
- Matcher<AStruct> m = Field(&AStruct::x, Ge(0));
-
- AStruct a;
- EXPECT_TRUE(m.Matches(a));
- a.x = -1;
- EXPECT_FALSE(m.Matches(a));
-}
-
-// Tests that Field(&Foo::field, ...) works when field is const.
-TEST(FieldTest, WorksForConstField) {
- AStruct a;
-
- Matcher<AStruct> m = Field(&AStruct::y, Ge(0.0));
- EXPECT_TRUE(m.Matches(a));
- m = Field(&AStruct::y, Le(0.0));
- EXPECT_FALSE(m.Matches(a));
-}
-
-// Tests that Field(&Foo::field, ...) works when field is not copyable.
-TEST(FieldTest, WorksForUncopyableField) {
- AStruct a;
-
- Matcher<AStruct> m = Field(&AStruct::z, Truly(ValueIsPositive));
- EXPECT_TRUE(m.Matches(a));
- m = Field(&AStruct::z, Not(Truly(ValueIsPositive)));
- EXPECT_FALSE(m.Matches(a));
-}
-
-// Tests that Field(&Foo::field, ...) works when field is a pointer.
-TEST(FieldTest, WorksForPointerField) {
- // Matching against NULL.
- Matcher<AStruct> m = Field(&AStruct::p, static_cast<const char*>(NULL));
- AStruct a;
- EXPECT_TRUE(m.Matches(a));
- a.p = "hi";
- EXPECT_FALSE(m.Matches(a));
-
- // Matching a pointer that is not NULL.
- m = Field(&AStruct::p, StartsWith("hi"));
- a.p = "hill";
- EXPECT_TRUE(m.Matches(a));
- a.p = "hole";
- EXPECT_FALSE(m.Matches(a));
-}
-
-// Tests that Field() works when the object is passed by reference.
-TEST(FieldTest, WorksForByRefArgument) {
- Matcher<const AStruct&> m = Field(&AStruct::x, Ge(0));
-
- AStruct a;
- EXPECT_TRUE(m.Matches(a));
- a.x = -1;
- EXPECT_FALSE(m.Matches(a));
-}
-
-// Tests that Field(&Foo::field, ...) works when the argument's type
-// is a sub-type of Foo.
-TEST(FieldTest, WorksForArgumentOfSubType) {
- // Note that the matcher expects DerivedStruct but we say AStruct
- // inside Field().
- Matcher<const DerivedStruct&> m = Field(&AStruct::x, Ge(0));
-
- DerivedStruct d;
- EXPECT_TRUE(m.Matches(d));
- d.x = -1;
- EXPECT_FALSE(m.Matches(d));
-}
-
-// Tests that Field(&Foo::field, m) works when field's type and m's
-// argument type are compatible but not the same.
-TEST(FieldTest, WorksForCompatibleMatcherType) {
- // The field is an int, but the inner matcher expects a signed char.
- Matcher<const AStruct&> m = Field(&AStruct::x,
- Matcher<signed char>(Ge(0)));
-
- AStruct a;
- EXPECT_TRUE(m.Matches(a));
- a.x = -1;
- EXPECT_FALSE(m.Matches(a));
-}
-
-// Tests that Field() can describe itself.
-TEST(FieldTest, CanDescribeSelf) {
- Matcher<const AStruct&> m = Field(&AStruct::x, Ge(0));
-
- EXPECT_EQ("is an object whose given field is >= 0", Describe(m));
- EXPECT_EQ("is an object whose given field isn't >= 0", DescribeNegation(m));
-}
-
-// Tests that Field() can explain the match result.
-TEST(FieldTest, CanExplainMatchResult) {
- Matcher<const AStruct&> m = Field(&AStruct::x, Ge(0));
-
- AStruct a;
- a.x = 1;
- EXPECT_EQ("whose given field is 1" + OfType("int"), Explain(m, a));
-
- m = Field(&AStruct::x, GreaterThan(0));
- EXPECT_EQ(
- "whose given field is 1" + OfType("int") + ", which is 1 more than 0",
- Explain(m, a));
-}
-
-// Tests that Field() works when the argument is a pointer to const.
-TEST(FieldForPointerTest, WorksForPointerToConst) {
- Matcher<const AStruct*> m = Field(&AStruct::x, Ge(0));
-
- AStruct a;
- EXPECT_TRUE(m.Matches(&a));
- a.x = -1;
- EXPECT_FALSE(m.Matches(&a));
-}
-
-// Tests that Field() works when the argument is a pointer to non-const.
-TEST(FieldForPointerTest, WorksForPointerToNonConst) {
- Matcher<AStruct*> m = Field(&AStruct::x, Ge(0));
-
- AStruct a;
- EXPECT_TRUE(m.Matches(&a));
- a.x = -1;
- EXPECT_FALSE(m.Matches(&a));
-}
-
-// Tests that Field() works when the argument is a reference to a const pointer.
-TEST(FieldForPointerTest, WorksForReferenceToConstPointer) {
- Matcher<AStruct* const&> m = Field(&AStruct::x, Ge(0));
-
- AStruct a;
- EXPECT_TRUE(m.Matches(&a));
- a.x = -1;
- EXPECT_FALSE(m.Matches(&a));
-}
-
-// Tests that Field() does not match the NULL pointer.
-TEST(FieldForPointerTest, DoesNotMatchNull) {
- Matcher<const AStruct*> m = Field(&AStruct::x, _);
- EXPECT_FALSE(m.Matches(NULL));
-}
-
-// Tests that Field(&Foo::field, ...) works when the argument's type
-// is a sub-type of const Foo*.
-TEST(FieldForPointerTest, WorksForArgumentOfSubType) {
- // Note that the matcher expects DerivedStruct but we say AStruct
- // inside Field().
- Matcher<DerivedStruct*> m = Field(&AStruct::x, Ge(0));
-
- DerivedStruct d;
- EXPECT_TRUE(m.Matches(&d));
- d.x = -1;
- EXPECT_FALSE(m.Matches(&d));
-}
-
-// Tests that Field() can describe itself when used to match a pointer.
-TEST(FieldForPointerTest, CanDescribeSelf) {
- Matcher<const AStruct*> m = Field(&AStruct::x, Ge(0));
-
- EXPECT_EQ("is an object whose given field is >= 0", Describe(m));
- EXPECT_EQ("is an object whose given field isn't >= 0", DescribeNegation(m));
-}
-
-// Tests that Field() can explain the result of matching a pointer.
-TEST(FieldForPointerTest, CanExplainMatchResult) {
- Matcher<const AStruct*> m = Field(&AStruct::x, Ge(0));
-
- AStruct a;
- a.x = 1;
- EXPECT_EQ("", Explain(m, static_cast<const AStruct*>(NULL)));
- EXPECT_EQ("which points to an object whose given field is 1" + OfType("int"),
- Explain(m, &a));
-
- m = Field(&AStruct::x, GreaterThan(0));
- EXPECT_EQ("which points to an object whose given field is 1" + OfType("int") +
- ", which is 1 more than 0", Explain(m, &a));
-}
-
-// A user-defined class for testing Property().
-class AClass {
- public:
- AClass() : n_(0) {}
-
- // A getter that returns a non-reference.
- int n() const { return n_; }
-
- void set_n(int new_n) { n_ = new_n; }
-
- // A getter that returns a reference to const.
- const string& s() const { return s_; }
-
- void set_s(const string& new_s) { s_ = new_s; }
-
- // A getter that returns a reference to non-const.
- double& x() const { return x_; }
- private:
- int n_;
- string s_;
-
- static double x_;
-};
-
-double AClass::x_ = 0.0;
-
-// A derived class for testing Property().
-class DerivedClass : public AClass {
- private:
- int k_;
-};
-
-// Tests that Property(&Foo::property, ...) works when property()
-// returns a non-reference.
-TEST(PropertyTest, WorksForNonReferenceProperty) {
- Matcher<const AClass&> m = Property(&AClass::n, Ge(0));
-
- AClass a;
- a.set_n(1);
- EXPECT_TRUE(m.Matches(a));
-
- a.set_n(-1);
- EXPECT_FALSE(m.Matches(a));
-}
-
-// Tests that Property(&Foo::property, ...) works when property()
-// returns a reference to const.
-TEST(PropertyTest, WorksForReferenceToConstProperty) {
- Matcher<const AClass&> m = Property(&AClass::s, StartsWith("hi"));
-
- AClass a;
- a.set_s("hill");
- EXPECT_TRUE(m.Matches(a));
-
- a.set_s("hole");
- EXPECT_FALSE(m.Matches(a));
-}
-
-// Tests that Property(&Foo::property, ...) works when property()
-// returns a reference to non-const.
-TEST(PropertyTest, WorksForReferenceToNonConstProperty) {
- double x = 0.0;
- AClass a;
-
- Matcher<const AClass&> m = Property(&AClass::x, Ref(x));
- EXPECT_FALSE(m.Matches(a));
-
- m = Property(&AClass::x, Not(Ref(x)));
- EXPECT_TRUE(m.Matches(a));
-}
-
-// Tests that Property(&Foo::property, ...) works when the argument is
-// passed by value.
-TEST(PropertyTest, WorksForByValueArgument) {
- Matcher<AClass> m = Property(&AClass::s, StartsWith("hi"));
-
- AClass a;
- a.set_s("hill");
- EXPECT_TRUE(m.Matches(a));
-
- a.set_s("hole");
- EXPECT_FALSE(m.Matches(a));
-}
-
-// Tests that Property(&Foo::property, ...) works when the argument's
-// type is a sub-type of Foo.
-TEST(PropertyTest, WorksForArgumentOfSubType) {
- // The matcher expects a DerivedClass, but inside the Property() we
- // say AClass.
- Matcher<const DerivedClass&> m = Property(&AClass::n, Ge(0));
-
- DerivedClass d;
- d.set_n(1);
- EXPECT_TRUE(m.Matches(d));
-
- d.set_n(-1);
- EXPECT_FALSE(m.Matches(d));
-}
-
-// Tests that Property(&Foo::property, m) works when property()'s type
-// and m's argument type are compatible but different.
-TEST(PropertyTest, WorksForCompatibleMatcherType) {
- // n() returns an int but the inner matcher expects a signed char.
- Matcher<const AClass&> m = Property(&AClass::n,
- Matcher<signed char>(Ge(0)));
-
- AClass a;
- EXPECT_TRUE(m.Matches(a));
- a.set_n(-1);
- EXPECT_FALSE(m.Matches(a));
-}
-
-// Tests that Property() can describe itself.
-TEST(PropertyTest, CanDescribeSelf) {
- Matcher<const AClass&> m = Property(&AClass::n, Ge(0));
-
- EXPECT_EQ("is an object whose given property is >= 0", Describe(m));
- EXPECT_EQ("is an object whose given property isn't >= 0",
- DescribeNegation(m));
-}
-
-// Tests that Property() can explain the match result.
-TEST(PropertyTest, CanExplainMatchResult) {
- Matcher<const AClass&> m = Property(&AClass::n, Ge(0));
-
- AClass a;
- a.set_n(1);
- EXPECT_EQ("whose given property is 1" + OfType("int"), Explain(m, a));
-
- m = Property(&AClass::n, GreaterThan(0));
- EXPECT_EQ(
- "whose given property is 1" + OfType("int") + ", which is 1 more than 0",
- Explain(m, a));
-}
-
-// Tests that Property() works when the argument is a pointer to const.
-TEST(PropertyForPointerTest, WorksForPointerToConst) {
- Matcher<const AClass*> m = Property(&AClass::n, Ge(0));
-
- AClass a;
- a.set_n(1);
- EXPECT_TRUE(m.Matches(&a));
-
- a.set_n(-1);
- EXPECT_FALSE(m.Matches(&a));
-}
-
-// Tests that Property() works when the argument is a pointer to non-const.
-TEST(PropertyForPointerTest, WorksForPointerToNonConst) {
- Matcher<AClass*> m = Property(&AClass::s, StartsWith("hi"));
-
- AClass a;
- a.set_s("hill");
- EXPECT_TRUE(m.Matches(&a));
-
- a.set_s("hole");
- EXPECT_FALSE(m.Matches(&a));
-}
-
-// Tests that Property() works when the argument is a reference to a
-// const pointer.
-TEST(PropertyForPointerTest, WorksForReferenceToConstPointer) {
- Matcher<AClass* const&> m = Property(&AClass::s, StartsWith("hi"));
-
- AClass a;
- a.set_s("hill");
- EXPECT_TRUE(m.Matches(&a));
-
- a.set_s("hole");
- EXPECT_FALSE(m.Matches(&a));
-}
-
-// Tests that Property() does not match the NULL pointer.
-TEST(PropertyForPointerTest, WorksForReferenceToNonConstProperty) {
- Matcher<const AClass*> m = Property(&AClass::x, _);
- EXPECT_FALSE(m.Matches(NULL));
-}
-
-// Tests that Property(&Foo::property, ...) works when the argument's
-// type is a sub-type of const Foo*.
-TEST(PropertyForPointerTest, WorksForArgumentOfSubType) {
- // The matcher expects a DerivedClass, but inside the Property() we
- // say AClass.
- Matcher<const DerivedClass*> m = Property(&AClass::n, Ge(0));
-
- DerivedClass d;
- d.set_n(1);
- EXPECT_TRUE(m.Matches(&d));
-
- d.set_n(-1);
- EXPECT_FALSE(m.Matches(&d));
-}
-
-// Tests that Property() can describe itself when used to match a pointer.
-TEST(PropertyForPointerTest, CanDescribeSelf) {
- Matcher<const AClass*> m = Property(&AClass::n, Ge(0));
-
- EXPECT_EQ("is an object whose given property is >= 0", Describe(m));
- EXPECT_EQ("is an object whose given property isn't >= 0",
- DescribeNegation(m));
-}
-
-// Tests that Property() can explain the result of matching a pointer.
-TEST(PropertyForPointerTest, CanExplainMatchResult) {
- Matcher<const AClass*> m = Property(&AClass::n, Ge(0));
-
- AClass a;
- a.set_n(1);
- EXPECT_EQ("", Explain(m, static_cast<const AClass*>(NULL)));
- EXPECT_EQ(
- "which points to an object whose given property is 1" + OfType("int"),
- Explain(m, &a));
-
- m = Property(&AClass::n, GreaterThan(0));
- EXPECT_EQ("which points to an object whose given property is 1" +
- OfType("int") + ", which is 1 more than 0",
- Explain(m, &a));
-}
-
-// Tests ResultOf.
-
-// Tests that ResultOf(f, ...) compiles and works as expected when f is a
-// function pointer.
-string IntToStringFunction(int input) { return input == 1 ? "foo" : "bar"; }
-
-TEST(ResultOfTest, WorksForFunctionPointers) {
- Matcher<int> matcher = ResultOf(&IntToStringFunction, Eq(string("foo")));
-
- EXPECT_TRUE(matcher.Matches(1));
- EXPECT_FALSE(matcher.Matches(2));
-}
-
-// Tests that ResultOf() can describe itself.
-TEST(ResultOfTest, CanDescribeItself) {
- Matcher<int> matcher = ResultOf(&IntToStringFunction, StrEq("foo"));
-
- EXPECT_EQ("is mapped by the given callable to a value that "
- "is equal to \"foo\"", Describe(matcher));
- EXPECT_EQ("is mapped by the given callable to a value that "
- "isn't equal to \"foo\"", DescribeNegation(matcher));
-}
-
-// Tests that ResultOf() can explain the match result.
-int IntFunction(int input) { return input == 42 ? 80 : 90; }
-
-TEST(ResultOfTest, CanExplainMatchResult) {
- Matcher<int> matcher = ResultOf(&IntFunction, Ge(85));
- EXPECT_EQ("which is mapped by the given callable to 90" + OfType("int"),
- Explain(matcher, 36));
-
- matcher = ResultOf(&IntFunction, GreaterThan(85));
- EXPECT_EQ("which is mapped by the given callable to 90" + OfType("int") +
- ", which is 5 more than 85", Explain(matcher, 36));
-}
-
-// Tests that ResultOf(f, ...) compiles and works as expected when f(x)
-// returns a non-reference.
-TEST(ResultOfTest, WorksForNonReferenceResults) {
- Matcher<int> matcher = ResultOf(&IntFunction, Eq(80));
-
- EXPECT_TRUE(matcher.Matches(42));
- EXPECT_FALSE(matcher.Matches(36));
-}
-
-// Tests that ResultOf(f, ...) compiles and works as expected when f(x)
-// returns a reference to non-const.
-double& DoubleFunction(double& input) { return input; } // NOLINT
-
-Uncopyable& RefUncopyableFunction(Uncopyable& obj) { // NOLINT
- return obj;
-}
-
-TEST(ResultOfTest, WorksForReferenceToNonConstResults) {
- double x = 3.14;
- double x2 = x;
- Matcher<double&> matcher = ResultOf(&DoubleFunction, Ref(x));
-
- EXPECT_TRUE(matcher.Matches(x));
- EXPECT_FALSE(matcher.Matches(x2));
-
- // Test that ResultOf works with uncopyable objects
- Uncopyable obj(0);
- Uncopyable obj2(0);
- Matcher<Uncopyable&> matcher2 =
- ResultOf(&RefUncopyableFunction, Ref(obj));
-
- EXPECT_TRUE(matcher2.Matches(obj));
- EXPECT_FALSE(matcher2.Matches(obj2));
-}
-
-// Tests that ResultOf(f, ...) compiles and works as expected when f(x)
-// returns a reference to const.
-const string& StringFunction(const string& input) { return input; }
-
-TEST(ResultOfTest, WorksForReferenceToConstResults) {
- string s = "foo";
- string s2 = s;
- Matcher<const string&> matcher = ResultOf(&StringFunction, Ref(s));
-
- EXPECT_TRUE(matcher.Matches(s));
- EXPECT_FALSE(matcher.Matches(s2));
-}
-
-// Tests that ResultOf(f, m) works when f(x) and m's
-// argument types are compatible but different.
-TEST(ResultOfTest, WorksForCompatibleMatcherTypes) {
- // IntFunction() returns int but the inner matcher expects a signed char.
- Matcher<int> matcher = ResultOf(IntFunction, Matcher<signed char>(Ge(85)));
-
- EXPECT_TRUE(matcher.Matches(36));
- EXPECT_FALSE(matcher.Matches(42));
-}
-
-// Tests that the program aborts when ResultOf is passed
-// a NULL function pointer.
-TEST(ResultOfDeathTest, DiesOnNullFunctionPointers) {
- EXPECT_DEATH_IF_SUPPORTED(
- ResultOf(static_cast<string(*)(int dummy)>(NULL), Eq(string("foo"))),
- "NULL function pointer is passed into ResultOf\\(\\)\\.");
-}
-
-// Tests that ResultOf(f, ...) compiles and works as expected when f is a
-// function reference.
-TEST(ResultOfTest, WorksForFunctionReferences) {
- Matcher<int> matcher = ResultOf(IntToStringFunction, StrEq("foo"));
- EXPECT_TRUE(matcher.Matches(1));
- EXPECT_FALSE(matcher.Matches(2));
-}
-
-// Tests that ResultOf(f, ...) compiles and works as expected when f is a
-// function object.
-struct Functor : public ::std::unary_function<int, string> {
- result_type operator()(argument_type input) const {
- return IntToStringFunction(input);
- }
-};
-
-TEST(ResultOfTest, WorksForFunctors) {
- Matcher<int> matcher = ResultOf(Functor(), Eq(string("foo")));
-
- EXPECT_TRUE(matcher.Matches(1));
- EXPECT_FALSE(matcher.Matches(2));
-}
-
-// Tests that ResultOf(f, ...) compiles and works as expected when f is a
-// functor with more then one operator() defined. ResultOf() must work
-// for each defined operator().
-struct PolymorphicFunctor {
- typedef int result_type;
- int operator()(int n) { return n; }
- int operator()(const char* s) { return static_cast<int>(strlen(s)); }
-};
-
-TEST(ResultOfTest, WorksForPolymorphicFunctors) {
- Matcher<int> matcher_int = ResultOf(PolymorphicFunctor(), Ge(5));
-
- EXPECT_TRUE(matcher_int.Matches(10));
- EXPECT_FALSE(matcher_int.Matches(2));
-
- Matcher<const char*> matcher_string = ResultOf(PolymorphicFunctor(), Ge(5));
-
- EXPECT_TRUE(matcher_string.Matches("long string"));
- EXPECT_FALSE(matcher_string.Matches("shrt"));
-}
-
-const int* ReferencingFunction(const int& n) { return &n; }
-
-struct ReferencingFunctor {
- typedef const int* result_type;
- result_type operator()(const int& n) { return &n; }
-};
-
-TEST(ResultOfTest, WorksForReferencingCallables) {
- const int n = 1;
- const int n2 = 1;
- Matcher<const int&> matcher2 = ResultOf(ReferencingFunction, Eq(&n));
- EXPECT_TRUE(matcher2.Matches(n));
- EXPECT_FALSE(matcher2.Matches(n2));
-
- Matcher<const int&> matcher3 = ResultOf(ReferencingFunctor(), Eq(&n));
- EXPECT_TRUE(matcher3.Matches(n));
- EXPECT_FALSE(matcher3.Matches(n2));
-}
-
-class DivisibleByImpl {
- public:
- explicit DivisibleByImpl(int a_divider) : divider_(a_divider) {}
-
- // For testing using ExplainMatchResultTo() with polymorphic matchers.
- template <typename T>
- bool MatchAndExplain(const T& n, MatchResultListener* listener) const {
- *listener << "which is " << (n % divider_) << " modulo "
- << divider_;
- return (n % divider_) == 0;
- }
-
- void DescribeTo(ostream* os) const {
- *os << "is divisible by " << divider_;
- }
-
- void DescribeNegationTo(ostream* os) const {
- *os << "is not divisible by " << divider_;
- }
-
- void set_divider(int a_divider) { divider_ = a_divider; }
- int divider() const { return divider_; }
-
- private:
- int divider_;
-};
-
-PolymorphicMatcher<DivisibleByImpl> DivisibleBy(int n) {
- return MakePolymorphicMatcher(DivisibleByImpl(n));
-}
-
-// Tests that when AllOf() fails, only the first failing matcher is
-// asked to explain why.
-TEST(ExplainMatchResultTest, AllOf_False_False) {
- const Matcher<int> m = AllOf(DivisibleBy(4), DivisibleBy(3));
- EXPECT_EQ("which is 1 modulo 4", Explain(m, 5));
-}
-
-// Tests that when AllOf() fails, only the first failing matcher is
-// asked to explain why.
-TEST(ExplainMatchResultTest, AllOf_False_True) {
- const Matcher<int> m = AllOf(DivisibleBy(4), DivisibleBy(3));
- EXPECT_EQ("which is 2 modulo 4", Explain(m, 6));
-}
-
-// Tests that when AllOf() fails, only the first failing matcher is
-// asked to explain why.
-TEST(ExplainMatchResultTest, AllOf_True_False) {
- const Matcher<int> m = AllOf(Ge(1), DivisibleBy(3));
- EXPECT_EQ("which is 2 modulo 3", Explain(m, 5));
-}
-
-// Tests that when AllOf() succeeds, all matchers are asked to explain
-// why.
-TEST(ExplainMatchResultTest, AllOf_True_True) {
- const Matcher<int> m = AllOf(DivisibleBy(2), DivisibleBy(3));
- EXPECT_EQ("which is 0 modulo 2, and which is 0 modulo 3", Explain(m, 6));
-}
-
-TEST(ExplainMatchResultTest, AllOf_True_True_2) {
- const Matcher<int> m = AllOf(Ge(2), Le(3));
- EXPECT_EQ("", Explain(m, 2));
-}
-
-TEST(ExplainmatcherResultTest, MonomorphicMatcher) {
- const Matcher<int> m = GreaterThan(5);
- EXPECT_EQ("which is 1 more than 5", Explain(m, 6));
-}
-
-// The following two tests verify that values without a public copy
-// ctor can be used as arguments to matchers like Eq(), Ge(), and etc
-// with the help of ByRef().
-
-class NotCopyable {
- public:
- explicit NotCopyable(int a_value) : value_(a_value) {}
-
- int value() const { return value_; }
-
- bool operator==(const NotCopyable& rhs) const {
- return value() == rhs.value();
- }
-
- bool operator>=(const NotCopyable& rhs) const {
- return value() >= rhs.value();
- }
- private:
- int value_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(NotCopyable);
-};
-
-TEST(ByRefTest, AllowsNotCopyableConstValueInMatchers) {
- const NotCopyable const_value1(1);
- const Matcher<const NotCopyable&> m = Eq(ByRef(const_value1));
-
- const NotCopyable n1(1), n2(2);
- EXPECT_TRUE(m.Matches(n1));
- EXPECT_FALSE(m.Matches(n2));
-}
-
-TEST(ByRefTest, AllowsNotCopyableValueInMatchers) {
- NotCopyable value2(2);
- const Matcher<NotCopyable&> m = Ge(ByRef(value2));
-
- NotCopyable n1(1), n2(2);
- EXPECT_FALSE(m.Matches(n1));
- EXPECT_TRUE(m.Matches(n2));
-}
-
-#if GTEST_HAS_TYPED_TEST
-// Tests ContainerEq with different container types, and
-// different element types.
-
-template <typename T>
-class ContainerEqTest : public testing::Test {};
-
-typedef testing::Types<
- set<int>,
- vector<size_t>,
- multiset<size_t>,
- list<int> >
- ContainerEqTestTypes;
-
-TYPED_TEST_CASE(ContainerEqTest, ContainerEqTestTypes);
-
-// Tests that the filled container is equal to itself.
-TYPED_TEST(ContainerEqTest, EqualsSelf) {
- static const int vals[] = {1, 1, 2, 3, 5, 8};
- TypeParam my_set(vals, vals + 6);
- const Matcher<TypeParam> m = ContainerEq(my_set);
- EXPECT_TRUE(m.Matches(my_set));
- EXPECT_EQ("", Explain(m, my_set));
-}
-
-// Tests that missing values are reported.
-TYPED_TEST(ContainerEqTest, ValueMissing) {
- static const int vals[] = {1, 1, 2, 3, 5, 8};
- static const int test_vals[] = {2, 1, 8, 5};
- TypeParam my_set(vals, vals + 6);
- TypeParam test_set(test_vals, test_vals + 4);
- const Matcher<TypeParam> m = ContainerEq(my_set);
- EXPECT_FALSE(m.Matches(test_set));
- EXPECT_EQ("which doesn't have these expected elements: 3",
- Explain(m, test_set));
-}
-
-// Tests that added values are reported.
-TYPED_TEST(ContainerEqTest, ValueAdded) {
- static const int vals[] = {1, 1, 2, 3, 5, 8};
- static const int test_vals[] = {1, 2, 3, 5, 8, 46};
- TypeParam my_set(vals, vals + 6);
- TypeParam test_set(test_vals, test_vals + 6);
- const Matcher<const TypeParam&> m = ContainerEq(my_set);
- EXPECT_FALSE(m.Matches(test_set));
- EXPECT_EQ("which has these unexpected elements: 46", Explain(m, test_set));
-}
-
-// Tests that added and missing values are reported together.
-TYPED_TEST(ContainerEqTest, ValueAddedAndRemoved) {
- static const int vals[] = {1, 1, 2, 3, 5, 8};
- static const int test_vals[] = {1, 2, 3, 8, 46};
- TypeParam my_set(vals, vals + 6);
- TypeParam test_set(test_vals, test_vals + 5);
- const Matcher<TypeParam> m = ContainerEq(my_set);
- EXPECT_FALSE(m.Matches(test_set));
- EXPECT_EQ("which has these unexpected elements: 46,\n"
- "and doesn't have these expected elements: 5",
- Explain(m, test_set));
-}
-
-// Tests duplicated value -- expect no explanation.
-TYPED_TEST(ContainerEqTest, DuplicateDifference) {
- static const int vals[] = {1, 1, 2, 3, 5, 8};
- static const int test_vals[] = {1, 2, 3, 5, 8};
- TypeParam my_set(vals, vals + 6);
- TypeParam test_set(test_vals, test_vals + 5);
- const Matcher<const TypeParam&> m = ContainerEq(my_set);
- // Depending on the container, match may be true or false
- // But in any case there should be no explanation.
- EXPECT_EQ("", Explain(m, test_set));
-}
-#endif // GTEST_HAS_TYPED_TEST
-
-// Tests that mutliple missing values are reported.
-// Using just vector here, so order is predicatble.
-TEST(ContainerEqExtraTest, MultipleValuesMissing) {
- static const int vals[] = {1, 1, 2, 3, 5, 8};
- static const int test_vals[] = {2, 1, 5};
- vector<int> my_set(vals, vals + 6);
- vector<int> test_set(test_vals, test_vals + 3);
- const Matcher<vector<int> > m = ContainerEq(my_set);
- EXPECT_FALSE(m.Matches(test_set));
- EXPECT_EQ("which doesn't have these expected elements: 3, 8",
- Explain(m, test_set));
-}
-
-// Tests that added values are reported.
-// Using just vector here, so order is predicatble.
-TEST(ContainerEqExtraTest, MultipleValuesAdded) {
- static const int vals[] = {1, 1, 2, 3, 5, 8};
- static const int test_vals[] = {1, 2, 92, 3, 5, 8, 46};
- list<size_t> my_set(vals, vals + 6);
- list<size_t> test_set(test_vals, test_vals + 7);
- const Matcher<const list<size_t>&> m = ContainerEq(my_set);
- EXPECT_FALSE(m.Matches(test_set));
- EXPECT_EQ("which has these unexpected elements: 92, 46",
- Explain(m, test_set));
-}
-
-// Tests that added and missing values are reported together.
-TEST(ContainerEqExtraTest, MultipleValuesAddedAndRemoved) {
- static const int vals[] = {1, 1, 2, 3, 5, 8};
- static const int test_vals[] = {1, 2, 3, 92, 46};
- list<size_t> my_set(vals, vals + 6);
- list<size_t> test_set(test_vals, test_vals + 5);
- const Matcher<const list<size_t> > m = ContainerEq(my_set);
- EXPECT_FALSE(m.Matches(test_set));
- EXPECT_EQ("which has these unexpected elements: 92, 46,\n"
- "and doesn't have these expected elements: 5, 8",
- Explain(m, test_set));
-}
-
-// Tests to see that duplicate elements are detected,
-// but (as above) not reported in the explanation.
-TEST(ContainerEqExtraTest, MultiSetOfIntDuplicateDifference) {
- static const int vals[] = {1, 1, 2, 3, 5, 8};
- static const int test_vals[] = {1, 2, 3, 5, 8};
- vector<int> my_set(vals, vals + 6);
- vector<int> test_set(test_vals, test_vals + 5);
- const Matcher<vector<int> > m = ContainerEq(my_set);
- EXPECT_TRUE(m.Matches(my_set));
- EXPECT_FALSE(m.Matches(test_set));
- // There is nothing to report when both sets contain all the same values.
- EXPECT_EQ("", Explain(m, test_set));
-}
-
-// Tests that ContainerEq works for non-trivial associative containers,
-// like maps.
-TEST(ContainerEqExtraTest, WorksForMaps) {
- map<int, std::string> my_map;
- my_map[0] = "a";
- my_map[1] = "b";
-
- map<int, std::string> test_map;
- test_map[0] = "aa";
- test_map[1] = "b";
-
- const Matcher<const map<int, std::string>&> m = ContainerEq(my_map);
- EXPECT_TRUE(m.Matches(my_map));
- EXPECT_FALSE(m.Matches(test_map));
-
- EXPECT_EQ("which has these unexpected elements: (0, \"aa\"),\n"
- "and doesn't have these expected elements: (0, \"a\")",
- Explain(m, test_map));
-}
-
-TEST(ContainerEqExtraTest, WorksForNativeArray) {
- int a1[] = { 1, 2, 3 };
- int a2[] = { 1, 2, 3 };
- int b[] = { 1, 2, 4 };
-
- EXPECT_THAT(a1, ContainerEq(a2));
- EXPECT_THAT(a1, Not(ContainerEq(b)));
-}
-
-TEST(ContainerEqExtraTest, WorksForTwoDimensionalNativeArray) {
- const char a1[][3] = { "hi", "lo" };
- const char a2[][3] = { "hi", "lo" };
- const char b[][3] = { "lo", "hi" };
-
- // Tests using ContainerEq() in the first dimension.
- EXPECT_THAT(a1, ContainerEq(a2));
- EXPECT_THAT(a1, Not(ContainerEq(b)));
-
- // Tests using ContainerEq() in the second dimension.
- EXPECT_THAT(a1, ElementsAre(ContainerEq(a2[0]), ContainerEq(a2[1])));
- EXPECT_THAT(a1, ElementsAre(Not(ContainerEq(b[0])), ContainerEq(a2[1])));
-}
-
-TEST(ContainerEqExtraTest, WorksForNativeArrayAsTuple) {
- const int a1[] = { 1, 2, 3 };
- const int a2[] = { 1, 2, 3 };
- const int b[] = { 1, 2, 3, 4 };
-
- const int* const p1 = a1;
- EXPECT_THAT(make_tuple(p1, 3), ContainerEq(a2));
- EXPECT_THAT(make_tuple(p1, 3), Not(ContainerEq(b)));
-
- const int c[] = { 1, 3, 2 };
- EXPECT_THAT(make_tuple(p1, 3), Not(ContainerEq(c)));
-}
-
-TEST(ContainerEqExtraTest, CopiesNativeArrayParameter) {
- std::string a1[][3] = {
- { "hi", "hello", "ciao" },
- { "bye", "see you", "ciao" }
- };
-
- std::string a2[][3] = {
- { "hi", "hello", "ciao" },
- { "bye", "see you", "ciao" }
- };
-
- const Matcher<const std::string(&)[2][3]> m = ContainerEq(a2);
- EXPECT_THAT(a1, m);
-
- a2[0][0] = "ha";
- EXPECT_THAT(a1, m);
-}
-
-TEST(WhenSortedByTest, WorksForEmptyContainer) {
- const vector<int> numbers;
- EXPECT_THAT(numbers, WhenSortedBy(less<int>(), ElementsAre()));
- EXPECT_THAT(numbers, Not(WhenSortedBy(less<int>(), ElementsAre(1))));
-}
-
-TEST(WhenSortedByTest, WorksForNonEmptyContainer) {
- vector<unsigned> numbers;
- numbers.push_back(3);
- numbers.push_back(1);
- numbers.push_back(2);
- numbers.push_back(2);
- EXPECT_THAT(numbers, WhenSortedBy(greater<unsigned>(),
- ElementsAre(3, 2, 2, 1)));
- EXPECT_THAT(numbers, Not(WhenSortedBy(greater<unsigned>(),
- ElementsAre(1, 2, 2, 3))));
-}
-
-TEST(WhenSortedByTest, WorksForNonVectorContainer) {
- list<string> words;
- words.push_back("say");
- words.push_back("hello");
- words.push_back("world");
- EXPECT_THAT(words, WhenSortedBy(less<string>(),
- ElementsAre("hello", "say", "world")));
- EXPECT_THAT(words, Not(WhenSortedBy(less<string>(),
- ElementsAre("say", "hello", "world"))));
-}
-
-TEST(WhenSortedByTest, WorksForNativeArray) {
- const int numbers[] = { 1, 3, 2, 4 };
- const int sorted_numbers[] = { 1, 2, 3, 4 };
- EXPECT_THAT(numbers, WhenSortedBy(less<int>(), ElementsAre(1, 2, 3, 4)));
- EXPECT_THAT(numbers, WhenSortedBy(less<int>(),
- ElementsAreArray(sorted_numbers)));
- EXPECT_THAT(numbers, Not(WhenSortedBy(less<int>(), ElementsAre(1, 3, 2, 4))));
-}
-
-TEST(WhenSortedByTest, CanDescribeSelf) {
- const Matcher<vector<int> > m = WhenSortedBy(less<int>(), ElementsAre(1, 2));
- EXPECT_EQ("(when sorted) has 2 elements where\n"
- "element #0 is equal to 1,\n"
- "element #1 is equal to 2",
- Describe(m));
- EXPECT_EQ("(when sorted) doesn't have 2 elements, or\n"
- "element #0 isn't equal to 1, or\n"
- "element #1 isn't equal to 2",
- DescribeNegation(m));
-}
-
-TEST(WhenSortedByTest, ExplainsMatchResult) {
- const int a[] = { 2, 1 };
- EXPECT_EQ("which is { 1, 2 } when sorted, whose element #0 doesn't match",
- Explain(WhenSortedBy(less<int>(), ElementsAre(2, 3)), a));
- EXPECT_EQ("which is { 1, 2 } when sorted",
- Explain(WhenSortedBy(less<int>(), ElementsAre(1, 2)), a));
-}
-
-// WhenSorted() is a simple wrapper on WhenSortedBy(). Hence we don't
-// need to test it as exhaustively as we test the latter.
-
-TEST(WhenSortedTest, WorksForEmptyContainer) {
- const vector<int> numbers;
- EXPECT_THAT(numbers, WhenSorted(ElementsAre()));
- EXPECT_THAT(numbers, Not(WhenSorted(ElementsAre(1))));
-}
-
-TEST(WhenSortedTest, WorksForNonEmptyContainer) {
- list<string> words;
- words.push_back("3");
- words.push_back("1");
- words.push_back("2");
- words.push_back("2");
- EXPECT_THAT(words, WhenSorted(ElementsAre("1", "2", "2", "3")));
- EXPECT_THAT(words, Not(WhenSorted(ElementsAre("3", "1", "2", "2"))));
-}
-
-// Tests IsReadableTypeName().
-
-TEST(IsReadableTypeNameTest, ReturnsTrueForShortNames) {
- EXPECT_TRUE(IsReadableTypeName("int"));
- EXPECT_TRUE(IsReadableTypeName("const unsigned char*"));
- EXPECT_TRUE(IsReadableTypeName("MyMap<int, void*>"));
- EXPECT_TRUE(IsReadableTypeName("void (*)(int, bool)"));
-}
-
-TEST(IsReadableTypeNameTest, ReturnsTrueForLongNonTemplateNonFunctionNames) {
- EXPECT_TRUE(IsReadableTypeName("my_long_namespace::MyClassName"));
- EXPECT_TRUE(IsReadableTypeName("int [5][6][7][8][9][10][11]"));
- EXPECT_TRUE(IsReadableTypeName("my_namespace::MyOuterClass::MyInnerClass"));
-}
-
-TEST(IsReadableTypeNameTest, ReturnsFalseForLongTemplateNames) {
- EXPECT_FALSE(
- IsReadableTypeName("basic_string<char, std::char_traits<char> >"));
- EXPECT_FALSE(IsReadableTypeName("std::vector<int, std::alloc_traits<int> >"));
-}
-
-TEST(IsReadableTypeNameTest, ReturnsFalseForLongFunctionTypeNames) {
- EXPECT_FALSE(IsReadableTypeName("void (&)(int, bool, char, float)"));
-}
-
-// Tests JoinAsTuple().
-
-TEST(JoinAsTupleTest, JoinsEmptyTuple) {
- EXPECT_EQ("", JoinAsTuple(Strings()));
-}
-
-TEST(JoinAsTupleTest, JoinsOneTuple) {
- const char* fields[] = { "1" };
- EXPECT_EQ("1", JoinAsTuple(Strings(fields, fields + 1)));
-}
-
-TEST(JoinAsTupleTest, JoinsTwoTuple) {
- const char* fields[] = { "1", "a" };
- EXPECT_EQ("(1, a)", JoinAsTuple(Strings(fields, fields + 2)));
-}
-
-TEST(JoinAsTupleTest, JoinsTenTuple) {
- const char* fields[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9", "10" };
- EXPECT_EQ("(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)",
- JoinAsTuple(Strings(fields, fields + 10)));
-}
-
-// Tests FormatMatcherDescription().
-
-TEST(FormatMatcherDescriptionTest, WorksForEmptyDescription) {
- EXPECT_EQ("is even",
- FormatMatcherDescription(false, "IsEven", Strings()));
- EXPECT_EQ("not (is even)",
- FormatMatcherDescription(true, "IsEven", Strings()));
-
- const char* params[] = { "5" };
- EXPECT_EQ("equals 5",
- FormatMatcherDescription(false, "Equals",
- Strings(params, params + 1)));
-
- const char* params2[] = { "5", "8" };
- EXPECT_EQ("is in range (5, 8)",
- FormatMatcherDescription(false, "IsInRange",
- Strings(params2, params2 + 2)));
-}
-
-// Tests PolymorphicMatcher::mutable_impl().
-TEST(PolymorphicMatcherTest, CanAccessMutableImpl) {
- PolymorphicMatcher<DivisibleByImpl> m(DivisibleByImpl(42));
- DivisibleByImpl& impl = m.mutable_impl();
- EXPECT_EQ(42, impl.divider());
-
- impl.set_divider(0);
- EXPECT_EQ(0, m.mutable_impl().divider());
-}
-
-// Tests PolymorphicMatcher::impl().
-TEST(PolymorphicMatcherTest, CanAccessImpl) {
- const PolymorphicMatcher<DivisibleByImpl> m(DivisibleByImpl(42));
- const DivisibleByImpl& impl = m.impl();
- EXPECT_EQ(42, impl.divider());
-}
-
-TEST(MatcherTupleTest, ExplainsMatchFailure) {
- stringstream ss1;
- ExplainMatchFailureTupleTo(make_tuple(Matcher<char>(Eq('a')), GreaterThan(5)),
- make_tuple('a', 10), &ss1);
- EXPECT_EQ("", ss1.str()); // Successful match.
-
- stringstream ss2;
- ExplainMatchFailureTupleTo(make_tuple(GreaterThan(5), Matcher<char>(Eq('a'))),
- make_tuple(2, 'b'), &ss2);
- EXPECT_EQ(" Expected arg #0: is > 5\n"
- " Actual: 2, which is 3 less than 5\n"
- " Expected arg #1: is equal to 'a' (97, 0x61)\n"
- " Actual: 'b' (98, 0x62)\n",
- ss2.str()); // Failed match where both arguments need explanation.
-
- stringstream ss3;
- ExplainMatchFailureTupleTo(make_tuple(GreaterThan(5), Matcher<char>(Eq('a'))),
- make_tuple(2, 'a'), &ss3);
- EXPECT_EQ(" Expected arg #0: is > 5\n"
- " Actual: 2, which is 3 less than 5\n",
- ss3.str()); // Failed match where only one argument needs
- // explanation.
-}
-
-// Tests Each().
-
-TEST(EachTest, ExplainsMatchResultCorrectly) {
- set<int> a; // empty
-
- Matcher<set<int> > m = Each(2);
- EXPECT_EQ("", Explain(m, a));
-
- Matcher<const int(&)[1]> n = Each(1); // NOLINT
-
- const int b[1] = { 1 };
- EXPECT_EQ("", Explain(n, b));
-
- n = Each(3);
- EXPECT_EQ("whose element #0 doesn't match", Explain(n, b));
-
- a.insert(1);
- a.insert(2);
- a.insert(3);
- m = Each(GreaterThan(0));
- EXPECT_EQ("", Explain(m, a));
-
- m = Each(GreaterThan(10));
- EXPECT_EQ("whose element #0 doesn't match, which is 9 less than 10",
- Explain(m, a));
-}
-
-TEST(EachTest, DescribesItselfCorrectly) {
- Matcher<vector<int> > m = Each(1);
- EXPECT_EQ("only contains elements that is equal to 1", Describe(m));
-
- Matcher<vector<int> > m2 = Not(m);
- EXPECT_EQ("contains some element that isn't equal to 1", Describe(m2));
-}
-
-TEST(EachTest, MatchesVectorWhenAllElementsMatch) {
- vector<int> some_vector;
- EXPECT_THAT(some_vector, Each(1));
- some_vector.push_back(3);
- EXPECT_THAT(some_vector, Not(Each(1)));
- EXPECT_THAT(some_vector, Each(3));
- some_vector.push_back(1);
- some_vector.push_back(2);
- EXPECT_THAT(some_vector, Not(Each(3)));
- EXPECT_THAT(some_vector, Each(Lt(3.5)));
-
- vector<string> another_vector;
- another_vector.push_back("fee");
- EXPECT_THAT(another_vector, Each(string("fee")));
- another_vector.push_back("fie");
- another_vector.push_back("foe");
- another_vector.push_back("fum");
- EXPECT_THAT(another_vector, Not(Each(string("fee"))));
-}
-
-TEST(EachTest, MatchesMapWhenAllElementsMatch) {
- map<const char*, int> my_map;
- const char* bar = "a string";
- my_map[bar] = 2;
- EXPECT_THAT(my_map, Each(make_pair(bar, 2)));
-
- map<string, int> another_map;
- EXPECT_THAT(another_map, Each(make_pair(string("fee"), 1)));
- another_map["fee"] = 1;
- EXPECT_THAT(another_map, Each(make_pair(string("fee"), 1)));
- another_map["fie"] = 2;
- another_map["foe"] = 3;
- another_map["fum"] = 4;
- EXPECT_THAT(another_map, Not(Each(make_pair(string("fee"), 1))));
- EXPECT_THAT(another_map, Not(Each(make_pair(string("fum"), 1))));
- EXPECT_THAT(another_map, Each(Pair(_, Gt(0))));
-}
-
-TEST(EachTest, AcceptsMatcher) {
- const int a[] = { 1, 2, 3 };
- EXPECT_THAT(a, Each(Gt(0)));
- EXPECT_THAT(a, Not(Each(Gt(1))));
-}
-
-TEST(EachTest, WorksForNativeArrayAsTuple) {
- const int a[] = { 1, 2 };
- const int* const pointer = a;
- EXPECT_THAT(make_tuple(pointer, 2), Each(Gt(0)));
- EXPECT_THAT(make_tuple(pointer, 2), Not(Each(Gt(1))));
-}
-
-// For testing Pointwise().
-class IsHalfOfMatcher {
- public:
- template <typename T1, typename T2>
- bool MatchAndExplain(const tuple<T1, T2>& a_pair,
- MatchResultListener* listener) const {
- if (get<0>(a_pair) == get<1>(a_pair)/2) {
- *listener << "where the second is " << get<1>(a_pair);
- return true;
- } else {
- *listener << "where the second/2 is " << get<1>(a_pair)/2;
- return false;
- }
- }
-
- void DescribeTo(ostream* os) const {
- *os << "are a pair where the first is half of the second";
- }
-
- void DescribeNegationTo(ostream* os) const {
- *os << "are a pair where the first isn't half of the second";
- }
-};
-
-PolymorphicMatcher<IsHalfOfMatcher> IsHalfOf() {
- return MakePolymorphicMatcher(IsHalfOfMatcher());
-}
-
-TEST(PointwiseTest, DescribesSelf) {
- vector<int> rhs;
- rhs.push_back(1);
- rhs.push_back(2);
- rhs.push_back(3);
- const Matcher<const vector<int>&> m = Pointwise(IsHalfOf(), rhs);
- EXPECT_EQ("contains 3 values, where each value and its corresponding value "
- "in { 1, 2, 3 } are a pair where the first is half of the second",
- Describe(m));
- EXPECT_EQ("doesn't contain exactly 3 values, or contains a value x at some "
- "index i where x and the i-th value of { 1, 2, 3 } are a pair "
- "where the first isn't half of the second",
- DescribeNegation(m));
-}
-
-TEST(PointwiseTest, MakesCopyOfRhs) {
- list<signed char> rhs;
- rhs.push_back(2);
- rhs.push_back(4);
-
- int lhs[] = { 1, 2 };
- const Matcher<const int (&)[2]> m = Pointwise(IsHalfOf(), rhs);
- EXPECT_THAT(lhs, m);
-
- // Changing rhs now shouldn't affect m, which made a copy of rhs.
- rhs.push_back(6);
- EXPECT_THAT(lhs, m);
-}
-
-TEST(PointwiseTest, WorksForLhsNativeArray) {
- const int lhs[] = { 1, 2, 3 };
- vector<int> rhs;
- rhs.push_back(2);
- rhs.push_back(4);
- rhs.push_back(6);
- EXPECT_THAT(lhs, Pointwise(Lt(), rhs));
- EXPECT_THAT(lhs, Not(Pointwise(Gt(), rhs)));
-}
-
-TEST(PointwiseTest, WorksForRhsNativeArray) {
- const int rhs[] = { 1, 2, 3 };
- vector<int> lhs;
- lhs.push_back(2);
- lhs.push_back(4);
- lhs.push_back(6);
- EXPECT_THAT(lhs, Pointwise(Gt(), rhs));
- EXPECT_THAT(lhs, Not(Pointwise(Lt(), rhs)));
-}
-
-TEST(PointwiseTest, RejectsWrongSize) {
- const double lhs[2] = { 1, 2 };
- const int rhs[1] = { 0 };
- EXPECT_THAT(lhs, Not(Pointwise(Gt(), rhs)));
- EXPECT_EQ("which contains 2 values",
- Explain(Pointwise(Gt(), rhs), lhs));
-
- const int rhs2[3] = { 0, 1, 2 };
- EXPECT_THAT(lhs, Not(Pointwise(Gt(), rhs2)));
-}
-
-TEST(PointwiseTest, RejectsWrongContent) {
- const double lhs[3] = { 1, 2, 3 };
- const int rhs[3] = { 2, 6, 4 };
- EXPECT_THAT(lhs, Not(Pointwise(IsHalfOf(), rhs)));
- EXPECT_EQ("where the value pair (2, 6) at index #1 don't match, "
- "where the second/2 is 3",
- Explain(Pointwise(IsHalfOf(), rhs), lhs));
-}
-
-TEST(PointwiseTest, AcceptsCorrectContent) {
- const double lhs[3] = { 1, 2, 3 };
- const int rhs[3] = { 2, 4, 6 };
- EXPECT_THAT(lhs, Pointwise(IsHalfOf(), rhs));
- EXPECT_EQ("", Explain(Pointwise(IsHalfOf(), rhs), lhs));
-}
-
-TEST(PointwiseTest, AllowsMonomorphicInnerMatcher) {
- const double lhs[3] = { 1, 2, 3 };
- const int rhs[3] = { 2, 4, 6 };
- const Matcher<tuple<const double&, const int&> > m1 = IsHalfOf();
- EXPECT_THAT(lhs, Pointwise(m1, rhs));
- EXPECT_EQ("", Explain(Pointwise(m1, rhs), lhs));
-
- // This type works as a tuple<const double&, const int&> can be
- // implicitly cast to tuple<double, int>.
- const Matcher<tuple<double, int> > m2 = IsHalfOf();
- EXPECT_THAT(lhs, Pointwise(m2, rhs));
- EXPECT_EQ("", Explain(Pointwise(m2, rhs), lhs));
-}
-
-} // namespace gmock_matchers_test
-} // namespace testing
diff --git a/src/testing/test/gmock-more-actions_test.cc b/src/testing/test/gmock-more-actions_test.cc
deleted file mode 100644
index 9fa9e2ec..00000000
--- a/src/testing/test/gmock-more-actions_test.cc
+++ /dev/null
@@ -1,705 +0,0 @@
-// Copyright 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-// Google Mock - a framework for writing C++ mock classes.
-//
-// This file tests the built-in actions in gmock-more-actions.h.
-
-#include "gmock/gmock-more-actions.h"
-
-#include <functional>
-#include <sstream>
-#include <string>
-#include "gmock/gmock.h"
-#include "gtest/gtest.h"
-#include "gtest/internal/gtest-linked_ptr.h"
-
-namespace testing {
-namespace gmock_more_actions_test {
-
-using ::std::plus;
-using ::std::string;
-using ::std::tr1::get;
-using ::std::tr1::make_tuple;
-using ::std::tr1::tuple;
-using ::std::tr1::tuple_element;
-using testing::_;
-using testing::Action;
-using testing::ActionInterface;
-using testing::DeleteArg;
-using testing::Invoke;
-using testing::Return;
-using testing::ReturnArg;
-using testing::ReturnPointee;
-using testing::SaveArg;
-using testing::SaveArgPointee;
-using testing::SetArgReferee;
-using testing::StaticAssertTypeEq;
-using testing::Unused;
-using testing::WithArg;
-using testing::WithoutArgs;
-using testing::internal::linked_ptr;
-
-// For suppressing compiler warnings on conversion possibly losing precision.
-inline short Short(short n) { return n; } // NOLINT
-inline char Char(char ch) { return ch; }
-
-// Sample functions and functors for testing Invoke() and etc.
-int Nullary() { return 1; }
-
-class NullaryFunctor {
- public:
- int operator()() { return 2; }
-};
-
-bool g_done = false;
-void VoidNullary() { g_done = true; }
-
-class VoidNullaryFunctor {
- public:
- void operator()() { g_done = true; }
-};
-
-bool Unary(int x) { return x < 0; }
-
-const char* Plus1(const char* s) { return s + 1; }
-
-void VoidUnary(int /* n */) { g_done = true; }
-
-bool ByConstRef(const string& s) { return s == "Hi"; }
-
-const double g_double = 0;
-bool ReferencesGlobalDouble(const double& x) { return &x == &g_double; }
-
-string ByNonConstRef(string& s) { return s += "+"; } // NOLINT
-
-struct UnaryFunctor {
- int operator()(bool x) { return x ? 1 : -1; }
-};
-
-const char* Binary(const char* input, short n) { return input + n; } // NOLINT
-
-void VoidBinary(int, char) { g_done = true; }
-
-int Ternary(int x, char y, short z) { return x + y + z; } // NOLINT
-
-void VoidTernary(int, char, bool) { g_done = true; }
-
-int SumOf4(int a, int b, int c, int d) { return a + b + c + d; }
-
-int SumOfFirst2(int a, int b, Unused, Unused) { return a + b; }
-
-void VoidFunctionWithFourArguments(char, int, float, double) { g_done = true; }
-
-string Concat4(const char* s1, const char* s2, const char* s3,
- const char* s4) {
- return string(s1) + s2 + s3 + s4;
-}
-
-int SumOf5(int a, int b, int c, int d, int e) { return a + b + c + d + e; }
-
-struct SumOf5Functor {
- int operator()(int a, int b, int c, int d, int e) {
- return a + b + c + d + e;
- }
-};
-
-string Concat5(const char* s1, const char* s2, const char* s3,
- const char* s4, const char* s5) {
- return string(s1) + s2 + s3 + s4 + s5;
-}
-
-int SumOf6(int a, int b, int c, int d, int e, int f) {
- return a + b + c + d + e + f;
-}
-
-struct SumOf6Functor {
- int operator()(int a, int b, int c, int d, int e, int f) {
- return a + b + c + d + e + f;
- }
-};
-
-string Concat6(const char* s1, const char* s2, const char* s3,
- const char* s4, const char* s5, const char* s6) {
- return string(s1) + s2 + s3 + s4 + s5 + s6;
-}
-
-string Concat7(const char* s1, const char* s2, const char* s3,
- const char* s4, const char* s5, const char* s6,
- const char* s7) {
- return string(s1) + s2 + s3 + s4 + s5 + s6 + s7;
-}
-
-string Concat8(const char* s1, const char* s2, const char* s3,
- const char* s4, const char* s5, const char* s6,
- const char* s7, const char* s8) {
- return string(s1) + s2 + s3 + s4 + s5 + s6 + s7 + s8;
-}
-
-string Concat9(const char* s1, const char* s2, const char* s3,
- const char* s4, const char* s5, const char* s6,
- const char* s7, const char* s8, const char* s9) {
- return string(s1) + s2 + s3 + s4 + s5 + s6 + s7 + s8 + s9;
-}
-
-string Concat10(const char* s1, const char* s2, const char* s3,
- const char* s4, const char* s5, const char* s6,
- const char* s7, const char* s8, const char* s9,
- const char* s10) {
- return string(s1) + s2 + s3 + s4 + s5 + s6 + s7 + s8 + s9 + s10;
-}
-
-class Foo {
- public:
- Foo() : value_(123) {}
-
- int Nullary() const { return value_; }
-
- short Unary(long x) { return static_cast<short>(value_ + x); } // NOLINT
-
- string Binary(const string& str, char c) const { return str + c; }
-
- int Ternary(int x, bool y, char z) { return value_ + x + y*z; }
-
- int SumOf4(int a, int b, int c, int d) const {
- return a + b + c + d + value_;
- }
-
- int SumOfLast2(Unused, Unused, int a, int b) const { return a + b; }
-
- int SumOf5(int a, int b, int c, int d, int e) { return a + b + c + d + e; }
-
- int SumOf6(int a, int b, int c, int d, int e, int f) {
- return a + b + c + d + e + f;
- }
-
- string Concat7(const char* s1, const char* s2, const char* s3,
- const char* s4, const char* s5, const char* s6,
- const char* s7) {
- return string(s1) + s2 + s3 + s4 + s5 + s6 + s7;
- }
-
- string Concat8(const char* s1, const char* s2, const char* s3,
- const char* s4, const char* s5, const char* s6,
- const char* s7, const char* s8) {
- return string(s1) + s2 + s3 + s4 + s5 + s6 + s7 + s8;
- }
-
- string Concat9(const char* s1, const char* s2, const char* s3,
- const char* s4, const char* s5, const char* s6,
- const char* s7, const char* s8, const char* s9) {
- return string(s1) + s2 + s3 + s4 + s5 + s6 + s7 + s8 + s9;
- }
-
- string Concat10(const char* s1, const char* s2, const char* s3,
- const char* s4, const char* s5, const char* s6,
- const char* s7, const char* s8, const char* s9,
- const char* s10) {
- return string(s1) + s2 + s3 + s4 + s5 + s6 + s7 + s8 + s9 + s10;
- }
-
- private:
- int value_;
-};
-
-// Tests using Invoke() with a nullary function.
-TEST(InvokeTest, Nullary) {
- Action<int()> a = Invoke(Nullary); // NOLINT
- EXPECT_EQ(1, a.Perform(make_tuple()));
-}
-
-// Tests using Invoke() with a unary function.
-TEST(InvokeTest, Unary) {
- Action<bool(int)> a = Invoke(Unary); // NOLINT
- EXPECT_FALSE(a.Perform(make_tuple(1)));
- EXPECT_TRUE(a.Perform(make_tuple(-1)));
-}
-
-// Tests using Invoke() with a binary function.
-TEST(InvokeTest, Binary) {
- Action<const char*(const char*, short)> a = Invoke(Binary); // NOLINT
- const char* p = "Hello";
- EXPECT_EQ(p + 2, a.Perform(make_tuple(p, Short(2))));
-}
-
-// Tests using Invoke() with a ternary function.
-TEST(InvokeTest, Ternary) {
- Action<int(int, char, short)> a = Invoke(Ternary); // NOLINT
- EXPECT_EQ(6, a.Perform(make_tuple(1, '\2', Short(3))));
-}
-
-// Tests using Invoke() with a 4-argument function.
-TEST(InvokeTest, FunctionThatTakes4Arguments) {
- Action<int(int, int, int, int)> a = Invoke(SumOf4); // NOLINT
- EXPECT_EQ(1234, a.Perform(make_tuple(1000, 200, 30, 4)));
-}
-
-// Tests using Invoke() with a 5-argument function.
-TEST(InvokeTest, FunctionThatTakes5Arguments) {
- Action<int(int, int, int, int, int)> a = Invoke(SumOf5); // NOLINT
- EXPECT_EQ(12345, a.Perform(make_tuple(10000, 2000, 300, 40, 5)));
-}
-
-// Tests using Invoke() with a 6-argument function.
-TEST(InvokeTest, FunctionThatTakes6Arguments) {
- Action<int(int, int, int, int, int, int)> a = Invoke(SumOf6); // NOLINT
- EXPECT_EQ(123456, a.Perform(make_tuple(100000, 20000, 3000, 400, 50, 6)));
-}
-
-// A helper that turns the type of a C-string literal from const
-// char[N] to const char*.
-inline const char* CharPtr(const char* s) { return s; }
-
-// Tests using Invoke() with a 7-argument function.
-TEST(InvokeTest, FunctionThatTakes7Arguments) {
- Action<string(const char*, const char*, const char*, const char*,
- const char*, const char*, const char*)> a =
- Invoke(Concat7);
- EXPECT_EQ("1234567",
- a.Perform(make_tuple(CharPtr("1"), CharPtr("2"), CharPtr("3"),
- CharPtr("4"), CharPtr("5"), CharPtr("6"),
- CharPtr("7"))));
-}
-
-// Tests using Invoke() with a 8-argument function.
-TEST(InvokeTest, FunctionThatTakes8Arguments) {
- Action<string(const char*, const char*, const char*, const char*,
- const char*, const char*, const char*, const char*)> a =
- Invoke(Concat8);
- EXPECT_EQ("12345678",
- a.Perform(make_tuple(CharPtr("1"), CharPtr("2"), CharPtr("3"),
- CharPtr("4"), CharPtr("5"), CharPtr("6"),
- CharPtr("7"), CharPtr("8"))));
-}
-
-// Tests using Invoke() with a 9-argument function.
-TEST(InvokeTest, FunctionThatTakes9Arguments) {
- Action<string(const char*, const char*, const char*, const char*,
- const char*, const char*, const char*, const char*,
- const char*)> a = Invoke(Concat9);
- EXPECT_EQ("123456789",
- a.Perform(make_tuple(CharPtr("1"), CharPtr("2"), CharPtr("3"),
- CharPtr("4"), CharPtr("5"), CharPtr("6"),
- CharPtr("7"), CharPtr("8"), CharPtr("9"))));
-}
-
-// Tests using Invoke() with a 10-argument function.
-TEST(InvokeTest, FunctionThatTakes10Arguments) {
- Action<string(const char*, const char*, const char*, const char*,
- const char*, const char*, const char*, const char*,
- const char*, const char*)> a = Invoke(Concat10);
- EXPECT_EQ("1234567890",
- a.Perform(make_tuple(CharPtr("1"), CharPtr("2"), CharPtr("3"),
- CharPtr("4"), CharPtr("5"), CharPtr("6"),
- CharPtr("7"), CharPtr("8"), CharPtr("9"),
- CharPtr("0"))));
-}
-
-// Tests using Invoke() with functions with parameters declared as Unused.
-TEST(InvokeTest, FunctionWithUnusedParameters) {
- Action<int(int, int, double, const string&)> a1 =
- Invoke(SumOfFirst2);
- EXPECT_EQ(12, a1.Perform(make_tuple(10, 2, 5.6, CharPtr("hi"))));
-
- Action<int(int, int, bool, int*)> a2 =
- Invoke(SumOfFirst2);
- EXPECT_EQ(23, a2.Perform(make_tuple(20, 3, true, static_cast<int*>(NULL))));
-}
-
-// Tests using Invoke() with methods with parameters declared as Unused.
-TEST(InvokeTest, MethodWithUnusedParameters) {
- Foo foo;
- Action<int(string, bool, int, int)> a1 =
- Invoke(&foo, &Foo::SumOfLast2);
- EXPECT_EQ(12, a1.Perform(make_tuple(CharPtr("hi"), true, 10, 2)));
-
- Action<int(char, double, int, int)> a2 =
- Invoke(&foo, &Foo::SumOfLast2);
- EXPECT_EQ(23, a2.Perform(make_tuple('a', 2.5, 20, 3)));
-}
-
-// Tests using Invoke() with a functor.
-TEST(InvokeTest, Functor) {
- Action<long(long, int)> a = Invoke(plus<long>()); // NOLINT
- EXPECT_EQ(3L, a.Perform(make_tuple(1, 2)));
-}
-
-// Tests using Invoke(f) as an action of a compatible type.
-TEST(InvokeTest, FunctionWithCompatibleType) {
- Action<long(int, short, char, bool)> a = Invoke(SumOf4); // NOLINT
- EXPECT_EQ(4321, a.Perform(make_tuple(4000, Short(300), Char(20), true)));
-}
-
-// Tests using Invoke() with an object pointer and a method pointer.
-
-// Tests using Invoke() with a nullary method.
-TEST(InvokeMethodTest, Nullary) {
- Foo foo;
- Action<int()> a = Invoke(&foo, &Foo::Nullary); // NOLINT
- EXPECT_EQ(123, a.Perform(make_tuple()));
-}
-
-// Tests using Invoke() with a unary method.
-TEST(InvokeMethodTest, Unary) {
- Foo foo;
- Action<short(long)> a = Invoke(&foo, &Foo::Unary); // NOLINT
- EXPECT_EQ(4123, a.Perform(make_tuple(4000)));
-}
-
-// Tests using Invoke() with a binary method.
-TEST(InvokeMethodTest, Binary) {
- Foo foo;
- Action<string(const string&, char)> a = Invoke(&foo, &Foo::Binary);
- string s("Hell");
- EXPECT_EQ("Hello", a.Perform(make_tuple(s, 'o')));
-}
-
-// Tests using Invoke() with a ternary method.
-TEST(InvokeMethodTest, Ternary) {
- Foo foo;
- Action<int(int, bool, char)> a = Invoke(&foo, &Foo::Ternary); // NOLINT
- EXPECT_EQ(1124, a.Perform(make_tuple(1000, true, Char(1))));
-}
-
-// Tests using Invoke() with a 4-argument method.
-TEST(InvokeMethodTest, MethodThatTakes4Arguments) {
- Foo foo;
- Action<int(int, int, int, int)> a = Invoke(&foo, &Foo::SumOf4); // NOLINT
- EXPECT_EQ(1357, a.Perform(make_tuple(1000, 200, 30, 4)));
-}
-
-// Tests using Invoke() with a 5-argument method.
-TEST(InvokeMethodTest, MethodThatTakes5Arguments) {
- Foo foo;
- Action<int(int, int, int, int, int)> a = Invoke(&foo, &Foo::SumOf5); // NOLINT
- EXPECT_EQ(12345, a.Perform(make_tuple(10000, 2000, 300, 40, 5)));
-}
-
-// Tests using Invoke() with a 6-argument method.
-TEST(InvokeMethodTest, MethodThatTakes6Arguments) {
- Foo foo;
- Action<int(int, int, int, int, int, int)> a = // NOLINT
- Invoke(&foo, &Foo::SumOf6);
- EXPECT_EQ(123456, a.Perform(make_tuple(100000, 20000, 3000, 400, 50, 6)));
-}
-
-// Tests using Invoke() with a 7-argument method.
-TEST(InvokeMethodTest, MethodThatTakes7Arguments) {
- Foo foo;
- Action<string(const char*, const char*, const char*, const char*,
- const char*, const char*, const char*)> a =
- Invoke(&foo, &Foo::Concat7);
- EXPECT_EQ("1234567",
- a.Perform(make_tuple(CharPtr("1"), CharPtr("2"), CharPtr("3"),
- CharPtr("4"), CharPtr("5"), CharPtr("6"),
- CharPtr("7"))));
-}
-
-// Tests using Invoke() with a 8-argument method.
-TEST(InvokeMethodTest, MethodThatTakes8Arguments) {
- Foo foo;
- Action<string(const char*, const char*, const char*, const char*,
- const char*, const char*, const char*, const char*)> a =
- Invoke(&foo, &Foo::Concat8);
- EXPECT_EQ("12345678",
- a.Perform(make_tuple(CharPtr("1"), CharPtr("2"), CharPtr("3"),
- CharPtr("4"), CharPtr("5"), CharPtr("6"),
- CharPtr("7"), CharPtr("8"))));
-}
-
-// Tests using Invoke() with a 9-argument method.
-TEST(InvokeMethodTest, MethodThatTakes9Arguments) {
- Foo foo;
- Action<string(const char*, const char*, const char*, const char*,
- const char*, const char*, const char*, const char*,
- const char*)> a = Invoke(&foo, &Foo::Concat9);
- EXPECT_EQ("123456789",
- a.Perform(make_tuple(CharPtr("1"), CharPtr("2"), CharPtr("3"),
- CharPtr("4"), CharPtr("5"), CharPtr("6"),
- CharPtr("7"), CharPtr("8"), CharPtr("9"))));
-}
-
-// Tests using Invoke() with a 10-argument method.
-TEST(InvokeMethodTest, MethodThatTakes10Arguments) {
- Foo foo;
- Action<string(const char*, const char*, const char*, const char*,
- const char*, const char*, const char*, const char*,
- const char*, const char*)> a = Invoke(&foo, &Foo::Concat10);
- EXPECT_EQ("1234567890",
- a.Perform(make_tuple(CharPtr("1"), CharPtr("2"), CharPtr("3"),
- CharPtr("4"), CharPtr("5"), CharPtr("6"),
- CharPtr("7"), CharPtr("8"), CharPtr("9"),
- CharPtr("0"))));
-}
-
-// Tests using Invoke(f) as an action of a compatible type.
-TEST(InvokeMethodTest, MethodWithCompatibleType) {
- Foo foo;
- Action<long(int, short, char, bool)> a = // NOLINT
- Invoke(&foo, &Foo::SumOf4);
- EXPECT_EQ(4444, a.Perform(make_tuple(4000, Short(300), Char(20), true)));
-}
-
-// Tests using WithoutArgs with an action that takes no argument.
-TEST(WithoutArgsTest, NoArg) {
- Action<int(int n)> a = WithoutArgs(Invoke(Nullary)); // NOLINT
- EXPECT_EQ(1, a.Perform(make_tuple(2)));
-}
-
-// Tests using WithArg with an action that takes 1 argument.
-TEST(WithArgTest, OneArg) {
- Action<bool(double x, int n)> b = WithArg<1>(Invoke(Unary)); // NOLINT
- EXPECT_TRUE(b.Perform(make_tuple(1.5, -1)));
- EXPECT_FALSE(b.Perform(make_tuple(1.5, 1)));
-}
-
-TEST(ReturnArgActionTest, WorksForOneArgIntArg0) {
- const Action<int(int)> a = ReturnArg<0>();
- EXPECT_EQ(5, a.Perform(make_tuple(5)));
-}
-
-TEST(ReturnArgActionTest, WorksForMultiArgBoolArg0) {
- const Action<bool(bool, bool, bool)> a = ReturnArg<0>();
- EXPECT_TRUE(a.Perform(make_tuple(true, false, false)));
-}
-
-TEST(ReturnArgActionTest, WorksForMultiArgStringArg2) {
- const Action<string(int, int, string, int)> a = ReturnArg<2>();
- EXPECT_EQ("seven", a.Perform(make_tuple(5, 6, string("seven"), 8)));
-}
-
-TEST(SaveArgActionTest, WorksForSameType) {
- int result = 0;
- const Action<void(int n)> a1 = SaveArg<0>(&result);
- a1.Perform(make_tuple(5));
- EXPECT_EQ(5, result);
-}
-
-TEST(SaveArgActionTest, WorksForCompatibleType) {
- int result = 0;
- const Action<void(bool, char)> a1 = SaveArg<1>(&result);
- a1.Perform(make_tuple(true, 'a'));
- EXPECT_EQ('a', result);
-}
-
-TEST(SaveArgPointeeActionTest, WorksForSameType) {
- int result = 0;
- const int value = 5;
- const Action<void(const int*)> a1 = SaveArgPointee<0>(&result);
- a1.Perform(make_tuple(&value));
- EXPECT_EQ(5, result);
-}
-
-TEST(SaveArgPointeeActionTest, WorksForCompatibleType) {
- int result = 0;
- char value = 'a';
- const Action<void(bool, char*)> a1 = SaveArgPointee<1>(&result);
- a1.Perform(make_tuple(true, &value));
- EXPECT_EQ('a', result);
-}
-
-TEST(SaveArgPointeeActionTest, WorksForLinkedPtr) {
- int result = 0;
- linked_ptr<int> value(new int(5));
- const Action<void(linked_ptr<int>)> a1 = SaveArgPointee<0>(&result);
- a1.Perform(make_tuple(value));
- EXPECT_EQ(5, result);
-}
-
-TEST(SetArgRefereeActionTest, WorksForSameType) {
- int value = 0;
- const Action<void(int&)> a1 = SetArgReferee<0>(1);
- a1.Perform(tuple<int&>(value));
- EXPECT_EQ(1, value);
-}
-
-TEST(SetArgRefereeActionTest, WorksForCompatibleType) {
- int value = 0;
- const Action<void(int, int&)> a1 = SetArgReferee<1>('a');
- a1.Perform(tuple<int, int&>(0, value));
- EXPECT_EQ('a', value);
-}
-
-TEST(SetArgRefereeActionTest, WorksWithExtraArguments) {
- int value = 0;
- const Action<void(bool, int, int&, const char*)> a1 = SetArgReferee<2>('a');
- a1.Perform(tuple<bool, int, int&, const char*>(true, 0, value, "hi"));
- EXPECT_EQ('a', value);
-}
-
-// A class that can be used to verify that its destructor is called: it will set
-// the bool provided to the constructor to true when destroyed.
-class DeletionTester {
- public:
- explicit DeletionTester(bool* is_deleted)
- : is_deleted_(is_deleted) {
- // Make sure the bit is set to false.
- *is_deleted_ = false;
- }
-
- ~DeletionTester() {
- *is_deleted_ = true;
- }
-
- private:
- bool* is_deleted_;
-};
-
-TEST(DeleteArgActionTest, OneArg) {
- bool is_deleted = false;
- DeletionTester* t = new DeletionTester(&is_deleted);
- const Action<void(DeletionTester*)> a1 = DeleteArg<0>(); // NOLINT
- EXPECT_FALSE(is_deleted);
- a1.Perform(make_tuple(t));
- EXPECT_TRUE(is_deleted);
-}
-
-TEST(DeleteArgActionTest, TenArgs) {
- bool is_deleted = false;
- DeletionTester* t = new DeletionTester(&is_deleted);
- const Action<void(bool, int, int, const char*, bool,
- int, int, int, int, DeletionTester*)> a1 = DeleteArg<9>();
- EXPECT_FALSE(is_deleted);
- a1.Perform(make_tuple(true, 5, 6, CharPtr("hi"), false, 7, 8, 9, 10, t));
- EXPECT_TRUE(is_deleted);
-}
-
-#if GTEST_HAS_EXCEPTIONS
-
-TEST(ThrowActionTest, ThrowsGivenExceptionInVoidFunction) {
- const Action<void(int n)> a = Throw('a');
- EXPECT_THROW(a.Perform(make_tuple(0)), char);
-}
-
-class MyException {};
-
-TEST(ThrowActionTest, ThrowsGivenExceptionInNonVoidFunction) {
- const Action<double(char ch)> a = Throw(MyException());
- EXPECT_THROW(a.Perform(make_tuple('0')), MyException);
-}
-
-TEST(ThrowActionTest, ThrowsGivenExceptionInNullaryFunction) {
- const Action<double()> a = Throw(MyException());
- EXPECT_THROW(a.Perform(make_tuple()), MyException);
-}
-
-#endif // GTEST_HAS_EXCEPTIONS
-
-// Tests that SetArrayArgument<N>(first, last) sets the elements of the array
-// pointed to by the N-th (0-based) argument to values in range [first, last).
-TEST(SetArrayArgumentTest, SetsTheNthArray) {
- typedef void MyFunction(bool, int*, char*);
- int numbers[] = { 1, 2, 3 };
- Action<MyFunction> a = SetArrayArgument<1>(numbers, numbers + 3);
-
- int n[4] = {};
- int* pn = n;
- char ch[4] = {};
- char* pch = ch;
- a.Perform(make_tuple(true, pn, pch));
- EXPECT_EQ(1, n[0]);
- EXPECT_EQ(2, n[1]);
- EXPECT_EQ(3, n[2]);
- EXPECT_EQ(0, n[3]);
- EXPECT_EQ('\0', ch[0]);
- EXPECT_EQ('\0', ch[1]);
- EXPECT_EQ('\0', ch[2]);
- EXPECT_EQ('\0', ch[3]);
-
- // Tests first and last are iterators.
- std::string letters = "abc";
- a = SetArrayArgument<2>(letters.begin(), letters.end());
- std::fill_n(n, 4, 0);
- std::fill_n(ch, 4, '\0');
- a.Perform(make_tuple(true, pn, pch));
- EXPECT_EQ(0, n[0]);
- EXPECT_EQ(0, n[1]);
- EXPECT_EQ(0, n[2]);
- EXPECT_EQ(0, n[3]);
- EXPECT_EQ('a', ch[0]);
- EXPECT_EQ('b', ch[1]);
- EXPECT_EQ('c', ch[2]);
- EXPECT_EQ('\0', ch[3]);
-}
-
-// Tests SetArrayArgument<N>(first, last) where first == last.
-TEST(SetArrayArgumentTest, SetsTheNthArrayWithEmptyRange) {
- typedef void MyFunction(bool, int*);
- int numbers[] = { 1, 2, 3 };
- Action<MyFunction> a = SetArrayArgument<1>(numbers, numbers);
-
- int n[4] = {};
- int* pn = n;
- a.Perform(make_tuple(true, pn));
- EXPECT_EQ(0, n[0]);
- EXPECT_EQ(0, n[1]);
- EXPECT_EQ(0, n[2]);
- EXPECT_EQ(0, n[3]);
-}
-
-// Tests SetArrayArgument<N>(first, last) where *first is convertible
-// (but not equal) to the argument type.
-TEST(SetArrayArgumentTest, SetsTheNthArrayWithConvertibleType) {
- typedef void MyFunction(bool, char*);
- int codes[] = { 97, 98, 99 };
- Action<MyFunction> a = SetArrayArgument<1>(codes, codes + 3);
-
- char ch[4] = {};
- char* pch = ch;
- a.Perform(make_tuple(true, pch));
- EXPECT_EQ('a', ch[0]);
- EXPECT_EQ('b', ch[1]);
- EXPECT_EQ('c', ch[2]);
- EXPECT_EQ('\0', ch[3]);
-}
-
-// Test SetArrayArgument<N>(first, last) with iterator as argument.
-TEST(SetArrayArgumentTest, SetsTheNthArrayWithIteratorArgument) {
- typedef void MyFunction(bool, std::back_insert_iterator<std::string>);
- std::string letters = "abc";
- Action<MyFunction> a = SetArrayArgument<1>(letters.begin(), letters.end());
-
- std::string s;
- a.Perform(make_tuple(true, back_inserter(s)));
- EXPECT_EQ(letters, s);
-}
-
-TEST(ReturnPointeeTest, Works) {
- int n = 42;
- const Action<int()> a = ReturnPointee(&n);
- EXPECT_EQ(42, a.Perform(make_tuple()));
-
- n = 43;
- EXPECT_EQ(43, a.Perform(make_tuple()));
-}
-
-} // namespace gmock_generated_actions_test
-} // namespace testing
diff --git a/src/testing/test/gmock-nice-strict_test.cc b/src/testing/test/gmock-nice-strict_test.cc
deleted file mode 100644
index e3344180..00000000
--- a/src/testing/test/gmock-nice-strict_test.cc
+++ /dev/null
@@ -1,284 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-#include "gmock/gmock-generated-nice-strict.h"
-
-#include <string>
-#include "gmock/gmock.h"
-#include "gtest/gtest.h"
-#include "gtest/gtest-spi.h"
-
-// This must not be defined inside the ::testing namespace, or it will
-// clash with ::testing::Mock.
-class Mock {
- public:
- Mock() {}
-
- MOCK_METHOD0(DoThis, void());
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(Mock);
-};
-
-namespace testing {
-namespace gmock_nice_strict_test {
-
-using testing::internal::string;
-using testing::GMOCK_FLAG(verbose);
-using testing::HasSubstr;
-using testing::NiceMock;
-using testing::StrictMock;
-
-#if GTEST_HAS_STREAM_REDIRECTION
-using testing::internal::CaptureStdout;
-using testing::internal::GetCapturedStdout;
-#endif
-
-// Defines some mock classes needed by the tests.
-
-class Foo {
- public:
- virtual ~Foo() {}
-
- virtual void DoThis() = 0;
- virtual int DoThat(bool flag) = 0;
-};
-
-class MockFoo : public Foo {
- public:
- MockFoo() {}
- void Delete() { delete this; }
-
- MOCK_METHOD0(DoThis, void());
- MOCK_METHOD1(DoThat, int(bool flag));
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFoo);
-};
-
-class MockBar {
- public:
- explicit MockBar(const string& s) : str_(s) {}
-
- MockBar(char a1, char a2, string a3, string a4, int a5, int a6,
- const string& a7, const string& a8, bool a9, bool a10) {
- str_ = string() + a1 + a2 + a3 + a4 + static_cast<char>(a5) +
- static_cast<char>(a6) + a7 + a8 + (a9 ? 'T' : 'F') + (a10 ? 'T' : 'F');
- }
-
- virtual ~MockBar() {}
-
- const string& str() const { return str_; }
-
- MOCK_METHOD0(This, int());
- MOCK_METHOD2(That, string(int, bool));
-
- private:
- string str_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(MockBar);
-};
-
-#if GTEST_HAS_STREAM_REDIRECTION
-
-// Tests that a nice mock generates no warning for uninteresting calls.
-TEST(NiceMockTest, NoWarningForUninterestingCall) {
- NiceMock<MockFoo> nice_foo;
-
- CaptureStdout();
- nice_foo.DoThis();
- nice_foo.DoThat(true);
- EXPECT_STREQ("", GetCapturedStdout().c_str());
-}
-
-// Tests that a nice mock generates no warning for uninteresting calls
-// that delete the mock object.
-TEST(NiceMockTest, NoWarningForUninterestingCallAfterDeath) {
- NiceMock<MockFoo>* const nice_foo = new NiceMock<MockFoo>;
-
- ON_CALL(*nice_foo, DoThis())
- .WillByDefault(Invoke(nice_foo, &MockFoo::Delete));
-
- CaptureStdout();
- nice_foo->DoThis();
- EXPECT_STREQ("", GetCapturedStdout().c_str());
-}
-
-// Tests that a nice mock generates informational logs for
-// uninteresting calls.
-TEST(NiceMockTest, InfoForUninterestingCall) {
- NiceMock<MockFoo> nice_foo;
-
- const string saved_flag = GMOCK_FLAG(verbose);
- GMOCK_FLAG(verbose) = "info";
- CaptureStdout();
- nice_foo.DoThis();
- EXPECT_THAT(GetCapturedStdout(),
- HasSubstr("Uninteresting mock function call"));
-
- CaptureStdout();
- nice_foo.DoThat(true);
- EXPECT_THAT(GetCapturedStdout(),
- HasSubstr("Uninteresting mock function call"));
- GMOCK_FLAG(verbose) = saved_flag;
-}
-
-#endif // GTEST_HAS_STREAM_REDIRECTION
-
-// Tests that a nice mock allows expected calls.
-TEST(NiceMockTest, AllowsExpectedCall) {
- NiceMock<MockFoo> nice_foo;
-
- EXPECT_CALL(nice_foo, DoThis());
- nice_foo.DoThis();
-}
-
-// Tests that an unexpected call on a nice mock fails.
-TEST(NiceMockTest, UnexpectedCallFails) {
- NiceMock<MockFoo> nice_foo;
-
- EXPECT_CALL(nice_foo, DoThis()).Times(0);
- EXPECT_NONFATAL_FAILURE(nice_foo.DoThis(), "called more times than expected");
-}
-
-// Tests that NiceMock works with a mock class that has a non-default
-// constructor.
-TEST(NiceMockTest, NonDefaultConstructor) {
- NiceMock<MockBar> nice_bar("hi");
- EXPECT_EQ("hi", nice_bar.str());
-
- nice_bar.This();
- nice_bar.That(5, true);
-}
-
-// Tests that NiceMock works with a mock class that has a 10-ary
-// non-default constructor.
-TEST(NiceMockTest, NonDefaultConstructor10) {
- NiceMock<MockBar> nice_bar('a', 'b', "c", "d", 'e', 'f',
- "g", "h", true, false);
- EXPECT_EQ("abcdefghTF", nice_bar.str());
-
- nice_bar.This();
- nice_bar.That(5, true);
-}
-
-#if !GTEST_OS_SYMBIAN && !GTEST_OS_WINDOWS_MOBILE
-// Tests that NiceMock<Mock> compiles where Mock is a user-defined
-// class (as opposed to ::testing::Mock). We had to workaround an
-// MSVC 8.0 bug that caused the symbol Mock used in the definition of
-// NiceMock to be looked up in the wrong context, and this test
-// ensures that our fix works.
-//
-// We have to skip this test on Symbian and Windows Mobile, as it
-// causes the program to crash there, for reasons unclear to us yet.
-TEST(NiceMockTest, AcceptsClassNamedMock) {
- NiceMock< ::Mock> nice;
- EXPECT_CALL(nice, DoThis());
- nice.DoThis();
-}
-#endif // !GTEST_OS_SYMBIAN && !GTEST_OS_WINDOWS_MOBILE
-
-// Tests that a strict mock allows expected calls.
-TEST(StrictMockTest, AllowsExpectedCall) {
- StrictMock<MockFoo> strict_foo;
-
- EXPECT_CALL(strict_foo, DoThis());
- strict_foo.DoThis();
-}
-
-// Tests that an unexpected call on a strict mock fails.
-TEST(StrictMockTest, UnexpectedCallFails) {
- StrictMock<MockFoo> strict_foo;
-
- EXPECT_CALL(strict_foo, DoThis()).Times(0);
- EXPECT_NONFATAL_FAILURE(strict_foo.DoThis(),
- "called more times than expected");
-}
-
-// Tests that an uninteresting call on a strict mock fails.
-TEST(StrictMockTest, UninterestingCallFails) {
- StrictMock<MockFoo> strict_foo;
-
- EXPECT_NONFATAL_FAILURE(strict_foo.DoThis(),
- "Uninteresting mock function call");
-}
-
-// Tests that an uninteresting call on a strict mock fails, even if
-// the call deletes the mock object.
-TEST(StrictMockTest, UninterestingCallFailsAfterDeath) {
- StrictMock<MockFoo>* const strict_foo = new StrictMock<MockFoo>;
-
- ON_CALL(*strict_foo, DoThis())
- .WillByDefault(Invoke(strict_foo, &MockFoo::Delete));
-
- EXPECT_NONFATAL_FAILURE(strict_foo->DoThis(),
- "Uninteresting mock function call");
-}
-
-// Tests that StrictMock works with a mock class that has a
-// non-default constructor.
-TEST(StrictMockTest, NonDefaultConstructor) {
- StrictMock<MockBar> strict_bar("hi");
- EXPECT_EQ("hi", strict_bar.str());
-
- EXPECT_NONFATAL_FAILURE(strict_bar.That(5, true),
- "Uninteresting mock function call");
-}
-
-// Tests that StrictMock works with a mock class that has a 10-ary
-// non-default constructor.
-TEST(StrictMockTest, NonDefaultConstructor10) {
- StrictMock<MockBar> strict_bar('a', 'b', "c", "d", 'e', 'f',
- "g", "h", true, false);
- EXPECT_EQ("abcdefghTF", strict_bar.str());
-
- EXPECT_NONFATAL_FAILURE(strict_bar.That(5, true),
- "Uninteresting mock function call");
-}
-
-#if !GTEST_OS_SYMBIAN && !GTEST_OS_WINDOWS_MOBILE
-// Tests that StrictMock<Mock> compiles where Mock is a user-defined
-// class (as opposed to ::testing::Mock). We had to workaround an
-// MSVC 8.0 bug that caused the symbol Mock used in the definition of
-// StrictMock to be looked up in the wrong context, and this test
-// ensures that our fix works.
-//
-// We have to skip this test on Symbian and Windows Mobile, as it
-// causes the program to crash there, for reasons unclear to us yet.
-TEST(StrictMockTest, AcceptsClassNamedMock) {
- StrictMock< ::Mock> strict;
- EXPECT_CALL(strict, DoThis());
- strict.DoThis();
-}
-#endif // !GTEST_OS_SYMBIAN && !GTEST_OS_WINDOWS_MOBILE
-
-} // namespace gmock_nice_strict_test
-} // namespace testing
diff --git a/src/testing/test/gmock-port_test.cc b/src/testing/test/gmock-port_test.cc
deleted file mode 100644
index d6a8d444..00000000
--- a/src/testing/test/gmock-port_test.cc
+++ /dev/null
@@ -1,43 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: vladl@google.com (Vlad Losev)
-
-// Google Mock - a framework for writing C++ mock classes.
-//
-// This file tests the internal cross-platform support utilities.
-
-#include "gmock/internal/gmock-port.h"
-#include "gtest/gtest.h"
-
-// NOTE: if this file is left without tests for some reason, put a dummy
-// test here to make references to symbols in the gtest library and avoid
-// 'undefined symbol' linker errors in gmock_main:
-
-TEST(DummyTest, Dummy) {}
diff --git a/src/testing/test/gmock-spec-builders_test.cc b/src/testing/test/gmock-spec-builders_test.cc
deleted file mode 100644
index 9177b322..00000000
--- a/src/testing/test/gmock-spec-builders_test.cc
+++ /dev/null
@@ -1,2535 +0,0 @@
-// Copyright 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-// Google Mock - a framework for writing C++ mock classes.
-//
-// This file tests the spec builder syntax.
-
-#include "gmock/gmock-spec-builders.h"
-
-#include <ostream> // NOLINT
-#include <sstream>
-#include <string>
-
-#include "gmock/gmock.h"
-#include "gmock/internal/gmock-port.h"
-#include "gtest/gtest.h"
-#include "gtest/gtest-spi.h"
-#include "gtest/internal/gtest-port.h"
-
-namespace testing {
-namespace internal {
-
-// Helper class for testing the Expectation class template.
-class ExpectationTester {
- public:
- // Sets the call count of the given expectation to the given number.
- void SetCallCount(int n, ExpectationBase* exp) {
- exp->call_count_ = n;
- }
-};
-
-} // namespace internal
-} // namespace testing
-
-namespace {
-
-using testing::_;
-using testing::AnyNumber;
-using testing::AtLeast;
-using testing::AtMost;
-using testing::Between;
-using testing::Cardinality;
-using testing::CardinalityInterface;
-using testing::ContainsRegex;
-using testing::Const;
-using testing::DoAll;
-using testing::DoDefault;
-using testing::Eq;
-using testing::Expectation;
-using testing::ExpectationSet;
-using testing::GMOCK_FLAG(verbose);
-using testing::Gt;
-using testing::InSequence;
-using testing::Invoke;
-using testing::InvokeWithoutArgs;
-using testing::IsSubstring;
-using testing::Lt;
-using testing::Message;
-using testing::Mock;
-using testing::Ne;
-using testing::Return;
-using testing::Sequence;
-using testing::SetArgPointee;
-using testing::internal::ExpectationTester;
-using testing::internal::FormatFileLocation;
-using testing::internal::kErrorVerbosity;
-using testing::internal::kInfoVerbosity;
-using testing::internal::kWarningVerbosity;
-using testing::internal::String;
-using testing::internal::linked_ptr;
-using testing::internal::string;
-
-#if GTEST_HAS_STREAM_REDIRECTION
-using testing::HasSubstr;
-using testing::internal::CaptureStdout;
-using testing::internal::GetCapturedStdout;
-#endif
-
-class Incomplete;
-
-class MockIncomplete {
- public:
- // This line verifies that a mock method can take a by-reference
- // argument of an incomplete type.
- MOCK_METHOD1(ByRefFunc, void(const Incomplete& x));
-};
-
-// Tells Google Mock how to print a value of type Incomplete.
-void PrintTo(const Incomplete& x, ::std::ostream* os);
-
-TEST(MockMethodTest, CanInstantiateWithIncompleteArgType) {
- // Even though this mock class contains a mock method that takes
- // by-reference an argument whose type is incomplete, we can still
- // use the mock, as long as Google Mock knows how to print the
- // argument.
- MockIncomplete incomplete;
- EXPECT_CALL(incomplete, ByRefFunc(_))
- .Times(AnyNumber());
-}
-
-// The definition of the printer for the argument type doesn't have to
-// be visible where the mock is used.
-void PrintTo(const Incomplete& /* x */, ::std::ostream* os) {
- *os << "incomplete";
-}
-
-class Result {};
-
-class MockA {
- public:
- MockA() {}
-
- MOCK_METHOD1(DoA, void(int n)); // NOLINT
- MOCK_METHOD1(ReturnResult, Result(int n)); // NOLINT
- MOCK_METHOD2(Binary, bool(int x, int y)); // NOLINT
- MOCK_METHOD2(ReturnInt, int(int x, int y)); // NOLINT
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(MockA);
-};
-
-class MockB {
- public:
- MockB() {}
-
- MOCK_CONST_METHOD0(DoB, int()); // NOLINT
- MOCK_METHOD1(DoB, int(int n)); // NOLINT
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(MockB);
-};
-
-class ReferenceHoldingMock {
- public:
- ReferenceHoldingMock() {}
-
- MOCK_METHOD1(AcceptReference, void(linked_ptr<MockA>*));
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(ReferenceHoldingMock);
-};
-
-// Tests that EXPECT_CALL and ON_CALL compile in a presence of macro
-// redefining a mock method name. This could happen, for example, when
-// the tested code #includes Win32 API headers which define many APIs
-// as macros, e.g. #define TextOut TextOutW.
-
-#define Method MethodW
-
-class CC {
- public:
- virtual ~CC() {}
- virtual int Method() = 0;
-};
-class MockCC : public CC {
- public:
- MockCC() {}
-
- MOCK_METHOD0(Method, int());
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(MockCC);
-};
-
-// Tests that a method with expanded name compiles.
-TEST(OnCallSyntaxTest, CompilesWithMethodNameExpandedFromMacro) {
- MockCC cc;
- ON_CALL(cc, Method());
-}
-
-// Tests that the method with expanded name not only compiles but runs
-// and returns a correct value, too.
-TEST(OnCallSyntaxTest, WorksWithMethodNameExpandedFromMacro) {
- MockCC cc;
- ON_CALL(cc, Method()).WillByDefault(Return(42));
- EXPECT_EQ(42, cc.Method());
-}
-
-// Tests that a method with expanded name compiles.
-TEST(ExpectCallSyntaxTest, CompilesWithMethodNameExpandedFromMacro) {
- MockCC cc;
- EXPECT_CALL(cc, Method());
- cc.Method();
-}
-
-// Tests that it works, too.
-TEST(ExpectCallSyntaxTest, WorksWithMethodNameExpandedFromMacro) {
- MockCC cc;
- EXPECT_CALL(cc, Method()).WillOnce(Return(42));
- EXPECT_EQ(42, cc.Method());
-}
-
-#undef Method // Done with macro redefinition tests.
-
-// Tests that ON_CALL evaluates its arguments exactly once as promised
-// by Google Mock.
-TEST(OnCallSyntaxTest, EvaluatesFirstArgumentOnce) {
- MockA a;
- MockA* pa = &a;
-
- ON_CALL(*pa++, DoA(_));
- EXPECT_EQ(&a + 1, pa);
-}
-
-TEST(OnCallSyntaxTest, EvaluatesSecondArgumentOnce) {
- MockA a;
- int n = 0;
-
- ON_CALL(a, DoA(n++));
- EXPECT_EQ(1, n);
-}
-
-// Tests that the syntax of ON_CALL() is enforced at run time.
-
-TEST(OnCallSyntaxTest, WithIsOptional) {
- MockA a;
-
- ON_CALL(a, DoA(5))
- .WillByDefault(Return());
- ON_CALL(a, DoA(_))
- .With(_)
- .WillByDefault(Return());
-}
-
-TEST(OnCallSyntaxTest, WithCanAppearAtMostOnce) {
- MockA a;
-
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- ON_CALL(a, ReturnResult(_))
- .With(_)
- .With(_)
- .WillByDefault(Return(Result()));
- }, ".With() cannot appear more than once in an ON_CALL()");
-}
-
-TEST(OnCallSyntaxTest, WillByDefaultIsMandatory) {
- MockA a;
-
- EXPECT_DEATH_IF_SUPPORTED({
- ON_CALL(a, DoA(5));
- a.DoA(5);
- }, "");
-}
-
-TEST(OnCallSyntaxTest, WillByDefaultCanAppearAtMostOnce) {
- MockA a;
-
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- ON_CALL(a, DoA(5))
- .WillByDefault(Return())
- .WillByDefault(Return());
- }, ".WillByDefault() must appear exactly once in an ON_CALL()");
-}
-
-// Tests that EXPECT_CALL evaluates its arguments exactly once as
-// promised by Google Mock.
-TEST(ExpectCallSyntaxTest, EvaluatesFirstArgumentOnce) {
- MockA a;
- MockA* pa = &a;
-
- EXPECT_CALL(*pa++, DoA(_));
- a.DoA(0);
- EXPECT_EQ(&a + 1, pa);
-}
-
-TEST(ExpectCallSyntaxTest, EvaluatesSecondArgumentOnce) {
- MockA a;
- int n = 0;
-
- EXPECT_CALL(a, DoA(n++));
- a.DoA(0);
- EXPECT_EQ(1, n);
-}
-
-// Tests that the syntax of EXPECT_CALL() is enforced at run time.
-
-TEST(ExpectCallSyntaxTest, WithIsOptional) {
- MockA a;
-
- EXPECT_CALL(a, DoA(5))
- .Times(0);
- EXPECT_CALL(a, DoA(6))
- .With(_)
- .Times(0);
-}
-
-TEST(ExpectCallSyntaxTest, WithCanAppearAtMostOnce) {
- MockA a;
-
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_CALL(a, DoA(6))
- .With(_)
- .With(_);
- }, ".With() cannot appear more than once in an EXPECT_CALL()");
-
- a.DoA(6);
-}
-
-TEST(ExpectCallSyntaxTest, WithMustBeFirstClause) {
- MockA a;
-
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_CALL(a, DoA(1))
- .Times(1)
- .With(_);
- }, ".With() must be the first clause in an EXPECT_CALL()");
-
- a.DoA(1);
-
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_CALL(a, DoA(2))
- .WillOnce(Return())
- .With(_);
- }, ".With() must be the first clause in an EXPECT_CALL()");
-
- a.DoA(2);
-}
-
-TEST(ExpectCallSyntaxTest, TimesCanBeInferred) {
- MockA a;
-
- EXPECT_CALL(a, DoA(1))
- .WillOnce(Return());
-
- EXPECT_CALL(a, DoA(2))
- .WillOnce(Return())
- .WillRepeatedly(Return());
-
- a.DoA(1);
- a.DoA(2);
- a.DoA(2);
-}
-
-TEST(ExpectCallSyntaxTest, TimesCanAppearAtMostOnce) {
- MockA a;
-
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_CALL(a, DoA(1))
- .Times(1)
- .Times(2);
- }, ".Times() cannot appear more than once in an EXPECT_CALL()");
-
- a.DoA(1);
- a.DoA(1);
-}
-
-TEST(ExpectCallSyntaxTest, TimesMustBeBeforeInSequence) {
- MockA a;
- Sequence s;
-
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_CALL(a, DoA(1))
- .InSequence(s)
- .Times(1);
- }, ".Times() cannot appear after ");
-
- a.DoA(1);
-}
-
-TEST(ExpectCallSyntaxTest, InSequenceIsOptional) {
- MockA a;
- Sequence s;
-
- EXPECT_CALL(a, DoA(1));
- EXPECT_CALL(a, DoA(2))
- .InSequence(s);
-
- a.DoA(1);
- a.DoA(2);
-}
-
-TEST(ExpectCallSyntaxTest, InSequenceCanAppearMultipleTimes) {
- MockA a;
- Sequence s1, s2;
-
- EXPECT_CALL(a, DoA(1))
- .InSequence(s1, s2)
- .InSequence(s1);
-
- a.DoA(1);
-}
-
-TEST(ExpectCallSyntaxTest, InSequenceMustBeBeforeAfter) {
- MockA a;
- Sequence s;
-
- Expectation e = EXPECT_CALL(a, DoA(1))
- .Times(AnyNumber());
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_CALL(a, DoA(2))
- .After(e)
- .InSequence(s);
- }, ".InSequence() cannot appear after ");
-
- a.DoA(2);
-}
-
-TEST(ExpectCallSyntaxTest, InSequenceMustBeBeforeWillOnce) {
- MockA a;
- Sequence s;
-
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_CALL(a, DoA(1))
- .WillOnce(Return())
- .InSequence(s);
- }, ".InSequence() cannot appear after ");
-
- a.DoA(1);
-}
-
-TEST(ExpectCallSyntaxTest, AfterMustBeBeforeWillOnce) {
- MockA a;
-
- Expectation e = EXPECT_CALL(a, DoA(1));
- EXPECT_NONFATAL_FAILURE({
- EXPECT_CALL(a, DoA(2))
- .WillOnce(Return())
- .After(e);
- }, ".After() cannot appear after ");
-
- a.DoA(1);
- a.DoA(2);
-}
-
-TEST(ExpectCallSyntaxTest, WillIsOptional) {
- MockA a;
-
- EXPECT_CALL(a, DoA(1));
- EXPECT_CALL(a, DoA(2))
- .WillOnce(Return());
-
- a.DoA(1);
- a.DoA(2);
-}
-
-TEST(ExpectCallSyntaxTest, WillCanAppearMultipleTimes) {
- MockA a;
-
- EXPECT_CALL(a, DoA(1))
- .Times(AnyNumber())
- .WillOnce(Return())
- .WillOnce(Return())
- .WillOnce(Return());
-}
-
-TEST(ExpectCallSyntaxTest, WillMustBeBeforeWillRepeatedly) {
- MockA a;
-
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_CALL(a, DoA(1))
- .WillRepeatedly(Return())
- .WillOnce(Return());
- }, ".WillOnce() cannot appear after ");
-
- a.DoA(1);
-}
-
-TEST(ExpectCallSyntaxTest, WillRepeatedlyIsOptional) {
- MockA a;
-
- EXPECT_CALL(a, DoA(1))
- .WillOnce(Return());
- EXPECT_CALL(a, DoA(2))
- .WillOnce(Return())
- .WillRepeatedly(Return());
-
- a.DoA(1);
- a.DoA(2);
- a.DoA(2);
-}
-
-TEST(ExpectCallSyntaxTest, WillRepeatedlyCannotAppearMultipleTimes) {
- MockA a;
-
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_CALL(a, DoA(1))
- .WillRepeatedly(Return())
- .WillRepeatedly(Return());
- }, ".WillRepeatedly() cannot appear more than once in an "
- "EXPECT_CALL()");
-}
-
-TEST(ExpectCallSyntaxTest, WillRepeatedlyMustBeBeforeRetiresOnSaturation) {
- MockA a;
-
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_CALL(a, DoA(1))
- .RetiresOnSaturation()
- .WillRepeatedly(Return());
- }, ".WillRepeatedly() cannot appear after ");
-}
-
-TEST(ExpectCallSyntaxTest, RetiresOnSaturationIsOptional) {
- MockA a;
-
- EXPECT_CALL(a, DoA(1));
- EXPECT_CALL(a, DoA(1))
- .RetiresOnSaturation();
-
- a.DoA(1);
- a.DoA(1);
-}
-
-TEST(ExpectCallSyntaxTest, RetiresOnSaturationCannotAppearMultipleTimes) {
- MockA a;
-
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_CALL(a, DoA(1))
- .RetiresOnSaturation()
- .RetiresOnSaturation();
- }, ".RetiresOnSaturation() cannot appear more than once");
-
- a.DoA(1);
-}
-
-TEST(ExpectCallSyntaxTest, DefaultCardinalityIsOnce) {
- {
- MockA a;
- EXPECT_CALL(a, DoA(1));
- a.DoA(1);
- }
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- MockA a;
- EXPECT_CALL(a, DoA(1));
- }, "to be called once");
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- MockA a;
- EXPECT_CALL(a, DoA(1));
- a.DoA(1);
- a.DoA(1);
- }, "to be called once");
-}
-
-#if GTEST_HAS_STREAM_REDIRECTION
-
-// Tests that Google Mock doesn't print a warning when the number of
-// WillOnce() is adequate.
-TEST(ExpectCallSyntaxTest, DoesNotWarnOnAdequateActionCount) {
- CaptureStdout();
- {
- MockB b;
-
- // It's always fine to omit WillOnce() entirely.
- EXPECT_CALL(b, DoB())
- .Times(0);
- EXPECT_CALL(b, DoB(1))
- .Times(AtMost(1));
- EXPECT_CALL(b, DoB(2))
- .Times(1)
- .WillRepeatedly(Return(1));
-
- // It's fine for the number of WillOnce()s to equal the upper bound.
- EXPECT_CALL(b, DoB(3))
- .Times(Between(1, 2))
- .WillOnce(Return(1))
- .WillOnce(Return(2));
-
- // It's fine for the number of WillOnce()s to be smaller than the
- // upper bound when there is a WillRepeatedly().
- EXPECT_CALL(b, DoB(4))
- .Times(AtMost(3))
- .WillOnce(Return(1))
- .WillRepeatedly(Return(2));
-
- // Satisfies the above expectations.
- b.DoB(2);
- b.DoB(3);
- }
- EXPECT_STREQ("", GetCapturedStdout().c_str());
-}
-
-// Tests that Google Mock warns on having too many actions in an
-// expectation compared to its cardinality.
-TEST(ExpectCallSyntaxTest, WarnsOnTooManyActions) {
- CaptureStdout();
- {
- MockB b;
-
- // Warns when the number of WillOnce()s is larger than the upper bound.
- EXPECT_CALL(b, DoB())
- .Times(0)
- .WillOnce(Return(1)); // #1
- EXPECT_CALL(b, DoB())
- .Times(AtMost(1))
- .WillOnce(Return(1))
- .WillOnce(Return(2)); // #2
- EXPECT_CALL(b, DoB(1))
- .Times(1)
- .WillOnce(Return(1))
- .WillOnce(Return(2))
- .RetiresOnSaturation(); // #3
-
- // Warns when the number of WillOnce()s equals the upper bound and
- // there is a WillRepeatedly().
- EXPECT_CALL(b, DoB())
- .Times(0)
- .WillRepeatedly(Return(1)); // #4
- EXPECT_CALL(b, DoB(2))
- .Times(1)
- .WillOnce(Return(1))
- .WillRepeatedly(Return(2)); // #5
-
- // Satisfies the above expectations.
- b.DoB(1);
- b.DoB(2);
- }
- const String output = GetCapturedStdout();
- EXPECT_PRED_FORMAT2(
- IsSubstring,
- "Too many actions specified in EXPECT_CALL(b, DoB())...\n"
- "Expected to be never called, but has 1 WillOnce().",
- output); // #1
- EXPECT_PRED_FORMAT2(
- IsSubstring,
- "Too many actions specified in EXPECT_CALL(b, DoB())...\n"
- "Expected to be called at most once, "
- "but has 2 WillOnce()s.",
- output); // #2
- EXPECT_PRED_FORMAT2(
- IsSubstring,
- "Too many actions specified in EXPECT_CALL(b, DoB(1))...\n"
- "Expected to be called once, but has 2 WillOnce()s.",
- output); // #3
- EXPECT_PRED_FORMAT2(
- IsSubstring,
- "Too many actions specified in EXPECT_CALL(b, DoB())...\n"
- "Expected to be never called, but has 0 WillOnce()s "
- "and a WillRepeatedly().",
- output); // #4
- EXPECT_PRED_FORMAT2(
- IsSubstring,
- "Too many actions specified in EXPECT_CALL(b, DoB(2))...\n"
- "Expected to be called once, but has 1 WillOnce() "
- "and a WillRepeatedly().",
- output); // #5
-}
-
-// Tests that Google Mock warns on having too few actions in an
-// expectation compared to its cardinality.
-TEST(ExpectCallSyntaxTest, WarnsOnTooFewActions) {
- MockB b;
-
- EXPECT_CALL(b, DoB())
- .Times(Between(2, 3))
- .WillOnce(Return(1));
-
- CaptureStdout();
- b.DoB();
- const String output = GetCapturedStdout();
- EXPECT_PRED_FORMAT2(
- IsSubstring,
- "Too few actions specified in EXPECT_CALL(b, DoB())...\n"
- "Expected to be called between 2 and 3 times, "
- "but has only 1 WillOnce().",
- output);
- b.DoB();
-}
-
-#endif // GTEST_HAS_STREAM_REDIRECTION
-
-// Tests the semantics of ON_CALL().
-
-// Tests that the built-in default action is taken when no ON_CALL()
-// is specified.
-TEST(OnCallTest, TakesBuiltInDefaultActionWhenNoOnCall) {
- MockB b;
- EXPECT_CALL(b, DoB());
-
- EXPECT_EQ(0, b.DoB());
-}
-
-// Tests that the built-in default action is taken when no ON_CALL()
-// matches the invocation.
-TEST(OnCallTest, TakesBuiltInDefaultActionWhenNoOnCallMatches) {
- MockB b;
- ON_CALL(b, DoB(1))
- .WillByDefault(Return(1));
- EXPECT_CALL(b, DoB(_));
-
- EXPECT_EQ(0, b.DoB(2));
-}
-
-// Tests that the last matching ON_CALL() action is taken.
-TEST(OnCallTest, PicksLastMatchingOnCall) {
- MockB b;
- ON_CALL(b, DoB(_))
- .WillByDefault(Return(3));
- ON_CALL(b, DoB(2))
- .WillByDefault(Return(2));
- ON_CALL(b, DoB(1))
- .WillByDefault(Return(1));
- EXPECT_CALL(b, DoB(_));
-
- EXPECT_EQ(2, b.DoB(2));
-}
-
-// Tests the semantics of EXPECT_CALL().
-
-// Tests that any call is allowed when no EXPECT_CALL() is specified.
-TEST(ExpectCallTest, AllowsAnyCallWhenNoSpec) {
- MockB b;
- EXPECT_CALL(b, DoB());
- // There is no expectation on DoB(int).
-
- b.DoB();
-
- // DoB(int) can be called any number of times.
- b.DoB(1);
- b.DoB(2);
-}
-
-// Tests that the last matching EXPECT_CALL() fires.
-TEST(ExpectCallTest, PicksLastMatchingExpectCall) {
- MockB b;
- EXPECT_CALL(b, DoB(_))
- .WillRepeatedly(Return(2));
- EXPECT_CALL(b, DoB(1))
- .WillRepeatedly(Return(1));
-
- EXPECT_EQ(1, b.DoB(1));
-}
-
-// Tests lower-bound violation.
-TEST(ExpectCallTest, CatchesTooFewCalls) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- MockB b;
- EXPECT_CALL(b, DoB(5))
- .Times(AtLeast(2));
-
- b.DoB(5);
- }, "Actual function call count doesn't match EXPECT_CALL(b, DoB(5))...\n"
- " Expected: to be called at least twice\n"
- " Actual: called once - unsatisfied and active");
-}
-
-// Tests that the cardinality can be inferred when no Times(...) is
-// specified.
-TEST(ExpectCallTest, InfersCardinalityWhenThereIsNoWillRepeatedly) {
- {
- MockB b;
- EXPECT_CALL(b, DoB())
- .WillOnce(Return(1))
- .WillOnce(Return(2));
-
- EXPECT_EQ(1, b.DoB());
- EXPECT_EQ(2, b.DoB());
- }
-
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- MockB b;
- EXPECT_CALL(b, DoB())
- .WillOnce(Return(1))
- .WillOnce(Return(2));
-
- EXPECT_EQ(1, b.DoB());
- }, "to be called twice");
-
- { // NOLINT
- MockB b;
- EXPECT_CALL(b, DoB())
- .WillOnce(Return(1))
- .WillOnce(Return(2));
-
- EXPECT_EQ(1, b.DoB());
- EXPECT_EQ(2, b.DoB());
- EXPECT_NONFATAL_FAILURE(b.DoB(), "to be called twice");
- }
-}
-
-TEST(ExpectCallTest, InfersCardinality1WhenThereIsWillRepeatedly) {
- {
- MockB b;
- EXPECT_CALL(b, DoB())
- .WillOnce(Return(1))
- .WillRepeatedly(Return(2));
-
- EXPECT_EQ(1, b.DoB());
- }
-
- { // NOLINT
- MockB b;
- EXPECT_CALL(b, DoB())
- .WillOnce(Return(1))
- .WillRepeatedly(Return(2));
-
- EXPECT_EQ(1, b.DoB());
- EXPECT_EQ(2, b.DoB());
- EXPECT_EQ(2, b.DoB());
- }
-
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- MockB b;
- EXPECT_CALL(b, DoB())
- .WillOnce(Return(1))
- .WillRepeatedly(Return(2));
- }, "to be called at least once");
-}
-
-// Tests that the n-th action is taken for the n-th matching
-// invocation.
-TEST(ExpectCallTest, NthMatchTakesNthAction) {
- MockB b;
- EXPECT_CALL(b, DoB())
- .WillOnce(Return(1))
- .WillOnce(Return(2))
- .WillOnce(Return(3));
-
- EXPECT_EQ(1, b.DoB());
- EXPECT_EQ(2, b.DoB());
- EXPECT_EQ(3, b.DoB());
-}
-
-// Tests that the WillRepeatedly() action is taken when the WillOnce(...)
-// list is exhausted.
-TEST(ExpectCallTest, TakesRepeatedActionWhenWillListIsExhausted) {
- MockB b;
- EXPECT_CALL(b, DoB())
- .WillOnce(Return(1))
- .WillRepeatedly(Return(2));
-
- EXPECT_EQ(1, b.DoB());
- EXPECT_EQ(2, b.DoB());
- EXPECT_EQ(2, b.DoB());
-}
-
-#if GTEST_HAS_STREAM_REDIRECTION
-
-// Tests that the default action is taken when the WillOnce(...) list is
-// exhausted and there is no WillRepeatedly().
-TEST(ExpectCallTest, TakesDefaultActionWhenWillListIsExhausted) {
- MockB b;
- EXPECT_CALL(b, DoB(_))
- .Times(1);
- EXPECT_CALL(b, DoB())
- .Times(AnyNumber())
- .WillOnce(Return(1))
- .WillOnce(Return(2));
-
- CaptureStdout();
- EXPECT_EQ(0, b.DoB(1)); // Shouldn't generate a warning as the
- // expectation has no action clause at all.
- EXPECT_EQ(1, b.DoB());
- EXPECT_EQ(2, b.DoB());
- const String output1 = GetCapturedStdout();
- EXPECT_STREQ("", output1.c_str());
-
- CaptureStdout();
- EXPECT_EQ(0, b.DoB());
- EXPECT_EQ(0, b.DoB());
- const String output2 = GetCapturedStdout();
- EXPECT_THAT(output2.c_str(),
- HasSubstr("Actions ran out in EXPECT_CALL(b, DoB())...\n"
- "Called 3 times, but only 2 WillOnce()s are specified"
- " - returning default value."));
- EXPECT_THAT(output2.c_str(),
- HasSubstr("Actions ran out in EXPECT_CALL(b, DoB())...\n"
- "Called 4 times, but only 2 WillOnce()s are specified"
- " - returning default value."));
-}
-
-TEST(FunctionMockerTest, ReportsExpectCallLocationForExhausedActions) {
- MockB b;
- std::string expect_call_location = FormatFileLocation(__FILE__, __LINE__ + 1);
- EXPECT_CALL(b, DoB()).Times(AnyNumber()).WillOnce(Return(1));
-
- EXPECT_EQ(1, b.DoB());
-
- CaptureStdout();
- EXPECT_EQ(0, b.DoB());
- const String output = GetCapturedStdout();
- // The warning message should contain the call location.
- EXPECT_PRED_FORMAT2(IsSubstring, expect_call_location, output);
-}
-
-TEST(FunctionMockerTest, ReportsDefaultActionLocationOfUninterestingCalls) {
- std::string on_call_location;
- CaptureStdout();
- {
- MockB b;
- on_call_location = FormatFileLocation(__FILE__, __LINE__ + 1);
- ON_CALL(b, DoB(_)).WillByDefault(Return(0));
- b.DoB(0);
- }
- EXPECT_PRED_FORMAT2(IsSubstring, on_call_location, GetCapturedStdout());
-}
-
-#endif // GTEST_HAS_STREAM_REDIRECTION
-
-// Tests that an uninteresting call performs the default action.
-TEST(UninterestingCallTest, DoesDefaultAction) {
- // When there is an ON_CALL() statement, the action specified by it
- // should be taken.
- MockA a;
- ON_CALL(a, Binary(_, _))
- .WillByDefault(Return(true));
- EXPECT_TRUE(a.Binary(1, 2));
-
- // When there is no ON_CALL(), the default value for the return type
- // should be returned.
- MockB b;
- EXPECT_EQ(0, b.DoB());
-}
-
-// Tests that an unexpected call performs the default action.
-TEST(UnexpectedCallTest, DoesDefaultAction) {
- // When there is an ON_CALL() statement, the action specified by it
- // should be taken.
- MockA a;
- ON_CALL(a, Binary(_, _))
- .WillByDefault(Return(true));
- EXPECT_CALL(a, Binary(0, 0));
- a.Binary(0, 0);
- bool result = false;
- EXPECT_NONFATAL_FAILURE(result = a.Binary(1, 2),
- "Unexpected mock function call");
- EXPECT_TRUE(result);
-
- // When there is no ON_CALL(), the default value for the return type
- // should be returned.
- MockB b;
- EXPECT_CALL(b, DoB(0))
- .Times(0);
- int n = -1;
- EXPECT_NONFATAL_FAILURE(n = b.DoB(1),
- "Unexpected mock function call");
- EXPECT_EQ(0, n);
-}
-
-// Tests that when an unexpected void function generates the right
-// failure message.
-TEST(UnexpectedCallTest, GeneratesFailureForVoidFunction) {
- // First, tests the message when there is only one EXPECT_CALL().
- MockA a1;
- EXPECT_CALL(a1, DoA(1));
- a1.DoA(1);
- // Ideally we should match the failure message against a regex, but
- // EXPECT_NONFATAL_FAILURE doesn't support that, so we test for
- // multiple sub-strings instead.
- EXPECT_NONFATAL_FAILURE(
- a1.DoA(9),
- "Unexpected mock function call - returning directly.\n"
- " Function call: DoA(9)\n"
- "Google Mock tried the following 1 expectation, but it didn't match:");
- EXPECT_NONFATAL_FAILURE(
- a1.DoA(9),
- " Expected arg #0: is equal to 1\n"
- " Actual: 9\n"
- " Expected: to be called once\n"
- " Actual: called once - saturated and active");
-
- // Next, tests the message when there are more than one EXPECT_CALL().
- MockA a2;
- EXPECT_CALL(a2, DoA(1));
- EXPECT_CALL(a2, DoA(3));
- a2.DoA(1);
- EXPECT_NONFATAL_FAILURE(
- a2.DoA(2),
- "Unexpected mock function call - returning directly.\n"
- " Function call: DoA(2)\n"
- "Google Mock tried the following 2 expectations, but none matched:");
- EXPECT_NONFATAL_FAILURE(
- a2.DoA(2),
- "tried expectation #0: EXPECT_CALL(a2, DoA(1))...\n"
- " Expected arg #0: is equal to 1\n"
- " Actual: 2\n"
- " Expected: to be called once\n"
- " Actual: called once - saturated and active");
- EXPECT_NONFATAL_FAILURE(
- a2.DoA(2),
- "tried expectation #1: EXPECT_CALL(a2, DoA(3))...\n"
- " Expected arg #0: is equal to 3\n"
- " Actual: 2\n"
- " Expected: to be called once\n"
- " Actual: never called - unsatisfied and active");
- a2.DoA(3);
-}
-
-// Tests that an unexpected non-void function generates the right
-// failure message.
-TEST(UnexpectedCallTest, GeneartesFailureForNonVoidFunction) {
- MockB b1;
- EXPECT_CALL(b1, DoB(1));
- b1.DoB(1);
- EXPECT_NONFATAL_FAILURE(
- b1.DoB(2),
- "Unexpected mock function call - returning default value.\n"
- " Function call: DoB(2)\n"
- " Returns: 0\n"
- "Google Mock tried the following 1 expectation, but it didn't match:");
- EXPECT_NONFATAL_FAILURE(
- b1.DoB(2),
- " Expected arg #0: is equal to 1\n"
- " Actual: 2\n"
- " Expected: to be called once\n"
- " Actual: called once - saturated and active");
-}
-
-// Tests that Google Mock explains that an retired expectation doesn't
-// match the call.
-TEST(UnexpectedCallTest, RetiredExpectation) {
- MockB b;
- EXPECT_CALL(b, DoB(1))
- .RetiresOnSaturation();
-
- b.DoB(1);
- EXPECT_NONFATAL_FAILURE(
- b.DoB(1),
- " Expected: the expectation is active\n"
- " Actual: it is retired");
-}
-
-// Tests that Google Mock explains that an expectation that doesn't
-// match the arguments doesn't match the call.
-TEST(UnexpectedCallTest, UnmatchedArguments) {
- MockB b;
- EXPECT_CALL(b, DoB(1));
-
- EXPECT_NONFATAL_FAILURE(
- b.DoB(2),
- " Expected arg #0: is equal to 1\n"
- " Actual: 2\n");
- b.DoB(1);
-}
-
-// Tests that Google Mock explains that an expectation with
-// unsatisfied pre-requisites doesn't match the call.
-TEST(UnexpectedCallTest, UnsatisifiedPrerequisites) {
- Sequence s1, s2;
- MockB b;
- EXPECT_CALL(b, DoB(1))
- .InSequence(s1);
- EXPECT_CALL(b, DoB(2))
- .Times(AnyNumber())
- .InSequence(s1);
- EXPECT_CALL(b, DoB(3))
- .InSequence(s2);
- EXPECT_CALL(b, DoB(4))
- .InSequence(s1, s2);
-
- ::testing::TestPartResultArray failures;
- {
- ::testing::ScopedFakeTestPartResultReporter reporter(&failures);
- b.DoB(4);
- // Now 'failures' contains the Google Test failures generated by
- // the above statement.
- }
-
- // There should be one non-fatal failure.
- ASSERT_EQ(1, failures.size());
- const ::testing::TestPartResult& r = failures.GetTestPartResult(0);
- EXPECT_EQ(::testing::TestPartResult::kNonFatalFailure, r.type());
-
- // Verifies that the failure message contains the two unsatisfied
- // pre-requisites but not the satisfied one.
-#if GTEST_USES_PCRE
- EXPECT_THAT(r.message(), ContainsRegex(
- // PCRE has trouble using (.|\n) to match any character, but
- // supports the (?s) prefix for using . to match any character.
- "(?s)the following immediate pre-requisites are not satisfied:\n"
- ".*: pre-requisite #0\n"
- ".*: pre-requisite #1"));
-#elif GTEST_USES_POSIX_RE
- EXPECT_THAT(r.message(), ContainsRegex(
- // POSIX RE doesn't understand the (?s) prefix, but has no trouble
- // with (.|\n).
- "the following immediate pre-requisites are not satisfied:\n"
- "(.|\n)*: pre-requisite #0\n"
- "(.|\n)*: pre-requisite #1"));
-#else
- // We can only use Google Test's own simple regex.
- EXPECT_THAT(r.message(), ContainsRegex(
- "the following immediate pre-requisites are not satisfied:"));
- EXPECT_THAT(r.message(), ContainsRegex(": pre-requisite #0"));
- EXPECT_THAT(r.message(), ContainsRegex(": pre-requisite #1"));
-#endif // GTEST_USES_PCRE
-
- b.DoB(1);
- b.DoB(3);
- b.DoB(4);
-}
-
-TEST(UndefinedReturnValueTest, ReturnValueIsMandatory) {
- MockA a;
- // TODO(wan@google.com): We should really verify the output message,
- // but we cannot yet due to that EXPECT_DEATH only captures stderr
- // while Google Mock logs to stdout.
- EXPECT_DEATH_IF_SUPPORTED(a.ReturnResult(1), "");
-}
-
-// Tests that an excessive call (one whose arguments match the
-// matchers but is called too many times) performs the default action.
-TEST(ExcessiveCallTest, DoesDefaultAction) {
- // When there is an ON_CALL() statement, the action specified by it
- // should be taken.
- MockA a;
- ON_CALL(a, Binary(_, _))
- .WillByDefault(Return(true));
- EXPECT_CALL(a, Binary(0, 0));
- a.Binary(0, 0);
- bool result = false;
- EXPECT_NONFATAL_FAILURE(result = a.Binary(0, 0),
- "Mock function called more times than expected");
- EXPECT_TRUE(result);
-
- // When there is no ON_CALL(), the default value for the return type
- // should be returned.
- MockB b;
- EXPECT_CALL(b, DoB(0))
- .Times(0);
- int n = -1;
- EXPECT_NONFATAL_FAILURE(n = b.DoB(0),
- "Mock function called more times than expected");
- EXPECT_EQ(0, n);
-}
-
-// Tests that when a void function is called too many times,
-// the failure message contains the argument values.
-TEST(ExcessiveCallTest, GeneratesFailureForVoidFunction) {
- MockA a;
- EXPECT_CALL(a, DoA(_))
- .Times(0);
- EXPECT_NONFATAL_FAILURE(
- a.DoA(9),
- "Mock function called more times than expected - returning directly.\n"
- " Function call: DoA(9)\n"
- " Expected: to be never called\n"
- " Actual: called once - over-saturated and active");
-}
-
-// Tests that when a non-void function is called too many times, the
-// failure message contains the argument values and the return value.
-TEST(ExcessiveCallTest, GeneratesFailureForNonVoidFunction) {
- MockB b;
- EXPECT_CALL(b, DoB(_));
- b.DoB(1);
- EXPECT_NONFATAL_FAILURE(
- b.DoB(2),
- "Mock function called more times than expected - "
- "returning default value.\n"
- " Function call: DoB(2)\n"
- " Returns: 0\n"
- " Expected: to be called once\n"
- " Actual: called twice - over-saturated and active");
-}
-
-// Tests using sequences.
-
-TEST(InSequenceTest, AllExpectationInScopeAreInSequence) {
- MockA a;
- {
- InSequence dummy;
-
- EXPECT_CALL(a, DoA(1));
- EXPECT_CALL(a, DoA(2));
- }
-
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- a.DoA(2);
- }, "Unexpected mock function call");
-
- a.DoA(1);
- a.DoA(2);
-}
-
-TEST(InSequenceTest, NestedInSequence) {
- MockA a;
- {
- InSequence dummy;
-
- EXPECT_CALL(a, DoA(1));
- {
- InSequence dummy2;
-
- EXPECT_CALL(a, DoA(2));
- EXPECT_CALL(a, DoA(3));
- }
- }
-
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- a.DoA(1);
- a.DoA(3);
- }, "Unexpected mock function call");
-
- a.DoA(2);
- a.DoA(3);
-}
-
-TEST(InSequenceTest, ExpectationsOutOfScopeAreNotAffected) {
- MockA a;
- {
- InSequence dummy;
-
- EXPECT_CALL(a, DoA(1));
- EXPECT_CALL(a, DoA(2));
- }
- EXPECT_CALL(a, DoA(3));
-
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- a.DoA(2);
- }, "Unexpected mock function call");
-
- a.DoA(3);
- a.DoA(1);
- a.DoA(2);
-}
-
-// Tests that any order is allowed when no sequence is used.
-TEST(SequenceTest, AnyOrderIsOkByDefault) {
- {
- MockA a;
- MockB b;
-
- EXPECT_CALL(a, DoA(1));
- EXPECT_CALL(b, DoB())
- .Times(AnyNumber());
-
- a.DoA(1);
- b.DoB();
- }
-
- { // NOLINT
- MockA a;
- MockB b;
-
- EXPECT_CALL(a, DoA(1));
- EXPECT_CALL(b, DoB())
- .Times(AnyNumber());
-
- b.DoB();
- a.DoA(1);
- }
-}
-
-// Tests that the calls must be in strict order when a complete order
-// is specified.
-TEST(SequenceTest, CallsMustBeInStrictOrderWhenSaidSo) {
- MockA a;
- Sequence s;
-
- EXPECT_CALL(a, ReturnResult(1))
- .InSequence(s)
- .WillOnce(Return(Result()));
-
- EXPECT_CALL(a, ReturnResult(2))
- .InSequence(s)
- .WillOnce(Return(Result()));
-
- EXPECT_CALL(a, ReturnResult(3))
- .InSequence(s)
- .WillOnce(Return(Result()));
-
- EXPECT_DEATH_IF_SUPPORTED({
- a.ReturnResult(1);
- a.ReturnResult(3);
- a.ReturnResult(2);
- }, "");
-
- EXPECT_DEATH_IF_SUPPORTED({
- a.ReturnResult(2);
- a.ReturnResult(1);
- a.ReturnResult(3);
- }, "");
-
- a.ReturnResult(1);
- a.ReturnResult(2);
- a.ReturnResult(3);
-}
-
-// Tests specifying a DAG using multiple sequences.
-TEST(SequenceTest, CallsMustConformToSpecifiedDag) {
- MockA a;
- MockB b;
- Sequence x, y;
-
- EXPECT_CALL(a, ReturnResult(1))
- .InSequence(x)
- .WillOnce(Return(Result()));
-
- EXPECT_CALL(b, DoB())
- .Times(2)
- .InSequence(y);
-
- EXPECT_CALL(a, ReturnResult(2))
- .InSequence(x, y)
- .WillRepeatedly(Return(Result()));
-
- EXPECT_CALL(a, ReturnResult(3))
- .InSequence(x)
- .WillOnce(Return(Result()));
-
- EXPECT_DEATH_IF_SUPPORTED({
- a.ReturnResult(1);
- b.DoB();
- a.ReturnResult(2);
- }, "");
-
- EXPECT_DEATH_IF_SUPPORTED({
- a.ReturnResult(2);
- }, "");
-
- EXPECT_DEATH_IF_SUPPORTED({
- a.ReturnResult(3);
- }, "");
-
- EXPECT_DEATH_IF_SUPPORTED({
- a.ReturnResult(1);
- b.DoB();
- b.DoB();
- a.ReturnResult(3);
- a.ReturnResult(2);
- }, "");
-
- b.DoB();
- a.ReturnResult(1);
- b.DoB();
- a.ReturnResult(3);
-}
-
-TEST(SequenceTest, Retirement) {
- MockA a;
- Sequence s;
-
- EXPECT_CALL(a, DoA(1))
- .InSequence(s);
- EXPECT_CALL(a, DoA(_))
- .InSequence(s)
- .RetiresOnSaturation();
- EXPECT_CALL(a, DoA(1))
- .InSequence(s);
-
- a.DoA(1);
- a.DoA(2);
- a.DoA(1);
-}
-
-// Tests Expectation.
-
-TEST(ExpectationTest, ConstrutorsWork) {
- MockA a;
- Expectation e1; // Default ctor.
-
- // Ctor from various forms of EXPECT_CALL.
- Expectation e2 = EXPECT_CALL(a, DoA(2));
- Expectation e3 = EXPECT_CALL(a, DoA(3)).With(_);
- {
- Sequence s;
- Expectation e4 = EXPECT_CALL(a, DoA(4)).Times(1);
- Expectation e5 = EXPECT_CALL(a, DoA(5)).InSequence(s);
- }
- Expectation e6 = EXPECT_CALL(a, DoA(6)).After(e2);
- Expectation e7 = EXPECT_CALL(a, DoA(7)).WillOnce(Return());
- Expectation e8 = EXPECT_CALL(a, DoA(8)).WillRepeatedly(Return());
- Expectation e9 = EXPECT_CALL(a, DoA(9)).RetiresOnSaturation();
-
- Expectation e10 = e2; // Copy ctor.
-
- EXPECT_THAT(e1, Ne(e2));
- EXPECT_THAT(e2, Eq(e10));
-
- a.DoA(2);
- a.DoA(3);
- a.DoA(4);
- a.DoA(5);
- a.DoA(6);
- a.DoA(7);
- a.DoA(8);
- a.DoA(9);
-}
-
-TEST(ExpectationTest, AssignmentWorks) {
- MockA a;
- Expectation e1;
- Expectation e2 = EXPECT_CALL(a, DoA(1));
-
- EXPECT_THAT(e1, Ne(e2));
-
- e1 = e2;
- EXPECT_THAT(e1, Eq(e2));
-
- a.DoA(1);
-}
-
-// Tests ExpectationSet.
-
-TEST(ExpectationSetTest, MemberTypesAreCorrect) {
- ::testing::StaticAssertTypeEq<Expectation, ExpectationSet::value_type>();
-}
-
-TEST(ExpectationSetTest, ConstructorsWork) {
- MockA a;
-
- Expectation e1;
- const Expectation e2;
- ExpectationSet es1; // Default ctor.
- ExpectationSet es2 = EXPECT_CALL(a, DoA(1)); // Ctor from EXPECT_CALL.
- ExpectationSet es3 = e1; // Ctor from Expectation.
- ExpectationSet es4(e1); // Ctor from Expectation; alternative syntax.
- ExpectationSet es5 = e2; // Ctor from const Expectation.
- ExpectationSet es6(e2); // Ctor from const Expectation; alternative syntax.
- ExpectationSet es7 = es2; // Copy ctor.
-
- EXPECT_EQ(0, es1.size());
- EXPECT_EQ(1, es2.size());
- EXPECT_EQ(1, es3.size());
- EXPECT_EQ(1, es4.size());
- EXPECT_EQ(1, es5.size());
- EXPECT_EQ(1, es6.size());
- EXPECT_EQ(1, es7.size());
-
- EXPECT_THAT(es3, Ne(es2));
- EXPECT_THAT(es4, Eq(es3));
- EXPECT_THAT(es5, Eq(es4));
- EXPECT_THAT(es6, Eq(es5));
- EXPECT_THAT(es7, Eq(es2));
- a.DoA(1);
-}
-
-TEST(ExpectationSetTest, AssignmentWorks) {
- ExpectationSet es1;
- ExpectationSet es2 = Expectation();
-
- es1 = es2;
- EXPECT_EQ(1, es1.size());
- EXPECT_THAT(*(es1.begin()), Eq(Expectation()));
- EXPECT_THAT(es1, Eq(es2));
-}
-
-TEST(ExpectationSetTest, InsertionWorks) {
- ExpectationSet es1;
- Expectation e1;
- es1 += e1;
- EXPECT_EQ(1, es1.size());
- EXPECT_THAT(*(es1.begin()), Eq(e1));
-
- MockA a;
- Expectation e2 = EXPECT_CALL(a, DoA(1));
- es1 += e2;
- EXPECT_EQ(2, es1.size());
-
- ExpectationSet::const_iterator it1 = es1.begin();
- ExpectationSet::const_iterator it2 = it1;
- ++it2;
- EXPECT_TRUE(*it1 == e1 || *it2 == e1); // e1 must be in the set.
- EXPECT_TRUE(*it1 == e2 || *it2 == e2); // e2 must be in the set too.
- a.DoA(1);
-}
-
-TEST(ExpectationSetTest, SizeWorks) {
- ExpectationSet es;
- EXPECT_EQ(0, es.size());
-
- es += Expectation();
- EXPECT_EQ(1, es.size());
-
- MockA a;
- es += EXPECT_CALL(a, DoA(1));
- EXPECT_EQ(2, es.size());
-
- a.DoA(1);
-}
-
-TEST(ExpectationSetTest, IsEnumerable) {
- ExpectationSet es;
- EXPECT_THAT(es.begin(), Eq(es.end()));
-
- es += Expectation();
- ExpectationSet::const_iterator it = es.begin();
- EXPECT_THAT(it, Ne(es.end()));
- EXPECT_THAT(*it, Eq(Expectation()));
- ++it;
- EXPECT_THAT(it, Eq(es.end()));
-}
-
-// Tests the .After() clause.
-
-TEST(AfterTest, SucceedsWhenPartialOrderIsSatisfied) {
- MockA a;
- ExpectationSet es;
- es += EXPECT_CALL(a, DoA(1));
- es += EXPECT_CALL(a, DoA(2));
- EXPECT_CALL(a, DoA(3))
- .After(es);
-
- a.DoA(1);
- a.DoA(2);
- a.DoA(3);
-}
-
-TEST(AfterTest, SucceedsWhenTotalOrderIsSatisfied) {
- MockA a;
- MockB b;
- // The following also verifies that const Expectation objects work
- // too. Do not remove the const modifiers.
- const Expectation e1 = EXPECT_CALL(a, DoA(1));
- const Expectation e2 = EXPECT_CALL(b, DoB())
- .Times(2)
- .After(e1);
- EXPECT_CALL(a, DoA(2)).After(e2);
-
- a.DoA(1);
- b.DoB();
- b.DoB();
- a.DoA(2);
-}
-
-// Calls must be in strict order when specified so.
-TEST(AfterDeathTest, CallsMustBeInStrictOrderWhenSpecifiedSo) {
- MockA a;
- MockB b;
- Expectation e1 = EXPECT_CALL(a, DoA(1));
- Expectation e2 = EXPECT_CALL(b, DoB())
- .Times(2)
- .After(e1);
- EXPECT_CALL(a, ReturnResult(2))
- .After(e2)
- .WillOnce(Return(Result()));
-
- a.DoA(1);
- // If a call to ReturnResult() violates the specified order, no
- // matching expectation will be found, and thus the default action
- // will be done. Since the return type of ReturnResult() is not a
- // built-in type, gmock won't know what to return and will thus
- // abort the program. Therefore a death test can tell us whether
- // gmock catches the order violation correctly.
- //
- // gtest and gmock print messages to stdout, which isn't captured by
- // death tests. Therefore we have to match with an empty regular
- // expression in all the EXPECT_DEATH()s.
- EXPECT_DEATH_IF_SUPPORTED(a.ReturnResult(2), "");
-
- b.DoB();
- EXPECT_DEATH_IF_SUPPORTED(a.ReturnResult(2), "");
-
- b.DoB();
- a.ReturnResult(2);
-}
-
-// Calls must satisfy the partial order when specified so.
-TEST(AfterDeathTest, CallsMustSatisfyPartialOrderWhenSpecifiedSo) {
- MockA a;
- Expectation e = EXPECT_CALL(a, DoA(1));
- const ExpectationSet es = EXPECT_CALL(a, DoA(2));
- EXPECT_CALL(a, ReturnResult(3))
- .After(e, es)
- .WillOnce(Return(Result()));
-
- EXPECT_DEATH_IF_SUPPORTED(a.ReturnResult(3), "");
-
- a.DoA(2);
- EXPECT_DEATH_IF_SUPPORTED(a.ReturnResult(3), "");
-
- a.DoA(1);
- a.ReturnResult(3);
-}
-
-// .After() can be combined with .InSequence().
-TEST(AfterDeathTest, CanBeUsedWithInSequence) {
- MockA a;
- Sequence s;
- Expectation e = EXPECT_CALL(a, DoA(1));
- EXPECT_CALL(a, DoA(2)).InSequence(s);
- EXPECT_CALL(a, ReturnResult(3))
- .InSequence(s).After(e)
- .WillOnce(Return(Result()));
-
- a.DoA(1);
- EXPECT_DEATH_IF_SUPPORTED(a.ReturnResult(3), "");
-
- a.DoA(2);
- a.ReturnResult(3);
-}
-
-// .After() can be called multiple times.
-TEST(AfterTest, CanBeCalledManyTimes) {
- MockA a;
- Expectation e1 = EXPECT_CALL(a, DoA(1));
- Expectation e2 = EXPECT_CALL(a, DoA(2));
- Expectation e3 = EXPECT_CALL(a, DoA(3));
- EXPECT_CALL(a, DoA(4))
- .After(e1)
- .After(e2)
- .After(e3);
-
- a.DoA(3);
- a.DoA(1);
- a.DoA(2);
- a.DoA(4);
-}
-
-// .After() accepts up to 5 arguments.
-TEST(AfterTest, AcceptsUpToFiveArguments) {
- MockA a;
- Expectation e1 = EXPECT_CALL(a, DoA(1));
- Expectation e2 = EXPECT_CALL(a, DoA(2));
- Expectation e3 = EXPECT_CALL(a, DoA(3));
- ExpectationSet es1 = EXPECT_CALL(a, DoA(4));
- ExpectationSet es2 = EXPECT_CALL(a, DoA(5));
- EXPECT_CALL(a, DoA(6))
- .After(e1, e2, e3, es1, es2);
-
- a.DoA(5);
- a.DoA(2);
- a.DoA(4);
- a.DoA(1);
- a.DoA(3);
- a.DoA(6);
-}
-
-// .After() allows input to contain duplicated Expectations.
-TEST(AfterTest, AcceptsDuplicatedInput) {
- MockA a;
- Expectation e1 = EXPECT_CALL(a, DoA(1));
- Expectation e2 = EXPECT_CALL(a, DoA(2));
- ExpectationSet es;
- es += e1;
- es += e2;
- EXPECT_CALL(a, ReturnResult(3))
- .After(e1, e2, es, e1)
- .WillOnce(Return(Result()));
-
- a.DoA(1);
- EXPECT_DEATH_IF_SUPPORTED(a.ReturnResult(3), "");
-
- a.DoA(2);
- a.ReturnResult(3);
-}
-
-// An Expectation added to an ExpectationSet after it has been used in
-// an .After() has no effect.
-TEST(AfterTest, ChangesToExpectationSetHaveNoEffectAfterwards) {
- MockA a;
- ExpectationSet es1 = EXPECT_CALL(a, DoA(1));
- Expectation e2 = EXPECT_CALL(a, DoA(2));
- EXPECT_CALL(a, DoA(3))
- .After(es1);
- es1 += e2;
-
- a.DoA(1);
- a.DoA(3);
- a.DoA(2);
-}
-
-// Tests that Google Mock correctly handles calls to mock functions
-// after a mock object owning one of their pre-requisites has died.
-
-// Tests that calls that satisfy the original spec are successful.
-TEST(DeletingMockEarlyTest, Success1) {
- MockB* const b1 = new MockB;
- MockA* const a = new MockA;
- MockB* const b2 = new MockB;
-
- {
- InSequence dummy;
- EXPECT_CALL(*b1, DoB(_))
- .WillOnce(Return(1));
- EXPECT_CALL(*a, Binary(_, _))
- .Times(AnyNumber())
- .WillRepeatedly(Return(true));
- EXPECT_CALL(*b2, DoB(_))
- .Times(AnyNumber())
- .WillRepeatedly(Return(2));
- }
-
- EXPECT_EQ(1, b1->DoB(1));
- delete b1;
- // a's pre-requisite has died.
- EXPECT_TRUE(a->Binary(0, 1));
- delete b2;
- // a's successor has died.
- EXPECT_TRUE(a->Binary(1, 2));
- delete a;
-}
-
-// Tests that calls that satisfy the original spec are successful.
-TEST(DeletingMockEarlyTest, Success2) {
- MockB* const b1 = new MockB;
- MockA* const a = new MockA;
- MockB* const b2 = new MockB;
-
- {
- InSequence dummy;
- EXPECT_CALL(*b1, DoB(_))
- .WillOnce(Return(1));
- EXPECT_CALL(*a, Binary(_, _))
- .Times(AnyNumber());
- EXPECT_CALL(*b2, DoB(_))
- .Times(AnyNumber())
- .WillRepeatedly(Return(2));
- }
-
- delete a; // a is trivially satisfied.
- EXPECT_EQ(1, b1->DoB(1));
- EXPECT_EQ(2, b2->DoB(2));
- delete b1;
- delete b2;
-}
-
-// Tests that it's OK to delete a mock object itself in its action.
-
-// Suppresses warning on unreferenced formal parameter in MSVC with
-// -W4.
-#ifdef _MSC_VER
-# pragma warning(push)
-# pragma warning(disable:4100)
-#endif
-
-ACTION_P(Delete, ptr) { delete ptr; }
-
-#ifdef _MSC_VER
-# pragma warning(pop)
-#endif
-
-TEST(DeletingMockEarlyTest, CanDeleteSelfInActionReturningVoid) {
- MockA* const a = new MockA;
- EXPECT_CALL(*a, DoA(_)).WillOnce(Delete(a));
- a->DoA(42); // This will cause a to be deleted.
-}
-
-TEST(DeletingMockEarlyTest, CanDeleteSelfInActionReturningValue) {
- MockA* const a = new MockA;
- EXPECT_CALL(*a, ReturnResult(_))
- .WillOnce(DoAll(Delete(a), Return(Result())));
- a->ReturnResult(42); // This will cause a to be deleted.
-}
-
-// Tests that calls that violate the original spec yield failures.
-TEST(DeletingMockEarlyTest, Failure1) {
- MockB* const b1 = new MockB;
- MockA* const a = new MockA;
- MockB* const b2 = new MockB;
-
- {
- InSequence dummy;
- EXPECT_CALL(*b1, DoB(_))
- .WillOnce(Return(1));
- EXPECT_CALL(*a, Binary(_, _))
- .Times(AnyNumber());
- EXPECT_CALL(*b2, DoB(_))
- .Times(AnyNumber())
- .WillRepeatedly(Return(2));
- }
-
- delete a; // a is trivially satisfied.
- EXPECT_NONFATAL_FAILURE({
- b2->DoB(2);
- }, "Unexpected mock function call");
- EXPECT_EQ(1, b1->DoB(1));
- delete b1;
- delete b2;
-}
-
-// Tests that calls that violate the original spec yield failures.
-TEST(DeletingMockEarlyTest, Failure2) {
- MockB* const b1 = new MockB;
- MockA* const a = new MockA;
- MockB* const b2 = new MockB;
-
- {
- InSequence dummy;
- EXPECT_CALL(*b1, DoB(_));
- EXPECT_CALL(*a, Binary(_, _))
- .Times(AnyNumber());
- EXPECT_CALL(*b2, DoB(_))
- .Times(AnyNumber());
- }
-
- EXPECT_NONFATAL_FAILURE(delete b1,
- "Actual: never called");
- EXPECT_NONFATAL_FAILURE(a->Binary(0, 1),
- "Unexpected mock function call");
- EXPECT_NONFATAL_FAILURE(b2->DoB(1),
- "Unexpected mock function call");
- delete a;
- delete b2;
-}
-
-class EvenNumberCardinality : public CardinalityInterface {
- public:
- // Returns true iff call_count calls will satisfy this cardinality.
- virtual bool IsSatisfiedByCallCount(int call_count) const {
- return call_count % 2 == 0;
- }
-
- // Returns true iff call_count calls will saturate this cardinality.
- virtual bool IsSaturatedByCallCount(int /* call_count */) const {
- return false;
- }
-
- // Describes self to an ostream.
- virtual void DescribeTo(::std::ostream* os) const {
- *os << "called even number of times";
- }
-};
-
-Cardinality EvenNumber() {
- return Cardinality(new EvenNumberCardinality);
-}
-
-TEST(ExpectationBaseTest,
- AllPrerequisitesAreSatisfiedWorksForNonMonotonicCardinality) {
- MockA* a = new MockA;
- Sequence s;
-
- EXPECT_CALL(*a, DoA(1))
- .Times(EvenNumber())
- .InSequence(s);
- EXPECT_CALL(*a, DoA(2))
- .Times(AnyNumber())
- .InSequence(s);
- EXPECT_CALL(*a, DoA(3))
- .Times(AnyNumber());
-
- a->DoA(3);
- a->DoA(1);
- EXPECT_NONFATAL_FAILURE(a->DoA(2), "Unexpected mock function call");
- EXPECT_NONFATAL_FAILURE(delete a, "to be called even number of times");
-}
-
-// The following tests verify the message generated when a mock
-// function is called.
-
-struct Printable {
-};
-
-inline void operator<<(::std::ostream& os, const Printable&) {
- os << "Printable";
-}
-
-struct Unprintable {
- Unprintable() : value(0) {}
- int value;
-};
-
-class MockC {
- public:
- MockC() {}
-
- MOCK_METHOD6(VoidMethod, void(bool cond, int n, string s, void* p,
- const Printable& x, Unprintable y));
- MOCK_METHOD0(NonVoidMethod, int()); // NOLINT
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(MockC);
-};
-
-class VerboseFlagPreservingFixture : public testing::Test {
- protected:
- // The code needs to work when both ::string and ::std::string are defined
- // and the flag is implemented as a testing::internal::String. In this
- // case, without the call to c_str(), the compiler will complain that it
- // cannot figure out what overload of string constructor to use.
- // TODO(vladl@google.com): Use internal::string instead of String for
- // string flags in Google Test.
- VerboseFlagPreservingFixture()
- : saved_verbose_flag_(GMOCK_FLAG(verbose).c_str()) {}
-
- ~VerboseFlagPreservingFixture() { GMOCK_FLAG(verbose) = saved_verbose_flag_; }
-
- private:
- const string saved_verbose_flag_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(VerboseFlagPreservingFixture);
-};
-
-#if GTEST_HAS_STREAM_REDIRECTION
-
-// Tests that an uninteresting mock function call generates a warning
-// containing the stack trace.
-TEST(FunctionCallMessageTest, UninterestingCallGeneratesFyiWithStackTrace) {
- MockC c;
- CaptureStdout();
- c.VoidMethod(false, 5, "Hi", NULL, Printable(), Unprintable());
- const String output = GetCapturedStdout();
- EXPECT_PRED_FORMAT2(IsSubstring, "GMOCK WARNING", output);
- EXPECT_PRED_FORMAT2(IsSubstring, "Stack trace:", output);
-
-# ifndef NDEBUG
-
- // We check the stack trace content in dbg-mode only, as opt-mode
- // may inline the call we are interested in seeing.
-
- // Verifies that a void mock function's name appears in the stack
- // trace.
- EXPECT_PRED_FORMAT2(IsSubstring, "VoidMethod(", output);
-
- // Verifies that a non-void mock function's name appears in the
- // stack trace.
- CaptureStdout();
- c.NonVoidMethod();
- const String output2 = GetCapturedStdout();
- EXPECT_PRED_FORMAT2(IsSubstring, "NonVoidMethod(", output2);
-
-# endif // NDEBUG
-}
-
-// Tests that an uninteresting mock function call causes the function
-// arguments and return value to be printed.
-TEST(FunctionCallMessageTest, UninterestingCallPrintsArgumentsAndReturnValue) {
- // A non-void mock function.
- MockB b;
- CaptureStdout();
- b.DoB();
- const String output1 = GetCapturedStdout();
- EXPECT_PRED_FORMAT2(
- IsSubstring,
- "Uninteresting mock function call - returning default value.\n"
- " Function call: DoB()\n"
- " Returns: 0\n", output1.c_str());
- // Makes sure the return value is printed.
-
- // A void mock function.
- MockC c;
- CaptureStdout();
- c.VoidMethod(false, 5, "Hi", NULL, Printable(), Unprintable());
- const String output2 = GetCapturedStdout();
- EXPECT_THAT(output2.c_str(),
- ContainsRegex(
- "Uninteresting mock function call - returning directly\\.\n"
- " Function call: VoidMethod"
- "\\(false, 5, \"Hi\", NULL, @.+ "
- "Printable, 4-byte object <00-00 00-00>\\)"));
- // A void function has no return value to print.
-}
-
-// Tests how the --gmock_verbose flag affects Google Mock's output.
-
-class GMockVerboseFlagTest : public VerboseFlagPreservingFixture {
- public:
- // Verifies that the given Google Mock output is correct. (When
- // should_print is true, the output should match the given regex and
- // contain the given function name in the stack trace. When it's
- // false, the output should be empty.)
- void VerifyOutput(const String& output, bool should_print,
- const string& expected_substring,
- const string& function_name) {
- if (should_print) {
- EXPECT_THAT(output.c_str(), HasSubstr(expected_substring));
-# ifndef NDEBUG
- // We check the stack trace content in dbg-mode only, as opt-mode
- // may inline the call we are interested in seeing.
- EXPECT_THAT(output.c_str(), HasSubstr(function_name));
-# else
- // Suppresses 'unused function parameter' warnings.
- static_cast<void>(function_name);
-# endif // NDEBUG
- } else {
- EXPECT_STREQ("", output.c_str());
- }
- }
-
- // Tests how the flag affects expected calls.
- void TestExpectedCall(bool should_print) {
- MockA a;
- EXPECT_CALL(a, DoA(5));
- EXPECT_CALL(a, Binary(_, 1))
- .WillOnce(Return(true));
-
- // A void-returning function.
- CaptureStdout();
- a.DoA(5);
- VerifyOutput(
- GetCapturedStdout(),
- should_print,
- "Mock function call matches EXPECT_CALL(a, DoA(5))...\n"
- " Function call: DoA(5)\n"
- "Stack trace:\n",
- "DoA");
-
- // A non-void-returning function.
- CaptureStdout();
- a.Binary(2, 1);
- VerifyOutput(
- GetCapturedStdout(),
- should_print,
- "Mock function call matches EXPECT_CALL(a, Binary(_, 1))...\n"
- " Function call: Binary(2, 1)\n"
- " Returns: true\n"
- "Stack trace:\n",
- "Binary");
- }
-
- // Tests how the flag affects uninteresting calls.
- void TestUninterestingCall(bool should_print) {
- MockA a;
-
- // A void-returning function.
- CaptureStdout();
- a.DoA(5);
- VerifyOutput(
- GetCapturedStdout(),
- should_print,
- "\nGMOCK WARNING:\n"
- "Uninteresting mock function call - returning directly.\n"
- " Function call: DoA(5)\n"
- "Stack trace:\n",
- "DoA");
-
- // A non-void-returning function.
- CaptureStdout();
- a.Binary(2, 1);
- VerifyOutput(
- GetCapturedStdout(),
- should_print,
- "\nGMOCK WARNING:\n"
- "Uninteresting mock function call - returning default value.\n"
- " Function call: Binary(2, 1)\n"
- " Returns: false\n"
- "Stack trace:\n",
- "Binary");
- }
-};
-
-// Tests that --gmock_verbose=info causes both expected and
-// uninteresting calls to be reported.
-TEST_F(GMockVerboseFlagTest, Info) {
- GMOCK_FLAG(verbose) = kInfoVerbosity;
- TestExpectedCall(true);
- TestUninterestingCall(true);
-}
-
-// Tests that --gmock_verbose=warning causes uninteresting calls to be
-// reported.
-TEST_F(GMockVerboseFlagTest, Warning) {
- GMOCK_FLAG(verbose) = kWarningVerbosity;
- TestExpectedCall(false);
- TestUninterestingCall(true);
-}
-
-// Tests that --gmock_verbose=warning causes neither expected nor
-// uninteresting calls to be reported.
-TEST_F(GMockVerboseFlagTest, Error) {
- GMOCK_FLAG(verbose) = kErrorVerbosity;
- TestExpectedCall(false);
- TestUninterestingCall(false);
-}
-
-// Tests that --gmock_verbose=SOME_INVALID_VALUE has the same effect
-// as --gmock_verbose=warning.
-TEST_F(GMockVerboseFlagTest, InvalidFlagIsTreatedAsWarning) {
- GMOCK_FLAG(verbose) = "invalid"; // Treated as "warning".
- TestExpectedCall(false);
- TestUninterestingCall(true);
-}
-
-#endif // GTEST_HAS_STREAM_REDIRECTION
-
-// A helper class that generates a failure when printed. We use it to
-// ensure that Google Mock doesn't print a value (even to an internal
-// buffer) when it is not supposed to do so.
-class PrintMeNot {};
-
-void PrintTo(PrintMeNot /* dummy */, ::std::ostream* /* os */) {
- ADD_FAILURE() << "Google Mock is printing a value that shouldn't be "
- << "printed even to an internal buffer.";
-}
-
-class LogTestHelper {
- public:
- LogTestHelper() {}
-
- MOCK_METHOD1(Foo, PrintMeNot(PrintMeNot));
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(LogTestHelper);
-};
-
-class GMockLogTest : public VerboseFlagPreservingFixture {
- protected:
- LogTestHelper helper_;
-};
-
-TEST_F(GMockLogTest, DoesNotPrintGoodCallInternallyIfVerbosityIsWarning) {
- GMOCK_FLAG(verbose) = kWarningVerbosity;
- EXPECT_CALL(helper_, Foo(_))
- .WillOnce(Return(PrintMeNot()));
- helper_.Foo(PrintMeNot()); // This is an expected call.
-}
-
-TEST_F(GMockLogTest, DoesNotPrintGoodCallInternallyIfVerbosityIsError) {
- GMOCK_FLAG(verbose) = kErrorVerbosity;
- EXPECT_CALL(helper_, Foo(_))
- .WillOnce(Return(PrintMeNot()));
- helper_.Foo(PrintMeNot()); // This is an expected call.
-}
-
-TEST_F(GMockLogTest, DoesNotPrintWarningInternallyIfVerbosityIsError) {
- GMOCK_FLAG(verbose) = kErrorVerbosity;
- ON_CALL(helper_, Foo(_))
- .WillByDefault(Return(PrintMeNot()));
- helper_.Foo(PrintMeNot()); // This should generate a warning.
-}
-
-// Tests Mock::AllowLeak().
-
-TEST(AllowLeakTest, AllowsLeakingUnusedMockObject) {
- MockA* a = new MockA;
- Mock::AllowLeak(a);
-}
-
-TEST(AllowLeakTest, CanBeCalledBeforeOnCall) {
- MockA* a = new MockA;
- Mock::AllowLeak(a);
- ON_CALL(*a, DoA(_)).WillByDefault(Return());
- a->DoA(0);
-}
-
-TEST(AllowLeakTest, CanBeCalledAfterOnCall) {
- MockA* a = new MockA;
- ON_CALL(*a, DoA(_)).WillByDefault(Return());
- Mock::AllowLeak(a);
-}
-
-TEST(AllowLeakTest, CanBeCalledBeforeExpectCall) {
- MockA* a = new MockA;
- Mock::AllowLeak(a);
- EXPECT_CALL(*a, DoA(_));
- a->DoA(0);
-}
-
-TEST(AllowLeakTest, CanBeCalledAfterExpectCall) {
- MockA* a = new MockA;
- EXPECT_CALL(*a, DoA(_)).Times(AnyNumber());
- Mock::AllowLeak(a);
-}
-
-TEST(AllowLeakTest, WorksWhenBothOnCallAndExpectCallArePresent) {
- MockA* a = new MockA;
- ON_CALL(*a, DoA(_)).WillByDefault(Return());
- EXPECT_CALL(*a, DoA(_)).Times(AnyNumber());
- Mock::AllowLeak(a);
-}
-
-// Tests that we can verify and clear a mock object's expectations
-// when none of its methods has expectations.
-TEST(VerifyAndClearExpectationsTest, NoMethodHasExpectations) {
- MockB b;
- ASSERT_TRUE(Mock::VerifyAndClearExpectations(&b));
-
- // There should be no expectations on the methods now, so we can
- // freely call them.
- EXPECT_EQ(0, b.DoB());
- EXPECT_EQ(0, b.DoB(1));
-}
-
-// Tests that we can verify and clear a mock object's expectations
-// when some, but not all, of its methods have expectations *and* the
-// verification succeeds.
-TEST(VerifyAndClearExpectationsTest, SomeMethodsHaveExpectationsAndSucceed) {
- MockB b;
- EXPECT_CALL(b, DoB())
- .WillOnce(Return(1));
- b.DoB();
- ASSERT_TRUE(Mock::VerifyAndClearExpectations(&b));
-
- // There should be no expectations on the methods now, so we can
- // freely call them.
- EXPECT_EQ(0, b.DoB());
- EXPECT_EQ(0, b.DoB(1));
-}
-
-// Tests that we can verify and clear a mock object's expectations
-// when some, but not all, of its methods have expectations *and* the
-// verification fails.
-TEST(VerifyAndClearExpectationsTest, SomeMethodsHaveExpectationsAndFail) {
- MockB b;
- EXPECT_CALL(b, DoB())
- .WillOnce(Return(1));
- bool result = true;
- EXPECT_NONFATAL_FAILURE(result = Mock::VerifyAndClearExpectations(&b),
- "Actual: never called");
- ASSERT_FALSE(result);
-
- // There should be no expectations on the methods now, so we can
- // freely call them.
- EXPECT_EQ(0, b.DoB());
- EXPECT_EQ(0, b.DoB(1));
-}
-
-// Tests that we can verify and clear a mock object's expectations
-// when all of its methods have expectations.
-TEST(VerifyAndClearExpectationsTest, AllMethodsHaveExpectations) {
- MockB b;
- EXPECT_CALL(b, DoB())
- .WillOnce(Return(1));
- EXPECT_CALL(b, DoB(_))
- .WillOnce(Return(2));
- b.DoB();
- b.DoB(1);
- ASSERT_TRUE(Mock::VerifyAndClearExpectations(&b));
-
- // There should be no expectations on the methods now, so we can
- // freely call them.
- EXPECT_EQ(0, b.DoB());
- EXPECT_EQ(0, b.DoB(1));
-}
-
-// Tests that we can verify and clear a mock object's expectations
-// when a method has more than one expectation.
-TEST(VerifyAndClearExpectationsTest, AMethodHasManyExpectations) {
- MockB b;
- EXPECT_CALL(b, DoB(0))
- .WillOnce(Return(1));
- EXPECT_CALL(b, DoB(_))
- .WillOnce(Return(2));
- b.DoB(1);
- bool result = true;
- EXPECT_NONFATAL_FAILURE(result = Mock::VerifyAndClearExpectations(&b),
- "Actual: never called");
- ASSERT_FALSE(result);
-
- // There should be no expectations on the methods now, so we can
- // freely call them.
- EXPECT_EQ(0, b.DoB());
- EXPECT_EQ(0, b.DoB(1));
-}
-
-// Tests that we can call VerifyAndClearExpectations() on the same
-// mock object multiple times.
-TEST(VerifyAndClearExpectationsTest, CanCallManyTimes) {
- MockB b;
- EXPECT_CALL(b, DoB());
- b.DoB();
- Mock::VerifyAndClearExpectations(&b);
-
- EXPECT_CALL(b, DoB(_))
- .WillOnce(Return(1));
- b.DoB(1);
- Mock::VerifyAndClearExpectations(&b);
- Mock::VerifyAndClearExpectations(&b);
-
- // There should be no expectations on the methods now, so we can
- // freely call them.
- EXPECT_EQ(0, b.DoB());
- EXPECT_EQ(0, b.DoB(1));
-}
-
-// Tests that we can clear a mock object's default actions when none
-// of its methods has default actions.
-TEST(VerifyAndClearTest, NoMethodHasDefaultActions) {
- MockB b;
- // If this crashes or generates a failure, the test will catch it.
- Mock::VerifyAndClear(&b);
- EXPECT_EQ(0, b.DoB());
-}
-
-// Tests that we can clear a mock object's default actions when some,
-// but not all of its methods have default actions.
-TEST(VerifyAndClearTest, SomeMethodsHaveDefaultActions) {
- MockB b;
- ON_CALL(b, DoB())
- .WillByDefault(Return(1));
-
- Mock::VerifyAndClear(&b);
-
- // Verifies that the default action of int DoB() was removed.
- EXPECT_EQ(0, b.DoB());
-}
-
-// Tests that we can clear a mock object's default actions when all of
-// its methods have default actions.
-TEST(VerifyAndClearTest, AllMethodsHaveDefaultActions) {
- MockB b;
- ON_CALL(b, DoB())
- .WillByDefault(Return(1));
- ON_CALL(b, DoB(_))
- .WillByDefault(Return(2));
-
- Mock::VerifyAndClear(&b);
-
- // Verifies that the default action of int DoB() was removed.
- EXPECT_EQ(0, b.DoB());
-
- // Verifies that the default action of int DoB(int) was removed.
- EXPECT_EQ(0, b.DoB(0));
-}
-
-// Tests that we can clear a mock object's default actions when a
-// method has more than one ON_CALL() set on it.
-TEST(VerifyAndClearTest, AMethodHasManyDefaultActions) {
- MockB b;
- ON_CALL(b, DoB(0))
- .WillByDefault(Return(1));
- ON_CALL(b, DoB(_))
- .WillByDefault(Return(2));
-
- Mock::VerifyAndClear(&b);
-
- // Verifies that the default actions (there are two) of int DoB(int)
- // were removed.
- EXPECT_EQ(0, b.DoB(0));
- EXPECT_EQ(0, b.DoB(1));
-}
-
-// Tests that we can call VerifyAndClear() on a mock object multiple
-// times.
-TEST(VerifyAndClearTest, CanCallManyTimes) {
- MockB b;
- ON_CALL(b, DoB())
- .WillByDefault(Return(1));
- Mock::VerifyAndClear(&b);
- Mock::VerifyAndClear(&b);
-
- ON_CALL(b, DoB(_))
- .WillByDefault(Return(1));
- Mock::VerifyAndClear(&b);
-
- EXPECT_EQ(0, b.DoB());
- EXPECT_EQ(0, b.DoB(1));
-}
-
-// Tests that VerifyAndClear() works when the verification succeeds.
-TEST(VerifyAndClearTest, Success) {
- MockB b;
- ON_CALL(b, DoB())
- .WillByDefault(Return(1));
- EXPECT_CALL(b, DoB(1))
- .WillOnce(Return(2));
-
- b.DoB();
- b.DoB(1);
- ASSERT_TRUE(Mock::VerifyAndClear(&b));
-
- // There should be no expectations on the methods now, so we can
- // freely call them.
- EXPECT_EQ(0, b.DoB());
- EXPECT_EQ(0, b.DoB(1));
-}
-
-// Tests that VerifyAndClear() works when the verification fails.
-TEST(VerifyAndClearTest, Failure) {
- MockB b;
- ON_CALL(b, DoB(_))
- .WillByDefault(Return(1));
- EXPECT_CALL(b, DoB())
- .WillOnce(Return(2));
-
- b.DoB(1);
- bool result = true;
- EXPECT_NONFATAL_FAILURE(result = Mock::VerifyAndClear(&b),
- "Actual: never called");
- ASSERT_FALSE(result);
-
- // There should be no expectations on the methods now, so we can
- // freely call them.
- EXPECT_EQ(0, b.DoB());
- EXPECT_EQ(0, b.DoB(1));
-}
-
-// Tests that VerifyAndClear() works when the default actions and
-// expectations are set on a const mock object.
-TEST(VerifyAndClearTest, Const) {
- MockB b;
- ON_CALL(Const(b), DoB())
- .WillByDefault(Return(1));
-
- EXPECT_CALL(Const(b), DoB())
- .WillOnce(DoDefault())
- .WillOnce(Return(2));
-
- b.DoB();
- b.DoB();
- ASSERT_TRUE(Mock::VerifyAndClear(&b));
-
- // There should be no expectations on the methods now, so we can
- // freely call them.
- EXPECT_EQ(0, b.DoB());
- EXPECT_EQ(0, b.DoB(1));
-}
-
-// Tests that we can set default actions and expectations on a mock
-// object after VerifyAndClear() has been called on it.
-TEST(VerifyAndClearTest, CanSetDefaultActionsAndExpectationsAfterwards) {
- MockB b;
- ON_CALL(b, DoB())
- .WillByDefault(Return(1));
- EXPECT_CALL(b, DoB(_))
- .WillOnce(Return(2));
- b.DoB(1);
-
- Mock::VerifyAndClear(&b);
-
- EXPECT_CALL(b, DoB())
- .WillOnce(Return(3));
- ON_CALL(b, DoB(_))
- .WillByDefault(Return(4));
-
- EXPECT_EQ(3, b.DoB());
- EXPECT_EQ(4, b.DoB(1));
-}
-
-// Tests that calling VerifyAndClear() on one mock object does not
-// affect other mock objects (either of the same type or not).
-TEST(VerifyAndClearTest, DoesNotAffectOtherMockObjects) {
- MockA a;
- MockB b1;
- MockB b2;
-
- ON_CALL(a, Binary(_, _))
- .WillByDefault(Return(true));
- EXPECT_CALL(a, Binary(_, _))
- .WillOnce(DoDefault())
- .WillOnce(Return(false));
-
- ON_CALL(b1, DoB())
- .WillByDefault(Return(1));
- EXPECT_CALL(b1, DoB(_))
- .WillOnce(Return(2));
-
- ON_CALL(b2, DoB())
- .WillByDefault(Return(3));
- EXPECT_CALL(b2, DoB(_));
-
- b2.DoB(0);
- Mock::VerifyAndClear(&b2);
-
- // Verifies that the default actions and expectations of a and b1
- // are still in effect.
- EXPECT_TRUE(a.Binary(0, 0));
- EXPECT_FALSE(a.Binary(0, 0));
-
- EXPECT_EQ(1, b1.DoB());
- EXPECT_EQ(2, b1.DoB(0));
-}
-
-TEST(VerifyAndClearTest,
- DestroyingChainedMocksDoesNotDeadlockThroughExpectations) {
- linked_ptr<MockA> a(new MockA);
- ReferenceHoldingMock test_mock;
-
- // EXPECT_CALL stores a reference to a inside test_mock.
- EXPECT_CALL(test_mock, AcceptReference(_))
- .WillRepeatedly(SetArgPointee<0>(a));
-
- // Throw away the reference to the mock that we have in a. After this, the
- // only reference to it is stored by test_mock.
- a.reset();
-
- // When test_mock goes out of scope, it destroys the last remaining reference
- // to the mock object originally pointed to by a. This will cause the MockA
- // destructor to be called from inside the ReferenceHoldingMock destructor.
- // The state of all mocks is protected by a single global lock, but there
- // should be no deadlock.
-}
-
-TEST(VerifyAndClearTest,
- DestroyingChainedMocksDoesNotDeadlockThroughDefaultAction) {
- linked_ptr<MockA> a(new MockA);
- ReferenceHoldingMock test_mock;
-
- // ON_CALL stores a reference to a inside test_mock.
- ON_CALL(test_mock, AcceptReference(_))
- .WillByDefault(SetArgPointee<0>(a));
-
- // Throw away the reference to the mock that we have in a. After this, the
- // only reference to it is stored by test_mock.
- a.reset();
-
- // When test_mock goes out of scope, it destroys the last remaining reference
- // to the mock object originally pointed to by a. This will cause the MockA
- // destructor to be called from inside the ReferenceHoldingMock destructor.
- // The state of all mocks is protected by a single global lock, but there
- // should be no deadlock.
-}
-
-// Tests that a mock function's action can call a mock function
-// (either the same function or a different one) either as an explicit
-// action or as a default action without causing a dead lock. It
-// verifies that the action is not performed inside the critical
-// section.
-TEST(SynchronizationTest, CanCallMockMethodInAction) {
- MockA a;
- MockC c;
- ON_CALL(a, DoA(_))
- .WillByDefault(IgnoreResult(InvokeWithoutArgs(&c,
- &MockC::NonVoidMethod)));
- EXPECT_CALL(a, DoA(1));
- EXPECT_CALL(a, DoA(1))
- .WillOnce(Invoke(&a, &MockA::DoA))
- .RetiresOnSaturation();
- EXPECT_CALL(c, NonVoidMethod());
-
- a.DoA(1);
- // This will match the second EXPECT_CALL() and trigger another a.DoA(1),
- // which will in turn match the first EXPECT_CALL() and trigger a call to
- // c.NonVoidMethod() that was specified by the ON_CALL() since the first
- // EXPECT_CALL() did not specify an action.
-}
-
-} // namespace
-
-// Allows the user to define his own main and then invoke gmock_main
-// from it. This might be necessary on some platforms which require
-// specific setup and teardown.
-#if GMOCK_RENAME_MAIN
-int gmock_main(int argc, char **argv) {
-#else
-int main(int argc, char **argv) {
-#endif // GMOCK_RENAME_MAIN
- testing::InitGoogleMock(&argc, argv);
-
- // Ensures that the tests pass no matter what value of
- // --gmock_catch_leaked_mocks and --gmock_verbose the user specifies.
- testing::GMOCK_FLAG(catch_leaked_mocks) = true;
- testing::GMOCK_FLAG(verbose) = testing::internal::kWarningVerbosity;
-
- return RUN_ALL_TESTS();
-}
diff --git a/src/testing/test/gmock_all_test.cc b/src/testing/test/gmock_all_test.cc
deleted file mode 100644
index 691aac84..00000000
--- a/src/testing/test/gmock_all_test.cc
+++ /dev/null
@@ -1,48 +0,0 @@
-// Copyright 2009, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-//
-// Tests for Google C++ Mocking Framework (Google Mock)
-//
-// Sometimes it's desirable to build most of Google Mock's own tests
-// by compiling a single file. This file serves this purpose.
-#include "test/gmock-actions_test.cc"
-#include "test/gmock-cardinalities_test.cc"
-#include "test/gmock-generated-actions_test.cc"
-#include "test/gmock-generated-function-mockers_test.cc"
-#include "test/gmock-generated-internal-utils_test.cc"
-#include "test/gmock-generated-matchers_test.cc"
-#include "test/gmock-internal-utils_test.cc"
-#include "test/gmock-matchers_test.cc"
-#include "test/gmock-more-actions_test.cc"
-#include "test/gmock-nice-strict_test.cc"
-#include "test/gmock-port_test.cc"
-#include "test/gmock-spec-builders_test.cc"
-#include "test/gmock_test.cc"
diff --git a/src/testing/test/gmock_leak_test.py b/src/testing/test/gmock_leak_test.py
deleted file mode 100755
index 38ff9d01..00000000
--- a/src/testing/test/gmock_leak_test.py
+++ /dev/null
@@ -1,90 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2009, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-"""Tests that leaked mock objects can be caught be Google Mock."""
-
-__author__ = 'wan@google.com (Zhanyong Wan)'
-
-
-import gmock_test_utils
-
-
-PROGRAM_PATH = gmock_test_utils.GetTestExecutablePath('gmock_leak_test_')
-TEST_WITH_EXPECT_CALL = [PROGRAM_PATH, '--gtest_filter=*ExpectCall*']
-TEST_WITH_ON_CALL = [PROGRAM_PATH, '--gtest_filter=*OnCall*']
-TEST_MULTIPLE_LEAKS = [PROGRAM_PATH, '--gtest_filter=*MultipleLeaked*']
-
-
-class GMockLeakTest(gmock_test_utils.TestCase):
-
- def testCatchesLeakedMockByDefault(self):
- self.assertNotEqual(
- 0,
- gmock_test_utils.Subprocess(TEST_WITH_EXPECT_CALL).exit_code)
- self.assertNotEqual(
- 0,
- gmock_test_utils.Subprocess(TEST_WITH_ON_CALL).exit_code)
-
- def testDoesNotCatchLeakedMockWhenDisabled(self):
- self.assertEquals(
- 0,
- gmock_test_utils.Subprocess(TEST_WITH_EXPECT_CALL +
- ['--gmock_catch_leaked_mocks=0']).exit_code)
- self.assertEquals(
- 0,
- gmock_test_utils.Subprocess(TEST_WITH_ON_CALL +
- ['--gmock_catch_leaked_mocks=0']).exit_code)
-
- def testCatchesLeakedMockWhenEnabled(self):
- self.assertNotEqual(
- 0,
- gmock_test_utils.Subprocess(TEST_WITH_EXPECT_CALL +
- ['--gmock_catch_leaked_mocks']).exit_code)
- self.assertNotEqual(
- 0,
- gmock_test_utils.Subprocess(TEST_WITH_ON_CALL +
- ['--gmock_catch_leaked_mocks']).exit_code)
-
- def testCatchesLeakedMockWhenEnabledWithExplictFlagValue(self):
- self.assertNotEqual(
- 0,
- gmock_test_utils.Subprocess(TEST_WITH_EXPECT_CALL +
- ['--gmock_catch_leaked_mocks=1']).exit_code)
-
- def testCatchesMultipleLeakedMocks(self):
- self.assertNotEqual(
- 0,
- gmock_test_utils.Subprocess(TEST_MULTIPLE_LEAKS +
- ['--gmock_catch_leaked_mocks']).exit_code)
-
-
-if __name__ == '__main__':
- gmock_test_utils.Main()
diff --git a/src/testing/test/gmock_leak_test_.cc b/src/testing/test/gmock_leak_test_.cc
deleted file mode 100644
index 1d27d22f..00000000
--- a/src/testing/test/gmock_leak_test_.cc
+++ /dev/null
@@ -1,100 +0,0 @@
-// Copyright 2009, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-// Google Mock - a framework for writing C++ mock classes.
-//
-// This program is for verifying that a leaked mock object can be
-// caught by Google Mock's leak detector.
-
-#include "gmock/gmock.h"
-
-namespace {
-
-using ::testing::Return;
-
-class FooInterface {
- public:
- virtual ~FooInterface() {}
- virtual void DoThis() = 0;
-};
-
-class MockFoo : public FooInterface {
- public:
- MockFoo() {}
-
- MOCK_METHOD0(DoThis, void());
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFoo);
-};
-
-TEST(LeakTest, LeakedMockWithExpectCallCausesFailureWhenLeakCheckingIsEnabled) {
- MockFoo* foo = new MockFoo;
-
- EXPECT_CALL(*foo, DoThis());
- foo->DoThis();
-
- // In order to test the leak detector, we deliberately leak foo.
-
- // Makes sure Google Mock's leak detector can change the exit code
- // to 1 even when the code is already exiting with 0.
- exit(0);
-}
-
-TEST(LeakTest, LeakedMockWithOnCallCausesFailureWhenLeakCheckingIsEnabled) {
- MockFoo* foo = new MockFoo;
-
- ON_CALL(*foo, DoThis()).WillByDefault(Return());
-
- // In order to test the leak detector, we deliberately leak foo.
-
- // Makes sure Google Mock's leak detector can change the exit code
- // to 1 even when the code is already exiting with 0.
- exit(0);
-}
-
-TEST(LeakTest, CatchesMultipleLeakedMockObjects) {
- MockFoo* foo1 = new MockFoo;
- MockFoo* foo2 = new MockFoo;
-
- ON_CALL(*foo1, DoThis()).WillByDefault(Return());
- EXPECT_CALL(*foo2, DoThis());
- foo2->DoThis();
-
- // In order to test the leak detector, we deliberately leak foo1 and
- // foo2.
-
- // Makes sure Google Mock's leak detector can change the exit code
- // to 1 even when the code is already exiting with 0.
- exit(0);
-}
-
-} // namespace
diff --git a/src/testing/test/gmock_link2_test.cc b/src/testing/test/gmock_link2_test.cc
deleted file mode 100644
index 4c310c3d..00000000
--- a/src/testing/test/gmock_link2_test.cc
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan), vladl@google.com (Vlad Losev)
-
-// Google Mock - a framework for writing C++ mock classes.
-//
-// This file is for verifying that various Google Mock constructs do not
-// produce linker errors when instantiated in different translation units.
-// Please see gmock_link_test.h for details.
-
-#define LinkTest LinkTest2
-
-#include "test/gmock_link_test.h"
diff --git a/src/testing/test/gmock_link_test.cc b/src/testing/test/gmock_link_test.cc
deleted file mode 100644
index 61e97d10..00000000
--- a/src/testing/test/gmock_link_test.cc
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan), vladl@google.com (Vlad Losev)
-
-// Google Mock - a framework for writing C++ mock classes.
-//
-// This file is for verifying that various Google Mock constructs do not
-// produce linker errors when instantiated in different translation units.
-// Please see gmock_link_test.h for details.
-
-#define LinkTest LinkTest1
-
-#include "test/gmock_link_test.h"
diff --git a/src/testing/test/gmock_link_test.h b/src/testing/test/gmock_link_test.h
deleted file mode 100644
index 1f55f5bd..00000000
--- a/src/testing/test/gmock_link_test.h
+++ /dev/null
@@ -1,669 +0,0 @@
-// Copyright 2009, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: vladl@google.com (Vlad Losev)
-
-// Google Mock - a framework for writing C++ mock classes.
-//
-// This file tests that:
-// a. A header file defining a mock class can be included in multiple
-// translation units without causing a link error.
-// b. Actions and matchers can be instantiated with identical template
-// arguments in different translation units without causing link
-// errors.
-// The following constructs are currently tested:
-// Actions:
-// Return()
-// Return(value)
-// ReturnNull
-// ReturnRef
-// Assign
-// SetArgPointee
-// SetArrayArgument
-// SetErrnoAndReturn
-// Invoke(function)
-// Invoke(object, method)
-// InvokeWithoutArgs(function)
-// InvokeWithoutArgs(object, method)
-// InvokeArgument
-// WithArg
-// WithArgs
-// WithoutArgs
-// DoAll
-// DoDefault
-// IgnoreResult
-// Throw
-// ACTION()-generated
-// ACTION_P()-generated
-// ACTION_P2()-generated
-// Matchers:
-// _
-// A
-// An
-// Eq
-// Gt, Lt, Ge, Le, Ne
-// NotNull
-// Ref
-// TypedEq
-// DoubleEq
-// FloatEq
-// NanSensitiveDoubleEq
-// NanSensitiveFloatEq
-// ContainsRegex
-// MatchesRegex
-// EndsWith
-// HasSubstr
-// StartsWith
-// StrCaseEq
-// StrCaseNe
-// StrEq
-// StrNe
-// ElementsAre
-// ElementsAreArray
-// ContainerEq
-// Field
-// Property
-// ResultOf(function)
-// Pointee
-// Truly(predicate)
-// AllOf
-// AnyOf
-// Not
-// MatcherCast<T>
-//
-// Please note: this test does not verify the functioning of these
-// constructs, only that the programs using them will link successfully.
-//
-// Implementation note:
-// This test requires identical definitions of Interface and Mock to be
-// included in different translation units. We achieve this by writing
-// them in this header and #including it in gmock_link_test.cc and
-// gmock_link2_test.cc. Because the symbols generated by the compiler for
-// those constructs must be identical in both translation units,
-// definitions of Interface and Mock tests MUST be kept in the SAME
-// NON-ANONYMOUS namespace in this file. The test fixture class LinkTest
-// is defined as LinkTest1 in gmock_link_test.cc and as LinkTest2 in
-// gmock_link2_test.cc to avoid producing linker errors.
-
-#ifndef GMOCK_TEST_GMOCK_LINK_TEST_H_
-#define GMOCK_TEST_GMOCK_LINK_TEST_H_
-
-#include "gmock/gmock.h"
-
-#if !GTEST_OS_WINDOWS_MOBILE
-# include <errno.h>
-#endif
-
-#include "gmock/internal/gmock-port.h"
-#include "gtest/gtest.h"
-#include <iostream>
-#include <vector>
-
-using testing::_;
-using testing::A;
-using testing::AllOf;
-using testing::AnyOf;
-using testing::Assign;
-using testing::ContainerEq;
-using testing::DoAll;
-using testing::DoDefault;
-using testing::DoubleEq;
-using testing::ElementsAre;
-using testing::ElementsAreArray;
-using testing::EndsWith;
-using testing::Eq;
-using testing::Field;
-using testing::FloatEq;
-using testing::Ge;
-using testing::Gt;
-using testing::HasSubstr;
-using testing::IgnoreResult;
-using testing::Invoke;
-using testing::InvokeArgument;
-using testing::InvokeWithoutArgs;
-using testing::IsNull;
-using testing::Le;
-using testing::Lt;
-using testing::Matcher;
-using testing::MatcherCast;
-using testing::NanSensitiveDoubleEq;
-using testing::NanSensitiveFloatEq;
-using testing::Ne;
-using testing::Not;
-using testing::NotNull;
-using testing::Pointee;
-using testing::Property;
-using testing::Ref;
-using testing::ResultOf;
-using testing::Return;
-using testing::ReturnNull;
-using testing::ReturnRef;
-using testing::SetArgPointee;
-using testing::SetArrayArgument;
-using testing::StartsWith;
-using testing::StrCaseEq;
-using testing::StrCaseNe;
-using testing::StrEq;
-using testing::StrNe;
-using testing::Truly;
-using testing::TypedEq;
-using testing::WithArg;
-using testing::WithArgs;
-using testing::WithoutArgs;
-
-#if !GTEST_OS_WINDOWS_MOBILE
-using testing::SetErrnoAndReturn;
-#endif
-
-#if GTEST_HAS_EXCEPTIONS
-using testing::Throw;
-#endif
-
-using testing::ContainsRegex;
-using testing::MatchesRegex;
-
-class Interface {
- public:
- virtual ~Interface() {}
- virtual void VoidFromString(char* str) = 0;
- virtual char* StringFromString(char* str) = 0;
- virtual int IntFromString(char* str) = 0;
- virtual int& IntRefFromString(char* str) = 0;
- virtual void VoidFromFunc(void(*func)(char* str)) = 0;
- virtual void VoidFromIntRef(int& n) = 0; // NOLINT
- virtual void VoidFromFloat(float n) = 0;
- virtual void VoidFromDouble(double n) = 0;
- virtual void VoidFromVector(const std::vector<int>& v) = 0;
-};
-
-class Mock: public Interface {
- public:
- Mock() {}
-
- MOCK_METHOD1(VoidFromString, void(char* str));
- MOCK_METHOD1(StringFromString, char*(char* str));
- MOCK_METHOD1(IntFromString, int(char* str));
- MOCK_METHOD1(IntRefFromString, int&(char* str));
- MOCK_METHOD1(VoidFromFunc, void(void(*func)(char* str)));
- MOCK_METHOD1(VoidFromIntRef, void(int& n)); // NOLINT
- MOCK_METHOD1(VoidFromFloat, void(float n));
- MOCK_METHOD1(VoidFromDouble, void(double n));
- MOCK_METHOD1(VoidFromVector, void(const std::vector<int>& v));
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(Mock);
-};
-
-class InvokeHelper {
- public:
- static void StaticVoidFromVoid() {}
- void VoidFromVoid() {}
- static void StaticVoidFromString(char* /* str */) {}
- void VoidFromString(char* /* str */) {}
- static int StaticIntFromString(char* /* str */) { return 1; }
- static bool StaticBoolFromString(const char* /* str */) { return true; }
-};
-
-class FieldHelper {
- public:
- explicit FieldHelper(int a_field) : field_(a_field) {}
- int field() const { return field_; }
- int field_; // NOLINT -- need external access to field_ to test
- // the Field matcher.
-};
-
-// Tests the linkage of the ReturnVoid action.
-TEST(LinkTest, TestReturnVoid) {
- Mock mock;
-
- EXPECT_CALL(mock, VoidFromString(_)).WillOnce(Return());
- mock.VoidFromString(NULL);
-}
-
-// Tests the linkage of the Return action.
-TEST(LinkTest, TestReturn) {
- Mock mock;
- char ch = 'x';
-
- EXPECT_CALL(mock, StringFromString(_)).WillOnce(Return(&ch));
- mock.StringFromString(NULL);
-}
-
-// Tests the linkage of the ReturnNull action.
-TEST(LinkTest, TestReturnNull) {
- Mock mock;
-
- EXPECT_CALL(mock, VoidFromString(_)).WillOnce(Return());
- mock.VoidFromString(NULL);
-}
-
-// Tests the linkage of the ReturnRef action.
-TEST(LinkTest, TestReturnRef) {
- Mock mock;
- int n = 42;
-
- EXPECT_CALL(mock, IntRefFromString(_)).WillOnce(ReturnRef(n));
- mock.IntRefFromString(NULL);
-}
-
-// Tests the linkage of the Assign action.
-TEST(LinkTest, TestAssign) {
- Mock mock;
- char ch = 'x';
-
- EXPECT_CALL(mock, VoidFromString(_)).WillOnce(Assign(&ch, 'y'));
- mock.VoidFromString(NULL);
-}
-
-// Tests the linkage of the SetArgPointee action.
-TEST(LinkTest, TestSetArgPointee) {
- Mock mock;
- char ch = 'x';
-
- EXPECT_CALL(mock, VoidFromString(_)).WillOnce(SetArgPointee<0>('y'));
- mock.VoidFromString(&ch);
-}
-
-// Tests the linkage of the SetArrayArgument action.
-TEST(LinkTest, TestSetArrayArgument) {
- Mock mock;
- char ch = 'x';
- char ch2 = 'y';
-
- EXPECT_CALL(mock, VoidFromString(_)).WillOnce(SetArrayArgument<0>(&ch2,
- &ch2 + 1));
- mock.VoidFromString(&ch);
-}
-
-#if !GTEST_OS_WINDOWS_MOBILE
-
-// Tests the linkage of the SetErrnoAndReturn action.
-TEST(LinkTest, TestSetErrnoAndReturn) {
- Mock mock;
-
- int saved_errno = errno;
- EXPECT_CALL(mock, IntFromString(_)).WillOnce(SetErrnoAndReturn(1, -1));
- mock.IntFromString(NULL);
- errno = saved_errno;
-}
-
-#endif // !GTEST_OS_WINDOWS_MOBILE
-
-// Tests the linkage of the Invoke(function) and Invoke(object, method) actions.
-TEST(LinkTest, TestInvoke) {
- Mock mock;
- InvokeHelper test_invoke_helper;
-
- EXPECT_CALL(mock, VoidFromString(_))
- .WillOnce(Invoke(&InvokeHelper::StaticVoidFromString))
- .WillOnce(Invoke(&test_invoke_helper, &InvokeHelper::VoidFromString));
- mock.VoidFromString(NULL);
- mock.VoidFromString(NULL);
-}
-
-// Tests the linkage of the InvokeWithoutArgs action.
-TEST(LinkTest, TestInvokeWithoutArgs) {
- Mock mock;
- InvokeHelper test_invoke_helper;
-
- EXPECT_CALL(mock, VoidFromString(_))
- .WillOnce(InvokeWithoutArgs(&InvokeHelper::StaticVoidFromVoid))
- .WillOnce(InvokeWithoutArgs(&test_invoke_helper,
- &InvokeHelper::VoidFromVoid));
- mock.VoidFromString(NULL);
- mock.VoidFromString(NULL);
-}
-
-// Tests the linkage of the InvokeArgument action.
-TEST(LinkTest, TestInvokeArgument) {
- Mock mock;
- char ch = 'x';
-
- EXPECT_CALL(mock, VoidFromFunc(_)).WillOnce(InvokeArgument<0>(&ch));
- mock.VoidFromFunc(InvokeHelper::StaticVoidFromString);
-}
-
-// Tests the linkage of the WithArg action.
-TEST(LinkTest, TestWithArg) {
- Mock mock;
-
- EXPECT_CALL(mock, VoidFromString(_))
- .WillOnce(WithArg<0>(Invoke(&InvokeHelper::StaticVoidFromString)));
- mock.VoidFromString(NULL);
-}
-
-// Tests the linkage of the WithArgs action.
-TEST(LinkTest, TestWithArgs) {
- Mock mock;
-
- EXPECT_CALL(mock, VoidFromString(_))
- .WillOnce(WithArgs<0>(Invoke(&InvokeHelper::StaticVoidFromString)));
- mock.VoidFromString(NULL);
-}
-
-// Tests the linkage of the WithoutArgs action.
-TEST(LinkTest, TestWithoutArgs) {
- Mock mock;
-
- EXPECT_CALL(mock, VoidFromString(_)).WillOnce(WithoutArgs(Return()));
- mock.VoidFromString(NULL);
-}
-
-// Tests the linkage of the DoAll action.
-TEST(LinkTest, TestDoAll) {
- Mock mock;
- char ch = 'x';
-
- EXPECT_CALL(mock, VoidFromString(_))
- .WillOnce(DoAll(SetArgPointee<0>('y'), Return()));
- mock.VoidFromString(&ch);
-}
-
-// Tests the linkage of the DoDefault action.
-TEST(LinkTest, TestDoDefault) {
- Mock mock;
- char ch = 'x';
-
- ON_CALL(mock, VoidFromString(_)).WillByDefault(Return());
- EXPECT_CALL(mock, VoidFromString(_)).WillOnce(DoDefault());
- mock.VoidFromString(&ch);
-}
-
-// Tests the linkage of the IgnoreResult action.
-TEST(LinkTest, TestIgnoreResult) {
- Mock mock;
-
- EXPECT_CALL(mock, VoidFromString(_)).WillOnce(IgnoreResult(Return(42)));
- mock.VoidFromString(NULL);
-}
-
-#if GTEST_HAS_EXCEPTIONS
-// Tests the linkage of the Throw action.
-TEST(LinkTest, TestThrow) {
- Mock mock;
-
- EXPECT_CALL(mock, VoidFromString(_)).WillOnce(Throw(42));
- EXPECT_THROW(mock.VoidFromString(NULL), int);
-}
-#endif // GTEST_HAS_EXCEPTIONS
-
-// The ACTION*() macros trigger warning C4100 (unreferenced formal
-// parameter) in MSVC with -W4. Unfortunately they cannot be fixed in
-// the macro definition, as the warnings are generated when the macro
-// is expanded and macro expansion cannot contain #pragma. Therefore
-// we suppress them here.
-#ifdef _MSC_VER
-# pragma warning(push)
-# pragma warning(disable:4100)
-#endif
-
-// Tests the linkage of actions created using ACTION macro.
-namespace {
-ACTION(Return1) { return 1; }
-}
-
-TEST(LinkTest, TestActionMacro) {
- Mock mock;
-
- EXPECT_CALL(mock, IntFromString(_)).WillOnce(Return1());
- mock.IntFromString(NULL);
-}
-
-// Tests the linkage of actions created using ACTION_P macro.
-namespace {
-ACTION_P(ReturnArgument, ret_value) { return ret_value; }
-}
-
-TEST(LinkTest, TestActionPMacro) {
- Mock mock;
-
- EXPECT_CALL(mock, IntFromString(_)).WillOnce(ReturnArgument(42));
- mock.IntFromString(NULL);
-}
-
-// Tests the linkage of actions created using ACTION_P2 macro.
-namespace {
-ACTION_P2(ReturnEqualsEitherOf, first, second) {
- return arg0 == first || arg0 == second;
-}
-}
-
-#ifdef _MSC_VER
-# pragma warning(pop)
-#endif
-
-TEST(LinkTest, TestActionP2Macro) {
- Mock mock;
- char ch = 'x';
-
- EXPECT_CALL(mock, IntFromString(_))
- .WillOnce(ReturnEqualsEitherOf("one", "two"));
- mock.IntFromString(&ch);
-}
-
-// Tests the linkage of the "_" matcher.
-TEST(LinkTest, TestMatcherAnything) {
- Mock mock;
-
- ON_CALL(mock, VoidFromString(_)).WillByDefault(Return());
-}
-
-// Tests the linkage of the A matcher.
-TEST(LinkTest, TestMatcherA) {
- Mock mock;
-
- ON_CALL(mock, VoidFromString(A<char*>())).WillByDefault(Return());
-}
-
-// Tests the linkage of the Eq and the "bare value" matcher.
-TEST(LinkTest, TestMatchersEq) {
- Mock mock;
- const char* p = "x";
-
- ON_CALL(mock, VoidFromString(Eq(p))).WillByDefault(Return());
- ON_CALL(mock, VoidFromString(const_cast<char*>("y")))
- .WillByDefault(Return());
-}
-
-// Tests the linkage of the Lt, Gt, Le, Ge, and Ne matchers.
-TEST(LinkTest, TestMatchersRelations) {
- Mock mock;
-
- ON_CALL(mock, VoidFromFloat(Lt(1.0f))).WillByDefault(Return());
- ON_CALL(mock, VoidFromFloat(Gt(1.0f))).WillByDefault(Return());
- ON_CALL(mock, VoidFromFloat(Le(1.0f))).WillByDefault(Return());
- ON_CALL(mock, VoidFromFloat(Ge(1.0f))).WillByDefault(Return());
- ON_CALL(mock, VoidFromFloat(Ne(1.0f))).WillByDefault(Return());
-}
-
-// Tests the linkage of the NotNull matcher.
-TEST(LinkTest, TestMatcherNotNull) {
- Mock mock;
-
- ON_CALL(mock, VoidFromString(NotNull())).WillByDefault(Return());
-}
-
-// Tests the linkage of the IsNull matcher.
-TEST(LinkTest, TestMatcherIsNull) {
- Mock mock;
-
- ON_CALL(mock, VoidFromString(IsNull())).WillByDefault(Return());
-}
-
-// Tests the linkage of the Ref matcher.
-TEST(LinkTest, TestMatcherRef) {
- Mock mock;
- int a = 0;
-
- ON_CALL(mock, VoidFromIntRef(Ref(a))).WillByDefault(Return());
-}
-
-// Tests the linkage of the TypedEq matcher.
-TEST(LinkTest, TestMatcherTypedEq) {
- Mock mock;
- long a = 0;
-
- ON_CALL(mock, VoidFromIntRef(TypedEq<int&>(a))).WillByDefault(Return());
-}
-
-// Tests the linkage of the FloatEq, DoubleEq, NanSensitiveFloatEq and
-// NanSensitiveDoubleEq matchers.
-TEST(LinkTest, TestMatchersFloatingPoint) {
- Mock mock;
- float a = 0;
-
- ON_CALL(mock, VoidFromFloat(FloatEq(a))).WillByDefault(Return());
- ON_CALL(mock, VoidFromDouble(DoubleEq(a))).WillByDefault(Return());
- ON_CALL(mock, VoidFromFloat(NanSensitiveFloatEq(a))).WillByDefault(Return());
- ON_CALL(mock, VoidFromDouble(NanSensitiveDoubleEq(a)))
- .WillByDefault(Return());
-}
-
-// Tests the linkage of the ContainsRegex matcher.
-TEST(LinkTest, TestMatcherContainsRegex) {
- Mock mock;
-
- ON_CALL(mock, VoidFromString(ContainsRegex(".*"))).WillByDefault(Return());
-}
-
-// Tests the linkage of the MatchesRegex matcher.
-TEST(LinkTest, TestMatcherMatchesRegex) {
- Mock mock;
-
- ON_CALL(mock, VoidFromString(MatchesRegex(".*"))).WillByDefault(Return());
-}
-
-// Tests the linkage of the StartsWith, EndsWith, and HasSubstr matchers.
-TEST(LinkTest, TestMatchersSubstrings) {
- Mock mock;
-
- ON_CALL(mock, VoidFromString(StartsWith("a"))).WillByDefault(Return());
- ON_CALL(mock, VoidFromString(EndsWith("c"))).WillByDefault(Return());
- ON_CALL(mock, VoidFromString(HasSubstr("b"))).WillByDefault(Return());
-}
-
-// Tests the linkage of the StrEq, StrNe, StrCaseEq, and StrCaseNe matchers.
-TEST(LinkTest, TestMatchersStringEquality) {
- Mock mock;
- ON_CALL(mock, VoidFromString(StrEq("a"))).WillByDefault(Return());
- ON_CALL(mock, VoidFromString(StrNe("a"))).WillByDefault(Return());
- ON_CALL(mock, VoidFromString(StrCaseEq("a"))).WillByDefault(Return());
- ON_CALL(mock, VoidFromString(StrCaseNe("a"))).WillByDefault(Return());
-}
-
-// Tests the linkage of the ElementsAre matcher.
-TEST(LinkTest, TestMatcherElementsAre) {
- Mock mock;
-
- ON_CALL(mock, VoidFromVector(ElementsAre('a', _))).WillByDefault(Return());
-}
-
-// Tests the linkage of the ElementsAreArray matcher.
-TEST(LinkTest, TestMatcherElementsAreArray) {
- Mock mock;
- char arr[] = { 'a', 'b' };
-
- ON_CALL(mock, VoidFromVector(ElementsAreArray(arr))).WillByDefault(Return());
-}
-
-// Tests the linkage of the ContainerEq matcher.
-TEST(LinkTest, TestMatcherContainerEq) {
- Mock mock;
- std::vector<int> v;
-
- ON_CALL(mock, VoidFromVector(ContainerEq(v))).WillByDefault(Return());
-}
-
-// Tests the linkage of the Field matcher.
-TEST(LinkTest, TestMatcherField) {
- FieldHelper helper(0);
-
- Matcher<const FieldHelper&> m = Field(&FieldHelper::field_, Eq(0));
- EXPECT_TRUE(m.Matches(helper));
-
- Matcher<const FieldHelper*> m2 = Field(&FieldHelper::field_, Eq(0));
- EXPECT_TRUE(m2.Matches(&helper));
-}
-
-// Tests the linkage of the Property matcher.
-TEST(LinkTest, TestMatcherProperty) {
- FieldHelper helper(0);
-
- Matcher<const FieldHelper&> m = Property(&FieldHelper::field, Eq(0));
- EXPECT_TRUE(m.Matches(helper));
-
- Matcher<const FieldHelper*> m2 = Property(&FieldHelper::field, Eq(0));
- EXPECT_TRUE(m2.Matches(&helper));
-}
-
-// Tests the linkage of the ResultOf matcher.
-TEST(LinkTest, TestMatcherResultOf) {
- Matcher<char*> m = ResultOf(&InvokeHelper::StaticIntFromString, Eq(1));
- EXPECT_TRUE(m.Matches(NULL));
-}
-
-// Tests the linkage of the ResultOf matcher.
-TEST(LinkTest, TestMatcherPointee) {
- int n = 1;
-
- Matcher<int*> m = Pointee(Eq(1));
- EXPECT_TRUE(m.Matches(&n));
-}
-
-// Tests the linkage of the Truly matcher.
-TEST(LinkTest, TestMatcherTruly) {
- Matcher<const char*> m = Truly(&InvokeHelper::StaticBoolFromString);
- EXPECT_TRUE(m.Matches(NULL));
-}
-
-// Tests the linkage of the AllOf matcher.
-TEST(LinkTest, TestMatcherAllOf) {
- Matcher<int> m = AllOf(_, Eq(1));
- EXPECT_TRUE(m.Matches(1));
-}
-
-// Tests the linkage of the AnyOf matcher.
-TEST(LinkTest, TestMatcherAnyOf) {
- Matcher<int> m = AnyOf(_, Eq(1));
- EXPECT_TRUE(m.Matches(1));
-}
-
-// Tests the linkage of the Not matcher.
-TEST(LinkTest, TestMatcherNot) {
- Matcher<int> m = Not(_);
- EXPECT_FALSE(m.Matches(1));
-}
-
-// Tests the linkage of the MatcherCast<T>() function.
-TEST(LinkTest, TestMatcherCast) {
- Matcher<const char*> m = MatcherCast<const char*>(_);
- EXPECT_TRUE(m.Matches(NULL));
-}
-
-#endif // GMOCK_TEST_GMOCK_LINK_TEST_H_
diff --git a/src/testing/test/gmock_output_test.py b/src/testing/test/gmock_output_test.py
deleted file mode 100755
index eced8a81..00000000
--- a/src/testing/test/gmock_output_test.py
+++ /dev/null
@@ -1,180 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2008, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-"""Tests the text output of Google C++ Mocking Framework.
-
-SYNOPSIS
- gmock_output_test.py --build_dir=BUILD/DIR --gengolden
- # where BUILD/DIR contains the built gmock_output_test_ file.
- gmock_output_test.py --gengolden
- gmock_output_test.py
-"""
-
-__author__ = 'wan@google.com (Zhanyong Wan)'
-
-import os
-import re
-import sys
-
-import gmock_test_utils
-
-
-# The flag for generating the golden file
-GENGOLDEN_FLAG = '--gengolden'
-
-PROGRAM_PATH = gmock_test_utils.GetTestExecutablePath('gmock_output_test_')
-COMMAND = [PROGRAM_PATH, '--gtest_stack_trace_depth=0', '--gtest_print_time=0']
-GOLDEN_NAME = 'gmock_output_test_golden.txt'
-GOLDEN_PATH = os.path.join(gmock_test_utils.GetSourceDir(), GOLDEN_NAME)
-
-
-def ToUnixLineEnding(s):
- """Changes all Windows/Mac line endings in s to UNIX line endings."""
-
- return s.replace('\r\n', '\n').replace('\r', '\n')
-
-
-def RemoveReportHeaderAndFooter(output):
- """Removes Google Test result report's header and footer from the output."""
-
- output = re.sub(r'.*gtest_main.*\n', '', output)
- output = re.sub(r'\[.*\d+ tests.*\n', '', output)
- output = re.sub(r'\[.* test environment .*\n', '', output)
- output = re.sub(r'\[=+\] \d+ tests .* ran.*', '', output)
- output = re.sub(r'.* FAILED TESTS\n', '', output)
- return output
-
-
-def RemoveLocations(output):
- """Removes all file location info from a Google Test program's output.
-
- Args:
- output: the output of a Google Test program.
-
- Returns:
- output with all file location info (in the form of
- 'DIRECTORY/FILE_NAME:LINE_NUMBER: 'or
- 'DIRECTORY\\FILE_NAME(LINE_NUMBER): ') replaced by
- 'FILE:#: '.
- """
-
- return re.sub(r'.*[/\\](.+)(\:\d+|\(\d+\))\:', 'FILE:#:', output)
-
-
-def NormalizeErrorMarker(output):
- """Normalizes the error marker, which is different on Windows vs on Linux."""
-
- return re.sub(r' error: ', ' Failure\n', output)
-
-
-def RemoveMemoryAddresses(output):
- """Removes memory addresses from the test output."""
-
- return re.sub(r'@\w+', '@0x#', output)
-
-
-def RemoveTestNamesOfLeakedMocks(output):
- """Removes the test names of leaked mock objects from the test output."""
-
- return re.sub(r'\(used in test .+\) ', '', output)
-
-
-def GetLeakyTests(output):
- """Returns a list of test names that leak mock objects."""
-
- # findall() returns a list of all matches of the regex in output.
- # For example, if '(used in test FooTest.Bar)' is in output, the
- # list will contain 'FooTest.Bar'.
- return re.findall(r'\(used in test (.+)\)', output)
-
-
-def GetNormalizedOutputAndLeakyTests(output):
- """Normalizes the output of gmock_output_test_.
-
- Args:
- output: The test output.
-
- Returns:
- A tuple (the normalized test output, the list of test names that have
- leaked mocks).
- """
-
- output = ToUnixLineEnding(output)
- output = RemoveReportHeaderAndFooter(output)
- output = NormalizeErrorMarker(output)
- output = RemoveLocations(output)
- output = RemoveMemoryAddresses(output)
- return (RemoveTestNamesOfLeakedMocks(output), GetLeakyTests(output))
-
-
-def GetShellCommandOutput(cmd):
- """Runs a command in a sub-process, and returns its STDOUT in a string."""
-
- return gmock_test_utils.Subprocess(cmd, capture_stderr=False).output
-
-
-def GetNormalizedCommandOutputAndLeakyTests(cmd):
- """Runs a command and returns its normalized output and a list of leaky tests.
-
- Args:
- cmd: the shell command.
- """
-
- # Disables exception pop-ups on Windows.
- os.environ['GTEST_CATCH_EXCEPTIONS'] = '1'
- return GetNormalizedOutputAndLeakyTests(GetShellCommandOutput(cmd))
-
-
-class GMockOutputTest(gmock_test_utils.TestCase):
- def testOutput(self):
- (output, leaky_tests) = GetNormalizedCommandOutputAndLeakyTests(COMMAND)
- golden_file = open(GOLDEN_PATH, 'rb')
- golden = golden_file.read()
- golden_file.close()
-
- # The normalized output should match the golden file.
- self.assertEquals(golden, output)
-
- # The raw output should contain 2 leaked mock object errors for
- # test GMockOutputTest.CatchesLeakedMocks.
- self.assertEquals(['GMockOutputTest.CatchesLeakedMocks',
- 'GMockOutputTest.CatchesLeakedMocks'],
- leaky_tests)
-
-
-if __name__ == '__main__':
- if sys.argv[1:] == [GENGOLDEN_FLAG]:
- (output, _) = GetNormalizedCommandOutputAndLeakyTests(COMMAND)
- golden_file = open(GOLDEN_PATH, 'wb')
- golden_file.write(output)
- golden_file.close()
- else:
- gmock_test_utils.Main()
diff --git a/src/testing/test/gmock_output_test_.cc b/src/testing/test/gmock_output_test_.cc
deleted file mode 100644
index c8e6b831..00000000
--- a/src/testing/test/gmock_output_test_.cc
+++ /dev/null
@@ -1,290 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-// Tests Google Mock's output in various scenarios. This ensures that
-// Google Mock's messages are readable and useful.
-
-#include "gmock/gmock.h"
-
-#include <stdio.h>
-#include <string>
-
-#include "gtest/gtest.h"
-
-using testing::_;
-using testing::AnyNumber;
-using testing::Ge;
-using testing::InSequence;
-using testing::Ref;
-using testing::Return;
-using testing::Sequence;
-
-class MockFoo {
- public:
- MockFoo() {}
-
- MOCK_METHOD3(Bar, char(const std::string& s, int i, double x));
- MOCK_METHOD2(Bar2, bool(int x, int y));
- MOCK_METHOD2(Bar3, void(int x, int y));
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFoo);
-};
-
-class GMockOutputTest : public testing::Test {
- protected:
- MockFoo foo_;
-};
-
-TEST_F(GMockOutputTest, ExpectedCall) {
- testing::GMOCK_FLAG(verbose) = "info";
-
- EXPECT_CALL(foo_, Bar2(0, _));
- foo_.Bar2(0, 0); // Expected call
-
- testing::GMOCK_FLAG(verbose) = "warning";
-}
-
-TEST_F(GMockOutputTest, ExpectedCallToVoidFunction) {
- testing::GMOCK_FLAG(verbose) = "info";
-
- EXPECT_CALL(foo_, Bar3(0, _));
- foo_.Bar3(0, 0); // Expected call
-
- testing::GMOCK_FLAG(verbose) = "warning";
-}
-
-TEST_F(GMockOutputTest, ExplicitActionsRunOut) {
- EXPECT_CALL(foo_, Bar2(_, _))
- .Times(2)
- .WillOnce(Return(false));
- foo_.Bar2(2, 2);
- foo_.Bar2(1, 1); // Explicit actions in EXPECT_CALL run out.
-}
-
-TEST_F(GMockOutputTest, UnexpectedCall) {
- EXPECT_CALL(foo_, Bar2(0, _));
-
- foo_.Bar2(1, 0); // Unexpected call
- foo_.Bar2(0, 0); // Expected call
-}
-
-TEST_F(GMockOutputTest, UnexpectedCallToVoidFunction) {
- EXPECT_CALL(foo_, Bar3(0, _));
-
- foo_.Bar3(1, 0); // Unexpected call
- foo_.Bar3(0, 0); // Expected call
-}
-
-TEST_F(GMockOutputTest, ExcessiveCall) {
- EXPECT_CALL(foo_, Bar2(0, _));
-
- foo_.Bar2(0, 0); // Expected call
- foo_.Bar2(0, 1); // Excessive call
-}
-
-TEST_F(GMockOutputTest, ExcessiveCallToVoidFunction) {
- EXPECT_CALL(foo_, Bar3(0, _));
-
- foo_.Bar3(0, 0); // Expected call
- foo_.Bar3(0, 1); // Excessive call
-}
-
-TEST_F(GMockOutputTest, UninterestingCall) {
- foo_.Bar2(0, 1); // Uninteresting call
-}
-
-TEST_F(GMockOutputTest, UninterestingCallToVoidFunction) {
- foo_.Bar3(0, 1); // Uninteresting call
-}
-
-TEST_F(GMockOutputTest, RetiredExpectation) {
- EXPECT_CALL(foo_, Bar2(_, _))
- .RetiresOnSaturation();
- EXPECT_CALL(foo_, Bar2(0, 0));
-
- foo_.Bar2(1, 1);
- foo_.Bar2(1, 1); // Matches a retired expectation
- foo_.Bar2(0, 0);
-}
-
-TEST_F(GMockOutputTest, UnsatisfiedPrerequisite) {
- {
- InSequence s;
- EXPECT_CALL(foo_, Bar(_, 0, _));
- EXPECT_CALL(foo_, Bar2(0, 0));
- EXPECT_CALL(foo_, Bar2(1, _));
- }
-
- foo_.Bar2(1, 0); // Has one immediate unsatisfied pre-requisite
- foo_.Bar("Hi", 0, 0);
- foo_.Bar2(0, 0);
- foo_.Bar2(1, 0);
-}
-
-TEST_F(GMockOutputTest, UnsatisfiedPrerequisites) {
- Sequence s1, s2;
-
- EXPECT_CALL(foo_, Bar(_, 0, _))
- .InSequence(s1);
- EXPECT_CALL(foo_, Bar2(0, 0))
- .InSequence(s2);
- EXPECT_CALL(foo_, Bar2(1, _))
- .InSequence(s1, s2);
-
- foo_.Bar2(1, 0); // Has two immediate unsatisfied pre-requisites
- foo_.Bar("Hi", 0, 0);
- foo_.Bar2(0, 0);
- foo_.Bar2(1, 0);
-}
-
-TEST_F(GMockOutputTest, UnsatisfiedWith) {
- EXPECT_CALL(foo_, Bar2(_, _)).With(Ge());
-}
-
-TEST_F(GMockOutputTest, UnsatisfiedExpectation) {
- EXPECT_CALL(foo_, Bar(_, _, _));
- EXPECT_CALL(foo_, Bar2(0, _))
- .Times(2);
-
- foo_.Bar2(0, 1);
-}
-
-TEST_F(GMockOutputTest, MismatchArguments) {
- const std::string s = "Hi";
- EXPECT_CALL(foo_, Bar(Ref(s), _, Ge(0)));
-
- foo_.Bar("Ho", 0, -0.1); // Mismatch arguments
- foo_.Bar(s, 0, 0);
-}
-
-TEST_F(GMockOutputTest, MismatchWith) {
- EXPECT_CALL(foo_, Bar2(Ge(2), Ge(1)))
- .With(Ge());
-
- foo_.Bar2(2, 3); // Mismatch With()
- foo_.Bar2(2, 1);
-}
-
-TEST_F(GMockOutputTest, MismatchArgumentsAndWith) {
- EXPECT_CALL(foo_, Bar2(Ge(2), Ge(1)))
- .With(Ge());
-
- foo_.Bar2(1, 3); // Mismatch arguments and mismatch With()
- foo_.Bar2(2, 1);
-}
-
-TEST_F(GMockOutputTest, UnexpectedCallWithDefaultAction) {
- ON_CALL(foo_, Bar2(_, _))
- .WillByDefault(Return(true)); // Default action #1
- ON_CALL(foo_, Bar2(1, _))
- .WillByDefault(Return(false)); // Default action #2
-
- EXPECT_CALL(foo_, Bar2(2, 2));
- foo_.Bar2(1, 0); // Unexpected call, takes default action #2.
- foo_.Bar2(0, 0); // Unexpected call, takes default action #1.
- foo_.Bar2(2, 2); // Expected call.
-}
-
-TEST_F(GMockOutputTest, ExcessiveCallWithDefaultAction) {
- ON_CALL(foo_, Bar2(_, _))
- .WillByDefault(Return(true)); // Default action #1
- ON_CALL(foo_, Bar2(1, _))
- .WillByDefault(Return(false)); // Default action #2
-
- EXPECT_CALL(foo_, Bar2(2, 2));
- EXPECT_CALL(foo_, Bar2(1, 1));
-
- foo_.Bar2(2, 2); // Expected call.
- foo_.Bar2(2, 2); // Excessive call, takes default action #1.
- foo_.Bar2(1, 1); // Expected call.
- foo_.Bar2(1, 1); // Excessive call, takes default action #2.
-}
-
-TEST_F(GMockOutputTest, UninterestingCallWithDefaultAction) {
- ON_CALL(foo_, Bar2(_, _))
- .WillByDefault(Return(true)); // Default action #1
- ON_CALL(foo_, Bar2(1, _))
- .WillByDefault(Return(false)); // Default action #2
-
- foo_.Bar2(2, 2); // Uninteresting call, takes default action #1.
- foo_.Bar2(1, 1); // Uninteresting call, takes default action #2.
-}
-
-TEST_F(GMockOutputTest, ExplicitActionsRunOutWithDefaultAction) {
- ON_CALL(foo_, Bar2(_, _))
- .WillByDefault(Return(true)); // Default action #1
-
- EXPECT_CALL(foo_, Bar2(_, _))
- .Times(2)
- .WillOnce(Return(false));
- foo_.Bar2(2, 2);
- foo_.Bar2(1, 1); // Explicit actions in EXPECT_CALL run out.
-}
-
-TEST_F(GMockOutputTest, CatchesLeakedMocks) {
- MockFoo* foo1 = new MockFoo;
- MockFoo* foo2 = new MockFoo;
-
- // Invokes ON_CALL on foo1.
- ON_CALL(*foo1, Bar(_, _, _)).WillByDefault(Return('a'));
-
- // Invokes EXPECT_CALL on foo2.
- EXPECT_CALL(*foo2, Bar2(_, _));
- EXPECT_CALL(*foo2, Bar2(1, _));
- EXPECT_CALL(*foo2, Bar3(_, _)).Times(AnyNumber());
- foo2->Bar2(2, 1);
- foo2->Bar2(1, 1);
-
- // Both foo1 and foo2 are deliberately leaked.
-}
-
-void TestCatchesLeakedMocksInAdHocTests() {
- MockFoo* foo = new MockFoo;
-
- // Invokes EXPECT_CALL on foo.
- EXPECT_CALL(*foo, Bar2(_, _));
- foo->Bar2(2, 1);
-
- // foo is deliberately leaked.
-}
-
-int main(int argc, char **argv) {
- testing::InitGoogleMock(&argc, argv);
-
- // Ensures that the tests pass no matter what value of
- // --gmock_catch_leaked_mocks and --gmock_verbose the user specifies.
- testing::GMOCK_FLAG(catch_leaked_mocks) = true;
- testing::GMOCK_FLAG(verbose) = "warning";
-
- TestCatchesLeakedMocksInAdHocTests();
- return RUN_ALL_TESTS();
-}
diff --git a/src/testing/test/gmock_output_test_golden.txt b/src/testing/test/gmock_output_test_golden.txt
deleted file mode 100644
index a7ff5630..00000000
--- a/src/testing/test/gmock_output_test_golden.txt
+++ /dev/null
@@ -1,310 +0,0 @@
-[ RUN ] GMockOutputTest.ExpectedCall
-
-FILE:#: EXPECT_CALL(foo_, Bar2(0, _)) invoked
-Stack trace:
-
-FILE:#: Mock function call matches EXPECT_CALL(foo_, Bar2(0, _))...
- Function call: Bar2(0, 0)
- Returns: false
-Stack trace:
-[ OK ] GMockOutputTest.ExpectedCall
-[ RUN ] GMockOutputTest.ExpectedCallToVoidFunction
-
-FILE:#: EXPECT_CALL(foo_, Bar3(0, _)) invoked
-Stack trace:
-
-FILE:#: Mock function call matches EXPECT_CALL(foo_, Bar3(0, _))...
- Function call: Bar3(0, 0)
-Stack trace:
-[ OK ] GMockOutputTest.ExpectedCallToVoidFunction
-[ RUN ] GMockOutputTest.ExplicitActionsRunOut
-
-GMOCK WARNING:
-FILE:#: Too few actions specified in EXPECT_CALL(foo_, Bar2(_, _))...
-Expected to be called twice, but has only 1 WillOnce().
-GMOCK WARNING:
-FILE:#: Actions ran out in EXPECT_CALL(foo_, Bar2(_, _))...
-Called 2 times, but only 1 WillOnce() is specified - returning default value.
-Stack trace:
-[ OK ] GMockOutputTest.ExplicitActionsRunOut
-[ RUN ] GMockOutputTest.UnexpectedCall
-unknown file: Failure
-
-Unexpected mock function call - returning default value.
- Function call: Bar2(1, 0)
- Returns: false
-Google Mock tried the following 1 expectation, but it didn't match:
-
-FILE:#: EXPECT_CALL(foo_, Bar2(0, _))...
- Expected arg #0: is equal to 0
- Actual: 1
- Expected: to be called once
- Actual: never called - unsatisfied and active
-[ FAILED ] GMockOutputTest.UnexpectedCall
-[ RUN ] GMockOutputTest.UnexpectedCallToVoidFunction
-unknown file: Failure
-
-Unexpected mock function call - returning directly.
- Function call: Bar3(1, 0)
-Google Mock tried the following 1 expectation, but it didn't match:
-
-FILE:#: EXPECT_CALL(foo_, Bar3(0, _))...
- Expected arg #0: is equal to 0
- Actual: 1
- Expected: to be called once
- Actual: never called - unsatisfied and active
-[ FAILED ] GMockOutputTest.UnexpectedCallToVoidFunction
-[ RUN ] GMockOutputTest.ExcessiveCall
-FILE:#: Failure
-Mock function called more times than expected - returning default value.
- Function call: Bar2(0, 1)
- Returns: false
- Expected: to be called once
- Actual: called twice - over-saturated and active
-[ FAILED ] GMockOutputTest.ExcessiveCall
-[ RUN ] GMockOutputTest.ExcessiveCallToVoidFunction
-FILE:#: Failure
-Mock function called more times than expected - returning directly.
- Function call: Bar3(0, 1)
- Expected: to be called once
- Actual: called twice - over-saturated and active
-[ FAILED ] GMockOutputTest.ExcessiveCallToVoidFunction
-[ RUN ] GMockOutputTest.UninterestingCall
-
-GMOCK WARNING:
-Uninteresting mock function call - returning default value.
- Function call: Bar2(0, 1)
- Returns: false
-Stack trace:
-[ OK ] GMockOutputTest.UninterestingCall
-[ RUN ] GMockOutputTest.UninterestingCallToVoidFunction
-
-GMOCK WARNING:
-Uninteresting mock function call - returning directly.
- Function call: Bar3(0, 1)
-Stack trace:
-[ OK ] GMockOutputTest.UninterestingCallToVoidFunction
-[ RUN ] GMockOutputTest.RetiredExpectation
-unknown file: Failure
-
-Unexpected mock function call - returning default value.
- Function call: Bar2(1, 1)
- Returns: false
-Google Mock tried the following 2 expectations, but none matched:
-
-FILE:#: tried expectation #0: EXPECT_CALL(foo_, Bar2(_, _))...
- Expected: the expectation is active
- Actual: it is retired
- Expected: to be called once
- Actual: called once - saturated and retired
-FILE:#: tried expectation #1: EXPECT_CALL(foo_, Bar2(0, 0))...
- Expected arg #0: is equal to 0
- Actual: 1
- Expected arg #1: is equal to 0
- Actual: 1
- Expected: to be called once
- Actual: never called - unsatisfied and active
-[ FAILED ] GMockOutputTest.RetiredExpectation
-[ RUN ] GMockOutputTest.UnsatisfiedPrerequisite
-unknown file: Failure
-
-Unexpected mock function call - returning default value.
- Function call: Bar2(1, 0)
- Returns: false
-Google Mock tried the following 2 expectations, but none matched:
-
-FILE:#: tried expectation #0: EXPECT_CALL(foo_, Bar2(0, 0))...
- Expected arg #0: is equal to 0
- Actual: 1
- Expected: to be called once
- Actual: never called - unsatisfied and active
-FILE:#: tried expectation #1: EXPECT_CALL(foo_, Bar2(1, _))...
- Expected: all pre-requisites are satisfied
- Actual: the following immediate pre-requisites are not satisfied:
-FILE:#: pre-requisite #0
- (end of pre-requisites)
- Expected: to be called once
- Actual: never called - unsatisfied and active
-[ FAILED ] GMockOutputTest.UnsatisfiedPrerequisite
-[ RUN ] GMockOutputTest.UnsatisfiedPrerequisites
-unknown file: Failure
-
-Unexpected mock function call - returning default value.
- Function call: Bar2(1, 0)
- Returns: false
-Google Mock tried the following 2 expectations, but none matched:
-
-FILE:#: tried expectation #0: EXPECT_CALL(foo_, Bar2(0, 0))...
- Expected arg #0: is equal to 0
- Actual: 1
- Expected: to be called once
- Actual: never called - unsatisfied and active
-FILE:#: tried expectation #1: EXPECT_CALL(foo_, Bar2(1, _))...
- Expected: all pre-requisites are satisfied
- Actual: the following immediate pre-requisites are not satisfied:
-FILE:#: pre-requisite #0
-FILE:#: pre-requisite #1
- (end of pre-requisites)
- Expected: to be called once
- Actual: never called - unsatisfied and active
-[ FAILED ] GMockOutputTest.UnsatisfiedPrerequisites
-[ RUN ] GMockOutputTest.UnsatisfiedWith
-FILE:#: Failure
-Actual function call count doesn't match EXPECT_CALL(foo_, Bar2(_, _))...
- Expected args: are a pair where the first >= the second
- Expected: to be called once
- Actual: never called - unsatisfied and active
-[ FAILED ] GMockOutputTest.UnsatisfiedWith
-[ RUN ] GMockOutputTest.UnsatisfiedExpectation
-FILE:#: Failure
-Actual function call count doesn't match EXPECT_CALL(foo_, Bar2(0, _))...
- Expected: to be called twice
- Actual: called once - unsatisfied and active
-FILE:#: Failure
-Actual function call count doesn't match EXPECT_CALL(foo_, Bar(_, _, _))...
- Expected: to be called once
- Actual: never called - unsatisfied and active
-[ FAILED ] GMockOutputTest.UnsatisfiedExpectation
-[ RUN ] GMockOutputTest.MismatchArguments
-unknown file: Failure
-
-Unexpected mock function call - returning default value.
- Function call: Bar(@0x# "Ho", 0, -0.1)
- Returns: '\0'
-Google Mock tried the following 1 expectation, but it didn't match:
-
-FILE:#: EXPECT_CALL(foo_, Bar(Ref(s), _, Ge(0)))...
- Expected arg #0: references the variable @0x# "Hi"
- Actual: "Ho", which is located @0x#
- Expected arg #2: is >= 0
- Actual: -0.1
- Expected: to be called once
- Actual: never called - unsatisfied and active
-[ FAILED ] GMockOutputTest.MismatchArguments
-[ RUN ] GMockOutputTest.MismatchWith
-unknown file: Failure
-
-Unexpected mock function call - returning default value.
- Function call: Bar2(2, 3)
- Returns: false
-Google Mock tried the following 1 expectation, but it didn't match:
-
-FILE:#: EXPECT_CALL(foo_, Bar2(Ge(2), Ge(1)))...
- Expected args: are a pair where the first >= the second
- Actual: don't match
- Expected: to be called once
- Actual: never called - unsatisfied and active
-[ FAILED ] GMockOutputTest.MismatchWith
-[ RUN ] GMockOutputTest.MismatchArgumentsAndWith
-unknown file: Failure
-
-Unexpected mock function call - returning default value.
- Function call: Bar2(1, 3)
- Returns: false
-Google Mock tried the following 1 expectation, but it didn't match:
-
-FILE:#: EXPECT_CALL(foo_, Bar2(Ge(2), Ge(1)))...
- Expected arg #0: is >= 2
- Actual: 1
- Expected args: are a pair where the first >= the second
- Actual: don't match
- Expected: to be called once
- Actual: never called - unsatisfied and active
-[ FAILED ] GMockOutputTest.MismatchArgumentsAndWith
-[ RUN ] GMockOutputTest.UnexpectedCallWithDefaultAction
-unknown file: Failure
-
-Unexpected mock function call - taking default action specified at:
-FILE:#:
- Function call: Bar2(1, 0)
- Returns: false
-Google Mock tried the following 1 expectation, but it didn't match:
-
-FILE:#: EXPECT_CALL(foo_, Bar2(2, 2))...
- Expected arg #0: is equal to 2
- Actual: 1
- Expected arg #1: is equal to 2
- Actual: 0
- Expected: to be called once
- Actual: never called - unsatisfied and active
-unknown file: Failure
-
-Unexpected mock function call - taking default action specified at:
-FILE:#:
- Function call: Bar2(0, 0)
- Returns: true
-Google Mock tried the following 1 expectation, but it didn't match:
-
-FILE:#: EXPECT_CALL(foo_, Bar2(2, 2))...
- Expected arg #0: is equal to 2
- Actual: 0
- Expected arg #1: is equal to 2
- Actual: 0
- Expected: to be called once
- Actual: never called - unsatisfied and active
-[ FAILED ] GMockOutputTest.UnexpectedCallWithDefaultAction
-[ RUN ] GMockOutputTest.ExcessiveCallWithDefaultAction
-FILE:#: Failure
-Mock function called more times than expected - taking default action specified at:
-FILE:#:
- Function call: Bar2(2, 2)
- Returns: true
- Expected: to be called once
- Actual: called twice - over-saturated and active
-FILE:#: Failure
-Mock function called more times than expected - taking default action specified at:
-FILE:#:
- Function call: Bar2(1, 1)
- Returns: false
- Expected: to be called once
- Actual: called twice - over-saturated and active
-[ FAILED ] GMockOutputTest.ExcessiveCallWithDefaultAction
-[ RUN ] GMockOutputTest.UninterestingCallWithDefaultAction
-
-GMOCK WARNING:
-Uninteresting mock function call - taking default action specified at:
-FILE:#:
- Function call: Bar2(2, 2)
- Returns: true
-Stack trace:
-
-GMOCK WARNING:
-Uninteresting mock function call - taking default action specified at:
-FILE:#:
- Function call: Bar2(1, 1)
- Returns: false
-Stack trace:
-[ OK ] GMockOutputTest.UninterestingCallWithDefaultAction
-[ RUN ] GMockOutputTest.ExplicitActionsRunOutWithDefaultAction
-
-GMOCK WARNING:
-FILE:#: Too few actions specified in EXPECT_CALL(foo_, Bar2(_, _))...
-Expected to be called twice, but has only 1 WillOnce().
-GMOCK WARNING:
-FILE:#: Actions ran out in EXPECT_CALL(foo_, Bar2(_, _))...
-Called 2 times, but only 1 WillOnce() is specified - taking default action specified at:
-FILE:#:
-Stack trace:
-[ OK ] GMockOutputTest.ExplicitActionsRunOutWithDefaultAction
-[ RUN ] GMockOutputTest.CatchesLeakedMocks
-[ OK ] GMockOutputTest.CatchesLeakedMocks
-[ FAILED ] GMockOutputTest.UnexpectedCall
-[ FAILED ] GMockOutputTest.UnexpectedCallToVoidFunction
-[ FAILED ] GMockOutputTest.ExcessiveCall
-[ FAILED ] GMockOutputTest.ExcessiveCallToVoidFunction
-[ FAILED ] GMockOutputTest.RetiredExpectation
-[ FAILED ] GMockOutputTest.UnsatisfiedPrerequisite
-[ FAILED ] GMockOutputTest.UnsatisfiedPrerequisites
-[ FAILED ] GMockOutputTest.UnsatisfiedWith
-[ FAILED ] GMockOutputTest.UnsatisfiedExpectation
-[ FAILED ] GMockOutputTest.MismatchArguments
-[ FAILED ] GMockOutputTest.MismatchWith
-[ FAILED ] GMockOutputTest.MismatchArgumentsAndWith
-[ FAILED ] GMockOutputTest.UnexpectedCallWithDefaultAction
-[ FAILED ] GMockOutputTest.ExcessiveCallWithDefaultAction
-
-
-FILE:#: ERROR: this mock object should be deleted but never is. Its address is @0x#.
-FILE:#: ERROR: this mock object should be deleted but never is. Its address is @0x#.
-FILE:#: ERROR: this mock object should be deleted but never is. Its address is @0x#.
-ERROR: 3 leaked mock objects found at program exit.
diff --git a/src/testing/test/gmock_stress_test.cc b/src/testing/test/gmock_stress_test.cc
deleted file mode 100644
index 0e97aeed..00000000
--- a/src/testing/test/gmock_stress_test.cc
+++ /dev/null
@@ -1,322 +0,0 @@
-// Copyright 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-// Tests that Google Mock constructs can be used in a large number of
-// threads concurrently.
-
-#include "gmock/gmock.h"
-#include "gtest/gtest.h"
-
-namespace testing {
-namespace {
-
-// From <gtest/internal/gtest-port.h>.
-using ::testing::internal::ThreadWithParam;
-
-// The maximum number of test threads (not including helper threads)
-// to create.
-const int kMaxTestThreads = 50;
-
-// How many times to repeat a task in a test thread.
-const int kRepeat = 50;
-
-class MockFoo {
- public:
- MOCK_METHOD1(Bar, int(int n)); // NOLINT
- MOCK_METHOD2(Baz, char(const char* s1, const internal::string& s2)); // NOLINT
-};
-
-// Helper for waiting for the given thread to finish and then deleting it.
-template <typename T>
-void JoinAndDelete(ThreadWithParam<T>* t) {
- t->Join();
- delete t;
-}
-
-using internal::linked_ptr;
-
-// Helper classes for testing using linked_ptr concurrently.
-
-class Base {
- public:
- explicit Base(int a_x) : x_(a_x) {}
- virtual ~Base() {}
- int x() const { return x_; }
- private:
- int x_;
-};
-
-class Derived1 : public Base {
- public:
- Derived1(int a_x, int a_y) : Base(a_x), y_(a_y) {}
- int y() const { return y_; }
- private:
- int y_;
-};
-
-class Derived2 : public Base {
- public:
- Derived2(int a_x, int a_z) : Base(a_x), z_(a_z) {}
- int z() const { return z_; }
- private:
- int z_;
-};
-
-linked_ptr<Derived1> pointer1(new Derived1(1, 2));
-linked_ptr<Derived2> pointer2(new Derived2(3, 4));
-
-struct Dummy {};
-
-// Tests that we can copy from a linked_ptr and read it concurrently.
-void TestConcurrentCopyAndReadLinkedPtr(Dummy /* dummy */) {
- // Reads pointer1 and pointer2 while they are being copied from in
- // another thread.
- EXPECT_EQ(1, pointer1->x());
- EXPECT_EQ(2, pointer1->y());
- EXPECT_EQ(3, pointer2->x());
- EXPECT_EQ(4, pointer2->z());
-
- // Copies from pointer1.
- linked_ptr<Derived1> p1(pointer1);
- EXPECT_EQ(1, p1->x());
- EXPECT_EQ(2, p1->y());
-
- // Assigns from pointer2 where the LHS was empty.
- linked_ptr<Base> p2;
- p2 = pointer1;
- EXPECT_EQ(1, p2->x());
-
- // Assigns from pointer2 where the LHS was not empty.
- p2 = pointer2;
- EXPECT_EQ(3, p2->x());
-}
-
-const linked_ptr<Derived1> p0(new Derived1(1, 2));
-
-// Tests that we can concurrently modify two linked_ptrs that point to
-// the same object.
-void TestConcurrentWriteToEqualLinkedPtr(Dummy /* dummy */) {
- // p1 and p2 point to the same, shared thing. One thread resets p1.
- // Another thread assigns to p2. This will cause the same
- // underlying "ring" to be updated concurrently.
- linked_ptr<Derived1> p1(p0);
- linked_ptr<Derived1> p2(p0);
-
- EXPECT_EQ(1, p1->x());
- EXPECT_EQ(2, p1->y());
-
- EXPECT_EQ(1, p2->x());
- EXPECT_EQ(2, p2->y());
-
- p1.reset();
- p2 = p0;
-
- EXPECT_EQ(1, p2->x());
- EXPECT_EQ(2, p2->y());
-}
-
-// Tests that different mock objects can be used in their respective
-// threads. This should generate no Google Test failure.
-void TestConcurrentMockObjects(Dummy /* dummy */) {
- // Creates a mock and does some typical operations on it.
- MockFoo foo;
- ON_CALL(foo, Bar(_))
- .WillByDefault(Return(1));
- ON_CALL(foo, Baz(_, _))
- .WillByDefault(Return('b'));
- ON_CALL(foo, Baz(_, "you"))
- .WillByDefault(Return('a'));
-
- EXPECT_CALL(foo, Bar(0))
- .Times(AtMost(3));
- EXPECT_CALL(foo, Baz(_, _));
- EXPECT_CALL(foo, Baz("hi", "you"))
- .WillOnce(Return('z'))
- .WillRepeatedly(DoDefault());
-
- EXPECT_EQ(1, foo.Bar(0));
- EXPECT_EQ(1, foo.Bar(0));
- EXPECT_EQ('z', foo.Baz("hi", "you"));
- EXPECT_EQ('a', foo.Baz("hi", "you"));
- EXPECT_EQ('b', foo.Baz("hi", "me"));
-}
-
-// Tests invoking methods of the same mock object in multiple threads.
-
-struct Helper1Param {
- MockFoo* mock_foo;
- int* count;
-};
-
-void Helper1(Helper1Param param) {
- for (int i = 0; i < kRepeat; i++) {
- const char ch = param.mock_foo->Baz("a", "b");
- if (ch == 'a') {
- // It was an expected call.
- (*param.count)++;
- } else {
- // It was an excessive call.
- EXPECT_EQ('\0', ch);
- }
-
- // An unexpected call.
- EXPECT_EQ('\0', param.mock_foo->Baz("x", "y")) << "Expected failure.";
-
- // An uninteresting call.
- EXPECT_EQ(1, param.mock_foo->Bar(5));
- }
-}
-
-// This should generate 3*kRepeat + 1 failures in total.
-void TestConcurrentCallsOnSameObject(Dummy /* dummy */) {
- MockFoo foo;
-
- ON_CALL(foo, Bar(_))
- .WillByDefault(Return(1));
- EXPECT_CALL(foo, Baz(_, "b"))
- .Times(kRepeat)
- .WillRepeatedly(Return('a'));
- EXPECT_CALL(foo, Baz(_, "c")); // Expected to be unsatisfied.
-
- // This chunk of code should generate kRepeat failures about
- // excessive calls, and 2*kRepeat failures about unexpected calls.
- int count1 = 0;
- const Helper1Param param = { &foo, &count1 };
- ThreadWithParam<Helper1Param>* const t =
- new ThreadWithParam<Helper1Param>(Helper1, param, NULL);
-
- int count2 = 0;
- const Helper1Param param2 = { &foo, &count2 };
- Helper1(param2);
- JoinAndDelete(t);
-
- EXPECT_EQ(kRepeat, count1 + count2);
-
- // foo's destructor should generate one failure about unsatisfied
- // expectation.
-}
-
-// Tests using the same mock object in multiple threads when the
-// expectations are partially ordered.
-
-void Helper2(MockFoo* foo) {
- for (int i = 0; i < kRepeat; i++) {
- foo->Bar(2);
- foo->Bar(3);
- }
-}
-
-// This should generate no Google Test failures.
-void TestPartiallyOrderedExpectationsWithThreads(Dummy /* dummy */) {
- MockFoo foo;
- Sequence s1, s2;
-
- {
- InSequence dummy;
- EXPECT_CALL(foo, Bar(0));
- EXPECT_CALL(foo, Bar(1))
- .InSequence(s1, s2);
- }
-
- EXPECT_CALL(foo, Bar(2))
- .Times(2*kRepeat)
- .InSequence(s1)
- .RetiresOnSaturation();
- EXPECT_CALL(foo, Bar(3))
- .Times(2*kRepeat)
- .InSequence(s2);
-
- {
- InSequence dummy;
- EXPECT_CALL(foo, Bar(2))
- .InSequence(s1, s2);
- EXPECT_CALL(foo, Bar(4));
- }
-
- foo.Bar(0);
- foo.Bar(1);
-
- ThreadWithParam<MockFoo*>* const t =
- new ThreadWithParam<MockFoo*>(Helper2, &foo, NULL);
- Helper2(&foo);
- JoinAndDelete(t);
-
- foo.Bar(2);
- foo.Bar(4);
-}
-
-// Tests using Google Mock constructs in many threads concurrently.
-TEST(StressTest, CanUseGMockWithThreads) {
- void (*test_routines[])(Dummy dummy) = {
- &TestConcurrentCopyAndReadLinkedPtr,
- &TestConcurrentWriteToEqualLinkedPtr,
- &TestConcurrentMockObjects,
- &TestConcurrentCallsOnSameObject,
- &TestPartiallyOrderedExpectationsWithThreads,
- };
-
- const int kRoutines = sizeof(test_routines)/sizeof(test_routines[0]);
- const int kCopiesOfEachRoutine = kMaxTestThreads / kRoutines;
- const int kTestThreads = kCopiesOfEachRoutine * kRoutines;
- ThreadWithParam<Dummy>* threads[kTestThreads] = {};
- for (int i = 0; i < kTestThreads; i++) {
- // Creates a thread to run the test function.
- threads[i] =
- new ThreadWithParam<Dummy>(test_routines[i % kRoutines], Dummy(), NULL);
- GTEST_LOG_(INFO) << "Thread #" << i << " running . . .";
- }
-
- // At this point, we have many threads running.
- for (int i = 0; i < kTestThreads; i++) {
- JoinAndDelete(threads[i]);
- }
-
- // Ensures that the correct number of failures have been reported.
- const TestInfo* const info = UnitTest::GetInstance()->current_test_info();
- const TestResult& result = *info->result();
- const int kExpectedFailures = (3*kRepeat + 1)*kCopiesOfEachRoutine;
- GTEST_CHECK_(kExpectedFailures == result.total_part_count())
- << "Expected " << kExpectedFailures << " failures, but got "
- << result.total_part_count();
-}
-
-} // namespace
-} // namespace testing
-
-int main(int argc, char **argv) {
- testing::InitGoogleMock(&argc, argv);
-
- const int exit_code = RUN_ALL_TESTS(); // Expected to fail.
- GTEST_CHECK_(exit_code != 0) << "RUN_ALL_TESTS() did not fail as expected";
-
- printf("\nPASS\n");
- return 0;
-}
diff --git a/src/testing/test/gmock_test.cc b/src/testing/test/gmock_test.cc
deleted file mode 100644
index 0b891137..00000000
--- a/src/testing/test/gmock_test.cc
+++ /dev/null
@@ -1,255 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-// Google Mock - a framework for writing C++ mock classes.
-//
-// This file tests code in gmock.cc.
-
-#include "gmock/gmock.h"
-
-#include <string>
-#include "gtest/gtest.h"
-
-using testing::GMOCK_FLAG(verbose);
-using testing::InitGoogleMock;
-using testing::internal::g_init_gtest_count;
-
-// Verifies that calling InitGoogleMock() on argv results in new_argv,
-// and the gmock_verbose flag's value is set to expected_gmock_verbose.
-template <typename Char, int M, int N>
-void TestInitGoogleMock(const Char* (&argv)[M], const Char* (&new_argv)[N],
- const ::std::string& expected_gmock_verbose) {
- const ::std::string old_verbose = GMOCK_FLAG(verbose);
-
- int argc = M;
- InitGoogleMock(&argc, const_cast<Char**>(argv));
- ASSERT_EQ(N, argc) << "The new argv has wrong number of elements.";
-
- for (int i = 0; i < N; i++) {
- EXPECT_STREQ(new_argv[i], argv[i]);
- }
-
- EXPECT_EQ(expected_gmock_verbose, GMOCK_FLAG(verbose).c_str());
- GMOCK_FLAG(verbose) = old_verbose; // Restores the gmock_verbose flag.
-}
-
-TEST(InitGoogleMockTest, ParsesInvalidCommandLine) {
- const char* argv[] = {
- NULL
- };
-
- const char* new_argv[] = {
- NULL
- };
-
- TestInitGoogleMock(argv, new_argv, GMOCK_FLAG(verbose));
-}
-
-TEST(InitGoogleMockTest, ParsesEmptyCommandLine) {
- const char* argv[] = {
- "foo.exe",
- NULL
- };
-
- const char* new_argv[] = {
- "foo.exe",
- NULL
- };
-
- TestInitGoogleMock(argv, new_argv, GMOCK_FLAG(verbose));
-}
-
-TEST(InitGoogleMockTest, ParsesSingleFlag) {
- const char* argv[] = {
- "foo.exe",
- "--gmock_verbose=info",
- NULL
- };
-
- const char* new_argv[] = {
- "foo.exe",
- NULL
- };
-
- TestInitGoogleMock(argv, new_argv, "info");
-}
-
-TEST(InitGoogleMockTest, ParsesUnrecognizedFlag) {
- const char* argv[] = {
- "foo.exe",
- "--non_gmock_flag=blah",
- NULL
- };
-
- const char* new_argv[] = {
- "foo.exe",
- "--non_gmock_flag=blah",
- NULL
- };
-
- TestInitGoogleMock(argv, new_argv, GMOCK_FLAG(verbose));
-}
-
-TEST(InitGoogleMockTest, ParsesGoogleMockFlagAndUnrecognizedFlag) {
- const char* argv[] = {
- "foo.exe",
- "--non_gmock_flag=blah",
- "--gmock_verbose=error",
- NULL
- };
-
- const char* new_argv[] = {
- "foo.exe",
- "--non_gmock_flag=blah",
- NULL
- };
-
- TestInitGoogleMock(argv, new_argv, "error");
-}
-
-TEST(InitGoogleMockTest, CallsInitGoogleTest) {
- const int old_init_gtest_count = g_init_gtest_count;
- const char* argv[] = {
- "foo.exe",
- "--non_gmock_flag=blah",
- "--gmock_verbose=error",
- NULL
- };
-
- const char* new_argv[] = {
- "foo.exe",
- "--non_gmock_flag=blah",
- NULL
- };
-
- TestInitGoogleMock(argv, new_argv, "error");
- EXPECT_EQ(old_init_gtest_count + 1, g_init_gtest_count);
-}
-
-TEST(WideInitGoogleMockTest, ParsesInvalidCommandLine) {
- const wchar_t* argv[] = {
- NULL
- };
-
- const wchar_t* new_argv[] = {
- NULL
- };
-
- TestInitGoogleMock(argv, new_argv, GMOCK_FLAG(verbose));
-}
-
-TEST(WideInitGoogleMockTest, ParsesEmptyCommandLine) {
- const wchar_t* argv[] = {
- L"foo.exe",
- NULL
- };
-
- const wchar_t* new_argv[] = {
- L"foo.exe",
- NULL
- };
-
- TestInitGoogleMock(argv, new_argv, GMOCK_FLAG(verbose));
-}
-
-TEST(WideInitGoogleMockTest, ParsesSingleFlag) {
- const wchar_t* argv[] = {
- L"foo.exe",
- L"--gmock_verbose=info",
- NULL
- };
-
- const wchar_t* new_argv[] = {
- L"foo.exe",
- NULL
- };
-
- TestInitGoogleMock(argv, new_argv, "info");
-}
-
-TEST(WideInitGoogleMockTest, ParsesUnrecognizedFlag) {
- const wchar_t* argv[] = {
- L"foo.exe",
- L"--non_gmock_flag=blah",
- NULL
- };
-
- const wchar_t* new_argv[] = {
- L"foo.exe",
- L"--non_gmock_flag=blah",
- NULL
- };
-
- TestInitGoogleMock(argv, new_argv, GMOCK_FLAG(verbose));
-}
-
-TEST(WideInitGoogleMockTest, ParsesGoogleMockFlagAndUnrecognizedFlag) {
- const wchar_t* argv[] = {
- L"foo.exe",
- L"--non_gmock_flag=blah",
- L"--gmock_verbose=error",
- NULL
- };
-
- const wchar_t* new_argv[] = {
- L"foo.exe",
- L"--non_gmock_flag=blah",
- NULL
- };
-
- TestInitGoogleMock(argv, new_argv, "error");
-}
-
-TEST(WideInitGoogleMockTest, CallsInitGoogleTest) {
- const int old_init_gtest_count = g_init_gtest_count;
- const wchar_t* argv[] = {
- L"foo.exe",
- L"--non_gmock_flag=blah",
- L"--gmock_verbose=error",
- NULL
- };
-
- const wchar_t* new_argv[] = {
- L"foo.exe",
- L"--non_gmock_flag=blah",
- NULL
- };
-
- TestInitGoogleMock(argv, new_argv, "error");
- EXPECT_EQ(old_init_gtest_count + 1, g_init_gtest_count);
-}
-
-// Makes sure Google Mock flags can be accessed in code.
-TEST(FlagTest, IsAccessibleInCode) {
- bool dummy = testing::GMOCK_FLAG(catch_leaked_mocks) &&
- testing::GMOCK_FLAG(verbose) == "";
- (void)dummy; // Avoids the "unused local variable" warning.
-}
diff --git a/src/testing/test/gmock_test_utils.py b/src/testing/test/gmock_test_utils.py
deleted file mode 100755
index ac3d67ae..00000000
--- a/src/testing/test/gmock_test_utils.py
+++ /dev/null
@@ -1,111 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2006, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-"""Unit test utilities for Google C++ Mocking Framework."""
-
-__author__ = 'wan@google.com (Zhanyong Wan)'
-
-import os
-import sys
-
-
-# Determines path to gtest_test_utils and imports it.
-SCRIPT_DIR = os.path.dirname(__file__) or '.'
-
-# isdir resolves symbolic links.
-gtest_tests_util_dir = os.path.join(SCRIPT_DIR, '../gtest/test')
-if os.path.isdir(gtest_tests_util_dir):
- GTEST_TESTS_UTIL_DIR = gtest_tests_util_dir
-else:
- GTEST_TESTS_UTIL_DIR = os.path.join(SCRIPT_DIR, '../../gtest/test')
-
-sys.path.append(GTEST_TESTS_UTIL_DIR)
-import gtest_test_utils # pylint: disable-msg=C6204
-
-
-def GetSourceDir():
- """Returns the absolute path of the directory where the .py files are."""
-
- return gtest_test_utils.GetSourceDir()
-
-
-def GetTestExecutablePath(executable_name):
- """Returns the absolute path of the test binary given its name.
-
- The function will print a message and abort the program if the resulting file
- doesn't exist.
-
- Args:
- executable_name: name of the test binary that the test script runs.
-
- Returns:
- The absolute path of the test binary.
- """
-
- return gtest_test_utils.GetTestExecutablePath(executable_name)
-
-
-def GetExitStatus(exit_code):
- """Returns the argument to exit(), or -1 if exit() wasn't called.
-
- Args:
- exit_code: the result value of os.system(command).
- """
-
- if os.name == 'nt':
- # On Windows, os.WEXITSTATUS() doesn't work and os.system() returns
- # the argument to exit() directly.
- return exit_code
- else:
- # On Unix, os.WEXITSTATUS() must be used to extract the exit status
- # from the result of os.system().
- if os.WIFEXITED(exit_code):
- return os.WEXITSTATUS(exit_code)
- else:
- return -1
-
-
-# Suppresses the "Invalid const name" lint complaint
-# pylint: disable-msg=C6409
-
-# Exposes Subprocess from gtest_test_utils.
-Subprocess = gtest_test_utils.Subprocess
-
-# Exposes TestCase from gtest_test_utils.
-TestCase = gtest_test_utils.TestCase
-
-# pylint: enable-msg=C6409
-
-
-def Main():
- """Runs the unit test."""
-
- gtest_test_utils.Main()
diff --git a/src/third_party/curl/curlbuild.h b/src/third_party/curl/curlbuild.h
index b0a53e6c..595df4e4 100644
--- a/src/third_party/curl/curlbuild.h
+++ b/src/third_party/curl/curlbuild.h
@@ -155,7 +155,8 @@
/* The size of `long', as computed by sizeof. */
#if defined(_M_X64) || (defined(__x86_64__) && !defined(__ILP32__)) || \
- defined(__aarch64__) || (defined(__mips__) && _MIPS_SIM == _ABI64)
+ defined(__aarch64__) || (defined(__mips__) && _MIPS_SIM == _ABI64) || \
+ defined(__powerpc64__) || defined(__s390x__) || defined(__LP64__)
#define CURL_SIZEOF_LONG 8
#else
#define CURL_SIZEOF_LONG 4
diff --git a/src/third_party/libdisasm/LICENSE b/src/third_party/libdisasm/LICENSE
new file mode 100644
index 00000000..c5638285
--- /dev/null
+++ b/src/third_party/libdisasm/LICENSE
@@ -0,0 +1,137 @@
+
+
+
+
+ The "Clarified Artistic License"
+
+ Preamble
+
+The intent of this document is to state the conditions under which a
+Package may be copied, such that the Copyright Holder maintains some
+semblance of artistic control over the development of the package,
+while giving the users of the package the right to use and distribute
+the Package in a more-or-less customary fashion, plus the right to make
+reasonable modifications.
+
+Definitions:
+
+ "Package" refers to the collection of files distributed by the
+ Copyright Holder, and derivatives of that collection of files
+ created through textual modification.
+
+ "Standard Version" refers to such a Package if it has not been
+ modified, or has been modified in accordance with the wishes
+ of the Copyright Holder as specified below.
+
+ "Copyright Holder" is whoever is named in the copyright or
+ copyrights for the package.
+
+ "You" is you, if you're thinking about copying or distributing
+ this Package.
+
+ "Distribution fee" is a fee you charge for providing a copy of this
+ Package to another party.
+
+ "Freely Available" means that no fee is charged for the right to use
+ the item, though there may be fees involved in handling the item.
+
+1. You may make and give away verbatim copies of the source form of the
+Standard Version of this Package without restriction, provided that you
+duplicate all of the original copyright notices and associated disclaimers.
+
+2. You may apply bug fixes, portability fixes and other modifications
+derived from the Public Domain, or those made Freely Available, or from
+the Copyright Holder. A Package modified in such a way shall still be
+considered the Standard Version.
+
+3. You may otherwise modify your copy of this Package in any way, provided
+that you insert a prominent notice in each changed file stating how and
+when you changed that file, and provided that you do at least ONE of the
+following:
+
+ a) place your modifications in the Public Domain or otherwise make them
+ Freely Available, such as by posting said modifications to Usenet or
+ an equivalent medium, or placing the modifications on a major archive
+ site allowing unrestricted access to them, or by allowing the Copyright
+ Holder to include your modifications in the Standard Version of the
+ Package.
+
+ b) use the modified Package only within your corporation or organization.
+
+ c) rename any non-standard executables so the names do not conflict
+ with standard executables, which must also be provided, and provide
+ a separate manual page for each non-standard executable that clearly
+ documents how it differs from the Standard Version.
+
+ d) make other distribution arrangements with the Copyright Holder.
+
+ e) permit and encourge anyone who receives a copy of the modified Package
+ permission to make your modifications Freely Available in some specific
+ way.
+
+4. You may distribute the programs of this Package in object code or
+executable form, provided that you do at least ONE of the following:
+
+ a) distribute a Standard Version of the executables and library files,
+ together with instructions (in the manual page or equivalent) on where
+ to get the Standard Version.
+
+ b) accompany the distribution with the machine-readable source of
+ the Package with your modifications.
+
+ c) give non-standard executables non-standard names, and clearly
+ document the differences in manual pages (or equivalent), together
+ with instructions on where to get the Standard Version.
+
+ d) make other distribution arrangements with the Copyright Holder.
+
+ e) offer the machine-readable source of the Package, with your
+ modifications, by mail order.
+
+5. You may charge a distribution fee for any distribution of this Package.
+If you offer support for this Package, you may charge any fee you choose
+for that support. You may not charge a license fee for the right to use
+this Package itself. You may distribute this Package in aggregate with
+other (possibly commercial and possibly nonfree) programs as part of a
+larger (possibly commercial and possibly nonfree) software distribution,
+and charge license fees for other parts of that software distribution,
+provided that you do not advertise this Package as a product of your own.
+If the Package includes an interpreter, You may embed this Package's
+interpreter within an executable of yours (by linking); this shall be
+construed as a mere form of aggregation, provided that the complete
+Standard Version of the interpreter is so embedded.
+
+6. The scripts and library files supplied as input to or produced as
+output from the programs of this Package do not automatically fall
+under the copyright of this Package, but belong to whoever generated
+them, and may be sold commercially, and may be aggregated with this
+Package. If such scripts or library files are aggregated with this
+Package via the so-called "undump" or "unexec" methods of producing a
+binary executable image, then distribution of such an image shall
+neither be construed as a distribution of this Package nor shall it
+fall under the restrictions of Paragraphs 3 and 4, provided that you do
+not represent such an executable image as a Standard Version of this
+Package.
+
+7. C subroutines (or comparably compiled subroutines in other
+languages) supplied by you and linked into this Package in order to
+emulate subroutines and variables of the language defined by this
+Package shall not be considered part of this Package, but are the
+equivalent of input as in Paragraph 6, provided these subroutines do
+not change the language in any way that would cause it to fail the
+regression tests for the language.
+
+8. Aggregation of the Standard Version of the Package with a commercial
+distribution is always permitted provided that the use of this Package is
+embedded; that is, when no overt attempt is made to make this Package's
+interfaces visible to the end user of the commercial distribution.
+Such use shall not be construed as a distribution of this Package.
+
+9. The name of the Copyright Holder may not be used to endorse or promote
+products derived from this software without specific prior written permission.
+
+10. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+
+ The End
diff --git a/src/third_party/libdisasm/README.breakpad b/src/third_party/libdisasm/README.breakpad
new file mode 100644
index 00000000..a3454114
--- /dev/null
+++ b/src/third_party/libdisasm/README.breakpad
@@ -0,0 +1,9 @@
+Name: libdisasm
+URL: https://sourceforge.net/projects/bastard/files/libdisasm/0.23/libdisasm-0.23.tar.gz/download
+Version: 0.23
+License: Clarified-Artistic
+License File: LICENSE
+
+Description:
+This contains a copy of libdisasm. It is no longer under development upstream,
+so we keep a copy here to maintain fixes ourselves.
diff --git a/src/third_party/libdisasm/libdis.h b/src/third_party/libdisasm/libdis.h
index 94103396..83a88612 100644
--- a/src/third_party/libdisasm/libdis.h
+++ b/src/third_party/libdisasm/libdis.h
@@ -1,10 +1,6 @@
#ifndef LIBDISASM_H
#define LIBDISASM_H
-#ifdef WIN32
-#include <windows.h>
-#endif
-
#include <stdint.h>
/* 'NEW" types
diff --git a/src/third_party/libdisasm/libdisasm.gyp b/src/third_party/libdisasm/libdisasm.gyp
index c48ac824..5c8dc458 100644
--- a/src/third_party/libdisasm/libdisasm.gyp
+++ b/src/third_party/libdisasm/libdisasm.gyp
@@ -27,6 +27,9 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
{
+ 'includes': [
+ '../../build/common.gypi',
+ ],
'targets': [
{
'target_name': 'libdisasm',
diff --git a/src/third_party/libdisasm/x86_disasm.c b/src/third_party/libdisasm/x86_disasm.c
index 51a213a4..1b82f4e6 100644
--- a/src/third_party/libdisasm/x86_disasm.c
+++ b/src/third_party/libdisasm/x86_disasm.c
@@ -35,7 +35,7 @@ unsigned int x86_disasm( unsigned char *buf, unsigned int buf_len,
if ( offset >= buf_len ) {
/* another caller screwup ;) */
- x86_report_error(report_disasm_bounds, (void*)(long)buf_rva+offset);
+ x86_report_error(report_disasm_bounds, (void*)(long)(buf_rva+offset));
return 0;
}
@@ -53,13 +53,13 @@ unsigned int x86_disasm( unsigned char *buf, unsigned int buf_len,
/* check and see if we had an invalid instruction */
if (! size ) {
- x86_report_error(report_invalid_insn, (void*)(long)buf_rva+offset );
+ x86_report_error(report_invalid_insn, (void*)(long)(buf_rva+offset));
return 0;
}
/* check if we overran the end of the buffer */
if ( size > len ) {
- x86_report_error( report_insn_bounds, (void*)(long)buf_rva + offset );
+ x86_report_error( report_insn_bounds, (void*)(long)(buf_rva + offset));
MAKE_INVALID( insn, bytes );
return 0;
}
diff --git a/src/third_party/linux/include/gflags/gflags.h b/src/third_party/linux/include/gflags/gflags.h
deleted file mode 100644
index 08a3b637..00000000
--- a/src/third_party/linux/include/gflags/gflags.h
+++ /dev/null
@@ -1,533 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// ---
-// Author: Ray Sidney
-// Revamped and reorganized by Craig Silverstein
-//
-// This is the file that should be included by any file which declares
-// or defines a command line flag or wants to parse command line flags
-// or print a program usage message (which will include information about
-// flags). Executive summary, in the form of an example foo.cc file:
-//
-// #include "foo.h" // foo.h has a line "DECLARE_int32(start);"
-//
-// DEFINE_int32(end, 1000, "The last record to read");
-// DECLARE_bool(verbose); // some other file has a DEFINE_bool(verbose, ...)
-//
-// void MyFunc() {
-// if (FLAGS_verbose) printf("Records %d-%d\n", FLAGS_start, FLAGS_end);
-// }
-//
-// Then, at the command-line:
-// ./foo --noverbose --start=5 --end=100
-//
-// For more details, see
-// doc/gflags.html
-//
-// --- A note about thread-safety:
-//
-// We describe many functions in this routine as being thread-hostile,
-// thread-compatible, or thread-safe. Here are the meanings we use:
-//
-// thread-safe: it is safe for multiple threads to call this routine
-// (or, when referring to a class, methods of this class)
-// concurrently.
-// thread-hostile: it is not safe for multiple threads to call this
-// routine (or methods of this class) concurrently. In gflags,
-// most thread-hostile routines are intended to be called early in,
-// or even before, main() -- that is, before threads are spawned.
-// thread-compatible: it is safe for multiple threads to read from
-// this variable (when applied to variables), or to call const
-// methods of this class (when applied to classes), as long as no
-// other thread is writing to the variable or calling non-const
-// methods of this class.
-
-#ifndef GOOGLE_GFLAGS_H_
-#define GOOGLE_GFLAGS_H_
-
-#include <string>
-#include <vector>
-
-// We care a lot about number of bits things take up. Unfortunately,
-// systems define their bit-specific ints in a lot of different ways.
-// We use our own way, and have a typedef to get there.
-// Note: these commands below may look like "#if 1" or "#if 0", but
-// that's because they were constructed that way at ./configure time.
-// Look at gflags.h.in to see how they're calculated (based on your config).
-#if 1
-#include <stdint.h> // the normal place uint16_t is defined
-#endif
-#if 1
-#include <sys/types.h> // the normal place u_int16_t is defined
-#endif
-#if 1
-#include <inttypes.h> // a third place for uint16_t or u_int16_t
-#endif
-
-namespace google {
-
-#if 1 // the C99 format
-typedef int32_t int32;
-typedef uint32_t uint32;
-typedef int64_t int64;
-typedef uint64_t uint64;
-#elif 1 // the BSD format
-typedef int32_t int32;
-typedef u_int32_t uint32;
-typedef int64_t int64;
-typedef u_int64_t uint64;
-#elif 0 // the windows (vc7) format
-typedef __int32 int32;
-typedef unsigned __int32 uint32;
-typedef __int64 int64;
-typedef unsigned __int64 uint64;
-#else
-#error Do not know how to define a 32-bit integer quantity on your system
-#endif
-
-// --------------------------------------------------------------------
-// To actually define a flag in a file, use DEFINE_bool,
-// DEFINE_string, etc. at the bottom of this file. You may also find
-// it useful to register a validator with the flag. This ensures that
-// when the flag is parsed from the commandline, or is later set via
-// SetCommandLineOption, we call the validation function.
-//
-// The validation function should return true if the flag value is valid, and
-// false otherwise. If the function returns false for the new setting of the
-// flag, the flag will retain its current value. If it returns false for the
-// default value, InitGoogle will die.
-//
-// This function is safe to call at global construct time (as in the
-// example below).
-//
-// Example use:
-// static bool ValidatePort(const char* flagname, int32 value) {
-// if (value > 0 && value < 32768) // value is ok
-// return true;
-// printf("Invalid value for --%s: %d\n", flagname, (int)value);
-// return false;
-// }
-// DEFINE_int32(port, 0, "What port to listen on");
-// static bool dummy = RegisterFlagValidator(&FLAGS_port, &ValidatePort);
-
-// Returns true if successfully registered, false if not (because the
-// first argument doesn't point to a command-line flag, or because a
-// validator is already registered for this flag).
-bool RegisterFlagValidator(const bool* flag,
- bool (*validate_fn)(const char*, bool));
-bool RegisterFlagValidator(const int32* flag,
- bool (*validate_fn)(const char*, int32));
-bool RegisterFlagValidator(const int64* flag,
- bool (*validate_fn)(const char*, int64));
-bool RegisterFlagValidator(const uint64* flag,
- bool (*validate_fn)(const char*, uint64));
-bool RegisterFlagValidator(const double* flag,
- bool (*validate_fn)(const char*, double));
-bool RegisterFlagValidator(const std::string* flag,
- bool (*validate_fn)(const char*, const std::string&));
-
-
-// --------------------------------------------------------------------
-// These methods are the best way to get access to info about the
-// list of commandline flags. Note that these routines are pretty slow.
-// GetAllFlags: mostly-complete info about the list, sorted by file.
-// ShowUsageWithFlags: pretty-prints the list to stdout (what --help does)
-// ShowUsageWithFlagsRestrict: limit to filenames with restrict as a substr
-//
-// In addition to accessing flags, you can also access argv[0] (the program
-// name) and argv (the entire commandline), which we sock away a copy of.
-// These variables are static, so you should only set them once.
-
-struct CommandLineFlagInfo {
- std::string name; // the name of the flag
- std::string type; // the type of the flag: int32, etc
- std::string description; // the "help text" associated with the flag
- std::string current_value; // the current value, as a string
- std::string default_value; // the default value, as a string
- std::string filename; // 'cleaned' version of filename holding the flag
- bool has_validator_fn; // true if RegisterFlagValidator called on flag
- bool is_default; // true if the flag has default value
-};
-
-extern void GetAllFlags(std::vector<CommandLineFlagInfo>* OUTPUT);
-// These two are actually defined in commandlineflags_reporting.cc.
-extern void ShowUsageWithFlags(const char *argv0); // what --help does
-extern void ShowUsageWithFlagsRestrict(const char *argv0, const char *restrict);
-
-// Create a descriptive string for a flag.
-// Goes to some trouble to make pretty line breaks.
-extern std::string DescribeOneFlag(const CommandLineFlagInfo& flag);
-
-// Thread-hostile; meant to be called before any threads are spawned.
-extern void SetArgv(int argc, const char** argv);
-// The following functions are thread-safe as long as SetArgv() is
-// only called before any threads start.
-extern const std::vector<std::string>& GetArgvs(); // all of argv as a vector
-extern const char* GetArgv(); // all of argv as a string
-extern const char* GetArgv0(); // only argv0
-extern uint32 GetArgvSum(); // simple checksum of argv
-extern const char* ProgramInvocationName(); // argv0, or "UNKNOWN" if not set
-extern const char* ProgramInvocationShortName(); // basename(argv0)
-// ProgramUsage() is thread-safe as long as SetUsageMessage() is only
-// called before any threads start.
-extern const char* ProgramUsage(); // string set by SetUsageMessage()
-
-
-// --------------------------------------------------------------------
-// Normally you access commandline flags by just saying "if (FLAGS_foo)"
-// or whatever, and set them by calling "FLAGS_foo = bar" (or, more
-// commonly, via the DEFINE_foo macro). But if you need a bit more
-// control, we have programmatic ways to get/set the flags as well.
-// These programmatic ways to access flags are thread-safe, but direct
-// access is only thread-compatible.
-
-// Return true iff the flagname was found.
-// OUTPUT is set to the flag's value, or unchanged if we return false.
-extern bool GetCommandLineOption(const char* name, std::string* OUTPUT);
-
-// Return true iff the flagname was found. OUTPUT is set to the flag's
-// CommandLineFlagInfo or unchanged if we return false.
-extern bool GetCommandLineFlagInfo(const char* name,
- CommandLineFlagInfo* OUTPUT);
-
-// Return the CommandLineFlagInfo of the flagname. exit() if name not found.
-// Example usage, to check if a flag's value is currently the default value:
-// if (GetCommandLineFlagInfoOrDie("foo").is_default) ...
-extern CommandLineFlagInfo GetCommandLineFlagInfoOrDie(const char* name);
-
-enum FlagSettingMode {
- // update the flag's value (can call this multiple times).
- SET_FLAGS_VALUE,
- // update the flag's value, but *only if* it has not yet been updated
- // with SET_FLAGS_VALUE, SET_FLAG_IF_DEFAULT, or "FLAGS_xxx = nondef".
- SET_FLAG_IF_DEFAULT,
- // set the flag's default value to this. If the flag has not yet updated
- // yet (via SET_FLAGS_VALUE, SET_FLAG_IF_DEFAULT, or "FLAGS_xxx = nondef")
- // change the flag's current value to the new default value as well.
- SET_FLAGS_DEFAULT
-};
-
-// Set a particular flag ("command line option"). Returns a string
-// describing the new value that the option has been set to. The
-// return value API is not well-specified, so basically just depend on
-// it to be empty if the setting failed for some reason -- the name is
-// not a valid flag name, or the value is not a valid value -- and
-// non-empty else.
-
-// SetCommandLineOption uses set_mode == SET_FLAGS_VALUE (the common case)
-extern std::string SetCommandLineOption(const char* name, const char* value);
-extern std::string SetCommandLineOptionWithMode(const char* name, const char* value,
- FlagSettingMode set_mode);
-
-
-// --------------------------------------------------------------------
-// Saves the states (value, default value, whether the user has set
-// the flag, registered validators, etc) of all flags, and restores
-// them when the FlagSaver is destroyed. This is very useful in
-// tests, say, when you want to let your tests change the flags, but
-// make sure that they get reverted to the original states when your
-// test is complete.
-//
-// Example usage:
-// void TestFoo() {
-// FlagSaver s1;
-// FLAG_foo = false;
-// FLAG_bar = "some value";
-//
-// // test happens here. You can return at any time
-// // without worrying about restoring the FLAG values.
-// }
-//
-// Note: This class is marked with __attribute__((unused)) because all the
-// work is done in the constructor and destructor, so in the standard
-// usage example above, the compiler would complain that it's an
-// unused variable.
-//
-// This class is thread-safe.
-
-class FlagSaver {
- public:
- FlagSaver();
- ~FlagSaver();
-
- private:
- class FlagSaverImpl* impl_; // we use pimpl here to keep API steady
-
- FlagSaver(const FlagSaver&); // no copying!
- void operator=(const FlagSaver&);
-} __attribute__ ((unused));
-
-// --------------------------------------------------------------------
-// Some deprecated or hopefully-soon-to-be-deprecated functions.
-
-// This is often used for logging. TODO(csilvers): figure out a better way
-extern std::string CommandlineFlagsIntoString();
-// Usually where this is used, a FlagSaver should be used instead.
-extern bool ReadFlagsFromString(const std::string& flagfilecontents,
- const char* prog_name,
- bool errors_are_fatal); // uses SET_FLAGS_VALUE
-
-// These let you manually implement --flagfile functionality.
-// DEPRECATED.
-extern bool AppendFlagsIntoFile(const std::string& filename, const char* prog_name);
-extern bool SaveCommandFlags(); // actually defined in google.cc !
-extern bool ReadFromFlagsFile(const std::string& filename, const char* prog_name,
- bool errors_are_fatal); // uses SET_FLAGS_VALUE
-
-
-// --------------------------------------------------------------------
-// Useful routines for initializing flags from the environment.
-// In each case, if 'varname' does not exist in the environment
-// return defval. If 'varname' does exist but is not valid
-// (e.g., not a number for an int32 flag), abort with an error.
-// Otherwise, return the value. NOTE: for booleans, for true use
-// 't' or 'T' or 'true' or '1', for false 'f' or 'F' or 'false' or '0'.
-
-extern bool BoolFromEnv(const char *varname, bool defval);
-extern int32 Int32FromEnv(const char *varname, int32 defval);
-extern int64 Int64FromEnv(const char *varname, int64 defval);
-extern uint64 Uint64FromEnv(const char *varname, uint64 defval);
-extern double DoubleFromEnv(const char *varname, double defval);
-extern const char *StringFromEnv(const char *varname, const char *defval);
-
-
-// --------------------------------------------------------------------
-// The next two functions parse commandlineflags from main():
-
-// Set the "usage" message for this program. For example:
-// string usage("This program does nothing. Sample usage:\n");
-// usage += argv[0] + " <uselessarg1> <uselessarg2>";
-// SetUsageMessage(usage);
-// Do not include commandline flags in the usage: we do that for you!
-// Thread-hostile; meant to be called before any threads are spawned.
-extern void SetUsageMessage(const std::string& usage);
-
-// Looks for flags in argv and parses them. Rearranges argv to put
-// flags first, or removes them entirely if remove_flags is true.
-// If a flag is defined more than once in the command line or flag
-// file, the last definition is used.
-// See top-of-file for more details on this function.
-#ifndef SWIG // In swig, use ParseCommandLineFlagsScript() instead.
-extern uint32 ParseCommandLineFlags(int *argc, char*** argv,
- bool remove_flags);
-#endif
-
-
-// Calls to ParseCommandLineNonHelpFlags and then to
-// HandleCommandLineHelpFlags can be used instead of a call to
-// ParseCommandLineFlags during initialization, in order to allow for
-// changing default values for some FLAGS (via
-// e.g. SetCommandLineOptionWithMode calls) between the time of
-// command line parsing and the time of dumping help information for
-// the flags as a result of command line parsing.
-// If a flag is defined more than once in the command line or flag
-// file, the last definition is used.
-extern uint32 ParseCommandLineNonHelpFlags(int *argc, char*** argv,
- bool remove_flags);
-// This is actually defined in commandlineflags_reporting.cc.
-// This function is misnamed (it also handles --version, etc.), but
-// it's too late to change that now. :-(
-extern void HandleCommandLineHelpFlags(); // in commandlineflags_reporting.cc
-
-// Allow command line reparsing. Disables the error normally
-// generated when an unknown flag is found, since it may be found in a
-// later parse. Thread-hostile; meant to be called before any threads
-// are spawned.
-extern void AllowCommandLineReparsing();
-
-// Reparse the flags that have not yet been recognized.
-// Only flags registered since the last parse will be recognized.
-// Any flag value must be provided as part of the argument using "=",
-// not as a separate command line argument that follows the flag argument.
-// Intended for handling flags from dynamically loaded libraries,
-// since their flags are not registered until they are loaded.
-extern uint32 ReparseCommandLineNonHelpFlags();
-
-
-// --------------------------------------------------------------------
-// Now come the command line flag declaration/definition macros that
-// will actually be used. They're kind of hairy. A major reason
-// for this is initialization: we want people to be able to access
-// variables in global constructors and have that not crash, even if
-// their global constructor runs before the global constructor here.
-// (Obviously, we can't guarantee the flags will have the correct
-// default value in that case, but at least accessing them is safe.)
-// The only way to do that is have flags point to a static buffer.
-// So we make one, using a union to ensure proper alignment, and
-// then use placement-new to actually set up the flag with the
-// correct default value. In the same vein, we have to worry about
-// flag access in global destructors, so FlagRegisterer has to be
-// careful never to destroy the flag-values it constructs.
-//
-// Note that when we define a flag variable FLAGS_<name>, we also
-// preemptively define a junk variable, FLAGS_no<name>. This is to
-// cause a link-time error if someone tries to define 2 flags with
-// names like "logging" and "nologging". We do this because a bool
-// flag FLAG can be set from the command line to true with a "-FLAG"
-// argument, and to false with a "-noFLAG" argument, and so this can
-// potentially avert confusion.
-//
-// We also put flags into their own namespace. It is purposefully
-// named in an opaque way that people should have trouble typing
-// directly. The idea is that DEFINE puts the flag in the weird
-// namespace, and DECLARE imports the flag from there into the current
-// namespace. The net result is to force people to use DECLARE to get
-// access to a flag, rather than saying "extern bool FLAGS_whatever;"
-// or some such instead. We want this so we can put extra
-// functionality (like sanity-checking) in DECLARE if we want, and
-// make sure it is picked up everywhere.
-//
-// We also put the type of the variable in the namespace, so that
-// people can't DECLARE_int32 something that they DEFINE_bool'd
-// elsewhere.
-
-class FlagRegisterer {
- public:
- FlagRegisterer(const char* name, const char* type,
- const char* help, const char* filename,
- void* current_storage, void* defvalue_storage);
-};
-
-extern bool FlagsTypeWarn(const char *name);
-
-// If your application #defines STRIP_FLAG_HELP to a non-zero value
-// before #including this file, we remove the help message from the
-// binary file. This can reduce the size of the resulting binary
-// somewhat, and may also be useful for security reasons.
-
-extern const char kStrippedFlagHelp[];
-
-}
-
-#ifndef SWIG // In swig, ignore the main flag declarations
-
-#if defined(STRIP_FLAG_HELP) && STRIP_FLAG_HELP > 0
-// Need this construct to avoid the 'defined but not used' warning.
-#define MAYBE_STRIPPED_HELP(txt) (false ? (txt) : kStrippedFlagHelp)
-#else
-#define MAYBE_STRIPPED_HELP(txt) txt
-#endif
-
-// Each command-line flag has two variables associated with it: one
-// with the current value, and one with the default value. However,
-// we have a third variable, which is where value is assigned; it's a
-// constant. This guarantees that FLAG_##value is initialized at
-// static initialization time (e.g. before program-start) rather than
-// than global construction time (which is after program-start but
-// before main), at least when 'value' is a compile-time constant. We
-// use a small trick for the "default value" variable, and call it
-// FLAGS_no<name>. This serves the second purpose of assuring a
-// compile error if someone tries to define a flag named no<name>
-// which is illegal (--foo and --nofoo both affect the "foo" flag).
-#define DEFINE_VARIABLE(type, shorttype, name, value, help) \
- namespace fL##shorttype { \
- static const type FLAGS_nono##name = value; \
- type FLAGS_##name = FLAGS_nono##name; \
- type FLAGS_no##name = FLAGS_nono##name; \
- static ::google::FlagRegisterer o_##name( \
- #name, #type, MAYBE_STRIPPED_HELP(help), __FILE__, \
- &FLAGS_##name, &FLAGS_no##name); \
- } \
- using fL##shorttype::FLAGS_##name
-
-#define DECLARE_VARIABLE(type, shorttype, name) \
- namespace fL##shorttype { \
- extern type FLAGS_##name; \
- } \
- using fL##shorttype::FLAGS_##name
-
-// For DEFINE_bool, we want to do the extra check that the passed-in
-// value is actually a bool, and not a string or something that can be
-// coerced to a bool. These declarations (no definition needed!) will
-// help us do that, and never evaluate From, which is important.
-// We'll use 'sizeof(IsBool(val))' to distinguish. This code requires
-// that the compiler have different sizes for bool & double. Since
-// this is not guaranteed by the standard, we check it with a
-// compile-time assert (msg[-1] will give a compile-time error).
-namespace fLB {
-struct CompileAssert {};
-typedef CompileAssert expected_sizeof_double_neq_sizeof_bool[
- (sizeof(double) != sizeof(bool)) ? 1 : -1];
-template<typename From> double IsBoolFlag(const From& from);
-bool IsBoolFlag(bool from);
-} // namespace fLB
-
-#define DECLARE_bool(name) DECLARE_VARIABLE(bool,B, name)
-#define DEFINE_bool(name,val,txt) \
- namespace fLB { \
- typedef CompileAssert FLAG_##name##_value_is_not_a_bool[ \
- (sizeof(::fLB::IsBoolFlag(val)) != sizeof(double)) ? 1 : -1]; \
- } \
- DEFINE_VARIABLE(bool,B, name, val, txt)
-
-#define DECLARE_int32(name) DECLARE_VARIABLE(::google::int32,I, name)
-#define DEFINE_int32(name,val,txt) DEFINE_VARIABLE(::google::int32,I, name, val, txt)
-
-#define DECLARE_int64(name) DECLARE_VARIABLE(::google::int64,I64, name)
-#define DEFINE_int64(name,val,txt) DEFINE_VARIABLE(::google::int64,I64, name, val, txt)
-
-#define DECLARE_uint64(name) DECLARE_VARIABLE(::google::uint64,U64, name)
-#define DEFINE_uint64(name,val,txt) DEFINE_VARIABLE(::google::uint64,U64, name, val, txt)
-
-#define DECLARE_double(name) DECLARE_VARIABLE(double,D, name)
-#define DEFINE_double(name,val,txt) DEFINE_VARIABLE(double,D, name, val, txt)
-
-// Strings are trickier, because they're not a POD, so we can't
-// construct them at static-initialization time (instead they get
-// constructed at global-constructor time, which is much later). To
-// try to avoid crashes in that case, we use a char buffer to store
-// the string, which we can static-initialize, and then placement-new
-// into it later. It's not perfect, but the best we can do.
-#define DECLARE_string(name) namespace fLS { extern std::string& FLAGS_##name; } \
- using fLS::FLAGS_##name
-
-// We need to define a var named FLAGS_no##name so people don't define
-// --string and --nostring. And we need a temporary place to put val
-// so we don't have to evaluate it twice. Two great needs that go
-// great together!
-// The weird 'using' + 'extern' inside the fLS namespace is to work around
-// an unknown compiler bug/issue with the gcc 4.2.1 on SUSE 10. See
-// http://code.google.com/p/google-gflags/issues/detail?id=20
-#define DEFINE_string(name, val, txt) \
- namespace fLS { \
- static union { void* align; char s[sizeof(std::string)]; } s_##name[2]; \
- const std::string* const FLAGS_no##name = new (s_##name[0].s) std::string(val); \
- static ::google::FlagRegisterer o_##name( \
- #name, "string", MAYBE_STRIPPED_HELP(txt), __FILE__, \
- s_##name[0].s, new (s_##name[1].s) std::string(*FLAGS_no##name)); \
- extern std::string& FLAGS_##name; \
- using fLS::FLAGS_##name; \
- std::string& FLAGS_##name = *(reinterpret_cast<std::string*>(s_##name[0].s)); \
- } \
- using fLS::FLAGS_##name
-
-#endif // SWIG
-
-#endif // GOOGLE_GFLAGS_H_
diff --git a/src/third_party/linux/lib/gflags/libgflags.a b/src/third_party/linux/lib/gflags/libgflags.a
deleted file mode 100644
index c0de874c..00000000
--- a/src/third_party/linux/lib/gflags/libgflags.a
+++ /dev/null
Binary files differ
diff --git a/src/third_party/linux/lib/glog/libglog.a b/src/third_party/linux/lib/glog/libglog.a
deleted file mode 100644
index 8d2afaef..00000000
--- a/src/third_party/linux/lib/glog/libglog.a
+++ /dev/null
Binary files differ
diff --git a/src/third_party/lss/linux_syscall_support.h b/src/third_party/lss/linux_syscall_support.h
index f7c013d9..a0879033 100644
--- a/src/third_party/lss/linux_syscall_support.h
+++ b/src/third_party/lss/linux_syscall_support.h
@@ -82,12 +82,13 @@
#ifndef SYS_LINUX_SYSCALL_SUPPORT_H
#define SYS_LINUX_SYSCALL_SUPPORT_H
-/* We currently only support x86-32, x86-64, ARM, MIPS, and PPC on Linux.
+/* We currently only support x86-32, x86-64, ARM, MIPS, PPC, s390 and s390x
+ * on Linux.
* Porting to other related platforms should not be difficult.
*/
#if (defined(__i386__) || defined(__x86_64__) || defined(__ARM_ARCH_3__) || \
defined(__mips__) || defined(__PPC__) || defined(__ARM_EABI__) || \
- defined(__aarch64__)) \
+ defined(__aarch64__) || defined(__s390__)) \
&& (defined(__linux) || defined(__ANDROID__))
#ifndef SYS_CPLUSPLUS
@@ -118,21 +119,58 @@ extern "C" {
#ifdef __mips__
/* Include definitions of the ABI currently in use. */
+#ifdef __ANDROID__
+/* Android doesn't have sgidefs.h, but does have asm/sgidefs.h,
+ * which has the definitions we need.
+ */
+#include <asm/sgidefs.h>
+#else
#include <sgidefs.h>
#endif
#endif
+#endif
-/* The Android NDK's <sys/stat.h> #defines these macros as aliases
- * to their non-64 counterparts. To avoid naming conflict, remove them. */
-#ifdef __ANDROID__
- /* These are restored by the corresponding #pragma pop_macro near
- * the end of this file. */
-# pragma push_macro("stat64")
-# pragma push_macro("fstat64")
-# pragma push_macro("lstat64")
-# undef stat64
-# undef fstat64
-# undef lstat64
+/* Some libcs, for example Android NDK and musl, #define these
+ * macros as aliases to their non-64 counterparts. To avoid naming
+ * conflict, remove them.
+ *
+ * These are restored by the corresponding #pragma pop_macro near
+ * the end of this file.
+ */
+#pragma push_macro("stat64")
+#pragma push_macro("fstat64")
+#pragma push_macro("lstat64")
+#pragma push_macro("pread64")
+#pragma push_macro("pwrite64")
+#pragma push_macro("getdents64")
+#undef stat64
+#undef fstat64
+#undef lstat64
+#undef pread64
+#undef pwrite64
+#undef getdents64
+
+#if defined(__ANDROID__) && defined(__x86_64__)
+// A number of x86_64 syscalls are blocked by seccomp on recent Android;
+// undefine them so that modern alternatives will be used instead where
+// possible.
+// The alternative syscalls have been sanity checked against linux-3.4+;
+// older versions might not work.
+# undef __NR_getdents
+# undef __NR_dup2
+# undef __NR_fork
+# undef __NR_getpgrp
+# undef __NR_open
+# undef __NR_poll
+# undef __NR_readlink
+# undef __NR_stat
+# undef __NR_unlink
+# undef __NR_pipe
+#endif
+
+#if defined(__ANDROID__)
+// waitpid is blocked by seccomp on all architectures on recent Android.
+# undef __NR_waitpid
#endif
/* As glibc often provides subtly incompatible data structures (and implicit
@@ -174,8 +212,8 @@ struct kernel_dirent64 {
};
/* include/linux/dirent.h */
-#if defined(__aarch64__)
-// aarch64 only defines dirent64, just uses that for dirent too.
+#if !defined(__NR_getdents)
+// when getdents is not available, getdents64 is used for both.
#define kernel_dirent kernel_dirent64
#else
struct kernel_dirent {
@@ -249,7 +287,7 @@ struct kernel_rusage {
};
#if defined(__i386__) || defined(__ARM_EABI__) || defined(__ARM_ARCH_3__) \
- || defined(__PPC__)
+ || defined(__PPC__) || (defined(__s390__) && !defined(__s390x__))
/* include/asm-{arm,i386,mips,ppc}/signal.h */
struct kernel_old_sigaction {
@@ -314,7 +352,7 @@ struct kernel_sockaddr {
char sa_data[14];
};
-/* include/asm-{arm,aarch64,i386,mips,ppc}/stat.h */
+/* include/asm-{arm,aarch64,i386,mips,ppc,s390}/stat.h */
#ifdef __mips__
#if _MIPS_SIM == _MIPS_SIM_ABI64
struct kernel_stat {
@@ -387,7 +425,7 @@ struct kernel_stat64 {
};
#endif
-/* include/asm-{arm,aarch64,i386,mips,x86_64,ppc}/stat.h */
+/* include/asm-{arm,aarch64,i386,mips,x86_64,ppc,s390}/stat.h */
#if defined(__i386__) || defined(__ARM_ARCH_3__) || defined(__ARM_EABI__)
struct kernel_stat {
/* The kernel headers suggest that st_dev and st_rdev should be 32bit
@@ -504,9 +542,53 @@ struct kernel_stat {
unsigned int __unused4;
unsigned int __unused5;
};
+#elif defined(__s390x__)
+struct kernel_stat {
+ unsigned long st_dev;
+ unsigned long st_ino;
+ unsigned long st_nlink;
+ unsigned int st_mode;
+ unsigned int st_uid;
+ unsigned int st_gid;
+ unsigned int __pad1;
+ unsigned long st_rdev;
+ unsigned long st_size;
+ unsigned long st_atime_;
+ unsigned long st_atime_nsec_;
+ unsigned long st_mtime_;
+ unsigned long st_mtime_nsec_;
+ unsigned long st_ctime_;
+ unsigned long st_ctime_nsec_;
+ unsigned long st_blksize;
+ long st_blocks;
+ unsigned long __unused[3];
+};
+#elif defined(__s390__)
+struct kernel_stat {
+ unsigned short st_dev;
+ unsigned short __pad1;
+ unsigned long st_ino;
+ unsigned short st_mode;
+ unsigned short st_nlink;
+ unsigned short st_uid;
+ unsigned short st_gid;
+ unsigned short st_rdev;
+ unsigned short __pad2;
+ unsigned long st_size;
+ unsigned long st_blksize;
+ unsigned long st_blocks;
+ unsigned long st_atime_;
+ unsigned long st_atime_nsec_;
+ unsigned long st_mtime_;
+ unsigned long st_mtime_nsec_;
+ unsigned long st_ctime_;
+ unsigned long st_ctime_nsec_;
+ unsigned long __unused4;
+ unsigned long __unused5;
+};
#endif
-/* include/asm-{arm,aarch64,i386,mips,x86_64,ppc}/statfs.h */
+/* include/asm-{arm,aarch64,i386,mips,x86_64,ppc,s390}/statfs.h */
#ifdef __mips__
#if _MIPS_SIM != _MIPS_SIM_ABI64
struct kernel_statfs64 {
@@ -524,6 +606,22 @@ struct kernel_statfs64 {
unsigned long f_spare[6];
};
#endif
+#elif defined(__s390__)
+/* See also arch/s390/include/asm/compat.h */
+struct kernel_statfs64 {
+ unsigned int f_type;
+ unsigned int f_bsize;
+ unsigned long long f_blocks;
+ unsigned long long f_bfree;
+ unsigned long long f_bavail;
+ unsigned long long f_files;
+ unsigned long long f_ffree;
+ struct { int val[2]; } f_fsid;
+ unsigned int f_namelen;
+ unsigned int f_frsize;
+ unsigned int f_flags;
+ unsigned int f_spare[4];
+};
#elif !defined(__x86_64__)
struct kernel_statfs64 {
unsigned long f_type;
@@ -540,7 +638,7 @@ struct kernel_statfs64 {
};
#endif
-/* include/asm-{arm,i386,mips,x86_64,ppc,generic}/statfs.h */
+/* include/asm-{arm,i386,mips,x86_64,ppc,generic,s390}/statfs.h */
#ifdef __mips__
struct kernel_statfs {
long f_type;
@@ -572,6 +670,21 @@ struct kernel_statfs {
uint64_t f_frsize;
uint64_t f_spare[5];
};
+#elif defined(__s390__)
+struct kernel_statfs {
+ unsigned int f_type;
+ unsigned int f_bsize;
+ unsigned long f_blocks;
+ unsigned long f_bfree;
+ unsigned long f_bavail;
+ unsigned long f_files;
+ unsigned long f_ffree;
+ struct { int val[2]; } f_fsid;
+ unsigned int f_namelen;
+ unsigned int f_frsize;
+ unsigned int f_flags;
+ unsigned int f_spare[4];
+};
#else
struct kernel_statfs {
unsigned long f_type;
@@ -644,11 +757,12 @@ struct kernel_statfs {
#endif
#ifndef MAKE_PROCESS_CPUCLOCK
#define MAKE_PROCESS_CPUCLOCK(pid, clock) \
- ((~(int)(pid) << 3) | (int)(clock))
+ ((int)(~(unsigned)(pid) << 3) | (int)(clock))
#endif
#ifndef MAKE_THREAD_CPUCLOCK
#define MAKE_THREAD_CPUCLOCK(tid, clock) \
- ((~(int)(tid) << 3) | (int)((clock) | CPUCLOCK_PERTHREAD_MASK))
+ ((int)(~(unsigned)(tid) << 3) | \
+ (int)((clock) | CPUCLOCK_PERTHREAD_MASK))
#endif
#ifndef FUTEX_WAIT
@@ -944,7 +1058,7 @@ struct kernel_statfs {
#ifndef __NR_getcpu
#define __NR_getcpu (__NR_SYSCALL_BASE + 345)
#endif
-/* End of ARM 3/EABI definitions */
+/* End of ARM 3/EABI definitions */
#elif defined(__aarch64__)
#ifndef __NR_setxattr
#define __NR_setxattr 5
@@ -986,6 +1100,7 @@ struct kernel_statfs {
#define __NR_getdents64 61
#endif
#ifndef __NR_getdents
+// when getdents is not available, getdents64 is used for both.
#define __NR_getdents __NR_getdents64
#endif
#ifndef __NR_pread64
@@ -1094,6 +1209,10 @@ struct kernel_statfs {
#ifndef __NR_getdents64
#define __NR_getdents64 217
#endif
+#ifndef __NR_getdents
+// when getdents is not available, getdents64 is used for both.
+#define __NR_getdents __NR_getdents64
+#endif
#ifndef __NR_set_tid_address
#define __NR_set_tid_address 218
#endif
@@ -1497,6 +1616,189 @@ struct kernel_statfs {
#define __NR_getcpu 302
#endif
/* End of powerpc defininitions */
+#elif defined(__s390__)
+#ifndef __NR_quotactl
+#define __NR_quotactl 131
+#endif
+#ifndef __NR_rt_sigreturn
+#define __NR_rt_sigreturn 173
+#endif
+#ifndef __NR_rt_sigaction
+#define __NR_rt_sigaction 174
+#endif
+#ifndef __NR_rt_sigprocmask
+#define __NR_rt_sigprocmask 175
+#endif
+#ifndef __NR_rt_sigpending
+#define __NR_rt_sigpending 176
+#endif
+#ifndef __NR_rt_sigsuspend
+#define __NR_rt_sigsuspend 179
+#endif
+#ifndef __NR_pread64
+#define __NR_pread64 180
+#endif
+#ifndef __NR_pwrite64
+#define __NR_pwrite64 181
+#endif
+#ifndef __NR_getdents64
+#define __NR_getdents64 220
+#endif
+#ifndef __NR_readahead
+#define __NR_readahead 222
+#endif
+#ifndef __NR_setxattr
+#define __NR_setxattr 224
+#endif
+#ifndef __NR_lsetxattr
+#define __NR_lsetxattr 225
+#endif
+#ifndef __NR_getxattr
+#define __NR_getxattr 227
+#endif
+#ifndef __NR_lgetxattr
+#define __NR_lgetxattr 228
+#endif
+#ifndef __NR_listxattr
+#define __NR_listxattr 230
+#endif
+#ifndef __NR_llistxattr
+#define __NR_llistxattr 231
+#endif
+#ifndef __NR_gettid
+#define __NR_gettid 236
+#endif
+#ifndef __NR_tkill
+#define __NR_tkill 237
+#endif
+#ifndef __NR_futex
+#define __NR_futex 238
+#endif
+#ifndef __NR_sched_setaffinity
+#define __NR_sched_setaffinity 239
+#endif
+#ifndef __NR_sched_getaffinity
+#define __NR_sched_getaffinity 240
+#endif
+#ifndef __NR_set_tid_address
+#define __NR_set_tid_address 252
+#endif
+#ifndef __NR_clock_gettime
+#define __NR_clock_gettime 260
+#endif
+#ifndef __NR_clock_getres
+#define __NR_clock_getres 261
+#endif
+#ifndef __NR_statfs64
+#define __NR_statfs64 265
+#endif
+#ifndef __NR_fstatfs64
+#define __NR_fstatfs64 266
+#endif
+#ifndef __NR_ioprio_set
+#define __NR_ioprio_set 282
+#endif
+#ifndef __NR_ioprio_get
+#define __NR_ioprio_get 283
+#endif
+#ifndef __NR_openat
+#define __NR_openat 288
+#endif
+#ifndef __NR_unlinkat
+#define __NR_unlinkat 294
+#endif
+#ifndef __NR_move_pages
+#define __NR_move_pages 310
+#endif
+#ifndef __NR_getcpu
+#define __NR_getcpu 311
+#endif
+#ifndef __NR_fallocate
+#define __NR_fallocate 314
+#endif
+/* Some syscalls are named/numbered differently between s390 and s390x. */
+#ifdef __s390x__
+# ifndef __NR_getrlimit
+# define __NR_getrlimit 191
+# endif
+# ifndef __NR_setresuid
+# define __NR_setresuid 208
+# endif
+# ifndef __NR_getresuid
+# define __NR_getresuid 209
+# endif
+# ifndef __NR_setresgid
+# define __NR_setresgid 210
+# endif
+# ifndef __NR_getresgid
+# define __NR_getresgid 211
+# endif
+# ifndef __NR_setfsuid
+# define __NR_setfsuid 215
+# endif
+# ifndef __NR_setfsgid
+# define __NR_setfsgid 216
+# endif
+# ifndef __NR_fadvise64
+# define __NR_fadvise64 253
+# endif
+# ifndef __NR_newfstatat
+# define __NR_newfstatat 293
+# endif
+#else /* __s390x__ */
+# ifndef __NR_getrlimit
+# define __NR_getrlimit 76
+# endif
+# ifndef __NR_setfsuid
+# define __NR_setfsuid 138
+# endif
+# ifndef __NR_setfsgid
+# define __NR_setfsgid 139
+# endif
+# ifndef __NR_setresuid
+# define __NR_setresuid 164
+# endif
+# ifndef __NR_getresuid
+# define __NR_getresuid 165
+# endif
+# ifndef __NR_setresgid
+# define __NR_setresgid 170
+# endif
+# ifndef __NR_getresgid
+# define __NR_getresgid 171
+# endif
+# ifndef __NR_ugetrlimit
+# define __NR_ugetrlimit 191
+# endif
+# ifndef __NR_mmap2
+# define __NR_mmap2 192
+# endif
+# ifndef __NR_setresuid32
+# define __NR_setresuid32 208
+# endif
+# ifndef __NR_getresuid32
+# define __NR_getresuid32 209
+# endif
+# ifndef __NR_setresgid32
+# define __NR_setresgid32 210
+# endif
+# ifndef __NR_getresgid32
+# define __NR_getresgid32 211
+# endif
+# ifndef __NR_setfsuid32
+# define __NR_setfsuid32 215
+# endif
+# ifndef __NR_setfsgid32
+# define __NR_setfsgid32 216
+# endif
+# ifndef __NR_fadvise64_64
+# define __NR_fadvise64_64 264
+# endif
+# ifndef __NR_fstatat64
+# define __NR_fstatat64 293
+# endif
+#endif /* __s390__ */
+/* End of s390/s390x definitions */
#endif
@@ -1560,7 +1862,7 @@ struct kernel_statfs {
#undef LSS_RETURN
#if (defined(__i386__) || defined(__x86_64__) || defined(__ARM_ARCH_3__) \
- || defined(__ARM_EABI__) || defined(__aarch64__))
+ || defined(__ARM_EABI__) || defined(__aarch64__) || defined(__s390__))
/* Failing system calls return a negative result in the range of
* -1..-4095. These are "errno" values with the sign inverted.
*/
@@ -1660,7 +1962,7 @@ struct kernel_statfs {
LSS_ENTRYPOINT \
"pop %%ebx" \
args \
- : "esp", "memory"); \
+ : "memory"); \
LSS_RETURN(type,__res)
#undef _syscall0
#define _syscall0(type,name) \
@@ -1669,7 +1971,7 @@ struct kernel_statfs {
__asm__ volatile(LSS_ENTRYPOINT \
: "=a" (__res) \
: "0" (__NR_##name) \
- : "esp", "memory"); \
+ : "memory"); \
LSS_RETURN(type,__res); \
}
#undef _syscall1
@@ -1717,7 +2019,7 @@ struct kernel_statfs {
: "i" (__NR_##name), "ri" ((long)(arg1)), \
"c" ((long)(arg2)), "d" ((long)(arg3)), \
"S" ((long)(arg4)), "D" ((long)(arg5)) \
- : "esp", "memory"); \
+ : "memory"); \
LSS_RETURN(type,__res); \
}
#undef _syscall6
@@ -1739,7 +2041,7 @@ struct kernel_statfs {
: "i" (__NR_##name), "0" ((long)(&__s)), \
"c" ((long)(arg2)), "d" ((long)(arg3)), \
"S" ((long)(arg4)), "D" ((long)(arg5)) \
- : "esp", "memory"); \
+ : "memory"); \
LSS_RETURN(type,__res); \
}
LSS_INLINE int LSS_NAME(clone)(int (*fn)(void *), void *child_stack,
@@ -1825,36 +2127,10 @@ struct kernel_statfs {
: "0"(-EINVAL), "i"(__NR_clone),
"m"(fn), "m"(child_stack), "m"(flags), "m"(arg),
"m"(parent_tidptr), "m"(newtls), "m"(child_tidptr)
- : "esp", "memory", "ecx", "edx", "esi", "edi");
+ : "memory", "ecx", "edx", "esi", "edi");
LSS_RETURN(int, __res);
}
- #define __NR__fadvise64_64 __NR_fadvise64_64
- LSS_INLINE _syscall6(int, _fadvise64_64, int, fd,
- unsigned, offset_lo, unsigned, offset_hi,
- unsigned, len_lo, unsigned, len_hi,
- int, advice)
-
- LSS_INLINE int LSS_NAME(fadvise64)(int fd, loff_t offset,
- loff_t len, int advice) {
- return LSS_NAME(_fadvise64_64)(fd,
- (unsigned)offset, (unsigned)(offset >>32),
- (unsigned)len, (unsigned)(len >> 32),
- advice);
- }
-
- #define __NR__fallocate __NR_fallocate
- LSS_INLINE _syscall6(int, _fallocate, int, fd,
- int, mode,
- unsigned, offset_lo, unsigned, offset_hi,
- unsigned, len_lo, unsigned, len_hi)
-
- LSS_INLINE int LSS_NAME(fallocate)(int fd, int mode,
- loff_t offset, loff_t len) {
- union { loff_t off; unsigned w[2]; } o = { offset }, l = { len };
- return LSS_NAME(_fallocate)(fd, mode, o.w[0], o.w[1], l.w[0], l.w[1]);
- }
-
LSS_INLINE _syscall1(int, set_thread_area, void *, u)
LSS_INLINE _syscall1(int, get_thread_area, void *, u)
@@ -2136,19 +2412,12 @@ struct kernel_statfs {
"d"(LSS_SYSCALL_ARG(parent_tidptr)),
"r"(LSS_SYSCALL_ARG(newtls)),
"r"(LSS_SYSCALL_ARG(child_tidptr))
- : "rsp", "memory", "r8", "r10", "r11", "rcx");
+ : "memory", "r8", "r10", "r11", "rcx");
}
LSS_RETURN(int, __res);
}
LSS_INLINE _syscall2(int, arch_prctl, int, c, void *, a)
- /* Need to make sure loff_t isn't truncated to 32-bits under x32. */
- LSS_INLINE int LSS_NAME(fadvise64)(int fd, loff_t offset, loff_t len,
- int advice) {
- LSS_BODY(4, int, fadvise64, LSS_SYSCALL_ARG(fd), (uint64_t)(offset),
- (uint64_t)(len), LSS_SYSCALL_ARG(advice));
- }
-
LSS_INLINE void (*LSS_NAME(restore_rt)(void))(void) {
/* On x86-64, the kernel does not know how to return from
* a signal handler. Instead, it relies on user space to provide a
@@ -2361,86 +2630,71 @@ struct kernel_statfs {
int flags, void *arg, int *parent_tidptr,
void *newtls, int *child_tidptr) {
long __res;
+ if (fn == NULL || child_stack == NULL) {
+ __res = -EINVAL;
+ LSS_RETURN(int, __res);
+ }
+
+ /* Push "arg" and "fn" onto the stack that will be
+ * used by the child.
+ */
+ {
+ uintptr_t* cstack = (uintptr_t*)child_stack - 2;
+ cstack[0] = (uintptr_t)fn;
+ cstack[1] = (uintptr_t)arg;
+ child_stack = cstack;
+ }
{
register int __flags __asm__("r0") = flags;
register void *__stack __asm__("r1") = child_stack;
register void *__ptid __asm__("r2") = parent_tidptr;
register void *__tls __asm__("r3") = newtls;
register int *__ctid __asm__("r4") = child_tidptr;
- __asm__ __volatile__(/* if (fn == NULL || child_stack == NULL)
- * return -EINVAL;
- */
+ __asm__ __volatile__(
#ifdef __thumb2__
- "push {r7}\n"
+ "push {r7}\n"
#endif
- "cmp %2,#0\n"
- "it ne\n"
- "cmpne %3,#0\n"
- "it eq\n"
- "moveq %0,%1\n"
- "beq 1f\n"
-
- /* Push "arg" and "fn" onto the stack that will be
- * used by the child.
- */
- "str %5,[%3,#-4]!\n"
- "str %2,[%3,#-4]!\n"
-
- /* %r0 = syscall(%r0 = flags,
- * %r1 = child_stack,
- * %r2 = parent_tidptr,
- * %r3 = newtls,
- * %r4 = child_tidptr)
- */
- "mov r7, %9\n"
- "swi 0x0\n"
+ /* %r0 = syscall(%r0 = flags,
+ * %r1 = child_stack,
+ * %r2 = parent_tidptr,
+ * %r3 = newtls,
+ * %r4 = child_tidptr)
+ */
+ "mov r7, %6\n"
+ "swi 0x0\n"
- /* if (%r0 != 0)
- * return %r0;
- */
- "movs %0,r0\n"
- "bne 1f\n"
+ /* if (%r0 != 0)
+ * return %r0;
+ */
+ "cmp r0, #0\n"
+ "bne 1f\n"
- /* In the child, now. Call "fn(arg)".
- */
- "ldr r0,[sp, #4]\n"
+ /* In the child, now. Call "fn(arg)".
+ */
+ "ldr r0,[sp, #4]\n"
- /* When compiling for Thumb-2 the "MOV LR,PC" here
- * won't work because it loads PC+4 into LR,
- * whereas the LDR is a 4-byte instruction.
- * This results in the child thread always
- * crashing with an "Illegal Instruction" when it
- * returned into the middle of the LDR instruction
- * The instruction sequence used instead was
- * recommended by
- * "https://wiki.edubuntu.org/ARM/Thumb2PortingHowto#Quick_Reference".
- */
- #ifdef __thumb2__
- "ldr r7,[sp]\n"
- "blx r7\n"
- #else
- "mov lr,pc\n"
- "ldr pc,[sp]\n"
- #endif
+ "ldr lr,[sp]\n"
+ "blx lr\n"
- /* Call _exit(%r0).
- */
- "mov r7, %10\n"
- "swi 0x0\n"
- "1:\n"
+ /* Call _exit(%r0).
+ */
+ "mov r7, %7\n"
+ "swi 0x0\n"
+ /* Unreachable */
+ "bkpt #0\n"
+ "1:\n"
#ifdef __thumb2__
- "pop {r7}"
+ "pop {r7}\n"
#endif
- : "=r" (__res)
- : "i"(-EINVAL),
- "r"(fn), "r"(__stack), "r"(__flags), "r"(arg),
- "r"(__ptid), "r"(__tls), "r"(__ctid),
- "i"(__NR_clone), "i"(__NR_exit)
-#ifdef __thumb2__
- : "cc", "lr", "memory");
-#else
- : "cc", "r7", "lr", "memory");
+ "movs %0,r0\n"
+ : "=r"(__res)
+ : "r"(__stack), "r"(__flags), "r"(__ptid), "r"(__tls), "r"(__ctid),
+ "i"(__NR_clone), "i"(__NR_exit)
+ : "cc", "lr", "memory"
+#ifndef __thumb2__
+ , "r7"
#endif
+ );
}
LSS_RETURN(int, __res);
}
@@ -2695,7 +2949,7 @@ struct kernel_statfs {
LSS_INLINE int LSS_NAME(clone)(int (*fn)(void *), void *child_stack,
int flags, void *arg, int *parent_tidptr,
void *newtls, int *child_tidptr) {
- register unsigned long __v0 __asm__("$2");
+ register unsigned long __v0 __asm__("$2") = -EINVAL;
register unsigned long __r7 __asm__("$7") = (unsigned long)newtls;
{
register int __flags __asm__("$4") = flags;
@@ -2714,25 +2968,24 @@ struct kernel_statfs {
/* if (fn == NULL || child_stack == NULL)
* return -EINVAL;
*/
- "li %0,%2\n"
+ "beqz %4,1f\n"
"beqz %5,1f\n"
- "beqz %6,1f\n"
/* Push "arg" and "fn" onto the stack that will be
* used by the child.
*/
#if _MIPS_SIM == _MIPS_SIM_ABI32 && _MIPS_SZPTR == 32
- "subu %6,32\n"
- "sw %5,0(%6)\n"
- "sw %8,4(%6)\n"
+ "subu %5,32\n"
+ "sw %4,0(%5)\n"
+ "sw %7,4(%5)\n"
#elif _MIPS_SIM == _MIPS_SIM_NABI32
- "sub %6,32\n"
- "sw %5,0(%6)\n"
- "sw %8,8(%6)\n"
+ "sub %5,32\n"
+ "sw %4,0(%5)\n"
+ "sw %7,8(%5)\n"
#else
- "dsubu %6,32\n"
- "sd %5,0(%6)\n"
- "sd %8,8(%6)\n"
+ "dsubu %5,32\n"
+ "sd %4,0(%5)\n"
+ "sd %7,8(%5)\n"
#endif
/* $7 = syscall($4 = flags,
@@ -2741,7 +2994,7 @@ struct kernel_statfs {
* $7 = newtls,
* $8 = child_tidptr)
*/
- "li $2,%3\n"
+ "li $2,%2\n"
"syscall\n"
/* if ($7 != 0)
@@ -2767,7 +3020,7 @@ struct kernel_statfs {
/* Call _exit($2)
*/
"move $4,$2\n"
- "li $2,%4\n"
+ "li $2,%3\n"
"syscall\n"
"1:\n"
@@ -2779,9 +3032,9 @@ struct kernel_statfs {
"daddu $29,16\n"
#endif
: "+r" (__v0), "+r" (__r7)
- : "i"(-EINVAL), "i"(__NR_clone), "i"(__NR_exit),
- "r"(fn), "r"(__stack), "r"(__flags), "r"(arg),
- "r"(__ptid), "r"(__r7), "r"(__ctid)
+ : "i"(__NR_clone), "i"(__NR_exit), "r"(fn),
+ "r"(__stack), "r"(__flags), "r"(arg),
+ "r"(__ptid), "r"(__ctid)
: "$9", "$10", "$11", "$12", "$13", "$14", "$15",
"$24", "$25", "memory");
}
@@ -2970,6 +3223,138 @@ struct kernel_statfs {
}
LSS_RETURN(int, __ret, __err);
}
+ #elif defined(__s390__)
+ #undef LSS_REG
+ #define LSS_REG(r, a) register unsigned long __r##r __asm__("r"#r) = (unsigned long) a
+ #undef LSS_BODY
+ #define LSS_BODY(type, name, args...) \
+ register unsigned long __nr __asm__("r1") \
+ = (unsigned long)(__NR_##name); \
+ register long __res_r2 __asm__("r2"); \
+ long __res; \
+ __asm__ __volatile__ \
+ ("svc 0\n\t" \
+ : "=d"(__res_r2) \
+ : "d"(__nr), ## args \
+ : "memory"); \
+ __res = __res_r2; \
+ LSS_RETURN(type, __res)
+ #undef _syscall0
+ #define _syscall0(type, name) \
+ type LSS_NAME(name)(void) { \
+ LSS_BODY(type, name); \
+ }
+ #undef _syscall1
+ #define _syscall1(type, name, type1, arg1) \
+ type LSS_NAME(name)(type1 arg1) { \
+ LSS_REG(2, arg1); \
+ LSS_BODY(type, name, "0"(__r2)); \
+ }
+ #undef _syscall2
+ #define _syscall2(type, name, type1, arg1, type2, arg2) \
+ type LSS_NAME(name)(type1 arg1, type2 arg2) { \
+ LSS_REG(2, arg1); LSS_REG(3, arg2); \
+ LSS_BODY(type, name, "0"(__r2), "d"(__r3)); \
+ }
+ #undef _syscall3
+ #define _syscall3(type, name, type1, arg1, type2, arg2, type3, arg3) \
+ type LSS_NAME(name)(type1 arg1, type2 arg2, type3 arg3) { \
+ LSS_REG(2, arg1); LSS_REG(3, arg2); LSS_REG(4, arg3); \
+ LSS_BODY(type, name, "0"(__r2), "d"(__r3), "d"(__r4)); \
+ }
+ #undef _syscall4
+ #define _syscall4(type, name, type1, arg1, type2, arg2, type3, arg3, \
+ type4, arg4) \
+ type LSS_NAME(name)(type1 arg1, type2 arg2, type3 arg3, \
+ type4 arg4) { \
+ LSS_REG(2, arg1); LSS_REG(3, arg2); LSS_REG(4, arg3); \
+ LSS_REG(5, arg4); \
+ LSS_BODY(type, name, "0"(__r2), "d"(__r3), "d"(__r4), \
+ "d"(__r5)); \
+ }
+ #undef _syscall5
+ #define _syscall5(type, name, type1, arg1, type2, arg2, type3, arg3, \
+ type4, arg4, type5, arg5) \
+ type LSS_NAME(name)(type1 arg1, type2 arg2, type3 arg3, \
+ type4 arg4, type5 arg5) { \
+ LSS_REG(2, arg1); LSS_REG(3, arg2); LSS_REG(4, arg3); \
+ LSS_REG(5, arg4); LSS_REG(6, arg5); \
+ LSS_BODY(type, name, "0"(__r2), "d"(__r3), "d"(__r4), \
+ "d"(__r5), "d"(__r6)); \
+ }
+ #undef _syscall6
+ #define _syscall6(type, name, type1, arg1, type2, arg2, type3, arg3, \
+ type4, arg4, type5, arg5, type6, arg6) \
+ type LSS_NAME(name)(type1 arg1, type2 arg2, type3 arg3, \
+ type4 arg4, type5 arg5, type6 arg6) { \
+ LSS_REG(2, arg1); LSS_REG(3, arg2); LSS_REG(4, arg3); \
+ LSS_REG(5, arg4); LSS_REG(6, arg5); LSS_REG(7, arg6); \
+ LSS_BODY(type, name, "0"(__r2), "d"(__r3), "d"(__r4), \
+ "d"(__r5), "d"(__r6), "d"(__r7)); \
+ }
+ LSS_INLINE int LSS_NAME(clone)(int (*fn)(void *), void *child_stack,
+ int flags, void *arg, int *parent_tidptr,
+ void *newtls, int *child_tidptr) {
+ long __ret;
+ {
+ register int (*__fn)(void *) __asm__ ("r1") = fn;
+ register void *__cstack __asm__ ("r2") = child_stack;
+ register int __flags __asm__ ("r3") = flags;
+ register void *__arg __asm__ ("r0") = arg;
+ register int *__ptidptr __asm__ ("r4") = parent_tidptr;
+ register void *__newtls __asm__ ("r6") = newtls;
+ register int *__ctidptr __asm__ ("r5") = child_tidptr;
+ __asm__ __volatile__ (
+ #ifndef __s390x__
+ /* arg already in r0 */
+ "ltr %4, %4\n\t" /* check fn, which is already in r1 */
+ "jz 1f\n\t" /* NULL function pointer, return -EINVAL */
+ "ltr %5, %5\n\t" /* check child_stack, which is already in r2 */
+ "jz 1f\n\t" /* NULL stack pointer, return -EINVAL */
+ /* flags already in r3 */
+ /* parent_tidptr already in r4 */
+ /* child_tidptr already in r5 */
+ /* newtls already in r6 */
+ "svc %2\n\t" /* invoke clone syscall */
+ "ltr %0,%%r2\n\t" /* load return code into __ret and test */
+ "jnz 1f\n\t" /* return to parent if non-zero */
+ /* start child thread */
+ "lr %%r2, %7\n\t" /* set first parameter to void *arg */
+ "ahi %%r15, -96\n\t" /* make room on the stack for the save area */
+ "xc 0(4,%%r15), 0(%%r15)\n\t"
+ "basr %%r14, %4\n\t" /* jump to fn */
+ "svc %3\n" /* invoke exit syscall */
+ "1:\n"
+ #else
+ /* arg already in r0 */
+ "ltgr %4, %4\n\t" /* check fn, which is already in r1 */
+ "jz 1f\n\t" /* NULL function pointer, return -EINVAL */
+ "ltgr %5, %5\n\t" /* check child_stack, which is already in r2 */
+ "jz 1f\n\t" /* NULL stack pointer, return -EINVAL */
+ /* flags already in r3 */
+ /* parent_tidptr already in r4 */
+ /* child_tidptr already in r5 */
+ /* newtls already in r6 */
+ "svc %2\n\t" /* invoke clone syscall */
+ "ltgr %0, %%r2\n\t" /* load return code into __ret and test */
+ "jnz 1f\n\t" /* return to parent if non-zero */
+ /* start child thread */
+ "lgr %%r2, %7\n\t" /* set first parameter to void *arg */
+ "aghi %%r15, -160\n\t" /* make room on the stack for the save area */
+ "xc 0(8,%%r15), 0(%%r15)\n\t"
+ "basr %%r14, %4\n\t" /* jump to fn */
+ "svc %3\n" /* invoke exit syscall */
+ "1:\n"
+ #endif
+ : "=r" (__ret)
+ : "0" (-EINVAL), "i" (__NR_clone), "i" (__NR_exit),
+ "d" (__fn), "d" (__cstack), "d" (__flags), "d" (__arg),
+ "d" (__ptidptr), "d" (__newtls), "d" (__ctidptr)
+ : "cc", "r14", "memory"
+ );
+ }
+ LSS_RETURN(int, __ret);
+ }
#endif
#define __NR__exit __NR_exit
#define __NR__gettid __NR_gettid
@@ -2982,19 +3367,22 @@ struct kernel_statfs {
LSS_INLINE _syscall2(int, clock_gettime, int, c,
struct kernel_timespec*, t)
LSS_INLINE _syscall1(int, dup, int, f)
- #if !defined(__aarch64__)
- // The dup2 syscall has been deprecated on aarch64. We polyfill it below.
+ #if defined(__NR_dup2)
+ // dup2 is polyfilled below when not available.
LSS_INLINE _syscall2(int, dup2, int, s,
int, d)
#endif
+ #if defined(__NR_dup3)
+ LSS_INLINE _syscall3(int, dup3, int, s, int, d, int, f)
+ #endif
LSS_INLINE _syscall3(int, execve, const char*, f,
const char*const*,a,const char*const*, e)
LSS_INLINE _syscall1(int, _exit, int, e)
LSS_INLINE _syscall1(int, exit_group, int, e)
LSS_INLINE _syscall3(int, fcntl, int, f,
int, c, long, a)
- #if !defined(__aarch64__)
- // The fork syscall has been deprecated on aarch64. We polyfill it below.
+ #if defined(__NR_fork)
+ // fork is polyfilled below when not available.
LSS_INLINE _syscall0(pid_t, fork)
#endif
LSS_INLINE _syscall2(int, fstat, int, f,
@@ -3010,17 +3398,17 @@ struct kernel_statfs {
LSS_INLINE _syscall2(int, ftruncate, int, f,
off_t, l)
#endif
- LSS_INLINE _syscall4(int, futex, int*, a,
- int, o, int, v,
- struct kernel_timespec*, t)
+ LSS_INLINE _syscall6(int, futex, int*, u,
+ int, o, int, v,
+ struct kernel_timespec*, t,
+ int*, u2, int, v2)
LSS_INLINE _syscall3(int, getdents, int, f,
struct kernel_dirent*, d, int, c)
LSS_INLINE _syscall3(int, getdents64, int, f,
struct kernel_dirent64*, d, int, c)
LSS_INLINE _syscall0(gid_t, getegid)
LSS_INLINE _syscall0(uid_t, geteuid)
- #if !defined(__aarch64__)
- // The getgprp syscall has been deprecated on aarch64.
+ #if defined(__NR_getpgrp)
LSS_INLINE _syscall0(pid_t, getpgrp)
#endif
LSS_INLINE _syscall0(pid_t, getpid)
@@ -3081,14 +3469,21 @@ struct kernel_statfs {
LSS_INLINE _syscall5(void*, _mremap, void*, o,
size_t, os, size_t, ns,
unsigned long, f, void *, a)
- #if !defined(__aarch64__)
- // The open and poll syscalls have been deprecated on aarch64. We polyfill
- // them below.
+ #if defined(__NR_open)
+ // open is polyfilled below when not available.
LSS_INLINE _syscall3(int, open, const char*, p,
int, f, int, m)
+ #endif
+ #if defined(__NR_poll)
+ // poll is polyfilled below when not available.
LSS_INLINE _syscall3(int, poll, struct kernel_pollfd*, u,
unsigned int, n, int, t)
#endif
+ #if defined(__NR_ppoll)
+ LSS_INLINE _syscall5(int, ppoll, struct kernel_pollfd *, u,
+ unsigned int, n, const struct kernel_timespec *, t,
+ const struct kernel_sigset_t *, sigmask, size_t, s)
+ #endif
LSS_INLINE _syscall5(int, prctl, int, option,
unsigned long, arg2,
unsigned long, arg3,
@@ -3103,11 +3498,15 @@ struct kernel_statfs {
#endif
LSS_INLINE _syscall3(ssize_t, read, int, f,
void *, b, size_t, c)
- #if !defined(__aarch64__)
- // The readlink syscall has been deprecated on aarch64. We polyfill below.
+ #if defined(__NR_readlink)
+ // readlink is polyfilled below when not available.
LSS_INLINE _syscall3(int, readlink, const char*, p,
char*, b, size_t, s)
#endif
+ #if defined(__NR_readlinkat)
+ LSS_INLINE _syscall4(int, readlinkat, int, d, const char *, p, char *, b,
+ size_t, s)
+ #endif
LSS_INLINE _syscall4(int, rt_sigaction, int, s,
const struct kernel_sigaction*, a,
struct kernel_sigaction*, o, size_t, c)
@@ -3118,6 +3517,8 @@ struct kernel_statfs {
struct kernel_sigset_t*, o, size_t, c)
LSS_INLINE _syscall2(int, rt_sigsuspend,
const struct kernel_sigset_t*, s, size_t, c)
+ LSS_INLINE _syscall4(int, rt_sigtimedwait, const struct kernel_sigset_t*, s,
+ siginfo_t*, i, const struct timespec*, t, size_t, c)
LSS_INLINE _syscall3(int, sched_getaffinity,pid_t, p,
unsigned int, l, unsigned long *, m)
LSS_INLINE _syscall3(int, sched_setaffinity,pid_t, p,
@@ -3144,8 +3545,8 @@ struct kernel_statfs {
#if defined(__NR_sigreturn)
LSS_INLINE _syscall1(int, sigreturn, unsigned long, u)
#endif
- #if !defined(__aarch64__)
- // The stat syscall has been deprecated on aarch64. We polyfill it below.
+ #if defined(__NR_stat)
+ // stat is polyfilled below when not available.
LSS_INLINE _syscall2(int, stat, const char*, f,
struct kernel_stat*, b)
#endif
@@ -3155,8 +3556,8 @@ struct kernel_statfs {
pid_t, t, int, s)
LSS_INLINE _syscall2(int, tkill, pid_t, p,
int, s)
- #if !defined(__aarch64__)
- // The unlink syscall has been deprecated on aarch64. We polyfill it below.
+ #if defined(__NR_unlink)
+ // unlink is polyfilled below when not available.
LSS_INLINE _syscall1(int, unlink, const char*, f)
#endif
LSS_INLINE _syscall3(ssize_t, write, int, f,
@@ -3184,14 +3585,85 @@ struct kernel_statfs {
LSS_INLINE _syscall4(int, socketpair, int, d,
int, t, int, p, int*, s)
#endif
- #if defined(__x86_64__)
+ #if defined(__NR_fadvise64)
+ #if defined(__x86_64__)
+ /* Need to make sure loff_t isn't truncated to 32-bits under x32. */
+ LSS_INLINE int LSS_NAME(fadvise64)(int fd, loff_t offset, loff_t len,
+ int advice) {
+ LSS_BODY(4, int, fadvise64, LSS_SYSCALL_ARG(fd), (uint64_t)(offset),
+ (uint64_t)(len), LSS_SYSCALL_ARG(advice));
+ }
+ #else
+ LSS_INLINE _syscall4(int, fadvise64,
+ int, fd, loff_t, offset, loff_t, len, int, advice)
+ #endif
+ #elif defined(__i386__)
+ #define __NR__fadvise64_64 __NR_fadvise64_64
+ LSS_INLINE _syscall6(int, _fadvise64_64, int, fd,
+ unsigned, offset_lo, unsigned, offset_hi,
+ unsigned, len_lo, unsigned, len_hi,
+ int, advice)
+
+ LSS_INLINE int LSS_NAME(fadvise64)(int fd, loff_t offset,
+ loff_t len, int advice) {
+ return LSS_NAME(_fadvise64_64)(fd,
+ (unsigned)offset, (unsigned)(offset >>32),
+ (unsigned)len, (unsigned)(len >> 32),
+ advice);
+ }
+
+ #elif defined(__s390__) && !defined(__s390x__)
+ #define __NR__fadvise64_64 __NR_fadvise64_64
+ struct kernel_fadvise64_64_args {
+ int fd;
+ long long offset;
+ long long len;
+ int advice;
+ };
+
+ LSS_INLINE _syscall1(int, _fadvise64_64,
+ struct kernel_fadvise64_64_args *args)
+
+ LSS_INLINE int LSS_NAME(fadvise64)(int fd, loff_t offset,
+ loff_t len, int advice) {
+ struct kernel_fadvise64_64_args args = { fd, offset, len, advice };
+ return LSS_NAME(_fadvise64_64)(&args);
+ }
+ #endif
+ #if defined(__NR_fallocate)
+ #if defined(__x86_64__)
/* Need to make sure loff_t isn't truncated to 32-bits under x32. */
LSS_INLINE int LSS_NAME(fallocate)(int f, int mode, loff_t offset,
loff_t len) {
LSS_BODY(4, int, fallocate, LSS_SYSCALL_ARG(f), LSS_SYSCALL_ARG(mode),
(uint64_t)(offset), (uint64_t)(len));
}
+ #elif (defined(__i386__) || (defined(__s390__) && !defined(__s390x__)) \
+ || defined(__ARM_ARCH_3__) || defined(__ARM_EABI__) \
+ || (defined(__mips__) && _MIPS_SIM == _MIPS_SIM_ABI32) \
+ || defined(__PPC__))
+ #define __NR__fallocate __NR_fallocate
+ LSS_INLINE _syscall6(int, _fallocate, int, fd,
+ int, mode,
+ unsigned, offset_lo, unsigned, offset_hi,
+ unsigned, len_lo, unsigned, len_hi)
+ LSS_INLINE int LSS_NAME(fallocate)(int fd, int mode,
+ loff_t offset, loff_t len) {
+ union { loff_t off; unsigned w[2]; } o = { offset }, l = { len };
+ return LSS_NAME(_fallocate)(fd, mode, o.w[0], o.w[1], l.w[0], l.w[1]);
+ }
+ #else
+ LSS_INLINE _syscall4(int, fallocate,
+ int, f, int, mode, loff_t, offset, loff_t, len)
+ #endif
+ #endif
+ #if defined(__NR_newfstatat)
+ LSS_INLINE _syscall4(int, newfstatat, int, d,
+ const char *, p,
+ struct kernel_stat*, b, int, f)
+ #endif
+ #if defined(__x86_64__) || defined(__s390x__)
LSS_INLINE int LSS_NAME(getresgid32)(gid_t *rgid,
gid_t *egid,
gid_t *sgid) {
@@ -3204,18 +3676,6 @@ struct kernel_statfs {
return LSS_NAME(getresuid)(ruid, euid, suid);
}
- /* Need to make sure __off64_t isn't truncated to 32-bits under x32. */
- LSS_INLINE void* LSS_NAME(mmap)(void *s, size_t l, int p, int f, int d,
- int64_t o) {
- LSS_BODY(6, void*, mmap, LSS_SYSCALL_ARG(s), LSS_SYSCALL_ARG(l),
- LSS_SYSCALL_ARG(p), LSS_SYSCALL_ARG(f),
- LSS_SYSCALL_ARG(d), (uint64_t)(o));
- }
-
- LSS_INLINE _syscall4(int, newfstatat, int, d,
- const char *, p,
- struct kernel_stat*, b, int, f)
-
LSS_INLINE int LSS_NAME(setfsgid32)(gid_t gid) {
return LSS_NAME(setfsgid)(gid);
}
@@ -3235,6 +3695,7 @@ struct kernel_statfs {
LSS_INLINE int LSS_NAME(sigaction)(int signum,
const struct kernel_sigaction *act,
struct kernel_sigaction *oldact) {
+ #if defined(__x86_64__)
/* On x86_64, the kernel requires us to always set our own
* SA_RESTORER in order to be able to return from a signal handler.
* This function must have a "magic" signature that the "gdb"
@@ -3246,42 +3707,47 @@ struct kernel_statfs {
a.sa_restorer = LSS_NAME(restore_rt)();
return LSS_NAME(rt_sigaction)(signum, &a, oldact,
(KERNEL_NSIG+7)/8);
- } else {
+ } else
+ #endif
return LSS_NAME(rt_sigaction)(signum, act, oldact,
(KERNEL_NSIG+7)/8);
- }
}
LSS_INLINE int LSS_NAME(sigpending)(struct kernel_sigset_t *set) {
return LSS_NAME(rt_sigpending)(set, (KERNEL_NSIG+7)/8);
}
+ LSS_INLINE int LSS_NAME(sigsuspend)(const struct kernel_sigset_t *set) {
+ return LSS_NAME(rt_sigsuspend)(set, (KERNEL_NSIG+7)/8);
+ }
+ #endif
+ #if defined(__NR_rt_sigprocmask)
LSS_INLINE int LSS_NAME(sigprocmask)(int how,
const struct kernel_sigset_t *set,
struct kernel_sigset_t *oldset) {
return LSS_NAME(rt_sigprocmask)(how, set, oldset, (KERNEL_NSIG+7)/8);
}
-
- LSS_INLINE int LSS_NAME(sigsuspend)(const struct kernel_sigset_t *set) {
- return LSS_NAME(rt_sigsuspend)(set, (KERNEL_NSIG+7)/8);
+ #endif
+ #if defined(__NR_rt_sigtimedwait)
+ LSS_INLINE int LSS_NAME(sigtimedwait)(const struct kernel_sigset_t *set,
+ siginfo_t *info,
+ const struct timespec *timeout) {
+ return LSS_NAME(rt_sigtimedwait)(set, info, timeout, (KERNEL_NSIG+7)/8);
}
#endif
- #if defined(__x86_64__) || defined(__ARM_ARCH_3__) || \
- defined(__ARM_EABI__) || defined(__aarch64__) || \
- (defined(__mips__) && _MIPS_SIM != _MIPS_SIM_ABI32)
+ #if defined(__NR_wait4)
LSS_INLINE _syscall4(pid_t, wait4, pid_t, p,
int*, s, int, o,
struct kernel_rusage*, r)
-
- LSS_INLINE pid_t LSS_NAME(waitpid)(pid_t pid, int *status, int options){
- return LSS_NAME(wait4)(pid, status, options, 0);
- }
#endif
- #if defined(__i386__) || defined(__x86_64__) || defined(__aarch64__)
+ #if defined(__NR_openat)
LSS_INLINE _syscall4(int, openat, int, d, const char *, p, int, f, int, m)
+ #endif
+ #if defined(__NR_unlinkat)
LSS_INLINE _syscall3(int, unlinkat, int, d, const char *, p, int, f)
#endif
- #if defined(__i386__) || defined(__ARM_ARCH_3__) || defined(__ARM_EABI__)
+ #if defined(__i386__) || defined(__ARM_ARCH_3__) || defined(__ARM_EABI__) || \
+ (defined(__s390__) && !defined(__s390x__))
#define __NR__getresgid32 __NR_getresgid32
#define __NR__getresuid32 __NR_getresuid32
#define __NR__setfsgid32 __NR_setfsgid32
@@ -3435,12 +3901,13 @@ struct kernel_statfs {
(1UL << ((signum - 1) % (8*sizeof(set->sig[0])))));
}
}
- #if defined(__i386__) || defined(__ARM_ARCH_3__) || \
- defined(__ARM_EABI__) || \
- (defined(__mips__) && _MIPS_SIM == _MIPS_SIM_ABI32) || defined(__PPC__)
+ #if defined(__i386__) || \
+ defined(__ARM_ARCH_3__) || defined(__ARM_EABI__) || \
+ (defined(__mips__) && _MIPS_SIM == _MIPS_SIM_ABI32) || \
+ defined(__PPC__) || \
+ (defined(__s390__) && !defined(__s390x__))
#define __NR__sigaction __NR_sigaction
#define __NR__sigpending __NR_sigpending
- #define __NR__sigprocmask __NR_sigprocmask
#define __NR__sigsuspend __NR_sigsuspend
#define __NR__socketcall __NR_socketcall
LSS_INLINE _syscall2(int, fstat64, int, f,
@@ -3448,20 +3915,27 @@ struct kernel_statfs {
LSS_INLINE _syscall5(int, _llseek, uint, fd,
unsigned long, hi, unsigned long, lo,
loff_t *, res, uint, wh)
-#if !defined(__ARM_EABI__)
- LSS_INLINE _syscall1(void*, mmap, void*, a)
-#endif
- LSS_INLINE _syscall6(void*, mmap2, void*, s,
+#if defined(__s390__) && !defined(__s390x__)
+ /* On s390, mmap2() arguments are passed in memory. */
+ LSS_INLINE void* LSS_NAME(_mmap2)(void *s, size_t l, int p, int f, int d,
+ off_t o) {
+ unsigned long buf[6] = { (unsigned long) s, (unsigned long) l,
+ (unsigned long) p, (unsigned long) f,
+ (unsigned long) d, (unsigned long) o };
+ LSS_REG(2, buf);
+ LSS_BODY(void*, mmap2, "0"(__r2));
+ }
+#else
+ #define __NR__mmap2 __NR_mmap2
+ LSS_INLINE _syscall6(void*, _mmap2, void*, s,
size_t, l, int, p,
int, f, int, d,
- off_t, o)
+ off_t, o)
+#endif
LSS_INLINE _syscall3(int, _sigaction, int, s,
const struct kernel_old_sigaction*, a,
struct kernel_old_sigaction*, o)
LSS_INLINE _syscall1(int, _sigpending, unsigned long*, s)
- LSS_INLINE _syscall3(int, _sigprocmask, int, h,
- const unsigned long*, s,
- unsigned long*, o)
#ifdef __PPC__
LSS_INLINE _syscall1(int, _sigsuspend, unsigned long, s)
#else
@@ -3545,23 +4019,6 @@ struct kernel_statfs {
return rc;
}
- LSS_INLINE int LSS_NAME(sigprocmask)(int how,
- const struct kernel_sigset_t *set,
- struct kernel_sigset_t *oldset) {
- int olderrno = LSS_ERRNO;
- int rc = LSS_NAME(rt_sigprocmask)(how, set, oldset, (KERNEL_NSIG+7)/8);
- if (rc < 0 && LSS_ERRNO == ENOSYS) {
- LSS_ERRNO = olderrno;
- if (oldset) {
- LSS_NAME(sigemptyset)(oldset);
- }
- rc = LSS_NAME(_sigprocmask)(how,
- set ? &set->sig[0] : NULL,
- oldset ? &oldset->sig[0] : NULL);
- }
- return rc;
- }
-
LSS_INLINE int LSS_NAME(sigsuspend)(const struct kernel_sigset_t *set) {
int olderrno = LSS_ERRNO;
int rc = LSS_NAME(rt_sigsuspend)(set, (KERNEL_NSIG+7)/8);
@@ -3576,6 +4033,43 @@ struct kernel_statfs {
return rc;
}
#endif
+ #if defined(__i386__) || \
+ defined(__ARM_ARCH_3__) || defined(__ARM_EABI__) || \
+ (defined(__mips__) && _MIPS_SIM == _MIPS_SIM_ABI32) || \
+ defined(__PPC__) || \
+ (defined(__s390__) && !defined(__s390x__))
+ /* On these architectures, implement mmap() with mmap2(). */
+ LSS_INLINE void* LSS_NAME(mmap)(void *s, size_t l, int p, int f, int d,
+ int64_t o) {
+ if (o % 4096) {
+ LSS_ERRNO = EINVAL;
+ return (void *) -1;
+ }
+ return LSS_NAME(_mmap2)(s, l, p, f, d, (o / 4096));
+ }
+ #elif defined(__s390x__)
+ /* On s390x, mmap() arguments are passed in memory. */
+ LSS_INLINE void* LSS_NAME(mmap)(void *s, size_t l, int p, int f, int d,
+ int64_t o) {
+ unsigned long buf[6] = { (unsigned long) s, (unsigned long) l,
+ (unsigned long) p, (unsigned long) f,
+ (unsigned long) d, (unsigned long) o };
+ LSS_REG(2, buf);
+ LSS_BODY(void*, mmap, "0"(__r2));
+ }
+ #elif defined(__x86_64__)
+ /* Need to make sure __off64_t isn't truncated to 32-bits under x32. */
+ LSS_INLINE void* LSS_NAME(mmap)(void *s, size_t l, int p, int f, int d,
+ int64_t o) {
+ LSS_BODY(6, void*, mmap, LSS_SYSCALL_ARG(s), LSS_SYSCALL_ARG(l),
+ LSS_SYSCALL_ARG(p), LSS_SYSCALL_ARG(f),
+ LSS_SYSCALL_ARG(d), (uint64_t)(o));
+ }
+ #else
+ /* Remaining 64-bit architectures. */
+ LSS_INLINE _syscall6(void*, mmap, void*, addr, size_t, length, int, prot,
+ int, flags, int, fd, int64_t, offset)
+ #endif
#if defined(__PPC__)
#undef LSS_SC_LOADARGS_0
#define LSS_SC_LOADARGS_0(dummy...)
@@ -3679,7 +4173,8 @@ struct kernel_statfs {
int*, sv)
#endif
#if defined(__i386__) || defined(__ARM_ARCH_3__) || \
- (defined(__mips__) && _MIPS_SIM == _MIPS_SIM_ABI32)
+ (defined(__mips__) && _MIPS_SIM == _MIPS_SIM_ABI32) || \
+ defined(__s390__)
#define __NR__socketcall __NR_socketcall
LSS_INLINE _syscall2(int, _socketcall, int, c,
va_list, a)
@@ -3723,13 +4218,13 @@ struct kernel_statfs {
return LSS_NAME(socketcall)(8, d, type, protocol, sv);
}
#endif
- #if defined(__i386__) || defined(__PPC__)
+ #if defined(__NR_fstatat64)
LSS_INLINE _syscall4(int, fstatat64, int, d,
const char *, p,
struct kernel_stat64 *, b, int, f)
#endif
- #if defined(__i386__) || defined(__PPC__) || \
- (defined(__mips__) && _MIPS_SIM == _MIPS_SIM_ABI32)
+ #if defined(__NR_waitpid)
+ // waitpid is polyfilled below when not available.
LSS_INLINE _syscall3(pid_t, waitpid, pid_t, p,
int*, s, int, o)
#endif
@@ -3756,14 +4251,18 @@ struct kernel_statfs {
return 0;
}
}
- #elif !defined(__aarch64__)
- // The unlink syscall has been deprecated on aarch64. We polyfill it below.
+ #elif defined(__NR_pipe)
+ // pipe is polyfilled below when not available.
LSS_INLINE _syscall1(int, pipe, int *, p)
#endif
+ #if defined(__NR_pipe2)
+ LSS_INLINE _syscall2(int, pipe2, int *, pipefd, int, flags)
+ #endif
/* TODO(csilvers): see if ppc can/should support this as well */
#if defined(__i386__) || defined(__ARM_ARCH_3__) || \
- defined(__ARM_EABI__) || \
- (defined(__mips__) && _MIPS_SIM != _MIPS_SIM_ABI64)
+ defined(__ARM_EABI__) || \
+ (defined(__mips__) && _MIPS_SIM != _MIPS_SIM_ABI64) || \
+ (defined(__s390__) && !defined(__s390x__))
#define __NR__statfs64 __NR_statfs64
#define __NR__fstatfs64 __NR_fstatfs64
LSS_INLINE _syscall3(int, _statfs64, const char*, p,
@@ -3835,26 +4334,6 @@ struct kernel_statfs {
return LSS_NAME(setpgid)(0, 0);
}
- LSS_INLINE int LSS_NAME(sysconf)(int name) {
- extern int __getpagesize(void);
- switch (name) {
- case _SC_OPEN_MAX: {
- struct kernel_rlimit limit;
-#if defined(__ARM_EABI__)
- return LSS_NAME(ugetrlimit)(RLIMIT_NOFILE, &limit) < 0
- ? 8192 : limit.rlim_cur;
-#else
- return LSS_NAME(getrlimit)(RLIMIT_NOFILE, &limit) < 0
- ? 8192 : limit.rlim_cur;
-#endif
- }
- case _SC_PAGESIZE:
- return __getpagesize();
- default:
- LSS_ERRNO = ENOSYS;
- return -1;
- }
- }
#if defined(__x86_64__)
/* Need to make sure loff_t isn't truncated to 32-bits under x32. */
LSS_INLINE ssize_t LSS_NAME(pread64)(int f, void *b, size_t c, loff_t o) {
@@ -3881,8 +4360,6 @@ struct kernel_statfs {
loff_t, o)
LSS_INLINE _syscall3(int, readahead, int, f,
loff_t, o, unsigned, c)
- LSS_INLINE _syscall6(void *, mmap, void *, addr, size_t, length, int, prot,
- int, flags, int, fd, int64_t, offset)
#else
#define __NR__pread64 __NR_pread64
#define __NR__pwrite64 __NR_pwrite64
@@ -3937,46 +4414,42 @@ struct kernel_statfs {
#endif
#endif
-#if defined(__aarch64__)
- LSS_INLINE _syscall3(int, dup3, int, s, int, d, int, f)
- LSS_INLINE _syscall6(void *, mmap, void *, addr, size_t, length, int, prot,
- int, flags, int, fd, int64_t, offset)
- LSS_INLINE _syscall4(int, newfstatat, int, dirfd, const char *, pathname,
- struct kernel_stat *, buf, int, flags)
- LSS_INLINE _syscall2(int, pipe2, int *, pipefd, int, flags)
- LSS_INLINE _syscall5(int, ppoll, struct kernel_pollfd *, u,
- unsigned int, n, const struct kernel_timespec *, t,
- const kernel_sigset_t *, sigmask, size_t, s)
- LSS_INLINE _syscall4(int, readlinkat, int, d, const char *, p, char *, b,
- size_t, s)
-#endif
-
/*
* Polyfills for deprecated syscalls.
*/
-#if defined(__aarch64__)
+#if !defined(__NR_dup2)
LSS_INLINE int LSS_NAME(dup2)(int s, int d) {
return LSS_NAME(dup3)(s, d, 0);
}
+#endif
+#if !defined(__NR_open)
LSS_INLINE int LSS_NAME(open)(const char *pathname, int flags, int mode) {
return LSS_NAME(openat)(AT_FDCWD, pathname, flags, mode);
}
+#endif
+#if !defined(__NR_unlink)
LSS_INLINE int LSS_NAME(unlink)(const char *pathname) {
return LSS_NAME(unlinkat)(AT_FDCWD, pathname, 0);
}
+#endif
+#if !defined(__NR_readlink)
LSS_INLINE int LSS_NAME(readlink)(const char *pathname, char *buffer,
size_t size) {
return LSS_NAME(readlinkat)(AT_FDCWD, pathname, buffer, size);
}
+#endif
- LSS_INLINE pid_t LSS_NAME(pipe)(int *pipefd) {
+#if !defined(__NR_pipe)
+ LSS_INLINE int LSS_NAME(pipe)(int *pipefd) {
return LSS_NAME(pipe2)(pipefd, 0);
}
+#endif
+#if !defined(__NR_poll)
LSS_INLINE int LSS_NAME(poll)(struct kernel_pollfd *fds, unsigned int nfds,
int timeout) {
struct kernel_timespec timeout_ts;
@@ -3989,12 +4462,26 @@ struct kernel_statfs {
}
return LSS_NAME(ppoll)(fds, nfds, timeout_ts_p, NULL, 0);
}
+#endif
+#if !defined(__NR_stat)
LSS_INLINE int LSS_NAME(stat)(const char *pathname,
struct kernel_stat *buf) {
return LSS_NAME(newfstatat)(AT_FDCWD, pathname, buf, 0);
}
+#endif
+
+#if !defined(__NR_waitpid)
+ LSS_INLINE pid_t LSS_NAME(waitpid)(pid_t pid, int *status, int options) {
+ return LSS_NAME(wait4)(pid, status, options, 0);
+ }
+#endif
+
+#if !defined(__NR_fork)
+// TODO: define this in an arch-independant way instead of inlining the clone
+// syscall body.
+# if defined(__aarch64__)
LSS_INLINE pid_t LSS_NAME(fork)(void) {
// No fork syscall on aarch64 - implement by means of the clone syscall.
// Note that this does not reset glibc's cached view of the PID/TID, so
@@ -4013,15 +4500,33 @@ struct kernel_statfs {
LSS_BODY(pid_t, clone, "r"(__r0), "r"(__r1), "r"(__r2), "r"(__r3),
"r"(__r4));
}
-#endif
+# elif defined(__x86_64__)
+ LSS_INLINE pid_t LSS_NAME(fork)(void) {
+ // Android disallows the fork syscall on x86_64 - implement by means of the
+ // clone syscall as above for aarch64.
+ int flags = SIGCHLD;
+ void *child_stack = NULL;
+ void *parent_tidptr = NULL;
+ void *newtls = NULL;
+ void *child_tidptr = NULL;
-#ifdef __ANDROID__
- /* These restore the original values of these macros saved by the
- * corresponding #pragma push_macro near the top of this file. */
-# pragma pop_macro("stat64")
-# pragma pop_macro("fstat64")
-# pragma pop_macro("lstat64")
-#endif
+ LSS_BODY(5, pid_t, clone, LSS_SYSCALL_ARG(flags),
+ LSS_SYSCALL_ARG(child_stack), LSS_SYSCALL_ARG(parent_tidptr),
+ LSS_SYSCALL_ARG(newtls), LSS_SYSCALL_ARG(child_tidptr));
+ }
+# else
+# error missing fork polyfill for this architecture
+# endif
+#endif
+
+/* These restore the original values of these macros saved by the
+ * corresponding #pragma push_macro near the top of this file. */
+#pragma pop_macro("stat64")
+#pragma pop_macro("fstat64")
+#pragma pop_macro("lstat64")
+#pragma pop_macro("pread64")
+#pragma pop_macro("pwrite64")
+#pragma pop_macro("getdents64")
#if defined(__cplusplus) && !defined(SYS_CPLUSPLUS)
}
diff --git a/src/third_party/mac_headers/README b/src/third_party/mac_headers/README
new file mode 100644
index 00000000..c681bb3d
--- /dev/null
+++ b/src/third_party/mac_headers/README
@@ -0,0 +1,2 @@
+These headers were copied from the Mac OS X 10.7 SDK to enable building
+the Mac dump_syms code that processes Mach-O files on Linux.
diff --git a/src/third_party/mac_headers/architecture/byte_order.h b/src/third_party/mac_headers/architecture/byte_order.h
new file mode 100644
index 00000000..b772d9f3
--- /dev/null
+++ b/src/third_party/mac_headers/architecture/byte_order.h
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 1999-2008 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ *
+ * This file contains Original Code and/or Modifications of Original Code
+ * as defined in and that are subject to the Apple Public Source License
+ * Version 2.0 (the 'License'). You may not use this file except in
+ * compliance with the License. Please obtain a copy of the License at
+ * http://www.opensource.apple.com/apsl/ and read it before using this
+ * file.
+ *
+ * The Original Code and all software distributed under the License are
+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
+ * Please see the License for the specific language governing rights and
+ * limitations under the License.
+ *
+ * @APPLE_LICENSE_HEADER_END@
+ */
+/*
+ * Copyright (c) 1992 NeXT Computer, Inc.
+ *
+ * Byte ordering conversion.
+ *
+ */
+/* This file mostly left blank */
+
+#ifndef _ARCHITECTURE_BYTE_ORDER_H_
+#define _ARCHITECTURE_BYTE_ORDER_H_
+
+/*
+ * Identify the byte order
+ * of the current host.
+ */
+
+enum NXByteOrder {
+ NX_UnknownByteOrder,
+ NX_LittleEndian,
+ NX_BigEndian
+};
+
+#endif /* _ARCHITECTURE_BYTE_ORDER_H_ */
diff --git a/src/third_party/mac_headers/i386/_types.h b/src/third_party/mac_headers/i386/_types.h
new file mode 100644
index 00000000..2ed7fd67
--- /dev/null
+++ b/src/third_party/mac_headers/i386/_types.h
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2000-2003 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
+ *
+ * This file contains Original Code and/or Modifications of Original Code
+ * as defined in and that are subject to the Apple Public Source License
+ * Version 2.0 (the 'License'). You may not use this file except in
+ * compliance with the License. The rights granted to you under the License
+ * may not be used to create, or enable the creation or redistribution of,
+ * unlawful or unlicensed copies of an Apple operating system, or to
+ * circumvent, violate, or enable the circumvention or violation of, any
+ * terms of an Apple operating system software license agreement.
+ *
+ * Please obtain a copy of the License at
+ * http://www.opensource.apple.com/apsl/ and read it before using this file.
+ *
+ * The Original Code and all software distributed under the License are
+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
+ * Please see the License for the specific language governing rights and
+ * limitations under the License.
+ *
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
+ */
+#ifndef _BSD_I386__TYPES_H_
+#define _BSD_I386__TYPES_H_
+
+typedef long __darwin_intptr_t;
+typedef unsigned int __darwin_natural_t;
+
+#endif /* _BSD_I386__TYPES_H_ */
diff --git a/src/third_party/mac_headers/mach-o/arch.h b/src/third_party/mac_headers/mach-o/arch.h
new file mode 100644
index 00000000..526c10fc
--- /dev/null
+++ b/src/third_party/mac_headers/mach-o/arch.h
@@ -0,0 +1,105 @@
+/*
+ * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ *
+ * This file contains Original Code and/or Modifications of Original Code
+ * as defined in and that are subject to the Apple Public Source License
+ * Version 2.0 (the 'License'). You may not use this file except in
+ * compliance with the License. Please obtain a copy of the License at
+ * http://www.opensource.apple.com/apsl/ and read it before using this
+ * file.
+ *
+ * The Original Code and all software distributed under the License are
+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
+ * Please see the License for the specific language governing rights and
+ * limitations under the License.
+ *
+ * @APPLE_LICENSE_HEADER_END@
+ */
+#ifndef _MACH_O_ARCH_H_
+#define _MACH_O_ARCH_H_
+/*
+ * Copyright (c) 1997 Apple Computer, Inc.
+ *
+ * Functions that deal with information about architectures.
+ *
+ */
+
+#include <stdint.h>
+#include <mach/machine.h>
+#include <architecture/byte_order.h>
+
+/* The NXArchInfo structs contain the architectures symbolic name
+ * (such as "ppc"), its CPU type and CPU subtype as defined in
+ * mach/machine.h, the byte order for the architecture, and a
+ * describing string (such as "PowerPC").
+ * There will both be entries for specific CPUs (such as ppc604e) as
+ * well as generic "family" entries (such as ppc).
+ */
+typedef struct {
+ const char *name;
+ cpu_type_t cputype;
+ cpu_subtype_t cpusubtype;
+ enum NXByteOrder byteorder;
+ const char *description;
+} NXArchInfo;
+
+#if __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/* NXGetAllArchInfos() returns a pointer to an array of all known
+ * NXArchInfo structures. The last NXArchInfo is marked by a NULL name.
+ */
+extern const NXArchInfo *NXGetAllArchInfos(void);
+
+/* NXGetLocalArchInfo() returns the NXArchInfo for the local host, or NULL
+ * if none is known.
+ */
+extern const NXArchInfo *NXGetLocalArchInfo(void);
+
+/* NXGetArchInfoFromName() and NXGetArchInfoFromCpuType() return the
+ * NXArchInfo from the architecture's name or cputype/cpusubtype
+ * combination. A cpusubtype of CPU_SUBTYPE_MULTIPLE can be used
+ * to request the most general NXArchInfo known for the given cputype.
+ * NULL is returned if no matching NXArchInfo can be found.
+ */
+extern const NXArchInfo *NXGetArchInfoFromName(const char *name);
+extern const NXArchInfo *NXGetArchInfoFromCpuType(cpu_type_t cputype,
+ cpu_subtype_t cpusubtype);
+
+/* NXFindBestFatArch() is passed a cputype and cpusubtype and a set of
+ * fat_arch structs and selects the best one that matches (if any) and returns
+ * a pointer to that fat_arch struct (or NULL). The fat_arch structs must be
+ * in the host byte order and correct such that the fat_archs really points to
+ * enough memory for nfat_arch structs. It is possible that this routine could
+ * fail if new cputypes or cpusubtypes are added and an old version of this
+ * routine is used. But if there is an exact match between the cputype and
+ * cpusubtype and one of the fat_arch structs this routine will always succeed.
+ */
+extern struct fat_arch *NXFindBestFatArch(cpu_type_t cputype,
+ cpu_subtype_t cpusubtype,
+ struct fat_arch *fat_archs,
+ uint32_t nfat_archs);
+
+/* NXCombineCpuSubtypes() returns the resulting cpusubtype when combining two
+ * different cpusubtypes for the specified cputype. If the two cpusubtypes
+ * can't be combined (the specific subtypes are mutually exclusive) -1 is
+ * returned indicating it is an error to combine them. This can also fail and
+ * return -1 if new cputypes or cpusubtypes are added and an old version of
+ * this routine is used. But if the cpusubtypes are the same they can always
+ * be combined and this routine will return the cpusubtype pass in.
+ */
+extern cpu_subtype_t NXCombineCpuSubtypes(cpu_type_t cputype,
+ cpu_subtype_t cpusubtype1,
+ cpu_subtype_t cpusubtype2);
+
+#if __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* _MACH_O_ARCH_H_ */
diff --git a/src/third_party/mac_headers/mach-o/fat.h b/src/third_party/mac_headers/mach-o/fat.h
new file mode 100644
index 00000000..e2bcf433
--- /dev/null
+++ b/src/third_party/mac_headers/mach-o/fat.h
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ *
+ * This file contains Original Code and/or Modifications of Original Code
+ * as defined in and that are subject to the Apple Public Source License
+ * Version 2.0 (the 'License'). You may not use this file except in
+ * compliance with the License. Please obtain a copy of the License at
+ * http://www.opensource.apple.com/apsl/ and read it before using this
+ * file.
+ *
+ * The Original Code and all software distributed under the License are
+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
+ * Please see the License for the specific language governing rights and
+ * limitations under the License.
+ *
+ * @APPLE_LICENSE_HEADER_END@
+ */
+#ifndef _MACH_O_FAT_H_
+#define _MACH_O_FAT_H_
+/*
+ * This header file describes the structures of the file format for "fat"
+ * architecture specific file (wrapper design). At the begining of the file
+ * there is one fat_header structure followed by a number of fat_arch
+ * structures. For each architecture in the file, specified by a pair of
+ * cputype and cpusubtype, the fat_header describes the file offset, file
+ * size and alignment in the file of the architecture specific member.
+ * The padded bytes in the file to place each member on it's specific alignment
+ * are defined to be read as zeros and can be left as "holes" if the file system
+ * can support them as long as they read as zeros.
+ *
+ * All structures defined here are always written and read to/from disk
+ * in big-endian order.
+ */
+
+/*
+ * <mach/machine.h> is needed here for the cpu_type_t and cpu_subtype_t types
+ * and contains the constants for the possible values of these types.
+ */
+#include <stdint.h>
+#include <mach/machine.h>
+#include <architecture/byte_order.h>
+
+#define FAT_MAGIC 0xcafebabe
+#define FAT_CIGAM 0xbebafeca /* NXSwapLong(FAT_MAGIC) */
+
+struct fat_header {
+ uint32_t magic; /* FAT_MAGIC */
+ uint32_t nfat_arch; /* number of structs that follow */
+};
+
+struct fat_arch {
+ cpu_type_t cputype; /* cpu specifier (int) */
+ cpu_subtype_t cpusubtype; /* machine specifier (int) */
+ uint32_t offset; /* file offset to this object file */
+ uint32_t size; /* size of this object file */
+ uint32_t align; /* alignment as a power of 2 */
+};
+
+#endif /* _MACH_O_FAT_H_ */
diff --git a/src/third_party/mac_headers/mach-o/loader.h b/src/third_party/mac_headers/mach-o/loader.h
new file mode 100644
index 00000000..ff18e29c
--- /dev/null
+++ b/src/third_party/mac_headers/mach-o/loader.h
@@ -0,0 +1,1402 @@
+/*
+ * Copyright (c) 1999-2010 Apple Inc. All Rights Reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ *
+ * This file contains Original Code and/or Modifications of Original Code
+ * as defined in and that are subject to the Apple Public Source License
+ * Version 2.0 (the 'License'). You may not use this file except in
+ * compliance with the License. Please obtain a copy of the License at
+ * http://www.opensource.apple.com/apsl/ and read it before using this
+ * file.
+ *
+ * The Original Code and all software distributed under the License are
+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
+ * Please see the License for the specific language governing rights and
+ * limitations under the License.
+ *
+ * @APPLE_LICENSE_HEADER_END@
+ */
+#ifndef _MACHO_LOADER_H_
+#define _MACHO_LOADER_H_
+
+/*
+ * This file describes the format of mach object files.
+ */
+#include <stdint.h>
+
+/*
+ * <mach/machine.h> is needed here for the cpu_type_t and cpu_subtype_t types
+ * and contains the constants for the possible values of these types.
+ */
+#include <mach/machine.h>
+
+/*
+ * <mach/vm_prot.h> is needed here for the vm_prot_t type and contains the
+ * constants that are or'ed together for the possible values of this type.
+ */
+#include <mach/vm_prot.h>
+
+/*
+ * <machine/thread_status.h> is expected to define the flavors of the thread
+ * states and the structures of those flavors for each machine.
+ */
+#include <mach/machine/thread_status.h>
+#include <architecture/byte_order.h>
+
+/*
+ * The 32-bit mach header appears at the very beginning of the object file for
+ * 32-bit architectures.
+ */
+struct mach_header {
+ uint32_t magic; /* mach magic number identifier */
+ cpu_type_t cputype; /* cpu specifier */
+ cpu_subtype_t cpusubtype; /* machine specifier */
+ uint32_t filetype; /* type of file */
+ uint32_t ncmds; /* number of load commands */
+ uint32_t sizeofcmds; /* the size of all the load commands */
+ uint32_t flags; /* flags */
+};
+
+/* Constant for the magic field of the mach_header (32-bit architectures) */
+#define MH_MAGIC 0xfeedface /* the mach magic number */
+#define MH_CIGAM 0xcefaedfe /* NXSwapInt(MH_MAGIC) */
+
+/*
+ * The 64-bit mach header appears at the very beginning of object files for
+ * 64-bit architectures.
+ */
+struct mach_header_64 {
+ uint32_t magic; /* mach magic number identifier */
+ cpu_type_t cputype; /* cpu specifier */
+ cpu_subtype_t cpusubtype; /* machine specifier */
+ uint32_t filetype; /* type of file */
+ uint32_t ncmds; /* number of load commands */
+ uint32_t sizeofcmds; /* the size of all the load commands */
+ uint32_t flags; /* flags */
+ uint32_t reserved; /* reserved */
+};
+
+/* Constant for the magic field of the mach_header_64 (64-bit architectures) */
+#define MH_MAGIC_64 0xfeedfacf /* the 64-bit mach magic number */
+#define MH_CIGAM_64 0xcffaedfe /* NXSwapInt(MH_MAGIC_64) */
+
+/*
+ * The layout of the file depends on the filetype. For all but the MH_OBJECT
+ * file type the segments are padded out and aligned on a segment alignment
+ * boundary for efficient demand pageing. The MH_EXECUTE, MH_FVMLIB, MH_DYLIB,
+ * MH_DYLINKER and MH_BUNDLE file types also have the headers included as part
+ * of their first segment.
+ *
+ * The file type MH_OBJECT is a compact format intended as output of the
+ * assembler and input (and possibly output) of the link editor (the .o
+ * format). All sections are in one unnamed segment with no segment padding.
+ * This format is used as an executable format when the file is so small the
+ * segment padding greatly increases its size.
+ *
+ * The file type MH_PRELOAD is an executable format intended for things that
+ * are not executed under the kernel (proms, stand alones, kernels, etc). The
+ * format can be executed under the kernel but may demand paged it and not
+ * preload it before execution.
+ *
+ * A core file is in MH_CORE format and can be any in an arbritray legal
+ * Mach-O file.
+ *
+ * Constants for the filetype field of the mach_header
+ */
+#define MH_OBJECT 0x1 /* relocatable object file */
+#define MH_EXECUTE 0x2 /* demand paged executable file */
+#define MH_FVMLIB 0x3 /* fixed VM shared library file */
+#define MH_CORE 0x4 /* core file */
+#define MH_PRELOAD 0x5 /* preloaded executable file */
+#define MH_DYLIB 0x6 /* dynamically bound shared library */
+#define MH_DYLINKER 0x7 /* dynamic link editor */
+#define MH_BUNDLE 0x8 /* dynamically bound bundle file */
+#define MH_DYLIB_STUB 0x9 /* shared library stub for static */
+ /* linking only, no section contents */
+#define MH_DSYM 0xa /* companion file with only debug */
+ /* sections */
+#define MH_KEXT_BUNDLE 0xb /* x86_64 kexts */
+
+/* Constants for the flags field of the mach_header */
+#define MH_NOUNDEFS 0x1 /* the object file has no undefined
+ references */
+#define MH_INCRLINK 0x2 /* the object file is the output of an
+ incremental link against a base file
+ and can't be link edited again */
+#define MH_DYLDLINK 0x4 /* the object file is input for the
+ dynamic linker and can't be staticly
+ link edited again */
+#define MH_BINDATLOAD 0x8 /* the object file's undefined
+ references are bound by the dynamic
+ linker when loaded. */
+#define MH_PREBOUND 0x10 /* the file has its dynamic undefined
+ references prebound. */
+#define MH_SPLIT_SEGS 0x20 /* the file has its read-only and
+ read-write segments split */
+#define MH_LAZY_INIT 0x40 /* the shared library init routine is
+ to be run lazily via catching memory
+ faults to its writeable segments
+ (obsolete) */
+#define MH_TWOLEVEL 0x80 /* the image is using two-level name
+ space bindings */
+#define MH_FORCE_FLAT 0x100 /* the executable is forcing all images
+ to use flat name space bindings */
+#define MH_NOMULTIDEFS 0x200 /* this umbrella guarantees no multiple
+ defintions of symbols in its
+ sub-images so the two-level namespace
+ hints can always be used. */
+#define MH_NOFIXPREBINDING 0x400 /* do not have dyld notify the
+ prebinding agent about this
+ executable */
+#define MH_PREBINDABLE 0x800 /* the binary is not prebound but can
+ have its prebinding redone. only used
+ when MH_PREBOUND is not set. */
+#define MH_ALLMODSBOUND 0x1000 /* indicates that this binary binds to
+ all two-level namespace modules of
+ its dependent libraries. only used
+ when MH_PREBINDABLE and MH_TWOLEVEL
+ are both set. */
+#define MH_SUBSECTIONS_VIA_SYMBOLS 0x2000/* safe to divide up the sections into
+ sub-sections via symbols for dead
+ code stripping */
+#define MH_CANONICAL 0x4000 /* the binary has been canonicalized
+ via the unprebind operation */
+#define MH_WEAK_DEFINES 0x8000 /* the final linked image contains
+ external weak symbols */
+#define MH_BINDS_TO_WEAK 0x10000 /* the final linked image uses
+ weak symbols */
+
+#define MH_ALLOW_STACK_EXECUTION 0x20000/* When this bit is set, all stacks
+ in the task will be given stack
+ execution privilege. Only used in
+ MH_EXECUTE filetypes. */
+#define MH_ROOT_SAFE 0x40000 /* When this bit is set, the binary
+ declares it is safe for use in
+ processes with uid zero */
+
+#define MH_SETUID_SAFE 0x80000 /* When this bit is set, the binary
+ declares it is safe for use in
+ processes when issetugid() is true */
+
+#define MH_NO_REEXPORTED_DYLIBS 0x100000 /* When this bit is set on a dylib,
+ the static linker does not need to
+ examine dependent dylibs to see
+ if any are re-exported */
+#define MH_PIE 0x200000 /* When this bit is set, the OS will
+ load the main executable at a
+ random address. Only used in
+ MH_EXECUTE filetypes. */
+#define MH_DEAD_STRIPPABLE_DYLIB 0x400000 /* Only for use on dylibs. When
+ linking against a dylib that
+ has this bit set, the static linker
+ will automatically not create a
+ LC_LOAD_DYLIB load command to the
+ dylib if no symbols are being
+ referenced from the dylib. */
+#define MH_HAS_TLV_DESCRIPTORS 0x800000 /* Contains a section of type
+ S_THREAD_LOCAL_VARIABLES */
+
+#define MH_NO_HEAP_EXECUTION 0x1000000 /* When this bit is set, the OS will
+ run the main executable with
+ a non-executable heap even on
+ platforms (e.g. i386) that don't
+ require it. Only used in MH_EXECUTE
+ filetypes. */
+
+/*
+ * The load commands directly follow the mach_header. The total size of all
+ * of the commands is given by the sizeofcmds field in the mach_header. All
+ * load commands must have as their first two fields cmd and cmdsize. The cmd
+ * field is filled in with a constant for that command type. Each command type
+ * has a structure specifically for it. The cmdsize field is the size in bytes
+ * of the particular load command structure plus anything that follows it that
+ * is a part of the load command (i.e. section structures, strings, etc.). To
+ * advance to the next load command the cmdsize can be added to the offset or
+ * pointer of the current load command. The cmdsize for 32-bit architectures
+ * MUST be a multiple of 4 bytes and for 64-bit architectures MUST be a multiple
+ * of 8 bytes (these are forever the maximum alignment of any load commands).
+ * The padded bytes must be zero. All tables in the object file must also
+ * follow these rules so the file can be memory mapped. Otherwise the pointers
+ * to these tables will not work well or at all on some machines. With all
+ * padding zeroed like objects will compare byte for byte.
+ */
+struct load_command {
+ uint32_t cmd; /* type of load command */
+ uint32_t cmdsize; /* total size of command in bytes */
+};
+
+/*
+ * After MacOS X 10.1 when a new load command is added that is required to be
+ * understood by the dynamic linker for the image to execute properly the
+ * LC_REQ_DYLD bit will be or'ed into the load command constant. If the dynamic
+ * linker sees such a load command it it does not understand will issue a
+ * "unknown load command required for execution" error and refuse to use the
+ * image. Other load commands without this bit that are not understood will
+ * simply be ignored.
+ */
+#define LC_REQ_DYLD 0x80000000
+
+/* Constants for the cmd field of all load commands, the type */
+#define LC_SEGMENT 0x1 /* segment of this file to be mapped */
+#define LC_SYMTAB 0x2 /* link-edit stab symbol table info */
+#define LC_SYMSEG 0x3 /* link-edit gdb symbol table info (obsolete) */
+#define LC_THREAD 0x4 /* thread */
+#define LC_UNIXTHREAD 0x5 /* unix thread (includes a stack) */
+#define LC_LOADFVMLIB 0x6 /* load a specified fixed VM shared library */
+#define LC_IDFVMLIB 0x7 /* fixed VM shared library identification */
+#define LC_IDENT 0x8 /* object identification info (obsolete) */
+#define LC_FVMFILE 0x9 /* fixed VM file inclusion (internal use) */
+#define LC_PREPAGE 0xa /* prepage command (internal use) */
+#define LC_DYSYMTAB 0xb /* dynamic link-edit symbol table info */
+#define LC_LOAD_DYLIB 0xc /* load a dynamically linked shared library */
+#define LC_ID_DYLIB 0xd /* dynamically linked shared lib ident */
+#define LC_LOAD_DYLINKER 0xe /* load a dynamic linker */
+#define LC_ID_DYLINKER 0xf /* dynamic linker identification */
+#define LC_PREBOUND_DYLIB 0x10 /* modules prebound for a dynamically */
+ /* linked shared library */
+#define LC_ROUTINES 0x11 /* image routines */
+#define LC_SUB_FRAMEWORK 0x12 /* sub framework */
+#define LC_SUB_UMBRELLA 0x13 /* sub umbrella */
+#define LC_SUB_CLIENT 0x14 /* sub client */
+#define LC_SUB_LIBRARY 0x15 /* sub library */
+#define LC_TWOLEVEL_HINTS 0x16 /* two-level namespace lookup hints */
+#define LC_PREBIND_CKSUM 0x17 /* prebind checksum */
+
+/*
+ * load a dynamically linked shared library that is allowed to be missing
+ * (all symbols are weak imported).
+ */
+#define LC_LOAD_WEAK_DYLIB (0x18 | LC_REQ_DYLD)
+
+#define LC_SEGMENT_64 0x19 /* 64-bit segment of this file to be
+ mapped */
+#define LC_ROUTINES_64 0x1a /* 64-bit image routines */
+#define LC_UUID 0x1b /* the uuid */
+#define LC_RPATH (0x1c | LC_REQ_DYLD) /* runpath additions */
+#define LC_CODE_SIGNATURE 0x1d /* local of code signature */
+#define LC_SEGMENT_SPLIT_INFO 0x1e /* local of info to split segments */
+#define LC_REEXPORT_DYLIB (0x1f | LC_REQ_DYLD) /* load and re-export dylib */
+#define LC_LAZY_LOAD_DYLIB 0x20 /* delay load of dylib until first use */
+#define LC_ENCRYPTION_INFO 0x21 /* encrypted segment information */
+#define LC_DYLD_INFO 0x22 /* compressed dyld information */
+#define LC_DYLD_INFO_ONLY (0x22|LC_REQ_DYLD) /* compressed dyld information only */
+#define LC_LOAD_UPWARD_DYLIB (0x23 | LC_REQ_DYLD) /* load upward dylib */
+#define LC_VERSION_MIN_MACOSX 0x24 /* build for MacOSX min OS version */
+#define LC_VERSION_MIN_IPHONEOS 0x25 /* build for iPhoneOS min OS version */
+#define LC_FUNCTION_STARTS 0x26 /* compressed table of function start addresses */
+#define LC_DYLD_ENVIRONMENT 0x27 /* string for dyld to treat
+ like environment variable */
+
+/*
+ * A variable length string in a load command is represented by an lc_str
+ * union. The strings are stored just after the load command structure and
+ * the offset is from the start of the load command structure. The size
+ * of the string is reflected in the cmdsize field of the load command.
+ * Once again any padded bytes to bring the cmdsize field to a multiple
+ * of 4 bytes must be zero.
+ */
+union lc_str {
+ uint32_t offset; /* offset to the string */
+#ifndef __LP64__
+ char *ptr; /* pointer to the string */
+#endif
+};
+
+/*
+ * The segment load command indicates that a part of this file is to be
+ * mapped into the task's address space. The size of this segment in memory,
+ * vmsize, maybe equal to or larger than the amount to map from this file,
+ * filesize. The file is mapped starting at fileoff to the beginning of
+ * the segment in memory, vmaddr. The rest of the memory of the segment,
+ * if any, is allocated zero fill on demand. The segment's maximum virtual
+ * memory protection and initial virtual memory protection are specified
+ * by the maxprot and initprot fields. If the segment has sections then the
+ * section structures directly follow the segment command and their size is
+ * reflected in cmdsize.
+ */
+struct segment_command { /* for 32-bit architectures */
+ uint32_t cmd; /* LC_SEGMENT */
+ uint32_t cmdsize; /* includes sizeof section structs */
+ char segname[16]; /* segment name */
+ uint32_t vmaddr; /* memory address of this segment */
+ uint32_t vmsize; /* memory size of this segment */
+ uint32_t fileoff; /* file offset of this segment */
+ uint32_t filesize; /* amount to map from the file */
+ vm_prot_t maxprot; /* maximum VM protection */
+ vm_prot_t initprot; /* initial VM protection */
+ uint32_t nsects; /* number of sections in segment */
+ uint32_t flags; /* flags */
+};
+
+/*
+ * The 64-bit segment load command indicates that a part of this file is to be
+ * mapped into a 64-bit task's address space. If the 64-bit segment has
+ * sections then section_64 structures directly follow the 64-bit segment
+ * command and their size is reflected in cmdsize.
+ */
+struct segment_command_64 { /* for 64-bit architectures */
+ uint32_t cmd; /* LC_SEGMENT_64 */
+ uint32_t cmdsize; /* includes sizeof section_64 structs */
+ char segname[16]; /* segment name */
+ uint64_t vmaddr; /* memory address of this segment */
+ uint64_t vmsize; /* memory size of this segment */
+ uint64_t fileoff; /* file offset of this segment */
+ uint64_t filesize; /* amount to map from the file */
+ vm_prot_t maxprot; /* maximum VM protection */
+ vm_prot_t initprot; /* initial VM protection */
+ uint32_t nsects; /* number of sections in segment */
+ uint32_t flags; /* flags */
+};
+
+/* Constants for the flags field of the segment_command */
+#define SG_HIGHVM 0x1 /* the file contents for this segment is for
+ the high part of the VM space, the low part
+ is zero filled (for stacks in core files) */
+#define SG_FVMLIB 0x2 /* this segment is the VM that is allocated by
+ a fixed VM library, for overlap checking in
+ the link editor */
+#define SG_NORELOC 0x4 /* this segment has nothing that was relocated
+ in it and nothing relocated to it, that is
+ it maybe safely replaced without relocation*/
+#define SG_PROTECTED_VERSION_1 0x8 /* This segment is protected. If the
+ segment starts at file offset 0, the
+ first page of the segment is not
+ protected. All other pages of the
+ segment are protected. */
+
+/*
+ * A segment is made up of zero or more sections. Non-MH_OBJECT files have
+ * all of their segments with the proper sections in each, and padded to the
+ * specified segment alignment when produced by the link editor. The first
+ * segment of a MH_EXECUTE and MH_FVMLIB format file contains the mach_header
+ * and load commands of the object file before its first section. The zero
+ * fill sections are always last in their segment (in all formats). This
+ * allows the zeroed segment padding to be mapped into memory where zero fill
+ * sections might be. The gigabyte zero fill sections, those with the section
+ * type S_GB_ZEROFILL, can only be in a segment with sections of this type.
+ * These segments are then placed after all other segments.
+ *
+ * The MH_OBJECT format has all of its sections in one segment for
+ * compactness. There is no padding to a specified segment boundary and the
+ * mach_header and load commands are not part of the segment.
+ *
+ * Sections with the same section name, sectname, going into the same segment,
+ * segname, are combined by the link editor. The resulting section is aligned
+ * to the maximum alignment of the combined sections and is the new section's
+ * alignment. The combined sections are aligned to their original alignment in
+ * the combined section. Any padded bytes to get the specified alignment are
+ * zeroed.
+ *
+ * The format of the relocation entries referenced by the reloff and nreloc
+ * fields of the section structure for mach object files is described in the
+ * header file <reloc.h>.
+ */
+struct section { /* for 32-bit architectures */
+ char sectname[16]; /* name of this section */
+ char segname[16]; /* segment this section goes in */
+ uint32_t addr; /* memory address of this section */
+ uint32_t size; /* size in bytes of this section */
+ uint32_t offset; /* file offset of this section */
+ uint32_t align; /* section alignment (power of 2) */
+ uint32_t reloff; /* file offset of relocation entries */
+ uint32_t nreloc; /* number of relocation entries */
+ uint32_t flags; /* flags (section type and attributes)*/
+ uint32_t reserved1; /* reserved (for offset or index) */
+ uint32_t reserved2; /* reserved (for count or sizeof) */
+};
+
+struct section_64 { /* for 64-bit architectures */
+ char sectname[16]; /* name of this section */
+ char segname[16]; /* segment this section goes in */
+ uint64_t addr; /* memory address of this section */
+ uint64_t size; /* size in bytes of this section */
+ uint32_t offset; /* file offset of this section */
+ uint32_t align; /* section alignment (power of 2) */
+ uint32_t reloff; /* file offset of relocation entries */
+ uint32_t nreloc; /* number of relocation entries */
+ uint32_t flags; /* flags (section type and attributes)*/
+ uint32_t reserved1; /* reserved (for offset or index) */
+ uint32_t reserved2; /* reserved (for count or sizeof) */
+ uint32_t reserved3; /* reserved */
+};
+
+/*
+ * The flags field of a section structure is separated into two parts a section
+ * type and section attributes. The section types are mutually exclusive (it
+ * can only have one type) but the section attributes are not (it may have more
+ * than one attribute).
+ */
+#define SECTION_TYPE 0x000000ff /* 256 section types */
+#define SECTION_ATTRIBUTES 0xffffff00 /* 24 section attributes */
+
+/* Constants for the type of a section */
+#define S_REGULAR 0x0 /* regular section */
+#define S_ZEROFILL 0x1 /* zero fill on demand section */
+#define S_CSTRING_LITERALS 0x2 /* section with only literal C strings*/
+#define S_4BYTE_LITERALS 0x3 /* section with only 4 byte literals */
+#define S_8BYTE_LITERALS 0x4 /* section with only 8 byte literals */
+#define S_LITERAL_POINTERS 0x5 /* section with only pointers to */
+ /* literals */
+/*
+ * For the two types of symbol pointers sections and the symbol stubs section
+ * they have indirect symbol table entries. For each of the entries in the
+ * section the indirect symbol table entries, in corresponding order in the
+ * indirect symbol table, start at the index stored in the reserved1 field
+ * of the section structure. Since the indirect symbol table entries
+ * correspond to the entries in the section the number of indirect symbol table
+ * entries is inferred from the size of the section divided by the size of the
+ * entries in the section. For symbol pointers sections the size of the entries
+ * in the section is 4 bytes and for symbol stubs sections the byte size of the
+ * stubs is stored in the reserved2 field of the section structure.
+ */
+#define S_NON_LAZY_SYMBOL_POINTERS 0x6 /* section with only non-lazy
+ symbol pointers */
+#define S_LAZY_SYMBOL_POINTERS 0x7 /* section with only lazy symbol
+ pointers */
+#define S_SYMBOL_STUBS 0x8 /* section with only symbol
+ stubs, byte size of stub in
+ the reserved2 field */
+#define S_MOD_INIT_FUNC_POINTERS 0x9 /* section with only function
+ pointers for initialization*/
+#define S_MOD_TERM_FUNC_POINTERS 0xa /* section with only function
+ pointers for termination */
+#define S_COALESCED 0xb /* section contains symbols that
+ are to be coalesced */
+#define S_GB_ZEROFILL 0xc /* zero fill on demand section
+ (that can be larger than 4
+ gigabytes) */
+#define S_INTERPOSING 0xd /* section with only pairs of
+ function pointers for
+ interposing */
+#define S_16BYTE_LITERALS 0xe /* section with only 16 byte
+ literals */
+#define S_DTRACE_DOF 0xf /* section contains
+ DTrace Object Format */
+#define S_LAZY_DYLIB_SYMBOL_POINTERS 0x10 /* section with only lazy
+ symbol pointers to lazy
+ loaded dylibs */
+/*
+ * Section types to support thread local variables
+ */
+#define S_THREAD_LOCAL_REGULAR 0x11 /* template of initial
+ values for TLVs */
+#define S_THREAD_LOCAL_ZEROFILL 0x12 /* template of initial
+ values for TLVs */
+#define S_THREAD_LOCAL_VARIABLES 0x13 /* TLV descriptors */
+#define S_THREAD_LOCAL_VARIABLE_POINTERS 0x14 /* pointers to TLV
+ descriptors */
+#define S_THREAD_LOCAL_INIT_FUNCTION_POINTERS 0x15 /* functions to call
+ to initialize TLV
+ values */
+
+/*
+ * Constants for the section attributes part of the flags field of a section
+ * structure.
+ */
+#define SECTION_ATTRIBUTES_USR 0xff000000 /* User setable attributes */
+#define S_ATTR_PURE_INSTRUCTIONS 0x80000000 /* section contains only true
+ machine instructions */
+#define S_ATTR_NO_TOC 0x40000000 /* section contains coalesced
+ symbols that are not to be
+ in a ranlib table of
+ contents */
+#define S_ATTR_STRIP_STATIC_SYMS 0x20000000 /* ok to strip static symbols
+ in this section in files
+ with the MH_DYLDLINK flag */
+#define S_ATTR_NO_DEAD_STRIP 0x10000000 /* no dead stripping */
+#define S_ATTR_LIVE_SUPPORT 0x08000000 /* blocks are live if they
+ reference live blocks */
+#define S_ATTR_SELF_MODIFYING_CODE 0x04000000 /* Used with i386 code stubs
+ written on by dyld */
+/*
+ * If a segment contains any sections marked with S_ATTR_DEBUG then all
+ * sections in that segment must have this attribute. No section other than
+ * a section marked with this attribute may reference the contents of this
+ * section. A section with this attribute may contain no symbols and must have
+ * a section type S_REGULAR. The static linker will not copy section contents
+ * from sections with this attribute into its output file. These sections
+ * generally contain DWARF debugging info.
+ */
+#define S_ATTR_DEBUG 0x02000000 /* a debug section */
+#define SECTION_ATTRIBUTES_SYS 0x00ffff00 /* system setable attributes */
+#define S_ATTR_SOME_INSTRUCTIONS 0x00000400 /* section contains some
+ machine instructions */
+#define S_ATTR_EXT_RELOC 0x00000200 /* section has external
+ relocation entries */
+#define S_ATTR_LOC_RELOC 0x00000100 /* section has local
+ relocation entries */
+
+
+/*
+ * The names of segments and sections in them are mostly meaningless to the
+ * link-editor. But there are few things to support traditional UNIX
+ * executables that require the link-editor and assembler to use some names
+ * agreed upon by convention.
+ *
+ * The initial protection of the "__TEXT" segment has write protection turned
+ * off (not writeable).
+ *
+ * The link-editor will allocate common symbols at the end of the "__common"
+ * section in the "__DATA" segment. It will create the section and segment
+ * if needed.
+ */
+
+/* The currently known segment names and the section names in those segments */
+
+#define SEG_PAGEZERO "__PAGEZERO" /* the pagezero segment which has no */
+ /* protections and catches NULL */
+ /* references for MH_EXECUTE files */
+
+
+#define SEG_TEXT "__TEXT" /* the tradition UNIX text segment */
+#define SECT_TEXT "__text" /* the real text part of the text */
+ /* section no headers, and no padding */
+#define SECT_FVMLIB_INIT0 "__fvmlib_init0" /* the fvmlib initialization */
+ /* section */
+#define SECT_FVMLIB_INIT1 "__fvmlib_init1" /* the section following the */
+ /* fvmlib initialization */
+ /* section */
+
+#define SEG_DATA "__DATA" /* the tradition UNIX data segment */
+#define SECT_DATA "__data" /* the real initialized data section */
+ /* no padding, no bss overlap */
+#define SECT_BSS "__bss" /* the real uninitialized data section*/
+ /* no padding */
+#define SECT_COMMON "__common" /* the section common symbols are */
+ /* allocated in by the link editor */
+
+#define SEG_OBJC "__OBJC" /* objective-C runtime segment */
+#define SECT_OBJC_SYMBOLS "__symbol_table" /* symbol table */
+#define SECT_OBJC_MODULES "__module_info" /* module information */
+#define SECT_OBJC_STRINGS "__selector_strs" /* string table */
+#define SECT_OBJC_REFS "__selector_refs" /* string table */
+
+#define SEG_ICON "__ICON" /* the icon segment */
+#define SECT_ICON_HEADER "__header" /* the icon headers */
+#define SECT_ICON_TIFF "__tiff" /* the icons in tiff format */
+
+#define SEG_LINKEDIT "__LINKEDIT" /* the segment containing all structs */
+ /* created and maintained by the link */
+ /* editor. Created with -seglinkedit */
+ /* option to ld(1) for MH_EXECUTE and */
+ /* FVMLIB file types only */
+
+#define SEG_UNIXSTACK "__UNIXSTACK" /* the unix stack segment */
+
+#define SEG_IMPORT "__IMPORT" /* the segment for the self (dyld) */
+ /* modifing code stubs that has read, */
+ /* write and execute permissions */
+
+/*
+ * Fixed virtual memory shared libraries are identified by two things. The
+ * target pathname (the name of the library as found for execution), and the
+ * minor version number. The address of where the headers are loaded is in
+ * header_addr. (THIS IS OBSOLETE and no longer supported).
+ */
+struct fvmlib {
+ union lc_str name; /* library's target pathname */
+ uint32_t minor_version; /* library's minor version number */
+ uint32_t header_addr; /* library's header address */
+};
+
+/*
+ * A fixed virtual shared library (filetype == MH_FVMLIB in the mach header)
+ * contains a fvmlib_command (cmd == LC_IDFVMLIB) to identify the library.
+ * An object that uses a fixed virtual shared library also contains a
+ * fvmlib_command (cmd == LC_LOADFVMLIB) for each library it uses.
+ * (THIS IS OBSOLETE and no longer supported).
+ */
+struct fvmlib_command {
+ uint32_t cmd; /* LC_IDFVMLIB or LC_LOADFVMLIB */
+ uint32_t cmdsize; /* includes pathname string */
+ struct fvmlib fvmlib; /* the library identification */
+};
+
+/*
+ * Dynamicly linked shared libraries are identified by two things. The
+ * pathname (the name of the library as found for execution), and the
+ * compatibility version number. The pathname must match and the compatibility
+ * number in the user of the library must be greater than or equal to the
+ * library being used. The time stamp is used to record the time a library was
+ * built and copied into user so it can be use to determined if the library used
+ * at runtime is exactly the same as used to built the program.
+ */
+struct dylib {
+ union lc_str name; /* library's path name */
+ uint32_t timestamp; /* library's build time stamp */
+ uint32_t current_version; /* library's current version number */
+ uint32_t compatibility_version; /* library's compatibility vers number*/
+};
+
+/*
+ * A dynamically linked shared library (filetype == MH_DYLIB in the mach header)
+ * contains a dylib_command (cmd == LC_ID_DYLIB) to identify the library.
+ * An object that uses a dynamically linked shared library also contains a
+ * dylib_command (cmd == LC_LOAD_DYLIB, LC_LOAD_WEAK_DYLIB, or
+ * LC_REEXPORT_DYLIB) for each library it uses.
+ */
+struct dylib_command {
+ uint32_t cmd; /* LC_ID_DYLIB, LC_LOAD_{,WEAK_}DYLIB,
+ LC_REEXPORT_DYLIB */
+ uint32_t cmdsize; /* includes pathname string */
+ struct dylib dylib; /* the library identification */
+};
+
+/*
+ * A dynamically linked shared library may be a subframework of an umbrella
+ * framework. If so it will be linked with "-umbrella umbrella_name" where
+ * Where "umbrella_name" is the name of the umbrella framework. A subframework
+ * can only be linked against by its umbrella framework or other subframeworks
+ * that are part of the same umbrella framework. Otherwise the static link
+ * editor produces an error and states to link against the umbrella framework.
+ * The name of the umbrella framework for subframeworks is recorded in the
+ * following structure.
+ */
+struct sub_framework_command {
+ uint32_t cmd; /* LC_SUB_FRAMEWORK */
+ uint32_t cmdsize; /* includes umbrella string */
+ union lc_str umbrella; /* the umbrella framework name */
+};
+
+/*
+ * For dynamically linked shared libraries that are subframework of an umbrella
+ * framework they can allow clients other than the umbrella framework or other
+ * subframeworks in the same umbrella framework. To do this the subframework
+ * is built with "-allowable_client client_name" and an LC_SUB_CLIENT load
+ * command is created for each -allowable_client flag. The client_name is
+ * usually a framework name. It can also be a name used for bundles clients
+ * where the bundle is built with "-client_name client_name".
+ */
+struct sub_client_command {
+ uint32_t cmd; /* LC_SUB_CLIENT */
+ uint32_t cmdsize; /* includes client string */
+ union lc_str client; /* the client name */
+};
+
+/*
+ * A dynamically linked shared library may be a sub_umbrella of an umbrella
+ * framework. If so it will be linked with "-sub_umbrella umbrella_name" where
+ * Where "umbrella_name" is the name of the sub_umbrella framework. When
+ * staticly linking when -twolevel_namespace is in effect a twolevel namespace
+ * umbrella framework will only cause its subframeworks and those frameworks
+ * listed as sub_umbrella frameworks to be implicited linked in. Any other
+ * dependent dynamic libraries will not be linked it when -twolevel_namespace
+ * is in effect. The primary library recorded by the static linker when
+ * resolving a symbol in these libraries will be the umbrella framework.
+ * Zero or more sub_umbrella frameworks may be use by an umbrella framework.
+ * The name of a sub_umbrella framework is recorded in the following structure.
+ */
+struct sub_umbrella_command {
+ uint32_t cmd; /* LC_SUB_UMBRELLA */
+ uint32_t cmdsize; /* includes sub_umbrella string */
+ union lc_str sub_umbrella; /* the sub_umbrella framework name */
+};
+
+/*
+ * A dynamically linked shared library may be a sub_library of another shared
+ * library. If so it will be linked with "-sub_library library_name" where
+ * Where "library_name" is the name of the sub_library shared library. When
+ * staticly linking when -twolevel_namespace is in effect a twolevel namespace
+ * shared library will only cause its subframeworks and those frameworks
+ * listed as sub_umbrella frameworks and libraries listed as sub_libraries to
+ * be implicited linked in. Any other dependent dynamic libraries will not be
+ * linked it when -twolevel_namespace is in effect. The primary library
+ * recorded by the static linker when resolving a symbol in these libraries
+ * will be the umbrella framework (or dynamic library). Zero or more sub_library
+ * shared libraries may be use by an umbrella framework or (or dynamic library).
+ * The name of a sub_library framework is recorded in the following structure.
+ * For example /usr/lib/libobjc_profile.A.dylib would be recorded as "libobjc".
+ */
+struct sub_library_command {
+ uint32_t cmd; /* LC_SUB_LIBRARY */
+ uint32_t cmdsize; /* includes sub_library string */
+ union lc_str sub_library; /* the sub_library name */
+};
+
+/*
+ * A program (filetype == MH_EXECUTE) that is
+ * prebound to its dynamic libraries has one of these for each library that
+ * the static linker used in prebinding. It contains a bit vector for the
+ * modules in the library. The bits indicate which modules are bound (1) and
+ * which are not (0) from the library. The bit for module 0 is the low bit
+ * of the first byte. So the bit for the Nth module is:
+ * (linked_modules[N/8] >> N%8) & 1
+ */
+struct prebound_dylib_command {
+ uint32_t cmd; /* LC_PREBOUND_DYLIB */
+ uint32_t cmdsize; /* includes strings */
+ union lc_str name; /* library's path name */
+ uint32_t nmodules; /* number of modules in library */
+ union lc_str linked_modules; /* bit vector of linked modules */
+};
+
+/*
+ * A program that uses a dynamic linker contains a dylinker_command to identify
+ * the name of the dynamic linker (LC_LOAD_DYLINKER). And a dynamic linker
+ * contains a dylinker_command to identify the dynamic linker (LC_ID_DYLINKER).
+ * A file can have at most one of these.
+ * This struct is also used for the LC_DYLD_ENVIRONMENT load command and
+ * contains string for dyld to treat like environment variable.
+ */
+struct dylinker_command {
+ uint32_t cmd; /* LC_ID_DYLINKER, LC_LOAD_DYLINKER or
+ LC_DYLD_ENVIRONMENT */
+ uint32_t cmdsize; /* includes pathname string */
+ union lc_str name; /* dynamic linker's path name */
+};
+
+/*
+ * Thread commands contain machine-specific data structures suitable for
+ * use in the thread state primitives. The machine specific data structures
+ * follow the struct thread_command as follows.
+ * Each flavor of machine specific data structure is preceded by an unsigned
+ * long constant for the flavor of that data structure, an uint32_t
+ * that is the count of longs of the size of the state data structure and then
+ * the state data structure follows. This triple may be repeated for many
+ * flavors. The constants for the flavors, counts and state data structure
+ * definitions are expected to be in the header file <machine/thread_status.h>.
+ * These machine specific data structures sizes must be multiples of
+ * 4 bytes The cmdsize reflects the total size of the thread_command
+ * and all of the sizes of the constants for the flavors, counts and state
+ * data structures.
+ *
+ * For executable objects that are unix processes there will be one
+ * thread_command (cmd == LC_UNIXTHREAD) created for it by the link-editor.
+ * This is the same as a LC_THREAD, except that a stack is automatically
+ * created (based on the shell's limit for the stack size). Command arguments
+ * and environment variables are copied onto that stack.
+ */
+struct thread_command {
+ uint32_t cmd; /* LC_THREAD or LC_UNIXTHREAD */
+ uint32_t cmdsize; /* total size of this command */
+ /* uint32_t flavor flavor of thread state */
+ /* uint32_t count count of longs in thread state */
+ /* struct XXX_thread_state state thread state for this flavor */
+ /* ... */
+};
+
+/*
+ * The routines command contains the address of the dynamic shared library
+ * initialization routine and an index into the module table for the module
+ * that defines the routine. Before any modules are used from the library the
+ * dynamic linker fully binds the module that defines the initialization routine
+ * and then calls it. This gets called before any module initialization
+ * routines (used for C++ static constructors) in the library.
+ */
+struct routines_command { /* for 32-bit architectures */
+ uint32_t cmd; /* LC_ROUTINES */
+ uint32_t cmdsize; /* total size of this command */
+ uint32_t init_address; /* address of initialization routine */
+ uint32_t init_module; /* index into the module table that */
+ /* the init routine is defined in */
+ uint32_t reserved1;
+ uint32_t reserved2;
+ uint32_t reserved3;
+ uint32_t reserved4;
+ uint32_t reserved5;
+ uint32_t reserved6;
+};
+
+/*
+ * The 64-bit routines command. Same use as above.
+ */
+struct routines_command_64 { /* for 64-bit architectures */
+ uint32_t cmd; /* LC_ROUTINES_64 */
+ uint32_t cmdsize; /* total size of this command */
+ uint64_t init_address; /* address of initialization routine */
+ uint64_t init_module; /* index into the module table that */
+ /* the init routine is defined in */
+ uint64_t reserved1;
+ uint64_t reserved2;
+ uint64_t reserved3;
+ uint64_t reserved4;
+ uint64_t reserved5;
+ uint64_t reserved6;
+};
+
+/*
+ * The symtab_command contains the offsets and sizes of the link-edit 4.3BSD
+ * "stab" style symbol table information as described in the header files
+ * <nlist.h> and <stab.h>.
+ */
+struct symtab_command {
+ uint32_t cmd; /* LC_SYMTAB */
+ uint32_t cmdsize; /* sizeof(struct symtab_command) */
+ uint32_t symoff; /* symbol table offset */
+ uint32_t nsyms; /* number of symbol table entries */
+ uint32_t stroff; /* string table offset */
+ uint32_t strsize; /* string table size in bytes */
+};
+
+/*
+ * This is the second set of the symbolic information which is used to support
+ * the data structures for the dynamically link editor.
+ *
+ * The original set of symbolic information in the symtab_command which contains
+ * the symbol and string tables must also be present when this load command is
+ * present. When this load command is present the symbol table is organized
+ * into three groups of symbols:
+ * local symbols (static and debugging symbols) - grouped by module
+ * defined external symbols - grouped by module (sorted by name if not lib)
+ * undefined external symbols (sorted by name if MH_BINDATLOAD is not set,
+ * and in order the were seen by the static
+ * linker if MH_BINDATLOAD is set)
+ * In this load command there are offsets and counts to each of the three groups
+ * of symbols.
+ *
+ * This load command contains a the offsets and sizes of the following new
+ * symbolic information tables:
+ * table of contents
+ * module table
+ * reference symbol table
+ * indirect symbol table
+ * The first three tables above (the table of contents, module table and
+ * reference symbol table) are only present if the file is a dynamically linked
+ * shared library. For executable and object modules, which are files
+ * containing only one module, the information that would be in these three
+ * tables is determined as follows:
+ * table of contents - the defined external symbols are sorted by name
+ * module table - the file contains only one module so everything in the
+ * file is part of the module.
+ * reference symbol table - is the defined and undefined external symbols
+ *
+ * For dynamically linked shared library files this load command also contains
+ * offsets and sizes to the pool of relocation entries for all sections
+ * separated into two groups:
+ * external relocation entries
+ * local relocation entries
+ * For executable and object modules the relocation entries continue to hang
+ * off the section structures.
+ */
+struct dysymtab_command {
+ uint32_t cmd; /* LC_DYSYMTAB */
+ uint32_t cmdsize; /* sizeof(struct dysymtab_command) */
+
+ /*
+ * The symbols indicated by symoff and nsyms of the LC_SYMTAB load command
+ * are grouped into the following three groups:
+ * local symbols (further grouped by the module they are from)
+ * defined external symbols (further grouped by the module they are from)
+ * undefined symbols
+ *
+ * The local symbols are used only for debugging. The dynamic binding
+ * process may have to use them to indicate to the debugger the local
+ * symbols for a module that is being bound.
+ *
+ * The last two groups are used by the dynamic binding process to do the
+ * binding (indirectly through the module table and the reference symbol
+ * table when this is a dynamically linked shared library file).
+ */
+ uint32_t ilocalsym; /* index to local symbols */
+ uint32_t nlocalsym; /* number of local symbols */
+
+ uint32_t iextdefsym;/* index to externally defined symbols */
+ uint32_t nextdefsym;/* number of externally defined symbols */
+
+ uint32_t iundefsym; /* index to undefined symbols */
+ uint32_t nundefsym; /* number of undefined symbols */
+
+ /*
+ * For the for the dynamic binding process to find which module a symbol
+ * is defined in the table of contents is used (analogous to the ranlib
+ * structure in an archive) which maps defined external symbols to modules
+ * they are defined in. This exists only in a dynamically linked shared
+ * library file. For executable and object modules the defined external
+ * symbols are sorted by name and is use as the table of contents.
+ */
+ uint32_t tocoff; /* file offset to table of contents */
+ uint32_t ntoc; /* number of entries in table of contents */
+
+ /*
+ * To support dynamic binding of "modules" (whole object files) the symbol
+ * table must reflect the modules that the file was created from. This is
+ * done by having a module table that has indexes and counts into the merged
+ * tables for each module. The module structure that these two entries
+ * refer to is described below. This exists only in a dynamically linked
+ * shared library file. For executable and object modules the file only
+ * contains one module so everything in the file belongs to the module.
+ */
+ uint32_t modtaboff; /* file offset to module table */
+ uint32_t nmodtab; /* number of module table entries */
+
+ /*
+ * To support dynamic module binding the module structure for each module
+ * indicates the external references (defined and undefined) each module
+ * makes. For each module there is an offset and a count into the
+ * reference symbol table for the symbols that the module references.
+ * This exists only in a dynamically linked shared library file. For
+ * executable and object modules the defined external symbols and the
+ * undefined external symbols indicates the external references.
+ */
+ uint32_t extrefsymoff; /* offset to referenced symbol table */
+ uint32_t nextrefsyms; /* number of referenced symbol table entries */
+
+ /*
+ * The sections that contain "symbol pointers" and "routine stubs" have
+ * indexes and (implied counts based on the size of the section and fixed
+ * size of the entry) into the "indirect symbol" table for each pointer
+ * and stub. For every section of these two types the index into the
+ * indirect symbol table is stored in the section header in the field
+ * reserved1. An indirect symbol table entry is simply a 32bit index into
+ * the symbol table to the symbol that the pointer or stub is referring to.
+ * The indirect symbol table is ordered to match the entries in the section.
+ */
+ uint32_t indirectsymoff; /* file offset to the indirect symbol table */
+ uint32_t nindirectsyms; /* number of indirect symbol table entries */
+
+ /*
+ * To support relocating an individual module in a library file quickly the
+ * external relocation entries for each module in the library need to be
+ * accessed efficiently. Since the relocation entries can't be accessed
+ * through the section headers for a library file they are separated into
+ * groups of local and external entries further grouped by module. In this
+ * case the presents of this load command who's extreloff, nextrel,
+ * locreloff and nlocrel fields are non-zero indicates that the relocation
+ * entries of non-merged sections are not referenced through the section
+ * structures (and the reloff and nreloc fields in the section headers are
+ * set to zero).
+ *
+ * Since the relocation entries are not accessed through the section headers
+ * this requires the r_address field to be something other than a section
+ * offset to identify the item to be relocated. In this case r_address is
+ * set to the offset from the vmaddr of the first LC_SEGMENT command.
+ * For MH_SPLIT_SEGS images r_address is set to the the offset from the
+ * vmaddr of the first read-write LC_SEGMENT command.
+ *
+ * The relocation entries are grouped by module and the module table
+ * entries have indexes and counts into them for the group of external
+ * relocation entries for that the module.
+ *
+ * For sections that are merged across modules there must not be any
+ * remaining external relocation entries for them (for merged sections
+ * remaining relocation entries must be local).
+ */
+ uint32_t extreloff; /* offset to external relocation entries */
+ uint32_t nextrel; /* number of external relocation entries */
+
+ /*
+ * All the local relocation entries are grouped together (they are not
+ * grouped by their module since they are only used if the object is moved
+ * from it staticly link edited address).
+ */
+ uint32_t locreloff; /* offset to local relocation entries */
+ uint32_t nlocrel; /* number of local relocation entries */
+
+};
+
+/*
+ * An indirect symbol table entry is simply a 32bit index into the symbol table
+ * to the symbol that the pointer or stub is refering to. Unless it is for a
+ * non-lazy symbol pointer section for a defined symbol which strip(1) as
+ * removed. In which case it has the value INDIRECT_SYMBOL_LOCAL. If the
+ * symbol was also absolute INDIRECT_SYMBOL_ABS is or'ed with that.
+ */
+#define INDIRECT_SYMBOL_LOCAL 0x80000000
+#define INDIRECT_SYMBOL_ABS 0x40000000
+
+
+/* a table of contents entry */
+struct dylib_table_of_contents {
+ uint32_t symbol_index; /* the defined external symbol
+ (index into the symbol table) */
+ uint32_t module_index; /* index into the module table this symbol
+ is defined in */
+};
+
+/* a module table entry */
+struct dylib_module {
+ uint32_t module_name; /* the module name (index into string table) */
+
+ uint32_t iextdefsym; /* index into externally defined symbols */
+ uint32_t nextdefsym; /* number of externally defined symbols */
+ uint32_t irefsym; /* index into reference symbol table */
+ uint32_t nrefsym; /* number of reference symbol table entries */
+ uint32_t ilocalsym; /* index into symbols for local symbols */
+ uint32_t nlocalsym; /* number of local symbols */
+
+ uint32_t iextrel; /* index into external relocation entries */
+ uint32_t nextrel; /* number of external relocation entries */
+
+ uint32_t iinit_iterm; /* low 16 bits are the index into the init
+ section, high 16 bits are the index into
+ the term section */
+ uint32_t ninit_nterm; /* low 16 bits are the number of init section
+ entries, high 16 bits are the number of
+ term section entries */
+
+ uint32_t /* for this module address of the start of */
+ objc_module_info_addr; /* the (__OBJC,__module_info) section */
+ uint32_t /* for this module size of */
+ objc_module_info_size; /* the (__OBJC,__module_info) section */
+};
+
+/* a 64-bit module table entry */
+struct dylib_module_64 {
+ uint32_t module_name; /* the module name (index into string table) */
+
+ uint32_t iextdefsym; /* index into externally defined symbols */
+ uint32_t nextdefsym; /* number of externally defined symbols */
+ uint32_t irefsym; /* index into reference symbol table */
+ uint32_t nrefsym; /* number of reference symbol table entries */
+ uint32_t ilocalsym; /* index into symbols for local symbols */
+ uint32_t nlocalsym; /* number of local symbols */
+
+ uint32_t iextrel; /* index into external relocation entries */
+ uint32_t nextrel; /* number of external relocation entries */
+
+ uint32_t iinit_iterm; /* low 16 bits are the index into the init
+ section, high 16 bits are the index into
+ the term section */
+ uint32_t ninit_nterm; /* low 16 bits are the number of init section
+ entries, high 16 bits are the number of
+ term section entries */
+
+ uint32_t /* for this module size of */
+ objc_module_info_size; /* the (__OBJC,__module_info) section */
+ uint64_t /* for this module address of the start of */
+ objc_module_info_addr; /* the (__OBJC,__module_info) section */
+};
+
+/*
+ * The entries in the reference symbol table are used when loading the module
+ * (both by the static and dynamic link editors) and if the module is unloaded
+ * or replaced. Therefore all external symbols (defined and undefined) are
+ * listed in the module's reference table. The flags describe the type of
+ * reference that is being made. The constants for the flags are defined in
+ * <mach-o/nlist.h> as they are also used for symbol table entries.
+ */
+struct dylib_reference {
+ uint32_t isym:24, /* index into the symbol table */
+ flags:8; /* flags to indicate the type of reference */
+};
+
+/*
+ * The twolevel_hints_command contains the offset and number of hints in the
+ * two-level namespace lookup hints table.
+ */
+struct twolevel_hints_command {
+ uint32_t cmd; /* LC_TWOLEVEL_HINTS */
+ uint32_t cmdsize; /* sizeof(struct twolevel_hints_command) */
+ uint32_t offset; /* offset to the hint table */
+ uint32_t nhints; /* number of hints in the hint table */
+};
+
+/*
+ * The entries in the two-level namespace lookup hints table are twolevel_hint
+ * structs. These provide hints to the dynamic link editor where to start
+ * looking for an undefined symbol in a two-level namespace image. The
+ * isub_image field is an index into the sub-images (sub-frameworks and
+ * sub-umbrellas list) that made up the two-level image that the undefined
+ * symbol was found in when it was built by the static link editor. If
+ * isub-image is 0 the the symbol is expected to be defined in library and not
+ * in the sub-images. If isub-image is non-zero it is an index into the array
+ * of sub-images for the umbrella with the first index in the sub-images being
+ * 1. The array of sub-images is the ordered list of sub-images of the umbrella
+ * that would be searched for a symbol that has the umbrella recorded as its
+ * primary library. The table of contents index is an index into the
+ * library's table of contents. This is used as the starting point of the
+ * binary search or a directed linear search.
+ */
+struct twolevel_hint {
+ uint32_t
+ isub_image:8, /* index into the sub images */
+ itoc:24; /* index into the table of contents */
+};
+
+/*
+ * The prebind_cksum_command contains the value of the original check sum for
+ * prebound files or zero. When a prebound file is first created or modified
+ * for other than updating its prebinding information the value of the check sum
+ * is set to zero. When the file has it prebinding re-done and if the value of
+ * the check sum is zero the original check sum is calculated and stored in
+ * cksum field of this load command in the output file. If when the prebinding
+ * is re-done and the cksum field is non-zero it is left unchanged from the
+ * input file.
+ */
+struct prebind_cksum_command {
+ uint32_t cmd; /* LC_PREBIND_CKSUM */
+ uint32_t cmdsize; /* sizeof(struct prebind_cksum_command) */
+ uint32_t cksum; /* the check sum or zero */
+};
+
+/*
+ * The uuid load command contains a single 128-bit unique random number that
+ * identifies an object produced by the static link editor.
+ */
+struct uuid_command {
+ uint32_t cmd; /* LC_UUID */
+ uint32_t cmdsize; /* sizeof(struct uuid_command) */
+ uint8_t uuid[16]; /* the 128-bit uuid */
+};
+
+/*
+ * The rpath_command contains a path which at runtime should be added to
+ * the current run path used to find @rpath prefixed dylibs.
+ */
+struct rpath_command {
+ uint32_t cmd; /* LC_RPATH */
+ uint32_t cmdsize; /* includes string */
+ union lc_str path; /* path to add to run path */
+};
+
+/*
+ * The linkedit_data_command contains the offsets and sizes of a blob
+ * of data in the __LINKEDIT segment.
+ */
+struct linkedit_data_command {
+ uint32_t cmd; /* LC_CODE_SIGNATURE, LC_SEGMENT_SPLIT_INFO,
+ or LC_FUNCTION_STARTS */
+ uint32_t cmdsize; /* sizeof(struct linkedit_data_command) */
+ uint32_t dataoff; /* file offset of data in __LINKEDIT segment */
+ uint32_t datasize; /* file size of data in __LINKEDIT segment */
+};
+
+/*
+ * The encryption_info_command contains the file offset and size of an
+ * of an encrypted segment.
+ */
+struct encryption_info_command {
+ uint32_t cmd; /* LC_ENCRYPTION_INFO */
+ uint32_t cmdsize; /* sizeof(struct encryption_info_command) */
+ uint32_t cryptoff; /* file offset of encrypted range */
+ uint32_t cryptsize; /* file size of encrypted range */
+ uint32_t cryptid; /* which enryption system,
+ 0 means not-encrypted yet */
+};
+
+/*
+ * The version_min_command contains the min OS version on which this
+ * binary was built to run.
+ */
+struct version_min_command {
+ uint32_t cmd; /* LC_VERSION_MIN_MACOSX or
+ LC_VERSION_MIN_IPHONEOS */
+ uint32_t cmdsize; /* sizeof(struct min_version_command) */
+ uint32_t version; /* X.Y.Z is encoded in nibbles xxxx.yy.zz */
+ uint32_t reserved; /* zero */
+};
+
+/*
+ * The dyld_info_command contains the file offsets and sizes of
+ * the new compressed form of the information dyld needs to
+ * load the image. This information is used by dyld on Mac OS X
+ * 10.6 and later. All information pointed to by this command
+ * is encoded using byte streams, so no endian swapping is needed
+ * to interpret it.
+ */
+struct dyld_info_command {
+ uint32_t cmd; /* LC_DYLD_INFO or LC_DYLD_INFO_ONLY */
+ uint32_t cmdsize; /* sizeof(struct dyld_info_command) */
+
+ /*
+ * Dyld rebases an image whenever dyld loads it at an address different
+ * from its preferred address. The rebase information is a stream
+ * of byte sized opcodes whose symbolic names start with REBASE_OPCODE_.
+ * Conceptually the rebase information is a table of tuples:
+ * <seg-index, seg-offset, type>
+ * The opcodes are a compressed way to encode the table by only
+ * encoding when a column changes. In addition simple patterns
+ * like "every n'th offset for m times" can be encoded in a few
+ * bytes.
+ */
+ uint32_t rebase_off; /* file offset to rebase info */
+ uint32_t rebase_size; /* size of rebase info */
+
+ /*
+ * Dyld binds an image during the loading process, if the image
+ * requires any pointers to be initialized to symbols in other images.
+ * The bind information is a stream of byte sized
+ * opcodes whose symbolic names start with BIND_OPCODE_.
+ * Conceptually the bind information is a table of tuples:
+ * <seg-index, seg-offset, type, symbol-library-ordinal, symbol-name, addend>
+ * The opcodes are a compressed way to encode the table by only
+ * encoding when a column changes. In addition simple patterns
+ * like for runs of pointers initialzed to the same value can be
+ * encoded in a few bytes.
+ */
+ uint32_t bind_off; /* file offset to binding info */
+ uint32_t bind_size; /* size of binding info */
+
+ /*
+ * Some C++ programs require dyld to unique symbols so that all
+ * images in the process use the same copy of some code/data.
+ * This step is done after binding. The content of the weak_bind
+ * info is an opcode stream like the bind_info. But it is sorted
+ * alphabetically by symbol name. This enable dyld to walk
+ * all images with weak binding information in order and look
+ * for collisions. If there are no collisions, dyld does
+ * no updating. That means that some fixups are also encoded
+ * in the bind_info. For instance, all calls to "operator new"
+ * are first bound to libstdc++.dylib using the information
+ * in bind_info. Then if some image overrides operator new
+ * that is detected when the weak_bind information is processed
+ * and the call to operator new is then rebound.
+ */
+ uint32_t weak_bind_off; /* file offset to weak binding info */
+ uint32_t weak_bind_size; /* size of weak binding info */
+
+ /*
+ * Some uses of external symbols do not need to be bound immediately.
+ * Instead they can be lazily bound on first use. The lazy_bind
+ * are contains a stream of BIND opcodes to bind all lazy symbols.
+ * Normal use is that dyld ignores the lazy_bind section when
+ * loading an image. Instead the static linker arranged for the
+ * lazy pointer to initially point to a helper function which
+ * pushes the offset into the lazy_bind area for the symbol
+ * needing to be bound, then jumps to dyld which simply adds
+ * the offset to lazy_bind_off to get the information on what
+ * to bind.
+ */
+ uint32_t lazy_bind_off; /* file offset to lazy binding info */
+ uint32_t lazy_bind_size; /* size of lazy binding infs */
+
+ /*
+ * The symbols exported by a dylib are encoded in a trie. This
+ * is a compact representation that factors out common prefixes.
+ * It also reduces LINKEDIT pages in RAM because it encodes all
+ * information (name, address, flags) in one small, contiguous range.
+ * The export area is a stream of nodes. The first node sequentially
+ * is the start node for the trie.
+ *
+ * Nodes for a symbol start with a uleb128 that is the length of
+ * the exported symbol information for the string so far.
+ * If there is no exported symbol, the node starts with a zero byte.
+ * If there is exported info, it follows the length. First is
+ * a uleb128 containing flags. Normally, it is followed by a
+ * uleb128 encoded offset which is location of the content named
+ * by the symbol from the mach_header for the image. If the flags
+ * is EXPORT_SYMBOL_FLAGS_REEXPORT, then following the flags is
+ * a uleb128 encoded library ordinal, then a zero terminated
+ * UTF8 string. If the string is zero length, then the symbol
+ * is re-export from the specified dylib with the same name.
+ *
+ * After the optional exported symbol information is a byte of
+ * how many edges (0-255) that this node has leaving it,
+ * followed by each edge.
+ * Each edge is a zero terminated UTF8 of the addition chars
+ * in the symbol, followed by a uleb128 offset for the node that
+ * edge points to.
+ *
+ */
+ uint32_t export_off; /* file offset to lazy binding info */
+ uint32_t export_size; /* size of lazy binding infs */
+};
+
+/*
+ * The following are used to encode rebasing information
+ */
+#define REBASE_TYPE_POINTER 1
+#define REBASE_TYPE_TEXT_ABSOLUTE32 2
+#define REBASE_TYPE_TEXT_PCREL32 3
+
+#define REBASE_OPCODE_MASK 0xF0
+#define REBASE_IMMEDIATE_MASK 0x0F
+#define REBASE_OPCODE_DONE 0x00
+#define REBASE_OPCODE_SET_TYPE_IMM 0x10
+#define REBASE_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB 0x20
+#define REBASE_OPCODE_ADD_ADDR_ULEB 0x30
+#define REBASE_OPCODE_ADD_ADDR_IMM_SCALED 0x40
+#define REBASE_OPCODE_DO_REBASE_IMM_TIMES 0x50
+#define REBASE_OPCODE_DO_REBASE_ULEB_TIMES 0x60
+#define REBASE_OPCODE_DO_REBASE_ADD_ADDR_ULEB 0x70
+#define REBASE_OPCODE_DO_REBASE_ULEB_TIMES_SKIPPING_ULEB 0x80
+
+
+/*
+ * The following are used to encode binding information
+ */
+#define BIND_TYPE_POINTER 1
+#define BIND_TYPE_TEXT_ABSOLUTE32 2
+#define BIND_TYPE_TEXT_PCREL32 3
+
+#define BIND_SPECIAL_DYLIB_SELF 0
+#define BIND_SPECIAL_DYLIB_MAIN_EXECUTABLE -1
+#define BIND_SPECIAL_DYLIB_FLAT_LOOKUP -2
+
+#define BIND_SYMBOL_FLAGS_WEAK_IMPORT 0x1
+#define BIND_SYMBOL_FLAGS_NON_WEAK_DEFINITION 0x8
+
+#define BIND_OPCODE_MASK 0xF0
+#define BIND_IMMEDIATE_MASK 0x0F
+#define BIND_OPCODE_DONE 0x00
+#define BIND_OPCODE_SET_DYLIB_ORDINAL_IMM 0x10
+#define BIND_OPCODE_SET_DYLIB_ORDINAL_ULEB 0x20
+#define BIND_OPCODE_SET_DYLIB_SPECIAL_IMM 0x30
+#define BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM 0x40
+#define BIND_OPCODE_SET_TYPE_IMM 0x50
+#define BIND_OPCODE_SET_ADDEND_SLEB 0x60
+#define BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB 0x70
+#define BIND_OPCODE_ADD_ADDR_ULEB 0x80
+#define BIND_OPCODE_DO_BIND 0x90
+#define BIND_OPCODE_DO_BIND_ADD_ADDR_ULEB 0xA0
+#define BIND_OPCODE_DO_BIND_ADD_ADDR_IMM_SCALED 0xB0
+#define BIND_OPCODE_DO_BIND_ULEB_TIMES_SKIPPING_ULEB 0xC0
+
+
+/*
+ * The following are used on the flags byte of a terminal node
+ * in the export information.
+ */
+#define EXPORT_SYMBOL_FLAGS_KIND_MASK 0x03
+#define EXPORT_SYMBOL_FLAGS_KIND_REGULAR 0x00
+#define EXPORT_SYMBOL_FLAGS_KIND_THREAD_LOCAL 0x01
+#define EXPORT_SYMBOL_FLAGS_WEAK_DEFINITION 0x04
+#define EXPORT_SYMBOL_FLAGS_REEXPORT 0x08
+#define EXPORT_SYMBOL_FLAGS_STUB_AND_RESOLVER 0x10
+
+/*
+ * The symseg_command contains the offset and size of the GNU style
+ * symbol table information as described in the header file <symseg.h>.
+ * The symbol roots of the symbol segments must also be aligned properly
+ * in the file. So the requirement of keeping the offsets aligned to a
+ * multiple of a 4 bytes translates to the length field of the symbol
+ * roots also being a multiple of a long. Also the padding must again be
+ * zeroed. (THIS IS OBSOLETE and no longer supported).
+ */
+struct symseg_command {
+ uint32_t cmd; /* LC_SYMSEG */
+ uint32_t cmdsize; /* sizeof(struct symseg_command) */
+ uint32_t offset; /* symbol segment offset */
+ uint32_t size; /* symbol segment size in bytes */
+};
+
+/*
+ * The ident_command contains a free format string table following the
+ * ident_command structure. The strings are null terminated and the size of
+ * the command is padded out with zero bytes to a multiple of 4 bytes/
+ * (THIS IS OBSOLETE and no longer supported).
+ */
+struct ident_command {
+ uint32_t cmd; /* LC_IDENT */
+ uint32_t cmdsize; /* strings that follow this command */
+};
+
+/*
+ * The fvmfile_command contains a reference to a file to be loaded at the
+ * specified virtual address. (Presently, this command is reserved for
+ * internal use. The kernel ignores this command when loading a program into
+ * memory).
+ */
+struct fvmfile_command {
+ uint32_t cmd; /* LC_FVMFILE */
+ uint32_t cmdsize; /* includes pathname string */
+ union lc_str name; /* files pathname */
+ uint32_t header_addr; /* files virtual address */
+};
+
+/*
+ * Sections of type S_THREAD_LOCAL_VARIABLES contain an array
+ * of tlv_descriptor structures.
+ */
+struct tlv_descriptor
+{
+ void* (*thunk)(struct tlv_descriptor*);
+ unsigned long key;
+ unsigned long offset;
+};
+
+#endif /* _MACHO_LOADER_H_ */
diff --git a/src/third_party/mac_headers/mach-o/nlist.h b/src/third_party/mac_headers/mach-o/nlist.h
new file mode 100644
index 00000000..1c194101
--- /dev/null
+++ b/src/third_party/mac_headers/mach-o/nlist.h
@@ -0,0 +1,312 @@
+/*
+ * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ *
+ * This file contains Original Code and/or Modifications of Original Code
+ * as defined in and that are subject to the Apple Public Source License
+ * Version 2.0 (the 'License'). You may not use this file except in
+ * compliance with the License. Please obtain a copy of the License at
+ * http://www.opensource.apple.com/apsl/ and read it before using this
+ * file.
+ *
+ * The Original Code and all software distributed under the License are
+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
+ * Please see the License for the specific language governing rights and
+ * limitations under the License.
+ *
+ * @APPLE_LICENSE_HEADER_END@
+ */
+#ifndef _MACHO_NLIST_H_
+#define _MACHO_NLIST_H_
+/* $NetBSD: nlist.h,v 1.5 1994/10/26 00:56:11 cgd Exp $ */
+
+/*-
+ * Copyright (c) 1991, 1993
+ * The Regents of the University of California. All rights reserved.
+ * (c) UNIX System Laboratories, Inc.
+ * All or some portions of this file are derived from material licensed
+ * to the University of California by American Telephone and Telegraph
+ * Co. or Unix System Laboratories, Inc. and are reproduced herein with
+ * the permission of UNIX System Laboratories, Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)nlist.h 8.2 (Berkeley) 1/21/94
+ */
+#include <stdint.h>
+
+/*
+ * Format of a symbol table entry of a Mach-O file for 32-bit architectures.
+ * Modified from the BSD format. The modifications from the original format
+ * were changing n_other (an unused field) to n_sect and the addition of the
+ * N_SECT type. These modifications are required to support symbols in a larger
+ * number of sections not just the three sections (text, data and bss) in a BSD
+ * file.
+ */
+struct nlist {
+ union {
+#ifndef __LP64__
+ char *n_name; /* for use when in-core */
+#endif
+ int32_t n_strx; /* index into the string table */
+ } n_un;
+ uint8_t n_type; /* type flag, see below */
+ uint8_t n_sect; /* section number or NO_SECT */
+ int16_t n_desc; /* see <mach-o/stab.h> */
+ uint32_t n_value; /* value of this symbol (or stab offset) */
+};
+
+/*
+ * This is the symbol table entry structure for 64-bit architectures.
+ */
+struct nlist_64 {
+ union {
+ uint32_t n_strx; /* index into the string table */
+ } n_un;
+ uint8_t n_type; /* type flag, see below */
+ uint8_t n_sect; /* section number or NO_SECT */
+ uint16_t n_desc; /* see <mach-o/stab.h> */
+ uint64_t n_value; /* value of this symbol (or stab offset) */
+};
+
+/*
+ * Symbols with a index into the string table of zero (n_un.n_strx == 0) are
+ * defined to have a null, "", name. Therefore all string indexes to non null
+ * names must not have a zero string index. This is bit historical information
+ * that has never been well documented.
+ */
+
+/*
+ * The n_type field really contains four fields:
+ * unsigned char N_STAB:3,
+ * N_PEXT:1,
+ * N_TYPE:3,
+ * N_EXT:1;
+ * which are used via the following masks.
+ */
+#define N_STAB 0xe0 /* if any of these bits set, a symbolic debugging entry */
+#define N_PEXT 0x10 /* private external symbol bit */
+#define N_TYPE 0x0e /* mask for the type bits */
+#define N_EXT 0x01 /* external symbol bit, set for external symbols */
+
+/*
+ * Only symbolic debugging entries have some of the N_STAB bits set and if any
+ * of these bits are set then it is a symbolic debugging entry (a stab). In
+ * which case then the values of the n_type field (the entire field) are given
+ * in <mach-o/stab.h>
+ */
+
+/*
+ * Values for N_TYPE bits of the n_type field.
+ */
+#define N_UNDF 0x0 /* undefined, n_sect == NO_SECT */
+#define N_ABS 0x2 /* absolute, n_sect == NO_SECT */
+#define N_SECT 0xe /* defined in section number n_sect */
+#define N_PBUD 0xc /* prebound undefined (defined in a dylib) */
+#define N_INDR 0xa /* indirect */
+
+/*
+ * If the type is N_INDR then the symbol is defined to be the same as another
+ * symbol. In this case the n_value field is an index into the string table
+ * of the other symbol's name. When the other symbol is defined then they both
+ * take on the defined type and value.
+ */
+
+/*
+ * If the type is N_SECT then the n_sect field contains an ordinal of the
+ * section the symbol is defined in. The sections are numbered from 1 and
+ * refer to sections in order they appear in the load commands for the file
+ * they are in. This means the same ordinal may very well refer to different
+ * sections in different files.
+ *
+ * The n_value field for all symbol table entries (including N_STAB's) gets
+ * updated by the link editor based on the value of it's n_sect field and where
+ * the section n_sect references gets relocated. If the value of the n_sect
+ * field is NO_SECT then it's n_value field is not changed by the link editor.
+ */
+#define NO_SECT 0 /* symbol is not in any section */
+#define MAX_SECT 255 /* 1 thru 255 inclusive */
+
+/*
+ * Common symbols are represented by undefined (N_UNDF) external (N_EXT) types
+ * who's values (n_value) are non-zero. In which case the value of the n_value
+ * field is the size (in bytes) of the common symbol. The n_sect field is set
+ * to NO_SECT. The alignment of a common symbol may be set as a power of 2
+ * between 2^1 and 2^15 as part of the n_desc field using the macros below. If
+ * the alignment is not set (a value of zero) then natural alignment based on
+ * the size is used.
+ */
+#define GET_COMM_ALIGN(n_desc) (((n_desc) >> 8) & 0x0f)
+#define SET_COMM_ALIGN(n_desc,align) \
+ (n_desc) = (((n_desc) & 0xf0ff) | (((align) & 0x0f) << 8))
+
+/*
+ * To support the lazy binding of undefined symbols in the dynamic link-editor,
+ * the undefined symbols in the symbol table (the nlist structures) are marked
+ * with the indication if the undefined reference is a lazy reference or
+ * non-lazy reference. If both a non-lazy reference and a lazy reference is
+ * made to the same symbol the non-lazy reference takes precedence. A reference
+ * is lazy only when all references to that symbol are made through a symbol
+ * pointer in a lazy symbol pointer section.
+ *
+ * The implementation of marking nlist structures in the symbol table for
+ * undefined symbols will be to use some of the bits of the n_desc field as a
+ * reference type. The mask REFERENCE_TYPE will be applied to the n_desc field
+ * of an nlist structure for an undefined symbol to determine the type of
+ * undefined reference (lazy or non-lazy).
+ *
+ * The constants for the REFERENCE FLAGS are propagated to the reference table
+ * in a shared library file. In that case the constant for a defined symbol,
+ * REFERENCE_FLAG_DEFINED, is also used.
+ */
+/* Reference type bits of the n_desc field of undefined symbols */
+#define REFERENCE_TYPE 0x7
+/* types of references */
+#define REFERENCE_FLAG_UNDEFINED_NON_LAZY 0
+#define REFERENCE_FLAG_UNDEFINED_LAZY 1
+#define REFERENCE_FLAG_DEFINED 2
+#define REFERENCE_FLAG_PRIVATE_DEFINED 3
+#define REFERENCE_FLAG_PRIVATE_UNDEFINED_NON_LAZY 4
+#define REFERENCE_FLAG_PRIVATE_UNDEFINED_LAZY 5
+
+/*
+ * To simplify stripping of objects that use are used with the dynamic link
+ * editor, the static link editor marks the symbols defined an object that are
+ * referenced by a dynamicly bound object (dynamic shared libraries, bundles).
+ * With this marking strip knows not to strip these symbols.
+ */
+#define REFERENCED_DYNAMICALLY 0x0010
+
+/*
+ * For images created by the static link editor with the -twolevel_namespace
+ * option in effect the flags field of the mach header is marked with
+ * MH_TWOLEVEL. And the binding of the undefined references of the image are
+ * determined by the static link editor. Which library an undefined symbol is
+ * bound to is recorded by the static linker in the high 8 bits of the n_desc
+ * field using the SET_LIBRARY_ORDINAL macro below. The ordinal recorded
+ * references the libraries listed in the Mach-O's LC_LOAD_DYLIB,
+ * LC_LOAD_WEAK_DYLIB, LC_REEXPORT_DYLIB, LC_LOAD_UPWARD_DYLIB, and
+ * LC_LAZY_LOAD_DYLIB, etc. load commands in the order they appear in the
+ * headers. The library ordinals start from 1.
+ * For a dynamic library that is built as a two-level namespace image the
+ * undefined references from module defined in another use the same nlist struct
+ * an in that case SELF_LIBRARY_ORDINAL is used as the library ordinal. For
+ * defined symbols in all images they also must have the library ordinal set to
+ * SELF_LIBRARY_ORDINAL. The EXECUTABLE_ORDINAL refers to the executable
+ * image for references from plugins that refer to the executable that loads
+ * them.
+ *
+ * The DYNAMIC_LOOKUP_ORDINAL is for undefined symbols in a two-level namespace
+ * image that are looked up by the dynamic linker with flat namespace semantics.
+ * This ordinal was added as a feature in Mac OS X 10.3 by reducing the
+ * value of MAX_LIBRARY_ORDINAL by one. So it is legal for existing binaries
+ * or binaries built with older tools to have 0xfe (254) dynamic libraries. In
+ * this case the ordinal value 0xfe (254) must be treated as a library ordinal
+ * for compatibility.
+ */
+#define GET_LIBRARY_ORDINAL(n_desc) (((n_desc) >> 8) & 0xff)
+#define SET_LIBRARY_ORDINAL(n_desc,ordinal) \
+ (n_desc) = (((n_desc) & 0x00ff) | (((ordinal) & 0xff) << 8))
+#define SELF_LIBRARY_ORDINAL 0x0
+#define MAX_LIBRARY_ORDINAL 0xfd
+#define DYNAMIC_LOOKUP_ORDINAL 0xfe
+#define EXECUTABLE_ORDINAL 0xff
+
+/*
+ * The bit 0x0020 of the n_desc field is used for two non-overlapping purposes
+ * and has two different symbolic names, N_NO_DEAD_STRIP and N_DESC_DISCARDED.
+ */
+
+/*
+ * The N_NO_DEAD_STRIP bit of the n_desc field only ever appears in a
+ * relocatable .o file (MH_OBJECT filetype). And is used to indicate to the
+ * static link editor it is never to dead strip the symbol.
+ */
+#define N_NO_DEAD_STRIP 0x0020 /* symbol is not to be dead stripped */
+
+/*
+ * The N_DESC_DISCARDED bit of the n_desc field never appears in linked image.
+ * But is used in very rare cases by the dynamic link editor to mark an in
+ * memory symbol as discared and longer used for linking.
+ */
+#define N_DESC_DISCARDED 0x0020 /* symbol is discarded */
+
+/*
+ * The N_WEAK_REF bit of the n_desc field indicates to the dynamic linker that
+ * the undefined symbol is allowed to be missing and is to have the address of
+ * zero when missing.
+ */
+#define N_WEAK_REF 0x0040 /* symbol is weak referenced */
+
+/*
+ * The N_WEAK_DEF bit of the n_desc field indicates to the static and dynamic
+ * linkers that the symbol definition is weak, allowing a non-weak symbol to
+ * also be used which causes the weak definition to be discared. Currently this
+ * is only supported for symbols in coalesed sections.
+ */
+#define N_WEAK_DEF 0x0080 /* coalesed symbol is a weak definition */
+
+/*
+ * The N_REF_TO_WEAK bit of the n_desc field indicates to the dynamic linker
+ * that the undefined symbol should be resolved using flat namespace searching.
+ */
+#define N_REF_TO_WEAK 0x0080 /* reference to a weak symbol */
+
+/*
+ * The N_ARM_THUMB_DEF bit of the n_desc field indicates that the symbol is
+ * a defintion of a Thumb function.
+ */
+#define N_ARM_THUMB_DEF 0x0008 /* symbol is a Thumb function (ARM) */
+
+/*
+ * The N_SYMBOL_RESOLVER bit of the n_desc field indicates that the
+ * that the function is actually a resolver function and should
+ * be called to get the address of the real function to use.
+ * This bit is only available in .o files (MH_OBJECT filetype)
+ */
+#define N_SYMBOL_RESOLVER 0x0100
+
+#ifndef __STRICT_BSD__
+#if __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+/*
+ * The function nlist(3) from the C library.
+ */
+extern int nlist (const char *filename, struct nlist *list);
+#if __cplusplus
+}
+#endif /* __cplusplus */
+#endif /* __STRICT_BSD__ */
+
+#endif /* _MACHO_LIST_H_ */
diff --git a/src/third_party/mac_headers/mach/boolean.h b/src/third_party/mac_headers/mach/boolean.h
new file mode 100644
index 00000000..641c3962
--- /dev/null
+++ b/src/third_party/mac_headers/mach/boolean.h
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
+ *
+ * This file contains Original Code and/or Modifications of Original Code
+ * as defined in and that are subject to the Apple Public Source License
+ * Version 2.0 (the 'License'). You may not use this file except in
+ * compliance with the License. The rights granted to you under the License
+ * may not be used to create, or enable the creation or redistribution of,
+ * unlawful or unlicensed copies of an Apple operating system, or to
+ * circumvent, violate, or enable the circumvention or violation of, any
+ * terms of an Apple operating system software license agreement.
+ *
+ * Please obtain a copy of the License at
+ * http://www.opensource.apple.com/apsl/ and read it before using this file.
+ *
+ * The Original Code and all software distributed under the License are
+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
+ * Please see the License for the specific language governing rights and
+ * limitations under the License.
+ *
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
+ */
+/*
+ * @OSF_COPYRIGHT@
+ */
+/*
+ * Mach Operating System
+ * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
+ * All Rights Reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation is hereby granted, provided that both the copyright
+ * notice and this permission notice appear in all copies of the
+ * software, derivative works or modified versions, and any portions
+ * thereof, and that both notices appear in supporting documentation.
+ *
+ * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
+ * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
+ *
+ * Carnegie Mellon requests users of this software to return to
+ *
+ * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
+ * School of Computer Science
+ * Carnegie Mellon University
+ * Pittsburgh PA 15213-3890
+ *
+ * any improvements or extensions that they make and grant Carnegie Mellon
+ * the rights to redistribute these changes.
+ */
+/*
+ */
+/*
+ * File: mach/boolean.h
+ *
+ * Boolean data type.
+ *
+ */
+
+#ifndef _MACH_BOOLEAN_H_
+#define _MACH_BOOLEAN_H_
+
+/*
+ * Pick up "boolean_t" type definition
+ */
+
+#ifndef ASSEMBLER
+#include <mach/machine/boolean.h>
+#endif /* ASSEMBLER */
+
+/*
+ * Define TRUE and FALSE if not defined.
+ */
+
+#ifndef TRUE
+#define TRUE 1
+#endif /* TRUE */
+
+#ifndef FALSE
+#define FALSE 0
+#endif /* FALSE */
+
+#endif /* _MACH_BOOLEAN_H_ */
diff --git a/src/third_party/mac_headers/mach/i386/boolean.h b/src/third_party/mac_headers/mach/i386/boolean.h
new file mode 100644
index 00000000..100f7e7b
--- /dev/null
+++ b/src/third_party/mac_headers/mach/i386/boolean.h
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
+ *
+ * This file contains Original Code and/or Modifications of Original Code
+ * as defined in and that are subject to the Apple Public Source License
+ * Version 2.0 (the 'License'). You may not use this file except in
+ * compliance with the License. The rights granted to you under the License
+ * may not be used to create, or enable the creation or redistribution of,
+ * unlawful or unlicensed copies of an Apple operating system, or to
+ * circumvent, violate, or enable the circumvention or violation of, any
+ * terms of an Apple operating system software license agreement.
+ *
+ * Please obtain a copy of the License at
+ * http://www.opensource.apple.com/apsl/ and read it before using this file.
+ *
+ * The Original Code and all software distributed under the License are
+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
+ * Please see the License for the specific language governing rights and
+ * limitations under the License.
+ *
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
+ */
+/*
+ * @OSF_COPYRIGHT@
+ */
+/*
+ * Mach Operating System
+ * Copyright (c) 1991,1990,1989 Carnegie Mellon University
+ * All Rights Reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation is hereby granted, provided that both the copyright
+ * notice and this permission notice appear in all copies of the
+ * software, derivative works or modified versions, and any portions
+ * thereof, and that both notices appear in supporting documentation.
+ *
+ * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
+ * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
+ *
+ * Carnegie Mellon requests users of this software to return to
+ *
+ * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
+ * School of Computer Science
+ * Carnegie Mellon University
+ * Pittsburgh PA 15213-3890
+ *
+ * any improvements or extensions that they make and grant Carnegie Mellon
+ * the rights to redistribute these changes.
+ */
+/*
+ */
+
+/*
+ * File: boolean.h
+ *
+ * Boolean type, for I386.
+ */
+
+#ifndef _MACH_I386_BOOLEAN_H_
+#define _MACH_I386_BOOLEAN_H_
+
+#if defined(__x86_64__) && !defined(KERNEL)
+typedef unsigned int boolean_t;
+#else
+typedef int boolean_t;
+#endif
+
+#endif /* _MACH_I386_BOOLEAN_H_ */
diff --git a/src/third_party/mac_headers/mach/i386/vm_param.h b/src/third_party/mac_headers/mach/i386/vm_param.h
new file mode 100644
index 00000000..edcb8349
--- /dev/null
+++ b/src/third_party/mac_headers/mach/i386/vm_param.h
@@ -0,0 +1,157 @@
+/*
+ * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
+ *
+ * This file contains Original Code and/or Modifications of Original Code
+ * as defined in and that are subject to the Apple Public Source License
+ * Version 2.0 (the 'License'). You may not use this file except in
+ * compliance with the License. The rights granted to you under the License
+ * may not be used to create, or enable the creation or redistribution of,
+ * unlawful or unlicensed copies of an Apple operating system, or to
+ * circumvent, violate, or enable the circumvention or violation of, any
+ * terms of an Apple operating system software license agreement.
+ *
+ * Please obtain a copy of the License at
+ * http://www.opensource.apple.com/apsl/ and read it before using this file.
+ *
+ * The Original Code and all software distributed under the License are
+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
+ * Please see the License for the specific language governing rights and
+ * limitations under the License.
+ *
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
+ */
+/*
+ * @OSF_COPYRIGHT@
+ */
+/*
+ * Mach Operating System
+ * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University
+ * All Rights Reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation is hereby granted, provided that both the copyright
+ * notice and this permission notice appear in all copies of the
+ * software, derivative works or modified versions, and any portions
+ * thereof, and that both notices appear in supporting documentation.
+ *
+ * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
+ * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
+ *
+ * Carnegie Mellon requests users of this software to return to
+ *
+ * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
+ * School of Computer Science
+ * Carnegie Mellon University
+ * Pittsburgh PA 15213-3890
+ *
+ * any improvements or extensions that they make and grant Carnegie Mellon
+ * the rights to redistribute these changes.
+ */
+
+/*
+ * Copyright (c) 1994 The University of Utah and
+ * the Computer Systems Laboratory at the University of Utah (CSL).
+ * All rights reserved.
+ *
+ * Permission to use, copy, modify and distribute this software is hereby
+ * granted provided that (1) source code retains these copyright, permission,
+ * and disclaimer notices, and (2) redistributions including binaries
+ * reproduce the notices in supporting documentation, and (3) all advertising
+ * materials mentioning features or use of this software display the following
+ * acknowledgement: ``This product includes software developed by the
+ * Computer Systems Laboratory at the University of Utah.''
+ *
+ * THE UNIVERSITY OF UTAH AND CSL ALLOW FREE USE OF THIS SOFTWARE IN ITS "AS
+ * IS" CONDITION. THE UNIVERSITY OF UTAH AND CSL DISCLAIM ANY LIABILITY OF
+ * ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
+ *
+ * CSL requests users of this software to return to csl-dist@cs.utah.edu any
+ * improvements that they make and grant CSL redistribution rights.
+ *
+ */
+
+/*
+ * File: vm_param.h
+ * Author: Avadis Tevanian, Jr.
+ * Date: 1985
+ *
+ * I386 machine dependent virtual memory parameters.
+ * Most of the declarations are preceeded by I386_ (or i386_)
+ * which is OK because only I386 specific code will be using
+ * them.
+ */
+
+#ifndef _MACH_I386_VM_PARAM_H_
+#define _MACH_I386_VM_PARAM_H_
+
+#define BYTE_SIZE 8 /* byte size in bits */
+
+#define I386_PGBYTES 4096 /* bytes per 80386 page */
+#define I386_PGSHIFT 12 /* bitshift for pages */
+
+#define PAGE_SIZE I386_PGBYTES
+#define PAGE_SHIFT I386_PGSHIFT
+#define PAGE_MASK (PAGE_SIZE - 1)
+
+#define I386_LPGBYTES 2*1024*1024 /* bytes per large page */
+#define I386_LPGSHIFT 21 /* bitshift for large pages */
+#define I386_LPGMASK (I386_LPGBYTES-1)
+
+/*
+ * Convert bytes to pages and convert pages to bytes.
+ * No rounding is used.
+ */
+
+#define i386_btop(x) ((ppnum_t)((x) >> I386_PGSHIFT))
+#define machine_btop(x) i386_btop(x)
+#define i386_ptob(x) (((pmap_paddr_t)(x)) << I386_PGSHIFT)
+
+/*
+ * Round off or truncate to the nearest page. These will work
+ * for either addresses or counts. (i.e. 1 byte rounds to 1 page
+ * bytes.
+ */
+
+#define i386_round_page(x) ((((pmap_paddr_t)(x)) + I386_PGBYTES - 1) & \
+ ~(I386_PGBYTES-1))
+#define i386_trunc_page(x) (((pmap_paddr_t)(x)) & ~(I386_PGBYTES-1))
+
+
+
+#define VM_MIN_ADDRESS64 ((user_addr_t) 0x0000000000000000ULL)
+/*
+ * default top of user stack... it grows down from here
+ */
+#define VM_USRSTACK64 ((user_addr_t) 0x00007FFF5FC00000ULL)
+#define VM_DYLD64 ((user_addr_t) 0x00007FFF5FC00000ULL)
+#define VM_LIB64_SHR_DATA ((user_addr_t) 0x00007FFF60000000ULL)
+#define VM_LIB64_SHR_TEXT ((user_addr_t) 0x00007FFF80000000ULL)
+/*
+ * the end of the usable user address space , for now about 47 bits.
+ * the 64 bit commpage is past the end of this
+ */
+#define VM_MAX_PAGE_ADDRESS ((user_addr_t) 0x00007FFFFFE00000ULL)
+/*
+ * canonical end of user address space for limits checking
+ */
+#define VM_MAX_USER_PAGE_ADDRESS ((user_addr_t)0x00007FFFFFFFF000ULL)
+
+
+/* system-wide values */
+#define MACH_VM_MIN_ADDRESS ((mach_vm_offset_t) 0)
+#define MACH_VM_MAX_ADDRESS ((mach_vm_offset_t) VM_MAX_PAGE_ADDRESS)
+
+/* process-relative values (all 32-bit legacy only for now) */
+#define VM_MIN_ADDRESS ((vm_offset_t) 0)
+#define VM_USRSTACK32 ((vm_offset_t) 0xC0000000)
+#define VM_MAX_ADDRESS ((vm_offset_t) 0xFFE00000)
+
+
+
+#endif /* _MACH_I386_VM_PARAM_H_ */
diff --git a/src/third_party/mac_headers/mach/i386/vm_types.h b/src/third_party/mac_headers/mach/i386/vm_types.h
new file mode 100644
index 00000000..2c38fa2d
--- /dev/null
+++ b/src/third_party/mac_headers/mach/i386/vm_types.h
@@ -0,0 +1,140 @@
+/*
+ * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
+ *
+ * This file contains Original Code and/or Modifications of Original Code
+ * as defined in and that are subject to the Apple Public Source License
+ * Version 2.0 (the 'License'). You may not use this file except in
+ * compliance with the License. The rights granted to you under the License
+ * may not be used to create, or enable the creation or redistribution of,
+ * unlawful or unlicensed copies of an Apple operating system, or to
+ * circumvent, violate, or enable the circumvention or violation of, any
+ * terms of an Apple operating system software license agreement.
+ *
+ * Please obtain a copy of the License at
+ * http://www.opensource.apple.com/apsl/ and read it before using this file.
+ *
+ * The Original Code and all software distributed under the License are
+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
+ * Please see the License for the specific language governing rights and
+ * limitations under the License.
+ *
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
+ */
+/*
+ * @OSF_COPYRIGHT@
+ */
+/*
+ * Mach Operating System
+ * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University
+ * All Rights Reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation is hereby granted, provided that both the copyright
+ * notice and this permission notice appear in all copies of the
+ * software, derivative works or modified versions, and any portions
+ * thereof, and that both notices appear in supporting documentation.
+ *
+ * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
+ * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
+ *
+ * Carnegie Mellon requests users of this software to return to
+ *
+ * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
+ * School of Computer Science
+ * Carnegie Mellon University
+ * Pittsburgh PA 15213-3890
+ *
+ * any improvements or extensions that they make and grant Carnegie Mellon
+ * the rights to redistribute these changes.
+ */
+/*
+ */
+
+/*
+ * File: vm_types.h
+ * Author: Avadis Tevanian, Jr.
+ * Date: 1985
+ *
+ * Header file for VM data types. I386 version.
+ */
+
+#ifndef _MACH_I386_VM_TYPES_H_
+#define _MACH_I386_VM_TYPES_H_
+
+#ifndef ASSEMBLER
+
+#include <i386/_types.h>
+#include <mach/i386/vm_param.h>
+#include <stdint.h>
+
+/*
+ * natural_t and integer_t are Mach's legacy types for machine-
+ * independent integer types (unsigned, and signed, respectively).
+ * Their original purpose was to define other types in a machine/
+ * compiler independent way.
+ *
+ * They also had an implicit "same size as pointer" characteristic
+ * to them (i.e. Mach's traditional types are very ILP32 or ILP64
+ * centric). We support x86 ABIs that do not follow either of
+ * these models (specifically LP64). Therefore, we had to make a
+ * choice between making these types scale with pointers or stay
+ * tied to integers. Because their use is predominantly tied to
+ * to the size of an integer, we are keeping that association and
+ * breaking free from pointer size guarantees.
+ *
+ * New use of these types is discouraged.
+ */
+typedef __darwin_natural_t natural_t;
+typedef int integer_t;
+
+/*
+ * A vm_offset_t is a type-neutral pointer,
+ * e.g. an offset into a virtual memory space.
+ */
+#ifdef __LP64__
+typedef uintptr_t vm_offset_t;
+#else /* __LP64__ */
+typedef natural_t vm_offset_t;
+#endif /* __LP64__ */
+
+/*
+ * A vm_size_t is the proper type for e.g.
+ * expressing the difference between two
+ * vm_offset_t entities.
+ */
+#ifdef __LP64__
+typedef uintptr_t vm_size_t;
+#else /* __LP64__ */
+typedef natural_t vm_size_t;
+#endif /* __LP64__ */
+
+/*
+ * This new type is independent of a particular vm map's
+ * implementation size - and represents appropriate types
+ * for all possible maps. This is used for interfaces
+ * where the size of the map is not known - or we don't
+ * want to have to distinguish.
+ */
+typedef uint64_t mach_vm_address_t;
+typedef uint64_t mach_vm_offset_t;
+typedef uint64_t mach_vm_size_t;
+
+typedef uint64_t vm_map_offset_t;
+typedef uint64_t vm_map_address_t;
+typedef uint64_t vm_map_size_t;
+
+
+#endif /* ASSEMBLER */
+
+/*
+ * If composing messages by hand (please do not)
+ */
+#define MACH_MSG_TYPE_INTEGER_T MACH_MSG_TYPE_INTEGER_32
+
+#endif /* _MACH_I386_VM_TYPES_H_ */
diff --git a/src/third_party/mac_headers/mach/machine.h b/src/third_party/mac_headers/mach/machine.h
new file mode 100644
index 00000000..5bb21e48
--- /dev/null
+++ b/src/third_party/mac_headers/mach/machine.h
@@ -0,0 +1,347 @@
+/*
+ * Copyright (c) 2000-2007 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
+ *
+ * This file contains Original Code and/or Modifications of Original Code
+ * as defined in and that are subject to the Apple Public Source License
+ * Version 2.0 (the 'License'). You may not use this file except in
+ * compliance with the License. The rights granted to you under the License
+ * may not be used to create, or enable the creation or redistribution of,
+ * unlawful or unlicensed copies of an Apple operating system, or to
+ * circumvent, violate, or enable the circumvention or violation of, any
+ * terms of an Apple operating system software license agreement.
+ *
+ * Please obtain a copy of the License at
+ * http://www.opensource.apple.com/apsl/ and read it before using this file.
+ *
+ * The Original Code and all software distributed under the License are
+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
+ * Please see the License for the specific language governing rights and
+ * limitations under the License.
+ *
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
+ */
+/*
+ * Mach Operating System
+ * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
+ * All Rights Reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation is hereby granted, provided that both the copyright
+ * notice and this permission notice appear in all copies of the
+ * software, derivative works or modified versions, and any portions
+ * thereof, and that both notices appear in supporting documentation.
+ *
+ * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
+ * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
+ *
+ * Carnegie Mellon requests users of this software to return to
+ *
+ * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
+ * School of Computer Science
+ * Carnegie Mellon University
+ * Pittsburgh PA 15213-3890
+ *
+ * any improvements or extensions that they make and grant Carnegie Mellon
+ * the rights to redistribute these changes.
+ */
+/* File: machine.h
+ * Author: Avadis Tevanian, Jr.
+ * Date: 1986
+ *
+ * Machine independent machine abstraction.
+ */
+
+#ifndef _MACH_MACHINE_H_
+#define _MACH_MACHINE_H_
+
+#include <stdint.h>
+#include <mach/machine/vm_types.h>
+#include <mach/boolean.h>
+
+typedef integer_t cpu_type_t;
+typedef integer_t cpu_subtype_t;
+typedef integer_t cpu_threadtype_t;
+
+#define CPU_STATE_MAX 4
+
+#define CPU_STATE_USER 0
+#define CPU_STATE_SYSTEM 1
+#define CPU_STATE_IDLE 2
+#define CPU_STATE_NICE 3
+
+
+
+/*
+ * Capability bits used in the definition of cpu_type.
+ */
+#define CPU_ARCH_MASK 0xff000000 /* mask for architecture bits */
+#define CPU_ARCH_ABI64 0x01000000 /* 64 bit ABI */
+
+/*
+ * Machine types known by all.
+ */
+
+#define CPU_TYPE_ANY ((cpu_type_t) -1)
+
+#define CPU_TYPE_VAX ((cpu_type_t) 1)
+/* skip ((cpu_type_t) 2) */
+/* skip ((cpu_type_t) 3) */
+/* skip ((cpu_type_t) 4) */
+/* skip ((cpu_type_t) 5) */
+#define CPU_TYPE_MC680x0 ((cpu_type_t) 6)
+#define CPU_TYPE_X86 ((cpu_type_t) 7)
+#define CPU_TYPE_I386 CPU_TYPE_X86 /* compatibility */
+#define CPU_TYPE_X86_64 (CPU_TYPE_X86 | CPU_ARCH_ABI64)
+
+/* skip CPU_TYPE_MIPS ((cpu_type_t) 8) */
+/* skip ((cpu_type_t) 9) */
+#define CPU_TYPE_MC98000 ((cpu_type_t) 10)
+#define CPU_TYPE_HPPA ((cpu_type_t) 11)
+#define CPU_TYPE_ARM ((cpu_type_t) 12)
+#define CPU_TYPE_MC88000 ((cpu_type_t) 13)
+#define CPU_TYPE_SPARC ((cpu_type_t) 14)
+#define CPU_TYPE_I860 ((cpu_type_t) 15)
+/* skip CPU_TYPE_ALPHA ((cpu_type_t) 16) */
+/* skip ((cpu_type_t) 17) */
+#define CPU_TYPE_POWERPC ((cpu_type_t) 18)
+#define CPU_TYPE_POWERPC64 (CPU_TYPE_POWERPC | CPU_ARCH_ABI64)
+
+/*
+ * Machine subtypes (these are defined here, instead of in a machine
+ * dependent directory, so that any program can get all definitions
+ * regardless of where is it compiled).
+ */
+
+/*
+ * Capability bits used in the definition of cpu_subtype.
+ */
+#define CPU_SUBTYPE_MASK 0xff000000 /* mask for feature flags */
+#define CPU_SUBTYPE_LIB64 0x80000000 /* 64 bit libraries */
+
+
+/*
+ * Object files that are hand-crafted to run on any
+ * implementation of an architecture are tagged with
+ * CPU_SUBTYPE_MULTIPLE. This functions essentially the same as
+ * the "ALL" subtype of an architecture except that it allows us
+ * to easily find object files that may need to be modified
+ * whenever a new implementation of an architecture comes out.
+ *
+ * It is the responsibility of the implementor to make sure the
+ * software handles unsupported implementations elegantly.
+ */
+#define CPU_SUBTYPE_MULTIPLE ((cpu_subtype_t) -1)
+#define CPU_SUBTYPE_LITTLE_ENDIAN ((cpu_subtype_t) 0)
+#define CPU_SUBTYPE_BIG_ENDIAN ((cpu_subtype_t) 1)
+
+/*
+ * Machine threadtypes.
+ * This is none - not defined - for most machine types/subtypes.
+ */
+#define CPU_THREADTYPE_NONE ((cpu_threadtype_t) 0)
+
+/*
+ * VAX subtypes (these do *not* necessary conform to the actual cpu
+ * ID assigned by DEC available via the SID register).
+ */
+
+#define CPU_SUBTYPE_VAX_ALL ((cpu_subtype_t) 0)
+#define CPU_SUBTYPE_VAX780 ((cpu_subtype_t) 1)
+#define CPU_SUBTYPE_VAX785 ((cpu_subtype_t) 2)
+#define CPU_SUBTYPE_VAX750 ((cpu_subtype_t) 3)
+#define CPU_SUBTYPE_VAX730 ((cpu_subtype_t) 4)
+#define CPU_SUBTYPE_UVAXI ((cpu_subtype_t) 5)
+#define CPU_SUBTYPE_UVAXII ((cpu_subtype_t) 6)
+#define CPU_SUBTYPE_VAX8200 ((cpu_subtype_t) 7)
+#define CPU_SUBTYPE_VAX8500 ((cpu_subtype_t) 8)
+#define CPU_SUBTYPE_VAX8600 ((cpu_subtype_t) 9)
+#define CPU_SUBTYPE_VAX8650 ((cpu_subtype_t) 10)
+#define CPU_SUBTYPE_VAX8800 ((cpu_subtype_t) 11)
+#define CPU_SUBTYPE_UVAXIII ((cpu_subtype_t) 12)
+
+/*
+ * 680x0 subtypes
+ *
+ * The subtype definitions here are unusual for historical reasons.
+ * NeXT used to consider 68030 code as generic 68000 code. For
+ * backwards compatability:
+ *
+ * CPU_SUBTYPE_MC68030 symbol has been preserved for source code
+ * compatability.
+ *
+ * CPU_SUBTYPE_MC680x0_ALL has been defined to be the same
+ * subtype as CPU_SUBTYPE_MC68030 for binary comatability.
+ *
+ * CPU_SUBTYPE_MC68030_ONLY has been added to allow new object
+ * files to be tagged as containing 68030-specific instructions.
+ */
+
+#define CPU_SUBTYPE_MC680x0_ALL ((cpu_subtype_t) 1)
+#define CPU_SUBTYPE_MC68030 ((cpu_subtype_t) 1) /* compat */
+#define CPU_SUBTYPE_MC68040 ((cpu_subtype_t) 2)
+#define CPU_SUBTYPE_MC68030_ONLY ((cpu_subtype_t) 3)
+
+/*
+ * I386 subtypes
+ */
+
+#define CPU_SUBTYPE_INTEL(f, m) ((cpu_subtype_t) (f) + ((m) << 4))
+
+#define CPU_SUBTYPE_I386_ALL CPU_SUBTYPE_INTEL(3, 0)
+#define CPU_SUBTYPE_386 CPU_SUBTYPE_INTEL(3, 0)
+#define CPU_SUBTYPE_486 CPU_SUBTYPE_INTEL(4, 0)
+#define CPU_SUBTYPE_486SX CPU_SUBTYPE_INTEL(4, 8) // 8 << 4 = 128
+#define CPU_SUBTYPE_586 CPU_SUBTYPE_INTEL(5, 0)
+#define CPU_SUBTYPE_PENT CPU_SUBTYPE_INTEL(5, 0)
+#define CPU_SUBTYPE_PENTPRO CPU_SUBTYPE_INTEL(6, 1)
+#define CPU_SUBTYPE_PENTII_M3 CPU_SUBTYPE_INTEL(6, 3)
+#define CPU_SUBTYPE_PENTII_M5 CPU_SUBTYPE_INTEL(6, 5)
+#define CPU_SUBTYPE_CELERON CPU_SUBTYPE_INTEL(7, 6)
+#define CPU_SUBTYPE_CELERON_MOBILE CPU_SUBTYPE_INTEL(7, 7)
+#define CPU_SUBTYPE_PENTIUM_3 CPU_SUBTYPE_INTEL(8, 0)
+#define CPU_SUBTYPE_PENTIUM_3_M CPU_SUBTYPE_INTEL(8, 1)
+#define CPU_SUBTYPE_PENTIUM_3_XEON CPU_SUBTYPE_INTEL(8, 2)
+#define CPU_SUBTYPE_PENTIUM_M CPU_SUBTYPE_INTEL(9, 0)
+#define CPU_SUBTYPE_PENTIUM_4 CPU_SUBTYPE_INTEL(10, 0)
+#define CPU_SUBTYPE_PENTIUM_4_M CPU_SUBTYPE_INTEL(10, 1)
+#define CPU_SUBTYPE_ITANIUM CPU_SUBTYPE_INTEL(11, 0)
+#define CPU_SUBTYPE_ITANIUM_2 CPU_SUBTYPE_INTEL(11, 1)
+#define CPU_SUBTYPE_XEON CPU_SUBTYPE_INTEL(12, 0)
+#define CPU_SUBTYPE_XEON_MP CPU_SUBTYPE_INTEL(12, 1)
+
+#define CPU_SUBTYPE_INTEL_FAMILY(x) ((x) & 15)
+#define CPU_SUBTYPE_INTEL_FAMILY_MAX 15
+
+#define CPU_SUBTYPE_INTEL_MODEL(x) ((x) >> 4)
+#define CPU_SUBTYPE_INTEL_MODEL_ALL 0
+
+/*
+ * X86 subtypes.
+ */
+
+#define CPU_SUBTYPE_X86_ALL ((cpu_subtype_t)3)
+#define CPU_SUBTYPE_X86_64_ALL ((cpu_subtype_t)3)
+#define CPU_SUBTYPE_X86_ARCH1 ((cpu_subtype_t)4)
+#define CPU_SUBTYPE_X86_64_H ((cpu_subtype_t)8) /* Haswell feature subset */
+
+
+#define CPU_THREADTYPE_INTEL_HTT ((cpu_threadtype_t) 1)
+
+/*
+ * Mips subtypes.
+ */
+
+#define CPU_SUBTYPE_MIPS_ALL ((cpu_subtype_t) 0)
+#define CPU_SUBTYPE_MIPS_R2300 ((cpu_subtype_t) 1)
+#define CPU_SUBTYPE_MIPS_R2600 ((cpu_subtype_t) 2)
+#define CPU_SUBTYPE_MIPS_R2800 ((cpu_subtype_t) 3)
+#define CPU_SUBTYPE_MIPS_R2000a ((cpu_subtype_t) 4) /* pmax */
+#define CPU_SUBTYPE_MIPS_R2000 ((cpu_subtype_t) 5)
+#define CPU_SUBTYPE_MIPS_R3000a ((cpu_subtype_t) 6) /* 3max */
+#define CPU_SUBTYPE_MIPS_R3000 ((cpu_subtype_t) 7)
+
+/*
+ * MC98000 (PowerPC) subtypes
+ */
+#define CPU_SUBTYPE_MC98000_ALL ((cpu_subtype_t) 0)
+#define CPU_SUBTYPE_MC98601 ((cpu_subtype_t) 1)
+
+/*
+ * HPPA subtypes for Hewlett-Packard HP-PA family of
+ * risc processors. Port by NeXT to 700 series.
+ */
+
+#define CPU_SUBTYPE_HPPA_ALL ((cpu_subtype_t) 0)
+#define CPU_SUBTYPE_HPPA_7100 ((cpu_subtype_t) 0) /* compat */
+#define CPU_SUBTYPE_HPPA_7100LC ((cpu_subtype_t) 1)
+
+/*
+ * MC88000 subtypes.
+ */
+#define CPU_SUBTYPE_MC88000_ALL ((cpu_subtype_t) 0)
+#define CPU_SUBTYPE_MC88100 ((cpu_subtype_t) 1)
+#define CPU_SUBTYPE_MC88110 ((cpu_subtype_t) 2)
+
+/*
+ * SPARC subtypes
+ */
+#define CPU_SUBTYPE_SPARC_ALL ((cpu_subtype_t) 0)
+
+/*
+ * I860 subtypes
+ */
+#define CPU_SUBTYPE_I860_ALL ((cpu_subtype_t) 0)
+#define CPU_SUBTYPE_I860_860 ((cpu_subtype_t) 1)
+
+/*
+ * PowerPC subtypes
+ */
+#define CPU_SUBTYPE_POWERPC_ALL ((cpu_subtype_t) 0)
+#define CPU_SUBTYPE_POWERPC_601 ((cpu_subtype_t) 1)
+#define CPU_SUBTYPE_POWERPC_602 ((cpu_subtype_t) 2)
+#define CPU_SUBTYPE_POWERPC_603 ((cpu_subtype_t) 3)
+#define CPU_SUBTYPE_POWERPC_603e ((cpu_subtype_t) 4)
+#define CPU_SUBTYPE_POWERPC_603ev ((cpu_subtype_t) 5)
+#define CPU_SUBTYPE_POWERPC_604 ((cpu_subtype_t) 6)
+#define CPU_SUBTYPE_POWERPC_604e ((cpu_subtype_t) 7)
+#define CPU_SUBTYPE_POWERPC_620 ((cpu_subtype_t) 8)
+#define CPU_SUBTYPE_POWERPC_750 ((cpu_subtype_t) 9)
+#define CPU_SUBTYPE_POWERPC_7400 ((cpu_subtype_t) 10)
+#define CPU_SUBTYPE_POWERPC_7450 ((cpu_subtype_t) 11)
+#define CPU_SUBTYPE_POWERPC_970 ((cpu_subtype_t) 100)
+
+/*
+ * ARM subtypes
+ */
+#define CPU_SUBTYPE_ARM_ALL ((cpu_subtype_t) 0)
+#define CPU_SUBTYPE_ARM_V4T ((cpu_subtype_t) 5)
+#define CPU_SUBTYPE_ARM_V6 ((cpu_subtype_t) 6)
+#define CPU_SUBTYPE_ARM_V5TEJ ((cpu_subtype_t) 7)
+#define CPU_SUBTYPE_ARM_XSCALE ((cpu_subtype_t) 8)
+#define CPU_SUBTYPE_ARM_V7 ((cpu_subtype_t) 9)
+
+/*
+ * CPU families (sysctl hw.cpufamily)
+ *
+ * These are meant to identify the CPU's marketing name - an
+ * application can map these to (possibly) localized strings.
+ * NB: the encodings of the CPU families are intentionally arbitrary.
+ * There is no ordering, and you should never try to deduce whether
+ * or not some feature is available based on the family.
+ * Use feature flags (eg, hw.optional.altivec) to test for optional
+ * functionality.
+ */
+#define CPUFAMILY_UNKNOWN 0
+#define CPUFAMILY_POWERPC_G3 0xcee41549
+#define CPUFAMILY_POWERPC_G4 0x77c184ae
+#define CPUFAMILY_POWERPC_G5 0xed76d8aa
+#define CPUFAMILY_INTEL_6_13 0xaa33392b
+#define CPUFAMILY_INTEL_YONAH 0x73d67300
+#define CPUFAMILY_INTEL_MEROM 0x426f69ef
+#define CPUFAMILY_INTEL_PENRYN 0x78ea4fbc
+#define CPUFAMILY_INTEL_NEHALEM 0x6b5a4cd2
+#define CPUFAMILY_INTEL_WESTMERE 0x573b5eec
+#define CPUFAMILY_INTEL_SANDYBRIDGE 0x5490b78c
+#define CPUFAMILY_ARM_9 0xe73283ae
+#define CPUFAMILY_ARM_11 0x8ff620d8
+#define CPUFAMILY_ARM_XSCALE 0x53b005f5
+#define CPUFAMILY_ARM_13 0x0cc90e64
+#define CPUFAMILY_ARM_14 0x96077ef1
+
+/* The following synonyms are deprecated: */
+#define CPUFAMILY_INTEL_6_14 CPUFAMILY_INTEL_YONAH
+#define CPUFAMILY_INTEL_6_15 CPUFAMILY_INTEL_MEROM
+#define CPUFAMILY_INTEL_6_23 CPUFAMILY_INTEL_PENRYN
+#define CPUFAMILY_INTEL_6_26 CPUFAMILY_INTEL_NEHALEM
+
+#define CPUFAMILY_INTEL_CORE CPUFAMILY_INTEL_YONAH
+#define CPUFAMILY_INTEL_CORE2 CPUFAMILY_INTEL_MEROM
+
+
+#endif /* _MACH_MACHINE_H_ */
diff --git a/src/third_party/mac_headers/mach/machine/boolean.h b/src/third_party/mac_headers/mach/machine/boolean.h
new file mode 100644
index 00000000..ffdc2390
--- /dev/null
+++ b/src/third_party/mac_headers/mach/machine/boolean.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2000-2007 Apple Inc. All rights reserved.
+ *
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
+ *
+ * This file contains Original Code and/or Modifications of Original Code
+ * as defined in and that are subject to the Apple Public Source License
+ * Version 2.0 (the 'License'). You may not use this file except in
+ * compliance with the License. The rights granted to you under the License
+ * may not be used to create, or enable the creation or redistribution of,
+ * unlawful or unlicensed copies of an Apple operating system, or to
+ * circumvent, violate, or enable the circumvention or violation of, any
+ * terms of an Apple operating system software license agreement.
+ *
+ * Please obtain a copy of the License at
+ * http://www.opensource.apple.com/apsl/ and read it before using this file.
+ *
+ * The Original Code and all software distributed under the License are
+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
+ * Please see the License for the specific language governing rights and
+ * limitations under the License.
+ *
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
+ */
+
+#ifndef _MACH_MACHINE_BOOLEAN_H_
+#define _MACH_MACHINE_BOOLEAN_H_
+
+#if defined (__i386__) || defined(__x86_64__)
+#include "mach/i386/boolean.h"
+#elif defined (__arm__)
+#include "mach/arm/boolean.h"
+#else
+#error architecture not supported
+#endif
+
+#endif /* _MACH_MACHINE_BOOLEAN_H_ */
diff --git a/src/third_party/mac_headers/mach/machine/thread_state.h b/src/third_party/mac_headers/mach/machine/thread_state.h
new file mode 100644
index 00000000..1547acac
--- /dev/null
+++ b/src/third_party/mac_headers/mach/machine/thread_state.h
@@ -0,0 +1,9 @@
+/*
+ * This file is a stub with the bare minimum needed to make things work.
+ */
+#ifndef _MACH_MACHINE_THREAD_STATE_H_
+#define _MACH_MACHINE_THREAD_STATE_H_
+
+#define THREAD_STATE_MAX 1
+
+#endif /* _MACH_MACHINE_THREAD_STATE_H_ */
diff --git a/src/third_party/mac_headers/mach/machine/thread_status.h b/src/third_party/mac_headers/mach/machine/thread_status.h
new file mode 100644
index 00000000..d1ab56ad
--- /dev/null
+++ b/src/third_party/mac_headers/mach/machine/thread_status.h
@@ -0,0 +1 @@
+/* This file intentionally left blank */
diff --git a/src/third_party/mac_headers/mach/machine/vm_types.h b/src/third_party/mac_headers/mach/machine/vm_types.h
new file mode 100644
index 00000000..8ccd24be
--- /dev/null
+++ b/src/third_party/mac_headers/mach/machine/vm_types.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2000-2007 Apple Inc. All rights reserved.
+ *
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
+ *
+ * This file contains Original Code and/or Modifications of Original Code
+ * as defined in and that are subject to the Apple Public Source License
+ * Version 2.0 (the 'License'). You may not use this file except in
+ * compliance with the License. The rights granted to you under the License
+ * may not be used to create, or enable the creation or redistribution of,
+ * unlawful or unlicensed copies of an Apple operating system, or to
+ * circumvent, violate, or enable the circumvention or violation of, any
+ * terms of an Apple operating system software license agreement.
+ *
+ * Please obtain a copy of the License at
+ * http://www.opensource.apple.com/apsl/ and read it before using this file.
+ *
+ * The Original Code and all software distributed under the License are
+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
+ * Please see the License for the specific language governing rights and
+ * limitations under the License.
+ *
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
+ */
+
+#ifndef _MACH_MACHINE_VM_TYPES_H_
+#define _MACH_MACHINE_VM_TYPES_H_
+
+#if defined (__i386__) || defined(__x86_64__)
+#include "mach/i386/vm_types.h"
+#elif defined (__arm__)
+#include "mach/arm/vm_types.h"
+#else
+#error architecture not supported
+#endif
+
+#endif /* _MACH_MACHINE_VM_TYPES_H_ */
diff --git a/src/third_party/mac_headers/mach/thread_status.h b/src/third_party/mac_headers/mach/thread_status.h
new file mode 100644
index 00000000..aead09bf
--- /dev/null
+++ b/src/third_party/mac_headers/mach/thread_status.h
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
+ *
+ * This file contains Original Code and/or Modifications of Original Code
+ * as defined in and that are subject to the Apple Public Source License
+ * Version 2.0 (the 'License'). You may not use this file except in
+ * compliance with the License. The rights granted to you under the License
+ * may not be used to create, or enable the creation or redistribution of,
+ * unlawful or unlicensed copies of an Apple operating system, or to
+ * circumvent, violate, or enable the circumvention or violation of, any
+ * terms of an Apple operating system software license agreement.
+ *
+ * Please obtain a copy of the License at
+ * http://www.opensource.apple.com/apsl/ and read it before using this file.
+ *
+ * The Original Code and all software distributed under the License are
+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
+ * Please see the License for the specific language governing rights and
+ * limitations under the License.
+ *
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
+ */
+/*
+ * @OSF_COPYRIGHT@
+ */
+/*
+ * Mach Operating System
+ * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University
+ * All Rights Reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation is hereby granted, provided that both the copyright
+ * notice and this permission notice appear in all copies of the
+ * software, derivative works or modified versions, and any portions
+ * thereof, and that both notices appear in supporting documentation.
+ *
+ * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
+ * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
+ *
+ * Carnegie Mellon requests users of this software to return to
+ *
+ * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
+ * School of Computer Science
+ * Carnegie Mellon University
+ * Pittsburgh PA 15213-3890
+ *
+ * any improvements or extensions that they make and grant Carnegie Mellon
+ * the rights to redistribute these changes.
+ */
+/*
+ */
+/*
+ * File: mach/thread_status.h
+ * Author: Avadis Tevanian, Jr.
+ *
+ * This file contains the structure definitions for the user-visible
+ * thread state. This thread state is examined with the thread_get_state
+ * kernel call and may be changed with the thread_set_state kernel call.
+ *
+ */
+
+#ifndef _MACH_THREAD_STATUS_H_
+#define _MACH_THREAD_STATUS_H_
+
+/*
+ * The actual structure that comprises the thread state is defined
+ * in the machine dependent module.
+ */
+#include <mach/machine/vm_types.h>
+#include <mach/machine/thread_status.h>
+#include <mach/machine/thread_state.h>
+
+/*
+ * Generic definition for machine-dependent thread status.
+ */
+
+typedef natural_t *thread_state_t; /* Variable-length array */
+
+/* THREAD_STATE_MAX is now defined in <mach/machine/thread_state.h> */
+typedef natural_t thread_state_data_t[THREAD_STATE_MAX];
+
+#define THREAD_STATE_FLAVOR_LIST 0 /* List of valid flavors */
+#define THREAD_STATE_FLAVOR_LIST_NEW 128
+
+typedef int thread_state_flavor_t;
+typedef thread_state_flavor_t *thread_state_flavor_array_t;
+
+#endif /* _MACH_THREAD_STATUS_H_ */
diff --git a/src/third_party/mac_headers/mach/vm_prot.h b/src/third_party/mac_headers/mach/vm_prot.h
new file mode 100644
index 00000000..07c2114e
--- /dev/null
+++ b/src/third_party/mac_headers/mach/vm_prot.h
@@ -0,0 +1,140 @@
+/*
+ * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
+ *
+ * This file contains Original Code and/or Modifications of Original Code
+ * as defined in and that are subject to the Apple Public Source License
+ * Version 2.0 (the 'License'). You may not use this file except in
+ * compliance with the License. The rights granted to you under the License
+ * may not be used to create, or enable the creation or redistribution of,
+ * unlawful or unlicensed copies of an Apple operating system, or to
+ * circumvent, violate, or enable the circumvention or violation of, any
+ * terms of an Apple operating system software license agreement.
+ *
+ * Please obtain a copy of the License at
+ * http://www.opensource.apple.com/apsl/ and read it before using this file.
+ *
+ * The Original Code and all software distributed under the License are
+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
+ * Please see the License for the specific language governing rights and
+ * limitations under the License.
+ *
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
+ */
+/*
+ * @OSF_COPYRIGHT@
+ */
+/*
+ * Mach Operating System
+ * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
+ * All Rights Reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation is hereby granted, provided that both the copyright
+ * notice and this permission notice appear in all copies of the
+ * software, derivative works or modified versions, and any portions
+ * thereof, and that both notices appear in supporting documentation.
+ *
+ * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
+ * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
+ *
+ * Carnegie Mellon requests users of this software to return to
+ *
+ * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
+ * School of Computer Science
+ * Carnegie Mellon University
+ * Pittsburgh PA 15213-3890
+ *
+ * any improvements or extensions that they make and grant Carnegie Mellon
+ * the rights to redistribute these changes.
+ */
+/*
+ */
+/*
+ * File: mach/vm_prot.h
+ * Author: Avadis Tevanian, Jr., Michael Wayne Young
+ *
+ * Virtual memory protection definitions.
+ *
+ */
+
+#ifndef _MACH_VM_PROT_H_
+#define _MACH_VM_PROT_H_
+
+/*
+ * Types defined:
+ *
+ * vm_prot_t VM protection values.
+ */
+
+typedef int vm_prot_t;
+
+/*
+ * Protection values, defined as bits within the vm_prot_t type
+ */
+
+#define VM_PROT_NONE ((vm_prot_t) 0x00)
+
+#define VM_PROT_READ ((vm_prot_t) 0x01) /* read permission */
+#define VM_PROT_WRITE ((vm_prot_t) 0x02) /* write permission */
+#define VM_PROT_EXECUTE ((vm_prot_t) 0x04) /* execute permission */
+
+/*
+ * The default protection for newly-created virtual memory
+ */
+
+#define VM_PROT_DEFAULT (VM_PROT_READ|VM_PROT_WRITE)
+
+/*
+ * The maximum privileges possible, for parameter checking.
+ */
+
+#define VM_PROT_ALL (VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE)
+
+/*
+ * An invalid protection value.
+ * Used only by memory_object_lock_request to indicate no change
+ * to page locks. Using -1 here is a bad idea because it
+ * looks like VM_PROT_ALL and then some.
+ */
+
+#define VM_PROT_NO_CHANGE ((vm_prot_t) 0x08)
+
+/*
+ * When a caller finds that he cannot obtain write permission on a
+ * mapped entry, the following flag can be used. The entry will
+ * be made "needs copy" effectively copying the object (using COW),
+ * and write permission will be added to the maximum protections
+ * for the associated entry.
+ */
+
+#define VM_PROT_COPY ((vm_prot_t) 0x10)
+
+
+/*
+ * Another invalid protection value.
+ * Used only by memory_object_data_request upon an object
+ * which has specified a copy_call copy strategy. It is used
+ * when the kernel wants a page belonging to a copy of the
+ * object, and is only asking the object as a result of
+ * following a shadow chain. This solves the race between pages
+ * being pushed up by the memory manager and the kernel
+ * walking down the shadow chain.
+ */
+
+#define VM_PROT_WANTS_COPY ((vm_prot_t) 0x10)
+
+
+/*
+ * Another invalid protection value.
+ * Indicates that the other protection bits are to be applied as a mask
+ * against the actual protection bits of the map entry.
+ */
+#define VM_PROT_IS_MASK ((vm_prot_t) 0x40)
+
+#endif /* _MACH_VM_PROT_H_ */
diff --git a/src/third_party/musl/COPYRIGHT b/src/third_party/musl/COPYRIGHT
new file mode 100644
index 00000000..f0ee3b78
--- /dev/null
+++ b/src/third_party/musl/COPYRIGHT
@@ -0,0 +1,163 @@
+musl as a whole is licensed under the following standard MIT license:
+
+----------------------------------------------------------------------
+Copyright © 2005-2014 Rich Felker, et al.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+----------------------------------------------------------------------
+
+Authors/contributors include:
+
+Alex Dowad
+Alexander Monakov
+Anthony G. Basile
+Arvid Picciani
+Bobby Bingham
+Boris Brezillon
+Brent Cook
+Chris Spiegel
+Clément Vasseur
+Daniel Micay
+Denys Vlasenko
+Emil Renner Berthing
+Felix Fietkau
+Felix Janda
+Gianluca Anzolin
+Hauke Mehrtens
+Hiltjo Posthuma
+Isaac Dunham
+Jaydeep Patil
+Jens Gustedt
+Jeremy Huntwork
+Jo-Philipp Wich
+Joakim Sindholt
+John Spencer
+Josiah Worcester
+Justin Cormack
+Khem Raj
+Kylie McClain
+Luca Barbato
+Luka Perkov
+M Farkas-Dyck (Strake)
+Mahesh Bodapati
+Michael Forney
+Natanael Copa
+Nicholas J. Kain
+orc
+Pascal Cuoq
+Petr Hosek
+Pierre Carrier
+Rich Felker
+Richard Pennington
+Shiz
+sin
+Solar Designer
+Stefan Kristiansson
+Szabolcs Nagy
+Timo Teräs
+Trutz Behn
+Valentin Ochs
+William Haddon
+
+Portions of this software are derived from third-party works licensed
+under terms compatible with the above MIT license:
+
+The TRE regular expression implementation (src/regex/reg* and
+src/regex/tre*) is Copyright © 2001-2008 Ville Laurikari and licensed
+under a 2-clause BSD license (license text in the source files). The
+included version has been heavily modified by Rich Felker in 2012, in
+the interests of size, simplicity, and namespace cleanliness.
+
+Much of the math library code (src/math/* and src/complex/*) is
+Copyright © 1993,2004 Sun Microsystems or
+Copyright © 2003-2011 David Schultz or
+Copyright © 2003-2009 Steven G. Kargl or
+Copyright © 2003-2009 Bruce D. Evans or
+Copyright © 2008 Stephen L. Moshier
+and labelled as such in comments in the individual source files. All
+have been licensed under extremely permissive terms.
+
+The ARM memcpy code (src/string/arm/memcpy_el.S) is Copyright © 2008
+The Android Open Source Project and is licensed under a two-clause BSD
+license. It was taken from Bionic libc, used on Android.
+
+The implementation of DES for crypt (src/crypt/crypt_des.c) is
+Copyright © 1994 David Burren. It is licensed under a BSD license.
+
+The implementation of blowfish crypt (src/crypt/crypt_blowfish.c) was
+originally written by Solar Designer and placed into the public
+domain. The code also comes with a fallback permissive license for use
+in jurisdictions that may not recognize the public domain.
+
+The smoothsort implementation (src/stdlib/qsort.c) is Copyright © 2011
+Valentin Ochs and is licensed under an MIT-style license.
+
+The BSD PRNG implementation (src/prng/random.c) and XSI search API
+(src/search/*.c) functions are Copyright © 2011 Szabolcs Nagy and
+licensed under following terms: "Permission to use, copy, modify,
+and/or distribute this code for any purpose with or without fee is
+hereby granted. There is no warranty."
+
+The x86_64 port was written by Nicholas J. Kain and is licensed under
+the standard MIT terms.
+
+The mips and microblaze ports were originally written by Richard
+Pennington for use in the ellcc project. The original code was adapted
+by Rich Felker for build system and code conventions during upstream
+integration. It is licensed under the standard MIT terms.
+
+The mips64 port was contributed by Imagination Technologies and is
+licensed under the standard MIT terms.
+
+The powerpc port was also originally written by Richard Pennington,
+and later supplemented and integrated by John Spencer. It is licensed
+under the standard MIT terms.
+
+All other files which have no copyright comments are original works
+produced specifically for use as part of this library, written either
+by Rich Felker, the main author of the library, or by one or more
+contibutors listed above. Details on authorship of individual files
+can be found in the git version control history of the project. The
+omission of copyright and license comments in each file is in the
+interest of source tree size.
+
+In addition, permission is hereby granted for all public header files
+(include/* and arch/*/bits/*) and crt files intended to be linked into
+applications (crt/*, ldso/dlstart.c, and arch/*/crt_arch.h) to omit
+the copyright notice and permission notice otherwise required by the
+license, and to use these files without any requirement of
+attribution. These files include substantial contributions from:
+
+Bobby Bingham
+John Spencer
+Nicholas J. Kain
+Rich Felker
+Richard Pennington
+Stefan Kristiansson
+Szabolcs Nagy
+
+all of whom have explicitly granted such permission.
+
+This file previously contained text expressing a belief that most of
+the files covered by the above exception were sufficiently trivial not
+to be subject to copyright, resulting in confusion over whether it
+negated the permissions granted in the license. In the spirit of
+permissive licensing, and of not having licensing issues being an
+obstacle to adoption, that text has been removed.
diff --git a/src/third_party/musl/README b/src/third_party/musl/README
new file mode 100644
index 00000000..a30eb112
--- /dev/null
+++ b/src/third_party/musl/README
@@ -0,0 +1,23 @@
+
+ musl libc
+
+musl, pronounced like the word "mussel", is an MIT-licensed
+implementation of the standard C library targetting the Linux syscall
+API, suitable for use in a wide range of deployment environments. musl
+offers efficient static and dynamic linking support, lightweight code
+and low runtime overhead, strong fail-safe guarantees under correct
+usage, and correctness in the sense of standards conformance and
+safety. musl is built on the principle that these goals are best
+achieved through simple code that is easy to understand and maintain.
+
+The 1.1 release series for musl features coverage for all interfaces
+defined in ISO C99 and POSIX 2008 base, along with a number of
+non-standardized interfaces for compatibility with Linux, BSD, and
+glibc functionality.
+
+For basic installation instructions, see the included INSTALL file.
+Information on full musl-targeted compiler toolchains, system
+bootstrapping, and Linux distributions built on musl can be found on
+the project website:
+
+ http://www.musl-libc.org/
diff --git a/src/third_party/musl/README.breakpad b/src/third_party/musl/README.breakpad
new file mode 100644
index 00000000..f500c435
--- /dev/null
+++ b/src/third_party/musl/README.breakpad
@@ -0,0 +1,3 @@
+This directory contains the elf header from
+https://git.musl-libc.org/cgit/musl/tree/
+that is required to get ELF working in dump_syms on Mac OS X.
diff --git a/src/third_party/musl/VERSION b/src/third_party/musl/VERSION
new file mode 100644
index 00000000..e9bc1499
--- /dev/null
+++ b/src/third_party/musl/VERSION
@@ -0,0 +1 @@
+1.1.14
diff --git a/src/third_party/musl/include/elf.h b/src/third_party/musl/include/elf.h
new file mode 100644
index 00000000..8b3cd3ed
--- /dev/null
+++ b/src/third_party/musl/include/elf.h
@@ -0,0 +1,2827 @@
+#ifndef _ELF_H
+#define _ELF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdint.h>
+
+typedef uint16_t Elf32_Half;
+typedef uint16_t Elf64_Half;
+
+typedef uint32_t Elf32_Word;
+typedef int32_t Elf32_Sword;
+typedef uint32_t Elf64_Word;
+typedef int32_t Elf64_Sword;
+
+typedef uint64_t Elf32_Xword;
+typedef int64_t Elf32_Sxword;
+typedef uint64_t Elf64_Xword;
+typedef int64_t Elf64_Sxword;
+
+typedef uint32_t Elf32_Addr;
+typedef uint64_t Elf64_Addr;
+
+typedef uint32_t Elf32_Off;
+typedef uint64_t Elf64_Off;
+
+typedef uint16_t Elf32_Section;
+typedef uint16_t Elf64_Section;
+
+typedef Elf32_Half Elf32_Versym;
+typedef Elf64_Half Elf64_Versym;
+
+#define EI_NIDENT (16)
+
+typedef struct {
+ unsigned char e_ident[EI_NIDENT];
+ Elf32_Half e_type;
+ Elf32_Half e_machine;
+ Elf32_Word e_version;
+ Elf32_Addr e_entry;
+ Elf32_Off e_phoff;
+ Elf32_Off e_shoff;
+ Elf32_Word e_flags;
+ Elf32_Half e_ehsize;
+ Elf32_Half e_phentsize;
+ Elf32_Half e_phnum;
+ Elf32_Half e_shentsize;
+ Elf32_Half e_shnum;
+ Elf32_Half e_shstrndx;
+} Elf32_Ehdr;
+
+typedef struct {
+ unsigned char e_ident[EI_NIDENT];
+ Elf64_Half e_type;
+ Elf64_Half e_machine;
+ Elf64_Word e_version;
+ Elf64_Addr e_entry;
+ Elf64_Off e_phoff;
+ Elf64_Off e_shoff;
+ Elf64_Word e_flags;
+ Elf64_Half e_ehsize;
+ Elf64_Half e_phentsize;
+ Elf64_Half e_phnum;
+ Elf64_Half e_shentsize;
+ Elf64_Half e_shnum;
+ Elf64_Half e_shstrndx;
+} Elf64_Ehdr;
+
+#define EI_MAG0 0
+#define ELFMAG0 0x7f
+
+#define EI_MAG1 1
+#define ELFMAG1 'E'
+
+#define EI_MAG2 2
+#define ELFMAG2 'L'
+
+#define EI_MAG3 3
+#define ELFMAG3 'F'
+
+
+#define ELFMAG "\177ELF"
+#define SELFMAG 4
+
+#define EI_CLASS 4
+#define ELFCLASSNONE 0
+#define ELFCLASS32 1
+#define ELFCLASS64 2
+#define ELFCLASSNUM 3
+
+#define EI_DATA 5
+#define ELFDATANONE 0
+#define ELFDATA2LSB 1
+#define ELFDATA2MSB 2
+#define ELFDATANUM 3
+
+#define EI_VERSION 6
+
+
+#define EI_OSABI 7
+#define ELFOSABI_NONE 0
+#define ELFOSABI_SYSV 0
+#define ELFOSABI_HPUX 1
+#define ELFOSABI_NETBSD 2
+#define ELFOSABI_LINUX 3
+#define ELFOSABI_GNU 3
+#define ELFOSABI_SOLARIS 6
+#define ELFOSABI_AIX 7
+#define ELFOSABI_IRIX 8
+#define ELFOSABI_FREEBSD 9
+#define ELFOSABI_TRU64 10
+#define ELFOSABI_MODESTO 11
+#define ELFOSABI_OPENBSD 12
+#define ELFOSABI_ARM 97
+#define ELFOSABI_STANDALONE 255
+
+#define EI_ABIVERSION 8
+
+#define EI_PAD 9
+
+
+
+#define ET_NONE 0
+#define ET_REL 1
+#define ET_EXEC 2
+#define ET_DYN 3
+#define ET_CORE 4
+#define ET_NUM 5
+#define ET_LOOS 0xfe00
+#define ET_HIOS 0xfeff
+#define ET_LOPROC 0xff00
+#define ET_HIPROC 0xffff
+
+
+
+#define EM_NONE 0
+#define EM_M32 1
+#define EM_SPARC 2
+#define EM_386 3
+#define EM_68K 4
+#define EM_88K 5
+#define EM_860 7
+#define EM_MIPS 8
+#define EM_S370 9
+#define EM_MIPS_RS3_LE 10
+
+#define EM_PARISC 15
+#define EM_VPP500 17
+#define EM_SPARC32PLUS 18
+#define EM_960 19
+#define EM_PPC 20
+#define EM_PPC64 21
+#define EM_S390 22
+
+#define EM_V800 36
+#define EM_FR20 37
+#define EM_RH32 38
+#define EM_RCE 39
+#define EM_ARM 40
+#define EM_FAKE_ALPHA 41
+#define EM_SH 42
+#define EM_SPARCV9 43
+#define EM_TRICORE 44
+#define EM_ARC 45
+#define EM_H8_300 46
+#define EM_H8_300H 47
+#define EM_H8S 48
+#define EM_H8_500 49
+#define EM_IA_64 50
+#define EM_MIPS_X 51
+#define EM_COLDFIRE 52
+#define EM_68HC12 53
+#define EM_MMA 54
+#define EM_PCP 55
+#define EM_NCPU 56
+#define EM_NDR1 57
+#define EM_STARCORE 58
+#define EM_ME16 59
+#define EM_ST100 60
+#define EM_TINYJ 61
+#define EM_X86_64 62
+#define EM_PDSP 63
+
+#define EM_FX66 66
+#define EM_ST9PLUS 67
+#define EM_ST7 68
+#define EM_68HC16 69
+#define EM_68HC11 70
+#define EM_68HC08 71
+#define EM_68HC05 72
+#define EM_SVX 73
+#define EM_ST19 74
+#define EM_VAX 75
+#define EM_CRIS 76
+#define EM_JAVELIN 77
+#define EM_FIREPATH 78
+#define EM_ZSP 79
+#define EM_MMIX 80
+#define EM_HUANY 81
+#define EM_PRISM 82
+#define EM_AVR 83
+#define EM_FR30 84
+#define EM_D10V 85
+#define EM_D30V 86
+#define EM_V850 87
+#define EM_M32R 88
+#define EM_MN10300 89
+#define EM_MN10200 90
+#define EM_PJ 91
+#define EM_OR1K 92
+#define EM_ARC_A5 93
+#define EM_XTENSA 94
+#define EM_AARCH64 183
+#define EM_TILEPRO 188
+#define EM_MICROBLAZE 189
+#define EM_TILEGX 191
+#define EM_NUM 192
+#define EM_ALPHA 0x9026
+
+#define EV_NONE 0
+#define EV_CURRENT 1
+#define EV_NUM 2
+
+typedef struct {
+ Elf32_Word sh_name;
+ Elf32_Word sh_type;
+ Elf32_Word sh_flags;
+ Elf32_Addr sh_addr;
+ Elf32_Off sh_offset;
+ Elf32_Word sh_size;
+ Elf32_Word sh_link;
+ Elf32_Word sh_info;
+ Elf32_Word sh_addralign;
+ Elf32_Word sh_entsize;
+} Elf32_Shdr;
+
+typedef struct {
+ Elf64_Word sh_name;
+ Elf64_Word sh_type;
+ Elf64_Xword sh_flags;
+ Elf64_Addr sh_addr;
+ Elf64_Off sh_offset;
+ Elf64_Xword sh_size;
+ Elf64_Word sh_link;
+ Elf64_Word sh_info;
+ Elf64_Xword sh_addralign;
+ Elf64_Xword sh_entsize;
+} Elf64_Shdr;
+
+
+
+#define SHN_UNDEF 0
+#define SHN_LORESERVE 0xff00
+#define SHN_LOPROC 0xff00
+#define SHN_BEFORE 0xff00
+
+#define SHN_AFTER 0xff01
+
+#define SHN_HIPROC 0xff1f
+#define SHN_LOOS 0xff20
+#define SHN_HIOS 0xff3f
+#define SHN_ABS 0xfff1
+#define SHN_COMMON 0xfff2
+#define SHN_XINDEX 0xffff
+#define SHN_HIRESERVE 0xffff
+
+
+
+#define SHT_NULL 0
+#define SHT_PROGBITS 1
+#define SHT_SYMTAB 2
+#define SHT_STRTAB 3
+#define SHT_RELA 4
+#define SHT_HASH 5
+#define SHT_DYNAMIC 6
+#define SHT_NOTE 7
+#define SHT_NOBITS 8
+#define SHT_REL 9
+#define SHT_SHLIB 10
+#define SHT_DYNSYM 11
+#define SHT_INIT_ARRAY 14
+#define SHT_FINI_ARRAY 15
+#define SHT_PREINIT_ARRAY 16
+#define SHT_GROUP 17
+#define SHT_SYMTAB_SHNDX 18
+#define SHT_NUM 19
+#define SHT_LOOS 0x60000000
+#define SHT_GNU_ATTRIBUTES 0x6ffffff5
+#define SHT_GNU_HASH 0x6ffffff6
+#define SHT_GNU_LIBLIST 0x6ffffff7
+#define SHT_CHECKSUM 0x6ffffff8
+#define SHT_LOSUNW 0x6ffffffa
+#define SHT_SUNW_move 0x6ffffffa
+#define SHT_SUNW_COMDAT 0x6ffffffb
+#define SHT_SUNW_syminfo 0x6ffffffc
+#define SHT_GNU_verdef 0x6ffffffd
+#define SHT_GNU_verneed 0x6ffffffe
+#define SHT_GNU_versym 0x6fffffff
+#define SHT_HISUNW 0x6fffffff
+#define SHT_HIOS 0x6fffffff
+#define SHT_LOPROC 0x70000000
+#define SHT_HIPROC 0x7fffffff
+#define SHT_LOUSER 0x80000000
+#define SHT_HIUSER 0x8fffffff
+
+#define SHF_WRITE (1 << 0)
+#define SHF_ALLOC (1 << 1)
+#define SHF_EXECINSTR (1 << 2)
+#define SHF_MERGE (1 << 4)
+#define SHF_STRINGS (1 << 5)
+#define SHF_INFO_LINK (1 << 6)
+#define SHF_LINK_ORDER (1 << 7)
+#define SHF_OS_NONCONFORMING (1 << 8)
+
+#define SHF_GROUP (1 << 9)
+#define SHF_TLS (1 << 10)
+#define SHF_MASKOS 0x0ff00000
+#define SHF_MASKPROC 0xf0000000
+#define SHF_ORDERED (1 << 30)
+#define SHF_EXCLUDE (1U << 31)
+
+#define GRP_COMDAT 0x1
+
+typedef struct {
+ Elf32_Word st_name;
+ Elf32_Addr st_value;
+ Elf32_Word st_size;
+ unsigned char st_info;
+ unsigned char st_other;
+ Elf32_Section st_shndx;
+} Elf32_Sym;
+
+typedef struct {
+ Elf64_Word st_name;
+ unsigned char st_info;
+ unsigned char st_other;
+ Elf64_Section st_shndx;
+ Elf64_Addr st_value;
+ Elf64_Xword st_size;
+} Elf64_Sym;
+
+typedef struct {
+ Elf32_Half si_boundto;
+ Elf32_Half si_flags;
+} Elf32_Syminfo;
+
+typedef struct {
+ Elf64_Half si_boundto;
+ Elf64_Half si_flags;
+} Elf64_Syminfo;
+
+#define SYMINFO_BT_SELF 0xffff
+#define SYMINFO_BT_PARENT 0xfffe
+#define SYMINFO_BT_LOWRESERVE 0xff00
+
+#define SYMINFO_FLG_DIRECT 0x0001
+#define SYMINFO_FLG_PASSTHRU 0x0002
+#define SYMINFO_FLG_COPY 0x0004
+#define SYMINFO_FLG_LAZYLOAD 0x0008
+
+#define SYMINFO_NONE 0
+#define SYMINFO_CURRENT 1
+#define SYMINFO_NUM 2
+
+#define ELF32_ST_BIND(val) (((unsigned char) (val)) >> 4)
+#define ELF32_ST_TYPE(val) ((val) & 0xf)
+#define ELF32_ST_INFO(bind, type) (((bind) << 4) + ((type) & 0xf))
+
+#define ELF64_ST_BIND(val) ELF32_ST_BIND (val)
+#define ELF64_ST_TYPE(val) ELF32_ST_TYPE (val)
+#define ELF64_ST_INFO(bind, type) ELF32_ST_INFO ((bind), (type))
+
+#define STB_LOCAL 0
+#define STB_GLOBAL 1
+#define STB_WEAK 2
+#define STB_NUM 3
+#define STB_LOOS 10
+#define STB_GNU_UNIQUE 10
+#define STB_HIOS 12
+#define STB_LOPROC 13
+#define STB_HIPROC 15
+
+#define STT_NOTYPE 0
+#define STT_OBJECT 1
+#define STT_FUNC 2
+#define STT_SECTION 3
+#define STT_FILE 4
+#define STT_COMMON 5
+#define STT_TLS 6
+#define STT_NUM 7
+#define STT_LOOS 10
+#define STT_GNU_IFUNC 10
+#define STT_HIOS 12
+#define STT_LOPROC 13
+#define STT_HIPROC 15
+
+#define STN_UNDEF 0
+
+#define ELF32_ST_VISIBILITY(o) ((o) & 0x03)
+#define ELF64_ST_VISIBILITY(o) ELF32_ST_VISIBILITY (o)
+
+#define STV_DEFAULT 0
+#define STV_INTERNAL 1
+#define STV_HIDDEN 2
+#define STV_PROTECTED 3
+
+
+
+
+typedef struct
+{
+ Elf32_Addr r_offset;
+ Elf32_Word r_info;
+} Elf32_Rel;
+
+typedef struct {
+ Elf64_Addr r_offset;
+ Elf64_Xword r_info;
+} Elf64_Rel;
+
+
+
+typedef struct {
+ Elf32_Addr r_offset;
+ Elf32_Word r_info;
+ Elf32_Sword r_addend;
+} Elf32_Rela;
+
+typedef struct {
+ Elf64_Addr r_offset;
+ Elf64_Xword r_info;
+ Elf64_Sxword r_addend;
+} Elf64_Rela;
+
+
+
+#define ELF32_R_SYM(val) ((val) >> 8)
+#define ELF32_R_TYPE(val) ((val) & 0xff)
+#define ELF32_R_INFO(sym, type) (((sym) << 8) + ((type) & 0xff))
+
+#define ELF64_R_SYM(i) ((i) >> 32)
+#define ELF64_R_TYPE(i) ((i) & 0xffffffff)
+#define ELF64_R_INFO(sym,type) ((((Elf64_Xword) (sym)) << 32) + (type))
+
+
+
+typedef struct {
+ Elf32_Word p_type;
+ Elf32_Off p_offset;
+ Elf32_Addr p_vaddr;
+ Elf32_Addr p_paddr;
+ Elf32_Word p_filesz;
+ Elf32_Word p_memsz;
+ Elf32_Word p_flags;
+ Elf32_Word p_align;
+} Elf32_Phdr;
+
+typedef struct {
+ Elf64_Word p_type;
+ Elf64_Word p_flags;
+ Elf64_Off p_offset;
+ Elf64_Addr p_vaddr;
+ Elf64_Addr p_paddr;
+ Elf64_Xword p_filesz;
+ Elf64_Xword p_memsz;
+ Elf64_Xword p_align;
+} Elf64_Phdr;
+
+
+
+#define PT_NULL 0
+#define PT_LOAD 1
+#define PT_DYNAMIC 2
+#define PT_INTERP 3
+#define PT_NOTE 4
+#define PT_SHLIB 5
+#define PT_PHDR 6
+#define PT_TLS 7
+#define PT_NUM 8
+#define PT_LOOS 0x60000000
+#define PT_GNU_EH_FRAME 0x6474e550
+#define PT_GNU_STACK 0x6474e551
+#define PT_GNU_RELRO 0x6474e552
+#define PT_LOSUNW 0x6ffffffa
+#define PT_SUNWBSS 0x6ffffffa
+#define PT_SUNWSTACK 0x6ffffffb
+#define PT_HISUNW 0x6fffffff
+#define PT_HIOS 0x6fffffff
+#define PT_LOPROC 0x70000000
+#define PT_HIPROC 0x7fffffff
+
+
+#define PN_XNUM 0xffff
+
+
+#define PF_X (1 << 0)
+#define PF_W (1 << 1)
+#define PF_R (1 << 2)
+#define PF_MASKOS 0x0ff00000
+#define PF_MASKPROC 0xf0000000
+
+
+
+#define NT_PRSTATUS 1
+#define NT_FPREGSET 2
+#define NT_PRPSINFO 3
+#define NT_PRXREG 4
+#define NT_TASKSTRUCT 4
+#define NT_PLATFORM 5
+#define NT_AUXV 6
+#define NT_GWINDOWS 7
+#define NT_ASRS 8
+#define NT_PSTATUS 10
+#define NT_PSINFO 13
+#define NT_PRCRED 14
+#define NT_UTSNAME 15
+#define NT_LWPSTATUS 16
+#define NT_LWPSINFO 17
+#define NT_PRFPXREG 20
+#define NT_SIGINFO 0x53494749
+#define NT_FILE 0x46494c45
+#define NT_PRXFPREG 0x46e62b7f
+#define NT_PPC_VMX 0x100
+#define NT_PPC_SPE 0x101
+#define NT_PPC_VSX 0x102
+#define NT_386_TLS 0x200
+#define NT_386_IOPERM 0x201
+#define NT_X86_XSTATE 0x202
+#define NT_S390_HIGH_GPRS 0x300
+#define NT_S390_TIMER 0x301
+#define NT_S390_TODCMP 0x302
+#define NT_S390_TODPREG 0x303
+#define NT_S390_CTRS 0x304
+#define NT_S390_PREFIX 0x305
+#define NT_S390_LAST_BREAK 0x306
+#define NT_S390_SYSTEM_CALL 0x307
+#define NT_S390_TDB 0x308
+#define NT_ARM_VFP 0x400
+#define NT_ARM_TLS 0x401
+#define NT_ARM_HW_BREAK 0x402
+#define NT_ARM_HW_WATCH 0x403
+#define NT_METAG_CBUF 0x500
+#define NT_METAG_RPIPE 0x501
+#define NT_METAG_TLS 0x502
+#define NT_VERSION 1
+
+
+
+
+typedef struct {
+ Elf32_Sword d_tag;
+ union {
+ Elf32_Word d_val;
+ Elf32_Addr d_ptr;
+ } d_un;
+} Elf32_Dyn;
+
+typedef struct {
+ Elf64_Sxword d_tag;
+ union {
+ Elf64_Xword d_val;
+ Elf64_Addr d_ptr;
+ } d_un;
+} Elf64_Dyn;
+
+
+
+#define DT_NULL 0
+#define DT_NEEDED 1
+#define DT_PLTRELSZ 2
+#define DT_PLTGOT 3
+#define DT_HASH 4
+#define DT_STRTAB 5
+#define DT_SYMTAB 6
+#define DT_RELA 7
+#define DT_RELASZ 8
+#define DT_RELAENT 9
+#define DT_STRSZ 10
+#define DT_SYMENT 11
+#define DT_INIT 12
+#define DT_FINI 13
+#define DT_SONAME 14
+#define DT_RPATH 15
+#define DT_SYMBOLIC 16
+#define DT_REL 17
+#define DT_RELSZ 18
+#define DT_RELENT 19
+#define DT_PLTREL 20
+#define DT_DEBUG 21
+#define DT_TEXTREL 22
+#define DT_JMPREL 23
+#define DT_BIND_NOW 24
+#define DT_INIT_ARRAY 25
+#define DT_FINI_ARRAY 26
+#define DT_INIT_ARRAYSZ 27
+#define DT_FINI_ARRAYSZ 28
+#define DT_RUNPATH 29
+#define DT_FLAGS 30
+#define DT_ENCODING 32
+#define DT_PREINIT_ARRAY 32
+#define DT_PREINIT_ARRAYSZ 33
+#define DT_NUM 34
+#define DT_LOOS 0x6000000d
+#define DT_HIOS 0x6ffff000
+#define DT_LOPROC 0x70000000
+#define DT_HIPROC 0x7fffffff
+#define DT_PROCNUM DT_MIPS_NUM
+
+#define DT_VALRNGLO 0x6ffffd00
+#define DT_GNU_PRELINKED 0x6ffffdf5
+#define DT_GNU_CONFLICTSZ 0x6ffffdf6
+#define DT_GNU_LIBLISTSZ 0x6ffffdf7
+#define DT_CHECKSUM 0x6ffffdf8
+#define DT_PLTPADSZ 0x6ffffdf9
+#define DT_MOVEENT 0x6ffffdfa
+#define DT_MOVESZ 0x6ffffdfb
+#define DT_FEATURE_1 0x6ffffdfc
+#define DT_POSFLAG_1 0x6ffffdfd
+
+#define DT_SYMINSZ 0x6ffffdfe
+#define DT_SYMINENT 0x6ffffdff
+#define DT_VALRNGHI 0x6ffffdff
+#define DT_VALTAGIDX(tag) (DT_VALRNGHI - (tag))
+#define DT_VALNUM 12
+
+#define DT_ADDRRNGLO 0x6ffffe00
+#define DT_GNU_HASH 0x6ffffef5
+#define DT_TLSDESC_PLT 0x6ffffef6
+#define DT_TLSDESC_GOT 0x6ffffef7
+#define DT_GNU_CONFLICT 0x6ffffef8
+#define DT_GNU_LIBLIST 0x6ffffef9
+#define DT_CONFIG 0x6ffffefa
+#define DT_DEPAUDIT 0x6ffffefb
+#define DT_AUDIT 0x6ffffefc
+#define DT_PLTPAD 0x6ffffefd
+#define DT_MOVETAB 0x6ffffefe
+#define DT_SYMINFO 0x6ffffeff
+#define DT_ADDRRNGHI 0x6ffffeff
+#define DT_ADDRTAGIDX(tag) (DT_ADDRRNGHI - (tag))
+#define DT_ADDRNUM 11
+
+
+
+#define DT_VERSYM 0x6ffffff0
+
+#define DT_RELACOUNT 0x6ffffff9
+#define DT_RELCOUNT 0x6ffffffa
+
+
+#define DT_FLAGS_1 0x6ffffffb
+#define DT_VERDEF 0x6ffffffc
+
+#define DT_VERDEFNUM 0x6ffffffd
+#define DT_VERNEED 0x6ffffffe
+
+#define DT_VERNEEDNUM 0x6fffffff
+#define DT_VERSIONTAGIDX(tag) (DT_VERNEEDNUM - (tag))
+#define DT_VERSIONTAGNUM 16
+
+
+
+#define DT_AUXILIARY 0x7ffffffd
+#define DT_FILTER 0x7fffffff
+#define DT_EXTRATAGIDX(tag) ((Elf32_Word)-((Elf32_Sword) (tag) <<1>>1)-1)
+#define DT_EXTRANUM 3
+
+
+#define DF_ORIGIN 0x00000001
+#define DF_SYMBOLIC 0x00000002
+#define DF_TEXTREL 0x00000004
+#define DF_BIND_NOW 0x00000008
+#define DF_STATIC_TLS 0x00000010
+
+
+
+#define DF_1_NOW 0x00000001
+#define DF_1_GLOBAL 0x00000002
+#define DF_1_GROUP 0x00000004
+#define DF_1_NODELETE 0x00000008
+#define DF_1_LOADFLTR 0x00000010
+#define DF_1_INITFIRST 0x00000020
+#define DF_1_NOOPEN 0x00000040
+#define DF_1_ORIGIN 0x00000080
+#define DF_1_DIRECT 0x00000100
+#define DF_1_TRANS 0x00000200
+#define DF_1_INTERPOSE 0x00000400
+#define DF_1_NODEFLIB 0x00000800
+#define DF_1_NODUMP 0x00001000
+#define DF_1_CONFALT 0x00002000
+#define DF_1_ENDFILTEE 0x00004000
+#define DF_1_DISPRELDNE 0x00008000
+#define DF_1_DISPRELPND 0x00010000
+#define DF_1_NODIRECT 0x00020000
+#define DF_1_IGNMULDEF 0x00040000
+#define DF_1_NOKSYMS 0x00080000
+#define DF_1_NOHDR 0x00100000
+#define DF_1_EDITED 0x00200000
+#define DF_1_NORELOC 0x00400000
+#define DF_1_SYMINTPOSE 0x00800000
+#define DF_1_GLOBAUDIT 0x01000000
+#define DF_1_SINGLETON 0x02000000
+
+#define DTF_1_PARINIT 0x00000001
+#define DTF_1_CONFEXP 0x00000002
+
+
+#define DF_P1_LAZYLOAD 0x00000001
+#define DF_P1_GROUPPERM 0x00000002
+
+
+
+
+typedef struct {
+ Elf32_Half vd_version;
+ Elf32_Half vd_flags;
+ Elf32_Half vd_ndx;
+ Elf32_Half vd_cnt;
+ Elf32_Word vd_hash;
+ Elf32_Word vd_aux;
+ Elf32_Word vd_next;
+} Elf32_Verdef;
+
+typedef struct {
+ Elf64_Half vd_version;
+ Elf64_Half vd_flags;
+ Elf64_Half vd_ndx;
+ Elf64_Half vd_cnt;
+ Elf64_Word vd_hash;
+ Elf64_Word vd_aux;
+ Elf64_Word vd_next;
+} Elf64_Verdef;
+
+
+
+#define VER_DEF_NONE 0
+#define VER_DEF_CURRENT 1
+#define VER_DEF_NUM 2
+
+
+#define VER_FLG_BASE 0x1
+#define VER_FLG_WEAK 0x2
+
+
+#define VER_NDX_LOCAL 0
+#define VER_NDX_GLOBAL 1
+#define VER_NDX_LORESERVE 0xff00
+#define VER_NDX_ELIMINATE 0xff01
+
+
+
+typedef struct {
+ Elf32_Word vda_name;
+ Elf32_Word vda_next;
+} Elf32_Verdaux;
+
+typedef struct {
+ Elf64_Word vda_name;
+ Elf64_Word vda_next;
+} Elf64_Verdaux;
+
+
+
+
+typedef struct {
+ Elf32_Half vn_version;
+ Elf32_Half vn_cnt;
+ Elf32_Word vn_file;
+ Elf32_Word vn_aux;
+ Elf32_Word vn_next;
+} Elf32_Verneed;
+
+typedef struct {
+ Elf64_Half vn_version;
+ Elf64_Half vn_cnt;
+ Elf64_Word vn_file;
+ Elf64_Word vn_aux;
+ Elf64_Word vn_next;
+} Elf64_Verneed;
+
+
+
+#define VER_NEED_NONE 0
+#define VER_NEED_CURRENT 1
+#define VER_NEED_NUM 2
+
+
+
+typedef struct {
+ Elf32_Word vna_hash;
+ Elf32_Half vna_flags;
+ Elf32_Half vna_other;
+ Elf32_Word vna_name;
+ Elf32_Word vna_next;
+} Elf32_Vernaux;
+
+typedef struct {
+ Elf64_Word vna_hash;
+ Elf64_Half vna_flags;
+ Elf64_Half vna_other;
+ Elf64_Word vna_name;
+ Elf64_Word vna_next;
+} Elf64_Vernaux;
+
+
+
+#define VER_FLG_WEAK 0x2
+
+
+
+typedef struct {
+ uint32_t a_type;
+ union {
+ uint32_t a_val;
+ } a_un;
+} Elf32_auxv_t;
+
+typedef struct {
+ uint64_t a_type;
+ union {
+ uint64_t a_val;
+ } a_un;
+} Elf64_auxv_t;
+
+
+
+#define AT_NULL 0
+#define AT_IGNORE 1
+#define AT_EXECFD 2
+#define AT_PHDR 3
+#define AT_PHENT 4
+#define AT_PHNUM 5
+#define AT_PAGESZ 6
+#define AT_BASE 7
+#define AT_FLAGS 8
+#define AT_ENTRY 9
+#define AT_NOTELF 10
+#define AT_UID 11
+#define AT_EUID 12
+#define AT_GID 13
+#define AT_EGID 14
+#define AT_CLKTCK 17
+
+
+#define AT_PLATFORM 15
+#define AT_HWCAP 16
+
+
+
+
+#define AT_FPUCW 18
+
+
+#define AT_DCACHEBSIZE 19
+#define AT_ICACHEBSIZE 20
+#define AT_UCACHEBSIZE 21
+
+
+
+#define AT_IGNOREPPC 22
+
+#define AT_SECURE 23
+
+#define AT_BASE_PLATFORM 24
+
+#define AT_RANDOM 25
+
+#define AT_HWCAP2 26
+
+#define AT_EXECFN 31
+
+
+
+#define AT_SYSINFO 32
+#define AT_SYSINFO_EHDR 33
+
+
+
+#define AT_L1I_CACHESHAPE 34
+#define AT_L1D_CACHESHAPE 35
+#define AT_L2_CACHESHAPE 36
+#define AT_L3_CACHESHAPE 37
+
+
+
+
+typedef struct {
+ Elf32_Word n_namesz;
+ Elf32_Word n_descsz;
+ Elf32_Word n_type;
+} Elf32_Nhdr;
+
+typedef struct {
+ Elf64_Word n_namesz;
+ Elf64_Word n_descsz;
+ Elf64_Word n_type;
+} Elf64_Nhdr;
+
+
+
+
+#define ELF_NOTE_SOLARIS "SUNW Solaris"
+
+
+#define ELF_NOTE_GNU "GNU"
+
+
+
+
+
+#define ELF_NOTE_PAGESIZE_HINT 1
+
+
+#define NT_GNU_ABI_TAG 1
+#define ELF_NOTE_ABI NT_GNU_ABI_TAG
+
+
+
+#define ELF_NOTE_OS_LINUX 0
+#define ELF_NOTE_OS_GNU 1
+#define ELF_NOTE_OS_SOLARIS2 2
+#define ELF_NOTE_OS_FREEBSD 3
+
+#define NT_GNU_BUILD_ID 3
+#define NT_GNU_GOLD_VERSION 4
+
+
+
+typedef struct {
+ Elf32_Xword m_value;
+ Elf32_Word m_info;
+ Elf32_Word m_poffset;
+ Elf32_Half m_repeat;
+ Elf32_Half m_stride;
+} Elf32_Move;
+
+typedef struct {
+ Elf64_Xword m_value;
+ Elf64_Xword m_info;
+ Elf64_Xword m_poffset;
+ Elf64_Half m_repeat;
+ Elf64_Half m_stride;
+} Elf64_Move;
+
+
+#define ELF32_M_SYM(info) ((info) >> 8)
+#define ELF32_M_SIZE(info) ((unsigned char) (info))
+#define ELF32_M_INFO(sym, size) (((sym) << 8) + (unsigned char) (size))
+
+#define ELF64_M_SYM(info) ELF32_M_SYM (info)
+#define ELF64_M_SIZE(info) ELF32_M_SIZE (info)
+#define ELF64_M_INFO(sym, size) ELF32_M_INFO (sym, size)
+
+#define EF_CPU32 0x00810000
+
+#define R_68K_NONE 0
+#define R_68K_32 1
+#define R_68K_16 2
+#define R_68K_8 3
+#define R_68K_PC32 4
+#define R_68K_PC16 5
+#define R_68K_PC8 6
+#define R_68K_GOT32 7
+#define R_68K_GOT16 8
+#define R_68K_GOT8 9
+#define R_68K_GOT32O 10
+#define R_68K_GOT16O 11
+#define R_68K_GOT8O 12
+#define R_68K_PLT32 13
+#define R_68K_PLT16 14
+#define R_68K_PLT8 15
+#define R_68K_PLT32O 16
+#define R_68K_PLT16O 17
+#define R_68K_PLT8O 18
+#define R_68K_COPY 19
+#define R_68K_GLOB_DAT 20
+#define R_68K_JMP_SLOT 21
+#define R_68K_RELATIVE 22
+#define R_68K_NUM 23
+
+#define R_386_NONE 0
+#define R_386_32 1
+#define R_386_PC32 2
+#define R_386_GOT32 3
+#define R_386_PLT32 4
+#define R_386_COPY 5
+#define R_386_GLOB_DAT 6
+#define R_386_JMP_SLOT 7
+#define R_386_RELATIVE 8
+#define R_386_GOTOFF 9
+#define R_386_GOTPC 10
+#define R_386_32PLT 11
+#define R_386_TLS_TPOFF 14
+#define R_386_TLS_IE 15
+#define R_386_TLS_GOTIE 16
+#define R_386_TLS_LE 17
+#define R_386_TLS_GD 18
+#define R_386_TLS_LDM 19
+#define R_386_16 20
+#define R_386_PC16 21
+#define R_386_8 22
+#define R_386_PC8 23
+#define R_386_TLS_GD_32 24
+#define R_386_TLS_GD_PUSH 25
+#define R_386_TLS_GD_CALL 26
+#define R_386_TLS_GD_POP 27
+#define R_386_TLS_LDM_32 28
+#define R_386_TLS_LDM_PUSH 29
+#define R_386_TLS_LDM_CALL 30
+#define R_386_TLS_LDM_POP 31
+#define R_386_TLS_LDO_32 32
+#define R_386_TLS_IE_32 33
+#define R_386_TLS_LE_32 34
+#define R_386_TLS_DTPMOD32 35
+#define R_386_TLS_DTPOFF32 36
+#define R_386_TLS_TPOFF32 37
+#define R_386_SIZE32 38
+#define R_386_TLS_GOTDESC 39
+#define R_386_TLS_DESC_CALL 40
+#define R_386_TLS_DESC 41
+#define R_386_IRELATIVE 42
+#define R_386_NUM 43
+
+
+
+
+
+#define STT_SPARC_REGISTER 13
+
+
+
+#define EF_SPARCV9_MM 3
+#define EF_SPARCV9_TSO 0
+#define EF_SPARCV9_PSO 1
+#define EF_SPARCV9_RMO 2
+#define EF_SPARC_LEDATA 0x800000
+#define EF_SPARC_EXT_MASK 0xFFFF00
+#define EF_SPARC_32PLUS 0x000100
+#define EF_SPARC_SUN_US1 0x000200
+#define EF_SPARC_HAL_R1 0x000400
+#define EF_SPARC_SUN_US3 0x000800
+
+
+
+#define R_SPARC_NONE 0
+#define R_SPARC_8 1
+#define R_SPARC_16 2
+#define R_SPARC_32 3
+#define R_SPARC_DISP8 4
+#define R_SPARC_DISP16 5
+#define R_SPARC_DISP32 6
+#define R_SPARC_WDISP30 7
+#define R_SPARC_WDISP22 8
+#define R_SPARC_HI22 9
+#define R_SPARC_22 10
+#define R_SPARC_13 11
+#define R_SPARC_LO10 12
+#define R_SPARC_GOT10 13
+#define R_SPARC_GOT13 14
+#define R_SPARC_GOT22 15
+#define R_SPARC_PC10 16
+#define R_SPARC_PC22 17
+#define R_SPARC_WPLT30 18
+#define R_SPARC_COPY 19
+#define R_SPARC_GLOB_DAT 20
+#define R_SPARC_JMP_SLOT 21
+#define R_SPARC_RELATIVE 22
+#define R_SPARC_UA32 23
+
+
+
+#define R_SPARC_PLT32 24
+#define R_SPARC_HIPLT22 25
+#define R_SPARC_LOPLT10 26
+#define R_SPARC_PCPLT32 27
+#define R_SPARC_PCPLT22 28
+#define R_SPARC_PCPLT10 29
+#define R_SPARC_10 30
+#define R_SPARC_11 31
+#define R_SPARC_64 32
+#define R_SPARC_OLO10 33
+#define R_SPARC_HH22 34
+#define R_SPARC_HM10 35
+#define R_SPARC_LM22 36
+#define R_SPARC_PC_HH22 37
+#define R_SPARC_PC_HM10 38
+#define R_SPARC_PC_LM22 39
+#define R_SPARC_WDISP16 40
+#define R_SPARC_WDISP19 41
+#define R_SPARC_GLOB_JMP 42
+#define R_SPARC_7 43
+#define R_SPARC_5 44
+#define R_SPARC_6 45
+#define R_SPARC_DISP64 46
+#define R_SPARC_PLT64 47
+#define R_SPARC_HIX22 48
+#define R_SPARC_LOX10 49
+#define R_SPARC_H44 50
+#define R_SPARC_M44 51
+#define R_SPARC_L44 52
+#define R_SPARC_REGISTER 53
+#define R_SPARC_UA64 54
+#define R_SPARC_UA16 55
+#define R_SPARC_TLS_GD_HI22 56
+#define R_SPARC_TLS_GD_LO10 57
+#define R_SPARC_TLS_GD_ADD 58
+#define R_SPARC_TLS_GD_CALL 59
+#define R_SPARC_TLS_LDM_HI22 60
+#define R_SPARC_TLS_LDM_LO10 61
+#define R_SPARC_TLS_LDM_ADD 62
+#define R_SPARC_TLS_LDM_CALL 63
+#define R_SPARC_TLS_LDO_HIX22 64
+#define R_SPARC_TLS_LDO_LOX10 65
+#define R_SPARC_TLS_LDO_ADD 66
+#define R_SPARC_TLS_IE_HI22 67
+#define R_SPARC_TLS_IE_LO10 68
+#define R_SPARC_TLS_IE_LD 69
+#define R_SPARC_TLS_IE_LDX 70
+#define R_SPARC_TLS_IE_ADD 71
+#define R_SPARC_TLS_LE_HIX22 72
+#define R_SPARC_TLS_LE_LOX10 73
+#define R_SPARC_TLS_DTPMOD32 74
+#define R_SPARC_TLS_DTPMOD64 75
+#define R_SPARC_TLS_DTPOFF32 76
+#define R_SPARC_TLS_DTPOFF64 77
+#define R_SPARC_TLS_TPOFF32 78
+#define R_SPARC_TLS_TPOFF64 79
+#define R_SPARC_GOTDATA_HIX22 80
+#define R_SPARC_GOTDATA_LOX10 81
+#define R_SPARC_GOTDATA_OP_HIX22 82
+#define R_SPARC_GOTDATA_OP_LOX10 83
+#define R_SPARC_GOTDATA_OP 84
+#define R_SPARC_H34 85
+#define R_SPARC_SIZE32 86
+#define R_SPARC_SIZE64 87
+#define R_SPARC_GNU_VTINHERIT 250
+#define R_SPARC_GNU_VTENTRY 251
+#define R_SPARC_REV32 252
+
+#define R_SPARC_NUM 253
+
+
+
+#define DT_SPARC_REGISTER 0x70000001
+#define DT_SPARC_NUM 2
+
+
+#define EF_MIPS_NOREORDER 1
+#define EF_MIPS_PIC 2
+#define EF_MIPS_CPIC 4
+#define EF_MIPS_XGOT 8
+#define EF_MIPS_64BIT_WHIRL 16
+#define EF_MIPS_ABI2 32
+#define EF_MIPS_ABI_ON32 64
+#define EF_MIPS_NAN2008 1024
+#define EF_MIPS_ARCH 0xf0000000
+
+
+
+#define EF_MIPS_ARCH_1 0x00000000
+#define EF_MIPS_ARCH_2 0x10000000
+#define EF_MIPS_ARCH_3 0x20000000
+#define EF_MIPS_ARCH_4 0x30000000
+#define EF_MIPS_ARCH_5 0x40000000
+#define EF_MIPS_ARCH_32 0x50000000
+#define EF_MIPS_ARCH_64 0x60000000
+#define EF_MIPS_ARCH_32R2 0x70000000
+#define EF_MIPS_ARCH_64R2 0x80000000
+
+
+#define E_MIPS_ARCH_1 0x00000000
+#define E_MIPS_ARCH_2 0x10000000
+#define E_MIPS_ARCH_3 0x20000000
+#define E_MIPS_ARCH_4 0x30000000
+#define E_MIPS_ARCH_5 0x40000000
+#define E_MIPS_ARCH_32 0x50000000
+#define E_MIPS_ARCH_64 0x60000000
+
+
+
+#define SHN_MIPS_ACOMMON 0xff00
+#define SHN_MIPS_TEXT 0xff01
+#define SHN_MIPS_DATA 0xff02
+#define SHN_MIPS_SCOMMON 0xff03
+#define SHN_MIPS_SUNDEFINED 0xff04
+
+
+
+#define SHT_MIPS_LIBLIST 0x70000000
+#define SHT_MIPS_MSYM 0x70000001
+#define SHT_MIPS_CONFLICT 0x70000002
+#define SHT_MIPS_GPTAB 0x70000003
+#define SHT_MIPS_UCODE 0x70000004
+#define SHT_MIPS_DEBUG 0x70000005
+#define SHT_MIPS_REGINFO 0x70000006
+#define SHT_MIPS_PACKAGE 0x70000007
+#define SHT_MIPS_PACKSYM 0x70000008
+#define SHT_MIPS_RELD 0x70000009
+#define SHT_MIPS_IFACE 0x7000000b
+#define SHT_MIPS_CONTENT 0x7000000c
+#define SHT_MIPS_OPTIONS 0x7000000d
+#define SHT_MIPS_SHDR 0x70000010
+#define SHT_MIPS_FDESC 0x70000011
+#define SHT_MIPS_EXTSYM 0x70000012
+#define SHT_MIPS_DENSE 0x70000013
+#define SHT_MIPS_PDESC 0x70000014
+#define SHT_MIPS_LOCSYM 0x70000015
+#define SHT_MIPS_AUXSYM 0x70000016
+#define SHT_MIPS_OPTSYM 0x70000017
+#define SHT_MIPS_LOCSTR 0x70000018
+#define SHT_MIPS_LINE 0x70000019
+#define SHT_MIPS_RFDESC 0x7000001a
+#define SHT_MIPS_DELTASYM 0x7000001b
+#define SHT_MIPS_DELTAINST 0x7000001c
+#define SHT_MIPS_DELTACLASS 0x7000001d
+#define SHT_MIPS_DWARF 0x7000001e
+#define SHT_MIPS_DELTADECL 0x7000001f
+#define SHT_MIPS_SYMBOL_LIB 0x70000020
+#define SHT_MIPS_EVENTS 0x70000021
+#define SHT_MIPS_TRANSLATE 0x70000022
+#define SHT_MIPS_PIXIE 0x70000023
+#define SHT_MIPS_XLATE 0x70000024
+#define SHT_MIPS_XLATE_DEBUG 0x70000025
+#define SHT_MIPS_WHIRL 0x70000026
+#define SHT_MIPS_EH_REGION 0x70000027
+#define SHT_MIPS_XLATE_OLD 0x70000028
+#define SHT_MIPS_PDR_EXCEPTION 0x70000029
+
+
+
+#define SHF_MIPS_GPREL 0x10000000
+#define SHF_MIPS_MERGE 0x20000000
+#define SHF_MIPS_ADDR 0x40000000
+#define SHF_MIPS_STRINGS 0x80000000
+#define SHF_MIPS_NOSTRIP 0x08000000
+#define SHF_MIPS_LOCAL 0x04000000
+#define SHF_MIPS_NAMES 0x02000000
+#define SHF_MIPS_NODUPE 0x01000000
+
+
+
+
+
+#define STO_MIPS_DEFAULT 0x0
+#define STO_MIPS_INTERNAL 0x1
+#define STO_MIPS_HIDDEN 0x2
+#define STO_MIPS_PROTECTED 0x3
+#define STO_MIPS_PLT 0x8
+#define STO_MIPS_SC_ALIGN_UNUSED 0xff
+
+
+#define STB_MIPS_SPLIT_COMMON 13
+
+
+
+typedef union {
+ struct {
+ Elf32_Word gt_current_g_value;
+ Elf32_Word gt_unused;
+ } gt_header;
+ struct {
+ Elf32_Word gt_g_value;
+ Elf32_Word gt_bytes;
+ } gt_entry;
+} Elf32_gptab;
+
+
+
+typedef struct {
+ Elf32_Word ri_gprmask;
+ Elf32_Word ri_cprmask[4];
+ Elf32_Sword ri_gp_value;
+} Elf32_RegInfo;
+
+
+
+typedef struct {
+ unsigned char kind;
+
+ unsigned char size;
+ Elf32_Section section;
+
+ Elf32_Word info;
+} Elf_Options;
+
+
+
+#define ODK_NULL 0
+#define ODK_REGINFO 1
+#define ODK_EXCEPTIONS 2
+#define ODK_PAD 3
+#define ODK_HWPATCH 4
+#define ODK_FILL 5
+#define ODK_TAGS 6
+#define ODK_HWAND 7
+#define ODK_HWOR 8
+
+
+
+#define OEX_FPU_MIN 0x1f
+#define OEX_FPU_MAX 0x1f00
+#define OEX_PAGE0 0x10000
+#define OEX_SMM 0x20000
+#define OEX_FPDBUG 0x40000
+#define OEX_PRECISEFP OEX_FPDBUG
+#define OEX_DISMISS 0x80000
+
+#define OEX_FPU_INVAL 0x10
+#define OEX_FPU_DIV0 0x08
+#define OEX_FPU_OFLO 0x04
+#define OEX_FPU_UFLO 0x02
+#define OEX_FPU_INEX 0x01
+
+
+
+#define OHW_R4KEOP 0x1
+#define OHW_R8KPFETCH 0x2
+#define OHW_R5KEOP 0x4
+#define OHW_R5KCVTL 0x8
+
+#define OPAD_PREFIX 0x1
+#define OPAD_POSTFIX 0x2
+#define OPAD_SYMBOL 0x4
+
+
+
+typedef struct {
+ Elf32_Word hwp_flags1;
+ Elf32_Word hwp_flags2;
+} Elf_Options_Hw;
+
+
+
+#define OHWA0_R4KEOP_CHECKED 0x00000001
+#define OHWA1_R4KEOP_CLEAN 0x00000002
+
+
+
+#define R_MIPS_NONE 0
+#define R_MIPS_16 1
+#define R_MIPS_32 2
+#define R_MIPS_REL32 3
+#define R_MIPS_26 4
+#define R_MIPS_HI16 5
+#define R_MIPS_LO16 6
+#define R_MIPS_GPREL16 7
+#define R_MIPS_LITERAL 8
+#define R_MIPS_GOT16 9
+#define R_MIPS_PC16 10
+#define R_MIPS_CALL16 11
+#define R_MIPS_GPREL32 12
+
+#define R_MIPS_SHIFT5 16
+#define R_MIPS_SHIFT6 17
+#define R_MIPS_64 18
+#define R_MIPS_GOT_DISP 19
+#define R_MIPS_GOT_PAGE 20
+#define R_MIPS_GOT_OFST 21
+#define R_MIPS_GOT_HI16 22
+#define R_MIPS_GOT_LO16 23
+#define R_MIPS_SUB 24
+#define R_MIPS_INSERT_A 25
+#define R_MIPS_INSERT_B 26
+#define R_MIPS_DELETE 27
+#define R_MIPS_HIGHER 28
+#define R_MIPS_HIGHEST 29
+#define R_MIPS_CALL_HI16 30
+#define R_MIPS_CALL_LO16 31
+#define R_MIPS_SCN_DISP 32
+#define R_MIPS_REL16 33
+#define R_MIPS_ADD_IMMEDIATE 34
+#define R_MIPS_PJUMP 35
+#define R_MIPS_RELGOT 36
+#define R_MIPS_JALR 37
+#define R_MIPS_TLS_DTPMOD32 38
+#define R_MIPS_TLS_DTPREL32 39
+#define R_MIPS_TLS_DTPMOD64 40
+#define R_MIPS_TLS_DTPREL64 41
+#define R_MIPS_TLS_GD 42
+#define R_MIPS_TLS_LDM 43
+#define R_MIPS_TLS_DTPREL_HI16 44
+#define R_MIPS_TLS_DTPREL_LO16 45
+#define R_MIPS_TLS_GOTTPREL 46
+#define R_MIPS_TLS_TPREL32 47
+#define R_MIPS_TLS_TPREL64 48
+#define R_MIPS_TLS_TPREL_HI16 49
+#define R_MIPS_TLS_TPREL_LO16 50
+#define R_MIPS_GLOB_DAT 51
+#define R_MIPS_COPY 126
+#define R_MIPS_JUMP_SLOT 127
+
+#define R_MIPS_NUM 128
+
+
+
+#define PT_MIPS_REGINFO 0x70000000
+#define PT_MIPS_RTPROC 0x70000001
+#define PT_MIPS_OPTIONS 0x70000002
+
+
+
+#define PF_MIPS_LOCAL 0x10000000
+
+
+
+#define DT_MIPS_RLD_VERSION 0x70000001
+#define DT_MIPS_TIME_STAMP 0x70000002
+#define DT_MIPS_ICHECKSUM 0x70000003
+#define DT_MIPS_IVERSION 0x70000004
+#define DT_MIPS_FLAGS 0x70000005
+#define DT_MIPS_BASE_ADDRESS 0x70000006
+#define DT_MIPS_MSYM 0x70000007
+#define DT_MIPS_CONFLICT 0x70000008
+#define DT_MIPS_LIBLIST 0x70000009
+#define DT_MIPS_LOCAL_GOTNO 0x7000000a
+#define DT_MIPS_CONFLICTNO 0x7000000b
+#define DT_MIPS_LIBLISTNO 0x70000010
+#define DT_MIPS_SYMTABNO 0x70000011
+#define DT_MIPS_UNREFEXTNO 0x70000012
+#define DT_MIPS_GOTSYM 0x70000013
+#define DT_MIPS_HIPAGENO 0x70000014
+#define DT_MIPS_RLD_MAP 0x70000016
+#define DT_MIPS_DELTA_CLASS 0x70000017
+#define DT_MIPS_DELTA_CLASS_NO 0x70000018
+
+#define DT_MIPS_DELTA_INSTANCE 0x70000019
+#define DT_MIPS_DELTA_INSTANCE_NO 0x7000001a
+
+#define DT_MIPS_DELTA_RELOC 0x7000001b
+#define DT_MIPS_DELTA_RELOC_NO 0x7000001c
+
+#define DT_MIPS_DELTA_SYM 0x7000001d
+
+#define DT_MIPS_DELTA_SYM_NO 0x7000001e
+
+#define DT_MIPS_DELTA_CLASSSYM 0x70000020
+
+#define DT_MIPS_DELTA_CLASSSYM_NO 0x70000021
+
+#define DT_MIPS_CXX_FLAGS 0x70000022
+#define DT_MIPS_PIXIE_INIT 0x70000023
+#define DT_MIPS_SYMBOL_LIB 0x70000024
+#define DT_MIPS_LOCALPAGE_GOTIDX 0x70000025
+#define DT_MIPS_LOCAL_GOTIDX 0x70000026
+#define DT_MIPS_HIDDEN_GOTIDX 0x70000027
+#define DT_MIPS_PROTECTED_GOTIDX 0x70000028
+#define DT_MIPS_OPTIONS 0x70000029
+#define DT_MIPS_INTERFACE 0x7000002a
+#define DT_MIPS_DYNSTR_ALIGN 0x7000002b
+#define DT_MIPS_INTERFACE_SIZE 0x7000002c
+#define DT_MIPS_RLD_TEXT_RESOLVE_ADDR 0x7000002d
+
+#define DT_MIPS_PERF_SUFFIX 0x7000002e
+
+#define DT_MIPS_COMPACT_SIZE 0x7000002f
+#define DT_MIPS_GP_VALUE 0x70000030
+#define DT_MIPS_AUX_DYNAMIC 0x70000031
+
+#define DT_MIPS_PLTGOT 0x70000032
+
+#define DT_MIPS_RWPLT 0x70000034
+#define DT_MIPS_NUM 0x35
+
+
+
+#define RHF_NONE 0
+#define RHF_QUICKSTART (1 << 0)
+#define RHF_NOTPOT (1 << 1)
+#define RHF_NO_LIBRARY_REPLACEMENT (1 << 2)
+#define RHF_NO_MOVE (1 << 3)
+#define RHF_SGI_ONLY (1 << 4)
+#define RHF_GUARANTEE_INIT (1 << 5)
+#define RHF_DELTA_C_PLUS_PLUS (1 << 6)
+#define RHF_GUARANTEE_START_INIT (1 << 7)
+#define RHF_PIXIE (1 << 8)
+#define RHF_DEFAULT_DELAY_LOAD (1 << 9)
+#define RHF_REQUICKSTART (1 << 10)
+#define RHF_REQUICKSTARTED (1 << 11)
+#define RHF_CORD (1 << 12)
+#define RHF_NO_UNRES_UNDEF (1 << 13)
+#define RHF_RLD_ORDER_SAFE (1 << 14)
+
+
+
+typedef struct
+{
+ Elf32_Word l_name;
+ Elf32_Word l_time_stamp;
+ Elf32_Word l_checksum;
+ Elf32_Word l_version;
+ Elf32_Word l_flags;
+} Elf32_Lib;
+
+typedef struct
+{
+ Elf64_Word l_name;
+ Elf64_Word l_time_stamp;
+ Elf64_Word l_checksum;
+ Elf64_Word l_version;
+ Elf64_Word l_flags;
+} Elf64_Lib;
+
+
+
+
+#define LL_NONE 0
+#define LL_EXACT_MATCH (1 << 0)
+#define LL_IGNORE_INT_VER (1 << 1)
+#define LL_REQUIRE_MINOR (1 << 2)
+#define LL_EXPORTS (1 << 3)
+#define LL_DELAY_LOAD (1 << 4)
+#define LL_DELTA (1 << 5)
+
+
+
+typedef Elf32_Addr Elf32_Conflict;
+
+
+
+
+
+
+#define EF_PARISC_TRAPNIL 0x00010000
+#define EF_PARISC_EXT 0x00020000
+#define EF_PARISC_LSB 0x00040000
+#define EF_PARISC_WIDE 0x00080000
+#define EF_PARISC_NO_KABP 0x00100000
+
+#define EF_PARISC_LAZYSWAP 0x00400000
+#define EF_PARISC_ARCH 0x0000ffff
+
+
+
+#define EFA_PARISC_1_0 0x020b
+#define EFA_PARISC_1_1 0x0210
+#define EFA_PARISC_2_0 0x0214
+
+
+
+#define SHN_PARISC_ANSI_COMMON 0xff00
+
+#define SHN_PARISC_HUGE_COMMON 0xff01
+
+
+
+#define SHT_PARISC_EXT 0x70000000
+#define SHT_PARISC_UNWIND 0x70000001
+#define SHT_PARISC_DOC 0x70000002
+
+
+
+#define SHF_PARISC_SHORT 0x20000000
+#define SHF_PARISC_HUGE 0x40000000
+#define SHF_PARISC_SBP 0x80000000
+
+
+
+#define STT_PARISC_MILLICODE 13
+
+#define STT_HP_OPAQUE (STT_LOOS + 0x1)
+#define STT_HP_STUB (STT_LOOS + 0x2)
+
+
+
+#define R_PARISC_NONE 0
+#define R_PARISC_DIR32 1
+#define R_PARISC_DIR21L 2
+#define R_PARISC_DIR17R 3
+#define R_PARISC_DIR17F 4
+#define R_PARISC_DIR14R 6
+#define R_PARISC_PCREL32 9
+#define R_PARISC_PCREL21L 10
+#define R_PARISC_PCREL17R 11
+#define R_PARISC_PCREL17F 12
+#define R_PARISC_PCREL14R 14
+#define R_PARISC_DPREL21L 18
+#define R_PARISC_DPREL14R 22
+#define R_PARISC_GPREL21L 26
+#define R_PARISC_GPREL14R 30
+#define R_PARISC_LTOFF21L 34
+#define R_PARISC_LTOFF14R 38
+#define R_PARISC_SECREL32 41
+#define R_PARISC_SEGBASE 48
+#define R_PARISC_SEGREL32 49
+#define R_PARISC_PLTOFF21L 50
+#define R_PARISC_PLTOFF14R 54
+#define R_PARISC_LTOFF_FPTR32 57
+#define R_PARISC_LTOFF_FPTR21L 58
+#define R_PARISC_LTOFF_FPTR14R 62
+#define R_PARISC_FPTR64 64
+#define R_PARISC_PLABEL32 65
+#define R_PARISC_PLABEL21L 66
+#define R_PARISC_PLABEL14R 70
+#define R_PARISC_PCREL64 72
+#define R_PARISC_PCREL22F 74
+#define R_PARISC_PCREL14WR 75
+#define R_PARISC_PCREL14DR 76
+#define R_PARISC_PCREL16F 77
+#define R_PARISC_PCREL16WF 78
+#define R_PARISC_PCREL16DF 79
+#define R_PARISC_DIR64 80
+#define R_PARISC_DIR14WR 83
+#define R_PARISC_DIR14DR 84
+#define R_PARISC_DIR16F 85
+#define R_PARISC_DIR16WF 86
+#define R_PARISC_DIR16DF 87
+#define R_PARISC_GPREL64 88
+#define R_PARISC_GPREL14WR 91
+#define R_PARISC_GPREL14DR 92
+#define R_PARISC_GPREL16F 93
+#define R_PARISC_GPREL16WF 94
+#define R_PARISC_GPREL16DF 95
+#define R_PARISC_LTOFF64 96
+#define R_PARISC_LTOFF14WR 99
+#define R_PARISC_LTOFF14DR 100
+#define R_PARISC_LTOFF16F 101
+#define R_PARISC_LTOFF16WF 102
+#define R_PARISC_LTOFF16DF 103
+#define R_PARISC_SECREL64 104
+#define R_PARISC_SEGREL64 112
+#define R_PARISC_PLTOFF14WR 115
+#define R_PARISC_PLTOFF14DR 116
+#define R_PARISC_PLTOFF16F 117
+#define R_PARISC_PLTOFF16WF 118
+#define R_PARISC_PLTOFF16DF 119
+#define R_PARISC_LTOFF_FPTR64 120
+#define R_PARISC_LTOFF_FPTR14WR 123
+#define R_PARISC_LTOFF_FPTR14DR 124
+#define R_PARISC_LTOFF_FPTR16F 125
+#define R_PARISC_LTOFF_FPTR16WF 126
+#define R_PARISC_LTOFF_FPTR16DF 127
+#define R_PARISC_LORESERVE 128
+#define R_PARISC_COPY 128
+#define R_PARISC_IPLT 129
+#define R_PARISC_EPLT 130
+#define R_PARISC_TPREL32 153
+#define R_PARISC_TPREL21L 154
+#define R_PARISC_TPREL14R 158
+#define R_PARISC_LTOFF_TP21L 162
+#define R_PARISC_LTOFF_TP14R 166
+#define R_PARISC_LTOFF_TP14F 167
+#define R_PARISC_TPREL64 216
+#define R_PARISC_TPREL14WR 219
+#define R_PARISC_TPREL14DR 220
+#define R_PARISC_TPREL16F 221
+#define R_PARISC_TPREL16WF 222
+#define R_PARISC_TPREL16DF 223
+#define R_PARISC_LTOFF_TP64 224
+#define R_PARISC_LTOFF_TP14WR 227
+#define R_PARISC_LTOFF_TP14DR 228
+#define R_PARISC_LTOFF_TP16F 229
+#define R_PARISC_LTOFF_TP16WF 230
+#define R_PARISC_LTOFF_TP16DF 231
+#define R_PARISC_GNU_VTENTRY 232
+#define R_PARISC_GNU_VTINHERIT 233
+#define R_PARISC_TLS_GD21L 234
+#define R_PARISC_TLS_GD14R 235
+#define R_PARISC_TLS_GDCALL 236
+#define R_PARISC_TLS_LDM21L 237
+#define R_PARISC_TLS_LDM14R 238
+#define R_PARISC_TLS_LDMCALL 239
+#define R_PARISC_TLS_LDO21L 240
+#define R_PARISC_TLS_LDO14R 241
+#define R_PARISC_TLS_DTPMOD32 242
+#define R_PARISC_TLS_DTPMOD64 243
+#define R_PARISC_TLS_DTPOFF32 244
+#define R_PARISC_TLS_DTPOFF64 245
+#define R_PARISC_TLS_LE21L R_PARISC_TPREL21L
+#define R_PARISC_TLS_LE14R R_PARISC_TPREL14R
+#define R_PARISC_TLS_IE21L R_PARISC_LTOFF_TP21L
+#define R_PARISC_TLS_IE14R R_PARISC_LTOFF_TP14R
+#define R_PARISC_TLS_TPREL32 R_PARISC_TPREL32
+#define R_PARISC_TLS_TPREL64 R_PARISC_TPREL64
+#define R_PARISC_HIRESERVE 255
+
+
+
+#define PT_HP_TLS (PT_LOOS + 0x0)
+#define PT_HP_CORE_NONE (PT_LOOS + 0x1)
+#define PT_HP_CORE_VERSION (PT_LOOS + 0x2)
+#define PT_HP_CORE_KERNEL (PT_LOOS + 0x3)
+#define PT_HP_CORE_COMM (PT_LOOS + 0x4)
+#define PT_HP_CORE_PROC (PT_LOOS + 0x5)
+#define PT_HP_CORE_LOADABLE (PT_LOOS + 0x6)
+#define PT_HP_CORE_STACK (PT_LOOS + 0x7)
+#define PT_HP_CORE_SHM (PT_LOOS + 0x8)
+#define PT_HP_CORE_MMF (PT_LOOS + 0x9)
+#define PT_HP_PARALLEL (PT_LOOS + 0x10)
+#define PT_HP_FASTBIND (PT_LOOS + 0x11)
+#define PT_HP_OPT_ANNOT (PT_LOOS + 0x12)
+#define PT_HP_HSL_ANNOT (PT_LOOS + 0x13)
+#define PT_HP_STACK (PT_LOOS + 0x14)
+
+#define PT_PARISC_ARCHEXT 0x70000000
+#define PT_PARISC_UNWIND 0x70000001
+
+
+
+#define PF_PARISC_SBP 0x08000000
+
+#define PF_HP_PAGE_SIZE 0x00100000
+#define PF_HP_FAR_SHARED 0x00200000
+#define PF_HP_NEAR_SHARED 0x00400000
+#define PF_HP_CODE 0x01000000
+#define PF_HP_MODIFY 0x02000000
+#define PF_HP_LAZYSWAP 0x04000000
+#define PF_HP_SBP 0x08000000
+
+
+
+
+
+
+#define EF_ALPHA_32BIT 1
+#define EF_ALPHA_CANRELAX 2
+
+
+
+
+#define SHT_ALPHA_DEBUG 0x70000001
+#define SHT_ALPHA_REGINFO 0x70000002
+
+
+
+#define SHF_ALPHA_GPREL 0x10000000
+
+
+#define STO_ALPHA_NOPV 0x80
+#define STO_ALPHA_STD_GPLOAD 0x88
+
+
+
+#define R_ALPHA_NONE 0
+#define R_ALPHA_REFLONG 1
+#define R_ALPHA_REFQUAD 2
+#define R_ALPHA_GPREL32 3
+#define R_ALPHA_LITERAL 4
+#define R_ALPHA_LITUSE 5
+#define R_ALPHA_GPDISP 6
+#define R_ALPHA_BRADDR 7
+#define R_ALPHA_HINT 8
+#define R_ALPHA_SREL16 9
+#define R_ALPHA_SREL32 10
+#define R_ALPHA_SREL64 11
+#define R_ALPHA_GPRELHIGH 17
+#define R_ALPHA_GPRELLOW 18
+#define R_ALPHA_GPREL16 19
+#define R_ALPHA_COPY 24
+#define R_ALPHA_GLOB_DAT 25
+#define R_ALPHA_JMP_SLOT 26
+#define R_ALPHA_RELATIVE 27
+#define R_ALPHA_TLS_GD_HI 28
+#define R_ALPHA_TLSGD 29
+#define R_ALPHA_TLS_LDM 30
+#define R_ALPHA_DTPMOD64 31
+#define R_ALPHA_GOTDTPREL 32
+#define R_ALPHA_DTPREL64 33
+#define R_ALPHA_DTPRELHI 34
+#define R_ALPHA_DTPRELLO 35
+#define R_ALPHA_DTPREL16 36
+#define R_ALPHA_GOTTPREL 37
+#define R_ALPHA_TPREL64 38
+#define R_ALPHA_TPRELHI 39
+#define R_ALPHA_TPRELLO 40
+#define R_ALPHA_TPREL16 41
+
+#define R_ALPHA_NUM 46
+
+
+#define LITUSE_ALPHA_ADDR 0
+#define LITUSE_ALPHA_BASE 1
+#define LITUSE_ALPHA_BYTOFF 2
+#define LITUSE_ALPHA_JSR 3
+#define LITUSE_ALPHA_TLS_GD 4
+#define LITUSE_ALPHA_TLS_LDM 5
+
+
+#define DT_ALPHA_PLTRO (DT_LOPROC + 0)
+#define DT_ALPHA_NUM 1
+
+
+
+
+#define EF_PPC_EMB 0x80000000
+
+
+#define EF_PPC_RELOCATABLE 0x00010000
+#define EF_PPC_RELOCATABLE_LIB 0x00008000
+
+
+
+#define R_PPC_NONE 0
+#define R_PPC_ADDR32 1
+#define R_PPC_ADDR24 2
+#define R_PPC_ADDR16 3
+#define R_PPC_ADDR16_LO 4
+#define R_PPC_ADDR16_HI 5
+#define R_PPC_ADDR16_HA 6
+#define R_PPC_ADDR14 7
+#define R_PPC_ADDR14_BRTAKEN 8
+#define R_PPC_ADDR14_BRNTAKEN 9
+#define R_PPC_REL24 10
+#define R_PPC_REL14 11
+#define R_PPC_REL14_BRTAKEN 12
+#define R_PPC_REL14_BRNTAKEN 13
+#define R_PPC_GOT16 14
+#define R_PPC_GOT16_LO 15
+#define R_PPC_GOT16_HI 16
+#define R_PPC_GOT16_HA 17
+#define R_PPC_PLTREL24 18
+#define R_PPC_COPY 19
+#define R_PPC_GLOB_DAT 20
+#define R_PPC_JMP_SLOT 21
+#define R_PPC_RELATIVE 22
+#define R_PPC_LOCAL24PC 23
+#define R_PPC_UADDR32 24
+#define R_PPC_UADDR16 25
+#define R_PPC_REL32 26
+#define R_PPC_PLT32 27
+#define R_PPC_PLTREL32 28
+#define R_PPC_PLT16_LO 29
+#define R_PPC_PLT16_HI 30
+#define R_PPC_PLT16_HA 31
+#define R_PPC_SDAREL16 32
+#define R_PPC_SECTOFF 33
+#define R_PPC_SECTOFF_LO 34
+#define R_PPC_SECTOFF_HI 35
+#define R_PPC_SECTOFF_HA 36
+
+
+#define R_PPC_TLS 67
+#define R_PPC_DTPMOD32 68
+#define R_PPC_TPREL16 69
+#define R_PPC_TPREL16_LO 70
+#define R_PPC_TPREL16_HI 71
+#define R_PPC_TPREL16_HA 72
+#define R_PPC_TPREL32 73
+#define R_PPC_DTPREL16 74
+#define R_PPC_DTPREL16_LO 75
+#define R_PPC_DTPREL16_HI 76
+#define R_PPC_DTPREL16_HA 77
+#define R_PPC_DTPREL32 78
+#define R_PPC_GOT_TLSGD16 79
+#define R_PPC_GOT_TLSGD16_LO 80
+#define R_PPC_GOT_TLSGD16_HI 81
+#define R_PPC_GOT_TLSGD16_HA 82
+#define R_PPC_GOT_TLSLD16 83
+#define R_PPC_GOT_TLSLD16_LO 84
+#define R_PPC_GOT_TLSLD16_HI 85
+#define R_PPC_GOT_TLSLD16_HA 86
+#define R_PPC_GOT_TPREL16 87
+#define R_PPC_GOT_TPREL16_LO 88
+#define R_PPC_GOT_TPREL16_HI 89
+#define R_PPC_GOT_TPREL16_HA 90
+#define R_PPC_GOT_DTPREL16 91
+#define R_PPC_GOT_DTPREL16_LO 92
+#define R_PPC_GOT_DTPREL16_HI 93
+#define R_PPC_GOT_DTPREL16_HA 94
+
+
+
+#define R_PPC_EMB_NADDR32 101
+#define R_PPC_EMB_NADDR16 102
+#define R_PPC_EMB_NADDR16_LO 103
+#define R_PPC_EMB_NADDR16_HI 104
+#define R_PPC_EMB_NADDR16_HA 105
+#define R_PPC_EMB_SDAI16 106
+#define R_PPC_EMB_SDA2I16 107
+#define R_PPC_EMB_SDA2REL 108
+#define R_PPC_EMB_SDA21 109
+#define R_PPC_EMB_MRKREF 110
+#define R_PPC_EMB_RELSEC16 111
+#define R_PPC_EMB_RELST_LO 112
+#define R_PPC_EMB_RELST_HI 113
+#define R_PPC_EMB_RELST_HA 114
+#define R_PPC_EMB_BIT_FLD 115
+#define R_PPC_EMB_RELSDA 116
+
+
+#define R_PPC_DIAB_SDA21_LO 180
+#define R_PPC_DIAB_SDA21_HI 181
+#define R_PPC_DIAB_SDA21_HA 182
+#define R_PPC_DIAB_RELSDA_LO 183
+#define R_PPC_DIAB_RELSDA_HI 184
+#define R_PPC_DIAB_RELSDA_HA 185
+
+
+#define R_PPC_IRELATIVE 248
+
+
+#define R_PPC_REL16 249
+#define R_PPC_REL16_LO 250
+#define R_PPC_REL16_HI 251
+#define R_PPC_REL16_HA 252
+
+
+
+#define R_PPC_TOC16 255
+
+
+#define DT_PPC_GOT (DT_LOPROC + 0)
+#define DT_PPC_NUM 1
+
+
+#define R_PPC64_NONE R_PPC_NONE
+#define R_PPC64_ADDR32 R_PPC_ADDR32
+#define R_PPC64_ADDR24 R_PPC_ADDR24
+#define R_PPC64_ADDR16 R_PPC_ADDR16
+#define R_PPC64_ADDR16_LO R_PPC_ADDR16_LO
+#define R_PPC64_ADDR16_HI R_PPC_ADDR16_HI
+#define R_PPC64_ADDR16_HA R_PPC_ADDR16_HA
+#define R_PPC64_ADDR14 R_PPC_ADDR14
+#define R_PPC64_ADDR14_BRTAKEN R_PPC_ADDR14_BRTAKEN
+#define R_PPC64_ADDR14_BRNTAKEN R_PPC_ADDR14_BRNTAKEN
+#define R_PPC64_REL24 R_PPC_REL24
+#define R_PPC64_REL14 R_PPC_REL14
+#define R_PPC64_REL14_BRTAKEN R_PPC_REL14_BRTAKEN
+#define R_PPC64_REL14_BRNTAKEN R_PPC_REL14_BRNTAKEN
+#define R_PPC64_GOT16 R_PPC_GOT16
+#define R_PPC64_GOT16_LO R_PPC_GOT16_LO
+#define R_PPC64_GOT16_HI R_PPC_GOT16_HI
+#define R_PPC64_GOT16_HA R_PPC_GOT16_HA
+
+#define R_PPC64_COPY R_PPC_COPY
+#define R_PPC64_GLOB_DAT R_PPC_GLOB_DAT
+#define R_PPC64_JMP_SLOT R_PPC_JMP_SLOT
+#define R_PPC64_RELATIVE R_PPC_RELATIVE
+
+#define R_PPC64_UADDR32 R_PPC_UADDR32
+#define R_PPC64_UADDR16 R_PPC_UADDR16
+#define R_PPC64_REL32 R_PPC_REL32
+#define R_PPC64_PLT32 R_PPC_PLT32
+#define R_PPC64_PLTREL32 R_PPC_PLTREL32
+#define R_PPC64_PLT16_LO R_PPC_PLT16_LO
+#define R_PPC64_PLT16_HI R_PPC_PLT16_HI
+#define R_PPC64_PLT16_HA R_PPC_PLT16_HA
+
+#define R_PPC64_SECTOFF R_PPC_SECTOFF
+#define R_PPC64_SECTOFF_LO R_PPC_SECTOFF_LO
+#define R_PPC64_SECTOFF_HI R_PPC_SECTOFF_HI
+#define R_PPC64_SECTOFF_HA R_PPC_SECTOFF_HA
+#define R_PPC64_ADDR30 37
+#define R_PPC64_ADDR64 38
+#define R_PPC64_ADDR16_HIGHER 39
+#define R_PPC64_ADDR16_HIGHERA 40
+#define R_PPC64_ADDR16_HIGHEST 41
+#define R_PPC64_ADDR16_HIGHESTA 42
+#define R_PPC64_UADDR64 43
+#define R_PPC64_REL64 44
+#define R_PPC64_PLT64 45
+#define R_PPC64_PLTREL64 46
+#define R_PPC64_TOC16 47
+#define R_PPC64_TOC16_LO 48
+#define R_PPC64_TOC16_HI 49
+#define R_PPC64_TOC16_HA 50
+#define R_PPC64_TOC 51
+#define R_PPC64_PLTGOT16 52
+#define R_PPC64_PLTGOT16_LO 53
+#define R_PPC64_PLTGOT16_HI 54
+#define R_PPC64_PLTGOT16_HA 55
+
+#define R_PPC64_ADDR16_DS 56
+#define R_PPC64_ADDR16_LO_DS 57
+#define R_PPC64_GOT16_DS 58
+#define R_PPC64_GOT16_LO_DS 59
+#define R_PPC64_PLT16_LO_DS 60
+#define R_PPC64_SECTOFF_DS 61
+#define R_PPC64_SECTOFF_LO_DS 62
+#define R_PPC64_TOC16_DS 63
+#define R_PPC64_TOC16_LO_DS 64
+#define R_PPC64_PLTGOT16_DS 65
+#define R_PPC64_PLTGOT16_LO_DS 66
+
+
+#define R_PPC64_TLS 67
+#define R_PPC64_DTPMOD64 68
+#define R_PPC64_TPREL16 69
+#define R_PPC64_TPREL16_LO 70
+#define R_PPC64_TPREL16_HI 71
+#define R_PPC64_TPREL16_HA 72
+#define R_PPC64_TPREL64 73
+#define R_PPC64_DTPREL16 74
+#define R_PPC64_DTPREL16_LO 75
+#define R_PPC64_DTPREL16_HI 76
+#define R_PPC64_DTPREL16_HA 77
+#define R_PPC64_DTPREL64 78
+#define R_PPC64_GOT_TLSGD16 79
+#define R_PPC64_GOT_TLSGD16_LO 80
+#define R_PPC64_GOT_TLSGD16_HI 81
+#define R_PPC64_GOT_TLSGD16_HA 82
+#define R_PPC64_GOT_TLSLD16 83
+#define R_PPC64_GOT_TLSLD16_LO 84
+#define R_PPC64_GOT_TLSLD16_HI 85
+#define R_PPC64_GOT_TLSLD16_HA 86
+#define R_PPC64_GOT_TPREL16_DS 87
+#define R_PPC64_GOT_TPREL16_LO_DS 88
+#define R_PPC64_GOT_TPREL16_HI 89
+#define R_PPC64_GOT_TPREL16_HA 90
+#define R_PPC64_GOT_DTPREL16_DS 91
+#define R_PPC64_GOT_DTPREL16_LO_DS 92
+#define R_PPC64_GOT_DTPREL16_HI 93
+#define R_PPC64_GOT_DTPREL16_HA 94
+#define R_PPC64_TPREL16_DS 95
+#define R_PPC64_TPREL16_LO_DS 96
+#define R_PPC64_TPREL16_HIGHER 97
+#define R_PPC64_TPREL16_HIGHERA 98
+#define R_PPC64_TPREL16_HIGHEST 99
+#define R_PPC64_TPREL16_HIGHESTA 100
+#define R_PPC64_DTPREL16_DS 101
+#define R_PPC64_DTPREL16_LO_DS 102
+#define R_PPC64_DTPREL16_HIGHER 103
+#define R_PPC64_DTPREL16_HIGHERA 104
+#define R_PPC64_DTPREL16_HIGHEST 105
+#define R_PPC64_DTPREL16_HIGHESTA 106
+
+
+#define R_PPC64_JMP_IREL 247
+#define R_PPC64_IRELATIVE 248
+#define R_PPC64_REL16 249
+#define R_PPC64_REL16_LO 250
+#define R_PPC64_REL16_HI 251
+#define R_PPC64_REL16_HA 252
+
+
+#define DT_PPC64_GLINK (DT_LOPROC + 0)
+#define DT_PPC64_OPD (DT_LOPROC + 1)
+#define DT_PPC64_OPDSZ (DT_LOPROC + 2)
+#define DT_PPC64_NUM 3
+
+
+
+
+
+#define EF_ARM_RELEXEC 0x01
+#define EF_ARM_HASENTRY 0x02
+#define EF_ARM_INTERWORK 0x04
+#define EF_ARM_APCS_26 0x08
+#define EF_ARM_APCS_FLOAT 0x10
+#define EF_ARM_PIC 0x20
+#define EF_ARM_ALIGN8 0x40
+#define EF_ARM_NEW_ABI 0x80
+#define EF_ARM_OLD_ABI 0x100
+#define EF_ARM_SOFT_FLOAT 0x200
+#define EF_ARM_VFP_FLOAT 0x400
+#define EF_ARM_MAVERICK_FLOAT 0x800
+
+#define EF_ARM_ABI_FLOAT_SOFT 0x200
+#define EF_ARM_ABI_FLOAT_HARD 0x400
+
+
+#define EF_ARM_SYMSARESORTED 0x04
+#define EF_ARM_DYNSYMSUSESEGIDX 0x08
+#define EF_ARM_MAPSYMSFIRST 0x10
+#define EF_ARM_EABIMASK 0XFF000000
+
+
+#define EF_ARM_BE8 0x00800000
+#define EF_ARM_LE8 0x00400000
+
+#define EF_ARM_EABI_VERSION(flags) ((flags) & EF_ARM_EABIMASK)
+#define EF_ARM_EABI_UNKNOWN 0x00000000
+#define EF_ARM_EABI_VER1 0x01000000
+#define EF_ARM_EABI_VER2 0x02000000
+#define EF_ARM_EABI_VER3 0x03000000
+#define EF_ARM_EABI_VER4 0x04000000
+#define EF_ARM_EABI_VER5 0x05000000
+
+
+#define STT_ARM_TFUNC STT_LOPROC
+#define STT_ARM_16BIT STT_HIPROC
+
+
+#define SHF_ARM_ENTRYSECT 0x10000000
+#define SHF_ARM_COMDEF 0x80000000
+
+
+
+#define PF_ARM_SB 0x10000000
+
+#define PF_ARM_PI 0x20000000
+#define PF_ARM_ABS 0x40000000
+
+
+#define PT_ARM_EXIDX (PT_LOPROC + 1)
+
+
+#define SHT_ARM_EXIDX (SHT_LOPROC + 1)
+#define SHT_ARM_PREEMPTMAP (SHT_LOPROC + 2)
+#define SHT_ARM_ATTRIBUTES (SHT_LOPROC + 3)
+
+
+#define R_AARCH64_NONE 0
+#define R_AARCH64_ABS64 257
+#define R_AARCH64_ABS32 258
+#define R_AARCH64_ABS16 259
+#define R_AARCH64_PREL64 260
+#define R_AARCH64_PREL32 261
+#define R_AARCH64_PREL16 262
+#define R_AARCH64_MOVW_UABS_G0 263
+#define R_AARCH64_MOVW_UABS_G0_NC 264
+#define R_AARCH64_MOVW_UABS_G1 265
+#define R_AARCH64_MOVW_UABS_G1_NC 266
+#define R_AARCH64_MOVW_UABS_G2 267
+#define R_AARCH64_MOVW_UABS_G2_NC 268
+#define R_AARCH64_MOVW_UABS_G3 269
+#define R_AARCH64_MOVW_SABS_G0 270
+#define R_AARCH64_MOVW_SABS_G1 271
+#define R_AARCH64_MOVW_SABS_G2 272
+#define R_AARCH64_LD_PREL_LO19 273
+#define R_AARCH64_ADR_PREL_LO21 274
+#define R_AARCH64_ADR_PREL_PG_HI21 275
+#define R_AARCH64_ADR_PREL_PG_HI21_NC 276
+#define R_AARCH64_ADD_ABS_LO12_NC 277
+#define R_AARCH64_LDST8_ABS_LO12_NC 278
+#define R_AARCH64_TSTBR14 279
+#define R_AARCH64_CONDBR19 280
+#define R_AARCH64_JUMP26 282
+#define R_AARCH64_CALL26 283
+#define R_AARCH64_LDST16_ABS_LO12_NC 284
+#define R_AARCH64_LDST32_ABS_LO12_NC 285
+#define R_AARCH64_LDST64_ABS_LO12_NC 286
+#define R_AARCH64_MOVW_PREL_G0 287
+#define R_AARCH64_MOVW_PREL_G0_NC 288
+#define R_AARCH64_MOVW_PREL_G1 289
+#define R_AARCH64_MOVW_PREL_G1_NC 290
+#define R_AARCH64_MOVW_PREL_G2 291
+#define R_AARCH64_MOVW_PREL_G2_NC 292
+#define R_AARCH64_MOVW_PREL_G3 293
+#define R_AARCH64_LDST128_ABS_LO12_NC 299
+#define R_AARCH64_MOVW_GOTOFF_G0 300
+#define R_AARCH64_MOVW_GOTOFF_G0_NC 301
+#define R_AARCH64_MOVW_GOTOFF_G1 302
+#define R_AARCH64_MOVW_GOTOFF_G1_NC 303
+#define R_AARCH64_MOVW_GOTOFF_G2 304
+#define R_AARCH64_MOVW_GOTOFF_G2_NC 305
+#define R_AARCH64_MOVW_GOTOFF_G3 306
+#define R_AARCH64_GOTREL64 307
+#define R_AARCH64_GOTREL32 308
+#define R_AARCH64_GOT_LD_PREL19 309
+#define R_AARCH64_LD64_GOTOFF_LO15 310
+#define R_AARCH64_ADR_GOT_PAGE 311
+#define R_AARCH64_LD64_GOT_LO12_NC 312
+#define R_AARCH64_LD64_GOTPAGE_LO15 313
+#define R_AARCH64_TLSGD_ADR_PREL21 512
+#define R_AARCH64_TLSGD_ADR_PAGE21 513
+#define R_AARCH64_TLSGD_ADD_LO12_NC 514
+#define R_AARCH64_TLSGD_MOVW_G1 515
+#define R_AARCH64_TLSGD_MOVW_G0_NC 516
+#define R_AARCH64_TLSLD_ADR_PREL21 517
+#define R_AARCH64_TLSLD_ADR_PAGE21 518
+#define R_AARCH64_TLSLD_ADD_LO12_NC 519
+#define R_AARCH64_TLSLD_MOVW_G1 520
+#define R_AARCH64_TLSLD_MOVW_G0_NC 521
+#define R_AARCH64_TLSLD_LD_PREL19 522
+#define R_AARCH64_TLSLD_MOVW_DTPREL_G2 523
+#define R_AARCH64_TLSLD_MOVW_DTPREL_G1 524
+#define R_AARCH64_TLSLD_MOVW_DTPREL_G1_NC 525
+#define R_AARCH64_TLSLD_MOVW_DTPREL_G0 526
+#define R_AARCH64_TLSLD_MOVW_DTPREL_G0_NC 527
+#define R_AARCH64_TLSLD_ADD_DTPREL_HI12 528
+#define R_AARCH64_TLSLD_ADD_DTPREL_LO12 529
+#define R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC 530
+#define R_AARCH64_TLSLD_LDST8_DTPREL_LO12 531
+#define R_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC 532
+#define R_AARCH64_TLSLD_LDST16_DTPREL_LO12 533
+#define R_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC 534
+#define R_AARCH64_TLSLD_LDST32_DTPREL_LO12 535
+#define R_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC 536
+#define R_AARCH64_TLSLD_LDST64_DTPREL_LO12 537
+#define R_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC 538
+#define R_AARCH64_TLSIE_MOVW_GOTTPREL_G1 539
+#define R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC 540
+#define R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21 541
+#define R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC 542
+#define R_AARCH64_TLSIE_LD_GOTTPREL_PREL19 543
+#define R_AARCH64_TLSLE_MOVW_TPREL_G2 544
+#define R_AARCH64_TLSLE_MOVW_TPREL_G1 545
+#define R_AARCH64_TLSLE_MOVW_TPREL_G1_NC 546
+#define R_AARCH64_TLSLE_MOVW_TPREL_G0 547
+#define R_AARCH64_TLSLE_MOVW_TPREL_G0_NC 548
+#define R_AARCH64_TLSLE_ADD_TPREL_HI12 549
+#define R_AARCH64_TLSLE_ADD_TPREL_LO12 550
+#define R_AARCH64_TLSLE_ADD_TPREL_LO12_NC 551
+#define R_AARCH64_TLSLE_LDST8_TPREL_LO12 552
+#define R_AARCH64_TLSLE_LDST8_TPREL_LO12_NC 553
+#define R_AARCH64_TLSLE_LDST16_TPREL_LO12 554
+#define R_AARCH64_TLSLE_LDST16_TPREL_LO12_NC 555
+#define R_AARCH64_TLSLE_LDST32_TPREL_LO12 556
+#define R_AARCH64_TLSLE_LDST32_TPREL_LO12_NC 557
+#define R_AARCH64_TLSLE_LDST64_TPREL_LO12 558
+#define R_AARCH64_TLSLE_LDST64_TPREL_LO12_NC 559
+#define R_AARCH64_TLSDESC_LD_PREL19 560
+#define R_AARCH64_TLSDESC_ADR_PREL21 561
+#define R_AARCH64_TLSDESC_ADR_PAGE21 562
+#define R_AARCH64_TLSDESC_LD64_LO12 563
+#define R_AARCH64_TLSDESC_ADD_LO12 564
+#define R_AARCH64_TLSDESC_OFF_G1 565
+#define R_AARCH64_TLSDESC_OFF_G0_NC 566
+#define R_AARCH64_TLSDESC_LDR 567
+#define R_AARCH64_TLSDESC_ADD 568
+#define R_AARCH64_TLSDESC_CALL 569
+#define R_AARCH64_TLSLE_LDST128_TPREL_LO12 570
+#define R_AARCH64_TLSLE_LDST128_TPREL_LO12_NC 571
+#define R_AARCH64_TLSLD_LDST128_DTPREL_LO12 572
+#define R_AARCH64_TLSLD_LDST128_DTPREL_LO12_NC 573
+#define R_AARCH64_COPY 1024
+#define R_AARCH64_GLOB_DAT 1025
+#define R_AARCH64_JUMP_SLOT 1026
+#define R_AARCH64_RELATIVE 1027
+#define R_AARCH64_TLS_DTPMOD64 1028
+#define R_AARCH64_TLS_DTPREL64 1029
+#define R_AARCH64_TLS_TPREL64 1030
+#define R_AARCH64_TLSDESC 1031
+
+
+#define R_ARM_NONE 0
+#define R_ARM_PC24 1
+#define R_ARM_ABS32 2
+#define R_ARM_REL32 3
+#define R_ARM_PC13 4
+#define R_ARM_ABS16 5
+#define R_ARM_ABS12 6
+#define R_ARM_THM_ABS5 7
+#define R_ARM_ABS8 8
+#define R_ARM_SBREL32 9
+#define R_ARM_THM_PC22 10
+#define R_ARM_THM_PC8 11
+#define R_ARM_AMP_VCALL9 12
+#define R_ARM_TLS_DESC 13
+#define R_ARM_THM_SWI8 14
+#define R_ARM_XPC25 15
+#define R_ARM_THM_XPC22 16
+#define R_ARM_TLS_DTPMOD32 17
+#define R_ARM_TLS_DTPOFF32 18
+#define R_ARM_TLS_TPOFF32 19
+#define R_ARM_COPY 20
+#define R_ARM_GLOB_DAT 21
+#define R_ARM_JUMP_SLOT 22
+#define R_ARM_RELATIVE 23
+#define R_ARM_GOTOFF 24
+#define R_ARM_GOTPC 25
+#define R_ARM_GOT32 26
+#define R_ARM_PLT32 27
+#define R_ARM_CALL 28
+#define R_ARM_JUMP24 29
+#define R_ARM_THM_JUMP24 30
+#define R_ARM_BASE_ABS 31
+#define R_ARM_ALU_PCREL_7_0 32
+#define R_ARM_ALU_PCREL_15_8 33
+#define R_ARM_ALU_PCREL_23_15 34
+#define R_ARM_LDR_SBREL_11_0 35
+#define R_ARM_ALU_SBREL_19_12 36
+#define R_ARM_ALU_SBREL_27_20 37
+#define R_ARM_TARGET1 38
+#define R_ARM_SBREL31 39
+#define R_ARM_V4BX 40
+#define R_ARM_TARGET2 41
+#define R_ARM_PREL31 42
+#define R_ARM_MOVW_ABS_NC 43
+#define R_ARM_MOVT_ABS 44
+#define R_ARM_MOVW_PREL_NC 45
+#define R_ARM_MOVT_PREL 46
+#define R_ARM_THM_MOVW_ABS_NC 47
+#define R_ARM_THM_MOVT_ABS 48
+#define R_ARM_THM_MOVW_PREL_NC 49
+#define R_ARM_THM_MOVT_PREL 50
+#define R_ARM_THM_JUMP19 51
+#define R_ARM_THM_JUMP6 52
+#define R_ARM_THM_ALU_PREL_11_0 53
+#define R_ARM_THM_PC12 54
+#define R_ARM_ABS32_NOI 55
+#define R_ARM_REL32_NOI 56
+#define R_ARM_ALU_PC_G0_NC 57
+#define R_ARM_ALU_PC_G0 58
+#define R_ARM_ALU_PC_G1_NC 59
+#define R_ARM_ALU_PC_G1 60
+#define R_ARM_ALU_PC_G2 61
+#define R_ARM_LDR_PC_G1 62
+#define R_ARM_LDR_PC_G2 63
+#define R_ARM_LDRS_PC_G0 64
+#define R_ARM_LDRS_PC_G1 65
+#define R_ARM_LDRS_PC_G2 66
+#define R_ARM_LDC_PC_G0 67
+#define R_ARM_LDC_PC_G1 68
+#define R_ARM_LDC_PC_G2 69
+#define R_ARM_ALU_SB_G0_NC 70
+#define R_ARM_ALU_SB_G0 71
+#define R_ARM_ALU_SB_G1_NC 72
+#define R_ARM_ALU_SB_G1 73
+#define R_ARM_ALU_SB_G2 74
+#define R_ARM_LDR_SB_G0 75
+#define R_ARM_LDR_SB_G1 76
+#define R_ARM_LDR_SB_G2 77
+#define R_ARM_LDRS_SB_G0 78
+#define R_ARM_LDRS_SB_G1 79
+#define R_ARM_LDRS_SB_G2 80
+#define R_ARM_LDC_SB_G0 81
+#define R_ARM_LDC_SB_G1 82
+#define R_ARM_LDC_SB_G2 83
+#define R_ARM_MOVW_BREL_NC 84
+#define R_ARM_MOVT_BREL 85
+#define R_ARM_MOVW_BREL 86
+#define R_ARM_THM_MOVW_BREL_NC 87
+#define R_ARM_THM_MOVT_BREL 88
+#define R_ARM_THM_MOVW_BREL 89
+#define R_ARM_TLS_GOTDESC 90
+#define R_ARM_TLS_CALL 91
+#define R_ARM_TLS_DESCSEQ 92
+#define R_ARM_THM_TLS_CALL 93
+#define R_ARM_PLT32_ABS 94
+#define R_ARM_GOT_ABS 95
+#define R_ARM_GOT_PREL 96
+#define R_ARM_GOT_BREL12 97
+#define R_ARM_GOTOFF12 98
+#define R_ARM_GOTRELAX 99
+#define R_ARM_GNU_VTENTRY 100
+#define R_ARM_GNU_VTINHERIT 101
+#define R_ARM_THM_PC11 102
+#define R_ARM_THM_PC9 103
+#define R_ARM_TLS_GD32 104
+
+#define R_ARM_TLS_LDM32 105
+
+#define R_ARM_TLS_LDO32 106
+
+#define R_ARM_TLS_IE32 107
+
+#define R_ARM_TLS_LE32 108
+#define R_ARM_TLS_LDO12 109
+#define R_ARM_TLS_LE12 110
+#define R_ARM_TLS_IE12GP 111
+#define R_ARM_ME_TOO 128
+#define R_ARM_THM_TLS_DESCSEQ 129
+#define R_ARM_THM_TLS_DESCSEQ16 129
+#define R_ARM_THM_TLS_DESCSEQ32 130
+#define R_ARM_THM_GOT_BREL12 131
+#define R_ARM_IRELATIVE 160
+#define R_ARM_RXPC25 249
+#define R_ARM_RSBREL32 250
+#define R_ARM_THM_RPC22 251
+#define R_ARM_RREL32 252
+#define R_ARM_RABS22 253
+#define R_ARM_RPC24 254
+#define R_ARM_RBASE 255
+
+#define R_ARM_NUM 256
+
+
+
+
+#define EF_IA_64_MASKOS 0x0000000f
+#define EF_IA_64_ABI64 0x00000010
+#define EF_IA_64_ARCH 0xff000000
+
+
+#define PT_IA_64_ARCHEXT (PT_LOPROC + 0)
+#define PT_IA_64_UNWIND (PT_LOPROC + 1)
+#define PT_IA_64_HP_OPT_ANOT (PT_LOOS + 0x12)
+#define PT_IA_64_HP_HSL_ANOT (PT_LOOS + 0x13)
+#define PT_IA_64_HP_STACK (PT_LOOS + 0x14)
+
+
+#define PF_IA_64_NORECOV 0x80000000
+
+
+#define SHT_IA_64_EXT (SHT_LOPROC + 0)
+#define SHT_IA_64_UNWIND (SHT_LOPROC + 1)
+
+
+#define SHF_IA_64_SHORT 0x10000000
+#define SHF_IA_64_NORECOV 0x20000000
+
+
+#define DT_IA_64_PLT_RESERVE (DT_LOPROC + 0)
+#define DT_IA_64_NUM 1
+
+
+#define R_IA64_NONE 0x00
+#define R_IA64_IMM14 0x21
+#define R_IA64_IMM22 0x22
+#define R_IA64_IMM64 0x23
+#define R_IA64_DIR32MSB 0x24
+#define R_IA64_DIR32LSB 0x25
+#define R_IA64_DIR64MSB 0x26
+#define R_IA64_DIR64LSB 0x27
+#define R_IA64_GPREL22 0x2a
+#define R_IA64_GPREL64I 0x2b
+#define R_IA64_GPREL32MSB 0x2c
+#define R_IA64_GPREL32LSB 0x2d
+#define R_IA64_GPREL64MSB 0x2e
+#define R_IA64_GPREL64LSB 0x2f
+#define R_IA64_LTOFF22 0x32
+#define R_IA64_LTOFF64I 0x33
+#define R_IA64_PLTOFF22 0x3a
+#define R_IA64_PLTOFF64I 0x3b
+#define R_IA64_PLTOFF64MSB 0x3e
+#define R_IA64_PLTOFF64LSB 0x3f
+#define R_IA64_FPTR64I 0x43
+#define R_IA64_FPTR32MSB 0x44
+#define R_IA64_FPTR32LSB 0x45
+#define R_IA64_FPTR64MSB 0x46
+#define R_IA64_FPTR64LSB 0x47
+#define R_IA64_PCREL60B 0x48
+#define R_IA64_PCREL21B 0x49
+#define R_IA64_PCREL21M 0x4a
+#define R_IA64_PCREL21F 0x4b
+#define R_IA64_PCREL32MSB 0x4c
+#define R_IA64_PCREL32LSB 0x4d
+#define R_IA64_PCREL64MSB 0x4e
+#define R_IA64_PCREL64LSB 0x4f
+#define R_IA64_LTOFF_FPTR22 0x52
+#define R_IA64_LTOFF_FPTR64I 0x53
+#define R_IA64_LTOFF_FPTR32MSB 0x54
+#define R_IA64_LTOFF_FPTR32LSB 0x55
+#define R_IA64_LTOFF_FPTR64MSB 0x56
+#define R_IA64_LTOFF_FPTR64LSB 0x57
+#define R_IA64_SEGREL32MSB 0x5c
+#define R_IA64_SEGREL32LSB 0x5d
+#define R_IA64_SEGREL64MSB 0x5e
+#define R_IA64_SEGREL64LSB 0x5f
+#define R_IA64_SECREL32MSB 0x64
+#define R_IA64_SECREL32LSB 0x65
+#define R_IA64_SECREL64MSB 0x66
+#define R_IA64_SECREL64LSB 0x67
+#define R_IA64_REL32MSB 0x6c
+#define R_IA64_REL32LSB 0x6d
+#define R_IA64_REL64MSB 0x6e
+#define R_IA64_REL64LSB 0x6f
+#define R_IA64_LTV32MSB 0x74
+#define R_IA64_LTV32LSB 0x75
+#define R_IA64_LTV64MSB 0x76
+#define R_IA64_LTV64LSB 0x77
+#define R_IA64_PCREL21BI 0x79
+#define R_IA64_PCREL22 0x7a
+#define R_IA64_PCREL64I 0x7b
+#define R_IA64_IPLTMSB 0x80
+#define R_IA64_IPLTLSB 0x81
+#define R_IA64_COPY 0x84
+#define R_IA64_SUB 0x85
+#define R_IA64_LTOFF22X 0x86
+#define R_IA64_LDXMOV 0x87
+#define R_IA64_TPREL14 0x91
+#define R_IA64_TPREL22 0x92
+#define R_IA64_TPREL64I 0x93
+#define R_IA64_TPREL64MSB 0x96
+#define R_IA64_TPREL64LSB 0x97
+#define R_IA64_LTOFF_TPREL22 0x9a
+#define R_IA64_DTPMOD64MSB 0xa6
+#define R_IA64_DTPMOD64LSB 0xa7
+#define R_IA64_LTOFF_DTPMOD22 0xaa
+#define R_IA64_DTPREL14 0xb1
+#define R_IA64_DTPREL22 0xb2
+#define R_IA64_DTPREL64I 0xb3
+#define R_IA64_DTPREL32MSB 0xb4
+#define R_IA64_DTPREL32LSB 0xb5
+#define R_IA64_DTPREL64MSB 0xb6
+#define R_IA64_DTPREL64LSB 0xb7
+#define R_IA64_LTOFF_DTPREL22 0xba
+
+
+
+
+#define R_SH_NONE 0
+#define R_SH_DIR32 1
+#define R_SH_REL32 2
+#define R_SH_DIR8WPN 3
+#define R_SH_IND12W 4
+#define R_SH_DIR8WPL 5
+#define R_SH_DIR8WPZ 6
+#define R_SH_DIR8BP 7
+#define R_SH_DIR8W 8
+#define R_SH_DIR8L 9
+#define R_SH_SWITCH16 25
+#define R_SH_SWITCH32 26
+#define R_SH_USES 27
+#define R_SH_COUNT 28
+#define R_SH_ALIGN 29
+#define R_SH_CODE 30
+#define R_SH_DATA 31
+#define R_SH_LABEL 32
+#define R_SH_SWITCH8 33
+#define R_SH_GNU_VTINHERIT 34
+#define R_SH_GNU_VTENTRY 35
+#define R_SH_TLS_GD_32 144
+#define R_SH_TLS_LD_32 145
+#define R_SH_TLS_LDO_32 146
+#define R_SH_TLS_IE_32 147
+#define R_SH_TLS_LE_32 148
+#define R_SH_TLS_DTPMOD32 149
+#define R_SH_TLS_DTPOFF32 150
+#define R_SH_TLS_TPOFF32 151
+#define R_SH_GOT32 160
+#define R_SH_PLT32 161
+#define R_SH_COPY 162
+#define R_SH_GLOB_DAT 163
+#define R_SH_JMP_SLOT 164
+#define R_SH_RELATIVE 165
+#define R_SH_GOTOFF 166
+#define R_SH_GOTPC 167
+#define R_SH_GOT20 201
+#define R_SH_GOTOFF20 202
+#define R_SH_GOTFUNCDESC 203
+#define R_SH_GOTFUNCDEST20 204
+#define R_SH_GOTOFFFUNCDESC 205
+#define R_SH_GOTOFFFUNCDEST20 206
+#define R_SH_FUNCDESC 207
+#define R_SH_FUNCDESC_VALUE 208
+
+#define R_SH_NUM 256
+
+
+
+#define R_390_NONE 0
+#define R_390_8 1
+#define R_390_12 2
+#define R_390_16 3
+#define R_390_32 4
+#define R_390_PC32 5
+#define R_390_GOT12 6
+#define R_390_GOT32 7
+#define R_390_PLT32 8
+#define R_390_COPY 9
+#define R_390_GLOB_DAT 10
+#define R_390_JMP_SLOT 11
+#define R_390_RELATIVE 12
+#define R_390_GOTOFF32 13
+#define R_390_GOTPC 14
+#define R_390_GOT16 15
+#define R_390_PC16 16
+#define R_390_PC16DBL 17
+#define R_390_PLT16DBL 18
+#define R_390_PC32DBL 19
+#define R_390_PLT32DBL 20
+#define R_390_GOTPCDBL 21
+#define R_390_64 22
+#define R_390_PC64 23
+#define R_390_GOT64 24
+#define R_390_PLT64 25
+#define R_390_GOTENT 26
+#define R_390_GOTOFF16 27
+#define R_390_GOTOFF64 28
+#define R_390_GOTPLT12 29
+#define R_390_GOTPLT16 30
+#define R_390_GOTPLT32 31
+#define R_390_GOTPLT64 32
+#define R_390_GOTPLTENT 33
+#define R_390_PLTOFF16 34
+#define R_390_PLTOFF32 35
+#define R_390_PLTOFF64 36
+#define R_390_TLS_LOAD 37
+#define R_390_TLS_GDCALL 38
+
+#define R_390_TLS_LDCALL 39
+
+#define R_390_TLS_GD32 40
+
+#define R_390_TLS_GD64 41
+
+#define R_390_TLS_GOTIE12 42
+
+#define R_390_TLS_GOTIE32 43
+
+#define R_390_TLS_GOTIE64 44
+
+#define R_390_TLS_LDM32 45
+
+#define R_390_TLS_LDM64 46
+
+#define R_390_TLS_IE32 47
+
+#define R_390_TLS_IE64 48
+
+#define R_390_TLS_IEENT 49
+
+#define R_390_TLS_LE32 50
+
+#define R_390_TLS_LE64 51
+
+#define R_390_TLS_LDO32 52
+
+#define R_390_TLS_LDO64 53
+
+#define R_390_TLS_DTPMOD 54
+#define R_390_TLS_DTPOFF 55
+#define R_390_TLS_TPOFF 56
+
+#define R_390_20 57
+#define R_390_GOT20 58
+#define R_390_GOTPLT20 59
+#define R_390_TLS_GOTIE20 60
+
+
+#define R_390_NUM 61
+
+
+
+#define R_CRIS_NONE 0
+#define R_CRIS_8 1
+#define R_CRIS_16 2
+#define R_CRIS_32 3
+#define R_CRIS_8_PCREL 4
+#define R_CRIS_16_PCREL 5
+#define R_CRIS_32_PCREL 6
+#define R_CRIS_GNU_VTINHERIT 7
+#define R_CRIS_GNU_VTENTRY 8
+#define R_CRIS_COPY 9
+#define R_CRIS_GLOB_DAT 10
+#define R_CRIS_JUMP_SLOT 11
+#define R_CRIS_RELATIVE 12
+#define R_CRIS_16_GOT 13
+#define R_CRIS_32_GOT 14
+#define R_CRIS_16_GOTPLT 15
+#define R_CRIS_32_GOTPLT 16
+#define R_CRIS_32_GOTREL 17
+#define R_CRIS_32_PLT_GOTREL 18
+#define R_CRIS_32_PLT_PCREL 19
+
+#define R_CRIS_NUM 20
+
+
+
+#define R_X86_64_NONE 0
+#define R_X86_64_64 1
+#define R_X86_64_PC32 2
+#define R_X86_64_GOT32 3
+#define R_X86_64_PLT32 4
+#define R_X86_64_COPY 5
+#define R_X86_64_GLOB_DAT 6
+#define R_X86_64_JUMP_SLOT 7
+#define R_X86_64_RELATIVE 8
+#define R_X86_64_GOTPCREL 9
+
+#define R_X86_64_32 10
+#define R_X86_64_32S 11
+#define R_X86_64_16 12
+#define R_X86_64_PC16 13
+#define R_X86_64_8 14
+#define R_X86_64_PC8 15
+#define R_X86_64_DTPMOD64 16
+#define R_X86_64_DTPOFF64 17
+#define R_X86_64_TPOFF64 18
+#define R_X86_64_TLSGD 19
+
+#define R_X86_64_TLSLD 20
+
+#define R_X86_64_DTPOFF32 21
+#define R_X86_64_GOTTPOFF 22
+
+#define R_X86_64_TPOFF32 23
+#define R_X86_64_PC64 24
+#define R_X86_64_GOTOFF64 25
+#define R_X86_64_GOTPC32 26
+#define R_X86_64_GOT64 27
+#define R_X86_64_GOTPCREL64 28
+#define R_X86_64_GOTPC64 29
+#define R_X86_64_GOTPLT64 30
+#define R_X86_64_PLTOFF64 31
+#define R_X86_64_SIZE32 32
+#define R_X86_64_SIZE64 33
+
+#define R_X86_64_GOTPC32_TLSDESC 34
+#define R_X86_64_TLSDESC_CALL 35
+
+#define R_X86_64_TLSDESC 36
+#define R_X86_64_IRELATIVE 37
+#define R_X86_64_RELATIVE64 38
+#define R_X86_64_NUM 39
+
+
+
+#define R_MN10300_NONE 0
+#define R_MN10300_32 1
+#define R_MN10300_16 2
+#define R_MN10300_8 3
+#define R_MN10300_PCREL32 4
+#define R_MN10300_PCREL16 5
+#define R_MN10300_PCREL8 6
+#define R_MN10300_GNU_VTINHERIT 7
+#define R_MN10300_GNU_VTENTRY 8
+#define R_MN10300_24 9
+#define R_MN10300_GOTPC32 10
+#define R_MN10300_GOTPC16 11
+#define R_MN10300_GOTOFF32 12
+#define R_MN10300_GOTOFF24 13
+#define R_MN10300_GOTOFF16 14
+#define R_MN10300_PLT32 15
+#define R_MN10300_PLT16 16
+#define R_MN10300_GOT32 17
+#define R_MN10300_GOT24 18
+#define R_MN10300_GOT16 19
+#define R_MN10300_COPY 20
+#define R_MN10300_GLOB_DAT 21
+#define R_MN10300_JMP_SLOT 22
+#define R_MN10300_RELATIVE 23
+
+#define R_MN10300_NUM 24
+
+
+
+#define R_M32R_NONE 0
+#define R_M32R_16 1
+#define R_M32R_32 2
+#define R_M32R_24 3
+#define R_M32R_10_PCREL 4
+#define R_M32R_18_PCREL 5
+#define R_M32R_26_PCREL 6
+#define R_M32R_HI16_ULO 7
+#define R_M32R_HI16_SLO 8
+#define R_M32R_LO16 9
+#define R_M32R_SDA16 10
+#define R_M32R_GNU_VTINHERIT 11
+#define R_M32R_GNU_VTENTRY 12
+
+#define R_M32R_16_RELA 33
+#define R_M32R_32_RELA 34
+#define R_M32R_24_RELA 35
+#define R_M32R_10_PCREL_RELA 36
+#define R_M32R_18_PCREL_RELA 37
+#define R_M32R_26_PCREL_RELA 38
+#define R_M32R_HI16_ULO_RELA 39
+#define R_M32R_HI16_SLO_RELA 40
+#define R_M32R_LO16_RELA 41
+#define R_M32R_SDA16_RELA 42
+#define R_M32R_RELA_GNU_VTINHERIT 43
+#define R_M32R_RELA_GNU_VTENTRY 44
+#define R_M32R_REL32 45
+
+#define R_M32R_GOT24 48
+#define R_M32R_26_PLTREL 49
+#define R_M32R_COPY 50
+#define R_M32R_GLOB_DAT 51
+#define R_M32R_JMP_SLOT 52
+#define R_M32R_RELATIVE 53
+#define R_M32R_GOTOFF 54
+#define R_M32R_GOTPC24 55
+#define R_M32R_GOT16_HI_ULO 56
+
+#define R_M32R_GOT16_HI_SLO 57
+
+#define R_M32R_GOT16_LO 58
+#define R_M32R_GOTPC_HI_ULO 59
+
+#define R_M32R_GOTPC_HI_SLO 60
+
+#define R_M32R_GOTPC_LO 61
+
+#define R_M32R_GOTOFF_HI_ULO 62
+
+#define R_M32R_GOTOFF_HI_SLO 63
+
+#define R_M32R_GOTOFF_LO 64
+#define R_M32R_NUM 256
+
+#define R_MICROBLAZE_NONE 0
+#define R_MICROBLAZE_32 1
+#define R_MICROBLAZE_32_PCREL 2
+#define R_MICROBLAZE_64_PCREL 3
+#define R_MICROBLAZE_32_PCREL_LO 4
+#define R_MICROBLAZE_64 5
+#define R_MICROBLAZE_32_LO 6
+#define R_MICROBLAZE_SRO32 7
+#define R_MICROBLAZE_SRW32 8
+#define R_MICROBLAZE_64_NONE 9
+#define R_MICROBLAZE_32_SYM_OP_SYM 10
+#define R_MICROBLAZE_GNU_VTINHERIT 11
+#define R_MICROBLAZE_GNU_VTENTRY 12
+#define R_MICROBLAZE_GOTPC_64 13
+#define R_MICROBLAZE_GOT_64 14
+#define R_MICROBLAZE_PLT_64 15
+#define R_MICROBLAZE_REL 16
+#define R_MICROBLAZE_JUMP_SLOT 17
+#define R_MICROBLAZE_GLOB_DAT 18
+#define R_MICROBLAZE_GOTOFF_64 19
+#define R_MICROBLAZE_GOTOFF_32 20
+#define R_MICROBLAZE_COPY 21
+#define R_MICROBLAZE_TLS 22
+#define R_MICROBLAZE_TLSGD 23
+#define R_MICROBLAZE_TLSLD 24
+#define R_MICROBLAZE_TLSDTPMOD32 25
+#define R_MICROBLAZE_TLSDTPREL32 26
+#define R_MICROBLAZE_TLSDTPREL64 27
+#define R_MICROBLAZE_TLSGOTTPREL32 28
+#define R_MICROBLAZE_TLSTPREL32 29
+
+#define R_OR1K_NONE 0
+#define R_OR1K_32 1
+#define R_OR1K_16 2
+#define R_OR1K_8 3
+#define R_OR1K_LO_16_IN_INSN 4
+#define R_OR1K_HI_16_IN_INSN 5
+#define R_OR1K_INSN_REL_26 6
+#define R_OR1K_GNU_VTENTRY 7
+#define R_OR1K_GNU_VTINHERIT 8
+#define R_OR1K_32_PCREL 9
+#define R_OR1K_16_PCREL 10
+#define R_OR1K_8_PCREL 11
+#define R_OR1K_GOTPC_HI16 12
+#define R_OR1K_GOTPC_LO16 13
+#define R_OR1K_GOT16 14
+#define R_OR1K_PLT26 15
+#define R_OR1K_GOTOFF_HI16 16
+#define R_OR1K_GOTOFF_LO16 17
+#define R_OR1K_COPY 18
+#define R_OR1K_GLOB_DAT 19
+#define R_OR1K_JMP_SLOT 20
+#define R_OR1K_RELATIVE 21
+#define R_OR1K_TLS_GD_HI16 22
+#define R_OR1K_TLS_GD_LO16 23
+#define R_OR1K_TLS_LDM_HI16 24
+#define R_OR1K_TLS_LDM_LO16 25
+#define R_OR1K_TLS_LDO_HI16 26
+#define R_OR1K_TLS_LDO_LO16 27
+#define R_OR1K_TLS_IE_HI16 28
+#define R_OR1K_TLS_IE_LO16 29
+#define R_OR1K_TLS_LE_HI16 30
+#define R_OR1K_TLS_LE_LO16 31
+#define R_OR1K_TLS_TPOFF 32
+#define R_OR1K_TLS_DTPOFF 33
+#define R_OR1K_TLS_DTPMOD 34
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif
diff --git a/src/tools/linux/core2md/core2md.cc b/src/tools/linux/core2md/core2md.cc
index a0e8f8ba..c3a9da39 100644
--- a/src/tools/linux/core2md/core2md.cc
+++ b/src/tools/linux/core2md/core2md.cc
@@ -64,7 +64,7 @@ int main(int argc, char *argv[]) {
if (!WriteMinidumpFromCore(minidump_file,
core_file,
procfs_dir)) {
- fprintf(stderr, "Unable to generate minidump.\n");
+ perror("core2md: Unable to generate minidump");
return 1;
}
diff --git a/src/tools/linux/dump_syms/dump_syms.cc b/src/tools/linux/dump_syms/dump_syms.cc
index 11617883..ebdf2314 100644
--- a/src/tools/linux/dump_syms/dump_syms.cc
+++ b/src/tools/linux/dump_syms/dump_syms.cc
@@ -27,6 +27,7 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#include <paths.h>
#include <stdio.h>
#include <unistd.h>
@@ -38,47 +39,73 @@
#include "common/linux/dump_symbols.h"
using google_breakpad::WriteSymbolFile;
+using google_breakpad::WriteSymbolFileHeader;
int usage(const char* self) {
fprintf(stderr, "Usage: %s [OPTION] <binary-with-debugging-info> "
"[directories-for-debug-file]\n\n", self);
fprintf(stderr, "Options:\n");
- fprintf(stderr, " -c Do not generate CFI section\n");
- fprintf(stderr, " -r Do not handle inter-compilation unit references\n");
- fprintf(stderr, " -v Verbose logging. Print all warnings to stderr\n");
+ fprintf(stderr, " -i: Output module header information only.\n");
+ fprintf(stderr, " -c Do not generate CFI section\n");
+ fprintf(stderr, " -r Do not handle inter-compilation "
+ "unit references\n");
+ fprintf(stderr, " -v Print all warnings to stderr\n");
+ fprintf(stderr, " -n <name> Use specified name for name of the object\n");
+ fprintf(stderr, " -o <os> Use specified name for the "
+ "operating system\n");
return 1;
}
int main(int argc, char **argv) {
if (argc < 2)
return usage(argv[0]);
-
+ bool header_only = false;
bool cfi = true;
bool handle_inter_cu_refs = true;
bool log_to_stderr = false;
+ std::string obj_name;
+ const char* obj_os = "Linux";
int arg_index = 1;
while (arg_index < argc && strlen(argv[arg_index]) > 0 &&
argv[arg_index][0] == '-') {
- if (strcmp("-c", argv[arg_index]) == 0) {
+ if (strcmp("-i", argv[arg_index]) == 0) {
+ header_only = true;
+ } else if (strcmp("-c", argv[arg_index]) == 0) {
cfi = false;
} else if (strcmp("-r", argv[arg_index]) == 0) {
handle_inter_cu_refs = false;
} else if (strcmp("-v", argv[arg_index]) == 0) {
log_to_stderr = true;
+ } else if (strcmp("-n", argv[arg_index]) == 0) {
+ if (arg_index + 1 >= argc) {
+ fprintf(stderr, "Missing argument to -n\n");
+ return usage(argv[0]);
+ }
+ obj_name = argv[arg_index + 1];
+ ++arg_index;
+ } else if (strcmp("-o", argv[arg_index]) == 0) {
+ if (arg_index + 1 >= argc) {
+ fprintf(stderr, "Missing argument to -o\n");
+ return usage(argv[0]);
+ }
+ obj_os = argv[arg_index + 1];
+ ++arg_index;
} else {
+ printf("2.4 %s\n", argv[arg_index]);
return usage(argv[0]);
}
++arg_index;
}
if (arg_index == argc)
return usage(argv[0]);
-
// Save stderr so it can be used below.
- FILE* saved_stderr = fdopen(dup(STDERR_FILENO), "w");
+ FILE* saved_stderr = fdopen(dup(fileno(stderr)), "w");
if (!log_to_stderr) {
- freopen("/dev/null", "w", stderr);
+ if (freopen(_PATH_DEVNULL, "w", stderr)) {
+ // If it fails, not a lot we can (or should) do.
+ // Add this brace section to silence gcc warnings.
+ }
}
-
const char* binary;
std::vector<string> debug_dirs;
binary = argv[arg_index];
@@ -88,11 +115,22 @@ int main(int argc, char **argv) {
debug_dirs.push_back(argv[debug_dir_index]);
}
- SymbolData symbol_data = cfi ? ALL_SYMBOL_DATA : NO_CFI;
- google_breakpad::DumpOptions options(symbol_data, handle_inter_cu_refs);
- if (!WriteSymbolFile(binary, debug_dirs, options, std::cout)) {
- fprintf(saved_stderr, "Failed to write symbol file.\n");
- return 1;
+ if (obj_name.empty())
+ obj_name = binary;
+
+ if (header_only) {
+ if (!WriteSymbolFileHeader(binary, obj_name, obj_os, std::cout)) {
+ fprintf(saved_stderr, "Failed to process file.\n");
+ return 1;
+ }
+ } else {
+ SymbolData symbol_data = cfi ? ALL_SYMBOL_DATA : NO_CFI;
+ google_breakpad::DumpOptions options(symbol_data, handle_inter_cu_refs);
+ if (!WriteSymbolFile(binary, obj_name, obj_os, debug_dirs, options,
+ std::cout)) {
+ fprintf(saved_stderr, "Failed to write symbol file.\n");
+ return 1;
+ }
}
return 0;
diff --git a/src/tools/linux/md2core/minidump-2-core.cc b/src/tools/linux/md2core/minidump-2-core.cc
index bcb0076e..a60be323 100644
--- a/src/tools/linux/md2core/minidump-2-core.cc
+++ b/src/tools/linux/md2core/minidump-2-core.cc
@@ -30,12 +30,10 @@
// Converts a minidump file to a core file which gdb can read.
// Large parts lifted from the userspace core dumper:
// http://code.google.com/p/google-coredumper/
-//
-// Usage: minidump-2-core [-v] 1234.dmp > core
#include <elf.h>
#include <errno.h>
-#include <inttypes.h>
+#include <limits.h>
#include <link.h>
#include <stdio.h>
#include <stdlib.h>
@@ -49,12 +47,15 @@
#include "common/linux/memory_mapped_file.h"
#include "common/minidump_type_helper.h"
+#include "common/path_helper.h"
#include "common/scoped_ptr.h"
+#include "common/using_std_string.h"
+#include "google_breakpad/common/breakpad_types.h"
#include "google_breakpad/common/minidump_format.h"
#include "third_party/lss/linux_syscall_support.h"
#include "tools/linux/md2core/minidump_memory_range.h"
-#if __WORDSIZE == 64
+#if ULONG_MAX == 0xffffffffffffffff
#define ELF_CLASS ELFCLASS64
#else
#define ELF_CLASS ELFCLASS32
@@ -74,6 +75,8 @@
#define ELF_ARCH EM_ARM
#elif defined(__mips__)
#define ELF_ARCH EM_MIPS
+#elif defined(__aarch64__)
+ #define ELF_ARCH EM_AARCH64
#endif
#if defined(__arm__)
@@ -81,6 +84,9 @@
// containing core registers, while they use 'user_regs_struct' on other
// architectures. This file-local typedef simplifies the source code.
typedef user_regs user_regs_struct;
+#elif defined (__mips__)
+// This file-local typedef simplifies the source code.
+typedef gregset_t user_regs_struct;
#endif
using google_breakpad::MDTypeHelper;
@@ -91,12 +97,105 @@ typedef MDTypeHelper<sizeof(ElfW(Addr))>::MDRawDebug MDRawDebug;
typedef MDTypeHelper<sizeof(ElfW(Addr))>::MDRawLinkMap MDRawLinkMap;
static const MDRVA kInvalidMDRVA = static_cast<MDRVA>(-1);
-static bool verbose;
-static std::string g_custom_so_basedir;
-static int usage(const char* argv0) {
- fprintf(stderr, "Usage: %s [-v] <minidump file>\n", argv0);
- return 1;
+struct Options {
+ string minidump_path;
+ bool verbose;
+ int out_fd;
+ bool use_filename;
+ bool inc_guid;
+ string so_basedir;
+};
+
+static void
+Usage(int argc, const char* argv[]) {
+ fprintf(stderr,
+ "Usage: %s [options] <minidump file>\n"
+ "\n"
+ "Convert a minidump file into a core file (often for use by gdb).\n"
+ "\n"
+ "The shared library list will by default have filenames as the runtime expects.\n"
+ "There are many flags to control the output names though to make it easier to\n"
+ "integrate with your debug environment (e.g. gdb).\n"
+ " Default: /lib64/libpthread.so.0\n"
+ " -f: /lib64/libpthread-2.19.so\n"
+ " -i: /lib64/<module id>-libpthread.so.0\n"
+ " -f -i: /lib64/<module id>-libpthread-2.19.so\n"
+ " -S /foo/: /foo/libpthread.so.0\n"
+ "\n"
+ "Options:\n"
+ " -v Enable verbose output\n"
+ " -o <file> Write coredump to specified file (otherwise use stdout).\n"
+ " -f Use the filename rather than the soname in the sharedlib list.\n"
+ " The soname is what the runtime system uses, but the filename is\n"
+ " how it's stored on disk.\n"
+ " -i Prefix sharedlib names with ID (when available). This makes it\n"
+ " easier to have a single directory full of symbols.\n"
+ " -S <dir> Set soname base directory. This will force all debug/symbol\n"
+ " lookups to be done in this directory rather than the filesystem\n"
+ " layout as it exists in the crashing image. This path should end\n"
+ " with a slash if it's a directory. e.g. /var/lib/breakpad/\n"
+ "", google_breakpad::BaseName(argv[0]).c_str());
+}
+
+static void
+SetupOptions(int argc, const char* argv[], Options* options) {
+ extern int optind;
+ int ch;
+ const char* output_file = NULL;
+
+ // Initialize the options struct as needed.
+ options->verbose = false;
+ options->use_filename = false;
+ options->inc_guid = false;
+
+ while ((ch = getopt(argc, (char * const *)argv, "fhio:S:v")) != -1) {
+ switch (ch) {
+ case 'h':
+ Usage(argc, argv);
+ exit(0);
+ break;
+ case '?':
+ Usage(argc, argv);
+ exit(1);
+ break;
+
+ case 'f':
+ options->use_filename = true;
+ break;
+ case 'i':
+ options->inc_guid = true;
+ break;
+ case 'o':
+ output_file = optarg;
+ break;
+ case 'S':
+ options->so_basedir = optarg;
+ break;
+ case 'v':
+ options->verbose = true;
+ break;
+ }
+ }
+
+ if ((argc - optind) != 1) {
+ fprintf(stderr, "%s: Missing minidump file\n", argv[0]);
+ Usage(argc, argv);
+ exit(1);
+ }
+
+ if (output_file == NULL || !strcmp(output_file, "-")) {
+ options->out_fd = STDOUT_FILENO;
+ } else {
+ options->out_fd = open(output_file, O_WRONLY|O_CREAT|O_TRUNC, 0664);
+ if (options->out_fd == -1) {
+ fprintf(stderr, "%s: could not open output %s: %s\n", argv[0],
+ output_file, strerror(errno));
+ exit(1);
+ }
+ }
+
+ options->minidump_path = argv[optind];
}
// Write all of the given buffer, handling short writes and EINTR. Return true
@@ -133,14 +232,14 @@ typedef struct elf_timeval { /* Time value with microsecond resolution */
long tv_usec; /* Microseconds */
} elf_timeval;
-typedef struct elf_siginfo { /* Information about signal (unused) */
+typedef struct _elf_siginfo { /* Information about signal (unused) */
int32_t si_signo; /* Signal number */
int32_t si_code; /* Extra code */
int32_t si_errno; /* Errno */
-} elf_siginfo;
+} _elf_siginfo;
typedef struct prstatus { /* Information about thread; includes CPU reg*/
- elf_siginfo pr_info; /* Info associated with signal */
+ _elf_siginfo pr_info; /* Info associated with signal */
uint16_t pr_cursig; /* Current signal */
unsigned long pr_sigpend; /* Set of pending signals */
unsigned long pr_sighold; /* Set of held signals */
@@ -198,8 +297,9 @@ struct CrashedProcess {
uint32_t permissions;
uint64_t start_address, end_address, offset;
- std::string filename;
- std::string data;
+ // The name we write out to the core.
+ string filename;
+ string data;
};
std::map<uint64_t, Mapping> mappings;
@@ -208,13 +308,20 @@ struct CrashedProcess {
struct Thread {
pid_t tid;
+#if defined(__mips__)
+ mcontext_t mcontext;
+#else
user_regs_struct regs;
-#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
+#endif
+#if defined(__i386__) || defined(__x86_64__)
user_fpregs_struct fpregs;
#endif
#if defined(__i386__)
user_fpxregs_struct fpxregs;
#endif
+#if defined(__aarch64__)
+ user_fpsimd_struct fpregs;
+#endif
uintptr_t stack_addr;
const uint8_t* stack;
size_t stack_length;
@@ -226,9 +333,15 @@ struct CrashedProcess {
prpsinfo prps;
- std::map<uintptr_t, std::string> signatures;
+ // The GUID/filename from MD_MODULE_LIST_STREAM entries.
+ // We gather them for merging later on into the list of maps.
+ struct Signature {
+ char guid[40];
+ string filename;
+ };
+ std::map<uintptr_t, Signature> signatures;
- std::string dynamic_data;
+ string dynamic_data;
MDRawDebug debug;
std::vector<MDRawLinkMap> link_map;
};
@@ -364,6 +477,33 @@ ParseThreadRegisters(CrashedProcess::Thread* thread,
thread->regs.uregs[16] = rawregs->cpsr;
thread->regs.uregs[17] = 0; // what is ORIG_r0 exactly?
}
+#elif defined(__aarch64__)
+static void
+ParseThreadRegisters(CrashedProcess::Thread* thread,
+ const MinidumpMemoryRange& range) {
+#define COPY_REGS(rawregs) \
+ do { \
+ for (int i = 0; i < 31; ++i) \
+ thread->regs.regs[i] = rawregs->iregs[i]; \
+ thread->regs.sp = rawregs->iregs[MD_CONTEXT_ARM64_REG_SP]; \
+ thread->regs.pc = rawregs->iregs[MD_CONTEXT_ARM64_REG_PC]; \
+ thread->regs.pstate = rawregs->cpsr; \
+ \
+ memcpy(thread->fpregs.vregs, rawregs->float_save.regs, 8 * 32); \
+ thread->fpregs.fpsr = rawregs->float_save.fpsr; \
+ thread->fpregs.fpcr = rawregs->float_save.fpcr; \
+ } while (false)
+
+ if (range.length() == sizeof(MDRawContextARM64_Old)) {
+ const MDRawContextARM64_Old* rawregs =
+ range.GetData<MDRawContextARM64_Old>(0);
+ COPY_REGS(rawregs);
+ } else {
+ const MDRawContextARM64* rawregs = range.GetData<MDRawContextARM64>(0);
+ COPY_REGS(rawregs);
+ }
+#undef COPY_REGS
+}
#elif defined(__mips__)
static void
ParseThreadRegisters(CrashedProcess::Thread* thread,
@@ -371,21 +511,28 @@ ParseThreadRegisters(CrashedProcess::Thread* thread,
const MDRawContextMIPS* rawregs = range.GetData<MDRawContextMIPS>(0);
for (int i = 0; i < MD_CONTEXT_MIPS_GPR_COUNT; ++i)
- thread->regs.regs[i] = rawregs->iregs[i];
+ thread->mcontext.gregs[i] = rawregs->iregs[i];
+
+ thread->mcontext.pc = rawregs->epc;
+
+ thread->mcontext.mdlo = rawregs->mdlo;
+ thread->mcontext.mdhi = rawregs->mdhi;
- thread->regs.lo = rawregs->mdlo;
- thread->regs.hi = rawregs->mdhi;
- thread->regs.epc = rawregs->epc;
- thread->regs.badvaddr = rawregs->badvaddr;
- thread->regs.status = rawregs->status;
- thread->regs.cause = rawregs->cause;
+ thread->mcontext.hi1 = rawregs->hi[0];
+ thread->mcontext.lo1 = rawregs->lo[0];
+ thread->mcontext.hi2 = rawregs->hi[1];
+ thread->mcontext.lo2 = rawregs->lo[1];
+ thread->mcontext.hi3 = rawregs->hi[2];
+ thread->mcontext.lo3 = rawregs->lo[2];
- for (int i = 0; i < MD_FLOATINGSAVEAREA_MIPS_FPR_COUNT; ++i)
- thread->fpregs.regs[i] = rawregs->float_save.regs[i];
+ for (int i = 0; i < MD_FLOATINGSAVEAREA_MIPS_FPR_COUNT; ++i) {
+ thread->mcontext.fpregs.fp_r.fp_fregs[i]._fp_fregs =
+ rawregs->float_save.regs[i];
+ }
- thread->fpregs.fpcsr = rawregs->float_save.fpcsr;
+ thread->mcontext.fpc_csr = rawregs->float_save.fpcsr;
#if _MIPS_SIM == _ABIO32
- thread->fpregs.fir = rawregs->float_save.fir;
+ thread->mcontext.fpc_eir = rawregs->float_save.fir;
#endif
}
#else
@@ -393,10 +540,11 @@ ParseThreadRegisters(CrashedProcess::Thread* thread,
#endif
static void
-ParseThreadList(CrashedProcess* crashinfo, const MinidumpMemoryRange& range,
+ParseThreadList(const Options& options, CrashedProcess* crashinfo,
+ const MinidumpMemoryRange& range,
const MinidumpMemoryRange& full_file) {
const uint32_t num_threads = *range.GetData<uint32_t>(0);
- if (verbose) {
+ if (options.verbose) {
fprintf(stderr,
"MD_THREAD_LIST_STREAM:\n"
"Found %d threads\n"
@@ -423,12 +571,13 @@ ParseThreadList(CrashedProcess* crashinfo, const MinidumpMemoryRange& range,
}
static void
-ParseSystemInfo(CrashedProcess* crashinfo, const MinidumpMemoryRange& range,
+ParseSystemInfo(const Options& options, CrashedProcess* crashinfo,
+ const MinidumpMemoryRange& range,
const MinidumpMemoryRange& full_file) {
const MDRawSystemInfo* sysinfo = range.GetData<MDRawSystemInfo>(0);
if (!sysinfo) {
fprintf(stderr, "Failed to access MD_SYSTEM_INFO_STREAM\n");
- _exit(1);
+ exit(1);
}
#if defined(__i386__)
if (sysinfo->processor_architecture != MD_CPU_ARCHITECTURE_X86) {
@@ -436,7 +585,7 @@ ParseSystemInfo(CrashedProcess* crashinfo, const MinidumpMemoryRange& range,
"This version of minidump-2-core only supports x86 (32bit)%s.\n",
sysinfo->processor_architecture == MD_CPU_ARCHITECTURE_AMD64 ?
",\nbut the minidump file is from a 64bit machine" : "");
- _exit(1);
+ exit(1);
}
#elif defined(__x86_64__)
if (sysinfo->processor_architecture != MD_CPU_ARCHITECTURE_AMD64) {
@@ -444,20 +593,36 @@ ParseSystemInfo(CrashedProcess* crashinfo, const MinidumpMemoryRange& range,
"This version of minidump-2-core only supports x86 (64bit)%s.\n",
sysinfo->processor_architecture == MD_CPU_ARCHITECTURE_X86 ?
",\nbut the minidump file is from a 32bit machine" : "");
- _exit(1);
+ exit(1);
}
#elif defined(__arm__)
if (sysinfo->processor_architecture != MD_CPU_ARCHITECTURE_ARM) {
fprintf(stderr,
"This version of minidump-2-core only supports ARM (32bit).\n");
- _exit(1);
+ exit(1);
+ }
+#elif defined(__aarch64__)
+ if (sysinfo->processor_architecture != MD_CPU_ARCHITECTURE_ARM64_OLD) {
+ fprintf(stderr,
+ "This version of minidump-2-core only supports ARM (64bit).\n");
+ exit(1);
}
#elif defined(__mips__)
+# if _MIPS_SIM == _ABIO32
if (sysinfo->processor_architecture != MD_CPU_ARCHITECTURE_MIPS) {
fprintf(stderr,
- "This version of minidump-2-core only supports mips (32bit).\n");
- _exit(1);
+ "This version of minidump-2-core only supports mips o32 (32bit).\n");
+ exit(1);
+ }
+# elif _MIPS_SIM == _ABI64
+ if (sysinfo->processor_architecture != MD_CPU_ARCHITECTURE_MIPS64) {
+ fprintf(stderr,
+ "This version of minidump-2-core only supports mips n64 (64bit).\n");
+ exit(1);
}
+# else
+# error "This mips ABI is currently not supported (n32)"
+# endif
#else
#error "This code has not been ported to your platform yet"
#endif
@@ -465,10 +630,10 @@ ParseSystemInfo(CrashedProcess* crashinfo, const MinidumpMemoryRange& range,
"Linux") &&
sysinfo->platform_id != MD_OS_NACL) {
fprintf(stderr, "This minidump was not generated by Linux or NaCl.\n");
- _exit(1);
+ exit(1);
}
- if (verbose) {
+ if (options.verbose) {
fprintf(stderr,
"MD_SYSTEM_INFO_STREAM:\n"
"Architecture: %s\n"
@@ -484,6 +649,8 @@ ParseSystemInfo(CrashedProcess* crashinfo, const MinidumpMemoryRange& range,
? "ARM"
: sysinfo->processor_architecture == MD_CPU_ARCHITECTURE_MIPS
? "MIPS"
+ : sysinfo->processor_architecture == MD_CPU_ARCHITECTURE_MIPS64
+ ? "MIPS64"
: "???",
sysinfo->number_of_processors,
sysinfo->processor_level,
@@ -507,8 +674,9 @@ ParseSystemInfo(CrashedProcess* crashinfo, const MinidumpMemoryRange& range,
}
static void
-ParseCPUInfo(CrashedProcess* crashinfo, const MinidumpMemoryRange& range) {
- if (verbose) {
+ParseCPUInfo(const Options& options, CrashedProcess* crashinfo,
+ const MinidumpMemoryRange& range) {
+ if (options.verbose) {
fputs("MD_LINUX_CPU_INFO:\n", stderr);
fwrite(range.data(), range.length(), 1, stderr);
fputs("\n\n\n", stderr);
@@ -516,9 +684,9 @@ ParseCPUInfo(CrashedProcess* crashinfo, const MinidumpMemoryRange& range) {
}
static void
-ParseProcessStatus(CrashedProcess* crashinfo,
+ParseProcessStatus(const Options& options, CrashedProcess* crashinfo,
const MinidumpMemoryRange& range) {
- if (verbose) {
+ if (options.verbose) {
fputs("MD_LINUX_PROC_STATUS:\n", stderr);
fwrite(range.data(), range.length(), 1, stderr);
fputs("\n\n", stderr);
@@ -526,8 +694,9 @@ ParseProcessStatus(CrashedProcess* crashinfo,
}
static void
-ParseLSBRelease(CrashedProcess* crashinfo, const MinidumpMemoryRange& range) {
- if (verbose) {
+ParseLSBRelease(const Options& options, CrashedProcess* crashinfo,
+ const MinidumpMemoryRange& range) {
+ if (options.verbose) {
fputs("MD_LINUX_LSB_RELEASE:\n", stderr);
fwrite(range.data(), range.length(), 1, stderr);
fputs("\n\n", stderr);
@@ -535,8 +704,9 @@ ParseLSBRelease(CrashedProcess* crashinfo, const MinidumpMemoryRange& range) {
}
static void
-ParseMaps(CrashedProcess* crashinfo, const MinidumpMemoryRange& range) {
- if (verbose) {
+ParseMaps(const Options& options, CrashedProcess* crashinfo,
+ const MinidumpMemoryRange& range) {
+ if (options.verbose) {
fputs("MD_LINUX_MAPS:\n", stderr);
fwrite(range.data(), range.length(), 1, stderr);
}
@@ -544,8 +714,8 @@ ParseMaps(CrashedProcess* crashinfo, const MinidumpMemoryRange& range) {
ptr < range.data() + range.length();) {
const uint8_t* eol = (uint8_t*)memchr(ptr, '\n',
range.data() + range.length() - ptr);
- std::string line((const char*)ptr,
- eol ? eol - ptr : range.data() + range.length() - ptr);
+ string line((const char*)ptr,
+ eol ? eol - ptr : range.data() + range.length() - ptr);
ptr = eol ? eol + 1 : range.data() + range.length();
unsigned long long start, stop, offset;
char* permissions = NULL;
@@ -575,14 +745,15 @@ ParseMaps(CrashedProcess* crashinfo, const MinidumpMemoryRange& range) {
free(permissions);
free(filename);
}
- if (verbose) {
+ if (options.verbose) {
fputs("\n\n\n", stderr);
}
}
static void
-ParseEnvironment(CrashedProcess* crashinfo, const MinidumpMemoryRange& range) {
- if (verbose) {
+ParseEnvironment(const Options& options, CrashedProcess* crashinfo,
+ const MinidumpMemoryRange& range) {
+ if (options.verbose) {
fputs("MD_LINUX_ENVIRON:\n", stderr);
char* env = new char[range.length()];
memcpy(env, range.data(), range.length());
@@ -619,7 +790,8 @@ ParseEnvironment(CrashedProcess* crashinfo, const MinidumpMemoryRange& range) {
}
static void
-ParseAuxVector(CrashedProcess* crashinfo, const MinidumpMemoryRange& range) {
+ParseAuxVector(const Options& options, CrashedProcess* crashinfo,
+ const MinidumpMemoryRange& range) {
// Some versions of Chrome erroneously used the MD_LINUX_AUXV stream value
// when dumping /proc/$x/maps
if (range.length() > 17) {
@@ -630,7 +802,7 @@ ParseAuxVector(CrashedProcess* crashinfo, const MinidumpMemoryRange& range) {
memcpy(addresses, range.data(), 17);
addresses[17] = '\000';
if (strspn(addresses, "0123456789abcdef-") == 17) {
- ParseMaps(crashinfo, range);
+ ParseMaps(options, crashinfo, range);
return;
}
}
@@ -640,12 +812,13 @@ ParseAuxVector(CrashedProcess* crashinfo, const MinidumpMemoryRange& range) {
}
static void
-ParseCmdLine(CrashedProcess* crashinfo, const MinidumpMemoryRange& range) {
+ParseCmdLine(const Options& options, CrashedProcess* crashinfo,
+ const MinidumpMemoryRange& range) {
// The command line is supposed to use NUL bytes to separate arguments.
// As Chrome rewrites its own command line and (incorrectly) substitutes
// spaces, this is often not the case in our minidump files.
const char* cmdline = (const char*) range.data();
- if (verbose) {
+ if (options.verbose) {
fputs("MD_LINUX_CMD_LINE:\n", stderr);
unsigned i = 0;
for (; i < range.length() && cmdline[i] && cmdline[i] != ' '; ++i) { }
@@ -688,13 +861,14 @@ ParseCmdLine(CrashedProcess* crashinfo, const MinidumpMemoryRange& range) {
}
static void
-ParseDSODebugInfo(CrashedProcess* crashinfo, const MinidumpMemoryRange& range,
+ParseDSODebugInfo(const Options& options, CrashedProcess* crashinfo,
+ const MinidumpMemoryRange& range,
const MinidumpMemoryRange& full_file) {
const MDRawDebug* debug = range.GetData<MDRawDebug>(0);
if (!debug) {
return;
}
- if (verbose) {
+ if (options.verbose) {
fprintf(stderr,
"MD_LINUX_DSO_DEBUG:\n"
"Version: %d\n"
@@ -719,7 +893,7 @@ ParseDSODebugInfo(CrashedProcess* crashinfo, const MinidumpMemoryRange& range,
const MDRawLinkMap* link_map =
full_file.GetArrayElement<MDRawLinkMap>(debug->map, i);
if (link_map) {
- if (verbose) {
+ if (options.verbose) {
fprintf(stderr,
"#%03d: %" PRIx64 ", %" PRIx64 ", \"%s\"\n",
i, static_cast<uint64_t>(link_map->addr),
@@ -730,13 +904,13 @@ ParseDSODebugInfo(CrashedProcess* crashinfo, const MinidumpMemoryRange& range,
}
}
}
- if (verbose) {
+ if (options.verbose) {
fputs("\n\n", stderr);
}
}
static void
-ParseExceptionStream(CrashedProcess* crashinfo,
+ParseExceptionStream(const Options& options, CrashedProcess* crashinfo,
const MinidumpMemoryRange& range) {
const MDRawExceptionStream* exp = range.GetData<MDRawExceptionStream>(0);
crashinfo->crashing_tid = exp->thread_id;
@@ -744,32 +918,37 @@ ParseExceptionStream(CrashedProcess* crashinfo,
}
static bool
-WriteThread(const CrashedProcess::Thread& thread, int fatal_signal) {
+WriteThread(const Options& options, const CrashedProcess::Thread& thread,
+ int fatal_signal) {
struct prstatus pr;
memset(&pr, 0, sizeof(pr));
pr.pr_info.si_signo = fatal_signal;
pr.pr_cursig = fatal_signal;
pr.pr_pid = thread.tid;
+#if defined(__mips__)
+ memcpy(&pr.pr_reg, &thread.mcontext.gregs, sizeof(user_regs_struct));
+#else
memcpy(&pr.pr_reg, &thread.regs, sizeof(user_regs_struct));
+#endif
Nhdr nhdr;
memset(&nhdr, 0, sizeof(nhdr));
nhdr.n_namesz = 5;
nhdr.n_descsz = sizeof(struct prstatus);
nhdr.n_type = NT_PRSTATUS;
- if (!writea(1, &nhdr, sizeof(nhdr)) ||
- !writea(1, "CORE\0\0\0\0", 8) ||
- !writea(1, &pr, sizeof(struct prstatus))) {
+ if (!writea(options.out_fd, &nhdr, sizeof(nhdr)) ||
+ !writea(options.out_fd, "CORE\0\0\0\0", 8) ||
+ !writea(options.out_fd, &pr, sizeof(struct prstatus))) {
return false;
}
#if defined(__i386__) || defined(__x86_64__)
nhdr.n_descsz = sizeof(user_fpregs_struct);
nhdr.n_type = NT_FPREGSET;
- if (!writea(1, &nhdr, sizeof(nhdr)) ||
- !writea(1, "CORE\0\0\0\0", 8) ||
- !writea(1, &thread.fpregs, sizeof(user_fpregs_struct))) {
+ if (!writea(options.out_fd, &nhdr, sizeof(nhdr)) ||
+ !writea(options.out_fd, "CORE\0\0\0\0", 8) ||
+ !writea(options.out_fd, &thread.fpregs, sizeof(user_fpregs_struct))) {
return false;
}
#endif
@@ -777,9 +956,9 @@ WriteThread(const CrashedProcess::Thread& thread, int fatal_signal) {
#if defined(__i386__)
nhdr.n_descsz = sizeof(user_fpxregs_struct);
nhdr.n_type = NT_PRXFPREG;
- if (!writea(1, &nhdr, sizeof(nhdr)) ||
- !writea(1, "LINUX\0\0\0", 8) ||
- !writea(1, &thread.fpxregs, sizeof(user_fpxregs_struct))) {
+ if (!writea(options.out_fd, &nhdr, sizeof(nhdr)) ||
+ !writea(options.out_fd, "LINUX\0\0\0", 8) ||
+ !writea(options.out_fd, &thread.fpxregs, sizeof(user_fpxregs_struct))) {
return false;
}
#endif
@@ -788,9 +967,10 @@ WriteThread(const CrashedProcess::Thread& thread, int fatal_signal) {
}
static void
-ParseModuleStream(CrashedProcess* crashinfo, const MinidumpMemoryRange& range,
+ParseModuleStream(const Options& options, CrashedProcess* crashinfo,
+ const MinidumpMemoryRange& range,
const MinidumpMemoryRange& full_file) {
- if (verbose) {
+ if (options.verbose) {
fputs("MD_MODULE_LIST_STREAM:\n", stderr);
}
const uint32_t num_mappings = *range.GetData<uint32_t>(0);
@@ -818,36 +998,29 @@ ParseModuleStream(CrashedProcess* crashinfo, const MinidumpMemoryRange& range,
record->signature.data4[2], record->signature.data4[3],
record->signature.data4[4], record->signature.data4[5],
record->signature.data4[6], record->signature.data4[7]);
- std::string filename =
- full_file.GetAsciiMDString(rawmodule->module_name_rva);
- size_t slash = filename.find_last_of('/');
- std::string basename = slash == std::string::npos ?
- filename : filename.substr(slash + 1);
- if (strcmp(guid, "00000000-0000-0000-0000-000000000000")) {
- std::string prefix;
- if (!g_custom_so_basedir.empty())
- prefix = g_custom_so_basedir;
- else
- prefix = std::string("/var/lib/breakpad/") + guid + "-" + basename;
-
- crashinfo->signatures[rawmodule->base_of_image] = prefix + basename;
- }
- if (verbose) {
- fprintf(stderr, "0x%08llX-0x%08llX, ChkSum: 0x%08X, GUID: %s, \"%s\"\n",
- (unsigned long long)rawmodule->base_of_image,
- (unsigned long long)rawmodule->base_of_image +
- rawmodule->size_of_image,
+ string filename = full_file.GetAsciiMDString(rawmodule->module_name_rva);
+
+ CrashedProcess::Signature signature;
+ strcpy(signature.guid, guid);
+ signature.filename = filename;
+ crashinfo->signatures[rawmodule->base_of_image] = signature;
+
+ if (options.verbose) {
+ fprintf(stderr, "0x%" PRIx64 "-0x%" PRIx64 ", ChkSum: 0x%08X, GUID: %s, "
+ " \"%s\"\n",
+ rawmodule->base_of_image,
+ rawmodule->base_of_image + rawmodule->size_of_image,
rawmodule->checksum, guid, filename.c_str());
}
}
- if (verbose) {
+ if (options.verbose) {
fputs("\n\n", stderr);
}
}
static void
-AddDataToMapping(CrashedProcess* crashinfo, const std::string& data,
+AddDataToMapping(CrashedProcess* crashinfo, const string& data,
uintptr_t addr) {
for (std::map<uint64_t, CrashedProcess::Mapping>::iterator
iter = crashinfo->mappings.begin();
@@ -896,14 +1069,14 @@ AddDataToMapping(CrashedProcess* crashinfo, const std::string& data,
}
static void
-AugmentMappings(CrashedProcess* crashinfo,
+AugmentMappings(const Options& options, CrashedProcess* crashinfo,
const MinidumpMemoryRange& full_file) {
// For each thread, find the memory mapping that matches the thread's stack.
// Then adjust the mapping to include the stack dump.
for (unsigned i = 0; i < crashinfo->threads.size(); ++i) {
const CrashedProcess::Thread& thread = crashinfo->threads[i];
AddDataToMapping(crashinfo,
- std::string((char *)thread.stack, thread.stack_length),
+ string((char *)thread.stack, thread.stack_length),
thread.stack_addr);
}
@@ -911,7 +1084,7 @@ AugmentMappings(CrashedProcess* crashinfo,
// the beginning of the address space, as this area should always be
// available.
static const uintptr_t start_addr = 4096;
- std::string data;
+ string data;
struct r_debug debug = { 0 };
debug.r_version = crashinfo->debug.version;
debug.r_brk = (ElfW(Addr))crashinfo->debug.brk;
@@ -931,14 +1104,58 @@ AugmentMappings(CrashedProcess* crashinfo,
link_map.l_ld = (ElfW(Dyn)*)iter->ld;
link_map.l_prev = prev;
prev = (struct link_map*)(start_addr + data.size());
- std::string filename = full_file.GetAsciiMDString(iter->name);
+ string filename = full_file.GetAsciiMDString(iter->name);
// Look up signature for this filename. If available, change filename
// to point to GUID, instead.
- std::map<uintptr_t, std::string>::const_iterator guid =
+ std::map<uintptr_t, CrashedProcess::Signature>::const_iterator sig =
crashinfo->signatures.find((uintptr_t)iter->addr);
- if (guid != crashinfo->signatures.end()) {
- filename = guid->second;
+ if (sig != crashinfo->signatures.end()) {
+ // At this point, we have:
+ // old_filename: The path as found via SONAME (e.g. /lib/libpthread.so.0).
+ // sig_filename: The path on disk (e.g. /lib/libpthread-2.19.so).
+ const char* guid = sig->second.guid;
+ string sig_filename = sig->second.filename;
+ string old_filename = filename.empty() ? sig_filename : filename;
+ string new_filename;
+
+ // First set up the leading path. We assume dirname always ends with a
+ // trailing slash (as needed), so we won't be appending one manually.
+ if (options.so_basedir.empty()) {
+ string dirname;
+ if (options.use_filename) {
+ dirname = sig_filename;
+ } else {
+ dirname = old_filename;
+ }
+ size_t slash = dirname.find_last_of('/');
+ if (slash != string::npos) {
+ new_filename = dirname.substr(0, slash + 1);
+ }
+ } else {
+ new_filename = options.so_basedir;
+ }
+
+ // Insert the module ID if requested.
+ if (options.inc_guid &&
+ strcmp(guid, "00000000-0000-0000-0000-000000000000") != 0) {
+ new_filename += guid;
+ new_filename += "-";
+ }
+
+ // Decide whether we use the filename or the SONAME (where the SONAME tends
+ // to be a symlink to the actual file).
+ new_filename += google_breakpad::BaseName(
+ options.use_filename ? sig_filename : old_filename);
+
+ if (filename != new_filename) {
+ if (options.verbose) {
+ fprintf(stderr, "0x%" PRIx64": rewriting mapping \"%s\" to \"%s\"\n",
+ static_cast<uint64_t>(link_map.l_addr),
+ filename.c_str(), new_filename.c_str());
+ }
+ filename = new_filename;
+ }
}
if (std::distance(iter, crashinfo->link_map.end()) == 1) {
@@ -961,7 +1178,7 @@ AugmentMappings(CrashedProcess* crashinfo,
ElfW(Dyn) dyn;
if ((i+1)*sizeof(dyn) > crashinfo->dynamic_data.length()) {
no_dt_debug:
- if (verbose) {
+ if (options.verbose) {
fprintf(stderr, "No DT_DEBUG entry found\n");
}
return;
@@ -984,31 +1201,14 @@ AugmentMappings(CrashedProcess* crashinfo,
}
int
-main(int argc, char** argv) {
- int argi = 1;
- while (argi < argc && argv[argi][0] == '-') {
- if (!strcmp(argv[argi], "-v")) {
- verbose = true;
- } else if (!strcmp(argv[argi], "--sobasedir")) {
- argi++;
- if (argi >= argc) {
- fprintf(stderr, "--sobasedir expects an argument.");
- return usage(argv[0]);
- }
-
- g_custom_so_basedir = argv[argi];
- } else {
- return usage(argv[0]);
- }
- argi++;
- }
-
- if (argc != argi + 1)
- return usage(argv[0]);
+main(int argc, const char* argv[]) {
+ Options options;
+ SetupOptions(argc, argv, &options);
- MemoryMappedFile mapped_file(argv[argi], 0);
+ MemoryMappedFile mapped_file(options.minidump_path.c_str(), 0);
if (!mapped_file.data()) {
- fprintf(stderr, "Failed to mmap dump file\n");
+ fprintf(stderr, "Failed to mmap dump file: %s: %s\n",
+ options.minidump_path.c_str(), strerror(errno));
return 1;
}
@@ -1026,7 +1226,8 @@ main(int argc, char** argv) {
dump.GetArrayElement<MDRawDirectory>(header->stream_directory_rva, i);
switch (dirent->stream_type) {
case MD_SYSTEM_INFO_STREAM:
- ParseSystemInfo(&crashinfo, dump.Subrange(dirent->location), dump);
+ ParseSystemInfo(options, &crashinfo, dump.Subrange(dirent->location),
+ dump);
ok = true;
break;
default:
@@ -1035,7 +1236,7 @@ main(int argc, char** argv) {
}
if (!ok) {
fprintf(stderr, "Cannot determine input file format.\n");
- _exit(1);
+ exit(1);
}
for (unsigned i = 0; i < header->stream_count; ++i) {
@@ -1043,45 +1244,50 @@ main(int argc, char** argv) {
dump.GetArrayElement<MDRawDirectory>(header->stream_directory_rva, i);
switch (dirent->stream_type) {
case MD_THREAD_LIST_STREAM:
- ParseThreadList(&crashinfo, dump.Subrange(dirent->location), dump);
+ ParseThreadList(options, &crashinfo, dump.Subrange(dirent->location),
+ dump);
break;
case MD_LINUX_CPU_INFO:
- ParseCPUInfo(&crashinfo, dump.Subrange(dirent->location));
+ ParseCPUInfo(options, &crashinfo, dump.Subrange(dirent->location));
break;
case MD_LINUX_PROC_STATUS:
- ParseProcessStatus(&crashinfo, dump.Subrange(dirent->location));
+ ParseProcessStatus(options, &crashinfo,
+ dump.Subrange(dirent->location));
break;
case MD_LINUX_LSB_RELEASE:
- ParseLSBRelease(&crashinfo, dump.Subrange(dirent->location));
+ ParseLSBRelease(options, &crashinfo, dump.Subrange(dirent->location));
break;
case MD_LINUX_ENVIRON:
- ParseEnvironment(&crashinfo, dump.Subrange(dirent->location));
+ ParseEnvironment(options, &crashinfo, dump.Subrange(dirent->location));
break;
case MD_LINUX_MAPS:
- ParseMaps(&crashinfo, dump.Subrange(dirent->location));
+ ParseMaps(options, &crashinfo, dump.Subrange(dirent->location));
break;
case MD_LINUX_AUXV:
- ParseAuxVector(&crashinfo, dump.Subrange(dirent->location));
+ ParseAuxVector(options, &crashinfo, dump.Subrange(dirent->location));
break;
case MD_LINUX_CMD_LINE:
- ParseCmdLine(&crashinfo, dump.Subrange(dirent->location));
+ ParseCmdLine(options, &crashinfo, dump.Subrange(dirent->location));
break;
case MD_LINUX_DSO_DEBUG:
- ParseDSODebugInfo(&crashinfo, dump.Subrange(dirent->location), dump);
+ ParseDSODebugInfo(options, &crashinfo, dump.Subrange(dirent->location),
+ dump);
break;
case MD_EXCEPTION_STREAM:
- ParseExceptionStream(&crashinfo, dump.Subrange(dirent->location));
+ ParseExceptionStream(options, &crashinfo,
+ dump.Subrange(dirent->location));
break;
case MD_MODULE_LIST_STREAM:
- ParseModuleStream(&crashinfo, dump.Subrange(dirent->location), dump);
+ ParseModuleStream(options, &crashinfo, dump.Subrange(dirent->location),
+ dump);
break;
default:
- if (verbose)
+ if (options.verbose)
fprintf(stderr, "Skipping %x\n", dirent->stream_type);
}
}
- AugmentMappings(&crashinfo, dump);
+ AugmentMappings(options, &crashinfo, dump);
// Write the ELF header. The file will look like:
// ELF header
@@ -1107,7 +1313,7 @@ main(int argc, char** argv) {
ehdr.e_phnum = 1 + // PT_NOTE
crashinfo.mappings.size(); // memory mappings
ehdr.e_shentsize= sizeof(Shdr);
- if (!writea(1, &ehdr, sizeof(Ehdr)))
+ if (!writea(options.out_fd, &ehdr, sizeof(Ehdr)))
return 1;
size_t offset = sizeof(Ehdr) + ehdr.e_phnum * sizeof(Phdr);
@@ -1129,7 +1335,7 @@ main(int argc, char** argv) {
phdr.p_type = PT_NOTE;
phdr.p_offset = offset;
phdr.p_filesz = filesz;
- if (!writea(1, &phdr, sizeof(phdr)))
+ if (!writea(options.out_fd, &phdr, sizeof(phdr)))
return 1;
phdr.p_type = PT_LOAD;
@@ -1162,7 +1368,7 @@ main(int argc, char** argv) {
phdr.p_filesz = 0;
phdr.p_offset = 0;
}
- if (!writea(1, &phdr, sizeof(phdr)))
+ if (!writea(options.out_fd, &phdr, sizeof(phdr)))
return 1;
}
@@ -1171,36 +1377,36 @@ main(int argc, char** argv) {
nhdr.n_namesz = 5;
nhdr.n_descsz = sizeof(prpsinfo);
nhdr.n_type = NT_PRPSINFO;
- if (!writea(1, &nhdr, sizeof(nhdr)) ||
- !writea(1, "CORE\0\0\0\0", 8) ||
- !writea(1, &crashinfo.prps, sizeof(prpsinfo))) {
+ if (!writea(options.out_fd, &nhdr, sizeof(nhdr)) ||
+ !writea(options.out_fd, "CORE\0\0\0\0", 8) ||
+ !writea(options.out_fd, &crashinfo.prps, sizeof(prpsinfo))) {
return 1;
}
nhdr.n_descsz = crashinfo.auxv_length;
nhdr.n_type = NT_AUXV;
- if (!writea(1, &nhdr, sizeof(nhdr)) ||
- !writea(1, "CORE\0\0\0\0", 8) ||
- !writea(1, crashinfo.auxv, crashinfo.auxv_length)) {
+ if (!writea(options.out_fd, &nhdr, sizeof(nhdr)) ||
+ !writea(options.out_fd, "CORE\0\0\0\0", 8) ||
+ !writea(options.out_fd, crashinfo.auxv, crashinfo.auxv_length)) {
return 1;
}
for (unsigned i = 0; i < crashinfo.threads.size(); ++i) {
if (crashinfo.threads[i].tid == crashinfo.crashing_tid) {
- WriteThread(crashinfo.threads[i], crashinfo.fatal_signal);
+ WriteThread(options, crashinfo.threads[i], crashinfo.fatal_signal);
break;
}
}
for (unsigned i = 0; i < crashinfo.threads.size(); ++i) {
if (crashinfo.threads[i].tid != crashinfo.crashing_tid)
- WriteThread(crashinfo.threads[i], 0);
+ WriteThread(options, crashinfo.threads[i], 0);
}
if (note_align) {
google_breakpad::scoped_array<char> scratch(new char[note_align]);
memset(scratch.get(), 0, note_align);
- if (!writea(1, scratch.get(), note_align))
+ if (!writea(options.out_fd, scratch.get(), note_align))
return 1;
}
@@ -1209,10 +1415,14 @@ main(int argc, char** argv) {
iter != crashinfo.mappings.end(); ++iter) {
const CrashedProcess::Mapping& mapping = iter->second;
if (mapping.data.size()) {
- if (!writea(1, mapping.data.c_str(), mapping.data.size()))
+ if (!writea(options.out_fd, mapping.data.c_str(), mapping.data.size()))
return 1;
}
}
+ if (options.out_fd != STDOUT_FILENO) {
+ close(options.out_fd);
+ }
+
return 0;
}
diff --git a/src/tools/linux/symupload/minidump_upload.cc b/src/tools/linux/symupload/minidump_upload.cc
index 94c3492c..19f17450 100644
--- a/src/tools/linux/symupload/minidump_upload.cc
+++ b/src/tools/linux/symupload/minidump_upload.cc
@@ -62,12 +62,14 @@ static void Start(Options *options) {
parameters["prod"] = options->product;
parameters["ver"] = options->version;
+ std::map<string, string> files;
+ files["upload_file_minidump"] = options->minidumpPath;
+
// Send it
string response, error;
bool success = HTTPUpload::SendRequest(options->uploadURLStr,
parameters,
- options->minidumpPath,
- "upload_file_minidump",
+ files,
options->proxy,
options->proxy_user_pwd,
"",
diff --git a/src/tools/linux/symupload/sym_upload.cc b/src/tools/linux/symupload/sym_upload.cc
index 09e82ca9..f155eb95 100644
--- a/src/tools/linux/symupload/sym_upload.cc
+++ b/src/tools/linux/symupload/sym_upload.cc
@@ -39,149 +39,73 @@
// cpu: the CPU that the module was built for
// symbol_file: the contents of the breakpad-format symbol file
-#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <unistd.h>
-#include <functional>
-#include <iostream>
-#include <string>
-#include <vector>
+#include <locale>
-#include "common/linux/http_upload.h"
-#include "common/using_std_string.h"
+#include "common/linux/symbol_upload.h"
-using google_breakpad::HTTPUpload;
+using google_breakpad::sym_upload::UploadProtocol;
+using google_breakpad::sym_upload::Options;
-typedef struct {
- string symbolsPath;
- string uploadURLStr;
- string proxy;
- string proxy_user_pwd;
- string version;
- bool success;
-} Options;
-
-static void TokenizeByChar(const string &source_string,
- int c, std::vector<string> *results) {
- assert(results);
- string::size_type cur_pos = 0, next_pos = 0;
- while ((next_pos = source_string.find(c, cur_pos)) != string::npos) {
- if (next_pos != cur_pos)
- results->push_back(source_string.substr(cur_pos, next_pos - cur_pos));
- cur_pos = next_pos + 1;
- }
- if (cur_pos < source_string.size() && next_pos != cur_pos)
- results->push_back(source_string.substr(cur_pos));
-}
-
-//=============================================================================
-// Parse out the module line which have 5 parts.
-// MODULE <os> <cpu> <uuid> <module-name>
-static bool ModuleDataForSymbolFile(const string &file,
- std::vector<string> *module_parts) {
- assert(module_parts);
- const size_t kModulePartNumber = 5;
- FILE* fp = fopen(file.c_str(), "r");
- if (fp) {
- char buffer[1024];
- if (fgets(buffer, sizeof(buffer), fp)) {
- string line(buffer);
- string::size_type line_break_pos = line.find_first_of('\n');
- if (line_break_pos == string::npos) {
- assert(0 && "The file is invalid!");
- fclose(fp);
- return false;
- }
- line.resize(line_break_pos);
- const char kDelimiter = ' ';
- TokenizeByChar(line, kDelimiter, module_parts);
- if (module_parts->size() != kModulePartNumber)
- module_parts->clear();
- }
- fclose(fp);
- }
-
- return module_parts->size() == kModulePartNumber;
-}
-
-//=============================================================================
-static string CompactIdentifier(const string &uuid) {
- std::vector<string> components;
- TokenizeByChar(uuid, '-', &components);
- string result;
- for (size_t i = 0; i < components.size(); ++i)
- result += components[i];
- return result;
-}
-
-//=============================================================================
-static void Start(Options *options) {
- std::map<string, string> parameters;
- options->success = false;
- std::vector<string> module_parts;
- if (!ModuleDataForSymbolFile(options->symbolsPath, &module_parts)) {
- fprintf(stderr, "Failed to parse symbol file!\n");
- return;
+static void StrToUpper(std::string* str) {
+ if (str == nullptr) {
+ fprintf(stderr, "nullptr passed to StrToUpper.\n");
+ exit(1);
}
-
- string compacted_id = CompactIdentifier(module_parts[3]);
-
- // Add parameters
- if (!options->version.empty())
- parameters["version"] = options->version;
-
- // MODULE <os> <cpu> <uuid> <module-name>
- // 0 1 2 3 4
- parameters["os"] = module_parts[1];
- parameters["cpu"] = module_parts[2];
- parameters["debug_file"] = module_parts[4];
- parameters["code_file"] = module_parts[4];
- parameters["debug_identifier"] = compacted_id;
- string response, error;
- long response_code;
- bool success = HTTPUpload::SendRequest(options->uploadURLStr,
- parameters,
- options->symbolsPath,
- "symbol_file",
- options->proxy,
- options->proxy_user_pwd,
- "",
- &response,
- &response_code,
- &error);
-
- if (!success) {
- printf("Failed to send symbol file: %s\n", error.c_str());
- printf("Response code: %ld\n", response_code);
- printf("Response:\n");
- printf("%s\n", response.c_str());
- } else if (response_code == 0) {
- printf("Failed to send symbol file: No response code\n");
- } else if (response_code != 200) {
- printf("Failed to send symbol file: Response code %ld\n", response_code);
- printf("Response:\n");
- printf("%s\n", response.c_str());
- } else {
- printf("Successfully sent the symbol file.\n");
+ for (size_t i = 0; i < str->length(); i++) {
+ (*str)[i] = std::toupper((*str)[i], std::locale::classic());
}
- options->success = success;
}
//=============================================================================
static void
Usage(int argc, const char *argv[]) {
fprintf(stderr, "Submit symbol information.\n");
- fprintf(stderr, "Usage: %s [options...] <symbols> <upload-URL>\n", argv[0]);
+ fprintf(stderr, "Usage: %s [options...] <symbol-file> <upload-URL>\n",
+ argv[0]);
fprintf(stderr, "Options:\n");
- fprintf(stderr, "<symbols> should be created by using the dump_syms tool.\n");
+ fprintf(stderr, "<symbol-file> should be created by using the dump_syms"
+ "tool.\n");
fprintf(stderr, "<upload-URL> is the destination for the upload\n");
+ fprintf(stderr, "-p:\t <protocol> One of ['sym-upload-v1',"
+ " 'sym-upload-v2'], defaults to 'sym-upload-v1'.\n");
fprintf(stderr, "-v:\t Version information (e.g., 1.2.3.4)\n");
fprintf(stderr, "-x:\t <host[:port]> Use HTTP proxy on given port\n");
fprintf(stderr, "-u:\t <user[:password]> Set proxy user and password\n");
fprintf(stderr, "-h:\t Usage\n");
fprintf(stderr, "-?:\t Usage\n");
+ fprintf(stderr, "\n");
+ fprintf(stderr, "These options only work with 'sym-upload-v2' protocol:\n");
+ fprintf(stderr, "-k:\t <API-key> A secret used to authenticate with the"
+ " API.\n");
+ fprintf(stderr, "-f:\t Force symbol upload if already exists.\n");
+ fprintf(stderr, "-t:\t <symbol-type> Explicitly set symbol upload type ("
+ "default is 'breakpad').\n"
+ "\t One of ['breakpad', 'elf', 'pe', 'macho', 'debug_only', 'dwp', "
+ "'dsym', 'pdb'].\n"
+ "\t Note: When this flag is set to anything other than 'breakpad', then "
+ "the '-c' and '-i' flags must also be set.\n");
+ fprintf(stderr, "-c:\t <code-file> Explicitly set 'code_file' for symbol "
+ "upload (basename of executable).\n");
+ fprintf(stderr, "-i:\t <debug-id> Explicitly set 'debug_id' for symbol "
+ "upload (typically build ID of executable).\n");
+ fprintf(stderr, "\n");
+ fprintf(stderr, "Examples:\n");
+ fprintf(stderr, " With 'sym-upload-v1':\n");
+ fprintf(stderr, " %s path/to/symbol_file http://myuploadserver\n",
+ argv[0]);
+ fprintf(stderr, " With 'sym-upload-v2':\n");
+ fprintf(stderr, " [Defaulting to symbol type 'BREAKPAD']\n");
+ fprintf(stderr, " %s -p sym-upload-v2 -k mysecret123! "
+ "path/to/symbol_file http://myuploadserver\n", argv[0]);
+ fprintf(stderr, " [Explicitly set symbol type to 'elf']\n");
+ fprintf(stderr, " %s -p sym-upload-v2 -k mysecret123! -t elf "
+ "-c app -i 11111111BBBB3333DDDD555555555555F "
+ "path/to/symbol_file http://myuploadserver\n", argv[0]);
}
//=============================================================================
@@ -189,9 +113,15 @@ static void
SetupOptions(int argc, const char *argv[], Options *options) {
extern int optind;
int ch;
+ constexpr char flag_pattern[] = "u:v:x:p:k:t:c:i:hf?";
- while ((ch = getopt(argc, (char * const *)argv, "u:v:x:h?")) != -1) {
+ while ((ch = getopt(argc, (char * const *)argv, flag_pattern)) != -1) {
switch (ch) {
+ case 'h':
+ case '?':
+ Usage(argc, argv);
+ exit(0);
+ break;
case 'u':
options->proxy_user_pwd = optarg;
break;
@@ -201,6 +131,36 @@ SetupOptions(int argc, const char *argv[], Options *options) {
case 'x':
options->proxy = optarg;
break;
+ case 'p':
+ if (strcmp(optarg, "sym-upload-v2") == 0) {
+ options->upload_protocol = UploadProtocol::SYM_UPLOAD_V2;
+ } else if (strcmp(optarg, "sym-upload-v1") == 0) {
+ options->upload_protocol = UploadProtocol::SYM_UPLOAD_V1;
+ } else {
+ fprintf(stderr, "Invalid protocol '%s'\n", optarg);
+ Usage(argc, argv);
+ exit(1);
+ }
+ break;
+ case 'k':
+ options->api_key = optarg;
+ break;
+ case 't': {
+ // This is really an enum, so treat as upper-case for consistency with
+ // enum naming convention on server-side.
+ options->type = optarg;
+ StrToUpper(&(options->type));
+ break;
+ }
+ case 'c':
+ options->code_file = optarg;
+ break;
+ case 'i':
+ options->debug_id = optarg;
+ break;
+ case 'f':
+ options->force = true;
+ break;
default:
fprintf(stderr, "Invalid option '%c'\n", ch);
@@ -216,6 +176,27 @@ SetupOptions(int argc, const char *argv[], Options *options) {
exit(1);
}
+ bool is_breakpad_upload = options->type.empty() ||
+ options->type == google_breakpad::sym_upload::kBreakpadSymbolType;
+ bool has_code_file = !options->code_file.empty();
+ bool has_debug_id = !options->debug_id.empty();
+ if (is_breakpad_upload && (has_code_file || has_debug_id)) {
+ fprintf(stderr, "\n");
+ fprintf(stderr, "%s: -c and -i should only be specified for non-breakpad "
+ "symbol upload types.\n", argv[0]);
+ fprintf(stderr, "\n");
+ Usage(argc, argv);
+ exit(1);
+ }
+ if (!is_breakpad_upload && (!has_code_file || !has_debug_id)) {
+ fprintf(stderr, "\n");
+ fprintf(stderr, "%s: -c and -i must be specified for non-breakpad "
+ "symbol upload types.\n", argv[0]);
+ fprintf(stderr, "\n");
+ Usage(argc, argv);
+ exit(1);
+ }
+
options->symbolsPath = argv[optind];
options->uploadURLStr = argv[optind + 1];
}
@@ -224,6 +205,6 @@ SetupOptions(int argc, const char *argv[], Options *options) {
int main(int argc, const char* argv[]) {
Options options;
SetupOptions(argc, argv, &options);
- Start(&options);
+ google_breakpad::sym_upload::Start(&options);
return options.success ? 0 : 1;
}
diff --git a/src/tools/linux/tools_linux.gypi b/src/tools/linux/tools_linux.gypi
index 1c15992e..020e4c1c 100644
--- a/src/tools/linux/tools_linux.gypi
+++ b/src/tools/linux/tools_linux.gypi
@@ -58,7 +58,7 @@
'target_name': 'minidump_upload',
'type': 'executable',
'sources': [
- 'symupload/minidump_upload.m',
+ 'symupload/minidump_upload.cc',
],
'dependencies': [
'../common/common.gyp:common',
diff --git a/src/tools/mac/crash_report/crash_report.xcodeproj/project.pbxproj b/src/tools/mac/crash_report/crash_report.xcodeproj/project.pbxproj
index d32837cb..33204f7e 100644
--- a/src/tools/mac/crash_report/crash_report.xcodeproj/project.pbxproj
+++ b/src/tools/mac/crash_report/crash_report.xcodeproj/project.pbxproj
@@ -8,6 +8,8 @@
/* Begin PBXBuildFile section */
162F64FE161C5ECB00CD68D5 /* arch_utilities.cc in Sources */ = {isa = PBXBuildFile; fileRef = 162F64FC161C5ECB00CD68D5 /* arch_utilities.cc */; };
+ 4214B800211109A600B769FA /* convert_old_arm64_context.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4214B7FE211109A600B769FA /* convert_old_arm64_context.cc */; };
+ 4247E6402110D5A500482558 /* path_helper.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4247E63F2110D5A500482558 /* path_helper.cc */; };
4D2C721B126F9ACC00B43EAF /* source_line_resolver_base.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D2C721A126F9ACC00B43EAF /* source_line_resolver_base.cc */; };
4D2C721F126F9ADE00B43EAF /* exploitability.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D2C721E126F9ADE00B43EAF /* exploitability.cc */; };
4D2C7223126F9AF900B43EAF /* exploitability_win.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D2C7222126F9AF900B43EAF /* exploitability_win.cc */; };
@@ -50,7 +52,7 @@
9BDF175D0B1B8C1B00F8391B /* process_state.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9BDF175B0B1B8C1B00F8391B /* process_state.cc */; };
9BDF176E0B1B8CB100F8391B /* on_demand_symbol_supplier.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9BDF176C0B1B8CB100F8391B /* on_demand_symbol_supplier.mm */; };
9BDF1A280B1BD58200F8391B /* pathname_stripper.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9BDF1A270B1BD58200F8391B /* pathname_stripper.cc */; };
- 9BDF21A70B1E825400F8391B /* dump_syms.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9BDF192E0B1BC15D00F8391B /* dump_syms.mm */; };
+ 9BDF21A70B1E825400F8391B /* dump_syms.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9BDF192E0B1BC15D00F8391B /* dump_syms.cc */; };
9BE650B20B52FE3000611104 /* file_id.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9BE650AC0B52FE3000611104 /* file_id.cc */; };
9BE650B40B52FE3000611104 /* macho_id.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9BE650AE0B52FE3000611104 /* macho_id.cc */; };
9BE650B60B52FE3000611104 /* macho_walker.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9BE650B00B52FE3000611104 /* macho_walker.cc */; };
@@ -64,6 +66,9 @@
F44DDD8719C85CD50047280E /* dump_context.cc in Sources */ = {isa = PBXBuildFile; fileRef = F44DDD8419C85CD50047280E /* dump_context.cc */; };
F44DDD8819C85CD50047280E /* dump_object.cc in Sources */ = {isa = PBXBuildFile; fileRef = F44DDD8519C85CD50047280E /* dump_object.cc */; };
F44DDD8919C85CD50047280E /* microdump_processor.cc in Sources */ = {isa = PBXBuildFile; fileRef = F44DDD8619C85CD50047280E /* microdump_processor.cc */; };
+ F47180561D745DEF0032F208 /* elf_reader.cc in Sources */ = {isa = PBXBuildFile; fileRef = F47180541D745DEF0032F208 /* elf_reader.cc */; };
+ F47180581D7467630032F208 /* proc_maps_linux.cc in Sources */ = {isa = PBXBuildFile; fileRef = F47180571D7467630032F208 /* proc_maps_linux.cc */; };
+ F471805A1D7468A40032F208 /* symbolic_constants_win.cc in Sources */ = {isa = PBXBuildFile; fileRef = F47180591D7468A40032F208 /* symbolic_constants_win.cc */; };
F4D43B2F1A38490700C290B2 /* microdump.cc in Sources */ = {isa = PBXBuildFile; fileRef = F4D43B2E1A38490700C290B2 /* microdump.cc */; };
F9C7ECE50E8ABCA600E953AD /* bytereader.cc in Sources */ = {isa = PBXBuildFile; fileRef = F9C7ECE20E8ABCA600E953AD /* bytereader.cc */; };
F9C7ECE60E8ABCA600E953AD /* dwarf2reader.cc in Sources */ = {isa = PBXBuildFile; fileRef = F9C7ECE30E8ABCA600E953AD /* dwarf2reader.cc */; };
@@ -78,6 +83,10 @@
08FB779EFE84155DC02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
162F64FC161C5ECB00CD68D5 /* arch_utilities.cc */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = arch_utilities.cc; path = ../../../common/mac/arch_utilities.cc; sourceTree = "<group>"; };
162F64FD161C5ECB00CD68D5 /* arch_utilities.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = arch_utilities.h; path = ../../../common/mac/arch_utilities.h; sourceTree = "<group>"; };
+ 4214B7FE211109A600B769FA /* convert_old_arm64_context.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = convert_old_arm64_context.cc; path = ../../../processor/convert_old_arm64_context.cc; sourceTree = "<group>"; };
+ 4214B7FF211109A600B769FA /* convert_old_arm64_context.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = convert_old_arm64_context.h; path = ../../../processor/convert_old_arm64_context.h; sourceTree = "<group>"; };
+ 4247E63E2110D5A500482558 /* path_helper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = path_helper.h; path = ../../../common/path_helper.h; sourceTree = "<group>"; };
+ 4247E63F2110D5A500482558 /* path_helper.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = path_helper.cc; path = ../../../common/path_helper.cc; sourceTree = "<group>"; };
4D2C721A126F9ACC00B43EAF /* source_line_resolver_base.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = source_line_resolver_base.cc; path = ../../../processor/source_line_resolver_base.cc; sourceTree = SOURCE_ROOT; };
4D2C721E126F9ADE00B43EAF /* exploitability.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = exploitability.cc; path = ../../../processor/exploitability.cc; sourceTree = SOURCE_ROOT; };
4D2C7222126F9AF900B43EAF /* exploitability_win.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = exploitability_win.cc; path = ../../../processor/exploitability_win.cc; sourceTree = SOURCE_ROOT; };
@@ -151,7 +160,7 @@
9BDF176B0B1B8CB100F8391B /* on_demand_symbol_supplier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = on_demand_symbol_supplier.h; sourceTree = "<group>"; };
9BDF176C0B1B8CB100F8391B /* on_demand_symbol_supplier.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = on_demand_symbol_supplier.mm; sourceTree = "<group>"; };
9BDF192D0B1BC15D00F8391B /* dump_syms.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = dump_syms.h; path = ../../../common/mac/dump_syms.h; sourceTree = SOURCE_ROOT; };
- 9BDF192E0B1BC15D00F8391B /* dump_syms.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; name = dump_syms.mm; path = ../../../common/mac/dump_syms.mm; sourceTree = SOURCE_ROOT; };
+ 9BDF192E0B1BC15D00F8391B /* dump_syms.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; name = dump_syms.cc; path = ../../../common/mac/dump_syms.cc; sourceTree = SOURCE_ROOT; };
9BDF1A270B1BD58200F8391B /* pathname_stripper.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = pathname_stripper.cc; path = ../../../processor/pathname_stripper.cc; sourceTree = SOURCE_ROOT; };
9BDF1A7A0B1BE30100F8391B /* range_map-inl.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = "range_map-inl.h"; path = "../../../processor/range_map-inl.h"; sourceTree = SOURCE_ROOT; };
9BDF1A7B0B1BE30100F8391B /* range_map.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = range_map.h; path = ../../../processor/range_map.h; sourceTree = SOURCE_ROOT; };
@@ -180,6 +189,10 @@
F44DDD8B19C85CFB0047280E /* dump_object.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = dump_object.h; path = ../../../google_breakpad/processor/dump_object.h; sourceTree = "<group>"; };
F44DDD8C19C85CFC0047280E /* microdump_processor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = microdump_processor.h; path = ../../../google_breakpad/processor/microdump_processor.h; sourceTree = "<group>"; };
F44DDD8D19C85CFC0047280E /* process_result.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = process_result.h; path = ../../../google_breakpad/processor/process_result.h; sourceTree = "<group>"; };
+ F47180541D745DEF0032F208 /* elf_reader.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = elf_reader.cc; path = ../../../common/dwarf/elf_reader.cc; sourceTree = "<group>"; };
+ F47180551D745DEF0032F208 /* elf_reader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = elf_reader.h; path = ../../../common/dwarf/elf_reader.h; sourceTree = "<group>"; };
+ F47180571D7467630032F208 /* proc_maps_linux.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = proc_maps_linux.cc; path = ../../../processor/proc_maps_linux.cc; sourceTree = "<group>"; };
+ F47180591D7468A40032F208 /* symbolic_constants_win.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = symbolic_constants_win.cc; path = ../../../processor/symbolic_constants_win.cc; sourceTree = "<group>"; };
F4D43B2E1A38490700C290B2 /* microdump.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = microdump.cc; path = ../../../processor/microdump.cc; sourceTree = "<group>"; };
F4D43B301A38492000C290B2 /* microdump.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = microdump.h; path = ../../../google_breakpad/processor/microdump.h; sourceTree = "<group>"; };
F9C7ECE20E8ABCA600E953AD /* bytereader.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = bytereader.cc; path = ../../../common/dwarf/bytereader.cc; sourceTree = SOURCE_ROOT; };
@@ -208,6 +221,10 @@
08FB7794FE84155DC02AAC07 /* crash_report */ = {
isa = PBXGroup;
children = (
+ 4214B7FE211109A600B769FA /* convert_old_arm64_context.cc */,
+ 4214B7FF211109A600B769FA /* convert_old_arm64_context.h */,
+ 4247E63F2110D5A500482558 /* path_helper.cc */,
+ 4247E63E2110D5A500482558 /* path_helper.h */,
8B31025311F0D2D400FCF3E4 /* Breakpad.xcconfig */,
8B3102DA11F0D65600FCF3E4 /* BreakpadDebug.xcconfig */,
8B3102DB11F0D65600FCF3E4 /* BreakpadRelease.xcconfig */,
@@ -219,7 +236,7 @@
8B31FF7211F0C6E000FCF3E4 /* macho_reader.cc */,
8B31FF7311F0C6E000FCF3E4 /* macho_reader.h */,
9BDF192D0B1BC15D00F8391B /* dump_syms.h */,
- 9BDF192E0B1BC15D00F8391B /* dump_syms.mm */,
+ 9BDF192E0B1BC15D00F8391B /* dump_syms.cc */,
08FB7796FE84155DC02AAC07 /* crash_report.mm */,
F44DDD8D19C85CFC0047280E /* process_result.h */,
9BDF176B0B1B8CB100F8391B /* on_demand_symbol_supplier.h */,
@@ -371,6 +388,7 @@
9BDF173F0B1B8B9A00F8391B /* minidump.cc */,
9BDF172B0B1B8B2400F8391B /* minidump_processor.cc */,
9BDF1A270B1BD58200F8391B /* pathname_stripper.cc */,
+ F47180571D7467630032F208 /* proc_maps_linux.cc */,
9BDF175B0B1B8C1B00F8391B /* process_state.cc */,
9BDF1A7A0B1BE30100F8391B /* range_map-inl.h */,
9BDF1A7B0B1BE30100F8391B /* range_map.h */,
@@ -381,6 +399,7 @@
FD8EDEAD0CADDAD400A5EDF1 /* stackwalker_sparc.h */,
FD6625C40CF4D438004AC844 /* stackwalker_amd64.cc */,
FD6625C50CF4D438004AC844 /* stackwalker_amd64.h */,
+ F47180591D7468A40032F208 /* symbolic_constants_win.cc */,
);
name = processor;
sourceTree = "<group>";
@@ -405,6 +424,8 @@
F9C7ECE30E8ABCA600E953AD /* dwarf2reader.cc */,
8B31FFC311F0C8AB00FCF3E4 /* dwarf2diehandler.cc */,
8B31FFC411F0C8AB00FCF3E4 /* dwarf2diehandler.h */,
+ F47180541D745DEF0032F208 /* elf_reader.cc */,
+ F47180551D745DEF0032F208 /* elf_reader.h */,
F9C7ECE40E8ABCA600E953AD /* functioninfo.cc */,
);
name = DWARF;
@@ -435,8 +456,11 @@
/* Begin PBXProject section */
08FB7793FE84155DC02AAC07 /* Project object */ = {
isa = PBXProject;
+ attributes = {
+ };
buildConfigurationList = 1DEB927808733DD40010E9CD /* Build configuration list for PBXProject "crash_report" */;
compatibilityVersion = "Xcode 3.1";
+ developmentRegion = en;
hasScannedForEncodings = 1;
knownRegions = (
English,
@@ -460,6 +484,7 @@
files = (
162F64FE161C5ECB00CD68D5 /* arch_utilities.cc in Sources */,
8DD76F9A0486AA7600D96B5E /* crash_report.mm in Sources */,
+ F47180581D7467630032F208 /* proc_maps_linux.cc in Sources */,
9BDF172C0B1B8B2400F8391B /* call_stack.cc in Sources */,
9BDF172D0B1B8B2400F8391B /* minidump_processor.cc in Sources */,
9BDF17410B1B8B9A00F8391B /* minidump.cc in Sources */,
@@ -468,9 +493,10 @@
9BDF17550B1B8BF900F8391B /* stackwalker_x86.cc in Sources */,
9BDF17560B1B8BF900F8391B /* stackwalker.cc in Sources */,
9BDF175D0B1B8C1B00F8391B /* process_state.cc in Sources */,
+ F47180561D745DEF0032F208 /* elf_reader.cc in Sources */,
9BDF176E0B1B8CB100F8391B /* on_demand_symbol_supplier.mm in Sources */,
9BDF1A280B1BD58200F8391B /* pathname_stripper.cc in Sources */,
- 9BDF21A70B1E825400F8391B /* dump_syms.mm in Sources */,
+ 9BDF21A70B1E825400F8391B /* dump_syms.cc in Sources */,
9B35FEEA0B26761C008DE8C7 /* basic_code_modules.cc in Sources */,
9B3904990B2E52FD0059FABE /* basic_source_line_resolver.cc in Sources */,
9BE650B20B52FE3000611104 /* file_id.cc in Sources */,
@@ -498,11 +524,13 @@
8B31FF8911F0C6FB00FCF3E4 /* module.cc in Sources */,
8B31FFC511F0C8AB00FCF3E4 /* dwarf2diehandler.cc in Sources */,
F407DC49185773C10064622B /* stack_frame_symbolizer.cc in Sources */,
+ F471805A1D7468A40032F208 /* symbolic_constants_win.cc in Sources */,
4D2C721B126F9ACC00B43EAF /* source_line_resolver_base.cc in Sources */,
4D2C721F126F9ADE00B43EAF /* exploitability.cc in Sources */,
4D2C7223126F9AF900B43EAF /* exploitability_win.cc in Sources */,
4D2C7227126F9B0F00B43EAF /* disassembler_x86.cc in Sources */,
F407DC48185773C10064622B /* exploitability_linux.cc in Sources */,
+ 4214B800211109A600B769FA /* convert_old_arm64_context.cc in Sources */,
4D2C722B126F9B5A00B43EAF /* x86_disasm.c in Sources */,
4D2C722D126F9B6E00B43EAF /* x86_misc.c in Sources */,
4D2C722F126F9B8300B43EAF /* x86_operand_list.c in Sources */,
@@ -512,6 +540,7 @@
4D2C7246126F9C0B00B43EAF /* ia32_insn.c in Sources */,
4D2C724A126F9C2300B43EAF /* ia32_opcode_tables.c in Sources */,
4D2C724C126F9C3800B43EAF /* ia32_implicit.c in Sources */,
+ 4247E6402110D5A500482558 /* path_helper.cc in Sources */,
F44DDD8919C85CD50047280E /* microdump_processor.cc in Sources */,
4D2C724E126F9C4D00B43EAF /* ia32_reg.c in Sources */,
4D2C725B126F9C8000B43EAF /* ia32_operand.c in Sources */,
@@ -530,6 +559,7 @@
1DEB927508733DD40010E9CD /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
HEADER_SEARCH_PATHS = ../../../../src;
PRODUCT_NAME = crash_report;
};
@@ -538,6 +568,7 @@
1DEB927608733DD40010E9CD /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
HEADER_SEARCH_PATHS = ../../../../src;
PRODUCT_NAME = crash_report;
};
diff --git a/src/tools/mac/crash_report/on_demand_symbol_supplier.mm b/src/tools/mac/crash_report/on_demand_symbol_supplier.mm
index ebbca87a..1955d266 100644
--- a/src/tools/mac/crash_report/on_demand_symbol_supplier.mm
+++ b/src/tools/mac/crash_report/on_demand_symbol_supplier.mm
@@ -27,6 +27,7 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#import <Foundation/Foundation.h>
#include <sys/stat.h>
#include <map>
#include <string>
@@ -280,11 +281,8 @@ bool OnDemandSymbolSupplier::GenerateSymbolFile(const CodeModule *module,
}
if (generate_file) {
- NSString *module_str = [[NSFileManager defaultManager]
- stringWithFileSystemRepresentation:module_path.c_str()
- length:module_path.length()];
DumpSymbols dump(ALL_SYMBOL_DATA, false);
- if (dump.Read(module_str)) {
+ if (dump.Read(module_path)) {
// What Breakpad calls "x86" should be given to the system as "i386".
std::string architecture;
if (system_info->cpu.compare("x86") == 0) {
@@ -303,7 +301,7 @@ bool OnDemandSymbolSupplier::GenerateSymbolFile(const CodeModule *module,
result = false;
}
} else {
- printf("Unable to open %s\n", [module_str UTF8String]);
+ printf("Unable to open %s\n", module_path.c_str());
result = false;
}
}
diff --git a/src/tools/mac/dump_syms/dump_syms.xcodeproj/project.pbxproj b/src/tools/mac/dump_syms/dump_syms.xcodeproj/project.pbxproj
index 16759f4c..5b644e24 100644
--- a/src/tools/mac/dump_syms/dump_syms.xcodeproj/project.pbxproj
+++ b/src/tools/mac/dump_syms/dump_syms.xcodeproj/project.pbxproj
@@ -35,7 +35,12 @@
/* Begin PBXBuildFile section */
162F64FA161C591500CD68D5 /* arch_utilities.cc in Sources */ = {isa = PBXBuildFile; fileRef = 162F64F8161C591500CD68D5 /* arch_utilities.cc */; };
162F6500161C5F2200CD68D5 /* arch_utilities.cc in Sources */ = {isa = PBXBuildFile; fileRef = 162F64F8161C591500CD68D5 /* arch_utilities.cc */; };
+ 4247E63D2110D4B200482558 /* path_helper.cc in Sources */ = {isa = PBXBuildFile; fileRef = EB06C7511FEBC515000214D9 /* path_helper.cc */; };
+ 4262382721AC496F00E5A3A6 /* dwarf_range_list_handler.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4262382521AC496F00E5A3A6 /* dwarf_range_list_handler.cc */; };
+ 4262382821AC49A000E5A3A6 /* dwarf_range_list_handler.h in Sources */ = {isa = PBXBuildFile; fileRef = 4262382621AC496F00E5A3A6 /* dwarf_range_list_handler.h */; };
4D72CAF513DFBAC2006CABE3 /* md5.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D72CAF413DFBAC2006CABE3 /* md5.cc */; };
+ 8BCAAA4C1CE3A7980046090B /* elf_reader.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8BCAAA4A1CE3A7980046090B /* elf_reader.cc */; };
+ 8BCAAA4D1CE3B1260046090B /* elf_reader.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8BCAAA4A1CE3A7980046090B /* elf_reader.cc */; };
B84A91F8116CF78F006C210E /* libgtestmockall.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B88FB024116BDFFF00407530 /* libgtestmockall.a */; };
B84A91FB116CF7AF006C210E /* module.cc in Sources */ = {isa = PBXBuildFile; fileRef = B88FAE241166603300407530 /* module.cc */; };
B84A91FC116CF7AF006C210E /* stabs_to_module.cc in Sources */ = {isa = PBXBuildFile; fileRef = B88FAE3C11666C8900407530 /* stabs_to_module.cc */; };
@@ -97,12 +102,13 @@
B8C5B51A1166534700D34F4E /* file_id.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9BE650410B52F6D800611104 /* file_id.cc */; };
B8C5B51B1166534700D34F4E /* macho_id.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9BE650430B52F6D800611104 /* macho_id.cc */; };
B8C5B51C1166534700D34F4E /* macho_walker.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9BE650450B52F6D800611104 /* macho_walker.cc */; };
- B8C5B51D1166534700D34F4E /* dump_syms.mm in Sources */ = {isa = PBXBuildFile; fileRef = 08FB7796FE84155DC02AAC07 /* dump_syms.mm */; };
- B8C5B51E1166534700D34F4E /* dump_syms_tool.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9BDF186E0B1BB43700F8391B /* dump_syms_tool.mm */; };
+ B8C5B51D1166534700D34F4E /* dump_syms.cc in Sources */ = {isa = PBXBuildFile; fileRef = 08FB7796FE84155DC02AAC07 /* dump_syms.cc */; };
+ B8C5B51E1166534700D34F4E /* dump_syms_tool.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9BDF186E0B1BB43700F8391B /* dump_syms_tool.cc */; };
B8C5B523116653BA00D34F4E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 08FB779EFE84155DC02AAC07 /* Foundation.framework */; };
D21F97D711CBA12300239E38 /* test_assembler_unittest.cc in Sources */ = {isa = PBXBuildFile; fileRef = B88FB0D9116CEC0600407530 /* test_assembler_unittest.cc */; };
D21F97D811CBA13D00239E38 /* libgtestmockall.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B88FB024116BDFFF00407530 /* libgtestmockall.a */; };
D21F97E911CBA1FF00239E38 /* test_assembler.cc in Sources */ = {isa = PBXBuildFile; fileRef = B88FAE0911665B5700407530 /* test_assembler.cc */; };
+ EB06C7531FEBC516000214D9 /* path_helper.cc in Sources */ = {isa = PBXBuildFile; fileRef = EB06C7511FEBC515000214D9 /* path_helper.cc */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@@ -270,18 +276,22 @@
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
- 08FB7796FE84155DC02AAC07 /* dump_syms.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = dump_syms.mm; path = ../../../common/mac/dump_syms.mm; sourceTree = "<group>"; };
+ 08FB7796FE84155DC02AAC07 /* dump_syms.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = dump_syms.cc; path = ../../../common/mac/dump_syms.cc; sourceTree = "<group>"; };
08FB779EFE84155DC02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
162F64F8161C591500CD68D5 /* arch_utilities.cc */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = arch_utilities.cc; path = ../../../common/mac/arch_utilities.cc; sourceTree = "<group>"; };
162F64F9161C591500CD68D5 /* arch_utilities.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = arch_utilities.h; path = ../../../common/mac/arch_utilities.h; sourceTree = "<group>"; };
+ 4262382521AC496F00E5A3A6 /* dwarf_range_list_handler.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = dwarf_range_list_handler.cc; path = ../../../common/dwarf_range_list_handler.cc; sourceTree = "<group>"; };
+ 4262382621AC496F00E5A3A6 /* dwarf_range_list_handler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dwarf_range_list_handler.h; path = ../../../common/dwarf_range_list_handler.h; sourceTree = "<group>"; };
4D72CAF413DFBAC2006CABE3 /* md5.cc */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = md5.cc; path = ../../../common/md5.cc; sourceTree = SOURCE_ROOT; };
557800890BE1F3AB00EC23E0 /* macho_utilities.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = macho_utilities.cc; path = ../../../common/mac/macho_utilities.cc; sourceTree = SOURCE_ROOT; };
5578008A0BE1F3AB00EC23E0 /* macho_utilities.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = macho_utilities.h; path = ../../../common/mac/macho_utilities.h; sourceTree = SOURCE_ROOT; };
8B31023E11F0CF1C00FCF3E4 /* Breakpad.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Breakpad.xcconfig; path = ../../../common/mac/Breakpad.xcconfig; sourceTree = SOURCE_ROOT; };
8B3102D411F0D60300FCF3E4 /* BreakpadDebug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = BreakpadDebug.xcconfig; path = ../../../common/mac/BreakpadDebug.xcconfig; sourceTree = SOURCE_ROOT; };
8B3102D511F0D60300FCF3E4 /* BreakpadRelease.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = BreakpadRelease.xcconfig; path = ../../../common/mac/BreakpadRelease.xcconfig; sourceTree = SOURCE_ROOT; };
+ 8BCAAA4A1CE3A7980046090B /* elf_reader.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = elf_reader.cc; path = ../../../common/dwarf/elf_reader.cc; sourceTree = "<group>"; };
+ 8BCAAA4B1CE3A7980046090B /* elf_reader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = elf_reader.h; path = ../../../common/dwarf/elf_reader.h; sourceTree = "<group>"; };
9BDF186D0B1BB43700F8391B /* dump_syms.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dump_syms.h; path = ../../../common/mac/dump_syms.h; sourceTree = "<group>"; };
- 9BDF186E0B1BB43700F8391B /* dump_syms_tool.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = dump_syms_tool.mm; sourceTree = "<group>"; };
+ 9BDF186E0B1BB43700F8391B /* dump_syms_tool.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = dump_syms_tool.cc; sourceTree = "<group>"; };
9BE650410B52F6D800611104 /* file_id.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = file_id.cc; path = ../../../common/mac/file_id.cc; sourceTree = SOURCE_ROOT; };
9BE650420B52F6D800611104 /* file_id.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = file_id.h; path = ../../../common/mac/file_id.h; sourceTree = SOURCE_ROOT; };
9BE650430B52F6D800611104 /* macho_id.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = macho_id.cc; path = ../../../common/mac/macho_id.cc; sourceTree = SOURCE_ROOT; };
@@ -337,12 +347,14 @@
B89E0E701166573700DD08C9 /* macho_dump.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = macho_dump.cc; sourceTree = "<group>"; };
B89E0E741166575200DD08C9 /* macho_dump */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = macho_dump; sourceTree = BUILT_PRODUCTS_DIR; };
B89E0E9511665A6400DD08C9 /* macho_reader_unittest */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = macho_reader_unittest; sourceTree = BUILT_PRODUCTS_DIR; };
- B89E0E9F11665AC300DD08C9 /* gtest_main.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = gtest_main.cc; path = ../../../testing/gtest/src/gtest_main.cc; sourceTree = SOURCE_ROOT; };
- B89E0EA011665AC300DD08C9 /* gtest-all.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "gtest-all.cc"; path = "../../../testing/gtest/src/gtest-all.cc"; sourceTree = SOURCE_ROOT; };
- B89E0EA311665AEA00DD08C9 /* gmock-all.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "gmock-all.cc"; path = "../../../testing/src/gmock-all.cc"; sourceTree = SOURCE_ROOT; };
+ B89E0E9F11665AC300DD08C9 /* gtest_main.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = gtest_main.cc; path = ../../../testing/googletest/src/gtest_main.cc; sourceTree = SOURCE_ROOT; };
+ B89E0EA011665AC300DD08C9 /* gtest-all.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "gtest-all.cc"; path = "../../../testing/googletest/src/gtest-all.cc"; sourceTree = SOURCE_ROOT; };
+ B89E0EA311665AEA00DD08C9 /* gmock-all.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "gmock-all.cc"; path = "../../../testing/googlemock/src/gmock-all.cc"; sourceTree = SOURCE_ROOT; };
B8C5B5111166531A00D34F4E /* dump_syms */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = dump_syms; sourceTree = BUILT_PRODUCTS_DIR; };
B8E8CA0C1156C854009E61B2 /* byteswap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = byteswap.h; path = ../../../common/mac/byteswap.h; sourceTree = SOURCE_ROOT; };
D21F97D211CBA0F200239E38 /* test_assembler_unittest */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = test_assembler_unittest; sourceTree = BUILT_PRODUCTS_DIR; };
+ EB06C7511FEBC515000214D9 /* path_helper.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = path_helper.cc; path = ../../../common/path_helper.cc; sourceTree = "<group>"; };
+ EB06C7521FEBC516000214D9 /* path_helper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = path_helper.h; path = ../../../common/path_helper.h; sourceTree = "<group>"; };
F95B422B0E0E22D100DBDE83 /* bytereader-inl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "bytereader-inl.h"; path = "../../../common/dwarf/bytereader-inl.h"; sourceTree = SOURCE_ROOT; };
F95B422C0E0E22D100DBDE83 /* bytereader.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = bytereader.cc; path = ../../../common/dwarf/bytereader.cc; sourceTree = SOURCE_ROOT; };
F95B422D0E0E22D100DBDE83 /* bytereader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = bytereader.h; path = ../../../common/dwarf/bytereader.h; sourceTree = SOURCE_ROOT; };
@@ -493,10 +505,12 @@
9BE650410B52F6D800611104 /* file_id.cc */,
9BE650420B52F6D800611104 /* file_id.h */,
9BDF186D0B1BB43700F8391B /* dump_syms.h */,
- 08FB7796FE84155DC02AAC07 /* dump_syms.mm */,
- 9BDF186E0B1BB43700F8391B /* dump_syms_tool.mm */,
+ 08FB7796FE84155DC02AAC07 /* dump_syms.cc */,
+ 9BDF186E0B1BB43700F8391B /* dump_syms_tool.cc */,
B89E0E701166573700DD08C9 /* macho_dump.cc */,
4D72CAF413DFBAC2006CABE3 /* md5.cc */,
+ EB06C7511FEBC515000214D9 /* path_helper.cc */,
+ EB06C7521FEBC516000214D9 /* path_helper.h */,
08FB779DFE84155DC02AAC07 /* External Frameworks and Libraries */,
1AB674ADFE9D54B511CA2CBB /* Products */,
);
@@ -603,6 +617,8 @@
B88FAF35116A595400407530 /* cfi_assembler.h */,
F95B422E0E0E22D100DBDE83 /* dwarf2enums.h */,
F95B422F0E0E22D100DBDE83 /* dwarf2reader.cc */,
+ 4262382521AC496F00E5A3A6 /* dwarf_range_list_handler.cc */,
+ 4262382621AC496F00E5A3A6 /* dwarf_range_list_handler.h */,
F95B42300E0E22D100DBDE83 /* dwarf2reader.h */,
B88FAF36116A595400407530 /* dwarf2reader_cfi_unittest.cc */,
F95B422D0E0E22D100DBDE83 /* bytereader.h */,
@@ -613,6 +629,8 @@
B88FAE1711665FE400407530 /* dwarf2diehandler.cc */,
B88FAE1811665FE400407530 /* dwarf2diehandler.h */,
B88FB0DB116CEC5800407530 /* dwarf2diehandler_unittest.cc */,
+ 8BCAAA4A1CE3A7980046090B /* elf_reader.cc */,
+ 8BCAAA4B1CE3A7980046090B /* elf_reader.h */,
);
name = DWARF;
sourceTree = "<group>";
@@ -887,6 +905,8 @@
/* Begin PBXProject section */
08FB7793FE84155DC02AAC07 /* Project object */ = {
isa = PBXProject;
+ attributes = {
+ };
buildConfigurationList = 1DEB927808733DD40010E9CD /* Build configuration list for PBXProject "dump_syms" */;
compatibilityVersion = "Xcode 3.1";
developmentRegion = English;
@@ -954,6 +974,7 @@
files = (
B88FAF38116A595400407530 /* dwarf2reader_cfi_unittest.cc in Sources */,
B88FAF3F116A5A2E00407530 /* dwarf2reader.cc in Sources */,
+ 8BCAAA4D1CE3B1260046090B /* elf_reader.cc in Sources */,
B88FAF40116A5A2E00407530 /* bytereader.cc in Sources */,
B88FAF37116A595400407530 /* cfi_assembler.cc in Sources */,
);
@@ -1050,6 +1071,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
+ 4247E63D2110D4B200482558 /* path_helper.cc in Sources */,
162F6500161C5F2200CD68D5 /* arch_utilities.cc in Sources */,
B89E0E781166576C00DD08C9 /* macho_reader.cc in Sources */,
B89E0E7A1166576C00DD08C9 /* macho_dump.cc in Sources */,
@@ -1069,19 +1091,23 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
+ 4262382821AC49A000E5A3A6 /* dwarf_range_list_handler.h in Sources */,
162F64FA161C591500CD68D5 /* arch_utilities.cc in Sources */,
B88FAE2C1166606200407530 /* macho_reader.cc in Sources */,
+ 8BCAAA4C1CE3A7980046090B /* elf_reader.cc in Sources */,
B8C5B5171166534700D34F4E /* dwarf2reader.cc in Sources */,
+ EB06C7531FEBC516000214D9 /* path_helper.cc in Sources */,
B8C5B5181166534700D34F4E /* bytereader.cc in Sources */,
B8C5B5191166534700D34F4E /* macho_utilities.cc in Sources */,
B8C5B51A1166534700D34F4E /* file_id.cc in Sources */,
B8C5B51B1166534700D34F4E /* macho_id.cc in Sources */,
B8C5B51C1166534700D34F4E /* macho_walker.cc in Sources */,
- B8C5B51D1166534700D34F4E /* dump_syms.mm in Sources */,
- B8C5B51E1166534700D34F4E /* dump_syms_tool.mm in Sources */,
+ B8C5B51D1166534700D34F4E /* dump_syms.cc in Sources */,
+ B8C5B51E1166534700D34F4E /* dump_syms_tool.cc in Sources */,
B88FAE1911665FE400407530 /* dwarf2diehandler.cc in Sources */,
B88FAE261166603300407530 /* dwarf_cu_to_module.cc in Sources */,
B88FAE271166603300407530 /* dwarf_line_to_module.cc in Sources */,
+ 4262382721AC496F00E5A3A6 /* dwarf_range_list_handler.cc in Sources */,
B88FAE281166603300407530 /* language.cc in Sources */,
B88FAE291166603300407530 /* module.cc in Sources */,
B88FAE351166673E00407530 /* dwarf_cfi_to_module.cc in Sources */,
@@ -1225,7 +1251,12 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 8B3102D411F0D60300FCF3E4 /* BreakpadDebug.xcconfig */;
buildSettings = {
- HEADER_SEARCH_PATHS = ../../..;
+ CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
+ HEADER_SEARCH_PATHS = (
+ ../../..,
+ ../../../common/mac/include/,
+ ../../../third_party/musl/include/,
+ );
};
name = Debug;
};
@@ -1233,7 +1264,12 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 8B3102D511F0D60300FCF3E4 /* BreakpadRelease.xcconfig */;
buildSettings = {
- HEADER_SEARCH_PATHS = ../../..;
+ CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
+ HEADER_SEARCH_PATHS = (
+ ../../..,
+ ../../../common/mac/include/,
+ ../../../third_party/musl/include/,
+ );
};
name = Release;
};
@@ -1242,10 +1278,10 @@
buildSettings = {
HEADER_SEARCH_PATHS = (
$inherited,
- ../../../testing,
- ../../../testing/include,
- ../../../testing/gtest,
- ../../../testing/gtest/include,
+ ../../../testing/googlemock,
+ ../../../testing/googlemock/include,
+ ../../../testing/googletest,
+ ../../../testing/googletest/include,
);
PRODUCT_NAME = stabs_to_module_unittest;
};
@@ -1256,10 +1292,10 @@
buildSettings = {
HEADER_SEARCH_PATHS = (
$inherited,
- ../../../testing,
- ../../../testing/include,
- ../../../testing/gtest,
- ../../../testing/gtest/include,
+ ../../../testing/googlemock,
+ ../../../testing/googlemock/include,
+ ../../../testing/googletest,
+ ../../../testing/googletest/include,
);
PRODUCT_NAME = stabs_to_module_unittest;
};
@@ -1270,10 +1306,10 @@
buildSettings = {
HEADER_SEARCH_PATHS = (
$inherited,
- ../../../testing,
- ../../../testing/include,
- ../../../testing/gtest,
- ../../../testing/gtest/include,
+ ../../../testing/googlemock,
+ ../../../testing/googlemock/include,
+ ../../../testing/googletest,
+ ../../../testing/googletest/include,
);
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
@@ -1289,10 +1325,10 @@
buildSettings = {
HEADER_SEARCH_PATHS = (
$inherited,
- ../../../testing,
- ../../../testing/include,
- ../../../testing/gtest,
- ../../../testing/gtest/include,
+ ../../../testing/googlemock,
+ ../../../testing/googlemock/include,
+ ../../../testing/googletest,
+ ../../../testing/googletest/include,
);
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
@@ -1323,10 +1359,10 @@
GCC_PREPROCESSOR_DEFINITIONS = HAVE_MACH_O_NLIST_H;
HEADER_SEARCH_PATHS = (
$inherited,
- ../../../testing,
- ../../../testing/include,
- ../../../testing/gtest,
- ../../../testing/gtest/include,
+ ../../../testing/googlemock,
+ ../../../testing/googlemock/include,
+ ../../../testing/googletest,
+ ../../../testing/googletest/include,
);
PRODUCT_NAME = stabs_reader_unittest;
};
@@ -1338,10 +1374,10 @@
GCC_PREPROCESSOR_DEFINITIONS = HAVE_MACH_O_NLIST_H;
HEADER_SEARCH_PATHS = (
$inherited,
- ../../../testing,
- ../../../testing/include,
- ../../../testing/gtest,
- ../../../testing/gtest/include,
+ ../../../testing/googlemock,
+ ../../../testing/googlemock/include,
+ ../../../testing/googletest,
+ ../../../testing/googletest/include,
);
PRODUCT_NAME = stabs_reader_unittest;
};
@@ -1352,10 +1388,10 @@
buildSettings = {
HEADER_SEARCH_PATHS = (
$inherited,
- ../../../testing,
- ../../../testing/include,
- ../../../testing/gtest,
- ../../../testing/gtest/include,
+ ../../../testing/googlemock,
+ ../../../testing/googlemock/include,
+ ../../../testing/googletest,
+ ../../../testing/googletest/include,
);
PRODUCT_NAME = gtestmockall;
};
@@ -1366,10 +1402,10 @@
buildSettings = {
HEADER_SEARCH_PATHS = (
$inherited,
- ../../../testing,
- ../../../testing/include,
- ../../../testing/gtest,
- ../../../testing/gtest/include,
+ ../../../testing/googlemock,
+ ../../../testing/googlemock/include,
+ ../../../testing/googletest,
+ ../../../testing/googletest/include,
);
PRODUCT_NAME = gtestmockall;
};
@@ -1380,10 +1416,10 @@
buildSettings = {
HEADER_SEARCH_PATHS = (
$inherited,
- ../../../testing,
- ../../../testing/include,
- ../../../testing/gtest,
- ../../../testing/gtest/include,
+ ../../../testing/googlemock,
+ ../../../testing/googlemock/include,
+ ../../../testing/googletest,
+ ../../../testing/googletest/include,
);
PRODUCT_NAME = module_unittest;
};
@@ -1394,10 +1430,10 @@
buildSettings = {
HEADER_SEARCH_PATHS = (
$inherited,
- ../../../testing,
- ../../../testing/include,
- ../../../testing/gtest,
- ../../../testing/gtest/include,
+ ../../../testing/googlemock,
+ ../../../testing/googlemock/include,
+ ../../../testing/googletest,
+ ../../../testing/googletest/include,
);
PRODUCT_NAME = module_unittest;
};
@@ -1408,10 +1444,10 @@
buildSettings = {
HEADER_SEARCH_PATHS = (
$inherited,
- ../../../testing,
- ../../../testing/include,
- ../../../testing/gtest,
- ../../../testing/gtest/include,
+ ../../../testing/googlemock,
+ ../../../testing/googlemock/include,
+ ../../../testing/googletest,
+ ../../../testing/googletest/include,
);
PRODUCT_NAME = dwarf2diehandler_unittest;
};
@@ -1422,10 +1458,10 @@
buildSettings = {
HEADER_SEARCH_PATHS = (
$inherited,
- ../../../testing,
- ../../../testing/include,
- ../../../testing/gtest,
- ../../../testing/gtest/include,
+ ../../../testing/googlemock,
+ ../../../testing/googlemock/include,
+ ../../../testing/googletest,
+ ../../../testing/googletest/include,
);
PRODUCT_NAME = dwarf2diehandler_unittest;
};
@@ -1436,10 +1472,10 @@
buildSettings = {
HEADER_SEARCH_PATHS = (
$inherited,
- ../../../testing,
- ../../../testing/include,
- ../../../testing/gtest,
- ../../../testing/gtest/include,
+ ../../../testing/googlemock,
+ ../../../testing/googlemock/include,
+ ../../../testing/googletest,
+ ../../../testing/googletest/include,
);
PRODUCT_NAME = dwarf_line_to_module_unittest;
};
@@ -1450,10 +1486,10 @@
buildSettings = {
HEADER_SEARCH_PATHS = (
$inherited,
- ../../../testing,
- ../../../testing/include,
- ../../../testing/gtest,
- ../../../testing/gtest/include,
+ ../../../testing/googlemock,
+ ../../../testing/googlemock/include,
+ ../../../testing/googletest,
+ ../../../testing/googletest/include,
);
PRODUCT_NAME = dwarf_line_to_module_unittest;
};
@@ -1464,10 +1500,10 @@
buildSettings = {
HEADER_SEARCH_PATHS = (
$inherited,
- ../../../testing,
- ../../../testing/include,
- ../../../testing/gtest,
- ../../../testing/gtest/include,
+ ../../../testing/googlemock,
+ ../../../testing/googlemock/include,
+ ../../../testing/googletest,
+ ../../../testing/googletest/include,
);
PRODUCT_NAME = dwarf_cu_to_module_unittest;
};
@@ -1478,10 +1514,10 @@
buildSettings = {
HEADER_SEARCH_PATHS = (
$inherited,
- ../../../testing,
- ../../../testing/include,
- ../../../testing/gtest,
- ../../../testing/gtest/include,
+ ../../../testing/googlemock,
+ ../../../testing/googlemock/include,
+ ../../../testing/googletest,
+ ../../../testing/googletest/include,
);
PRODUCT_NAME = dwarf_cu_to_module_unittest;
};
@@ -1492,10 +1528,10 @@
buildSettings = {
HEADER_SEARCH_PATHS = (
$inherited,
- ../../../testing,
- ../../../testing/include,
- ../../../testing/gtest,
- ../../../testing/gtest/include,
+ ../../../testing/googlemock,
+ ../../../testing/googlemock/include,
+ ../../../testing/googletest,
+ ../../../testing/googletest/include,
);
PRODUCT_NAME = dwarf_cfi_to_module_unittest;
};
@@ -1506,10 +1542,10 @@
buildSettings = {
HEADER_SEARCH_PATHS = (
$inherited,
- ../../../testing,
- ../../../testing/include,
- ../../../testing/gtest,
- ../../../testing/gtest/include,
+ ../../../testing/googlemock,
+ ../../../testing/googlemock/include,
+ ../../../testing/googletest,
+ ../../../testing/googletest/include,
);
PRODUCT_NAME = dwarf_cfi_to_module_unittest;
};
@@ -1520,10 +1556,10 @@
buildSettings = {
HEADER_SEARCH_PATHS = (
$inherited,
- ../../../testing,
- ../../../testing/include,
- ../../../testing/gtest,
- ../../../testing/gtest/include,
+ ../../../testing/googlemock,
+ ../../../testing/googlemock/include,
+ ../../../testing/googletest,
+ ../../../testing/googletest/include,
);
PRODUCT_NAME = bytereader_unittest;
};
@@ -1534,10 +1570,10 @@
buildSettings = {
HEADER_SEARCH_PATHS = (
$inherited,
- ../../../testing,
- ../../../testing/include,
- ../../../testing/gtest,
- ../../../testing/gtest/include,
+ ../../../testing/googlemock,
+ ../../../testing/googlemock/include,
+ ../../../testing/googletest,
+ ../../../testing/googletest/include,
);
PRODUCT_NAME = bytereader_unittest;
};
@@ -1548,10 +1584,10 @@
buildSettings = {
HEADER_SEARCH_PATHS = (
$inherited,
- ../../../testing,
- ../../../testing/include,
- ../../../testing/gtest,
- ../../../testing/gtest/include,
+ ../../../testing/googletest,
+ ../../../testing/googletest/include,
+ ../../../testing/googlemock,
+ ../../../testing/googlemock/include,
);
PRODUCT_NAME = byte_cursor_unittest;
};
@@ -1562,10 +1598,10 @@
buildSettings = {
HEADER_SEARCH_PATHS = (
$inherited,
- ../../../testing,
- ../../../testing/include,
- ../../../testing/gtest,
- ../../../testing/gtest/include,
+ ../../../testing/googletest,
+ ../../../testing/googletest/include,
+ ../../../testing/googlemock,
+ ../../../testing/googlemock/include,
);
PRODUCT_NAME = byte_cursor_unittest;
};
@@ -1590,10 +1626,10 @@
buildSettings = {
HEADER_SEARCH_PATHS = (
$inherited,
- ../../../testing,
- ../../../testing/include,
- ../../../testing/gtest,
- ../../../testing/gtest/include,
+ ../../../testing/googletest,
+ ../../../testing/googletest/include,
+ ../../../testing/googlemock,
+ ../../../testing/googlemock/include,
);
PRODUCT_NAME = macho_reader_unittest;
};
@@ -1604,10 +1640,10 @@
buildSettings = {
HEADER_SEARCH_PATHS = (
$inherited,
- ../../../testing,
- ../../../testing/include,
- ../../../testing/gtest,
- ../../../testing/gtest/include,
+ ../../../testing/googletest,
+ ../../../testing/googletest/include,
+ ../../../testing/googlemock,
+ ../../../testing/googlemock/include,
);
PRODUCT_NAME = macho_reader_unittest;
};
@@ -1617,6 +1653,7 @@
isa = XCBuildConfiguration;
buildSettings = {
GCC_PREPROCESSOR_DEFINITIONS = HAVE_MACH_O_NLIST_H;
+ GCC_VERSION = "";
PRODUCT_NAME = dump_syms;
};
name = Debug;
@@ -1625,6 +1662,7 @@
isa = XCBuildConfiguration;
buildSettings = {
GCC_PREPROCESSOR_DEFINITIONS = HAVE_MACH_O_NLIST_H;
+ GCC_VERSION = "";
PRODUCT_NAME = dump_syms;
};
name = Release;
@@ -1634,10 +1672,10 @@
buildSettings = {
HEADER_SEARCH_PATHS = (
$inherited,
- ../../../testing,
- ../../../testing/include,
- ../../../testing/gtest,
- ../../../testing/gtest/include,
+ ../../../testing/googletest,
+ ../../../testing/googletest/include,
+ ../../../testing/googlemock,
+ ../../../testing/googlemock/include,
);
PRODUCT_NAME = test_assembler_unittest;
};
@@ -1648,10 +1686,10 @@
buildSettings = {
HEADER_SEARCH_PATHS = (
$inherited,
- ../../../testing,
- ../../../testing/include,
- ../../../testing/gtest,
- ../../../testing/gtest/include,
+ ../../../testing/googletest,
+ ../../../testing/googletest/include,
+ ../../../testing/googlemock,
+ ../../../testing/googlemock/include,
);
PRODUCT_NAME = test_assembler_unittest;
};
diff --git a/src/tools/mac/dump_syms/dump_syms_tool.mm b/src/tools/mac/dump_syms/dump_syms_tool.cc
index 1880cd3b..6f68457b 100644
--- a/src/tools/mac/dump_syms/dump_syms_tool.mm
+++ b/src/tools/mac/dump_syms/dump_syms_tool.cc
@@ -29,12 +29,13 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-// dump_syms_tool.mm: Command line tool that uses the DumpSymbols class.
+// dump_syms_tool.cc: Command line tool that uses the DumpSymbols class.
// TODO(waylonis): accept stdin
#include <mach-o/arch.h>
#include <unistd.h>
+#include <algorithm>
#include <iostream>
#include <vector>
@@ -50,10 +51,13 @@ using std::vector;
struct Options {
Options()
- : srcPath(), dsymPath(), arch(), cfi(true), handle_inter_cu_refs(true) {}
- NSString *srcPath;
- NSString *dsymPath;
+ : srcPath(), dsymPath(), arch(), header_only(false),
+ cfi(true), handle_inter_cu_refs(true) {}
+
+ string srcPath;
+ string dsymPath;
const NXArchInfo *arch;
+ bool header_only;
bool cfi;
bool handle_inter_cu_refs;
};
@@ -114,8 +118,10 @@ static bool Start(const Options &options) {
// requested, then consider the Module as "split" and dump all the debug data
// from the primary debug info file, the dSYM, and then dump additional CFI
// data from the source Mach-O file.
- bool split_module = options.dsymPath && options.srcPath && options.cfi;
- NSString* primary_file = split_module ? options.dsymPath : options.srcPath;
+ bool split_module =
+ !options.dsymPath.empty() && !options.srcPath.empty() && options.cfi;
+ const string& primary_file =
+ split_module ? options.dsymPath : options.srcPath;
if (!dump_symbols.Read(primary_file))
return false;
@@ -124,16 +130,16 @@ static bool Start(const Options &options) {
if (!dump_symbols.SetArchitecture(options.arch->cputype,
options.arch->cpusubtype)) {
fprintf(stderr, "%s: no architecture '%s' is present in file.\n",
- [primary_file fileSystemRepresentation], options.arch->name);
+ primary_file.c_str(), options.arch->name);
size_t available_size;
- const struct fat_arch *available =
+ const SuperFatArch *available =
dump_symbols.AvailableArchitectures(&available_size);
if (available_size == 1)
fprintf(stderr, "the file's architecture is: ");
else
fprintf(stderr, "architectures present in the file are:\n");
for (size_t i = 0; i < available_size; i++) {
- const struct fat_arch *arch = &available[i];
+ const SuperFatArch *arch = &available[i];
const NXArchInfo *arch_info =
google_breakpad::BreakpadGetArchInfoFromCpuType(
arch->cputype, arch->cpusubtype);
@@ -147,6 +153,9 @@ static bool Start(const Options &options) {
}
}
+ if (options.header_only)
+ return dump_symbols.WriteSymbolFileHeader(std::cout);
+
// Read the primary file into a Breakpad Module.
Module* module = NULL;
if (!dump_symbols.ReadSymbolData(&module))
@@ -185,6 +194,7 @@ static void Usage(int argc, const char *argv[]) {
fprintf(stderr, "Output a Breakpad symbol file from a Mach-o file.\n");
fprintf(stderr, "Usage: %s [-a ARCHITECTURE] [-c] [-g dSYM path] "
"<Mach-o file>\n", argv[0]);
+ fprintf(stderr, "\t-i: Output module header information only.\n");
fprintf(stderr, "\t-a: Architecture type [default: native, or whatever is\n");
fprintf(stderr, "\t in the file, if it contains only one architecture]\n");
fprintf(stderr, "\t-g: Debug symbol file (dSYM) to dump in addition to the "
@@ -200,8 +210,11 @@ static void SetupOptions(int argc, const char *argv[], Options *options) {
extern int optind;
signed char ch;
- while ((ch = getopt(argc, (char * const *)argv, "a:g:chr?")) != -1) {
+ while ((ch = getopt(argc, (char * const *)argv, "ia:g:chr?")) != -1) {
switch (ch) {
+ case 'i':
+ options->header_only = true;
+ break;
case 'a': {
const NXArchInfo *arch_info =
google_breakpad::BreakpadGetArchInfoFromName(optarg);
@@ -214,8 +227,7 @@ static void SetupOptions(int argc, const char *argv[], Options *options) {
break;
}
case 'g':
- options->dsymPath = [[NSFileManager defaultManager]
- stringWithFileSystemRepresentation:optarg length:strlen(optarg)];
+ options->dsymPath = optarg;
break;
case 'c':
options->cfi = false;
@@ -237,21 +249,16 @@ static void SetupOptions(int argc, const char *argv[], Options *options) {
exit(1);
}
- options->srcPath = [[NSFileManager defaultManager]
- stringWithFileSystemRepresentation:argv[optind]
- length:strlen(argv[optind])];
+ options->srcPath = argv[optind];
}
//=============================================================================
int main (int argc, const char * argv[]) {
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
Options options;
bool result;
SetupOptions(argc, argv, &options);
result = Start(options);
- [pool release];
-
return !result;
}
diff --git a/src/tools/mac/dump_syms/macho_dump.cc b/src/tools/mac/dump_syms/macho_dump.cc
index 4402bf4e..6e784ca7 100644
--- a/src/tools/mac/dump_syms/macho_dump.cc
+++ b/src/tools/mac/dump_syms/macho_dump.cc
@@ -34,7 +34,6 @@
#include <errno.h>
#include <fcntl.h>
-#include <libgen.h>
#include <mach-o/arch.h>
#include <sys/mman.h>
#include <stdint.h>
@@ -49,6 +48,7 @@
#include "common/byte_cursor.h"
#include "common/mac/arch_utilities.h"
#include "common/mac/macho_reader.h"
+#include "common/path_helper.h"
using google_breakpad::ByteBuffer;
using std::ostringstream;
@@ -85,7 +85,7 @@ class DumpSection: public mach_o::Reader::SectionHandler {
section.contents.Size());
return true;
}
-
+
private:
int index_;
};
@@ -138,8 +138,12 @@ void DumpFile(const char *filename) {
}
printf("filename: %s\n", filename);
size_t object_files_size;
- const struct fat_arch *object_files
- = fat_reader.object_files(&object_files_size);
+ const SuperFatArch* super_fat_object_files =
+ fat_reader.object_files(&object_files_size);
+ struct fat_arch *object_files;
+ if (!super_fat_object_files->ConvertToFatArch(object_files)) {
+ exit(1);
+ }
printf(" object file count: %ld\n", object_files_size);
for (size_t i = 0; i < object_files_size; i++) {
const struct fat_arch &file = object_files[i];
@@ -187,7 +191,7 @@ void DumpFile(const char *filename) {
} // namespace
int main(int argc, char **argv) {
- program_name = basename(argv[0]);
+ program_name = google_breakpad::BaseName(argv[0]);
if (argc == 1) {
fprintf(stderr, "Usage: %s FILE ...\n"
"Dump the contents of the Mach-O or fat binary files "
diff --git a/src/tools/mac/symupload/minidump_upload.m b/src/tools/mac/symupload/minidump_upload.m
index 991a5de5..741ad765 100644
--- a/src/tools/mac/symupload/minidump_upload.m
+++ b/src/tools/mac/symupload/minidump_upload.m
@@ -68,8 +68,8 @@ static void Start(Options *options) {
encoding:NSUTF8StringEncoding];
NSLog(@"Send: %@", error ? [error description] : @"No Error");
- NSLog(@"Response: %d", [[ul response] statusCode]);
- NSLog(@"Result: %d bytes\n%@", [data length], result);
+ NSLog(@"Response: %ld", (long)[[ul response] statusCode]);
+ NSLog(@"Result: %lu bytes\n%@", (unsigned long)[data length], result);
[result release];
[ul release];
diff --git a/src/tools/mac/symupload/symupload.m b/src/tools/mac/symupload/symupload.m
index fe413458..a7cce7b0 100644
--- a/src/tools/mac/symupload/symupload.m
+++ b/src/tools/mac/symupload/symupload.m
@@ -38,6 +38,8 @@
// cpu: the CPU that the module was built for (x86 or ppc)
// symbol_file: the contents of the breakpad-format symbol file
+#include <fcntl.h>
+#include <sys/stat.h>
#include <unistd.h>
#include <Foundation/Foundation.h>
@@ -82,15 +84,6 @@ static NSArray *ModuleDataForSymbolFile(NSString *file) {
}
//=============================================================================
-static NSString *CompactIdentifier(NSString *uuid) {
- NSMutableString *str = [NSMutableString stringWithString:uuid];
- [str replaceOccurrencesOfString:@"-" withString:@"" options:0
- range:NSMakeRange(0, [str length])];
-
- return str;
-}
-
-//=============================================================================
static void Start(Options *options) {
NSURL *url = [NSURL URLWithString:options->uploadURLStr];
HTTPMultipartUpload *ul = [[HTTPMultipartUpload alloc] initWithURL:url];
@@ -174,6 +167,25 @@ SetupOptions(int argc, const char *argv[], Options *options) {
exit(1);
}
+ int fd = open(argv[optind], O_RDONLY);
+ if (fd < 0) {
+ fprintf(stderr, "%s: %s: %s\n", argv[0], argv[optind], strerror(errno));
+ exit(1);
+ }
+
+ struct stat statbuf;
+ if (fstat(fd, &statbuf) < 0) {
+ fprintf(stderr, "%s: %s: %s\n", argv[0], argv[optind], strerror(errno));
+ close(fd);
+ exit(1);
+ }
+ close(fd);
+
+ if (!S_ISREG(statbuf.st_mode)) {
+ fprintf(stderr, "%s: %s: not a regular file\n", argv[0], argv[optind]);
+ exit(1);
+ }
+
options->symbolsPath = [NSString stringWithUTF8String:argv[optind]];
options->uploadURLStr = [NSString stringWithUTF8String:argv[optind + 1]];
}
diff --git a/src/tools/mac/tools_mac.gypi b/src/tools/mac/tools_mac.gypi
index ae06f030..7457573b 100644
--- a/src/tools/mac/tools_mac.gypi
+++ b/src/tools/mac/tools_mac.gypi
@@ -55,7 +55,7 @@
'target_name': 'dump_syms',
'type': 'executable',
'sources': [
- 'dump_syms/dump_syms_tool.mm',
+ 'dump_syms/dump_syms_tool.cc',
],
'link_settings': {
'libraries': [
diff --git a/src/tools/mac/upload_system_symbols/arch_constants.h b/src/tools/mac/upload_system_symbols/arch_constants.h
index 2115e54e..e12e53e2 100644
--- a/src/tools/mac/upload_system_symbols/arch_constants.h
+++ b/src/tools/mac/upload_system_symbols/arch_constants.h
@@ -43,10 +43,15 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define CPU_SUBTYPE_ARM64_ALL 0
#endif
+#ifndef CPU_SUBTYPE_ARM64_E
+#define CPU_SUBTYPE_ARM64_E 2
+#endif
+
const cpu_type_t kCPU_TYPE_ARM = CPU_TYPE_ARM;
const cpu_type_t kCPU_TYPE_ARM64 = CPU_TYPE_ARM64;
const cpu_subtype_t kCPU_SUBTYPE_ARM64_ALL = CPU_SUBTYPE_ARM64_ALL;
+const cpu_subtype_t kCPU_SUBTYPE_ARM64_E = CPU_SUBTYPE_ARM64_E;
const cpu_subtype_t kCPU_SUBTYPE_ARM_V7S = CPU_SUBTYPE_ARM_V7S;
const char* GetNXArchInfoName(cpu_type_t cpu_type, cpu_subtype_t cpu_subtype) {
@@ -59,3 +64,4 @@ const char* GetNXArchInfoName(cpu_type_t cpu_type, cpu_subtype_t cpu_subtype) {
const uint32_t kMachHeaderFtypeDylib = MH_DYLIB;
const uint32_t kMachHeaderFtypeBundle = MH_BUNDLE;
const uint32_t kMachHeaderFtypeExe = MH_EXECUTE;
+const uint32_t kMachHeaderFtypeDylinker = MH_DYLINKER;
diff --git a/src/tools/mac/upload_system_symbols/arch_reader.go b/src/tools/mac/upload_system_symbols/arch_reader.go
index f6064823..ed98fa60 100644
--- a/src/tools/mac/upload_system_symbols/arch_reader.go
+++ b/src/tools/mac/upload_system_symbols/arch_reader.go
@@ -47,6 +47,9 @@ func getArchStringFromHeader(header macho.FileHeader) string {
if header.Cpu == C.kCPU_TYPE_ARM64 && header.SubCpu == C.kCPU_SUBTYPE_ARM64_ALL {
return "arm64"
}
+ if header.Cpu == C.kCPU_TYPE_ARM64 && header.SubCpu == C.kCPU_SUBTYPE_ARM64_E {
+ return "arm64e"
+ }
if header.Cpu == C.kCPU_TYPE_ARM && header.SubCpu == C.kCPU_SUBTYPE_ARM_V7S {
return "armv7s"
}
@@ -59,7 +62,8 @@ func getArchStringFromHeader(header macho.FileHeader) string {
}
const (
- MachODylib macho.Type = C.kMachHeaderFtypeDylib
- MachOBundle = C.kMachHeaderFtypeBundle
- MachOExe = C.kMachHeaderFtypeExe
+ MachODylib macho.Type = C.kMachHeaderFtypeDylib
+ MachOBundle = C.kMachHeaderFtypeBundle
+ MachOExe = C.kMachHeaderFtypeExe
+ MachODylinker = C.kMachHeaderFtypeDylinker
)
diff --git a/src/tools/mac/upload_system_symbols/upload_system_symbols.go b/src/tools/mac/upload_system_symbols/upload_system_symbols.go
index 35561208..05a7764a 100644
--- a/src/tools/mac/upload_system_symbols/upload_system_symbols.go
+++ b/src/tools/mac/upload_system_symbols/upload_system_symbols.go
@@ -69,13 +69,18 @@ var (
var (
// pathsToScan are the subpaths in the systemRoot that should be scanned for shared libraries.
pathsToScan = []string{
- "/Library/QuickTime",
"/System/Library/Components",
"/System/Library/Frameworks",
"/System/Library/PrivateFrameworks",
"/usr/lib",
}
+ // optionalPathsToScan is just like pathsToScan, but the paths are permitted to be absent.
+ optionalPathsToScan = []string{
+ // Gone in 10.15.
+ "/Library/QuickTime",
+ }
+
// uploadServers are the list of servers to which symbols should be uploaded.
uploadServers = []string{
"https://clients2.google.com/cr/symbol",
@@ -114,7 +119,7 @@ func main() {
if *dumpOnlyPath != "" {
// -dump-to specified, so make sure that the path is a directory.
if fi, err := os.Stat(*dumpOnlyPath); err != nil {
- log.Fatal("-dump-to location: %v", err)
+ log.Fatalf("-dump-to location: %v", err)
} else if !fi.IsDir() {
log.Fatal("-dump-to location is not a directory")
}
@@ -127,7 +132,7 @@ func main() {
uq = StartUploadQueue()
if p, err := ioutil.TempDir("", "upload_system_symbols"); err != nil {
- log.Fatal("Failed to create temporary directory: %v", err)
+ log.Fatalf("Failed to create temporary directory: %v", err)
} else {
dumpPath = p
defer os.RemoveAll(p)
@@ -266,7 +271,7 @@ func (dq *DumpQueue) worker() {
symfile := fmt.Sprintf("%s_%s.sym", filebase, req.arch)
f, err := os.Create(symfile)
if err != nil {
- log.Fatal("Error creating symbol file:", err)
+ log.Fatalf("Error creating symbol file: %v", err)
}
cmd := exec.Command(dumpSyms, "-a", req.arch, req.path)
@@ -288,13 +293,13 @@ func (dq *DumpQueue) worker() {
func uploadFromDirectory(directory string, uq *UploadQueue) {
d, err := os.Open(directory)
if err != nil {
- log.Fatal("Could not open directory to upload: %v", err)
+ log.Fatalf("Could not open directory to upload: %v", err)
}
defer d.Close()
entries, err := d.Readdirnames(0)
if err != nil {
- log.Fatal("Could not read directory: %v", err)
+ log.Fatalf("Could not read directory: %v", err)
}
for _, entry := range entries {
@@ -322,7 +327,11 @@ func findLibsInRoot(root string, dq *DumpQueue) {
fq.WorkerPool = StartWorkerPool(12, fq.worker)
for _, p := range pathsToScan {
- fq.findLibsInPath(path.Join(root, p))
+ fq.findLibsInPath(path.Join(root, p), true)
+ }
+
+ for _, p := range optionalPathsToScan {
+ fq.findLibsInPath(path.Join(root, p), false)
}
close(fq.queue)
@@ -332,23 +341,26 @@ func findLibsInRoot(root string, dq *DumpQueue) {
// findLibsInPath recursively walks the directory tree, sending file paths to
// test for being Mach-O to the findQueue.
-func (fq *findQueue) findLibsInPath(loc string) {
+func (fq *findQueue) findLibsInPath(loc string, mustExist bool) {
d, err := os.Open(loc)
if err != nil {
- log.Fatal("Could not open %s: %v", loc, err)
+ if !mustExist && os.IsNotExist(err) {
+ return
+ }
+ log.Fatalf("Could not open %s: %v", loc, err)
}
defer d.Close()
for {
fis, err := d.Readdir(100)
if err != nil && err != io.EOF {
- log.Fatal("Error reading directory %s: %v", loc, err)
+ log.Fatalf("Error reading directory %s: %v", loc, err)
}
for _, fi := range fis {
fp := path.Join(loc, fi.Name())
if fi.IsDir() {
- fq.findLibsInPath(fp)
+ fq.findLibsInPath(fp, true)
continue
} else if fi.Mode()&os.ModeSymlink != 0 {
continue
@@ -404,7 +416,7 @@ func (fq *findQueue) worker() {
}
func (fq *findQueue) dumpMachOFile(fp string, image *macho.File) {
- if image.Type != MachODylib && image.Type != MachOBundle {
+ if image.Type != MachODylib && image.Type != MachOBundle && image.Type != MachODylinker {
return
}
diff --git a/src/tools/python/deps-to-manifest.py b/src/tools/python/deps-to-manifest.py
new file mode 100755
index 00000000..b4562854
--- /dev/null
+++ b/src/tools/python/deps-to-manifest.py
@@ -0,0 +1,167 @@
+#!/usr/bin/python
+# Copyright 2016 Google Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+"""Convert gclient's DEPS file to repo's manifest xml file."""
+
+from __future__ import print_function
+
+import argparse
+import os
+import sys
+
+
+REMOTES = {
+ 'chromium': 'https://chromium.googlesource.com/',
+ 'github': 'https://github.com/',
+}
+REVIEWS = {
+ 'chromium': 'https://chromium-review.googlesource.com',
+}
+
+MANIFEST_HEAD = """<?xml version='1.0' encoding='UTF-8'?>
+<!-- AUTOGENERATED BY %(prog)s; DO NOT EDIT -->
+<manifest>
+
+ <default revision='refs/heads/master'
+ remote='chromium'
+ sync-c='true'
+ sync-j='8' />
+"""
+
+MANIFEST_REMOTE = """
+ <remote name='%(name)s'
+ fetch='%(fetch)s'
+ review='%(review)s' />
+"""
+
+MANIFEST_PROJECT = """
+ <project path='%(path)s'
+ name='%(name)s'
+ revision='%(revision)s'
+ remote='%(remote)s' />
+"""
+
+MANIFEST_TAIL = """
+</manifest>
+"""
+
+
+def ConvertDepsToManifest(deps, manifest):
+ """Convert the |deps| file to the |manifest|."""
+ # Load the DEPS file data.
+ ctx = {}
+ execfile(deps, ctx)
+
+ new_contents = ''
+
+ # Write out the common header.
+ data = {
+ 'prog': os.path.basename(__file__),
+ }
+ new_contents += MANIFEST_HEAD % data
+
+ # Write out the <remote> sections.
+ for name, fetch in REMOTES.items():
+ data = {
+ 'name': name,
+ 'fetch': fetch,
+ 'review': REVIEWS.get(name, ''),
+ }
+ new_contents += MANIFEST_REMOTE % data
+
+ # Write out the main repo itself.
+ data = {
+ 'path': 'src',
+ 'name': 'breakpad/breakpad',
+ 'revision': 'refs/heads/master',
+ 'remote': 'chromium',
+ }
+ new_contents += MANIFEST_PROJECT % data
+
+ # Write out the <project> sections.
+ for path, url in ctx['deps'].items():
+ for name, fetch in REMOTES.items():
+ if url.startswith(fetch):
+ remote = name
+ break
+ else:
+ raise ValueError('Unknown DEPS remote: %s: %s' % (path, url))
+
+ # The DEPS url will look like:
+ # https://chromium.googlesource.com/external/gyp/@e8ab0833a42691cd2
+ remote_path, rev = url.split('@')
+ remote_path = remote_path[len(fetch):]
+
+ # If it's not a revision, assume it's a tag. Repo wants full ref names.
+ if len(rev) != 40:
+ rev = 'refs/tags/%s' % rev
+
+ data = {
+ 'path': path,
+ 'name': remote_path,
+ 'revision': rev,
+ 'remote': remote,
+ }
+ new_contents += MANIFEST_PROJECT % data
+
+ # Write out the common footer.
+ new_contents += MANIFEST_TAIL
+
+ # See if the manifest has actually changed contents to avoid thrashing.
+ try:
+ old_contents = open(manifest).read()
+ except IOError:
+ # In case the file doesn't exist yet.
+ old_contents = ''
+ if old_contents != new_contents:
+ print('Updating %s due to changed %s' % (manifest, deps))
+ with open(manifest, 'w') as fp:
+ fp.write(new_contents)
+
+
+def GetParser():
+ """Return a CLI parser."""
+ parser = argparse.ArgumentParser(description=__doc__)
+ parser.add_argument('deps',
+ help='The DEPS file to convert')
+ parser.add_argument('manifest',
+ help='The manifest xml to generate')
+ return parser
+
+
+def main(argv):
+ """The main func!"""
+ parser = GetParser()
+ opts = parser.parse_args(argv)
+ ConvertDepsToManifest(opts.deps, opts.manifest)
+
+
+if __name__ == '__main__':
+ sys.exit(main(sys.argv[1:]))
diff --git a/src/tools/python/filter_syms.py b/src/tools/python/filter_syms.py
index 738cb3e9..abddf789 100644
--- a/src/tools/python/filter_syms.py
+++ b/src/tools/python/filter_syms.py
@@ -54,7 +54,7 @@ class SymbolFileParser(object):
"""Parser for Breakpad symbol files.
The format of these files is documented at
- https://code.google.com/p/google-breakpad/wiki/SymbolFiles
+ https://chromium.googlesource.com/breakpad/breakpad/+/master/docs/symbol_files.md
"""
def __init__(self, input_stream, output_stream, ignored_prefixes=None,
diff --git a/src/tools/windows/binaries/dump_syms.exe b/src/tools/windows/binaries/dump_syms.exe
index ca4676f5..3a2dfd8e 100644
--- a/src/tools/windows/binaries/dump_syms.exe
+++ b/src/tools/windows/binaries/dump_syms.exe
Binary files differ
diff --git a/src/tools/windows/binaries/symupload.exe b/src/tools/windows/binaries/symupload.exe
index ba319b26..09d2a55b 100644
--- a/src/tools/windows/binaries/symupload.exe
+++ b/src/tools/windows/binaries/symupload.exe
Binary files differ
diff --git a/src/tools/windows/converter/ms_symbol_server_converter.cc b/src/tools/windows/converter/ms_symbol_server_converter.cc
index dd3f770f..2b40faee 100644
--- a/src/tools/windows/converter/ms_symbol_server_converter.cc
+++ b/src/tools/windows/converter/ms_symbol_server_converter.cc
@@ -36,12 +36,14 @@
#include <windows.h>
#include <dbghelp.h>
+#include <pathcch.h>
#include <cassert>
#include <cstdio>
#include "tools/windows/converter/ms_symbol_server_converter.h"
#include "common/windows/pdb_source_line_writer.h"
+#include "common/windows/pe_source_line_writer.h"
#include "common/windows/string_utils-inl.h"
// SYMOPT_NO_PROMPTS is not defined in earlier platform SDKs. Define it
@@ -52,6 +54,31 @@
#define SYMOPT_NO_PROMPTS 0x00080000
#endif // SYMOPT_NO_PROMPTS
+namespace {
+
+std::wstring GetExeDirectory() {
+ wchar_t directory[MAX_PATH];
+
+ // Get path to this process exe.
+ DWORD result = GetModuleFileName(/*hModule=*/nullptr, directory, MAX_PATH);
+ if (result <= 0 || result == MAX_PATH) {
+ fprintf(stderr,
+ "GetExeDirectory: failed to get path to process exe.\n");
+ return L"";
+ }
+ HRESULT hr = PathCchRemoveFileSpec(directory, result + 1);
+ if (hr != S_OK) {
+ fprintf(stderr,
+ "GetExeDirectory: failed to remove basename from path '%ls'.\n",
+ directory);
+ return L"";
+ }
+
+ return std::wstring(directory);
+}
+
+} // namespace
+
namespace google_breakpad {
// Use sscanf_s if it is available, to quench the warning about scanf being
@@ -73,7 +100,7 @@ bool GUIDOrSignatureIdentifier::InitializeFromString(
if (length > 32 && length <= 40) {
// GUID
if (SSCANF(identifier.c_str(),
- "%08X%04X%04X%02X%02X%02X%02X%02X%02X%02X%02X%X",
+ "%08X%04hX%04hX%02hhX%02hhX%02hhX%02hhX%02hhX%02hhX%02hhX%02hhX%X",
&guid_.Data1, &guid_.Data2, &guid_.Data3,
&guid_.Data4[0], &guid_.Data4[1],
&guid_.Data4[2], &guid_.Data4[3],
@@ -153,12 +180,40 @@ class AutoSymSrv {
if (!Cleanup()) {
// Print the error message here, because destructors have no return
// value.
- fprintf(stderr, "~AutoSymSrv: SymCleanup: error %d\n", GetLastError());
+ fprintf(stderr, "~AutoSymSrv: SymCleanup: error %lu\n", GetLastError());
}
}
bool Initialize(HANDLE process, char *path, bool invade_process) {
process_ = process;
+
+ // TODO(nbilling): Figure out why dbghelp.dll is being loaded from
+ // system32/SysWOW64 before exe folder.
+
+ // Attempt to locate and load dbghelp.dll beside the process exe. This is
+ // somewhat of a workaround to loader delay load behavior that is occurring
+ // when we call into symsrv APIs. dbghelp.dll must be loaded from beside
+ // the process exe so that we are guaranteed to find symsrv.dll alongside
+ // dbghelp.dll (a security requirement of dbghelp.dll) and so that the
+ // symsrv.dll file that is loaded has a symsrv.yes file alongside it (a
+ // requirement of symsrv.dll when accessing Microsoft-owned symbol
+ // servers).
+ // 'static local' because we don't care about the value but we need the
+ // initialization to happen exactly once.
+ static HMODULE dbghelp_module = [] () -> HMODULE {
+ std::wstring exe_directory = GetExeDirectory();
+ if (exe_directory.empty()) {
+ return nullptr;
+ }
+ std::wstring dbghelp_path = exe_directory + L"\\dbghelp.dll";
+ return LoadLibrary(dbghelp_path.c_str());
+ }();
+ if (dbghelp_module == nullptr) {
+ fprintf(stderr,
+ "AutoSymSrv::Initialize: failed to load dbghelp.dll beside exe.");
+ return false;
+ }
+
initialized_ = SymInitialize(process, path, invade_process) == TRUE;
return initialized_;
}
@@ -237,7 +292,7 @@ MSSymbolServerConverter::LocateFile(const string &debug_or_code_file,
if (!symsrv.Initialize(process,
const_cast<char *>(symbol_path_.c_str()),
false)) {
- fprintf(stderr, "LocateFile: SymInitialize: error %d for %s %s %s\n",
+ fprintf(stderr, "LocateFile: SymInitialize: error %lu for %s %s %s\n",
GetLastError(),
debug_or_code_file.c_str(),
debug_or_code_id.c_str(),
@@ -248,7 +303,7 @@ MSSymbolServerConverter::LocateFile(const string &debug_or_code_file,
if (!SymRegisterCallback64(process, SymCallback,
reinterpret_cast<ULONG64>(this))) {
fprintf(stderr,
- "LocateFile: SymRegisterCallback64: error %d for %s %s %s\n",
+ "LocateFile: SymRegisterCallback64: error %lu for %s %s %s\n",
GetLastError(),
debug_or_code_file.c_str(),
debug_or_code_id.c_str(),
@@ -303,7 +358,7 @@ MSSymbolServerConverter::LocateFile(const string &debug_or_code_file,
}
fprintf(stderr,
- "LocateFile: SymFindFileInPath: error %d for %s %s %s\n",
+ "LocateFile: SymFindFileInPath: error %lu for %s %s %s\n",
error,
debug_or_code_file.c_str(),
debug_or_code_id.c_str(),
@@ -321,7 +376,7 @@ MSSymbolServerConverter::LocateFile(const string &debug_or_code_file,
// Do the cleanup here even though it will happen when symsrv goes out of
// scope, to allow it to influence the return value.
if (!symsrv.Cleanup()) {
- fprintf(stderr, "LocateFile: SymCleanup: error %d for %s %s %s\n",
+ fprintf(stderr, "LocateFile: SymCleanup: error %lu for %s %s %s\n",
GetLastError(),
debug_or_code_file.c_str(),
debug_or_code_id.c_str(),
@@ -404,7 +459,8 @@ BOOL CALLBACK MSSymbolServerConverter::SymCallback(HANDLE process,
};
for (int desc_action_index = 0;
- desc_action_index < sizeof(desc_actions) / sizeof(desc_action);
+ desc_action_index <
+ static_cast<int>(sizeof(desc_actions) / sizeof(desc_action));
++desc_action_index) {
if (desc.find(desc_actions[desc_action_index].desc) != string::npos) {
*(desc_actions[desc_action_index].action) = true;
@@ -445,7 +501,10 @@ MSSymbolServerConverter::LocateAndConvertSymbolFile(
string pdb_file;
LocateResult result = LocateSymbolFile(missing, &pdb_file);
if (result != LOCATE_SUCCESS) {
- return result;
+ fprintf(stderr, "Fallback to PE-only symbol generation for: %s\n",
+ missing.debug_file.c_str());
+ return LocateAndConvertPEFile(missing, keep_pe_file, converted_symbol_file,
+ out_pe_file);
}
if (symbol_file && keep_symbol_file) {
@@ -500,7 +559,7 @@ MSSymbolServerConverter::LocateAndConvertSymbolFile(
if (!WindowsStringUtils::safe_mbstowcs(pdb_file, &pdb_file_w)) {
fprintf(stderr,
"LocateAndConvertSymbolFile: "
- "WindowsStringUtils::safe_mbstowcs failed for %s\n",
+ "WindowsStringUtils::safe_mbstowcs failed for %ws\n",
pdb_file_w.c_str());
return LOCATE_FAILURE;
}
@@ -525,7 +584,7 @@ MSSymbolServerConverter::LocateAndConvertSymbolFile(
#if _MSC_VER >= 1400 // MSVC 2005/8
errno_t err;
if ((err = fopen_s(&converted_output, converted_symbol_file->c_str(), "w"))
- != 0) {
+ != 0) {
#else // _MSC_VER >= 1400
// fopen_s and errno_t were introduced in MSVC8. Use fopen for earlier
// environments. Don't use fopen with MSVC8 and later, because it's
@@ -536,18 +595,18 @@ MSSymbolServerConverter::LocateAndConvertSymbolFile(
err = -1;
#endif // _MSC_VER >= 1400
fprintf(stderr, "LocateAndConvertSymbolFile: "
- "fopen_s: error %d for %s %s %s %s\n",
- err,
- missing.debug_file.c_str(),
- missing.debug_identifier.c_str(),
- missing.version.c_str(),
- converted_symbol_file->c_str());
+ "fopen_s: error %d for %s %s %s %s\n",
+ err,
+ missing.debug_file.c_str(),
+ missing.debug_identifier.c_str(),
+ missing.version.c_str(),
+ converted_symbol_file->c_str());
return LOCATE_FAILURE;
}
AutoDeleter sym_deleter(*converted_symbol_file);
- bool success = writer.WriteMap(converted_output);
+ bool success = writer.WriteSymbols(converted_output);
fclose(converted_output);
if (!success) {
@@ -573,4 +632,121 @@ MSSymbolServerConverter::LocateAndConvertSymbolFile(
return LOCATE_SUCCESS;
}
+MSSymbolServerConverter::LocateResult
+MSSymbolServerConverter::LocateAndConvertPEFile(
+ const MissingSymbolInfo &missing,
+ bool keep_pe_file,
+ string *converted_symbol_file,
+ string *out_pe_file) {
+ assert(converted_symbol_file);
+ converted_symbol_file->clear();
+
+ string pe_file;
+ MSSymbolServerConverter::LocateResult result = LocatePEFile(missing,
+ &pe_file);
+ if (result != LOCATE_SUCCESS) {
+ fprintf(stderr, "WARNING: Could not download: %s\n", pe_file.c_str());
+ return result;
+ }
+
+ if (out_pe_file && keep_pe_file) {
+ *out_pe_file = pe_file;
+ }
+
+ // Conversion may fail because the file is corrupt. If a broken file is
+ // kept in the local cache, LocatePEFile will not hit the network again
+ // to attempt to locate it. To guard against problems like this, the
+ // PE file in the local cache will be removed if conversion fails.
+ AutoDeleter pe_deleter(pe_file);
+
+ // Be sure that it's a .exe or .dll file, since we'll be replacing extension
+ // with .sym for the converted file's name.
+ string pe_extension = pe_file.substr(pe_file.length() - 4);
+ // strcasecmp is called _stricmp here.
+ if (_stricmp(pe_extension.c_str(), ".exe") != 0 &&
+ _stricmp(pe_extension.c_str(), ".dll") != 0) {
+ fprintf(stderr, "LocateAndConvertPEFile: "
+ "no .dll/.exe extension for %s %s %s %s\n",
+ missing.debug_file.c_str(),
+ missing.debug_identifier.c_str(),
+ missing.version.c_str(),
+ pe_file.c_str());
+ return LOCATE_FAILURE;
+ }
+
+ *converted_symbol_file = pe_file.substr(0, pe_file.length() - 4) + ".sym";
+
+ FILE *converted_output = NULL;
+#if _MSC_VER >= 1400 // MSVC 2005/8
+ errno_t err;
+ if ((err = fopen_s(&converted_output, converted_symbol_file->c_str(), "w"))
+ != 0) {
+#else // _MSC_VER >= 1400
+ // fopen_s and errno_t were introduced in MSVC8. Use fopen for earlier
+ // environments. Don't use fopen with MSVC8 and later, because it's
+ // deprecated. fopen does not provide reliable error codes, so just use
+ // -1 in the event of a failure.
+ int err;
+ if (!(converted_output = fopen(converted_symbol_file->c_str(), "w"))) {
+ err = -1;
+#endif // _MSC_VER >= 1400
+ fprintf(stderr, "LocateAndConvertPEFile: "
+ "fopen_s: error %d for %s %s %s %s\n",
+ err,
+ missing.debug_file.c_str(),
+ missing.debug_identifier.c_str(),
+ missing.version.c_str(),
+ converted_symbol_file->c_str());
+ return LOCATE_FAILURE;
+ }
+ AutoDeleter sym_deleter(*converted_symbol_file);
+
+ wstring pe_file_w;
+ if (!WindowsStringUtils::safe_mbstowcs(pe_file, &pe_file_w)) {
+ fprintf(stderr,
+ "LocateAndConvertPEFile: "
+ "WindowsStringUtils::safe_mbstowcs failed for %s\n",
+ pe_file.c_str());
+ return LOCATE_FAILURE;
+ }
+ PESourceLineWriter writer(pe_file_w);
+ PDBModuleInfo module_info;
+ if (!writer.GetModuleInfo(&module_info)) {
+ fprintf(stderr, "LocateAndConvertPEFile: "
+ "PESourceLineWriter::GetModuleInfo failed for %s %s %s %s\n",
+ missing.debug_file.c_str(),
+ missing.debug_identifier.c_str(),
+ missing.version.c_str(),
+ pe_file.c_str());
+ return LOCATE_FAILURE;
+ }
+ if (module_info.cpu.compare(L"x86_64") != 0) {
+ // This module is not x64 so we cannot generate Breakpad symbols from the
+ // PE alone. Don't delete PE-- no need to retry download.
+ pe_deleter.Release();
+ return LOCATE_FAILURE;
+ }
+
+ bool success = writer.WriteSymbols(converted_output);
+ fclose(converted_output);
+
+ if (!success) {
+ fprintf(stderr, "LocateAndConvertPEFile: "
+ "PESourceLineWriter::WriteMap failed for %s %s %s %s\n",
+ missing.debug_file.c_str(),
+ missing.debug_identifier.c_str(),
+ missing.version.c_str(),
+ pe_file.c_str());
+ return LOCATE_FAILURE;
+ }
+
+ if (keep_pe_file) {
+ pe_deleter.Release();
+ }
+
+ sym_deleter.Release();
+
+ return LOCATE_SUCCESS;
+}
+
} // namespace google_breakpad
diff --git a/src/tools/windows/converter/ms_symbol_server_converter.h b/src/tools/windows/converter/ms_symbol_server_converter.h
index d601b433..401f7c34 100644
--- a/src/tools/windows/converter/ms_symbol_server_converter.h
+++ b/src/tools/windows/converter/ms_symbol_server_converter.h
@@ -177,6 +177,22 @@ class MSSymbolServerConverter {
string *symbol_file,
string *pe_file);
+ // Calls LocatePEFile and converts the returned PE file to the
+ // dumped-symbol format, storing it adjacent to the PE file. The
+ // only conversion supported is from PE files. Returns the return
+ // value of LocatePEFile, or if LocatePEFile succeeds but
+ // conversion fails, returns LOCATE_FAILURE. The pathname to the
+ // PE file and to the converted symbol file are returned in
+ // |converted_symbol_file| and |pe_file|. |pe_file| is optional and may be
+ // NULL. If only the converted symbol file is desired, set |keep_pe_file|
+ // to false to indicate that the executable file (exe, dll) should be deleted
+ // after conversion.
+ // NOTE: Currrently only supports x64 PEs.
+ LocateResult LocateAndConvertPEFile(const MissingSymbolInfo &missing,
+ bool keep_pe_file,
+ string *converted_symbol_file,
+ string *pe_file);
+
private:
// Locates the PDB or PE file (DLL or EXE) specified by the identifying
// information in |debug_or_code_file| and |debug_or_code_id|, by checking
diff --git a/src/tools/windows/converter_exe/configure.cmd b/src/tools/windows/converter_exe/configure.cmd
new file mode 100644
index 00000000..5464a61e
--- /dev/null
+++ b/src/tools/windows/converter_exe/configure.cmd
@@ -0,0 +1,33 @@
+@if "%ECHOON%"=="" @echo off
+SETLOCAL
+
+REM ******************************************************************
+REM Please, make sure to run this in an Elevated Command Prompt.
+REM Usage:
+REM configure.cmd
+REM ******************************************************************
+
+REM ******************************************************************
+REM Initialize
+REM ******************************************************************
+SET SCRIPT_LOCATION=%~dp0
+
+REM ******************************************************************
+REM Go to script location
+REM ******************************************************************
+pushd %SCRIPT_LOCATION%
+
+REM ******************************************************************
+REM Register msdia140.dll.
+REM ******************************************************************
+SET MSG=Failed to register msdia140.dll. Make sure to run this in elevated command prompt.
+%systemroot%\SysWoW64\regsvr32.exe /s msdia140.dll & if errorlevel 1 echo %MSG% & goto :fail
+
+:success
+echo Configuration was successful.
+ENDLOCAL
+exit /b 0
+
+:fail
+ENDLOCAL
+exit /b 1
diff --git a/src/tools/windows/converter_exe/converter.cc b/src/tools/windows/converter_exe/converter.cc
new file mode 100644
index 00000000..5b70903a
--- /dev/null
+++ b/src/tools/windows/converter_exe/converter.cc
@@ -0,0 +1,807 @@
+// Copyright 2019 Google Inc. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#pragma comment(lib, "winhttp.lib")
+#pragma comment(lib, "wininet.lib")
+#pragma comment(lib, "diaguids.lib")
+#pragma comment(lib, "imagehlp.lib")
+
+#include <cassert>
+#include <cstdio>
+#include <ctime>
+#include <map>
+#include <regex>
+#include <string>
+#include <vector>
+
+#include "tools/windows/converter_exe/escaping.h"
+#include "tools/windows/converter_exe/http_download.h"
+#include "tools/windows/converter_exe/tokenizer.h"
+#include "common/windows/http_upload.h"
+#include "common/windows/string_utils-inl.h"
+#include "tools/windows/converter/ms_symbol_server_converter.h"
+
+using strings::WebSafeBase64Unescape;
+using strings::WebSafeBase64Escape;
+
+namespace {
+
+using std::map;
+using std::string;
+using std::vector;
+using std::wstring;
+using crash::HTTPDownload;
+using crash::Tokenizer;
+using google_breakpad::HTTPUpload;
+using google_breakpad::MissingSymbolInfo;
+using google_breakpad::MSSymbolServerConverter;
+using google_breakpad::WindowsStringUtils;
+
+const char *kMissingStringDelimiters = "|";
+const char *kLocalCachePath = "c:\\symbols";
+const char *kNoExeMSSSServer = "http://msdl.microsoft.com/download/symbols/";
+
+// Windows stdio doesn't do line buffering. Use this function to flush after
+// writing to stdout and stderr so that a log will be available if the
+// converter crashes.
+static int FprintfFlush(FILE *file, const char *format, ...) {
+ va_list arguments;
+ va_start(arguments, format);
+ int retval = vfprintf(file, format, arguments);
+ va_end(arguments);
+ fflush(file);
+ return retval;
+}
+
+static string CurrentDateAndTime() {
+ const string kUnknownDateAndTime = R"(????-??-?? ??:??:??)";
+
+ time_t current_time;
+ time(&current_time);
+
+ // localtime_s is safer but is only available in MSVC8. Use localtime
+ // in earlier environments.
+ struct tm *time_pointer;
+#if _MSC_VER >= 1400 // MSVC 2005/8
+ struct tm time_struct;
+ time_pointer = &time_struct;
+ if (localtime_s(time_pointer, &current_time) != 0) {
+ return kUnknownDateAndTime;
+ }
+#else // _MSC_VER >= 1400
+ time_pointer = localtime(&current_time);
+ if (!time_pointer) {
+ return kUnknownDateAndTime;
+ }
+#endif // _MSC_VER >= 1400
+
+ char buffer[256];
+ if (!strftime(buffer, sizeof(buffer), "%Y-%m-%d %H:%M:%S", time_pointer)) {
+ return kUnknownDateAndTime;
+ }
+
+ return string(buffer);
+}
+
+// ParseMissingString turns |missing_string| into a MissingSymbolInfo
+// structure. It returns true on success, and false if no such conversion
+// is possible.
+static bool ParseMissingString(const string &missing_string,
+ MissingSymbolInfo *missing_info) {
+ assert(missing_info);
+
+ vector<string> tokens;
+ Tokenizer::Tokenize(kMissingStringDelimiters, missing_string, &tokens);
+ if (tokens.size() != 5) {
+ return false;
+ }
+
+ missing_info->debug_file = tokens[0];
+ missing_info->debug_identifier = tokens[1];
+ missing_info->version = tokens[2];
+ missing_info->code_file = tokens[3];
+ missing_info->code_identifier = tokens[4];
+
+ return true;
+}
+
+// StringMapToWStringMap takes each element in a map that associates
+// (narrow) strings to strings and converts the keys and values to wstrings.
+// Returns true on success and false on failure, printing an error message.
+static bool StringMapToWStringMap(const map<string, string> &smap,
+ map<wstring, wstring> *wsmap) {
+ assert(wsmap);
+ wsmap->clear();
+
+ for (map<string, string>::const_iterator iterator = smap.begin();
+ iterator != smap.end();
+ ++iterator) {
+ wstring key;
+ if (!WindowsStringUtils::safe_mbstowcs(iterator->first, &key)) {
+ FprintfFlush(stderr,
+ "StringMapToWStringMap: safe_mbstowcs failed for key %s\n",
+ iterator->first.c_str());
+ return false;
+ }
+
+ wstring value;
+ if (!WindowsStringUtils::safe_mbstowcs(iterator->second, &value)) {
+ FprintfFlush(stderr, "StringMapToWStringMap: safe_mbstowcs failed "
+ "for value %s\n",
+ iterator->second.c_str());
+ return false;
+ }
+
+ wsmap->insert(make_pair(key, value));
+ }
+
+ return true;
+}
+
+// MissingSymbolInfoToParameters turns a MissingSymbolInfo structure into a
+// map of parameters suitable for passing to HTTPDownload or HTTPUpload.
+// Returns true on success and false on failure, printing an error message.
+static bool MissingSymbolInfoToParameters(const MissingSymbolInfo &missing_info,
+ map<wstring, wstring> *wparameters) {
+ assert(wparameters);
+
+ map<string, string> parameters;
+ string encoded_param;
+ // Indicate the params are encoded.
+ parameters["encoded"] = "true"; // The string value here does not matter.
+
+ WebSafeBase64Escape(missing_info.code_file, &encoded_param);
+ parameters["code_file"] = encoded_param;
+
+ WebSafeBase64Escape(missing_info.code_identifier, &encoded_param);
+ parameters["code_identifier"] = encoded_param;
+
+ WebSafeBase64Escape(missing_info.debug_file, &encoded_param);
+ parameters["debug_file"] = encoded_param;
+
+ WebSafeBase64Escape(missing_info.debug_identifier, &encoded_param);
+ parameters["debug_identifier"] = encoded_param;
+
+ if (!missing_info.version.empty()) {
+ // The version is optional.
+ WebSafeBase64Escape(missing_info.version, &encoded_param);
+ parameters["version"] = encoded_param;
+ }
+
+ WebSafeBase64Escape("WinSymConv", &encoded_param);
+ parameters["product"] = encoded_param;
+
+ if (!StringMapToWStringMap(parameters, wparameters)) {
+ // StringMapToWStringMap will have printed an error.
+ return false;
+ }
+
+ return true;
+}
+
+// UploadSymbolFile sends |converted_file| as identified by |missing_info|
+// to the symbol server rooted at |upload_symbol_url|. Returns true on
+// success and false on failure, printing an error message.
+static bool UploadSymbolFile(const wstring &upload_symbol_url,
+ const MissingSymbolInfo &missing_info,
+ const string &converted_file) {
+ map<wstring, wstring> parameters;
+ if (!MissingSymbolInfoToParameters(missing_info, &parameters)) {
+ // MissingSymbolInfoToParameters or a callee will have printed an error.
+ return false;
+ }
+
+ wstring converted_file_w;
+
+ if (!WindowsStringUtils::safe_mbstowcs(converted_file, &converted_file_w)) {
+ FprintfFlush(stderr, "UploadSymbolFile: safe_mbstowcs failed for %s\n",
+ converted_file.c_str());
+ return false;
+ }
+ map<wstring, wstring> files;
+ files[L"symbol_file"] = converted_file_w;
+
+ FprintfFlush(stderr, "Uploading %s\n", converted_file.c_str());
+ if (!HTTPUpload::SendMultipartPostRequest(
+ upload_symbol_url, parameters,
+ files, NULL, NULL, NULL)) {
+ FprintfFlush(stderr, "UploadSymbolFile: HTTPUpload::SendRequest failed "
+ "for %s %s %s\n",
+ missing_info.debug_file.c_str(),
+ missing_info.debug_identifier.c_str(),
+ missing_info.version.c_str());
+ return false;
+ }
+
+ return true;
+}
+
+// SendFetchFailedPing informs the symbol server based at
+// |fetch_symbol_failure_url| that the symbol file identified by
+// |missing_info| could authoritatively not be located. Returns
+// true on success and false on failure.
+static bool SendFetchFailedPing(const wstring &fetch_symbol_failure_url,
+ const MissingSymbolInfo &missing_info) {
+ map<wstring, wstring> parameters;
+ if (!MissingSymbolInfoToParameters(missing_info, &parameters)) {
+ // MissingSymbolInfoToParameters or a callee will have printed an error.
+ return false;
+ }
+
+ string content;
+ if (!HTTPDownload::Download(fetch_symbol_failure_url,
+ &parameters,
+ &content,
+ NULL)) {
+ FprintfFlush(stderr, "SendFetchFailedPing: HTTPDownload::Download failed "
+ "for %s %s %s\n",
+ missing_info.debug_file.c_str(),
+ missing_info.debug_identifier.c_str(),
+ missing_info.version.c_str());
+ return false;
+ }
+
+ return true;
+}
+
+// Returns true if it's safe to make an external request for the symbol
+// file described in missing_info. It's considered safe to make an
+// external request unless the symbol file's debug_file string matches
+// the given blacklist regular expression.
+// The debug_file name is used from the MissingSymbolInfo struct,
+// matched against the blacklist_regex.
+static bool SafeToMakeExternalRequest(const MissingSymbolInfo &missing_info,
+ std::regex blacklist_regex) {
+ string file_name = missing_info.debug_file;
+ // Use regex_search because we want to match substrings.
+ if (std::regex_search(file_name, blacklist_regex)) {
+ FprintfFlush(stderr, "Not safe to make external request for file %s\n",
+ file_name.c_str());
+ return false;
+ }
+
+ return true;
+}
+
+// Converter options derived from command line parameters.
+struct ConverterOptions {
+ ConverterOptions()
+ : report_fetch_failures(true) {
+ }
+
+ ~ConverterOptions() {
+ }
+
+ // Names of MS Symbol Supplier Servers that are internal to Google, and may
+ // have symbols for any request.
+ vector<string> full_internal_msss_servers;
+
+ // Names of MS Symbol Supplier Servers that are internal to Google, and
+ // shouldn't be checked for symbols for any .exe files.
+ vector<string> full_external_msss_servers;
+
+ // Names of MS Symbol Supplier Servers that are external to Google, and may
+ // have symbols for any request.
+ vector<string> no_exe_internal_msss_servers;
+
+ // Names of MS Symbol Supplier Servers that are external to Google, and
+ // shouldn't be checked for symbols for any .exe files.
+ vector<string> no_exe_external_msss_servers;
+
+ // Temporary local storage for symbols.
+ string local_cache_path;
+
+ // URL for uploading symbols.
+ wstring upload_symbols_url;
+
+ // URL to fetch list of missing symbols.
+ wstring missing_symbols_url;
+
+ // URL to report symbol fetch failure.
+ wstring fetch_symbol_failure_url;
+
+ // Are symbol fetch failures reported.
+ bool report_fetch_failures;
+
+ // File containing the list of missing symbols. Fetch failures are not
+ // reported if such file is provided.
+ string missing_symbols_file;
+
+ // Regex used to blacklist files to prevent external symbol requests.
+ // Owned and cleaned up by this struct.
+ std::regex blacklist_regex;
+
+ private:
+ // DISABLE_COPY_AND_ASSIGN
+ ConverterOptions(const ConverterOptions&);
+ ConverterOptions& operator=(const ConverterOptions&);
+};
+
+// ConverMissingSymbolFile takes a single MissingSymbolInfo structure and
+// attempts to locate it from the symbol servers provided in the
+// |options.*_msss_servers| arguments. "Full" servers are those that will be
+// queried for all symbol files; "No-EXE" servers will only be queried for
+// modules whose missing symbol data indicates are not main program executables.
+// Results will be sent to the |options.upload_symbols_url| on success or
+// |options.fetch_symbol_failure_url| on failure, and the local cache will be
+// stored at |options.local_cache_path|. Because nothing can be done even in
+// the event of a failure, this function returns no value, although it
+// may result in error messages being printed.
+static void ConvertMissingSymbolFile(const MissingSymbolInfo &missing_info,
+ const ConverterOptions &options) {
+ string time_string = CurrentDateAndTime();
+ FprintfFlush(stdout, "converter: %s: attempting %s %s %s\n",
+ time_string.c_str(),
+ missing_info.debug_file.c_str(),
+ missing_info.debug_identifier.c_str(),
+ missing_info.version.c_str());
+
+ // The first lookup is always to internal symbol servers.
+ // Always ask the symbol servers identified as "full."
+ vector<string> msss_servers = options.full_internal_msss_servers;
+
+ // If the file is not an .exe file, also ask an additional set of symbol
+ // servers, such as Microsoft's public symbol server.
+ bool is_exe = false;
+
+ if (missing_info.code_file.length() >= 4) {
+ string code_extension =
+ missing_info.code_file.substr(missing_info.code_file.size() - 4);
+
+ // Firefox is a special case: .dll-only servers should be consulted for
+ // its symbols. This enables us to get its symbols from Mozilla's
+ // symbol server when crashes occur in Google extension code hosted by a
+ // Firefox process.
+ if (_stricmp(code_extension.c_str(), ".exe") == 0 &&
+ _stricmp(missing_info.code_file.c_str(), "firefox.exe") != 0) {
+ is_exe = true;
+ }
+ }
+
+ if (!is_exe) {
+ msss_servers.insert(msss_servers.end(),
+ options.no_exe_internal_msss_servers.begin(),
+ options.no_exe_internal_msss_servers.end());
+ }
+
+ // If there are any suitable internal symbol servers, make a request.
+ MSSymbolServerConverter::LocateResult located =
+ MSSymbolServerConverter::LOCATE_FAILURE;
+ string converted_file;
+ if (msss_servers.size() > 0) {
+ // Attempt to fetch the symbol file and convert it.
+ FprintfFlush(stderr, "Making internal request for %s (%s)\n",
+ missing_info.debug_file.c_str(),
+ missing_info.debug_identifier.c_str());
+ MSSymbolServerConverter converter(options.local_cache_path, msss_servers);
+ located = converter.LocateAndConvertSymbolFile(missing_info,
+ false, // keep_symbol_file
+ false, // keep_pe_file
+ &converted_file,
+ NULL, // symbol_file
+ NULL); // pe_file
+ switch (located) {
+ case MSSymbolServerConverter::LOCATE_SUCCESS:
+ FprintfFlush(stderr, "LocateResult = LOCATE_SUCCESS\n");
+ // Upload it. Don't bother checking the return value. If this
+ // succeeds, it should disappear from the missing symbol list.
+ // If it fails, something will print an error message indicating
+ // the cause of the failure, and the item will remain on the
+ // missing symbol list.
+ UploadSymbolFile(options.upload_symbols_url, missing_info,
+ converted_file);
+ remove(converted_file.c_str());
+
+ // Note: this does leave some directories behind that could be
+ // cleaned up. The directories inside options.local_cache_path for
+ // debug_file/debug_identifier can be removed at this point.
+ break;
+
+ case MSSymbolServerConverter::LOCATE_NOT_FOUND:
+ FprintfFlush(stderr, "LocateResult = LOCATE_NOT_FOUND\n");
+ // The symbol file definitively did not exist. Fall through,
+ // so we can attempt an external query if it's safe to do so.
+ break;
+
+ case MSSymbolServerConverter::LOCATE_RETRY:
+ FprintfFlush(stderr, "LocateResult = LOCATE_RETRY\n");
+ // Fall through in case we should make an external request.
+ // If not, or if an external request fails in the same way,
+ // we'll leave the entry in the symbol file list and
+ // try again on a future pass. Print a message so that there's
+ // a record.
+ break;
+
+ case MSSymbolServerConverter::LOCATE_FAILURE:
+ FprintfFlush(stderr, "LocateResult = LOCATE_FAILURE\n");
+ // LocateAndConvertSymbolFile printed an error message.
+ break;
+
+ default:
+ FprintfFlush(
+ stderr,
+ "FATAL: Unexpected return value '%d' from "
+ "LocateAndConvertSymbolFile()\n",
+ located);
+ assert(0);
+ break;
+ }
+ } else {
+ // No suitable internal symbol servers. This is fine because the converter
+ // is mainly used for downloading and converting of external symbols.
+ }
+
+ // Make a request to an external server if the internal request didn't
+ // succeed, and it's safe to do so.
+ if (located != MSSymbolServerConverter::LOCATE_SUCCESS &&
+ SafeToMakeExternalRequest(missing_info, options.blacklist_regex)) {
+ msss_servers = options.full_external_msss_servers;
+ if (!is_exe) {
+ msss_servers.insert(msss_servers.end(),
+ options.no_exe_external_msss_servers.begin(),
+ options.no_exe_external_msss_servers.end());
+ }
+ if (msss_servers.size() > 0) {
+ FprintfFlush(stderr, "Making external request for %s (%s)\n",
+ missing_info.debug_file.c_str(),
+ missing_info.debug_identifier.c_str());
+ MSSymbolServerConverter external_converter(options.local_cache_path,
+ msss_servers);
+ located = external_converter.LocateAndConvertSymbolFile(
+ missing_info,
+ false, // keep_symbol_file
+ false, // keep_pe_file
+ &converted_file,
+ NULL, // symbol_file
+ NULL); // pe_file
+ } else {
+ FprintfFlush(stderr, "ERROR: No suitable external symbol servers.\n");
+ }
+ }
+
+ // Final handling for this symbol file is based on the result from the
+ // external request (if performed above), or on the result from the
+ // previous internal lookup.
+ switch (located) {
+ case MSSymbolServerConverter::LOCATE_SUCCESS:
+ FprintfFlush(stderr, "LocateResult = LOCATE_SUCCESS\n");
+ // Upload it. Don't bother checking the return value. If this
+ // succeeds, it should disappear from the missing symbol list.
+ // If it fails, something will print an error message indicating
+ // the cause of the failure, and the item will remain on the
+ // missing symbol list.
+ UploadSymbolFile(options.upload_symbols_url, missing_info,
+ converted_file);
+ remove(converted_file.c_str());
+
+ // Note: this does leave some directories behind that could be
+ // cleaned up. The directories inside options.local_cache_path for
+ // debug_file/debug_identifier can be removed at this point.
+ break;
+
+ case MSSymbolServerConverter::LOCATE_NOT_FOUND:
+ // The symbol file definitively didn't exist. Inform the server.
+ // If this fails, something will print an error message indicating
+ // the cause of the failure, but there's really nothing more to
+ // do. If this succeeds, the entry should be removed from the
+ // missing symbols list.
+ if (!options.report_fetch_failures) {
+ FprintfFlush(stderr, "SendFetchFailedPing skipped\n");
+ } else if (SendFetchFailedPing(options.fetch_symbol_failure_url,
+ missing_info)) {
+ FprintfFlush(stderr, "SendFetchFailedPing succeeded\n");
+ } else {
+ FprintfFlush(stderr, "SendFetchFailedPing failed\n");
+ }
+ break;
+
+ case MSSymbolServerConverter::LOCATE_RETRY:
+ FprintfFlush(stderr, "LocateResult = LOCATE_RETRY\n");
+ // Nothing to do but leave the entry in the symbol file list and
+ // try again on a future pass. Print a message so that there's
+ // a record.
+ FprintfFlush(stderr, "ConvertMissingSymbolFile: deferring retry "
+ "for %s %s %s\n",
+ missing_info.debug_file.c_str(),
+ missing_info.debug_identifier.c_str(),
+ missing_info.version.c_str());
+ break;
+
+ case MSSymbolServerConverter::LOCATE_FAILURE:
+ FprintfFlush(stderr, "LocateResult = LOCATE_FAILURE\n");
+ // LocateAndConvertSymbolFile printed an error message.
+
+ // This is due to a bad debug file name, so fetch failed.
+ if (!options.report_fetch_failures) {
+ FprintfFlush(stderr, "SendFetchFailedPing skipped\n");
+ } else if (SendFetchFailedPing(options.fetch_symbol_failure_url,
+ missing_info)) {
+ FprintfFlush(stderr, "SendFetchFailedPing succeeded\n");
+ } else {
+ FprintfFlush(stderr, "SendFetchFailedPing failed\n");
+ }
+ break;
+
+ default:
+ FprintfFlush(
+ stderr,
+ "FATAL: Unexpected return value '%d' from "
+ "LocateAndConvertSymbolFile()\n",
+ located);
+ assert(0);
+ break;
+ }
+}
+
+
+// Reads the contents of file |file_name| and populates |contents|.
+// Returns true on success.
+static bool ReadFile(string file_name, string *contents) {
+ char buffer[1024 * 8];
+ FILE *fp = fopen(file_name.c_str(), "rt");
+ if (!fp) {
+ return false;
+ }
+ contents->clear();
+ while (fgets(buffer, sizeof(buffer), fp) != NULL) {
+ contents->append(buffer);
+ }
+ fclose(fp);
+ return true;
+}
+
+// ConvertMissingSymbolsList obtains a missing symbol list from
+// |options.missing_symbols_url| or |options.missing_symbols_file| and calls
+// ConvertMissingSymbolFile for each missing symbol file in the list.
+static bool ConvertMissingSymbolsList(const ConverterOptions &options) {
+ // Set param to indicate requesting for encoded response.
+ map<wstring, wstring> parameters;
+ parameters[L"product"] = L"WinSymConv";
+ parameters[L"encoded"] = L"true";
+ // Get the missing symbol list.
+ string missing_symbol_list;
+ if (!options.missing_symbols_file.empty()) {
+ if (!ReadFile(options.missing_symbols_file, &missing_symbol_list)) {
+ return false;
+ }
+ } else if (!HTTPDownload::Download(options.missing_symbols_url, &parameters,
+ &missing_symbol_list, NULL)) {
+ return false;
+ }
+
+ // Tokenize the content into a vector.
+ vector<string> missing_symbol_lines;
+ Tokenizer::Tokenize("\n", missing_symbol_list, &missing_symbol_lines);
+
+ FprintfFlush(stderr, "Found %d missing symbol files in list.\n",
+ missing_symbol_lines.size() - 1); // last line is empty.
+ int convert_attempts = 0;
+ for (vector<string>::const_iterator iterator = missing_symbol_lines.begin();
+ iterator != missing_symbol_lines.end();
+ ++iterator) {
+ // Decode symbol line.
+ const string &encoded_line = *iterator;
+ // Skip lines that are blank.
+ if (encoded_line.empty()) {
+ continue;
+ }
+
+ string line;
+ if (!WebSafeBase64Unescape(encoded_line, &line)) {
+ // If decoding fails, assume the line is not encoded.
+ // This is helpful when the program connects to a debug server without
+ // encoding.
+ line = encoded_line;
+ }
+
+ FprintfFlush(stderr, "\nLine: %s\n", line.c_str());
+
+ // Turn each element into a MissingSymbolInfo structure.
+ MissingSymbolInfo missing_info;
+ if (!ParseMissingString(line, &missing_info)) {
+ FprintfFlush(stderr, "ConvertMissingSymbols: ParseMissingString failed "
+ "for %s from %ws\n",
+ line.c_str(), options.missing_symbols_url.c_str());
+ continue;
+ }
+
+ ++convert_attempts;
+ ConvertMissingSymbolFile(missing_info, options);
+ }
+
+ // Say something reassuring, since ConvertMissingSymbolFile was never called
+ // and therefore never reported any progress.
+ if (convert_attempts == 0) {
+ string current_time = CurrentDateAndTime();
+ FprintfFlush(stdout, "converter: %s: nothing to convert\n",
+ current_time.c_str());
+ }
+
+ return true;
+}
+
+// usage prints the usage message. It returns 1 as a convenience, to be used
+// as a return value from main.
+static int usage(const char *program_name) {
+ FprintfFlush(stderr,
+ "usage: %s [options]\n"
+ " -f <full_msss_server> MS servers to ask for all symbols\n"
+ " -n <no_exe_msss_server> same, but prevent asking for EXEs\n"
+ " -l <local_cache_path> Temporary local storage for symbols\n"
+ " -s <upload_url> URL for uploading symbols\n"
+ " -m <missing_symbols_url> URL to fetch list of missing symbols\n"
+ " -mf <missing_symbols_file> File containing the list of missing\n"
+ " symbols. Fetch failures are not\n"
+ " reported if such file is provided.\n"
+ " -t <fetch_failure_url> URL to report symbol fetch failure\n"
+ " -b <regex> Regex used to blacklist files to\n"
+ " prevent external symbol requests\n"
+ " Note that any server specified by -f or -n that starts with \\filer\n"
+ " will be treated as internal, and all others as external.\n",
+ program_name);
+
+ return 1;
+}
+
+// "Internal" servers consist only of those whose names start with
+// the literal string "\\filer\".
+static bool IsInternalServer(const string &server_name) {
+ if (server_name.find("\\\\filer\\") == 0) {
+ return true;
+ }
+ return false;
+}
+
+// Adds a server with the given name to the list of internal or external
+// servers, as appropriate.
+static void AddServer(const string &server_name,
+ vector<string> *internal_servers,
+ vector<string> *external_servers) {
+ if (IsInternalServer(server_name)) {
+ internal_servers->push_back(server_name);
+ } else {
+ external_servers->push_back(server_name);
+ }
+}
+
+} // namespace
+
+int main(int argc, char **argv) {
+ string time_string = CurrentDateAndTime();
+ FprintfFlush(stdout, "converter: %s: starting\n", time_string.c_str());
+
+ ConverterOptions options;
+ options.report_fetch_failures = true;
+
+ // All arguments are paired.
+ if (argc % 2 != 1) {
+ return usage(argv[0]);
+ }
+
+ string blacklist_regex_str;
+ bool have_any_msss_servers = false;
+ for (int argi = 1; argi < argc; argi += 2) {
+ string option = argv[argi];
+ string value = argv[argi + 1];
+
+ if (option == "-f") {
+ AddServer(value, &options.full_internal_msss_servers,
+ &options.full_external_msss_servers);
+ have_any_msss_servers = true;
+ } else if (option == "-n") {
+ AddServer(value, &options.no_exe_internal_msss_servers,
+ &options.no_exe_external_msss_servers);
+ have_any_msss_servers = true;
+ } else if (option == "-l") {
+ if (!options.local_cache_path.empty()) {
+ return usage(argv[0]);
+ }
+ options.local_cache_path = value;
+ } else if (option == "-s") {
+ if (!WindowsStringUtils::safe_mbstowcs(value,
+ &options.upload_symbols_url)) {
+ FprintfFlush(stderr, "main: safe_mbstowcs failed for %s\n",
+ value.c_str());
+ return 1;
+ }
+ } else if (option == "-m") {
+ if (!WindowsStringUtils::safe_mbstowcs(value,
+ &options.missing_symbols_url)) {
+ FprintfFlush(stderr, "main: safe_mbstowcs failed for %s\n",
+ value.c_str());
+ return 1;
+ }
+ } else if (option == "-mf") {
+ options.missing_symbols_file = value;
+ printf("Getting the list of missing symbols from a file. Fetch failures"
+ " will not be reported.\n");
+ options.report_fetch_failures = false;
+ } else if (option == "-t") {
+ if (!WindowsStringUtils::safe_mbstowcs(
+ value,
+ &options.fetch_symbol_failure_url)) {
+ FprintfFlush(stderr, "main: safe_mbstowcs failed for %s\n",
+ value.c_str());
+ return 1;
+ }
+ } else if (option == "-b") {
+ blacklist_regex_str = value;
+ } else {
+ return usage(argv[0]);
+ }
+ }
+
+ if (blacklist_regex_str.empty()) {
+ FprintfFlush(stderr, "No blacklist specified.\n");
+ return usage(argv[0]);
+ }
+
+ // Compile the blacklist regular expression for later use.
+ options.blacklist_regex = std::regex(blacklist_regex_str.c_str(),
+ std::regex_constants::icase);
+
+ // Set the defaults. If the user specified any MSSS servers, don't use
+ // any default.
+ if (!have_any_msss_servers) {
+ AddServer(kNoExeMSSSServer, &options.no_exe_internal_msss_servers,
+ &options.no_exe_external_msss_servers);
+ }
+
+ if (options.local_cache_path.empty()) {
+ options.local_cache_path = kLocalCachePath;
+ }
+
+ if (options.upload_symbols_url.empty()) {
+ FprintfFlush(stderr, "No upload symbols URL specified.\n");
+ return usage(argv[0]);
+ }
+ if (options.missing_symbols_url.empty() &&
+ options.missing_symbols_file.empty()) {
+ FprintfFlush(stderr, "No missing symbols URL or file specified.\n");
+ return usage(argv[0]);
+ }
+ if (options.fetch_symbol_failure_url.empty()) {
+ FprintfFlush(stderr, "No fetch symbol failure URL specified.\n");
+ return usage(argv[0]);
+ }
+
+ FprintfFlush(stdout,
+ "# of Symbol Servers (int/ext): %d/%d full, %d/%d no_exe\n",
+ options.full_internal_msss_servers.size(),
+ options.full_external_msss_servers.size(),
+ options.no_exe_internal_msss_servers.size(),
+ options.no_exe_external_msss_servers.size());
+
+ if (!ConvertMissingSymbolsList(options)) {
+ return 1;
+ }
+
+ time_string = CurrentDateAndTime();
+ FprintfFlush(stdout, "converter: %s: finished\n", time_string.c_str());
+ return 0;
+}
diff --git a/src/testing/gtest/test/gtest_uninitialized_test.py b/src/tools/windows/converter_exe/converter.gyp
index 6ae57eee..fe443d1b 100755..100644
--- a/src/testing/gtest/test/gtest_uninitialized_test.py
+++ b/src/tools/windows/converter_exe/converter.gyp
@@ -1,7 +1,4 @@
-#!/usr/bin/env python
-#
-# Copyright 2008, Google Inc.
-# All rights reserved.
+# Copyright 2013 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
@@ -29,42 +26,32 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-"""Verifies that Google Test warns the user when not initialized properly."""
-
-__author__ = 'wan@google.com (Zhanyong Wan)'
-
-import gtest_test_utils
-
-
-COMMAND = gtest_test_utils.GetTestExecutablePath('gtest_uninitialized_test_')
-
-
-def Assert(condition):
- if not condition:
- raise AssertionError
-
-
-def AssertEq(expected, actual):
- if expected != actual:
- print 'Expected: %s' % (expected,)
- print ' Actual: %s' % (actual,)
- raise AssertionError
-
-
-def TestExitCodeAndOutput(command):
- """Runs the given command and verifies its exit code and output."""
-
- # Verifies that 'command' exits with code 1.
- p = gtest_test_utils.Subprocess(command)
- Assert(p.exited)
- AssertEq(1, p.exit_code)
- Assert('InitGoogleTest' in p.output)
-
-
-class GTestUninitializedTest(gtest_test_utils.TestCase):
- def testExitCodeAndOutput(self):
- TestExitCodeAndOutput(COMMAND)
-
-
-if __name__ == '__main__':
- gtest_test_utils.Main()
+{
+ 'includes': [
+ '../../../build/common.gypi',
+ ],
+ 'targets': [
+ {
+ 'target_name': 'converter_exe',
+ 'type': 'executable',
+ 'sources': [
+ 'converter.cc',
+ 'escaping.cc',
+ 'escaping.h',
+ 'http_client.h',
+ 'http_download.cc',
+ 'http_download.h',
+ 'tokenizer.cc',
+ 'tokenizer.h',
+ 'winhttp_client.cc',
+ 'winhttp_client.h',
+ 'wininet_client.cc',
+ 'wininet_client.h',
+ ],
+ 'dependencies': [
+ '../../../common/windows/common_windows.gyp:common_windows_lib',
+ '../converter/ms_symbol_server_converter.gyp:ms_symbol_server_converter',
+ ],
+ },
+ ],
+}
diff --git a/src/tools/windows/converter_exe/escaping.cc b/src/tools/windows/converter_exe/escaping.cc
new file mode 100644
index 00000000..74a7203a
--- /dev/null
+++ b/src/tools/windows/converter_exe/escaping.cc
@@ -0,0 +1,757 @@
+// Copyright 2019 Google Inc. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#include "tools/windows/converter_exe/escaping.h"
+
+#include <assert.h>
+
+#define kApb kAsciiPropertyBits
+
+const unsigned char kAsciiPropertyBits[256] = {
+ 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, // 0x00
+ 0x40, 0x68, 0x48, 0x48, 0x48, 0x48, 0x40, 0x40,
+ 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, // 0x10
+ 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40,
+ 0x28, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, // 0x20
+ 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
+ 0x84, 0x84, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
+ 0x10, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x05, // 0x40
+ 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
+ 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, // 0x50
+ 0x05, 0x05, 0x05, 0x10, 0x10, 0x10, 0x10, 0x10,
+ 0x10, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x05, // 0x60
+ 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
+ 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, // 0x70
+ 0x05, 0x05, 0x05, 0x10, 0x10, 0x10, 0x10, 0x40,
+};
+
+// Use !! to suppress the warning C4800 of forcing 'int' to 'bool'.
+static inline bool ascii_isspace(unsigned char c) { return !!(kApb[c] & 0x08); }
+
+///////////////////////////////////
+// scoped_array
+///////////////////////////////////
+// scoped_array<C> is like scoped_ptr<C>, except that the caller must allocate
+// with new [] and the destructor deletes objects with delete [].
+//
+// As with scoped_ptr<C>, a scoped_array<C> either points to an object
+// or is NULL. A scoped_array<C> owns the object that it points to.
+// scoped_array<T> is thread-compatible, and once you index into it,
+// the returned objects have only the threadsafety guarantees of T.
+//
+// Size: sizeof(scoped_array<C>) == sizeof(C*)
+template <class C>
+class scoped_array {
+ public:
+
+ // The element type
+ typedef C element_type;
+
+ // Constructor. Defaults to intializing with NULL.
+ // There is no way to create an uninitialized scoped_array.
+ // The input parameter must be allocated with new [].
+ explicit scoped_array(C* p = NULL) : array_(p) { }
+
+ // Destructor. If there is a C object, delete it.
+ // We don't need to test ptr_ == NULL because C++ does that for us.
+ ~scoped_array() {
+ enum { type_must_be_complete = sizeof(C) };
+ delete[] array_;
+ }
+
+ // Reset. Deletes the current owned object, if any.
+ // Then takes ownership of a new object, if given.
+ // this->reset(this->get()) works.
+ void reset(C* p = NULL) {
+ if (p != array_) {
+ enum { type_must_be_complete = sizeof(C) };
+ delete[] array_;
+ array_ = p;
+ }
+ }
+
+ // Get one element of the current object.
+ // Will assert() if there is no current object, or index i is negative.
+ C& operator[](std::ptrdiff_t i) const {
+ assert(i >= 0);
+ assert(array_ != NULL);
+ return array_[i];
+ }
+
+ // Get a pointer to the zeroth element of the current object.
+ // If there is no current object, return NULL.
+ C* get() const {
+ return array_;
+ }
+
+ // Comparison operators.
+ // These return whether a scoped_array and a raw pointer refer to
+ // the same array, not just to two different but equal arrays.
+ bool operator==(const C* p) const { return array_ == p; }
+ bool operator!=(const C* p) const { return array_ != p; }
+
+ // Swap two scoped arrays.
+ void swap(scoped_array& p2) {
+ C* tmp = array_;
+ array_ = p2.array_;
+ p2.array_ = tmp;
+ }
+
+ // Release an array.
+ // The return value is the current pointer held by this object.
+ // If this object holds a NULL pointer, the return value is NULL.
+ // After this operation, this object will hold a NULL pointer,
+ // and will not own the object any more.
+ C* release() {
+ C* retVal = array_;
+ array_ = NULL;
+ return retVal;
+ }
+
+ private:
+ C* array_;
+
+ // Forbid comparison of different scoped_array types.
+ template <class C2> bool operator==(scoped_array<C2> const& p2) const;
+ template <class C2> bool operator!=(scoped_array<C2> const& p2) const;
+
+ // Disallow evil constructors
+ scoped_array(const scoped_array&);
+ void operator=(const scoped_array&);
+};
+
+
+///////////////////////////////////
+// Escape methods
+///////////////////////////////////
+
+namespace strings {
+
+// Return a mutable char* pointing to a string's internal buffer,
+// which may not be null-terminated. Writing through this pointer will
+// modify the string.
+//
+// string_as_array(&str)[i] is valid for 0 <= i < str.size() until the
+// next call to a string method that invalidates iterators.
+//
+// As of 2006-04, there is no standard-blessed way of getting a
+// mutable reference to a string's internal buffer. However, issue 530
+// (http://www.open-std.org/JTC1/SC22/WG21/docs/lwg-active.html#530)
+// proposes this as the method. According to Matt Austern, this should
+// already work on all current implementations.
+inline char* string_as_array(string* str) {
+ // DO NOT USE const_cast<char*>(str->data())! See the unittest for why.
+ return str->empty() ? NULL : &*str->begin();
+}
+
+int CalculateBase64EscapedLen(int input_len, bool do_padding) {
+ // these formulae were copied from comments that used to go with the base64
+ // encoding functions
+ int intermediate_result = 8 * input_len + 5;
+ assert(intermediate_result > 0); // make sure we didn't overflow
+ int len = intermediate_result / 6;
+ if (do_padding) len = ((len + 3) / 4) * 4;
+ return len;
+}
+
+// Base64Escape does padding, so this calculation includes padding.
+int CalculateBase64EscapedLen(int input_len) {
+ return CalculateBase64EscapedLen(input_len, true);
+}
+
+// ----------------------------------------------------------------------
+// int Base64Unescape() - base64 decoder
+// int Base64Escape() - base64 encoder
+// int WebSafeBase64Unescape() - Google's variation of base64 decoder
+// int WebSafeBase64Escape() - Google's variation of base64 encoder
+//
+// Check out
+// http://www.cis.ohio-state.edu/htbin/rfc/rfc2045.html for formal
+// description, but what we care about is that...
+// Take the encoded stuff in groups of 4 characters and turn each
+// character into a code 0 to 63 thus:
+// A-Z map to 0 to 25
+// a-z map to 26 to 51
+// 0-9 map to 52 to 61
+// +(- for WebSafe) maps to 62
+// /(_ for WebSafe) maps to 63
+// There will be four numbers, all less than 64 which can be represented
+// by a 6 digit binary number (aaaaaa, bbbbbb, cccccc, dddddd respectively).
+// Arrange the 6 digit binary numbers into three bytes as such:
+// aaaaaabb bbbbcccc ccdddddd
+// Equals signs (one or two) are used at the end of the encoded block to
+// indicate that the text was not an integer multiple of three bytes long.
+// ----------------------------------------------------------------------
+
+int Base64UnescapeInternal(const char *src, int szsrc,
+ char *dest, int szdest,
+ const signed char* unbase64) {
+ static const char kPad64 = '=';
+
+ int decode = 0;
+ int destidx = 0;
+ int state = 0;
+ unsigned int ch = 0;
+ unsigned int temp = 0;
+
+ // The GET_INPUT macro gets the next input character, skipping
+ // over any whitespace, and stopping when we reach the end of the
+ // string or when we read any non-data character. The arguments are
+ // an arbitrary identifier (used as a label for goto) and the number
+ // of data bytes that must remain in the input to avoid aborting the
+ // loop.
+#define GET_INPUT(label, remain) \
+ label: \
+ --szsrc; \
+ ch = *src++; \
+ decode = unbase64[ch]; \
+ if (decode < 0) { \
+ if (ascii_isspace((char)ch) && szsrc >= remain) \
+ goto label; \
+ state = 4 - remain; \
+ break; \
+ }
+
+ // if dest is null, we're just checking to see if it's legal input
+ // rather than producing output. (I suspect this could just be done
+ // with a regexp...). We duplicate the loop so this test can be
+ // outside it instead of in every iteration.
+
+ if (dest) {
+ // This loop consumes 4 input bytes and produces 3 output bytes
+ // per iteration. We can't know at the start that there is enough
+ // data left in the string for a full iteration, so the loop may
+ // break out in the middle; if so 'state' will be set to the
+ // number of input bytes read.
+
+ while (szsrc >= 4) {
+ // We'll start by optimistically assuming that the next four
+ // bytes of the string (src[0..3]) are four good data bytes
+ // (that is, no nulls, whitespace, padding chars, or illegal
+ // chars). We need to test src[0..2] for nulls individually
+ // before constructing temp to preserve the property that we
+ // never read past a null in the string (no matter how long
+ // szsrc claims the string is).
+
+ if (!src[0] || !src[1] || !src[2] ||
+ (temp = ((unbase64[static_cast<int>(src[0])] << 18) |
+ (unbase64[static_cast<int>(src[1])] << 12) |
+ (unbase64[static_cast<int>(src[2])] << 6) |
+ (unbase64[static_cast<int>(src[3])]))) & 0x80000000) {
+ // Iff any of those four characters was bad (null, illegal,
+ // whitespace, padding), then temp's high bit will be set
+ // (because unbase64[] is -1 for all bad characters).
+ //
+ // We'll back up and resort to the slower decoder, which knows
+ // how to handle those cases.
+
+ GET_INPUT(first, 4);
+ temp = decode;
+ GET_INPUT(second, 3);
+ temp = (temp << 6) | decode;
+ GET_INPUT(third, 2);
+ temp = (temp << 6) | decode;
+ GET_INPUT(fourth, 1);
+ temp = (temp << 6) | decode;
+ } else {
+ // We really did have four good data bytes, so advance four
+ // characters in the string.
+
+ szsrc -= 4;
+ src += 4;
+ decode = -1;
+ ch = '\0';
+ }
+
+ // temp has 24 bits of input, so write that out as three bytes.
+
+ if (destidx+3 > szdest) return -1;
+ dest[destidx+2] = (char)temp;
+ temp >>= 8;
+ dest[destidx+1] = (char)temp;
+ temp >>= 8;
+ dest[destidx] = (char)temp;
+ destidx += 3;
+ }
+ } else {
+ while (szsrc >= 4) {
+ if (!src[0] || !src[1] || !src[2] ||
+ (temp = ((unbase64[static_cast<int>(src[0])] << 18) |
+ (unbase64[static_cast<int>(src[1])] << 12) |
+ (unbase64[static_cast<int>(src[2])] << 6) |
+ (unbase64[static_cast<int>(src[3])]))) & 0x80000000) {
+ GET_INPUT(first_no_dest, 4);
+ GET_INPUT(second_no_dest, 3);
+ GET_INPUT(third_no_dest, 2);
+ GET_INPUT(fourth_no_dest, 1);
+ } else {
+ szsrc -= 4;
+ src += 4;
+ decode = -1;
+ ch = '\0';
+ }
+ destidx += 3;
+ }
+ }
+
+#undef GET_INPUT
+
+ // if the loop terminated because we read a bad character, return
+ // now.
+ if (decode < 0 && ch != '\0' && ch != kPad64 && !ascii_isspace((char)ch))
+ return -1;
+
+ if (ch == kPad64) {
+ // if we stopped by hitting an '=', un-read that character -- we'll
+ // look at it again when we count to check for the proper number of
+ // equals signs at the end.
+ ++szsrc;
+ --src;
+ } else {
+ // This loop consumes 1 input byte per iteration. It's used to
+ // clean up the 0-3 input bytes remaining when the first, faster
+ // loop finishes. 'temp' contains the data from 'state' input
+ // characters read by the first loop.
+ while (szsrc > 0) {
+ --szsrc;
+ ch = *src++;
+ decode = unbase64[ch];
+ if (decode < 0) {
+ if (ascii_isspace((char)ch)) {
+ continue;
+ } else if (ch == '\0') {
+ break;
+ } else if (ch == kPad64) {
+ // back up one character; we'll read it again when we check
+ // for the correct number of equals signs at the end.
+ ++szsrc;
+ --src;
+ break;
+ } else {
+ return -1;
+ }
+ }
+
+ // Each input character gives us six bits of output.
+ temp = (temp << 6) | decode;
+ ++state;
+ if (state == 4) {
+ // If we've accumulated 24 bits of output, write that out as
+ // three bytes.
+ if (dest) {
+ if (destidx+3 > szdest) return -1;
+ dest[destidx+2] = (char)temp;
+ temp >>= 8;
+ dest[destidx+1] = (char)temp;
+ temp >>= 8;
+ dest[destidx] = (char)temp;
+ }
+ destidx += 3;
+ state = 0;
+ temp = 0;
+ }
+ }
+ }
+
+ // Process the leftover data contained in 'temp' at the end of the input.
+ int expected_equals = 0;
+ switch (state) {
+ case 0:
+ // Nothing left over; output is a multiple of 3 bytes.
+ break;
+
+ case 1:
+ // Bad input; we have 6 bits left over.
+ return -1;
+
+ case 2:
+ // Produce one more output byte from the 12 input bits we have left.
+ if (dest) {
+ if (destidx+1 > szdest) return -1;
+ temp >>= 4;
+ dest[destidx] = (char)temp;
+ }
+ ++destidx;
+ expected_equals = 2;
+ break;
+
+ case 3:
+ // Produce two more output bytes from the 18 input bits we have left.
+ if (dest) {
+ if (destidx+2 > szdest) return -1;
+ temp >>= 2;
+ dest[destidx+1] = (char)temp;
+ temp >>= 8;
+ dest[destidx] = (char)temp;
+ }
+ destidx += 2;
+ expected_equals = 1;
+ break;
+
+ default:
+ // state should have no other values at this point.
+ fprintf(stdout, "This can't happen; base64 decoder state = %d", state);
+ }
+
+ // The remainder of the string should be all whitespace, mixed with
+ // exactly 0 equals signs, or exactly 'expected_equals' equals
+ // signs. (Always accepting 0 equals signs is a google extension
+ // not covered in the RFC.)
+
+ int equals = 0;
+ while (szsrc > 0 && *src) {
+ if (*src == kPad64)
+ ++equals;
+ else if (!ascii_isspace(*src))
+ return -1;
+ --szsrc;
+ ++src;
+ }
+
+ return (equals == 0 || equals == expected_equals) ? destidx : -1;
+}
+
+int Base64Unescape(const char *src, int szsrc, char *dest, int szdest) {
+ static const signed char UnBase64[] = {
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 62/*+*/, -1, -1, -1, 63/*/ */,
+ 52/*0*/, 53/*1*/, 54/*2*/, 55/*3*/, 56/*4*/, 57/*5*/, 58/*6*/, 59/*7*/,
+ 60/*8*/, 61/*9*/, -1, -1, -1, -1, -1, -1,
+ -1, 0/*A*/, 1/*B*/, 2/*C*/, 3/*D*/, 4/*E*/, 5/*F*/, 6/*G*/,
+ 7/*H*/, 8/*I*/, 9/*J*/, 10/*K*/, 11/*L*/, 12/*M*/, 13/*N*/, 14/*O*/,
+ 15/*P*/, 16/*Q*/, 17/*R*/, 18/*S*/, 19/*T*/, 20/*U*/, 21/*V*/, 22/*W*/,
+ 23/*X*/, 24/*Y*/, 25/*Z*/, -1, -1, -1, -1, -1,
+ -1, 26/*a*/, 27/*b*/, 28/*c*/, 29/*d*/, 30/*e*/, 31/*f*/, 32/*g*/,
+ 33/*h*/, 34/*i*/, 35/*j*/, 36/*k*/, 37/*l*/, 38/*m*/, 39/*n*/, 40/*o*/,
+ 41/*p*/, 42/*q*/, 43/*r*/, 44/*s*/, 45/*t*/, 46/*u*/, 47/*v*/, 48/*w*/,
+ 49/*x*/, 50/*y*/, 51/*z*/, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1
+ };
+ // The above array was generated by the following code
+ // #include <sys/time.h>
+ // #include <stdlib.h>
+ // #include <string.h>
+ // main()
+ // {
+ // static const char Base64[] =
+ // "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+ // char *pos;
+ // int idx, i, j;
+ // printf(" ");
+ // for (i = 0; i < 255; i += 8) {
+ // for (j = i; j < i + 8; j++) {
+ // pos = strchr(Base64, j);
+ // if ((pos == NULL) || (j == 0))
+ // idx = -1;
+ // else
+ // idx = pos - Base64;
+ // if (idx == -1)
+ // printf(" %2d, ", idx);
+ // else
+ // printf(" %2d/*%c*/,", idx, j);
+ // }
+ // printf("\n ");
+ // }
+ // }
+
+ return Base64UnescapeInternal(src, szsrc, dest, szdest, UnBase64);
+}
+
+bool Base64Unescape(const char *src, int slen, string* dest) {
+ // Determine the size of the output string. Base64 encodes every 3 bytes into
+ // 4 characters. any leftover chars are added directly for good measure.
+ // This is documented in the base64 RFC: http://www.ietf.org/rfc/rfc3548.txt
+ const int dest_len = 3 * (slen / 4) + (slen % 4);
+
+ dest->resize(dest_len);
+
+ // We are getting the destination buffer by getting the beginning of the
+ // string and converting it into a char *.
+ const int len = Base64Unescape(src, slen,
+ string_as_array(dest), dest->size());
+ if (len < 0) {
+ return false;
+ }
+
+ // could be shorter if there was padding
+ assert(len <= dest_len);
+ dest->resize(len);
+
+ return true;
+}
+
+// Base64Escape
+//
+// NOTE: We have to use an unsigned type for src because code built
+// in the the /google tree treats characters as signed unless
+// otherwised specified.
+//
+// TODO(who?): Move this function to use the char* type for "src"
+int Base64EscapeInternal(const unsigned char *src, int szsrc,
+ char *dest, int szdest, const char *base64,
+ bool do_padding) {
+ static const char kPad64 = '=';
+
+ if (szsrc <= 0) return 0;
+
+ char *cur_dest = dest;
+ const unsigned char *cur_src = src;
+
+ // Three bytes of data encodes to four characters of cyphertext.
+ // So we can pump through three-byte chunks atomically.
+ while (szsrc > 2) { /* keep going until we have less than 24 bits */
+ if ((szdest -= 4) < 0) return 0;
+ cur_dest[0] = base64[cur_src[0] >> 2];
+ cur_dest[1] = base64[((cur_src[0] & 0x03) << 4) + (cur_src[1] >> 4)];
+ cur_dest[2] = base64[((cur_src[1] & 0x0f) << 2) + (cur_src[2] >> 6)];
+ cur_dest[3] = base64[cur_src[2] & 0x3f];
+
+ cur_dest += 4;
+ cur_src += 3;
+ szsrc -= 3;
+ }
+
+ /* now deal with the tail (<=2 bytes) */
+ switch (szsrc) {
+ case 0:
+ // Nothing left; nothing more to do.
+ break;
+ case 1:
+ // One byte left: this encodes to two characters, and (optionally)
+ // two pad characters to round out the four-character cypherblock.
+ if ((szdest -= 2) < 0) return 0;
+ cur_dest[0] = base64[cur_src[0] >> 2];
+ cur_dest[1] = base64[(cur_src[0] & 0x03) << 4];
+ cur_dest += 2;
+ if (do_padding) {
+ if ((szdest -= 2) < 0) return 0;
+ cur_dest[0] = kPad64;
+ cur_dest[1] = kPad64;
+ cur_dest += 2;
+ }
+ break;
+ case 2:
+ // Two bytes left: this encodes to three characters, and (optionally)
+ // one pad character to round out the four-character cypherblock.
+ if ((szdest -= 3) < 0) return 0;
+ cur_dest[0] = base64[cur_src[0] >> 2];
+ cur_dest[1] = base64[((cur_src[0] & 0x03) << 4) + (cur_src[1] >> 4)];
+ cur_dest[2] = base64[(cur_src[1] & 0x0f) << 2];
+ cur_dest += 3;
+ if (do_padding) {
+ if ((szdest -= 1) < 0) return 0;
+ cur_dest[0] = kPad64;
+ cur_dest += 1;
+ }
+ break;
+ default:
+ // Should not be reached: blocks of 3 bytes are handled
+ // in the while loop before this switch statement.
+ fprintf(stderr, "Logic problem? szsrc = %d", szsrc);
+ assert(false);
+ break;
+ }
+ return (cur_dest - dest);
+}
+
+static const char kBase64Chars[] =
+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+
+static const char kWebSafeBase64Chars[] =
+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
+
+int Base64Escape(const unsigned char *src, int szsrc, char *dest, int szdest) {
+ return Base64EscapeInternal(src, szsrc, dest, szdest, kBase64Chars, true);
+}
+
+void Base64Escape(const unsigned char *src, int szsrc,
+ string* dest, bool do_padding) {
+ const int max_escaped_size =
+ CalculateBase64EscapedLen(szsrc, do_padding);
+ dest->clear();
+ dest->resize(max_escaped_size + 1, '\0');
+ const int escaped_len = Base64EscapeInternal(src, szsrc,
+ &*dest->begin(), dest->size(),
+ kBase64Chars,
+ do_padding);
+ assert(max_escaped_size <= escaped_len);
+ dest->resize(escaped_len);
+}
+
+void Base64Escape(const string& src, string* dest) {
+ Base64Escape(reinterpret_cast<const unsigned char*>(src.c_str()),
+ src.size(), dest, true);
+}
+
+////////////////////////////////////////////////////
+// WebSafe methods
+////////////////////////////////////////////////////
+
+int WebSafeBase64Unescape(const char *src, int szsrc, char *dest, int szdest) {
+ static const signed char UnBase64[] = {
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, 62/*-*/, -1, -1,
+ 52/*0*/, 53/*1*/, 54/*2*/, 55/*3*/, 56/*4*/, 57/*5*/, 58/*6*/, 59/*7*/,
+ 60/*8*/, 61/*9*/, -1, -1, -1, -1, -1, -1,
+ -1, 0/*A*/, 1/*B*/, 2/*C*/, 3/*D*/, 4/*E*/, 5/*F*/, 6/*G*/,
+ 7/*H*/, 8/*I*/, 9/*J*/, 10/*K*/, 11/*L*/, 12/*M*/, 13/*N*/, 14/*O*/,
+ 15/*P*/, 16/*Q*/, 17/*R*/, 18/*S*/, 19/*T*/, 20/*U*/, 21/*V*/, 22/*W*/,
+ 23/*X*/, 24/*Y*/, 25/*Z*/, -1, -1, -1, -1, 63/*_*/,
+ -1, 26/*a*/, 27/*b*/, 28/*c*/, 29/*d*/, 30/*e*/, 31/*f*/, 32/*g*/,
+ 33/*h*/, 34/*i*/, 35/*j*/, 36/*k*/, 37/*l*/, 38/*m*/, 39/*n*/, 40/*o*/,
+ 41/*p*/, 42/*q*/, 43/*r*/, 44/*s*/, 45/*t*/, 46/*u*/, 47/*v*/, 48/*w*/,
+ 49/*x*/, 50/*y*/, 51/*z*/, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1
+ };
+ // The above array was generated by the following code
+ // #include <sys/time.h>
+ // #include <stdlib.h>
+ // #include <string.h>
+ // main()
+ // {
+ // static const char Base64[] =
+ // "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
+ // char *pos;
+ // int idx, i, j;
+ // printf(" ");
+ // for (i = 0; i < 255; i += 8) {
+ // for (j = i; j < i + 8; j++) {
+ // pos = strchr(Base64, j);
+ // if ((pos == NULL) || (j == 0))
+ // idx = -1;
+ // else
+ // idx = pos - Base64;
+ // if (idx == -1)
+ // printf(" %2d, ", idx);
+ // else
+ // printf(" %2d/*%c*/,", idx, j);
+ // }
+ // printf("\n ");
+ // }
+ // }
+
+ return Base64UnescapeInternal(src, szsrc, dest, szdest, UnBase64);
+}
+
+bool WebSafeBase64Unescape(const char *src, int slen, string* dest) {
+ int dest_len = 3 * (slen / 4) + (slen % 4);
+ dest->clear();
+ dest->resize(dest_len);
+ int len = WebSafeBase64Unescape(src, slen, &*dest->begin(), dest->size());
+ if (len < 0) {
+ dest->clear();
+ return false;
+ }
+ // could be shorter if there was padding
+ assert(len <= dest_len);
+ dest->resize(len);
+ return true;
+}
+
+bool WebSafeBase64Unescape(const string& src, string* dest) {
+ return WebSafeBase64Unescape(src.data(), src.size(), dest);
+}
+
+int WebSafeBase64Escape(const unsigned char *src, int szsrc, char *dest,
+ int szdest, bool do_padding) {
+ return Base64EscapeInternal(src, szsrc, dest, szdest,
+ kWebSafeBase64Chars, do_padding);
+}
+
+void WebSafeBase64Escape(const unsigned char *src, int szsrc,
+ string *dest, bool do_padding) {
+ const int max_escaped_size =
+ CalculateBase64EscapedLen(szsrc, do_padding);
+ dest->clear();
+ dest->resize(max_escaped_size + 1, '\0');
+ const int escaped_len = Base64EscapeInternal(src, szsrc,
+ &*dest->begin(), dest->size(),
+ kWebSafeBase64Chars,
+ do_padding);
+ assert(max_escaped_size <= escaped_len);
+ dest->resize(escaped_len);
+}
+
+void WebSafeBase64EscapeInternal(const string& src,
+ string* dest,
+ bool do_padding) {
+ int encoded_len = CalculateBase64EscapedLen(src.size());
+ scoped_array<char> buf(new char[encoded_len]);
+ int len = WebSafeBase64Escape(reinterpret_cast<const unsigned char*>(src.c_str()),
+ src.size(), buf.get(),
+ encoded_len, do_padding);
+ dest->assign(buf.get(), len);
+}
+
+void WebSafeBase64Escape(const string& src, string* dest) {
+ WebSafeBase64EscapeInternal(src, dest, false);
+}
+
+void WebSafeBase64EscapeWithPadding(const string& src, string* dest) {
+ WebSafeBase64EscapeInternal(src, dest, true);
+}
+
+} // namespace strings
diff --git a/src/tools/windows/converter_exe/escaping.h b/src/tools/windows/converter_exe/escaping.h
new file mode 100644
index 00000000..c8aa90b7
--- /dev/null
+++ b/src/tools/windows/converter_exe/escaping.h
@@ -0,0 +1,99 @@
+// Copyright 2019 Google Inc. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Base64 escaping methods to encode/decode strings.
+
+#ifndef TOOLS_WINDOWS_CONVERTER_EXE_ESCAPING_H_
+#define TOOLS_WINDOWS_CONVERTER_EXE_ESCAPING_H_
+
+#include <string>
+
+namespace strings {
+
+using std::string;
+
+// ----------------------------------------------------------------------
+// Base64Escape()
+// WebSafeBase64Escape()
+// Encode "src" to "dest" using base64 encoding.
+// src is not null terminated, instead specify len.
+// 'dest' should have at least CalculateBase64EscapedLen() length.
+// RETURNS the length of dest.
+// The WebSafe variation use '-' instead of '+' and '_' instead of '/'
+// so that we can place the out in the URL or cookies without having
+// to escape them. It also has an extra parameter "do_padding",
+// which when set to false will prevent padding with "=".
+// ----------------------------------------------------------------------
+void Base64Escape(const string& src, string* dest);
+int Base64Escape(const unsigned char* src, int slen, char* dest, int szdest);
+// Encode src into dest with padding.
+void Base64Escape(const unsigned char* src, int szsrc,
+ string* dest, bool do_padding);
+
+int WebSafeBase64Escape(const unsigned char* src, int slen, char* dest,
+ int szdest, bool do_padding);
+// Encode src into dest web-safely without padding.
+void WebSafeBase64Escape(const string& src, string* dest);
+// Encode src into dest web-safely with padding.
+void WebSafeBase64EscapeWithPadding(const string& src, string* dest);
+void WebSafeBase64Escape(const unsigned char* src, int szsrc,
+ string* dest, bool do_padding);
+
+// ----------------------------------------------------------------------
+// Base64Unescape()
+// WebSafeBase64Unescape()
+// Copies "src" to "dest", where src is in base64 and is written to its
+// ASCII equivalents. src is not null terminated, instead specify len.
+// I recommend that slen<szdest, but we honor szdest anyway.
+// RETURNS the length of dest, or -1 if src contains invalid chars.
+// The WebSafe variation use '-' instead of '+' and '_' instead of '/'.
+// The variations that store into a string clear the string first, and
+// return false (with dest empty) if src contains invalid chars; for
+// these versions src and dest must be different strings.
+// ----------------------------------------------------------------------
+int Base64Unescape(const char* src, int slen, char* dest, int szdest);
+bool Base64Unescape(const char* src, int slen, string* dest);
+inline bool Base64Unescape(const string& src, string* dest) {
+ return Base64Unescape(src.data(), src.size(), dest);
+}
+
+
+int WebSafeBase64Unescape(const char* src, int slen, char* dest, int szdest);
+bool WebSafeBase64Unescape(const char* src, int slen, string* dest);
+bool WebSafeBase64Unescape(const string& src, string* dest);
+
+// Return the length to use for the output buffer given to the base64 escape
+// routines. Make sure to use the same value for do_padding in both.
+// This function may return incorrect results if given input_len values that
+// are extremely high, which should happen rarely.
+int CalculateBase64EscapedLen(int input_len, bool do_padding);
+// Use this version when calling Base64Escape without a do_padding arg.
+int CalculateBase64EscapedLen(int input_len);
+} // namespace strings
+
+#endif // TOOLS_WINDOWS_CONVERTER_EXE_ESCAPING_H_
diff --git a/src/tools/windows/converter_exe/http_client.h b/src/tools/windows/converter_exe/http_client.h
new file mode 100644
index 00000000..3e7aa8a7
--- /dev/null
+++ b/src/tools/windows/converter_exe/http_client.h
@@ -0,0 +1,96 @@
+// Copyright 2019 Google Inc. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef TOOLS_CRASH_CONVERTER_WINDOWS_HTTP_CLIENT_H_
+#define TOOLS_CRASH_CONVERTER_WINDOWS_HTTP_CLIENT_H_
+
+#include <tchar.h>
+#include <windows.h>
+#include <vector>
+
+typedef void* HttpHandle;
+
+namespace crash {
+
+// HttpClient provides an abstract layer for HTTP APIs. The actual
+// implementation can be based on either WinHttp or WinInet.
+class HttpClient {
+ public:
+ enum AccessType {
+ ACCESS_TYPE_PRECONFIG,
+ ACCESS_TYPE_DIRECT,
+ ACCESS_TYPE_PROXY,
+ };
+
+ virtual ~HttpClient() {}
+
+ virtual bool CrackUrl(const TCHAR* url,
+ DWORD flags,
+ TCHAR* scheme,
+ size_t scheme_buffer_length,
+ TCHAR* host,
+ size_t host_buffer_length,
+ TCHAR* uri,
+ size_t uri_buffer_length,
+ int* port) const = 0;
+ virtual bool Open(const TCHAR* user_agent,
+ DWORD access_type,
+ const TCHAR* proxy_name,
+ const TCHAR* proxy_bypass,
+ HttpHandle* session_handle) const = 0;
+ virtual bool Connect(HttpHandle session_handle,
+ const TCHAR* server,
+ int port,
+ HttpHandle* connection_handle) const = 0;
+ virtual bool OpenRequest(HttpHandle connection_handle,
+ const TCHAR* verb,
+ const TCHAR* uri,
+ const TCHAR* version,
+ const TCHAR* referrer,
+ bool is_secure,
+ HttpHandle* request_handle) const = 0;
+ virtual bool SendRequest(HttpHandle request_handle,
+ const TCHAR* headers,
+ DWORD headers_length) const = 0;
+ virtual bool ReceiveResponse(HttpHandle request_handle) const = 0;
+ virtual bool GetHttpStatusCode(HttpHandle request_handle,
+ int* status_code) const = 0;
+ virtual bool GetContentLength(HttpHandle request_handle,
+ DWORD* content_length) const = 0;
+ virtual bool ReadData(HttpHandle request_handle,
+ void* buffer,
+ DWORD buffer_length,
+ DWORD* bytes_read) const = 0;
+ virtual bool Close(HttpHandle handle) const = 0;
+
+ static const DWORD kUnknownContentLength = (DWORD)-1;
+};
+
+} // namespace crash
+
+#endif // TOOLS_CRASH_CONVERTER_WINDOWS_HTTP_CLIENT_H_
diff --git a/src/tools/windows/converter_exe/http_download.cc b/src/tools/windows/converter_exe/http_download.cc
new file mode 100644
index 00000000..5afc1ccc
--- /dev/null
+++ b/src/tools/windows/converter_exe/http_download.cc
@@ -0,0 +1,326 @@
+// Copyright 2019 Google Inc. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#include <assert.h>
+#include <stdio.h>
+#include <Windows.h>
+#include <WinInet.h>
+
+#include <vector>
+
+#include "tools/windows/converter_exe/http_download.h"
+#include "tools/windows/converter_exe/winhttp_client.h"
+#include "tools/windows/converter_exe/wininet_client.h"
+
+namespace crash {
+static const std::vector<char>::size_type kVectorChunkSize = 4096; // 4 KB
+
+using std::vector;
+
+// Class that atuo closes the contained HttpHandle when the object
+// goes out of scope.
+class AutoHttpHandle {
+ public:
+ AutoHttpHandle() : handle_(NULL) {}
+ explicit AutoHttpHandle(HttpHandle handle) : handle_(handle) {}
+ ~AutoHttpHandle() {
+ if (handle_) {
+ InternetCloseHandle(handle_);
+ }
+ }
+
+ HttpHandle get() { return handle_; }
+ HttpHandle* get_handle_addr () { return &handle_; }
+
+ private:
+ HttpHandle handle_;
+};
+
+// Template class for auto releasing the contained pointer when
+// the object goes out of scope.
+template<typename T>
+class AutoPtr {
+ public:
+ explicit AutoPtr(T* ptr) : ptr_(ptr) {}
+ ~AutoPtr() {
+ if (ptr_) {
+ delete ptr_;
+ }
+ }
+
+ T* get() { return ptr_; }
+ T* operator -> () { return ptr_; }
+
+ private:
+ T* ptr_;
+};
+
+// CheckParameters ensures that the parameters in |parameters| are safe for
+// use in an HTTP URL. Returns true if they are, false if unsafe characters
+// are present.
+static bool CheckParameters(const map<wstring, wstring> *parameters) {
+ for (map<wstring, wstring>::const_iterator iterator = parameters->begin();
+ iterator != parameters->end();
+ ++iterator) {
+ const wstring &key = iterator->first;
+ if (key.empty()) {
+ // Disallow empty parameter names.
+ return false;
+ }
+ for (unsigned int i = 0; i < key.size(); ++i) {
+ wchar_t c = key[i];
+ if (c < 32 || c == '"' || c == '?' || c == '&' || c > 127) {
+ return false;
+ }
+ }
+
+ const wstring &value = iterator->second;
+ for (unsigned int i = 0; i < value.size(); ++i) {
+ wchar_t c = value[i];
+ if (c < 32 || c == '"' || c == '?' || c == '&' || c > 127) {
+ return false;
+ }
+ }
+ }
+
+ return true;
+}
+
+HttpClient* HTTPDownload::CreateHttpClient(const wchar_t* url) {
+ const TCHAR* kHttpApiPolicyEnvironmentVariable = TEXT("USE_WINHTTP");
+ TCHAR buffer[2] = {0};
+ HttpClient* http_client = NULL;
+
+ if (::GetEnvironmentVariable(kHttpApiPolicyEnvironmentVariable,
+ buffer,
+ sizeof(buffer)/sizeof(buffer[0])) > 0) {
+ fprintf(stdout,
+ "Environment variable [%ws] is set, use WinHttp\n",
+ kHttpApiPolicyEnvironmentVariable);
+ http_client = CreateWinHttpClient(url);
+ if (http_client == NULL) {
+ fprintf(stderr, "WinHttpClient not created, Is the protocol HTTPS? "
+ "Fall back to WinInet API.\n");
+ }
+ } else {
+ fprintf(stderr,
+ "Environment variable [%ws] is NOT set, use WinInet API\n",
+ kHttpApiPolicyEnvironmentVariable);
+ }
+
+ if (http_client == NULL) {
+ return CreateWinInetClient(url);
+ }
+
+ return http_client;
+}
+
+// static
+bool HTTPDownload::Download(const wstring &url,
+ const map<wstring, wstring> *parameters,
+ string *content, int *status_code) {
+ assert(content);
+ AutoPtr<HttpClient> http_client(CreateHttpClient(url.c_str()));
+
+ if (!http_client.get()) {
+ fprintf(stderr, "Failed to create any http client.\n");
+ return false;
+ }
+
+ if (status_code) {
+ *status_code = 0;
+ }
+
+ wchar_t scheme[16] = {0};
+ wchar_t host[256] = {0};
+ wchar_t path[256] = {0};
+ int port = 0;
+ if (!http_client->CrackUrl(url.c_str(),
+ 0,
+ scheme,
+ sizeof(scheme)/sizeof(scheme[0]),
+ host,
+ sizeof(host)/sizeof(host[0]),
+ path,
+ sizeof(path)/sizeof(path[0]),
+ &port)) {
+ fprintf(stderr,
+ "HTTPDownload::Download: InternetCrackUrl: error %lu for %ws\n",
+ GetLastError(), url.c_str());
+ return false;
+ }
+
+ bool secure = false;
+ if (_wcsicmp(scheme, L"https") == 0) {
+ secure = true;
+ } else if (wcscmp(scheme, L"http") != 0) {
+ fprintf(stderr,
+ "HTTPDownload::Download: scheme must be http or https for %ws\n",
+ url.c_str());
+ return false;
+ }
+
+ AutoHttpHandle internet;
+ if (!http_client->Open(NULL, // user agent
+ HttpClient::ACCESS_TYPE_PRECONFIG,
+ NULL, // proxy name
+ NULL, // proxy bypass
+ internet.get_handle_addr())) {
+ fprintf(stderr,
+ "HTTPDownload::Download: Open: error %lu for %ws\n",
+ GetLastError(), url.c_str());
+ return false;
+ }
+
+ AutoHttpHandle connection;
+ if (!http_client->Connect(internet.get(),
+ host,
+ port,
+ connection.get_handle_addr())) {
+ fprintf(stderr,
+ "HTTPDownload::Download: InternetConnect: error %lu for %ws\n",
+ GetLastError(), url.c_str());
+ return false;
+ }
+
+ wstring request_string = path;
+ if (parameters) {
+ // TODO(mmentovai): escape bad characters in parameters instead of
+ // forbidding them.
+ if (!CheckParameters(parameters)) {
+ fprintf(stderr,
+ "HTTPDownload::Download: invalid characters in parameters\n");
+ return false;
+ }
+
+ bool added_parameter = false;
+ for (map<wstring, wstring>::const_iterator iterator = parameters->begin();
+ iterator != parameters->end();
+ ++iterator) {
+ request_string.append(added_parameter ? L"&" : L"?");
+ request_string.append(iterator->first);
+ request_string.append(L"=");
+ request_string.append(iterator->second);
+ added_parameter = true;
+ }
+ }
+
+ AutoHttpHandle request;
+ if (!http_client->OpenRequest(connection.get(),
+ L"GET",
+ request_string.c_str(),
+ NULL, // version
+ NULL, // referer
+ secure,
+ request.get_handle_addr())) {
+ fprintf(stderr,
+ "HttpClient::OpenRequest: error %lu for %ws, request: %ws\n",
+ GetLastError(), url.c_str(), request_string.c_str());
+ return false;
+ }
+
+ if (!http_client->SendRequest(request.get(), NULL, 0)) {
+ fprintf(stderr,
+ "HttpClient::SendRequest: error %lu for %ws\n",
+ GetLastError(), url.c_str());
+ return false;
+ }
+
+ if (!http_client->ReceiveResponse(request.get())) {
+ fprintf(stderr,
+ "HttpClient::ReceiveResponse: error %lu for %ws\n",
+ GetLastError(), url.c_str());
+ return false;
+ }
+
+ int http_status = 0;
+ if (!http_client->GetHttpStatusCode(request.get(), &http_status)) {
+ fprintf(stderr,
+ "HttpClient::GetHttpStatusCode: error %lu for %ws\n",
+ GetLastError(), url.c_str());
+ return false;
+ }
+ if (http_status != 200) {
+ fprintf(stderr,
+ "HTTPDownload::Download: HTTP status code %d for %ws\n",
+ http_status, url.c_str());
+ return false;
+ }
+
+ DWORD content_length = 0;
+ vector<char>::size_type buffer_size = 0;
+ http_client->GetContentLength(request.get(), &content_length);
+ if (content_length == HttpClient::kUnknownContentLength) {
+ buffer_size = kVectorChunkSize;
+ } else {
+ buffer_size = content_length;
+ }
+
+ if (content_length != 0) {
+ vector<char> response_buffer = vector<char>(buffer_size+1);
+ DWORD size_read;
+ DWORD total_read = 0;
+ bool read_result;
+ do {
+ if (content_length == HttpClient::kUnknownContentLength
+ && buffer_size == total_read) {
+ // The content length wasn't specified in the response header, so we
+ // have to keep growing the buffer until we're done reading.
+ buffer_size += kVectorChunkSize;
+ response_buffer.resize(buffer_size);
+ }
+ read_result = !!http_client->ReadData(
+ request.get(),
+ &response_buffer[total_read],
+ static_cast<DWORD>(buffer_size) - total_read,
+ &size_read);
+ total_read += size_read;
+ } while (read_result && (size_read != 0));
+
+ if (!read_result) {
+ fprintf(stderr,
+ "HttpClient::ReadData: error %lu for %ws\n",
+ GetLastError(),
+ url.c_str());
+ return false;
+ } else if (size_read != 0) {
+ fprintf(stderr,
+ "HttpClient::ReadData: error %lu/%lu for %ws\n",
+ total_read,
+ content_length,
+ url.c_str());
+ return false;
+ }
+ content->assign(&response_buffer[0], total_read);
+ } else {
+ content->clear();
+ }
+ return true;
+}
+
+} // namespace crash
diff --git a/src/testing/gtest/xcode/Samples/FrameworkSample/widget.h b/src/tools/windows/converter_exe/http_download.h
index 0c55cdc8..2d705d5e 100644
--- a/src/testing/gtest/xcode/Samples/FrameworkSample/widget.h
+++ b/src/tools/windows/converter_exe/http_download.h
@@ -1,59 +1,62 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: preston.a.jackson@gmail.com (Preston Jackson)
-//
-// Google Test - FrameworkSample
-// widget.h
-//
-
-// Widget is a very simple class used for demonstrating the use of gtest. It
-// simply stores two values a string and an integer, which are returned via
-// public accessors in multiple forms.
-
-#import <string>
-
-class Widget {
- public:
- Widget(int number, const std::string& name);
- ~Widget();
-
- // Public accessors to number data
- float GetFloatValue() const;
- int GetIntValue() const;
-
- // Public accessors to the string data
- std::string GetStringValue() const;
- void GetCharPtrValue(char* buffer, size_t max_size) const;
-
- private:
- // Data members
- float number_;
- std::string name_;
-};
+// Copyright 2019 Google Inc. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef TOOLS_WINDOWS_CONVERTER_EXE_HTTP_DOWNLOAD_H_
+#define TOOLS_WINDOWS_CONVERTER_EXE_HTTP_DOWNLOAD_H_
+
+#include <map>
+#include <string>
+#include "tools/windows/converter_exe/winhttp_client.h"
+
+namespace crash {
+
+using std::map;
+using std::string;
+using std::wstring;
+
+class HTTPDownload {
+ public:
+ // Retrieves the resource located at |url|, a http or https URL, via WinInet.
+ // The request is fetched with GET request; the optional |parameters| are
+ // appended to the URL. Returns true on success, placing the content of the
+ // retrieved resource in |content|. Returns false on failure. HTTP status
+ // codes other than 200 cause Download to return false. If |status_code| is
+ // supplied, it will be set to the value of the HTTP status code, if an HTTP
+ // transaction occurs. If Download fails before a transaction can occur,
+ // |status_code| will be set to 0. Any failures will result in messages
+ // being printed to stderr.
+ static bool Download(const wstring &url,
+ const map<wstring, wstring> *parameters,
+ string *content, int *status_code);
+ private:
+ static HttpClient* CreateHttpClient(const wchar_t*);
+};
+
+} // namespace crash
+
+#endif // TOOLS_WINDOWS_CONVERTER_EXE_HTTP_DOWNLOAD_H_
diff --git a/src/tools/windows/converter_exe/missing_symbols_test.txt b/src/tools/windows/converter_exe/missing_symbols_test.txt
new file mode 100644
index 00000000..91641fca
--- /dev/null
+++ b/src/tools/windows/converter_exe/missing_symbols_test.txt
@@ -0,0 +1,5 @@
+msctf.pdb|6A5BABB8E88644C696530BFE3C90F32F2|6.1.7600.16385|msctf.dll|4A5BDFAA109000
+imm32.pdb|98F27BA5AEE541ECBEE00CD03AD50FEE2|6.1.7600.16385|imm32.dll|4A5BDF402e000
+amd_opencl64.pdb|3D306D0FCCB14F47AF322A5ACDF5EEA81||amd_opencl64.dll|587901FB1E000
+igd10iumd64.pdb|B2B72475BB0846D8ADE4344FAE0CCE361 ||igd10iumd64.dll|568D69FBD99000
+NvCameraWhitelisting64.pdb|3C364C4D3FBF4180B021D52D469C6DAB1||NvCameraWhitelisting64.dll|5B8ED23485000 \ No newline at end of file
diff --git a/src/tools/windows/converter_exe/symsrv.yes b/src/tools/windows/converter_exe/symsrv.yes
new file mode 100644
index 00000000..1d01dda7
--- /dev/null
+++ b/src/tools/windows/converter_exe/symsrv.yes
@@ -0,0 +1,2 @@
+See breakpad/tools/windows/converter/ms_symbol_server_converter.h for a
+description of this file's function.
diff --git a/src/testing/gtest/samples/sample1.cc b/src/tools/windows/converter_exe/tokenizer.cc
index f171e260..992694cd 100644
--- a/src/testing/gtest/samples/sample1.cc
+++ b/src/tools/windows/converter_exe/tokenizer.cc
@@ -1,68 +1,61 @@
-// Copyright 2005, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// A sample program demonstrating using Google C++ testing framework.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-#include "sample1.h"
-
-// Returns n! (the factorial of n). For negative n, n! is defined to be 1.
-int Factorial(int n) {
- int result = 1;
- for (int i = 1; i <= n; i++) {
- result *= i;
- }
-
- return result;
-}
-
-// Returns true iff n is a prime number.
-bool IsPrime(int n) {
- // Trivial case 1: small numbers
- if (n <= 1) return false;
-
- // Trivial case 2: even numbers
- if (n % 2 == 0) return n == 2;
-
- // Now, we have that n is odd and n >= 3.
-
- // Try to divide n by every odd number i, starting from 3
- for (int i = 3; ; i += 2) {
- // We only have to try i up to the squre root of n
- if (i > n/i) break;
-
- // Now, we have i <= n/i < n.
- // If n is divisible by i, n is not prime.
- if (n % i == 0) return false;
- }
-
- // n has no integer factor in the range (1, n), and thus is prime.
- return true;
-}
+// Copyright 2019 Google Inc. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#include <assert.h>
+
+#include "tools/windows/converter_exe/tokenizer.h"
+
+namespace crash {
+
+// static
+void Tokenizer::Tokenize(const string &delimiters, const string &input,
+ vector<string> *output) {
+ assert(output);
+ output->clear();
+
+ string::size_type position = 0; // Where to begin looking for a delimiter
+ string::size_type new_position; // Position of found delimiter
+ string token;
+
+ while ((new_position = input.find_first_of(delimiters, position)) !=
+ string::npos) {
+ token = input.substr(position, new_position - position);
+ output->push_back(token);
+
+ // Next time, begin looking right after this delimiter.
+ position = new_position + 1;
+ }
+
+ // There are no more delimiters in the string. Take everything from the
+ // final delimiter up to the end of the string as a token. This may be
+ // an empty string.
+ token = input.substr(position);
+ output->push_back(token);
+}
+
+} // namespace crash
diff --git a/src/testing/gtest/test/gtest-typed-test2_test.cc b/src/tools/windows/converter_exe/tokenizer.h
index c284700b..f4bbcfd0 100644
--- a/src/testing/gtest/test/gtest-typed-test2_test.cc
+++ b/src/tools/windows/converter_exe/tokenizer.h
@@ -1,45 +1,51 @@
-// Copyright 2008 Google Inc.
-// All Rights Reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-#include <vector>
-
-#include "test/gtest-typed-test_test.h"
-#include "gtest/gtest.h"
-
-#if GTEST_HAS_TYPED_TEST_P
-
-// Tests that the same type-parameterized test case can be
-// instantiated in different translation units linked together.
-// (ContainerTest is also instantiated in gtest-typed-test_test.cc.)
-INSTANTIATE_TYPED_TEST_CASE_P(Vector, ContainerTest,
- testing::Types<std::vector<int> >);
-
-#endif // GTEST_HAS_TYPED_TEST_P
+// Copyright 2019 Google Inc. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef TOOLS_WINDOWS_CONVERTER_EXE_TOKENIZER_H_
+#define TOOLS_WINDOWS_CONVERTER_EXE_TOKENIZER_H_
+
+#include <string>
+#include <vector>
+
+namespace crash {
+
+using std::string;
+using std::vector;
+
+class Tokenizer {
+ public:
+ // Splits |input| into a series of tokens delimited in the input string by
+ // any of the characters in |delimiters|. The tokens are passed back in the
+ // |output| vector.
+ static void Tokenize(const string &delimiters, const string &input,
+ vector<string> *output);
+};
+
+} // namespace crash
+
+#endif // TOOLS_WINDOWS_CONVERTER_EXE_TOKENIZER_H_
diff --git a/src/tools/windows/converter_exe/winhttp_client.cc b/src/tools/windows/converter_exe/winhttp_client.cc
new file mode 100644
index 00000000..8a8ade3b
--- /dev/null
+++ b/src/tools/windows/converter_exe/winhttp_client.cc
@@ -0,0 +1,307 @@
+// Copyright 2019 Google Inc. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#include "tools/windows/converter_exe/winhttp_client.h"
+
+#include <assert.h>
+#include <stdlib.h>
+#include <windows.h>
+#include <winhttp.h>
+#include <vector>
+
+namespace crash {
+
+namespace internal {
+
+// This class implements HttpClient based on WinInet APIs.
+class WinHttpClient : public HttpClient {
+ public:
+ virtual ~WinHttpClient() {}
+ virtual bool CrackUrl(const TCHAR* url,
+ DWORD flags,
+ TCHAR* scheme,
+ size_t scheme_buffer_length,
+ TCHAR* host,
+ size_t host_buffer_length,
+ TCHAR* uri,
+ size_t uri_buffer_length,
+ int* port) const;
+ virtual bool Open(const TCHAR* user_agent,
+ DWORD access_type,
+ const TCHAR* proxy_name,
+ const TCHAR* proxy_bypass,
+ HttpHandle* session_handle) const;
+ virtual bool Connect(HttpHandle session_handle,
+ const TCHAR* server,
+ int port,
+ HttpHandle* connection_handle) const;
+ virtual bool OpenRequest(HttpHandle connection_handle,
+ const TCHAR* verb,
+ const TCHAR* uri,
+ const TCHAR* version,
+ const TCHAR* referrer,
+ bool is_secure,
+ HttpHandle* request_handle) const;
+ virtual bool SendRequest(HttpHandle request_handle,
+ const TCHAR* headers,
+ DWORD headers_length) const;
+ virtual bool ReceiveResponse(HttpHandle request_handle) const;
+ virtual bool GetHttpStatusCode(HttpHandle request_handle,
+ int* status_code) const;
+ virtual bool GetContentLength(HttpHandle request_handle,
+ DWORD* content_length) const;
+ virtual bool ReadData(HttpHandle request_handle,
+ void* buffer,
+ DWORD buffer_length,
+ DWORD* bytes_read) const;
+ virtual bool Close(HttpHandle handle) const;
+
+ private:
+ static DWORD MapAccessType(DWORD access_type);
+ static HINTERNET ToHINTERNET(HttpHandle handle);
+ static HttpHandle FromHINTERNET(HINTERNET handle);
+};
+
+bool WinHttpClient::CrackUrl(const TCHAR* url,
+ DWORD flags,
+ TCHAR* scheme,
+ size_t scheme_buffer_length,
+ TCHAR* host,
+ size_t host_buffer_length,
+ TCHAR* uri,
+ size_t uri_buffer_length,
+ int* port) const {
+ assert(url);
+ assert(scheme);
+ assert(host);
+ assert(uri);
+ assert(port);
+
+ URL_COMPONENTS url_comp = {0};
+ url_comp.dwStructSize = sizeof(url_comp);
+ url_comp.lpszScheme = scheme;
+ url_comp.dwSchemeLength = static_cast<DWORD>(scheme_buffer_length);
+ url_comp.lpszHostName = host;
+ url_comp.dwHostNameLength = static_cast<DWORD>(host_buffer_length);
+ url_comp.lpszUrlPath = uri;
+ url_comp.dwUrlPathLength = static_cast<DWORD>(uri_buffer_length);
+
+ bool result = !!::WinHttpCrackUrl(url, 0, flags, &url_comp);
+ if (result) {
+ *port = static_cast<int>(url_comp.nPort);
+ }
+ return result;
+}
+
+bool WinHttpClient::Open(const TCHAR* user_agent,
+ DWORD access_type,
+ const TCHAR* proxy_name,
+ const TCHAR* proxy_bypass,
+ HttpHandle* session_handle) const {
+ *session_handle = FromHINTERNET(::WinHttpOpen(user_agent,
+ MapAccessType(access_type),
+ proxy_name,
+ proxy_bypass,
+ 0));
+
+ return !!(*session_handle);
+}
+
+bool WinHttpClient::Connect(HttpHandle session_handle,
+ const TCHAR* server,
+ int port,
+ HttpHandle* connection_handle) const {
+ assert(server);
+
+ // Uses NULL user name and password to connect.
+ *connection_handle = FromHINTERNET(::WinHttpConnect(
+ ToHINTERNET(session_handle),
+ server,
+ static_cast<INTERNET_PORT>(port),
+ NULL));
+ return !!(*connection_handle);
+}
+
+bool WinHttpClient::OpenRequest(HttpHandle connection_handle,
+ const TCHAR* verb,
+ const TCHAR* uri,
+ const TCHAR* version,
+ const TCHAR* referrer,
+ bool is_secure,
+ HttpHandle* request_handle) const {
+ assert(connection_handle);
+ assert(verb);
+ assert(uri);
+ assert(request_handle);
+
+ *request_handle = FromHINTERNET(::WinHttpOpenRequest(
+ ToHINTERNET(connection_handle),
+ verb,
+ uri,
+ version,
+ referrer,
+ WINHTTP_DEFAULT_ACCEPT_TYPES,
+ is_secure ? WINHTTP_FLAG_SECURE : 0));
+ return !!(*request_handle);
+}
+
+bool WinHttpClient::SendRequest(HttpHandle request_handle,
+ const TCHAR* headers,
+ DWORD headers_length) const {
+ assert(request_handle);
+
+ return !!::WinHttpSendRequest(ToHINTERNET(request_handle),
+ headers,
+ headers_length,
+ NULL,
+ 0,
+ WINHTTP_IGNORE_REQUEST_TOTAL_LENGTH,
+ NULL);
+}
+
+bool WinHttpClient::ReceiveResponse(HttpHandle request_handle) const {
+ assert(request_handle);
+
+ return !!::WinHttpReceiveResponse(ToHINTERNET(request_handle), NULL);
+}
+
+bool WinHttpClient::GetHttpStatusCode(HttpHandle request_handle,
+ int* status_code) const {
+ TCHAR http_status_string[4] = {0};
+ DWORD http_status_string_size = sizeof(http_status_string);
+ if (!::WinHttpQueryHeaders(ToHINTERNET(request_handle),
+ WINHTTP_QUERY_STATUS_CODE,
+ WINHTTP_HEADER_NAME_BY_INDEX,
+ static_cast<void *>(&http_status_string),
+ &http_status_string_size, 0)) {
+ return false;
+ }
+
+ *status_code = static_cast<DWORD>(_tcstol(http_status_string, NULL, 10));
+ return true;
+}
+
+bool WinHttpClient::GetContentLength(HttpHandle request_handle,
+ DWORD* content_length) const {
+ assert(request_handle);
+ assert(content_length);
+
+ TCHAR content_length_string[11] = {0};
+ DWORD content_length_string_size = sizeof(content_length_string);
+ if (!::WinHttpQueryHeaders(ToHINTERNET(request_handle),
+ WINHTTP_QUERY_CONTENT_LENGTH,
+ WINHTTP_HEADER_NAME_BY_INDEX,
+ static_cast<void *>(&content_length_string),
+ &content_length_string_size, 0)) {
+ *content_length = kUnknownContentLength;
+ } else {
+ *content_length =
+ static_cast<DWORD>(wcstol(content_length_string, NULL, 10));
+ }
+ return true;
+}
+
+bool WinHttpClient::ReadData(HttpHandle request_handle,
+ void* buffer,
+ DWORD buffer_length,
+ DWORD* bytes_read) const {
+ assert(request_handle);
+ assert(buffer);
+ assert(bytes_read);
+
+ DWORD bytes_read_local = 0;
+ if (!::WinHttpReadData(ToHINTERNET(request_handle),
+ buffer,
+ buffer_length,
+ &bytes_read_local)) {
+ return false;
+ }
+ *bytes_read = bytes_read_local;
+ return true;
+}
+
+bool WinHttpClient::Close(HttpHandle handle) const {
+ assert(handle);
+ return !!::WinHttpCloseHandle(ToHINTERNET(handle));
+}
+
+DWORD WinHttpClient::MapAccessType(DWORD access_type) {
+ switch (static_cast<AccessType>(access_type)) {
+ case ACCESS_TYPE_PRECONFIG:
+ default:
+ return WINHTTP_ACCESS_TYPE_DEFAULT_PROXY;
+ case ACCESS_TYPE_DIRECT:
+ return WINHTTP_ACCESS_TYPE_NO_PROXY;
+ case ACCESS_TYPE_PROXY:
+ return WINHTTP_ACCESS_TYPE_NAMED_PROXY;
+ }
+}
+
+
+HINTERNET WinHttpClient::ToHINTERNET(HttpHandle handle) {
+ return static_cast<HINTERNET>(handle);
+}
+
+HttpHandle WinHttpClient::FromHINTERNET(HINTERNET handle) {
+ return static_cast<HttpHandle>(handle);
+}
+
+} // namespace internal
+
+HttpClient* CreateWinHttpClient(const TCHAR* url) {
+ assert(url);
+
+ internal::WinHttpClient winhttp;
+ wchar_t scheme[16] = {0};
+ wchar_t host[256] = {0};
+ wchar_t path[256] = {0};
+ int port = 0;
+
+ if (!winhttp.CrackUrl(url,
+ 0,
+ scheme,
+ sizeof(scheme)/sizeof(scheme[0]),
+ host,
+ sizeof(host)/sizeof(host[0]),
+ path,
+ sizeof(path)/sizeof(path[0]),
+ &port)) {
+ return NULL;
+ }
+
+ if (_wcsicmp(scheme, L"https") == 0) {
+ // Winhttp under WINE doesn't support wildcard certificates, so avoid
+ // to use it if the scheme is https. The caller should fall back to
+ // use wininet if NULL is returned.
+ return NULL;
+ }
+
+ return new internal::WinHttpClient();
+}
+
+} // namespace crash
diff --git a/src/testing/gtest/test/production.cc b/src/tools/windows/converter_exe/winhttp_client.h
index 8b8a40b4..819d610f 100644
--- a/src/testing/gtest/test/production.cc
+++ b/src/tools/windows/converter_exe/winhttp_client.h
@@ -1,36 +1,40 @@
-// Copyright 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-//
-// This is part of the unit test for include/gtest/gtest_prod.h.
-
-#include "production.h"
-
-PrivateCode::PrivateCode() : x_(0) {}
+// Copyright 2019 Google Inc. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef TOOLS_WINDOWS_CONVERTER_EXE_WINHTTP_CLIENT_H_
+#define TOOLS_WINDOWS_CONVERTER_EXE_WINHTTP_CLIENT_H_
+
+#include "tools/windows/converter_exe/http_client.h"
+
+namespace crash {
+
+HttpClient* CreateWinHttpClient(const TCHAR* url);
+
+} // namespace crash
+
+#endif // TOOLS_WINDOWS_CONVERTER_EXE_WINHTTP_CLIENT_H_
diff --git a/src/tools/windows/converter_exe/wininet_client.cc b/src/tools/windows/converter_exe/wininet_client.cc
new file mode 100644
index 00000000..3e542db2
--- /dev/null
+++ b/src/tools/windows/converter_exe/wininet_client.cc
@@ -0,0 +1,278 @@
+// Copyright 2019 Google Inc. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#include "tools/windows/converter_exe/wininet_client.h"
+
+#include <assert.h>
+#include <stdlib.h>
+#include <windows.h>
+#include <wininet.h>
+
+namespace crash {
+
+namespace internal {
+
+// This class implements HttpClient based on WinInet APIs.
+class WinInetClient : public HttpClient {
+ public:
+ virtual ~WinInetClient() {}
+ virtual bool CrackUrl(const TCHAR* url,
+ DWORD flags,
+ TCHAR* scheme,
+ size_t scheme_buffer_length,
+ TCHAR* host,
+ size_t host_buffer_length,
+ TCHAR* uri,
+ size_t uri_buffer_length,
+ int* port) const;
+ virtual bool Open(const TCHAR* user_agent,
+ DWORD access_type,
+ const TCHAR* proxy_name,
+ const TCHAR* proxy_bypass,
+ HttpHandle* session_handle) const;
+ virtual bool Connect(HttpHandle session_handle,
+ const TCHAR* server,
+ int port,
+ HttpHandle* connection_handle) const;
+ virtual bool OpenRequest(HttpHandle connection_handle,
+ const TCHAR* verb,
+ const TCHAR* uri,
+ const TCHAR* version,
+ const TCHAR* referrer,
+ bool is_secure,
+ HttpHandle* request_handle) const;
+ virtual bool SendRequest(HttpHandle request_handle,
+ const TCHAR* headers,
+ DWORD headers_length) const;
+ virtual bool ReceiveResponse(HttpHandle request_handle) const;
+ virtual bool GetHttpStatusCode(HttpHandle request_handle,
+ int* status_code) const;
+ virtual bool GetContentLength(HttpHandle request_handle,
+ DWORD* content_length) const;
+ virtual bool ReadData(HttpHandle request_handle,
+ void* buffer,
+ DWORD buffer_length,
+ DWORD* bytes_read) const;
+ virtual bool Close(HttpHandle handle) const;
+
+ private:
+ static DWORD MapAccessType(DWORD access_type);
+ static HINTERNET ToHINTERNET(HttpHandle handle);
+ static HttpHandle FromHINTERNET(HINTERNET handle);
+};
+
+bool WinInetClient::CrackUrl(const TCHAR* url,
+ DWORD flags,
+ TCHAR* scheme,
+ size_t scheme_buffer_length,
+ TCHAR* host,
+ size_t host_buffer_length,
+ TCHAR* uri,
+ size_t uri_buffer_length,
+ int* port) const {
+ assert(url);
+ assert(scheme);
+ assert(host);
+ assert(uri);
+ assert(port);
+
+ URL_COMPONENTS url_comp = {0};
+ url_comp.dwStructSize = sizeof(url_comp);
+ url_comp.lpszScheme = scheme;
+ url_comp.dwSchemeLength = static_cast<DWORD>(scheme_buffer_length);
+ url_comp.lpszHostName = host;
+ url_comp.dwHostNameLength = static_cast<DWORD>(host_buffer_length);
+ url_comp.lpszUrlPath = uri;
+ url_comp.dwUrlPathLength = static_cast<DWORD>(uri_buffer_length);
+
+ bool result = !!::InternetCrackUrl(url, 0, flags, &url_comp);
+ if (result) {
+ *port = static_cast<int>(url_comp.nPort);
+ }
+ return result;
+}
+
+bool WinInetClient::Open(const TCHAR* user_agent,
+ DWORD access_type,
+ const TCHAR* proxy_name,
+ const TCHAR* proxy_bypass,
+ HttpHandle* session_handle) const {
+ *session_handle = FromHINTERNET(::InternetOpen(user_agent,
+ MapAccessType(access_type),
+ proxy_name,
+ proxy_bypass,
+ 0));
+ return !!(*session_handle);
+}
+
+bool WinInetClient::Connect(HttpHandle session_handle,
+ const TCHAR* server,
+ int port,
+ HttpHandle* connection_handle) const {
+ assert(server);
+
+ // Uses NULL user name and password to connect. Always uses http service.
+ *connection_handle = FromHINTERNET(::InternetConnect(
+ ToHINTERNET(session_handle),
+ server,
+ static_cast<INTERNET_PORT>(port),
+ NULL,
+ NULL,
+ INTERNET_SERVICE_HTTP,
+ 0,
+ 0));
+ return !!(*connection_handle);
+}
+
+bool WinInetClient::OpenRequest(HttpHandle connection_handle,
+ const TCHAR* verb,
+ const TCHAR* uri,
+ const TCHAR* version,
+ const TCHAR* referrer,
+ bool is_secure,
+ HttpHandle* request_handle) const {
+ assert(connection_handle);
+ assert(verb);
+ assert(uri);
+
+ *request_handle = FromHINTERNET(::HttpOpenRequest(
+ ToHINTERNET(connection_handle),
+ verb,
+ uri,
+ version,
+ referrer,
+ NULL,
+ is_secure ? INTERNET_FLAG_SECURE : 0,
+ NULL));
+ return !!(*request_handle);
+}
+
+bool WinInetClient::SendRequest(HttpHandle request_handle,
+ const TCHAR* headers,
+ DWORD headers_length) const {
+ assert(request_handle);
+
+ return !!::HttpSendRequest(ToHINTERNET(request_handle),
+ headers,
+ headers_length,
+ NULL,
+ 0);
+}
+
+bool WinInetClient::ReceiveResponse(HttpHandle) const {
+ return true;
+}
+
+bool WinInetClient::GetHttpStatusCode(HttpHandle request_handle,
+ int* status_code) const {
+ assert(request_handle);
+
+ TCHAR http_status_string[4] = {0};
+ DWORD http_status_string_size = sizeof(http_status_string);
+ if (!::HttpQueryInfo(ToHINTERNET(request_handle),
+ HTTP_QUERY_STATUS_CODE,
+ static_cast<void *>(&http_status_string),
+ &http_status_string_size,
+ 0)) {
+ return false;
+ }
+
+ *status_code = _tcstol(http_status_string, NULL, 10);
+ return true;
+}
+
+bool WinInetClient::GetContentLength(HttpHandle request_handle,
+ DWORD* content_length) const {
+ assert(request_handle);
+ assert(content_length);
+
+ TCHAR content_length_string[11];
+ DWORD content_length_string_size = sizeof(content_length_string);
+ if (!::HttpQueryInfo(ToHINTERNET(request_handle),
+ HTTP_QUERY_CONTENT_LENGTH,
+ static_cast<void *>(&content_length_string),
+ &content_length_string_size,
+ 0)) {
+ *content_length = kUnknownContentLength;
+ } else {
+ *content_length = wcstol(content_length_string, NULL, 10);
+ }
+ return true;
+}
+
+bool WinInetClient::ReadData(HttpHandle request_handle,
+ void* buffer,
+ DWORD buffer_length,
+ DWORD* bytes_read) const {
+ assert(request_handle);
+ assert(buffer);
+ assert(bytes_read);
+
+ DWORD bytes_read_local = 0;
+ if (!::InternetReadFile(ToHINTERNET(request_handle),
+ buffer,
+ buffer_length,
+ &bytes_read_local)) {
+ return false;
+ }
+ *bytes_read = bytes_read_local;
+ return true;
+}
+
+bool WinInetClient::Close(HttpHandle handle) const {
+ assert(handle);
+ return !!::InternetCloseHandle(ToHINTERNET(handle));
+}
+
+DWORD WinInetClient::MapAccessType(DWORD access_type) {
+ switch (static_cast<AccessType>(access_type)) {
+ case ACCESS_TYPE_PRECONFIG:
+ default:
+ return INTERNET_OPEN_TYPE_PRECONFIG;
+ case ACCESS_TYPE_DIRECT:
+ return INTERNET_OPEN_TYPE_DIRECT;
+ case ACCESS_TYPE_PROXY:
+ return INTERNET_OPEN_TYPE_PROXY;
+ }
+}
+
+HINTERNET WinInetClient::ToHINTERNET(HttpHandle handle) {
+ return static_cast<HINTERNET>(handle);
+}
+
+HttpHandle WinInetClient::FromHINTERNET(HINTERNET handle) {
+ return static_cast<HttpHandle>(handle);
+}
+
+} // namespace internal
+
+HttpClient* CreateWinInetClient(const TCHAR*) {
+ return new internal::WinInetClient();
+}
+
+} // namespace crash
diff --git a/src/common/android/include/sys/signal.h b/src/tools/windows/converter_exe/wininet_client.h
index 20c81e93..bd04b605 100644
--- a/src/common/android/include/sys/signal.h
+++ b/src/tools/windows/converter_exe/wininet_client.h
@@ -1,35 +1,40 @@
-// Copyright (c) 2012, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_SYS_SIGNAL_H
-#define GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_SYS_SIGNAL_H
-
-#include <signal.h>
-
-#endif // GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_SYS_SIGNAL_H
+// Copyright 2019 Google Inc. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef TOOLS_WINDOWS_CONVERTER_EXE_WININET_CLIENT_H_
+#define TOOLS_WINDOWS_CONVERTER_EXE_WININET_CLIENT_H_
+
+#include "tools/windows/converter_exe/http_client.h"
+
+namespace crash {
+
+HttpClient* CreateWinInetClient(const TCHAR* url);
+
+} // namespace crash
+
+#endif // TOOLS_WINDOWS_CONVERTER_EXE_WININET_CLIENT_H_
diff --git a/src/tools/windows/converter_exe/winsymconv.cmd b/src/tools/windows/converter_exe/winsymconv.cmd
new file mode 100644
index 00000000..bea84b58
--- /dev/null
+++ b/src/tools/windows/converter_exe/winsymconv.cmd
@@ -0,0 +1,86 @@
+@if "%ECHOON%"=="" @echo off
+SETLOCAL
+
+REM ******************************************************************
+REM Usage:
+REM winsymconv
+REM ******************************************************************
+
+REM ******************************************************************
+REM Initialize
+REM ******************************************************************
+SET SCRIPT_LOCATION=%~dp0
+SET DBGHELP_WINHTTP=
+SET USE_WINHTTP=
+
+REM ******************************************************************
+REM Go to script location
+REM ******************************************************************
+pushd %SCRIPT_LOCATION%
+
+REM ******************************************************************
+REM Make sure the symbol file directory exists
+REM ******************************************************************
+SET SYMBOL_DIR=%SCRIPT_LOCATION%symbol
+if NOT EXIST %SYMBOL_DIR% MKDIR %SYMBOL_DIR%
+if NOT EXIST %SYMBOL_DIR% echo Failed to create directory '%SYMBOL_DIR%' & goto :fail
+
+:restart
+
+REM ******************************************************************
+REM Convert missing Windows symbols on the staging instance.
+REM ******************************************************************
+echo Converting missing Windows symbols on staging instance ...
+
+google_converter.exe ^
+ -n http://msdl.microsoft.com/download/symbols ^
+ -n http://symbols.mozilla.org/firefox ^
+ -n http://chromium-browser-symsrv.commondatastorage.googleapis.com ^
+ -n https://download.amd.com/dir/bin ^
+ -n https://driver-symbols.nvidia.com ^
+ -n https://software.intel.com/sites/downloads/symbols ^
+ -l %SYMBOL_DIR% ^
+ -s https://clients2.google.com/cr/staging_symbol ^
+ -m https://clients2.google.com/cr/staging_symbol/missingsymbols ^
+ -t https://clients2.google.com/cr/staging_symbol/fetchfailed ^
+ -b "google|chrome|internal|private" ^
+ > %SCRIPT_LOCATION%last_cycle_staging.txt
+
+REM ******************************************************************
+REM Convert missing Windows symbols on the production instance.
+REM ******************************************************************
+echo Converting missing Windows symbols on production instance ...
+
+google_converter.exe ^
+ -n http://msdl.microsoft.com/download/symbols ^
+ -n http://symbols.mozilla.org/firefox ^
+ -n http://chromium-browser-symsrv.commondatastorage.googleapis.com ^
+ -n https://download.amd.com/dir/bin ^
+ -n https://driver-symbols.nvidia.com ^
+ -n https://software.intel.com/sites/downloads/symbols ^
+ -l %SYMBOL_DIR% ^
+ -s https://clients2.google.com/cr/symbol ^
+ -m https://clients2.google.com/cr/symbol/missingsymbols ^
+ -t https://clients2.google.com/cr/symbol/fetchfailed ^
+ -b "google|chrome|internal|private" ^
+ > %SCRIPT_LOCATION%last_cycle_prod.txt
+
+REM ******************************************************************
+REM Sleep for 5 minutes ...
+REM ******************************************************************
+echo Sleeping for 5 minutes ...
+
+%SCRIPT_LOCATION%sleep.exe 300
+
+REM ******************************************
+REM Restart work loop ...
+REM ******************************************
+goto :restart
+
+:success
+ENDLOCAL
+exit /b 0
+
+:fail
+ENDLOCAL
+exit /b 1
diff --git a/src/tools/windows/converter_exe/winsymconv_test.cmd b/src/tools/windows/converter_exe/winsymconv_test.cmd
new file mode 100644
index 00000000..c1777066
--- /dev/null
+++ b/src/tools/windows/converter_exe/winsymconv_test.cmd
@@ -0,0 +1,72 @@
+@if "%ECHOON%"=="" @echo off
+SETLOCAL
+
+REM ******************************************************************
+REM Usage:
+REM winsymconv_test
+REM ******************************************************************
+
+REM ******************************************************************
+REM Initialize
+REM ******************************************************************
+SET SCRIPT_LOCATION=%~dp0
+SET DBGHELP_WINHTTP=
+SET USE_WINHTTP=
+
+REM ******************************************************************
+REM Go to script location
+REM ******************************************************************
+pushd %SCRIPT_LOCATION%
+
+REM ******************************************************************
+REM Make sure the symbol file directory exists
+REM ******************************************************************
+SET SYMBOL_DIR=%SCRIPT_LOCATION%symbol
+if NOT EXIST %SYMBOL_DIR% MKDIR %SYMBOL_DIR%
+if NOT EXIST %SYMBOL_DIR% echo Failed to create directory '%SYMBOL_DIR%' & goto :fail
+
+REM ******************************************************************
+REM Testing on the staging instance.
+REM ******************************************************************
+echo Testing on the staging instance ...
+
+google_converter.exe ^
+ -n http://msdl.microsoft.com/download/symbols ^
+ -n http://symbols.mozilla.org/firefox ^
+ -n http://chromium-browser-symsrv.commondatastorage.googleapis.com ^
+ -n https://download.amd.com/dir/bin ^
+ -n https://driver-symbols.nvidia.com ^
+ -n https://software.intel.com/sites/downloads/symbols ^
+ -l %SYMBOL_DIR% ^
+ -s https://clients2.google.com/cr/staging_symbol ^
+ -mf %SCRIPT_LOCATION%missing_symbols_test.txt ^
+ -t https://clients2.google.com/cr/staging_symbol/fetchfailed ^
+ -b "google|chrome|internal|private" ^
+ > %SCRIPT_LOCATION%last_cycle_staging.txt
+
+REM ******************************************************************
+REM Testing on the production instance.
+REM ******************************************************************
+echo Testing on the production instance ...
+
+google_converter.exe ^
+ -n http://msdl.microsoft.com/download/symbols ^
+ -n http://symbols.mozilla.org/firefox ^
+ -n http://chromium-browser-symsrv.commondatastorage.googleapis.com ^
+ -n https://download.amd.com/dir/bin ^
+ -n https://driver-symbols.nvidia.com ^
+ -n https://software.intel.com/sites/downloads/symbols ^
+ -l %SYMBOL_DIR% ^
+ -s https://clients2.google.com/cr/symbol ^
+ -mf %SCRIPT_LOCATION%missing_symbols_test.txt ^
+ -t https://clients2.google.com/cr/symbol/fetchfailed ^
+ -b "google|chrome|internal|private" ^
+ > %SCRIPT_LOCATION%last_cycle_prod.txt
+
+:success
+ENDLOCAL
+exit /b 0
+
+:fail
+ENDLOCAL
+exit /b 1
diff --git a/src/tools/windows/dump_syms/dump_syms.cc b/src/tools/windows/dump_syms/dump_syms.cc
index 3e8827b6..5b7d1777 100644
--- a/src/tools/windows/dump_syms/dump_syms.cc
+++ b/src/tools/windows/dump_syms/dump_syms.cc
@@ -31,31 +31,43 @@
// a text-based format that we can use from the minidump processor.
#include <stdio.h>
+#include <wchar.h>
#include <string>
#include "common/windows/pdb_source_line_writer.h"
+#include "common/windows/pe_source_line_writer.h"
using std::wstring;
using google_breakpad::PDBSourceLineWriter;
+using google_breakpad::PESourceLineWriter;
+using std::unique_ptr;
int wmain(int argc, wchar_t **argv) {
- if (argc < 2) {
- fprintf(stderr, "Usage: %ws <file.[pdb|exe|dll]>\n", argv[0]);
+ bool success;
+ if (argc == 2) {
+ PDBSourceLineWriter pdb_writer;
+ if (!pdb_writer.Open(wstring(argv[1]), PDBSourceLineWriter::ANY_FILE)) {
+ fprintf(stderr, "Open failed.\n");
+ return 1;
+ }
+ success = pdb_writer.WriteSymbols(stdout);
+ } else if (argc == 3 && wcscmp(argv[1], L"--pe") == 0) {
+ PESourceLineWriter pe_writer(argv[2]);
+ success = pe_writer.WriteSymbols(stdout);
+ } else {
+ fprintf(stderr, "Usage: %ws [--pe] <file.[pdb|exe|dll]>\n", argv[0]);
+ fprintf(stderr, "Options:\n");
+ fprintf(stderr, "--pe:\tRead debugging information from PE file and do "
+ "not attempt to locate matching PDB file.\n"
+ "\tThis is only supported for PE32+ (64 bit) PE files.\n");
return 1;
}
- PDBSourceLineWriter writer;
- if (!writer.Open(wstring(argv[1]), PDBSourceLineWriter::ANY_FILE)) {
- fprintf(stderr, "Open failed\n");
+ if (!success) {
+ fprintf(stderr, "WriteSymbols failed.\n");
return 1;
}
- if (!writer.WriteMap(stdout)) {
- fprintf(stderr, "WriteMap failed\n");
- return 1;
- }
-
- writer.Close();
return 0;
}
diff --git a/src/tools/windows/dump_syms/dump_syms_unittest.cc b/src/tools/windows/dump_syms/dump_syms_unittest.cc
index 61f84431..766e5c09 100644
--- a/src/tools/windows/dump_syms/dump_syms_unittest.cc
+++ b/src/tools/windows/dump_syms/dump_syms_unittest.cc
@@ -32,8 +32,7 @@
#include <string>
#include <utility>
-#include "gmock/gmock.h"
-#include "gtest/gtest.h"
+#include "breakpad_googletest_includes.h"
namespace tools {
namespace windows {
@@ -56,11 +55,15 @@ const wchar_t* kRootNames[] = {
// without source data.
L"omap_stretched",
// A PDB file with OMAP data for an image that has been basic block reordered.
- L"omap_reorder_bbs",
+ L"omap_reorder_bbs",
// A 64bit PDB file with no OMAP data.
L"dump_syms_regtest64",
};
+const wchar_t* kPEOnlyRootNames[] = {
+ L"pe_only_symbol_test",
+};
+
void TrimLastComponent(const std::wstring& path,
std::wstring* trimmed,
std::wstring* component) {
@@ -122,7 +125,7 @@ void RunCommand(const std::wstring& command_line,
STARTUPINFO startup_info = {};
PROCESS_INFORMATION process_info = {};
startup_info.cb = sizeof(STARTUPINFO);
- startup_info.hStdError = child_stdout_write;
+ startup_info.hStdError = NULL;
startup_info.hStdInput = child_stdin_read;
startup_info.hStdOutput = child_stdout_write;
startup_info.dwFlags = STARTF_USESTDHANDLES;
@@ -163,7 +166,7 @@ void GetFileContents(const std::wstring& path, std::string* content) {
}
}
-class DumpSymsRegressionTest : public testing::Test {
+class DumpSymsRegressionTest : public testing::TestWithParam<const wchar_t *> {
public:
virtual void SetUp() {
std::wstring self_dir;
@@ -178,27 +181,64 @@ class DumpSymsRegressionTest : public testing::Test {
std::wstring testdata_dir;
};
+class DumpSymsPEOnlyRegressionTest : public testing::TestWithParam<const wchar_t *> {
+public:
+ virtual void SetUp() {
+ std::wstring self_dir;
+ ASSERT_TRUE(GetSelfDirectory(&self_dir));
+ dump_syms_exe = self_dir + L"\\dump_syms.exe";
+
+ TrimLastComponent(self_dir, &testdata_dir, NULL);
+ testdata_dir += L"\\testdata";
+ }
+
+ std::wstring dump_syms_exe;
+ std::wstring testdata_dir;
+};
+
} //namespace
-TEST_F(DumpSymsRegressionTest, EnsureDumpedSymbolsMatch) {
- for (size_t i = 0; i < sizeof(kRootNames) / sizeof(kRootNames[0]); ++i) {
- const wchar_t* root_name = kRootNames[i];
- std::wstring root_path = testdata_dir + L"\\" + root_name;
+TEST_P(DumpSymsRegressionTest, EnsureDumpedSymbolsMatch) {
+ const wchar_t* root_name = GetParam();
+ std::wstring root_path = testdata_dir + L"\\" + root_name;
- std::wstring sym_path = root_path + L".sym";
- std::string expected_symbols;
- ASSERT_NO_FATAL_FAILURE(GetFileContents(sym_path, &expected_symbols));
+ std::wstring sym_path = root_path + L".sym";
+ std::string expected_symbols;
+ ASSERT_NO_FATAL_FAILURE(GetFileContents(sym_path, &expected_symbols));
- std::wstring pdb_path = root_path + L".pdb";
- std::wstring command_line = L"\"" + dump_syms_exe + L"\" \"" +
- pdb_path + L"\"";
- std::string symbols;
- ASSERT_NO_FATAL_FAILURE(RunCommand(command_line, &symbols));
+ std::wstring pdb_path = root_path + L".pdb";
+ std::wstring command_line = L"\"" + dump_syms_exe + L"\" \"" +
+ pdb_path + L"\"";
+ std::string symbols;
+ ASSERT_NO_FATAL_FAILURE(RunCommand(command_line, &symbols));
- EXPECT_EQ(expected_symbols, symbols);
- }
+ EXPECT_EQ(expected_symbols, symbols);
+}
+
+INSTANTIATE_TEST_CASE_P(DumpSyms, DumpSymsRegressionTest,
+ testing::ValuesIn(kRootNames));
+
+TEST_P(DumpSymsPEOnlyRegressionTest, EnsurePEOnlyDumpedSymbolsMatch) {
+ const wchar_t* root_name = GetParam();
+ std::wstring root_path = testdata_dir + L"\\" + root_name;
+
+ std::wstring sym_path = root_path + L".sym";
+ std::string expected_symbols;
+ ASSERT_NO_FATAL_FAILURE(GetFileContents(sym_path, &expected_symbols));
+
+ std::wstring dll_path = root_path + L".dll";
+ std::wstring command_line = L"\"" + dump_syms_exe + L"\" --pe \"" +
+ dll_path + L"\"";
+ std::string symbols;
+ ASSERT_NO_FATAL_FAILURE(RunCommand(command_line, &symbols));
+
+ EXPECT_EQ(expected_symbols, symbols);
}
+INSTANTIATE_TEST_CASE_P(PEOnlyDumpSyms, DumpSymsPEOnlyRegressionTest,
+ testing::ValuesIn(kPEOnlyRootNames));
+
+
} // namespace dump_syms
} // namespace windows
-} // namespace tools \ No newline at end of file
+} // namespace tools
diff --git a/src/tools/windows/dump_syms/testdata/dump_syms_regtest.cc b/src/tools/windows/dump_syms/testdata/dump_syms_regtest.cc
index e5cc5cf9..e8efbeb8 100644
--- a/src/tools/windows/dump_syms/testdata/dump_syms_regtest.cc
+++ b/src/tools/windows/dump_syms/testdata/dump_syms_regtest.cc
@@ -27,9 +27,15 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+// with 32-bit cl
// cl /Zi dump_syms_regtest.cc /link /PROFILE
// dump_syms dump_syms_regtest.pdb > dump_syms_regtest.sym
+// with 64-bit cl
+// cp dump_syms_regtest.cc dump_syms_regtest64.cc
+// cl /Zi dump_syms_regtest64.cc /link /PROFILE
+// dump_syms dump_syms_regtest64.pdb > dump_syms_regtest64.sym
+
namespace google_breakpad {
class C {
diff --git a/src/tools/windows/dump_syms/testdata/dump_syms_regtest.sym b/src/tools/windows/dump_syms/testdata/dump_syms_regtest.sym
index 72d147e0..696155dd 100644
--- a/src/tools/windows/dump_syms/testdata/dump_syms_regtest.sym
+++ b/src/tools/windows/dump_syms/testdata/dump_syms_regtest.sym
@@ -1,2945 +1,2945 @@
-MODULE windows x86 9214611565FA4C538FE724A797B860F71 dump_syms_regtest.pdb
-FILE 1 c:\src\breakpad\src\src\tools\windows\dump_syms\testdata\dump_syms_regtest.cc
-FILE 2 f:\dd\public\sdk\inc\internal\pebteb.h
-FILE 3 f:\dd\public\sdk\inc\internal\ntldr.h
-FILE 4 f:\dd\public\sdk\inc\internal\ntconfig.h
-FILE 5 f:\dd\public\sdk\inc\internal\ntregapi.h
-FILE 6 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\h\stdarg.h
-FILE 7 f:\dd\public\ddk\inc\ntdef.h
-FILE 8 f:\dd\public\sdk\inc\internal\ntmmapi.h
-FILE 9 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\h\ctype.h
-FILE 10 f:\dd\public\sdk\inc\pshpack1.h
-FILE 11 f:\dd\public\sdk\inc\internal\nxi386.h
-FILE 12 f:\dd\public\ddk\inc\poppack.h
-FILE 13 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\h\process.h
-FILE 14 f:\dd\public\sdk\inc\pshpack8.h
-FILE 15 f:\dd\public\ddk\inc\ntpoapi.h
-FILE 16 f:\dd\public\sdk\inc\internal\ntexapi.h
-FILE 17 f:\dd\public\sdk\inc\poppack.h
-FILE 18 f:\dd\public\ddk\inc\ntimage.h
-FILE 19 f:\dd\public\ddk\inc\pshpack4.h
-FILE 20 f:\dd\public\sdk\inc\pshpack2.h
-FILE 21 f:\dd\public\ddk\inc\ntnls.h
-FILE 22 f:\dd\public\sdk\inc\internal\ntelfapi.h
-FILE 23 f:\dd\public\sdk\inc\internal\ntpsapi.h
-FILE 24 f:\dd\public\sdk\inc\internal\nti386.h
-FILE 25 f:\dd\public\sdk\inc\specstrings.h
-FILE 26 f:\dd\public\sdk\inc\sal_supp.h
-FILE 27 f:\dd\public\sdk\inc\specstrings_supp.h
-FILE 28 f:\dd\public\sdk\inc\specstrings_strict.h
-FILE 29 f:\dd\public\sdk\inc\specstrings_undef.h
-FILE 30 f:\dd\public\sdk\inc\driverspecs.h
-FILE 31 f:\dd\public\sdk\inc\sdv_driverspecs.h
-FILE 32 f:\dd\public\sdk\inc\basetsd.h
-FILE 33 f:\dd\public\sdk\inc\internal\ntpnpapi.h
-FILE 34 f:\dd\public\sdk\inc\cfg.h
-FILE 35 f:\dd\public\sdk\inc\internal\ntxcapi.h
-FILE 36 f:\dd\public\sdk\inc\guiddef.h
-FILE 37 f:\dd\public\sdk\inc\internal\nt.h
-FILE 38 f:\dd\public\sdk\inc\ntstatus.h
-FILE 39 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\h\excpt.h
-FILE 40 f:\dd\public\sdk\inc\internal\ntkeapi.h
-FILE 41 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\h\crtdefs.h
-FILE 42 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\h\sal.h
-FILE 43 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\h\codeanalysis\sourceannotations.h
-FILE 44 f:\dd\public\sdk\inc\internal\ntobapi.h
-FILE 45 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\h\string.h
-FILE 46 f:\dd\public\sdk\inc\internal\ntioapi.h
-FILE 47 f:\dd\public\ddk\inc\devioctl.h
-FILE 48 f:\dd\public\sdk\inc\internal\ntseapi.h
-FILE 49 f:\dd\public\ddk\inc\mce.h
-FILE 50 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\misc\i386\chandler4.c
-FILE 51 f:\dd\public\sdk\inc\pshpack4.h
-FILE 52 f:\dd\public\devdiv\inc\ddbanned.h
-FILE 53 f:\dd\public\sdk\inc\internal\ntlpcapi.h
-FILE 54 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\h\vadefs.h
-FILE 55 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\h\cruntime.h
-FILE 56 f:\dd\public\sdk\inc\internal\ntiolog.h
-FILE 57 f:\dd\vctools\crt_bld\SELF_X86\crt\prebuild\misc\i386\exsup.asm
-FILE 58 f:\dd\vctools\crt_bld\SELF_X86\crt\prebuild\h\pversion.inc
-FILE 59 f:\dd\vctools\crt_bld\SELF_X86\crt\prebuild\h\cmacros.inc
-FILE 60 f:\dd\vctools\crt_bld\SELF_X86\crt\prebuild\h\exsup.inc
-FILE 61 f:\dd\vctools\crt_bld\SELF_X86\crt\prebuild\misc\i386\nlgsupp.asm
-FILE 62 f:\dd\vctools\crt_bld\SELF_X86\crt\prebuild\misc\i386\exsup4.asm
-FILE 64 f:\dd\vctools\crt_bld\SELF_X86\crt\prebuild\misc\i386\sehprolg4.asm
-FILE 65 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\string\i386\p4_memcpy.c
-FILE 69 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\string\i386\memcmp.c
-FILE 73 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\string\i386\p4_memset.c
-FILE 77 f:\dd\public\sdk\inc\winreg.h
-FILE 78 f:\dd\public\sdk\inc\imm.h
-FILE 79 f:\dd\public\sdk\inc\wingdi.h
-FILE 80 f:\dd\vctools\crt_bld\self_x86\crt\src\stdlib.h
-FILE 81 f:\dd\public\sdk\inc\winerror.h
-FILE 82 f:\dd\public\sdk\inc\ktmtypes.h
-FILE 84 f:\dd\vctools\crt_bld\self_x86\crt\src\stdarg.h
-FILE 85 f:\dd\public\sdk\inc\windef.h
-FILE 86 f:\dd\public\sdk\inc\winbase.h
-FILE 88 f:\dd\vctools\crt_bld\self_x86\crt\src\string.h
-FILE 89 f:\dd\public\sdk\inc\winuser.h
-FILE 91 f:\dd\public\sdk\inc\winnetwk.h
-FILE 92 f:\dd\public\sdk\inc\winnt.h
-FILE 93 f:\dd\public\sdk\inc\wnnc.h
-FILE 94 f:\dd\vctools\crt_bld\self_x86\crt\src\ctype.h
-FILE 96 f:\dd\public\sdk\inc\winnls.h
-FILE 98 f:\dd\vctools\crt_bld\self_x86\crt\src\mtdll.h
-FILE 99 f:\dd\vctools\crt_bld\self_x86\crt\src\crtdefs.h
-FILE 100 f:\dd\vctools\crt_bld\self_x86\crt\src\sal.h
-FILE 101 f:\dd\vctools\crt_bld\self_x86\crt\src\codeanalysis\sourceannotations.h
-FILE 102 f:\dd\public\sdk\inc\winver.h
-FILE 103 f:\dd\public\sdk\inc\verrsrc.h
-FILE 104 f:\dd\public\sdk\inc\wincon.h
-FILE 105 f:\dd\public\sdk\inc\stralign.h
-FILE 107 f:\dd\public\sdk\inc\mcx.h
-FILE 108 f:\dd\vctools\crt_bld\self_x86\crt\src\atox.c
-FILE 109 f:\dd\vctools\crt_bld\self_x86\crt\src\limits.h
-FILE 110 f:\dd\public\sdk\inc\windows.h
-FILE 111 f:\dd\vctools\crt_bld\self_x86\crt\src\setlocal.h
-FILE 112 f:\dd\public\sdk\inc\sdkddkver.h
-FILE 113 f:\dd\vctools\crt_bld\self_x86\crt\src\oscalls.h
-FILE 114 f:\dd\vctools\crt_bld\self_x86\crt\src\excpt.h
-FILE 120 f:\dd\public\sdk\inc\reason.h
-FILE 123 f:\dd\public\sdk\inc\kernelspecs.h
-FILE 125 f:\dd\vctools\crt_bld\self_x86\crt\src\tchar.h
-FILE 126 f:\dd\vctools\crt_bld\self_x86\crt\src\mbstring.h
-FILE 127 f:\dd\vctools\crt_bld\self_x86\crt\src\mbctype.h
-FILE 128 f:\dd\public\sdk\inc\ime_cmodes.h
-FILE 130 f:\dd\vctools\crt_bld\self_x86\crt\src\vadefs.h
-FILE 131 f:\dd\vctools\crt_bld\self_x86\crt\src\cruntime.h
-FILE 132 f:\dd\public\sdk\inc\tvout.h
-FILE 145 f:\dd\vctools\crt_bld\self_x86\crt\src\internal_securecrt.h
-FILE 152 f:\dd\vctools\crt_bld\self_x86\crt\src\internal.h
-FILE 164 f:\dd\vctools\crt_bld\self_x86\crt\src\crtdbg.h
-FILE 165 f:\dd\vctools\crt_bld\self_x86\crt\src\xtoa.c
-FILE 178 f:\dd\vctools\crt_bld\self_x86\crt\src\xtoas.c
-FILE 182 f:\dd\vctools\crt_bld\self_x86\crt\src\errno.h
-FILE 224 f:\dd\vctools\crt_bld\self_x86\crt\src\dosmap.c
-FILE 250 f:\dd\vctools\crt_bld\self_x86\crt\src\rtcsup.h
-FILE 251 f:\dd\vctools\crt_bld\self_x86\crt\src\rtcapi.h
-FILE 265 f:\dd\vctools\crt_bld\self_x86\crt\src\winheap.h
-FILE 281 f:\dd\vctools\crt_bld\self_x86\crt\src\malloc.h
-FILE 291 f:\dd\vctools\crt_bld\self_x86\crt\src\calloc_impl.c
-FILE 299 f:\dd\vctools\crt_bld\self_x86\crt\src\dbgint.h
-FILE 333 f:\dd\vctools\crt_bld\self_x86\crt\src\crtheap.c
-FILE 389 f:\dd\vctools\crt_bld\self_x86\crt\src\free.c
-FILE 453 f:\dd\vctools\crt_bld\self_x86\crt\src\heapinit.c
-FILE 498 f:\dd\vctools\crt_bld\self_x86\crt\src\rterr.h
-FILE 504 f:\dd\vctools\crt_bld\self_x86\crt\src\malloc.c
-FILE 561 f:\dd\vctools\crt_bld\self_x86\crt\src\msize.c
-FILE 618 f:\dd\vctools\crt_bld\self_x86\crt\src\realloc.c
-FILE 677 f:\dd\vctools\crt_bld\self_x86\crt\src\recalloc.c
-FILE 731 f:\dd\vctools\crt_bld\self_x86\crt\src\_newmode.c
-FILE 774 f:\dd\vctools\crt_bld\self_x86\crt\src\msdos.h
-FILE 777 f:\dd\vctools\crt_bld\self_x86\crt\src\stddef.h
-FILE 792 f:\dd\vctools\crt_bld\self_x86\crt\src\ioinit.c
-FILE 844 f:\dd\vctools\crt_bld\self_x86\crt\src\intel\loadcfg.c
-FILE 892 f:\dd\vctools\crt_bld\self_x86\crt\src\intel\secchk.c
-FILE 904 f:\dd\vctools\crt_bld\self_x86\crt\src\process.h
-FILE 943 f:\dd\vctools\crt_bld\self_x86\crt\src\a_env.c
-FILE 960 f:\dd\vctools\crt_bld\self_x86\crt\src\awint.h
-FILE 975 f:\dd\vctools\crt_bld\self_x86\crt\src\signal.h
-FILE 1011 f:\dd\vctools\crt_bld\self_x86\crt\src\abort.c
-FILE 1039 f:\dd\vctools\crt_bld\self_x86\crt\src\swprintf.inl
-FILE 1053 f:\dd\vctools\crt_bld\self_x86\crt\src\crtmbox.c
-FILE 1063 f:\dd\vctools\crt_bld\self_x86\crt\src\crtmboxw.c
-FILE 1065 f:\dd\vctools\crt_bld\self_x86\crt\src\wchar.h
-FILE 1069 f:\dd\vctools\crt_bld\self_x86\crt\src\wtime.inl
-FILE 1120 f:\dd\vctools\crt_bld\self_x86\crt\src\ctype.c
-FILE 1145 f:\dd\vctools\crt_bld\self_x86\crt\src\dbghook.c
-FILE 1181 f:\dd\vctools\crt_bld\self_x86\crt\src\errmode.c
-FILE 1244 f:\dd\vctools\crt_bld\self_x86\crt\src\getqloc.c
-FILE 1288 f:\dd\vctools\crt_bld\self_x86\crt\src\locale.h
-FILE 1301 f:\dd\vctools\crt_bld\self_x86\crt\src\glstatus.c
-FILE 1344 f:\dd\vctools\crt_bld\self_x86\crt\src\gs_cookie.c
-FILE 1392 f:\dd\vctools\crt_bld\self_x86\crt\src\gs_report.c
-FILE 1413 f:\binaries.x86ret\inc\mm3dnow.h
-FILE 1415 f:\binaries.x86ret\inc\ammintrin.h
-FILE 1424 f:\binaries.x86ret\inc\immintrin.h
-FILE 1426 f:\binaries.x86ret\inc\wmmintrin.h
-FILE 1427 f:\binaries.x86ret\inc\nmmintrin.h
-FILE 1428 f:\binaries.x86ret\inc\smmintrin.h
-FILE 1429 f:\binaries.x86ret\inc\tmmintrin.h
-FILE 1430 f:\binaries.x86ret\inc\pmmintrin.h
-FILE 1431 f:\binaries.x86ret\inc\emmintrin.h
-FILE 1432 f:\binaries.x86ret\inc\xmmintrin.h
-FILE 1433 f:\binaries.x86ret\inc\mmintrin.h
-FILE 1455 f:\dd\vctools\crt_bld\self_x86\crt\src\gs_support.c
-FILE 1467 f:\dd\vctools\crt_bld\self_x86\crt\src\intrin.h
-FILE 1468 f:\dd\vctools\crt_bld\self_x86\crt\src\setjmp.h
-FILE 1508 f:\dd\vctools\crt_bld\self_x86\crt\src\initcoll.c
-FILE 1568 f:\dd\vctools\crt_bld\self_x86\crt\src\initctyp.c
-FILE 1627 f:\dd\vctools\crt_bld\self_x86\crt\src\inithelp.c
-FILE 1685 f:\dd\vctools\crt_bld\self_x86\crt\src\initmon.c
-FILE 1737 f:\dd\vctools\crt_bld\self_x86\crt\src\nlsint.h
-FILE 1742 f:\dd\vctools\crt_bld\self_x86\crt\src\initnum.c
-FILE 1800 f:\dd\vctools\crt_bld\self_x86\crt\src\inittime.c
-FILE 1855 f:\dd\vctools\crt_bld\self_x86\crt\src\lconv.c
-FILE 1913 f:\dd\vctools\crt_bld\self_x86\crt\src\localref.c
-FILE 1962 f:\dd\vctools\crt_bld\self_x86\crt\src\sect_attribs.h
-FILE 1969 f:\dd\vctools\crt_bld\self_x86\crt\src\onexit.c
-FILE 1989 f:\dd\vctools\crt_bld\self_x86\crt\src\nlsdata1.c
-FILE 2036 f:\dd\vctools\crt_bld\self_x86\crt\src\nlsdata2.c
-FILE 2079 f:\dd\vctools\crt_bld\self_x86\crt\src\pesect.c
-FILE 2128 f:\dd\vctools\crt_bld\self_x86\crt\src\purevirt.c
-FILE 2186 f:\dd\vctools\crt_bld\self_x86\crt\src\rand_s.c
-FILE 2250 f:\dd\vctools\crt_bld\self_x86\crt\src\setlocal.c
-FILE 2311 f:\dd\vctools\crt_bld\self_x86\crt\src\winsig.c
-FILE 2314 f:\dd\vctools\crt_bld\self_x86\crt\src\float.h
-FILE 2315 f:\dd\vctools\crt_bld\self_x86\crt\src\crtwrn.h
-FILE 2369 f:\dd\vctools\crt_bld\self_x86\crt\src\winxfltr.c
-FILE 2394 f:\dd\vctools\crt_bld\self_x86\crt\src\fltintrn.h
-FILE 2419 f:\dd\vctools\crt_bld\self_x86\crt\src\cmiscdat.c
-FILE 2445 f:\dd\vctools\crt_bld\self_x86\crt\src\intel\strncmp.c
-FILE 2468 f:\dd\vctools\crt_bld\self_x86\crt\src\tcscat_s.inl
-FILE 2493 f:\dd\vctools\crt_bld\self_x86\crt\src\strcat_s.c
-FILE 2523 f:\dd\vctools\crt_bld\self_x86\crt\src\tcscpy_s.inl
-FILE 2548 f:\dd\vctools\crt_bld\self_x86\crt\src\strcpy_s.c
-FILE 2578 f:\dd\vctools\crt_bld\self_x86\crt\src\tcsncpy_s.inl
-FILE 2603 f:\dd\vctools\crt_bld\self_x86\crt\src\strncpy_s.c
-FILE 2658 f:\dd\vctools\crt_bld\self_x86\crt\src\wcscat_s.c
-FILE 2713 f:\dd\vctools\crt_bld\self_x86\crt\src\wcscpy_s.c
-FILE 2728 f:\dd\vctools\crt_bld\self_x86\crt\src\wcslen.c
-FILE 2776 f:\dd\vctools\crt_bld\self_x86\crt\src\wcsncpy_s.c
-FILE 2787 f:\dd\vctools\crt_bld\SELF_X86\crt\src\INTEL\memcpy.asm
-FILE 2788 f:\dd\vctools\crt_bld\SELF_X86\crt\src\cruntime.inc
-FILE 2789 f:\dd\vctools\crt_bld\SELF_X86\crt\src\INTEL\memset.asm
-FILE 2791 f:\dd\vctools\crt_bld\SELF_X86\crt\src\INTEL\strcmp.asm
-FILE 2793 f:\dd\vctools\crt_bld\SELF_X86\crt\src\INTEL\strcspn.asm
-FILE 2794 f:\dd\vctools\crt_bld\SELF_X86\crt\src\Intel\STRSPN.ASM
-FILE 2796 f:\dd\vctools\crt_bld\SELF_X86\crt\src\INTEL\strlen.asm
-FILE 2798 f:\dd\vctools\crt_bld\SELF_X86\crt\src\INTEL\_strnicm.asm
-FILE 2800 f:\dd\vctools\crt_bld\SELF_X86\crt\src\INTEL\strpbrk.asm
-FILE 2803 f:\dd\vctools\crt_bld\SELF_X86\crt\src\INTEL\llmul.asm
-FILE 2805 f:\dd\vctools\crt_bld\SELF_X86\crt\src\mm.inc
-FILE 2806 f:\dd\vctools\crt_bld\SELF_X86\crt\src\INTEL\ulldvrm.asm
-FILE 2820 f:\dd\vctools\crt_bld\self_x86\crt\src\handler.cpp
-FILE 2841 f:\dd\vctools\crt_bld\self_x86\crt\src\new.h
-FILE 2875 f:\dd\vctools\crt_bld\self_x86\crt\src\delete.cpp
-FILE 2931 f:\dd\vctools\crt_bld\self_x86\crt\src\_wctype.c
-FILE 2987 f:\dd\vctools\crt_bld\self_x86\crt\src\iswctype.c
-FILE 2998 f:\dd\vctools\crt_bld\self_x86\crt\src\stdio.h
-FILE 3045 f:\dd\vctools\crt_bld\self_x86\crt\src\isctype.c
-FILE 3106 f:\dd\vctools\crt_bld\self_x86\crt\src\strtol.c
-FILE 3163 f:\dd\vctools\crt_bld\self_x86\crt\src\strtoq.c
-FILE 3218 f:\dd\vctools\crt_bld\self_x86\crt\src\tolower.c
-FILE 3271 f:\dd\vctools\crt_bld\self_x86\crt\src\ismbbyte.c
-FILE 3305 f:\dd\vctools\crt_bld\self_x86\crt\src\mbdata.h
-FILE 3326 f:\dd\vctools\crt_bld\self_x86\crt\src\mbctype.c
-FILE 3386 f:\dd\vctools\crt_bld\self_x86\crt\src\a_loc.c
-FILE 3447 f:\dd\vctools\crt_bld\self_x86\crt\src\a_map.c
-FILE 3507 f:\dd\vctools\crt_bld\self_x86\crt\src\a_str.c
-FILE 3583 f:\dd\vctools\crt_bld\self_x86\crt\src\invarg.c
-FILE 3626 f:\dd\vctools\crt_bld\self_x86\crt\src\stricmp.c
-FILE 3682 f:\dd\vctools\crt_bld\self_x86\crt\src\strnicmp.c
-FILE 3774 f:\dd\vctools\crt_bld\self_x86\crt\src\tidtable.c
-FILE 3778 f:\dd\vctools\crt_bld\self_x86\crt\src\memory.h
-FILE 3838 f:\dd\vctools\crt_bld\self_x86\crt\src\stdenvp.c
-FILE 3860 f:\dd\vctools\crt_bld\self_x86\crt\src\dos.h
-FILE 3891 f:\dd\vctools\crt_bld\self_x86\crt\src\stdargv.c
-FILE 3954 f:\dd\vctools\crt_bld\self_x86\crt\src\mlock.c
-FILE 3998 f:\dd\vctools\crt_bld\self_x86\crt\src\cmsgs.h
-FILE 4012 f:\dd\vctools\crt_bld\self_x86\crt\src\crt0msg.c
-FILE 4072 f:\dd\vctools\crt_bld\self_x86\crt\src\crt0init.c
-FILE 4123 f:\dd\vctools\crt_bld\self_x86\crt\src\crt0fp.c
-FILE 4186 f:\dd\vctools\crt_bld\self_x86\crt\src\crt0dat.c
-FILE 4250 f:\dd\vctools\crt_bld\self_x86\crt\src\crt0.c
-FILE 4274 f:\dd\vctools\crt_bld\SELF_X86\crt\src\INTEL\alloca16.asm
-FILE 4276 f:\dd\vctools\crt_bld\SELF_X86\crt\src\INTEL\chkstk.asm
-FILE 4289 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\h\errno.h
-FILE 4293 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\h\internal.h
-FILE 4294 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\h\limits.h
-FILE 4295 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\h\mtdll.h
-FILE 4309 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\h\sect_attribs.h
-FILE 4315 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\tran\i386\cpu_disp.c
-FILE 4327 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\h\crtdbg.h
-FILE 4340 f:\dd\vctools\langapi\undname\undname.cxx
-FILE 4345 f:\dd\vctools\langapi\undname\undname.inl
-FILE 4347 f:\dd\vctools\langapi\undname\utf8.h
-FILE 4355 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\h\swprintf.inl
-FILE 4365 f:\dd\vctools\langapi\undname\undname.hxx
-FILE 4366 f:\dd\vctools\langapi\undname\undname.h
-FILE 4367 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\h\stdlib.h
-FILE 4368 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\h\stdio.h
-FILE 4396 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\h\eh.h
-FILE 4397 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\eh\unhandld.cpp
-FILE 4401 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\h\ehhooks.h
-FILE 4405 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\h\ehassert.h
-FILE 4427 f:\dd\vctools\langapi\include\ehdata.h
-FILE 4429 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\h\stddef.h
-FILE 4449 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\stdhpp\exception
-FILE 4472 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\h\malloc.h
-FILE 4473 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\eh\typname.cpp
-FILE 4475 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\stdhpp\cstddef
-FILE 4487 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\h\typeinfo.h
-FILE 4488 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\stdhpp\typeinfo
-FILE 4490 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\stdhpp\xstddef
-FILE 4491 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\stdhpp\yvals.h
-FILE 4492 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\stdhpp\use_ansi.h
-FILE 4493 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\h\dbgint.h
-FILE 4496 f:\dd\public\internal\vctools\include\undname.h
-FILE 4531 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\eh\typinfo.cpp
-FILE 4591 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\eh\hooks.cpp
-FILE 4643 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\rtc\initsect.cpp
-FILE 4664 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\h\rtcapi.h
-FILE 4680 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\h\rtcpriv.h
-FUNC 1000 54 0 main
-1000 6 57 1
-1006 8 58 1
-100e e 59 1
-101c 8 60 1
-1024 b 61 1
-102f f 62 1
-103e 12 64 1
-1050 4 65 1
-FUNC 1060 a 0 google_breakpad::i
-1060 3 51 1
-1063 5 52 1
-1068 2 53 1
-FUNC 1070 21 0 google_breakpad::C::C()
-1070 21 37 1
-FUNC 10a0 14 0 google_breakpad::C::~C()
-10a0 14 38 1
-FUNC 10c0 16 0 google_breakpad::C::set_member(int)
-10c0 16 40 1
-FUNC 10e0 1e 0 google_breakpad::C::f()
-10e0 1e 43 1
-FUNC 1100 10 0 google_breakpad::C::g()
-1100 10 44 1
-FUNC 1110 7 0 google_breakpad::C::h(google_breakpad::C const &)
-1110 7 45 1
-FUNC 1120 2c 0 google_breakpad::C::`scalar deleting destructor'(unsigned int)
-FUNC 114c 10 0 type_info::~type_info()
-114c 2 49 4531
-114e d 50 4531
-115b 1 51 4531
-FUNC 115c 21 0 type_info::`scalar deleting destructor'(unsigned int)
-FUNC 117d b 0 operator delete(void *)
-117d 5 20 2875
-1182 1 24 2875
-1183 5 23 2875
-FUNC 1188 29 0 fast_error_exit
-1188 5 326 4250
-118d 9 335 4250
-1196 5 337 4250
-119b 8 339 4250
-11a3 c 340 4250
-11af 2 341 4250
-FUNC 11b1 161 0 __tmainCRTStartup
-11b1 c 196 4250
-11bd a 214 4250
-11c7 b 216 4250
-11d2 49 223 4250
-121b 9 225 4250
-1224 8 226 4250
-122c 9 228 4250
-1235 8 229 4250
-123d 5 238 4250
-1242 3 246 4250
-1245 9 248 4250
-124e 8 249 4250
-1256 b 252 4250
-1261 a 255 4250
-126b 9 257 4250
-1274 8 258 4250
-127c 9 259 4250
-1285 8 260 4250
-128d 8 262 4250
-1295 4 263 4250
-1299 7 264 4250
-12a0 a 277 4250
-12aa 18 278 4250
-12c2 5 281 4250
-12c7 6 282 4250
-12cd 5 284 4250
-12d2 2 286 4250
-12d4 17 287 4250
-12eb 6 293 4250
-12f1 6 295 4250
-12f7 6 296 4250
-12fd 5 298 4250
-1302 7 300 4250
-1309 3 302 4250
-130c 6 303 4250
-FUNC 1312 a 0 mainCRTStartup
-1312 0 179 4250
-1312 5 186 4250
-1317 5 188 4250
-FUNC 131c 70 0 type_info::_Type_info_dtor(type_info *)
-131c c 62 4473
-1328 8 63 4473
-1330 4 64 4473
-1334 a 65 4473
-133e d 70 4473
-134b 4 72 4473
-134f 4 74 4473
-1353 6 79 4473
-1359 7 80 4473
-1360 9 94 4473
-1369 4 101 4473
-136d c 103 4473
-1379 6 107 4473
-137f 2 83 4473
-1381 2 72 4473
-1383 9 104 4473
-FUNC 1390 88 0 strcmp
-1390 0 65 2791
-1390 4 73 2791
-1394 4 74 2791
-1398 6 76 2791
-139e 2 77 2791
-13a0 2 81 2791
-13a2 2 83 2791
-13a4 2 84 2791
-13a6 2 85 2791
-13a8 2 86 2791
-13aa 3 87 2791
-13ad 2 88 2791
-13af 2 89 2791
-13b1 2 90 2791
-13b3 3 92 2791
-13b6 3 94 2791
-13b9 2 95 2791
-13bb 2 96 2791
-13bd 2 97 2791
-13bf 3 98 2791
-13c2 2 99 2791
-13c4 3 100 2791
-13c7 3 101 2791
-13ca 2 102 2791
-13cc 4 103 2791
-13d0 2 107 2791
-13d2 2 108 2791
-13d4 2 115 2791
-13d6 2 116 2791
-13d8 3 117 2791
-13db 1 118 2791
-13dc 6 122 2791
-13e2 2 123 2791
-13e4 2 125 2791
-13e6 3 126 2791
-13e9 2 127 2791
-13eb 2 128 2791
-13ed 3 129 2791
-13f0 2 130 2791
-13f2 2 131 2791
-13f4 6 133 2791
-13fa 2 134 2791
-13fc 3 139 2791
-13ff 3 140 2791
-1402 2 141 2791
-1404 2 142 2791
-1406 2 143 2791
-1408 2 144 2791
-140a 3 145 2791
-140d 2 146 2791
-140f 2 147 2791
-1411 2 148 2791
-1413 3 149 2791
-1416 2 150 2791
-FUNC 1418 3a 0 free
-1418 5 40 389
-141d 6 45 389
-1423 11 50 389
-1434 4 51 389
-1438 18 53 389
-1450 2 55 389
-FUNC 1452 42 0 __CxxUnhandledExceptionFilter(_EXCEPTION_POINTERS *)
-1452 5 67 4397
-1457 32 68 4397
-1489 5 69 4397
-148e 2 72 4397
-1490 4 73 4397
-FUNC 1494 e 0 __CxxSetUnhandledExceptionFilter
-1494 0 86 4397
-1494 b 89 4397
-149f 2 90 4397
-14a1 1 91 4397
-FUNC 14a2 2b 0 __crtCorExitProcess
-14a2 5 675 4186
-14a7 b 679 4186
-14b2 4 680 4186
-14b6 c 681 4186
-14c2 4 682 4186
-14c6 5 683 4186
-14cb 2 693 4186
-FUNC 14cd 18 0 __crtExitProcess
-14cd 5 698 4186
-14d2 9 699 4186
-14db a 708 4186
-FUNC 14e5 9 0 _lockexit
-14e5 0 758 4186
-14e5 8 759 4186
-14ed 1 760 4186
-FUNC 14ee 9 0 _unlockexit
-14ee 0 784 4186
-14ee 8 785 4186
-14f6 1 786 4186
-FUNC 14f7 33 0 _init_pointers
-14f7 3 809 4186
-14fa 7 810 4186
-1501 6 812 4186
-1507 6 813 4186
-150d 6 814 4186
-1513 6 815 4186
-1519 6 816 4186
-151f a 817 4186
-1529 1 818 4186
-FUNC 152a 24 0 _initterm_e
-152a 6 908 4186
-1530 b 917 4186
-153b 6 922 4186
-1541 2 923 4186
-1543 3 924 4186
-1546 6 917 4186
-154c 2 928 4186
-FUNC 154e 97 0 _cinit
-154e 5 258 4186
-1553 18 268 4186
-156b a 270 4186
-1575 5 272 4186
-157a 11 278 4186
-158b 2 279 4186
-158d 2 280 4186
-158f c 283 4186
-159b 20 288 4186
-15bb 1a 301 4186
-15d5 c 303 4186
-15e1 2 307 4186
-15e3 2 308 4186
-FUNC 15e5 140 0 doexit
-15e5 c 489 4186
-15f1 8 507 4186
-15f9 4 508 4186
-15fd f 510 4186
-160c 5 511 4186
-1611 8 514 4186
-1619 a 516 4186
-1623 13 532 4186
-1636 4 533 4186
-163a d 534 4186
-1647 3 538 4186
-164a 3 539 4186
-164d 11 547 4186
-165e 2 550 4186
-1660 4 552 4186
-1664 6 559 4186
-166a 7 562 4186
-1671 2 565 4186
-1673 a 567 4186
-167d 8 568 4186
-1685 a 570 4186
-168f 6 573 4186
-1695 8 574 4186
-169d 5 576 4186
-16a2 21 582 4186
-16c3 21 590 4186
-16e4 c 608 4186
-16f0 6 613 4186
-16f6 a 617 4186
-1700 8 619 4186
-1708 8 621 4186
-1710 6 609 4186
-1716 9 610 4186
-171f 6 622 4186
-FUNC 1725 16 0 exit
-1725 5 392 4186
-172a f 393 4186
-1739 2 394 4186
-FUNC 173b 16 0 _exit
-173b 5 400 4186
-1740 f 401 4186
-174f 2 402 4186
-FUNC 1751 f 0 _cexit
-1751 0 407 4186
-1751 e 408 4186
-175f 1 409 4186
-FUNC 1760 f 0 _c_exit
-1760 0 414 4186
-1760 e 415 4186
-176e 1 416 4186
-FUNC 176f 1e 0 _amsg_exit
-176f 5 439 4186
-1774 5 440 4186
-1779 9 441 4186
-1782 b 442 4186
-FUNC 178d 26 0 _GET_RTERRMSG
-178d 5 165 4012
-1792 2 168 4012
-1794 c 169 4012
-17a0 6 168 4012
-17a6 2 172 4012
-17a8 2 173 4012
-17aa 7 170 4012
-17b1 2 173 4012
-FUNC 17b3 1af 0 _NMSG_WRITE
-17b3 1b 196 4012
-17ce 8 197 4012
-17d6 11 199 4012
-17e7 2a 226 4012
-1811 c 263 4012
-181d 20 272 4012
-183d 21 275 4012
-185e 1f 276 4012
-187d d 279 4012
-188a d 281 4012
-1897 1d 282 4012
-18b4 18 285 4012
-18cc 14 286 4012
-18e0 15 290 4012
-18f5 a 272 4012
-18ff a 228 4012
-1909 9 229 4012
-1912 2 244 4012
-1914 a 246 4012
-191e 6 248 4012
-1924 8 244 4012
-192c 27 260 4012
-1953 f 294 4012
-FUNC 1962 39 0 _FF_MSGBANNER
-1962 0 134 4012
-1962 22 138 4012
-1984 a 140 4012
-198e c 141 4012
-199a 1 143 4012
-FUNC 199b 14a 0 _XcptFilter
-199b 6 195 2369
-19a1 7 202 2369
-19a8 8 203 2369
-19b0 2a 208 2369
-19da 4 210 2369
-19de 3 216 2369
-19e1 4 223 2369
-19e5 7 224 2369
-19ec 5 232 2369
-19f1 4 237 2369
-19f5 8 238 2369
-19fd 3 244 2369
-1a00 6 248 2369
-1a06 a 263 2369
-1a10 c 272 2369
-1a1c 3 280 2369
-1a1f 13 283 2369
-1a32 c 310 2369
-1a3e 9 312 2369
-1a47 7 314 2369
-1a4e 9 316 2369
-1a57 7 318 2369
-1a5e 9 320 2369
-1a67 7 322 2369
-1a6e 9 324 2369
-1a77 7 326 2369
-1a7e 9 328 2369
-1a87 7 330 2369
-1a8e 9 332 2369
-1a97 7 334 2369
-1a9e 9 336 2369
-1aa7 7 338 2369
-1aae 9 340 2369
-1ab7 7 342 2369
-1abe 7 344 2369
-1ac5 8 353 2369
-1acd 3 358 2369
-1ad0 2 360 2369
-1ad2 4 365 2369
-1ad6 4 366 2369
-1ada 4 372 2369
-1ade 5 374 2369
-1ae3 2 376 2369
-FUNC 1ae5 dc 0 _setenvp
-1ae5 0 77 3838
-1ae5 9 85 3838
-1aee 6 86 3838
-1af4 9 91 3838
-1afd 4 98 3838
-1b01 8 99 3838
-1b09 4 110 3838
-1b0d 1 111 3838
-1b0e b 112 3838
-1b19 6 108 3838
-1b1f 15 117 3838
-1b34 2 118 3838
-1b36 9 121 3838
-1b3f 6 123 3838
-1b45 9 125 3838
-1b4e 10 127 3838
-1b5e f 133 3838
-1b6d 3 134 3838
-1b70 7 121 3838
-1b77 b 138 3838
-1b82 7 139 3838
-1b89 3 142 3838
-1b8c a 149 3838
-1b96 2 152 3838
-1b98 2 138 3838
-1b9a 3 153 3838
-1b9d b 129 3838
-1ba8 7 130 3838
-1baf 5 131 3838
-1bb4 d 133 3838
-FUNC 1bc1 19a 0 parse_cmdline
-1bc1 6 221 3891
-1bc7 9 229 3891
-1bd0 2 232 3891
-1bd2 17 234 3891
-1be9 3 253 3891
-1bec 5 255 3891
-1bf1 5 257 3891
-1bf6 9 258 3891
-1bff 2 259 3891
-1c01 2 261 3891
-1c03 4 262 3891
-1c07 8 263 3891
-1c0f 2 265 3891
-1c11 f 267 3891
-1c20 2 268 3891
-1c22 6 269 3891
-1c28 a 270 3891
-1c32 1 271 3891
-1c33 1a 275 3891
-1c4d 4 280 3891
-1c51 4 281 3891
-1c55 4 284 3891
-1c59 9 289 3891
-1c62 a 290 3891
-1c6c 3 291 3891
-1c6f 1 278 3891
-1c70 2 279 3891
-1c72 9 294 3891
-1c7b 6 298 3891
-1c81 9 299 3891
-1c8a 2 300 3891
-1c8c 3 314 3891
-1c8f 4 318 3891
-1c93 1 321 3891
-1c94 1 322 3891
-1c95 5 319 3891
-1c9a 5 324 3891
-1c9f 5 327 3891
-1ca4 e 328 3891
-1cb2 2 329 3891
-1cb4 2 330 3891
-1cb6 d 332 3891
-1cc3 2 335 3891
-1cc5 5 339 3891
-1cca 4 340 3891
-1cce 4 341 3891
-1cd2 6 342 3891
-1cd8 3 341 3891
-1cdb 14 346 3891
-1cef 4 351 3891
-1cf3 12 353 3891
-1d05 b 354 3891
-1d10 2 355 3891
-1d12 a 357 3891
-1d1c 2 358 3891
-1d1e a 359 3891
-1d28 1 360 3891
-1d29 2 361 3891
-1d2b 5 364 3891
-1d30 1 366 3891
-1d31 5 375 3891
-1d36 4 379 3891
-1d3a 7 380 3891
-1d41 2 381 3891
-1d43 8 382 3891
-1d4b 9 385 3891
-1d54 3 386 3891
-1d57 2 387 3891
-1d59 2 388 3891
-FUNC 1d5b bb 0 _setargv
-1d5b 9 88 3891
-1d64 c 97 3891
-1d70 5 98 3891
-1d75 18 104 3891
-1d8d 19 120 3891
-1da6 11 127 3891
-1db7 15 134 3891
-1dcc a 138 3891
-1dd6 2 140 3891
-1dd8 9 142 3891
-1de1 2 143 3891
-1de3 2 144 3891
-1de5 13 151 3891
-1df8 c 156 3891
-1e04 6 160 3891
-1e0a 4 175 3891
-1e0e 6 136 3891
-1e14 2 176 3891
-FUNC 1e16 97 0 __crtGetEnvironmentStringsA
-1e16 a 40 943
-1e20 e 49 943
-1e2e 4 50 943
-1e32 5 54 943
-1e37 8 55 943
-1e3f 9 56 943
-1e48 1b 70 943
-1e63 12 74 943
-1e75 12 88 943
-1e87 9 90 943
-1e90 3 91 943
-1e93 7 94 943
-1e9a 5 95 943
-1e9f 7 76 943
-1ea6 5 77 943
-1eab 2 96 943
-FUNC 1ead 245 0 _ioinit
-1ead 9 111 792
-1eb6 a 122 792
-1ec0 13 129 792
-1ed3 8 131 792
-1edb 15 137 792
-1ef0 3 134 792
-1ef3 a 139 792
-1efd 3 141 792
-1f00 6 143 792
-1f06 4 145 792
-1f0a 3 146 792
-1f0d 1b 147 792
-1f28 15 155 792
-1f3d 2 160 792
-1f3f 6 166 792
-1f45 2 167 792
-1f47 e 173 792
-1f55 d 179 792
-1f62 f 185 792
-1f71 7 199 792
-1f78 c 201 792
-1f84 3 198 792
-1f87 4 203 792
-1f8b 4 205 792
-1f8f 4 206 792
-1f93 10 209 792
-1fa3 12 210 792
-1fb5 b 179 792
-1fc0 2 280 792
-1fc2 6 191 792
-1fc8 6 217 792
-1fce 29 230 792
-1ff7 14 232 792
-200b 7 233 792
-2012 8 234 792
-201a 17 237 792
-2031 3 239 792
-2034 c 217 792
-2040 2 249 792
-2042 b 251 792
-204d c 254 792
-2059 6 302 792
-205f 4 258 792
-2063 30 262 792
-2093 c 273 792
-209f 6 274 792
-20a5 5 275 792
-20aa 4 276 792
-20ae 13 280 792
-20c1 3 282 792
-20c4 2 284 792
-20c6 4 293 792
-20ca 6 294 792
-20d0 a 249 792
-20da c 309 792
-20e6 5 311 792
-20eb 2 312 792
-20ed 5 281 792
-FUNC 20f2 26 0 _RTC_Initialize
-FUNC 2118 26 0 _RTC_Terminate
-FUNC 213e 9 0 _encoded_null
-213e 0 79 3774
-213e 8 80 3774
-2146 1 81 3774
-FUNC 2147 9 4 __crtTlsAlloc
-2147 0 95 3774
-2147 6 96 3774
-214d 3 97 3774
-FUNC 2150 34 0 __set_flsgetvalue
-2150 3 143 3774
-2153 e 145 3774
-2161 4 146 3774
-2165 e 148 3774
-2173 d 149 3774
-2180 3 151 3774
-2183 1 155 3774
-FUNC 2184 3d 0 _mtterm
-2184 0 329 3774
-2184 a 336 3774
-218e f 337 3774
-219d 7 338 3774
-21a4 a 342 3774
-21ae 7 343 3774
-21b5 7 344 3774
-21bc 5 352 3774
-FUNC 21c1 b4 0 _initptd
-21c1 c 379 3774
-21cd b 381 3774
-21d8 a 384 3774
-21e2 4 385 3774
-21e6 6 386 3774
-21ec 3 391 3774
-21ef 7 395 3774
-21f6 7 396 3774
-21fd 7 397 3774
-2204 8 399 3774
-220c 4 400 3774
-2210 9 402 3774
-2219 c 404 3774
-2225 8 411 3774
-222d 3 412 3774
-2230 6 413 3774
-2236 4 421 3774
-223a 8 422 3774
-2242 9 423 3774
-224b c 425 3774
-2257 6 428 3774
-225d 6 404 3774
-2263 9 406 3774
-226c 9 426 3774
-FUNC 2275 79 0 _getptd_noexit
-2275 4 448 3774
-2279 6 452 3774
-227f 15 460 3774
-2294 14 472 3774
-22a8 19 475 3774
-22c1 a 481 3774
-22cb 6 483 3774
-22d1 6 484 3774
-22d7 2 486 3774
-22d9 7 492 3774
-22e0 2 493 3774
-22e2 8 498 3774
-22ea 3 500 3774
-22ed 1 501 3774
-FUNC 22ee 1a 0 _getptd
-22ee 3 522 3774
-22f1 7 523 3774
-22f8 4 524 3774
-22fc 8 525 3774
-2304 3 527 3774
-2307 1 528 3774
-FUNC 2308 12f 4 _freefls
-2308 c 556 3774
-2314 b 567 3774
-231f 7 568 3774
-2326 7 569 3774
-232d 7 571 3774
-2334 7 572 3774
-233b 7 574 3774
-2342 7 575 3774
-2349 7 577 3774
-2350 7 578 3774
-2357 7 580 3774
-235e 7 581 3774
-2365 7 583 3774
-236c 7 584 3774
-2373 7 586 3774
-237a 7 587 3774
-2381 a 589 3774
-238b 7 590 3774
-2392 8 592 3774
-239a 4 593 3774
-239e 1a 596 3774
-23b8 7 597 3774
-23bf c 599 3774
-23cb 8 603 3774
-23d3 7 605 3774
-23da 7 606 3774
-23e1 7 608 3774
-23e8 15 611 3774
-23fd 7 612 3774
-2404 c 615 3774
-2410 7 619 3774
-2417 8 622 3774
-241f 3 599 3774
-2422 9 600 3774
-242b 3 615 3774
-242e 9 616 3774
-FUNC 2437 17b 0 _mtinit
-2437 3 203 3774
-243a d 211 3774
-2447 4 212 3774
-244b 5 213 3774
-2450 3 214 3774
-2453 2 300 3774
-2455 e 218 3774
-2463 d 221 3774
-2470 d 224 3774
-247d d 227 3774
-248a 2a 228 3774
-24b4 a 231 3774
-24be 1a 235 3774
-24d8 25 244 3774
-24fd 5 249 3774
-2502 e 256 3774
-2510 d 257 3774
-251d d 258 3774
-252a 12 259 3774
-253c 7 266 3774
-2543 2 268 3774
-2545 1d 274 3774
-2562 2 276 3774
-2564 29 284 3774
-258d a 294 3774
-2597 6 296 3774
-259d 6 297 3774
-25a3 5 299 3774
-25a8 5 286 3774
-25ad 4 245 3774
-25b1 1 300 3774
-FUNC 25b2 1e 0 _heap_init
-25b2 0 40 453
-25b2 1d 44 453
-25cf 1 60 453
-FUNC 25d0 45 0 _SEH_prolog4
-FUNC 2615 14 0 _SEH_epilog4
-FUNC 2630 18f 0 _except_handler4
-FUNC 27bf 9b 0 __security_init_cookie
-27bf 8 97 1455
-27c7 21 114 1455
-27e8 7 116 1455
-27ef 3 117 1455
-27f2 a 127 1455
-27fc 6 132 1455
-2802 8 135 1455
-280a 8 136 1455
-2812 8 137 1455
-281a a 139 1455
-2824 8 144 1455
-282c 4 161 1455
-2830 7 163 1455
-2837 4 166 1455
-283b c 168 1455
-2847 6 172 1455
-284d b 173 1455
-2858 2 175 1455
-FUNC 285a f 0 _initp_misc_invarg
-285a 5 64 3583
-285f 8 65 3583
-2867 2 66 3583
-FUNC 2869 129 0 _call_reportfault
-2869 16 164 3583
-287f 9 166 3583
-2888 7 167 3583
-288f 17 170 3583
-28a6 1b 172 3583
-28c1 6 179 3583
-28c7 6 180 3583
-28cd 6 181 3583
-28d3 6 182 3583
-28d9 6 183 3583
-28df 6 184 3583
-28e5 7 185 3583
-28ec 7 186 3583
-28f3 7 187 3583
-28fa 7 188 3583
-2901 7 189 3583
-2908 7 190 3583
-290f 1 191 3583
-2910 6 192 3583
-2916 3 198 3583
-2919 19 199 3583
-2932 9 201 3583
-293b 9 240 3583
-2944 9 241 3583
-294d 6 242 3583
-2953 6 245 3583
-2959 a 248 3583
-2963 d 250 3583
-2970 d 254 3583
-297d 7 255 3583
-2984 e 257 3583
-FUNC 2992 25 0 _invoke_watson
-2992 3 146 3583
-2995 12 155 3583
-29a7 f 156 3583
-29b6 1 157 3583
-FUNC 29b7 2d 0 _invalid_parameter
-29b7 5 96 3583
-29bc c 103 3583
-29c8 4 104 3583
-29cc 1 111 3583
-29cd 2 106 3583
-29cf 15 110 3583
-FUNC 29e4 10 0 _invalid_parameter_noinfo
-29e4 0 120 3583
-29e4 f 121 3583
-29f3 1 122 3583
-FUNC 29f4 4a 0 _mtinitlocks
-29f4 4 136 3954
-29f8 7 143 3954
-29ff a 144 3954
-2a09 9 145 3954
-2a12 14 147 3954
-2a26 6 143 3954
-2a2c 3 156 3954
-2a2f 3 157 3954
-2a32 c 150 3954
-FUNC 2a3e 57 0 _mtdeletelocks
-2a3e 3 187 3954
-2a41 d 193 3954
-2a4e c 195 3954
-2a5a 3 199 3954
-2a5d 6 205 3954
-2a63 4 206 3954
-2a67 b 193 3954
-2a72 6 214 3954
-2a78 c 216 3954
-2a84 3 220 3954
-2a87 b 214 3954
-2a92 3 223 3954
-FUNC 2a95 17 0 _unlock
-2a95 5 370 3954
-2a9a 10 374 3954
-2aaa 2 375 3954
-FUNC 2aac c2 0 _mtinitlocknum
-2aac c 258 3954
-2ab8 6 260 3954
-2abe a 268 3954
-2ac8 5 269 3954
-2acd 7 270 3954
-2ad4 c 271 3954
-2ae0 e 275 3954
-2aee 4 276 3954
-2af2 e 278 3954
-2b00 b 279 3954
-2b0b 4 280 3954
-2b0f 8 283 3954
-2b17 3 284 3954
-2b1a 4 286 3954
-2b1e 10 287 3954
-2b2e 7 288 3954
-2b35 b 289 3954
-2b40 3 290 3954
-2b43 2 291 3954
-2b45 2 292 3954
-2b47 2 295 3954
-2b49 7 296 3954
-2b50 c 299 3954
-2b5c 3 303 3954
-2b5f 6 304 3954
-2b65 9 300 3954
-FUNC 2b6e 33 0 _lock
-2b6e 5 332 3954
-2b73 10 337 3954
-2b83 b 339 3954
-2b8e 8 340 3954
-2b96 9 347 3954
-2b9f 2 348 3954
-FUNC 2ba1 5f 0 strcpy_s
-2ba1 5 13 2523
-2ba6 23 18 2523
-2bc9 b 19 2523
-2bd4 11 23 2523
-2be5 4 27 2523
-2be9 3 29 2523
-2bec e 30 2523
-2bfa 4 33 2523
-2bfe 2 34 2523
-FUNC 2c00 8b 0 strlen
-2c00 0 54 2796
-2c00 4 63 2796
-2c04 6 64 2796
-2c0a 2 65 2796
-2c0c 2 69 2796
-2c0e 3 70 2796
-2c11 2 71 2796
-2c13 2 72 2796
-2c15 6 73 2796
-2c1b 2 74 2796
-2c1d 13 76 2796
-2c30 2 81 2796
-2c32 5 82 2796
-2c37 2 83 2796
-2c39 3 84 2796
-2c3c 2 85 2796
-2c3e 3 86 2796
-2c41 5 87 2796
-2c46 2 88 2796
-2c48 3 90 2796
-2c4b 2 91 2796
-2c4d 2 92 2796
-2c4f 2 93 2796
-2c51 2 94 2796
-2c53 5 95 2796
-2c58 2 96 2796
-2c5a 5 97 2796
-2c5f 2 98 2796
-2c61 2 99 2796
-2c63 3 103 2796
-2c66 4 104 2796
-2c6a 2 105 2796
-2c6c 1 106 2796
-2c6d 3 108 2796
-2c70 4 109 2796
-2c74 2 110 2796
-2c76 1 111 2796
-2c77 3 113 2796
-2c7a 4 114 2796
-2c7e 2 115 2796
-2c80 1 116 2796
-2c81 3 118 2796
-2c84 4 119 2796
-2c88 2 120 2796
-2c8a 1 121 2796
-FUNC 2c8b 94 0 malloc
-2c8b 6 81 504
-2c91 a 85 504
-2c9b 3d 89 504
-2cd8 4 94 504
-2cdc b 98 504
-2ce7 b 105 504
-2cf2 2 109 504
-2cf4 7 100 504
-2cfb 7 119 504
-2d02 6 121 504
-2d08 7 111 504
-2d0f b 112 504
-2d1a 3 113 504
-2d1d 2 122 504
-FUNC 2d20 90 0 _local_unwind4
-FUNC 2db0 46 0 _unwind_handler4
-FUNC 2df6 1c 4 _seh_longjmp_unwind4
-FUNC 2e12 17 0 _EH4_CallFilterFunc
-FUNC 2e29 19 0 _EH4_TransferToHandler
-FUNC 2e42 19 0 _EH4_GlobalUnwind2
-FUNC 2e5b 17 8 _EH4_LocalUnwind
-FUNC 2e72 42 0 _get_errno_from_oserr
-2e72 5 119 224
-2e77 5 123 224
-2e7c 9 124 224
-2e85 6 123 224
-2e8b 8 133 224
-2e93 3 134 224
-2e96 2 139 224
-2e98 7 125 224
-2e9f 2 139 224
-2ea1 11 135 224
-2eb2 2 139 224
-FUNC 2eb4 13 0 _errno
-2eb4 0 279 224
-2eb4 5 280 224
-2eb9 4 281 224
-2ebd 5 282 224
-2ec2 1 287 224
-2ec3 3 284 224
-2ec6 1 287 224
-FUNC 2ec7 39 0 terminate()
-2ec7 c 84 4591
-2ed3 8 89 4591
-2edb 4 90 4591
-2edf 4 95 4591
-2ee3 2 99 4591
-2ee5 2 100 4591
-2ee7 7 101 4591
-2eee 7 106 4591
-2ef5 5 114 4591
-2efa 6 115 4591
-FUNC 2f00 11 0 _initp_eh_hooks
-2f00 0 69 4591
-2f00 10 70 4591
-2f10 1 71 4591
-FUNC 2f11 1e 0 _initp_misc_winsig
-2f11 5 57 2311
-2f16 8 58 2311
-2f1e 5 59 2311
-2f23 5 60 2311
-2f28 5 61 2311
-2f2d 2 62 2311
-FUNC 2f2f 37 0 siglookup
-2f2f 5 629 2311
-2f34 a 630 2311
-2f3e 14 639 2311
-2f52 e 642 2311
-2f60 2 646 2311
-2f62 2 651 2311
-2f64 2 652 2311
-FUNC 2f66 d 0 __get_sigabrt
-2f66 0 669 2311
-2f66 c 670 2311
-2f72 1 671 2311
-FUNC 2f73 1a3 0 raise
-2f73 c 450 2311
-2f7f 5 457 2311
-2f84 3 458 2311
-2f87 1f 460 2311
-2fa6 a 486 2311
-2fb0 4 487 2311
-2fb4 8 488 2311
-2fbc a 463 2311
-2fc6 2 465 2311
-2fc8 10 490 2311
-2fd8 2 491 2311
-2fda f 460 2311
-2fe9 12 498 2311
-2ffb a 474 2311
-3005 2 476 2311
-3007 a 468 2311
-3011 2 470 2311
-3013 a 479 2311
-301d 7 480 2311
-3024 a 500 2311
-302e 2 508 2311
-3030 4 507 2311
-3034 6 508 2311
-303a 5 513 2311
-303f 7 518 2311
-3046 5 525 2311
-304b 7 526 2311
-3052 5 528 2311
-3057 f 539 2311
-3066 6 540 2311
-306c 3 541 2311
-306f 5 547 2311
-3074 6 548 2311
-307a 7 549 2311
-3081 5 557 2311
-3086 1a 564 2311
-30a0 d 567 2311
-30ad 5 564 2311
-30b2 7 570 2311
-30b9 c 573 2311
-30c5 5 578 2311
-30ca 8 584 2311
-30d2 2 585 2311
-30d4 6 573 2311
-30da 6 574 2311
-30e0 9 575 2311
-30e9 5 586 2311
-30ee f 593 2311
-30fd 6 594 2311
-3103 5 599 2311
-3108 6 600 2311
-310e 2 603 2311
-3110 6 604 2311
-FUNC 3116 f 0 _initp_misc_rand_s
-3116 5 58 2186
-311b 8 59 2186
-3123 2 60 2186
-FUNC 3125 f 0 _initp_misc_purevirt
-3125 5 179 1627
-312a 8 180 1627
-3132 2 181 1627
-FUNC 3134 f 0 _initp_heap_handler
-3134 5 31 2820
-3139 8 32 2820
-3141 2 33 2820
-FUNC 3143 28 0 _callnewh
-3143 5 131 2820
-3148 c 133 2820
-3154 e 135 2820
-3162 3 138 2820
-3165 2 139 2820
-3167 2 136 2820
-3169 2 139 2820
-FUNC 316b b6 0 _onexit_nolock
-316b 8 100 1969
-3173 f 103 1969
-3182 f 104 1969
-3191 14 108 1969
-31a5 10 118 1969
-31b5 d 123 1969
-31c2 13 125 1969
-31d5 3 130 1969
-31d8 13 132 1969
-31eb 3 143 1969
-31ee f 145 1969
-31fd 10 152 1969
-320d 8 153 1969
-3215 5 155 1969
-321a 5 110 1969
-321f 2 156 1969
-FUNC 3221 31 0 __onexitinit
-3221 3 201 1969
-3224 d 204 1969
-3231 11 205 1969
-3242 4 207 1969
-3246 4 212 1969
-324a 1 217 1969
-324b 3 214 1969
-324e 3 216 1969
-3251 1 217 1969
-FUNC 3252 3c 0 _onexit
-3252 c 81 1969
-325e 5 84 1969
-3263 4 86 1969
-3267 c 87 1969
-3273 c 89 1969
-327f 3 93 1969
-3282 6 94 1969
-3288 6 90 1969
-FUNC 328e 17 0 atexit
-328e 5 161 1969
-3293 10 162 1969
-32a3 2 163 1969
-FUNC 32a5 23 0 _initp_misc_cfltcvt_tab
-32a5 4 54 2419
-32a9 2 56 2419
-32ab 1a 58 2419
-32c5 3 60 2419
-FUNC 32d0 35 0 _ValidateImageBase
-32d0 5 44 2079
-32d5 d 50 2079
-32e2 2 52 2079
-32e4 2 68 2079
-32e6 5 55 2079
-32eb 6 56 2079
-32f1 2 58 2079
-32f3 10 62 2079
-3303 2 68 2079
-FUNC 3310 44 0 _FindPESection
-3310 5 92 2079
-3315 8 99 2079
-331d 18 108 2079
-3335 10 111 2079
-3345 8 108 2079
-334d 5 123 2079
-3352 2 124 2079
-FUNC 3360 bc 0 _IsNonwritableInCurrentImage
-3360 35 149 2079
-3395 7 156 2079
-339c f 164 2079
-33ab 2 166 2079
-33ad 8 174 2079
-33b5 e 175 2079
-33c3 2 176 2079
-33c5 2 178 2079
-33c7 12 185 2079
-33d9 12 195 2079
-33eb 16 187 2079
-3401 9 193 2079
-340a 12 195 2079
-FUNC 341c 16c 0 __crtMessageBoxW
-341c 12 41 1053
-342e 14 49 1053
-3442 4 56 1053
-3446 c 62 1053
-3452 d 64 1053
-345f 2 65 1053
-3461 6 67 1053
-3467 10 72 1053
-3477 6 76 1053
-347d 9 78 1053
-3486 10 81 1053
-3496 10 84 1053
-34a6 d 88 1053
-34b3 8 93 1053
-34bb 4 95 1053
-34bf 10 97 1053
-34cf 1a 110 1053
-34e9 3 113 1053
-34ec c 114 1053
-34f8 8 116 1053
-3500 1f 121 1053
-351f 7 130 1053
-3526 2 132 1053
-3528 a 134 1053
-3532 3 136 1053
-3535 4 137 1053
-3539 5 139 1053
-353e e 143 1053
-354c 3 145 1053
-354f 4 146 1053
-3553 8 148 1053
-355b 8 155 1053
-3563 4 156 1053
-3567 10 158 1053
-3577 2 163 1053
-3579 f 166 1053
-FUNC 3588 75 0 wcscat_s
-3588 6 13 2468
-358e 22 18 2468
-35b0 2 46 2468
-35b2 e 19 2468
-35c0 2 21 2468
-35c2 6 23 2468
-35c8 3 25 2468
-35cb 3 26 2468
-35ce 2 29 2468
-35d0 2 32 2468
-35d2 14 35 2468
-35e6 9 41 2468
-35ef e 42 2468
-FUNC 35fd cd 0 wcsncpy_s
-35fd 5 13 2578
-3602 16 17 2578
-3618 5 65 2578
-361d 2 66 2578
-361f 1e 24 2578
-363d 4 25 2578
-3641 5 28 2578
-3646 2 29 2578
-3648 e 31 2578
-3656 2 33 2578
-3658 5 35 2578
-365d 16 37 2578
-3673 2 41 2578
-3675 19 45 2578
-368e 4 48 2578
-3692 5 50 2578
-3697 8 54 2578
-369f a 58 2578
-36a9 d 59 2578
-36b6 3 61 2578
-36b9 11 62 2578
-FUNC 36ca 1b 0 wcslen
-36ca 5 41 2728
-36cf 3 42 2728
-36d2 b 44 2728
-36dd 6 46 2728
-36e3 2 47 2728
-FUNC 36e5 63 0 wcscpy_s
-36e5 6 13 2523
-36eb 22 18 2523
-370d 2 34 2523
-370f c 19 2523
-371b 16 23 2523
-3731 9 29 2523
-373a e 30 2523
-FUNC 3748 3f 0 _set_error_mode
-3748 5 43 1181
-374d 11 46 1181
-375e 5 54 1181
-3763 2 61 1181
-3765 5 50 1181
-376a 6 51 1181
-3770 2 61 1181
-3772 13 57 1181
-3785 2 61 1181
-FUNC 3787 f 0 __security_check_cookie
-3787 0 52 892
-3787 6 55 892
-378d 2 56 892
-378f 2 57 892
-3791 5 59 892
-FUNC 3796 45 0 _malloc_crt
-3796 7 39 333
-379d 2 40 333
-379f b 44 333
-37aa c 45 333
-37b6 1a 46 333
-37d0 5 47 333
-37d5 4 50 333
-37d9 2 51 333
-FUNC 37db 4c 0 _calloc_crt
-37db 7 54 333
-37e2 2 55 333
-37e4 12 61 333
-37f6 c 62 333
-3802 1a 63 333
-381c 5 64 333
-3821 4 67 333
-3825 2 68 333
-FUNC 3827 4e 0 _realloc_crt
-3827 7 71 333
-382e 2 72 333
-3830 f 76 333
-383f 11 77 333
-3850 1a 78 333
-386a 5 79 333
-386f 4 82 333
-3873 2 83 333
-FUNC 3875 2f 0 CPtoLCID
-3875 0 329 3326
-3875 14 330 3326
-3889 2 345 3326
-388b 1 346 3326
-388c 5 342 3326
-3891 1 346 3326
-3892 5 339 3326
-3897 1 346 3326
-3898 5 336 3326
-389d 1 346 3326
-389e 5 333 3326
-38a3 1 346 3326
-FUNC 38a4 64 0 setSBCS
-38a4 6 363 3326
-38aa 11 368 3326
-38bb 1b 379 3326
-38d6 12 381 3326
-38e8 9 382 3326
-38f1 b 384 3326
-38fc 9 385 3326
-3905 3 386 3326
-FUNC 3908 190 0 setSBUpLow
-3908 17 402 3326
-391f 10 412 3326
-392f f 415 3326
-393e c 416 3326
-394a 11 420 3326
-395b 6 419 3326
-3961 20 421 3326
-3981 a 420 3326
-398b 20 427 3326
-39ab 23 432 3326
-39ce 25 437 3326
-39f3 2 442 3326
-39f5 d 443 3326
-3a02 5 445 3326
-3a07 9 446 3326
-3a10 5 448 3326
-3a15 5 450 3326
-3a1a e 451 3326
-3a28 2 453 3326
-3a2a 7 454 3326
-3a31 5 442 3326
-3a36 8 456 3326
-3a3e 12 472 3326
-3a50 17 461 3326
-3a67 5 463 3326
-3a6c 5 464 3326
-3a71 5 466 3326
-3a76 5 468 3326
-3a7b 5 469 3326
-3a80 2 471 3326
-3a82 3 472 3326
-3a85 5 460 3326
-3a8a e 474 3326
-FUNC 3a98 a4 0 __updatetmbcinfo
-3a98 c 495 3326
-3aa4 7 498 3326
-3aab 10 499 3326
-3abb 3 532 3326
-3abe 4 535 3326
-3ac2 8 537 3326
-3aca 2 540 3326
-3acc 6 541 3326
-3ad2 8 500 3326
-3ada 4 502 3326
-3ade e 505 3326
-3aec 17 511 3326
-3b03 7 516 3326
-3b0a 11 523 3326
-3b1b 7 524 3326
-3b22 11 527 3326
-3b33 9 529 3326
-FUNC 3b3c 87 0 _LocaleUpdate::_LocaleUpdate(localeinfo_struct *)
-3b3c 5 240 111
-3b41 e 241 111
-3b4f 8 243 111
-3b57 5 244 111
-3b5c 6 245 111
-3b62 1c 247 111
-3b7e 21 248 111
-3b9f 9 249 111
-3ba8 4 251 111
-3bac 4 252 111
-3bb0 2 255 111
-3bb2 a 257 111
-3bbc 7 259 111
-FUNC 3bc3 7c 0 getSystemCP
-3bc3 9 282 3326
-3bcc b 284 3326
-3bd7 6 285 3326
-3bdd 5 289 3326
-3be2 a 291 3326
-3bec 14 292 3326
-3c00 5 295 3326
-3c05 a 297 3326
-3c0f 8 298 3326
-3c17 5 302 3326
-3c1c 12 305 3326
-3c2e f 308 3326
-3c3d 2 309 3326
-FUNC 3c3f 1e9 0 _setmbcp_nolock
-3c3f 17 684 3326
-3c56 b 691 3326
-3c61 9 694 3326
-3c6a 7 696 3326
-3c71 7 697 3326
-3c78 3 701 3326
-3c7b 2 703 3326
-3c7d c 706 3326
-3c89 d 703 3326
-3c96 2a 741 3326
-3cc0 13 749 3326
-3cd3 f 754 3326
-3ce2 15 759 3326
-3cf7 17 762 3326
-3d0e c 764 3326
-3d1a f 710 3326
-3d29 15 713 3326
-3d3e 9 718 3326
-3d47 8 721 3326
-3d4f 12 722 3326
-3d61 4 721 3326
-3d65 b 718 3326
-3d70 12 713 3326
-3d82 20 729 3326
-3da2 f 731 3326
-3db1 7 734 3326
-3db8 5 735 3326
-3dbd 6 765 3326
-3dc3 4 764 3326
-3dc7 d 762 3326
-3dd4 8 769 3326
-3ddc 7 770 3326
-3de3 b 773 3326
-3dee 3 776 3326
-3df1 2 778 3326
-3df3 3 780 3326
-3df6 12 783 3326
-3e08 2 787 3326
-3e0a 6 792 3326
-3e10 6 795 3326
-3e16 3 744 3326
-3e19 f 800 3326
-FUNC 3e28 19a 0 _setmbcp
-3e28 c 572 3326
-3e34 4 573 3326
-3e38 a 577 3326
-3e42 5 579 3326
-3e47 3 580 3326
-3e4a b 582 3326
-3e55 9 584 3326
-3e5e d 590 3326
-3e6b 8 592 3326
-3e73 c 594 3326
-3e7f 3 605 3326
-3e82 16 610 3326
-3e98 1a 612 3326
-3eb2 7 613 3326
-3eb9 3 617 3326
-3ebc 9 618 3326
-3ec5 17 620 3326
-3edc 8 622 3326
-3ee4 4 623 3326
-3ee8 8 628 3326
-3ef0 8 629 3326
-3ef8 8 630 3326
-3f00 a 631 3326
-3f0a d 632 3326
-3f17 3 631 3326
-3f1a c 633 3326
-3f26 a 634 3326
-3f30 3 633 3326
-3f33 c 635 3326
-3f3f d 636 3326
-3f4c 3 635 3326
-3f4f 1c 638 3326
-3f6b 7 639 3326
-3f72 6 643 3326
-3f78 3 644 3326
-3f7b e 646 3326
-3f89 9 648 3326
-3f92 2 651 3326
-3f94 5 652 3326
-3f99 8 658 3326
-3fa1 7 659 3326
-3fa8 b 660 3326
-3fb3 2 666 3326
-3fb5 4 671 3326
-3fb9 3 680 3326
-3fbc 6 681 3326
-FUNC 3fc2 1e 0 __initmbctable
-3fc2 0 841 3326
-3fc2 9 851 3326
-3fcb 8 852 3326
-3fd3 a 853 3326
-3fdd 2 858 3326
-3fdf 1 859 3326
-FUNC 3fe0 53 0 x_ismbbtype_l
-3fe0 8 213 3271
-3fe8 b 214 3271
-3ff3 4 219 3271
-3ff7 3a 222 3271
-4031 2 223 3271
-FUNC 4033 18 0 _ismbblead
-4033 5 171 3271
-4038 11 172 3271
-4049 2 173 3271
-FUNC 404b 8f 0 __addlocaleref
-404b 7 36 1913
-4052 d 39 1913
-405f a 41 1913
-4069 3 42 1913
-406c a 44 1913
-4076 3 45 1913
-4079 a 47 1913
-4083 3 48 1913
-4086 a 50 1913
-4090 3 51 1913
-4093 a 53 1913
-409d f 55 1913
-40ac 3 56 1913
-40af d 59 1913
-40bc 3 60 1913
-40bf 8 53 1913
-40c7 11 63 1913
-40d8 2 64 1913
-FUNC 40da 99 0 __removelocaleref
-40da 6 74 1913
-40e0 b 77 1913
-40eb b 79 1913
-40f6 a 81 1913
-4100 3 82 1913
-4103 a 84 1913
-410d 3 85 1913
-4110 a 87 1913
-411a 3 88 1913
-411d a 90 1913
-4127 3 91 1913
-412a a 93 1913
-4134 f 95 1913
-4143 3 96 1913
-4146 d 99 1913
-4153 3 100 1913
-4156 8 93 1913
-415e 10 103 1913
-416e 3 106 1913
-4171 2 107 1913
-FUNC 4173 14b 0 __freetlocinfo
-4173 7 129 1913
-417a 25 137 1913
-419f e 140 1913
-41ad 6 142 1913
-41b3 d 143 1913
-41c0 e 147 1913
-41ce 6 149 1913
-41d4 d 150 1913
-41e1 b 153 1913
-41ec d 154 1913
-41f9 e 161 1913
-4207 11 163 1913
-4218 13 164 1913
-422b e 165 1913
-4239 e 166 1913
-4247 15 173 1913
-425c 6 175 1913
-4262 d 176 1913
-426f a 179 1913
-4279 13 182 1913
-428c 7 184 1913
-4293 10 192 1913
-42a3 7 194 1913
-42aa 8 179 1913
-42b2 a 201 1913
-42bc 2 202 1913
-FUNC 42be 4d 0 _updatetlocinfoEx_nolock
-42be 6 216 1913
-42c4 e 219 1913
-42d2 3 222 1913
-42d5 4 223 1913
-42d9 9 230 1913
-42e2 4 236 1913
-42e6 6 238 1913
-42ec e 248 1913
-42fa 7 249 1913
-4301 5 253 1913
-4306 3 220 1913
-4309 2 254 1913
-FUNC 430b 79 0 __updatetlocinfo
-430b c 281 1913
-4317 7 283 1913
-431e 10 285 1913
-432e 8 297 1913
-4336 4 300 1913
-433a 8 302 1913
-4342 2 305 1913
-4344 6 306 1913
-434a 8 286 1913
-4352 4 288 1913
-4356 14 290 1913
-436a e 292 1913
-4378 8 294 1913
-4380 4 295 1913
-FUNC 4384 8 0 _crt_debugger_hook
-4384 0 62 1145
-4384 7 65 1145
-438b 1 66 1145
-FUNC 4390 7a 0 memset
-4390 0 59 2789
-4390 4 68 2789
-4394 4 69 2789
-4398 2 71 2789
-439a 2 72 2789
-439c 2 74 2789
-439e 4 75 2789
-43a2 2 78 2789
-43a4 2 79 2789
-43a6 6 80 2789
-43ac 2 81 2789
-43ae 7 82 2789
-43b5 2 83 2789
-43b7 5 85 2789
-43bc 1 91 2789
-43bd 2 92 2789
-43bf 3 94 2789
-43c2 2 95 2789
-43c4 2 97 2789
-43c6 3 98 2789
-43c9 2 99 2789
-43cb 2 101 2789
-43cd 2 103 2789
-43cf 3 104 2789
-43d2 3 105 2789
-43d5 2 106 2789
-43d7 2 110 2789
-43d9 3 111 2789
-43dc 2 113 2789
-43de 2 115 2789
-43e0 3 117 2789
-43e3 2 119 2789
-43e5 2 122 2789
-43e7 3 123 2789
-43ea 3 124 2789
-43ed 2 125 2789
-43ef 2 127 2789
-43f1 2 129 2789
-43f3 2 130 2789
-43f5 2 134 2789
-43f7 3 135 2789
-43fa 3 137 2789
-43fd 2 138 2789
-43ff 4 142 2789
-4403 1 143 2789
-4404 1 145 2789
-4405 4 148 2789
-4409 1 150 2789
-FUNC 4410 95 0 _aulldvrm
-4410 0 45 2806
-4410 1 48 2806
-4411 4 80 2806
-4415 2 81 2806
-4417 2 82 2806
-4419 4 83 2806
-441d 4 84 2806
-4421 2 85 2806
-4423 2 86 2806
-4425 2 87 2806
-4427 4 88 2806
-442b 2 89 2806
-442d 2 90 2806
-442f 2 95 2806
-4431 4 96 2806
-4435 2 97 2806
-4437 2 98 2806
-4439 4 99 2806
-443d 2 100 2806
-443f 2 101 2806
-4441 2 108 2806
-4443 4 109 2806
-4447 4 110 2806
-444b 4 111 2806
-444f 2 113 2806
-4451 2 114 2806
-4453 2 115 2806
-4455 2 116 2806
-4457 2 117 2806
-4459 2 118 2806
-445b 2 119 2806
-445d 2 120 2806
-445f 4 129 2806
-4463 2 130 2806
-4465 4 131 2806
-4469 2 132 2806
-446b 2 133 2806
-446d 2 134 2806
-446f 4 142 2806
-4473 2 143 2806
-4475 2 144 2806
-4477 4 145 2806
-447b 2 146 2806
-447d 1 148 2806
-447e 4 149 2806
-4482 4 150 2806
-4486 2 152 2806
-4488 4 161 2806
-448c 4 162 2806
-4490 2 163 2806
-4492 2 164 2806
-4494 3 165 2806
-4497 2 170 2806
-4499 2 171 2806
-449b 2 172 2806
-449d 2 173 2806
-449f 2 174 2806
-44a1 1 180 2806
-44a2 3 182 2806
-FUNC 44b0 20 0 _global_unwind2
-FUNC 44d0 45 0 __unwind_handler
-FUNC 4515 84 0 _local_unwind2
-FUNC 4599 23 0 _abnormal_termination
-FUNC 45bc 9 0 _NLG_Notify1
-FUNC 45c5 1f 0 _NLG_Notify
-PUBLIC 45dc 0 _NLG_Dispatch2
-FUNC 45e4 3 0 _NLG_Call
-PUBLIC 45e6 0 _NLG_Return2
-FUNC 45e7 33 0 abort
-45e7 0 54 1011
-45e7 5 71 1011
-45ec 4 72 1011
-45f0 8 74 1011
-45f8 9 81 1011
-4601 11 83 1011
-4612 8 92 1011
-FUNC 4620 361 0 memcpy
-4620 3 101 2787
-4623 1 113 2787
-4624 1 114 2787
-4625 3 116 2787
-4628 3 117 2787
-462b 3 119 2787
-462e 2 129 2787
-4630 2 131 2787
-4632 2 132 2787
-4634 2 134 2787
-4636 2 135 2787
-4638 2 137 2787
-463a 6 138 2787
-4640 6 147 2787
-4646 2 148 2787
-4648 7 150 2787
-464f 2 151 2787
-4651 1 153 2787
-4652 1 154 2787
-4653 3 155 2787
-4656 3 156 2787
-4659 2 157 2787
-465b 1 158 2787
-465c 1 159 2787
-465d 2 160 2787
-465f 5 163 2787
-4664 6 176 2787
-466a 2 177 2787
-466c 3 179 2787
-466f 3 180 2787
-4672 3 182 2787
-4675 2 183 2787
-4677 2 185 2787
-4679 7 187 2787
-4680 2 205 2787
-4682 5 206 2787
-4687 3 208 2787
-468a 2 209 2787
-468c 3 211 2787
-468f 2 212 2787
-4691 7 214 2787
-4698 8 218 2787
-46a0 14 222 2787
-46b4 2 229 2787
-46b6 2 230 2787
-46b8 2 232 2787
-46ba 3 233 2787
-46bd 3 235 2787
-46c0 3 236 2787
-46c3 3 238 2787
-46c6 3 239 2787
-46c9 3 241 2787
-46cc 3 242 2787
-46cf 3 244 2787
-46d2 2 245 2787
-46d4 2 247 2787
-46d6 a 249 2787
-46e0 2 253 2787
-46e2 2 254 2787
-46e4 2 256 2787
-46e6 3 257 2787
-46e9 3 259 2787
-46ec 3 260 2787
-46ef 3 262 2787
-46f2 3 263 2787
-46f5 3 265 2787
-46f8 2 266 2787
-46fa 2 268 2787
-46fc 8 270 2787
-4704 2 274 2787
-4706 2 275 2787
-4708 2 277 2787
-470a 3 278 2787
-470d 3 280 2787
-4710 3 281 2787
-4713 3 283 2787
-4716 2 284 2787
-4718 2 286 2787
-471a 2a 288 2787
-4744 4 295 2787
-4748 4 297 2787
-474c 4 299 2787
-4750 4 301 2787
-4754 4 303 2787
-4758 4 305 2787
-475c 4 307 2787
-4760 4 309 2787
-4764 4 311 2787
-4768 4 313 2787
-476c 4 315 2787
-4770 4 317 2787
-4774 4 319 2787
-4778 4 321 2787
-477c 7 323 2787
-4783 2 325 2787
-4785 2 326 2787
-4787 19 328 2787
-47a0 3 337 2787
-47a3 1 338 2787
-47a4 1 339 2787
-47a5 3 341 2787
-47a8 2 345 2787
-47aa 2 347 2787
-47ac 3 348 2787
-47af 1 349 2787
-47b0 1 350 2787
-47b1 3 351 2787
-47b4 2 355 2787
-47b6 2 357 2787
-47b8 3 358 2787
-47bb 3 359 2787
-47be 3 360 2787
-47c1 1 361 2787
-47c2 1 362 2787
-47c3 5 363 2787
-47c8 2 367 2787
-47ca 2 369 2787
-47cc 3 370 2787
-47cf 3 371 2787
-47d2 3 372 2787
-47d5 3 373 2787
-47d8 3 374 2787
-47db 1 375 2787
-47dc 1 376 2787
-47dd 3 377 2787
-47e0 4 388 2787
-47e4 4 389 2787
-47e8 6 394 2787
-47ee 2 395 2787
-47f0 3 397 2787
-47f3 3 398 2787
-47f6 3 400 2787
-47f9 2 401 2787
-47fb 1 403 2787
-47fc 2 404 2787
-47fe 1 405 2787
-47ff 9 407 2787
-4808 2 411 2787
-480a a 414 2787
-4814 2 419 2787
-4816 5 420 2787
-481b 3 422 2787
-481e 2 423 2787
-4820 3 425 2787
-4823 2 426 2787
-4825 7 428 2787
-482c 14 432 2787
-4840 3 439 2787
-4843 2 440 2787
-4845 3 442 2787
-4848 3 443 2787
-484b 3 445 2787
-484e 3 446 2787
-4851 3 448 2787
-4854 2 449 2787
-4856 1 451 2787
-4857 2 452 2787
-4859 1 453 2787
-485a a 455 2787
-4864 3 459 2787
-4867 2 460 2787
-4869 3 462 2787
-486c 3 463 2787
-486f 3 465 2787
-4872 3 466 2787
-4875 3 468 2787
-4878 3 469 2787
-487b 3 471 2787
-487e 2 472 2787
-4880 1 474 2787
-4881 2 475 2787
-4883 1 476 2787
-4884 8 478 2787
-488c 3 482 2787
-488f 2 483 2787
-4891 3 485 2787
-4894 3 486 2787
-4897 3 488 2787
-489a 3 489 2787
-489d 3 491 2787
-48a0 3 492 2787
-48a3 3 494 2787
-48a6 3 495 2787
-48a9 3 497 2787
-48ac 6 498 2787
-48b2 1 500 2787
-48b3 2 501 2787
-48b5 1 502 2787
-48b6 2a 504 2787
-48e0 4 513 2787
-48e4 4 515 2787
-48e8 4 517 2787
-48ec 4 519 2787
-48f0 4 521 2787
-48f4 4 523 2787
-48f8 4 525 2787
-48fc 4 527 2787
-4900 4 529 2787
-4904 4 531 2787
-4908 4 533 2787
-490c 4 535 2787
-4910 4 537 2787
-4914 4 539 2787
-4918 7 541 2787
-491f 2 543 2787
-4921 2 544 2787
-4923 19 546 2787
-493c 3 555 2787
-493f 1 557 2787
-4940 1 558 2787
-4941 3 559 2787
-4944 3 563 2787
-4947 3 565 2787
-494a 3 566 2787
-494d 1 567 2787
-494e 1 568 2787
-494f 5 569 2787
-4954 3 573 2787
-4957 3 575 2787
-495a 3 576 2787
-495d 3 577 2787
-4960 3 578 2787
-4963 1 579 2787
-4964 1 580 2787
-4965 3 581 2787
-4968 3 585 2787
-496b 3 587 2787
-496e 3 588 2787
-4971 3 589 2787
-4974 3 590 2787
-4977 3 591 2787
-497a 3 592 2787
-497d 1 593 2787
-497e 1 594 2787
-497f 2 595 2787
-FUNC 4981 20 0 _freea
-4981 5 235 281
-4986 7 237 281
-498d 3 239 281
-4990 8 241 281
-4998 7 243 281
-499f 2 252 281
-FUNC 49a1 33 0 _msize
-49a1 5 39 561
-49a6 19 43 561
-49bf 2 50 561
-49c1 11 46 561
-49d2 2 50 561
-FUNC 49d4 9 0 _fptrap
-49d4 0 46 4123
-49d4 8 47 4123
-49dc 1 48 4123
-FUNC 49dd 106 0 __report_gsfailure
-49dd b 140 1392
-49e8 5 170 1392
-49ed 6 171 1392
-49f3 6 172 1392
-49f9 6 173 1392
-49ff 6 174 1392
-4a05 6 175 1392
-4a0b 7 176 1392
-4a12 7 177 1392
-4a19 7 178 1392
-4a20 7 179 1392
-4a27 7 180 1392
-4a2e 7 181 1392
-4a35 1 182 1392
-4a36 6 183 1392
-4a3c 3 190 1392
-4a3f 5 191 1392
-4a44 3 192 1392
-4a47 5 193 1392
-4a4c 3 194 1392
-4a4f 5 195 1392
-4a54 6 201 1392
-4a5a a 204 1392
-4a64 a 206 1392
-4a6e a 285 1392
-4a78 a 286 1392
-4a82 b 293 1392
-4a8d b 294 1392
-4a98 b 297 1392
-4aa3 8 298 1392
-4aab 8 302 1392
-4ab3 b 304 1392
-4abe 9 313 1392
-4ac7 8 315 1392
-4acf 12 319 1392
-4ae1 2 320 1392
-FUNC 4ae3 82 0 _calloc_impl
-4ae3 5 21 291
-4ae8 7 26 291
-4aef 19 28 291
-4b08 2 69 291
-4b0a 7 30 291
-4b11 4 34 291
-4b15 1 35 291
-4b16 2 39 291
-4b18 5 41 291
-4b1d f 44 291
-4b2c d 47 291
-4b39 b 59 291
-4b44 7 61 291
-4b4b 6 62 291
-4b51 4 63 291
-4b55 7 52 291
-4b5c 7 53 291
-4b63 2 69 291
-FUNC 4b65 ad 0 realloc
-4b65 5 62 618
-4b6a 6 67 618
-4b70 9 68 618
-4b79 3 117 618
-4b7c 7 71 618
-4b83 9 73 618
-4b8c 5 74 618
-4b91 2 109 618
-4b93 4 83 618
-4b97 1 84 618
-4b98 14 85 618
-4bac c 94 618
-4bb8 b 109 618
-4bc3 5 81 618
-4bc8 7 89 618
-4bcf b 90 618
-4bda 4 91 618
-4bde 2 117 618
-4be0 16 111 618
-4bf6 2 112 618
-4bf8 16 103 618
-4c0e 4 105 618
-FUNC 4c12 1e7 0 __crtLCMapStringA_stat
-4c12 12 96 3447
-4c24 c 101 3447
-4c30 17 102 3447
-4c47 4 106 3447
-4c4b 1 107 3447
-4c4c 3 109 3447
-4c4f 3 113 3447
-4c52 5 133 3447
-4c57 b 134 3447
-4c62 2c 145 3447
-4c8e 7 146 3447
-4c95 48 149 3447
-4cdd 3 150 3447
-4ce0 2 151 3447
-4ce2 19 160 3447
-4cfb 1f 169 3447
-4d1a a 172 3447
-4d24 b 175 3447
-4d2f 9 177 3447
-4d38 10 186 3447
-4d48 5 190 3447
-4d4d 4b 196 3447
-4d98 4 197 3447
-4d9c 16 207 3447
-4db2 9 220 3447
-4dbb 2 223 3447
-4dbd 17 233 3447
-4dd4 7 240 3447
-4ddb 8 242 3447
-4de3 4 244 3447
-4de7 12 245 3447
-FUNC 4df9 46 0 __crtLCMapStringA
-4df9 8 258 3447
-4e01 b 259 3447
-4e0c 31 271 3447
-4e3d 2 272 3447
-FUNC 4e3f e7 0 __crtGetStringTypeA_stat
-4e3f 12 63 3507
-4e51 7 67 3507
-4e58 5 83 3507
-4e5d b 84 3507
-4e68 29 95 3507
-4e91 4 96 3507
-4e95 3e 99 3507
-4ed3 2 100 3507
-4ed5 2 101 3507
-4ed7 f 103 3507
-4ee6 13 111 3507
-4ef9 11 116 3507
-4f0a 6 118 3507
-4f10 4 120 3507
-4f14 12 121 3507
-FUNC 4f26 40 0 __crtGetStringTypeA
-4f26 8 133 3507
-4f2e b 134 3507
-4f39 2b 145 3507
-4f64 2 146 3507
-FUNC 4f66 377 0 __free_lc_time
-4f66 6 228 1800
-4f6c b 229 1800
-4f77 8 232 1800
-4f7f 8 233 1800
-4f87 8 234 1800
-4f8f 8 235 1800
-4f97 8 236 1800
-4f9f 8 237 1800
-4fa7 7 238 1800
-4fae 8 240 1800
-4fb6 8 241 1800
-4fbe 8 242 1800
-4fc6 8 243 1800
-4fce 8 244 1800
-4fd6 8 245 1800
-4fde 8 246 1800
-4fe6 8 248 1800
-4fee b 249 1800
-4ff9 8 250 1800
-5001 8 251 1800
-5009 8 252 1800
-5011 8 253 1800
-5019 8 254 1800
-5021 8 255 1800
-5029 8 256 1800
-5031 8 257 1800
-5039 8 258 1800
-5041 8 259 1800
-5049 8 261 1800
-5051 8 262 1800
-5059 8 263 1800
-5061 8 264 1800
-5069 8 265 1800
-5071 b 266 1800
-507c b 267 1800
-5087 b 268 1800
-5092 b 269 1800
-509d b 270 1800
-50a8 b 271 1800
-50b3 b 272 1800
-50be b 274 1800
-50c9 b 275 1800
-50d4 b 277 1800
-50df b 278 1800
-50ea b 279 1800
-50f5 b 282 1800
-5100 b 283 1800
-510b b 284 1800
-5116 b 285 1800
-5121 e 286 1800
-512f b 287 1800
-513a b 288 1800
-5145 b 290 1800
-5150 b 291 1800
-515b b 292 1800
-5166 b 293 1800
-5171 b 294 1800
-517c b 295 1800
-5187 b 296 1800
-5192 b 298 1800
-519d b 299 1800
-51a8 b 300 1800
-51b3 b 301 1800
-51be b 302 1800
-51c9 b 303 1800
-51d4 e 304 1800
-51e2 b 305 1800
-51ed b 306 1800
-51f8 b 307 1800
-5203 b 308 1800
-520e b 309 1800
-5219 b 311 1800
-5224 b 312 1800
-522f b 313 1800
-523a b 314 1800
-5245 b 315 1800
-5250 b 316 1800
-525b b 317 1800
-5266 b 318 1800
-5271 b 319 1800
-527c b 320 1800
-5287 e 321 1800
-5295 b 322 1800
-52a0 b 324 1800
-52ab b 325 1800
-52b6 b 327 1800
-52c1 b 328 1800
-52cc f 329 1800
-52db 2 332 1800
-FUNC 52dd 69 0 __free_lconv_num
-52dd 6 218 1742
-52e3 7 219 1742
-52ea a 222 1742
-52f4 7 223 1742
-52fb b 225 1742
-5306 7 226 1742
-530d b 228 1742
-5318 7 229 1742
-531f b 231 1742
-532a 7 232 1742
-5331 b 234 1742
-533c 8 235 1742
-5344 2 236 1742
-FUNC 5346 fe 0 __free_lconv_mon
-5346 6 270 1685
-534c b 271 1685
-5357 b 274 1685
-5362 7 275 1685
-5369 b 277 1685
-5374 7 278 1685
-537b b 280 1685
-5386 7 281 1685
-538d b 283 1685
-5398 7 284 1685
-539f b 286 1685
-53aa 7 287 1685
-53b1 b 289 1685
-53bc 7 290 1685
-53c3 b 292 1685
-53ce 7 293 1685
-53d5 b 295 1685
-53e0 7 296 1685
-53e7 b 298 1685
-53f2 7 299 1685
-53f9 b 301 1685
-5404 7 302 1685
-540b b 304 1685
-5416 7 305 1685
-541d b 307 1685
-5428 7 308 1685
-542f b 310 1685
-543a 8 311 1685
-5442 2 312 1685
-FUNC 5444 ba 0 _VEC_memzero
-FUNC 54fe 10 0 __sse2_available_init
-54fe 0 30 4315
-54fe d 31 4315
-550b 2 32 4315
-550d 1 33 4315
-FUNC 550e 103 0 _VEC_memcpy
-FUNC 5620 2c 0 _alloca_probe_16
-5620 0 44 4274
-5620 1 46 4274
-5621 4 47 4274
-5625 2 48 4274
-5627 3 49 4274
-562a 2 50 4274
-562c 2 51 4274
-562e 2 52 4274
-5630 1 53 4274
-5631 5 54 4274
-5636 1 59 4274
-5637 4 60 4274
-563b 2 61 4274
-563d 3 62 4274
-5640 2 63 4274
-5642 2 64 4274
-5644 2 65 4274
-5646 1 66 4274
-5647 5 67 4274
-PUBLIC 5636 0 _alloca_probe_8
-FUNC 5650 34 0 _allmul
-5650 0 47 2803
-5650 4 63 2803
-5654 4 64 2803
-5658 2 65 2803
-565a 4 66 2803
-565e 2 67 2803
-5660 4 69 2803
-5664 2 70 2803
-5666 3 72 2803
-5669 1 75 2803
-566a 2 83 2803
-566c 2 84 2803
-566e 4 86 2803
-5672 4 87 2803
-5676 2 88 2803
-5678 4 90 2803
-567c 2 91 2803
-567e 2 92 2803
-5680 1 94 2803
-5681 3 96 2803
-FUNC 5690 2b 0 _chkstk
-5690 0 65 4276
-5690 1 69 4276
-5691 4 73 4276
-5695 2 74 4276
-5697 2 79 4276
-5699 2 80 4276
-569b 2 81 4276
-569d 2 83 4276
-569f 5 84 4276
-56a4 2 87 4276
-56a6 2 88 4276
-56a8 2 89 4276
-56aa 1 90 4276
-56ab 1 91 4276
-56ac 2 92 4276
-56ae 3 93 4276
-56b1 1 94 4276
-56b2 5 98 4276
-56b7 2 99 4276
-56b9 2 100 4276
-FUNC 56c0 46 0 strcspn
-56c0 4 191 2794
-56c4 2 198 2794
-56c6 1 199 2794
-56c7 1 200 2794
-56c8 1 201 2794
-56c9 1 202 2794
-56ca 1 203 2794
-56cb 1 204 2794
-56cc 1 205 2794
-56cd 1 206 2794
-56ce 6 212 2794
-56d4 2 216 2794
-56d6 2 217 2794
-56d8 2 218 2794
-56da 3 219 2794
-56dd 4 220 2794
-56e1 2 221 2794
-56e3 3 227 2794
-56e6 6 229 2794
-56ec 3 234 2794
-56ef 2 236 2794
-56f1 2 237 2794
-56f3 2 238 2794
-56f5 3 239 2794
-56f8 4 240 2794
-56fc 2 245 2794
-56fe 2 255 2794
-5700 3 257 2794
-5703 3 259 2794
-FUNC 5710 40 0 strpbrk
-5710 4 191 2794
-5714 2 198 2794
-5716 1 199 2794
-5717 1 200 2794
-5718 1 201 2794
-5719 1 202 2794
-571a 1 203 2794
-571b 1 204 2794
-571c 1 205 2794
-571d 1 206 2794
-571e 6 212 2794
-5724 2 216 2794
-5726 2 217 2794
-5728 2 218 2794
-572a 3 219 2794
-572d 4 220 2794
-5731 2 221 2794
-5733 5 227 2794
-5738 2 236 2794
-573a 2 237 2794
-573c 2 238 2794
-573e 3 239 2794
-5741 4 240 2794
-5745 2 247 2794
-5747 3 248 2794
-574a 3 257 2794
-574d 3 259 2794
-FUNC 5750 61 0 __ascii_strnicmp
-5750 6 69 2798
-5756 3 75 2798
-5759 2 76 2798
-575b 2 77 2798
-575d 3 79 2798
-5760 3 80 2798
-5763 2 82 2798
-5765 2 83 2798
-5767 5 84 2798
-576c 2 89 2798
-576e 2 91 2798
-5770 2 93 2798
-5772 2 95 2798
-5774 2 97 2798
-5776 2 98 2798
-5778 3 100 2798
-577b 3 101 2798
-577e 2 103 2798
-5780 2 104 2798
-5782 2 106 2798
-5784 2 107 2798
-5786 2 109 2798
-5788 2 112 2798
-578a 2 113 2798
-578c 2 115 2798
-578e 2 116 2798
-5790 2 118 2798
-5792 2 121 2798
-5794 2 122 2798
-5796 3 124 2798
-5799 2 125 2798
-579b 2 128 2798
-579d 2 129 2798
-579f 2 130 2798
-57a1 5 133 2798
-57a6 2 134 2798
-57a8 2 135 2798
-57aa 2 138 2798
-57ac 5 140 2798
-PUBLIC 57b2 10 RtlUnwind
-STACK WIN 4 1000 54 6 0 8 0 14 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 1060 a 3 0 0 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 1070 21 7 0 0 0 4 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 10a0 14 7 0 0 0 4 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 10c0 16 7 0 4 0 4 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 10e0 1e 7 0 0 0 4 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 1100 10 7 0 0 0 4 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 1110 7 3 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 1120 2c 7 0 4 0 4 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 114c 10 0 0 0 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
-STACK WIN 4 115c 21 8 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 1162 17 2 0 4 4 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $23 $T0 4 - ^ =
-STACK WIN 4 117d b 5 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 1188 29 5 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 11b1 161 c 0 0 10 24 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 40 - ^ = $23 $T0 44 - ^ = $24 $T0 48 - ^ =
-STACK WIN 4 12d4 14 0 0 0 10 24 0 1 $T0 $ebp = $T2 $esp = $T1 .raSearchStart = $eip $T1 ^ = $ebp $T0 = $esp $T1 4 + =
-STACK WIN 4 1312 a 0 0 0 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
-STACK WIN 4 131c 70 c 0 4 10 1c 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 32 - ^ = $23 $T0 36 - ^ = $24 $T0 40 - ^ =
-STACK WIN 4 1383 8 0 0 4 10 1c 0 1 $T0 $ebp = $T2 $esp = $T1 .raSearchStart = $eip $T1 ^ = $ebp $T0 = $esp $T1 4 + =
-STACK WIN 4 1418 3a 5 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 1439 17 0 0 4 4 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $23 $T0 4 - ^ =
-STACK WIN 4 1452 42 5 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 1494 e 0 0 0 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
-STACK WIN 4 14a2 2b 5 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 14cd 18 5 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 14e5 9 0 0 0 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
-STACK WIN 4 14ee 9 0 0 0 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
-STACK WIN 4 14f7 33 3 0 0 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
-STACK WIN 4 14fa 2f 0 0 0 4 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = $23 $T0 4 - ^ =
-STACK WIN 4 152a 24 6 0 8 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 1530 1c 0 0 8 4 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $23 $T0 4 - ^ =
-STACK WIN 4 154e 97 5 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 1590 34 0 0 4 4 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $23 $T0 4 - ^ =
-STACK WIN 4 1591 32 0 0 4 8 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $23 $T0 4 - ^ = $24 $T0 8 - ^ =
-STACK WIN 4 15e5 140 c 0 c 10 30 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 52 - ^ = $23 $T0 56 - ^ = $24 $T0 60 - ^ =
-STACK WIN 4 1710 e 0 0 c 10 30 0 1 $T0 $ebp = $T2 $esp = $T1 .raSearchStart = $eip $T1 ^ = $ebp $T0 = $esp $T1 4 + =
-STACK WIN 4 1725 16 5 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 173b 16 5 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 1751 f 0 0 0 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
-STACK WIN 4 1760 f 0 0 0 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
-STACK WIN 4 176f 1e 5 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 178d 26 5 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 17b3 1af 1b 0 4 0 1fc 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 17c9 192 5 0 4 4 1fc 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 512 - ^ =
-STACK WIN 4 17ca 18e 4 0 4 8 1fc 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 512 - ^ = $23 $T0 516 - ^ =
-STACK WIN 4 17ce 189 0 0 4 c 1fc 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 512 - ^ = $23 $T0 516 - ^ = $24 $T0 520 - ^ =
-STACK WIN 4 1962 39 0 0 0 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
-STACK WIN 4 199b 14a 6 0 8 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 19a1 142 0 0 8 4 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $23 $T0 4 - ^ =
-STACK WIN 4 19b9 129 0 0 8 8 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $23 $T0 4 - ^ = $24 $T0 8 - ^ =
-STACK WIN 4 1a0a d4 0 0 8 c 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $23 $T0 4 - ^ = $24 $T0 8 - ^ = $20 $T0 12 - ^ =
-STACK WIN 4 1ae5 dc 0 0 0 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
-STACK WIN 4 1af4 a8 0 0 0 4 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = $23 $T0 4 - ^ =
-STACK WIN 4 1afb a0 0 0 0 8 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = $23 $T0 4 - ^ = $24 $T0 8 - ^ =
-STACK WIN 4 1b3d 5d 0 0 0 c 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = $23 $T0 4 - ^ = $24 $T0 8 - ^ = $20 $T0 12 - ^ =
-STACK WIN 4 1bc1 19a d 0 c 0 4 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 1bcb 185 3 0 c 4 4 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 8 - ^ =
-STACK WIN 4 1bce 181 0 0 c 8 4 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 8 - ^ = $23 $T0 12 - ^ =
-STACK WIN 4 1d5b bb d 0 0 0 c 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 1d64 b0 4 0 0 4 c 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 16 - ^ =
-STACK WIN 4 1d67 ac 1 0 0 8 c 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 16 - ^ = $23 $T0 20 - ^ =
-STACK WIN 4 1d68 aa 0 0 0 c c 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 16 - ^ = $23 $T0 20 - ^ = $24 $T0 24 - ^ =
-STACK WIN 4 1e16 97 a 0 0 0 c 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 1e1f 8c 1 0 0 4 c 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 16 - ^ =
-STACK WIN 4 1e20 8a 0 0 0 8 c 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 16 - ^ = $23 $T0 20 - ^ =
-STACK WIN 4 1e48 61 0 0 0 c c 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 16 - ^ = $23 $T0 20 - ^ = $24 $T0 24 - ^ =
-STACK WIN 4 1ead 245 9 0 0 0 4c 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 1eb6 235 0 0 0 4 4c 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $23 $T0 80 - ^ =
-STACK WIN 4 1f27 1c3 0 0 0 8 4c 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $23 $T0 80 - ^ = $20 $T0 84 - ^ =
-STACK WIN 4 1f28 1c1 0 0 0 c 4c 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $23 $T0 80 - ^ = $20 $T0 84 - ^ = $24 $T0 88 - ^ =
-STACK WIN 4 20f2 26 e 0 0 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
-STACK WIN 4 20f5 22 b 0 0 4 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = $23 $T0 4 - ^ =
-STACK WIN 4 2100 16 0 0 0 8 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = $23 $T0 4 - ^ = $24 $T0 8 - ^ =
-STACK WIN 4 2118 26 e 0 0 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
-STACK WIN 4 211b 22 b 0 0 4 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = $23 $T0 4 - ^ =
-STACK WIN 4 2126 16 0 0 0 8 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = $23 $T0 4 - ^ = $24 $T0 8 - ^ =
-STACK WIN 4 213e 9 0 0 0 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
-STACK WIN 4 2147 9 0 0 4 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
-STACK WIN 4 2150 34 3 0 0 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
-STACK WIN 4 2153 30 0 0 0 4 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = $23 $T0 4 - ^ =
-STACK WIN 4 2184 3d 0 0 0 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
-STACK WIN 4 21c1 b4 c 0 8 10 18 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 28 - ^ = $23 $T0 32 - ^ = $24 $T0 36 - ^ =
-STACK WIN 4 225d e 0 0 8 10 18 0 1 $T0 $ebp = $T2 $esp = $T1 .raSearchStart = $eip $T1 ^ = $ebp $T0 = $esp $T1 4 + =
-STACK WIN 4 226c 8 0 0 8 10 18 0 1 $T0 $ebp = $T2 $esp = $T1 .raSearchStart = $eip $T1 ^ = $ebp $T0 = $esp $T1 4 + =
-STACK WIN 4 2275 79 4 0 0 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
-STACK WIN 4 2278 75 1 0 0 4 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = $23 $T0 4 - ^ =
-STACK WIN 4 2279 71 0 0 0 8 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = $23 $T0 4 - ^ = $24 $T0 8 - ^ =
-STACK WIN 4 22ee 1a 3 0 0 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
-STACK WIN 4 22f1 16 0 0 0 4 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = $23 $T0 4 - ^ =
-STACK WIN 4 2308 12f c 0 4 10 18 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 28 - ^ = $23 $T0 32 - ^ = $24 $T0 36 - ^ =
-STACK WIN 4 241f b 0 0 4 10 18 0 1 $T0 $ebp = $T2 $esp = $T1 .raSearchStart = $eip $T1 ^ = $ebp $T0 = $esp $T1 4 + =
-STACK WIN 4 242b b 0 0 4 10 18 0 1 $T0 $ebp = $T2 $esp = $T1 .raSearchStart = $eip $T1 ^ = $ebp $T0 = $esp $T1 4 + =
-STACK WIN 4 2437 17b 3 0 0 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
-STACK WIN 4 243a 177 0 0 0 4 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = $24 $T0 4 - ^ =
-STACK WIN 4 2455 15b 0 0 0 8 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = $24 $T0 4 - ^ = $23 $T0 8 - ^ =
-STACK WIN 4 25b2 1e 0 0 0 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
-STACK WIN 4 2630 18f 17 0 10 0 18 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 2639 c9 e 0 10 4 18 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 28 - ^ =
-STACK WIN 4 263d c4 a 0 10 8 18 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 28 - ^ = $23 $T0 32 - ^ =
-STACK WIN 4 2647 b9 0 0 10 c 18 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 28 - ^ = $23 $T0 32 - ^ = $24 $T0 36 - ^ =
-STACK WIN 4 27bf 9b 17 0 0 0 10 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 27d5 83 1 0 0 4 10 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 20 - ^ =
-STACK WIN 4 27d6 81 0 0 0 8 10 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 20 - ^ = $24 $T0 24 - ^ =
-STACK WIN 4 27f2 64 0 0 0 c 10 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 20 - ^ = $24 $T0 24 - ^ = $23 $T0 28 - ^ =
-STACK WIN 4 285a f 5 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 2869 129 1a 0 c 8 328 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 812 - ^ = $24 $T0 816 - ^ =
-STACK WIN 4 2992 25 3 0 14 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
-STACK WIN 4 2995 21 0 0 14 4 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = $23 $T0 4 - ^ =
-STACK WIN 4 29b7 2d 5 0 14 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 29e4 10 0 0 0 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
-STACK WIN 4 29f4 4a 4 0 0 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
-STACK WIN 4 29f7 3a 1 0 0 4 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = $23 $T0 4 - ^ =
-STACK WIN 4 29f8 38 0 0 0 8 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = $23 $T0 4 - ^ = $24 $T0 8 - ^ =
-STACK WIN 4 2a3e 57 a 0 0 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
-STACK WIN 4 2a41 53 7 0 0 4 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = $20 $T0 4 - ^ =
-STACK WIN 4 2a48 4b 0 0 0 8 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = $20 $T0 4 - ^ = $23 $T0 8 - ^ =
-STACK WIN 4 2a4e 2a 0 0 0 c 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = $20 $T0 4 - ^ = $23 $T0 8 - ^ = $24 $T0 12 - ^ =
-STACK WIN 4 2a95 17 5 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 2aac c2 c 0 4 10 1c 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 32 - ^ = $23 $T0 36 - ^ = $24 $T0 40 - ^ =
-STACK WIN 4 2b65 8 0 0 4 10 1c 0 1 $T0 $ebp = $T2 $esp = $T1 .raSearchStart = $eip $T1 ^ = $ebp $T0 = $esp $T1 4 + =
-STACK WIN 4 2b6e 33 9 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 2b77 28 0 0 4 4 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $23 $T0 4 - ^ =
-STACK WIN 4 2ba1 5f a 0 c 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 2baa 54 1 0 c 4 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $23 $T0 4 - ^ =
-STACK WIN 4 2bab 52 0 0 c 8 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $23 $T0 4 - ^ = $24 $T0 8 - ^ =
-STACK WIN 4 2c8b 94 6 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 2c91 8c 0 0 4 4 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 4 - ^ =
-STACK WIN 4 2c9a 6c 0 0 4 8 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 4 - ^ = $23 $T0 8 - ^ =
-STACK WIN 4 2c9b 6a 0 0 4 c 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 4 - ^ = $23 $T0 8 - ^ = $24 $T0 12 - ^ =
-STACK WIN 4 2e72 42 5 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 2eb4 13 0 0 0 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
-STACK WIN 4 2ec7 39 c 0 0 10 18 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 28 - ^ = $23 $T0 32 - ^ = $24 $T0 36 - ^ =
-STACK WIN 4 2ee7 4 0 0 0 10 18 0 1 $T0 $ebp = $T2 $esp = $T1 .raSearchStart = $eip $T1 ^ = $ebp $T0 = $esp $T1 4 + =
-STACK WIN 4 2f00 11 0 0 4 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
-STACK WIN 4 2f11 1e 5 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 2f2f 37 5 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 2f3e 1b 0 0 4 4 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $23 $T0 4 - ^ =
-STACK WIN 4 2f66 d 0 0 0 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
-STACK WIN 4 2f73 1a3 c 0 4 10 30 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 52 - ^ = $23 $T0 56 - ^ = $24 $T0 60 - ^ =
-STACK WIN 4 30d4 14 0 0 4 10 30 0 1 $T0 $ebp = $T2 $esp = $T1 .raSearchStart = $eip $T1 ^ = $ebp $T0 = $esp $T1 4 + =
-STACK WIN 4 3116 f 5 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 3125 f 5 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 3134 f 5 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 3143 28 5 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 316b b6 f 0 4 0 4 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 3172 ad 8 0 4 4 4 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 8 - ^ =
-STACK WIN 4 3173 ab 7 0 4 8 4 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 8 - ^ = $23 $T0 12 - ^ =
-STACK WIN 4 317a a3 0 0 4 c 4 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 8 - ^ = $23 $T0 12 - ^ = $24 $T0 16 - ^ =
-STACK WIN 4 3221 31 3 0 0 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
-STACK WIN 4 3224 2d 0 0 0 4 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = $23 $T0 4 - ^ =
-STACK WIN 4 3252 3c c 0 4 10 1c 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 32 - ^ = $23 $T0 36 - ^ = $24 $T0 40 - ^ =
-STACK WIN 4 3288 5 0 0 4 10 1c 0 1 $T0 $ebp = $T2 $esp = $T1 .raSearchStart = $eip $T1 ^ = $ebp $T0 = $esp $T1 4 + =
-STACK WIN 4 328e 17 5 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 32a5 23 4 0 0 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
-STACK WIN 4 32a8 1f 1 0 0 4 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = $23 $T0 4 - ^ =
-STACK WIN 4 32a9 1d 0 0 0 8 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = $23 $T0 4 - ^ = $24 $T0 8 - ^ =
-STACK WIN 4 32d0 35 5 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 3310 44 1a 0 8 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 3322 30 8 0 8 4 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 4 - ^ =
-STACK WIN 4 3323 2e 7 0 8 8 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 4 - ^ = $23 $T0 8 - ^ =
-STACK WIN 4 332a 26 0 0 8 c 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 4 - ^ = $23 $T0 8 - ^ = $24 $T0 12 - ^ =
-STACK WIN 4 3360 bc 35 0 4 10 18 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 28 - ^ = $23 $T0 32 - ^ = $24 $T0 36 - ^ =
-STACK WIN 4 33eb 13 0 0 4 10 18 0 1 $T0 $ebp = $T2 $esp = $T1 .raSearchStart = $eip $T1 ^ = $ebp $T0 = $esp $T1 4 + =
-STACK WIN 4 341c 16c 1e 0 c 0 24 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 3432 14f 8 0 c 4 24 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 40 - ^ =
-STACK WIN 4 3439 145 1 0 c 8 24 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 40 - ^ = $23 $T0 44 - ^ =
-STACK WIN 4 343a 143 0 0 c c 24 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 40 - ^ = $23 $T0 44 - ^ = $24 $T0 48 - ^ =
-STACK WIN 4 3588 75 a 0 c 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 358e 22 4 0 c 4 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $23 $T0 4 - ^ =
-STACK WIN 4 3592 1d 0 0 c 8 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $23 $T0 4 - ^ = $24 $T0 8 - ^ =
-STACK WIN 4 35fd cd e 0 10 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 3606 17 5 0 10 4 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 4 - ^ =
-STACK WIN 4 360a 28 1 0 10 8 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 4 - ^ = $23 $T0 8 - ^ =
-STACK WIN 4 360b 10 0 0 10 c 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 4 - ^ = $23 $T0 8 - ^ = $24 $T0 12 - ^ =
-STACK WIN 4 36ca 1b 5 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 36e5 63 a 0 c 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 36eb 22 4 0 c 4 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $23 $T0 4 - ^ =
-STACK WIN 4 36ef 1d 0 0 c 8 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $23 $T0 4 - ^ = $24 $T0 8 - ^ =
-STACK WIN 4 3748 3f 5 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 3787 f 0 0 0 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
-STACK WIN 4 3796 45 7 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 379c 3d 1 0 4 4 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $23 $T0 4 - ^ =
-STACK WIN 4 379d 3b 0 0 4 8 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $23 $T0 4 - ^ = $24 $T0 8 - ^ =
-STACK WIN 4 37db 4c 7 0 8 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 37e1 44 1 0 8 4 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $23 $T0 4 - ^ =
-STACK WIN 4 37e2 42 0 0 8 8 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $23 $T0 4 - ^ = $24 $T0 8 - ^ =
-STACK WIN 4 3827 4e 7 0 8 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 382d 46 1 0 8 4 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $23 $T0 4 - ^ =
-STACK WIN 4 382e 44 0 0 8 8 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $23 $T0 4 - ^ = $24 $T0 8 - ^ =
-STACK WIN 4 3875 2f 0 0 0 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
-STACK WIN 4 38a4 64 6 0 0 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
-STACK WIN 4 38a7 60 3 0 0 4 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = $23 $T0 4 - ^ =
-STACK WIN 4 38a8 5e 2 0 0 8 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = $23 $T0 4 - ^ = $24 $T0 8 - ^ =
-STACK WIN 4 3908 190 17 0 0 0 51c 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 391e 173 1 0 0 4 51c 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 1312 - ^ =
-STACK WIN 4 391f 16f 0 0 0 8 51c 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 1312 - ^ = $24 $T0 1316 - ^ =
-STACK WIN 4 3a98 a4 c 0 0 10 1c 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 32 - ^ = $23 $T0 36 - ^ = $24 $T0 40 - ^ =
-STACK WIN 4 3b30 b 0 0 0 10 1c 0 1 $T0 $ebp = $T2 $esp = $T1 .raSearchStart = $eip $T1 ^ = $ebp $T0 = $esp $T1 4 + =
-STACK WIN 4 3b3c 87 b 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 3b45 7a 2 0 4 4 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $23 $T0 4 - ^ =
-STACK WIN 4 3bc3 7c 9 0 0 0 10 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 3bcc 71 0 0 0 4 10 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 20 - ^ =
-STACK WIN 4 3c3f 1e9 1b 0 8 0 20 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 3c52 1cf 8 0 8 4 20 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 36 - ^ =
-STACK WIN 4 3c56 1c8 4 0 8 8 20 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 36 - ^ = $23 $T0 40 - ^ =
-STACK WIN 4 3c5a 1c3 0 0 8 c 20 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 36 - ^ = $23 $T0 40 - ^ = $24 $T0 44 - ^ =
-STACK WIN 4 3e28 19a c 0 4 10 24 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 40 - ^ = $23 $T0 44 - ^ = $24 $T0 48 - ^ =
-STACK WIN 4 3f89 8 0 0 4 10 24 0 1 $T0 $ebp = $T2 $esp = $T1 .raSearchStart = $eip $T1 ^ = $ebp $T0 = $esp $T1 4 + =
-STACK WIN 4 3fc2 1e 0 0 0 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
-STACK WIN 4 3fe0 53 8 0 10 0 10 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 4033 18 5 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 404b 8f e 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 4051 87 8 0 4 4 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 4 - ^ =
-STACK WIN 4 4052 85 7 0 4 8 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 4 - ^ = $23 $T0 8 - ^ =
-STACK WIN 4 4059 7d 0 0 4 c 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 4 - ^ = $23 $T0 8 - ^ = $24 $T0 12 - ^ =
-STACK WIN 4 40da 99 6 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 40e0 91 0 0 4 4 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $24 $T0 4 - ^ =
-STACK WIN 4 40ec 82 0 0 4 8 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $24 $T0 4 - ^ = $20 $T0 8 - ^ =
-STACK WIN 4 40ed 80 0 0 4 c 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $24 $T0 4 - ^ = $20 $T0 8 - ^ = $23 $T0 12 - ^ =
-STACK WIN 4 4173 14b 13 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 4179 143 d 0 4 4 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 4 - ^ =
-STACK WIN 4 417a 141 c 0 4 8 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 4 - ^ = $23 $T0 8 - ^ =
-STACK WIN 4 4186 134 0 0 4 c 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 4 - ^ = $23 $T0 8 - ^ = $24 $T0 12 - ^ =
-STACK WIN 4 42be 4d 6 0 8 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 42c4 45 0 0 8 4 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $24 $T0 4 - ^ =
-STACK WIN 4 42d3 31 0 0 8 8 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $24 $T0 4 - ^ = $23 $T0 8 - ^ =
-STACK WIN 4 430b 79 c 0 0 10 1c 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 32 - ^ = $23 $T0 36 - ^ = $24 $T0 40 - ^ =
-STACK WIN 4 4378 8 0 0 0 10 1c 0 1 $T0 $ebp = $T2 $esp = $T1 .raSearchStart = $eip $T1 ^ = $ebp $T0 = $esp $T1 4 + =
-STACK WIN 4 4384 8 0 0 4 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
-STACK WIN 4 45e7 33 0 0 0 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
-STACK WIN 4 4981 20 5 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 49a1 33 5 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 49d4 9 0 0 0 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
-STACK WIN 4 49dd 106 b 0 0 0 328 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 4ae3 82 5 0 c 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 4b0f 54 0 0 c 4 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $23 $T0 4 - ^ =
-STACK WIN 4 4b65 ad 5 0 8 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 4b7c 62 0 0 8 4 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $23 $T0 4 - ^ =
-STACK WIN 4 4b91 4c 0 0 8 8 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $23 $T0 4 - ^ = $24 $T0 8 - ^ =
-STACK WIN 4 4c12 1e7 1a 0 24 c 10 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 20 - ^ = $23 $T0 24 - ^ = $24 $T0 28 - ^ =
-STACK WIN 4 4df9 46 8 0 24 0 10 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 4e3f e7 16 0 1c c 8 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 12 - ^ = $23 $T0 16 - ^ = $24 $T0 20 - ^ =
-STACK WIN 4 4f26 40 8 0 20 0 10 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 4f66 377 6 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 4f6c 36f 0 0 4 4 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $23 $T0 4 - ^ =
-STACK WIN 4 52dd 69 6 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 52e3 61 0 0 4 4 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $23 $T0 4 - ^ =
-STACK WIN 4 5346 fe 6 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
-STACK WIN 4 534c f6 0 0 4 4 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $23 $T0 4 - ^ =
-STACK WIN 4 5444 ba 0 0 c 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
-STACK WIN 4 54fe 10 0 0 0 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
-STACK WIN 4 550e 103 0 0 c 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
-STACK WIN 0 12d4 14 0 0 0 0 0 0 0 0
-STACK WIN 0 1383 9 0 0 0 0 0 0 0 0
-STACK WIN 0 1390 88 0 0 8 0 0 0 0 0
-STACK WIN 0 1710 f 0 0 0 0 0 0 0 0
-STACK WIN 0 225d f 0 0 0 0 0 0 0 0
-STACK WIN 0 226c 9 0 0 0 0 0 0 0 0
-STACK WIN 0 241f c 0 0 0 0 0 0 0 0
-STACK WIN 0 242b c 0 0 0 0 0 0 0 0
-STACK WIN 0 2b65 9 0 0 0 0 0 0 0 0
-STACK WIN 0 2c00 8b 0 0 4 0 0 0 0 0
-STACK WIN 0 2d20 90 3 0 c c 0 0 0 0
-STACK WIN 0 2db0 46 0 0 10 4 0 0 0 1
-STACK WIN 0 2e12 17 4 0 0 10 0 0 0 1
-STACK WIN 0 2e29 19 0 0 0 0 0 0 0 0
-STACK WIN 0 2e5b 17 1 0 8 4 0 0 0 1
-STACK WIN 0 2ee7 4 0 0 0 0 0 0 0 0
-STACK WIN 0 30d4 15 0 0 0 0 0 0 0 0
-STACK WIN 0 3288 6 0 0 0 0 0 0 0 0
-STACK WIN 0 33eb 13 0 0 0 0 0 0 0 0
-STACK WIN 0 3b30 c 0 0 0 0 0 0 0 0
-STACK WIN 0 3f89 9 0 0 0 0 0 0 0 0
-STACK WIN 0 4378 9 0 0 0 0 0 0 0 0
-STACK WIN 0 4390 7a 0 0 c 0 0 0 0 0
-STACK WIN 0 4410 95 0 0 10 0 4 0 0 0
-STACK WIN 0 4515 84 3 0 8 c 0 0 0 0
-STACK WIN 0 4599 23 0 0 0 0 0 0 0 0
-STACK WIN 0 45e4 3 0 0 0 0 0 0 0 0
-STACK WIN 0 5650 1a 0 0 10 0 0 0 0 0
-STACK WIN 0 566a 1a 0 0 10 0 4 0 0 0
+MODULE windows x86 9214611565FA4C538FE724A797B860F71 dump_syms_regtest.pdb
+FILE 1 c:\src\breakpad\src\src\tools\windows\dump_syms\testdata\dump_syms_regtest.cc
+FILE 2 f:\dd\public\sdk\inc\internal\pebteb.h
+FILE 3 f:\dd\public\sdk\inc\internal\ntldr.h
+FILE 4 f:\dd\public\sdk\inc\internal\ntconfig.h
+FILE 5 f:\dd\public\sdk\inc\internal\ntregapi.h
+FILE 6 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\h\stdarg.h
+FILE 7 f:\dd\public\ddk\inc\ntdef.h
+FILE 8 f:\dd\public\sdk\inc\internal\ntmmapi.h
+FILE 9 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\h\ctype.h
+FILE 10 f:\dd\public\sdk\inc\pshpack1.h
+FILE 11 f:\dd\public\sdk\inc\internal\nxi386.h
+FILE 12 f:\dd\public\ddk\inc\poppack.h
+FILE 13 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\h\process.h
+FILE 14 f:\dd\public\sdk\inc\pshpack8.h
+FILE 15 f:\dd\public\ddk\inc\ntpoapi.h
+FILE 16 f:\dd\public\sdk\inc\internal\ntexapi.h
+FILE 17 f:\dd\public\sdk\inc\poppack.h
+FILE 18 f:\dd\public\ddk\inc\ntimage.h
+FILE 19 f:\dd\public\ddk\inc\pshpack4.h
+FILE 20 f:\dd\public\sdk\inc\pshpack2.h
+FILE 21 f:\dd\public\ddk\inc\ntnls.h
+FILE 22 f:\dd\public\sdk\inc\internal\ntelfapi.h
+FILE 23 f:\dd\public\sdk\inc\internal\ntpsapi.h
+FILE 24 f:\dd\public\sdk\inc\internal\nti386.h
+FILE 25 f:\dd\public\sdk\inc\specstrings.h
+FILE 26 f:\dd\public\sdk\inc\sal_supp.h
+FILE 27 f:\dd\public\sdk\inc\specstrings_supp.h
+FILE 28 f:\dd\public\sdk\inc\specstrings_strict.h
+FILE 29 f:\dd\public\sdk\inc\specstrings_undef.h
+FILE 30 f:\dd\public\sdk\inc\driverspecs.h
+FILE 31 f:\dd\public\sdk\inc\sdv_driverspecs.h
+FILE 32 f:\dd\public\sdk\inc\basetsd.h
+FILE 33 f:\dd\public\sdk\inc\internal\ntpnpapi.h
+FILE 34 f:\dd\public\sdk\inc\cfg.h
+FILE 35 f:\dd\public\sdk\inc\internal\ntxcapi.h
+FILE 36 f:\dd\public\sdk\inc\guiddef.h
+FILE 37 f:\dd\public\sdk\inc\internal\nt.h
+FILE 38 f:\dd\public\sdk\inc\ntstatus.h
+FILE 39 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\h\excpt.h
+FILE 40 f:\dd\public\sdk\inc\internal\ntkeapi.h
+FILE 41 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\h\crtdefs.h
+FILE 42 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\h\sal.h
+FILE 43 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\h\codeanalysis\sourceannotations.h
+FILE 44 f:\dd\public\sdk\inc\internal\ntobapi.h
+FILE 45 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\h\string.h
+FILE 46 f:\dd\public\sdk\inc\internal\ntioapi.h
+FILE 47 f:\dd\public\ddk\inc\devioctl.h
+FILE 48 f:\dd\public\sdk\inc\internal\ntseapi.h
+FILE 49 f:\dd\public\ddk\inc\mce.h
+FILE 50 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\misc\i386\chandler4.c
+FILE 51 f:\dd\public\sdk\inc\pshpack4.h
+FILE 52 f:\dd\public\devdiv\inc\ddbanned.h
+FILE 53 f:\dd\public\sdk\inc\internal\ntlpcapi.h
+FILE 54 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\h\vadefs.h
+FILE 55 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\h\cruntime.h
+FILE 56 f:\dd\public\sdk\inc\internal\ntiolog.h
+FILE 57 f:\dd\vctools\crt_bld\SELF_X86\crt\prebuild\misc\i386\exsup.asm
+FILE 58 f:\dd\vctools\crt_bld\SELF_X86\crt\prebuild\h\pversion.inc
+FILE 59 f:\dd\vctools\crt_bld\SELF_X86\crt\prebuild\h\cmacros.inc
+FILE 60 f:\dd\vctools\crt_bld\SELF_X86\crt\prebuild\h\exsup.inc
+FILE 61 f:\dd\vctools\crt_bld\SELF_X86\crt\prebuild\misc\i386\nlgsupp.asm
+FILE 62 f:\dd\vctools\crt_bld\SELF_X86\crt\prebuild\misc\i386\exsup4.asm
+FILE 64 f:\dd\vctools\crt_bld\SELF_X86\crt\prebuild\misc\i386\sehprolg4.asm
+FILE 65 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\string\i386\p4_memcpy.c
+FILE 69 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\string\i386\memcmp.c
+FILE 73 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\string\i386\p4_memset.c
+FILE 77 f:\dd\public\sdk\inc\winreg.h
+FILE 78 f:\dd\public\sdk\inc\imm.h
+FILE 79 f:\dd\public\sdk\inc\wingdi.h
+FILE 80 f:\dd\vctools\crt_bld\self_x86\crt\src\stdlib.h
+FILE 81 f:\dd\public\sdk\inc\winerror.h
+FILE 82 f:\dd\public\sdk\inc\ktmtypes.h
+FILE 84 f:\dd\vctools\crt_bld\self_x86\crt\src\stdarg.h
+FILE 85 f:\dd\public\sdk\inc\windef.h
+FILE 86 f:\dd\public\sdk\inc\winbase.h
+FILE 88 f:\dd\vctools\crt_bld\self_x86\crt\src\string.h
+FILE 89 f:\dd\public\sdk\inc\winuser.h
+FILE 91 f:\dd\public\sdk\inc\winnetwk.h
+FILE 92 f:\dd\public\sdk\inc\winnt.h
+FILE 93 f:\dd\public\sdk\inc\wnnc.h
+FILE 94 f:\dd\vctools\crt_bld\self_x86\crt\src\ctype.h
+FILE 96 f:\dd\public\sdk\inc\winnls.h
+FILE 98 f:\dd\vctools\crt_bld\self_x86\crt\src\mtdll.h
+FILE 99 f:\dd\vctools\crt_bld\self_x86\crt\src\crtdefs.h
+FILE 100 f:\dd\vctools\crt_bld\self_x86\crt\src\sal.h
+FILE 101 f:\dd\vctools\crt_bld\self_x86\crt\src\codeanalysis\sourceannotations.h
+FILE 102 f:\dd\public\sdk\inc\winver.h
+FILE 103 f:\dd\public\sdk\inc\verrsrc.h
+FILE 104 f:\dd\public\sdk\inc\wincon.h
+FILE 105 f:\dd\public\sdk\inc\stralign.h
+FILE 107 f:\dd\public\sdk\inc\mcx.h
+FILE 108 f:\dd\vctools\crt_bld\self_x86\crt\src\atox.c
+FILE 109 f:\dd\vctools\crt_bld\self_x86\crt\src\limits.h
+FILE 110 f:\dd\public\sdk\inc\windows.h
+FILE 111 f:\dd\vctools\crt_bld\self_x86\crt\src\setlocal.h
+FILE 112 f:\dd\public\sdk\inc\sdkddkver.h
+FILE 113 f:\dd\vctools\crt_bld\self_x86\crt\src\oscalls.h
+FILE 114 f:\dd\vctools\crt_bld\self_x86\crt\src\excpt.h
+FILE 120 f:\dd\public\sdk\inc\reason.h
+FILE 123 f:\dd\public\sdk\inc\kernelspecs.h
+FILE 125 f:\dd\vctools\crt_bld\self_x86\crt\src\tchar.h
+FILE 126 f:\dd\vctools\crt_bld\self_x86\crt\src\mbstring.h
+FILE 127 f:\dd\vctools\crt_bld\self_x86\crt\src\mbctype.h
+FILE 128 f:\dd\public\sdk\inc\ime_cmodes.h
+FILE 130 f:\dd\vctools\crt_bld\self_x86\crt\src\vadefs.h
+FILE 131 f:\dd\vctools\crt_bld\self_x86\crt\src\cruntime.h
+FILE 132 f:\dd\public\sdk\inc\tvout.h
+FILE 145 f:\dd\vctools\crt_bld\self_x86\crt\src\internal_securecrt.h
+FILE 152 f:\dd\vctools\crt_bld\self_x86\crt\src\internal.h
+FILE 164 f:\dd\vctools\crt_bld\self_x86\crt\src\crtdbg.h
+FILE 165 f:\dd\vctools\crt_bld\self_x86\crt\src\xtoa.c
+FILE 178 f:\dd\vctools\crt_bld\self_x86\crt\src\xtoas.c
+FILE 182 f:\dd\vctools\crt_bld\self_x86\crt\src\errno.h
+FILE 224 f:\dd\vctools\crt_bld\self_x86\crt\src\dosmap.c
+FILE 250 f:\dd\vctools\crt_bld\self_x86\crt\src\rtcsup.h
+FILE 251 f:\dd\vctools\crt_bld\self_x86\crt\src\rtcapi.h
+FILE 265 f:\dd\vctools\crt_bld\self_x86\crt\src\winheap.h
+FILE 281 f:\dd\vctools\crt_bld\self_x86\crt\src\malloc.h
+FILE 291 f:\dd\vctools\crt_bld\self_x86\crt\src\calloc_impl.c
+FILE 299 f:\dd\vctools\crt_bld\self_x86\crt\src\dbgint.h
+FILE 333 f:\dd\vctools\crt_bld\self_x86\crt\src\crtheap.c
+FILE 389 f:\dd\vctools\crt_bld\self_x86\crt\src\free.c
+FILE 453 f:\dd\vctools\crt_bld\self_x86\crt\src\heapinit.c
+FILE 498 f:\dd\vctools\crt_bld\self_x86\crt\src\rterr.h
+FILE 504 f:\dd\vctools\crt_bld\self_x86\crt\src\malloc.c
+FILE 561 f:\dd\vctools\crt_bld\self_x86\crt\src\msize.c
+FILE 618 f:\dd\vctools\crt_bld\self_x86\crt\src\realloc.c
+FILE 677 f:\dd\vctools\crt_bld\self_x86\crt\src\recalloc.c
+FILE 731 f:\dd\vctools\crt_bld\self_x86\crt\src\_newmode.c
+FILE 774 f:\dd\vctools\crt_bld\self_x86\crt\src\msdos.h
+FILE 777 f:\dd\vctools\crt_bld\self_x86\crt\src\stddef.h
+FILE 792 f:\dd\vctools\crt_bld\self_x86\crt\src\ioinit.c
+FILE 844 f:\dd\vctools\crt_bld\self_x86\crt\src\intel\loadcfg.c
+FILE 892 f:\dd\vctools\crt_bld\self_x86\crt\src\intel\secchk.c
+FILE 904 f:\dd\vctools\crt_bld\self_x86\crt\src\process.h
+FILE 943 f:\dd\vctools\crt_bld\self_x86\crt\src\a_env.c
+FILE 960 f:\dd\vctools\crt_bld\self_x86\crt\src\awint.h
+FILE 975 f:\dd\vctools\crt_bld\self_x86\crt\src\signal.h
+FILE 1011 f:\dd\vctools\crt_bld\self_x86\crt\src\abort.c
+FILE 1039 f:\dd\vctools\crt_bld\self_x86\crt\src\swprintf.inl
+FILE 1053 f:\dd\vctools\crt_bld\self_x86\crt\src\crtmbox.c
+FILE 1063 f:\dd\vctools\crt_bld\self_x86\crt\src\crtmboxw.c
+FILE 1065 f:\dd\vctools\crt_bld\self_x86\crt\src\wchar.h
+FILE 1069 f:\dd\vctools\crt_bld\self_x86\crt\src\wtime.inl
+FILE 1120 f:\dd\vctools\crt_bld\self_x86\crt\src\ctype.c
+FILE 1145 f:\dd\vctools\crt_bld\self_x86\crt\src\dbghook.c
+FILE 1181 f:\dd\vctools\crt_bld\self_x86\crt\src\errmode.c
+FILE 1244 f:\dd\vctools\crt_bld\self_x86\crt\src\getqloc.c
+FILE 1288 f:\dd\vctools\crt_bld\self_x86\crt\src\locale.h
+FILE 1301 f:\dd\vctools\crt_bld\self_x86\crt\src\glstatus.c
+FILE 1344 f:\dd\vctools\crt_bld\self_x86\crt\src\gs_cookie.c
+FILE 1392 f:\dd\vctools\crt_bld\self_x86\crt\src\gs_report.c
+FILE 1413 f:\binaries.x86ret\inc\mm3dnow.h
+FILE 1415 f:\binaries.x86ret\inc\ammintrin.h
+FILE 1424 f:\binaries.x86ret\inc\immintrin.h
+FILE 1426 f:\binaries.x86ret\inc\wmmintrin.h
+FILE 1427 f:\binaries.x86ret\inc\nmmintrin.h
+FILE 1428 f:\binaries.x86ret\inc\smmintrin.h
+FILE 1429 f:\binaries.x86ret\inc\tmmintrin.h
+FILE 1430 f:\binaries.x86ret\inc\pmmintrin.h
+FILE 1431 f:\binaries.x86ret\inc\emmintrin.h
+FILE 1432 f:\binaries.x86ret\inc\xmmintrin.h
+FILE 1433 f:\binaries.x86ret\inc\mmintrin.h
+FILE 1455 f:\dd\vctools\crt_bld\self_x86\crt\src\gs_support.c
+FILE 1467 f:\dd\vctools\crt_bld\self_x86\crt\src\intrin.h
+FILE 1468 f:\dd\vctools\crt_bld\self_x86\crt\src\setjmp.h
+FILE 1508 f:\dd\vctools\crt_bld\self_x86\crt\src\initcoll.c
+FILE 1568 f:\dd\vctools\crt_bld\self_x86\crt\src\initctyp.c
+FILE 1627 f:\dd\vctools\crt_bld\self_x86\crt\src\inithelp.c
+FILE 1685 f:\dd\vctools\crt_bld\self_x86\crt\src\initmon.c
+FILE 1737 f:\dd\vctools\crt_bld\self_x86\crt\src\nlsint.h
+FILE 1742 f:\dd\vctools\crt_bld\self_x86\crt\src\initnum.c
+FILE 1800 f:\dd\vctools\crt_bld\self_x86\crt\src\inittime.c
+FILE 1855 f:\dd\vctools\crt_bld\self_x86\crt\src\lconv.c
+FILE 1913 f:\dd\vctools\crt_bld\self_x86\crt\src\localref.c
+FILE 1962 f:\dd\vctools\crt_bld\self_x86\crt\src\sect_attribs.h
+FILE 1969 f:\dd\vctools\crt_bld\self_x86\crt\src\onexit.c
+FILE 1989 f:\dd\vctools\crt_bld\self_x86\crt\src\nlsdata1.c
+FILE 2036 f:\dd\vctools\crt_bld\self_x86\crt\src\nlsdata2.c
+FILE 2079 f:\dd\vctools\crt_bld\self_x86\crt\src\pesect.c
+FILE 2128 f:\dd\vctools\crt_bld\self_x86\crt\src\purevirt.c
+FILE 2186 f:\dd\vctools\crt_bld\self_x86\crt\src\rand_s.c
+FILE 2250 f:\dd\vctools\crt_bld\self_x86\crt\src\setlocal.c
+FILE 2311 f:\dd\vctools\crt_bld\self_x86\crt\src\winsig.c
+FILE 2314 f:\dd\vctools\crt_bld\self_x86\crt\src\float.h
+FILE 2315 f:\dd\vctools\crt_bld\self_x86\crt\src\crtwrn.h
+FILE 2369 f:\dd\vctools\crt_bld\self_x86\crt\src\winxfltr.c
+FILE 2394 f:\dd\vctools\crt_bld\self_x86\crt\src\fltintrn.h
+FILE 2419 f:\dd\vctools\crt_bld\self_x86\crt\src\cmiscdat.c
+FILE 2445 f:\dd\vctools\crt_bld\self_x86\crt\src\intel\strncmp.c
+FILE 2468 f:\dd\vctools\crt_bld\self_x86\crt\src\tcscat_s.inl
+FILE 2493 f:\dd\vctools\crt_bld\self_x86\crt\src\strcat_s.c
+FILE 2523 f:\dd\vctools\crt_bld\self_x86\crt\src\tcscpy_s.inl
+FILE 2548 f:\dd\vctools\crt_bld\self_x86\crt\src\strcpy_s.c
+FILE 2578 f:\dd\vctools\crt_bld\self_x86\crt\src\tcsncpy_s.inl
+FILE 2603 f:\dd\vctools\crt_bld\self_x86\crt\src\strncpy_s.c
+FILE 2658 f:\dd\vctools\crt_bld\self_x86\crt\src\wcscat_s.c
+FILE 2713 f:\dd\vctools\crt_bld\self_x86\crt\src\wcscpy_s.c
+FILE 2728 f:\dd\vctools\crt_bld\self_x86\crt\src\wcslen.c
+FILE 2776 f:\dd\vctools\crt_bld\self_x86\crt\src\wcsncpy_s.c
+FILE 2787 f:\dd\vctools\crt_bld\SELF_X86\crt\src\INTEL\memcpy.asm
+FILE 2788 f:\dd\vctools\crt_bld\SELF_X86\crt\src\cruntime.inc
+FILE 2789 f:\dd\vctools\crt_bld\SELF_X86\crt\src\INTEL\memset.asm
+FILE 2791 f:\dd\vctools\crt_bld\SELF_X86\crt\src\INTEL\strcmp.asm
+FILE 2793 f:\dd\vctools\crt_bld\SELF_X86\crt\src\INTEL\strcspn.asm
+FILE 2794 f:\dd\vctools\crt_bld\SELF_X86\crt\src\Intel\STRSPN.ASM
+FILE 2796 f:\dd\vctools\crt_bld\SELF_X86\crt\src\INTEL\strlen.asm
+FILE 2798 f:\dd\vctools\crt_bld\SELF_X86\crt\src\INTEL\_strnicm.asm
+FILE 2800 f:\dd\vctools\crt_bld\SELF_X86\crt\src\INTEL\strpbrk.asm
+FILE 2803 f:\dd\vctools\crt_bld\SELF_X86\crt\src\INTEL\llmul.asm
+FILE 2805 f:\dd\vctools\crt_bld\SELF_X86\crt\src\mm.inc
+FILE 2806 f:\dd\vctools\crt_bld\SELF_X86\crt\src\INTEL\ulldvrm.asm
+FILE 2820 f:\dd\vctools\crt_bld\self_x86\crt\src\handler.cpp
+FILE 2841 f:\dd\vctools\crt_bld\self_x86\crt\src\new.h
+FILE 2875 f:\dd\vctools\crt_bld\self_x86\crt\src\delete.cpp
+FILE 2931 f:\dd\vctools\crt_bld\self_x86\crt\src\_wctype.c
+FILE 2987 f:\dd\vctools\crt_bld\self_x86\crt\src\iswctype.c
+FILE 2998 f:\dd\vctools\crt_bld\self_x86\crt\src\stdio.h
+FILE 3045 f:\dd\vctools\crt_bld\self_x86\crt\src\isctype.c
+FILE 3106 f:\dd\vctools\crt_bld\self_x86\crt\src\strtol.c
+FILE 3163 f:\dd\vctools\crt_bld\self_x86\crt\src\strtoq.c
+FILE 3218 f:\dd\vctools\crt_bld\self_x86\crt\src\tolower.c
+FILE 3271 f:\dd\vctools\crt_bld\self_x86\crt\src\ismbbyte.c
+FILE 3305 f:\dd\vctools\crt_bld\self_x86\crt\src\mbdata.h
+FILE 3326 f:\dd\vctools\crt_bld\self_x86\crt\src\mbctype.c
+FILE 3386 f:\dd\vctools\crt_bld\self_x86\crt\src\a_loc.c
+FILE 3447 f:\dd\vctools\crt_bld\self_x86\crt\src\a_map.c
+FILE 3507 f:\dd\vctools\crt_bld\self_x86\crt\src\a_str.c
+FILE 3583 f:\dd\vctools\crt_bld\self_x86\crt\src\invarg.c
+FILE 3626 f:\dd\vctools\crt_bld\self_x86\crt\src\stricmp.c
+FILE 3682 f:\dd\vctools\crt_bld\self_x86\crt\src\strnicmp.c
+FILE 3774 f:\dd\vctools\crt_bld\self_x86\crt\src\tidtable.c
+FILE 3778 f:\dd\vctools\crt_bld\self_x86\crt\src\memory.h
+FILE 3838 f:\dd\vctools\crt_bld\self_x86\crt\src\stdenvp.c
+FILE 3860 f:\dd\vctools\crt_bld\self_x86\crt\src\dos.h
+FILE 3891 f:\dd\vctools\crt_bld\self_x86\crt\src\stdargv.c
+FILE 3954 f:\dd\vctools\crt_bld\self_x86\crt\src\mlock.c
+FILE 3998 f:\dd\vctools\crt_bld\self_x86\crt\src\cmsgs.h
+FILE 4012 f:\dd\vctools\crt_bld\self_x86\crt\src\crt0msg.c
+FILE 4072 f:\dd\vctools\crt_bld\self_x86\crt\src\crt0init.c
+FILE 4123 f:\dd\vctools\crt_bld\self_x86\crt\src\crt0fp.c
+FILE 4186 f:\dd\vctools\crt_bld\self_x86\crt\src\crt0dat.c
+FILE 4250 f:\dd\vctools\crt_bld\self_x86\crt\src\crt0.c
+FILE 4274 f:\dd\vctools\crt_bld\SELF_X86\crt\src\INTEL\alloca16.asm
+FILE 4276 f:\dd\vctools\crt_bld\SELF_X86\crt\src\INTEL\chkstk.asm
+FILE 4289 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\h\errno.h
+FILE 4293 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\h\internal.h
+FILE 4294 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\h\limits.h
+FILE 4295 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\h\mtdll.h
+FILE 4309 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\h\sect_attribs.h
+FILE 4315 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\tran\i386\cpu_disp.c
+FILE 4327 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\h\crtdbg.h
+FILE 4340 f:\dd\vctools\langapi\undname\undname.cxx
+FILE 4345 f:\dd\vctools\langapi\undname\undname.inl
+FILE 4347 f:\dd\vctools\langapi\undname\utf8.h
+FILE 4355 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\h\swprintf.inl
+FILE 4365 f:\dd\vctools\langapi\undname\undname.hxx
+FILE 4366 f:\dd\vctools\langapi\undname\undname.h
+FILE 4367 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\h\stdlib.h
+FILE 4368 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\h\stdio.h
+FILE 4396 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\h\eh.h
+FILE 4397 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\eh\unhandld.cpp
+FILE 4401 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\h\ehhooks.h
+FILE 4405 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\h\ehassert.h
+FILE 4427 f:\dd\vctools\langapi\include\ehdata.h
+FILE 4429 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\h\stddef.h
+FILE 4449 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\stdhpp\exception
+FILE 4472 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\h\malloc.h
+FILE 4473 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\eh\typname.cpp
+FILE 4475 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\stdhpp\cstddef
+FILE 4487 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\h\typeinfo.h
+FILE 4488 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\stdhpp\typeinfo
+FILE 4490 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\stdhpp\xstddef
+FILE 4491 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\stdhpp\yvals.h
+FILE 4492 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\stdhpp\use_ansi.h
+FILE 4493 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\h\dbgint.h
+FILE 4496 f:\dd\public\internal\vctools\include\undname.h
+FILE 4531 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\eh\typinfo.cpp
+FILE 4591 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\eh\hooks.cpp
+FILE 4643 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\rtc\initsect.cpp
+FILE 4664 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\h\rtcapi.h
+FILE 4680 f:\dd\vctools\crt_bld\self_x86\crt\prebuild\h\rtcpriv.h
+FUNC 1000 54 0 main
+1000 6 57 1
+1006 8 58 1
+100e e 59 1
+101c 8 60 1
+1024 b 61 1
+102f f 62 1
+103e 12 64 1
+1050 4 65 1
+FUNC 1060 a 0 static int google_breakpad::i()
+1060 3 51 1
+1063 5 52 1
+1068 2 53 1
+FUNC 1070 21 0 google_breakpad::C::C()
+1070 21 37 1
+FUNC 10a0 14 0 google_breakpad::C::~C()
+10a0 14 38 1
+FUNC 10c0 16 0 google_breakpad::C::set_member(int)
+10c0 16 40 1
+FUNC 10e0 1e 0 google_breakpad::C::f()
+10e0 1e 43 1
+FUNC 1100 10 0 google_breakpad::C::g()
+1100 10 44 1
+FUNC 1110 7 0 google_breakpad::C::h(google_breakpad::C const &)
+1110 7 45 1
+FUNC 1120 2c 0 google_breakpad::C::`scalar deleting destructor'(unsigned int)
+FUNC 114c 10 0 type_info::~type_info()
+114c 2 49 4531
+114e d 50 4531
+115b 1 51 4531
+FUNC 115c 21 0 type_info::`scalar deleting destructor'(unsigned int)
+FUNC 117d b 0 operator delete(void *)
+117d 5 20 2875
+1182 1 24 2875
+1183 5 23 2875
+FUNC 1188 29 0 static void fast_error_exit(int)
+1188 5 326 4250
+118d 9 335 4250
+1196 5 337 4250
+119b 8 339 4250
+11a3 c 340 4250
+11af 2 341 4250
+FUNC 11b1 161 0 static int __tmainCRTStartup()
+11b1 c 196 4250
+11bd a 214 4250
+11c7 b 216 4250
+11d2 49 223 4250
+121b 9 225 4250
+1224 8 226 4250
+122c 9 228 4250
+1235 8 229 4250
+123d 5 238 4250
+1242 3 246 4250
+1245 9 248 4250
+124e 8 249 4250
+1256 b 252 4250
+1261 a 255 4250
+126b 9 257 4250
+1274 8 258 4250
+127c 9 259 4250
+1285 8 260 4250
+128d 8 262 4250
+1295 4 263 4250
+1299 7 264 4250
+12a0 a 277 4250
+12aa 18 278 4250
+12c2 5 281 4250
+12c7 6 282 4250
+12cd 5 284 4250
+12d2 2 286 4250
+12d4 17 287 4250
+12eb 6 293 4250
+12f1 6 295 4250
+12f7 6 296 4250
+12fd 5 298 4250
+1302 7 300 4250
+1309 3 302 4250
+130c 6 303 4250
+FUNC 1312 a 0 mainCRTStartup
+1312 0 179 4250
+1312 5 186 4250
+1317 5 188 4250
+FUNC 131c 70 0 type_info::_Type_info_dtor(type_info *)
+131c c 62 4473
+1328 8 63 4473
+1330 4 64 4473
+1334 a 65 4473
+133e d 70 4473
+134b 4 72 4473
+134f 4 74 4473
+1353 6 79 4473
+1359 7 80 4473
+1360 9 94 4473
+1369 4 101 4473
+136d c 103 4473
+1379 6 107 4473
+137f 2 83 4473
+1381 2 72 4473
+1383 9 104 4473
+FUNC 1390 88 0 strcmp
+1390 0 65 2791
+1390 4 73 2791
+1394 4 74 2791
+1398 6 76 2791
+139e 2 77 2791
+13a0 2 81 2791
+13a2 2 83 2791
+13a4 2 84 2791
+13a6 2 85 2791
+13a8 2 86 2791
+13aa 3 87 2791
+13ad 2 88 2791
+13af 2 89 2791
+13b1 2 90 2791
+13b3 3 92 2791
+13b6 3 94 2791
+13b9 2 95 2791
+13bb 2 96 2791
+13bd 2 97 2791
+13bf 3 98 2791
+13c2 2 99 2791
+13c4 3 100 2791
+13c7 3 101 2791
+13ca 2 102 2791
+13cc 4 103 2791
+13d0 2 107 2791
+13d2 2 108 2791
+13d4 2 115 2791
+13d6 2 116 2791
+13d8 3 117 2791
+13db 1 118 2791
+13dc 6 122 2791
+13e2 2 123 2791
+13e4 2 125 2791
+13e6 3 126 2791
+13e9 2 127 2791
+13eb 2 128 2791
+13ed 3 129 2791
+13f0 2 130 2791
+13f2 2 131 2791
+13f4 6 133 2791
+13fa 2 134 2791
+13fc 3 139 2791
+13ff 3 140 2791
+1402 2 141 2791
+1404 2 142 2791
+1406 2 143 2791
+1408 2 144 2791
+140a 3 145 2791
+140d 2 146 2791
+140f 2 147 2791
+1411 2 148 2791
+1413 3 149 2791
+1416 2 150 2791
+FUNC 1418 3a 0 free
+1418 5 40 389
+141d 6 45 389
+1423 11 50 389
+1434 4 51 389
+1438 18 53 389
+1450 2 55 389
+FUNC 1452 42 0 __CxxUnhandledExceptionFilter(_EXCEPTION_POINTERS *)
+1452 5 67 4397
+1457 32 68 4397
+1489 5 69 4397
+148e 2 72 4397
+1490 4 73 4397
+FUNC 1494 e 0 __CxxSetUnhandledExceptionFilter
+1494 0 86 4397
+1494 b 89 4397
+149f 2 90 4397
+14a1 1 91 4397
+FUNC 14a2 2b 0 __crtCorExitProcess
+14a2 5 675 4186
+14a7 b 679 4186
+14b2 4 680 4186
+14b6 c 681 4186
+14c2 4 682 4186
+14c6 5 683 4186
+14cb 2 693 4186
+FUNC 14cd 18 0 __crtExitProcess
+14cd 5 698 4186
+14d2 9 699 4186
+14db a 708 4186
+FUNC 14e5 9 0 _lockexit
+14e5 0 758 4186
+14e5 8 759 4186
+14ed 1 760 4186
+FUNC 14ee 9 0 _unlockexit
+14ee 0 784 4186
+14ee 8 785 4186
+14f6 1 786 4186
+FUNC 14f7 33 0 _init_pointers
+14f7 3 809 4186
+14fa 7 810 4186
+1501 6 812 4186
+1507 6 813 4186
+150d 6 814 4186
+1513 6 815 4186
+1519 6 816 4186
+151f a 817 4186
+1529 1 818 4186
+FUNC 152a 24 0 _initterm_e
+152a 6 908 4186
+1530 b 917 4186
+153b 6 922 4186
+1541 2 923 4186
+1543 3 924 4186
+1546 6 917 4186
+154c 2 928 4186
+FUNC 154e 97 0 _cinit
+154e 5 258 4186
+1553 18 268 4186
+156b a 270 4186
+1575 5 272 4186
+157a 11 278 4186
+158b 2 279 4186
+158d 2 280 4186
+158f c 283 4186
+159b 20 288 4186
+15bb 1a 301 4186
+15d5 c 303 4186
+15e1 2 307 4186
+15e3 2 308 4186
+FUNC 15e5 140 0 static void doexit(int, int, int)
+15e5 c 489 4186
+15f1 8 507 4186
+15f9 4 508 4186
+15fd f 510 4186
+160c 5 511 4186
+1611 8 514 4186
+1619 a 516 4186
+1623 13 532 4186
+1636 4 533 4186
+163a d 534 4186
+1647 3 538 4186
+164a 3 539 4186
+164d 11 547 4186
+165e 2 550 4186
+1660 4 552 4186
+1664 6 559 4186
+166a 7 562 4186
+1671 2 565 4186
+1673 a 567 4186
+167d 8 568 4186
+1685 a 570 4186
+168f 6 573 4186
+1695 8 574 4186
+169d 5 576 4186
+16a2 21 582 4186
+16c3 21 590 4186
+16e4 c 608 4186
+16f0 6 613 4186
+16f6 a 617 4186
+1700 8 619 4186
+1708 8 621 4186
+1710 6 609 4186
+1716 9 610 4186
+171f 6 622 4186
+FUNC 1725 16 0 exit
+1725 5 392 4186
+172a f 393 4186
+1739 2 394 4186
+FUNC 173b 16 0 _exit
+173b 5 400 4186
+1740 f 401 4186
+174f 2 402 4186
+FUNC 1751 f 0 _cexit
+1751 0 407 4186
+1751 e 408 4186
+175f 1 409 4186
+FUNC 1760 f 0 _c_exit
+1760 0 414 4186
+1760 e 415 4186
+176e 1 416 4186
+FUNC 176f 1e 0 _amsg_exit
+176f 5 439 4186
+1774 5 440 4186
+1779 9 441 4186
+1782 b 442 4186
+FUNC 178d 26 0 _GET_RTERRMSG
+178d 5 165 4012
+1792 2 168 4012
+1794 c 169 4012
+17a0 6 168 4012
+17a6 2 172 4012
+17a8 2 173 4012
+17aa 7 170 4012
+17b1 2 173 4012
+FUNC 17b3 1af 0 _NMSG_WRITE
+17b3 1b 196 4012
+17ce 8 197 4012
+17d6 11 199 4012
+17e7 2a 226 4012
+1811 c 263 4012
+181d 20 272 4012
+183d 21 275 4012
+185e 1f 276 4012
+187d d 279 4012
+188a d 281 4012
+1897 1d 282 4012
+18b4 18 285 4012
+18cc 14 286 4012
+18e0 15 290 4012
+18f5 a 272 4012
+18ff a 228 4012
+1909 9 229 4012
+1912 2 244 4012
+1914 a 246 4012
+191e 6 248 4012
+1924 8 244 4012
+192c 27 260 4012
+1953 f 294 4012
+FUNC 1962 39 0 _FF_MSGBANNER
+1962 0 134 4012
+1962 22 138 4012
+1984 a 140 4012
+198e c 141 4012
+199a 1 143 4012
+FUNC 199b 14a 0 _XcptFilter
+199b 6 195 2369
+19a1 7 202 2369
+19a8 8 203 2369
+19b0 2a 208 2369
+19da 4 210 2369
+19de 3 216 2369
+19e1 4 223 2369
+19e5 7 224 2369
+19ec 5 232 2369
+19f1 4 237 2369
+19f5 8 238 2369
+19fd 3 244 2369
+1a00 6 248 2369
+1a06 a 263 2369
+1a10 c 272 2369
+1a1c 3 280 2369
+1a1f 13 283 2369
+1a32 c 310 2369
+1a3e 9 312 2369
+1a47 7 314 2369
+1a4e 9 316 2369
+1a57 7 318 2369
+1a5e 9 320 2369
+1a67 7 322 2369
+1a6e 9 324 2369
+1a77 7 326 2369
+1a7e 9 328 2369
+1a87 7 330 2369
+1a8e 9 332 2369
+1a97 7 334 2369
+1a9e 9 336 2369
+1aa7 7 338 2369
+1aae 9 340 2369
+1ab7 7 342 2369
+1abe 7 344 2369
+1ac5 8 353 2369
+1acd 3 358 2369
+1ad0 2 360 2369
+1ad2 4 365 2369
+1ad6 4 366 2369
+1ada 4 372 2369
+1ade 5 374 2369
+1ae3 2 376 2369
+FUNC 1ae5 dc 0 _setenvp
+1ae5 0 77 3838
+1ae5 9 85 3838
+1aee 6 86 3838
+1af4 9 91 3838
+1afd 4 98 3838
+1b01 8 99 3838
+1b09 4 110 3838
+1b0d 1 111 3838
+1b0e b 112 3838
+1b19 6 108 3838
+1b1f 15 117 3838
+1b34 2 118 3838
+1b36 9 121 3838
+1b3f 6 123 3838
+1b45 9 125 3838
+1b4e 10 127 3838
+1b5e f 133 3838
+1b6d 3 134 3838
+1b70 7 121 3838
+1b77 b 138 3838
+1b82 7 139 3838
+1b89 3 142 3838
+1b8c a 149 3838
+1b96 2 152 3838
+1b98 2 138 3838
+1b9a 3 153 3838
+1b9d b 129 3838
+1ba8 7 130 3838
+1baf 5 131 3838
+1bb4 d 133 3838
+FUNC 1bc1 19a 0 static void parse_cmdline(char *, char * *, char *, int *, int *)
+1bc1 6 221 3891
+1bc7 9 229 3891
+1bd0 2 232 3891
+1bd2 17 234 3891
+1be9 3 253 3891
+1bec 5 255 3891
+1bf1 5 257 3891
+1bf6 9 258 3891
+1bff 2 259 3891
+1c01 2 261 3891
+1c03 4 262 3891
+1c07 8 263 3891
+1c0f 2 265 3891
+1c11 f 267 3891
+1c20 2 268 3891
+1c22 6 269 3891
+1c28 a 270 3891
+1c32 1 271 3891
+1c33 1a 275 3891
+1c4d 4 280 3891
+1c51 4 281 3891
+1c55 4 284 3891
+1c59 9 289 3891
+1c62 a 290 3891
+1c6c 3 291 3891
+1c6f 1 278 3891
+1c70 2 279 3891
+1c72 9 294 3891
+1c7b 6 298 3891
+1c81 9 299 3891
+1c8a 2 300 3891
+1c8c 3 314 3891
+1c8f 4 318 3891
+1c93 1 321 3891
+1c94 1 322 3891
+1c95 5 319 3891
+1c9a 5 324 3891
+1c9f 5 327 3891
+1ca4 e 328 3891
+1cb2 2 329 3891
+1cb4 2 330 3891
+1cb6 d 332 3891
+1cc3 2 335 3891
+1cc5 5 339 3891
+1cca 4 340 3891
+1cce 4 341 3891
+1cd2 6 342 3891
+1cd8 3 341 3891
+1cdb 14 346 3891
+1cef 4 351 3891
+1cf3 12 353 3891
+1d05 b 354 3891
+1d10 2 355 3891
+1d12 a 357 3891
+1d1c 2 358 3891
+1d1e a 359 3891
+1d28 1 360 3891
+1d29 2 361 3891
+1d2b 5 364 3891
+1d30 1 366 3891
+1d31 5 375 3891
+1d36 4 379 3891
+1d3a 7 380 3891
+1d41 2 381 3891
+1d43 8 382 3891
+1d4b 9 385 3891
+1d54 3 386 3891
+1d57 2 387 3891
+1d59 2 388 3891
+FUNC 1d5b bb 0 _setargv
+1d5b 9 88 3891
+1d64 c 97 3891
+1d70 5 98 3891
+1d75 18 104 3891
+1d8d 19 120 3891
+1da6 11 127 3891
+1db7 15 134 3891
+1dcc a 138 3891
+1dd6 2 140 3891
+1dd8 9 142 3891
+1de1 2 143 3891
+1de3 2 144 3891
+1de5 13 151 3891
+1df8 c 156 3891
+1e04 6 160 3891
+1e0a 4 175 3891
+1e0e 6 136 3891
+1e14 2 176 3891
+FUNC 1e16 97 0 __crtGetEnvironmentStringsA
+1e16 a 40 943
+1e20 e 49 943
+1e2e 4 50 943
+1e32 5 54 943
+1e37 8 55 943
+1e3f 9 56 943
+1e48 1b 70 943
+1e63 12 74 943
+1e75 12 88 943
+1e87 9 90 943
+1e90 3 91 943
+1e93 7 94 943
+1e9a 5 95 943
+1e9f 7 76 943
+1ea6 5 77 943
+1eab 2 96 943
+FUNC 1ead 245 0 _ioinit
+1ead 9 111 792
+1eb6 a 122 792
+1ec0 13 129 792
+1ed3 8 131 792
+1edb 15 137 792
+1ef0 3 134 792
+1ef3 a 139 792
+1efd 3 141 792
+1f00 6 143 792
+1f06 4 145 792
+1f0a 3 146 792
+1f0d 1b 147 792
+1f28 15 155 792
+1f3d 2 160 792
+1f3f 6 166 792
+1f45 2 167 792
+1f47 e 173 792
+1f55 d 179 792
+1f62 f 185 792
+1f71 7 199 792
+1f78 c 201 792
+1f84 3 198 792
+1f87 4 203 792
+1f8b 4 205 792
+1f8f 4 206 792
+1f93 10 209 792
+1fa3 12 210 792
+1fb5 b 179 792
+1fc0 2 280 792
+1fc2 6 191 792
+1fc8 6 217 792
+1fce 29 230 792
+1ff7 14 232 792
+200b 7 233 792
+2012 8 234 792
+201a 17 237 792
+2031 3 239 792
+2034 c 217 792
+2040 2 249 792
+2042 b 251 792
+204d c 254 792
+2059 6 302 792
+205f 4 258 792
+2063 30 262 792
+2093 c 273 792
+209f 6 274 792
+20a5 5 275 792
+20aa 4 276 792
+20ae 13 280 792
+20c1 3 282 792
+20c4 2 284 792
+20c6 4 293 792
+20ca 6 294 792
+20d0 a 249 792
+20da c 309 792
+20e6 5 311 792
+20eb 2 312 792
+20ed 5 281 792
+FUNC 20f2 26 0 _RTC_Initialize
+FUNC 2118 26 0 _RTC_Terminate
+FUNC 213e 9 0 _encoded_null
+213e 0 79 3774
+213e 8 80 3774
+2146 1 81 3774
+FUNC 2147 9 4 __crtTlsAlloc
+2147 0 95 3774
+2147 6 96 3774
+214d 3 97 3774
+FUNC 2150 34 0 __set_flsgetvalue
+2150 3 143 3774
+2153 e 145 3774
+2161 4 146 3774
+2165 e 148 3774
+2173 d 149 3774
+2180 3 151 3774
+2183 1 155 3774
+FUNC 2184 3d 0 _mtterm
+2184 0 329 3774
+2184 a 336 3774
+218e f 337 3774
+219d 7 338 3774
+21a4 a 342 3774
+21ae 7 343 3774
+21b5 7 344 3774
+21bc 5 352 3774
+FUNC 21c1 b4 0 _initptd
+21c1 c 379 3774
+21cd b 381 3774
+21d8 a 384 3774
+21e2 4 385 3774
+21e6 6 386 3774
+21ec 3 391 3774
+21ef 7 395 3774
+21f6 7 396 3774
+21fd 7 397 3774
+2204 8 399 3774
+220c 4 400 3774
+2210 9 402 3774
+2219 c 404 3774
+2225 8 411 3774
+222d 3 412 3774
+2230 6 413 3774
+2236 4 421 3774
+223a 8 422 3774
+2242 9 423 3774
+224b c 425 3774
+2257 6 428 3774
+225d 6 404 3774
+2263 9 406 3774
+226c 9 426 3774
+FUNC 2275 79 0 _getptd_noexit
+2275 4 448 3774
+2279 6 452 3774
+227f 15 460 3774
+2294 14 472 3774
+22a8 19 475 3774
+22c1 a 481 3774
+22cb 6 483 3774
+22d1 6 484 3774
+22d7 2 486 3774
+22d9 7 492 3774
+22e0 2 493 3774
+22e2 8 498 3774
+22ea 3 500 3774
+22ed 1 501 3774
+FUNC 22ee 1a 0 _getptd
+22ee 3 522 3774
+22f1 7 523 3774
+22f8 4 524 3774
+22fc 8 525 3774
+2304 3 527 3774
+2307 1 528 3774
+FUNC 2308 12f 4 _freefls
+2308 c 556 3774
+2314 b 567 3774
+231f 7 568 3774
+2326 7 569 3774
+232d 7 571 3774
+2334 7 572 3774
+233b 7 574 3774
+2342 7 575 3774
+2349 7 577 3774
+2350 7 578 3774
+2357 7 580 3774
+235e 7 581 3774
+2365 7 583 3774
+236c 7 584 3774
+2373 7 586 3774
+237a 7 587 3774
+2381 a 589 3774
+238b 7 590 3774
+2392 8 592 3774
+239a 4 593 3774
+239e 1a 596 3774
+23b8 7 597 3774
+23bf c 599 3774
+23cb 8 603 3774
+23d3 7 605 3774
+23da 7 606 3774
+23e1 7 608 3774
+23e8 15 611 3774
+23fd 7 612 3774
+2404 c 615 3774
+2410 7 619 3774
+2417 8 622 3774
+241f 3 599 3774
+2422 9 600 3774
+242b 3 615 3774
+242e 9 616 3774
+FUNC 2437 17b 0 _mtinit
+2437 3 203 3774
+243a d 211 3774
+2447 4 212 3774
+244b 5 213 3774
+2450 3 214 3774
+2453 2 300 3774
+2455 e 218 3774
+2463 d 221 3774
+2470 d 224 3774
+247d d 227 3774
+248a 2a 228 3774
+24b4 a 231 3774
+24be 1a 235 3774
+24d8 25 244 3774
+24fd 5 249 3774
+2502 e 256 3774
+2510 d 257 3774
+251d d 258 3774
+252a 12 259 3774
+253c 7 266 3774
+2543 2 268 3774
+2545 1d 274 3774
+2562 2 276 3774
+2564 29 284 3774
+258d a 294 3774
+2597 6 296 3774
+259d 6 297 3774
+25a3 5 299 3774
+25a8 5 286 3774
+25ad 4 245 3774
+25b1 1 300 3774
+FUNC 25b2 1e 0 _heap_init
+25b2 0 40 453
+25b2 1d 44 453
+25cf 1 60 453
+FUNC 25d0 45 0 _SEH_prolog4
+FUNC 2615 14 0 _SEH_epilog4
+FUNC 2630 18f 0 _except_handler4
+FUNC 27bf 9b 0 __security_init_cookie
+27bf 8 97 1455
+27c7 21 114 1455
+27e8 7 116 1455
+27ef 3 117 1455
+27f2 a 127 1455
+27fc 6 132 1455
+2802 8 135 1455
+280a 8 136 1455
+2812 8 137 1455
+281a a 139 1455
+2824 8 144 1455
+282c 4 161 1455
+2830 7 163 1455
+2837 4 166 1455
+283b c 168 1455
+2847 6 172 1455
+284d b 173 1455
+2858 2 175 1455
+FUNC 285a f 0 _initp_misc_invarg
+285a 5 64 3583
+285f 8 65 3583
+2867 2 66 3583
+FUNC 2869 129 0 _call_reportfault
+2869 16 164 3583
+287f 9 166 3583
+2888 7 167 3583
+288f 17 170 3583
+28a6 1b 172 3583
+28c1 6 179 3583
+28c7 6 180 3583
+28cd 6 181 3583
+28d3 6 182 3583
+28d9 6 183 3583
+28df 6 184 3583
+28e5 7 185 3583
+28ec 7 186 3583
+28f3 7 187 3583
+28fa 7 188 3583
+2901 7 189 3583
+2908 7 190 3583
+290f 1 191 3583
+2910 6 192 3583
+2916 3 198 3583
+2919 19 199 3583
+2932 9 201 3583
+293b 9 240 3583
+2944 9 241 3583
+294d 6 242 3583
+2953 6 245 3583
+2959 a 248 3583
+2963 d 250 3583
+2970 d 254 3583
+297d 7 255 3583
+2984 e 257 3583
+FUNC 2992 25 0 _invoke_watson
+2992 3 146 3583
+2995 12 155 3583
+29a7 f 156 3583
+29b6 1 157 3583
+FUNC 29b7 2d 0 _invalid_parameter
+29b7 5 96 3583
+29bc c 103 3583
+29c8 4 104 3583
+29cc 1 111 3583
+29cd 2 106 3583
+29cf 15 110 3583
+FUNC 29e4 10 0 _invalid_parameter_noinfo
+29e4 0 120 3583
+29e4 f 121 3583
+29f3 1 122 3583
+FUNC 29f4 4a 0 _mtinitlocks
+29f4 4 136 3954
+29f8 7 143 3954
+29ff a 144 3954
+2a09 9 145 3954
+2a12 14 147 3954
+2a26 6 143 3954
+2a2c 3 156 3954
+2a2f 3 157 3954
+2a32 c 150 3954
+FUNC 2a3e 57 0 _mtdeletelocks
+2a3e 3 187 3954
+2a41 d 193 3954
+2a4e c 195 3954
+2a5a 3 199 3954
+2a5d 6 205 3954
+2a63 4 206 3954
+2a67 b 193 3954
+2a72 6 214 3954
+2a78 c 216 3954
+2a84 3 220 3954
+2a87 b 214 3954
+2a92 3 223 3954
+FUNC 2a95 17 0 _unlock
+2a95 5 370 3954
+2a9a 10 374 3954
+2aaa 2 375 3954
+FUNC 2aac c2 0 _mtinitlocknum
+2aac c 258 3954
+2ab8 6 260 3954
+2abe a 268 3954
+2ac8 5 269 3954
+2acd 7 270 3954
+2ad4 c 271 3954
+2ae0 e 275 3954
+2aee 4 276 3954
+2af2 e 278 3954
+2b00 b 279 3954
+2b0b 4 280 3954
+2b0f 8 283 3954
+2b17 3 284 3954
+2b1a 4 286 3954
+2b1e 10 287 3954
+2b2e 7 288 3954
+2b35 b 289 3954
+2b40 3 290 3954
+2b43 2 291 3954
+2b45 2 292 3954
+2b47 2 295 3954
+2b49 7 296 3954
+2b50 c 299 3954
+2b5c 3 303 3954
+2b5f 6 304 3954
+2b65 9 300 3954
+FUNC 2b6e 33 0 _lock
+2b6e 5 332 3954
+2b73 10 337 3954
+2b83 b 339 3954
+2b8e 8 340 3954
+2b96 9 347 3954
+2b9f 2 348 3954
+FUNC 2ba1 5f 0 strcpy_s
+2ba1 5 13 2523
+2ba6 23 18 2523
+2bc9 b 19 2523
+2bd4 11 23 2523
+2be5 4 27 2523
+2be9 3 29 2523
+2bec e 30 2523
+2bfa 4 33 2523
+2bfe 2 34 2523
+FUNC 2c00 8b 0 strlen
+2c00 0 54 2796
+2c00 4 63 2796
+2c04 6 64 2796
+2c0a 2 65 2796
+2c0c 2 69 2796
+2c0e 3 70 2796
+2c11 2 71 2796
+2c13 2 72 2796
+2c15 6 73 2796
+2c1b 2 74 2796
+2c1d 13 76 2796
+2c30 2 81 2796
+2c32 5 82 2796
+2c37 2 83 2796
+2c39 3 84 2796
+2c3c 2 85 2796
+2c3e 3 86 2796
+2c41 5 87 2796
+2c46 2 88 2796
+2c48 3 90 2796
+2c4b 2 91 2796
+2c4d 2 92 2796
+2c4f 2 93 2796
+2c51 2 94 2796
+2c53 5 95 2796
+2c58 2 96 2796
+2c5a 5 97 2796
+2c5f 2 98 2796
+2c61 2 99 2796
+2c63 3 103 2796
+2c66 4 104 2796
+2c6a 2 105 2796
+2c6c 1 106 2796
+2c6d 3 108 2796
+2c70 4 109 2796
+2c74 2 110 2796
+2c76 1 111 2796
+2c77 3 113 2796
+2c7a 4 114 2796
+2c7e 2 115 2796
+2c80 1 116 2796
+2c81 3 118 2796
+2c84 4 119 2796
+2c88 2 120 2796
+2c8a 1 121 2796
+FUNC 2c8b 94 0 malloc
+2c8b 6 81 504
+2c91 a 85 504
+2c9b 3d 89 504
+2cd8 4 94 504
+2cdc b 98 504
+2ce7 b 105 504
+2cf2 2 109 504
+2cf4 7 100 504
+2cfb 7 119 504
+2d02 6 121 504
+2d08 7 111 504
+2d0f b 112 504
+2d1a 3 113 504
+2d1d 2 122 504
+FUNC 2d20 90 0 _local_unwind4
+FUNC 2db0 46 0 static void _unwind_handler4()
+FUNC 2df6 1c 4 _seh_longjmp_unwind4
+FUNC 2e12 17 0 _EH4_CallFilterFunc
+FUNC 2e29 19 0 _EH4_TransferToHandler
+FUNC 2e42 19 0 _EH4_GlobalUnwind2
+FUNC 2e5b 17 8 _EH4_LocalUnwind
+FUNC 2e72 42 0 _get_errno_from_oserr
+2e72 5 119 224
+2e77 5 123 224
+2e7c 9 124 224
+2e85 6 123 224
+2e8b 8 133 224
+2e93 3 134 224
+2e96 2 139 224
+2e98 7 125 224
+2e9f 2 139 224
+2ea1 11 135 224
+2eb2 2 139 224
+FUNC 2eb4 13 0 _errno
+2eb4 0 279 224
+2eb4 5 280 224
+2eb9 4 281 224
+2ebd 5 282 224
+2ec2 1 287 224
+2ec3 3 284 224
+2ec6 1 287 224
+FUNC 2ec7 39 0 terminate()
+2ec7 c 84 4591
+2ed3 8 89 4591
+2edb 4 90 4591
+2edf 4 95 4591
+2ee3 2 99 4591
+2ee5 2 100 4591
+2ee7 7 101 4591
+2eee 7 106 4591
+2ef5 5 114 4591
+2efa 6 115 4591
+FUNC 2f00 11 0 _initp_eh_hooks
+2f00 0 69 4591
+2f00 10 70 4591
+2f10 1 71 4591
+FUNC 2f11 1e 0 _initp_misc_winsig
+2f11 5 57 2311
+2f16 8 58 2311
+2f1e 5 59 2311
+2f23 5 60 2311
+2f28 5 61 2311
+2f2d 2 62 2311
+FUNC 2f2f 37 0 static struct _XCPT_ACTION * siglookup(int, struct _XCPT_ACTION *)
+2f2f 5 629 2311
+2f34 a 630 2311
+2f3e 14 639 2311
+2f52 e 642 2311
+2f60 2 646 2311
+2f62 2 651 2311
+2f64 2 652 2311
+FUNC 2f66 d 0 __get_sigabrt
+2f66 0 669 2311
+2f66 c 670 2311
+2f72 1 671 2311
+FUNC 2f73 1a3 0 raise
+2f73 c 450 2311
+2f7f 5 457 2311
+2f84 3 458 2311
+2f87 1f 460 2311
+2fa6 a 486 2311
+2fb0 4 487 2311
+2fb4 8 488 2311
+2fbc a 463 2311
+2fc6 2 465 2311
+2fc8 10 490 2311
+2fd8 2 491 2311
+2fda f 460 2311
+2fe9 12 498 2311
+2ffb a 474 2311
+3005 2 476 2311
+3007 a 468 2311
+3011 2 470 2311
+3013 a 479 2311
+301d 7 480 2311
+3024 a 500 2311
+302e 2 508 2311
+3030 4 507 2311
+3034 6 508 2311
+303a 5 513 2311
+303f 7 518 2311
+3046 5 525 2311
+304b 7 526 2311
+3052 5 528 2311
+3057 f 539 2311
+3066 6 540 2311
+306c 3 541 2311
+306f 5 547 2311
+3074 6 548 2311
+307a 7 549 2311
+3081 5 557 2311
+3086 1a 564 2311
+30a0 d 567 2311
+30ad 5 564 2311
+30b2 7 570 2311
+30b9 c 573 2311
+30c5 5 578 2311
+30ca 8 584 2311
+30d2 2 585 2311
+30d4 6 573 2311
+30da 6 574 2311
+30e0 9 575 2311
+30e9 5 586 2311
+30ee f 593 2311
+30fd 6 594 2311
+3103 5 599 2311
+3108 6 600 2311
+310e 2 603 2311
+3110 6 604 2311
+FUNC 3116 f 0 _initp_misc_rand_s
+3116 5 58 2186
+311b 8 59 2186
+3123 2 60 2186
+FUNC 3125 f 0 _initp_misc_purevirt
+3125 5 179 1627
+312a 8 180 1627
+3132 2 181 1627
+FUNC 3134 f 0 _initp_heap_handler
+3134 5 31 2820
+3139 8 32 2820
+3141 2 33 2820
+FUNC 3143 28 0 _callnewh
+3143 5 131 2820
+3148 c 133 2820
+3154 e 135 2820
+3162 3 138 2820
+3165 2 139 2820
+3167 2 136 2820
+3169 2 139 2820
+FUNC 316b b6 0 static * _onexit_nolock( *)
+316b 8 100 1969
+3173 f 103 1969
+3182 f 104 1969
+3191 14 108 1969
+31a5 10 118 1969
+31b5 d 123 1969
+31c2 13 125 1969
+31d5 3 130 1969
+31d8 13 132 1969
+31eb 3 143 1969
+31ee f 145 1969
+31fd 10 152 1969
+320d 8 153 1969
+3215 5 155 1969
+321a 5 110 1969
+321f 2 156 1969
+FUNC 3221 31 0 __onexitinit
+3221 3 201 1969
+3224 d 204 1969
+3231 11 205 1969
+3242 4 207 1969
+3246 4 212 1969
+324a 1 217 1969
+324b 3 214 1969
+324e 3 216 1969
+3251 1 217 1969
+FUNC 3252 3c 0 _onexit
+3252 c 81 1969
+325e 5 84 1969
+3263 4 86 1969
+3267 c 87 1969
+3273 c 89 1969
+327f 3 93 1969
+3282 6 94 1969
+3288 6 90 1969
+FUNC 328e 17 0 atexit
+328e 5 161 1969
+3293 10 162 1969
+32a3 2 163 1969
+FUNC 32a5 23 0 _initp_misc_cfltcvt_tab
+32a5 4 54 2419
+32a9 2 56 2419
+32ab 1a 58 2419
+32c5 3 60 2419
+FUNC 32d0 35 0 _ValidateImageBase
+32d0 5 44 2079
+32d5 d 50 2079
+32e2 2 52 2079
+32e4 2 68 2079
+32e6 5 55 2079
+32eb 6 56 2079
+32f1 2 58 2079
+32f3 10 62 2079
+3303 2 68 2079
+FUNC 3310 44 0 _FindPESection
+3310 5 92 2079
+3315 8 99 2079
+331d 18 108 2079
+3335 10 111 2079
+3345 8 108 2079
+334d 5 123 2079
+3352 2 124 2079
+FUNC 3360 bc 0 _IsNonwritableInCurrentImage
+3360 35 149 2079
+3395 7 156 2079
+339c f 164 2079
+33ab 2 166 2079
+33ad 8 174 2079
+33b5 e 175 2079
+33c3 2 176 2079
+33c5 2 178 2079
+33c7 12 185 2079
+33d9 12 195 2079
+33eb 16 187 2079
+3401 9 193 2079
+340a 12 195 2079
+FUNC 341c 16c 0 __crtMessageBoxW
+341c 12 41 1053
+342e 14 49 1053
+3442 4 56 1053
+3446 c 62 1053
+3452 d 64 1053
+345f 2 65 1053
+3461 6 67 1053
+3467 10 72 1053
+3477 6 76 1053
+347d 9 78 1053
+3486 10 81 1053
+3496 10 84 1053
+34a6 d 88 1053
+34b3 8 93 1053
+34bb 4 95 1053
+34bf 10 97 1053
+34cf 1a 110 1053
+34e9 3 113 1053
+34ec c 114 1053
+34f8 8 116 1053
+3500 1f 121 1053
+351f 7 130 1053
+3526 2 132 1053
+3528 a 134 1053
+3532 3 136 1053
+3535 4 137 1053
+3539 5 139 1053
+353e e 143 1053
+354c 3 145 1053
+354f 4 146 1053
+3553 8 148 1053
+355b 8 155 1053
+3563 4 156 1053
+3567 10 158 1053
+3577 2 163 1053
+3579 f 166 1053
+FUNC 3588 75 0 wcscat_s
+3588 6 13 2468
+358e 22 18 2468
+35b0 2 46 2468
+35b2 e 19 2468
+35c0 2 21 2468
+35c2 6 23 2468
+35c8 3 25 2468
+35cb 3 26 2468
+35ce 2 29 2468
+35d0 2 32 2468
+35d2 14 35 2468
+35e6 9 41 2468
+35ef e 42 2468
+FUNC 35fd cd 0 wcsncpy_s
+35fd 5 13 2578
+3602 16 17 2578
+3618 5 65 2578
+361d 2 66 2578
+361f 1e 24 2578
+363d 4 25 2578
+3641 5 28 2578
+3646 2 29 2578
+3648 e 31 2578
+3656 2 33 2578
+3658 5 35 2578
+365d 16 37 2578
+3673 2 41 2578
+3675 19 45 2578
+368e 4 48 2578
+3692 5 50 2578
+3697 8 54 2578
+369f a 58 2578
+36a9 d 59 2578
+36b6 3 61 2578
+36b9 11 62 2578
+FUNC 36ca 1b 0 wcslen
+36ca 5 41 2728
+36cf 3 42 2728
+36d2 b 44 2728
+36dd 6 46 2728
+36e3 2 47 2728
+FUNC 36e5 63 0 wcscpy_s
+36e5 6 13 2523
+36eb 22 18 2523
+370d 2 34 2523
+370f c 19 2523
+371b 16 23 2523
+3731 9 29 2523
+373a e 30 2523
+FUNC 3748 3f 0 _set_error_mode
+3748 5 43 1181
+374d 11 46 1181
+375e 5 54 1181
+3763 2 61 1181
+3765 5 50 1181
+376a 6 51 1181
+3770 2 61 1181
+3772 13 57 1181
+3785 2 61 1181
+FUNC 3787 f 0 __security_check_cookie
+3787 0 52 892
+3787 6 55 892
+378d 2 56 892
+378f 2 57 892
+3791 5 59 892
+FUNC 3796 45 0 _malloc_crt
+3796 7 39 333
+379d 2 40 333
+379f b 44 333
+37aa c 45 333
+37b6 1a 46 333
+37d0 5 47 333
+37d5 4 50 333
+37d9 2 51 333
+FUNC 37db 4c 0 _calloc_crt
+37db 7 54 333
+37e2 2 55 333
+37e4 12 61 333
+37f6 c 62 333
+3802 1a 63 333
+381c 5 64 333
+3821 4 67 333
+3825 2 68 333
+FUNC 3827 4e 0 _realloc_crt
+3827 7 71 333
+382e 2 72 333
+3830 f 76 333
+383f 11 77 333
+3850 1a 78 333
+386a 5 79 333
+386f 4 82 333
+3873 2 83 333
+FUNC 3875 2f 0 static int CPtoLCID(int)
+3875 0 329 3326
+3875 14 330 3326
+3889 2 345 3326
+388b 1 346 3326
+388c 5 342 3326
+3891 1 346 3326
+3892 5 339 3326
+3897 1 346 3326
+3898 5 336 3326
+389d 1 346 3326
+389e 5 333 3326
+38a3 1 346 3326
+FUNC 38a4 64 0 static void setSBCS(struct threadmbcinfostruct *)
+38a4 6 363 3326
+38aa 11 368 3326
+38bb 1b 379 3326
+38d6 12 381 3326
+38e8 9 382 3326
+38f1 b 384 3326
+38fc 9 385 3326
+3905 3 386 3326
+FUNC 3908 190 0 static void setSBUpLow(struct threadmbcinfostruct *)
+3908 17 402 3326
+391f 10 412 3326
+392f f 415 3326
+393e c 416 3326
+394a 11 420 3326
+395b 6 419 3326
+3961 20 421 3326
+3981 a 420 3326
+398b 20 427 3326
+39ab 23 432 3326
+39ce 25 437 3326
+39f3 2 442 3326
+39f5 d 443 3326
+3a02 5 445 3326
+3a07 9 446 3326
+3a10 5 448 3326
+3a15 5 450 3326
+3a1a e 451 3326
+3a28 2 453 3326
+3a2a 7 454 3326
+3a31 5 442 3326
+3a36 8 456 3326
+3a3e 12 472 3326
+3a50 17 461 3326
+3a67 5 463 3326
+3a6c 5 464 3326
+3a71 5 466 3326
+3a76 5 468 3326
+3a7b 5 469 3326
+3a80 2 471 3326
+3a82 3 472 3326
+3a85 5 460 3326
+3a8a e 474 3326
+FUNC 3a98 a4 0 __updatetmbcinfo
+3a98 c 495 3326
+3aa4 7 498 3326
+3aab 10 499 3326
+3abb 3 532 3326
+3abe 4 535 3326
+3ac2 8 537 3326
+3aca 2 540 3326
+3acc 6 541 3326
+3ad2 8 500 3326
+3ada 4 502 3326
+3ade e 505 3326
+3aec 17 511 3326
+3b03 7 516 3326
+3b0a 11 523 3326
+3b1b 7 524 3326
+3b22 11 527 3326
+3b33 9 529 3326
+FUNC 3b3c 87 0 _LocaleUpdate::_LocaleUpdate(localeinfo_struct *)
+3b3c 5 240 111
+3b41 e 241 111
+3b4f 8 243 111
+3b57 5 244 111
+3b5c 6 245 111
+3b62 1c 247 111
+3b7e 21 248 111
+3b9f 9 249 111
+3ba8 4 251 111
+3bac 4 252 111
+3bb0 2 255 111
+3bb2 a 257 111
+3bbc 7 259 111
+FUNC 3bc3 7c 0 static int getSystemCP(int)
+3bc3 9 282 3326
+3bcc b 284 3326
+3bd7 6 285 3326
+3bdd 5 289 3326
+3be2 a 291 3326
+3bec 14 292 3326
+3c00 5 295 3326
+3c05 a 297 3326
+3c0f 8 298 3326
+3c17 5 302 3326
+3c1c 12 305 3326
+3c2e f 308 3326
+3c3d 2 309 3326
+FUNC 3c3f 1e9 0 _setmbcp_nolock
+3c3f 17 684 3326
+3c56 b 691 3326
+3c61 9 694 3326
+3c6a 7 696 3326
+3c71 7 697 3326
+3c78 3 701 3326
+3c7b 2 703 3326
+3c7d c 706 3326
+3c89 d 703 3326
+3c96 2a 741 3326
+3cc0 13 749 3326
+3cd3 f 754 3326
+3ce2 15 759 3326
+3cf7 17 762 3326
+3d0e c 764 3326
+3d1a f 710 3326
+3d29 15 713 3326
+3d3e 9 718 3326
+3d47 8 721 3326
+3d4f 12 722 3326
+3d61 4 721 3326
+3d65 b 718 3326
+3d70 12 713 3326
+3d82 20 729 3326
+3da2 f 731 3326
+3db1 7 734 3326
+3db8 5 735 3326
+3dbd 6 765 3326
+3dc3 4 764 3326
+3dc7 d 762 3326
+3dd4 8 769 3326
+3ddc 7 770 3326
+3de3 b 773 3326
+3dee 3 776 3326
+3df1 2 778 3326
+3df3 3 780 3326
+3df6 12 783 3326
+3e08 2 787 3326
+3e0a 6 792 3326
+3e10 6 795 3326
+3e16 3 744 3326
+3e19 f 800 3326
+FUNC 3e28 19a 0 _setmbcp
+3e28 c 572 3326
+3e34 4 573 3326
+3e38 a 577 3326
+3e42 5 579 3326
+3e47 3 580 3326
+3e4a b 582 3326
+3e55 9 584 3326
+3e5e d 590 3326
+3e6b 8 592 3326
+3e73 c 594 3326
+3e7f 3 605 3326
+3e82 16 610 3326
+3e98 1a 612 3326
+3eb2 7 613 3326
+3eb9 3 617 3326
+3ebc 9 618 3326
+3ec5 17 620 3326
+3edc 8 622 3326
+3ee4 4 623 3326
+3ee8 8 628 3326
+3ef0 8 629 3326
+3ef8 8 630 3326
+3f00 a 631 3326
+3f0a d 632 3326
+3f17 3 631 3326
+3f1a c 633 3326
+3f26 a 634 3326
+3f30 3 633 3326
+3f33 c 635 3326
+3f3f d 636 3326
+3f4c 3 635 3326
+3f4f 1c 638 3326
+3f6b 7 639 3326
+3f72 6 643 3326
+3f78 3 644 3326
+3f7b e 646 3326
+3f89 9 648 3326
+3f92 2 651 3326
+3f94 5 652 3326
+3f99 8 658 3326
+3fa1 7 659 3326
+3fa8 b 660 3326
+3fb3 2 666 3326
+3fb5 4 671 3326
+3fb9 3 680 3326
+3fbc 6 681 3326
+FUNC 3fc2 1e 0 __initmbctable
+3fc2 0 841 3326
+3fc2 9 851 3326
+3fcb 8 852 3326
+3fd3 a 853 3326
+3fdd 2 858 3326
+3fdf 1 859 3326
+FUNC 3fe0 53 0 static int x_ismbbtype_l(struct localeinfo_struct *, unsigned int, int, int)
+3fe0 8 213 3271
+3fe8 b 214 3271
+3ff3 4 219 3271
+3ff7 3a 222 3271
+4031 2 223 3271
+FUNC 4033 18 0 _ismbblead
+4033 5 171 3271
+4038 11 172 3271
+4049 2 173 3271
+FUNC 404b 8f 0 __addlocaleref
+404b 7 36 1913
+4052 d 39 1913
+405f a 41 1913
+4069 3 42 1913
+406c a 44 1913
+4076 3 45 1913
+4079 a 47 1913
+4083 3 48 1913
+4086 a 50 1913
+4090 3 51 1913
+4093 a 53 1913
+409d f 55 1913
+40ac 3 56 1913
+40af d 59 1913
+40bc 3 60 1913
+40bf 8 53 1913
+40c7 11 63 1913
+40d8 2 64 1913
+FUNC 40da 99 0 __removelocaleref
+40da 6 74 1913
+40e0 b 77 1913
+40eb b 79 1913
+40f6 a 81 1913
+4100 3 82 1913
+4103 a 84 1913
+410d 3 85 1913
+4110 a 87 1913
+411a 3 88 1913
+411d a 90 1913
+4127 3 91 1913
+412a a 93 1913
+4134 f 95 1913
+4143 3 96 1913
+4146 d 99 1913
+4153 3 100 1913
+4156 8 93 1913
+415e 10 103 1913
+416e 3 106 1913
+4171 2 107 1913
+FUNC 4173 14b 0 __freetlocinfo
+4173 7 129 1913
+417a 25 137 1913
+419f e 140 1913
+41ad 6 142 1913
+41b3 d 143 1913
+41c0 e 147 1913
+41ce 6 149 1913
+41d4 d 150 1913
+41e1 b 153 1913
+41ec d 154 1913
+41f9 e 161 1913
+4207 11 163 1913
+4218 13 164 1913
+422b e 165 1913
+4239 e 166 1913
+4247 15 173 1913
+425c 6 175 1913
+4262 d 176 1913
+426f a 179 1913
+4279 13 182 1913
+428c 7 184 1913
+4293 10 192 1913
+42a3 7 194 1913
+42aa 8 179 1913
+42b2 a 201 1913
+42bc 2 202 1913
+FUNC 42be 4d 0 _updatetlocinfoEx_nolock
+42be 6 216 1913
+42c4 e 219 1913
+42d2 3 222 1913
+42d5 4 223 1913
+42d9 9 230 1913
+42e2 4 236 1913
+42e6 6 238 1913
+42ec e 248 1913
+42fa 7 249 1913
+4301 5 253 1913
+4306 3 220 1913
+4309 2 254 1913
+FUNC 430b 79 0 __updatetlocinfo
+430b c 281 1913
+4317 7 283 1913
+431e 10 285 1913
+432e 8 297 1913
+4336 4 300 1913
+433a 8 302 1913
+4342 2 305 1913
+4344 6 306 1913
+434a 8 286 1913
+4352 4 288 1913
+4356 14 290 1913
+436a e 292 1913
+4378 8 294 1913
+4380 4 295 1913
+FUNC 4384 8 0 _crt_debugger_hook
+4384 0 62 1145
+4384 7 65 1145
+438b 1 66 1145
+FUNC 4390 7a 0 memset
+4390 0 59 2789
+4390 4 68 2789
+4394 4 69 2789
+4398 2 71 2789
+439a 2 72 2789
+439c 2 74 2789
+439e 4 75 2789
+43a2 2 78 2789
+43a4 2 79 2789
+43a6 6 80 2789
+43ac 2 81 2789
+43ae 7 82 2789
+43b5 2 83 2789
+43b7 5 85 2789
+43bc 1 91 2789
+43bd 2 92 2789
+43bf 3 94 2789
+43c2 2 95 2789
+43c4 2 97 2789
+43c6 3 98 2789
+43c9 2 99 2789
+43cb 2 101 2789
+43cd 2 103 2789
+43cf 3 104 2789
+43d2 3 105 2789
+43d5 2 106 2789
+43d7 2 110 2789
+43d9 3 111 2789
+43dc 2 113 2789
+43de 2 115 2789
+43e0 3 117 2789
+43e3 2 119 2789
+43e5 2 122 2789
+43e7 3 123 2789
+43ea 3 124 2789
+43ed 2 125 2789
+43ef 2 127 2789
+43f1 2 129 2789
+43f3 2 130 2789
+43f5 2 134 2789
+43f7 3 135 2789
+43fa 3 137 2789
+43fd 2 138 2789
+43ff 4 142 2789
+4403 1 143 2789
+4404 1 145 2789
+4405 4 148 2789
+4409 1 150 2789
+FUNC 4410 95 0 _aulldvrm
+4410 0 45 2806
+4410 1 48 2806
+4411 4 80 2806
+4415 2 81 2806
+4417 2 82 2806
+4419 4 83 2806
+441d 4 84 2806
+4421 2 85 2806
+4423 2 86 2806
+4425 2 87 2806
+4427 4 88 2806
+442b 2 89 2806
+442d 2 90 2806
+442f 2 95 2806
+4431 4 96 2806
+4435 2 97 2806
+4437 2 98 2806
+4439 4 99 2806
+443d 2 100 2806
+443f 2 101 2806
+4441 2 108 2806
+4443 4 109 2806
+4447 4 110 2806
+444b 4 111 2806
+444f 2 113 2806
+4451 2 114 2806
+4453 2 115 2806
+4455 2 116 2806
+4457 2 117 2806
+4459 2 118 2806
+445b 2 119 2806
+445d 2 120 2806
+445f 4 129 2806
+4463 2 130 2806
+4465 4 131 2806
+4469 2 132 2806
+446b 2 133 2806
+446d 2 134 2806
+446f 4 142 2806
+4473 2 143 2806
+4475 2 144 2806
+4477 4 145 2806
+447b 2 146 2806
+447d 1 148 2806
+447e 4 149 2806
+4482 4 150 2806
+4486 2 152 2806
+4488 4 161 2806
+448c 4 162 2806
+4490 2 163 2806
+4492 2 164 2806
+4494 3 165 2806
+4497 2 170 2806
+4499 2 171 2806
+449b 2 172 2806
+449d 2 173 2806
+449f 2 174 2806
+44a1 1 180 2806
+44a2 3 182 2806
+FUNC 44b0 20 0 _global_unwind2
+FUNC 44d0 45 0 static void __unwind_handler()
+FUNC 4515 84 0 _local_unwind2
+FUNC 4599 23 0 _abnormal_termination
+FUNC 45bc 9 0 _NLG_Notify1
+FUNC 45c5 1f 0 _NLG_Notify
+PUBLIC m 45dc 0 _NLG_Dispatch
+FUNC 45e4 3 0 _NLG_Call
+PUBLIC 45e6 0 _NLG_Return2
+FUNC 45e7 33 0 abort
+45e7 0 54 1011
+45e7 5 71 1011
+45ec 4 72 1011
+45f0 8 74 1011
+45f8 9 81 1011
+4601 11 83 1011
+4612 8 92 1011
+FUNC 4620 361 0 memcpy
+4620 3 101 2787
+4623 1 113 2787
+4624 1 114 2787
+4625 3 116 2787
+4628 3 117 2787
+462b 3 119 2787
+462e 2 129 2787
+4630 2 131 2787
+4632 2 132 2787
+4634 2 134 2787
+4636 2 135 2787
+4638 2 137 2787
+463a 6 138 2787
+4640 6 147 2787
+4646 2 148 2787
+4648 7 150 2787
+464f 2 151 2787
+4651 1 153 2787
+4652 1 154 2787
+4653 3 155 2787
+4656 3 156 2787
+4659 2 157 2787
+465b 1 158 2787
+465c 1 159 2787
+465d 2 160 2787
+465f 5 163 2787
+4664 6 176 2787
+466a 2 177 2787
+466c 3 179 2787
+466f 3 180 2787
+4672 3 182 2787
+4675 2 183 2787
+4677 2 185 2787
+4679 7 187 2787
+4680 2 205 2787
+4682 5 206 2787
+4687 3 208 2787
+468a 2 209 2787
+468c 3 211 2787
+468f 2 212 2787
+4691 7 214 2787
+4698 8 218 2787
+46a0 14 222 2787
+46b4 2 229 2787
+46b6 2 230 2787
+46b8 2 232 2787
+46ba 3 233 2787
+46bd 3 235 2787
+46c0 3 236 2787
+46c3 3 238 2787
+46c6 3 239 2787
+46c9 3 241 2787
+46cc 3 242 2787
+46cf 3 244 2787
+46d2 2 245 2787
+46d4 2 247 2787
+46d6 a 249 2787
+46e0 2 253 2787
+46e2 2 254 2787
+46e4 2 256 2787
+46e6 3 257 2787
+46e9 3 259 2787
+46ec 3 260 2787
+46ef 3 262 2787
+46f2 3 263 2787
+46f5 3 265 2787
+46f8 2 266 2787
+46fa 2 268 2787
+46fc 8 270 2787
+4704 2 274 2787
+4706 2 275 2787
+4708 2 277 2787
+470a 3 278 2787
+470d 3 280 2787
+4710 3 281 2787
+4713 3 283 2787
+4716 2 284 2787
+4718 2 286 2787
+471a 2a 288 2787
+4744 4 295 2787
+4748 4 297 2787
+474c 4 299 2787
+4750 4 301 2787
+4754 4 303 2787
+4758 4 305 2787
+475c 4 307 2787
+4760 4 309 2787
+4764 4 311 2787
+4768 4 313 2787
+476c 4 315 2787
+4770 4 317 2787
+4774 4 319 2787
+4778 4 321 2787
+477c 7 323 2787
+4783 2 325 2787
+4785 2 326 2787
+4787 19 328 2787
+47a0 3 337 2787
+47a3 1 338 2787
+47a4 1 339 2787
+47a5 3 341 2787
+47a8 2 345 2787
+47aa 2 347 2787
+47ac 3 348 2787
+47af 1 349 2787
+47b0 1 350 2787
+47b1 3 351 2787
+47b4 2 355 2787
+47b6 2 357 2787
+47b8 3 358 2787
+47bb 3 359 2787
+47be 3 360 2787
+47c1 1 361 2787
+47c2 1 362 2787
+47c3 5 363 2787
+47c8 2 367 2787
+47ca 2 369 2787
+47cc 3 370 2787
+47cf 3 371 2787
+47d2 3 372 2787
+47d5 3 373 2787
+47d8 3 374 2787
+47db 1 375 2787
+47dc 1 376 2787
+47dd 3 377 2787
+47e0 4 388 2787
+47e4 4 389 2787
+47e8 6 394 2787
+47ee 2 395 2787
+47f0 3 397 2787
+47f3 3 398 2787
+47f6 3 400 2787
+47f9 2 401 2787
+47fb 1 403 2787
+47fc 2 404 2787
+47fe 1 405 2787
+47ff 9 407 2787
+4808 2 411 2787
+480a a 414 2787
+4814 2 419 2787
+4816 5 420 2787
+481b 3 422 2787
+481e 2 423 2787
+4820 3 425 2787
+4823 2 426 2787
+4825 7 428 2787
+482c 14 432 2787
+4840 3 439 2787
+4843 2 440 2787
+4845 3 442 2787
+4848 3 443 2787
+484b 3 445 2787
+484e 3 446 2787
+4851 3 448 2787
+4854 2 449 2787
+4856 1 451 2787
+4857 2 452 2787
+4859 1 453 2787
+485a a 455 2787
+4864 3 459 2787
+4867 2 460 2787
+4869 3 462 2787
+486c 3 463 2787
+486f 3 465 2787
+4872 3 466 2787
+4875 3 468 2787
+4878 3 469 2787
+487b 3 471 2787
+487e 2 472 2787
+4880 1 474 2787
+4881 2 475 2787
+4883 1 476 2787
+4884 8 478 2787
+488c 3 482 2787
+488f 2 483 2787
+4891 3 485 2787
+4894 3 486 2787
+4897 3 488 2787
+489a 3 489 2787
+489d 3 491 2787
+48a0 3 492 2787
+48a3 3 494 2787
+48a6 3 495 2787
+48a9 3 497 2787
+48ac 6 498 2787
+48b2 1 500 2787
+48b3 2 501 2787
+48b5 1 502 2787
+48b6 2a 504 2787
+48e0 4 513 2787
+48e4 4 515 2787
+48e8 4 517 2787
+48ec 4 519 2787
+48f0 4 521 2787
+48f4 4 523 2787
+48f8 4 525 2787
+48fc 4 527 2787
+4900 4 529 2787
+4904 4 531 2787
+4908 4 533 2787
+490c 4 535 2787
+4910 4 537 2787
+4914 4 539 2787
+4918 7 541 2787
+491f 2 543 2787
+4921 2 544 2787
+4923 19 546 2787
+493c 3 555 2787
+493f 1 557 2787
+4940 1 558 2787
+4941 3 559 2787
+4944 3 563 2787
+4947 3 565 2787
+494a 3 566 2787
+494d 1 567 2787
+494e 1 568 2787
+494f 5 569 2787
+4954 3 573 2787
+4957 3 575 2787
+495a 3 576 2787
+495d 3 577 2787
+4960 3 578 2787
+4963 1 579 2787
+4964 1 580 2787
+4965 3 581 2787
+4968 3 585 2787
+496b 3 587 2787
+496e 3 588 2787
+4971 3 589 2787
+4974 3 590 2787
+4977 3 591 2787
+497a 3 592 2787
+497d 1 593 2787
+497e 1 594 2787
+497f 2 595 2787
+FUNC 4981 20 0 _freea
+4981 5 235 281
+4986 7 237 281
+498d 3 239 281
+4990 8 241 281
+4998 7 243 281
+499f 2 252 281
+FUNC 49a1 33 0 _msize
+49a1 5 39 561
+49a6 19 43 561
+49bf 2 50 561
+49c1 11 46 561
+49d2 2 50 561
+FUNC 49d4 9 0 _fptrap
+49d4 0 46 4123
+49d4 8 47 4123
+49dc 1 48 4123
+FUNC 49dd 106 0 __report_gsfailure
+49dd b 140 1392
+49e8 5 170 1392
+49ed 6 171 1392
+49f3 6 172 1392
+49f9 6 173 1392
+49ff 6 174 1392
+4a05 6 175 1392
+4a0b 7 176 1392
+4a12 7 177 1392
+4a19 7 178 1392
+4a20 7 179 1392
+4a27 7 180 1392
+4a2e 7 181 1392
+4a35 1 182 1392
+4a36 6 183 1392
+4a3c 3 190 1392
+4a3f 5 191 1392
+4a44 3 192 1392
+4a47 5 193 1392
+4a4c 3 194 1392
+4a4f 5 195 1392
+4a54 6 201 1392
+4a5a a 204 1392
+4a64 a 206 1392
+4a6e a 285 1392
+4a78 a 286 1392
+4a82 b 293 1392
+4a8d b 294 1392
+4a98 b 297 1392
+4aa3 8 298 1392
+4aab 8 302 1392
+4ab3 b 304 1392
+4abe 9 313 1392
+4ac7 8 315 1392
+4acf 12 319 1392
+4ae1 2 320 1392
+FUNC 4ae3 82 0 _calloc_impl
+4ae3 5 21 291
+4ae8 7 26 291
+4aef 19 28 291
+4b08 2 69 291
+4b0a 7 30 291
+4b11 4 34 291
+4b15 1 35 291
+4b16 2 39 291
+4b18 5 41 291
+4b1d f 44 291
+4b2c d 47 291
+4b39 b 59 291
+4b44 7 61 291
+4b4b 6 62 291
+4b51 4 63 291
+4b55 7 52 291
+4b5c 7 53 291
+4b63 2 69 291
+FUNC 4b65 ad 0 realloc
+4b65 5 62 618
+4b6a 6 67 618
+4b70 9 68 618
+4b79 3 117 618
+4b7c 7 71 618
+4b83 9 73 618
+4b8c 5 74 618
+4b91 2 109 618
+4b93 4 83 618
+4b97 1 84 618
+4b98 14 85 618
+4bac c 94 618
+4bb8 b 109 618
+4bc3 5 81 618
+4bc8 7 89 618
+4bcf b 90 618
+4bda 4 91 618
+4bde 2 117 618
+4be0 16 111 618
+4bf6 2 112 618
+4bf8 16 103 618
+4c0e 4 105 618
+FUNC 4c12 1e7 0 static int __crtLCMapStringA_stat(struct localeinfo_struct *, unsigned long, unsigned long, const char *, int, char *, int, int, int)
+4c12 12 96 3447
+4c24 c 101 3447
+4c30 17 102 3447
+4c47 4 106 3447
+4c4b 1 107 3447
+4c4c 3 109 3447
+4c4f 3 113 3447
+4c52 5 133 3447
+4c57 b 134 3447
+4c62 2c 145 3447
+4c8e 7 146 3447
+4c95 48 149 3447
+4cdd 3 150 3447
+4ce0 2 151 3447
+4ce2 19 160 3447
+4cfb 1f 169 3447
+4d1a a 172 3447
+4d24 b 175 3447
+4d2f 9 177 3447
+4d38 10 186 3447
+4d48 5 190 3447
+4d4d 4b 196 3447
+4d98 4 197 3447
+4d9c 16 207 3447
+4db2 9 220 3447
+4dbb 2 223 3447
+4dbd 17 233 3447
+4dd4 7 240 3447
+4ddb 8 242 3447
+4de3 4 244 3447
+4de7 12 245 3447
+FUNC 4df9 46 0 __crtLCMapStringA
+4df9 8 258 3447
+4e01 b 259 3447
+4e0c 31 271 3447
+4e3d 2 272 3447
+FUNC 4e3f e7 0 static int __crtGetStringTypeA_stat(struct localeinfo_struct *, unsigned long, const char *, int, unsigned short *, int, int, int)
+4e3f 12 63 3507
+4e51 7 67 3507
+4e58 5 83 3507
+4e5d b 84 3507
+4e68 29 95 3507
+4e91 4 96 3507
+4e95 3e 99 3507
+4ed3 2 100 3507
+4ed5 2 101 3507
+4ed7 f 103 3507
+4ee6 13 111 3507
+4ef9 11 116 3507
+4f0a 6 118 3507
+4f10 4 120 3507
+4f14 12 121 3507
+FUNC 4f26 40 0 __crtGetStringTypeA
+4f26 8 133 3507
+4f2e b 134 3507
+4f39 2b 145 3507
+4f64 2 146 3507
+FUNC 4f66 377 0 __free_lc_time
+4f66 6 228 1800
+4f6c b 229 1800
+4f77 8 232 1800
+4f7f 8 233 1800
+4f87 8 234 1800
+4f8f 8 235 1800
+4f97 8 236 1800
+4f9f 8 237 1800
+4fa7 7 238 1800
+4fae 8 240 1800
+4fb6 8 241 1800
+4fbe 8 242 1800
+4fc6 8 243 1800
+4fce 8 244 1800
+4fd6 8 245 1800
+4fde 8 246 1800
+4fe6 8 248 1800
+4fee b 249 1800
+4ff9 8 250 1800
+5001 8 251 1800
+5009 8 252 1800
+5011 8 253 1800
+5019 8 254 1800
+5021 8 255 1800
+5029 8 256 1800
+5031 8 257 1800
+5039 8 258 1800
+5041 8 259 1800
+5049 8 261 1800
+5051 8 262 1800
+5059 8 263 1800
+5061 8 264 1800
+5069 8 265 1800
+5071 b 266 1800
+507c b 267 1800
+5087 b 268 1800
+5092 b 269 1800
+509d b 270 1800
+50a8 b 271 1800
+50b3 b 272 1800
+50be b 274 1800
+50c9 b 275 1800
+50d4 b 277 1800
+50df b 278 1800
+50ea b 279 1800
+50f5 b 282 1800
+5100 b 283 1800
+510b b 284 1800
+5116 b 285 1800
+5121 e 286 1800
+512f b 287 1800
+513a b 288 1800
+5145 b 290 1800
+5150 b 291 1800
+515b b 292 1800
+5166 b 293 1800
+5171 b 294 1800
+517c b 295 1800
+5187 b 296 1800
+5192 b 298 1800
+519d b 299 1800
+51a8 b 300 1800
+51b3 b 301 1800
+51be b 302 1800
+51c9 b 303 1800
+51d4 e 304 1800
+51e2 b 305 1800
+51ed b 306 1800
+51f8 b 307 1800
+5203 b 308 1800
+520e b 309 1800
+5219 b 311 1800
+5224 b 312 1800
+522f b 313 1800
+523a b 314 1800
+5245 b 315 1800
+5250 b 316 1800
+525b b 317 1800
+5266 b 318 1800
+5271 b 319 1800
+527c b 320 1800
+5287 e 321 1800
+5295 b 322 1800
+52a0 b 324 1800
+52ab b 325 1800
+52b6 b 327 1800
+52c1 b 328 1800
+52cc f 329 1800
+52db 2 332 1800
+FUNC 52dd 69 0 __free_lconv_num
+52dd 6 218 1742
+52e3 7 219 1742
+52ea a 222 1742
+52f4 7 223 1742
+52fb b 225 1742
+5306 7 226 1742
+530d b 228 1742
+5318 7 229 1742
+531f b 231 1742
+532a 7 232 1742
+5331 b 234 1742
+533c 8 235 1742
+5344 2 236 1742
+FUNC 5346 fe 0 __free_lconv_mon
+5346 6 270 1685
+534c b 271 1685
+5357 b 274 1685
+5362 7 275 1685
+5369 b 277 1685
+5374 7 278 1685
+537b b 280 1685
+5386 7 281 1685
+538d b 283 1685
+5398 7 284 1685
+539f b 286 1685
+53aa 7 287 1685
+53b1 b 289 1685
+53bc 7 290 1685
+53c3 b 292 1685
+53ce 7 293 1685
+53d5 b 295 1685
+53e0 7 296 1685
+53e7 b 298 1685
+53f2 7 299 1685
+53f9 b 301 1685
+5404 7 302 1685
+540b b 304 1685
+5416 7 305 1685
+541d b 307 1685
+5428 7 308 1685
+542f b 310 1685
+543a 8 311 1685
+5442 2 312 1685
+FUNC 5444 ba 0 _VEC_memzero
+FUNC 54fe 10 0 __sse2_available_init
+54fe 0 30 4315
+54fe d 31 4315
+550b 2 32 4315
+550d 1 33 4315
+FUNC 550e 103 0 _VEC_memcpy
+FUNC 5620 2c 0 _alloca_probe_16
+5620 0 44 4274
+5620 1 46 4274
+5621 4 47 4274
+5625 2 48 4274
+5627 3 49 4274
+562a 2 50 4274
+562c 2 51 4274
+562e 2 52 4274
+5630 1 53 4274
+5631 5 54 4274
+5636 1 59 4274
+5637 4 60 4274
+563b 2 61 4274
+563d 3 62 4274
+5640 2 63 4274
+5642 2 64 4274
+5644 2 65 4274
+5646 1 66 4274
+5647 5 67 4274
+PUBLIC 5636 0 _alloca_probe_8
+FUNC 5650 34 0 _allmul
+5650 0 47 2803
+5650 4 63 2803
+5654 4 64 2803
+5658 2 65 2803
+565a 4 66 2803
+565e 2 67 2803
+5660 4 69 2803
+5664 2 70 2803
+5666 3 72 2803
+5669 1 75 2803
+566a 2 83 2803
+566c 2 84 2803
+566e 4 86 2803
+5672 4 87 2803
+5676 2 88 2803
+5678 4 90 2803
+567c 2 91 2803
+567e 2 92 2803
+5680 1 94 2803
+5681 3 96 2803
+FUNC 5690 2b 0 _chkstk
+5690 0 65 4276
+5690 1 69 4276
+5691 4 73 4276
+5695 2 74 4276
+5697 2 79 4276
+5699 2 80 4276
+569b 2 81 4276
+569d 2 83 4276
+569f 5 84 4276
+56a4 2 87 4276
+56a6 2 88 4276
+56a8 2 89 4276
+56aa 1 90 4276
+56ab 1 91 4276
+56ac 2 92 4276
+56ae 3 93 4276
+56b1 1 94 4276
+56b2 5 98 4276
+56b7 2 99 4276
+56b9 2 100 4276
+FUNC 56c0 46 0 strcspn
+56c0 4 191 2794
+56c4 2 198 2794
+56c6 1 199 2794
+56c7 1 200 2794
+56c8 1 201 2794
+56c9 1 202 2794
+56ca 1 203 2794
+56cb 1 204 2794
+56cc 1 205 2794
+56cd 1 206 2794
+56ce 6 212 2794
+56d4 2 216 2794
+56d6 2 217 2794
+56d8 2 218 2794
+56da 3 219 2794
+56dd 4 220 2794
+56e1 2 221 2794
+56e3 3 227 2794
+56e6 6 229 2794
+56ec 3 234 2794
+56ef 2 236 2794
+56f1 2 237 2794
+56f3 2 238 2794
+56f5 3 239 2794
+56f8 4 240 2794
+56fc 2 245 2794
+56fe 2 255 2794
+5700 3 257 2794
+5703 3 259 2794
+FUNC 5710 40 0 strpbrk
+5710 4 191 2794
+5714 2 198 2794
+5716 1 199 2794
+5717 1 200 2794
+5718 1 201 2794
+5719 1 202 2794
+571a 1 203 2794
+571b 1 204 2794
+571c 1 205 2794
+571d 1 206 2794
+571e 6 212 2794
+5724 2 216 2794
+5726 2 217 2794
+5728 2 218 2794
+572a 3 219 2794
+572d 4 220 2794
+5731 2 221 2794
+5733 5 227 2794
+5738 2 236 2794
+573a 2 237 2794
+573c 2 238 2794
+573e 3 239 2794
+5741 4 240 2794
+5745 2 247 2794
+5747 3 248 2794
+574a 3 257 2794
+574d 3 259 2794
+FUNC 5750 61 0 __ascii_strnicmp
+5750 6 69 2798
+5756 3 75 2798
+5759 2 76 2798
+575b 2 77 2798
+575d 3 79 2798
+5760 3 80 2798
+5763 2 82 2798
+5765 2 83 2798
+5767 5 84 2798
+576c 2 89 2798
+576e 2 91 2798
+5770 2 93 2798
+5772 2 95 2798
+5774 2 97 2798
+5776 2 98 2798
+5778 3 100 2798
+577b 3 101 2798
+577e 2 103 2798
+5780 2 104 2798
+5782 2 106 2798
+5784 2 107 2798
+5786 2 109 2798
+5788 2 112 2798
+578a 2 113 2798
+578c 2 115 2798
+578e 2 116 2798
+5790 2 118 2798
+5792 2 121 2798
+5794 2 122 2798
+5796 3 124 2798
+5799 2 125 2798
+579b 2 128 2798
+579d 2 129 2798
+579f 2 130 2798
+57a1 5 133 2798
+57a6 2 134 2798
+57a8 2 135 2798
+57aa 2 138 2798
+57ac 5 140 2798
+PUBLIC 57b2 10 RtlUnwind
+STACK WIN 4 1000 54 6 0 8 0 14 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 1060 a 3 0 0 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 1070 21 7 0 0 0 4 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 10a0 14 7 0 0 0 4 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 10c0 16 7 0 4 0 4 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 10e0 1e 7 0 0 0 4 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 1100 10 7 0 0 0 4 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 1110 7 3 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 1120 2c 7 0 4 0 4 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 114c 10 0 0 0 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
+STACK WIN 4 115c 21 8 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 1162 17 2 0 4 4 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $23 $T0 4 - ^ =
+STACK WIN 4 117d b 5 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 1188 29 5 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 11b1 161 c 0 0 10 24 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 40 - ^ = $23 $T0 44 - ^ = $24 $T0 48 - ^ =
+STACK WIN 4 12d4 14 0 0 0 10 24 0 1 $T0 $ebp = $T2 $esp = $T1 .raSearchStart = $eip $T1 ^ = $ebp $T0 = $esp $T1 4 + =
+STACK WIN 4 1312 a 0 0 0 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
+STACK WIN 4 131c 70 c 0 4 10 1c 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 32 - ^ = $23 $T0 36 - ^ = $24 $T0 40 - ^ =
+STACK WIN 4 1383 8 0 0 4 10 1c 0 1 $T0 $ebp = $T2 $esp = $T1 .raSearchStart = $eip $T1 ^ = $ebp $T0 = $esp $T1 4 + =
+STACK WIN 4 1418 3a 5 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 1439 17 0 0 4 4 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $23 $T0 4 - ^ =
+STACK WIN 4 1452 42 5 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 1494 e 0 0 0 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
+STACK WIN 4 14a2 2b 5 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 14cd 18 5 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 14e5 9 0 0 0 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
+STACK WIN 4 14ee 9 0 0 0 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
+STACK WIN 4 14f7 33 3 0 0 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
+STACK WIN 4 14fa 2f 0 0 0 4 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = $23 $T0 4 - ^ =
+STACK WIN 4 152a 24 6 0 8 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 1530 1c 0 0 8 4 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $23 $T0 4 - ^ =
+STACK WIN 4 154e 97 5 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 1590 34 0 0 4 4 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $23 $T0 4 - ^ =
+STACK WIN 4 1591 32 0 0 4 8 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $23 $T0 4 - ^ = $24 $T0 8 - ^ =
+STACK WIN 4 15e5 140 c 0 c 10 30 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 52 - ^ = $23 $T0 56 - ^ = $24 $T0 60 - ^ =
+STACK WIN 4 1710 e 0 0 c 10 30 0 1 $T0 $ebp = $T2 $esp = $T1 .raSearchStart = $eip $T1 ^ = $ebp $T0 = $esp $T1 4 + =
+STACK WIN 4 1725 16 5 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 173b 16 5 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 1751 f 0 0 0 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
+STACK WIN 4 1760 f 0 0 0 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
+STACK WIN 4 176f 1e 5 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 178d 26 5 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 17b3 1af 1b 0 4 0 1fc 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 17c9 192 5 0 4 4 1fc 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 512 - ^ =
+STACK WIN 4 17ca 18e 4 0 4 8 1fc 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 512 - ^ = $23 $T0 516 - ^ =
+STACK WIN 4 17ce 189 0 0 4 c 1fc 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 512 - ^ = $23 $T0 516 - ^ = $24 $T0 520 - ^ =
+STACK WIN 4 1962 39 0 0 0 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
+STACK WIN 4 199b 14a 6 0 8 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 19a1 142 0 0 8 4 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $23 $T0 4 - ^ =
+STACK WIN 4 19b9 129 0 0 8 8 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $23 $T0 4 - ^ = $24 $T0 8 - ^ =
+STACK WIN 4 1a0a d4 0 0 8 c 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $23 $T0 4 - ^ = $24 $T0 8 - ^ = $20 $T0 12 - ^ =
+STACK WIN 4 1ae5 dc 0 0 0 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
+STACK WIN 4 1af4 a8 0 0 0 4 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = $23 $T0 4 - ^ =
+STACK WIN 4 1afb a0 0 0 0 8 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = $23 $T0 4 - ^ = $24 $T0 8 - ^ =
+STACK WIN 4 1b3d 5d 0 0 0 c 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = $23 $T0 4 - ^ = $24 $T0 8 - ^ = $20 $T0 12 - ^ =
+STACK WIN 4 1bc1 19a d 0 c 0 4 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 1bcb 185 3 0 c 4 4 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 8 - ^ =
+STACK WIN 4 1bce 181 0 0 c 8 4 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 8 - ^ = $23 $T0 12 - ^ =
+STACK WIN 4 1d5b bb d 0 0 0 c 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 1d64 b0 4 0 0 4 c 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 16 - ^ =
+STACK WIN 4 1d67 ac 1 0 0 8 c 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 16 - ^ = $23 $T0 20 - ^ =
+STACK WIN 4 1d68 aa 0 0 0 c c 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 16 - ^ = $23 $T0 20 - ^ = $24 $T0 24 - ^ =
+STACK WIN 4 1e16 97 a 0 0 0 c 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 1e1f 8c 1 0 0 4 c 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 16 - ^ =
+STACK WIN 4 1e20 8a 0 0 0 8 c 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 16 - ^ = $23 $T0 20 - ^ =
+STACK WIN 4 1e48 61 0 0 0 c c 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 16 - ^ = $23 $T0 20 - ^ = $24 $T0 24 - ^ =
+STACK WIN 4 1ead 245 9 0 0 0 4c 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 1eb6 235 0 0 0 4 4c 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $23 $T0 80 - ^ =
+STACK WIN 4 1f27 1c3 0 0 0 8 4c 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $23 $T0 80 - ^ = $20 $T0 84 - ^ =
+STACK WIN 4 1f28 1c1 0 0 0 c 4c 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $23 $T0 80 - ^ = $20 $T0 84 - ^ = $24 $T0 88 - ^ =
+STACK WIN 4 20f2 26 e 0 0 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
+STACK WIN 4 20f5 22 b 0 0 4 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = $23 $T0 4 - ^ =
+STACK WIN 4 2100 16 0 0 0 8 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = $23 $T0 4 - ^ = $24 $T0 8 - ^ =
+STACK WIN 4 2118 26 e 0 0 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
+STACK WIN 4 211b 22 b 0 0 4 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = $23 $T0 4 - ^ =
+STACK WIN 4 2126 16 0 0 0 8 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = $23 $T0 4 - ^ = $24 $T0 8 - ^ =
+STACK WIN 4 213e 9 0 0 0 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
+STACK WIN 4 2147 9 0 0 4 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
+STACK WIN 4 2150 34 3 0 0 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
+STACK WIN 4 2153 30 0 0 0 4 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = $23 $T0 4 - ^ =
+STACK WIN 4 2184 3d 0 0 0 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
+STACK WIN 4 21c1 b4 c 0 8 10 18 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 28 - ^ = $23 $T0 32 - ^ = $24 $T0 36 - ^ =
+STACK WIN 4 225d e 0 0 8 10 18 0 1 $T0 $ebp = $T2 $esp = $T1 .raSearchStart = $eip $T1 ^ = $ebp $T0 = $esp $T1 4 + =
+STACK WIN 4 226c 8 0 0 8 10 18 0 1 $T0 $ebp = $T2 $esp = $T1 .raSearchStart = $eip $T1 ^ = $ebp $T0 = $esp $T1 4 + =
+STACK WIN 4 2275 79 4 0 0 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
+STACK WIN 4 2278 75 1 0 0 4 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = $23 $T0 4 - ^ =
+STACK WIN 4 2279 71 0 0 0 8 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = $23 $T0 4 - ^ = $24 $T0 8 - ^ =
+STACK WIN 4 22ee 1a 3 0 0 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
+STACK WIN 4 22f1 16 0 0 0 4 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = $23 $T0 4 - ^ =
+STACK WIN 4 2308 12f c 0 4 10 18 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 28 - ^ = $23 $T0 32 - ^ = $24 $T0 36 - ^ =
+STACK WIN 4 241f b 0 0 4 10 18 0 1 $T0 $ebp = $T2 $esp = $T1 .raSearchStart = $eip $T1 ^ = $ebp $T0 = $esp $T1 4 + =
+STACK WIN 4 242b b 0 0 4 10 18 0 1 $T0 $ebp = $T2 $esp = $T1 .raSearchStart = $eip $T1 ^ = $ebp $T0 = $esp $T1 4 + =
+STACK WIN 4 2437 17b 3 0 0 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
+STACK WIN 4 243a 177 0 0 0 4 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = $24 $T0 4 - ^ =
+STACK WIN 4 2455 15b 0 0 0 8 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = $24 $T0 4 - ^ = $23 $T0 8 - ^ =
+STACK WIN 4 25b2 1e 0 0 0 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
+STACK WIN 4 2630 18f 17 0 10 0 18 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 2639 c9 e 0 10 4 18 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 28 - ^ =
+STACK WIN 4 263d c4 a 0 10 8 18 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 28 - ^ = $23 $T0 32 - ^ =
+STACK WIN 4 2647 b9 0 0 10 c 18 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 28 - ^ = $23 $T0 32 - ^ = $24 $T0 36 - ^ =
+STACK WIN 4 27bf 9b 17 0 0 0 10 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 27d5 83 1 0 0 4 10 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 20 - ^ =
+STACK WIN 4 27d6 81 0 0 0 8 10 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 20 - ^ = $24 $T0 24 - ^ =
+STACK WIN 4 27f2 64 0 0 0 c 10 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 20 - ^ = $24 $T0 24 - ^ = $23 $T0 28 - ^ =
+STACK WIN 4 285a f 5 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 2869 129 1a 0 c 8 328 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 812 - ^ = $24 $T0 816 - ^ =
+STACK WIN 4 2992 25 3 0 14 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
+STACK WIN 4 2995 21 0 0 14 4 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = $23 $T0 4 - ^ =
+STACK WIN 4 29b7 2d 5 0 14 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 29e4 10 0 0 0 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
+STACK WIN 4 29f4 4a 4 0 0 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
+STACK WIN 4 29f7 3a 1 0 0 4 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = $23 $T0 4 - ^ =
+STACK WIN 4 29f8 38 0 0 0 8 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = $23 $T0 4 - ^ = $24 $T0 8 - ^ =
+STACK WIN 4 2a3e 57 a 0 0 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
+STACK WIN 4 2a41 53 7 0 0 4 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = $20 $T0 4 - ^ =
+STACK WIN 4 2a48 4b 0 0 0 8 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = $20 $T0 4 - ^ = $23 $T0 8 - ^ =
+STACK WIN 4 2a4e 2a 0 0 0 c 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = $20 $T0 4 - ^ = $23 $T0 8 - ^ = $24 $T0 12 - ^ =
+STACK WIN 4 2a95 17 5 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 2aac c2 c 0 4 10 1c 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 32 - ^ = $23 $T0 36 - ^ = $24 $T0 40 - ^ =
+STACK WIN 4 2b65 8 0 0 4 10 1c 0 1 $T0 $ebp = $T2 $esp = $T1 .raSearchStart = $eip $T1 ^ = $ebp $T0 = $esp $T1 4 + =
+STACK WIN 4 2b6e 33 9 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 2b77 28 0 0 4 4 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $23 $T0 4 - ^ =
+STACK WIN 4 2ba1 5f a 0 c 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 2baa 54 1 0 c 4 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $23 $T0 4 - ^ =
+STACK WIN 4 2bab 52 0 0 c 8 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $23 $T0 4 - ^ = $24 $T0 8 - ^ =
+STACK WIN 4 2c8b 94 6 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 2c91 8c 0 0 4 4 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 4 - ^ =
+STACK WIN 4 2c9a 6c 0 0 4 8 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 4 - ^ = $23 $T0 8 - ^ =
+STACK WIN 4 2c9b 6a 0 0 4 c 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 4 - ^ = $23 $T0 8 - ^ = $24 $T0 12 - ^ =
+STACK WIN 4 2e72 42 5 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 2eb4 13 0 0 0 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
+STACK WIN 4 2ec7 39 c 0 0 10 18 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 28 - ^ = $23 $T0 32 - ^ = $24 $T0 36 - ^ =
+STACK WIN 4 2ee7 4 0 0 0 10 18 0 1 $T0 $ebp = $T2 $esp = $T1 .raSearchStart = $eip $T1 ^ = $ebp $T0 = $esp $T1 4 + =
+STACK WIN 4 2f00 11 0 0 4 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
+STACK WIN 4 2f11 1e 5 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 2f2f 37 5 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 2f3e 1b 0 0 4 4 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $23 $T0 4 - ^ =
+STACK WIN 4 2f66 d 0 0 0 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
+STACK WIN 4 2f73 1a3 c 0 4 10 30 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 52 - ^ = $23 $T0 56 - ^ = $24 $T0 60 - ^ =
+STACK WIN 4 30d4 14 0 0 4 10 30 0 1 $T0 $ebp = $T2 $esp = $T1 .raSearchStart = $eip $T1 ^ = $ebp $T0 = $esp $T1 4 + =
+STACK WIN 4 3116 f 5 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 3125 f 5 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 3134 f 5 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 3143 28 5 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 316b b6 f 0 4 0 4 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 3172 ad 8 0 4 4 4 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 8 - ^ =
+STACK WIN 4 3173 ab 7 0 4 8 4 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 8 - ^ = $23 $T0 12 - ^ =
+STACK WIN 4 317a a3 0 0 4 c 4 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 8 - ^ = $23 $T0 12 - ^ = $24 $T0 16 - ^ =
+STACK WIN 4 3221 31 3 0 0 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
+STACK WIN 4 3224 2d 0 0 0 4 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = $23 $T0 4 - ^ =
+STACK WIN 4 3252 3c c 0 4 10 1c 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 32 - ^ = $23 $T0 36 - ^ = $24 $T0 40 - ^ =
+STACK WIN 4 3288 5 0 0 4 10 1c 0 1 $T0 $ebp = $T2 $esp = $T1 .raSearchStart = $eip $T1 ^ = $ebp $T0 = $esp $T1 4 + =
+STACK WIN 4 328e 17 5 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 32a5 23 4 0 0 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
+STACK WIN 4 32a8 1f 1 0 0 4 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = $23 $T0 4 - ^ =
+STACK WIN 4 32a9 1d 0 0 0 8 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = $23 $T0 4 - ^ = $24 $T0 8 - ^ =
+STACK WIN 4 32d0 35 5 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 3310 44 1a 0 8 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 3322 30 8 0 8 4 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 4 - ^ =
+STACK WIN 4 3323 2e 7 0 8 8 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 4 - ^ = $23 $T0 8 - ^ =
+STACK WIN 4 332a 26 0 0 8 c 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 4 - ^ = $23 $T0 8 - ^ = $24 $T0 12 - ^ =
+STACK WIN 4 3360 bc 35 0 4 10 18 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 28 - ^ = $23 $T0 32 - ^ = $24 $T0 36 - ^ =
+STACK WIN 4 33eb 13 0 0 4 10 18 0 1 $T0 $ebp = $T2 $esp = $T1 .raSearchStart = $eip $T1 ^ = $ebp $T0 = $esp $T1 4 + =
+STACK WIN 4 341c 16c 1e 0 c 0 24 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 3432 14f 8 0 c 4 24 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 40 - ^ =
+STACK WIN 4 3439 145 1 0 c 8 24 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 40 - ^ = $23 $T0 44 - ^ =
+STACK WIN 4 343a 143 0 0 c c 24 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 40 - ^ = $23 $T0 44 - ^ = $24 $T0 48 - ^ =
+STACK WIN 4 3588 75 a 0 c 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 358e 22 4 0 c 4 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $23 $T0 4 - ^ =
+STACK WIN 4 3592 1d 0 0 c 8 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $23 $T0 4 - ^ = $24 $T0 8 - ^ =
+STACK WIN 4 35fd cd e 0 10 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 3606 17 5 0 10 4 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 4 - ^ =
+STACK WIN 4 360a 28 1 0 10 8 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 4 - ^ = $23 $T0 8 - ^ =
+STACK WIN 4 360b 10 0 0 10 c 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 4 - ^ = $23 $T0 8 - ^ = $24 $T0 12 - ^ =
+STACK WIN 4 36ca 1b 5 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 36e5 63 a 0 c 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 36eb 22 4 0 c 4 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $23 $T0 4 - ^ =
+STACK WIN 4 36ef 1d 0 0 c 8 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $23 $T0 4 - ^ = $24 $T0 8 - ^ =
+STACK WIN 4 3748 3f 5 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 3787 f 0 0 0 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
+STACK WIN 4 3796 45 7 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 379c 3d 1 0 4 4 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $23 $T0 4 - ^ =
+STACK WIN 4 379d 3b 0 0 4 8 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $23 $T0 4 - ^ = $24 $T0 8 - ^ =
+STACK WIN 4 37db 4c 7 0 8 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 37e1 44 1 0 8 4 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $23 $T0 4 - ^ =
+STACK WIN 4 37e2 42 0 0 8 8 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $23 $T0 4 - ^ = $24 $T0 8 - ^ =
+STACK WIN 4 3827 4e 7 0 8 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 382d 46 1 0 8 4 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $23 $T0 4 - ^ =
+STACK WIN 4 382e 44 0 0 8 8 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $23 $T0 4 - ^ = $24 $T0 8 - ^ =
+STACK WIN 4 3875 2f 0 0 0 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
+STACK WIN 4 38a4 64 6 0 0 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
+STACK WIN 4 38a7 60 3 0 0 4 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = $23 $T0 4 - ^ =
+STACK WIN 4 38a8 5e 2 0 0 8 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = $23 $T0 4 - ^ = $24 $T0 8 - ^ =
+STACK WIN 4 3908 190 17 0 0 0 51c 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 391e 173 1 0 0 4 51c 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 1312 - ^ =
+STACK WIN 4 391f 16f 0 0 0 8 51c 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 1312 - ^ = $24 $T0 1316 - ^ =
+STACK WIN 4 3a98 a4 c 0 0 10 1c 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 32 - ^ = $23 $T0 36 - ^ = $24 $T0 40 - ^ =
+STACK WIN 4 3b30 b 0 0 0 10 1c 0 1 $T0 $ebp = $T2 $esp = $T1 .raSearchStart = $eip $T1 ^ = $ebp $T0 = $esp $T1 4 + =
+STACK WIN 4 3b3c 87 b 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 3b45 7a 2 0 4 4 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $23 $T0 4 - ^ =
+STACK WIN 4 3bc3 7c 9 0 0 0 10 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 3bcc 71 0 0 0 4 10 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 20 - ^ =
+STACK WIN 4 3c3f 1e9 1b 0 8 0 20 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 3c52 1cf 8 0 8 4 20 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 36 - ^ =
+STACK WIN 4 3c56 1c8 4 0 8 8 20 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 36 - ^ = $23 $T0 40 - ^ =
+STACK WIN 4 3c5a 1c3 0 0 8 c 20 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 36 - ^ = $23 $T0 40 - ^ = $24 $T0 44 - ^ =
+STACK WIN 4 3e28 19a c 0 4 10 24 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 40 - ^ = $23 $T0 44 - ^ = $24 $T0 48 - ^ =
+STACK WIN 4 3f89 8 0 0 4 10 24 0 1 $T0 $ebp = $T2 $esp = $T1 .raSearchStart = $eip $T1 ^ = $ebp $T0 = $esp $T1 4 + =
+STACK WIN 4 3fc2 1e 0 0 0 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
+STACK WIN 4 3fe0 53 8 0 10 0 10 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 4033 18 5 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 404b 8f e 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 4051 87 8 0 4 4 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 4 - ^ =
+STACK WIN 4 4052 85 7 0 4 8 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 4 - ^ = $23 $T0 8 - ^ =
+STACK WIN 4 4059 7d 0 0 4 c 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 4 - ^ = $23 $T0 8 - ^ = $24 $T0 12 - ^ =
+STACK WIN 4 40da 99 6 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 40e0 91 0 0 4 4 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $24 $T0 4 - ^ =
+STACK WIN 4 40ec 82 0 0 4 8 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $24 $T0 4 - ^ = $20 $T0 8 - ^ =
+STACK WIN 4 40ed 80 0 0 4 c 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $24 $T0 4 - ^ = $20 $T0 8 - ^ = $23 $T0 12 - ^ =
+STACK WIN 4 4173 14b 13 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 4179 143 d 0 4 4 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 4 - ^ =
+STACK WIN 4 417a 141 c 0 4 8 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 4 - ^ = $23 $T0 8 - ^ =
+STACK WIN 4 4186 134 0 0 4 c 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 4 - ^ = $23 $T0 8 - ^ = $24 $T0 12 - ^ =
+STACK WIN 4 42be 4d 6 0 8 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 42c4 45 0 0 8 4 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $24 $T0 4 - ^ =
+STACK WIN 4 42d3 31 0 0 8 8 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $24 $T0 4 - ^ = $23 $T0 8 - ^ =
+STACK WIN 4 430b 79 c 0 0 10 1c 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 32 - ^ = $23 $T0 36 - ^ = $24 $T0 40 - ^ =
+STACK WIN 4 4378 8 0 0 0 10 1c 0 1 $T0 $ebp = $T2 $esp = $T1 .raSearchStart = $eip $T1 ^ = $ebp $T0 = $esp $T1 4 + =
+STACK WIN 4 4384 8 0 0 4 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
+STACK WIN 4 45e7 33 0 0 0 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
+STACK WIN 4 4981 20 5 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 49a1 33 5 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 49d4 9 0 0 0 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
+STACK WIN 4 49dd 106 b 0 0 0 328 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 4ae3 82 5 0 c 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 4b0f 54 0 0 c 4 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $23 $T0 4 - ^ =
+STACK WIN 4 4b65 ad 5 0 8 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 4b7c 62 0 0 8 4 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $23 $T0 4 - ^ =
+STACK WIN 4 4b91 4c 0 0 8 8 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $23 $T0 4 - ^ = $24 $T0 8 - ^ =
+STACK WIN 4 4c12 1e7 1a 0 24 c 10 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 20 - ^ = $23 $T0 24 - ^ = $24 $T0 28 - ^ =
+STACK WIN 4 4df9 46 8 0 24 0 10 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 4e3f e7 16 0 1c c 8 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $20 $T0 12 - ^ = $23 $T0 16 - ^ = $24 $T0 20 - ^ =
+STACK WIN 4 4f26 40 8 0 20 0 10 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 4f66 377 6 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 4f6c 36f 0 0 4 4 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $23 $T0 4 - ^ =
+STACK WIN 4 52dd 69 6 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 52e3 61 0 0 4 4 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $23 $T0 4 - ^ =
+STACK WIN 4 5346 fe 6 0 4 0 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =
+STACK WIN 4 534c f6 0 0 4 4 0 0 1 $T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $23 $T0 4 - ^ =
+STACK WIN 4 5444 ba 0 0 c 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
+STACK WIN 4 54fe 10 0 0 0 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
+STACK WIN 4 550e 103 0 0 c 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
+STACK WIN 0 12d4 14 0 0 0 0 0 0 0 0
+STACK WIN 0 1383 9 0 0 0 0 0 0 0 0
+STACK WIN 0 1390 88 0 0 8 0 0 0 0 0
+STACK WIN 0 1710 f 0 0 0 0 0 0 0 0
+STACK WIN 0 225d f 0 0 0 0 0 0 0 0
+STACK WIN 0 226c 9 0 0 0 0 0 0 0 0
+STACK WIN 0 241f c 0 0 0 0 0 0 0 0
+STACK WIN 0 242b c 0 0 0 0 0 0 0 0
+STACK WIN 0 2b65 9 0 0 0 0 0 0 0 0
+STACK WIN 0 2c00 8b 0 0 4 0 0 0 0 0
+STACK WIN 0 2d20 90 3 0 c c 0 0 0 0
+STACK WIN 0 2db0 46 0 0 10 4 0 0 0 1
+STACK WIN 0 2e12 17 4 0 0 10 0 0 0 1
+STACK WIN 0 2e29 19 0 0 0 0 0 0 0 0
+STACK WIN 0 2e5b 17 1 0 8 4 0 0 0 1
+STACK WIN 0 2ee7 4 0 0 0 0 0 0 0 0
+STACK WIN 0 30d4 15 0 0 0 0 0 0 0 0
+STACK WIN 0 3288 6 0 0 0 0 0 0 0 0
+STACK WIN 0 33eb 13 0 0 0 0 0 0 0 0
+STACK WIN 0 3b30 c 0 0 0 0 0 0 0 0
+STACK WIN 0 3f89 9 0 0 0 0 0 0 0 0
+STACK WIN 0 4378 9 0 0 0 0 0 0 0 0
+STACK WIN 0 4390 7a 0 0 c 0 0 0 0 0
+STACK WIN 0 4410 95 0 0 10 0 4 0 0 0
+STACK WIN 0 4515 84 3 0 8 c 0 0 0 0
+STACK WIN 0 4599 23 0 0 0 0 0 0 0 0
+STACK WIN 0 45e4 3 0 0 0 0 0 0 0 0
+STACK WIN 0 5650 1a 0 0 10 0 0 0 0 0
+STACK WIN 0 566a 1a 0 0 10 0 4 0 0 0
diff --git a/src/tools/windows/dump_syms/testdata/dump_syms_regtest64.exe b/src/tools/windows/dump_syms/testdata/dump_syms_regtest64.exe
new file mode 100755
index 00000000..6f6d5d13
--- /dev/null
+++ b/src/tools/windows/dump_syms/testdata/dump_syms_regtest64.exe
Binary files differ
diff --git a/src/tools/windows/dump_syms/testdata/dump_syms_regtest64.pdb b/src/tools/windows/dump_syms/testdata/dump_syms_regtest64.pdb
index 86d362ec..8257eb72 100644
--- a/src/tools/windows/dump_syms/testdata/dump_syms_regtest64.pdb
+++ b/src/tools/windows/dump_syms/testdata/dump_syms_regtest64.pdb
Binary files differ
diff --git a/src/tools/windows/dump_syms/testdata/dump_syms_regtest64.sym b/src/tools/windows/dump_syms/testdata/dump_syms_regtest64.sym
index 6f5cd1bd..eb839165 100644
--- a/src/tools/windows/dump_syms/testdata/dump_syms_regtest64.sym
+++ b/src/tools/windows/dump_syms/testdata/dump_syms_regtest64.sym
@@ -1,6 +1,6 @@
MODULE windows x86_64 72E103A85CB249078B76B2E7C06257B13 dump_syms_regtest64.pdb
-INFO CODE_ID 5357F5C01A000 dump_syms_regtest64.exe
-FILE 1 d:\src\breakpad\src\tools\windows\dump_syms\testdata\dump_syms_regtest64.cc
+INFO CODE_ID 589DFD111A000 dump_syms_regtest64.exe
+FILE 1 c:\cygwin64\wip\breakpad-depot\src\src\tools\windows\dump_syms\testdata\dump_syms_regtest.cc
FILE 2 f:\dd\vctools\crt\crtw32\misc\amd64\amdsecgs.asm
FILE 3 f:\dd\ExternalAPIs\Windows\WinBlue\sdk\inc\ksamd64.inc
FILE 4 f:\dd\ExternalAPIs\Windows\WinBlue\sdk\inc\kxamd64.inc
@@ -322,7 +322,7 @@ FILE 10842 f:\dd\vctools\crt\crtw32\eh\typinfo.cpp
FILE 10933 f:\dd\vctools\crt\crtw32\eh\hooks.cpp
FILE 11032 f:\dd\vctools\crt\crtw32\rtc\initsect.cpp
FILE 11055 f:\dd\vctools\crt\crtw32\h\rtcpriv.h
-FUNC 1000 6 0 google_breakpad::i
+FUNC 1000 6 0 static int google_breakpad::i()
1000 0 51 1
1000 5 52 1
1005 1 53 1
@@ -352,7 +352,7 @@ FUNC 1178 5 0 operator delete(void *)
1178 0 20 6742
1178 5 23 6742
FUNC 1180 39 0 type_info::`scalar deleting destructor'(unsigned int)
-FUNC 11bc 180 0 __tmainCRTStartup
+FUNC 11bc 180 0 static int __tmainCRTStartup()
11bc a 172 9116
11c6 c 188 9116
11d2 4e 196 9116
@@ -384,7 +384,7 @@ FUNC 11bc 180 0 __tmainCRTStartup
1329 6 278 9116
132f 2 282 9116
1331 b 283 9116
-FUNC 133c 2c 0 fast_error_exit
+FUNC 133c 2c 0 static void fast_error_exit(int)
133c 6 305 9116
1342 b 315 9116
134d 5 317 9116
@@ -652,7 +652,7 @@ FUNC 1b4c 4b 0 init_pointers
1b85 8 889 9790
1b8d 5 900 9790
1b92 5 893 9790
-FUNC 1b98 60 0 _initterm
+FUNC 1b98 60 0 static void _initterm( * *, * *)
1b98 30 941 9790
1bc8 5 948 9790
1bcd 8 953 9790
@@ -673,7 +673,7 @@ FUNC 1c34 a 0 lockexit
FUNC 1c40 a 0 unlockexit
1c40 0 851 9790
1c40 a 852 9790
-FUNC 1c4c 195 0 doexit
+FUNC 1c4c 195 0 static void doexit(int, int, int)
1c4c 24 552 9790
1c70 b 568 9790
1c7b d 571 9790
@@ -799,7 +799,7 @@ FUNC 2140 f3 0 setargv
221c 4 177 9411
2220 3 138 9411
2223 10 178 9411
-FUNC 2234 1c7 0 parse_cmdline
+FUNC 2234 1c7 0 static void parse_cmdline(char *, char * *, char *, int *, int *)
2234 1d 223 9411
2251 15 230 9411
2266 7 231 9411
@@ -1524,7 +1524,7 @@ FUNC 3ef8 a8 0 _LocaleUpdate::_LocaleUpdate(localeinfo_struct *)
3f8e 2 260 208
3f90 7 262 208
3f97 9 264 208
-FUNC 3fa0 7d 0 getSystemCP
+FUNC 3fa0 7d 0 static int getSystemCP(int)
3fa0 8 295 8253
3fa8 c 297 8253
3fb4 7 298 8253
@@ -1538,7 +1538,7 @@ FUNC 3fa0 7d 0 getSystemCP
3ff0 12 320 8253
4002 15 323 8253
4017 6 324 8253
-FUNC 4020 8e 0 setSBCS
+FUNC 4020 8e 0 static void setSBCS(struct threadmbcinfostruct *)
4020 14 374 8253
4034 7 378 8253
403b 12 379 8253
@@ -1550,7 +1550,7 @@ FUNC 4020 8e 0 setSBCS
4080 c 395 8253
408c d 396 8253
4099 15 397 8253
-FUNC 40b0 1e1 0 setSBUpLow
+FUNC 40b0 1e1 0 static void setSBUpLow(struct threadmbcinfostruct *)
40b0 2e 413 8253
40de e 423 8253
40ec 14 426 8253
@@ -1872,7 +1872,7 @@ FUNC 4f28 1d 0 unlock_file2
4f2d 5 342 5182
4f32 8 343 5182
4f3a b 351 5182
-FUNC 4f48 79 0 x_ismbbtype_l
+FUNC 4f48 79 0 static int x_ismbbtype_l(struct localeinfo_struct *, unsigned int, int, int)
4f48 11 223 8159
4f59 13 224 8159
4f6c 45 232 8159
@@ -2332,7 +2332,7 @@ FUNC 5a6c 3fa 0 _free_lc_time
5e48 c 331 3520
5e54 c 333 3520
5e60 6 336 3520
-FUNC 5e68 2ec 0 __crtLCMapStringA_stat
+FUNC 5e68 2ec 0 static int __crtLCMapStringA_stat(struct localeinfo_struct *, const wchar_t *, unsigned long, const char *, int, char *, int, int, int)
5e68 2d 96 8449
5e95 13 101 8449
5ea8 21 102 8449
@@ -2368,7 +2368,7 @@ FUNC 6154 96 0 _crtLCMapStringA
6166 13 259 8449
6179 5f 271 8449
61d8 12 272 8449
-FUNC 61ec 176 0 __crtGetStringTypeA_stat
+FUNC 61ec 176 0 static int __crtGetStringTypeA_stat(struct localeinfo_struct *, unsigned long, const char *, int, unsigned short *, int, int)
61ec 2d 60 8545
6219 14 80 8545
622d 7 81 8545
@@ -2841,7 +2841,7 @@ FUNC 6c1c 79 0 flush
FUNC 6c98 a 0 flushall
6c98 0 193 5660
6c98 a 194 5660
-FUNC 6ca4 e6 0 flsall
+FUNC 6ca4 e6 0 static int flsall(int)
6ca4 1c 228 5660
6cc0 2 230 5660
6cc2 2 231 5660
@@ -3645,7 +3645,7 @@ FUNC 9b08 3b0 0 cftoa_l
9e7e 4 626 9904
9e82 16 628 9904
9e98 20 629 9904
-FUNC 9eb8 1f9 0 _cftoe2_l
+FUNC 9eb8 1f9 0 static int _cftoe2_l(char *, unsigned __int64, int, int, struct _strflt *, char, struct localeinfo_struct *)
9eb8 20 242 9904
9ed8 1a 246 9904
9ef2 5 249 9904
@@ -3691,7 +3691,7 @@ a15b 3 376 9904
a15e 2 377 9904
a160 32 380 9904
a192 19 383 9904
-FUNC a1ac 161 0 _cftof2_l
+FUNC a1ac 161 0 static int _cftof2_l(char *, unsigned __int64, int, struct _strflt *, char, struct localeinfo_struct *)
a1ac 19 638 9904
a1c5 7 640 9904
a1cc 19 641 9904
@@ -4097,76 +4097,76 @@ b952 15 130 9988
b967 15 136 9988
PUBLIC b97c 0 RtlUnwindEx
PUBLIC b982 0 IsProcessorFeaturePresent
-FUNC b990 1e 0 __tmainCRTStartup$filt$0
+FUNC b990 1e 0 static __tmainCRTStartup$filt$0()
b990 1e 267 9116
-FUNC b9ae 19 0 `type_info::_Type_info_dtor'::`1'::fin$0
+FUNC b9ae 19 0 static `type_info::_Type_info_dtor'::`1'::fin$0()
b9ae 9 72 10741
b9b7 10 73 10741
-FUNC b9c7 19 0 _freefls$fin$1
+FUNC b9c7 19 0 static _freefls$fin$1()
b9c7 9 413 9313
b9d0 10 414 9313
-FUNC b9e0 19 0 _freefls$fin$0
+FUNC b9e0 19 0 static _freefls$fin$0()
b9e0 9 429 9313
b9e9 10 430 9313
-FUNC b9f9 19 0 _initptd$fin$1
+FUNC b9f9 19 0 static _initptd$fin$1()
b9f9 9 226 9313
ba02 10 228 9313
-FUNC ba12 19 0 _initptd$fin$0
+FUNC ba12 19 0 static _initptd$fin$0()
ba12 9 247 9313
ba1b 10 248 9313
-FUNC ba2b 24 0 doexit$fin$0
+FUNC ba2b 24 0 static doexit$fin$0()
ba2b 9 665 9790
ba34 9 666 9790
ba3d 12 667 9790
-FUNC ba4f 1b 0 _ioinit$fin$0
+FUNC ba4f 1b 0 static _ioinit$fin$0()
ba4f 9 325 1584
ba58 12 326 1584
-FUNC ba6a 1d 0 _mtinitlocknum$fin$0
+FUNC ba6a 1d 0 static _mtinitlocknum$fin$0()
ba6a 9 292 9509
ba73 14 293 9509
-FUNC ba87 19 0 __updatetlocinfo$fin$0
+FUNC ba87 19 0 static __updatetlocinfo$fin$0()
ba87 9 293 3702
ba90 10 295 3702
-FUNC baa0 19 0 __updatetmbcinfo$fin$0
+FUNC baa0 19 0 static __updatetmbcinfo$fin$0()
baa0 9 538 8253
baa9 10 540 8253
-FUNC bab9 19 0 _setmbcp$fin$0
+FUNC bab9 19 0 static _setmbcp$fin$0()
bab9 9 659 8253
bac2 10 661 8253
-FUNC bae0 20 0 _IsNonwritableInCurrentImage$filt$0
+FUNC bae0 20 0 static _IsNonwritableInCurrentImage$filt$0()
bae0 20 181 3978
-FUNC bb00 14 0 _onexit$fin$0
+FUNC bb00 14 0 static _onexit$fin$0()
bb00 e 89 3795
bb0e 6 90 3795
-FUNC bb14 1e 0 raise$fin$0
+FUNC bb14 1e 0 static raise$fin$0()
bb14 9 574 4150
bb1d 6 575 4150
bb23 f 576 4150
-FUNC bb32 28 0 flsall$fin$0
+FUNC bb32 28 0 static flsall$fin$0()
bb32 9 276 5660
bb3b 1f 277 5660
-FUNC bb5a 19 0 flsall$fin$1
+FUNC bb5a 19 0 static flsall$fin$1()
bb5a 9 282 5660
bb63 10 283 5660
-FUNC bb73 19 0 _fcloseall$fin$0
+FUNC bb73 19 0 static _fcloseall$fin$0()
bb73 9 69 5472
bb7c 10 70 5472
-FUNC bb8c 19 0 _locterm$fin$0
+FUNC bb8c 19 0 static _locterm$fin$0()
bb8c 9 193 4530
bb95 10 195 4530
-FUNC bba5 17 0 _commit$fin$0
+FUNC bba5 17 0 static _commit$fin$0()
bba5 9 72 1490
bbae e 73 1490
-FUNC bbbc 17 0 _write$fin$0
+FUNC bbbc 17 0 static _write$fin$0()
bbbc 9 81 1964
bbc5 e 82 1964
-FUNC bbd3 18 0 fclose$fin$0
+FUNC bbd3 18 0 static fclose$fin$0()
bbd3 9 58 5556
bbdc f 59 5556
-FUNC bbeb 19 0 __lock_fhandle$fin$0
+FUNC bbeb 19 0 static __lock_fhandle$fin$0()
bbeb 9 451 1865
bbf4 10 452 1865
-FUNC bc04 17 0 _close$fin$0
+FUNC bc04 17 0 static _close$fin$0()
bc04 9 60 1396
bc0d e 61 1396
STACK CFI INIT 1010 6a .cfa: $rsp .ra: .cfa 8 - ^
diff --git a/src/tools/windows/dump_syms/testdata/omap_reorder_bbs.sym b/src/tools/windows/dump_syms/testdata/omap_reorder_bbs.sym
index 716bf33a..2a7c0896 100644
--- a/src/tools/windows/dump_syms/testdata/omap_reorder_bbs.sym
+++ b/src/tools/windows/dump_syms/testdata/omap_reorder_bbs.sym
@@ -1,5 +1,4 @@
MODULE windows x86 99302CF6F3C244F2B8E048BA0268A12F1 omap_reorder_bbs.pdb
-INFO CODE_ID 517C17D711000 omap_reorder_bbs.exe
FILE 1 c:\src\breakpad\src\src\tools\windows\dump_syms\testdata\dump_syms_regtest.cc
FILE 2 f:\dd\public\sdk\inc\internal\pebteb.h
FILE 3 f:\dd\public\sdk\inc\internal\ntldr.h
@@ -291,7 +290,7 @@ FUNC 2cec 54 0 main
2d1b f 62 1
2d2a 12 64 1
2d3c 4 65 1
-FUNC 4b70 a 0 google_breakpad::i
+FUNC 4b70 a 0 static int google_breakpad::i()
4b70 3 51 1
4b73 5 52 1
4b78 2 53 1
@@ -321,10 +320,10 @@ FUNC 12a0 b 0 operator delete(void *)
12a0 5 20 2875
12a5 1 24 2875
12a6 5 23 2875
-FUNC 198c 4 0 fast_error_exit
-FUNC 1ff0 18 0 fast_error_exit
-FUNC 455c 12 0 fast_error_exit
-FUNC 4d0c 5 0 fast_error_exit
+FUNC 198c 4 0 static void fast_error_exit(int)
+FUNC 1ff0 18 0 static void fast_error_exit(int)
+FUNC 455c 12 0 static void fast_error_exit(int)
+FUNC 4d0c 5 0 static void fast_error_exit(int)
1ff0 5 326 4250
1ff5 13 335 4250
4d0c 5 337 4250
@@ -332,7 +331,7 @@ FUNC 4d0c 5 0 fast_error_exit
198c 2 340 4250
4564 a 340 4250
198e 2 341 4250
-FUNC 38be 161 0 __tmainCRTStartup
+FUNC 38be 161 0 static int __tmainCRTStartup()
38be c 196 4250
38ca a 214 4250
38d4 b 216 4250
@@ -557,7 +556,7 @@ FUNC 6f60 2 0 _cinit
1d44 c 303 4186
4bf8 2 307 4186
6f60 2 308 4186
-FUNC 35a7 140 0 doexit
+FUNC 35a7 140 0 static void doexit(int, int, int)
35a7 c 489 4186
35b3 8 507 4186
35bb 4 508 4186
@@ -810,61 +809,61 @@ FUNC 4139 dc 0 _setenvp
41fc 7 130 3838
4203 5 131 3838
4208 d 133 3838
-FUNC 1018 8 0 parse_cmdline
-FUNC 19b4 e 0 parse_cmdline
-FUNC 19f4 2 0 parse_cmdline
-FUNC 1dd0 14 0 parse_cmdline
-FUNC 1fac 28 0 parse_cmdline
-FUNC 2058 f 0 parse_cmdline
-FUNC 209c 9 0 parse_cmdline
-FUNC 2364 1a 0 parse_cmdline
-FUNC 253c 4 0 parse_cmdline
-FUNC 2598 9 0 parse_cmdline
-FUNC 25cc 10 0 parse_cmdline
-FUNC 2718 b 0 parse_cmdline
-FUNC 2730 e 0 parse_cmdline
-FUNC 28a8 a 0 parse_cmdline
-FUNC 28fc 2 0 parse_cmdline
-FUNC 290c 14 0 parse_cmdline
-FUNC 2b34 f 0 parse_cmdline
-FUNC 2bfc 10 0 parse_cmdline
-FUNC 2d88 7 0 parse_cmdline
-FUNC 3730 d 0 parse_cmdline
-FUNC 377c 2 0 parse_cmdline
-FUNC 37b0 10 0 parse_cmdline
-FUNC 3c38 24 0 parse_cmdline
-FUNC 3c84 10 0 parse_cmdline
-FUNC 3db8 1b 0 parse_cmdline
-FUNC 3e90 e 0 parse_cmdline
-FUNC 3efc 13 0 parse_cmdline
-FUNC 4110 12 0 parse_cmdline
-FUNC 42dc f 0 parse_cmdline
-FUNC 42f0 10 0 parse_cmdline
-FUNC 4518 6 0 parse_cmdline
-FUNC 4610 7 0 parse_cmdline
-FUNC 4684 11 0 parse_cmdline
-FUNC 46f8 13 0 parse_cmdline
-FUNC 4848 a 0 parse_cmdline
-FUNC 4994 f 0 parse_cmdline
-FUNC 49bc e 0 parse_cmdline
-FUNC 4aac 1 0 parse_cmdline
-FUNC 4cb8 f 0 parse_cmdline
-FUNC 4ed8 24 0 parse_cmdline
-FUNC 4f10 3 0 parse_cmdline
-FUNC 4f30 e 0 parse_cmdline
-FUNC 501c 10 0 parse_cmdline
-FUNC 5518 3 0 parse_cmdline
-FUNC 569c 3 0 parse_cmdline
-FUNC 57bc 12 0 parse_cmdline
-FUNC 5a50 10 0 parse_cmdline
-FUNC 5cc0 14 0 parse_cmdline
-FUNC 5e84 f 0 parse_cmdline
-FUNC 6448 f 0 parse_cmdline
-FUNC 6530 e 0 parse_cmdline
-FUNC 66b0 13 0 parse_cmdline
-FUNC 6970 4 0 parse_cmdline
-FUNC 6aec 7 0 parse_cmdline
-FUNC 6f30 e 0 parse_cmdline
+FUNC 1018 8 0 static void parse_cmdline(char *, char * *, char *, int *, int *)
+FUNC 19b4 e 0 static void parse_cmdline(char *, char * *, char *, int *, int *)
+FUNC 19f4 2 0 static void parse_cmdline(char *, char * *, char *, int *, int *)
+FUNC 1dd0 14 0 static void parse_cmdline(char *, char * *, char *, int *, int *)
+FUNC 1fac 28 0 static void parse_cmdline(char *, char * *, char *, int *, int *)
+FUNC 2058 f 0 static void parse_cmdline(char *, char * *, char *, int *, int *)
+FUNC 209c 9 0 static void parse_cmdline(char *, char * *, char *, int *, int *)
+FUNC 2364 1a 0 static void parse_cmdline(char *, char * *, char *, int *, int *)
+FUNC 253c 4 0 static void parse_cmdline(char *, char * *, char *, int *, int *)
+FUNC 2598 9 0 static void parse_cmdline(char *, char * *, char *, int *, int *)
+FUNC 25cc 10 0 static void parse_cmdline(char *, char * *, char *, int *, int *)
+FUNC 2718 b 0 static void parse_cmdline(char *, char * *, char *, int *, int *)
+FUNC 2730 e 0 static void parse_cmdline(char *, char * *, char *, int *, int *)
+FUNC 28a8 a 0 static void parse_cmdline(char *, char * *, char *, int *, int *)
+FUNC 28fc 2 0 static void parse_cmdline(char *, char * *, char *, int *, int *)
+FUNC 290c 14 0 static void parse_cmdline(char *, char * *, char *, int *, int *)
+FUNC 2b34 f 0 static void parse_cmdline(char *, char * *, char *, int *, int *)
+FUNC 2bfc 10 0 static void parse_cmdline(char *, char * *, char *, int *, int *)
+FUNC 2d88 7 0 static void parse_cmdline(char *, char * *, char *, int *, int *)
+FUNC 3730 d 0 static void parse_cmdline(char *, char * *, char *, int *, int *)
+FUNC 377c 2 0 static void parse_cmdline(char *, char * *, char *, int *, int *)
+FUNC 37b0 10 0 static void parse_cmdline(char *, char * *, char *, int *, int *)
+FUNC 3c38 24 0 static void parse_cmdline(char *, char * *, char *, int *, int *)
+FUNC 3c84 10 0 static void parse_cmdline(char *, char * *, char *, int *, int *)
+FUNC 3db8 1b 0 static void parse_cmdline(char *, char * *, char *, int *, int *)
+FUNC 3e90 e 0 static void parse_cmdline(char *, char * *, char *, int *, int *)
+FUNC 3efc 13 0 static void parse_cmdline(char *, char * *, char *, int *, int *)
+FUNC 4110 12 0 static void parse_cmdline(char *, char * *, char *, int *, int *)
+FUNC 42dc f 0 static void parse_cmdline(char *, char * *, char *, int *, int *)
+FUNC 42f0 10 0 static void parse_cmdline(char *, char * *, char *, int *, int *)
+FUNC 4518 6 0 static void parse_cmdline(char *, char * *, char *, int *, int *)
+FUNC 4610 7 0 static void parse_cmdline(char *, char * *, char *, int *, int *)
+FUNC 4684 11 0 static void parse_cmdline(char *, char * *, char *, int *, int *)
+FUNC 46f8 13 0 static void parse_cmdline(char *, char * *, char *, int *, int *)
+FUNC 4848 a 0 static void parse_cmdline(char *, char * *, char *, int *, int *)
+FUNC 4994 f 0 static void parse_cmdline(char *, char * *, char *, int *, int *)
+FUNC 49bc e 0 static void parse_cmdline(char *, char * *, char *, int *, int *)
+FUNC 4aac 1 0 static void parse_cmdline(char *, char * *, char *, int *, int *)
+FUNC 4cb8 f 0 static void parse_cmdline(char *, char * *, char *, int *, int *)
+FUNC 4ed8 24 0 static void parse_cmdline(char *, char * *, char *, int *, int *)
+FUNC 4f10 3 0 static void parse_cmdline(char *, char * *, char *, int *, int *)
+FUNC 4f30 e 0 static void parse_cmdline(char *, char * *, char *, int *, int *)
+FUNC 501c 10 0 static void parse_cmdline(char *, char * *, char *, int *, int *)
+FUNC 5518 3 0 static void parse_cmdline(char *, char * *, char *, int *, int *)
+FUNC 569c 3 0 static void parse_cmdline(char *, char * *, char *, int *, int *)
+FUNC 57bc 12 0 static void parse_cmdline(char *, char * *, char *, int *, int *)
+FUNC 5a50 10 0 static void parse_cmdline(char *, char * *, char *, int *, int *)
+FUNC 5cc0 14 0 static void parse_cmdline(char *, char * *, char *, int *, int *)
+FUNC 5e84 f 0 static void parse_cmdline(char *, char * *, char *, int *, int *)
+FUNC 6448 f 0 static void parse_cmdline(char *, char * *, char *, int *, int *)
+FUNC 6530 e 0 static void parse_cmdline(char *, char * *, char *, int *, int *)
+FUNC 66b0 13 0 static void parse_cmdline(char *, char * *, char *, int *, int *)
+FUNC 6970 4 0 static void parse_cmdline(char *, char * *, char *, int *, int *)
+FUNC 6aec 7 0 static void parse_cmdline(char *, char * *, char *, int *, int *)
+FUNC 6f30 e 0 static void parse_cmdline(char *, char * *, char *, int *, int *)
1fac 6 221 3891
1fb2 9 229 3891
1fbb 2 232 3891
@@ -1633,7 +1632,7 @@ FUNC 65a0 2 0 malloc
5b9e 2 113 504
22f5 2 122 504
FUNC 297c 90 0 _local_unwind4
-FUNC 2a0c 46 0 _unwind_handler4
+FUNC 2a0c 46 0 static void _unwind_handler4()
FUNC 2a52 1c 4 _seh_longjmp_unwind4
FUNC 2a6e 17 0 _EH4_CallFilterFunc
FUNC 2a85 19 0 _EH4_TransferToHandler
@@ -1688,13 +1687,13 @@ FUNC 15b8 1e 0 _initp_misc_winsig
15ca 5 60 2311
15cf 5 61 2311
15d4 2 62 2311
-FUNC 15d8 18 0 siglookup
-FUNC 3538 f 0 siglookup
-FUNC 42c8 14 0 siglookup
-FUNC 45c8 2 0 siglookup
-FUNC 4e1c f 0 siglookup
-FUNC 55f0 2 0 siglookup
-FUNC 63ac f 0 siglookup
+FUNC 15d8 18 0 static struct _XCPT_ACTION * siglookup(int, struct _XCPT_ACTION *)
+FUNC 3538 f 0 static struct _XCPT_ACTION * siglookup(int, struct _XCPT_ACTION *)
+FUNC 42c8 14 0 static struct _XCPT_ACTION * siglookup(int, struct _XCPT_ACTION *)
+FUNC 45c8 2 0 static struct _XCPT_ACTION * siglookup(int, struct _XCPT_ACTION *)
+FUNC 4e1c f 0 static struct _XCPT_ACTION * siglookup(int, struct _XCPT_ACTION *)
+FUNC 55f0 2 0 static struct _XCPT_ACTION * siglookup(int, struct _XCPT_ACTION *)
+FUNC 63ac f 0 static struct _XCPT_ACTION * siglookup(int, struct _XCPT_ACTION *)
63ac 5 629 2311
63b1 a 630 2311
15d8 18 639 2311
@@ -1786,19 +1785,19 @@ FUNC 6c18 5 0 _callnewh
6c1b 2 139 2820
60b0 2 136 2820
60b2 2 139 2820
-FUNC 2274 12 0 _onexit_nolock
-FUNC 2484 10 0 _onexit_nolock
-FUNC 2640 2 0 _onexit_nolock
-FUNC 2b88 10 0 _onexit_nolock
-FUNC 32ac 13 0 _onexit_nolock
-FUNC 4124 15 0 _onexit_nolock
-FUNC 43e8 33 0 _onexit_nolock
-FUNC 45f8 18 0 _onexit_nolock
-FUNC 4a2c 20 0 _onexit_nolock
-FUNC 4b68 2 0 _onexit_nolock
-FUNC 4bb8 18 0 _onexit_nolock
-FUNC 4d84 5 0 _onexit_nolock
-FUNC 6a0c 1a 0 _onexit_nolock
+FUNC 2274 12 0 static * _onexit_nolock( *)
+FUNC 2484 10 0 static * _onexit_nolock( *)
+FUNC 2640 2 0 static * _onexit_nolock( *)
+FUNC 2b88 10 0 static * _onexit_nolock( *)
+FUNC 32ac 13 0 static * _onexit_nolock( *)
+FUNC 4124 15 0 static * _onexit_nolock( *)
+FUNC 43e8 33 0 static * _onexit_nolock( *)
+FUNC 45f8 18 0 static * _onexit_nolock( *)
+FUNC 4a2c 20 0 static * _onexit_nolock( *)
+FUNC 4b68 2 0 static * _onexit_nolock( *)
+FUNC 4bb8 18 0 static * _onexit_nolock( *)
+FUNC 4d84 5 0 static * _onexit_nolock( *)
+FUNC 6a0c 1a 0 static * _onexit_nolock( *)
43e8 8 100 1969
43f0 f 103 1969
43ff f 104 1969
@@ -2171,15 +2170,15 @@ FUNC 6f20 9 0 _realloc_crt
2b5e e 79 333
38b8 4 82 333
38bc 2 83 333
-FUNC 28b4 c 0 CPtoLCID
-FUNC 3d08 6 0 CPtoLCID
-FUNC 5510 6 0 CPtoLCID
-FUNC 5600 6 0 CPtoLCID
-FUNC 5f14 3 0 CPtoLCID
-FUNC 6294 f 0 CPtoLCID
-FUNC 68f4 10 0 CPtoLCID
-FUNC 69cc 6 0 CPtoLCID
-FUNC 6fe0 e 0 CPtoLCID
+FUNC 28b4 c 0 static int CPtoLCID(int)
+FUNC 3d08 6 0 static int CPtoLCID(int)
+FUNC 5510 6 0 static int CPtoLCID(int)
+FUNC 5600 6 0 static int CPtoLCID(int)
+FUNC 5f14 3 0 static int CPtoLCID(int)
+FUNC 6294 f 0 static int CPtoLCID(int)
+FUNC 68f4 10 0 static int CPtoLCID(int)
+FUNC 69cc 6 0 static int CPtoLCID(int)
+FUNC 6fe0 e 0 static int CPtoLCID(int)
68f4 0 329 3326
28b4 c 330 3326
6294 f 330 3326
@@ -2195,11 +2194,11 @@ FUNC 6fe0 e 0 CPtoLCID
69d1 1 346 3326
5600 5 333 3326
5605 1 346 3326
-FUNC 2208 f 0 setSBCS
-FUNC 387c 3 0 setSBCS
-FUNC 48ac f 0 setSBCS
-FUNC 5900 44 0 setSBCS
-FUNC 6be0 b 0 setSBCS
+FUNC 2208 f 0 static void setSBCS(struct threadmbcinfostruct *)
+FUNC 387c 3 0 static void setSBCS(struct threadmbcinfostruct *)
+FUNC 48ac f 0 static void setSBCS(struct threadmbcinfostruct *)
+FUNC 5900 44 0 static void setSBCS(struct threadmbcinfostruct *)
+FUNC 6be0 b 0 static void setSBCS(struct threadmbcinfostruct *)
5900 6 363 3326
5906 11 368 3326
5917 1b 379 3326
@@ -2208,32 +2207,32 @@ FUNC 6be0 b 0 setSBCS
6be0 b 384 3326
48ac f 385 3326
387c 3 386 3326
-FUNC 12dc 18 0 setSBUpLow
-FUNC 1794 f 0 setSBUpLow
-FUNC 1b6c 7 0 setSBUpLow
-FUNC 2548 e 0 setSBUpLow
-FUNC 2c0c 39 0 setSBUpLow
-FUNC 3238 8 0 setSBUpLow
-FUNC 3e54 2 0 setSBUpLow
-FUNC 3ee0 16 0 setSBUpLow
-FUNC 445c 20 0 setSBUpLow
-FUNC 4800 f 0 setSBUpLow
-FUNC 4910 8 0 setSBUpLow
-FUNC 4a8c 12 0 setSBUpLow
-FUNC 4d8c e 0 setSBUpLow
-FUNC 566c f 0 setSBUpLow
-FUNC 56fc c 0 setSBUpLow
-FUNC 59e4 14 0 setSBUpLow
-FUNC 5aa8 6 0 setSBUpLow
-FUNC 5b08 17 0 setSBUpLow
-FUNC 5b60 14 0 setSBUpLow
-FUNC 5db4 12 0 setSBUpLow
-FUNC 6060 c 0 setSBUpLow
-FUNC 60b4 6 0 setSBUpLow
-FUNC 6218 f 0 setSBUpLow
-FUNC 62b8 6a 0 setSBUpLow
-FUNC 697c 3 0 setSBUpLow
-FUNC 6b44 1b 0 setSBUpLow
+FUNC 12dc 18 0 static void setSBUpLow(struct threadmbcinfostruct *)
+FUNC 1794 f 0 static void setSBUpLow(struct threadmbcinfostruct *)
+FUNC 1b6c 7 0 static void setSBUpLow(struct threadmbcinfostruct *)
+FUNC 2548 e 0 static void setSBUpLow(struct threadmbcinfostruct *)
+FUNC 2c0c 39 0 static void setSBUpLow(struct threadmbcinfostruct *)
+FUNC 3238 8 0 static void setSBUpLow(struct threadmbcinfostruct *)
+FUNC 3e54 2 0 static void setSBUpLow(struct threadmbcinfostruct *)
+FUNC 3ee0 16 0 static void setSBUpLow(struct threadmbcinfostruct *)
+FUNC 445c 20 0 static void setSBUpLow(struct threadmbcinfostruct *)
+FUNC 4800 f 0 static void setSBUpLow(struct threadmbcinfostruct *)
+FUNC 4910 8 0 static void setSBUpLow(struct threadmbcinfostruct *)
+FUNC 4a8c 12 0 static void setSBUpLow(struct threadmbcinfostruct *)
+FUNC 4d8c e 0 static void setSBUpLow(struct threadmbcinfostruct *)
+FUNC 566c f 0 static void setSBUpLow(struct threadmbcinfostruct *)
+FUNC 56fc c 0 static void setSBUpLow(struct threadmbcinfostruct *)
+FUNC 59e4 14 0 static void setSBUpLow(struct threadmbcinfostruct *)
+FUNC 5aa8 6 0 static void setSBUpLow(struct threadmbcinfostruct *)
+FUNC 5b08 17 0 static void setSBUpLow(struct threadmbcinfostruct *)
+FUNC 5b60 14 0 static void setSBUpLow(struct threadmbcinfostruct *)
+FUNC 5db4 12 0 static void setSBUpLow(struct threadmbcinfostruct *)
+FUNC 6060 c 0 static void setSBUpLow(struct threadmbcinfostruct *)
+FUNC 60b4 6 0 static void setSBUpLow(struct threadmbcinfostruct *)
+FUNC 6218 f 0 static void setSBUpLow(struct threadmbcinfostruct *)
+FUNC 62b8 6a 0 static void setSBUpLow(struct threadmbcinfostruct *)
+FUNC 697c 3 0 static void setSBUpLow(struct threadmbcinfostruct *)
+FUNC 6b44 1b 0 static void setSBUpLow(struct threadmbcinfostruct *)
2c0c 17 402 3326
2c23 10 412 3326
2c33 12 415 3326
@@ -2318,17 +2317,17 @@ FUNC 6cbc 1c 0 _LocaleUpdate::_LocaleUpdate(localeinfo_struct *)
4d7c 6 255 111
5f68 a 257 111
2904 7 259 111
-FUNC 19fc e 0 getSystemCP
-FUNC 2690 7 0 getSystemCP
-FUNC 2b98 3 0 getSystemCP
-FUNC 3b80 28 0 getSystemCP
-FUNC 3e18 c 0 getSystemCP
-FUNC 4710 f 0 getSystemCP
-FUNC 4868 10 0 getSystemCP
-FUNC 56bc 16 0 getSystemCP
-FUNC 5e20 16 0 getSystemCP
-FUNC 6020 1f 0 getSystemCP
-FUNC 6f64 2 0 getSystemCP
+FUNC 19fc e 0 static int getSystemCP(int)
+FUNC 2690 7 0 static int getSystemCP(int)
+FUNC 2b98 3 0 static int getSystemCP(int)
+FUNC 3b80 28 0 static int getSystemCP(int)
+FUNC 3e18 c 0 static int getSystemCP(int)
+FUNC 4710 f 0 static int getSystemCP(int)
+FUNC 4868 10 0 static int getSystemCP(int)
+FUNC 56bc 16 0 static int getSystemCP(int)
+FUNC 5e20 16 0 static int getSystemCP(int)
+FUNC 6020 1f 0 static int getSystemCP(int)
+FUNC 6f64 2 0 static int getSystemCP(int)
3b80 9 282 3326
3b89 b 284 3326
3b94 6 285 3326
@@ -2486,15 +2485,15 @@ FUNC 6234 13 0 __initmbctable
5ddc a 853 3326
165c 2 858 3326
165e 1 859 3326
-FUNC 1674 7 0 x_ismbbtype_l
-FUNC 1c0c 2c 0 x_ismbbtype_l
-FUNC 3d74 2 0 x_ismbbtype_l
-FUNC 4c90 e 0 x_ismbbtype_l
-FUNC 5430 16 0 x_ismbbtype_l
-FUNC 59b0 2 0 x_ismbbtype_l
-FUNC 6254 10 0 x_ismbbtype_l
-FUNC 643c 3 0 x_ismbbtype_l
-FUNC 6498 10 0 x_ismbbtype_l
+FUNC 1674 7 0 static int x_ismbbtype_l(struct localeinfo_struct *, unsigned int, int, int)
+FUNC 1c0c 2c 0 static int x_ismbbtype_l(struct localeinfo_struct *, unsigned int, int, int)
+FUNC 3d74 2 0 static int x_ismbbtype_l(struct localeinfo_struct *, unsigned int, int, int)
+FUNC 4c90 e 0 static int x_ismbbtype_l(struct localeinfo_struct *, unsigned int, int, int)
+FUNC 5430 16 0 static int x_ismbbtype_l(struct localeinfo_struct *, unsigned int, int, int)
+FUNC 59b0 2 0 static int x_ismbbtype_l(struct localeinfo_struct *, unsigned int, int, int)
+FUNC 6254 10 0 static int x_ismbbtype_l(struct localeinfo_struct *, unsigned int, int, int)
+FUNC 643c 3 0 static int x_ismbbtype_l(struct localeinfo_struct *, unsigned int, int, int)
+FUNC 6498 10 0 static int x_ismbbtype_l(struct localeinfo_struct *, unsigned int, int, int)
1c0c 8 213 3271
1c14 b 214 3271
1c1f 4 219 3271
@@ -2805,12 +2804,12 @@ FUNC 33f1 95 0 _aulldvrm
3482 1 180 2806
3483 3 182 2806
FUNC 675b 20 0 _global_unwind2
-FUNC 677b 45 0 __unwind_handler
+FUNC 677b 45 0 static void __unwind_handler()
FUNC 67c0 84 0 _local_unwind2
FUNC 6844 23 0 _abnormal_termination
FUNC 6867 9 0 _NLG_Notify1
FUNC 6870 1f 0 _NLG_Notify
-PUBLIC 6887 0 _NLG_Dispatch2
+PUBLIC m 6887 0 _NLG_Dispatch
FUNC 688f 3 0 _NLG_Call
PUBLIC 6891 0 _NLG_Return2
FUNC 4695 33 0 abort
@@ -3200,52 +3199,52 @@ FUNC 6734 14 0 realloc
5976 6 112 618
1048 16 103 618
2ae0 8 105 618
-FUNC 1000 7 0 __crtLCMapStringA_stat
-FUNC 11b0 14 0 __crtLCMapStringA_stat
-FUNC 17c4 8 0 __crtLCMapStringA_stat
-FUNC 1ac4 6 0 __crtLCMapStringA_stat
-FUNC 21f4 c 0 __crtLCMapStringA_stat
-FUNC 2234 9 0 __crtLCMapStringA_stat
-FUNC 2354 f 0 __crtLCMapStringA_stat
-FUNC 242c 12 0 __crtLCMapStringA_stat
-FUNC 2710 3 0 __crtLCMapStringA_stat
-FUNC 2794 b 0 __crtLCMapStringA_stat
-FUNC 28d0 13 0 __crtLCMapStringA_stat
-FUNC 31f8 5 0 __crtLCMapStringA_stat
-FUNC 327c 14 0 __crtLCMapStringA_stat
-FUNC 32c0 4a 0 __crtLCMapStringA_stat
-FUNC 336c 20 0 __crtLCMapStringA_stat
-FUNC 36f8 f 0 __crtLCMapStringA_stat
-FUNC 37e0 10 0 __crtLCMapStringA_stat
-FUNC 3c30 1 0 __crtLCMapStringA_stat
-FUNC 3f94 e 0 __crtLCMapStringA_stat
-FUNC 4300 14 0 __crtLCMapStringA_stat
-FUNC 4338 11 0 __crtLCMapStringA_stat
-FUNC 497c 16 0 __crtLCMapStringA_stat
-FUNC 4b10 15 0 __crtLCMapStringA_stat
-FUNC 4c70 14 0 __crtLCMapStringA_stat
-FUNC 4ce8 10 0 __crtLCMapStringA_stat
-FUNC 4db4 1e 0 __crtLCMapStringA_stat
-FUNC 4e68 12 0 __crtLCMapStringA_stat
-FUNC 54e8 3 0 __crtLCMapStringA_stat
-FUNC 5574 14 0 __crtLCMapStringA_stat
-FUNC 55d0 2 0 __crtLCMapStringA_stat
-FUNC 55f8 8 0 __crtLCMapStringA_stat
-FUNC 5628 8 0 __crtLCMapStringA_stat
-FUNC 578c 3 0 __crtLCMapStringA_stat
-FUNC 5838 24 0 __crtLCMapStringA_stat
-FUNC 58f4 c 0 __crtLCMapStringA_stat
-FUNC 5f44 7 0 __crtLCMapStringA_stat
-FUNC 61fc f 0 __crtLCMapStringA_stat
-FUNC 6328 14 0 __crtLCMapStringA_stat
-FUNC 63a0 c 0 __crtLCMapStringA_stat
-FUNC 6404 6 0 __crtLCMapStringA_stat
-FUNC 65e8 28 0 __crtLCMapStringA_stat
-FUNC 6624 10 0 __crtLCMapStringA_stat
-FUNC 6ad4 16 0 __crtLCMapStringA_stat
-FUNC 6d80 e 0 __crtLCMapStringA_stat
-FUNC 6eb4 3 0 __crtLCMapStringA_stat
-FUNC 6f10 f 0 __crtLCMapStringA_stat
+FUNC 1000 7 0 static int __crtLCMapStringA_stat(struct localeinfo_struct *, unsigned long, unsigned long, const char *, int, char *, int, int, int)
+FUNC 11b0 14 0 static int __crtLCMapStringA_stat(struct localeinfo_struct *, unsigned long, unsigned long, const char *, int, char *, int, int, int)
+FUNC 17c4 8 0 static int __crtLCMapStringA_stat(struct localeinfo_struct *, unsigned long, unsigned long, const char *, int, char *, int, int, int)
+FUNC 1ac4 6 0 static int __crtLCMapStringA_stat(struct localeinfo_struct *, unsigned long, unsigned long, const char *, int, char *, int, int, int)
+FUNC 21f4 c 0 static int __crtLCMapStringA_stat(struct localeinfo_struct *, unsigned long, unsigned long, const char *, int, char *, int, int, int)
+FUNC 2234 9 0 static int __crtLCMapStringA_stat(struct localeinfo_struct *, unsigned long, unsigned long, const char *, int, char *, int, int, int)
+FUNC 2354 f 0 static int __crtLCMapStringA_stat(struct localeinfo_struct *, unsigned long, unsigned long, const char *, int, char *, int, int, int)
+FUNC 242c 12 0 static int __crtLCMapStringA_stat(struct localeinfo_struct *, unsigned long, unsigned long, const char *, int, char *, int, int, int)
+FUNC 2710 3 0 static int __crtLCMapStringA_stat(struct localeinfo_struct *, unsigned long, unsigned long, const char *, int, char *, int, int, int)
+FUNC 2794 b 0 static int __crtLCMapStringA_stat(struct localeinfo_struct *, unsigned long, unsigned long, const char *, int, char *, int, int, int)
+FUNC 28d0 13 0 static int __crtLCMapStringA_stat(struct localeinfo_struct *, unsigned long, unsigned long, const char *, int, char *, int, int, int)
+FUNC 31f8 5 0 static int __crtLCMapStringA_stat(struct localeinfo_struct *, unsigned long, unsigned long, const char *, int, char *, int, int, int)
+FUNC 327c 14 0 static int __crtLCMapStringA_stat(struct localeinfo_struct *, unsigned long, unsigned long, const char *, int, char *, int, int, int)
+FUNC 32c0 4a 0 static int __crtLCMapStringA_stat(struct localeinfo_struct *, unsigned long, unsigned long, const char *, int, char *, int, int, int)
+FUNC 336c 20 0 static int __crtLCMapStringA_stat(struct localeinfo_struct *, unsigned long, unsigned long, const char *, int, char *, int, int, int)
+FUNC 36f8 f 0 static int __crtLCMapStringA_stat(struct localeinfo_struct *, unsigned long, unsigned long, const char *, int, char *, int, int, int)
+FUNC 37e0 10 0 static int __crtLCMapStringA_stat(struct localeinfo_struct *, unsigned long, unsigned long, const char *, int, char *, int, int, int)
+FUNC 3c30 1 0 static int __crtLCMapStringA_stat(struct localeinfo_struct *, unsigned long, unsigned long, const char *, int, char *, int, int, int)
+FUNC 3f94 e 0 static int __crtLCMapStringA_stat(struct localeinfo_struct *, unsigned long, unsigned long, const char *, int, char *, int, int, int)
+FUNC 4300 14 0 static int __crtLCMapStringA_stat(struct localeinfo_struct *, unsigned long, unsigned long, const char *, int, char *, int, int, int)
+FUNC 4338 11 0 static int __crtLCMapStringA_stat(struct localeinfo_struct *, unsigned long, unsigned long, const char *, int, char *, int, int, int)
+FUNC 497c 16 0 static int __crtLCMapStringA_stat(struct localeinfo_struct *, unsigned long, unsigned long, const char *, int, char *, int, int, int)
+FUNC 4b10 15 0 static int __crtLCMapStringA_stat(struct localeinfo_struct *, unsigned long, unsigned long, const char *, int, char *, int, int, int)
+FUNC 4c70 14 0 static int __crtLCMapStringA_stat(struct localeinfo_struct *, unsigned long, unsigned long, const char *, int, char *, int, int, int)
+FUNC 4ce8 10 0 static int __crtLCMapStringA_stat(struct localeinfo_struct *, unsigned long, unsigned long, const char *, int, char *, int, int, int)
+FUNC 4db4 1e 0 static int __crtLCMapStringA_stat(struct localeinfo_struct *, unsigned long, unsigned long, const char *, int, char *, int, int, int)
+FUNC 4e68 12 0 static int __crtLCMapStringA_stat(struct localeinfo_struct *, unsigned long, unsigned long, const char *, int, char *, int, int, int)
+FUNC 54e8 3 0 static int __crtLCMapStringA_stat(struct localeinfo_struct *, unsigned long, unsigned long, const char *, int, char *, int, int, int)
+FUNC 5574 14 0 static int __crtLCMapStringA_stat(struct localeinfo_struct *, unsigned long, unsigned long, const char *, int, char *, int, int, int)
+FUNC 55d0 2 0 static int __crtLCMapStringA_stat(struct localeinfo_struct *, unsigned long, unsigned long, const char *, int, char *, int, int, int)
+FUNC 55f8 8 0 static int __crtLCMapStringA_stat(struct localeinfo_struct *, unsigned long, unsigned long, const char *, int, char *, int, int, int)
+FUNC 5628 8 0 static int __crtLCMapStringA_stat(struct localeinfo_struct *, unsigned long, unsigned long, const char *, int, char *, int, int, int)
+FUNC 578c 3 0 static int __crtLCMapStringA_stat(struct localeinfo_struct *, unsigned long, unsigned long, const char *, int, char *, int, int, int)
+FUNC 5838 24 0 static int __crtLCMapStringA_stat(struct localeinfo_struct *, unsigned long, unsigned long, const char *, int, char *, int, int, int)
+FUNC 58f4 c 0 static int __crtLCMapStringA_stat(struct localeinfo_struct *, unsigned long, unsigned long, const char *, int, char *, int, int, int)
+FUNC 5f44 7 0 static int __crtLCMapStringA_stat(struct localeinfo_struct *, unsigned long, unsigned long, const char *, int, char *, int, int, int)
+FUNC 61fc f 0 static int __crtLCMapStringA_stat(struct localeinfo_struct *, unsigned long, unsigned long, const char *, int, char *, int, int, int)
+FUNC 6328 14 0 static int __crtLCMapStringA_stat(struct localeinfo_struct *, unsigned long, unsigned long, const char *, int, char *, int, int, int)
+FUNC 63a0 c 0 static int __crtLCMapStringA_stat(struct localeinfo_struct *, unsigned long, unsigned long, const char *, int, char *, int, int, int)
+FUNC 6404 6 0 static int __crtLCMapStringA_stat(struct localeinfo_struct *, unsigned long, unsigned long, const char *, int, char *, int, int, int)
+FUNC 65e8 28 0 static int __crtLCMapStringA_stat(struct localeinfo_struct *, unsigned long, unsigned long, const char *, int, char *, int, int, int)
+FUNC 6624 10 0 static int __crtLCMapStringA_stat(struct localeinfo_struct *, unsigned long, unsigned long, const char *, int, char *, int, int, int)
+FUNC 6ad4 16 0 static int __crtLCMapStringA_stat(struct localeinfo_struct *, unsigned long, unsigned long, const char *, int, char *, int, int, int)
+FUNC 6d80 e 0 static int __crtLCMapStringA_stat(struct localeinfo_struct *, unsigned long, unsigned long, const char *, int, char *, int, int, int)
+FUNC 6eb4 3 0 static int __crtLCMapStringA_stat(struct localeinfo_struct *, unsigned long, unsigned long, const char *, int, char *, int, int, int)
+FUNC 6f10 f 0 static int __crtLCMapStringA_stat(struct localeinfo_struct *, unsigned long, unsigned long, const char *, int, char *, int, int, int)
65e8 12 96 3447
65fa 16 101 3447
2354 f 102 3447
@@ -3308,24 +3307,24 @@ FUNC 610c 47 0 __crtLCMapStringA
3c24 7 271 3447
611f 34 271 3447
3204 2 272 3447
-FUNC 1198 3 0 __crtGetStringTypeA_stat
-FUNC 17b4 e 0 __crtGetStringTypeA_stat
-FUNC 19ac 2 0 __crtGetStringTypeA_stat
-FUNC 24a4 14 0 __crtGetStringTypeA_stat
-FUNC 3318 33 0 __crtGetStringTypeA_stat
-FUNC 357c 2b 0 __crtGetStringTypeA_stat
-FUNC 43c4 b 0 __crtGetStringTypeA_stat
-FUNC 4624 14 0 __crtGetStringTypeA_stat
-FUNC 4d9c 11 0 __crtGetStringTypeA_stat
-FUNC 5094 a 0 __crtGetStringTypeA_stat
-FUNC 5b4c 12 0 __crtGetStringTypeA_stat
-FUNC 5efc c 0 __crtGetStringTypeA_stat
-FUNC 5f38 6 0 __crtGetStringTypeA_stat
-FUNC 6420 c 0 __crtGetStringTypeA_stat
-FUNC 68c0 14 0 __crtGetStringTypeA_stat
-FUNC 6910 12 0 __crtGetStringTypeA_stat
-FUNC 6bf0 28 0 __crtGetStringTypeA_stat
-FUNC 6c20 8 0 __crtGetStringTypeA_stat
+FUNC 1198 3 0 static int __crtGetStringTypeA_stat(struct localeinfo_struct *, unsigned long, const char *, int, unsigned short *, int, int, int)
+FUNC 17b4 e 0 static int __crtGetStringTypeA_stat(struct localeinfo_struct *, unsigned long, const char *, int, unsigned short *, int, int, int)
+FUNC 19ac 2 0 static int __crtGetStringTypeA_stat(struct localeinfo_struct *, unsigned long, const char *, int, unsigned short *, int, int, int)
+FUNC 24a4 14 0 static int __crtGetStringTypeA_stat(struct localeinfo_struct *, unsigned long, const char *, int, unsigned short *, int, int, int)
+FUNC 3318 33 0 static int __crtGetStringTypeA_stat(struct localeinfo_struct *, unsigned long, const char *, int, unsigned short *, int, int, int)
+FUNC 357c 2b 0 static int __crtGetStringTypeA_stat(struct localeinfo_struct *, unsigned long, const char *, int, unsigned short *, int, int, int)
+FUNC 43c4 b 0 static int __crtGetStringTypeA_stat(struct localeinfo_struct *, unsigned long, const char *, int, unsigned short *, int, int, int)
+FUNC 4624 14 0 static int __crtGetStringTypeA_stat(struct localeinfo_struct *, unsigned long, const char *, int, unsigned short *, int, int, int)
+FUNC 4d9c 11 0 static int __crtGetStringTypeA_stat(struct localeinfo_struct *, unsigned long, const char *, int, unsigned short *, int, int, int)
+FUNC 5094 a 0 static int __crtGetStringTypeA_stat(struct localeinfo_struct *, unsigned long, const char *, int, unsigned short *, int, int, int)
+FUNC 5b4c 12 0 static int __crtGetStringTypeA_stat(struct localeinfo_struct *, unsigned long, const char *, int, unsigned short *, int, int, int)
+FUNC 5efc c 0 static int __crtGetStringTypeA_stat(struct localeinfo_struct *, unsigned long, const char *, int, unsigned short *, int, int, int)
+FUNC 5f38 6 0 static int __crtGetStringTypeA_stat(struct localeinfo_struct *, unsigned long, const char *, int, unsigned short *, int, int, int)
+FUNC 6420 c 0 static int __crtGetStringTypeA_stat(struct localeinfo_struct *, unsigned long, const char *, int, unsigned short *, int, int, int)
+FUNC 68c0 14 0 static int __crtGetStringTypeA_stat(struct localeinfo_struct *, unsigned long, const char *, int, unsigned short *, int, int, int)
+FUNC 6910 12 0 static int __crtGetStringTypeA_stat(struct localeinfo_struct *, unsigned long, const char *, int, unsigned short *, int, int, int)
+FUNC 6bf0 28 0 static int __crtGetStringTypeA_stat(struct localeinfo_struct *, unsigned long, const char *, int, unsigned short *, int, int, int)
+FUNC 6c20 8 0 static int __crtGetStringTypeA_stat(struct localeinfo_struct *, unsigned long, const char *, int, unsigned short *, int, int, int)
6bf0 12 63 3507
6c02 7 67 3507
6c09 f 83 3507
diff --git a/src/tools/windows/dump_syms/testdata/omap_reorder_funcs.sym b/src/tools/windows/dump_syms/testdata/omap_reorder_funcs.sym
index 78da3930..cae41484 100644
--- a/src/tools/windows/dump_syms/testdata/omap_reorder_funcs.sym
+++ b/src/tools/windows/dump_syms/testdata/omap_reorder_funcs.sym
@@ -290,7 +290,7 @@ FUNC 41e2 54 0 main
4211 f 62 1
4220 12 64 1
4232 4 65 1
-FUNC 4242 a 0 google_breakpad::i
+FUNC 4242 a 0 static int google_breakpad::i()
4242 3 51 1
4245 5 52 1
424a 2 53 1
@@ -316,14 +316,14 @@ FUNC 2307 b 0 operator delete(void *)
2307 5 20 2875
230c 1 24 2875
230d 5 23 2875
-FUNC 3238 29 0 fast_error_exit
+FUNC 3238 29 0 static void fast_error_exit(int)
3238 5 326 4250
323d 9 335 4250
3246 5 337 4250
324b 8 339 4250
3253 c 340 4250
325f 2 341 4250
-FUNC 32ed 161 0 __tmainCRTStartup
+FUNC 32ed 161 0 static int __tmainCRTStartup()
32ed c 196 4250
32f9 a 214 4250
3303 b 216 4250
@@ -505,7 +505,7 @@ FUNC 147f 97 0 _cinit
1506 c 303 4186
1512 2 307 4186
1514 2 308 4186
-FUNC 4504 140 0 doexit
+FUNC 4504 140 0 static void doexit(int, int, int)
4504 c 489 4186
4510 8 507 4186
4518 4 508 4186
@@ -675,7 +675,7 @@ FUNC 255c dc 0 _setenvp
261f 7 130 3838
2626 5 131 3838
262b d 133 3838
-FUNC 54b7 19a 0 parse_cmdline
+FUNC 54b7 19a 0 static void parse_cmdline(char *, char * *, char *, int *, int *)
54b7 6 221 3891
54bd 9 229 3891
54c6 2 232 3891
@@ -1194,7 +1194,7 @@ FUNC 2312 94 0 malloc
23a1 3 113 504
23a4 2 122 504
FUNC 43b2 90 0 _local_unwind4
-FUNC 4442 46 0 _unwind_handler4
+FUNC 4442 46 0 static void _unwind_handler4()
FUNC 4488 1c 4 _seh_longjmp_unwind4
FUNC 44a4 17 0 _EH4_CallFilterFunc
FUNC 44bb 19 0 _EH4_TransferToHandler
@@ -1242,7 +1242,7 @@ FUNC 215a 1e 0 _initp_misc_winsig
216c 5 60 2311
2171 5 61 2311
2176 2 62 2311
-FUNC 24f8 37 0 siglookup
+FUNC 24f8 37 0 static struct _XCPT_ACTION * siglookup(int, struct _XCPT_ACTION *)
24f8 5 629 2311
24fd a 630 2311
2507 14 639 2311
@@ -1328,7 +1328,7 @@ FUNC 4644 28 0 _callnewh
4666 2 139 2820
4668 2 136 2820
466a 2 139 2820
-FUNC 4c24 b6 0 _onexit_nolock
+FUNC 4c24 b6 0 static * _onexit_nolock( *)
4c24 8 100 1969
4c2c f 103 1969
4c3b f 104 1969
@@ -1535,7 +1535,7 @@ FUNC 4e39 4e 0 _realloc_crt
4e7c 5 79 333
4e81 4 82 333
4e85 2 83 333
-FUNC 2bc5 2f 0 CPtoLCID
+FUNC 2bc5 2f 0 static int CPtoLCID(int)
2bc5 0 329 3326
2bc5 14 330 3326
2bd9 2 345 3326
@@ -1548,7 +1548,7 @@ FUNC 2bc5 2f 0 CPtoLCID
2bed 1 346 3326
2bee 5 333 3326
2bf3 1 346 3326
-FUNC 1f3c 64 0 setSBCS
+FUNC 1f3c 64 0 static void setSBCS(struct threadmbcinfostruct *)
1f3c 6 363 3326
1f42 11 368 3326
1f53 1b 379 3326
@@ -1557,7 +1557,7 @@ FUNC 1f3c 64 0 setSBCS
1f89 b 384 3326
1f94 9 385 3326
1f9d 3 386 3326
-FUNC 466c 190 0 setSBUpLow
+FUNC 466c 190 0 static void setSBUpLow(struct threadmbcinfostruct *)
466c 17 402 3326
4683 10 412 3326
4693 f 415 3326
@@ -1623,7 +1623,7 @@ FUNC 48f9 87 0 _LocaleUpdate::_LocaleUpdate(localeinfo_struct *)
496d 2 255 111
496f a 257 111
4979 7 259 111
-FUNC 10e5 7c 0 getSystemCP
+FUNC 10e5 7c 0 static int getSystemCP(int)
10e5 9 282 3326
10ee b 284 3326
10f9 6 285 3326
@@ -1734,7 +1734,7 @@ FUNC 1cd3 1e 0 __initmbctable
1ce4 a 853 3326
1cee 2 858 3326
1cf0 1 859 3326
-FUNC 2638 53 0 x_ismbbtype_l
+FUNC 2638 53 0 static int x_ismbbtype_l(struct localeinfo_struct *, unsigned int, int, int)
2638 8 213 3271
2640 b 214 3271
264b 4 219 3271
@@ -1953,12 +1953,12 @@ FUNC 1223 95 0 _aulldvrm
12b4 1 180 2806
12b5 3 182 2806
FUNC 28d7 20 0 _global_unwind2
-FUNC 28f7 45 0 __unwind_handler
+FUNC 28f7 45 0 static void __unwind_handler()
FUNC 293c 84 0 _local_unwind2
FUNC 29c0 23 0 _abnormal_termination
FUNC 29e3 9 0 _NLG_Notify1
FUNC 29ec 1f 0 _NLG_Notify
-PUBLIC 2a03 0 _NLG_Dispatch2
+PUBLIC m 2a03 0 _NLG_Dispatch
FUNC 2a0b 3 0 _NLG_Call
PUBLIC 2a0d 0 _NLG_Return2
FUNC 2862 33 0 abort
@@ -2301,7 +2301,7 @@ FUNC 5067 ad 0 realloc
50f8 2 112 618
50fa 16 103 618
5110 4 105 618
-FUNC 1904 1e7 0 __crtLCMapStringA_stat
+FUNC 1904 1e7 0 static int __crtLCMapStringA_stat(struct localeinfo_struct *, unsigned long, unsigned long, const char *, int, char *, int, int, int)
1904 12 96 3447
1916 c 101 3447
1922 17 102 3447
@@ -2338,7 +2338,7 @@ FUNC 22a3 46 0 __crtLCMapStringA
22ab b 259 3447
22b6 31 271 3447
22e7 2 272 3447
-FUNC 47fc e7 0 __crtGetStringTypeA_stat
+FUNC 47fc e7 0 static int __crtGetStringTypeA_stat(struct localeinfo_struct *, unsigned long, const char *, int, unsigned short *, int, int, int)
47fc 12 63 3507
480e 7 67 3507
4815 5 83 3507
diff --git a/src/tools/windows/dump_syms/testdata/omap_stretched.sym b/src/tools/windows/dump_syms/testdata/omap_stretched.sym
index ea858544..a48ddb64 100644
--- a/src/tools/windows/dump_syms/testdata/omap_stretched.sym
+++ b/src/tools/windows/dump_syms/testdata/omap_stretched.sym
@@ -290,7 +290,7 @@ FUNC 1000 54 0 main
102f f 62 1
103e 12 64 1
1050 4 65 1
-FUNC 1060 a 0 google_breakpad::i
+FUNC 1060 a 0 static int google_breakpad::i()
1060 3 51 1
1063 5 52 1
1068 2 53 1
@@ -320,14 +320,14 @@ FUNC 1197 b 0 operator delete(void *)
1197 5 20 2875
119c 1 24 2875
119d 5 23 2875
-FUNC 11a2 29 0 fast_error_exit
+FUNC 11a2 29 0 static void fast_error_exit(int)
11a2 5 326 4250
11a7 9 335 4250
11b0 5 337 4250
11b5 8 339 4250
11bd c 340 4250
11c9 2 341 4250
-FUNC 11cb 161 0 __tmainCRTStartup
+FUNC 11cb 161 0 static int __tmainCRTStartup()
11cb c 196 4250
11d7 a 214 4250
11e1 b 216 4250
@@ -511,7 +511,7 @@ FUNC 15a0 a1 0 _cinit
1631 c 303 4186
163d 2 307 4186
163f 2 308 4186
-FUNC 1641 140 0 doexit
+FUNC 1641 140 0 static void doexit(int, int, int)
1641 c 489 4186
164d 8 507 4186
1655 4 508 4186
@@ -684,9 +684,9 @@ FUNC 1c5e dc 0 _setenvp
1d21 7 130 3838
1d28 5 131 3838
1d2d d 133 3838
-FUNC 1d3a 2ee 0 parse_cmdline
-FUNC 2032 3 0 parse_cmdline
-FUNC 203f 4 0 parse_cmdline
+FUNC 1d3a 2ee 0 static void parse_cmdline(char *, char * *, char *, int *, int *)
+FUNC 2032 3 0 static void parse_cmdline(char *, char * *, char *, int *, int *)
+FUNC 203f 4 0 static void parse_cmdline(char *, char * *, char *, int *, int *)
1d3a 6 221 3891
1d40 7 229 3891
1d51 2 229 3891
@@ -1237,7 +1237,7 @@ FUNC 330c b6 0 malloc
33bd 3 113 504
33c0 2 122 504
FUNC 33c2 90 0 _local_unwind4
-FUNC 3452 46 0 _unwind_handler4
+FUNC 3452 46 0 static void _unwind_handler4()
FUNC 3498 1c 4 _seh_longjmp_unwind4
FUNC 34b4 17 0 _EH4_CallFilterFunc
FUNC 34cb 19 0 _EH4_TransferToHandler
@@ -1285,8 +1285,8 @@ FUNC 35b3 1e 0 _initp_misc_winsig
35c5 5 60 2311
35ca 5 61 2311
35cf 2 62 2311
-FUNC 35d1 38 0 siglookup
-FUNC 3613 9 0 siglookup
+FUNC 35d1 38 0 static struct _XCPT_ACTION * siglookup(int, struct _XCPT_ACTION *)
+FUNC 3613 9 0 static struct _XCPT_ACTION * siglookup(int, struct _XCPT_ACTION *)
35d1 5 629 2311
35d6 a 630 2311
35ea 14 639 2311
@@ -1373,7 +1373,7 @@ FUNC 37f9 28 0 _callnewh
381b 2 139 2820
381d 2 136 2820
381f 2 139 2820
-FUNC 3821 c0 0 _onexit_nolock
+FUNC 3821 c0 0 static * _onexit_nolock( *)
3821 8 100 1969
3829 f 103 1969
3838 f 104 1969
@@ -1599,7 +1599,7 @@ FUNC 4038 4e 0 _realloc_crt
407b 5 79 333
4080 4 82 333
4084 2 83 333
-FUNC 4086 2f 0 CPtoLCID
+FUNC 4086 2f 0 static int CPtoLCID(int)
4086 0 329 3326
4086 14 330 3326
409a 2 345 3326
@@ -1612,8 +1612,8 @@ FUNC 4086 2f 0 CPtoLCID
40ae 1 346 3326
40af 5 333 3326
40b4 1 346 3326
-FUNC 40b5 ab 0 setSBCS
-FUNC 416a 9 0 setSBCS
+FUNC 40b5 ab 0 static void setSBCS(struct threadmbcinfostruct *)
+FUNC 416a 9 0 static void setSBCS(struct threadmbcinfostruct *)
40b5 6 363 3326
40bb 11 368 3326
40cc 36 379 3326
@@ -1627,7 +1627,7 @@ FUNC 416a 9 0 setSBCS
415d 3 385 3326
416a 6 385 3326
4170 3 386 3326
-FUNC 4173 246 0 setSBUpLow
+FUNC 4173 246 0 static void setSBUpLow(struct threadmbcinfostruct *)
4173 17 402 3326
418a 7 412 3326
419b 9 412 3326
@@ -1706,8 +1706,8 @@ FUNC 445d 15d 0 _LocaleUpdate::_LocaleUpdate(localeinfo_struct *)
45a3 3 257 111
45b0 3 257 111
45b3 7 259 111
-FUNC 45ba 87 0 getSystemCP
-FUNC 464b 9 0 getSystemCP
+FUNC 45ba 87 0 static int getSystemCP(int)
+FUNC 464b 9 0 static int getSystemCP(int)
45ba 9 282 3326
45c3 b 284 3326
45ce 6 285 3326
@@ -1828,8 +1828,8 @@ FUNC 4ac0 1e 0 __initmbctable
4ad1 a 853 3326
4adb 2 858 3326
4add 1 859 3326
-FUNC 4ade 70 0 x_ismbbtype_l
-FUNC 4b58 6 0 x_ismbbtype_l
+FUNC 4ade 70 0 static int x_ismbbtype_l(struct localeinfo_struct *, unsigned int, int, int)
+FUNC 4b58 6 0 static int x_ismbbtype_l(struct localeinfo_struct *, unsigned int, int, int)
4ade 8 213 3271
4ae6 b 214 3271
4af1 4 219 3271
@@ -2062,12 +2062,12 @@ FUNC 5169 95 0 _aulldvrm
51fa 1 180 2806
51fb 3 182 2806
FUNC 51fe 20 0 _global_unwind2
-FUNC 521e 45 0 __unwind_handler
+FUNC 521e 45 0 static void __unwind_handler()
FUNC 5263 84 0 _local_unwind2
FUNC 52e7 23 0 _abnormal_termination
FUNC 530a 9 0 _NLG_Notify1
FUNC 5313 1f 0 _NLG_Notify
-PUBLIC 532a 0 _NLG_Dispatch2
+PUBLIC m 532a 0 _NLG_Dispatch
FUNC 5332 3 0 _NLG_Call
PUBLIC 5334 0 _NLG_Return2
FUNC 5335 33 0 abort
@@ -2416,7 +2416,7 @@ FUNC 59a4 6 0 realloc
5986 14 103 618
59a4 2 103 618
59a6 4 105 618
-FUNC 59aa 22d 0 __crtLCMapStringA_stat
+FUNC 59aa 22d 0 static int __crtLCMapStringA_stat(struct localeinfo_struct *, unsigned long, unsigned long, const char *, int, char *, int, int, int)
59aa 12 96 3447
59bc c 101 3447
59c8 21 102 3447
@@ -2457,7 +2457,7 @@ FUNC 5c21 6 0 __crtLCMapStringA
5bea 2d 271 3447
5c21 4 271 3447
5c25 2 272 3447
-FUNC 5c27 112 0 __crtGetStringTypeA_stat
+FUNC 5c27 112 0 static int __crtGetStringTypeA_stat(struct localeinfo_struct *, unsigned long, const char *, int, unsigned short *, int, int, int)
5c27 12 63 3507
5c39 7 67 3507
5c40 5 83 3507
diff --git a/src/tools/windows/dump_syms/testdata/omap_stretched_filled.sym b/src/tools/windows/dump_syms/testdata/omap_stretched_filled.sym
index 23a65eb4..410801e2 100644
--- a/src/tools/windows/dump_syms/testdata/omap_stretched_filled.sym
+++ b/src/tools/windows/dump_syms/testdata/omap_stretched_filled.sym
@@ -290,7 +290,7 @@ FUNC 1000 54 0 main
102f f 62 1
103e 12 64 1
1050 4 65 1
-FUNC 1060 a 0 google_breakpad::i
+FUNC 1060 a 0 static int google_breakpad::i()
1060 3 51 1
1063 5 52 1
1068 2 53 1
@@ -316,14 +316,14 @@ FUNC 1197 b 0 operator delete(void *)
1197 5 20 2875
119c 1 24 2875
119d 5 23 2875
-FUNC 11a2 29 0 fast_error_exit
+FUNC 11a2 29 0 static void fast_error_exit(int)
11a2 5 326 4250
11a7 9 335 4250
11b0 5 337 4250
11b5 8 339 4250
11bd c 340 4250
11c9 2 341 4250
-FUNC 11cb 161 0 __tmainCRTStartup
+FUNC 11cb 161 0 static int __tmainCRTStartup()
11cb c 196 4250
11d7 a 214 4250
11e1 b 216 4250
@@ -505,7 +505,7 @@ FUNC 15a0 a1 0 _cinit
1631 c 303 4186
163d 2 307 4186
163f 2 308 4186
-FUNC 1641 140 0 doexit
+FUNC 1641 140 0 static void doexit(int, int, int)
1641 c 489 4186
164d 8 507 4186
1655 4 508 4186
@@ -675,7 +675,7 @@ FUNC 1c5e dc 0 _setenvp
1d21 7 130 3838
1d28 5 131 3838
1d2d d 133 3838
-FUNC 1d3a 309 0 parse_cmdline
+FUNC 1d3a 309 0 static void parse_cmdline(char *, char * *, char *, int *, int *)
1d3a 6 221 3891
1d40 13 229 3891
1d53 2 232 3891
@@ -1194,7 +1194,7 @@ FUNC 330c b6 0 malloc
33bd 3 113 504
33c0 2 122 504
FUNC 33c2 90 0 _local_unwind4
-FUNC 3452 46 0 _unwind_handler4
+FUNC 3452 46 0 static void _unwind_handler4()
FUNC 3498 1c 4 _seh_longjmp_unwind4
FUNC 34b4 17 0 _EH4_CallFilterFunc
FUNC 34cb 19 0 _EH4_TransferToHandler
@@ -1242,7 +1242,7 @@ FUNC 35b3 1e 0 _initp_misc_winsig
35c5 5 60 2311
35ca 5 61 2311
35cf 2 62 2311
-FUNC 35d1 4b 0 siglookup
+FUNC 35d1 4b 0 static struct _XCPT_ACTION * siglookup(int, struct _XCPT_ACTION *)
35d1 5 629 2311
35d6 a 630 2311
35e0 1e 639 2311
@@ -1328,7 +1328,7 @@ FUNC 37f9 28 0 _callnewh
381b 2 139 2820
381d 2 136 2820
381f 2 139 2820
-FUNC 3821 c0 0 _onexit_nolock
+FUNC 3821 c0 0 static * _onexit_nolock( *)
3821 8 100 1969
3829 f 103 1969
3838 f 104 1969
@@ -1535,7 +1535,7 @@ FUNC 4038 4e 0 _realloc_crt
407b 5 79 333
4080 4 82 333
4084 2 83 333
-FUNC 4086 2f 0 CPtoLCID
+FUNC 4086 2f 0 static int CPtoLCID(int)
4086 0 329 3326
4086 14 330 3326
409a 2 345 3326
@@ -1548,7 +1548,7 @@ FUNC 4086 2f 0 CPtoLCID
40ae 1 346 3326
40af 5 333 3326
40b4 1 346 3326
-FUNC 40b5 be 0 setSBCS
+FUNC 40b5 be 0 static void setSBCS(struct threadmbcinfostruct *)
40b5 6 363 3326
40bb 11 368 3326
40cc 4b 379 3326
@@ -1557,7 +1557,7 @@ FUNC 40b5 be 0 setSBCS
4147 b 384 3326
4152 1e 385 3326
4170 3 386 3326
-FUNC 4173 246 0 setSBUpLow
+FUNC 4173 246 0 static void setSBUpLow(struct threadmbcinfostruct *)
4173 17 402 3326
418a 1a 412 3326
41a4 f 415 3326
@@ -1623,7 +1623,7 @@ FUNC 445d 15d 0 _LocaleUpdate::_LocaleUpdate(localeinfo_struct *)
457f 2 255 111
4581 32 257 111
45b3 7 259 111
-FUNC 45ba 9a 0 getSystemCP
+FUNC 45ba 9a 0 static int getSystemCP(int)
45ba 9 282 3326
45c3 b 284 3326
45ce 6 285 3326
@@ -1734,7 +1734,7 @@ FUNC 4ac0 1e 0 __initmbctable
4ad1 a 853 3326
4adb 2 858 3326
4add 1 859 3326
-FUNC 4ade 80 0 x_ismbbtype_l
+FUNC 4ade 80 0 static int x_ismbbtype_l(struct localeinfo_struct *, unsigned int, int, int)
4ade 8 213 3271
4ae6 b 214 3271
4af1 4 219 3271
@@ -1953,12 +1953,12 @@ FUNC 5169 95 0 _aulldvrm
51fa 1 180 2806
51fb 3 182 2806
FUNC 51fe 20 0 _global_unwind2
-FUNC 521e 45 0 __unwind_handler
+FUNC 521e 45 0 static void __unwind_handler()
FUNC 5263 84 0 _local_unwind2
FUNC 52e7 23 0 _abnormal_termination
FUNC 530a 9 0 _NLG_Notify1
FUNC 5313 1f 0 _NLG_Notify
-PUBLIC 532a 0 _NLG_Dispatch2
+PUBLIC m 532a 0 _NLG_Dispatch
FUNC 5332 3 0 _NLG_Call
PUBLIC 5334 0 _NLG_Return2
FUNC 5335 33 0 abort
@@ -2301,7 +2301,7 @@ FUNC 58df cb 0 realloc
5984 2 112 618
5986 20 103 618
59a6 4 105 618
-FUNC 59aa 22d 0 __crtLCMapStringA_stat
+FUNC 59aa 22d 0 static int __crtLCMapStringA_stat(struct localeinfo_struct *, unsigned long, unsigned long, const char *, int, char *, int, int, int)
59aa 12 96 3447
59bc c 101 3447
59c8 21 102 3447
@@ -2338,7 +2338,7 @@ FUNC 5bd7 50 0 __crtLCMapStringA
5bdf b 259 3447
5bea 3b 271 3447
5c25 2 272 3447
-FUNC 5c27 112 0 __crtGetStringTypeA_stat
+FUNC 5c27 112 0 static int __crtGetStringTypeA_stat(struct localeinfo_struct *, unsigned long, const char *, int, unsigned short *, int, int, int)
5c27 12 63 3507
5c39 7 67 3507
5c40 5 83 3507
diff --git a/src/tools/windows/dump_syms/testdata/pe_only_symbol_test.dll b/src/tools/windows/dump_syms/testdata/pe_only_symbol_test.dll
new file mode 100644
index 00000000..879af40b
--- /dev/null
+++ b/src/tools/windows/dump_syms/testdata/pe_only_symbol_test.dll
Binary files differ
diff --git a/src/tools/windows/dump_syms/testdata/pe_only_symbol_test.sym b/src/tools/windows/dump_syms/testdata/pe_only_symbol_test.sym
new file mode 100644
index 00000000..745aa4bb
--- /dev/null
+++ b/src/tools/windows/dump_syms/testdata/pe_only_symbol_test.sym
@@ -0,0 +1,214 @@
+MODULE windows x86_64 2A5EAB481FAB4A17A9761CDC14FE531A1 pe_only_symbol_test.pdb
+INFO CODE_ID 5C8AD05F12000 pe_only_symbol_test.dll
+STACK CFI INIT 1440 39 .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 1440 .cfa: $rsp 32 +
+STACK CFI INIT 1490 7f .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 1490 .cfa: $rsp 128 +
+STACK CFI INIT 1520 41 .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 1520 .cfa: $rsp 48 +
+STACK CFI INIT 1570 35 .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 1570 .cfa: $rsp 48 +
+STACK CFI INIT 15b0 3a .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 15b0 .cfa: $rsp 48 +
+STACK CFI INIT 1640 8 .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 1640 .cfa: $rsp 16 +
+STACK CFI INIT 1650 d .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 1650 .cfa: $rsp 16 +
+STACK CFI INIT 1660 b .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 1660 .cfa: $rsp 16 +
+STACK CFI INIT 1670 5a .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 1670 .cfa: $rsp 64 +
+STACK CFI INIT 16e0 97 .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 16e0 .cfa: $rsp 112 +
+STACK CFI INIT 17c0 3f .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 17c0 .cfa: $rsp 64 +
+STACK CFI INIT 1810 23 .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 1810 .cfa: $rsp 64 +
+STACK CFI INIT 1840 16 .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 1840 .cfa: $rsp 16 +
+STACK CFI INIT 1856 20 .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 1856 .cfa: $rsp 16 +
+STACK CFI INIT 1876 5 .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 1876 .cfa: $rsp 16 +
+STACK CFI INIT 1890 1b .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 1890 .cfa: $rsp 48 +
+STACK CFI INIT 18ab 56 .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 18ab .cfa: $rsp 48 +
+STACK CFI INIT 1901 10 .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 1901 .cfa: $rsp 48 +
+STACK CFI INIT 1940 7 .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 1940 .cfa: $rsp 64 +
+STACK CFI INIT 1947 1a .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 1947 .cfa: $rsp 64 +
+STACK CFI INIT 1961 b .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 1961 .cfa: $rsp 64 +
+STACK CFI INIT 196c 4c .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 196c .cfa: $rsp 64 +
+STACK CFI INIT 19b8 5 .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 19b8 .cfa: $rsp 64 +
+STACK CFI INIT 19bd 13 .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 19bd .cfa: $rsp 64 +
+STACK CFI INIT 19d0 73 .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 19d0 .cfa: $rsp 64 +
+STACK CFI INIT 1a90 3a .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 1a90 .cfa: $rsp 48 +
+STACK CFI INIT 1ae0 f8 .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 1ae0 .cfa: $rsp 96 +
+STACK CFI INIT 1c30 21 .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 1c30 .cfa: $rsp 8 +
+STACK CFI INIT 1c60 87 .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 1c60 .cfa: $rsp 64 +
+STACK CFI INIT 1d10 13a .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 1d10 .cfa: $rsp 80 +
+STACK CFI INIT 1ea0 88 .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 1ea0 .cfa: $rsp 64 +
+STACK CFI INIT 1f50 135 .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 1f50 .cfa: $rsp 80 +
+STACK CFI INIT 20e0 4d .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 20e0 .cfa: $rsp 64 +
+STACK CFI INIT 2140 2a .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 2140 .cfa: $rsp 48 +
+STACK CFI INIT 2180 36 .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 2180 .cfa: $rsp 48 +
+STACK CFI INIT 2290 36 .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 2290 .cfa: $rsp 96 +
+STACK CFI INIT 22e0 44 .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 22e0 .cfa: $rsp 96 +
+STACK CFI INIT 2340 5f .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 2340 .cfa: $rsp 544 +
+STACK CFI INIT 239f d9 .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 239f .cfa: $rsp 544 +
+STACK CFI INIT 2478 1d .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 2478 .cfa: $rsp 544 +
+STACK CFI INIT 2560 cf .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 2560 .cfa: $rsp 1088 +
+STACK CFI INIT 2670 2d .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 2670 .cfa: $rsp 80 +
+STACK CFI INIT 269d 6b .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 269d .cfa: $rsp 80 +
+STACK CFI INIT 2708 1a .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 2708 .cfa: $rsp 80 +
+STACK CFI INIT 2770 260 .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 2770 .cfa: $rsp 3824 +
+STACK CFI INIT 2a70 1f .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 2a70 .cfa: $rsp 48 +
+STACK CFI INIT 2aa0 c5 .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 2aa0 .cfa: $rsp 1088 +
+STACK CFI INIT 2ba0 64 .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 2ba0 .cfa: $rsp 64 +
+STACK CFI INIT 2c20 25 .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 2c20 .cfa: $rsp 64 +
+STACK CFI INIT 2c50 35 .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 2c50 .cfa: $rsp 48 +
+STACK CFI INIT 2ca0 d1 .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 2ca0 .cfa: $rsp 64 +
+STACK CFI INIT 2db0 13 .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 2db0 .cfa: $rsp 48 +
+STACK CFI INIT 2dd0 9b .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 2dd0 .cfa: $rsp 48 +
+STACK CFI INIT 2ea0 10e .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 2ea0 .cfa: $rsp 64 +
+STACK CFI INIT 3000 91 .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 3000 .cfa: $rsp 128 +
+STACK CFI INIT 30c0 b2 .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 30c0 .cfa: $rsp 128 +
+STACK CFI INIT 31a0 be .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 31a0 .cfa: $rsp 80 +
+STACK CFI INIT 3290 74 .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 3290 .cfa: $rsp 64 +
+STACK CFI INIT 3330 16 .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 3330 .cfa: $rsp 48 +
+STACK CFI INIT 3350 15 .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 3350 .cfa: $rsp 48 +
+STACK CFI INIT 3380 45 .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 3380 .cfa: $rsp 64 +
+STACK CFI INIT 33e0 3b .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 33e0 .cfa: $rsp 48 +
+STACK CFI INIT 3430 40 .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 3430 .cfa: $rsp 48 +
+STACK CFI INIT 34a0 15 .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 34a0 .cfa: $rsp 48 +
+STACK CFI INIT 34c0 c6 .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 34c0 .cfa: $rsp 64 +
+STACK CFI INIT 35c0 e .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 35c0 .cfa: $rsp 48 +
+STACK CFI INIT 35e0 8a .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 35e0 .cfa: $rsp 48 +
+STACK CFI INIT 36a0 62 .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 36a0 .cfa: $rsp 80 +
+STACK CFI INIT 3720 2d .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 3720 .cfa: $rsp 48 +
+STACK CFI INIT 3760 1d .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 3760 .cfa: $rsp 48 +
+STACK CFI INIT 3790 30 .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 3790 .cfa: $rsp 48 +
+STACK CFI INIT 37d0 15 .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 37d0 .cfa: $rsp 48 +
+STACK CFI INIT 37f0 5b .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 37f0 .cfa: $rsp 64 +
+STACK CFI INIT 3870 2e .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 3870 .cfa: $rsp 48 +
+STACK CFI INIT 38b0 15 .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 38b0 .cfa: $rsp 48 +
+STACK CFI INIT 38d0 49 .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 38d0 .cfa: $rsp 48 +
+STACK CFI INIT 3930 10c .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 3930 .cfa: $rsp 128 +
+STACK CFI INIT 3a80 8b .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 3a80 .cfa: $rsp 96 +
+STACK CFI INIT 3b30 2f .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 3b30 .cfa: $rsp 48 +
+STACK CFI INIT 3b70 3f .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 3b70 .cfa: $rsp 48 +
+STACK CFI INIT 3bc0 82 .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 3bc0 .cfa: $rsp 80 +
+STACK CFI INIT 3c70 50 .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 3c70 .cfa: $rsp 64 +
+STACK CFI INIT 3ce0 33 .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 3ce0 .cfa: $rsp 64 +
+STACK CFI INIT 3d50 191 .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 3d50 .cfa: $rsp 1536 +
+STACK CFI INIT 3f50 51 .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 3f50 .cfa: $rsp 176 +
+STACK CFI INIT 3fc0 e .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 3fc0 .cfa: $rsp 48 +
+STACK CFI INIT 3ff0 a6 .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 3ff0 .cfa: $rsp 64 +
+STACK CFI INIT 40c0 16 .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 40c0 .cfa: $rsp 48 +
+STACK CFI INIT 40f0 72 .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 40f0 .cfa: $rsp 64 +
+STACK CFI INIT 4180 42 .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 4180 .cfa: $rsp 48 +
+STACK CFI INIT 41e0 42 .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 41e0 .cfa: $rsp 48 +
+STACK CFI INIT 4250 1e .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 4250 .cfa: $rsp 32 +
+STACK CFI INIT 4280 18 .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 4280 .cfa: $rsp 48 +
+STACK CFI INIT 42a0 37 .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 42a0 .cfa: $rsp 64 +
+STACK CFI INIT 4300 145 .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 4300 .cfa: $rsp 1120 +
+STACK CFI INIT 44a0 2ae .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 44a0 .cfa: $rsp 640 +
+STACK CFI INIT 4800 103 .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 4800 .cfa: $rsp 1664 +
+STACK CFI INIT 4950 3c5 .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 4950 .cfa: $rsp 240 +
+STACK CFI INIT 4e10 36d .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 4e10 .cfa: $rsp 96 +
+STACK CFI INIT 5270 25 .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 5270 .cfa: $rsp 32 +
+STACK CFI INIT 66c0 2 .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 66c0 .cfa: $rsp 8 +
+STACK CFI INIT 76d0 1a .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 76d0 .cfa: $rsp 48 +
+STACK CFI INIT 76f0 20 .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 76f0 .cfa: $rsp 48 +
+STACK CFI INIT 7720 48 .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 7720 .cfa: $rsp 64 +
+STACK CFI INIT 7780 20 .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 7780 .cfa: $rsp 48 +
+STACK CFI INIT 77b0 3d .cfa: $rsp .ra: .cfa 8 - ^
+STACK CFI 77b0 .cfa: $rsp 48 +
diff --git a/src/tools/windows/refresh_binaries.bat b/src/tools/windows/refresh_binaries.bat
index d881ae64..bf18d507 100644
--- a/src/tools/windows/refresh_binaries.bat
+++ b/src/tools/windows/refresh_binaries.bat
@@ -11,17 +11,13 @@ REM README.binaries file to contain
REM the revision number, and builds the tools. You must run 'svn commit' to
REM commit the pending edits to the repository.
-pushd %~dp0\..\..\
-call svn update --accept postpone
-cd tools\windows
-devenv symupload\symupload.vcproj /rebuild Release
-copy symupload\Release\symupload.exe binaries\
-REM switch back to top level so that 'svn info' displays useful information.
-cd ..\..\
-echo This checkin of the binaries was created by refresh_binaries.bat. > %TEMP%\checkin.txt
-echo Date: %DATE% %TIME% >> %TEMP%\checkin.txt
-echo Repository information (output of 'svn info') follows: >> %TEMP%\checkin.txt
-call svn info >> %TEMP%\checkin.txt
+pushd %~dp0
+if %VisualStudioVersion% == 14.0 set GYP_MSVS_VERSION=2015
+gyp tools_windows.gyp
+msbuild tools_windows.sln /p:Configuration=Release /t:Clean,Build
+copy Release\symupload.exe binaries\
+copy Release\dump_syms.exe binaries\
+git add binaries
+git commit -m "Built Windows binaries"
echo Done!
-echo type 'svn commit -F %%TEMP%%\checkin.txt' to commit.
popd
diff --git a/src/tools/windows/symupload/symupload.cc b/src/tools/windows/symupload/symupload.cc
index df4bb693..7e302932 100644
--- a/src/tools/windows/symupload/symupload.cc
+++ b/src/tools/windows/symupload/symupload.cc
@@ -56,12 +56,17 @@
#include "common/windows/http_upload.h"
#include "common/windows/pdb_source_line_writer.h"
+#include "common/windows/symbol_collector_client.h"
using std::string;
using std::wstring;
using std::vector;
using std::map;
using google_breakpad::HTTPUpload;
+using google_breakpad::SymbolCollectorClient;
+using google_breakpad::SymbolStatus;
+using google_breakpad::UploadUrlResponse;
+using google_breakpad::CompleteUploadResult;
using google_breakpad::PDBModuleInfo;
using google_breakpad::PDBSourceLineWriter;
using google_breakpad::WindowsStringUtils;
@@ -142,7 +147,7 @@ static bool DumpSymbolsToTempFile(const wchar_t *file,
return false;
}
- bool success = writer.WriteMap(temp_file);
+ bool success = writer.WriteSymbols(temp_file);
fclose(temp_file);
if (!success) {
_wunlink(temp_filename);
@@ -154,6 +159,92 @@ static bool DumpSymbolsToTempFile(const wchar_t *file,
return writer.GetModuleInfo(pdb_info);
}
+static bool DoSymUploadV2(
+ const wchar_t* api_url,
+ const wchar_t* api_key,
+ const wstring& debug_file,
+ const wstring& debug_id,
+ const wstring& symbol_file,
+ bool force) {
+ wstring url(api_url);
+ wstring key(api_key);
+
+ if (!force) {
+ SymbolStatus symbolStatus = SymbolCollectorClient::CheckSymbolStatus(
+ url,
+ key,
+ debug_file,
+ debug_id);
+ if (symbolStatus == SymbolStatus::Found) {
+ wprintf(L"Symbol file already exists, upload aborted."
+ L" Use \"-f\" to overwrite.\n");
+ return true;
+ }
+ else if (symbolStatus == SymbolStatus::Unknown) {
+ wprintf(L"Failed to get check for existing symbol.\n");
+ return false;
+ }
+ }
+
+ UploadUrlResponse uploadUrlResponse;
+ if (!SymbolCollectorClient::CreateUploadUrl(
+ url,
+ key,
+ &uploadUrlResponse)) {
+ wprintf(L"Failed to create upload URL.\n");
+ return false;
+ }
+
+ wstring signed_url = uploadUrlResponse.upload_url;
+ wstring upload_key = uploadUrlResponse.upload_key;
+ wstring response;
+ int response_code;
+ bool success = HTTPUpload::SendPutRequest(
+ signed_url,
+ symbol_file,
+ /* timeout = */ NULL,
+ &response,
+ &response_code);
+ if (!success) {
+ wprintf(L"Failed to send symbol file.\n");
+ wprintf(L"Response code: %ld\n", response_code);
+ wprintf(L"Response:\n");
+ wprintf(L"%s\n", response.c_str());
+ return false;
+ }
+ else if (response_code == 0) {
+ wprintf(L"Failed to send symbol file: No response code\n");
+ return false;
+ }
+ else if (response_code != 200) {
+ wprintf(L"Failed to send symbol file: Response code %ld\n", response_code);
+ wprintf(L"Response:\n");
+ wprintf(L"%s\n", response.c_str());
+ return false;
+ }
+
+ CompleteUploadResult completeUploadResult =
+ SymbolCollectorClient::CompleteUpload(
+ url,
+ key,
+ upload_key,
+ debug_file,
+ debug_id);
+ if (completeUploadResult == CompleteUploadResult::Error) {
+ wprintf(L"Failed to complete upload.\n");
+ return false;
+ }
+ else if (completeUploadResult == CompleteUploadResult::DuplicateData) {
+ wprintf(L"Uploaded file checksum matched existing file checksum,"
+ L" no change necessary.\n");
+ }
+ else {
+ wprintf(L"Successfully sent the symbol file.\n");
+ }
+
+ return true;
+}
+
__declspec(noreturn) void printUsageAndExit() {
wprintf(L"Usage:\n\n"
L" symupload [--timeout NN] [--product product_name] ^\n"
@@ -166,13 +257,28 @@ __declspec(noreturn) void printUsageAndExit() {
wprintf(L"Example:\n\n"
L" symupload.exe --timeout 0 --product Chrome ^\n"
L" chrome.dll http://no.free.symbol.server.for.you\n");
+ wprintf(L"\n");
+ wprintf(L"sym-upload-v2 usage:\n"
+ L" symupload -p [-f] <file.exe|file.dll> <API-URL> <API-key>\n");
+ wprintf(L"\n");
+ wprintf(L"sym_upload_v2 Options:\n");
+ wprintf(L" <API-URL> is the sym_upload_v2 API URL.\n");
+ wprintf(L" <API-key> is a secret used to authenticate with the API.\n");
+ wprintf(L" -p:\t Use sym_upload_v2 protocol.\n");
+ wprintf(L" -f:\t Force symbol upload if already exists.\n");
+
exit(0);
}
+
int wmain(int argc, wchar_t *argv[]) {
const wchar_t *module;
const wchar_t *product = nullptr;
int timeout = -1;
int currentarg = 1;
+ bool use_sym_upload_v2 = false;
+ bool force = false;
+ const wchar_t* api_url = nullptr;
+ const wchar_t* api_key = nullptr;
while (argc > currentarg + 1) {
if (!wcscmp(L"--timeout", argv[currentarg])) {
timeout = _wtoi(argv[currentarg + 1]);
@@ -184,6 +290,16 @@ int wmain(int argc, wchar_t *argv[]) {
currentarg += 2;
continue;
}
+ if (!wcscmp(L"-p", argv[currentarg])) {
+ use_sym_upload_v2 = true;
+ ++currentarg;
+ continue;
+ }
+ if (!wcscmp(L"-f", argv[currentarg])) {
+ force = true;
+ ++currentarg;
+ continue;
+ }
break;
}
@@ -200,54 +316,75 @@ int wmain(int argc, wchar_t *argv[]) {
}
wstring code_file = WindowsStringUtils::GetBaseName(wstring(module));
-
- map<wstring, wstring> parameters;
- parameters[L"code_file"] = code_file;
- parameters[L"debug_file"] = pdb_info.debug_file;
- parameters[L"debug_identifier"] = pdb_info.debug_identifier;
- parameters[L"os"] = L"windows"; // This version of symupload is Windows-only
- parameters[L"cpu"] = pdb_info.cpu;
-
- // Don't make a missing product name a hard error. Issue a warning and let
- // the server decide whether to reject files without product name.
- if (product) {
- parameters[L"product"] = product;
- } else {
- fwprintf(
- stderr,
- L"Warning: No product name (flag --product) was specified for %s\n",
- module);
- }
-
+ wstring file_version;
// Don't make a missing version a hard error. Issue a warning, and let the
// server decide whether to reject files without versions.
- wstring file_version;
- if (GetFileVersionString(module, &file_version)) {
- parameters[L"version"] = file_version;
- } else {
+ if (!GetFileVersionString(module, &file_version)) {
fwprintf(stderr, L"Warning: Could not get file version for %s\n", module);
}
bool success = true;
- while (currentarg < argc) {
- int response_code;
- if (!HTTPUpload::SendRequest(argv[currentarg], parameters,
- symbol_file, L"symbol_file",
- timeout == -1 ? NULL : &timeout,
- nullptr, &response_code)) {
- success = false;
- fwprintf(stderr,
- L"Symbol file upload to %s failed. Response code = %ld\n",
- argv[currentarg], response_code);
+ if (use_sym_upload_v2) {
+ if (argc >= currentarg + 2) {
+ api_url = argv[currentarg++];
+ api_key = argv[currentarg++];
+
+ success = DoSymUploadV2(
+ api_url,
+ api_key,
+ pdb_info.debug_file,
+ pdb_info.debug_identifier,
+ symbol_file,
+ force);
+ } else {
+ printUsageAndExit();
+ }
+ } else {
+ map<wstring, wstring> parameters;
+ parameters[L"code_file"] = code_file;
+ parameters[L"debug_file"] = pdb_info.debug_file;
+ parameters[L"debug_identifier"] = pdb_info.debug_identifier;
+ parameters[L"os"] = L"windows"; // This version of symupload is Windows-only
+ parameters[L"cpu"] = pdb_info.cpu;
+
+ map<wstring, wstring> files;
+ files[L"symbol_file"] = symbol_file;
+
+ if (!file_version.empty()) {
+ parameters[L"version"] = file_version;
+ }
+
+ // Don't make a missing product name a hard error. Issue a warning and let
+ // the server decide whether to reject files without product name.
+ if (product) {
+ parameters[L"product"] = product;
+ }
+ else {
+ fwprintf(
+ stderr,
+ L"Warning: No product name (flag --product) was specified for %s\n",
+ module);
+ }
+
+ while (currentarg < argc) {
+ int response_code;
+ if (!HTTPUpload::SendMultipartPostRequest(argv[currentarg], parameters, files,
+ timeout == -1 ? NULL : &timeout,
+ nullptr, &response_code)) {
+ success = false;
+ fwprintf(stderr,
+ L"Symbol file upload to %s failed. Response code = %ld\n",
+ argv[currentarg], response_code);
+ }
+ currentarg++;
}
- currentarg++;
}
_wunlink(symbol_file.c_str());
if (success) {
- wprintf(L"Uploaded symbols for windows-%s/%s/%s (%s %s)\n",
+ wprintf(L"Uploaded breakpad symbols for windows-%s/%s/%s (%s %s)\n",
pdb_info.cpu.c_str(), pdb_info.debug_file.c_str(),
pdb_info.debug_identifier.c_str(), code_file.c_str(),
file_version.c_str());
diff --git a/src/tools/windows/symupload/symupload.gyp b/src/tools/windows/symupload/symupload.gyp
index d7e5fb7b..4567a4bd 100644
--- a/src/tools/windows/symupload/symupload.gyp
+++ b/src/tools/windows/symupload/symupload.gyp
@@ -40,6 +40,11 @@
'dependencies': [
'../../../common/windows/common_windows.gyp:common_windows_lib',
],
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'LargeAddressAware': '2',
+ },
+ },
},
],
}
diff --git a/src/testing/gtest/xcode/Samples/FrameworkSample/runtests.sh b/src/tools/windows/tools_windows.gyp
index 4a0d413e..17b88b4a 100644
--- a/src/testing/gtest/xcode/Samples/FrameworkSample/runtests.sh
+++ b/src/tools/windows/tools_windows.gyp
@@ -1,7 +1,4 @@
-#!/bin/bash
-#
-# Copyright 2008, Google Inc.
-# All rights reserved.
+# Copyright 2017 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
@@ -29,34 +26,21 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-# Executes the samples and tests for the Google Test Framework.
-
-# Help the dynamic linker find the path to the libraries.
-export DYLD_FRAMEWORK_PATH=$BUILT_PRODUCTS_DIR
-export DYLD_LIBRARY_PATH=$BUILT_PRODUCTS_DIR
-
-# Create some executables.
-test_executables=$@
-
-# Now execute each one in turn keeping track of how many succeeded and failed.
-succeeded=0
-failed=0
-failed_list=()
-for test in ${test_executables[*]}; do
- "$test"
- result=$?
- if [ $result -eq 0 ]; then
- succeeded=$(( $succeeded + 1 ))
- else
- failed=$(( failed + 1 ))
- failed_list="$failed_list $test"
- fi
-done
-# Report the successes and failures to the console.
-echo "Tests complete with $succeeded successes and $failed failures."
-if [ $failed -ne 0 ]; then
- echo "The following tests failed:"
- echo $failed_list
-fi
-exit $failed
+{
+ 'includes': [
+ '../../build/common.gypi',
+ ],
+ 'targets': [
+ {
+ 'target_name': 'build_all',
+ 'type': 'none',
+ 'dependencies': [
+ './converter/ms_symbol_server_converter.gyp:*',
+ './converter_exe/converter.gyp:*',
+ './dump_syms/dump_syms.gyp:*',
+ './symupload/symupload.gyp:*',
+ ],
+ },
+ ],
+}